diff --git a/src/Layers/APAC/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al b/src/Layers/APAC/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
index 17c007808f..dcb135e4e7 100644
--- a/src/Layers/APAC/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
+++ b/src/Layers/APAC/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
@@ -63,36 +63,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Salespeople")
{
ApplicationArea = Suite;
Caption = 'Salespeople/Purchasers';
RunObject = page "Salespersons/Purchasers";
+ Tooltip = 'Open the Salespeople/Purchasers page.';
}
action("Teams")
{
ApplicationArea = Basic, Suite;
Caption = 'Teams';
RunObject = page "Teams";
+ Tooltip = 'Open the Teams page.';
}
action("Tasks")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Opportunities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
group("Group1")
{
@@ -102,36 +108,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesBudget;
Caption = 'Sales Budgets';
RunObject = page "Budget Names Sales";
+ Tooltip = 'Open the Sales Budgets page.';
}
action("Sales Analysis Reports")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Reports';
RunObject = page "Analysis Report Sale";
+ Tooltip = 'Open the Sales Analysis Reports page.';
}
action("Sales Analysis by Dimensions")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Item Dimensions - Detail")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Detail';
RunObject = report "Item Dimensions - Detail";
+ Tooltip = 'Run the Item Dimensions - Detail report.';
}
action("Item Dimensions - Total")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Total';
RunObject = report "Item Dimensions - Total";
+ Tooltip = 'Run the Item Dimensions - Total report.';
}
action("Opportunities Matrix")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Analysis';
RunObject = page "Opportunities";
+ Tooltip = 'Open the Opportunity Analysis page.';
}
}
group("Group2")
@@ -142,6 +154,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Deferral Summary';
RunObject = report "Deferral Summary - Sales";
+ Tooltip = 'Run the Sales Deferral Summary report.';
}
group("Group3")
{
@@ -151,18 +164,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Tasks';
RunObject = report "Salesperson - Tasks";
+ Tooltip = 'Run the Salesperson Tasks report.';
}
action("Salesperson - Commission")
{
ApplicationArea = Suite;
Caption = 'Salesperson Commission';
RunObject = report "Salesperson - Commission";
+ Tooltip = 'Run the Salesperson Commission report.';
}
action("Salesperson - Opportunities")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Opportunities';
RunObject = report "Salesperson - Opportunities";
+ Tooltip = 'Run the Salesperson Opportunities report.';
}
#if not CLEAN28
action("Sales Statistics")
@@ -173,6 +189,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
#endif
action("Team - Tasks")
@@ -180,12 +197,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Team Tasks';
RunObject = report "Team - Tasks";
+ Tooltip = 'Run the Team Tasks report.';
}
action("Salesperson - Sales Statistics")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Sales Statistics';
RunObject = report "Salesperson - Sales Statistics";
+ Tooltip = 'Run the Salesperson Sales Statistics report.';
}
}
group("Group4")
@@ -196,36 +215,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Contact Labels';
RunObject = report "Contact - Labels";
+ Tooltip = 'Run the Contact Labels report.';
}
action("Contact - Company Summary")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact - Company Summary';
RunObject = report "Contact - Company Summary";
+ Tooltip = 'Run the Contact - Company Summary report.';
}
action("Questionnaire - Handouts")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire - Handouts';
RunObject = report "Questionnaire - Handouts";
+ Tooltip = 'Run the Questionnaire - Handouts report.';
}
action("Contact - List")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact List';
RunObject = report "Contact - List";
+ Tooltip = 'Run the Contact List report.';
}
action("Orgl. Profile Summary")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Person Summary';
RunObject = report "Contact - Person Summary";
+ Tooltip = 'Run the Contact - Person Summary report.';
}
action("Contact - Cover Sheet")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Cover Sheet';
RunObject = report "Contact - Cover Sheet";
+ Tooltip = 'Run the Contact - Cover Sheet report.';
}
}
group("Group5")
@@ -240,6 +265,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - List report.';
}
#endif
action("Customer - Labels")
@@ -247,36 +273,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Customer Labels';
RunObject = report "Customer - Labels";
+ Tooltip = 'Run the Customer Labels report.';
}
action("Customer - Balance to Date")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Balance to Date';
RunObject = report "Customer - Balance to Date";
+ Tooltip = 'Run the Customer - Balance to Date report.';
}
action("Customer - Order Summary")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Summary';
RunObject = report "Customer - Order Summary";
+ Tooltip = 'Run the Customer - Order Summary report.';
}
action("Customer/Item Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Item Sales';
RunObject = report "Customer/Item Sales";
+ Tooltip = 'Run the Customer/Item Sales report.';
}
action("Customer Register")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Register';
RunObject = report "Customer Register";
+ Tooltip = 'Run the Customer Register report.';
}
action("Customer - Order Detail")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Detail';
RunObject = report "Customer - Order Detail";
+ Tooltip = 'Run the Customer - Order Detail report.';
}
#if not CLEAN28
action("Customer - Top 10 List")
@@ -287,6 +319,7 @@ page 8907 "Sales & Marketing Manager RC"
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';
+ Tooltip = 'Run the Customer Top 10 List report.';
}
#endif
action("Customer - Trial Balance")
@@ -294,6 +327,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Trial Balance';
RunObject = report "Customer - Trial Balance";
+ Tooltip = 'Run the Customer Trial Balance report.';
}
#if not CLEAN28
action("Customer - Sales List")
@@ -304,6 +338,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
}
@@ -315,18 +350,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - List';
RunObject = report "Opportunity - List";
+ Tooltip = 'Run the Opportunity - List report.';
}
action("Opportunity - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - Details';
RunObject = report "Opportunity - Details";
+ Tooltip = 'Run the Opportunity - Details report.';
}
action("Sales Cycle - Analysis")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycle - Analysis';
RunObject = report "Sales Cycle - Analysis";
+ Tooltip = 'Run the Sales Cycle - Analysis report.';
}
}
}
@@ -339,60 +377,70 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts1")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Quotes")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quotes';
RunObject = page "Sales Quotes";
+ Tooltip = 'Open the Sales Quotes page.';
}
action("Orders")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Orders';
RunObject = page "Sales Order List";
+ Tooltip = 'Open the Sales Orders page.';
}
action("Blanket Orders")
{
ApplicationArea = Suite;
Caption = 'Blanket Sales Orders';
RunObject = page "Blanket Sales Orders";
+ Tooltip = 'Open the Blanket Sales Orders page.';
}
action("Return Orders")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Sales Return Orders';
RunObject = page "Sales Return Order List";
+ Tooltip = 'Open the Sales Return Orders page.';
}
action("Invoices")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Invoices';
RunObject = page "Sales Invoice List";
+ Tooltip = 'Open the Sales Invoices page.';
}
action("Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Credit Memos';
RunObject = page "Sales Credit Memos";
+ Tooltip = 'Open the Sales Credit Memos page.';
}
action("Certificates of Supply")
{
ApplicationArea = Basic, Suite;
Caption = 'Certificates of Supply';
RunObject = page "Certificates of Supply";
+ Tooltip = 'Open the Certificates of Supply page.';
}
action("Order Planning")
{
ApplicationArea = Planning;
Caption = 'Order Planning';
RunObject = page "Order Planning";
+ Tooltip = 'Open the Order Planning page.';
}
group("Group8")
{
@@ -402,24 +450,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Invoices';
RunObject = page "Posted Sales Invoices";
+ Tooltip = 'Open the Posted Sales Invoices page.';
}
action("Posted Sales Shipments")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Shipments';
RunObject = page "Posted Sales Shipments";
+ Tooltip = 'Open the Posted Sales Shipments page.';
}
action("Posted Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Credit Memos';
RunObject = page "Posted Sales Credit Memos";
+ Tooltip = 'Open the Posted Sales Credit Memos page.';
}
action("Posted Return Receipts")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Posted Return Receipts';
RunObject = page "Posted Return Receipts";
+ Tooltip = 'Open the Posted Return Receipts page.';
}
}
group("Group9")
@@ -430,48 +482,56 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'G/L Registers';
RunObject = page "G/L Registers";
+ Tooltip = 'Open the G/L Registers page.';
}
action("Item Tracing")
{
ApplicationArea = ItemTracking;
Caption = 'Item Tracing';
RunObject = page "Item Tracing";
+ Tooltip = 'Open the Item Tracing page.';
}
action("Sales Quote Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quote Archives';
RunObject = page "Sales Quote Archives";
+ Tooltip = 'Open the Sales Quote Archives page.';
}
action("Sales Order Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Order Archives';
RunObject = page "Sales Order Archives";
+ Tooltip = 'Open the Sales Order Archives page.';
}
action("Sales Return Order Archives")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Return Order Archives';
RunObject = page "Sales Return List Archive";
+ Tooltip = 'Open the Sales Return Order Archives page.';
}
action("Customer Ledger Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Ledger Entries';
RunObject = page "Customer Ledger Entries";
+ Tooltip = 'Open the Customer Ledger Entries page.';
}
action("Detailed Cust. Ledg. Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Detailed Customer Ledger Entries';
RunObject = page "Detailed Cust. Ledg. Entries";
+ Tooltip = 'Open the Detailed Customer Ledger Entries page.';
}
action("Value Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Value Entries';
RunObject = page "Value Entries";
+ Tooltip = 'Open the Value Entries page.';
}
action("Navigate")
{
@@ -491,6 +551,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Detail';
RunObject = report "Customer - Order Detail";
+ Tooltip = 'Run the Customer - Order Detail report.';
}
#if not CLEAN28
action("Sales Reservation Avail.")
@@ -501,6 +562,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Reservation Avail. report.';
}
#endif
#if not CLEAN28
@@ -512,6 +574,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
#endif
#if not CLEAN28
@@ -523,19 +586,23 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
+
action("Customer/Item Sales1")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Item Sales';
RunObject = report "Customer/Item Sales";
+ Tooltip = 'Run the Customer/Item Sales report.';
}
action("Customer - Order Summary1")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Summary';
RunObject = report "Customer - Order Summary";
+ Tooltip = 'Run the Customer - Order Summary report.';
}
}
}
@@ -547,42 +614,49 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Campaigns")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaigns';
RunObject = page "Campaign List";
+ Tooltip = 'Open the Campaigns page.';
}
action("Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Segments';
RunObject = page "Segment List";
+ Tooltip = 'Open the Segments page.';
}
action("Logged Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Logged Segments';
RunObject = page "Logged Segments";
+ Tooltip = 'Open the Logged Segments page.';
}
action("Opportunities1")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
action("Tasks1")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Campaign - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign - Details';
RunObject = report "Campaign - Details";
+ Tooltip = 'Run the Campaign - Details report.';
}
group("Group12")
{
@@ -592,18 +666,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Entries';
RunObject = page "Campaign Entries";
+ Tooltip = 'Open the Campaign Entries page.';
}
action("Opportunity Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Entries';
RunObject = page "Opportunity Entries";
+ Tooltip = 'Open the Opportunity Entries page.';
}
action("Interaction Log Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Log Entries';
RunObject = page "Interaction Log Entries";
+ Tooltip = 'Open the Interaction Log Entries page.';
}
}
}
@@ -615,18 +692,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Items';
RunObject = page "Item List";
+ Tooltip = 'Open the Items page.';
}
action("Nonstock Items")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Items';
RunObject = page "Catalog Item List";
+ Tooltip = 'Open the Nonstock Items page.';
}
action("Item Attributes")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Attributes';
RunObject = page "Item Attributes";
+ Tooltip = 'Open the Item Attributes page.';
}
action("Sales Price Worksheet")
{
@@ -640,6 +720,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Adjust Item Costs/Prices';
RunObject = report "Adjust Item Costs/Prices";
+ Tooltip = 'Run the Adjust Item Costs/Prices report.';
}
group("Group14")
{
@@ -649,42 +730,49 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Inventory Sales Statistics';
RunObject = report "Inventory - Sales Statistics";
+ Tooltip = 'Run the Inventory Sales Statistics report.';
}
action("Inventory Cost and Price List")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Cost and Price List';
RunObject = report "Inventory Cost and Price List";
+ Tooltip = 'Run the Inventory Cost and Price List report.';
}
action("Item Charges - Specification")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Charges - Specification';
RunObject = report "Item Charges - Specification";
+ Tooltip = 'Run the Item Charges - Specification report.';
}
action("Inventory - Customer Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Customer Sales';
RunObject = report "Inventory - Customer Sales";
+ Tooltip = 'Run the Inventory Customer Sales report.';
}
action("Nonstock Item Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Sales';
RunObject = report "Catalog Item Sales";
+ Tooltip = 'Run the Nonstock Item Sales report.';
}
action("Inventory Availability")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Availability';
RunObject = report "Inventory Availability";
+ Tooltip = 'Run the Inventory Availability report.';
}
action("Inventory Order Details")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Order Details';
RunObject = report "Inventory Order Details";
+ Tooltip = 'Run the Inventory Order Details report.';
}
action("Price List")
{
@@ -698,18 +786,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Inventory - Sales Back Orders';
RunObject = report "Inventory - Sales Back Orders";
+ Tooltip = 'Run the Inventory - Sales Back Orders report.';
}
action("Inventory - Top 10 List")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Top 10 List';
RunObject = report "Inventory - Top 10 List";
+ Tooltip = 'Run the Inventory Top 10 List report.';
}
action("Item Substitutions")
{
ApplicationArea = Suite;
Caption = 'Item Substitutions';
RunObject = report "Item Substitutions";
+ Tooltip = 'Run the Item Substitutions report.';
}
}
}
@@ -721,54 +812,63 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Orders - Dynamics 365 Sales';
RunObject = page "CRM Sales Order List";
+ Tooltip = 'Open the Sales Orders - Dynamics 365 Sales page.';
}
action("Quotes - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Quotes - Dynamics 365 Sales';
RunObject = page "CRM Sales Quote List";
+ Tooltip = 'Open the Quotes - Dynamics 365 Sales page.';
}
action("Cases - Dynamics 365 for Customer Service")
{
ApplicationArea = Suite;
Caption = 'Cases - Dynamics 365 for Customer Service';
RunObject = page "CRM Case List";
+ Tooltip = 'Open the Cases - Dynamics 365 for Customer Service page.';
}
action("Opportunities - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Opportunities - Dynamics 365 Sales';
RunObject = page "CRM Opportunity List";
+ Tooltip = 'Open the Opportunities - Dynamics 365 Sales page.';
}
action("Accounts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Accounts - Dynamics 365 Sales';
RunObject = page "CRM Account List";
+ Tooltip = 'Open the Accounts - Dynamics 365 Sales page.';
}
action("Transaction Currencies - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Transaction Currencies - Dynamics 365 Sales';
RunObject = page "CRM TransactionCurrency List";
+ Tooltip = 'Open the Transaction Currencies - Dynamics 365 Sales page.';
}
action("Unit Groups - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Unit Groups - Dynamics 365 Sales';
RunObject = page "CRM UnitGroup List";
+ Tooltip = 'Open the Unit Groups - Dynamics 365 Sales page.';
}
action("Products - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Products - Dynamics 365 Sales';
RunObject = page "CRM Product List";
+ Tooltip = 'Open the Products - Dynamics 365 Sales page.';
}
action("Contacts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Contacts - Dynamics 365 Sales';
RunObject = page "CRM Contact List";
+ Tooltip = 'Open the Contacts - Dynamics 365 Sales page.';
}
action("Records Skipped For Synchronization")
{
@@ -776,6 +876,7 @@ page 8907 "Sales & Marketing Manager RC"
Caption = 'Coupled Data Synchronization Errors';
RunObject = page "CRM Skipped Records";
AccessByPermission = TableData "CRM Integration Record" = R;
+ Tooltip = 'Open the Coupled Data Synchronization Errors page.';
}
}
group("Group16")
@@ -786,60 +887,70 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = OrderPromising;
Caption = 'Order Promising Setup';
RunObject = page "Order Promising Setup";
+ Tooltip = 'Open the Order Promising Setup page.';
}
action("Sales & Receivables Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales & Receivables Setup';
RunObject = page "Sales & Receivables Setup";
+ Tooltip = 'Open the Sales & Receivables Setup page.';
}
action("report Selection Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Sales';
RunObject = page "Report Selection - Sales";
+ Tooltip = 'Open the Report Selections Sales page.';
}
action("Standard Sales Codes")
{
ApplicationArea = Suite;
Caption = 'Standard Sales Codes';
RunObject = page "Standard Sales Codes";
+ Tooltip = 'Open the Standard Sales Codes page.';
}
action("Payment Terms")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Terms';
RunObject = page "Payment Terms";
+ Tooltip = 'Open the Payment Terms page.';
}
action("Payment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Methods';
RunObject = page "Payment Methods";
+ Tooltip = 'Open the Payment Methods page.';
}
action("Item Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Shipment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Shipment Methods';
RunObject = page "Shipment Methods";
+ Tooltip = 'Open the Shipment Methods page.';
}
action("Shipping Agents")
{
ApplicationArea = Suite;
Caption = 'Shipping Agents';
RunObject = page "Shipping Agents";
+ Tooltip = 'Open the Shipping Agents page.';
}
action("Return Reasons")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Return Reasons';
RunObject = page "Return Reasons";
+ Tooltip = 'Open the Return Reasons page.';
}
action("Customer Templates")
{
@@ -856,24 +967,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesAnalysis, PurchaseAnalysis, InventoryAnalysis;
Caption = 'Analysis Types';
RunObject = page "Analysis Types";
+ Tooltip = 'Open the Analysis Types page.';
}
action("Sales Analysis by Dimensions1")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Analysis Column Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Column Templates';
RunObject = report "Run Sales Analysis Col. Temp.";
+ Tooltip = 'Run the Sales Analysis Column Templates report.';
}
action("Analysis Line Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Line Templates';
RunObject = report "Run Sales Analysis Line Templ.";
+ Tooltip = 'Run the Sales Analysis Line Templates report.';
}
}
group("Group18")
@@ -884,12 +999,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Price Groups';
RunObject = page "Customer Price Groups";
+ Tooltip = 'Open the Customer Price Groups page.';
}
action("Customer Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Discount Groups';
RunObject = page "Customer Disc. Groups";
+ Tooltip = 'Open the Customer Discount Groups page.';
}
}
group("Group19")
@@ -900,24 +1017,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Setup';
RunObject = page "Catalog Item Setup";
+ Tooltip = 'Open the Nonstock Item Setup page.';
}
action("Item Charges")
{
ApplicationArea = ItemCharges;
Caption = 'Item Charges';
RunObject = page "Item Charges";
+ Tooltip = 'Open the Item Charges page.';
}
action("Item Disc. Groups1")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Inventory Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Setup';
RunObject = page "Inventory Setup";
+ Tooltip = 'Open the Inventory Setup page.';
}
}
group("Group20")
@@ -928,96 +1049,112 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite, RelationshipMgmt;
Caption = 'Marketing Setup';
RunObject = page "Marketing Setup";
+ Tooltip = 'Open the Marketing Setup page.';
}
action("Interaction Template Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Template Setup';
RunObject = page "Interaction Template Setup";
+ Tooltip = 'Open the Interaction Template Setup page.';
}
action("Business Relations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Business Relations';
RunObject = page "Business Relations";
+ Tooltip = 'Open the Business Relations page.';
}
action("Industry Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Industry Groups';
RunObject = page "Industry Groups";
+ Tooltip = 'Open the Industry Groups page.';
}
action("Web Sources")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Web Sources';
RunObject = page "Web Sources";
+ Tooltip = 'Open the Web Sources page.';
}
action("Job Responsibilities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Job Responsibilities';
RunObject = page "Job Responsibilities";
+ Tooltip = 'Open the Job Responsibilities page.';
}
action("Organizational Levels")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Organizational Levels';
RunObject = page "Organizational Levels";
+ Tooltip = 'Open the Organizational Levels page.';
}
action("Interaction Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Groups';
RunObject = page "Interaction Groups";
+ Tooltip = 'Open the Interaction Groups page.';
}
action("Interaction Templates")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Templates';
RunObject = page "Interaction Templates";
+ Tooltip = 'Open the Interaction Templates page.';
}
action("Salutations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Salutations';
RunObject = page "Salutations";
+ Tooltip = 'Open the Salutations page.';
}
action("Mailing Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Mailing Groups';
RunObject = page "Mailing Groups";
+ Tooltip = 'Open the Mailing Groups page.';
}
action("Status")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Status';
RunObject = page "Campaign Status";
+ Tooltip = 'Open the Campaign Status page.';
}
action("Sales Cycles")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycles';
RunObject = page "Sales Cycles";
+ Tooltip = 'Open the Sales Cycles page.';
}
action("Close Opportunity Codes")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Close Opportunity Codes';
RunObject = page "Close Opportunity Codes";
+ Tooltip = 'Open the Close Opportunity Codes page.';
}
action("Questionnaire Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire Setup';
RunObject = page "Profile Questionnaires";
+ Tooltip = 'Open the Questionnaire Setup page.';
}
action("Activities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Activities';
RunObject = page "Activity List";
+ Tooltip = 'Open the Activities page.';
}
}
}
diff --git a/src/Layers/APAC/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al b/src/Layers/APAC/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
index 650e64ab7d..716abb9fbe 100644
--- a/src/Layers/APAC/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
+++ b/src/Layers/APAC/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -72,53 +72,53 @@ page 9001 "Accounting Manager Role Center"
{
area(rolecenter)
{
- part(Control1902304208; "Account Manager Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part(Control99; "Finance Performance")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control103; "Trailing Sales Orders Chart")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control106; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control100; "Cash Flow Forecast Chart")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1907692008; "My Customers")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1902476008; "My Vendors")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control108; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- systempart(Control1901377608; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
+ part(Control1902304208; "Account Manager Activities")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part("User Tasks Activities"; "User Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part(Control99; "Finance Performance")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control103; "Trailing Sales Orders Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control106; "My Job Queue")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control100; "Cash Flow Forecast Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1907692008; "My Customers")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1902476008; "My Vendors")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control108; "Report Inbox Part")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ systempart(Control1901377608; MyNotes)
+ {
+ ApplicationArea = Basic, Suite;
+ }
}
}
diff --git a/src/Layers/APAC/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/APAC/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index 9367f88af5..1bef7df158 100644
--- a/src/Layers/APAC/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/APAC/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -97,7 +97,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
@@ -307,6 +306,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Suite;
Caption = 'Business Units';
RunObject = page "Business Unit List";
+ Tooltip = 'Open the Business Units page.';
}
action("BAS Business Units")
{
@@ -466,6 +466,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'G/L Register';
RunObject = report "G/L Register";
+ Tooltip = 'Run the G/L Register report.';
}
action("G/L Journal")
{
@@ -1450,6 +1451,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Customer Statement';
RunObject = codeunit "Customer Layout - Statement";
+ Tooltip = 'Run the Customer Statement codeunit.';
}
action("AU/NZ Statement")
{
diff --git a/src/Layers/APAC/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al b/src/Layers/APAC/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
index 25c53270f9..6fc0bec9bb 100644
--- a/src/Layers/APAC/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
+++ b/src/Layers/APAC/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
@@ -76,6 +76,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'System Information';
RunObject = page "Latest Error";
+ Tooltip = 'Open the System Information page.';
}
action("Table Information")
{
@@ -89,30 +90,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Extension Management';
RunObject = page "Extension Management";
+ Tooltip = 'Open the Extension Management page.';
}
action("Profiles")
{
ApplicationArea = Basic, Suite;
Caption = 'Profiles (Roles)';
RunObject = page "Profile List";
+ Tooltip = 'Open the Profiles (Roles) page.';
}
action("Devices")
{
ApplicationArea = Basic, Suite;
Caption = 'Devices';
RunObject = page "Devices";
+ Tooltip = 'Open the Devices page.';
}
action("Control Add-ins")
{
ApplicationArea = All;
Caption = 'Control Add-ins';
RunObject = page "Control Add-ins";
+ Tooltip = 'Open the Control Add-ins page.';
}
action("Get the Mobile Device App (Tablet and Phone activatation code)")
{
ApplicationArea = All;
Caption = 'Mobile device activation and app';
RunObject = page "O365 Device Setup";
+ Tooltip = 'Open the Mobile device activation and app page.';
}
action("Printer Management")
{
@@ -130,60 +136,70 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Online Map Setup';
RunObject = page "Online Map Setup";
+ Tooltip = 'Open the Online Map Setup page.';
}
action("Bank Export/Import Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Bank Export/Import Setup';
RunObject = page "Bank Export/Import Setup";
+ Tooltip = 'Open the Bank Export/Import Setup page.';
}
action("Cue Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Cue Setup';
RunObject = page "Cue Setup Administrator";
+ Tooltip = 'Open the Cue Setup page.';
}
action("Document Sending Profiles")
{
ApplicationArea = Basic, Suite;
Caption = 'Document Sending Profiles';
RunObject = page "Document Sending Profiles";
+ Tooltip = 'Open the Document Sending Profiles page.';
}
action("Printer Selections")
{
ApplicationArea = Suite;
Caption = 'Printer Selections';
RunObject = page "Printer Selections";
+ Tooltip = 'Open the Printer Selections page.';
}
action("Electronic Document Formats")
{
ApplicationArea = Suite;
Caption = 'Electronic Document Formats';
RunObject = page "Electronic Document Format";
+ Tooltip = 'Open the Electronic Document Formats page.';
}
action("Assisted Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Assisted Setup';
RunObject = page "Assisted Setup";
+ Tooltip = 'Open the Assisted Setup page.';
}
action("Application Area")
{
ApplicationArea = All;
Caption = 'Application Area';
RunObject = page "Application Area";
+ Tooltip = 'Open the Application Area page.';
}
action("Set Up Customer/Vendor/Item Templates")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Vendor/Item Templates';
RunObject = page "Config Templates";
+ Tooltip = 'Open the Customer/Vendor/Item Templates page.';
}
action("Transformation Rules")
{
ApplicationArea = Basic, Suite;
Caption = 'Transformation Rules';
RunObject = page "Transformation Rules";
+ Tooltip = 'Open the Transformation Rules page.';
}
action("Business Setup")
{
@@ -197,6 +213,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Image Analysis Setup';
RunObject = page "Image Analysis Setup";
+ Tooltip = 'Open the Image Analysis Setup page.';
}
}
group("Group4")
@@ -207,18 +224,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Entries';
RunObject = page "Job Queue Entries";
+ Tooltip = 'Open the Job Queue Entries page.';
}
action("Job Queue Log Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Log Entries';
RunObject = page "Job Queue Log Entries";
+ Tooltip = 'Open the Job Queue Log Entries page.';
}
action("Job Queue Category List")
{
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Category List';
RunObject = page "Job Queue Category List";
+ Tooltip = 'Open the Job Queue Category List page.';
}
action("Scheduled Tasks")
{
@@ -236,12 +256,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Change Log Setup';
RunObject = page "Change Log Setup";
+ Tooltip = 'Open the Change Log Setup page.';
}
action("Change Log")
{
ApplicationArea = Basic, Suite;
Caption = 'Change Log Entries';
RunObject = page "Change Log Entries";
+ Tooltip = 'Open the Change Log Entries page.';
}
}
group("Group6")
@@ -252,12 +274,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Layout Selection';
RunObject = page "Report Layout Selection";
+ Tooltip = 'Open the Report Layout Selection page.';
}
action("Report Configuration")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Settings';
RunObject = page "Report Settings";
+ Tooltip = 'Open the Report Settings page.';
AccessByPermission = TableData "Object Options" = IMD;
}
action("Report Inbox")
@@ -265,6 +289,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Inbox';
RunObject = page "Report Inbox";
+ Tooltip = 'Open the Report Inbox page.';
}
#if not CLEAN28
action("Custom Report Layouts")
@@ -277,6 +302,7 @@ page 8900 "Administrator Main Role Center"
#pragma warning disable AL0432
RunObject = page "Custom Report Layouts";
#pragma warning restore AL0432
+ Tooltip = 'Open the Custom Report Layouts page.';
}
#endif
action("Report Selection Purchase")
@@ -284,30 +310,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Purchase';
RunObject = page "Report Selection - Purchase";
+ Tooltip = 'Open the Report Selections Purchase page.';
}
action("Report Selection Reminder and")
{
ApplicationArea = Suite;
Caption = 'Report Selections Reminder/Fin. Charge';
RunObject = page "Report Selection - Reminder";
+ Tooltip = 'Open the Report Selections Reminder/Fin. Charge page.';
}
action("Report Selection Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Sales';
RunObject = page "Report Selection - Sales";
+ Tooltip = 'Open the Report Selections Sales page.';
}
action("Report Selection - Bank Acc.")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Bank Account';
RunObject = page "Report Selection - Bank Acc.";
+ Tooltip = 'Open the Report Selections Bank Account page.';
}
action("Report Selections Inventory")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Inventory';
RunObject = page "Report Selection - Inventory";
+ Tooltip = 'Open the Report Selections Inventory page.';
}
}
group("Group7")
@@ -318,19 +349,15 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Test Tool';
RunObject = page "CAL Test Tool";
+ Tooltip = 'Open the Test Tool page.';
}
action("Code Coverage")
{
ApplicationArea = All;
Caption = 'Code Coverage';
RunObject = page "Code Coverage";
+ Tooltip = 'Open the Code Coverage page.';
}
- // action("Sessions")
- // {
- // ApplicationArea = All;
- // Caption = 'Sessions';
- // RunObject = codeunit 9500;
- // }
}
action("Feature Management")
{
@@ -351,54 +378,63 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Company Information';
RunObject = page "Company Information";
+ Tooltip = 'Open the Company Information page.';
}
action("Companies")
{
ApplicationArea = Basic, Suite;
Caption = 'Companies';
RunObject = page "Companies";
+ Tooltip = 'Open the Companies page.';
}
action("No. Series")
{
ApplicationArea = Basic, Suite;
Caption = 'No. Series';
RunObject = page "No. Series";
+ Tooltip = 'Open the No. Series page.';
}
action("Post Codes")
{
ApplicationArea = Basic, Suite;
Caption = 'Post Codes';
RunObject = page "Post Codes";
+ Tooltip = 'Open the Post Codes page.';
}
action("Territories")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Territories';
RunObject = page "Territories";
+ Tooltip = 'Open the Territories page.';
}
action("Languages")
{
ApplicationArea = Suite;
Caption = 'Languages';
RunObject = page "Languages";
+ Tooltip = 'Open the Languages page.';
}
action("Countries/Regions")
{
ApplicationArea = Basic, Suite;
Caption = 'Countries/Regions';
RunObject = page "Countries/Regions";
+ Tooltip = 'Open the Countries/Regions page.';
}
action("Base Calendar Entries Subform")
{
ApplicationArea = Basic, Suite;
Caption = 'Base Calendar';
RunObject = page "Base Calendar List";
+ Tooltip = 'Open the Base Calendar page.';
}
action("Responsibility Centers")
{
- ApplicationArea = All;
+ ApplicationArea = Basic, Suite;
Caption = 'Responsibility Centers';
RunObject = page "Responsibility Center List";
+ Tooltip = 'Open the Responsibility Centers page.';
}
}
group("Group10")
@@ -409,13 +445,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Data Encryption Management';
RunObject = page "Data Encryption Management";
- // AccessByPermission = System 5420 = X;
+ Tooltip = 'Open the Data Encryption Management page.';
}
action("Data Classification Worksheet")
{
ApplicationArea = All;
Caption = 'Data Classification Worksheet';
RunObject = page "Data Classification Worksheet";
+ Tooltip = 'Open the Data Classification Worksheet page.';
AccessByPermission = TableData "Data Sensitivity" = R;
}
action("Privacy for App Integrations")
@@ -430,12 +467,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'XML Schemas';
RunObject = page "XML Schemas";
+ Tooltip = 'Open the XML Schemas page.';
}
action("SEPA Schema Viewer")
{
ApplicationArea = Basic, Suite;
Caption = 'SEPA Schema Viewer';
RunObject = page "XML Schema Viewer";
+ Tooltip = 'Open the SEPA Schema Viewer page.';
}
}
group("Group11")
@@ -446,18 +485,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Data Migration Overview';
RunObject = page "Data Migration Overview";
+ Tooltip = 'Open the Data Migration Overview page.';
}
action("Data Migration")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Migration';
RunObject = page "Data Migration Wizard";
+ Tooltip = 'Open the Data Migration page.';
}
action("Data Migration Settings")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Migration Settings';
RunObject = page "Data Migration Settings";
+ Tooltip = 'Open the Data Migration Settings page.';
AccessByPermission = TableData "Data Migration Setup" = R;
}
}
@@ -469,24 +511,28 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Import from a Data File';
RunObject = page "Import Data";
+ Tooltip = 'Open the Import from a Data File page.';
}
action("Export to a Data File")
{
ApplicationArea = Basic, Suite;
Caption = 'Export to a Data File';
RunObject = page "Export Data";
+ Tooltip = 'Open the Export to a Data File page.';
}
action("Data Exchange Types")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Exchange Types';
RunObject = page "Data Exchange Types";
+ Tooltip = 'Open the Data Exchange Types page.';
}
action("Data Exchange Definition")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Exchange Definitions';
RunObject = page "Data Exch Def List";
+ Tooltip = 'Open the Data Exchange Definitions page.';
}
}
group("Group13")
@@ -500,18 +546,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Customers...';
RunObject = report "Create Conts. from Customers";
+ Tooltip = 'Run the Create Contacts from Customers report.';
}
action("Create Contacts from Vendors")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Vendors...';
RunObject = report "Create Conts. from Vendors";
+ Tooltip = 'Run the Create Contacts from Vendors report.';
}
action("Create Contacts from Bank Acco")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Bank Accounts...';
RunObject = report "Create Conts. from Bank Accs.";
+ Tooltip = 'Run the Create Contacts from Bank Accounts report.';
}
}
}
@@ -526,6 +575,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Date Compr. Registers';
RunObject = page "Date Compr. Registers";
+ Tooltip = 'Open the Date Compr. Registers page.';
}
}
group("Group17")
@@ -536,6 +586,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Delete Orphaned Record Links';
RunObject = codeunit "Remove Orphaned Record Links";
+ Tooltip = 'Run the Delete Orphaned Record Links codeunit.';
}
}
group("Group18")
@@ -546,12 +597,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Profile Customizations';
RunObject = page "Profile Customization List";
+ Tooltip = 'Open the Profile Customizations page.';
}
action("User Page Personalizations")
{
ApplicationArea = Basic, Suite;
Caption = 'User Page Personalizations';
RunObject = page "Personalized Pages";
+ Tooltip = 'Open the User Page Personalizations page.';
}
}
}
@@ -564,24 +617,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Users';
RunObject = page "Users";
+ Tooltip = 'Open the Users page.';
}
action("User Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'User Setup';
RunObject = page "User Setup";
+ Tooltip = 'Open the User Setup page.';
}
- // action("Change Password")
- // {
- // ApplicationArea = Basic, Suite;
- // Caption = 'Change Password';
- // RunObject = page 9809;
- // }
action("User Security Status")
{
ApplicationArea = Basic, Suite;
Caption = 'User Security Status';
RunObject = page "User Security Status List";
+ Tooltip = 'Open the User Security Status page.';
AccessByPermission = TableData "User" = R;
}
action("User Tasks")
@@ -589,18 +639,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'User Tasks';
RunObject = page "User Task List";
+ Tooltip = 'Open the User Tasks page.';
}
action("User Personalization")
{
ApplicationArea = Basic, Suite;
Caption = 'User Settings';
RunObject = page "User Settings List";
+ Tooltip = 'Open the User Settings page.';
}
action("User Time Registers")
{
ApplicationArea = Basic, Suite;
Caption = 'Time Registers';
RunObject = page "User Time Registers";
+ Tooltip = 'Open the Time Registers page.';
}
}
group(Permissions)
@@ -642,30 +695,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflows';
RunObject = page "Workflows";
+ Tooltip = 'Open the Workflows page.';
}
action("Workflow User Group")
{
ApplicationArea = Suite;
Caption = 'Workflow User Groups';
RunObject = page "Workflow User Groups";
+ Tooltip = 'Open the Workflow User Groups page.';
}
action("Approval User Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Approval User Setup';
RunObject = page "Approval User Setup";
+ Tooltip = 'View or edit information about workflow users who are involved in approval processes, such as approval amount limits for specific types of requests and substitute approvers to whom approval requests are delegated when the original approver is absent.';
}
action("Incoming Documents Setup")
{
ApplicationArea = Suite;
Caption = 'Incoming Documents Setup';
RunObject = page "Incoming Documents Setup";
+ Tooltip = 'Open the Incoming Documents Setup page.';
}
action("Send Overdue Appr. Notif.")
{
ApplicationArea = Suite;
Caption = 'Send Overdue Approval Notifications';
RunObject = report "Send Overdue Appr. Notif.";
+ Tooltip = 'Run the Send Overdue Approval Notifications report.';
}
group("Group21")
{
@@ -675,12 +733,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflow Templates';
RunObject = page "Workflow Templates";
+ Tooltip = 'Open the Workflow Templates page.';
}
action("Workflow Categories")
{
ApplicationArea = Suite;
Caption = 'Workflow Categories';
RunObject = page "Workflow Categories";
+ Tooltip = 'Open the Workflow Categories page.';
}
}
group("Group22")
@@ -691,18 +751,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflow Event Hierarchies';
RunObject = page "Workflow Event Hierarchies";
+ Tooltip = 'Open the Workflow Event Hierarchies page.';
}
action("WF Event/Response Combinations")
{
ApplicationArea = Suite;
Caption = 'Workflow Event/Response Combinations';
RunObject = page "WF Event/Response Combinations";
+ Tooltip = 'Open the Workflow Event/Response Combinations page.';
}
action("Workflow - Table Relations")
{
ApplicationArea = Suite;
Caption = 'Workflow - Table Relations';
RunObject = page "Workflow - Table Relations";
+ Tooltip = 'Open the Workflow - Table Relations page.';
}
}
group("Group23")
@@ -713,18 +776,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Notification Setup';
RunObject = page "Notification Setup";
+ Tooltip = 'Open the Notification Setup page.';
}
action("Notification Entries")
{
ApplicationArea = Suite;
Caption = 'Notification Entries';
RunObject = page "Notification Entries";
+ Tooltip = 'Open the Notification Entries page.';
}
action("Sent Notification Entries")
{
ApplicationArea = Suite;
Caption = 'Sent Notification Entries';
RunObject = page "Sent Notification Entries";
+ Tooltip = 'Open the Sent Notification Entries page.';
}
}
group("Group24")
@@ -735,36 +801,42 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Approval Entries';
RunObject = page "Approval Entries";
+ Tooltip = 'Open the Approval Entries page.';
}
action("Posted Approval Entries")
{
ApplicationArea = Suite;
Caption = 'Posted Approval Entries';
RunObject = page "Posted Approval Entries";
+ Tooltip = 'Open the Posted Approval Entries page.';
}
action("Overdue Approval Entries")
{
ApplicationArea = Suite;
Caption = 'Overdue Approval Entries';
RunObject = page "Overdue Approval Entries";
+ Tooltip = 'Open the Overdue Approval Entries page.';
}
action("Restricted Records")
{
ApplicationArea = Suite;
Caption = 'Restricted Records';
RunObject = page "Restricted Records";
+ Tooltip = 'Open the Restricted Records page.';
}
action("Workflow Step Instances")
{
ApplicationArea = Suite;
Caption = 'Workflow Step Instances';
RunObject = page "Workflow Step Instances";
+ Tooltip = 'Open the Workflow Step Instances page.';
}
action("Archived Workflow Step Instances")
{
ApplicationArea = Suite;
Caption = 'Archived Workflow Step Instances';
RunObject = page "Archived WF Step Instances";
+ Tooltip = 'Open the Archived Workflow Step Instances page.';
}
}
group("Group26")
@@ -773,14 +845,16 @@ page 8900 "Administrator Main Role Center"
action("Dynamic Request page Entities")
{
ApplicationArea = Basic, Suite;
- Caption = 'Dynamic Request page Entities';
- RunObject = page "Dynamic Request page Entities";
+ Caption = 'Dynamic Request Page Entities';
+ RunObject = page "Dynamic Request Page Entities";
+ Tooltip = 'Open the Dynamic Request Page Entities page.';
}
action("Dynamic Request page Fields")
{
ApplicationArea = Basic, Suite;
- Caption = 'Dynamic Request page Fields';
- RunObject = page "Dynamic Request page Fields";
+ Caption = 'Dynamic Request Page Fields';
+ RunObject = page "Dynamic Request Page Fields";
+ Tooltip = 'Open the Dynamic Request Page Fields page.';
}
}
}
@@ -792,12 +866,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Web Services';
RunObject = page "Web Services";
+ Tooltip = 'Open the Web Services page.';
}
action("Microsoft Dynamics 365 Connection Setup")
{
ApplicationArea = Suite;
Caption = 'Microsoft Dynamics 365 Connection Setup';
RunObject = page "CRM Connection Setup";
+ Tooltip = 'Open the Microsoft Dynamics 365 Connection Setup page.';
AccessByPermission = TableData "CRM Connection Setup" = IM;
}
action("Email Account Setup")
@@ -813,66 +889,77 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'OCR Service Setup';
RunObject = page "OCR Service Setup";
+ Tooltip = 'Open the OCR Service Setup page.';
}
action("Currency Exchange Rate Services")
{
ApplicationArea = Suite;
Caption = 'Currency Exchange Rate Services';
RunObject = page "Curr. Exch. Rate Service List";
+ Tooltip = 'Open the Currency Exchange Rate Services page.';
}
action("Service Connections Overview")
{
ApplicationArea = Basic, Suite;
Caption = 'Service Connections';
RunObject = page "Service Connections";
+ Tooltip = 'Open the Service Connections page.';
}
action("Doc. Exch. Service Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Document Exchange Service Setup';
RunObject = page "Doc. Exch. Service Setup";
+ Tooltip = 'Open the Document Exchange Service Setup page.';
}
action("Integration Table Mappings")
{
ApplicationArea = Suite;
Caption = 'Integration Table Mappings';
RunObject = page "Integration Table Mapping List";
+ Tooltip = 'Open the Integration Table Mappings page.';
}
action("Integration Synchronization Jobs")
{
ApplicationArea = Suite;
Caption = 'Integration Synchronization Jobs';
RunObject = page "Integration Synch. Job List";
+ Tooltip = 'Open the Integration Synchronization Jobs page.';
}
action("Integration Synchronization Errors")
{
ApplicationArea = Suite;
Caption = 'Integration Synchronization Errors';
RunObject = page "Integration Synch. Error List";
+ Tooltip = 'Open the Integration Synchronization Errors page.';
}
action("Online Payments")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Services';
RunObject = page "Payment Services";
+ Tooltip = 'Open the Payment Services page.';
}
action("API Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'API Setup';
RunObject = page "API Setup";
+ Tooltip = 'Open the API Setup page.';
}
action("Acc. Sched. KPI Web Serv. Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Account Schedule KPI Web Service Setup';
RunObject = page "Acc. Sched. KPI Web Srv. Setup";
+ Tooltip = 'Open the Account Schedule KPI Web Service Setup page.';
}
action("Acc. Sched. KPI Web Service")
{
ApplicationArea = Basic, Suite;
Caption = 'Account Schedule KPI Web Service';
RunObject = page "Acc. Sched. KPI Web Service";
+ Tooltip = 'Open the Account Schedule KPI Web Service page.';
}
}
group("Group27A")
@@ -973,48 +1060,56 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Configuration Questionnaire';
RunObject = page "Config. Questionnaire";
+ Tooltip = 'Open the Configuration Questionnaire page.';
}
action("Data Migration1")
{
ApplicationArea = Suite;
Caption = 'Configuration Packages';
RunObject = page "Config. Packages";
+ Tooltip = 'Open the Configuration Packages page.';
}
action("Setup Master Templates")
{
ApplicationArea = Basic, Suite;
Caption = 'Configuration Templates';
RunObject = page "Config. Template List";
+ Tooltip = 'Open the Configuration Templates page.';
}
action("Create G/L acc. Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create G/L Acc. Journal Lines';
RunObject = report "Create G/L Acc. Journal Lines";
+ Tooltip = 'Run the Create G/L Acc. Journal Lines report.';
}
action("Create Customer Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Customer Journal Lines';
RunObject = report "Create Customer Journal Lines";
+ Tooltip = 'Run the Create Customer Journal Lines report.';
}
action("Create Vendor Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Vendor Journal Lines';
RunObject = report "Create Vendor Journal Lines";
+ Tooltip = 'Run the Create Vendor Journal Lines report.';
}
action("Create Item Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Item Journal Lines';
RunObject = report "Create Item Journal Lines";
+ Tooltip = 'Run the Create Item Journal Lines report.';
}
action("Configuration Worksheet")
{
ApplicationArea = Suite;
Caption = 'Configuration Worksheet';
RunObject = page "Config. Worksheet";
+ Tooltip = 'Open the Configuration Worksheet page.';
}
}
}
diff --git a/src/Layers/APAC/BaseApp/Sales/Customer/Customer.Table.al b/src/Layers/APAC/BaseApp/Sales/Customer/Customer.Table.al
index 7787ffa33a..be02f11d51 100644
--- a/src/Layers/APAC/BaseApp/Sales/Customer/Customer.Table.al
+++ b/src/Layers/APAC/BaseApp/Sales/Customer/Customer.Table.al
@@ -2546,6 +2546,7 @@ table 18 Customer
UpdateReferencedIds();
SetLastModifiedDateTime();
if IsContactUpdateNeeded() then begin
+ OnBeforeModifyContactUpdate(Rec);
Modify();
UpdateContFromCust.OnModify(Rec);
if not Find() then begin
@@ -2555,6 +2556,11 @@ table 18 Customer
end;
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnBeforeModifyContactUpdate(var Customer: Record Customer)
+ begin
+ end;
+
trigger OnRename()
var
IsHandled: Boolean;
diff --git a/src/Layers/APAC/BaseApp/Sales/Customer/CustomerTempl.Table.al b/src/Layers/APAC/BaseApp/Sales/Customer/CustomerTempl.Table.al
index 9aed751575..ec9bd24cd6 100644
--- a/src/Layers/APAC/BaseApp/Sales/Customer/CustomerTempl.Table.al
+++ b/src/Layers/APAC/BaseApp/Sales/Customer/CustomerTempl.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -935,4 +935,5 @@ table 1381 "Customer Templ."
local procedure OnCopyTemplateOnBeforeModify(SourceCustomerTempl: Record "Customer Templ."; SavedCustomerTempl: Record "Customer Templ."; var CustomerTempl: Record "Customer Templ.")
begin
end;
+
}
diff --git a/src/Layers/APAC/BaseApp/Sales/Document/SalesHeader.Table.al b/src/Layers/APAC/BaseApp/Sales/Document/SalesHeader.Table.al
index 06e6272a1a..94dd259b56 100644
--- a/src/Layers/APAC/BaseApp/Sales/Document/SalesHeader.Table.al
+++ b/src/Layers/APAC/BaseApp/Sales/Document/SalesHeader.Table.al
@@ -331,6 +331,7 @@ table 36 "Sales Header"
Validate("Payment Terms Code");
Validate("Prepmt. Payment Terms Code");
Validate("Payment Method Code");
+ OnAfterValidateBillToCustomerPaymentFields(Rec);
Validate("Prepayment %");
if (xRec."Sell-to Customer No." = "Sell-to Customer No.") and
@@ -10525,6 +10526,11 @@ table 36 "Sales Header"
begin
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnAfterValidateBillToCustomerPaymentFields(var SalesHeader: Record "Sales Header")
+ begin
+ end;
+
///
/// Raised after extended text is transferred for sales line recreation.
///
diff --git a/src/Layers/AT/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al b/src/Layers/AT/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
index 1b78447c9d..2369330216 100644
--- a/src/Layers/AT/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
+++ b/src/Layers/AT/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
@@ -69,53 +69,53 @@ page 9001 "Accounting Manager Role Center"
{
area(rolecenter)
{
- part(Control1902304208; "Account Manager Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part(Control99; "Finance Performance")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control103; "Trailing Sales Orders Chart")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control106; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control100; "Cash Flow Forecast Chart")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1907692008; "My Customers")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1902476008; "My Vendors")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control108; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- systempart(Control1901377608; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
+ part(Control1902304208; "Account Manager Activities")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part("User Tasks Activities"; "User Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part(Control99; "Finance Performance")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control103; "Trailing Sales Orders Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control106; "My Job Queue")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control100; "Cash Flow Forecast Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1907692008; "My Customers")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1902476008; "My Vendors")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control108; "Report Inbox Part")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ systempart(Control1901377608; MyNotes)
+ {
+ ApplicationArea = Basic, Suite;
+ }
}
}
@@ -699,7 +699,7 @@ page 9001 "Accounting Manager Role Center"
}
action("Cost Centers")
{
- ApplicationArea = Dimensions;
+ ApplicationArea = CostAccounting;
Caption = 'Cost Centers';
RunObject = Page "Chart of Cost Centers";
ToolTip = 'Manage cost centers, which are departments and profit centers that are responsible for costs and income. Often, there are more cost centers set up in cost accounting than in any dimension that is set up in the general ledger. In the general ledger, usually only the first level cost centers for direct costs and the initial costs are used. In cost accounting, additional cost centers are created for additional allocation levels.';
@@ -1062,7 +1062,7 @@ page 9001 "Accounting Manager Role Center"
}
action("Cost Accounting Setup")
{
- ApplicationArea = Dimensions;
+ ApplicationArea = CostAccounting;
Caption = 'Cost Accounting Setup';
Image = CostAccountingSetup;
RunObject = Page "Cost Accounting Setup";
diff --git a/src/Layers/AT/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/AT/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index 9dcd33c7b1..52a7793431 100644
--- a/src/Layers/AT/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/AT/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -1,3 +1,4 @@
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -97,7 +98,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
@@ -2678,7 +2678,7 @@ page 8901 "Finance Manager Role Center"
action("General Business")
{
ApplicationArea = Basic, Suite;
- Caption = 'Gen. Business Posting Groups';
+ Caption = 'General Business Posting Groups';
RunObject = page "Gen. Business Posting Groups";
Tooltip = 'Open the Gen. Business Posting Groups page.';
}
diff --git a/src/Layers/AU/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/AU/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index 8e944c0a39..0b4dd841e9 100644
--- a/src/Layers/AU/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/AU/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -97,7 +97,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
@@ -300,6 +299,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Suite;
Caption = 'Business Units';
RunObject = page "Business Unit List";
+ Tooltip = 'Open the Business Units page.';
}
action("BAS Business Units")
{
@@ -429,12 +429,6 @@ page 8901 "Finance Manager Role Center"
RunObject = page "Item Budget Entries";
Tooltip = 'Open the Item Budget Entries page.';
}
- // action("Simulation Register")
- // {
- // ApplicationArea = Basic, Suite;
- // Caption = 'Simulation Register';
- // RunObject = page 28160;
- // }
action("GST Purchase Entries")
{
ApplicationArea = Basic, Suite;
@@ -459,6 +453,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'G/L Register';
RunObject = report "G/L Register";
+ Tooltip = 'Run the G/L Register report.';
}
action("G/L Journal")
{
@@ -811,6 +806,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Payment Registration';
RunObject = page "Payment Registration";
+ Tooltip = 'Open the Payment Registration page.';
}
action("Deposit")
{
@@ -1447,6 +1443,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Customer Statement';
RunObject = codeunit "Customer Layout - Statement";
+ Tooltip = 'Run the Customer Statement codeunit.';
}
action("Customer Register")
{
diff --git a/src/Layers/BE/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al b/src/Layers/BE/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
index 5a622b4368..c2f5118bc6 100644
--- a/src/Layers/BE/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
+++ b/src/Layers/BE/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
@@ -68,53 +68,53 @@ page 9001 "Accounting Manager Role Center"
{
area(rolecenter)
{
- part(Control1902304208; "Account Manager Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part(Control99; "Finance Performance")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control103; "Trailing Sales Orders Chart")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control106; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control100; "Cash Flow Forecast Chart")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1907692008; "My Customers")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1902476008; "My Vendors")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control108; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- systempart(Control1901377608; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
+ part(Control1902304208; "Account Manager Activities")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part("User Tasks Activities"; "User Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part(Control99; "Finance Performance")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control103; "Trailing Sales Orders Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control106; "My Job Queue")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control100; "Cash Flow Forecast Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1907692008; "My Customers")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1902476008; "My Vendors")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control108; "Report Inbox Part")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ systempart(Control1901377608; MyNotes)
+ {
+ ApplicationArea = Basic, Suite;
+ }
}
}
diff --git a/src/Layers/BE/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/BE/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index 5e00d72438..db99ee33f2 100644
--- a/src/Layers/BE/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/BE/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -96,7 +96,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
@@ -166,6 +165,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'VAT Register';
RunObject = report "VAT Register";
+ Tooltip = 'Run the VAT Register report.';
}
action("Form/Intervat Declaration")
{
@@ -2671,7 +2671,7 @@ page 8901 "Finance Manager Role Center"
action("General Business")
{
ApplicationArea = Basic, Suite;
- Caption = 'Gen. Business Posting Groups';
+ Caption = 'General Business Posting Groups';
RunObject = page "Gen. Business Posting Groups";
Tooltip = 'Open the Gen. Business Posting Groups page.';
}
diff --git a/src/Layers/BE/BaseApp/Sales/Customer/Customer.Table.al b/src/Layers/BE/BaseApp/Sales/Customer/Customer.Table.al
index 54a52b6dd9..0eb6fd8f26 100644
--- a/src/Layers/BE/BaseApp/Sales/Customer/Customer.Table.al
+++ b/src/Layers/BE/BaseApp/Sales/Customer/Customer.Table.al
@@ -2522,6 +2522,7 @@ table 18 Customer
UpdateReferencedIds();
SetLastModifiedDateTime();
if IsContactUpdateNeeded() then begin
+ OnBeforeModifyContactUpdate(Rec);
Modify();
UpdateContFromCust.OnModify(Rec);
if not Find() then begin
@@ -2531,6 +2532,11 @@ table 18 Customer
end;
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnBeforeModifyContactUpdate(var Customer: Record Customer)
+ begin
+ end;
+
trigger OnRename()
var
IsHandled: Boolean;
diff --git a/src/Layers/BE/BaseApp/Sales/Customer/CustomerBankAccount.Table.al b/src/Layers/BE/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
index 4d1f87d66e..885b731dbe 100644
--- a/src/Layers/BE/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
+++ b/src/Layers/BE/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -482,4 +482,5 @@ table 287 "Customer Bank Account"
local procedure OnBeforeValidatePostCode(var CustomerBankAccount: Record "Customer Bank Account"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
begin
end;
+
}
diff --git a/src/Layers/BE/BaseApp/Sales/Customer/CustomerTempl.Table.al b/src/Layers/BE/BaseApp/Sales/Customer/CustomerTempl.Table.al
index 1f2c579e6f..5da29947a4 100644
--- a/src/Layers/BE/BaseApp/Sales/Customer/CustomerTempl.Table.al
+++ b/src/Layers/BE/BaseApp/Sales/Customer/CustomerTempl.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -907,4 +907,5 @@ table 1381 "Customer Templ."
local procedure OnCopyTemplateOnBeforeModify(SourceCustomerTempl: Record "Customer Templ."; SavedCustomerTempl: Record "Customer Templ."; var CustomerTempl: Record "Customer Templ.")
begin
end;
+
}
diff --git a/src/Layers/BE/BaseApp/Sales/Document/SalesHeader.Table.al b/src/Layers/BE/BaseApp/Sales/Document/SalesHeader.Table.al
index 5356681641..e4f0547456 100644
--- a/src/Layers/BE/BaseApp/Sales/Document/SalesHeader.Table.al
+++ b/src/Layers/BE/BaseApp/Sales/Document/SalesHeader.Table.al
@@ -328,6 +328,7 @@ table 36 "Sales Header"
Validate("Payment Terms Code");
Validate("Prepmt. Payment Terms Code");
Validate("Payment Method Code");
+ OnAfterValidateBillToCustomerPaymentFields(Rec);
Validate("Prepayment %");
if (xRec."Sell-to Customer No." = "Sell-to Customer No.") and
@@ -10386,6 +10387,11 @@ table 36 "Sales Header"
begin
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnAfterValidateBillToCustomerPaymentFields(var SalesHeader: Record "Sales Header")
+ begin
+ end;
+
///
/// Raised after extended text is transferred for sales line recreation.
///
diff --git a/src/Layers/CH/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al b/src/Layers/CH/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
index 4b217971d7..ce19fd248d 100644
--- a/src/Layers/CH/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
+++ b/src/Layers/CH/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
@@ -64,36 +64,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Salespeople")
{
ApplicationArea = Suite;
Caption = 'Salespeople/Purchasers';
RunObject = page "Salespersons/Purchasers";
+ Tooltip = 'Open the Salespeople/Purchasers page.';
}
action("Teams")
{
ApplicationArea = Basic, Suite;
Caption = 'Teams';
RunObject = page "Teams";
+ Tooltip = 'Open the Teams page.';
}
action("Tasks")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Opportunities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
group("Group1")
{
@@ -103,36 +109,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesBudget;
Caption = 'Sales Budgets';
RunObject = page "Budget Names Sales";
+ Tooltip = 'Open the Sales Budgets page.';
}
action("Sales Analysis Reports")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Reports';
RunObject = page "Analysis Report Sale";
+ Tooltip = 'Open the Sales Analysis Reports page.';
}
action("Sales Analysis by Dimensions")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Item Dimensions - Detail")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Detail';
RunObject = report "Item Dimensions - Detail";
+ Tooltip = 'Run the Item Dimensions - Detail report.';
}
action("Item Dimensions - Total")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Total';
RunObject = report "Item Dimensions - Total";
+ Tooltip = 'Run the Item Dimensions - Total report.';
}
action("Opportunities Matrix")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Analysis';
RunObject = page "Opportunities";
+ Tooltip = 'Open the Opportunity Analysis page.';
}
}
group("Group2")
@@ -143,6 +155,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Deferral Summary';
RunObject = report "Deferral Summary - Sales";
+ Tooltip = 'Run the Sales Deferral Summary report.';
}
group("Group3")
{
@@ -152,18 +165,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Tasks';
RunObject = report "Salesperson - Tasks";
+ Tooltip = 'Run the Salesperson Tasks report.';
}
action("Salesperson - Commission")
{
ApplicationArea = Suite;
Caption = 'Salesperson Commission';
RunObject = report "Salesperson - Commission";
+ Tooltip = 'Run the Salesperson Commission report.';
}
action("Salesperson - Opportunities")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Opportunities';
RunObject = report "Salesperson - Opportunities";
+ Tooltip = 'Run the Salesperson Opportunities report.';
}
#if not CLEAN28
action("Sales Statistics")
@@ -174,6 +190,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
#endif
action("Team - Tasks")
@@ -181,12 +198,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Team Tasks';
RunObject = report "Team - Tasks";
+ Tooltip = 'Run the Team Tasks report.';
}
action("Salesperson - Sales Statistics")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Sales Statistics';
RunObject = report "Salesperson - Sales Statistics";
+ Tooltip = 'Run the Salesperson Sales Statistics report.';
}
}
group("Group4")
@@ -197,36 +216,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Contact Labels';
RunObject = report "Contact - Labels";
+ Tooltip = 'Run the Contact Labels report.';
}
action("Contact - Company Summary")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact - Company Summary';
RunObject = report "Contact - Company Summary";
+ Tooltip = 'Run the Contact - Company Summary report.';
}
action("Questionnaire - Handouts")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire - Handouts';
RunObject = report "Questionnaire - Handouts";
+ Tooltip = 'Run the Questionnaire - Handouts report.';
}
action("Contact - List")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact List';
RunObject = report "Contact - List";
+ Tooltip = 'Run the Contact List report.';
}
action("Orgl. Profile Summary")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Person Summary';
RunObject = report "Contact - Person Summary";
+ Tooltip = 'Run the Contact - Person Summary report.';
}
action("Contact - Cover Sheet")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Cover Sheet';
RunObject = report "Contact - Cover Sheet";
+ Tooltip = 'Run the Contact - Cover Sheet report.';
}
}
group("Group5")
@@ -241,6 +266,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - List report.';
}
#endif
action("Customer - Labels")
@@ -248,18 +274,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Customer Labels';
RunObject = report "Customer - Labels";
+ Tooltip = 'Run the Customer Labels report.';
}
action("Customer - Balance to Date")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Balance to Date';
RunObject = report "Customer - Balance to Date";
+ Tooltip = 'Run the Customer - Balance to Date report.';
}
action("Customer Register")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Register';
RunObject = report "Customer Register";
+ Tooltip = 'Run the Customer Register report.';
}
action("Customer - Order Detail")
{
@@ -267,6 +296,7 @@ page 8907 "Sales & Marketing Manager RC"
Caption = 'Customer - Order Detail';
RunObject = report "Customer - Order Detail";
Visible = false;
+ Tooltip = 'Run the Customer - Order Detail report.';
}
#if not CLEAN28
action("Customer - Sales List")
@@ -277,6 +307,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
}
@@ -288,18 +319,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - List';
RunObject = report "Opportunity - List";
+ Tooltip = 'Run the Opportunity - List report.';
}
action("Opportunity - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - Details';
RunObject = report "Opportunity - Details";
+ Tooltip = 'Run the Opportunity - Details report.';
}
action("Sales Cycle - Analysis")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycle - Analysis';
RunObject = report "Sales Cycle - Analysis";
+ Tooltip = 'Run the Sales Cycle - Analysis report.';
}
}
}
@@ -312,60 +346,70 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts1")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Quotes")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quotes';
RunObject = page "Sales Quotes";
+ Tooltip = 'Open the Sales Quotes page.';
}
action("Orders")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Orders';
RunObject = page "Sales Order List";
+ Tooltip = 'Open the Sales Orders page.';
}
action("Blanket Orders")
{
ApplicationArea = Suite;
Caption = 'Blanket Sales Orders';
RunObject = page "Blanket Sales Orders";
+ Tooltip = 'Open the Blanket Sales Orders page.';
}
action("Return Orders")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Sales Return Orders';
RunObject = page "Sales Return Order List";
+ Tooltip = 'Open the Sales Return Orders page.';
}
action("Invoices")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Invoices';
RunObject = page "Sales Invoice List";
+ Tooltip = 'Open the Sales Invoices page.';
}
action("Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Credit Memos';
RunObject = page "Sales Credit Memos";
+ Tooltip = 'Open the Sales Credit Memos page.';
}
action("Certificates of Supply")
{
ApplicationArea = Basic, Suite;
Caption = 'Certificates of Supply';
RunObject = page "Certificates of Supply";
+ Tooltip = 'Open the Certificates of Supply page.';
}
action("Order Planning")
{
ApplicationArea = Planning;
Caption = 'Order Planning';
RunObject = page "Order Planning";
+ Tooltip = 'Open the Order Planning page.';
}
group("Group8")
{
@@ -375,24 +419,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Invoices';
RunObject = page "Posted Sales Invoices";
+ Tooltip = 'Open the Posted Sales Invoices page.';
}
action("Posted Sales Shipments")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Shipments';
RunObject = page "Posted Sales Shipments";
+ Tooltip = 'Open the Posted Sales Shipments page.';
}
action("Posted Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Credit Memos';
RunObject = page "Posted Sales Credit Memos";
+ Tooltip = 'Open the Posted Sales Credit Memos page.';
}
action("Posted Return Receipts")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Posted Return Receipts';
RunObject = page "Posted Return Receipts";
+ Tooltip = 'Open the Posted Return Receipts page.';
}
}
group("Group9")
@@ -403,48 +451,56 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'G/L Registers';
RunObject = page "G/L Registers";
+ Tooltip = 'Open the G/L Registers page.';
}
action("Item Tracing")
{
ApplicationArea = ItemTracking;
Caption = 'Item Tracing';
RunObject = page "Item Tracing";
+ Tooltip = 'Open the Item Tracing page.';
}
action("Sales Quote Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quote Archives';
RunObject = page "Sales Quote Archives";
+ Tooltip = 'Open the Sales Quote Archives page.';
}
action("Sales Order Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Order Archives';
RunObject = page "Sales Order Archives";
+ Tooltip = 'Open the Sales Order Archives page.';
}
action("Sales Return Order Archives")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Return Order Archives';
RunObject = page "Sales Return List Archive";
+ Tooltip = 'Open the Sales Return Order Archives page.';
}
action("Customer Ledger Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Ledger Entries';
RunObject = page "Customer Ledger Entries";
+ Tooltip = 'Open the Customer Ledger Entries page.';
}
action("Detailed Cust. Ledg. Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Detailed Customer Ledger Entries';
RunObject = page "Detailed Cust. Ledg. Entries";
+ Tooltip = 'Open the Detailed Customer Ledger Entries page.';
}
action("Value Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Value Entries';
RunObject = page "Value Entries";
+ Tooltip = 'Open the Value Entries page.';
}
action("Navigate")
{
@@ -468,6 +524,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Reservation Avail. report.';
}
#endif
#if not CLEAN28
@@ -479,6 +536,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
#endif
#if not CLEAN28
@@ -490,6 +548,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
action("EC Sales List")
@@ -497,6 +556,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'EC Sales List';
RunObject = report "EC Sales List";
+ Tooltip = 'Run the EC Sales List report.';
}
}
}
@@ -508,48 +568,56 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Campaigns")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaigns';
RunObject = page "Campaign List";
+ Tooltip = 'Open the Campaigns page.';
}
action("Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Segments';
RunObject = page "Segment List";
+ Tooltip = 'Open the Segments page.';
}
action("Logged Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Logged Segments';
RunObject = page "Logged Segments";
+ Tooltip = 'Open the Logged Segments page.';
}
action("Opportunities1")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
action("Tasks1")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Export Contact")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Export Contact';
RunObject = xmlport "Export Contact";
+ Tooltip = 'Export the contact information.';
}
action("Campaign - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign - Details';
RunObject = report "Campaign - Details";
+ Tooltip = 'Run the Campaign - Details report.';
}
group("Group12")
{
@@ -559,18 +627,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Entries';
RunObject = page "Campaign Entries";
+ Tooltip = 'Open the Campaign Entries page.';
}
action("Opportunity Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Entries';
RunObject = page "Opportunity Entries";
+ Tooltip = 'Open the Opportunity Entries page.';
}
action("Interaction Log Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Log Entries';
RunObject = page "Interaction Log Entries";
+ Tooltip = 'Open the Interaction Log Entries page.';
}
}
}
@@ -582,18 +653,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Items';
RunObject = page "Item List";
+ Tooltip = 'Open the Items page.';
}
action("Nonstock Items")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Items';
RunObject = page "Catalog Item List";
+ Tooltip = 'Open the Nonstock Items page.';
}
action("Item Attributes")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Attributes';
RunObject = page "Item Attributes";
+ Tooltip = 'Open the Item Attributes page.';
}
action("Sales Price Worksheet")
{
@@ -607,6 +681,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Adjust Item Costs/Prices';
RunObject = report "Adjust Item Costs/Prices";
+ Tooltip = 'Run the Adjust Item Costs/Prices report.';
}
group("Group14")
{
@@ -616,36 +691,49 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Inventory Sales Statistics';
RunObject = report "Inventory - Sales Statistics";
+ Tooltip = 'Run the Inventory Sales Statistics report.';
}
action("Inventory Cost and Price List")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Cost and Price List';
RunObject = report "Inventory Cost and Price List";
+ Tooltip = 'Run the Inventory Cost and Price List report.';
+ }
+ action("Item Charges - Specification")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Item Charges - Specification';
+ RunObject = report "Item Charges - Specification";
+ Tooltip = 'Run the Item Charges - Specification report.';
}
action("Inventory - Customer Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Customer Sales';
RunObject = report "Inventory - Customer Sales";
+ Tooltip = 'Run the Inventory Customer Sales report.';
}
action("Nonstock Item Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Sales';
RunObject = report "Catalog Item Sales";
+ Tooltip = 'Run the Nonstock Item Sales report.';
}
action("Inventory Availability")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Availability';
RunObject = report "Inventory Availability";
+ Tooltip = 'Run the Inventory Availability report.';
}
action("Inventory Order Details")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Order Details';
RunObject = report "Inventory Order Details";
+ Tooltip = 'Run the Inventory Order Details report.';
}
action("Price List")
{
@@ -659,18 +747,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Inventory - Sales Back Orders';
RunObject = report "Inventory - Sales Back Orders";
+ Tooltip = 'Run the Inventory - Sales Back Orders report.';
}
action("Inventory - Top 10 List")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Top 10 List';
RunObject = report "Inventory - Top 10 List";
+ Tooltip = 'Run the Inventory Top 10 List report.';
}
action("Item Substitutions")
{
ApplicationArea = Suite;
Caption = 'Item Substitutions';
RunObject = report "Item Substitutions";
+ Tooltip = 'Run the Item Substitutions report.';
}
}
}
@@ -682,54 +773,63 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Orders - Dynamics 365 Sales';
RunObject = page "CRM Sales Order List";
+ Tooltip = 'Open the Sales Orders - Dynamics 365 Sales page.';
}
action("Quotes - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Quotes - Dynamics 365 Sales';
RunObject = page "CRM Sales Quote List";
+ Tooltip = 'Open the Quotes - Dynamics 365 Sales page.';
}
action("Cases - Dynamics 365 for Customer Service")
{
ApplicationArea = Suite;
Caption = 'Cases - Dynamics 365 for Customer Service';
RunObject = page "CRM Case List";
+ Tooltip = 'Open the Cases - Dynamics 365 for Customer Service page.';
}
action("Opportunities - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Opportunities - Dynamics 365 Sales';
RunObject = page "CRM Opportunity List";
+ Tooltip = 'Open the Opportunities - Dynamics 365 Sales page.';
}
action("Accounts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Accounts - Dynamics 365 Sales';
RunObject = page "CRM Account List";
+ Tooltip = 'Open the Accounts - Dynamics 365 Sales page.';
}
action("Transaction Currencies - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Transaction Currencies - Dynamics 365 Sales';
RunObject = page "CRM TransactionCurrency List";
+ Tooltip = 'Open the Transaction Currencies - Dynamics 365 Sales page.';
}
action("Unit Groups - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Unit Groups - Dynamics 365 Sales';
RunObject = page "CRM UnitGroup List";
+ Tooltip = 'Open the Unit Groups - Dynamics 365 Sales page.';
}
action("Products - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Products - Dynamics 365 Sales';
RunObject = page "CRM Product List";
+ Tooltip = 'Open the Products - Dynamics 365 Sales page.';
}
action("Contacts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Contacts - Dynamics 365 Sales';
RunObject = page "CRM Contact List";
+ Tooltip = 'Open the Contacts - Dynamics 365 Sales page.';
}
action("Records Skipped For Synchronization")
{
@@ -737,6 +837,7 @@ page 8907 "Sales & Marketing Manager RC"
Caption = 'Coupled Data Synchronization Errors';
RunObject = page "CRM Skipped Records";
AccessByPermission = TableData "CRM Integration Record" = R;
+ Tooltip = 'Open the Coupled Data Synchronization Errors page.';
}
}
group("Group16")
@@ -747,60 +848,70 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = OrderPromising;
Caption = 'Order Promising Setup';
RunObject = page "Order Promising Setup";
+ Tooltip = 'Open the Order Promising Setup page.';
}
action("Sales & Receivables Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales & Receivables Setup';
RunObject = page "Sales & Receivables Setup";
+ Tooltip = 'Open the Sales & Receivables Setup page.';
}
action("report Selection Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Sales';
RunObject = page "Report Selection - Sales";
+ Tooltip = 'Open the Report Selections Sales page.';
}
action("Standard Sales Codes")
{
ApplicationArea = Suite;
Caption = 'Standard Sales Codes';
RunObject = page "Standard Sales Codes";
+ Tooltip = 'Open the Standard Sales Codes page.';
}
action("Payment Terms")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Terms';
RunObject = page "Payment Terms";
+ Tooltip = 'Open the Payment Terms page.';
}
action("Payment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Methods';
RunObject = page "Payment Methods";
+ Tooltip = 'Open the Payment Methods page.';
}
action("Item Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Shipment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Shipment Methods';
RunObject = page "Shipment Methods";
+ Tooltip = 'Open the Shipment Methods page.';
}
action("Shipping Agents")
{
ApplicationArea = Suite;
Caption = 'Shipping Agents';
RunObject = page "Shipping Agents";
+ Tooltip = 'Open the Shipping Agents page.';
}
action("Return Reasons")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Return Reasons';
RunObject = page "Return Reasons";
+ Tooltip = 'Open the Return Reasons page.';
}
action("Customer Templates")
{
@@ -817,24 +928,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesAnalysis, PurchaseAnalysis, InventoryAnalysis;
Caption = 'Analysis Types';
RunObject = page "Analysis Types";
+ Tooltip = 'Open the Analysis Types page.';
}
action("Sales Analysis by Dimensions1")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Analysis Column Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Column Templates';
RunObject = report "Run Sales Analysis Col. Temp.";
+ Tooltip = 'Run the Sales Analysis Column Templates report.';
}
action("Analysis Line Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Line Templates';
RunObject = report "Run Sales Analysis Line Templ.";
+ Tooltip = 'Run the Sales Analysis Line Templates report.';
}
}
group("Group18")
@@ -845,12 +960,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Price Groups';
RunObject = page "Customer Price Groups";
+ Tooltip = 'Open the Customer Price Groups page.';
}
action("Customer Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Discount Groups';
RunObject = page "Customer Disc. Groups";
+ Tooltip = 'Open the Customer Discount Groups page.';
}
}
group("Group19")
@@ -861,24 +978,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Setup';
RunObject = page "Catalog Item Setup";
+ Tooltip = 'Open the Nonstock Item Setup page.';
}
action("Item Charges")
{
ApplicationArea = ItemCharges;
Caption = 'Item Charges';
RunObject = page "Item Charges";
+ Tooltip = 'Open the Item Charges page.';
}
action("Item Disc. Groups1")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Inventory Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Setup';
RunObject = page "Inventory Setup";
+ Tooltip = 'Open the Inventory Setup page.';
}
}
group("Group20")
@@ -889,99 +1010,115 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite, RelationshipMgmt;
Caption = 'Marketing Setup';
RunObject = page "Marketing Setup";
+ Tooltip = 'Open the Marketing Setup page.';
}
action("Interaction Template Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Template Setup';
RunObject = page "Interaction Template Setup";
+ Tooltip = 'Open the Interaction Template Setup page.';
}
action("Business Relations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Business Relations';
RunObject = page "Business Relations";
+ Tooltip = 'Open the Business Relations page.';
}
action("Industry Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Industry Groups';
RunObject = page "Industry Groups";
+ Tooltip = 'Open the Industry Groups page.';
}
action("Web Sources")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Web Sources';
RunObject = page "Web Sources";
+ Tooltip = 'Open the Web Sources page.';
}
action("Job Responsibilities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Job Responsibilities';
RunObject = page "Job Responsibilities";
+ Tooltip = 'Open the Job Responsibilities page.';
}
action("Organizational Levels")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Organizational Levels';
RunObject = page "Organizational Levels";
+ Tooltip = 'Open the Organizational Levels page.';
}
action("Interaction Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Groups';
RunObject = page "Interaction Groups";
+ Tooltip = 'Open the Interaction Groups page.';
}
action("Interaction Templates")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Templates';
RunObject = page "Interaction Templates";
+ Tooltip = 'Open the Interaction Templates page.';
}
action("Salutations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Salutations';
RunObject = page "Salutations";
+ Tooltip = 'Open the Salutations page.';
}
action("Mailing Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Mailing Groups';
RunObject = page "Mailing Groups";
+ Tooltip = 'Open the Mailing Groups page.';
}
action("Status")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Status';
RunObject = page "Campaign Status";
+ Tooltip = 'Open the Campaign Status page.';
}
action("Sales Cycles")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycles';
RunObject = page "Sales Cycles";
+ Tooltip = 'Open the Sales Cycles page.';
}
action("Close Opportunity Codes")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Close Opportunity Codes';
RunObject = page "Close Opportunity Codes";
+ Tooltip = 'Open the Close Opportunity Codes page.';
}
action("Questionnaire Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire Setup';
RunObject = page "Profile Questionnaires";
+ Tooltip = 'Open the Questionnaire Setup page.';
}
action("Activities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Activities';
RunObject = page "Activity List";
+ Tooltip = 'Open the Activities page.';
}
}
}
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Layers/CH/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al b/src/Layers/CH/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
index 80b1f8dcad..75fa2f43e8 100644
--- a/src/Layers/CH/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
+++ b/src/Layers/CH/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -68,53 +68,53 @@ page 9001 "Accounting Manager Role Center"
{
area(rolecenter)
{
- part(Control1902304208; "Account Manager Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part(Control99; "Finance Performance")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control103; "Trailing Sales Orders Chart")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control106; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control100; "Cash Flow Forecast Chart")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1907692008; "My Customers")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1902476008; "My Vendors")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control108; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- systempart(Control1901377608; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
+ part(Control1902304208; "Account Manager Activities")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part("User Tasks Activities"; "User Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part(Control99; "Finance Performance")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control103; "Trailing Sales Orders Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control106; "My Job Queue")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control100; "Cash Flow Forecast Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1907692008; "My Customers")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1902476008; "My Vendors")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control108; "Report Inbox Part")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ systempart(Control1901377608; MyNotes)
+ {
+ ApplicationArea = Basic, Suite;
+ }
}
}
diff --git a/src/Layers/CH/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/CH/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index 9d6e6c6364..a2939da0be 100644
--- a/src/Layers/CH/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/CH/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -1,3 +1,4 @@
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -98,7 +99,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
@@ -2629,7 +2629,7 @@ page 8901 "Finance Manager Role Center"
action("General Business")
{
ApplicationArea = Basic, Suite;
- Caption = 'Gen. Business Posting Groups';
+ Caption = 'General Business Posting Groups';
RunObject = page "Gen. Business Posting Groups";
Tooltip = 'Open the Gen. Business Posting Groups page.';
}
diff --git a/src/Layers/CH/BaseApp/Purchases/Document/PurchaseQuote.Page.al b/src/Layers/CH/BaseApp/Purchases/Document/PurchaseQuote.Page.al
index dd78155be0..df0943e742 100644
--- a/src/Layers/CH/BaseApp/Purchases/Document/PurchaseQuote.Page.al
+++ b/src/Layers/CH/BaseApp/Purchases/Document/PurchaseQuote.Page.al
@@ -1618,6 +1618,13 @@ page 49 "Purchase Quote"
OnAfterActivateFields();
end;
+ local procedure SetPurchaseLinesAvailability()
+ begin
+ IsPurchaseLinesEditable := Rec.PurchaseLinesEditable();
+
+ OnAfterSetPurchaseLinesAvailability(Rec, IsPurchaseLinesEditable);
+ end;
+
local procedure ApproveCalcInvDisc()
begin
CurrPage.PurchLines.PAGE.ApproveCalcInvDisc();
@@ -1672,7 +1679,7 @@ page 49 "Purchase Quote"
WorkflowWebhookManagement.GetCanRequestAndCanCancel(Rec.RecordId, CanRequestApprovalForFlow, CanCancelApprovalForFlow);
HasIncomingDocument := Rec."Incoming Document Entry No." <> 0;
- IsPurchaseLinesEditable := Rec.PurchaseLinesEditable();
+ SetPurchaseLinesAvailability();
end;
local procedure ValidateShippingOption()
@@ -1727,6 +1734,11 @@ page 49 "Purchase Quote"
begin
end;
+ [IntegrationEvent(true, false)]
+ local procedure OnAfterSetPurchaseLinesAvailability(var PurchaseHeader: Record "Purchase Header"; var PurchaseLinesAvailable: Boolean)
+ begin
+ end;
+
[IntegrationEvent(false, false)]
local procedure OnBeforeValidateShipToOptions(var PurchaseHeader: Record "Purchase Header"; ShipToOptions: Option)
begin
diff --git a/src/Layers/CH/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al b/src/Layers/CH/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
index 684fa6dd82..b152a8871c 100644
--- a/src/Layers/CH/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
+++ b/src/Layers/CH/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
@@ -77,6 +77,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'System Information';
RunObject = page "Latest Error";
+ Tooltip = 'Open the System Information page.';
}
action("Table Information")
{
@@ -90,30 +91,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Extension Management';
RunObject = page "Extension Management";
+ Tooltip = 'Open the Extension Management page.';
}
action("Profiles")
{
ApplicationArea = Basic, Suite;
Caption = 'Profiles (Roles)';
RunObject = page "Profile List";
+ Tooltip = 'Open the Profiles (Roles) page.';
}
action("Devices")
{
ApplicationArea = Basic, Suite;
Caption = 'Devices';
RunObject = page "Devices";
+ Tooltip = 'Open the Devices page.';
}
action("Control Add-ins")
{
- ApplicationArea = Basic, Suite;
+ ApplicationArea = All;
Caption = 'Control Add-ins';
RunObject = page "Control Add-ins";
+ Tooltip = 'Open the Control Add-ins page.';
}
action("Get the Mobile Device App (Tablet and Phone activatation code)")
{
ApplicationArea = All;
Caption = 'Mobile device activation and app';
RunObject = page "O365 Device Setup";
+ Tooltip = 'Open the Mobile device activation and app page.';
}
action("Printer Management")
{
@@ -131,60 +137,70 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Online Map Setup';
RunObject = page "Online Map Setup";
+ Tooltip = 'Open the Online Map Setup page.';
}
action("Bank Export/Import Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Bank Export/Import Setup';
RunObject = page "Bank Export/Import Setup";
+ Tooltip = 'Open the Bank Export/Import Setup page.';
}
action("Cue Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Cue Setup';
RunObject = page "Cue Setup Administrator";
+ Tooltip = 'Open the Cue Setup page.';
}
action("Document Sending Profiles")
{
ApplicationArea = Basic, Suite;
Caption = 'Document Sending Profiles';
RunObject = page "Document Sending Profiles";
+ Tooltip = 'Open the Document Sending Profiles page.';
}
action("Printer Selections")
{
ApplicationArea = Suite;
Caption = 'Printer Selections';
RunObject = page "Printer Selections";
+ Tooltip = 'Open the Printer Selections page.';
}
action("Electronic Document Formats")
{
ApplicationArea = Suite;
Caption = 'Electronic Document Formats';
RunObject = page "Electronic Document Format";
+ Tooltip = 'Open the Electronic Document Formats page.';
}
action("Assisted Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Assisted Setup';
RunObject = page "Assisted Setup";
+ Tooltip = 'Open the Assisted Setup page.';
}
action("Application Area")
{
ApplicationArea = All;
Caption = 'Application Area';
RunObject = page "Application Area";
+ Tooltip = 'Open the Application Area page.';
}
action("Set Up Customer/Vendor/Item Templates")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Vendor/Item Templates';
RunObject = page "Config Templates";
+ Tooltip = 'Open the Customer/Vendor/Item Templates page.';
}
action("Transformation Rules")
{
ApplicationArea = Basic, Suite;
Caption = 'Transformation Rules';
RunObject = page "Transformation Rules";
+ Tooltip = 'Open the Transformation Rules page.';
}
action("Business Setup")
{
@@ -198,6 +214,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Image Analysis Setup';
RunObject = page "Image Analysis Setup";
+ Tooltip = 'Open the Image Analysis Setup page.';
}
}
group("Group4")
@@ -208,18 +225,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Entries';
RunObject = page "Job Queue Entries";
+ Tooltip = 'Open the Job Queue Entries page.';
}
action("Job Queue Log Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Log Entries';
RunObject = page "Job Queue Log Entries";
+ Tooltip = 'Open the Job Queue Log Entries page.';
}
action("Job Queue Category List")
{
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Category List';
RunObject = page "Job Queue Category List";
+ Tooltip = 'Open the Job Queue Category List page.';
}
action("Scheduled Tasks")
{
@@ -237,12 +257,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Change Log Setup';
RunObject = page "Change Log Setup";
+ Tooltip = 'Open the Change Log Setup page.';
}
action("Change Log")
{
ApplicationArea = Basic, Suite;
Caption = 'Change Log Entries';
RunObject = page "Change Log Entries";
+ Tooltip = 'Open the Change Log Entries page.';
}
}
group("Group6")
@@ -253,12 +275,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Layout Selection';
RunObject = page "Report Layout Selection";
+ Tooltip = 'Open the Report Layout Selection page.';
}
action("Report Configuration")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Settings';
RunObject = page "Report Settings";
+ Tooltip = 'Open the Report Settings page.';
AccessByPermission = TableData "Object Options" = IMD;
}
action("Report Inbox")
@@ -266,6 +290,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Inbox';
RunObject = page "Report Inbox";
+ Tooltip = 'Open the Report Inbox page.';
}
#if not CLEAN28
action("Custom Report Layouts")
@@ -278,6 +303,7 @@ page 8900 "Administrator Main Role Center"
#pragma warning disable AL0432
RunObject = page "Custom Report Layouts";
#pragma warning restore AL0432
+ Tooltip = 'Open the Custom Report Layouts page.';
}
#endif
action("Report Selection Purchase")
@@ -285,30 +311,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Purchase';
RunObject = page "Report Selection - Purchase";
+ Tooltip = 'Open the Report Selections Purchase page.';
}
action("Report Selection Reminder and")
{
ApplicationArea = Suite;
Caption = 'Report Selections Reminder/Fin. Charge';
RunObject = page "Report Selection - Reminder";
+ Tooltip = 'Open the Report Selections Reminder/Fin. Charge page.';
}
action("Report Selection Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Sales';
RunObject = page "Report Selection - Sales";
+ Tooltip = 'Open the Report Selections Sales page.';
}
action("Report Selection - Bank Acc.")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Bank Account';
RunObject = page "Report Selection - Bank Acc.";
+ Tooltip = 'Open the Report Selections Bank Account page.';
}
action("Report Selections Inventory")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Inventory';
RunObject = page "Report Selection - Inventory";
+ Tooltip = 'Open the Report Selections Inventory page.';
}
}
group("Group7")
@@ -319,19 +350,15 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Test Tool';
RunObject = page "CAL Test Tool";
+ Tooltip = 'Open the Test Tool page.';
}
action("Code Coverage")
{
ApplicationArea = All;
Caption = 'Code Coverage';
RunObject = page "Code Coverage";
+ Tooltip = 'Open the Code Coverage page.';
}
- // action("Sessions")
- // {
- // ApplicationArea = All;
- // Caption = 'Sessions';
- // RunObject = codeunit 9500;
- // }
}
action("Feature Management")
{
@@ -352,54 +379,63 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Company Information';
RunObject = page "Company Information";
+ Tooltip = 'Open the Company Information page.';
}
action("Companies")
{
ApplicationArea = Basic, Suite;
Caption = 'Companies';
RunObject = page "Companies";
+ Tooltip = 'Open the Companies page.';
}
action("No. Series")
{
ApplicationArea = Basic, Suite;
Caption = 'No. Series';
RunObject = page "No. Series";
+ Tooltip = 'Open the No. Series page.';
}
action("Post Codes")
{
ApplicationArea = Basic, Suite;
Caption = 'Post Codes';
RunObject = page "Post Codes";
+ Tooltip = 'Open the Post Codes page.';
}
action("Territories")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Territories';
RunObject = page "Territories";
+ Tooltip = 'Open the Territories page.';
}
action("Languages")
{
ApplicationArea = Suite;
Caption = 'Languages';
RunObject = page "Languages";
+ Tooltip = 'Open the Languages page.';
}
action("Countries/Regions")
{
ApplicationArea = Basic, Suite;
Caption = 'Countries/Regions';
RunObject = page "Countries/Regions";
+ Tooltip = 'Open the Countries/Regions page.';
}
action("Base Calendar Entries Subform")
{
ApplicationArea = Basic, Suite;
Caption = 'Base Calendar';
RunObject = page "Base Calendar List";
+ Tooltip = 'Open the Base Calendar page.';
}
action("Responsibility Centers")
{
- ApplicationArea = All;
+ ApplicationArea = Basic, Suite;
Caption = 'Responsibility Centers';
RunObject = page "Responsibility Center List";
+ Tooltip = 'Open the Responsibility Centers page.';
}
}
group("Group10")
@@ -410,13 +446,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Data Encryption Management';
RunObject = page "Data Encryption Management";
- // AccessByPermission = system 5420 = X;
+ Tooltip = 'Open the Data Encryption Management page.';
}
action("Data Classification Worksheet")
{
ApplicationArea = All;
Caption = 'Data Classification Worksheet';
RunObject = page "Data Classification Worksheet";
+ Tooltip = 'Open the Data Classification Worksheet page.';
AccessByPermission = TableData "Data Sensitivity" = R;
}
action("Privacy for App Integrations")
@@ -431,12 +468,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'XML Schemas';
RunObject = page "XML Schemas";
+ Tooltip = 'Open the XML Schemas page.';
}
action("SEPA Schema Viewer")
{
ApplicationArea = Basic, Suite;
Caption = 'SEPA Schema Viewer';
RunObject = page "XML Schema Viewer";
+ Tooltip = 'Open the SEPA Schema Viewer page.';
}
}
group("Group11")
@@ -447,18 +486,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Data Migration Overview';
RunObject = page "Data Migration Overview";
+ Tooltip = 'Open the Data Migration Overview page.';
}
action("Data Migration")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Migration';
RunObject = page "Data Migration Wizard";
+ Tooltip = 'Open the Data Migration page.';
}
action("Data Migration Settings")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Migration Settings';
RunObject = page "Data Migration Settings";
+ Tooltip = 'Open the Data Migration Settings page.';
AccessByPermission = TableData "Data Migration Setup" = R;
}
}
@@ -470,24 +512,28 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Import from a Data File';
RunObject = page "Import Data";
+ Tooltip = 'Open the Import from a Data File page.';
}
action("Export to a Data File")
{
ApplicationArea = Basic, Suite;
Caption = 'Export to a Data File';
RunObject = page "Export Data";
+ Tooltip = 'Open the Export to a Data File page.';
}
action("Data Exchange Types")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Exchange Types';
RunObject = page "Data Exchange Types";
+ Tooltip = 'Open the Data Exchange Types page.';
}
action("Data Exchange Definition")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Exchange Definitions';
RunObject = page "Data Exch Def List";
+ Tooltip = 'Open the Data Exchange Definitions page.';
}
}
group("Group13")
@@ -501,18 +547,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Customers...';
RunObject = report "Create Conts. from Customers";
+ Tooltip = 'Run the Create Contacts from Customers report.';
}
action("Create Contacts from Vendors")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Vendors...';
RunObject = report "Create Conts. from Vendors";
+ Tooltip = 'Run the Create Contacts from Vendors report.';
}
action("Create Contacts from Bank Acco")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Bank Accounts...';
RunObject = report "Create Conts. from Bank Accs.";
+ Tooltip = 'Run the Create Contacts from Bank Accounts report.';
}
}
}
@@ -527,6 +576,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Date Compr. Registers';
RunObject = page "Date Compr. Registers";
+ Tooltip = 'Open the Date Compr. Registers page.';
}
}
group("Group17")
@@ -537,6 +587,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Delete Orphaned Record Links';
RunObject = codeunit "Remove Orphaned Record Links";
+ Tooltip = 'Run the Delete Orphaned Record Links codeunit.';
}
}
group("Group18")
@@ -547,12 +598,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Profile Customizations';
RunObject = page "Profile Customization List";
+ Tooltip = 'Open the Profile Customizations page.';
}
action("User Page Personalizations")
{
ApplicationArea = Basic, Suite;
Caption = 'User Page Personalizations';
RunObject = page "Personalized Pages";
+ Tooltip = 'Open the User Page Personalizations page.';
}
}
}
@@ -565,18 +618,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Users';
RunObject = page "Users";
+ Tooltip = 'Open the Users page.';
}
action("User Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'User Setup';
RunObject = page "User Setup";
+ Tooltip = 'Open the User Setup page.';
}
action("User Security Status")
{
ApplicationArea = Basic, Suite;
Caption = 'User Security Status';
RunObject = page "User Security Status List";
+ Tooltip = 'Open the User Security Status page.';
AccessByPermission = TableData "User" = R;
}
action("User Tasks")
@@ -584,18 +640,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'User Tasks';
RunObject = page "User Task List";
+ Tooltip = 'Open the User Tasks page.';
}
action("User Personalization")
{
ApplicationArea = Basic, Suite;
Caption = 'User Settings';
RunObject = page "User Settings List";
+ Tooltip = 'Open the User Settings page.';
}
action("User Time Registers")
{
ApplicationArea = Basic, Suite;
Caption = 'Time Registers';
RunObject = page "User Time Registers";
+ Tooltip = 'Open the Time Registers page.';
}
}
group(Permissions)
@@ -637,30 +696,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflows';
RunObject = page "Workflows";
+ Tooltip = 'Open the Workflows page.';
}
action("Workflow User Group")
{
ApplicationArea = Suite;
Caption = 'Workflow User Groups';
RunObject = page "Workflow User Groups";
+ Tooltip = 'Open the Workflow User Groups page.';
}
action("Approval User Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Approval User Setup';
RunObject = page "Approval User Setup";
+ Tooltip = 'View or edit information about workflow users who are involved in approval processes, such as approval amount limits for specific types of requests and substitute approvers to whom approval requests are delegated when the original approver is absent.';
}
action("Incoming Documents Setup")
{
ApplicationArea = Suite;
Caption = 'Incoming Documents Setup';
RunObject = page "Incoming Documents Setup";
+ Tooltip = 'Open the Incoming Documents Setup page.';
}
action("Send Overdue Appr. Notif.")
{
ApplicationArea = Suite;
Caption = 'Send Overdue Approval Notifications';
RunObject = report "Send Overdue Appr. Notif.";
+ Tooltip = 'Run the Send Overdue Approval Notifications report.';
}
group("Group21")
{
@@ -670,12 +734,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflow Templates';
RunObject = page "Workflow Templates";
+ Tooltip = 'Open the Workflow Templates page.';
}
action("Workflow Categories")
{
ApplicationArea = Suite;
Caption = 'Workflow Categories';
RunObject = page "Workflow Categories";
+ Tooltip = 'Open the Workflow Categories page.';
}
}
group("Group22")
@@ -686,18 +752,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflow Event Hierarchies';
RunObject = page "Workflow Event Hierarchies";
+ Tooltip = 'Open the Workflow Event Hierarchies page.';
}
action("WF Event/Response Combinations")
{
ApplicationArea = Suite;
Caption = 'Workflow Event/Response Combinations';
RunObject = page "WF Event/Response Combinations";
+ Tooltip = 'Open the Workflow Event/Response Combinations page.';
}
action("Workflow - Table Relations")
{
ApplicationArea = Suite;
Caption = 'Workflow - Table Relations';
RunObject = page "Workflow - Table Relations";
+ Tooltip = 'Open the Workflow - Table Relations page.';
}
}
group("Group23")
@@ -708,18 +777,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Notification Setup';
RunObject = page "Notification Setup";
+ Tooltip = 'Open the Notification Setup page.';
}
action("Notification Entries")
{
ApplicationArea = Suite;
Caption = 'Notification Entries';
RunObject = page "Notification Entries";
+ Tooltip = 'Open the Notification Entries page.';
}
action("Sent Notification Entries")
{
ApplicationArea = Suite;
Caption = 'Sent Notification Entries';
RunObject = page "Sent Notification Entries";
+ Tooltip = 'Open the Sent Notification Entries page.';
}
}
group("Group24")
@@ -730,36 +802,42 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Approval Entries';
RunObject = page "Approval Entries";
+ Tooltip = 'Open the Approval Entries page.';
}
action("Posted Approval Entries")
{
ApplicationArea = Suite;
Caption = 'Posted Approval Entries';
RunObject = page "Posted Approval Entries";
+ Tooltip = 'Open the Posted Approval Entries page.';
}
action("Overdue Approval Entries")
{
ApplicationArea = Suite;
Caption = 'Overdue Approval Entries';
RunObject = page "Overdue Approval Entries";
+ Tooltip = 'Open the Overdue Approval Entries page.';
}
action("Restricted Records")
{
ApplicationArea = Suite;
Caption = 'Restricted Records';
RunObject = page "Restricted Records";
+ Tooltip = 'Open the Restricted Records page.';
}
action("Workflow Step Instances")
{
ApplicationArea = Suite;
Caption = 'Workflow Step Instances';
RunObject = page "Workflow Step Instances";
+ Tooltip = 'Open the Workflow Step Instances page.';
}
action("Archived Workflow Step Instances")
{
ApplicationArea = Suite;
Caption = 'Archived Workflow Step Instances';
RunObject = page "Archived WF Step Instances";
+ Tooltip = 'Open the Archived Workflow Step Instances page.';
}
}
group("Group26")
@@ -770,12 +848,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Dynamic Request Page Entities';
RunObject = page "Dynamic Request Page Entities";
+ Tooltip = 'Open the Dynamic Request Page Entities page.';
}
action("Dynamic Request page Fields")
{
ApplicationArea = Basic, Suite;
Caption = 'Dynamic Request Page Fields';
RunObject = page "Dynamic Request Page Fields";
+ Tooltip = 'Open the Dynamic Request Page Fields page.';
}
}
}
@@ -787,12 +867,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Web Services';
RunObject = page "Web Services";
+ Tooltip = 'Open the Web Services page.';
}
action("Microsoft Dynamics 365 Connection Setup")
{
ApplicationArea = Suite;
Caption = 'Microsoft Dynamics 365 Connection Setup';
RunObject = page "CRM Connection Setup";
+ Tooltip = 'Open the Microsoft Dynamics 365 Connection Setup page.';
AccessByPermission = TableData "CRM Connection Setup" = IM;
}
action("Email Account Setup")
@@ -808,72 +890,84 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'OCR Service Setup';
RunObject = page "OCR Service Setup";
+ Tooltip = 'Open the OCR Service Setup page.';
}
action("Currency Exchange Rate Services")
{
ApplicationArea = Suite;
Caption = 'Currency Exchange Rate Services';
RunObject = page "Curr. Exch. Rate Service List";
+ Tooltip = 'Open the Currency Exchange Rate Services page.';
}
action("Service Connections Overview")
{
ApplicationArea = Basic, Suite;
Caption = 'Service Connections';
RunObject = page "Service Connections";
+ Tooltip = 'Open the Service Connections page.';
}
action("Doc. Exch. Service Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Document Exchange Service Setup';
RunObject = page "Doc. Exch. Service Setup";
+ Tooltip = 'Open the Document Exchange Service Setup page.';
}
action("Integration Table Mappings")
{
ApplicationArea = Suite;
Caption = 'Integration Table Mappings';
RunObject = page "Integration Table Mapping List";
+ Tooltip = 'Open the Integration Table Mappings page.';
}
action("Integration Synchronization Jobs")
{
ApplicationArea = Suite;
Caption = 'Integration Synchronization Jobs';
RunObject = page "Integration Synch. Job List";
+ Tooltip = 'Open the Integration Synchronization Jobs page.';
}
action("Integration Synchronization Errors")
{
ApplicationArea = Suite;
Caption = 'Integration Synchronization Errors';
RunObject = page "Integration Synch. Error List";
+ Tooltip = 'Open the Integration Synchronization Errors page.';
}
action("Online Payments")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Services';
RunObject = page "Payment Services";
+ Tooltip = 'Open the Payment Services page.';
}
action("VAT Registration Service (VIES) Setting")
{
ApplicationArea = Basic, Suite;
Caption = 'VAT Registration Service (VIES) Setting';
RunObject = page "VAT Registration Config";
+ Tooltip = 'Open the VAT Registration Service (VIES) Setting page.';
}
action("API Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'API Setup';
RunObject = page "API Setup";
+ Tooltip = 'Open the API Setup page.';
}
action("Account Schedule KPI Web Servi")
{
ApplicationArea = Basic, Suite;
Caption = 'Account Schedule KPI Web Service Setup';
RunObject = page "Acc. Sched. KPI Web Srv. Setup";
+ Tooltip = 'Open the Account Schedule KPI Web Service Setup page.';
}
action("Acc. Sched. KPI Web Service")
{
ApplicationArea = Basic, Suite;
Caption = 'Account Schedule KPI Web Service';
RunObject = page "Acc. Sched. KPI Web Service";
+ Tooltip = 'Open the Account Schedule KPI Web Service page.';
}
}
group("Group27A")
@@ -974,48 +1068,56 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Configuration Questionnaire';
RunObject = page "Config. Questionnaire";
+ Tooltip = 'Open the Configuration Questionnaire page.';
}
action("Data Migration1")
{
ApplicationArea = Suite;
Caption = 'Configuration Packages';
RunObject = page "Config. Packages";
+ Tooltip = 'Open the Configuration Packages page.';
}
action("Setup Master Templates")
{
ApplicationArea = Basic, Suite;
Caption = 'Configuration Templates';
RunObject = page "Config. Template List";
+ Tooltip = 'Open the Configuration Templates page.';
}
action("Create G/L acc. Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create G/L Acc. Journal Lines';
RunObject = report "Create G/L Acc. Journal Lines";
+ Tooltip = 'Run the Create G/L Acc. Journal Lines report.';
}
action("Create Customer Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Customer Journal Lines';
RunObject = report "Create Customer Journal Lines";
+ Tooltip = 'Run the Create Customer Journal Lines report.';
}
action("Create Vendor Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Vendor Journal Lines';
RunObject = report "Create Vendor Journal Lines";
+ Tooltip = 'Run the Create Vendor Journal Lines report.';
}
action("Create Item Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Item Journal Lines';
RunObject = report "Create Item Journal Lines";
+ Tooltip = 'Run the Create Item Journal Lines report.';
}
action("Configuration Worksheet")
{
ApplicationArea = Suite;
Caption = 'Configuration Worksheet';
RunObject = page "Config. Worksheet";
+ Tooltip = 'Open the Configuration Worksheet page.';
}
}
}
diff --git a/src/Layers/CH/BaseApp/Sales/Customer/Customer.Table.al b/src/Layers/CH/BaseApp/Sales/Customer/Customer.Table.al
index 845fba3e44..ea0352553f 100644
--- a/src/Layers/CH/BaseApp/Sales/Customer/Customer.Table.al
+++ b/src/Layers/CH/BaseApp/Sales/Customer/Customer.Table.al
@@ -2475,6 +2475,7 @@ table 18 Customer
UpdateReferencedIds();
SetLastModifiedDateTime();
if IsContactUpdateNeeded() then begin
+ OnBeforeModifyContactUpdate(Rec);
Modify();
UpdateContFromCust.OnModify(Rec);
if not Find() then begin
@@ -2484,6 +2485,11 @@ table 18 Customer
end;
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnBeforeModifyContactUpdate(var Customer: Record Customer)
+ begin
+ end;
+
trigger OnRename()
var
IsHandled: Boolean;
diff --git a/src/Layers/CH/BaseApp/Sales/Customer/CustomerBankAccount.Table.al b/src/Layers/CH/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
index 419d809c72..08a8232ce8 100644
--- a/src/Layers/CH/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
+++ b/src/Layers/CH/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -517,4 +517,5 @@ table 287 "Customer Bank Account"
local procedure OnBeforeValidatePostCode(var CustomerBankAccount: Record "Customer Bank Account"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
begin
end;
+
}
diff --git a/src/Layers/CH/BaseApp/Sales/Customer/CustomerTempl.Table.al b/src/Layers/CH/BaseApp/Sales/Customer/CustomerTempl.Table.al
index 94f8767029..ae94a7f353 100644
--- a/src/Layers/CH/BaseApp/Sales/Customer/CustomerTempl.Table.al
+++ b/src/Layers/CH/BaseApp/Sales/Customer/CustomerTempl.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -899,4 +899,5 @@ table 1381 "Customer Templ."
local procedure OnCopyTemplateOnBeforeModify(SourceCustomerTempl: Record "Customer Templ."; SavedCustomerTempl: Record "Customer Templ."; var CustomerTempl: Record "Customer Templ.")
begin
end;
+
}
diff --git a/src/Layers/CH/BaseApp/Sales/Document/SalesHeader.Table.al b/src/Layers/CH/BaseApp/Sales/Document/SalesHeader.Table.al
index a80a925abb..418ed2dab0 100644
--- a/src/Layers/CH/BaseApp/Sales/Document/SalesHeader.Table.al
+++ b/src/Layers/CH/BaseApp/Sales/Document/SalesHeader.Table.al
@@ -329,6 +329,7 @@ table 36 "Sales Header"
Validate("Payment Terms Code");
Validate("Prepmt. Payment Terms Code");
Validate("Payment Method Code");
+ OnAfterValidateBillToCustomerPaymentFields(Rec);
Validate("Prepayment %");
if (xRec."Sell-to Customer No." = "Sell-to Customer No.") and
@@ -10441,6 +10442,11 @@ table 36 "Sales Header"
begin
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnAfterValidateBillToCustomerPaymentFields(var SalesHeader: Record "Sales Header")
+ begin
+ end;
+
///
/// Raised after extended text is transferred for sales line recreation.
///
diff --git a/src/Layers/CZ/BaseApp/Sales/Document/SalesHeader.Table.al b/src/Layers/CZ/BaseApp/Sales/Document/SalesHeader.Table.al
index 326436a8fa..b23e344ce6 100644
--- a/src/Layers/CZ/BaseApp/Sales/Document/SalesHeader.Table.al
+++ b/src/Layers/CZ/BaseApp/Sales/Document/SalesHeader.Table.al
@@ -328,6 +328,7 @@ table 36 "Sales Header"
Validate("Payment Terms Code");
Validate("Prepmt. Payment Terms Code");
Validate("Payment Method Code");
+ OnAfterValidateBillToCustomerPaymentFields(Rec);
Validate("Prepayment %");
if (xRec."Sell-to Customer No." = "Sell-to Customer No.") and
@@ -10356,6 +10357,11 @@ table 36 "Sales Header"
begin
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnAfterValidateBillToCustomerPaymentFields(var SalesHeader: Record "Sales Header")
+ begin
+ end;
+
///
/// Raised after extended text is transferred for sales line recreation.
///
diff --git a/src/Layers/DACH/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al b/src/Layers/DACH/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
index af9c4cf206..e271a000d4 100644
--- a/src/Layers/DACH/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
+++ b/src/Layers/DACH/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
@@ -64,36 +64,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Salespeople")
{
ApplicationArea = Suite;
Caption = 'Salespeople/Purchasers';
RunObject = page "Salespersons/Purchasers";
+ Tooltip = 'Open the Salespeople/Purchasers page.';
}
action("Teams")
{
ApplicationArea = Basic, Suite;
Caption = 'Teams';
RunObject = page "Teams";
+ Tooltip = 'Open the Teams page.';
}
action("Tasks")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Opportunities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
group("Group1")
{
@@ -103,36 +109,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesBudget;
Caption = 'Sales Budgets';
RunObject = page "Budget Names Sales";
+ Tooltip = 'Open the Sales Budgets page.';
}
action("Sales Analysis Reports")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Reports';
RunObject = page "Analysis Report Sale";
+ Tooltip = 'Open the Sales Analysis Reports page.';
}
action("Sales Analysis by Dimensions")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Item Dimensions - Detail")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Detail';
RunObject = report "Item Dimensions - Detail";
+ Tooltip = 'Run the Item Dimensions - Detail report.';
}
action("Item Dimensions - Total")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Total';
RunObject = report "Item Dimensions - Total";
+ Tooltip = 'Run the Item Dimensions - Total report.';
}
action("Opportunities Matrix")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Analysis';
RunObject = page "Opportunities";
+ Tooltip = 'Open the Opportunity Analysis page.';
}
}
group("Group2")
@@ -143,6 +155,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Deferral Summary';
RunObject = report "Deferral Summary - Sales";
+ Tooltip = 'Run the Sales Deferral Summary report.';
}
group("Group3")
{
@@ -152,18 +165,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Tasks';
RunObject = report "Salesperson - Tasks";
+ Tooltip = 'Run the Salesperson Tasks report.';
}
action("Salesperson - Commission")
{
ApplicationArea = Suite;
Caption = 'Salesperson Commission';
RunObject = report "Salesperson - Commission";
+ Tooltip = 'Run the Salesperson Commission report.';
}
action("Salesperson - Opportunities")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Opportunities';
RunObject = report "Salesperson - Opportunities";
+ Tooltip = 'Run the Salesperson Opportunities report.';
}
#if not CLEAN28
action("Sales Statistics")
@@ -174,6 +190,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
#endif
action("Team - Tasks")
@@ -181,12 +198,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Team Tasks';
RunObject = report "Team - Tasks";
+ Tooltip = 'Run the Team Tasks report.';
}
action("Salesperson - Sales Statistics")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Sales Statistics';
RunObject = report "Salesperson - Sales Statistics";
+ Tooltip = 'Run the Salesperson Sales Statistics report.';
}
}
group("Group4")
@@ -197,36 +216,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Contact Labels';
RunObject = report "Contact - Labels";
+ Tooltip = 'Run the Contact Labels report.';
}
action("Contact - Company Summary")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact - Company Summary';
RunObject = report "Contact - Company Summary";
+ Tooltip = 'Run the Contact - Company Summary report.';
}
action("Questionnaire - Handouts")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire - Handouts';
RunObject = report "Questionnaire - Handouts";
+ Tooltip = 'Run the Questionnaire - Handouts report.';
}
action("Contact - List")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact List';
RunObject = report "Contact - List";
+ Tooltip = 'Run the Contact List report.';
}
action("Orgl. Profile Summary")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Person Summary';
RunObject = report "Contact - Person Summary";
+ Tooltip = 'Run the Contact - Person Summary report.';
}
action("Contact - Cover Sheet")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Cover Sheet';
RunObject = report "Contact - Cover Sheet";
+ Tooltip = 'Run the Contact - Cover Sheet report.';
}
}
group("Group5")
@@ -241,6 +266,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - List report.';
}
#endif
action("Customer - Labels")
@@ -248,36 +274,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Customer Labels';
RunObject = report "Customer - Labels";
+ Tooltip = 'Run the Customer Labels report.';
}
action("Customer - Balance to Date")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Balance to Date';
RunObject = report "Customer - Balance to Date";
+ Tooltip = 'Run the Customer - Balance to Date report.';
}
action("Customer - Order Summary")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Summary';
RunObject = report "Customer - Order Summary";
+ Tooltip = 'Run the Customer - Order Summary report.';
}
action("Customer/Item Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Item Sales';
RunObject = report "Customer/Item Sales";
+ Tooltip = 'Run the Customer/Item Sales report.';
}
action("Customer Register")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Register';
RunObject = report "Customer Register";
+ Tooltip = 'Run the Customer Register report.';
}
action("Customer - Order Detail")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Detail';
RunObject = report "Customer - Order Detail";
+ Tooltip = 'Run the Customer - Order Detail report.';
}
#if not CLEAN28
action("Customer - Top 10 List")
@@ -288,6 +320,7 @@ page 8907 "Sales & Marketing Manager RC"
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';
+ Tooltip = 'Run the Customer Top 10 List report.';
}
#endif
action("Customer - Trial Balance")
@@ -295,6 +328,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Trial Balance';
RunObject = report "Customer - Trial Balance";
+ Tooltip = 'Run the Customer Trial Balance report.';
}
#if not CLEAN28
action("Customer - Sales List")
@@ -305,6 +339,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
}
@@ -316,18 +351,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - List';
RunObject = report "Opportunity - List";
+ Tooltip = 'Run the Opportunity - List report.';
}
action("Opportunity - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - Details';
RunObject = report "Opportunity - Details";
+ Tooltip = 'Run the Opportunity - Details report.';
}
action("Sales Cycle - Analysis")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycle - Analysis';
RunObject = report "Sales Cycle - Analysis";
+ Tooltip = 'Run the Sales Cycle - Analysis report.';
}
}
}
@@ -340,60 +378,70 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts1")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Quotes")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quotes';
RunObject = page "Sales Quotes";
+ Tooltip = 'Open the Sales Quotes page.';
}
action("Orders")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Orders';
RunObject = page "Sales Order List";
+ Tooltip = 'Open the Sales Orders page.';
}
action("Blanket Orders")
{
ApplicationArea = Suite;
Caption = 'Blanket Sales Orders';
RunObject = page "Blanket Sales Orders";
+ Tooltip = 'Open the Blanket Sales Orders page.';
}
action("Return Orders")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Sales Return Orders';
RunObject = page "Sales Return Order List";
+ Tooltip = 'Open the Sales Return Orders page.';
}
action("Invoices")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Invoices';
RunObject = page "Sales Invoice List";
+ Tooltip = 'Open the Sales Invoices page.';
}
action("Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Credit Memos';
RunObject = page "Sales Credit Memos";
+ Tooltip = 'Open the Sales Credit Memos page.';
}
action("Certificates of Supply")
{
ApplicationArea = Basic, Suite;
Caption = 'Certificates of Supply';
RunObject = page "Certificates of Supply";
+ Tooltip = 'Open the Certificates of Supply page.';
}
action("Order Planning")
{
ApplicationArea = Planning;
Caption = 'Order Planning';
RunObject = page "Order Planning";
+ Tooltip = 'Open the Order Planning page.';
}
group("Group8")
{
@@ -403,24 +451,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Invoices';
RunObject = page "Posted Sales Invoices";
+ Tooltip = 'Open the Posted Sales Invoices page.';
}
action("Posted Sales Shipments")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Shipments';
RunObject = page "Posted Sales Shipments";
+ Tooltip = 'Open the Posted Sales Shipments page.';
}
action("Posted Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Credit Memos';
RunObject = page "Posted Sales Credit Memos";
+ Tooltip = 'Open the Posted Sales Credit Memos page.';
}
action("Posted Return Receipts")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Posted Return Receipts';
RunObject = page "Posted Return Receipts";
+ Tooltip = 'Open the Posted Return Receipts page.';
}
}
group("Group9")
@@ -431,48 +483,56 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'G/L Registers';
RunObject = page "G/L Registers";
+ Tooltip = 'Open the G/L Registers page.';
}
action("Item Tracing")
{
ApplicationArea = ItemTracking;
Caption = 'Item Tracing';
RunObject = page "Item Tracing";
+ Tooltip = 'Open the Item Tracing page.';
}
action("Sales Quote Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quote Archives';
RunObject = page "Sales Quote Archives";
+ Tooltip = 'Open the Sales Quote Archives page.';
}
action("Sales Order Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Order Archives';
RunObject = page "Sales Order Archives";
+ Tooltip = 'Open the Sales Order Archives page.';
}
action("Sales Return Order Archives")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Return Order Archives';
RunObject = page "Sales Return List Archive";
+ Tooltip = 'Open the Sales Return Order Archives page.';
}
action("Customer Ledger Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Ledger Entries';
RunObject = page "Customer Ledger Entries";
+ Tooltip = 'Open the Customer Ledger Entries page.';
}
action("Detailed Cust. Ledg. Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Detailed Customer Ledger Entries';
RunObject = page "Detailed Cust. Ledg. Entries";
+ Tooltip = 'Open the Detailed Customer Ledger Entries page.';
}
action("Value Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Value Entries';
RunObject = page "Value Entries";
+ Tooltip = 'Open the Value Entries page.';
}
action("Navigate")
{
@@ -492,6 +552,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Detail';
RunObject = report "Customer - Order Detail";
+ Tooltip = 'Run the Customer - Order Detail report.';
}
#if not CLEAN28
action("Sales Reservation Avail.")
@@ -502,6 +563,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Reservation Avail. report.';
}
#endif
#if not CLEAN28
@@ -513,6 +575,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
#endif
#if not CLEAN28
@@ -524,6 +587,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
action("EC Sales List")
@@ -531,18 +595,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'EC Sales List';
RunObject = report "EC Sales List";
+ Tooltip = 'Run the EC Sales List report.';
}
action("Customer/Item Sales1")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Item Sales';
RunObject = report "Customer/Item Sales";
+ Tooltip = 'Run the Customer/Item Sales report.';
}
action("Customer - Order Summary1")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Summary';
RunObject = report "Customer - Order Summary";
+ Tooltip = 'Run the Customer - Order Summary report.';
}
}
}
@@ -554,48 +621,56 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Campaigns")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaigns';
RunObject = page "Campaign List";
+ Tooltip = 'Open the Campaigns page.';
}
action("Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Segments';
RunObject = page "Segment List";
+ Tooltip = 'Open the Segments page.';
}
action("Logged Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Logged Segments';
RunObject = page "Logged Segments";
+ Tooltip = 'Open the Logged Segments page.';
}
action("Opportunities1")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
action("Tasks1")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Export Contact")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Export Contact';
RunObject = xmlport "Export Contact";
+ Tooltip = 'Export the contact information.';
}
action("Campaign - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign - Details';
RunObject = report "Campaign - Details";
+ Tooltip = 'Run the Campaign - Details report.';
}
group("Group12")
{
@@ -605,18 +680,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Entries';
RunObject = page "Campaign Entries";
+ Tooltip = 'Open the Campaign Entries page.';
}
action("Opportunity Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Entries';
RunObject = page "Opportunity Entries";
+ Tooltip = 'Open the Opportunity Entries page.';
}
action("Interaction Log Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Log Entries';
RunObject = page "Interaction Log Entries";
+ Tooltip = 'Open the Interaction Log Entries page.';
}
}
}
@@ -628,18 +706,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Items';
RunObject = page "Item List";
+ Tooltip = 'Open the Items page.';
}
action("Nonstock Items")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Items';
RunObject = page "Catalog Item List";
+ Tooltip = 'Open the Nonstock Items page.';
}
action("Item Attributes")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Attributes';
RunObject = page "Item Attributes";
+ Tooltip = 'Open the Item Attributes page.';
}
action("Sales Price Worksheet")
{
@@ -653,6 +734,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Adjust Item Costs/Prices';
RunObject = report "Adjust Item Costs/Prices";
+ Tooltip = 'Run the Adjust Item Costs/Prices report.';
}
group("Group14")
{
@@ -662,42 +744,49 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Inventory Sales Statistics';
RunObject = report "Inventory - Sales Statistics";
+ Tooltip = 'Run the Inventory Sales Statistics report.';
}
action("Inventory Cost and Price List")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Cost and Price List';
RunObject = report "Inventory Cost and Price List";
+ Tooltip = 'Run the Inventory Cost and Price List report.';
}
action("Item Charges - Specification")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Charges - Specification';
RunObject = report "Item Charges - Specification";
+ Tooltip = 'Run the Item Charges - Specification report.';
}
action("Inventory - Customer Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Customer Sales';
RunObject = report "Inventory - Customer Sales";
+ Tooltip = 'Run the Inventory Customer Sales report.';
}
action("Nonstock Item Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Sales';
RunObject = report "Catalog Item Sales";
+ Tooltip = 'Run the Nonstock Item Sales report.';
}
action("Inventory Availability")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Availability';
RunObject = report "Inventory Availability";
+ Tooltip = 'Run the Inventory Availability report.';
}
action("Inventory Order Details")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Order Details';
RunObject = report "Inventory Order Details";
+ Tooltip = 'Run the Inventory Order Details report.';
}
action("Price List")
{
@@ -711,24 +800,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Inventory - Sales Back Orders';
RunObject = report "Inventory - Sales Back Orders";
+ Tooltip = 'Run the Inventory - Sales Back Orders report.';
}
action("Inventory - Top 10 List")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Top 10 List';
RunObject = report "Inventory - Top 10 List";
+ Tooltip = 'Run the Inventory Top 10 List report.';
}
action("Item Substitutions")
{
ApplicationArea = Suite;
Caption = 'Item Substitutions';
RunObject = report "Item Substitutions";
+ Tooltip = 'Run the Item Substitutions report.';
}
action("Item ABC Analysis")
{
ApplicationArea = Basic, Suite;
Caption = 'Item ABC Analysis';
RunObject = report "Item ABC Analysis";
+ Tooltip = 'Run the Item ABC Analysis report.';
}
}
}
@@ -740,54 +833,63 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Orders - Dynamics 365 Sales';
RunObject = page "CRM Sales Order List";
+ Tooltip = 'Open the Sales Orders - Dynamics 365 Sales page.';
}
action("Quotes - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Quotes - Dynamics 365 Sales';
RunObject = page "CRM Sales Quote List";
+ Tooltip = 'Open the Quotes - Dynamics 365 Sales page.';
}
action("Cases - Dynamics 365 for Customer Service")
{
ApplicationArea = Suite;
Caption = 'Cases - Dynamics 365 for Customer Service';
RunObject = page "CRM Case List";
+ Tooltip = 'Open the Cases - Dynamics 365 for Customer Service page.';
}
action("Opportunities - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Opportunities - Dynamics 365 Sales';
RunObject = page "CRM Opportunity List";
+ Tooltip = 'Open the Opportunities - Dynamics 365 Sales page.';
}
action("Accounts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Accounts - Dynamics 365 Sales';
RunObject = page "CRM Account List";
+ Tooltip = 'Open the Accounts - Dynamics 365 Sales page.';
}
action("Transaction Currencies - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Transaction Currencies - Dynamics 365 Sales';
RunObject = page "CRM TransactionCurrency List";
+ Tooltip = 'Open the Transaction Currencies - Dynamics 365 Sales page.';
}
action("Unit Groups - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Unit Groups - Dynamics 365 Sales';
RunObject = page "CRM UnitGroup List";
+ Tooltip = 'Open the Unit Groups - Dynamics 365 Sales page.';
}
action("Products - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Products - Dynamics 365 Sales';
RunObject = page "CRM Product List";
+ Tooltip = 'Open the Products - Dynamics 365 Sales page.';
}
action("Contacts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Contacts - Dynamics 365 Sales';
RunObject = page "CRM Contact List";
+ Tooltip = 'Open the Contacts - Dynamics 365 Sales page.';
}
action("Records Skipped For Synchronization")
{
@@ -795,6 +897,7 @@ page 8907 "Sales & Marketing Manager RC"
Caption = 'Coupled Data Synchronization Errors';
RunObject = page "CRM Skipped Records";
AccessByPermission = TableData "CRM Integration Record" = R;
+ Tooltip = 'Open the Coupled Data Synchronization Errors page.';
}
}
group("Group16")
@@ -805,60 +908,70 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = OrderPromising;
Caption = 'Order Promising Setup';
RunObject = page "Order Promising Setup";
+ Tooltip = 'Open the Order Promising Setup page.';
}
action("Sales & Receivables Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales & Receivables Setup';
RunObject = page "Sales & Receivables Setup";
+ Tooltip = 'Open the Sales & Receivables Setup page.';
}
action("report Selection Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Sales';
RunObject = page "Report Selection - Sales";
+ Tooltip = 'Open the Report Selections Sales page.';
}
action("Standard Sales Codes")
{
ApplicationArea = Suite;
Caption = 'Standard Sales Codes';
RunObject = page "Standard Sales Codes";
+ Tooltip = 'Open the Standard Sales Codes page.';
}
action("Payment Terms")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Terms';
RunObject = page "Payment Terms";
+ Tooltip = 'Open the Payment Terms page.';
}
action("Payment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Methods';
RunObject = page "Payment Methods";
+ Tooltip = 'Open the Payment Methods page.';
}
action("Item Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Shipment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Shipment Methods';
RunObject = page "Shipment Methods";
+ Tooltip = 'Open the Shipment Methods page.';
}
action("Shipping Agents")
{
ApplicationArea = Suite;
Caption = 'Shipping Agents';
RunObject = page "Shipping Agents";
+ Tooltip = 'Open the Shipping Agents page.';
}
action("Return Reasons")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Return Reasons';
RunObject = page "Return Reasons";
+ Tooltip = 'Open the Return Reasons page.';
}
action("Customer Templates")
{
@@ -875,24 +988,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesAnalysis, PurchaseAnalysis, InventoryAnalysis;
Caption = 'Analysis Types';
RunObject = page "Analysis Types";
+ Tooltip = 'Open the Analysis Types page.';
}
action("Sales Analysis by Dimensions1")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Analysis Column Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Column Templates';
RunObject = report "Run Sales Analysis Col. Temp.";
+ Tooltip = 'Run the Sales Analysis Column Templates report.';
}
action("Analysis Line Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Line Templates';
RunObject = report "Run Sales Analysis Line Templ.";
+ Tooltip = 'Run the Sales Analysis Line Templates report.';
}
}
group("Group18")
@@ -903,12 +1020,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Price Groups';
RunObject = page "Customer Price Groups";
+ Tooltip = 'Open the Customer Price Groups page.';
}
action("Customer Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Discount Groups';
RunObject = page "Customer Disc. Groups";
+ Tooltip = 'Open the Customer Discount Groups page.';
}
}
group("Group19")
@@ -919,24 +1038,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Setup';
RunObject = page "Catalog Item Setup";
+ Tooltip = 'Open the Nonstock Item Setup page.';
}
action("Item Charges")
{
ApplicationArea = ItemCharges;
Caption = 'Item Charges';
RunObject = page "Item Charges";
+ Tooltip = 'Open the Item Charges page.';
}
action("Item Disc. Groups1")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Inventory Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Setup';
RunObject = page "Inventory Setup";
+ Tooltip = 'Open the Inventory Setup page.';
}
}
group("Group20")
@@ -947,99 +1070,116 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite, RelationshipMgmt;
Caption = 'Marketing Setup';
RunObject = page "Marketing Setup";
+ Tooltip = 'Open the Marketing Setup page.';
}
action("Interaction Template Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Template Setup';
RunObject = page "Interaction Template Setup";
+ Tooltip = 'Open the Interaction Template Setup page.';
}
action("Business Relations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Business Relations';
RunObject = page "Business Relations";
+ Tooltip = 'Open the Business Relations page.';
}
action("Industry Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Industry Groups';
RunObject = page "Industry Groups";
+ Tooltip = 'Open the Industry Groups page.';
}
action("Web Sources")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Web Sources';
RunObject = page "Web Sources";
+ Tooltip = 'Open the Web Sources page.';
}
action("Job Responsibilities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Job Responsibilities';
RunObject = page "Job Responsibilities";
+ Tooltip = 'Open the Job Responsibilities page.';
}
action("Organizational Levels")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Organizational Levels';
RunObject = page "Organizational Levels";
+ Tooltip = 'Open the Organizational Levels page.';
}
action("Interaction Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Groups';
RunObject = page "Interaction Groups";
+ Tooltip = 'Open the Interaction Groups page.';
}
action("Interaction Templates")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Templates';
RunObject = page "Interaction Templates";
+ Tooltip = 'Open the Interaction Templates page.';
}
action("Salutations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Salutations';
RunObject = page "Salutations";
+ Tooltip = 'Open the Salutations page.';
}
action("Mailing Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Mailing Groups';
RunObject = page "Mailing Groups";
+ Tooltip = 'Open the Mailing Groups page.';
}
action("Status")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Status';
RunObject = page "Campaign Status";
+ Tooltip = 'Open the Campaign Status page.';
}
action("Sales Cycles")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycles';
RunObject = page "Sales Cycles";
+ Tooltip = 'Open the Sales Cycles page.';
}
action("Close Opportunity Codes")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Close Opportunity Codes';
RunObject = page "Close Opportunity Codes";
+ Tooltip = 'Open the Close Opportunity Codes page.';
}
action("Questionnaire Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire Setup';
RunObject = page "Profile Questionnaires";
+ Tooltip = 'Open the Questionnaire Setup page.';
}
action("Activities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Activities';
RunObject = page "Activity List";
+ Tooltip = 'Open the Activities page.';
}
}
}
}
}
+
}
diff --git a/src/Layers/DACH/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al b/src/Layers/DACH/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
index 32bd04c979..1a28c705a5 100644
--- a/src/Layers/DACH/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
+++ b/src/Layers/DACH/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
@@ -69,53 +69,53 @@ page 9001 "Accounting Manager Role Center"
{
area(rolecenter)
{
- part(Control1902304208; "Account Manager Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part(Control99; "Finance Performance")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control103; "Trailing Sales Orders Chart")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control106; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control100; "Cash Flow Forecast Chart")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1907692008; "My Customers")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1902476008; "My Vendors")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control108; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- systempart(Control1901377608; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
+ part(Control1902304208; "Account Manager Activities")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part("User Tasks Activities"; "User Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part(Control99; "Finance Performance")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control103; "Trailing Sales Orders Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control106; "My Job Queue")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control100; "Cash Flow Forecast Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1907692008; "My Customers")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1902476008; "My Vendors")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control108; "Report Inbox Part")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ systempart(Control1901377608; MyNotes)
+ {
+ ApplicationArea = Basic, Suite;
+ }
}
}
@@ -692,7 +692,7 @@ page 9001 "Accounting Manager Role Center"
}
action("Cost Centers")
{
- ApplicationArea = Dimensions;
+ ApplicationArea = CostAccounting;
Caption = 'Cost Centers';
RunObject = Page "Chart of Cost Centers";
ToolTip = 'Manage cost centers, which are departments and profit centers that are responsible for costs and income. Often, there are more cost centers set up in cost accounting than in any dimension that is set up in the general ledger. In the general ledger, usually only the first level cost centers for direct costs and the initial costs are used. In cost accounting, additional cost centers are created for additional allocation levels.';
@@ -1055,7 +1055,7 @@ page 9001 "Accounting Manager Role Center"
}
action("Cost Accounting Setup")
{
- ApplicationArea = Dimensions;
+ ApplicationArea = CostAccounting;
Caption = 'Cost Accounting Setup';
Image = CostAccountingSetup;
RunObject = Page "Cost Accounting Setup";
diff --git a/src/Layers/DACH/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/DACH/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index 09619cf85d..f32f934f77 100644
--- a/src/Layers/DACH/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/DACH/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -1,3 +1,4 @@
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -97,7 +98,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
@@ -2711,7 +2711,7 @@ page 8901 "Finance Manager Role Center"
action("General Business")
{
ApplicationArea = Basic, Suite;
- Caption = 'Gen. Business Posting Groups';
+ Caption = 'General Business Posting Groups';
RunObject = page "Gen. Business Posting Groups";
Tooltip = 'Open the Gen. Business Posting Groups page.';
}
diff --git a/src/Layers/DACH/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al b/src/Layers/DACH/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
index 647d7257c0..b152a8871c 100644
--- a/src/Layers/DACH/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
+++ b/src/Layers/DACH/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
@@ -77,6 +77,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'System Information';
RunObject = page "Latest Error";
+ Tooltip = 'Open the System Information page.';
}
action("Table Information")
{
@@ -90,30 +91,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Extension Management';
RunObject = page "Extension Management";
+ Tooltip = 'Open the Extension Management page.';
}
action("Profiles")
{
ApplicationArea = Basic, Suite;
Caption = 'Profiles (Roles)';
RunObject = page "Profile List";
+ Tooltip = 'Open the Profiles (Roles) page.';
}
action("Devices")
{
ApplicationArea = Basic, Suite;
Caption = 'Devices';
RunObject = page "Devices";
+ Tooltip = 'Open the Devices page.';
}
action("Control Add-ins")
{
- ApplicationArea = Basic, Suite;
+ ApplicationArea = All;
Caption = 'Control Add-ins';
RunObject = page "Control Add-ins";
+ Tooltip = 'Open the Control Add-ins page.';
}
action("Get the Mobile Device App (Tablet and Phone activatation code)")
{
ApplicationArea = All;
Caption = 'Mobile device activation and app';
RunObject = page "O365 Device Setup";
+ Tooltip = 'Open the Mobile device activation and app page.';
}
action("Printer Management")
{
@@ -131,60 +137,70 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Online Map Setup';
RunObject = page "Online Map Setup";
+ Tooltip = 'Open the Online Map Setup page.';
}
action("Bank Export/Import Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Bank Export/Import Setup';
RunObject = page "Bank Export/Import Setup";
+ Tooltip = 'Open the Bank Export/Import Setup page.';
}
action("Cue Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Cue Setup';
RunObject = page "Cue Setup Administrator";
+ Tooltip = 'Open the Cue Setup page.';
}
action("Document Sending Profiles")
{
ApplicationArea = Basic, Suite;
Caption = 'Document Sending Profiles';
RunObject = page "Document Sending Profiles";
+ Tooltip = 'Open the Document Sending Profiles page.';
}
action("Printer Selections")
{
ApplicationArea = Suite;
Caption = 'Printer Selections';
RunObject = page "Printer Selections";
+ Tooltip = 'Open the Printer Selections page.';
}
action("Electronic Document Formats")
{
ApplicationArea = Suite;
Caption = 'Electronic Document Formats';
RunObject = page "Electronic Document Format";
+ Tooltip = 'Open the Electronic Document Formats page.';
}
action("Assisted Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Assisted Setup';
RunObject = page "Assisted Setup";
+ Tooltip = 'Open the Assisted Setup page.';
}
action("Application Area")
{
ApplicationArea = All;
Caption = 'Application Area';
RunObject = page "Application Area";
+ Tooltip = 'Open the Application Area page.';
}
action("Set Up Customer/Vendor/Item Templates")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Vendor/Item Templates';
RunObject = page "Config Templates";
+ Tooltip = 'Open the Customer/Vendor/Item Templates page.';
}
action("Transformation Rules")
{
ApplicationArea = Basic, Suite;
Caption = 'Transformation Rules';
RunObject = page "Transformation Rules";
+ Tooltip = 'Open the Transformation Rules page.';
}
action("Business Setup")
{
@@ -198,6 +214,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Image Analysis Setup';
RunObject = page "Image Analysis Setup";
+ Tooltip = 'Open the Image Analysis Setup page.';
}
}
group("Group4")
@@ -208,18 +225,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Entries';
RunObject = page "Job Queue Entries";
+ Tooltip = 'Open the Job Queue Entries page.';
}
action("Job Queue Log Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Log Entries';
RunObject = page "Job Queue Log Entries";
+ Tooltip = 'Open the Job Queue Log Entries page.';
}
action("Job Queue Category List")
{
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Category List';
RunObject = page "Job Queue Category List";
+ Tooltip = 'Open the Job Queue Category List page.';
}
action("Scheduled Tasks")
{
@@ -237,12 +257,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Change Log Setup';
RunObject = page "Change Log Setup";
+ Tooltip = 'Open the Change Log Setup page.';
}
action("Change Log")
{
ApplicationArea = Basic, Suite;
Caption = 'Change Log Entries';
RunObject = page "Change Log Entries";
+ Tooltip = 'Open the Change Log Entries page.';
}
}
group("Group6")
@@ -253,12 +275,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Layout Selection';
RunObject = page "Report Layout Selection";
+ Tooltip = 'Open the Report Layout Selection page.';
}
action("Report Configuration")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Settings';
RunObject = page "Report Settings";
+ Tooltip = 'Open the Report Settings page.';
AccessByPermission = TableData "Object Options" = IMD;
}
action("Report Inbox")
@@ -266,6 +290,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Inbox';
RunObject = page "Report Inbox";
+ Tooltip = 'Open the Report Inbox page.';
}
#if not CLEAN28
action("Custom Report Layouts")
@@ -278,6 +303,7 @@ page 8900 "Administrator Main Role Center"
#pragma warning disable AL0432
RunObject = page "Custom Report Layouts";
#pragma warning restore AL0432
+ Tooltip = 'Open the Custom Report Layouts page.';
}
#endif
action("Report Selection Purchase")
@@ -285,30 +311,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Purchase';
RunObject = page "Report Selection - Purchase";
+ Tooltip = 'Open the Report Selections Purchase page.';
}
action("Report Selection Reminder and")
{
ApplicationArea = Suite;
Caption = 'Report Selections Reminder/Fin. Charge';
RunObject = page "Report Selection - Reminder";
+ Tooltip = 'Open the Report Selections Reminder/Fin. Charge page.';
}
action("Report Selection Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Sales';
RunObject = page "Report Selection - Sales";
+ Tooltip = 'Open the Report Selections Sales page.';
}
action("Report Selection - Bank Acc.")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Bank Account';
RunObject = page "Report Selection - Bank Acc.";
+ Tooltip = 'Open the Report Selections Bank Account page.';
}
action("Report Selections Inventory")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Inventory';
RunObject = page "Report Selection - Inventory";
+ Tooltip = 'Open the Report Selections Inventory page.';
}
}
group("Group7")
@@ -319,19 +350,15 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Test Tool';
RunObject = page "CAL Test Tool";
+ Tooltip = 'Open the Test Tool page.';
}
action("Code Coverage")
{
ApplicationArea = All;
Caption = 'Code Coverage';
RunObject = page "Code Coverage";
+ Tooltip = 'Open the Code Coverage page.';
}
- // action("Sessions")
- // {
- // ApplicationArea = All;
- // Caption = 'Sessions';
- // RunObject = codeunit 9500;
- // }
}
action("Feature Management")
{
@@ -352,54 +379,63 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Company Information';
RunObject = page "Company Information";
+ Tooltip = 'Open the Company Information page.';
}
action("Companies")
{
ApplicationArea = Basic, Suite;
Caption = 'Companies';
RunObject = page "Companies";
+ Tooltip = 'Open the Companies page.';
}
action("No. Series")
{
ApplicationArea = Basic, Suite;
Caption = 'No. Series';
RunObject = page "No. Series";
+ Tooltip = 'Open the No. Series page.';
}
action("Post Codes")
{
ApplicationArea = Basic, Suite;
Caption = 'Post Codes';
RunObject = page "Post Codes";
+ Tooltip = 'Open the Post Codes page.';
}
action("Territories")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Territories';
RunObject = page "Territories";
+ Tooltip = 'Open the Territories page.';
}
action("Languages")
{
ApplicationArea = Suite;
Caption = 'Languages';
RunObject = page "Languages";
+ Tooltip = 'Open the Languages page.';
}
action("Countries/Regions")
{
ApplicationArea = Basic, Suite;
Caption = 'Countries/Regions';
RunObject = page "Countries/Regions";
+ Tooltip = 'Open the Countries/Regions page.';
}
action("Base Calendar Entries Subform")
{
ApplicationArea = Basic, Suite;
Caption = 'Base Calendar';
RunObject = page "Base Calendar List";
+ Tooltip = 'Open the Base Calendar page.';
}
action("Responsibility Centers")
{
- ApplicationArea = All;
+ ApplicationArea = Basic, Suite;
Caption = 'Responsibility Centers';
RunObject = page "Responsibility Center List";
+ Tooltip = 'Open the Responsibility Centers page.';
}
}
group("Group10")
@@ -410,13 +446,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Data Encryption Management';
RunObject = page "Data Encryption Management";
- //AccessByPermission = System 5420 = X;
+ Tooltip = 'Open the Data Encryption Management page.';
}
action("Data Classification Worksheet")
{
ApplicationArea = All;
Caption = 'Data Classification Worksheet';
RunObject = page "Data Classification Worksheet";
+ Tooltip = 'Open the Data Classification Worksheet page.';
AccessByPermission = TableData "Data Sensitivity" = R;
}
action("Privacy for App Integrations")
@@ -431,12 +468,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'XML Schemas';
RunObject = page "XML Schemas";
+ Tooltip = 'Open the XML Schemas page.';
}
action("SEPA Schema Viewer")
{
ApplicationArea = Basic, Suite;
Caption = 'SEPA Schema Viewer';
RunObject = page "XML Schema Viewer";
+ Tooltip = 'Open the SEPA Schema Viewer page.';
}
}
group("Group11")
@@ -447,18 +486,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Data Migration Overview';
RunObject = page "Data Migration Overview";
+ Tooltip = 'Open the Data Migration Overview page.';
}
action("Data Migration")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Migration';
RunObject = page "Data Migration Wizard";
+ Tooltip = 'Open the Data Migration page.';
}
action("Data Migration Settings")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Migration Settings';
RunObject = page "Data Migration Settings";
+ Tooltip = 'Open the Data Migration Settings page.';
AccessByPermission = TableData "Data Migration Setup" = R;
}
}
@@ -470,24 +512,28 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Import from a Data File';
RunObject = page "Import Data";
+ Tooltip = 'Open the Import from a Data File page.';
}
action("Export to a Data File")
{
ApplicationArea = Basic, Suite;
Caption = 'Export to a Data File';
RunObject = page "Export Data";
+ Tooltip = 'Open the Export to a Data File page.';
}
action("Data Exchange Types")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Exchange Types';
RunObject = page "Data Exchange Types";
+ Tooltip = 'Open the Data Exchange Types page.';
}
action("Data Exchange Definition")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Exchange Definitions';
RunObject = page "Data Exch Def List";
+ Tooltip = 'Open the Data Exchange Definitions page.';
}
}
group("Group13")
@@ -501,18 +547,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Customers...';
RunObject = report "Create Conts. from Customers";
+ Tooltip = 'Run the Create Contacts from Customers report.';
}
action("Create Contacts from Vendors")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Vendors...';
RunObject = report "Create Conts. from Vendors";
+ Tooltip = 'Run the Create Contacts from Vendors report.';
}
action("Create Contacts from Bank Acco")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Bank Accounts...';
RunObject = report "Create Conts. from Bank Accs.";
+ Tooltip = 'Run the Create Contacts from Bank Accounts report.';
}
}
}
@@ -527,6 +576,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Date Compr. Registers';
RunObject = page "Date Compr. Registers";
+ Tooltip = 'Open the Date Compr. Registers page.';
}
}
group("Group17")
@@ -537,6 +587,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Delete Orphaned Record Links';
RunObject = codeunit "Remove Orphaned Record Links";
+ Tooltip = 'Run the Delete Orphaned Record Links codeunit.';
}
}
group("Group18")
@@ -547,12 +598,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Profile Customizations';
RunObject = page "Profile Customization List";
+ Tooltip = 'Open the Profile Customizations page.';
}
action("User Page Personalizations")
{
ApplicationArea = Basic, Suite;
Caption = 'User Page Personalizations';
RunObject = page "Personalized Pages";
+ Tooltip = 'Open the User Page Personalizations page.';
}
}
}
@@ -565,24 +618,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Users';
RunObject = page "Users";
+ Tooltip = 'Open the Users page.';
}
action("User Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'User Setup';
RunObject = page "User Setup";
+ Tooltip = 'Open the User Setup page.';
}
- // action("Change Password")
- // {
- // ApplicationArea = Basic, Suite;
- // Caption = 'Change Password';
- // RunObject = page 9809;
- // }
action("User Security Status")
{
ApplicationArea = Basic, Suite;
Caption = 'User Security Status';
RunObject = page "User Security Status List";
+ Tooltip = 'Open the User Security Status page.';
AccessByPermission = TableData "User" = R;
}
action("User Tasks")
@@ -590,18 +640,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'User Tasks';
RunObject = page "User Task List";
+ Tooltip = 'Open the User Tasks page.';
}
action("User Personalization")
{
ApplicationArea = Basic, Suite;
Caption = 'User Settings';
RunObject = page "User Settings List";
+ Tooltip = 'Open the User Settings page.';
}
action("User Time Registers")
{
ApplicationArea = Basic, Suite;
Caption = 'Time Registers';
RunObject = page "User Time Registers";
+ Tooltip = 'Open the Time Registers page.';
}
}
group(Permissions)
@@ -643,30 +696,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflows';
RunObject = page "Workflows";
+ Tooltip = 'Open the Workflows page.';
}
action("Workflow User Group")
{
ApplicationArea = Suite;
Caption = 'Workflow User Groups';
RunObject = page "Workflow User Groups";
+ Tooltip = 'Open the Workflow User Groups page.';
}
action("Approval User Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Approval User Setup';
RunObject = page "Approval User Setup";
+ Tooltip = 'View or edit information about workflow users who are involved in approval processes, such as approval amount limits for specific types of requests and substitute approvers to whom approval requests are delegated when the original approver is absent.';
}
action("Incoming Documents Setup")
{
ApplicationArea = Suite;
Caption = 'Incoming Documents Setup';
RunObject = page "Incoming Documents Setup";
+ Tooltip = 'Open the Incoming Documents Setup page.';
}
action("Send Overdue Appr. Notif.")
{
ApplicationArea = Suite;
Caption = 'Send Overdue Approval Notifications';
RunObject = report "Send Overdue Appr. Notif.";
+ Tooltip = 'Run the Send Overdue Approval Notifications report.';
}
group("Group21")
{
@@ -676,12 +734,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflow Templates';
RunObject = page "Workflow Templates";
+ Tooltip = 'Open the Workflow Templates page.';
}
action("Workflow Categories")
{
ApplicationArea = Suite;
Caption = 'Workflow Categories';
RunObject = page "Workflow Categories";
+ Tooltip = 'Open the Workflow Categories page.';
}
}
group("Group22")
@@ -692,18 +752,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflow Event Hierarchies';
RunObject = page "Workflow Event Hierarchies";
+ Tooltip = 'Open the Workflow Event Hierarchies page.';
}
action("WF Event/Response Combinations")
{
ApplicationArea = Suite;
Caption = 'Workflow Event/Response Combinations';
RunObject = page "WF Event/Response Combinations";
+ Tooltip = 'Open the Workflow Event/Response Combinations page.';
}
action("Workflow - Table Relations")
{
ApplicationArea = Suite;
Caption = 'Workflow - Table Relations';
RunObject = page "Workflow - Table Relations";
+ Tooltip = 'Open the Workflow - Table Relations page.';
}
}
group("Group23")
@@ -714,18 +777,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Notification Setup';
RunObject = page "Notification Setup";
+ Tooltip = 'Open the Notification Setup page.';
}
action("Notification Entries")
{
ApplicationArea = Suite;
Caption = 'Notification Entries';
RunObject = page "Notification Entries";
+ Tooltip = 'Open the Notification Entries page.';
}
action("Sent Notification Entries")
{
ApplicationArea = Suite;
Caption = 'Sent Notification Entries';
RunObject = page "Sent Notification Entries";
+ Tooltip = 'Open the Sent Notification Entries page.';
}
}
group("Group24")
@@ -736,36 +802,42 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Approval Entries';
RunObject = page "Approval Entries";
+ Tooltip = 'Open the Approval Entries page.';
}
action("Posted Approval Entries")
{
ApplicationArea = Suite;
Caption = 'Posted Approval Entries';
RunObject = page "Posted Approval Entries";
+ Tooltip = 'Open the Posted Approval Entries page.';
}
action("Overdue Approval Entries")
{
ApplicationArea = Suite;
Caption = 'Overdue Approval Entries';
RunObject = page "Overdue Approval Entries";
+ Tooltip = 'Open the Overdue Approval Entries page.';
}
action("Restricted Records")
{
ApplicationArea = Suite;
Caption = 'Restricted Records';
RunObject = page "Restricted Records";
+ Tooltip = 'Open the Restricted Records page.';
}
action("Workflow Step Instances")
{
ApplicationArea = Suite;
Caption = 'Workflow Step Instances';
RunObject = page "Workflow Step Instances";
+ Tooltip = 'Open the Workflow Step Instances page.';
}
action("Archived Workflow Step Instances")
{
ApplicationArea = Suite;
Caption = 'Archived Workflow Step Instances';
RunObject = page "Archived WF Step Instances";
+ Tooltip = 'Open the Archived Workflow Step Instances page.';
}
}
group("Group26")
@@ -774,14 +846,16 @@ page 8900 "Administrator Main Role Center"
action("Dynamic Request page Entities")
{
ApplicationArea = Basic, Suite;
- Caption = 'Dynamic Request page Entities';
- RunObject = page "Dynamic Request page Entities";
+ Caption = 'Dynamic Request Page Entities';
+ RunObject = page "Dynamic Request Page Entities";
+ Tooltip = 'Open the Dynamic Request Page Entities page.';
}
action("Dynamic Request page Fields")
{
ApplicationArea = Basic, Suite;
- Caption = 'Dynamic Request page Fields';
- RunObject = page "Dynamic Request page Fields";
+ Caption = 'Dynamic Request Page Fields';
+ RunObject = page "Dynamic Request Page Fields";
+ Tooltip = 'Open the Dynamic Request Page Fields page.';
}
}
}
@@ -793,12 +867,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Web Services';
RunObject = page "Web Services";
+ Tooltip = 'Open the Web Services page.';
}
action("Microsoft Dynamics 365 Connection Setup")
{
ApplicationArea = Suite;
Caption = 'Microsoft Dynamics 365 Connection Setup';
RunObject = page "CRM Connection Setup";
+ Tooltip = 'Open the Microsoft Dynamics 365 Connection Setup page.';
AccessByPermission = TableData "CRM Connection Setup" = IM;
}
action("Email Account Setup")
@@ -814,72 +890,84 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'OCR Service Setup';
RunObject = page "OCR Service Setup";
+ Tooltip = 'Open the OCR Service Setup page.';
}
action("Currency Exchange Rate Services")
{
ApplicationArea = Suite;
Caption = 'Currency Exchange Rate Services';
RunObject = page "Curr. Exch. Rate Service List";
+ Tooltip = 'Open the Currency Exchange Rate Services page.';
}
action("Service Connections Overview")
{
ApplicationArea = Basic, Suite;
Caption = 'Service Connections';
RunObject = page "Service Connections";
+ Tooltip = 'Open the Service Connections page.';
}
action("Doc. Exch. Service Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Document Exchange Service Setup';
RunObject = page "Doc. Exch. Service Setup";
+ Tooltip = 'Open the Document Exchange Service Setup page.';
}
action("Integration Table Mappings")
{
ApplicationArea = Suite;
Caption = 'Integration Table Mappings';
RunObject = page "Integration Table Mapping List";
+ Tooltip = 'Open the Integration Table Mappings page.';
}
action("Integration Synchronization Jobs")
{
ApplicationArea = Suite;
Caption = 'Integration Synchronization Jobs';
RunObject = page "Integration Synch. Job List";
+ Tooltip = 'Open the Integration Synchronization Jobs page.';
}
action("Integration Synchronization Errors")
{
ApplicationArea = Suite;
Caption = 'Integration Synchronization Errors';
RunObject = page "Integration Synch. Error List";
+ Tooltip = 'Open the Integration Synchronization Errors page.';
}
action("Online Payments")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Services';
RunObject = page "Payment Services";
+ Tooltip = 'Open the Payment Services page.';
}
action("VAT Registration Service (VIES) Setting")
{
ApplicationArea = Basic, Suite;
Caption = 'VAT Registration Service (VIES) Setting';
RunObject = page "VAT Registration Config";
+ Tooltip = 'Open the VAT Registration Service (VIES) Setting page.';
}
action("API Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'API Setup';
RunObject = page "API Setup";
+ Tooltip = 'Open the API Setup page.';
}
action("Account Schedule KPI Web Servi")
{
ApplicationArea = Basic, Suite;
Caption = 'Account Schedule KPI Web Service Setup';
RunObject = page "Acc. Sched. KPI Web Srv. Setup";
+ Tooltip = 'Open the Account Schedule KPI Web Service Setup page.';
}
action("Acc. Sched. KPI Web Service")
{
ApplicationArea = Basic, Suite;
Caption = 'Account Schedule KPI Web Service';
RunObject = page "Acc. Sched. KPI Web Service";
+ Tooltip = 'Open the Account Schedule KPI Web Service page.';
}
}
group("Group27A")
@@ -943,8 +1031,8 @@ page 8900 "Administrator Main Role Center"
Caption = 'Exchange Sync. Setup';
RunObject = page "Exchange Sync. Setup";
}
-#endif
- }
+#endif
+ }
group("GroupOneDrive")
{
Caption = 'OneDrive for Business';
@@ -980,48 +1068,56 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Configuration Questionnaire';
RunObject = page "Config. Questionnaire";
+ Tooltip = 'Open the Configuration Questionnaire page.';
}
action("Data Migration1")
{
ApplicationArea = Suite;
Caption = 'Configuration Packages';
RunObject = page "Config. Packages";
+ Tooltip = 'Open the Configuration Packages page.';
}
action("Setup Master Templates")
{
ApplicationArea = Basic, Suite;
Caption = 'Configuration Templates';
RunObject = page "Config. Template List";
+ Tooltip = 'Open the Configuration Templates page.';
}
action("Create G/L acc. Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create G/L Acc. Journal Lines';
RunObject = report "Create G/L Acc. Journal Lines";
+ Tooltip = 'Run the Create G/L Acc. Journal Lines report.';
}
action("Create Customer Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Customer Journal Lines';
RunObject = report "Create Customer Journal Lines";
+ Tooltip = 'Run the Create Customer Journal Lines report.';
}
action("Create Vendor Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Vendor Journal Lines';
RunObject = report "Create Vendor Journal Lines";
+ Tooltip = 'Run the Create Vendor Journal Lines report.';
}
action("Create Item Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Item Journal Lines';
RunObject = report "Create Item Journal Lines";
+ Tooltip = 'Run the Create Item Journal Lines report.';
}
action("Configuration Worksheet")
{
ApplicationArea = Suite;
Caption = 'Configuration Worksheet';
RunObject = page "Config. Worksheet";
+ Tooltip = 'Open the Configuration Worksheet page.';
}
}
}
diff --git a/src/Layers/DE/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al b/src/Layers/DE/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
index 93d021acde..22eff9ae11 100644
--- a/src/Layers/DE/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
+++ b/src/Layers/DE/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
@@ -69,53 +69,53 @@ page 9001 "Accounting Manager Role Center"
{
area(rolecenter)
{
- part(Control1902304208; "Account Manager Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part(Control99; "Finance Performance")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control103; "Trailing Sales Orders Chart")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control106; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control100; "Cash Flow Forecast Chart")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1907692008; "My Customers")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1902476008; "My Vendors")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control108; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- systempart(Control1901377608; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
+ part(Control1902304208; "Account Manager Activities")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part("User Tasks Activities"; "User Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part(Control99; "Finance Performance")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control103; "Trailing Sales Orders Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control106; "My Job Queue")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control100; "Cash Flow Forecast Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1907692008; "My Customers")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1902476008; "My Vendors")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control108; "Report Inbox Part")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ systempart(Control1901377608; MyNotes)
+ {
+ ApplicationArea = Basic, Suite;
+ }
}
}
@@ -677,7 +677,7 @@ page 9001 "Accounting Manager Role Center"
}
action("Cost Centers")
{
- ApplicationArea = Dimensions;
+ ApplicationArea = CostAccounting;
Caption = 'Cost Centers';
RunObject = Page "Chart of Cost Centers";
ToolTip = 'Manage cost centers, which are departments and profit centers that are responsible for costs and income. Often, there are more cost centers set up in cost accounting than in any dimension that is set up in the general ledger. In the general ledger, usually only the first level cost centers for direct costs and the initial costs are used. In cost accounting, additional cost centers are created for additional allocation levels.';
@@ -1040,7 +1040,7 @@ page 9001 "Accounting Manager Role Center"
}
action("Cost Accounting Setup")
{
- ApplicationArea = Dimensions;
+ ApplicationArea = CostAccounting;
Caption = 'Cost Accounting Setup';
Image = CostAccountingSetup;
RunObject = Page "Cost Accounting Setup";
diff --git a/src/Layers/DE/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/DE/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index a9fe5d5f52..46aa79c7b9 100644
--- a/src/Layers/DE/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/DE/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -98,7 +98,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
@@ -2646,7 +2645,7 @@ page 8901 "Finance Manager Role Center"
action("General Business")
{
ApplicationArea = Basic, Suite;
- Caption = 'Gen. Business Posting Groups';
+ Caption = 'General Business Posting Groups';
RunObject = page "Gen. Business Posting Groups";
Tooltip = 'Open the Gen. Business Posting Groups page.';
}
diff --git a/src/Layers/ES/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al b/src/Layers/ES/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
index 66b51eae7e..cc75ce8131 100644
--- a/src/Layers/ES/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
+++ b/src/Layers/ES/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
@@ -64,36 +64,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Salespeople")
{
ApplicationArea = Suite;
Caption = 'Salespeople/Purchasers';
RunObject = page "Salespersons/Purchasers";
+ Tooltip = 'Open the Salespeople/Purchasers page.';
}
action("Teams")
{
ApplicationArea = Basic, Suite;
Caption = 'Teams';
RunObject = page "Teams";
+ Tooltip = 'Open the Teams page.';
}
action("Tasks")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Opportunities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
group("Group1")
{
@@ -103,36 +109,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesBudget;
Caption = 'Sales Budgets';
RunObject = page "Budget Names Sales";
+ Tooltip = 'Open the Sales Budgets page.';
}
action("Sales Analysis Reports")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Reports';
RunObject = page "Analysis Report Sale";
+ Tooltip = 'Open the Sales Analysis Reports page.';
}
action("Sales Analysis by Dimensions")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Item Dimensions - Detail")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Detail';
RunObject = report "Item Dimensions - Detail";
+ Tooltip = 'Run the Item Dimensions - Detail report.';
}
action("Item Dimensions - Total")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Total';
RunObject = report "Item Dimensions - Total";
+ Tooltip = 'Run the Item Dimensions - Total report.';
}
action("Opportunities Matrix")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Analysis';
RunObject = page "Opportunities";
+ Tooltip = 'Open the Opportunity Analysis page.';
}
}
group("Group2")
@@ -143,6 +155,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Deferral Summary';
RunObject = report "Deferral Summary - Sales";
+ Tooltip = 'Run the Sales Deferral Summary report.';
}
group("Group3")
{
@@ -152,18 +165,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Tasks';
RunObject = report "Salesperson - Tasks";
+ Tooltip = 'Run the Salesperson Tasks report.';
}
action("Salesperson - Commission")
{
ApplicationArea = Suite;
Caption = 'Salesperson Commission';
RunObject = report "Salesperson - Commission";
+ Tooltip = 'Run the Salesperson Commission report.';
}
action("Salesperson - Opportunities")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Opportunities';
RunObject = report "Salesperson - Opportunities";
+ Tooltip = 'Run the Salesperson Opportunities report.';
}
#if not CLEAN28
action("Sales Statistics")
@@ -174,6 +190,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
#endif
action("Team - Tasks")
@@ -181,12 +198,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Team Tasks';
RunObject = report "Team - Tasks";
+ Tooltip = 'Run the Team Tasks report.';
}
action("Salesperson - Sales Statistics")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Sales Statistics';
RunObject = report "Salesperson - Sales Statistics";
+ Tooltip = 'Run the Salesperson Sales Statistics report.';
}
}
group("Group4")
@@ -197,36 +216,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Contact Labels';
RunObject = report "Contact - Labels";
+ Tooltip = 'Run the Contact Labels report.';
}
action("Contact - Company Summary")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact - Company Summary';
RunObject = report "Contact - Company Summary";
+ Tooltip = 'Run the Contact - Company Summary report.';
}
action("Questionnaire - Handouts")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire - Handouts';
RunObject = report "Questionnaire - Handouts";
+ Tooltip = 'Run the Questionnaire - Handouts report.';
}
action("Contact - List")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact List';
RunObject = report "Contact - List";
+ Tooltip = 'Run the Contact List report.';
}
action("Orgl. Profile Summary")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Person Summary';
RunObject = report "Contact - Person Summary";
+ Tooltip = 'Run the Contact - Person Summary report.';
}
action("Contact - Cover Sheet")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Cover Sheet';
RunObject = report "Contact - Cover Sheet";
+ Tooltip = 'Run the Contact - Cover Sheet report.';
}
}
group("Group5")
@@ -241,6 +266,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - List report.';
}
#endif
action("Customer - Labels")
@@ -248,36 +274,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Customer Labels';
RunObject = report "Customer - Labels";
+ Tooltip = 'Run the Customer Labels report.';
}
action("Customer - Balance to Date")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Balance to Date';
RunObject = report "Customer - Balance to Date";
+ Tooltip = 'Run the Customer - Balance to Date report.';
}
action("Customer - Order Summary")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Summary';
RunObject = report "Customer - Order Summary";
+ Tooltip = 'Run the Customer - Order Summary report.';
}
action("Customer/Item Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Item Sales';
RunObject = report "Customer/Item Sales";
+ Tooltip = 'Run the Customer/Item Sales report.';
}
action("Customer Register")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Register';
RunObject = report "Customer Register";
+ Tooltip = 'Run the Customer Register report.';
}
action("Customer - Order Detail")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Detail';
RunObject = report "Customer - Order Detail";
+ Tooltip = 'Run the Customer - Order Detail report.';
}
#if not CLEAN28
action("Customer - Top 10 List")
@@ -288,6 +320,7 @@ page 8907 "Sales & Marketing Manager RC"
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';
+ Tooltip = 'Run the Customer Top 10 List report.';
}
#endif
action("Customer - Trial Balance")
@@ -295,6 +328,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Trial Balance';
RunObject = report "Customer - Trial Balance";
+ Tooltip = 'Run the Customer Trial Balance report.';
}
#if not CLEAN28
action("Customer - Sales List")
@@ -305,6 +339,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
}
@@ -316,18 +351,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - List';
RunObject = report "Opportunity - List";
+ Tooltip = 'Run the Opportunity - List report.';
}
action("Opportunity - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - Details';
RunObject = report "Opportunity - Details";
+ Tooltip = 'Run the Opportunity - Details report.';
}
action("Sales Cycle - Analysis")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycle - Analysis';
RunObject = report "Sales Cycle - Analysis";
+ Tooltip = 'Run the Sales Cycle - Analysis report.';
}
}
}
@@ -340,60 +378,70 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts1")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Quotes")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quotes';
RunObject = page "Sales Quotes";
+ Tooltip = 'Open the Sales Quotes page.';
}
action("Orders")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Orders';
RunObject = page "Sales Order List";
+ Tooltip = 'Open the Sales Orders page.';
}
action("Blanket Orders")
{
ApplicationArea = Suite;
Caption = 'Blanket Sales Orders';
RunObject = page "Blanket Sales Orders";
+ Tooltip = 'Open the Blanket Sales Orders page.';
}
action("Return Orders")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Sales Return Orders';
RunObject = page "Sales Return Order List";
+ Tooltip = 'Open the Sales Return Orders page.';
}
action("Invoices")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Invoices';
RunObject = page "Sales Invoice List";
+ Tooltip = 'Open the Sales Invoices page.';
}
action("Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Credit Memos';
RunObject = page "Sales Credit Memos";
+ Tooltip = 'Open the Sales Credit Memos page.';
}
action("Certificates of Supply")
{
ApplicationArea = Basic, Suite;
Caption = 'Certificates of Supply';
RunObject = page "Certificates of Supply";
+ Tooltip = 'Open the Certificates of Supply page.';
}
action("Order Planning")
{
ApplicationArea = Planning;
Caption = 'Order Planning';
RunObject = page "Order Planning";
+ Tooltip = 'Open the Order Planning page.';
}
group("Group8")
{
@@ -403,24 +451,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Invoices';
RunObject = page "Posted Sales Invoices";
+ Tooltip = 'Open the Posted Sales Invoices page.';
}
action("Posted Sales Shipments")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Shipments';
RunObject = page "Posted Sales Shipments";
+ Tooltip = 'Open the Posted Sales Shipments page.';
}
action("Posted Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Credit Memos';
RunObject = page "Posted Sales Credit Memos";
+ Tooltip = 'Open the Posted Sales Credit Memos page.';
}
action("Posted Return Receipts")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Posted Return Receipts';
RunObject = page "Posted Return Receipts";
+ Tooltip = 'Open the Posted Return Receipts page.';
}
}
group("Group9")
@@ -431,48 +483,56 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'G/L Registers';
RunObject = page "G/L Registers";
+ Tooltip = 'Open the G/L Registers page.';
}
action("Item Tracing")
{
ApplicationArea = ItemTracking;
Caption = 'Item Tracing';
RunObject = page "Item Tracing";
+ Tooltip = 'Open the Item Tracing page.';
}
action("Sales Quote Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quote Archives';
RunObject = page "Sales Quote Archives";
+ Tooltip = 'Open the Sales Quote Archives page.';
}
action("Sales Order Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Order Archives';
RunObject = page "Sales Order Archives";
+ Tooltip = 'Open the Sales Order Archives page.';
}
action("Sales Return Order Archives")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Return Order Archives';
RunObject = page "Sales Return List Archive";
+ Tooltip = 'Open the Sales Return Order Archives page.';
}
action("Customer Ledger Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Ledger Entries';
RunObject = page "Customer Ledger Entries";
+ Tooltip = 'Open the Customer Ledger Entries page.';
}
action("Detailed Cust. Ledg. Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Detailed Customer Ledger Entries';
RunObject = page "Detailed Cust. Ledg. Entries";
+ Tooltip = 'Open the Detailed Customer Ledger Entries page.';
}
action("Value Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Value Entries';
RunObject = page "Value Entries";
+ Tooltip = 'Open the Value Entries page.';
}
action("Navigate")
{
@@ -492,6 +552,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Detail';
RunObject = report "Customer - Order Detail";
+ Tooltip = 'Run the Customer - Order Detail report.';
}
#if not CLEAN28
action("Sales Reservation Avail.")
@@ -502,6 +563,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Reservation Avail. report.';
}
#endif
#if not CLEAN28
@@ -513,6 +575,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
#endif
#if not CLEAN28
@@ -524,6 +587,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
action("EC Sales List")
@@ -531,24 +595,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'EC Sales List';
RunObject = report "EC Sales List";
+ Tooltip = 'Run the EC Sales List report.';
}
action("Customer/Item Sales1")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Item Sales';
RunObject = report "Customer/Item Sales";
+ Tooltip = 'Run the Customer/Item Sales report.';
}
action("Customer - Order Summary1")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Summary';
RunObject = report "Customer - Order Summary";
+ Tooltip = 'Run the Customer - Order Summary report.';
}
action("Long Term Sales Invoices")
{
ApplicationArea = Basic, Suite;
Caption = 'Long Term Sales Invoices';
RunObject = report "Long Term Sales Invoices";
+ Tooltip = 'Run the Long Term Sales Invoices report.';
}
}
}
@@ -560,42 +628,49 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Campaigns")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaigns';
RunObject = page "Campaign List";
+ Tooltip = 'Open the Campaigns page.';
}
action("Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Segments';
RunObject = page "Segment List";
+ Tooltip = 'Open the Segments page.';
}
action("Logged Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Logged Segments';
RunObject = page "Logged Segments";
+ Tooltip = 'Open the Logged Segments page.';
}
action("Opportunities1")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
action("Tasks1")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Campaign - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign - Details';
RunObject = report "Campaign - Details";
+ Tooltip = 'Run the Campaign - Details report.';
}
group("Group12")
{
@@ -605,18 +680,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Entries';
RunObject = page "Campaign Entries";
+ Tooltip = 'Open the Campaign Entries page.';
}
action("Opportunity Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Entries';
RunObject = page "Opportunity Entries";
+ Tooltip = 'Open the Opportunity Entries page.';
}
action("Interaction Log Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Log Entries';
RunObject = page "Interaction Log Entries";
+ Tooltip = 'Open the Interaction Log Entries page.';
}
}
}
@@ -628,18 +706,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Items';
RunObject = page "Item List";
+ Tooltip = 'Open the Items page.';
}
action("Nonstock Items")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Items';
RunObject = page "Catalog Item List";
+ Tooltip = 'Open the Nonstock Items page.';
}
action("Item Attributes")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Attributes';
RunObject = page "Item Attributes";
+ Tooltip = 'Open the Item Attributes page.';
}
action("Sales Price Worksheet")
{
@@ -653,6 +734,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Adjust Item Costs/Prices';
RunObject = report "Adjust Item Costs/Prices";
+ Tooltip = 'Run the Adjust Item Costs/Prices report.';
}
group("Group14")
{
@@ -662,42 +744,49 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Inventory Sales Statistics';
RunObject = report "Inventory - Sales Statistics";
+ Tooltip = 'Run the Inventory Sales Statistics report.';
}
action("Inventory Cost and Price List")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Cost and Price List';
RunObject = report "Inventory Cost and Price List";
+ Tooltip = 'Run the Inventory Cost and Price List report.';
}
action("Item Charges - Specification")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Charges - Specification';
RunObject = report "Item Charges - Specification";
+ Tooltip = 'Run the Item Charges - Specification report.';
}
action("Inventory - Customer Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Customer Sales';
RunObject = report "Inventory - Customer Sales";
+ Tooltip = 'Run the Inventory Customer Sales report.';
}
action("Nonstock Item Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Sales';
RunObject = report "Catalog Item Sales";
+ Tooltip = 'Run the Nonstock Item Sales report.';
}
action("Inventory Availability")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Availability';
RunObject = report "Inventory Availability";
+ Tooltip = 'Run the Inventory Availability report.';
}
action("Inventory Order Details")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Order Details';
RunObject = report "Inventory Order Details";
+ Tooltip = 'Run the Inventory Order Details report.';
}
action("Price List")
{
@@ -711,18 +800,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Inventory - Sales Back Orders';
RunObject = report "Inventory - Sales Back Orders";
+ Tooltip = 'Run the Inventory - Sales Back Orders report.';
}
action("Inventory - Top 10 List")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Top 10 List';
RunObject = report "Inventory - Top 10 List";
+ Tooltip = 'Run the Inventory Top 10 List report.';
}
action("Item Substitutions")
{
ApplicationArea = Suite;
Caption = 'Item Substitutions';
RunObject = report "Item Substitutions";
+ Tooltip = 'Run the Item Substitutions report.';
}
}
}
@@ -734,54 +826,63 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Orders - Dynamics 365 Sales';
RunObject = page "CRM Sales Order List";
+ Tooltip = 'Open the Sales Orders - Dynamics 365 Sales page.';
}
action("Quotes - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Quotes - Dynamics 365 Sales';
RunObject = page "CRM Sales Quote List";
+ Tooltip = 'Open the Quotes - Dynamics 365 Sales page.';
}
action("Cases - Dynamics 365 for Customer Service")
{
ApplicationArea = Suite;
Caption = 'Cases - Dynamics 365 for Customer Service';
RunObject = page "CRM Case List";
+ Tooltip = 'Open the Cases - Dynamics 365 for Customer Service page.';
}
action("Opportunities - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Opportunities - Dynamics 365 Sales';
RunObject = page "CRM Opportunity List";
+ Tooltip = 'Open the Opportunities - Dynamics 365 Sales page.';
}
action("Accounts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Accounts - Dynamics 365 Sales';
RunObject = page "CRM Account List";
+ Tooltip = 'Open the Accounts - Dynamics 365 Sales page.';
}
action("Transaction Currencies - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Transaction Currencies - Dynamics 365 Sales';
RunObject = page "CRM TransactionCurrency List";
+ Tooltip = 'Open the Transaction Currencies - Dynamics 365 Sales page.';
}
action("Unit Groups - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Unit Groups - Dynamics 365 Sales';
RunObject = page "CRM UnitGroup List";
+ Tooltip = 'Open the Unit Groups - Dynamics 365 Sales page.';
}
action("Products - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Products - Dynamics 365 Sales';
RunObject = page "CRM Product List";
+ Tooltip = 'Open the Products - Dynamics 365 Sales page.';
}
action("Contacts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Contacts - Dynamics 365 Sales';
RunObject = page "CRM Contact List";
+ Tooltip = 'Open the Contacts - Dynamics 365 Sales page.';
}
action("Records Skipped For Synchronization")
{
@@ -789,6 +890,7 @@ page 8907 "Sales & Marketing Manager RC"
Caption = 'Coupled Data Synchronization Errors';
RunObject = page "CRM Skipped Records";
AccessByPermission = TableData "CRM Integration Record" = R;
+ Tooltip = 'Open the Coupled Data Synchronization Errors page.';
}
}
group("Group16")
@@ -799,60 +901,70 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = OrderPromising;
Caption = 'Order Promising Setup';
RunObject = page "Order Promising Setup";
+ Tooltip = 'Open the Order Promising Setup page.';
}
action("Sales & Receivables Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales & Receivables Setup';
RunObject = page "Sales & Receivables Setup";
+ Tooltip = 'Open the Sales & Receivables Setup page.';
}
action("report Selection Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Sales';
RunObject = page "Report Selection - Sales";
+ Tooltip = 'Open the Report Selections Sales page.';
}
action("Standard Sales Codes")
{
ApplicationArea = Suite;
Caption = 'Standard Sales Codes';
RunObject = page "Standard Sales Codes";
+ Tooltip = 'Open the Standard Sales Codes page.';
}
action("Payment Terms")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Terms';
RunObject = page "Payment Terms";
+ Tooltip = 'Open the Payment Terms page.';
}
action("Payment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Methods';
RunObject = page "Payment Methods";
+ Tooltip = 'Open the Payment Methods page.';
}
action("Item Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Shipment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Shipment Methods';
RunObject = page "Shipment Methods";
+ Tooltip = 'Open the Shipment Methods page.';
}
action("Shipping Agents")
{
ApplicationArea = Suite;
Caption = 'Shipping Agents';
RunObject = page "Shipping Agents";
+ Tooltip = 'Open the Shipping Agents page.';
}
action("Return Reasons")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Return Reasons';
RunObject = page "Return Reasons";
+ Tooltip = 'Open the Return Reasons page.';
}
action("Customer Templates")
{
@@ -869,24 +981,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesAnalysis, PurchaseAnalysis, InventoryAnalysis;
Caption = 'Analysis Types';
RunObject = page "Analysis Types";
+ Tooltip = 'Open the Analysis Types page.';
}
action("Sales Analysis by Dimensions1")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Analysis Column Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Column Templates';
RunObject = report "Run Sales Analysis Col. Temp.";
+ Tooltip = 'Run the Sales Analysis Column Templates report.';
}
action("Analysis Line Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Line Templates';
RunObject = report "Run Sales Analysis Line Templ.";
+ Tooltip = 'Run the Sales Analysis Line Templates report.';
}
}
group("Group18")
@@ -897,12 +1013,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Price Groups';
RunObject = page "Customer Price Groups";
+ Tooltip = 'Open the Customer Price Groups page.';
}
action("Customer Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Discount Groups';
RunObject = page "Customer Disc. Groups";
+ Tooltip = 'Open the Customer Discount Groups page.';
}
}
group("Group19")
@@ -913,24 +1031,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Setup';
RunObject = page "Catalog Item Setup";
+ Tooltip = 'Open the Nonstock Item Setup page.';
}
action("Item Charges")
{
ApplicationArea = ItemCharges;
Caption = 'Item Charges';
RunObject = page "Item Charges";
+ Tooltip = 'Open the Item Charges page.';
}
action("Item Disc. Groups1")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Inventory Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Setup';
RunObject = page "Inventory Setup";
+ Tooltip = 'Open the Inventory Setup page.';
}
}
group("Group20")
@@ -941,99 +1063,116 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite, RelationshipMgmt;
Caption = 'Marketing Setup';
RunObject = page "Marketing Setup";
+ Tooltip = 'Open the Marketing Setup page.';
}
action("Interaction Template Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Template Setup';
RunObject = page "Interaction Template Setup";
+ Tooltip = 'Open the Interaction Template Setup page.';
}
action("Business Relations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Business Relations';
RunObject = page "Business Relations";
+ Tooltip = 'Open the Business Relations page.';
}
action("Industry Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Industry Groups';
RunObject = page "Industry Groups";
+ Tooltip = 'Open the Industry Groups page.';
}
action("Web Sources")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Web Sources';
RunObject = page "Web Sources";
+ Tooltip = 'Open the Web Sources page.';
}
action("Job Responsibilities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Job Responsibilities';
RunObject = page "Job Responsibilities";
+ Tooltip = 'Open the Job Responsibilities page.';
}
action("Organizational Levels")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Organizational Levels';
RunObject = page "Organizational Levels";
+ Tooltip = 'Open the Organizational Levels page.';
}
action("Interaction Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Groups';
RunObject = page "Interaction Groups";
+ Tooltip = 'Open the Interaction Groups page.';
}
action("Interaction Templates")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Templates';
RunObject = page "Interaction Templates";
+ Tooltip = 'Open the Interaction Templates page.';
}
action("Salutations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Salutations';
RunObject = page "Salutations";
+ Tooltip = 'Open the Salutations page.';
}
action("Mailing Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Mailing Groups';
RunObject = page "Mailing Groups";
+ Tooltip = 'Open the Mailing Groups page.';
}
action("Status")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Status';
RunObject = page "Campaign Status";
+ Tooltip = 'Open the Campaign Status page.';
}
action("Sales Cycles")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycles';
RunObject = page "Sales Cycles";
+ Tooltip = 'Open the Sales Cycles page.';
}
action("Close Opportunity Codes")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Close Opportunity Codes';
RunObject = page "Close Opportunity Codes";
+ Tooltip = 'Open the Close Opportunity Codes page.';
}
action("Questionnaire Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire Setup';
RunObject = page "Profile Questionnaires";
+ Tooltip = 'Open the Questionnaire Setup page.';
}
action("Activities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Activities';
RunObject = page "Activity List";
+ Tooltip = 'Open the Activities page.';
}
}
}
}
}
+
}
diff --git a/src/Layers/ES/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al b/src/Layers/ES/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
index 4f7958dc1f..497e5abe6a 100644
--- a/src/Layers/ES/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
+++ b/src/Layers/ES/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
@@ -72,53 +72,53 @@ page 9001 "Accounting Manager Role Center"
{
area(rolecenter)
{
- part(Control1902304208; "Account Manager Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part(Control99; "Finance Performance")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control103; "Trailing Sales Orders Chart")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control106; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control100; "Cash Flow Forecast Chart")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1907692008; "My Customers")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1902476008; "My Vendors")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control108; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- systempart(Control1901377608; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
+ part(Control1902304208; "Account Manager Activities")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part("User Tasks Activities"; "User Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part(Control99; "Finance Performance")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control103; "Trailing Sales Orders Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control106; "My Job Queue")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control100; "Cash Flow Forecast Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1907692008; "My Customers")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1902476008; "My Vendors")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control108; "Report Inbox Part")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ systempart(Control1901377608; MyNotes)
+ {
+ ApplicationArea = Basic, Suite;
+ }
}
}
@@ -668,7 +668,7 @@ page 9001 "Accounting Manager Role Center"
}
action("Cost Centers")
{
- ApplicationArea = Dimensions;
+ ApplicationArea = CostAccounting;
Caption = 'Cost Centers';
RunObject = Page "Chart of Cost Centers";
ToolTip = 'Manage cost centers, which are departments and profit centers that are responsible for costs and income. Often, there are more cost centers set up in cost accounting than in any dimension that is set up in the general ledger. In the general ledger, usually only the first level cost centers for direct costs and the initial costs are used. In cost accounting, additional cost centers are created for additional allocation levels.';
@@ -1016,7 +1016,7 @@ page 9001 "Accounting Manager Role Center"
}
action("Cost Accounting Setup")
{
- ApplicationArea = Dimensions;
+ ApplicationArea = CostAccounting;
Caption = 'Cost Accounting Setup';
Image = CostAccountingSetup;
RunObject = Page "Cost Accounting Setup";
diff --git a/src/Layers/ES/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/ES/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index 081fcf294d..73f5d68ad7 100644
--- a/src/Layers/ES/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/ES/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -97,7 +97,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
@@ -476,6 +475,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Financial Report';
RunObject = report "Account Schedule";
+ Tooltip = 'Run the Account Schedule report.';
}
action("Normalized Account Schedule")
{
@@ -1650,6 +1650,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Suite;
Caption = 'Salesperson Commission';
RunObject = report "Salesperson - Commission";
+ Tooltip = 'Run the Salesperson Commission report.';
}
action("Customer - Overdue Payments")
{
@@ -1892,6 +1893,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Purchase Statistics';
RunObject = report "Purchase Statistics";
+ Tooltip = 'Run the Purchase Statistics report.';
}
action("Purchases Invoice Book")
{
@@ -2887,7 +2889,7 @@ page 8901 "Finance Manager Role Center"
action("General Business")
{
ApplicationArea = Basic, Suite;
- Caption = 'Gen. Business Posting Groups';
+ Caption = 'General Business Posting Groups';
RunObject = page "Gen. Business Posting Groups";
Tooltip = 'Open the Gen. Business Posting Groups page.';
}
diff --git a/src/Layers/ES/BaseApp/HumanResources/Employee/Employee.Table.al b/src/Layers/ES/BaseApp/HumanResources/Employee/Employee.Table.al
index e847bf65d2..ae7ac1b0f3 100644
--- a/src/Layers/ES/BaseApp/HumanResources/Employee/Employee.Table.al
+++ b/src/Layers/ES/BaseApp/HumanResources/Employee/Employee.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -1027,4 +1027,5 @@ table 5200 Employee
local procedure OnBeforeSetEmployeeLedgEntryFilterByAccPeriod(var EmployeeLedgerEntry: Record "Employee Ledger Entry"; var IsHandled: Boolean)
begin
end;
+
}
diff --git a/src/Layers/ES/BaseApp/Purchases/Document/PurchaseQuote.Page.al b/src/Layers/ES/BaseApp/Purchases/Document/PurchaseQuote.Page.al
index 7ca17f85f1..a13e5a605b 100644
--- a/src/Layers/ES/BaseApp/Purchases/Document/PurchaseQuote.Page.al
+++ b/src/Layers/ES/BaseApp/Purchases/Document/PurchaseQuote.Page.al
@@ -1628,6 +1628,13 @@ page 49 "Purchase Quote"
OnAfterActivateFields();
end;
+ local procedure SetPurchaseLinesAvailability()
+ begin
+ IsPurchaseLinesEditable := Rec.PurchaseLinesEditable();
+
+ OnAfterSetPurchaseLinesAvailability(Rec, IsPurchaseLinesEditable);
+ end;
+
local procedure ApproveCalcInvDisc()
begin
CurrPage.PurchLines.PAGE.ApproveCalcInvDisc();
@@ -1682,7 +1689,7 @@ page 49 "Purchase Quote"
WorkflowWebhookManagement.GetCanRequestAndCanCancel(Rec.RecordId, CanRequestApprovalForFlow, CanCancelApprovalForFlow);
HasIncomingDocument := Rec."Incoming Document Entry No." <> 0;
- IsPurchaseLinesEditable := Rec.PurchaseLinesEditable();
+ SetPurchaseLinesAvailability();
end;
local procedure ValidateShippingOption()
@@ -1737,6 +1744,11 @@ page 49 "Purchase Quote"
begin
end;
+ [IntegrationEvent(true, false)]
+ local procedure OnAfterSetPurchaseLinesAvailability(var PurchaseHeader: Record "Purchase Header"; var PurchaseLinesAvailable: Boolean)
+ begin
+ end;
+
[IntegrationEvent(false, false)]
local procedure OnBeforeValidateShipToOptions(var PurchaseHeader: Record "Purchase Header"; ShipToOptions: Option)
begin
diff --git a/src/Layers/ES/BaseApp/Sales/Customer/Customer.Table.al b/src/Layers/ES/BaseApp/Sales/Customer/Customer.Table.al
index 9105017c31..3c8f5848d6 100644
--- a/src/Layers/ES/BaseApp/Sales/Customer/Customer.Table.al
+++ b/src/Layers/ES/BaseApp/Sales/Customer/Customer.Table.al
@@ -2501,6 +2501,7 @@ table 18 Customer
UpdateReferencedIds();
SetLastModifiedDateTime();
if IsContactUpdateNeeded() then begin
+ OnBeforeModifyContactUpdate(Rec);
Modify();
UpdateContFromCust.OnModify(Rec);
if not Find() then begin
@@ -2510,6 +2511,11 @@ table 18 Customer
end;
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnBeforeModifyContactUpdate(var Customer: Record Customer)
+ begin
+ end;
+
trigger OnRename()
var
IsHandled: Boolean;
diff --git a/src/Layers/ES/BaseApp/Sales/Customer/CustomerBankAccount.Table.al b/src/Layers/ES/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
index 328cefe153..d841e8e382 100644
--- a/src/Layers/ES/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
+++ b/src/Layers/ES/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -554,4 +554,5 @@ table 287 "Customer Bank Account"
local procedure OnBeforeValidatePostCode(var CustomerBankAccount: Record "Customer Bank Account"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
begin
end;
+
}
diff --git a/src/Layers/ES/BaseApp/Sales/Customer/CustomerTempl.Table.al b/src/Layers/ES/BaseApp/Sales/Customer/CustomerTempl.Table.al
index d497120634..e242b6166c 100644
--- a/src/Layers/ES/BaseApp/Sales/Customer/CustomerTempl.Table.al
+++ b/src/Layers/ES/BaseApp/Sales/Customer/CustomerTempl.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -910,4 +910,5 @@ table 1381 "Customer Templ."
local procedure OnCopyTemplateOnBeforeModify(SourceCustomerTempl: Record "Customer Templ."; SavedCustomerTempl: Record "Customer Templ."; var CustomerTempl: Record "Customer Templ.")
begin
end;
+
}
diff --git a/src/Layers/ES/BaseApp/Sales/Document/SalesHeader.Table.al b/src/Layers/ES/BaseApp/Sales/Document/SalesHeader.Table.al
index f8a90897fe..e3398cbc69 100644
--- a/src/Layers/ES/BaseApp/Sales/Document/SalesHeader.Table.al
+++ b/src/Layers/ES/BaseApp/Sales/Document/SalesHeader.Table.al
@@ -331,6 +331,7 @@ table 36 "Sales Header"
Validate("Payment Terms Code");
Validate("Prepmt. Payment Terms Code");
Validate("Payment Method Code");
+ OnAfterValidateBillToCustomerPaymentFields(Rec);
Validate("Prepayment %");
if (xRec."Sell-to Customer No." = "Sell-to Customer No.") and
@@ -4089,10 +4090,6 @@ table 36 "Sales Header"
InitRecord();
end;
-
-
-
-
///
/// Initializes a new sales header with default values.
///
@@ -10515,6 +10512,11 @@ table 36 "Sales Header"
begin
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnAfterValidateBillToCustomerPaymentFields(var SalesHeader: Record "Sales Header")
+ begin
+ end;
+
///
/// Raised after extended text is transferred for sales line recreation.
///
diff --git a/src/Layers/FI/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al b/src/Layers/FI/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
index 973b0c6d2d..495a78043c 100644
--- a/src/Layers/FI/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
+++ b/src/Layers/FI/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
@@ -71,53 +71,53 @@ page 9001 "Accounting Manager Role Center"
{
area(rolecenter)
{
- part(Control1902304208; "Account Manager Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part(Control99; "Finance Performance")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control103; "Trailing Sales Orders Chart")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control106; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control100; "Cash Flow Forecast Chart")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1907692008; "My Customers")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1902476008; "My Vendors")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control108; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- systempart(Control1901377608; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
+ part(Control1902304208; "Account Manager Activities")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part("User Tasks Activities"; "User Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part(Control99; "Finance Performance")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control103; "Trailing Sales Orders Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control106; "My Job Queue")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control100; "Cash Flow Forecast Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1907692008; "My Customers")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1902476008; "My Vendors")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control108; "Report Inbox Part")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ systempart(Control1901377608; MyNotes)
+ {
+ ApplicationArea = Basic, Suite;
+ }
}
}
diff --git a/src/Layers/FI/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/FI/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index 9f8d008ba1..16d4530718 100644
--- a/src/Layers/FI/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/FI/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -96,7 +96,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
@@ -2578,7 +2577,7 @@ page 8901 "Finance Manager Role Center"
action("General Business")
{
ApplicationArea = Basic, Suite;
- Caption = 'Gen. Business Posting Groups';
+ Caption = 'General Business Posting Groups';
RunObject = page "Gen. Business Posting Groups";
Tooltip = 'Open the Gen. Business Posting Groups page.';
}
diff --git a/src/Layers/FI/BaseApp/Sales/Customer/CustomerBankAccount.Table.al b/src/Layers/FI/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
index 7d3554c408..ef6d64cb6b 100644
--- a/src/Layers/FI/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
+++ b/src/Layers/FI/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -491,4 +491,5 @@ table 287 "Customer Bank Account"
local procedure OnBeforeValidatePostCode(var CustomerBankAccount: Record "Customer Bank Account"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
begin
end;
+
}
diff --git a/src/Layers/FI/BaseApp/Sales/Document/SalesHeader.Table.al b/src/Layers/FI/BaseApp/Sales/Document/SalesHeader.Table.al
index 72e1b35541..69ad59dee3 100644
--- a/src/Layers/FI/BaseApp/Sales/Document/SalesHeader.Table.al
+++ b/src/Layers/FI/BaseApp/Sales/Document/SalesHeader.Table.al
@@ -328,6 +328,7 @@ table 36 "Sales Header"
Validate("Payment Terms Code");
Validate("Prepmt. Payment Terms Code");
Validate("Payment Method Code");
+ OnAfterValidateBillToCustomerPaymentFields(Rec);
Validate("Prepayment %");
if (xRec."Sell-to Customer No." = "Sell-to Customer No.") and
@@ -10356,6 +10357,11 @@ table 36 "Sales Header"
begin
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnAfterValidateBillToCustomerPaymentFields(var SalesHeader: Record "Sales Header")
+ begin
+ end;
+
///
/// Raised after extended text is transferred for sales line recreation.
///
diff --git a/src/Layers/FR/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al b/src/Layers/FR/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
index ce204edd7d..ff7a94c724 100644
--- a/src/Layers/FR/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
+++ b/src/Layers/FR/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
@@ -64,36 +64,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Salespeople")
{
ApplicationArea = Suite;
Caption = 'Salespeople/Purchasers';
RunObject = page "Salespersons/Purchasers";
+ Tooltip = 'Open the Salespeople/Purchasers page.';
}
action("Teams")
{
ApplicationArea = Basic, Suite;
Caption = 'Teams';
RunObject = page "Teams";
+ Tooltip = 'Open the Teams page.';
}
action("Tasks")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Opportunities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
group("Group1")
{
@@ -103,36 +109,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesBudget;
Caption = 'Sales Budgets';
RunObject = page "Budget Names Sales";
+ Tooltip = 'Open the Sales Budgets page.';
}
action("Sales Analysis Reports")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Reports';
RunObject = page "Analysis Report Sale";
+ Tooltip = 'Open the Sales Analysis Reports page.';
}
action("Sales Analysis by Dimensions")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Item Dimensions - Detail")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Detail';
RunObject = report "Item Dimensions - Detail";
+ Tooltip = 'Run the Item Dimensions - Detail report.';
}
action("Item Dimensions - Total")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Total';
RunObject = report "Item Dimensions - Total";
+ Tooltip = 'Run the Item Dimensions - Total report.';
}
action("Opportunities Matrix")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Analysis';
RunObject = page "Opportunities";
+ Tooltip = 'Open the Opportunity Analysis page.';
}
}
group("Group2")
@@ -143,6 +155,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Deferral Summary';
RunObject = report "Deferral Summary - Sales";
+ Tooltip = 'Run the Sales Deferral Summary report.';
}
group("Group3")
{
@@ -152,18 +165,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Tasks';
RunObject = report "Salesperson - Tasks";
+ Tooltip = 'Run the Salesperson Tasks report.';
}
action("Salesperson - Commission")
{
ApplicationArea = Suite;
Caption = 'Salesperson Commission';
RunObject = report "Salesperson - Commission";
+ Tooltip = 'Run the Salesperson Commission report.';
}
action("Salesperson - Opportunities")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Opportunities';
RunObject = report "Salesperson - Opportunities";
+ Tooltip = 'Run the Salesperson Opportunities report.';
}
#if not CLEAN28
action("Sales Statistics")
@@ -174,6 +190,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
#endif
action("Team - Tasks")
@@ -181,12 +198,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Team Tasks';
RunObject = report "Team - Tasks";
+ Tooltip = 'Run the Team Tasks report.';
}
action("Salesperson - Sales Statistics")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Sales Statistics';
RunObject = report "Salesperson - Sales Statistics";
+ Tooltip = 'Run the Salesperson Sales Statistics report.';
}
}
group("Group4")
@@ -197,36 +216,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Contact Labels';
RunObject = report "Contact - Labels";
+ Tooltip = 'Run the Contact Labels report.';
}
action("Contact - Company Summary")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact - Company Summary';
RunObject = report "Contact - Company Summary";
+ Tooltip = 'Run the Contact - Company Summary report.';
}
action("Questionnaire - Handouts")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire - Handouts';
RunObject = report "Questionnaire - Handouts";
+ Tooltip = 'Run the Questionnaire - Handouts report.';
}
action("Contact - List")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact List';
RunObject = report "Contact - List";
+ Tooltip = 'Run the Contact List report.';
}
action("Orgl. Profile Summary")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Person Summary';
RunObject = report "Contact - Person Summary";
+ Tooltip = 'Run the Contact - Person Summary report.';
}
action("Contact - Cover Sheet")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Cover Sheet';
RunObject = report "Contact - Cover Sheet";
+ Tooltip = 'Run the Contact - Cover Sheet report.';
}
}
group("Group5")
@@ -241,6 +266,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - List report.';
}
#endif
action("Customer - Labels")
@@ -248,36 +274,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Customer Labels';
RunObject = report "Customer - Labels";
+ Tooltip = 'Run the Customer Labels report.';
}
action("Customer - Balance to Date")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Balance to Date';
RunObject = report "Customer - Balance to Date";
+ Tooltip = 'Run the Customer - Balance to Date report.';
}
action("Customer - Order Summary")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Summary';
RunObject = report "Customer - Order Summary";
+ Tooltip = 'Run the Customer - Order Summary report.';
}
action("Customer/Item Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Item Sales';
RunObject = report "Customer/Item Sales";
+ Tooltip = 'Run the Customer/Item Sales report.';
}
action("Customer Register")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Register';
RunObject = report "Customer Register";
+ Tooltip = 'Run the Customer Register report.';
}
action("Customer - Order Detail")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Detail';
RunObject = report "Customer - Order Detail";
+ Tooltip = 'Run the Customer - Order Detail report.';
}
#if not CLEAN28
action("Customer - Top 10 List")
@@ -288,6 +320,7 @@ page 8907 "Sales & Marketing Manager RC"
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';
+ Tooltip = 'Run the Customer Top 10 List report.';
}
#endif
action("Customer - Trial Balance")
@@ -295,6 +328,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Trial Balance';
RunObject = report "Customer - Trial Balance";
+ Tooltip = 'Run the Customer Trial Balance report.';
}
#if not CLEAN28
action("Customer - Sales List")
@@ -305,6 +339,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
}
@@ -316,18 +351,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - List';
RunObject = report "Opportunity - List";
+ Tooltip = 'Run the Opportunity - List report.';
}
action("Opportunity - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - Details';
RunObject = report "Opportunity - Details";
+ Tooltip = 'Run the Opportunity - Details report.';
}
action("Sales Cycle - Analysis")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycle - Analysis';
RunObject = report "Sales Cycle - Analysis";
+ Tooltip = 'Run the Sales Cycle - Analysis report.';
}
}
}
@@ -340,60 +378,70 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts1")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Quotes")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quotes';
RunObject = page "Sales Quotes";
+ Tooltip = 'Open the Sales Quotes page.';
}
action("Orders")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Orders';
RunObject = page "Sales Order List";
+ Tooltip = 'Open the Sales Orders page.';
}
action("Blanket Orders")
{
ApplicationArea = Suite;
Caption = 'Blanket Sales Orders';
RunObject = page "Blanket Sales Orders";
+ Tooltip = 'Open the Blanket Sales Orders page.';
}
action("Return Orders")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Sales Return Orders';
RunObject = page "Sales Return Order List";
+ Tooltip = 'Open the Sales Return Orders page.';
}
action("Invoices")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Invoices';
RunObject = page "Sales Invoice List";
+ Tooltip = 'Open the Sales Invoices page.';
}
action("Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Credit Memos';
RunObject = page "Sales Credit Memos";
+ Tooltip = 'Open the Sales Credit Memos page.';
}
action("Certificates of Supply")
{
ApplicationArea = Basic, Suite;
Caption = 'Certificates of Supply';
RunObject = page "Certificates of Supply";
+ Tooltip = 'Open the Certificates of Supply page.';
}
action("Order Planning")
{
ApplicationArea = Planning;
Caption = 'Order Planning';
RunObject = page "Order Planning";
+ Tooltip = 'Open the Order Planning page.';
}
group("Group8")
{
@@ -403,24 +451,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Invoices';
RunObject = page "Posted Sales Invoices";
+ Tooltip = 'Open the Posted Sales Invoices page.';
}
action("Posted Sales Shipments")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Shipments';
RunObject = page "Posted Sales Shipments";
+ Tooltip = 'Open the Posted Sales Shipments page.';
}
action("Posted Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Credit Memos';
RunObject = page "Posted Sales Credit Memos";
+ Tooltip = 'Open the Posted Sales Credit Memos page.';
}
action("Posted Return Receipts")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Posted Return Receipts';
RunObject = page "Posted Return Receipts";
+ Tooltip = 'Open the Posted Return Receipts page.';
}
}
group("Group9")
@@ -431,48 +483,56 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'G/L Registers';
RunObject = page "G/L Registers";
+ Tooltip = 'Open the G/L Registers page.';
}
action("Item Tracing")
{
ApplicationArea = ItemTracking;
Caption = 'Item Tracing';
RunObject = page "Item Tracing";
+ Tooltip = 'Open the Item Tracing page.';
}
action("Sales Quote Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quote Archives';
RunObject = page "Sales Quote Archives";
+ Tooltip = 'Open the Sales Quote Archives page.';
}
action("Sales Order Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Order Archives';
RunObject = page "Sales Order Archives";
+ Tooltip = 'Open the Sales Order Archives page.';
}
action("Sales Return Order Archives")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Return Order Archives';
RunObject = page "Sales Return List Archive";
+ Tooltip = 'Open the Sales Return Order Archives page.';
}
action("Customer Ledger Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Ledger Entries';
RunObject = page "Customer Ledger Entries";
+ Tooltip = 'Open the Customer Ledger Entries page.';
}
action("Detailed Cust. Ledg. Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Detailed Customer Ledger Entries';
RunObject = page "Detailed Cust. Ledg. Entries";
+ Tooltip = 'Open the Detailed Customer Ledger Entries page.';
}
action("Value Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Value Entries';
RunObject = page "Value Entries";
+ Tooltip = 'Open the Value Entries page.';
}
action("Navigate")
{
@@ -492,6 +552,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Detail';
RunObject = report "Customer - Order Detail";
+ Tooltip = 'Run the Customer - Order Detail report.';
}
#if not CLEAN28
action("Sales Reservation Avail.")
@@ -502,6 +563,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Reservation Avail. report.';
}
#endif
#if not CLEAN28
@@ -513,6 +575,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
#endif
#if not CLEAN28
@@ -524,6 +587,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
action("EC Sales List")
@@ -531,24 +595,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'EC Sales List';
RunObject = report "EC Sales List";
+ Tooltip = 'Run the EC Sales List report.';
}
action("EC Sales List - Services")
{
ApplicationArea = Basic, Suite;
Caption = 'EC Sales List - Services';
RunObject = report "EC Sales List - Services";
+ Tooltip = 'Run the EC Sales List - Services report.';
}
action("Customer/Item Sales1")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Item Sales';
RunObject = report "Customer/Item Sales";
+ Tooltip = 'Run the Customer/Item Sales report.';
}
action("Customer - Order Summary1")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Summary';
RunObject = report "Customer - Order Summary";
+ Tooltip = 'Run the Customer - Order Summary report.';
}
}
}
@@ -560,42 +628,49 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Campaigns")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaigns';
RunObject = page "Campaign List";
+ Tooltip = 'Open the Campaigns page.';
}
action("Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Segments';
RunObject = page "Segment List";
+ Tooltip = 'Open the Segments page.';
}
action("Logged Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Logged Segments';
RunObject = page "Logged Segments";
+ Tooltip = 'Open the Logged Segments page.';
}
action("Opportunities1")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
action("Tasks1")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Campaign - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign - Details';
RunObject = report "Campaign - Details";
+ Tooltip = 'Run the Campaign - Details report.';
}
group("Group12")
{
@@ -605,18 +680,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Entries';
RunObject = page "Campaign Entries";
+ Tooltip = 'Open the Campaign Entries page.';
}
action("Opportunity Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Entries';
RunObject = page "Opportunity Entries";
+ Tooltip = 'Open the Opportunity Entries page.';
}
action("Interaction Log Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Log Entries';
RunObject = page "Interaction Log Entries";
+ Tooltip = 'Open the Interaction Log Entries page.';
}
}
}
@@ -628,18 +706,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Items';
RunObject = page "Item List";
+ Tooltip = 'Open the Items page.';
}
action("Nonstock Items")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Items';
RunObject = page "Catalog Item List";
+ Tooltip = 'Open the Nonstock Items page.';
}
action("Item Attributes")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Attributes';
RunObject = page "Item Attributes";
+ Tooltip = 'Open the Item Attributes page.';
}
action("Sales Price Worksheet")
{
@@ -653,6 +734,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Adjust Item Costs/Prices';
RunObject = report "Adjust Item Costs/Prices";
+ Tooltip = 'Run the Adjust Item Costs/Prices report.';
}
group("Group14")
{
@@ -662,42 +744,49 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Inventory Sales Statistics';
RunObject = report "Inventory - Sales Statistics";
+ Tooltip = 'Run the Inventory Sales Statistics report.';
}
action("Inventory Cost and Price List")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Cost and Price List';
RunObject = report "Inventory Cost and Price List";
+ Tooltip = 'Run the Inventory Cost and Price List report.';
}
action("Item Charges - Specification")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Charges - Specification';
RunObject = report "Item Charges - Specification";
+ Tooltip = 'Run the Item Charges - Specification report.';
}
action("Inventory - Customer Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Customer Sales';
RunObject = report "Inventory - Customer Sales";
+ Tooltip = 'Run the Inventory Customer Sales report.';
}
action("Nonstock Item Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Sales';
RunObject = report "Catalog Item Sales";
+ Tooltip = 'Run the Nonstock Item Sales report.';
}
action("Inventory Availability")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Availability';
RunObject = report "Inventory Availability";
+ Tooltip = 'Run the Inventory Availability report.';
}
action("Inventory Order Details")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Order Details';
RunObject = report "Inventory Order Details";
+ Tooltip = 'Run the Inventory Order Details report.';
}
action("Price List")
{
@@ -711,18 +800,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Inventory - Sales Back Orders';
RunObject = report "Inventory - Sales Back Orders";
+ Tooltip = 'Run the Inventory - Sales Back Orders report.';
}
action("Inventory - Top 10 List")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Top 10 List';
RunObject = report "Inventory - Top 10 List";
+ Tooltip = 'Run the Inventory Top 10 List report.';
}
action("Item Substitutions")
{
ApplicationArea = Suite;
Caption = 'Item Substitutions';
RunObject = report "Item Substitutions";
+ Tooltip = 'Run the Item Substitutions report.';
}
}
}
@@ -734,54 +826,63 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Orders - Dynamics 365 Sales';
RunObject = page "CRM Sales Order List";
+ Tooltip = 'Open the Sales Orders - Dynamics 365 Sales page.';
}
action("Quotes - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Quotes - Dynamics 365 Sales';
RunObject = page "CRM Sales Quote List";
+ Tooltip = 'Open the Quotes - Dynamics 365 Sales page.';
}
action("Cases - Dynamics 365 for Customer Service")
{
ApplicationArea = Suite;
Caption = 'Cases - Dynamics 365 for Customer Service';
RunObject = page "CRM Case List";
+ Tooltip = 'Open the Cases - Dynamics 365 for Customer Service page.';
}
action("Opportunities - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Opportunities - Dynamics 365 Sales';
RunObject = page "CRM Opportunity List";
+ Tooltip = 'Open the Opportunities - Dynamics 365 Sales page.';
}
action("Accounts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Accounts - Dynamics 365 Sales';
RunObject = page "CRM Account List";
+ Tooltip = 'Open the Accounts - Dynamics 365 Sales page.';
}
action("Transaction Currencies - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Transaction Currencies - Dynamics 365 Sales';
RunObject = page "CRM TransactionCurrency List";
+ Tooltip = 'Open the Transaction Currencies - Dynamics 365 Sales page.';
}
action("Unit Groups - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Unit Groups - Dynamics 365 Sales';
RunObject = page "CRM UnitGroup List";
+ Tooltip = 'Open the Unit Groups - Dynamics 365 Sales page.';
}
action("Products - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Products - Dynamics 365 Sales';
RunObject = page "CRM Product List";
+ Tooltip = 'Open the Products - Dynamics 365 Sales page.';
}
action("Contacts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Contacts - Dynamics 365 Sales';
RunObject = page "CRM Contact List";
+ Tooltip = 'Open the Contacts - Dynamics 365 Sales page.';
}
action("Records Skipped For Synchronization")
{
@@ -789,6 +890,7 @@ page 8907 "Sales & Marketing Manager RC"
Caption = 'Coupled Data Synchronization Errors';
RunObject = page "CRM Skipped Records";
AccessByPermission = TableData "CRM Integration Record" = R;
+ Tooltip = 'Open the Coupled Data Synchronization Errors page.';
}
}
group("Group16")
@@ -799,60 +901,70 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = OrderPromising;
Caption = 'Order Promising Setup';
RunObject = page "Order Promising Setup";
+ Tooltip = 'Open the Order Promising Setup page.';
}
action("Sales & Receivables Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales & Receivables Setup';
RunObject = page "Sales & Receivables Setup";
+ Tooltip = 'Open the Sales & Receivables Setup page.';
}
action("report Selection Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Sales';
RunObject = page "Report Selection - Sales";
+ Tooltip = 'Open the Report Selections Sales page.';
}
action("Standard Sales Codes")
{
ApplicationArea = Suite;
Caption = 'Standard Sales Codes';
RunObject = page "Standard Sales Codes";
+ Tooltip = 'Open the Standard Sales Codes page.';
}
action("Payment Terms")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Terms';
RunObject = page "Payment Terms";
+ Tooltip = 'Open the Payment Terms page.';
}
action("Payment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Methods';
RunObject = page "Payment Methods";
+ Tooltip = 'Open the Payment Methods page.';
}
action("Item Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Shipment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Shipment Methods';
RunObject = page "Shipment Methods";
+ Tooltip = 'Open the Shipment Methods page.';
}
action("Shipping Agents")
{
ApplicationArea = Suite;
Caption = 'Shipping Agents';
RunObject = page "Shipping Agents";
+ Tooltip = 'Open the Shipping Agents page.';
}
action("Return Reasons")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Return Reasons';
RunObject = page "Return Reasons";
+ Tooltip = 'Open the Return Reasons page.';
}
action("Customer Templates")
{
@@ -869,24 +981,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesAnalysis, PurchaseAnalysis, InventoryAnalysis;
Caption = 'Analysis Types';
RunObject = page "Analysis Types";
+ Tooltip = 'Open the Analysis Types page.';
}
action("Sales Analysis by Dimensions1")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Analysis Column Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Column Templates';
RunObject = report "Run Sales Analysis Col. Temp.";
+ Tooltip = 'Run the Sales Analysis Column Templates report.';
}
action("Analysis Line Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Line Templates';
RunObject = report "Run Sales Analysis Line Templ.";
+ Tooltip = 'Run the Sales Analysis Line Templates report.';
}
}
group("Group18")
@@ -897,12 +1013,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Price Groups';
RunObject = page "Customer Price Groups";
+ Tooltip = 'Open the Customer Price Groups page.';
}
action("Customer Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Discount Groups';
RunObject = page "Customer Disc. Groups";
+ Tooltip = 'Open the Customer Discount Groups page.';
}
}
group("Group19")
@@ -913,24 +1031,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Setup';
RunObject = page "Catalog Item Setup";
+ Tooltip = 'Open the Nonstock Item Setup page.';
}
action("Item Charges")
{
ApplicationArea = ItemCharges;
Caption = 'Item Charges';
RunObject = page "Item Charges";
+ Tooltip = 'Open the Item Charges page.';
}
action("Item Disc. Groups1")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Inventory Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Setup';
RunObject = page "Inventory Setup";
+ Tooltip = 'Open the Inventory Setup page.';
}
}
group("Group20")
@@ -941,99 +1063,116 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite, RelationshipMgmt;
Caption = 'Marketing Setup';
RunObject = page "Marketing Setup";
+ Tooltip = 'Open the Marketing Setup page.';
}
action("Interaction Template Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Template Setup';
RunObject = page "Interaction Template Setup";
+ Tooltip = 'Open the Interaction Template Setup page.';
}
action("Business Relations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Business Relations';
RunObject = page "Business Relations";
+ Tooltip = 'Open the Business Relations page.';
}
action("Industry Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Industry Groups';
RunObject = page "Industry Groups";
+ Tooltip = 'Open the Industry Groups page.';
}
action("Web Sources")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Web Sources';
RunObject = page "Web Sources";
+ Tooltip = 'Open the Web Sources page.';
}
action("Job Responsibilities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Job Responsibilities';
RunObject = page "Job Responsibilities";
+ Tooltip = 'Open the Job Responsibilities page.';
}
action("Organizational Levels")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Organizational Levels';
RunObject = page "Organizational Levels";
+ Tooltip = 'Open the Organizational Levels page.';
}
action("Interaction Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Groups';
RunObject = page "Interaction Groups";
+ Tooltip = 'Open the Interaction Groups page.';
}
action("Interaction Templates")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Templates';
RunObject = page "Interaction Templates";
+ Tooltip = 'Open the Interaction Templates page.';
}
action("Salutations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Salutations';
RunObject = page "Salutations";
+ Tooltip = 'Open the Salutations page.';
}
action("Mailing Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Mailing Groups';
RunObject = page "Mailing Groups";
+ Tooltip = 'Open the Mailing Groups page.';
}
action("Status")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Status';
RunObject = page "Campaign Status";
+ Tooltip = 'Open the Campaign Status page.';
}
action("Sales Cycles")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycles';
RunObject = page "Sales Cycles";
+ Tooltip = 'Open the Sales Cycles page.';
}
action("Close Opportunity Codes")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Close Opportunity Codes';
RunObject = page "Close Opportunity Codes";
+ Tooltip = 'Open the Close Opportunity Codes page.';
}
action("Questionnaire Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire Setup';
RunObject = page "Profile Questionnaires";
+ Tooltip = 'Open the Questionnaire Setup page.';
}
action("Activities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Activities';
RunObject = page "Activity List";
+ Tooltip = 'Open the Activities page.';
}
}
}
}
}
+
}
diff --git a/src/Layers/FR/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al b/src/Layers/FR/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
index 7f3eb73ce3..b4a3b44e1f 100644
--- a/src/Layers/FR/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
+++ b/src/Layers/FR/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
@@ -1187,7 +1187,7 @@ page 9001 "Accounting Manager Role Center"
}
action("Cost Accounting Setup")
{
- ApplicationArea = Dimensions;
+ ApplicationArea = CostAccounting;
Caption = 'Cost Accounting Setup';
Image = CostAccountingSetup;
RunObject = Page "Cost Accounting Setup";
diff --git a/src/Layers/FR/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/FR/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index d3feb36572..449d99a177 100644
--- a/src/Layers/FR/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/FR/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -97,7 +97,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
@@ -461,6 +460,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Financial Report';
RunObject = report "Account Schedule";
+ Tooltip = 'Run the Account Schedule report.';
}
action("FR Account Schedule")
{
@@ -946,6 +946,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Cash Flow Ledger Entries';
RunObject = page "Cash Flow Forecast Entries";
+ Tooltip = 'Open the Cash Flow Ledger Entries page.';
}
#if not CLEAN28
action("Payment Slip Archive")
@@ -1645,6 +1646,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Purchase Credit Memos';
RunObject = page "Purchase Credit Memos";
+ Tooltip = 'Open the Purchase Credit Memos page.';
}
#if not CLEAN28
action("Payment Slips2")
@@ -1911,6 +1913,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Purchases & Payables Setup';
RunObject = page "Purchases & Payables Setup";
+ Tooltip = 'Open the Purchases & Payables Setup page.';
}
}
}
@@ -2779,7 +2782,7 @@ page 8901 "Finance Manager Role Center"
action("General Business")
{
ApplicationArea = Basic, Suite;
- Caption = 'Gen. Business Posting Groups';
+ Caption = 'General Business Posting Groups';
RunObject = page "Gen. Business Posting Groups";
Tooltip = 'Open the Gen. Business Posting Groups page.';
}
diff --git a/src/Layers/FR/BaseApp/HumanResources/Employee/Employee.Table.al b/src/Layers/FR/BaseApp/HumanResources/Employee/Employee.Table.al
index e709bf4f7c..18c00305b5 100644
--- a/src/Layers/FR/BaseApp/HumanResources/Employee/Employee.Table.al
+++ b/src/Layers/FR/BaseApp/HumanResources/Employee/Employee.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -1012,4 +1012,5 @@ table 5200 Employee
local procedure OnBeforeSetEmployeeLedgEntryFilterByAccPeriod(var EmployeeLedgerEntry: Record "Employee Ledger Entry"; var IsHandled: Boolean)
begin
end;
+
}
diff --git a/src/Layers/FR/BaseApp/Sales/Customer/Customer.Table.al b/src/Layers/FR/BaseApp/Sales/Customer/Customer.Table.al
index 876f8c3334..bed641a57d 100644
--- a/src/Layers/FR/BaseApp/Sales/Customer/Customer.Table.al
+++ b/src/Layers/FR/BaseApp/Sales/Customer/Customer.Table.al
@@ -2504,6 +2504,7 @@ table 18 Customer
UpdateReferencedIds();
SetLastModifiedDateTime();
if IsContactUpdateNeeded() then begin
+ OnBeforeModifyContactUpdate(Rec);
Modify();
UpdateContFromCust.OnModify(Rec);
if not Find() then begin
@@ -2513,6 +2514,11 @@ table 18 Customer
end;
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnBeforeModifyContactUpdate(var Customer: Record Customer)
+ begin
+ end;
+
trigger OnRename()
var
IsHandled: Boolean;
diff --git a/src/Layers/FR/BaseApp/Sales/Customer/CustomerBankAccount.Table.al b/src/Layers/FR/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
index d945be8706..77d1f30aee 100644
--- a/src/Layers/FR/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
+++ b/src/Layers/FR/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -546,4 +546,5 @@ table 287 "Customer Bank Account"
local procedure OnBeforeValidatePostCode(var CustomerBankAccount: Record "Customer Bank Account"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
begin
end;
+
}
diff --git a/src/Layers/FR/BaseApp/Sales/Customer/CustomerTempl.Table.al b/src/Layers/FR/BaseApp/Sales/Customer/CustomerTempl.Table.al
index ba66591344..d74152edd6 100644
--- a/src/Layers/FR/BaseApp/Sales/Customer/CustomerTempl.Table.al
+++ b/src/Layers/FR/BaseApp/Sales/Customer/CustomerTempl.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -899,4 +899,5 @@ table 1381 "Customer Templ."
local procedure OnCopyTemplateOnBeforeModify(SourceCustomerTempl: Record "Customer Templ."; SavedCustomerTempl: Record "Customer Templ."; var CustomerTempl: Record "Customer Templ.")
begin
end;
+
}
diff --git a/src/Layers/FR/BaseApp/Sales/Document/SalesHeader.Table.al b/src/Layers/FR/BaseApp/Sales/Document/SalesHeader.Table.al
index 67c35c5199..c0b1e02d9c 100644
--- a/src/Layers/FR/BaseApp/Sales/Document/SalesHeader.Table.al
+++ b/src/Layers/FR/BaseApp/Sales/Document/SalesHeader.Table.al
@@ -328,6 +328,7 @@ table 36 "Sales Header"
Validate("Payment Terms Code");
Validate("Prepmt. Payment Terms Code");
Validate("Payment Method Code");
+ OnAfterValidateBillToCustomerPaymentFields(Rec);
Validate("Prepayment %");
if (xRec."Sell-to Customer No." = "Sell-to Customer No.") and
@@ -10360,6 +10361,11 @@ table 36 "Sales Header"
begin
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnAfterValidateBillToCustomerPaymentFields(var SalesHeader: Record "Sales Header")
+ begin
+ end;
+
///
/// Raised after extended text is transferred for sales line recreation.
///
diff --git a/src/Layers/GB/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al b/src/Layers/GB/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
index 3d8a91c23a..a134036581 100644
--- a/src/Layers/GB/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
+++ b/src/Layers/GB/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
@@ -71,53 +71,53 @@ page 9001 "Accounting Manager Role Center"
{
area(rolecenter)
{
- part(Control1902304208; "Account Manager Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part(Control99; "Finance Performance")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control103; "Trailing Sales Orders Chart")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control106; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control100; "Cash Flow Forecast Chart")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1907692008; "My Customers")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1902476008; "My Vendors")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control108; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- systempart(Control1901377608; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
+ part(Control1902304208; "Account Manager Activities")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part("User Tasks Activities"; "User Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part(Control99; "Finance Performance")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control103; "Trailing Sales Orders Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control106; "My Job Queue")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control100; "Cash Flow Forecast Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1907692008; "My Customers")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1902476008; "My Vendors")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control108; "Report Inbox Part")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ systempart(Control1901377608; MyNotes)
+ {
+ ApplicationArea = Basic, Suite;
+ }
}
}
diff --git a/src/Layers/GB/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/GB/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index ad640d8e29..7ecc94b591 100644
--- a/src/Layers/GB/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/GB/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -96,7 +96,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
@@ -2547,6 +2546,7 @@ page 8901 "Finance Manager Role Center"
Caption = 'Posting Groups';
action("General Business")
{
+ ApplicationArea = Basic, Suite;
Caption = 'General Business Posting Groups';
RunObject = page "Gen. Business Posting Groups";
Tooltip = 'Open the Gen. Business Posting Groups page.';
diff --git a/src/Layers/GB/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al b/src/Layers/GB/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
index 7c237f9cab..139de823e3 100644
--- a/src/Layers/GB/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
+++ b/src/Layers/GB/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
@@ -77,6 +77,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'System Information';
RunObject = page "Latest Error";
+ Tooltip = 'Open the System Information page.';
}
action("Table Information")
{
@@ -90,30 +91,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Extension Management';
RunObject = page "Extension Management";
+ Tooltip = 'Open the Extension Management page.';
}
action("Profiles")
{
ApplicationArea = Basic, Suite;
Caption = 'Profiles (Roles)';
RunObject = page "Profile List";
+ Tooltip = 'Open the Profiles (Roles) page.';
}
action("Devices")
{
ApplicationArea = Basic, Suite;
Caption = 'Devices';
RunObject = page "Devices";
+ Tooltip = 'Open the Devices page.';
}
action("Control Add-ins")
{
ApplicationArea = All;
Caption = 'Control Add-ins';
RunObject = page "Control Add-ins";
+ Tooltip = 'Open the Control Add-ins page.';
}
action("Get the Mobile Device App (Tablet and Phone activatation code)")
{
ApplicationArea = All;
Caption = 'Mobile device activation and app';
RunObject = page "O365 Device Setup";
+ Tooltip = 'Open the Mobile device activation and app page.';
}
action("Printer Management")
{
@@ -131,60 +137,70 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Online Map Setup';
RunObject = page "Online Map Setup";
+ Tooltip = 'Open the Online Map Setup page.';
}
action("Bank Export/Import Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Bank Export/Import Setup';
RunObject = page "Bank Export/Import Setup";
+ Tooltip = 'Open the Bank Export/Import Setup page.';
}
action("Cue Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Cue Setup';
RunObject = page "Cue Setup Administrator";
+ Tooltip = 'Open the Cue Setup page.';
}
action("Document Sending Profiles")
{
ApplicationArea = Basic, Suite;
Caption = 'Document Sending Profiles';
RunObject = page "Document Sending Profiles";
+ Tooltip = 'Open the Document Sending Profiles page.';
}
action("Printer Selections")
{
ApplicationArea = Suite;
Caption = 'Printer Selections';
RunObject = page "Printer Selections";
+ Tooltip = 'Open the Printer Selections page.';
}
action("Electronic Document Formats")
{
ApplicationArea = Suite;
Caption = 'Electronic Document Formats';
RunObject = page "Electronic Document Format";
+ Tooltip = 'Open the Electronic Document Formats page.';
}
action("Assisted Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Assisted Setup';
RunObject = page "Assisted Setup";
+ Tooltip = 'Open the Assisted Setup page.';
}
action("Application Area")
{
ApplicationArea = All;
Caption = 'Application Area';
RunObject = page "Application Area";
+ Tooltip = 'Open the Application Area page.';
}
action("Set Up Customer/Vendor/Item Templates")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Vendor/Item Templates';
RunObject = page "Config Templates";
+ Tooltip = 'Open the Customer/Vendor/Item Templates page.';
}
action("Transformation Rules")
{
ApplicationArea = Basic, Suite;
Caption = 'Transformation Rules';
RunObject = page "Transformation Rules";
+ Tooltip = 'Open the Transformation Rules page.';
}
action("Business Setup")
{
@@ -198,6 +214,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Image Analysis Setup';
RunObject = page "Image Analysis Setup";
+ Tooltip = 'Open the Image Analysis Setup page.';
}
}
group("Group4")
@@ -208,18 +225,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Entries';
RunObject = page "Job Queue Entries";
+ Tooltip = 'Open the Job Queue Entries page.';
}
action("Job Queue Log Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Log Entries';
RunObject = page "Job Queue Log Entries";
+ Tooltip = 'Open the Job Queue Log Entries page.';
}
action("Job Queue Category List")
{
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Category List';
RunObject = page "Job Queue Category List";
+ Tooltip = 'Open the Job Queue Category List page.';
}
action("Scheduled Tasks")
{
@@ -237,12 +257,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Change Log Setup';
RunObject = page "Change Log Setup";
+ Tooltip = 'Open the Change Log Setup page.';
}
action("Change Log")
{
ApplicationArea = Basic, Suite;
Caption = 'Change Log Entries';
RunObject = page "Change Log Entries";
+ Tooltip = 'Open the Change Log Entries page.';
}
}
group("Group6")
@@ -253,12 +275,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Layout Selection';
RunObject = page "Report Layout Selection";
+ Tooltip = 'Open the Report Layout Selection page.';
}
action("Report Configuration")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Settings';
RunObject = page "Report Settings";
+ Tooltip = 'Open the Report Settings page.';
AccessByPermission = TableData "Object Options" = IMD;
}
action("Report Inbox")
@@ -266,6 +290,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Inbox';
RunObject = page "Report Inbox";
+ Tooltip = 'Open the Report Inbox page.';
}
#if not CLEAN28
action("Custom Report Layouts")
@@ -278,6 +303,7 @@ page 8900 "Administrator Main Role Center"
#pragma warning disable AL0432
RunObject = page "Custom Report Layouts";
#pragma warning restore AL0432
+ Tooltip = 'Open the Custom Report Layouts page.';
}
#endif
action("Report Selection Purchase")
@@ -285,30 +311,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Purchase';
RunObject = page "Report Selection - Purchase";
+ Tooltip = 'Open the Report Selections Purchase page.';
}
action("Report Selection Reminder and")
{
ApplicationArea = Suite;
Caption = 'Report Selections Reminder/Fin. Charge';
RunObject = page "Report Selection - Reminder";
+ Tooltip = 'Open the Report Selections Reminder/Fin. Charge page.';
}
action("Report Selection Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Sales';
RunObject = page "Report Selection - Sales";
+ Tooltip = 'Open the Report Selections Sales page.';
}
action("Report Selection - Bank Acc.")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Bank Account';
RunObject = page "Report Selection - Bank Acc.";
+ Tooltip = 'Open the Report Selections Bank Account page.';
}
action("Report Selections Inventory")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Inventory';
RunObject = page "Report Selection - Inventory";
+ Tooltip = 'Open the Report Selections Inventory page.';
}
}
group("Group7")
@@ -319,12 +350,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Test Tool';
RunObject = page "CAL Test Tool";
+ Tooltip = 'Open the Test Tool page.';
}
action("Code Coverage")
{
ApplicationArea = All;
Caption = 'Code Coverage';
RunObject = page "Code Coverage";
+ Tooltip = 'Open the Code Coverage page.';
}
// action("Sessions")
// {
@@ -352,54 +385,63 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Company Information';
RunObject = page "Company Information";
+ Tooltip = 'Open the Company Information page.';
}
action("Companies")
{
ApplicationArea = Basic, Suite;
Caption = 'Companies';
RunObject = page "Companies";
+ Tooltip = 'Open the Companies page.';
}
action("No. Series")
{
ApplicationArea = Basic, Suite;
Caption = 'No. Series';
RunObject = page "No. Series";
+ Tooltip = 'Open the No. Series page.';
}
action("Post Codes")
{
ApplicationArea = Basic, Suite;
Caption = 'Post Codes';
RunObject = page "Post Codes";
+ Tooltip = 'Open the Post Codes page.';
}
action("Territories")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Territories';
RunObject = page "Territories";
+ Tooltip = 'Open the Territories page.';
}
action("Languages")
{
ApplicationArea = Suite;
Caption = 'Languages';
RunObject = page "Languages";
+ Tooltip = 'Open the Languages page.';
}
action("Countries/Regions")
{
ApplicationArea = Basic, Suite;
Caption = 'Countries/Regions';
RunObject = page "Countries/Regions";
+ Tooltip = 'Open the Countries/Regions page.';
}
action("Base Calendar Entries Subform")
{
ApplicationArea = Basic, Suite;
Caption = 'Base Calendar';
RunObject = page "Base Calendar List";
+ Tooltip = 'Open the Base Calendar page.';
}
action("Responsibility Centers")
{
ApplicationArea = Basic, Suite;
Caption = 'Responsibility Centers';
RunObject = page "Responsibility Center List";
+ Tooltip = 'Open the Responsibility Centers page.';
}
}
group("Group10")
@@ -417,6 +459,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Data Classification Worksheet';
RunObject = page "Data Classification Worksheet";
+ Tooltip = 'Open the Data Classification Worksheet page.';
AccessByPermission = TableData "Data Sensitivity" = R;
}
action("Privacy for App Integrations")
@@ -431,12 +474,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'XML Schemas';
RunObject = page "XML Schemas";
+ Tooltip = 'Open the XML Schemas page.';
}
action("SEPA Schema Viewer")
{
ApplicationArea = Basic, Suite;
Caption = 'SEPA Schema Viewer';
RunObject = page "XML Schema Viewer";
+ Tooltip = 'Open the SEPA Schema Viewer page.';
}
}
group("Group11")
@@ -447,18 +492,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Data Migration Overview';
RunObject = page "Data Migration Overview";
+ Tooltip = 'Open the Data Migration Overview page.';
}
action("Data Migration")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Migration';
RunObject = page "Data Migration Wizard";
+ Tooltip = 'Open the Data Migration page.';
}
action("Data Migration Settings")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Migration Settings';
RunObject = page "Data Migration Settings";
+ Tooltip = 'Open the Data Migration Settings page.';
AccessByPermission = TableData "Data Migration Setup" = R;
}
}
@@ -470,24 +518,28 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Import from a Data File';
RunObject = page "Import Data";
+ Tooltip = 'Open the Import from a Data File page.';
}
action("Export to a Data File")
{
ApplicationArea = Basic, Suite;
Caption = 'Export to a Data File';
RunObject = page "Export Data";
+ Tooltip = 'Open the Export to a Data File page.';
}
action("Data Exchange Types")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Exchange Types';
RunObject = page "Data Exchange Types";
+ Tooltip = 'Open the Data Exchange Types page.';
}
action("Data Exchange Definition")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Exchange Definitions';
RunObject = page "Data Exch Def List";
+ Tooltip = 'Open the Data Exchange Definitions page.';
}
}
group("Group13")
@@ -501,18 +553,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Customers...';
RunObject = report "Create Conts. from Customers";
+ Tooltip = 'Run the Create Contacts from Customers report.';
}
action("Create Contacts from Vendors")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Vendors...';
RunObject = report "Create Conts. from Vendors";
+ Tooltip = 'Run the Create Contacts from Vendors report.';
}
action("Create Contacts from Bank Acco")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Bank Accounts...';
RunObject = report "Create Conts. from Bank Accs.";
+ Tooltip = 'Run the Create Contacts from Bank Accounts report.';
}
}
}
@@ -527,6 +582,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Date Compr. Registers';
RunObject = page "Date Compr. Registers";
+ Tooltip = 'Open the Date Compr. Registers page.';
}
}
group("Group17")
@@ -537,6 +593,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Delete Orphaned Record Links';
RunObject = codeunit "Remove Orphaned Record Links";
+ Tooltip = 'Run the Delete Orphaned Record Links codeunit.';
}
}
group("Group18")
@@ -547,12 +604,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Profile Customizations';
RunObject = page "Profile Customization List";
+ Tooltip = 'Open the Profile Customizations page.';
}
action("User Page Personalizations")
{
ApplicationArea = Basic, Suite;
Caption = 'User Page Personalizations';
RunObject = page "Personalized Pages";
+ Tooltip = 'Open the User Page Personalizations page.';
}
}
}
@@ -565,12 +624,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Users';
RunObject = page "Users";
+ Tooltip = 'Open the Users page.';
}
action("User Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'User Setup';
RunObject = page "User Setup";
+ Tooltip = 'Open the User Setup page.';
}
// action("Change Password")
// {
@@ -583,6 +644,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'User Security Status';
RunObject = page "User Security Status List";
+ Tooltip = 'Open the User Security Status page.';
AccessByPermission = TableData "User" = R;
}
action("User Tasks")
@@ -590,18 +652,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'User Tasks';
RunObject = page "User Task List";
+ Tooltip = 'Open the User Tasks page.';
}
action("User Personalization")
{
ApplicationArea = Basic, Suite;
Caption = 'User Settings';
RunObject = page "User Settings List";
+ Tooltip = 'Open the User Settings page.';
}
action("User Time Registers")
{
ApplicationArea = Basic, Suite;
Caption = 'Time Registers';
RunObject = page "User Time Registers";
+ Tooltip = 'Open the Time Registers page.';
}
}
group(Permissions)
@@ -643,30 +708,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflows';
RunObject = page "Workflows";
+ Tooltip = 'Open the Workflows page.';
}
action("Workflow User Group")
{
ApplicationArea = Suite;
Caption = 'Workflow User Groups';
RunObject = page "Workflow User Groups";
+ Tooltip = 'Open the Workflow User Groups page.';
}
action("Approval User Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Approval User Setup';
RunObject = page "Approval User Setup";
+ Tooltip = 'View or edit information about workflow users who are involved in approval processes, such as approval amount limits for specific types of requests and substitute approvers to whom approval requests are delegated when the original approver is absent.';
}
action("Incoming Documents Setup")
{
ApplicationArea = Suite;
Caption = 'Incoming Documents Setup';
RunObject = page "Incoming Documents Setup";
+ Tooltip = 'Open the Incoming Documents Setup page.';
}
action("Send Overdue Appr. Notif.")
{
ApplicationArea = Suite;
Caption = 'Send Overdue Approval Notifications';
RunObject = report "Send Overdue Appr. Notif.";
+ Tooltip = 'Run the Send Overdue Approval Notifications report.';
}
group("Group21")
{
@@ -676,12 +746,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflow Templates';
RunObject = page "Workflow Templates";
+ Tooltip = 'Open the Workflow Templates page.';
}
action("Workflow Categories")
{
ApplicationArea = Suite;
Caption = 'Workflow Categories';
RunObject = page "Workflow Categories";
+ Tooltip = 'Open the Workflow Categories page.';
}
}
group("Group22")
@@ -692,18 +764,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflow Event Hierarchies';
RunObject = page "Workflow Event Hierarchies";
+ Tooltip = 'Open the Workflow Event Hierarchies page.';
}
action("WF Event/Response Combinations")
{
ApplicationArea = Suite;
Caption = 'Workflow Event/Response Combinations';
RunObject = page "WF Event/Response Combinations";
+ Tooltip = 'Open the Workflow Event/Response Combinations page.';
}
action("Workflow - Table Relations")
{
ApplicationArea = Suite;
Caption = 'Workflow - Table Relations';
RunObject = page "Workflow - Table Relations";
+ Tooltip = 'Open the Workflow - Table Relations page.';
}
}
group("Group23")
@@ -714,18 +789,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Notification Setup';
RunObject = page "Notification Setup";
+ Tooltip = 'Open the Notification Setup page.';
}
action("Notification Entries")
{
ApplicationArea = Suite;
Caption = 'Notification Entries';
RunObject = page "Notification Entries";
+ Tooltip = 'Open the Notification Entries page.';
}
action("Sent Notification Entries")
{
ApplicationArea = Suite;
Caption = 'Sent Notification Entries';
RunObject = page "Sent Notification Entries";
+ Tooltip = 'Open the Sent Notification Entries page.';
}
}
group("Group24")
@@ -736,36 +814,42 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Approval Entries';
RunObject = page "Approval Entries";
+ Tooltip = 'Open the Approval Entries page.';
}
action("Posted Approval Entries")
{
ApplicationArea = Suite;
Caption = 'Posted Approval Entries';
RunObject = page "Posted Approval Entries";
+ Tooltip = 'Open the Posted Approval Entries page.';
}
action("Overdue Approval Entries")
{
ApplicationArea = Suite;
Caption = 'Overdue Approval Entries';
RunObject = page "Overdue Approval Entries";
+ Tooltip = 'Open the Overdue Approval Entries page.';
}
action("Restricted Records")
{
ApplicationArea = Suite;
Caption = 'Restricted Records';
RunObject = page "Restricted Records";
+ Tooltip = 'Open the Restricted Records page.';
}
action("Workflow Step Instances")
{
ApplicationArea = Suite;
Caption = 'Workflow Step Instances';
RunObject = page "Workflow Step Instances";
+ Tooltip = 'Open the Workflow Step Instances page.';
}
action("Archived Workflow Step Instances")
{
ApplicationArea = Suite;
Caption = 'Archived Workflow Step Instances';
RunObject = page "Archived WF Step Instances";
+ Tooltip = 'Open the Archived Workflow Step Instances page.';
}
}
group("Group26")
@@ -793,12 +877,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Web Services';
RunObject = page "Web Services";
+ Tooltip = 'Open the Web Services page.';
}
action("Microsoft Dynamics 365 Connection Setup")
{
ApplicationArea = Suite;
Caption = 'Microsoft Dynamics 365 Connection Setup';
RunObject = page "CRM Connection Setup";
+ Tooltip = 'Open the Microsoft Dynamics 365 Connection Setup page.';
AccessByPermission = TableData "CRM Connection Setup" = IM;
}
action("Email Account Setup")
@@ -814,72 +900,84 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'OCR Service Setup';
RunObject = page "OCR Service Setup";
+ Tooltip = 'Open the OCR Service Setup page.';
}
action("Currency Exchange Rate Services")
{
ApplicationArea = Suite;
Caption = 'Currency Exchange Rate Services';
RunObject = page "Curr. Exch. Rate Service List";
+ Tooltip = 'Open the Currency Exchange Rate Services page.';
}
action("Service Connections Overview")
{
ApplicationArea = Basic, Suite;
Caption = 'Service Connections';
RunObject = page "Service Connections";
+ Tooltip = 'Open the Service Connections page.';
}
action("Doc. Exch. Service Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Document Exchange Service Setup';
RunObject = page "Doc. Exch. Service Setup";
+ Tooltip = 'Open the Document Exchange Service Setup page.';
}
action("Integration Table Mappings")
{
ApplicationArea = Suite;
Caption = 'Integration Table Mappings';
RunObject = page "Integration Table Mapping List";
+ Tooltip = 'Open the Integration Table Mappings page.';
}
action("Integration Synchronization Jobs")
{
ApplicationArea = Suite;
Caption = 'Integration Synchronization Jobs';
RunObject = page "Integration Synch. Job List";
+ Tooltip = 'Open the Integration Synchronization Jobs page.';
}
action("Integration Synchronization Errors")
{
ApplicationArea = Suite;
Caption = 'Integration Synchronization Errors';
RunObject = page "Integration Synch. Error List";
+ Tooltip = 'Open the Integration Synchronization Errors page.';
}
action("Online Payments")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Services';
RunObject = page "Payment Services";
+ Tooltip = 'Open the Payment Services page.';
}
action("VAT Registration Service (VIES) Setting")
{
ApplicationArea = Basic, Suite;
Caption = 'VAT Registration Service (VIES) Setting';
RunObject = page "VAT Registration Config";
+ Tooltip = 'Open the VAT Registration Service (VIES) Setting page.';
}
action("API Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'API Setup';
RunObject = page "API Setup";
+ Tooltip = 'Open the API Setup page.';
}
action("Account Schedule KPI Web Servi")
{
ApplicationArea = Basic, Suite;
Caption = 'Account Schedule KPI Web Service Setup';
RunObject = page "Acc. Sched. KPI Web Srv. Setup";
+ Tooltip = 'Open the Account Schedule KPI Web Service Setup page.';
}
action("Acc. Sched. KPI Web Service")
{
ApplicationArea = Basic, Suite;
Caption = 'Account Schedule KPI Web Service';
RunObject = page "Acc. Sched. KPI Web Service";
+ Tooltip = 'Open the Account Schedule KPI Web Service page.';
}
#if not CLEAN28
action("UK Postcode Address Autocomplete")
@@ -991,48 +1089,56 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Configuration Questionnaire';
RunObject = page "Config. Questionnaire";
+ Tooltip = 'Open the Configuration Questionnaire page.';
}
action("Data Migration1")
{
ApplicationArea = Suite;
Caption = 'Configuration Packages';
RunObject = page "Config. Packages";
+ Tooltip = 'Open the Configuration Packages page.';
}
action("Setup Master Templates")
{
ApplicationArea = Basic, Suite;
Caption = 'Configuration Templates';
RunObject = page "Config. Template List";
+ Tooltip = 'Open the Configuration Templates page.';
}
action("Create G/L acc. Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create G/L Acc. Journal Lines';
RunObject = report "Create G/L Acc. Journal Lines";
+ Tooltip = 'Run the Create G/L Acc. Journal Lines report.';
}
action("Create Customer Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Customer Journal Lines';
RunObject = report "Create Customer Journal Lines";
+ Tooltip = 'Run the Create Customer Journal Lines report.';
}
action("Create Vendor Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Vendor Journal Lines';
RunObject = report "Create Vendor Journal Lines";
+ Tooltip = 'Run the Create Vendor Journal Lines report.';
}
action("Create Item Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Item Journal Lines';
RunObject = report "Create Item Journal Lines";
+ Tooltip = 'Run the Create Item Journal Lines report.';
}
action("Configuration Worksheet")
{
ApplicationArea = Suite;
Caption = 'Configuration Worksheet';
RunObject = page "Config. Worksheet";
+ Tooltip = 'Open the Configuration Worksheet page.';
}
}
}
diff --git a/src/Layers/GB/BaseApp/Sales/Document/SalesHeader.Table.al b/src/Layers/GB/BaseApp/Sales/Document/SalesHeader.Table.al
index 326436a8fa..b23e344ce6 100644
--- a/src/Layers/GB/BaseApp/Sales/Document/SalesHeader.Table.al
+++ b/src/Layers/GB/BaseApp/Sales/Document/SalesHeader.Table.al
@@ -328,6 +328,7 @@ table 36 "Sales Header"
Validate("Payment Terms Code");
Validate("Prepmt. Payment Terms Code");
Validate("Payment Method Code");
+ OnAfterValidateBillToCustomerPaymentFields(Rec);
Validate("Prepayment %");
if (xRec."Sell-to Customer No." = "Sell-to Customer No.") and
@@ -10356,6 +10357,11 @@ table 36 "Sales Header"
begin
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnAfterValidateBillToCustomerPaymentFields(var SalesHeader: Record "Sales Header")
+ begin
+ end;
+
///
/// Raised after extended text is transferred for sales line recreation.
///
diff --git a/src/Layers/IS/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al b/src/Layers/IS/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
index 13d8f06891..75e927fdd4 100644
--- a/src/Layers/IS/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
+++ b/src/Layers/IS/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
@@ -71,53 +71,53 @@ page 9001 "Accounting Manager Role Center"
{
area(rolecenter)
{
- part(Control1902304208; "Account Manager Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part(Control99; "Finance Performance")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control103; "Trailing Sales Orders Chart")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control106; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control100; "Cash Flow Forecast Chart")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1907692008; "My Customers")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1902476008; "My Vendors")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control108; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- systempart(Control1901377608; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
+ part(Control1902304208; "Account Manager Activities")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part("User Tasks Activities"; "User Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part(Control99; "Finance Performance")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control103; "Trailing Sales Orders Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control106; "My Job Queue")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control100; "Cash Flow Forecast Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1907692008; "My Customers")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1902476008; "My Vendors")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control108; "Report Inbox Part")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ systempart(Control1901377608; MyNotes)
+ {
+ ApplicationArea = Basic, Suite;
+ }
}
}
diff --git a/src/Layers/IS/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/IS/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index 808c8f1704..43387cef86 100644
--- a/src/Layers/IS/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/IS/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -96,7 +96,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
@@ -2568,7 +2567,7 @@ page 8901 "Finance Manager Role Center"
action("General Business")
{
ApplicationArea = Basic, Suite;
- Caption = 'Gen. Business Posting Groups';
+ Caption = 'General Business Posting Groups';
RunObject = page "Gen. Business Posting Groups";
Tooltip = 'Open the Gen. Business Posting Groups page.';
}
diff --git a/src/Layers/IT/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al b/src/Layers/IT/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
index 17ff0d247d..78ef2e1628 100644
--- a/src/Layers/IT/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
+++ b/src/Layers/IT/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
@@ -65,36 +65,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Salespeople")
{
ApplicationArea = Suite;
Caption = 'Salespeople/Purchasers';
RunObject = page "Salespersons/Purchasers";
+ Tooltip = 'Open the Salespeople/Purchasers page.';
}
action("Teams")
{
ApplicationArea = Basic, Suite;
Caption = 'Teams';
RunObject = page "Teams";
+ Tooltip = 'Open the Teams page.';
}
action("Tasks")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Opportunities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
group("Group1")
{
@@ -104,36 +110,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesBudget;
Caption = 'Sales Budgets';
RunObject = page "Budget Names Sales";
+ Tooltip = 'Open the Sales Budgets page.';
}
action("Sales Analysis Reports")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Reports';
RunObject = page "Analysis Report Sale";
+ Tooltip = 'Open the Sales Analysis Reports page.';
}
action("Sales Analysis by Dimensions")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Item Dimensions - Detail")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Detail';
RunObject = report "Item Dimensions - Detail";
+ Tooltip = 'Run the Item Dimensions - Detail report.';
}
action("Item Dimensions - Total")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Total';
RunObject = report "Item Dimensions - Total";
+ Tooltip = 'Run the Item Dimensions - Total report.';
}
action("Opportunities Matrix")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Analysis';
RunObject = page "Opportunities";
+ Tooltip = 'Open the Opportunity Analysis page.';
}
}
group("Group2")
@@ -144,6 +156,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Deferral Summary';
RunObject = report "Deferral Summary - Sales";
+ Tooltip = 'Run the Sales Deferral Summary report.';
}
group("Group3")
{
@@ -153,18 +166,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Tasks';
RunObject = report "Salesperson - Tasks";
+ Tooltip = 'Run the Salesperson Tasks report.';
}
action("Salesperson - Commission")
{
ApplicationArea = Suite;
Caption = 'Salesperson Commission';
RunObject = report "Salesperson - Commission";
+ Tooltip = 'Run the Salesperson Commission report.';
}
action("Salesperson - Opportunities")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Opportunities';
RunObject = report "Salesperson - Opportunities";
+ Tooltip = 'Run the Salesperson Opportunities report.';
}
#if not CLEAN28
action("Sales Statistics")
@@ -175,6 +191,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
#endif
action("Team - Tasks")
@@ -182,12 +199,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Team Tasks';
RunObject = report "Team - Tasks";
+ Tooltip = 'Run the Team Tasks report.';
}
action("Salesperson - Sales Statistics")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Sales Statistics';
RunObject = report "Salesperson - Sales Statistics";
+ Tooltip = 'Run the Salesperson Sales Statistics report.';
}
}
group("Group4")
@@ -198,36 +217,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Contact Labels';
RunObject = report "Contact - Labels";
+ Tooltip = 'Run the Contact Labels report.';
}
action("Contact - Company Summary")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact - Company Summary';
RunObject = report "Contact - Company Summary";
+ Tooltip = 'Run the Contact - Company Summary report.';
}
action("Questionnaire - Handouts")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire - Handouts';
RunObject = report "Questionnaire - Handouts";
+ Tooltip = 'Run the Questionnaire - Handouts report.';
}
action("Contact - List")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact List';
RunObject = report "Contact - List";
+ Tooltip = 'Run the Contact List report.';
}
action("Orgl. Profile Summary")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Person Summary';
RunObject = report "Contact - Person Summary";
+ Tooltip = 'Run the Contact - Person Summary report.';
}
action("Contact - Cover Sheet")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Cover Sheet';
RunObject = report "Contact - Cover Sheet";
+ Tooltip = 'Run the Contact - Cover Sheet report.';
}
}
group("Group5")
@@ -242,6 +267,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - List report.';
}
#endif
action("Customer - Labels")
@@ -249,36 +275,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Customer Labels';
RunObject = report "Customer - Labels";
+ Tooltip = 'Run the Customer Labels report.';
}
action("Customer - Balance to Date")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Balance to Date';
RunObject = report "Customer - Balance to Date";
+ Tooltip = 'Run the Customer - Balance to Date report.';
}
action("Customer - Order Summary")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Summary';
RunObject = report "Customer - Order Summary";
+ Tooltip = 'Run the Customer - Order Summary report.';
}
action("Customer/Item Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Item Sales';
RunObject = report "Customer/Item Sales";
+ Tooltip = 'Run the Customer/Item Sales report.';
}
action("Customer Register")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Register';
RunObject = report "Customer Register";
+ Tooltip = 'Run the Customer Register report.';
}
action("Customer - Order Detail")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Detail';
RunObject = report "Customer - Order Detail";
+ Tooltip = 'Run the Customer - Order Detail report.';
}
#if not CLEAN28
action("Customer - Top 10 List")
@@ -289,6 +321,7 @@ page 8907 "Sales & Marketing Manager RC"
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';
+ Tooltip = 'Run the Customer Top 10 List report.';
}
#endif
action("Customer - Trial Balance")
@@ -296,6 +329,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Trial Balance';
RunObject = report "Customer - Trial Balance";
+ Tooltip = 'Run the Customer Trial Balance report.';
}
#if not CLEAN28
action("Customer - Sales List")
@@ -306,6 +340,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
}
@@ -317,18 +352,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - List';
RunObject = report "Opportunity - List";
+ Tooltip = 'Run the Opportunity - List report.';
}
action("Opportunity - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - Details';
RunObject = report "Opportunity - Details";
+ Tooltip = 'Run the Opportunity - Details report.';
}
action("Sales Cycle - Analysis")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycle - Analysis';
RunObject = report "Sales Cycle - Analysis";
+ Tooltip = 'Run the Sales Cycle - Analysis report.';
}
}
}
@@ -341,60 +379,70 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts1")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Quotes")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quotes';
RunObject = page "Sales Quotes";
+ Tooltip = 'Open the Sales Quotes page.';
}
action("Orders")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Orders';
RunObject = page "Sales Order List";
+ Tooltip = 'Open the Sales Orders page.';
}
action("Blanket Orders")
{
ApplicationArea = Suite;
Caption = 'Blanket Sales Orders';
RunObject = page "Blanket Sales Orders";
+ Tooltip = 'Open the Blanket Sales Orders page.';
}
action("Return Orders")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Sales Return Orders';
RunObject = page "Sales Return Order List";
+ Tooltip = 'Open the Sales Return Orders page.';
}
action("Invoices")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Invoices';
RunObject = page "Sales Invoice List";
+ Tooltip = 'Open the Sales Invoices page.';
}
action("Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Credit Memos';
RunObject = page "Sales Credit Memos";
+ Tooltip = 'Open the Sales Credit Memos page.';
}
action("Certificates of Supply")
{
ApplicationArea = Basic, Suite;
Caption = 'Certificates of Supply';
RunObject = page "Certificates of Supply";
+ Tooltip = 'Open the Certificates of Supply page.';
}
action("Order Planning")
{
ApplicationArea = Planning;
Caption = 'Order Planning';
RunObject = page "Order Planning";
+ Tooltip = 'Open the Order Planning page.';
}
group("Group8")
{
@@ -404,24 +452,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Invoices';
RunObject = page "Posted Sales Invoices";
+ Tooltip = 'Open the Posted Sales Invoices page.';
}
action("Posted Sales Shipments")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Shipments';
RunObject = page "Posted Sales Shipments";
+ Tooltip = 'Open the Posted Sales Shipments page.';
}
action("Posted Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Credit Memos';
RunObject = page "Posted Sales Credit Memos";
+ Tooltip = 'Open the Posted Sales Credit Memos page.';
}
action("Posted Return Receipts")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Posted Return Receipts';
RunObject = page "Posted Return Receipts";
+ Tooltip = 'Open the Posted Return Receipts page.';
}
}
group("Group9")
@@ -432,48 +484,56 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'G/L Registers';
RunObject = page "G/L Registers";
+ Tooltip = 'Open the G/L Registers page.';
}
action("Item Tracing")
{
ApplicationArea = ItemTracking;
Caption = 'Item Tracing';
RunObject = page "Item Tracing";
+ Tooltip = 'Open the Item Tracing page.';
}
action("Sales Quote Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quote Archives';
RunObject = page "Sales Quote Archives";
+ Tooltip = 'Open the Sales Quote Archives page.';
}
action("Sales Order Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Order Archives';
RunObject = page "Sales Order Archives";
+ Tooltip = 'Open the Sales Order Archives page.';
}
action("Sales Return Order Archives")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Return Order Archives';
RunObject = page "Sales Return List Archive";
+ Tooltip = 'Open the Sales Return Order Archives page.';
}
action("Customer Ledger Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Ledger Entries';
RunObject = page "Customer Ledger Entries";
+ Tooltip = 'Open the Customer Ledger Entries page.';
}
action("Detailed Cust. Ledg. Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Detailed Customer Ledger Entries';
RunObject = page "Detailed Cust. Ledg. Entries";
+ Tooltip = 'Open the Detailed Customer Ledger Entries page.';
}
action("Value Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Value Entries';
RunObject = page "Value Entries";
+ Tooltip = 'Open the Value Entries page.';
}
action("Navigate")
{
@@ -493,6 +553,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Detail';
RunObject = report "Customer - Order Detail";
+ Tooltip = 'Run the Customer - Order Detail report.';
}
#if not CLEAN28
action("Sales Reservation Avail.")
@@ -503,6 +564,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Reservation Avail. report.';
}
#endif
#if not CLEAN28
@@ -514,6 +576,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
#endif
#if not CLEAN28
@@ -525,6 +588,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
action("EC Sales List")
@@ -532,18 +596,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'EC Sales List';
RunObject = report "EC Sales List";
+ Tooltip = 'Run the EC Sales List report.';
}
action("Customer/Item Sales1")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Item Sales';
RunObject = report "Customer/Item Sales";
+ Tooltip = 'Run the Customer/Item Sales report.';
}
action("Customer - Order Summary1")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Summary';
RunObject = report "Customer - Order Summary";
+ Tooltip = 'Run the Customer - Order Summary report.';
}
}
}
@@ -555,42 +622,49 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Campaigns")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaigns';
RunObject = page "Campaign List";
+ Tooltip = 'Open the Campaigns page.';
}
action("Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Segments';
RunObject = page "Segment List";
+ Tooltip = 'Open the Segments page.';
}
action("Logged Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Logged Segments';
RunObject = page "Logged Segments";
+ Tooltip = 'Open the Logged Segments page.';
}
action("Opportunities1")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
action("Tasks1")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Campaign - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign - Details';
RunObject = report "Campaign - Details";
+ Tooltip = 'Run the Campaign - Details report.';
}
group("Group12")
{
@@ -600,18 +674,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Entries';
RunObject = page "Campaign Entries";
+ Tooltip = 'Open the Campaign Entries page.';
}
action("Opportunity Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Entries';
RunObject = page "Opportunity Entries";
+ Tooltip = 'Open the Opportunity Entries page.';
}
action("Interaction Log Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Log Entries';
RunObject = page "Interaction Log Entries";
+ Tooltip = 'Open the Interaction Log Entries page.';
}
}
}
@@ -623,18 +700,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Items';
RunObject = page "Item List";
+ Tooltip = 'Open the Items page.';
}
action("Nonstock Items")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Items';
RunObject = page "Catalog Item List";
+ Tooltip = 'Open the Nonstock Items page.';
}
action("Item Attributes")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Attributes';
RunObject = page "Item Attributes";
+ Tooltip = 'Open the Item Attributes page.';
}
action("Sales Price Worksheet")
{
@@ -648,6 +728,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Adjust Item Costs/Prices';
RunObject = report "Adjust Item Costs/Prices";
+ Tooltip = 'Run the Adjust Item Costs/Prices report.';
}
group("Group14")
{
@@ -657,42 +738,49 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Inventory Sales Statistics';
RunObject = report "Inventory - Sales Statistics";
+ Tooltip = 'Run the Inventory Sales Statistics report.';
}
action("Inventory Cost and Price List")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Cost and Price List';
RunObject = report "Inventory Cost and Price List";
+ Tooltip = 'Run the Inventory Cost and Price List report.';
}
action("Item Charges - Specification")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Charges - Specification';
RunObject = report "Item Charges - Specification";
+ Tooltip = 'Run the Item Charges - Specification report.';
}
action("Inventory - Customer Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Customer Sales';
RunObject = report "Inventory - Customer Sales";
+ Tooltip = 'Run the Inventory Customer Sales report.';
}
action("Nonstock Item Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Sales';
RunObject = report "Catalog Item Sales";
+ Tooltip = 'Run the Nonstock Item Sales report.';
}
action("Inventory Availability")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Availability';
RunObject = report "Inventory Availability";
+ Tooltip = 'Run the Inventory Availability report.';
}
action("Inventory Order Details")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Order Details';
RunObject = report "Inventory Order Details";
+ Tooltip = 'Run the Inventory Order Details report.';
}
action("Price List")
{
@@ -706,18 +794,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Inventory - Sales Back Orders';
RunObject = report "Inventory - Sales Back Orders";
+ Tooltip = 'Run the Inventory - Sales Back Orders report.';
}
action("Inventory - Top 10 List")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Top 10 List';
RunObject = report "Inventory - Top 10 List";
+ Tooltip = 'Run the Inventory Top 10 List report.';
}
action("Item Substitutions")
{
ApplicationArea = Suite;
Caption = 'Item Substitutions';
RunObject = report "Item Substitutions";
+ Tooltip = 'Run the Item Substitutions report.';
}
}
}
@@ -729,54 +820,63 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Orders - Dynamics 365 Sales';
RunObject = page "CRM Sales Order List";
+ Tooltip = 'Open the Sales Orders - Dynamics 365 Sales page.';
}
action("Quotes - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Quotes - Dynamics 365 Sales';
RunObject = page "CRM Sales Quote List";
+ Tooltip = 'Open the Quotes - Dynamics 365 Sales page.';
}
action("Cases - Dynamics 365 for Customer Service")
{
ApplicationArea = Suite;
Caption = 'Cases - Dynamics 365 for Customer Service';
RunObject = page "CRM Case List";
+ Tooltip = 'Open the Cases - Dynamics 365 for Customer Service page.';
}
action("Opportunities - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Opportunities - Dynamics 365 Sales';
RunObject = page "CRM Opportunity List";
+ Tooltip = 'Open the Opportunities - Dynamics 365 Sales page.';
}
action("Accounts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Accounts - Dynamics 365 Sales';
RunObject = page "CRM Account List";
+ Tooltip = 'Open the Accounts - Dynamics 365 Sales page.';
}
action("Transaction Currencies - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Transaction Currencies - Dynamics 365 Sales';
RunObject = page "CRM TransactionCurrency List";
+ Tooltip = 'Open the Transaction Currencies - Dynamics 365 Sales page.';
}
action("Unit Groups - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Unit Groups - Dynamics 365 Sales';
RunObject = page "CRM UnitGroup List";
+ Tooltip = 'Open the Unit Groups - Dynamics 365 Sales page.';
}
action("Products - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Products - Dynamics 365 Sales';
RunObject = page "CRM Product List";
+ Tooltip = 'Open the Products - Dynamics 365 Sales page.';
}
action("Contacts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Contacts - Dynamics 365 Sales';
RunObject = page "CRM Contact List";
+ Tooltip = 'Open the Contacts - Dynamics 365 Sales page.';
}
action("Records Skipped For Synchronization")
{
@@ -784,6 +884,7 @@ page 8907 "Sales & Marketing Manager RC"
Caption = 'Coupled Data Synchronization Errors';
RunObject = page "CRM Skipped Records";
AccessByPermission = TableData "CRM Integration Record" = R;
+ Tooltip = 'Open the Coupled Data Synchronization Errors page.';
}
}
group("Group16")
@@ -794,66 +895,77 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = OrderPromising;
Caption = 'Order Promising Setup';
RunObject = page "Order Promising Setup";
+ Tooltip = 'Open the Order Promising Setup page.';
}
action("Sales & Receivables Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales & Receivables Setup';
RunObject = page "Sales & Receivables Setup";
+ Tooltip = 'Open the Sales & Receivables Setup page.';
}
action("Fattura Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Fattura Setup';
RunObject = page "Fattura Setup";
+ Tooltip = 'Open the Fattura Setup page.';
}
action("report Selection Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Sales';
RunObject = page "Report Selection - Sales";
+ Tooltip = 'Open the Report Selections Sales page.';
}
action("Standard Sales Codes")
{
ApplicationArea = Suite;
Caption = 'Standard Sales Codes';
RunObject = page "Standard Sales Codes";
+ Tooltip = 'Open the Standard Sales Codes page.';
}
action("Payment Terms")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Terms';
RunObject = page "Payment Terms";
+ Tooltip = 'Open the Payment Terms page.';
}
action("Payment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Methods';
RunObject = page "Payment Methods";
+ Tooltip = 'Open the Payment Methods page.';
}
action("Item Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Shipment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Shipment Methods';
RunObject = page "Shipment Methods";
+ Tooltip = 'Open the Shipment Methods page.';
}
action("Shipping Agents")
{
ApplicationArea = Suite;
Caption = 'Shipping Agents';
RunObject = page "Shipping Agents";
+ Tooltip = 'Open the Shipping Agents page.';
}
action("Return Reasons")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Return Reasons';
RunObject = page "Return Reasons";
+ Tooltip = 'Open the Return Reasons page.';
}
action("Customer Templates")
{
@@ -870,24 +982,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesAnalysis, PurchaseAnalysis, InventoryAnalysis;
Caption = 'Analysis Types';
RunObject = page "Analysis Types";
+ Tooltip = 'Open the Analysis Types page.';
}
action("Sales Analysis by Dimensions1")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Analysis Column Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Column Templates';
RunObject = report "Run Sales Analysis Col. Temp.";
+ Tooltip = 'Run the Sales Analysis Column Templates report.';
}
action("Analysis Line Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Line Templates';
RunObject = report "Run Sales Analysis Line Templ.";
+ Tooltip = 'Run the Sales Analysis Line Templates report.';
}
}
group("Group18")
@@ -898,12 +1014,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Price Groups';
RunObject = page "Customer Price Groups";
+ Tooltip = 'Open the Customer Price Groups page.';
}
action("Customer Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Discount Groups';
RunObject = page "Customer Disc. Groups";
+ Tooltip = 'Open the Customer Discount Groups page.';
}
}
group("Group19")
@@ -914,24 +1032,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Setup';
RunObject = page "Catalog Item Setup";
+ Tooltip = 'Open the Nonstock Item Setup page.';
}
action("Item Charges")
{
ApplicationArea = ItemCharges;
Caption = 'Item Charges';
RunObject = page "Item Charges";
+ Tooltip = 'Open the Item Charges page.';
}
action("Item Disc. Groups1")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Inventory Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Setup';
RunObject = page "Inventory Setup";
+ Tooltip = 'Open the Inventory Setup page.';
}
}
group("Group20")
@@ -942,99 +1064,116 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite, RelationshipMgmt;
Caption = 'Marketing Setup';
RunObject = page "Marketing Setup";
+ Tooltip = 'Open the Marketing Setup page.';
}
action("Interaction Template Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Template Setup';
RunObject = page "Interaction Template Setup";
+ Tooltip = 'Open the Interaction Template Setup page.';
}
action("Business Relations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Business Relations';
RunObject = page "Business Relations";
+ Tooltip = 'Open the Business Relations page.';
}
action("Industry Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Industry Groups';
RunObject = page "Industry Groups";
+ Tooltip = 'Open the Industry Groups page.';
}
action("Web Sources")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Web Sources';
RunObject = page "Web Sources";
+ Tooltip = 'Open the Web Sources page.';
}
action("Job Responsibilities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Job Responsibilities';
RunObject = page "Job Responsibilities";
+ Tooltip = 'Open the Job Responsibilities page.';
}
action("Organizational Levels")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Organizational Levels';
RunObject = page "Organizational Levels";
+ Tooltip = 'Open the Organizational Levels page.';
}
action("Interaction Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Groups';
RunObject = page "Interaction Groups";
+ Tooltip = 'Open the Interaction Groups page.';
}
action("Interaction Templates")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Templates';
RunObject = page "Interaction Templates";
+ Tooltip = 'Open the Interaction Templates page.';
}
action("Salutations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Salutations';
RunObject = page "Salutations";
+ Tooltip = 'Open the Salutations page.';
}
action("Mailing Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Mailing Groups';
RunObject = page "Mailing Groups";
+ Tooltip = 'Open the Mailing Groups page.';
}
action("Status")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Status';
RunObject = page "Campaign Status";
+ Tooltip = 'Open the Campaign Status page.';
}
action("Sales Cycles")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycles';
RunObject = page "Sales Cycles";
+ Tooltip = 'Open the Sales Cycles page.';
}
action("Close Opportunity Codes")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Close Opportunity Codes';
RunObject = page "Close Opportunity Codes";
+ Tooltip = 'Open the Close Opportunity Codes page.';
}
action("Questionnaire Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire Setup';
RunObject = page "Profile Questionnaires";
+ Tooltip = 'Open the Questionnaire Setup page.';
}
action("Activities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Activities';
RunObject = page "Activity List";
+ Tooltip = 'Open the Activities page.';
}
}
}
}
}
+
}
diff --git a/src/Layers/IT/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al b/src/Layers/IT/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
index f212efec09..b73e807b5d 100644
--- a/src/Layers/IT/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
+++ b/src/Layers/IT/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
@@ -73,53 +73,53 @@ page 9001 "Accounting Manager Role Center"
{
area(rolecenter)
{
- part(Control1902304208; "Account Manager Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part(Control99; "Finance Performance")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control103; "Trailing Sales Orders Chart")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control106; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control100; "Cash Flow Forecast Chart")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1907692008; "My Customers")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1902476008; "My Vendors")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control108; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- systempart(Control1901377608; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
+ part(Control1902304208; "Account Manager Activities")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part("User Tasks Activities"; "User Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part(Control99; "Finance Performance")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control103; "Trailing Sales Orders Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control106; "My Job Queue")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control100; "Cash Flow Forecast Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1907692008; "My Customers")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1902476008; "My Vendors")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control108; "Report Inbox Part")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ systempart(Control1901377608; MyNotes)
+ {
+ ApplicationArea = Basic, Suite;
+ }
}
}
diff --git a/src/Layers/IT/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/IT/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index 7f939113b4..edb7777306 100644
--- a/src/Layers/IT/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/IT/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -97,7 +97,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
@@ -249,6 +248,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Day Book Vendor Ledger Entry';
RunObject = report "Day Book Vendor Ledger Entry";
+ Tooltip = 'Run the Day Book Vendor Ledger Entry report.';
}
action("VAT Fiscal Register - Print")
{
@@ -1838,6 +1838,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Purchases & Payables Setup';
RunObject = page "Purchases & Payables Setup";
+ Tooltip = 'Open the Purchases & Payables Setup page.';
}
action("Withhold Tax Code")
{
@@ -2641,6 +2642,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Tariff Numbers';
RunObject = page "Tariff Numbers";
+ Tooltip = 'Open the Tariff Numbers page.';
}
action("Service Tariff Numbers")
{
diff --git a/src/Layers/IT/BaseApp/HumanResources/Employee/Employee.Table.al b/src/Layers/IT/BaseApp/HumanResources/Employee/Employee.Table.al
index 9ec8fc8b03..40416046c5 100644
--- a/src/Layers/IT/BaseApp/HumanResources/Employee/Employee.Table.al
+++ b/src/Layers/IT/BaseApp/HumanResources/Employee/Employee.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -828,6 +828,7 @@ table 5200 Employee
if "Middle Name" = '' then
exit("First Name" + ' ' + "Last Name");
+
exit("First Name" + ' ' + "Middle Name" + ' ' + "Last Name");
end;
diff --git a/src/Layers/IT/BaseApp/Purchases/Document/PurchaseQuote.Page.al b/src/Layers/IT/BaseApp/Purchases/Document/PurchaseQuote.Page.al
index 2ef0560d30..2072b11a53 100644
--- a/src/Layers/IT/BaseApp/Purchases/Document/PurchaseQuote.Page.al
+++ b/src/Layers/IT/BaseApp/Purchases/Document/PurchaseQuote.Page.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -1629,6 +1629,13 @@ page 49 "Purchase Quote"
OnAfterActivateFields();
end;
+ local procedure SetPurchaseLinesAvailability()
+ begin
+ IsPurchaseLinesEditable := Rec.PurchaseLinesEditable();
+
+ OnAfterSetPurchaseLinesAvailability(Rec, IsPurchaseLinesEditable);
+ end;
+
local procedure SetIsActivityCodeMandatory()
var
GeneralLedgerSetup: Record "General Ledger Setup";
@@ -1691,7 +1698,7 @@ page 49 "Purchase Quote"
WorkflowWebhookManagement.GetCanRequestAndCanCancel(Rec.RecordId, CanRequestApprovalForFlow, CanCancelApprovalForFlow);
HasIncomingDocument := Rec."Incoming Document Entry No." <> 0;
- IsPurchaseLinesEditable := Rec.PurchaseLinesEditable();
+ SetPurchaseLinesAvailability();
end;
local procedure ValidateShippingOption()
@@ -1746,6 +1753,11 @@ page 49 "Purchase Quote"
begin
end;
+ [IntegrationEvent(true, false)]
+ local procedure OnAfterSetPurchaseLinesAvailability(var PurchaseHeader: Record "Purchase Header"; var PurchaseLinesAvailable: Boolean)
+ begin
+ end;
+
[IntegrationEvent(false, false)]
local procedure OnBeforeValidateShipToOptions(var PurchaseHeader: Record "Purchase Header"; ShipToOptions: Option)
begin
diff --git a/src/Layers/IT/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al b/src/Layers/IT/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
index 7ed95851f6..ee5c81811c 100644
--- a/src/Layers/IT/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
+++ b/src/Layers/IT/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
@@ -77,6 +77,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'System Information';
RunObject = page "Latest Error";
+ Tooltip = 'Open the System Information page.';
}
action("Table Information")
{
@@ -90,30 +91,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Extension Management';
RunObject = page "Extension Management";
+ Tooltip = 'Open the Extension Management page.';
}
action("Profiles")
{
ApplicationArea = Basic, Suite;
Caption = 'Profiles (Roles)';
RunObject = page "Profile List";
+ Tooltip = 'Open the Profiles (Roles) page.';
}
action("Devices")
{
ApplicationArea = Basic, Suite;
Caption = 'Devices';
RunObject = page "Devices";
+ Tooltip = 'Open the Devices page.';
}
action("Control Add-ins")
{
ApplicationArea = All;
Caption = 'Control Add-ins';
RunObject = page "Control Add-ins";
+ Tooltip = 'Open the Control Add-ins page.';
}
action("Get the Mobile Device App (Tablet and Phone activatation code)")
{
ApplicationArea = All;
Caption = 'Mobile device activation and app';
RunObject = page "O365 Device Setup";
+ Tooltip = 'Open the Mobile device activation and app page.';
}
action("Printer Management")
{
@@ -131,60 +137,70 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Online Map Setup';
RunObject = page "Online Map Setup";
+ Tooltip = 'Open the Online Map Setup page.';
}
action("Bank Export/Import Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Bank Export/Import Setup';
RunObject = page "Bank Export/Import Setup";
+ Tooltip = 'Open the Bank Export/Import Setup page.';
}
action("Cue Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Cue Setup';
RunObject = page "Cue Setup Administrator";
+ Tooltip = 'Open the Cue Setup page.';
}
action("Document Sending Profiles")
{
ApplicationArea = Basic, Suite;
Caption = 'Document Sending Profiles';
RunObject = page "Document Sending Profiles";
+ Tooltip = 'Open the Document Sending Profiles page.';
}
action("Printer Selections")
{
ApplicationArea = Suite;
Caption = 'Printer Selections';
RunObject = page "Printer Selections";
+ Tooltip = 'Open the Printer Selections page.';
}
action("Electronic Document Formats")
{
ApplicationArea = Suite;
Caption = 'Electronic Document Formats';
RunObject = page "Electronic Document Format";
+ Tooltip = 'Open the Electronic Document Formats page.';
}
action("Assisted Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Assisted Setup';
RunObject = page "Assisted Setup";
+ Tooltip = 'Open the Assisted Setup page.';
}
action("Application Area")
{
ApplicationArea = All;
Caption = 'Application Area';
RunObject = page "Application Area";
+ Tooltip = 'Open the Application Area page.';
}
action("Set Up Customer/Vendor/Item Templates")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Vendor/Item Templates';
RunObject = page "Config Templates";
+ Tooltip = 'Open the Customer/Vendor/Item Templates page.';
}
action("Transformation Rules")
{
ApplicationArea = Basic, Suite;
Caption = 'Transformation Rules';
RunObject = page "Transformation Rules";
+ Tooltip = 'Open the Transformation Rules page.';
}
action("Business Setup")
{
@@ -198,6 +214,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Image Analysis Setup';
RunObject = page "Image Analysis Setup";
+ Tooltip = 'Open the Image Analysis Setup page.';
}
}
group("Group4")
@@ -208,18 +225,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Entries';
RunObject = page "Job Queue Entries";
+ Tooltip = 'Open the Job Queue Entries page.';
}
action("Job Queue Log Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Log Entries';
RunObject = page "Job Queue Log Entries";
+ Tooltip = 'Open the Job Queue Log Entries page.';
}
action("Job Queue Category List")
{
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Category List';
RunObject = page "Job Queue Category List";
+ Tooltip = 'Open the Job Queue Category List page.';
}
action("Scheduled Tasks")
{
@@ -237,12 +257,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Change Log Setup';
RunObject = page "Change Log Setup";
+ Tooltip = 'Open the Change Log Setup page.';
}
action("Change Log")
{
ApplicationArea = Basic, Suite;
Caption = 'Change Log Entries';
RunObject = page "Change Log Entries";
+ Tooltip = 'Open the Change Log Entries page.';
}
}
group("Group6")
@@ -253,12 +275,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Layout Selection';
RunObject = page "Report Layout Selection";
+ Tooltip = 'Open the Report Layout Selection page.';
}
action("Report Configuration")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Settings';
RunObject = page "Report Settings";
+ Tooltip = 'Open the Report Settings page.';
AccessByPermission = TableData "Object Options" = IMD;
}
action("Report Inbox")
@@ -266,6 +290,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Inbox';
RunObject = page "Report Inbox";
+ Tooltip = 'Open the Report Inbox page.';
}
#if not CLEAN28
action("Custom Report Layouts")
@@ -278,6 +303,7 @@ page 8900 "Administrator Main Role Center"
#pragma warning disable AL0432
RunObject = page "Custom Report Layouts";
#pragma warning restore AL0432
+ Tooltip = 'Open the Custom Report Layouts page.';
}
#endif
action("Report Selection Purchase")
@@ -285,30 +311,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Purchase';
RunObject = page "Report Selection - Purchase";
+ Tooltip = 'Open the Report Selections Purchase page.';
}
action("Report Selection Reminder and")
{
ApplicationArea = Suite;
Caption = 'Report Selections Reminder/Fin. Charge';
RunObject = page "Report Selection - Reminder";
+ Tooltip = 'Open the Report Selections Reminder/Fin. Charge page.';
}
action("Report Selection Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Sales';
RunObject = page "Report Selection - Sales";
+ Tooltip = 'Open the Report Selections Sales page.';
}
action("Report Selection - Bank Acc.")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Bank Account';
RunObject = page "Report Selection - Bank Acc.";
+ Tooltip = 'Open the Report Selections Bank Account page.';
}
action("Report Selections Inventory")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Inventory';
RunObject = page "Report Selection - Inventory";
+ Tooltip = 'Open the Report Selections Inventory page.';
}
}
group("Group7")
@@ -319,12 +350,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Test Tool';
RunObject = page "CAL Test Tool";
+ Tooltip = 'Open the Test Tool page.';
}
action("Code Coverage")
{
ApplicationArea = All;
Caption = 'Code Coverage';
RunObject = page "Code Coverage";
+ Tooltip = 'Open the Code Coverage page.';
}
// action("Sessions")
// {
@@ -352,54 +385,63 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Company Information';
RunObject = page "Company Information";
+ Tooltip = 'Open the Company Information page.';
}
action("Companies")
{
ApplicationArea = Basic, Suite;
Caption = 'Companies';
RunObject = page "Companies";
+ Tooltip = 'Open the Companies page.';
}
action("No. Series")
{
ApplicationArea = Basic, Suite;
Caption = 'No. Series';
RunObject = page "No. Series";
+ Tooltip = 'Open the No. Series page.';
}
action("Post Codes")
{
ApplicationArea = Basic, Suite;
Caption = 'Post Codes';
RunObject = page "Post Codes";
+ Tooltip = 'Open the Post Codes page.';
}
action("Territories")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Territories';
RunObject = page "Territories";
+ Tooltip = 'Open the Territories page.';
}
action("Languages")
{
ApplicationArea = Suite;
Caption = 'Languages';
RunObject = page "Languages";
+ Tooltip = 'Open the Languages page.';
}
action("Countries/Regions")
{
ApplicationArea = Basic, Suite;
Caption = 'Countries/Regions';
RunObject = page "Countries/Regions";
+ Tooltip = 'Open the Countries/Regions page.';
}
action("Base Calendar Entries Subform")
{
ApplicationArea = Basic, Suite;
Caption = 'Base Calendar';
RunObject = page "Base Calendar List";
+ Tooltip = 'Open the Base Calendar page.';
}
action("Responsibility Centers")
{
ApplicationArea = Basic, Suite;
Caption = 'Responsibility Centers';
RunObject = page "Responsibility Center List";
+ Tooltip = 'Open the Responsibility Centers page.';
}
}
group("Group10")
@@ -417,6 +459,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Data Classification Worksheet';
RunObject = page "Data Classification Worksheet";
+ Tooltip = 'Open the Data Classification Worksheet page.';
AccessByPermission = TableData "Data Sensitivity" = R;
}
action("Privacy for App Integrations")
@@ -431,12 +474,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'XML Schemas';
RunObject = page "XML Schemas";
+ Tooltip = 'Open the XML Schemas page.';
}
action("SEPA Schema Viewer")
{
ApplicationArea = Basic, Suite;
Caption = 'SEPA Schema Viewer';
RunObject = page "XML Schema Viewer";
+ Tooltip = 'Open the SEPA Schema Viewer page.';
}
}
group("Group11")
@@ -447,18 +492,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Data Migration Overview';
RunObject = page "Data Migration Overview";
+ Tooltip = 'Open the Data Migration Overview page.';
}
action("Data Migration")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Migration';
RunObject = page "Data Migration Wizard";
+ Tooltip = 'Open the Data Migration page.';
}
action("Data Migration Settings")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Migration Settings';
RunObject = page "Data Migration Settings";
+ Tooltip = 'Open the Data Migration Settings page.';
AccessByPermission = TableData "Data Migration Setup" = R;
}
}
@@ -470,24 +518,28 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Import from a Data File';
RunObject = page "Import Data";
+ Tooltip = 'Open the Import from a Data File page.';
}
action("Export to a Data File")
{
ApplicationArea = Basic, Suite;
Caption = 'Export to a Data File';
RunObject = page "Export Data";
+ Tooltip = 'Open the Export to a Data File page.';
}
action("Data Exchange Types")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Exchange Types';
RunObject = page "Data Exchange Types";
+ Tooltip = 'Open the Data Exchange Types page.';
}
action("Data Exchange Definition")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Exchange Definitions';
RunObject = page "Data Exch Def List";
+ Tooltip = 'Open the Data Exchange Definitions page.';
}
}
group("Group13")
@@ -501,18 +553,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Customers...';
RunObject = report "Create Conts. from Customers";
+ Tooltip = 'Run the Create Contacts from Customers report.';
}
action("Create Contacts from Vendors")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Vendors...';
RunObject = report "Create Conts. from Vendors";
+ Tooltip = 'Run the Create Contacts from Vendors report.';
}
action("Create Contacts from Bank Acco")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Bank Accounts...';
RunObject = report "Create Conts. from Bank Accs.";
+ Tooltip = 'Run the Create Contacts from Bank Accounts report.';
}
}
}
@@ -527,6 +582,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Date Compr. Registers';
RunObject = page "Date Compr. Registers";
+ Tooltip = 'Open the Date Compr. Registers page.';
}
}
group("Group17")
@@ -537,6 +593,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Delete Orphaned Record Links';
RunObject = codeunit "Remove Orphaned Record Links";
+ Tooltip = 'Run the Delete Orphaned Record Links codeunit.';
}
}
group("Group18")
@@ -547,12 +604,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Profile Customizations';
RunObject = page "Profile Customization List";
+ Tooltip = 'Open the Profile Customizations page.';
}
action("User Page Personalizations")
{
ApplicationArea = Basic, Suite;
Caption = 'User Page Personalizations';
RunObject = page "Personalized Pages";
+ Tooltip = 'Open the User Page Personalizations page.';
}
}
}
@@ -565,12 +624,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Users';
RunObject = page "Users";
+ Tooltip = 'Open the Users page.';
}
action("User Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'User Setup';
RunObject = page "User Setup";
+ Tooltip = 'Open the User Setup page.';
}
// action("Change Password")
// {
@@ -583,6 +644,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'User Security Status';
RunObject = page "User Security Status List";
+ Tooltip = 'Open the User Security Status page.';
AccessByPermission = TableData "User" = R;
}
action("User Tasks")
@@ -590,18 +652,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'User Tasks';
RunObject = page "User Task List";
+ Tooltip = 'Open the User Tasks page.';
}
action("User Personalization")
{
ApplicationArea = Basic, Suite;
Caption = 'User Settings';
RunObject = page "User Settings List";
+ Tooltip = 'Open the User Settings page.';
}
action("User Time Registers")
{
ApplicationArea = Basic, Suite;
Caption = 'Time Registers';
RunObject = page "User Time Registers";
+ Tooltip = 'Open the Time Registers page.';
}
}
group(Permissions)
@@ -643,30 +708,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflows';
RunObject = page "Workflows";
+ Tooltip = 'Open the Workflows page.';
}
action("Workflow User Group")
{
ApplicationArea = Suite;
Caption = 'Workflow User Groups';
RunObject = page "Workflow User Groups";
+ Tooltip = 'Open the Workflow User Groups page.';
}
action("Approval User Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Approval User Setup';
RunObject = page "Approval User Setup";
+ Tooltip = 'View or edit information about workflow users who are involved in approval processes, such as approval amount limits for specific types of requests and substitute approvers to whom approval requests are delegated when the original approver is absent.';
}
action("Incoming Documents Setup")
{
ApplicationArea = Suite;
Caption = 'Incoming Documents Setup';
RunObject = page "Incoming Documents Setup";
+ Tooltip = 'Open the Incoming Documents Setup page.';
}
action("Send Overdue Appr. Notif.")
{
ApplicationArea = Suite;
Caption = 'Send Overdue Approval Notifications';
RunObject = report "Send Overdue Appr. Notif.";
+ Tooltip = 'Run the Send Overdue Approval Notifications report.';
}
group("Group21")
{
@@ -676,12 +746,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflow Templates';
RunObject = page "Workflow Templates";
+ Tooltip = 'Open the Workflow Templates page.';
}
action("Workflow Categories")
{
ApplicationArea = Suite;
Caption = 'Workflow Categories';
RunObject = page "Workflow Categories";
+ Tooltip = 'Open the Workflow Categories page.';
}
}
group("Group22")
@@ -692,18 +764,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflow Event Hierarchies';
RunObject = page "Workflow Event Hierarchies";
+ Tooltip = 'Open the Workflow Event Hierarchies page.';
}
action("WF Event/Response Combinations")
{
ApplicationArea = Suite;
Caption = 'Workflow Event/Response Combinations';
RunObject = page "WF Event/Response Combinations";
+ Tooltip = 'Open the Workflow Event/Response Combinations page.';
}
action("Workflow - Table Relations")
{
ApplicationArea = Suite;
Caption = 'Workflow - Table Relations';
RunObject = page "Workflow - Table Relations";
+ Tooltip = 'Open the Workflow - Table Relations page.';
}
}
group("Group23")
@@ -714,18 +789,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Notification Setup';
RunObject = page "Notification Setup";
+ Tooltip = 'Open the Notification Setup page.';
}
action("Notification Entries")
{
ApplicationArea = Suite;
Caption = 'Notification Entries';
RunObject = page "Notification Entries";
+ Tooltip = 'Open the Notification Entries page.';
}
action("Sent Notification Entries")
{
ApplicationArea = Suite;
Caption = 'Sent Notification Entries';
RunObject = page "Sent Notification Entries";
+ Tooltip = 'Open the Sent Notification Entries page.';
}
}
group("Group24")
@@ -736,36 +814,42 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Approval Entries';
RunObject = page "Approval Entries";
+ Tooltip = 'Open the Approval Entries page.';
}
action("Posted Approval Entries")
{
ApplicationArea = Suite;
Caption = 'Posted Approval Entries';
RunObject = page "Posted Approval Entries";
+ Tooltip = 'Open the Posted Approval Entries page.';
}
action("Overdue Approval Entries")
{
ApplicationArea = Suite;
Caption = 'Overdue Approval Entries';
RunObject = page "Overdue Approval Entries";
+ Tooltip = 'Open the Overdue Approval Entries page.';
}
action("Restricted Records")
{
ApplicationArea = Suite;
Caption = 'Restricted Records';
RunObject = page "Restricted Records";
+ Tooltip = 'Open the Restricted Records page.';
}
action("Workflow Step Instances")
{
ApplicationArea = Suite;
Caption = 'Workflow Step Instances';
RunObject = page "Workflow Step Instances";
+ Tooltip = 'Open the Workflow Step Instances page.';
}
action("Archived Workflow Step Instances")
{
ApplicationArea = Suite;
Caption = 'Archived Workflow Step Instances';
RunObject = page "Archived WF Step Instances";
+ Tooltip = 'Open the Archived Workflow Step Instances page.';
}
}
group("Group26")
@@ -776,12 +860,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Dynamic Request Page Entities';
RunObject = page "Dynamic Request Page Entities";
+ Tooltip = 'Open the Dynamic Request Page Entities page.';
}
action("Dynamic Request page Fields")
{
ApplicationArea = Basic, Suite;
Caption = 'Dynamic Request Page Fields';
RunObject = page "Dynamic Request Page Fields";
+ Tooltip = 'Open the Dynamic Request Page Fields page.';
}
}
}
@@ -793,12 +879,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Web Services';
RunObject = page "Web Services";
+ Tooltip = 'Open the Web Services page.';
}
action("Microsoft Dynamics 365 Connection Setup")
{
ApplicationArea = Suite;
Caption = 'Microsoft Dynamics 365 Connection Setup';
RunObject = page "CRM Connection Setup";
+ Tooltip = 'Open the Microsoft Dynamics 365 Connection Setup page.';
AccessByPermission = TableData "CRM Connection Setup" = IM;
}
action("Email Account Setup")
@@ -814,54 +902,63 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'OCR Service Setup';
RunObject = page "OCR Service Setup";
+ Tooltip = 'Open the OCR Service Setup page.';
}
action("Currency Exchange Rate Services")
{
ApplicationArea = Suite;
Caption = 'Currency Exchange Rate Services';
RunObject = page "Curr. Exch. Rate Service List";
+ Tooltip = 'Open the Currency Exchange Rate Services page.';
}
action("Service Connections Overview")
{
ApplicationArea = Basic, Suite;
Caption = 'Service Connections';
RunObject = page "Service Connections";
+ Tooltip = 'Open the Service Connections page.';
}
action("Doc. Exch. Service Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Document Exchange Service Setup';
RunObject = page "Doc. Exch. Service Setup";
+ Tooltip = 'Open the Document Exchange Service Setup page.';
}
action("Integration Table Mappings")
{
ApplicationArea = Suite;
Caption = 'Integration Table Mappings';
RunObject = page "Integration Table Mapping List";
+ Tooltip = 'Open the Integration Table Mappings page.';
}
action("Integration Synchronization Jobs")
{
ApplicationArea = Suite;
Caption = 'Integration Synchronization Jobs';
RunObject = page "Integration Synch. Job List";
+ Tooltip = 'Open the Integration Synchronization Jobs page.';
}
action("Integration Synchronization Errors")
{
ApplicationArea = Suite;
Caption = 'Integration Synchronization Errors';
RunObject = page "Integration Synch. Error List";
+ Tooltip = 'Open the Integration Synchronization Errors page.';
}
action("Online Payments")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Services';
RunObject = page "Payment Services";
+ Tooltip = 'Open the Payment Services page.';
}
action("VAT Registration Service (VIES) Setting")
{
ApplicationArea = Basic, Suite;
Caption = 'VAT Registration Service (VIES) Setting';
RunObject = page "VAT Registration Config";
+ Tooltip = 'Open the VAT Registration Service (VIES) Setting page.';
}
action("API Setup")
{
@@ -874,12 +971,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Account Schedule KPI Web Service Setup';
RunObject = page "Acc. Sched. KPI Web Srv. Setup";
+ Tooltip = 'Open the Account Schedule KPI Web Service Setup page.';
}
action("Acc. Sched. KPI Web Service")
{
ApplicationArea = Basic, Suite;
Caption = 'Account Schedule KPI Web Service';
RunObject = page "Acc. Sched. KPI Web Service";
+ Tooltip = 'Open the Account Schedule KPI Web Service page.';
}
}
group("Group27A")
@@ -980,48 +1079,56 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Configuration Questionnaire';
RunObject = page "Config. Questionnaire";
+ Tooltip = 'Open the Configuration Questionnaire page.';
}
action("Data Migration1")
{
ApplicationArea = Suite;
Caption = 'Configuration Packages';
RunObject = page "Config. Packages";
+ Tooltip = 'Open the Configuration Packages page.';
}
action("Setup Master Templates")
{
ApplicationArea = Basic, Suite;
Caption = 'Configuration Templates';
RunObject = page "Config. Template List";
+ Tooltip = 'Open the Configuration Templates page.';
}
action("Create G/L acc. Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create G/L Acc. Journal Lines';
RunObject = report "Create G/L Acc. Journal Lines";
+ Tooltip = 'Run the Create G/L Acc. Journal Lines report.';
}
action("Create Customer Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Customer Journal Lines';
RunObject = report "Create Customer Journal Lines";
+ Tooltip = 'Run the Create Customer Journal Lines report.';
}
action("Create Vendor Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Vendor Journal Lines';
RunObject = report "Create Vendor Journal Lines";
+ Tooltip = 'Run the Create Vendor Journal Lines report.';
}
action("Create Item Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Item Journal Lines';
RunObject = report "Create Item Journal Lines";
+ Tooltip = 'Run the Create Item Journal Lines report.';
}
action("Configuration Worksheet")
{
ApplicationArea = Suite;
Caption = 'Configuration Worksheet';
RunObject = page "Config. Worksheet";
+ Tooltip = 'Open the Configuration Worksheet page.';
}
}
}
diff --git a/src/Layers/IT/BaseApp/Sales/Customer/Customer.Table.al b/src/Layers/IT/BaseApp/Sales/Customer/Customer.Table.al
index bf2be9ad64..6814cd3c40 100644
--- a/src/Layers/IT/BaseApp/Sales/Customer/Customer.Table.al
+++ b/src/Layers/IT/BaseApp/Sales/Customer/Customer.Table.al
@@ -2638,6 +2638,7 @@ table 18 Customer
UpdateReferencedIds();
SetLastModifiedDateTime();
if IsContactUpdateNeeded() then begin
+ OnBeforeModifyContactUpdate(Rec);
Modify();
UpdateContFromCust.OnModify(Rec);
if not Find() then begin
@@ -2647,6 +2648,11 @@ table 18 Customer
end;
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnBeforeModifyContactUpdate(var Customer: Record Customer)
+ begin
+ end;
+
trigger OnRename()
var
IsHandled: Boolean;
diff --git a/src/Layers/IT/BaseApp/Sales/Customer/CustomerBankAccount.Table.al b/src/Layers/IT/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
index cf8998abbf..2b9b442bbd 100644
--- a/src/Layers/IT/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
+++ b/src/Layers/IT/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -581,4 +581,5 @@ table 287 "Customer Bank Account"
local procedure OnBeforeValidatePostCode(var CustomerBankAccount: Record "Customer Bank Account"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
begin
end;
+
}
diff --git a/src/Layers/IT/BaseApp/Sales/Customer/CustomerTempl.Table.al b/src/Layers/IT/BaseApp/Sales/Customer/CustomerTempl.Table.al
index 35b58652fd..fefba214a9 100644
--- a/src/Layers/IT/BaseApp/Sales/Customer/CustomerTempl.Table.al
+++ b/src/Layers/IT/BaseApp/Sales/Customer/CustomerTempl.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -959,4 +959,5 @@ table 1381 "Customer Templ."
local procedure OnCopyTemplateOnBeforeModify(SourceCustomerTempl: Record "Customer Templ."; SavedCustomerTempl: Record "Customer Templ."; var CustomerTempl: Record "Customer Templ.")
begin
end;
+
}
diff --git a/src/Layers/IT/BaseApp/Sales/Document/SalesHeader.Table.al b/src/Layers/IT/BaseApp/Sales/Document/SalesHeader.Table.al
index d887a42dfa..2569f41d46 100644
--- a/src/Layers/IT/BaseApp/Sales/Document/SalesHeader.Table.al
+++ b/src/Layers/IT/BaseApp/Sales/Document/SalesHeader.Table.al
@@ -335,6 +335,7 @@ table 36 "Sales Header"
Validate("Payment Terms Code");
Validate("Prepmt. Payment Terms Code");
Validate("Payment Method Code");
+ OnAfterValidateBillToCustomerPaymentFields(Rec);
Validate("Prepayment %");
if (xRec."Sell-to Customer No." = "Sell-to Customer No.") and
@@ -11087,6 +11088,11 @@ table 36 "Sales Header"
begin
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnAfterValidateBillToCustomerPaymentFields(var SalesHeader: Record "Sales Header")
+ begin
+ end;
+
///
/// Raised after extended text is transferred for sales line recreation.
///
diff --git a/src/Layers/NA/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al b/src/Layers/NA/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
index 58e5911e96..2ac4cc331f 100644
--- a/src/Layers/NA/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
+++ b/src/Layers/NA/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
@@ -66,36 +66,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Salespeople")
{
ApplicationArea = Suite;
Caption = 'Salespeople/Purchasers';
RunObject = page "Salespersons/Purchasers";
+ Tooltip = 'Open the Salespeople/Purchasers page.';
}
action("Teams")
{
ApplicationArea = Basic, Suite;
Caption = 'Teams';
RunObject = page "Teams";
+ Tooltip = 'Open the Teams page.';
}
action("Tasks")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Opportunities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
group("Group1")
{
@@ -105,36 +111,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesBudget;
Caption = 'Sales Budgets';
RunObject = page "Budget Names Sales";
+ Tooltip = 'Open the Sales Budgets page.';
}
action("Sales Analysis Reports")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Reports';
RunObject = page "Analysis Report Sale";
+ Tooltip = 'Open the Sales Analysis Reports page.';
}
action("Sales Analysis by Dimensions")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Item Dimensions - Detail")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Detail';
RunObject = report "Item Dimensions - Detail";
+ Tooltip = 'Run the Item Dimensions - Detail report.';
}
action("Item Dimensions - Total")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Total';
RunObject = report "Item Dimensions - Total";
+ Tooltip = 'Run the Item Dimensions - Total report.';
}
action("Opportunities Matrix")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Analysis';
RunObject = page "Opportunities";
+ Tooltip = 'Open the Opportunity Analysis page.';
}
}
group("Group2")
@@ -145,6 +157,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Deferral Summary';
RunObject = report "Deferral Summary - Sales";
+ Tooltip = 'Run the Sales Deferral Summary report.';
}
group("Group3")
{
@@ -154,36 +167,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Tasks';
RunObject = report "Salesperson - Tasks";
+ Tooltip = 'Run the Salesperson Tasks report.';
}
action("Salesperson - Commission")
{
ApplicationArea = Suite;
Caption = 'Salesperson Commission';
RunObject = report "Salesperson Commissions";
+ Tooltip = 'Run the Salesperson Commission report.';
}
action("Salesperson - Opportunities")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Opportunities';
RunObject = report "Salesperson - Opportunities";
+ Tooltip = 'Run the Salesperson Opportunities report.';
}
action("Team - Tasks")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Team Tasks';
RunObject = report "Team - Tasks";
+ Tooltip = 'Run the Team Tasks report.';
}
action("Salesperson - Sales Statistics")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Statistics by Inv.';
RunObject = report "Salesperson Statistics by Inv.";
+ Tooltip = 'Run the Salesperson Sales Statistics report.';
}
action("Salesperson - Sales Statistics1")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Statistics by Inv.';
RunObject = report "Salesperson Statistics by Inv.";
+ Tooltip = 'Run the Salesperson Statistics by Inv. report.';
}
}
group("Group4")
@@ -194,36 +213,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Contact Labels';
RunObject = report "Contact - Labels";
+ Tooltip = 'Run the Contact Labels report.';
}
action("Contact - Company Summary")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact - Company Summary';
RunObject = report "Contact - Company Summary";
+ Tooltip = 'Run the Contact - Company Summary report.';
}
action("Questionnaire - Handouts")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire - Handouts';
RunObject = report "Questionnaire - Handouts";
+ Tooltip = 'Run the Questionnaire - Handouts report.';
}
action("Contact - List")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact List';
RunObject = report "Contact - List";
+ Tooltip = 'Run the Contact List report.';
}
action("Orgl. Profile Summary")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Person Summary';
RunObject = report "Contact - Person Summary";
+ Tooltip = 'Run the Contact - Person Summary report.';
}
action("Contact - Cover Sheet")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Cover Sheet';
RunObject = report "Contact - Cover Sheet";
+ Tooltip = 'Run the Contact - Cover Sheet report.';
}
}
group("Group5")
@@ -234,42 +259,49 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Listing';
RunObject = report "Customer Listing";
+ Tooltip = 'Run the Customer - List report.';
}
action("Customer - Labels")
{
ApplicationArea = Suite;
Caption = 'Customer Labels';
RunObject = report "Customer Labels NA";
+ Tooltip = 'Run the Customer Labels report.';
}
action("Customer - Balance to Date")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Balance to Date';
RunObject = report "Customer - Balance to Date";
+ Tooltip = 'Run the Customer - Balance to Date report.';
}
action("Customer - Order Summary")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Summary';
RunObject = report "Customer - Order Summary";
+ Tooltip = 'Run the Customer - Order Summary report.';
}
action("Customer/Item Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Item Statistics';
RunObject = report "Customer/Item Statistics";
+ Tooltip = 'Run the Customer/Item Sales report.';
}
action("Customer Register")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Register';
RunObject = report "Customer Register";
+ Tooltip = 'Run the Customer Register report.';
}
action("Customer - Order Detail")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Detail';
RunObject = report "Customer - Order Detail";
+ Tooltip = 'Run the Customer - Order Detail report.';
}
#if not CLEAN28
action("Customer - Top 10 List")
@@ -280,6 +312,7 @@ page 8907 "Sales & Marketing Manager RC"
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';
+ Tooltip = 'Run the Customer Top 10 List report.';
}
#endif
action("Customer/Item Sales1")
@@ -287,12 +320,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer/Item Statistics';
RunObject = report "Customer/Item Statistics";
+ Tooltip = 'Run the Customer/Item Sales report.';
}
action("Customer - Trial Balance")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Trial Balance';
RunObject = report "Customer - Trial Balance";
+ Tooltip = 'Run the Customer Trial Balance report.';
}
#if not CLEAN28
action("Customer - Sales List")
@@ -303,6 +338,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
}
@@ -314,18 +350,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - List';
RunObject = report "Opportunity - List";
+ Tooltip = 'Run the Opportunity - List report.';
}
action("Opportunity - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - Details';
RunObject = report "Opportunity - Details";
+ Tooltip = 'Run the Opportunity - Details report.';
}
action("Sales Cycle - Analysis")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycle - Analysis';
RunObject = report "Sales Cycle - Analysis";
+ Tooltip = 'Run the Sales Cycle - Analysis report.';
}
}
}
@@ -338,76 +377,89 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts1")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Quotes")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quotes';
RunObject = page "Sales Quotes";
+ Tooltip = 'Open the Sales Quotes page.';
}
action("Orders")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Orders';
RunObject = page "Sales Order List";
+ Tooltip = 'Open the Sales Orders page.';
}
action("Blanket Orders")
{
ApplicationArea = Suite;
Caption = 'Blanket Sales Orders';
RunObject = page "Blanket Sales Orders";
+ Tooltip = 'Open the Blanket Sales Orders page.';
}
action("Return Orders")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Sales Return Orders';
RunObject = page "Sales Return Order List";
+ Tooltip = 'Open the Sales Return Orders page.';
}
action("Invoices")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Invoices';
RunObject = page "Sales Invoice List";
+ Tooltip = 'Open the Sales Invoices page.';
}
action("Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Credit Memos';
RunObject = page "Sales Credit Memos";
+ Tooltip = 'Open the Sales Credit Memos page.';
}
action("Certificates of Supply")
{
ApplicationArea = Basic, Suite;
Caption = 'Certificates of Supply';
RunObject = page "Certificates of Supply";
+ Tooltip = 'Open the Certificates of Supply page.';
}
action("Order Planning")
{
ApplicationArea = Planning;
Caption = 'Order Planning';
RunObject = page "Order Planning";
+ Tooltip = 'Open the Order Planning page.';
}
action("Customer Order Status")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Order Status';
RunObject = page "Customer Order Status";
+ Tooltip = 'Open the Customer Order Status page.';
}
action("Sales Order Invoicing")
{
Caption = 'Sales Order Invoicing';
RunObject = page "Sales Order Invoice";
+ Tooltip = 'Open the Sales Order Invoicing page.';
}
action("Sales Order Shipping")
{
Caption = 'Sales Order Shipping';
RunObject = page "Sales Order Shipment List";
+ Tooltip = 'Open the Sales Order Shipping page.';
}
group("Group8")
{
@@ -417,24 +469,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Invoices';
RunObject = page "Posted Sales Invoices";
+ Tooltip = 'Open the Posted Sales Invoices page.';
}
action("Posted Sales Shipments")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Shipments';
RunObject = page "Posted Sales Shipments";
+ Tooltip = 'Open the Posted Sales Shipments page.';
}
action("Posted Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Credit Memos';
RunObject = page "Posted Sales Credit Memos";
+ Tooltip = 'Open the Posted Sales Credit Memos page.';
}
action("Posted Return Receipts")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Posted Return Receipts';
RunObject = page "Posted Return Receipts";
+ Tooltip = 'Open the Posted Return Receipts page.';
}
}
group("Group9")
@@ -445,48 +501,56 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'G/L Registers';
RunObject = page "G/L Registers";
+ Tooltip = 'Open the G/L Registers page.';
}
action("Item Tracing")
{
ApplicationArea = ItemTracking;
Caption = 'Item Tracing';
RunObject = page "Item Tracing";
+ Tooltip = 'Open the Item Tracing page.';
}
action("Sales Quote Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quote Archives';
RunObject = page "Sales Quote Archives";
+ Tooltip = 'Open the Sales Quote Archives page.';
}
action("Sales Order Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Order Archives';
RunObject = page "Sales Order Archives";
+ Tooltip = 'Open the Sales Order Archives page.';
}
action("Sales Return Order Archives")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Return Order Archives';
RunObject = page "Sales Return List Archive";
+ Tooltip = 'Open the Sales Return Order Archives page.';
}
action("Customer Ledger Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Ledger Entries';
RunObject = page "Customer Ledger Entries";
+ Tooltip = 'Open the Customer Ledger Entries page.';
}
action("Detailed Cust. Ledg. Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Detailed Customer Ledger Entries';
RunObject = page "Detailed Cust. Ledg. Entries";
+ Tooltip = 'Open the Detailed Customer Ledger Entries page.';
}
action("Value Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Value Entries';
RunObject = page "Value Entries";
+ Tooltip = 'Open the Value Entries page.';
}
action("Navigate")
{
@@ -506,6 +570,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Detail';
RunObject = report "Customer - Order Detail";
+ Tooltip = 'Run the Customer - Order Detail report.';
}
#if not CLEAN28
action("Sales Reservation Avail.")
@@ -516,6 +581,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Reservation Avail. report.';
}
action("Customer - Sales List1")
{
@@ -525,6 +591,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
action("Customer/Item Sales2")
@@ -532,12 +599,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer/Item Statistics';
RunObject = report "Customer/Item Statistics";
+ Tooltip = 'Run the Customer/Item Statistics report.';
}
action("Customer - Order Summary1")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Summary';
RunObject = report "Customer - Order Summary";
+ Tooltip = 'Run the Customer - Order Summary report.';
}
action("Customer - Labels1")
{
@@ -545,18 +614,21 @@ page 8907 "Sales & Marketing Manager RC"
Caption = 'Shipping Labels';
RunObject = report "Shipping Labels";
AccessByPermission = TableData "Location" = R;
+ Tooltip = 'Run the Shipping Labels report.';
}
action("UPS COD Tags")
{
ApplicationArea = Basic, Suite;
Caption = 'UPS COD Tags';
RunObject = report "UPS COD Tags";
+ Tooltip = 'Run the UPS COD Tags report.';
}
action("Return Authorization")
{
ApplicationArea = Basic, Suite;
Caption = 'Return Authorization';
RunObject = report "Return Authorization";
+ Tooltip = 'Run the Return Authorization report.';
}
}
}
@@ -568,42 +640,49 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Campaigns")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaigns';
RunObject = page "Campaign List";
+ Tooltip = 'Open the Campaigns page.';
}
action("Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Segments';
RunObject = page "Segment List";
+ Tooltip = 'Open the Segments page.';
}
action("Logged Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Logged Segments';
RunObject = page "Logged Segments";
+ Tooltip = 'Open the Logged Segments page.';
}
action("Opportunities1")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
action("Tasks1")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Campaign - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign - Details';
RunObject = report "Campaign - Details";
+ Tooltip = 'Run the Campaign - Details report.';
}
group("Group12")
{
@@ -613,18 +692,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Entries';
RunObject = page "Campaign Entries";
+ Tooltip = 'Open the Campaign Entries page.';
}
action("Opportunity Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Entries';
RunObject = page "Opportunity Entries";
+ Tooltip = 'Open the Opportunity Entries page.';
}
action("Interaction Log Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Log Entries';
RunObject = page "Interaction Log Entries";
+ Tooltip = 'Open the Interaction Log Entries page.';
}
}
}
@@ -636,18 +718,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Items';
RunObject = page "Item List";
+ Tooltip = 'Open the Items page.';
}
action("Nonstock Items")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Items';
RunObject = page "Catalog Item List";
+ Tooltip = 'Open the Nonstock Items page.';
}
action("Item Attributes")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Attributes';
RunObject = page "Item Attributes";
+ Tooltip = 'Open the Item Attributes page.';
}
action("Sales Price Worksheet")
{
@@ -661,6 +746,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Adjust Item Costs/Prices';
RunObject = report "Adjust Item Costs/Prices";
+ Tooltip = 'Run the Adjust Item Costs/Prices report.';
}
group("Group14")
{
@@ -670,30 +756,35 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Item Charges - Specification';
RunObject = report "Item Charges - Specification";
+ Tooltip = 'Run the Item Charges - Specification report.';
}
action("Nonstock Item Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Sales';
RunObject = report "Catalog Item Sales";
+ Tooltip = 'Run the Nonstock Item Sales report.';
}
action("Inventory Order Details")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Order Details';
RunObject = report "Inventory Order Details";
+ Tooltip = 'Run the Inventory Order Details report.';
}
action("Inventory - Sales Back Orders")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory - Sales Back Orders';
RunObject = report "Inventory - Sales Back Orders";
+ Tooltip = 'Run the Inventory - Sales Back Orders report.';
}
action("Item Substitutions")
{
ApplicationArea = Suite;
Caption = 'Item Substitutions';
RunObject = report "Item Substitutions";
+ Tooltip = 'Run the Item Substitutions report.';
}
#if not CLEAN28
action("Availability Projection")
@@ -704,6 +795,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteReason = 'Prepare for extraction of Manufacturing app';
ObsoleteState = Pending;
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Availability Projection report.';
}
action("Availability Status")
{
@@ -712,42 +804,50 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteReason = 'Prepare for extraction of Manufacturing app';
ObsoleteState = Pending;
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Availability Status report.';
}
#endif
action("Back Order Fill by Customer")
{
Caption = 'Back Order Fill by Customer';
RunObject = report "Back Order Fill by Customer";
+ Tooltip = 'Run the Back Order Fill by Customer report.';
}
action("Back Order Fill by Item")
{
Caption = 'Back Order Fill by Item';
RunObject = report "Back Order Fill by Item";
+ Tooltip = 'Run the Back Order Fill by Item report.';
}
action("Item List")
{
Caption = 'Item List';
RunObject = report "Item List";
+ Tooltip = 'Run the Item List report.';
}
action("Item Cost and Price List")
{
Caption = 'Item Cost and Price List';
RunObject = report "Item Cost and Price List";
+ Tooltip = 'Run the Item Cost and Price List report.';
}
action("Item Sales by Customer")
{
Caption = 'Item Sales by Customer';
RunObject = report "Item Sales by Customer";
+ Tooltip = 'Run the Item Sales by Customer report.';
}
action("Item Sales Statistics")
{
Caption = 'Item Sales Statistics';
RunObject = report "Item Sales Statistics";
+ Tooltip = 'Run the Item Sales Statistics report.';
}
action("Items by Sales Tax Group")
{
Caption = 'Items by Sales Tax Group';
RunObject = report "Items by Sales Tax Group";
+ Tooltip = 'Run the Items by Sales Tax Group report.';
}
action("List Price Sheet")
{
@@ -760,37 +860,44 @@ page 8907 "Sales & Marketing Manager RC"
{
Caption = 'Picking List by Item';
RunObject = report "Picking List by Item";
+ Tooltip = 'Run the Picking List by Item report.';
}
action("Picking List by Order")
{
Caption = 'Picking List by Order';
RunObject = report "Picking List by Order";
+ Tooltip = 'Run the Picking List by Order report.';
}
action("Sales History")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales History';
RunObject = report "Sales History";
+ Tooltip = 'Run the Sales History report.';
}
action("Sales Order Status")
{
Caption = 'Sales Order Status';
RunObject = report "Sales Order Status";
+ Tooltip = 'Run the Sales Order Status report.';
}
action("Sales Promotion")
{
Caption = 'Sales Promotion';
RunObject = report "Sales Promotion V16";
+ Tooltip = 'Run the Sales Promotion report.';
}
action("Serial Number Sold History")
{
Caption = 'Serial Number Sold History';
RunObject = report "Serial Number Sold History";
+ Tooltip = 'Run the Serial Number Sold History report.';
}
action("Top __ Inventory Items")
{
Caption = 'Top __ Inventory Items';
RunObject = report "Top __ Inventory Items";
+ Tooltip = 'Run the Top __ Inventory Items report.';
}
}
}
@@ -802,54 +909,63 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Orders - Dynamics 365 Sales';
RunObject = page "CRM Sales Order List";
+ Tooltip = 'Open the Sales Orders - Dynamics 365 Sales page.';
}
action("Quotes - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Quotes - Dynamics 365 Sales';
RunObject = page "CRM Sales Quote List";
+ Tooltip = 'Open the Quotes - Dynamics 365 Sales page.';
}
action("Cases - Dynamics 365 for Customer Service")
{
ApplicationArea = Suite;
Caption = 'Cases - Dynamics 365 for Customer Service';
RunObject = page "CRM Case List";
+ Tooltip = 'Open the Cases - Dynamics 365 for Customer Service page.';
}
action("Opportunities - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Opportunities - Dynamics 365 Sales';
RunObject = page "CRM Opportunity List";
+ Tooltip = 'Open the Opportunities - Dynamics 365 Sales page.';
}
action("Accounts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Accounts - Dynamics 365 Sales';
RunObject = page "CRM Account List";
+ Tooltip = 'Open the Accounts - Dynamics 365 Sales page.';
}
action("Transaction Currencies - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Transaction Currencies - Dynamics 365 Sales';
RunObject = page "CRM TransactionCurrency List";
+ Tooltip = 'Open the Transaction Currencies - Dynamics 365 Sales page.';
}
action("Unit Groups - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Unit Groups - Dynamics 365 Sales';
RunObject = page "CRM UnitGroup List";
+ Tooltip = 'Open the Unit Groups - Dynamics 365 Sales page.';
}
action("Products - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Products - Dynamics 365 Sales';
RunObject = page "CRM Product List";
+ Tooltip = 'Open the Products - Dynamics 365 Sales page.';
}
action("Contacts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Contacts - Dynamics 365 Sales';
RunObject = page "CRM Contact List";
+ Tooltip = 'Open the Contacts - Dynamics 365 Sales page.';
}
action("Records Skipped For Synchronization")
{
@@ -857,6 +973,7 @@ page 8907 "Sales & Marketing Manager RC"
Caption = 'Coupled Data Synchronization Errors';
RunObject = page "CRM Skipped Records";
AccessByPermission = TableData "CRM Integration Record" = R;
+ Tooltip = 'Open the Coupled Data Synchronization Errors page.';
}
}
group("Group16")
@@ -867,60 +984,70 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = OrderPromising;
Caption = 'Order Promising Setup';
RunObject = page "Order Promising Setup";
+ Tooltip = 'Open the Order Promising Setup page.';
}
action("Sales & Receivables Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales & Receivables Setup';
RunObject = page "Sales & Receivables Setup";
+ Tooltip = 'Open the Sales & Receivables Setup page.';
}
action("report Selection Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Sales';
RunObject = page "Report Selection - Sales";
+ Tooltip = 'Open the Report Selections Sales page.';
}
action("Standard Sales Codes")
{
ApplicationArea = Suite;
Caption = 'Standard Sales Codes';
RunObject = page "Standard Sales Codes";
+ Tooltip = 'Open the Standard Sales Codes page.';
}
action("Payment Terms")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Terms';
RunObject = page "Payment Terms";
+ Tooltip = 'Open the Payment Terms page.';
}
action("Payment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Methods';
RunObject = page "Payment Methods";
+ Tooltip = 'Open the Payment Methods page.';
}
action("Item Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Shipment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Shipment Methods';
RunObject = page "Shipment Methods";
+ Tooltip = 'Open the Shipment Methods page.';
}
action("Shipping Agents")
{
ApplicationArea = Suite;
Caption = 'Shipping Agents';
RunObject = page "Shipping Agents";
+ Tooltip = 'Open the Shipping Agents page.';
}
action("Return Reasons")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Return Reasons';
RunObject = page "Return Reasons";
+ Tooltip = 'Open the Return Reasons page.';
}
action("Customer Templates")
{
@@ -934,6 +1061,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Mexican CFDI Setup';
RunObject = page "Mexican CFDI Wizard";
+ Tooltip = 'Open the Mexican CFDI Setup page.';
}
group("Group17")
{
@@ -943,24 +1071,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesAnalysis, PurchaseAnalysis, InventoryAnalysis;
Caption = 'Analysis Types';
RunObject = page "Analysis Types";
+ Tooltip = 'Open the Analysis Types page.';
}
action("Sales Analysis by Dimensions1")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Analysis Column Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Column Templates';
RunObject = report "Run Sales Analysis Col. Temp.";
+ Tooltip = 'Run the Sales Analysis Column Templates report.';
}
action("Analysis Line Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Line Templates';
RunObject = report "Run Sales Analysis Line Templ.";
+ Tooltip = 'Run the Sales Analysis Line Templates report.';
}
}
group("Group18")
@@ -971,12 +1103,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Price Groups';
RunObject = page "Customer Price Groups";
+ Tooltip = 'Open the Customer Price Groups page.';
}
action("Customer Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Discount Groups';
RunObject = page "Customer Disc. Groups";
+ Tooltip = 'Open the Customer Discount Groups page.';
}
}
group("Group19")
@@ -987,24 +1121,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Setup';
RunObject = page "Catalog Item Setup";
+ Tooltip = 'Open the Nonstock Item Setup page.';
}
action("Item Charges")
{
ApplicationArea = ItemCharges;
Caption = 'Item Charges';
RunObject = page "Item Charges";
+ Tooltip = 'Open the Item Charges page.';
}
action("Item Disc. Groups1")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Inventory Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Setup';
RunObject = page "Inventory Setup";
+ Tooltip = 'Open the Inventory Setup page.';
}
}
group("Group20")
@@ -1015,99 +1153,116 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite, RelationshipMgmt;
Caption = 'Marketing Setup';
RunObject = page "Marketing Setup";
+ Tooltip = 'Open the Marketing Setup page.';
}
action("Interaction Template Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Template Setup';
RunObject = page "Interaction Template Setup";
+ Tooltip = 'Open the Interaction Template Setup page.';
}
action("Business Relations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Business Relations';
RunObject = page "Business Relations";
+ Tooltip = 'Open the Business Relations page.';
}
action("Industry Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Industry Groups';
RunObject = page "Industry Groups";
+ Tooltip = 'Open the Industry Groups page.';
}
action("Web Sources")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Web Sources';
RunObject = page "Web Sources";
+ Tooltip = 'Open the Web Sources page.';
}
action("Job Responsibilities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Job Responsibilities';
RunObject = page "Job Responsibilities";
+ Tooltip = 'Open the Job Responsibilities page.';
}
action("Organizational Levels")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Organizational Levels';
RunObject = page "Organizational Levels";
+ Tooltip = 'Open the Organizational Levels page.';
}
action("Interaction Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Groups';
RunObject = page "Interaction Groups";
+ Tooltip = 'Open the Interaction Groups page.';
}
action("Interaction Templates")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Templates';
RunObject = page "Interaction Templates";
+ Tooltip = 'Open the Interaction Templates page.';
}
action("Salutations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Salutations';
RunObject = page "Salutations";
+ Tooltip = 'Open the Salutations page.';
}
action("Mailing Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Mailing Groups';
RunObject = page "Mailing Groups";
+ Tooltip = 'Open the Mailing Groups page.';
}
action("Status")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Status';
RunObject = page "Campaign Status";
+ Tooltip = 'Open the Campaign Status page.';
}
action("Sales Cycles")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycles';
RunObject = page "Sales Cycles";
+ Tooltip = 'Open the Sales Cycles page.';
}
action("Close Opportunity Codes")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Close Opportunity Codes';
RunObject = page "Close Opportunity Codes";
+ Tooltip = 'Open the Close Opportunity Codes page.';
}
action("Questionnaire Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire Setup';
RunObject = page "Profile Questionnaires";
+ Tooltip = 'Open the Questionnaire Setup page.';
}
action("Activities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Activities';
RunObject = page "Activity List";
+ Tooltip = 'Open the Activities page.';
}
}
}
}
}
-}
\ No newline at end of file
+
+}
diff --git a/src/Layers/NA/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al b/src/Layers/NA/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
index c92e1e7a3f..1bb853386b 100644
--- a/src/Layers/NA/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
+++ b/src/Layers/NA/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
@@ -70,53 +70,53 @@ page 9001 "Accounting Manager Role Center"
{
area(rolecenter)
{
- part(Control1902304208; "Account Manager Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part(Control99; "Finance Performance")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control103; "Trailing Sales Orders Chart")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control106; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control100; "Cash Flow Forecast Chart")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1907692008; "My Customers")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1902476008; "My Vendors")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control108; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- systempart(Control1901377608; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
+ part(Control1902304208; "Account Manager Activities")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part("User Tasks Activities"; "User Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part(Control99; "Finance Performance")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control103; "Trailing Sales Orders Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control106; "My Job Queue")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control100; "Cash Flow Forecast Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1907692008; "My Customers")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1902476008; "My Vendors")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control108; "Report Inbox Part")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ systempart(Control1901377608; MyNotes)
+ {
+ ApplicationArea = Basic, Suite;
+ }
}
}
diff --git a/src/Layers/NA/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/NA/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index 4e07d4bef9..d754429de6 100644
--- a/src/Layers/NA/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/NA/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -101,7 +101,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
@@ -220,6 +219,7 @@ page 8901 "Finance Manager Role Center"
{
Caption = 'Day Book Vendor Ledger Entry';
RunObject = report "Day Book Vendor Ledger Entry";
+ Tooltip = 'Run the Day Book Vendor Ledger Entry report.';
}
action("Sales Taxes Collected")
{
@@ -402,7 +402,7 @@ page 8901 "Finance Manager Role Center"
{
ApplicationArea = Basic, Suite;
Caption = 'G/L Register';
- RunObject = Report "G/L Register";
+ RunObject = report "G/L Register";
Tooltip = 'Run the G/L Register report.';
}
action("Detail Trial Balance")
@@ -465,6 +465,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Financial Report';
RunObject = report "Account Schedule";
+ Tooltip = 'Run the Account Schedule report.';
}
action("Account Schedule Layout")
{
@@ -476,7 +477,7 @@ page 8901 "Finance Manager Role Center"
{
ApplicationArea = Basic, Suite;
Caption = 'Trial Balance (Obsolete)';
- RunObject = Report "Trial Balance";
+ RunObject = report "Trial Balance";
Tooltip = 'Run the Trial Balance report.';
ObsoleteState = Pending;
ObsoleteReason = 'This report has been replaced by the report Trial Balance (Excel). This report will be removed in a future release.';
@@ -486,7 +487,7 @@ page 8901 "Finance Manager Role Center"
{
ApplicationArea = Basic, Suite;
Caption = 'Trial Balance/Budget (Obsolete)';
- RunObject = Report "Trial Balance/Budget";
+ RunObject = report "Trial Balance/Budget";
Tooltip = 'Run the Trial Balance/Budget report.';
ObsoleteState = Pending;
ObsoleteReason = 'This report has been replaced by the report Trial Balance/Budget (Excel). This report will be removed in a future release.';
@@ -504,25 +505,29 @@ page 8901 "Finance Manager Role Center"
{
ApplicationArea = Basic, Suite;
Caption = 'Closing Trial Balance';
- RunObject = Report "Closing Trial Balance";
+ RunObject = report "Closing Trial Balance";
+ Tooltip = 'Run the Closing Trial Balance report.';
}
action("Consolidated Trial Balance")
{
ApplicationArea = Suite;
Caption = 'Consolidated Trial Balance';
- RunObject = Report "Consolidated Trial Balance";
+ RunObject = report "Consolidated Trial Balance";
+ Tooltip = 'Run the Consolidated Trial Balance report.';
}
action("Consolidated Trial Balance (4)")
{
ApplicationArea = Suite;
Caption = 'Consolidated Trial Balance (4)';
- RunObject = Report "Consolidated Trial Balance (4)";
+ RunObject = report "Consolidated Trial Balance (4)";
+ Tooltip = 'Run the Consolidated Trial Balance (4) report.';
}
action("Budget")
{
ApplicationArea = Suite;
Caption = 'Budget';
- RunObject = Report Budget;
+ RunObject = report "Budget";
+ Tooltip = 'Run the Budget report.';
}
action("Trial Balance by Period")
{
@@ -660,7 +665,8 @@ page 8901 "Finance Manager Role Center"
{
ApplicationArea = Basic, Suite;
Caption = 'Chart of Accounts';
- RunObject = Report "Chart of Accounts";
+ RunObject = report "Chart of Accounts";
+ Tooltip = 'Run the Chart of Accounts report.';
}
action("Change Log Setup List")
{
@@ -817,6 +823,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Cash Receipt Journals';
RunObject = page "Cash Receipt Journal";
+ Tooltip = 'Open the Cash Receipt Journals page.';
}
action("Sales Tax Journal")
{
@@ -1155,6 +1162,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Credit Management")
{
@@ -1343,7 +1351,7 @@ page 8901 "Finance Manager Role Center"
action("Customer Comment List")
{
Caption = 'Customer Comment List';
- RunObject = Report "Customer Comment List";
+ RunObject = report "Customer Comment List";
}
action("Customer Statement")
{
@@ -1356,7 +1364,7 @@ page 8901 "Finance Manager Role Center"
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Register';
- RunObject = Report "Customer Register";
+ RunObject = report "Customer Register";
}
action("Customer - Balance to Date")
{
@@ -1374,7 +1382,7 @@ page 8901 "Finance Manager Role Center"
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Listing';
- RunObject = Report "Customer Listing";
+ RunObject = report "Customer Listing";
}
action("Customer - Summary Aging Simp.")
{
@@ -1400,7 +1408,7 @@ page 8901 "Finance Manager Role Center"
{
ApplicationArea = Suite;
Caption = 'Customer Labels';
- RunObject = Report "Customer Labels NA";
+ RunObject = report "Customer Labels NA";
}
#if not CLEAN28
action("Customer - Top 10 List")
@@ -1427,7 +1435,7 @@ page 8901 "Finance Manager Role Center"
action("Salesperson - Commission")
{
Caption = 'Salesperson Commission';
- RunObject = Report "Salesperson Commissions";
+ RunObject = report "Salesperson Commissions";
}
#if not CLEAN28
action("Customer - Sales List")
@@ -1636,6 +1644,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Incoming Documents';
RunObject = page "Incoming Documents";
+ Tooltip = 'Open the Incoming Documents page.';
}
action("Generate EFT Files")
{
@@ -1921,6 +1930,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Purchases & Payables Setup';
RunObject = page "Purchases & Payables Setup";
+ Tooltip = 'Open the Purchases & Payables Setup page.';
}
}
}
@@ -2494,9 +2504,10 @@ page 8901 "Finance Manager Role Center"
}
action("Inventory - G/L Reconciliation")
{
- ApplicationArea = Suite;
+ ApplicationArea = Basic, Suite;
Caption = 'Inventory - G/L Reconciliation';
RunObject = page "Inventory - G/L Reconciliation";
+ Tooltip = 'Open the Inventory - G/L Reconciliation page.';
}
action("Item List")
{
@@ -2651,6 +2662,7 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'No. Series';
RunObject = page "No. Series";
+ Tooltip = 'Open the No. Series page.';
}
action("GIFI Codes")
{
diff --git a/src/Layers/NA/BaseApp/HumanResources/Employee/Employee.Table.al b/src/Layers/NA/BaseApp/HumanResources/Employee/Employee.Table.al
index 2cbdef0912..6230694a75 100644
--- a/src/Layers/NA/BaseApp/HumanResources/Employee/Employee.Table.al
+++ b/src/Layers/NA/BaseApp/HumanResources/Employee/Employee.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -1012,4 +1012,5 @@ table 5200 Employee
local procedure OnBeforeSetEmployeeLedgEntryFilterByAccPeriod(var EmployeeLedgerEntry: Record "Employee Ledger Entry"; var IsHandled: Boolean)
begin
end;
+
}
diff --git a/src/Layers/NA/BaseApp/Purchases/Document/PurchaseQuote.Page.al b/src/Layers/NA/BaseApp/Purchases/Document/PurchaseQuote.Page.al
index 9ceb40353e..bc872670bb 100644
--- a/src/Layers/NA/BaseApp/Purchases/Document/PurchaseQuote.Page.al
+++ b/src/Layers/NA/BaseApp/Purchases/Document/PurchaseQuote.Page.al
@@ -1659,6 +1659,13 @@ page 49 "Purchase Quote"
OnAfterActivateFields();
end;
+ local procedure SetPurchaseLinesAvailability()
+ begin
+ IsPurchaseLinesEditable := Rec.PurchaseLinesEditable();
+
+ OnAfterSetPurchaseLinesAvailability(Rec, IsPurchaseLinesEditable);
+ end;
+
local procedure ApproveCalcInvDisc()
begin
CurrPage.PurchLines.PAGE.ApproveCalcInvDisc();
@@ -1713,7 +1720,7 @@ page 49 "Purchase Quote"
WorkflowWebhookManagement.GetCanRequestAndCanCancel(Rec.RecordId, CanRequestApprovalForFlow, CanCancelApprovalForFlow);
HasIncomingDocument := Rec."Incoming Document Entry No." <> 0;
- IsPurchaseLinesEditable := Rec.PurchaseLinesEditable();
+ SetPurchaseLinesAvailability();
end;
local procedure ValidateShippingOption()
@@ -1768,6 +1775,11 @@ page 49 "Purchase Quote"
begin
end;
+ [IntegrationEvent(true, false)]
+ local procedure OnAfterSetPurchaseLinesAvailability(var PurchaseHeader: Record "Purchase Header"; var PurchaseLinesAvailable: Boolean)
+ begin
+ end;
+
[IntegrationEvent(false, false)]
local procedure OnBeforeValidateShipToOptions(var PurchaseHeader: Record "Purchase Header"; ShipToOptions: Option)
begin
diff --git a/src/Layers/NA/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al b/src/Layers/NA/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
index 266fc775da..d8f1e18c03 100644
--- a/src/Layers/NA/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
+++ b/src/Layers/NA/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
@@ -76,6 +76,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'System Information';
RunObject = page "Latest Error";
+ Tooltip = 'Open the System Information page.';
}
action("Table Information")
{
@@ -89,30 +90,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Extension Management';
RunObject = page "Extension Management";
+ Tooltip = 'Open the Extension Management page.';
}
action("Profiles")
{
ApplicationArea = Basic, Suite;
Caption = 'Profiles (Roles)';
RunObject = page "Profile List";
+ Tooltip = 'Open the Profiles (Roles) page.';
}
action("Devices")
{
ApplicationArea = Basic, Suite;
Caption = 'Devices';
RunObject = page "Devices";
+ Tooltip = 'Open the Devices page.';
}
action("Control Add-ins")
{
ApplicationArea = All;
Caption = 'Control Add-ins';
RunObject = page "Control Add-ins";
+ Tooltip = 'Open the Control Add-ins page.';
}
action("Get the Mobile Device App (Tablet and Phone activatation code)")
{
ApplicationArea = All;
Caption = 'Mobile device activation and app';
RunObject = page "O365 Device Setup";
+ Tooltip = 'Open the Mobile device activation and app page.';
}
action("Printer Management")
{
@@ -130,60 +136,70 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Online Map Setup';
RunObject = page "Online Map Setup";
+ Tooltip = 'Open the Online Map Setup page.';
}
action("Bank Export/Import Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Bank Export/Import Setup';
RunObject = page "Bank Export/Import Setup";
+ Tooltip = 'Open the Bank Export/Import Setup page.';
}
action("Cue Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Cue Setup';
RunObject = page "Cue Setup Administrator";
+ Tooltip = 'Open the Cue Setup page.';
}
action("Document Sending Profiles")
{
ApplicationArea = Basic, Suite;
Caption = 'Document Sending Profiles';
RunObject = page "Document Sending Profiles";
+ Tooltip = 'Open the Document Sending Profiles page.';
}
action("Printer Selections")
{
ApplicationArea = Suite;
Caption = 'Printer Selections';
RunObject = page "Printer Selections";
+ Tooltip = 'Open the Printer Selections page.';
}
action("Electronic Document Formats")
{
ApplicationArea = Suite;
Caption = 'Electronic Document Formats';
RunObject = page "Electronic Document Format";
+ Tooltip = 'Open the Electronic Document Formats page.';
}
action("Assisted Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Assisted Setup';
RunObject = page "Assisted Setup";
+ Tooltip = 'Open the Assisted Setup page.';
}
action("Application Area")
{
ApplicationArea = All;
Caption = 'Application Area';
RunObject = page "Application Area";
+ Tooltip = 'Open the Application Area page.';
}
action("Set Up Customer/Vendor/Item Templates")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Vendor/Item Templates';
RunObject = page "Config Templates";
+ Tooltip = 'Open the Customer/Vendor/Item Templates page.';
}
action("Transformation Rules")
{
ApplicationArea = Basic, Suite;
Caption = 'Transformation Rules';
RunObject = page "Transformation Rules";
+ Tooltip = 'Open the Transformation Rules page.';
}
action("Business Setup")
{
@@ -197,6 +213,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Image Analysis Setup';
RunObject = page "Image Analysis Setup";
+ Tooltip = 'Open the Image Analysis Setup page.';
}
}
group("Group4")
@@ -207,18 +224,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Entries';
RunObject = page "Job Queue Entries";
+ Tooltip = 'Open the Job Queue Entries page.';
}
action("Job Queue Log Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Log Entries';
RunObject = page "Job Queue Log Entries";
+ Tooltip = 'Open the Job Queue Log Entries page.';
}
action("Job Queue Category List")
{
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Category List';
RunObject = page "Job Queue Category List";
+ Tooltip = 'Open the Job Queue Category List page.';
}
action("Scheduled Tasks")
{
@@ -236,12 +256,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Change Log Setup';
RunObject = page "Change Log Setup";
+ Tooltip = 'Open the Change Log Setup page.';
}
action("Change Log")
{
ApplicationArea = Basic, Suite;
Caption = 'Change Log Entries';
RunObject = page "Change Log Entries";
+ Tooltip = 'Open the Change Log Entries page.';
}
}
group("Group6")
@@ -252,12 +274,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Layout Selection';
RunObject = page "Report Layout Selection";
+ Tooltip = 'Open the Report Layout Selection page.';
}
action("Report Configuration")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Settings';
RunObject = page "Report Settings";
+ Tooltip = 'Open the Report Settings page.';
AccessByPermission = TableData "Object Options" = IMD;
}
action("Report Inbox")
@@ -265,6 +289,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Inbox';
RunObject = page "Report Inbox";
+ Tooltip = 'Open the Report Inbox page.';
}
#if not CLEAN28
action("Custom Report Layouts")
@@ -277,6 +302,7 @@ page 8900 "Administrator Main Role Center"
#pragma warning disable AL0432
RunObject = page "Custom Report Layouts";
#pragma warning restore AL0432
+ Tooltip = 'Open the Custom Report Layouts page.';
}
#endif
action("Report Selection Purchase")
@@ -284,30 +310,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Purchase';
RunObject = page "Report Selection - Purchase";
+ Tooltip = 'Open the Report Selections Purchase page.';
}
action("Report Selection Reminder and")
{
ApplicationArea = Suite;
Caption = 'Report Selections Reminder/Fin. Charge';
RunObject = page "Report Selection - Reminder";
+ Tooltip = 'Open the Report Selections Reminder/Fin. Charge page.';
}
action("Report Selection Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Sales';
RunObject = page "Report Selection - Sales";
+ Tooltip = 'Open the Report Selections Sales page.';
}
action("Report Selection - Bank Acc.")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Bank Account';
RunObject = page "Report Selection - Bank Acc.";
+ Tooltip = 'Open the Report Selections Bank Account page.';
}
action("Report Selections Inventory")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Inventory';
RunObject = page "Report Selection - Inventory";
+ Tooltip = 'Open the Report Selections Inventory page.';
}
}
group("Group7")
@@ -318,12 +349,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Test Tool';
RunObject = page "CAL Test Tool";
+ Tooltip = 'Open the Test Tool page.';
}
action("Code Coverage")
{
ApplicationArea = All;
Caption = 'Code Coverage';
RunObject = page "Code Coverage";
+ Tooltip = 'Open the Code Coverage page.';
}
// action("Sessions")
// {
@@ -351,54 +384,63 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Company Information';
RunObject = page "Company Information";
+ Tooltip = 'Open the Company Information page.';
}
action("Companies")
{
ApplicationArea = Basic, Suite;
Caption = 'Companies';
RunObject = page "Companies";
+ Tooltip = 'Open the Companies page.';
}
action("No. Series")
{
ApplicationArea = Basic, Suite;
Caption = 'No. Series';
RunObject = page "No. Series";
+ Tooltip = 'Open the No. Series page.';
}
action("Post Codes")
{
ApplicationArea = Basic, Suite;
Caption = 'Post Codes';
RunObject = page "Post Codes";
+ Tooltip = 'Open the Post Codes page.';
}
action("Territories")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Territories';
RunObject = page "Territories";
+ Tooltip = 'Open the Territories page.';
}
action("Languages")
{
ApplicationArea = Suite;
Caption = 'Languages';
RunObject = page "Languages";
+ Tooltip = 'Open the Languages page.';
}
action("Countries/Regions")
{
ApplicationArea = Basic, Suite;
Caption = 'Countries/Regions';
RunObject = page "Countries/Regions";
+ Tooltip = 'Open the Countries/Regions page.';
}
action("Base Calendar Entries Subform")
{
ApplicationArea = Basic, Suite;
Caption = 'Base Calendar';
RunObject = page "Base Calendar List";
+ Tooltip = 'Open the Base Calendar page.';
}
action("Responsibility Centers")
{
ApplicationArea = Basic, Suite;
Caption = 'Responsibility Centers';
RunObject = page "Responsibility Center List";
+ Tooltip = 'Open the Responsibility Centers page.';
}
}
group("Group10")
@@ -416,6 +458,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Data Classification Worksheet';
RunObject = page "Data Classification Worksheet";
+ Tooltip = 'Open the Data Classification Worksheet page.';
AccessByPermission = TableData "Data Sensitivity" = R;
}
action("Privacy for App Integrations")
@@ -430,12 +473,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'XML Schemas';
RunObject = page "XML Schemas";
+ Tooltip = 'Open the XML Schemas page.';
}
action("SEPA Schema Viewer")
{
ApplicationArea = Basic, Suite;
Caption = 'SEPA Schema Viewer';
RunObject = page "XML Schema Viewer";
+ Tooltip = 'Open the SEPA Schema Viewer page.';
}
}
group("Group11")
@@ -446,18 +491,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Data Migration Overview';
RunObject = page "Data Migration Overview";
+ Tooltip = 'Open the Data Migration Overview page.';
}
action("Data Migration")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Migration';
RunObject = page "Data Migration Wizard";
+ Tooltip = 'Open the Data Migration page.';
}
action("Data Migration Settings")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Migration Settings';
RunObject = page "Data Migration Settings";
+ Tooltip = 'Open the Data Migration Settings page.';
AccessByPermission = TableData "Data Migration Setup" = R;
}
}
@@ -469,24 +517,28 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Import from a Data File';
RunObject = page "Import Data";
+ Tooltip = 'Open the Import from a Data File page.';
}
action("Export to a Data File")
{
ApplicationArea = Basic, Suite;
Caption = 'Export to a Data File';
RunObject = page "Export Data";
+ Tooltip = 'Open the Export to a Data File page.';
}
action("Data Exchange Types")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Exchange Types';
RunObject = page "Data Exchange Types";
+ Tooltip = 'Open the Data Exchange Types page.';
}
action("Data Exchange Definition")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Exchange Definitions';
RunObject = page "Data Exch Def List";
+ Tooltip = 'Open the Data Exchange Definitions page.';
}
}
group("Group13")
@@ -500,18 +552,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Customers...';
RunObject = report "Create Conts. from Customers";
+ Tooltip = 'Run the Create Contacts from Customers report.';
}
action("Create Contacts from Vendors")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Vendors...';
RunObject = report "Create Conts. from Vendors";
+ Tooltip = 'Run the Create Contacts from Vendors report.';
}
action("Create Contacts from Bank Acco")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Bank Accounts...';
RunObject = report "Create Conts. from Bank Accs.";
+ Tooltip = 'Run the Create Contacts from Bank Accounts report.';
}
}
}
@@ -526,6 +581,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Date Compr. Registers';
RunObject = page "Date Compr. Registers";
+ Tooltip = 'Open the Date Compr. Registers page.';
}
}
group("Group17")
@@ -536,6 +592,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Delete Orphaned Record Links';
RunObject = codeunit "Remove Orphaned Record Links";
+ Tooltip = 'Run the Delete Orphaned Record Links codeunit.';
}
}
group("Group18")
@@ -546,12 +603,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Profile Customizations';
RunObject = page "Profile Customization List";
+ Tooltip = 'Open the Profile Customizations page.';
}
action("User Page Personalizations")
{
ApplicationArea = Basic, Suite;
Caption = 'User Page Personalizations';
RunObject = page "Personalized Pages";
+ Tooltip = 'Open the User Page Personalizations page.';
}
}
}
@@ -564,12 +623,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Users';
RunObject = page "Users";
+ Tooltip = 'Open the Users page.';
}
action("User Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'User Setup';
RunObject = page "User Setup";
+ Tooltip = 'Open the User Setup page.';
}
// action("Change Password")
// {
@@ -582,6 +643,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'User Security Status';
RunObject = page "User Security Status List";
+ Tooltip = 'Open the User Security Status page.';
AccessByPermission = TableData "User" = R;
}
action("User Tasks")
@@ -589,18 +651,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'User Tasks';
RunObject = page "User Task List";
+ Tooltip = 'Open the User Tasks page.';
}
action("User Personalization")
{
ApplicationArea = Basic, Suite;
Caption = 'User Settings';
RunObject = page "User Settings List";
+ Tooltip = 'Open the User Settings page.';
}
action("User Time Registers")
{
ApplicationArea = Basic, Suite;
Caption = 'Time Registers';
RunObject = page "User Time Registers";
+ Tooltip = 'Open the Time Registers page.';
}
}
group(Permissions)
@@ -642,30 +707,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflows';
RunObject = page "Workflows";
+ Tooltip = 'Open the Workflows page.';
}
action("Workflow User Group")
{
ApplicationArea = Suite;
Caption = 'Workflow User Groups';
RunObject = page "Workflow User Groups";
+ Tooltip = 'Open the Workflow User Groups page.';
}
action("Approval User Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Approval User Setup';
RunObject = page "Approval User Setup";
+ Tooltip = 'View or edit information about workflow users who are involved in approval processes, such as approval amount limits for specific types of requests and substitute approvers to whom approval requests are delegated when the original approver is absent.';
}
action("Incoming Documents Setup")
{
ApplicationArea = Suite;
Caption = 'Incoming Documents Setup';
RunObject = page "Incoming Documents Setup";
+ Tooltip = 'Open the Incoming Documents Setup page.';
}
action("Send Overdue Appr. Notif.")
{
ApplicationArea = Suite;
Caption = 'Send Overdue Approval Notifications';
RunObject = report "Send Overdue Appr. Notif.";
+ Tooltip = 'Run the Send Overdue Approval Notifications report.';
}
group("Group21")
{
@@ -675,12 +745,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflow Templates';
RunObject = page "Workflow Templates";
+ Tooltip = 'Open the Workflow Templates page.';
}
action("Workflow Categories")
{
ApplicationArea = Suite;
Caption = 'Workflow Categories';
RunObject = page "Workflow Categories";
+ Tooltip = 'Open the Workflow Categories page.';
}
}
group("Group22")
@@ -691,18 +763,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflow Event Hierarchies';
RunObject = page "Workflow Event Hierarchies";
+ Tooltip = 'Open the Workflow Event Hierarchies page.';
}
action("WF Event/Response Combinations")
{
ApplicationArea = Suite;
Caption = 'Workflow Event/Response Combinations';
RunObject = page "WF Event/Response Combinations";
+ Tooltip = 'Open the Workflow Event/Response Combinations page.';
}
action("Workflow - Table Relations")
{
ApplicationArea = Suite;
Caption = 'Workflow - Table Relations';
RunObject = page "Workflow - Table Relations";
+ Tooltip = 'Open the Workflow - Table Relations page.';
}
}
group("Group23")
@@ -713,18 +788,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Notification Setup';
RunObject = page "Notification Setup";
+ Tooltip = 'Open the Notification Setup page.';
}
action("Notification Entries")
{
ApplicationArea = Suite;
Caption = 'Notification Entries';
RunObject = page "Notification Entries";
+ Tooltip = 'Open the Notification Entries page.';
}
action("Sent Notification Entries")
{
ApplicationArea = Suite;
Caption = 'Sent Notification Entries';
RunObject = page "Sent Notification Entries";
+ Tooltip = 'Open the Sent Notification Entries page.';
}
}
group("Group24")
@@ -735,36 +813,42 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Approval Entries';
RunObject = page "Approval Entries";
+ Tooltip = 'Open the Approval Entries page.';
}
action("Posted Approval Entries")
{
ApplicationArea = Suite;
Caption = 'Posted Approval Entries';
RunObject = page "Posted Approval Entries";
+ Tooltip = 'Open the Posted Approval Entries page.';
}
action("Overdue Approval Entries")
{
ApplicationArea = Suite;
Caption = 'Overdue Approval Entries';
RunObject = page "Overdue Approval Entries";
+ Tooltip = 'Open the Overdue Approval Entries page.';
}
action("Restricted Records")
{
ApplicationArea = Suite;
Caption = 'Restricted Records';
RunObject = page "Restricted Records";
+ Tooltip = 'Open the Restricted Records page.';
}
action("Workflow Step Instances")
{
ApplicationArea = Suite;
Caption = 'Workflow Step Instances';
RunObject = page "Workflow Step Instances";
+ Tooltip = 'Open the Workflow Step Instances page.';
}
action("Archived Workflow Step Instances")
{
ApplicationArea = Suite;
Caption = 'Archived Workflow Step Instances';
RunObject = page "Archived WF Step Instances";
+ Tooltip = 'Open the Archived Workflow Step Instances page.';
}
}
group("Group26")
@@ -792,12 +876,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Web Services';
RunObject = page "Web Services";
+ Tooltip = 'Open the Web Services page.';
}
action("Microsoft Dynamics 365 Connection Setup")
{
ApplicationArea = Suite;
Caption = 'Microsoft Dynamics 365 Connection Setup';
RunObject = page "CRM Connection Setup";
+ Tooltip = 'Open the Microsoft Dynamics 365 Connection Setup page.';
AccessByPermission = TableData "CRM Connection Setup" = IM;
}
action("Email Account Setup")
@@ -813,66 +899,77 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'OCR Service Setup';
RunObject = page "OCR Service Setup";
+ Tooltip = 'Open the OCR Service Setup page.';
}
action("Currency Exchange Rate Services")
{
ApplicationArea = Suite;
Caption = 'Currency Exchange Rate Services';
RunObject = page "Curr. Exch. Rate Service List";
+ Tooltip = 'Open the Currency Exchange Rate Services page.';
}
action("Service Connections Overview")
{
ApplicationArea = Basic, Suite;
Caption = 'Service Connections';
RunObject = page "Service Connections";
+ Tooltip = 'Open the Service Connections page.';
}
action("Doc. Exch. Service Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Document Exchange Service Setup';
RunObject = page "Doc. Exch. Service Setup";
+ Tooltip = 'Open the Document Exchange Service Setup page.';
}
action("Integration Table Mappings")
{
ApplicationArea = Suite;
Caption = 'Integration Table Mappings';
RunObject = page "Integration Table Mapping List";
+ Tooltip = 'Open the Integration Table Mappings page.';
}
action("Integration Synchronization Jobs")
{
ApplicationArea = Suite;
Caption = 'Integration Synchronization Jobs';
RunObject = page "Integration Synch. Job List";
+ Tooltip = 'Open the Integration Synchronization Jobs page.';
}
action("Integration Synchronization Errors")
{
ApplicationArea = Suite;
Caption = 'Integration Synchronization Errors';
RunObject = page "Integration Synch. Error List";
+ Tooltip = 'Open the Integration Synchronization Errors page.';
}
action("Online Payments")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Services';
RunObject = page "Payment Services";
+ Tooltip = 'Open the Payment Services page.';
}
action("API Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'API Setup';
RunObject = page "API Setup";
+ Tooltip = 'Open the API Setup page.';
}
action("Account Schedule KPI Web Servi")
{
ApplicationArea = Basic, Suite;
Caption = 'Account Schedule KPI Web Service Setup';
RunObject = page "Acc. Sched. KPI Web Srv. Setup";
+ Tooltip = 'Open the Account Schedule KPI Web Service Setup page.';
}
action("Acc. Sched. KPI Web Service")
{
ApplicationArea = Basic, Suite;
Caption = 'Account Schedule KPI Web Service';
RunObject = page "Acc. Sched. KPI Web Service";
+ Tooltip = 'Open the Account Schedule KPI Web Service page.';
}
action("PAC Web Services")
{
@@ -979,48 +1076,56 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Configuration Questionnaire';
RunObject = page "Config. Questionnaire";
+ Tooltip = 'Open the Configuration Questionnaire page.';
}
action("Data Migration1")
{
ApplicationArea = Suite;
Caption = 'Configuration Packages';
RunObject = page "Config. Packages";
+ Tooltip = 'Open the Configuration Packages page.';
}
action("Setup Master Templates")
{
ApplicationArea = Basic, Suite;
Caption = 'Configuration Templates';
RunObject = page "Config. Template List";
+ Tooltip = 'Open the Configuration Templates page.';
}
action("Create G/L acc. Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create G/L Acc. Journal Lines';
RunObject = report "Create G/L Acc. Journal Lines";
+ Tooltip = 'Run the Create G/L Acc. Journal Lines report.';
}
action("Create Customer Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Customer Journal Lines';
RunObject = report "Create Customer Journal Lines";
+ Tooltip = 'Run the Create Customer Journal Lines report.';
}
action("Create Vendor Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Vendor Journal Lines';
RunObject = report "Create Vendor Journal Lines";
+ Tooltip = 'Run the Create Vendor Journal Lines report.';
}
action("Create Item Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Item Journal Lines';
RunObject = report "Create Item Journal Lines";
+ Tooltip = 'Run the Create Item Journal Lines report.';
}
action("Configuration Worksheet")
{
ApplicationArea = Suite;
Caption = 'Configuration Worksheet';
RunObject = page "Config. Worksheet";
+ Tooltip = 'Open the Configuration Worksheet page.';
}
}
}
diff --git a/src/Layers/NA/BaseApp/Sales/Customer/Customer.Table.al b/src/Layers/NA/BaseApp/Sales/Customer/Customer.Table.al
index 6100a9d911..fd1166fe71 100644
--- a/src/Layers/NA/BaseApp/Sales/Customer/Customer.Table.al
+++ b/src/Layers/NA/BaseApp/Sales/Customer/Customer.Table.al
@@ -2600,6 +2600,7 @@ table 18 Customer
UpdateReferencedIds();
SetLastModifiedDateTime();
if IsContactUpdateNeeded() then begin
+ OnBeforeModifyContactUpdate(Rec);
Modify();
UpdateContFromCust.OnModify(Rec);
if not Find() then begin
@@ -2609,6 +2610,11 @@ table 18 Customer
end;
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnBeforeModifyContactUpdate(var Customer: Record Customer)
+ begin
+ end;
+
trigger OnRename()
var
IsHandled: Boolean;
diff --git a/src/Layers/NA/BaseApp/Sales/Customer/CustomerBankAccount.Table.al b/src/Layers/NA/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
index c59e64ac32..055b4db0b6 100644
--- a/src/Layers/NA/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
+++ b/src/Layers/NA/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -484,4 +484,5 @@ table 287 "Customer Bank Account"
local procedure OnBeforeValidatePostCode(var CustomerBankAccount: Record "Customer Bank Account"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
begin
end;
+
}
diff --git a/src/Layers/NA/BaseApp/Sales/Customer/CustomerTempl.Table.al b/src/Layers/NA/BaseApp/Sales/Customer/CustomerTempl.Table.al
index 9d414ab6af..2967691995 100644
--- a/src/Layers/NA/BaseApp/Sales/Customer/CustomerTempl.Table.al
+++ b/src/Layers/NA/BaseApp/Sales/Customer/CustomerTempl.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -953,4 +953,5 @@ table 1381 "Customer Templ."
local procedure OnCopyTemplateOnBeforeModify(SourceCustomerTempl: Record "Customer Templ."; SavedCustomerTempl: Record "Customer Templ."; var CustomerTempl: Record "Customer Templ.")
begin
end;
+
}
diff --git a/src/Layers/NA/BaseApp/Sales/Document/SalesHeader.Table.al b/src/Layers/NA/BaseApp/Sales/Document/SalesHeader.Table.al
index d6fa4ba1a6..96f59c2c79 100644
--- a/src/Layers/NA/BaseApp/Sales/Document/SalesHeader.Table.al
+++ b/src/Layers/NA/BaseApp/Sales/Document/SalesHeader.Table.al
@@ -332,6 +332,7 @@ table 36 "Sales Header"
Validate("Payment Terms Code");
Validate("Prepmt. Payment Terms Code");
Validate("Payment Method Code");
+ OnAfterValidateBillToCustomerPaymentFields(Rec);
Validate("Prepayment %");
if (xRec."Sell-to Customer No." = "Sell-to Customer No.") and
@@ -8073,7 +8074,6 @@ table 36 "Sales Header"
"Responsibility Center" := UserSetupMgt.GetRespCenter(0, SellToCustomer."Responsibility Center");
OnCopySelltoCustomerAddressFieldsFromCustomerOnAfterAssignRespCenter(Rec, SellToCustomer, CurrFieldNo);
end;
-
IsHandled := false;
OnCopySellToCustomerAddressFieldsFromCustomerOnBeforeUpdateLocation(Rec, SellToCustomer, IsHandled);
if not IsHandled then
@@ -10670,6 +10670,11 @@ table 36 "Sales Header"
begin
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnAfterValidateBillToCustomerPaymentFields(var SalesHeader: Record "Sales Header")
+ begin
+ end;
+
///
/// Raised after extended text is transferred for sales line recreation.
///
diff --git a/src/Layers/NL/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al b/src/Layers/NL/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
index 3074b76b7b..2ad4139183 100644
--- a/src/Layers/NL/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
+++ b/src/Layers/NL/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
@@ -64,36 +64,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Salespeople")
{
ApplicationArea = Suite;
Caption = 'Salespeople/Purchasers';
RunObject = page "Salespersons/Purchasers";
+ Tooltip = 'Open the Salespeople/Purchasers page.';
}
action("Teams")
{
ApplicationArea = Basic, Suite;
Caption = 'Teams';
RunObject = page "Teams";
+ Tooltip = 'Open the Teams page.';
}
action("Tasks")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Opportunities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
group("Group1")
{
@@ -103,36 +109,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesBudget;
Caption = 'Sales Budgets';
RunObject = page "Budget Names Sales";
+ Tooltip = 'Open the Sales Budgets page.';
}
action("Sales Analysis Reports")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Reports';
RunObject = page "Analysis Report Sale";
+ Tooltip = 'Open the Sales Analysis Reports page.';
}
action("Sales Analysis by Dimensions")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Item Dimensions - Detail")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Detail';
RunObject = report "Item Dimensions - Detail";
+ Tooltip = 'Run the Item Dimensions - Detail report.';
}
action("Item Dimensions - Total")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Total';
RunObject = report "Item Dimensions - Total";
+ Tooltip = 'Run the Item Dimensions - Total report.';
}
action("Opportunities Matrix")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Analysis';
RunObject = page "Opportunities";
+ Tooltip = 'Open the Opportunity Analysis page.';
}
}
group("Group2")
@@ -143,6 +155,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Deferral Summary';
RunObject = report "Deferral Summary - Sales";
+ Tooltip = 'Run the Sales Deferral Summary report.';
}
group("Group3")
{
@@ -152,18 +165,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Tasks';
RunObject = report "Salesperson - Tasks";
+ Tooltip = 'Run the Salesperson Tasks report.';
}
action("Salesperson - Commission")
{
ApplicationArea = Suite;
Caption = 'Salesperson Commission';
RunObject = report "Salesperson - Commission";
+ Tooltip = 'Run the Salesperson Commission report.';
}
action("Salesperson - Opportunities")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Opportunities';
RunObject = report "Salesperson - Opportunities";
+ Tooltip = 'Run the Salesperson Opportunities report.';
}
#if not CLEAN28
action("Sales Statistics")
@@ -174,6 +190,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
#endif
action("Team - Tasks")
@@ -181,12 +198,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Team Tasks';
RunObject = report "Team - Tasks";
+ Tooltip = 'Run the Team Tasks report.';
}
action("Salesperson - Sales Statistics")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Sales Statistics';
RunObject = report "Salesperson - Sales Statistics";
+ Tooltip = 'Run the Salesperson Sales Statistics report.';
}
}
group("Group4")
@@ -197,36 +216,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Contact Labels';
RunObject = report "Contact - Labels";
+ Tooltip = 'Run the Contact Labels report.';
}
action("Contact - Company Summary")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact - Company Summary';
RunObject = report "Contact - Company Summary";
+ Tooltip = 'Run the Contact - Company Summary report.';
}
action("Questionnaire - Handouts")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire - Handouts';
RunObject = report "Questionnaire - Handouts";
+ Tooltip = 'Run the Questionnaire - Handouts report.';
}
action("Contact - List")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact List';
RunObject = report "Contact - List";
+ Tooltip = 'Run the Contact List report.';
}
action("Orgl. Profile Summary")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Person Summary';
RunObject = report "Contact - Person Summary";
+ Tooltip = 'Run the Contact - Person Summary report.';
}
action("Contact - Cover Sheet")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Cover Sheet';
RunObject = report "Contact - Cover Sheet";
+ Tooltip = 'Run the Contact - Cover Sheet report.';
}
}
group("Group5")
@@ -241,6 +266,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - List report.';
}
#endif
action("Customer - Labels")
@@ -248,36 +274,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Customer Labels';
RunObject = report "Customer - Labels";
+ Tooltip = 'Run the Customer Labels report.';
}
action("Customer - Balance to Date")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Balance to Date';
RunObject = report "Customer - Balance to Date";
+ Tooltip = 'Run the Customer - Balance to Date report.';
}
action("Customer - Order Summary")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Summary';
RunObject = report "Customer - Order Summary";
+ Tooltip = 'Run the Customer - Order Summary report.';
}
action("Customer/Item Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Item Sales';
RunObject = report "Customer/Item Sales";
+ Tooltip = 'Run the Customer/Item Sales report.';
}
action("Customer Register")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Register';
RunObject = report "Customer Register";
+ Tooltip = 'Run the Customer Register report.';
}
action("Customer - Order Detail")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Detail';
RunObject = report "Customer - Order Detail";
+ Tooltip = 'Run the Customer - Order Detail report.';
}
#if not CLEAN28
action("Customer - Top 10 List")
@@ -288,6 +320,7 @@ page 8907 "Sales & Marketing Manager RC"
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';
+ Tooltip = 'Run the Customer Top 10 List report.';
}
#endif
action("Customer - Trial Balance")
@@ -295,6 +328,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Trial Balance';
RunObject = report "Customer - Trial Balance";
+ Tooltip = 'Run the Customer Trial Balance report.';
}
#if not CLEAN28
action("Customer - Sales List")
@@ -305,6 +339,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
}
@@ -316,18 +351,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - List';
RunObject = report "Opportunity - List";
+ Tooltip = 'Run the Opportunity - List report.';
}
action("Opportunity - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - Details';
RunObject = report "Opportunity - Details";
+ Tooltip = 'Run the Opportunity - Details report.';
}
action("Sales Cycle - Analysis")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycle - Analysis';
RunObject = report "Sales Cycle - Analysis";
+ Tooltip = 'Run the Sales Cycle - Analysis report.';
}
}
}
@@ -340,66 +378,70 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts1")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Quotes")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quotes';
RunObject = page "Sales Quotes";
+ Tooltip = 'Open the Sales Quotes page.';
}
action("Orders")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Orders';
RunObject = page "Sales Order List";
+ Tooltip = 'Open the Sales Orders page.';
}
action("Blanket Orders")
{
ApplicationArea = Suite;
Caption = 'Blanket Sales Orders';
RunObject = page "Blanket Sales Orders";
+ Tooltip = 'Open the Blanket Sales Orders page.';
}
action("Return Orders")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Sales Return Orders';
RunObject = page "Sales Return Order List";
+ Tooltip = 'Open the Sales Return Orders page.';
}
action("Invoices")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Invoices';
RunObject = page "Sales Invoice List";
+ Tooltip = 'Open the Sales Invoices page.';
}
action("Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Credit Memos';
RunObject = page "Sales Credit Memos";
- }
- action("CMR - Sales Shipment")
- {
- ApplicationArea = Warehouse;
- Caption = 'CMR - Sales Shipment';
- RunObject = report "CMR - Sales Shipment";
+ Tooltip = 'Open the Sales Credit Memos page.';
}
action("Certificates of Supply")
{
ApplicationArea = Basic, Suite;
Caption = 'Certificates of Supply';
RunObject = page "Certificates of Supply";
+ Tooltip = 'Open the Certificates of Supply page.';
}
action("Order Planning")
{
ApplicationArea = Planning;
Caption = 'Order Planning';
RunObject = page "Order Planning";
+ Tooltip = 'Open the Order Planning page.';
}
group("Group8")
{
@@ -409,24 +451,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Invoices';
RunObject = page "Posted Sales Invoices";
+ Tooltip = 'Open the Posted Sales Invoices page.';
}
action("Posted Sales Shipments")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Shipments';
RunObject = page "Posted Sales Shipments";
+ Tooltip = 'Open the Posted Sales Shipments page.';
}
action("Posted Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Credit Memos';
RunObject = page "Posted Sales Credit Memos";
+ Tooltip = 'Open the Posted Sales Credit Memos page.';
}
action("Posted Return Receipts")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Posted Return Receipts';
RunObject = page "Posted Return Receipts";
+ Tooltip = 'Open the Posted Return Receipts page.';
}
}
group("Group9")
@@ -437,48 +483,56 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'G/L Registers';
RunObject = page "G/L Registers";
+ Tooltip = 'Open the G/L Registers page.';
}
action("Item Tracing")
{
ApplicationArea = ItemTracking;
Caption = 'Item Tracing';
RunObject = page "Item Tracing";
+ Tooltip = 'Open the Item Tracing page.';
}
action("Sales Quote Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quote Archives';
RunObject = page "Sales Quote Archives";
+ Tooltip = 'Open the Sales Quote Archives page.';
}
action("Sales Order Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Order Archives';
RunObject = page "Sales Order Archives";
+ Tooltip = 'Open the Sales Order Archives page.';
}
action("Sales Return Order Archives")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Return Order Archives';
RunObject = page "Sales Return List Archive";
+ Tooltip = 'Open the Sales Return Order Archives page.';
}
action("Customer Ledger Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Ledger Entries';
RunObject = page "Customer Ledger Entries";
+ Tooltip = 'Open the Customer Ledger Entries page.';
}
action("Detailed Cust. Ledg. Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Detailed Customer Ledger Entries';
RunObject = page "Detailed Cust. Ledg. Entries";
+ Tooltip = 'Open the Detailed Customer Ledger Entries page.';
}
action("Value Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Value Entries';
RunObject = page "Value Entries";
+ Tooltip = 'Open the Value Entries page.';
}
action("Navigate")
{
@@ -498,6 +552,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Detail';
RunObject = report "Customer - Order Detail";
+ Tooltip = 'Run the Customer - Order Detail report.';
}
#if not CLEAN28
action("Sales Reservation Avail.")
@@ -508,6 +563,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Reservation Avail. report.';
}
#endif
#if not CLEAN28
@@ -519,6 +575,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
#endif
#if not CLEAN28
@@ -530,6 +587,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
action("EC Sales List")
@@ -537,18 +595,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'EC Sales List';
RunObject = report "EC Sales List";
+ Tooltip = 'Run the EC Sales List report.';
}
action("Customer/Item Sales1")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Item Sales';
RunObject = report "Customer/Item Sales";
+ Tooltip = 'Run the Customer/Item Sales report.';
}
action("Customer - Order Summary1")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Summary';
RunObject = report "Customer - Order Summary";
+ Tooltip = 'Run the Customer - Order Summary report.';
}
}
}
@@ -560,42 +621,49 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Campaigns")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaigns';
RunObject = page "Campaign List";
+ Tooltip = 'Open the Campaigns page.';
}
action("Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Segments';
RunObject = page "Segment List";
+ Tooltip = 'Open the Segments page.';
}
action("Logged Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Logged Segments';
RunObject = page "Logged Segments";
+ Tooltip = 'Open the Logged Segments page.';
}
action("Opportunities1")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
action("Tasks1")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Campaign - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign - Details';
RunObject = report "Campaign - Details";
+ Tooltip = 'Run the Campaign - Details report.';
}
group("Group12")
{
@@ -605,18 +673,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Entries';
RunObject = page "Campaign Entries";
+ Tooltip = 'Open the Campaign Entries page.';
}
action("Opportunity Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Entries';
RunObject = page "Opportunity Entries";
+ Tooltip = 'Open the Opportunity Entries page.';
}
action("Interaction Log Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Log Entries';
RunObject = page "Interaction Log Entries";
+ Tooltip = 'Open the Interaction Log Entries page.';
}
}
}
@@ -628,18 +699,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Items';
RunObject = page "Item List";
+ Tooltip = 'Open the Items page.';
}
action("Nonstock Items")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Items';
RunObject = page "Catalog Item List";
+ Tooltip = 'Open the Nonstock Items page.';
}
action("Item Attributes")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Attributes';
RunObject = page "Item Attributes";
+ Tooltip = 'Open the Item Attributes page.';
}
action("Sales Price Worksheet")
{
@@ -653,6 +727,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Adjust Item Costs/Prices';
RunObject = report "Adjust Item Costs/Prices";
+ Tooltip = 'Run the Adjust Item Costs/Prices report.';
}
group("Group14")
{
@@ -662,42 +737,49 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Inventory Sales Statistics';
RunObject = report "Inventory - Sales Statistics";
+ Tooltip = 'Run the Inventory Sales Statistics report.';
}
action("Inventory Cost and Price List")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Cost and Price List';
RunObject = report "Inventory Cost and Price List";
+ Tooltip = 'Run the Inventory Cost and Price List report.';
}
action("Item Charges - Specification")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Charges - Specification';
RunObject = report "Item Charges - Specification";
+ Tooltip = 'Run the Item Charges - Specification report.';
}
action("Inventory - Customer Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Customer Sales';
RunObject = report "Inventory - Customer Sales";
+ Tooltip = 'Run the Inventory Customer Sales report.';
}
action("Nonstock Item Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Sales';
RunObject = report "Catalog Item Sales";
+ Tooltip = 'Run the Nonstock Item Sales report.';
}
action("Inventory Availability")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Availability';
RunObject = report "Inventory Availability";
+ Tooltip = 'Run the Inventory Availability report.';
}
action("Inventory Order Details")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Order Details';
RunObject = report "Inventory Order Details";
+ Tooltip = 'Run the Inventory Order Details report.';
}
action("Price List")
{
@@ -711,18 +793,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Inventory - Sales Back Orders';
RunObject = report "Inventory - Sales Back Orders";
+ Tooltip = 'Run the Inventory - Sales Back Orders report.';
}
action("Inventory - Top 10 List")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Top 10 List';
RunObject = report "Inventory - Top 10 List";
+ Tooltip = 'Run the Inventory Top 10 List report.';
}
action("Item Substitutions")
{
ApplicationArea = Suite;
Caption = 'Item Substitutions';
RunObject = report "Item Substitutions";
+ Tooltip = 'Run the Item Substitutions report.';
}
}
}
@@ -734,54 +819,63 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Orders - Dynamics 365 Sales';
RunObject = page "CRM Sales Order List";
+ Tooltip = 'Open the Sales Orders - Dynamics 365 Sales page.';
}
action("Quotes - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Quotes - Dynamics 365 Sales';
RunObject = page "CRM Sales Quote List";
+ Tooltip = 'Open the Quotes - Dynamics 365 Sales page.';
}
action("Cases - Dynamics 365 for Customer Service")
{
ApplicationArea = Suite;
Caption = 'Cases - Dynamics 365 for Customer Service';
RunObject = page "CRM Case List";
+ Tooltip = 'Open the Cases - Dynamics 365 for Customer Service page.';
}
action("Opportunities - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Opportunities - Dynamics 365 Sales';
RunObject = page "CRM Opportunity List";
+ Tooltip = 'Open the Opportunities - Dynamics 365 Sales page.';
}
action("Accounts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Accounts - Dynamics 365 Sales';
RunObject = page "CRM Account List";
+ Tooltip = 'Open the Accounts - Dynamics 365 Sales page.';
}
action("Transaction Currencies - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Transaction Currencies - Dynamics 365 Sales';
RunObject = page "CRM TransactionCurrency List";
+ Tooltip = 'Open the Transaction Currencies - Dynamics 365 Sales page.';
}
action("Unit Groups - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Unit Groups - Dynamics 365 Sales';
RunObject = page "CRM UnitGroup List";
+ Tooltip = 'Open the Unit Groups - Dynamics 365 Sales page.';
}
action("Products - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Products - Dynamics 365 Sales';
RunObject = page "CRM Product List";
+ Tooltip = 'Open the Products - Dynamics 365 Sales page.';
}
action("Contacts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Contacts - Dynamics 365 Sales';
RunObject = page "CRM Contact List";
+ Tooltip = 'Open the Contacts - Dynamics 365 Sales page.';
}
action("Records Skipped For Synchronization")
{
@@ -789,6 +883,7 @@ page 8907 "Sales & Marketing Manager RC"
Caption = 'Coupled Data Synchronization Errors';
RunObject = page "CRM Skipped Records";
AccessByPermission = TableData "CRM Integration Record" = R;
+ Tooltip = 'Open the Coupled Data Synchronization Errors page.';
}
}
group("Group16")
@@ -799,60 +894,70 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = OrderPromising;
Caption = 'Order Promising Setup';
RunObject = page "Order Promising Setup";
+ Tooltip = 'Open the Order Promising Setup page.';
}
action("Sales & Receivables Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales & Receivables Setup';
RunObject = page "Sales & Receivables Setup";
+ Tooltip = 'Open the Sales & Receivables Setup page.';
}
action("report Selection Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Sales';
RunObject = page "Report Selection - Sales";
+ Tooltip = 'Open the Report Selections Sales page.';
}
action("Standard Sales Codes")
{
ApplicationArea = Suite;
Caption = 'Standard Sales Codes';
RunObject = page "Standard Sales Codes";
+ Tooltip = 'Open the Standard Sales Codes page.';
}
action("Payment Terms")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Terms';
RunObject = page "Payment Terms";
+ Tooltip = 'Open the Payment Terms page.';
}
action("Payment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Methods';
RunObject = page "Payment Methods";
+ Tooltip = 'Open the Payment Methods page.';
}
action("Item Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Shipment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Shipment Methods';
RunObject = page "Shipment Methods";
+ Tooltip = 'Open the Shipment Methods page.';
}
action("Shipping Agents")
{
ApplicationArea = Suite;
Caption = 'Shipping Agents';
RunObject = page "Shipping Agents";
+ Tooltip = 'Open the Shipping Agents page.';
}
action("Return Reasons")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Return Reasons';
RunObject = page "Return Reasons";
+ Tooltip = 'Open the Return Reasons page.';
}
action("Customer Templates")
{
@@ -869,24 +974,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesAnalysis, PurchaseAnalysis, InventoryAnalysis;
Caption = 'Analysis Types';
RunObject = page "Analysis Types";
+ Tooltip = 'Open the Analysis Types page.';
}
action("Sales Analysis by Dimensions1")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Analysis Column Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Column Templates';
RunObject = report "Run Sales Analysis Col. Temp.";
+ Tooltip = 'Run the Sales Analysis Column Templates report.';
}
action("Analysis Line Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Line Templates';
RunObject = report "Run Sales Analysis Line Templ.";
+ Tooltip = 'Run the Sales Analysis Line Templates report.';
}
}
group("Group18")
@@ -897,12 +1006,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Price Groups';
RunObject = page "Customer Price Groups";
+ Tooltip = 'Open the Customer Price Groups page.';
}
action("Customer Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Discount Groups';
RunObject = page "Customer Disc. Groups";
+ Tooltip = 'Open the Customer Discount Groups page.';
}
}
group("Group19")
@@ -913,24 +1024,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Setup';
RunObject = page "Catalog Item Setup";
+ Tooltip = 'Open the Nonstock Item Setup page.';
}
action("Item Charges")
{
ApplicationArea = ItemCharges;
Caption = 'Item Charges';
RunObject = page "Item Charges";
+ Tooltip = 'Open the Item Charges page.';
}
action("Item Disc. Groups1")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Inventory Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Setup';
RunObject = page "Inventory Setup";
+ Tooltip = 'Open the Inventory Setup page.';
}
}
group("Group20")
@@ -941,96 +1056,112 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite, RelationshipMgmt;
Caption = 'Marketing Setup';
RunObject = page "Marketing Setup";
+ Tooltip = 'Open the Marketing Setup page.';
}
action("Interaction Template Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Template Setup';
RunObject = page "Interaction Template Setup";
+ Tooltip = 'Open the Interaction Template Setup page.';
}
action("Business Relations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Business Relations';
RunObject = page "Business Relations";
+ Tooltip = 'Open the Business Relations page.';
}
action("Industry Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Industry Groups';
RunObject = page "Industry Groups";
+ Tooltip = 'Open the Industry Groups page.';
}
action("Web Sources")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Web Sources';
RunObject = page "Web Sources";
+ Tooltip = 'Open the Web Sources page.';
}
action("Job Responsibilities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Job Responsibilities';
RunObject = page "Job Responsibilities";
+ Tooltip = 'Open the Job Responsibilities page.';
}
action("Organizational Levels")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Organizational Levels';
RunObject = page "Organizational Levels";
+ Tooltip = 'Open the Organizational Levels page.';
}
action("Interaction Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Groups';
RunObject = page "Interaction Groups";
+ Tooltip = 'Open the Interaction Groups page.';
}
action("Interaction Templates")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Templates';
RunObject = page "Interaction Templates";
+ Tooltip = 'Open the Interaction Templates page.';
}
action("Salutations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Salutations';
RunObject = page "Salutations";
+ Tooltip = 'Open the Salutations page.';
}
action("Mailing Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Mailing Groups';
RunObject = page "Mailing Groups";
+ Tooltip = 'Open the Mailing Groups page.';
}
action("Status")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Status';
RunObject = page "Campaign Status";
+ Tooltip = 'Open the Campaign Status page.';
}
action("Sales Cycles")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycles';
RunObject = page "Sales Cycles";
+ Tooltip = 'Open the Sales Cycles page.';
}
action("Close Opportunity Codes")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Close Opportunity Codes';
RunObject = page "Close Opportunity Codes";
+ Tooltip = 'Open the Close Opportunity Codes page.';
}
action("Questionnaire Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire Setup';
RunObject = page "Profile Questionnaires";
+ Tooltip = 'Open the Questionnaire Setup page.';
}
action("Activities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Activities';
RunObject = page "Activity List";
+ Tooltip = 'Open the Activities page.';
}
}
}
diff --git a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Account/GLAccount.Table.al b/src/Layers/NL/BaseApp/Finance/GeneralLedger/Account/GLAccount.Table.al
index fdd437cc19..53a27d3cce 100644
--- a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Account/GLAccount.Table.al
+++ b/src/Layers/NL/BaseApp/Finance/GeneralLedger/Account/GLAccount.Table.al
@@ -922,6 +922,14 @@ table 15 "G/L Account"
TableRelation = "IC G/L Account"."No.";
}
///
+ /// Excludes default account name description from journal entries when posting transactions.
+ ///
+ field(70; "Omit Default Descr. in Jnl."; Boolean)
+ {
+ Caption = 'Omit Default Descr. in Jnl.';
+ ToolTip = 'Specifies if the default description is automatically inserted in the Description field on journal lines created for this general ledger account.';
+ }
+ ///
/// Net change amount in source currency for the account within the specified date filters.
///
field(75; "Source Currency Net Change"; Decimal)
@@ -1058,10 +1066,6 @@ table 15 "G/L Account"
Caption = 'API Account Type';
Editable = false;
}
- field(11400; "Omit Default Descr. in Jnl."; Boolean)
- {
- Caption = 'Omit Default Descr. in Jnl.';
- }
}
keys
diff --git a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al b/src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al
index eacba81f46..a0319bb1e9 100644
--- a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al
+++ b/src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al
@@ -3840,52 +3840,6 @@ table 81 "Gen. Journal Line"
UpdateVendorNo();
end;
}
- field(11000000; "Transaction Mode Code"; Code[20])
- {
- Caption = 'Transaction Mode Code';
- TableRelation = if ("Account Type" = const(Customer)) "Transaction Mode".Code where("Account Type" = const(Customer))
- else
- if ("Account Type" = const(Vendor)) "Transaction Mode".Code where("Account Type" = const(Vendor))
- else
- if ("Account Type" = const(Employee)) "Transaction Mode".Code where("Account Type" = const(Employee))
- else
- if ("Bal. Account Type" = const(Customer)) "Transaction Mode".Code where("Account Type" = const(Customer))
- else
- if ("Bal. Account Type" = const(Vendor)) "Transaction Mode".Code where("Account Type" = const(Vendor))
- else
- if ("Bal. Account Type" = const(Employee)) "Transaction Mode".Code where("Account Type" = const(Employee));
-
- trigger OnValidate()
- var
- TrMode: Record "Transaction Mode";
- begin
- if "Transaction Mode Code" <> '' then begin
- case "Account Type" of
- "Account Type"::Customer:
- TrMode.Get(TrMode."Account Type"::Customer, "Transaction Mode Code");
- "Account Type"::Vendor:
- TrMode.Get(TrMode."Account Type"::Vendor, "Transaction Mode Code");
- "Account Type"::Employee:
- TrMode.Get(TrMode."Account Type"::Employee, "Transaction Mode Code");
- else
- case "Bal. Account Type" of
- "Bal. Account Type"::Customer:
- TrMode.Get(TrMode."Account Type"::Customer, "Transaction Mode Code");
- "Bal. Account Type"::Vendor:
- TrMode.Get(TrMode."Account Type"::Vendor, "Transaction Mode Code");
- "Bal. Account Type"::Employee:
- TrMode.Get(TrMode."Account Type"::Employee, "Transaction Mode Code");
- else
- Error(
- Text1000000, FieldCaption("Transaction Mode Code"), FieldCaption("Account Type"), FieldCaption("Bal. Account Type"));
- end;
- end;
-
- if TrMode."Payment Terms Code" <> '' then
- Validate("Payment Terms Code", TrMode."Payment Terms Code");
- end;
- end;
- }
}
keys
@@ -4123,7 +4077,6 @@ table 81 "Gen. Journal Line"
#pragma warning restore AA0470
#pragma warning restore AA0074
GLSetupRead: Boolean;
- Text1000000: Label '%1 can only be filled in when %2 %3 is equal to Customer or Vendor.';
ExportAgainQst: Label 'One or more of the selected lines have already been exported. Do you want to export them again?';
NothingToExportErr: Label 'There is nothing to export.';
NotExistErr: Label 'Document number %1 does not exist or is already closed.', Comment = '%1=Document number';
@@ -7288,7 +7241,6 @@ table 81 "Gen. Journal Line"
"Payment Reference" := PurchHeader."Vendor Invoice No.";
end;
"Payment Method Code" := PurchHeader."Payment Method Code";
- "Transaction Mode Code" := PurchHeader."Transaction Mode Code";
"Recipient Bank Account" := PurchHeader."Bank Account Code";
OnAfterCopyGenJnlLineFromPurchHeaderPayment(PurchHeader, Rec);
@@ -7384,7 +7336,6 @@ table 81 "Gen. Journal Line"
"Pmt. Discount Date" := SalesHeader."Pmt. Discount Date";
"Payment Discount %" := SalesHeader."Payment Discount %";
"Direct Debit Mandate ID" := SalesHeader."Direct Debit Mandate ID";
- "Transaction Mode Code" := SalesHeader."Transaction Mode Code";
"Recipient Bank Account" := SalesHeader."Bank Account Code";
OnAfterCopyGenJnlLineFromSalesHeaderPayment(SalesHeader, Rec);
@@ -7813,7 +7764,6 @@ table 81 "Gen. Journal Line"
CheckConfirmDifferentCustomerAndBillToCustomer(Cust, "Account No.");
OnGetCustomerAccountOnBeforeValidatePaymentTermsCode(Rec, Cust, HideValidationDialog);
Validate("Payment Terms Code");
- "Transaction Mode Code" := Cust."Transaction Mode Code";
CheckPaymentTolerance();
OnAfterAccountNoOnValidateGetCustomerAccount(Rec, Cust, CurrFieldNo);
@@ -7860,7 +7810,6 @@ table 81 "Gen. Journal Line"
ClearBalancePostingGroups();
CheckConfirmDifferentCustomerAndBillToCustomer(Cust, "Bal. Account No.");
Validate("Payment Terms Code");
- "Transaction Mode Code" := Cust."Transaction Mode Code";
CheckPaymentTolerance();
OnAfterAccountNoOnValidateGetCustomerBalAccount(Rec, Cust, CurrFieldNo);
@@ -7903,7 +7852,6 @@ table 81 "Gen. Journal Line"
ClearPostingGroups();
CheckConfirmDifferentVendorAndPayToVendor(Vend, "Account No.");
Validate("Payment Terms Code");
- "Transaction Mode Code" := Vend."Transaction Mode Code";
CheckPaymentTolerance();
OnAfterAccountNoOnValidateGetVendorAccount(Rec, Vend, CurrFieldNo);
@@ -7948,7 +7896,6 @@ table 81 "Gen. Journal Line"
Validate("Recipient Bank Account", Employee."No.");
"Posting Group" := Employee."Employee Posting Group";
SetSalespersonPurchaserCode(Employee."Salespers./Purch. Code", "Salespers./Purch. Code");
- "Transaction Mode Code" := Employee."Transaction Mode Code";
if not SetCurrencyCode("Bal. Account Type", "Bal. Account No.") then
"Currency Code" := Employee."Currency Code";
ClearPostingGroups();
@@ -7977,7 +7924,6 @@ table 81 "Gen. Journal Line"
ClearBalancePostingGroups();
CheckConfirmDifferentVendorAndPayToVendor(Vend, "Bal. Account No.");
Validate("Payment Terms Code");
- "Transaction Mode Code" := Vend."Transaction Mode Code";
CheckPaymentTolerance();
OnAfterAccountNoOnValidateGetVendorBalAccount(Rec, Vend, CurrFieldNo);
@@ -8007,7 +7953,6 @@ table 81 "Gen. Journal Line"
Validate("Recipient Bank Account", Employee."No.");
"Posting Group" := Employee."Employee Posting Group";
SetSalespersonPurchaserCode(Employee."Salespers./Purch. Code", "Salespers./Purch. Code");
- "Transaction Mode Code" := Employee."Transaction Mode Code";
if ("Account No." = '') or ("Account Type" = "Account Type"::"G/L Account") then
"Currency Code" := Employee."Currency Code";
ClearBalancePostingGroups();
diff --git a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/GenJournalTemplate.Table.al b/src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/GenJournalTemplate.Table.al
deleted file mode 100644
index 20a724b7d5..0000000000
--- a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/GenJournalTemplate.Table.al
+++ /dev/null
@@ -1,637 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Finance.GeneralLedger.Journal;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.Journal;
-using Microsoft.Bank.Statement;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Reports;
-using Microsoft.FixedAssets.FixedAsset;
-using Microsoft.FixedAssets.Journal;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Intercompany.Journal;
-using Microsoft.Intercompany.Partner;
-using Microsoft.Projects.Project.Journal;
-using Microsoft.Purchases.Vendor;
-using Microsoft.Sales.Customer;
-using System.Reflection;
-using System.Security.User;
-
-///
-/// Stores journal template definitions that control journal behavior, validation rules, and user interface features.
-/// Templates provide the framework for different types of journals with specialized functionality for specific business processes.
-///
-///
-/// Templates define default settings for journal batches including source codes, number series, posting reports, and page assignments.
-/// Key relationships: Used by Gen. Journal Batch for template-based configuration inheritance.
-/// Extensibility: Template types can be extended to support custom journal workflows and validation requirements.
-///
-table 80 "Gen. Journal Template"
-{
- Caption = 'Gen. Journal Template';
- LookupPageID = "General Journal Template List";
- ReplicateData = true;
- DataClassification = CustomerContent;
-
- fields
- {
- ///
- /// Unique identifier for the journal template used to reference and configure journal batches.
- ///
- field(1; Name; Code[10])
- {
- Caption = 'Name';
- ToolTip = 'Specifies the name of the journal template you are creating.';
- NotBlank = true;
- }
- ///
- /// Descriptive name for the journal template providing user-friendly identification.
- ///
- field(2; Description; Text[80])
- {
- Caption = 'Description';
- ToolTip = 'Specifies a brief description of the journal template you are creating.';
- }
- ///
- /// Report ID used for testing journal lines before posting to validate transactions.
- ///
- field(5; "Test Report ID"; Integer)
- {
- Caption = 'Test Report ID';
- ToolTip = 'Specifies the test report that is printed when you click Test Report.';
- TableRelation = AllObjWithCaption."Object ID" where("Object Type" = const(Report));
- }
- ///
- /// Page ID that defines the user interface for entering journal lines with this template.
- ///
- field(6; "Page ID"; Integer)
- {
- Caption = 'Page ID';
- ToolTip = 'Specifies the number of the page that is used to show the journal or worksheet that uses the template.';
- TableRelation = AllObjWithCaption."Object ID" where("Object Type" = const(Page));
-
- trigger OnValidate()
- begin
- if "Page ID" = 0 then
- Validate(Type);
- end;
- }
- ///
- /// Report ID for the posting report that prints after successful journal posting.
- ///
- field(7; "Posting Report ID"; Integer)
- {
- Caption = 'Posting Report ID';
- ToolTip = 'Specifies the posting report that is printed when you choose Post and Print.';
- TableRelation = AllObjWithCaption."Object ID" where("Object Type" = const(Report));
- }
- ///
- /// Indicates whether the posting report must be printed after journal posting.
- ///
- field(8; "Force Posting Report"; Boolean)
- {
- Caption = 'Force Posting Report';
- ToolTip = 'Specifies whether a report is printed automatically when you post.';
- }
- ///
- /// Template type that determines journal behavior and specialized functionality for different business scenarios.
- ///
- field(9; Type; Enum "Gen. Journal Template Type")
- {
- Caption = 'Type';
- ToolTip = 'Specifies the journal type.';
-
- trigger OnValidate()
- begin
- "Test Report ID" := REPORT::"General Journal - Test";
- "Posting Report ID" := REPORT::"G/L Register";
- SourceCodeSetup.Get();
- case Type of
- Type::General:
- begin
- "Source Code" := SourceCodeSetup."General Journal";
- "Page ID" := PAGE::"General Journal";
- end;
- Type::Sales:
- begin
- "Source Code" := SourceCodeSetup."Sales Journal";
- "Page ID" := PAGE::"Sales Journal";
- end;
- Type::Purchases:
- begin
- "Source Code" := SourceCodeSetup."Purchase Journal";
- "Page ID" := PAGE::"Purchase Journal";
- end;
- Type::"Cash Receipts":
- begin
- "Source Code" := SourceCodeSetup."Cash Receipt Journal";
- "Page ID" := PAGE::"Cash Receipt Journal";
- end;
- Type::Payments:
- begin
- "Source Code" := SourceCodeSetup."Payment Journal";
- "Page ID" := PAGE::"Payment Journal";
- end;
- Type::Assets:
- begin
- "Source Code" := SourceCodeSetup."Fixed Asset G/L Journal";
- "Page ID" := PAGE::"Fixed Asset G/L Journal";
- end;
- Type::Cash:
- begin
- "Source Code" := SourceCodeSetup."Cash Journal";
- "Page ID" := PAGE::"Cash Journal";
- "Posting Report ID" := REPORT::"CBG Posting - Test";
- "Test Report ID" := REPORT::"CBG Posting - Test";
- end;
- Type::Bank:
- begin
- "Source Code" := SourceCodeSetup."Bank Journal";
- "Page ID" := PAGE::"Bank/Giro Journal";
- "Posting Report ID" := REPORT::"CBG Posting - Test";
- "Test Report ID" := REPORT::"CBG Posting - Test";
- end;
- Type::Intercompany:
- begin
- "Source Code" := SourceCodeSetup."IC General Journal";
- "Page ID" := PAGE::"IC General Journal";
- end;
- Type::Jobs:
- begin
- "Source Code" := SourceCodeSetup."Job G/L Journal";
- "Page ID" := PAGE::"Job G/L Journal";
- end;
- end;
-
- if Recurring then
- "Page ID" := PAGE::"Recurring General Journal";
-
- OnAfterValidateType(Rec, SourceCodeSetup);
- end;
- }
- ///
- /// Source code automatically applied to all journal lines created with this template for audit tracking.
- ///
- field(10; "Source Code"; Code[10])
- {
- Caption = 'Source Code';
- ToolTip = 'Specifies the source code that specifies where the entry was created.';
- TableRelation = "Source Code";
-
- trigger OnValidate()
- begin
- GenJnlLine.SetRange("Journal Template Name", Name);
- GenJnlLine.ModifyAll("Source Code", "Source Code");
- Modify();
- end;
- }
- ///
- /// Default reason code applied to journal lines created with this template for transaction classification.
- ///
- field(11; "Reason Code"; Code[10])
- {
- Caption = 'Reason Code';
- ToolTip = 'Specifies the reason code, a supplementary source code that enables you to trace the entry.';
- TableRelation = "Reason Code";
- }
- ///
- /// Indicates whether this template is used for recurring journal entries with automated posting schedules.
- ///
- field(12; Recurring; Boolean)
- {
- Caption = 'Recurring';
- ToolTip = 'Specifies whether the journal template will be a recurring journal.';
-
- trigger OnValidate()
- begin
- Validate(Type);
- if Recurring then
- TestField("No. Series", '');
- end;
- }
- ///
- /// Display caption for the test report used with this journal template.
- ///
- field(15; "Test Report Caption"; Text[250])
- {
- CalcFormula = lookup(AllObjWithCaption."Object Caption" where("Object Type" = const(Report),
- "Object ID" = field("Test Report ID")));
- Caption = 'Test Report Caption';
- ToolTip = 'Specifies the name of the test report that is printed when you print a journal under this journal template.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Display caption for the page used for journal line entry with this template.
- ///
- field(16; "Page Caption"; Text[250])
- {
- CalcFormula = lookup(AllObjWithCaption."Object Caption" where("Object Type" = const(Page),
- "Object ID" = field("Page ID")));
- Caption = 'Page Caption';
- ToolTip = 'Specifies the displayed name of the journal or worksheet that uses the template.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Display caption for the posting report used with this journal template.
- ///
- field(17; "Posting Report Caption"; Text[250])
- {
- CalcFormula = lookup(AllObjWithCaption."Object Caption" where("Object Type" = const(Report),
- "Object ID" = field("Posting Report ID")));
- Caption = 'Posting Report Caption';
- ToolTip = 'Specifies the name of the report that is printed when you print the journal.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Requires journal documents to have balanced debit and credit amounts before posting.
- ///
- field(18; "Force Doc. Balance"; Boolean)
- {
- Caption = 'Force Doc. Balance';
- ToolTip = 'Specifies whether transactions that are posted in the general journal must balance by document number and document type, in addition to balancing by date.';
- InitValue = true;
- }
- ///
- /// Account type for the default balancing account used in journal lines created with this template.
- ///
- field(19; "Bal. Account Type"; Enum "Gen. Journal Account Type")
- {
- Caption = 'Bal. Account Type';
- ToolTip = 'Specifies the type of account that a balancing entry is posted to, such as BANK for a cash account.';
-
- trigger OnValidate()
- begin
- "Bal. Account No." := '';
- end;
- }
- ///
- /// Account number for the default balancing account used in journal lines created with this template.
- ///
- field(20; "Bal. Account No."; Code[20])
- {
- Caption = 'Bal. Account No.';
- ToolTip = 'Specifies the number of the general ledger, customer, vendor, or bank account that the balancing entry is posted to, such as a cash account for cash purchases.';
- TableRelation = if ("Bal. Account Type" = const("G/L Account")) "G/L Account"
- else
- if ("Bal. Account Type" = const(Customer)) Customer
- else
- if ("Bal. Account Type" = const(Vendor)) Vendor
- else
- if ("Bal. Account Type" = const("Bank Account")) "Bank Account"
- else
- if ("Bal. Account Type" = const("Fixed Asset")) "Fixed Asset"
- else
- if ("Bal. Account Type" = const("IC Partner")) "IC Partner";
-
- trigger OnValidate()
- begin
- if "Bal. Account Type" = "Bal. Account Type"::"G/L Account" then
- CheckGLAcc("Bal. Account No.");
- end;
- }
- ///
- /// Number series used for automatic document number assignment in journal lines.
- ///
- field(21; "No. Series"; Code[20])
- {
- Caption = 'No. Series';
- ToolTip = 'Specifies the number series from which entry or record numbers are assigned to new entries or records.';
- TableRelation = "No. Series";
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeNoSeriesValidate(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "No. Series" <> '' then begin
- if Recurring then
- Error(
- RecurringJnlFieldErr,
- FieldCaption("Posting No. Series"));
- if "No. Series" = "Posting No. Series" then
- "Posting No. Series" := '';
- end;
- end;
- }
- ///
- /// Number series used for posted document numbers after journal posting completion.
- ///
- field(22; "Posting No. Series"; Code[20])
- {
- Caption = 'Posting No. Series';
- ToolTip = 'Specifies the code for the number series that will be used to assign document numbers to ledger entries that are posted from journals using this template.';
- TableRelation = "No. Series";
-
- trigger OnValidate()
- begin
- if ("Posting No. Series" = "No. Series") and ("Posting No. Series" <> '') then
- FieldError("Posting No. Series", StrSubstNo(ValueNotAllowedFieldErr, "Posting No. Series"));
- end;
- }
- ///
- /// Automatically copies VAT posting setup from accounts to journal lines for VAT calculation.
- ///
- field(23; "Copy VAT Setup to Jnl. Lines"; Boolean)
- {
- Caption = 'Copy VAT Setup to Jnl. Lines';
- ToolTip = 'Specifies whether the program to calculate VAT for accounts and balancing accounts on the journal line of the selected journal template.';
- InitValue = true;
-
- trigger OnValidate()
- begin
- if "Copy VAT Setup to Jnl. Lines" <> xRec."Copy VAT Setup to Jnl. Lines" then begin
- GenJnlBatch.SetRange("Journal Template Name", Name);
- GenJnlBatch.ModifyAll("Copy VAT Setup to Jnl. Lines", "Copy VAT Setup to Jnl. Lines");
- end;
- end;
- }
- ///
- /// Allows manual adjustment of VAT amounts in journal lines when posting with this template.
- ///
- field(24; "Allow VAT Difference"; Boolean)
- {
- Caption = 'Allow VAT Difference';
- ToolTip = 'Specifies whether to allow the manual adjustment of VAT amounts in journals.';
-
- trigger OnValidate()
- begin
- if "Allow VAT Difference" <> xRec."Allow VAT Difference" then begin
- GenJnlBatch.SetRange("Journal Template Name", Name);
- GenJnlBatch.ModifyAll("Allow VAT Difference", "Allow VAT Difference");
- end;
- end;
- }
- ///
- /// Report ID for customer receipt reports generated from journal postings with this template.
- ///
- field(25; "Cust. Receipt Report ID"; Integer)
- {
- AccessByPermission = TableData Customer = R;
- Caption = 'Cust. Receipt Report ID';
- ToolTip = 'Specifies how to print customer receipts when you post.';
- TableRelation = AllObjWithCaption."Object ID" where("Object Type" = const(Report));
- }
- ///
- /// Display caption for the customer receipt report used with this journal template.
- ///
- field(26; "Cust. Receipt Report Caption"; Text[250])
- {
- AccessByPermission = TableData Customer = R;
- CalcFormula = lookup(AllObjWithCaption."Object Caption" where("Object Type" = const(Report),
- "Object ID" = field("Cust. Receipt Report ID")));
- Caption = 'Cust. Receipt Report Caption';
- ToolTip = 'Specifies how to print customer receipts when you post.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Report ID for vendor receipt reports generated from journal postings with this template.
- ///
- field(27; "Vendor Receipt Report ID"; Integer)
- {
- AccessByPermission = TableData Vendor = R;
- Caption = 'Vendor Receipt Report ID';
- ToolTip = 'Specifies how to print vendor receipts when you post.';
- TableRelation = AllObjWithCaption."Object ID" where("Object Type" = const(Report));
- }
- ///
- /// Display caption for the vendor receipt report used with this journal template.
- ///
- field(28; "Vendor Receipt Report Caption"; Text[250])
- {
- AccessByPermission = TableData Vendor = R;
- CalcFormula = lookup(AllObjWithCaption."Object Caption" where("Object Type" = const(Report),
- "Object ID" = field("Vendor Receipt Report ID")));
- Caption = 'Vendor Receipt Report Caption';
- ToolTip = 'Specifies how to print vendor receipts when you post.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Automatically increments batch names when creating new batches with this template.
- ///
- field(30; "Increment Batch Name"; Boolean)
- {
- Caption = 'Increment Batch Name';
- ToolTip = 'Specifies if batch names using this template are automatically incremented. Example: The posting following BATCH001 is automatically named BATCH002.';
- }
- ///
- /// Creates copies of posted journal lines in the Posted General Journal Line table for audit history.
- ///
- field(31; "Copy to Posted Jnl. Lines"; Boolean)
- {
- Caption = 'Copy to Posted Jnl. Lines';
- ToolTip = 'Specifies whether the journal lines to be copied to posted journal lines of the selected journal template.';
-
- trigger OnValidate()
- begin
- if "Copy to Posted Jnl. Lines" <> xRec."Copy to Posted Jnl. Lines" then begin
- TestField(Recurring, false);
- GenJnlBatch.SetRange("Journal Template Name", Name);
- GenJnlBatch.ModifyAll("Copy to Posted Jnl. Lines", "Copy to Posted Jnl. Lines");
- end;
- end;
- }
- ///
- /// Start date for allowable posting dates when using this journal template.
- ///
- field(32; "Allow Posting Date From"; Date)
- {
- Caption = 'Allow Posting Date From';
- ToolTip = 'Specifies the earliest date when posting to the journal template is allowed.';
-
- trigger OnValidate()
- begin
- if xRec."Allow Posting Date From" <> Rec."Allow Posting Date From" then begin
- if Rec."Allow Posting Date From" <> 0D then
- Evaluate(Rec."Allow Posting From DateFormula", '');
-
- CheckDateRange();
- end;
- end;
- }
- ///
- /// End date for allowable posting dates when using this journal template.
- ///
- field(33; "Allow Posting Date To"; Date)
- {
- Caption = 'Allow Posting Date To';
- ToolTip = 'Specifies the last date when posting to the journal template is allowed.';
-
- trigger OnValidate()
- begin
- if xRec."Allow Posting Date To" <> Rec."Allow Posting Date To" then begin
- if Rec."Allow Posting Date To" <> 0D then
- Evaluate(Rec."Allow Posting To DateFormula", '');
-
- CheckDateRange();
- end;
- end;
- }
- ///
- /// Automatically unlinks incoming documents from journal lines when posting for document workflow management.
- ///
- field(34; "Unlink Inc. Doc On Posting"; Boolean)
- {
- Caption = 'Unlink Incoming Documents On Posting';
- ToolTip = 'Specifies whether the the incoming document will be unlinked from the journal when it is posted.';
-
- trigger OnValidate()
- begin
- if "Unlink Inc. Doc On Posting" then
- TestField(Recurring);
- end;
- }
- field(35; "Allow Posting From DateFormula"; DateFormula)
- {
- Caption = 'Allow Posting From Date Formula';
-
- trigger OnValidate()
- begin
- if xRec."Allow Posting From DateFormula" <> Rec."Allow Posting From DateFormula" then begin
- if Format(Rec."Allow Posting From DateFormula") <> '' then
- Rec.Validate("Allow Posting Date From", 0D);
-
- CheckDateRange();
- end;
- end;
- }
- field(36; "Allow Posting To DateFormula"; DateFormula)
- {
- Caption = 'Allow Posting To Date Formula';
-
- trigger OnValidate()
- begin
- if xRec."Allow Posting To DateFormula" <> Rec."Allow Posting To DateFormula" then begin
- if Format(Rec."Allow Posting To DateFormula") <> '' then
- Rec.Validate("Allow Posting Date To", 0D);
-
- CheckDateRange();
- end;
- end;
- }
- field(11402; "No. of CBG Statements"; Integer)
- {
- CalcFormula = count("CBG Statement" where("Journal Template Name" = field(Name)));
- Caption = 'No. of CBG Statements';
- Editable = false;
- FieldClass = FlowField;
- }
- }
-
- keys
- {
- key(Key1; Name)
- {
- Clustered = true;
- }
- key(Key2; Type, "Bal. Account Type", "Bal. Account No.")
- {
- }
- key(Key3; Type, Recurring, "No. Series")
- {
- }
- }
-
- fieldgroups
- {
- fieldgroup(DropDown; Name, Description, Type)
- {
- }
- }
-
- trigger OnDelete()
- begin
- GenJnlAlloc.SetRange("Journal Template Name", Name);
- GenJnlAlloc.DeleteAll();
- GenJnlLine.SetRange("Journal Template Name", Name);
- GenJnlLine.DeleteAll(true);
- GenJnlBatch.SetRange("Journal Template Name", Name);
- GenJnlBatch.DeleteAll();
- end;
-
- trigger OnInsert()
- begin
- Validate("Page ID");
- end;
-
- var
- GenJnlBatch: Record "Gen. Journal Batch";
- GenJnlLine: Record "Gen. Journal Line";
- GenJnlAlloc: Record "Gen. Jnl. Allocation";
- SourceCodeSetup: Record "Source Code Setup";
- RecurringJnlFieldErr: Label 'Only the %1 field can be filled in on recurring journals.', comment = '%1 = a field name';
- ValueNotAllowedFieldErr: Label 'must not be %1', comment = '%1 = a field value';
-
- local procedure CheckGLAcc(AccNo: Code[20])
- var
- GLAcc: Record "G/L Account";
- begin
- if AccNo <> '' then begin
- GLAcc.Get(AccNo);
- GLAcc.CheckGLAcc();
- GLAcc.TestField("Direct Posting", true);
- end;
-
- OnAfterCheckGLAcc(Rec, GLAcc);
- end;
-
- local procedure CheckDateRange()
- var
- UserSetupManagement: Codeunit "User Setup Management";
- AllowedFrom: Date;
- AllowedTo: Date;
- begin
- AllowedFrom := Rec."Allow Posting Date From";
- AllowedTo := Rec."Allow Posting Date To";
- UserSetupManagement.GetDateRange(
- AllowedFrom, AllowedTo,
- Rec."Allow Posting From DateFormula", Rec."Allow Posting To DateFormula",
- Rec.RecordId());
- end;
-
- ///
- /// Integration event that occurs after validating the journal template type.
- /// Allows customization of template behavior based on type changes and source code setup configuration.
- ///
- /// The journal template record being validated.
- /// Source code setup record containing configuration for source codes.
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateType(var GenJournalTemplate: Record "Gen. Journal Template"; SourceCodeSetup: Record "Source Code Setup")
- begin
- end;
-
- ///
- /// Integration event that occurs before validating number series configuration for the journal template.
- /// Allows custom handling of number series validation logic and error prevention.
- ///
- /// The journal template record with number series being validated.
- /// Set to true to skip standard validation processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeNoSeriesValidate(var GenJournalTemplate: Record "Gen. Journal Template"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Integration event that occurs after checking G/L Account configuration for the journal template.
- /// Allows additional validation or processing based on the associated G/L Account settings.
- ///
- /// The journal template record being checked.
- /// The G/L Account record associated with the template for validation.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckGLAcc(var GenJournalTemplate: Record "Gen. Journal Template"; GLAccount: Record "G/L Account")
- begin
- end;
-}
-
diff --git a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/GenJournalTemplateType.Enum.al b/src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/GenJournalTemplateType.Enum.al
deleted file mode 100644
index 29cda080bf..0000000000
--- a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/GenJournalTemplateType.Enum.al
+++ /dev/null
@@ -1,80 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Finance.GeneralLedger.Journal;
-
-///
-/// Defines the types of journal templates that determine journal behavior, validation rules, and available functionality.
-/// Each template type provides specialized features for different business transaction scenarios.
-///
-enum 89 "Gen. Journal Template Type"
-{
- Extensible = true;
- AssignmentCompatibility = true;
-
- ///
- /// General template type for all-purpose journal entries with full flexibility.
- ///
- value(0; General)
- {
- Caption = 'General';
- }
- ///
- /// Sales template type optimized for customer-related transactions and receivables.
- ///
- value(1; Sales)
- {
- Caption = 'Sales';
- }
- ///
- /// Purchases template type optimized for vendor-related transactions and payables.
- ///
- value(2; Purchases)
- {
- Caption = 'Purchases';
- }
- ///
- /// Cash receipts template type specialized for incoming payment transactions.
- ///
- value(3; "Cash Receipts")
- {
- Caption = 'Cash Receipts';
- }
- ///
- /// Payments template type specialized for outgoing payment transactions.
- ///
- value(4; Payments)
- {
- Caption = 'Payments';
- }
- ///
- /// Assets template type specialized for fixed asset transactions and depreciation.
- ///
- value(5; Assets)
- {
- Caption = 'Assets';
- }
- ///
- /// Intercompany template type for transactions between related companies.
- ///
- value(6; Intercompany)
- {
- Caption = 'Intercompany';
- }
- ///
- /// Projects template type for project-related financial transactions and cost tracking.
- ///
- value(7; Jobs)
- {
- Caption = 'Projects';
- }
- value(11; Cash)
- {
- Caption = 'Cash';
- }
- value(12; Bank)
- {
- Caption = 'Bank';
- }
-}
diff --git a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/GeneralJournal.Page.al b/src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/GeneralJournal.Page.al
index 4b873ea429..3a4e3313d3 100644
--- a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/GeneralJournal.Page.al
+++ b/src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/GeneralJournal.Page.al
@@ -576,16 +576,6 @@ page 39 "General Journal"
ToolTip = 'Specifies the reason code that has been entered on the journal lines.';
Visible = false;
}
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the transaction mode used in telebanking.';
- }
- field("Recipient Bank Account"; Rec."Recipient Bank Account")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the bank account that the amount will be transferred to after it has been exported from the payment journal.';
- }
field(Correction; Rec.Correction)
{
ApplicationArea = Basic, Suite;
diff --git a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/PostedGenJournalLine.Table.al b/src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/PostedGenJournalLine.Table.al
deleted file mode 100644
index 9fdf884d46..0000000000
--- a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Journal/PostedGenJournalLine.Table.al
+++ /dev/null
@@ -1,1894 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Finance.GeneralLedger.Journal;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.Check;
-using Microsoft.Bank.DirectDebit;
-using Microsoft.Bank.Payment;
-using Microsoft.CRM.Campaign;
-using Microsoft.CRM.Team;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Consolidation;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Deferral;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Ledger;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.SalesTax;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.FixedAssets.Depreciation;
-using Microsoft.FixedAssets.FixedAsset;
-using Microsoft.FixedAssets.Insurance;
-using Microsoft.FixedAssets.Journal;
-using Microsoft.FixedAssets.Ledger;
-using Microsoft.FixedAssets.Maintenance;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.Enums;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Foundation.PaymentTerms;
-using Microsoft.Foundation.UOM;
-using Microsoft.HumanResources.Employee;
-using Microsoft.Intercompany.BankAccount;
-using Microsoft.Intercompany.GLAccount;
-using Microsoft.Intercompany.Journal;
-using Microsoft.Intercompany.Partner;
-using Microsoft.Intercompany.Setup;
-using Microsoft.Projects.Project.Job;
-using Microsoft.Purchases.Vendor;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.History;
-using System.IO;
-using System.Threading;
-
-///
-/// Table storing historical records of posted general journal lines for audit trail and reference purposes.
-/// Maintains complete transaction history including account details, amounts, dimensions, and posting information.
-///
-///
-/// Archive table for posted general journal transactions providing comprehensive audit trail functionality.
-/// Contains complete transaction details including account information, amounts, dimensions, VAT, and posting metadata.
-/// Key features: Historical transaction tracking, audit trail compliance, transaction reconstruction capability.
-/// Integration: Links to ledger entries via transaction numbers, maintains posting batch relationships.
-///
-table 181 "Posted Gen. Journal Line"
-{
- Caption = 'Posted Gen. Journal Line';
- LookupPageId = "Posted General Journal";
- DrillDownPageId = "Posted General Journal";
- DataClassification = CustomerContent;
-
- fields
- {
- ///
- /// Journal template name that defined the original journal's behavior and validation rules.
- ///
- field(1; "Journal Template Name"; Code[10])
- {
- Caption = 'Journal Template Name';
- ToolTip = 'Specifies the name of the journal template.';
- }
- ///
- /// Original line number from the general journal line before posting.
- ///
- field(2; "Line No."; Integer)
- {
- Caption = 'Line No.';
- AutoIncrement = true;
- }
- ///
- /// Account type that was posted (G/L Account, Customer, Vendor, Bank Account, etc.).
- ///
- field(3; "Account Type"; Enum "Gen. Journal Account Type")
- {
- Caption = 'Account Type';
- ToolTip = 'Specifies the type of account that the entry on the journal line will be posted to.';
- }
- ///
- /// Account number that was posted to in the original journal transaction.
- ///
- field(4; "Account No."; Code[20])
- {
- Caption = 'Account No.';
- ToolTip = 'Specifies the account number that the entry on the journal line will be posted to.';
- TableRelation = if ("Account Type" = const("G/L Account")) "G/L Account" where("Account Type" = const(Posting),
- Blocked = const(false))
- else
- if ("Account Type" = const(Customer)) Customer
- else
- if ("Account Type" = const(Vendor)) Vendor
- else
- if ("Account Type" = const("Bank Account")) "Bank Account"
- else
- if ("Account Type" = const("Fixed Asset")) "Fixed Asset"
- else
- if ("Account Type" = const("IC Partner")) "IC Partner"
- else
- if ("Account Type" = const(Employee)) Employee;
- }
- ///
- /// Date when the journal line was posted to the ledgers.
- ///
- field(5; "Posting Date"; Date)
- {
- Caption = 'Posting Date';
- ToolTip = 'Specifies the entry''s posting date.';
- ClosingDates = true;
- }
- ///
- /// Document type of the posted transaction (Invoice, Payment, Credit Memo, etc.).
- ///
- field(6; "Document Type"; Enum "Gen. Journal Document Type")
- {
- Caption = 'Document Type';
- ToolTip = 'Specifies the type of document that the entry on the journal line is.';
- }
- ///
- /// Document number of the posted transaction for reference and tracking.
- ///
- field(7; "Document No."; Code[20])
- {
- Caption = 'Document No.';
- ToolTip = 'Specifies a document number for the journal line.';
- }
- ///
- /// Description text from the original journal line explaining the transaction purpose.
- ///
- field(8; Description; Text[100])
- {
- Caption = 'Description';
- ToolTip = 'Specifies a description of the entry.';
- }
- ///
- /// VAT percentage rate applied to the posted transaction amount.
- ///
- field(10; "VAT %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'VAT %';
- DecimalPlaces = 0 : 5;
- Editable = false;
- MaxValue = 100;
- MinValue = 0;
- }
- ///
- /// Balancing account number used in the posted journal transaction.
- ///
- field(11; "Bal. Account No."; Code[20])
- {
- Caption = 'Bal. Account No.';
- ToolTip = 'Specifies the number of the general ledger, customer, vendor, or bank account to which a balancing entry for the journal line will posted (for example, a cash account for cash purchases).';
- TableRelation = if ("Bal. Account Type" = const("G/L Account")) "G/L Account" where("Account Type" = const(Posting),
- Blocked = const(false))
- else
- if ("Bal. Account Type" = const(Customer)) Customer
- else
- if ("Bal. Account Type" = const(Vendor)) Vendor
- else
- if ("Bal. Account Type" = const("Bank Account")) "Bank Account"
- else
- if ("Bal. Account Type" = const("Fixed Asset")) "Fixed Asset"
- else
- if ("Bal. Account Type" = const("IC Partner")) "IC Partner"
- else
- if ("Bal. Account Type" = const(Employee)) Employee;
- }
- ///
- /// Currency code of the posted transaction amount.
- ///
- field(12; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- ToolTip = 'Specifies the code of the currency for the amounts on the journal line.';
- TableRelation = Currency;
- }
- ///
- /// Transaction amount in the specified currency (positive for debits, negative for credits).
- ///
- field(13; Amount; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Amount';
- ToolTip = 'Specifies the total amount (including VAT) that the journal line consists of.';
- }
- ///
- /// Debit amount of the posted transaction (always positive when displayed).
- ///
- field(14; "Debit Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- BlankZero = true;
- Caption = 'Debit Amount';
- ToolTip = 'Specifies the total amount (including VAT) that the journal line consists of, if it is a debit amount.';
- }
- ///
- /// Credit amount for the posted transaction when using debit/credit presentation.
- ///
- field(15; "Credit Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- BlankZero = true;
- Caption = 'Credit Amount';
- ToolTip = 'Specifies the total amount (including VAT) that the journal line consists of, if it is a credit amount.';
- }
- ///
- /// Transaction amount converted to local currency using posting date exchange rate.
- ///
- field(16; "Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Amount (LCY)';
- }
- ///
- /// Running balance in local currency after posting this transaction.
- ///
- field(17; "Balance (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Balance (LCY)';
- Editable = false;
- }
- ///
- /// Exchange rate factor used for currency conversion at posting time.
- ///
- field(18; "Currency Factor"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Currency Factor';
- DecimalPlaces = 0 : 15;
- Editable = false;
- MinValue = 0;
- }
- ///
- /// Sales or purchase amount in local currency for statistical reporting.
- ///
- field(19; "Sales/Purch. (LCY)"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- Caption = 'Sales/Purch. (LCY)';
- }
- ///
- /// Calculated profit amount in local currency for financial analysis.
- ///
- field(20; "Profit (LCY)"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- Caption = 'Profit (LCY)';
- }
- ///
- /// Invoice discount amount in local currency applied during posting.
- ///
- field(21; "Inv. Discount (LCY)"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- Caption = 'Inv. Discount (LCY)';
- }
- ///
- /// Bill-to customer number or pay-to vendor number for transaction tracking.
- ///
- field(22; "Bill-to/Pay-to No."; Code[20])
- {
- Caption = 'Bill-to/Pay-to No.';
- Editable = false;
- TableRelation = if ("Account Type" = const(Customer)) Customer
- else
- if ("Bal. Account Type" = const(Customer)) Customer
- else
- if ("Account Type" = const(Vendor)) Vendor
- else
- if ("Bal. Account Type" = const(Vendor)) Vendor;
- }
- ///
- /// Posting group used for G/L account determination (Customer, Vendor, or Fixed Asset).
- ///
- field(23; "Posting Group"; Code[20])
- {
- Caption = 'Posting Group';
- Editable = false;
- TableRelation = if ("Account Type" = const(Customer)) "Customer Posting Group"
- else
- if ("Account Type" = const(Vendor)) "Vendor Posting Group"
- else
- if ("Account Type" = const("Fixed Asset")) "FA Posting Group";
- }
- ///
- /// Global dimension 1 code for reporting and analysis purposes.
- ///
- field(24; "Shortcut Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,2,1';
- Caption = 'Shortcut Dimension 1 Code';
- 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.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1),
- Blocked = const(false));
- }
- ///
- /// Global dimension 2 code for reporting and analysis purposes.
- ///
- field(25; "Shortcut Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,2,2';
- Caption = 'Shortcut Dimension 2 Code';
- 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.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2),
- Blocked = const(false));
- }
- ///
- /// Salesperson or purchaser code associated with the transaction.
- ///
- field(26; "Salespers./Purch. Code"; Code[20])
- {
- Caption = 'Salespers./Purch. Code';
- TableRelation = "Salesperson/Purchaser";
- }
- ///
- /// Source code identifying the origin of the posted transaction.
- ///
- field(29; "Source Code"; Code[10])
- {
- Caption = 'Source Code';
- Editable = false;
- TableRelation = "Source Code";
- }
- ///
- /// Indicates whether the entry was created automatically by the system.
- ///
- field(30; "System-Created Entry"; Boolean)
- {
- Caption = 'System-Created Entry';
- Editable = false;
- }
- ///
- /// Hold code preventing payment processing for this transaction.
- ///
- field(34; "On Hold"; Code[3])
- {
- Caption = 'On Hold';
- }
- ///
- /// Document type of the entry that was applied for payment settlement in the posted transaction.
- ///
- field(35; "Applies-to Doc. Type"; Enum "Gen. Journal Document Type")
- {
- Caption = 'Applies-to Doc. Type';
- }
- ///
- /// Document number of the entry that was applied for payment settlement in the posted transaction.
- ///
- field(36; "Applies-to Doc. No."; Code[20])
- {
- Caption = 'Applies-to Doc. No.';
- }
- ///
- /// Payment due date for the posted transaction.
- ///
- field(38; "Due Date"; Date)
- {
- Caption = 'Due Date';
- }
- ///
- /// Date until which payment discount can be taken.
- ///
- field(39; "Pmt. Discount Date"; Date)
- {
- Caption = 'Pmt. Discount Date';
- }
- ///
- /// Payment discount percentage available for early payment.
- ///
- field(40; "Payment Discount %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Payment Discount %';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
- }
- ///
- /// Project number for project-related transactions and cost allocation.
- ///
- field(42; "Job No."; Code[20])
- {
- Caption = 'Project No.';
- TableRelation = Job;
- }
- ///
- /// Quantity associated with the posted transaction for unit-based calculations and reporting.
- ///
- field(43; Quantity; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Quantity';
- ToolTip = 'Specifies the quantity of items to be included on the journal line.';
- DecimalPlaces = 0 : 5;
- }
- ///
- /// VAT amount calculated and posted for the transaction.
- ///
- field(44; "VAT Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'VAT Amount';
- ToolTip = 'Specifies the amount of VAT included in the total amount.';
- }
- ///
- /// VAT posting method used (Automatic or Manual VAT Entry).
- ///
- field(45; "VAT Posting"; Option)
- {
- Caption = 'VAT Posting';
- Editable = false;
- OptionCaption = 'Automatic VAT Entry,Manual VAT Entry';
- OptionMembers = "Automatic VAT Entry","Manual VAT Entry";
- }
- ///
- /// Payment terms code defining payment conditions for the transaction.
- ///
- field(47; "Payment Terms Code"; Code[10])
- {
- Caption = 'Payment Terms Code';
- TableRelation = "Payment Terms";
- }
- ///
- /// Application identifier for grouping entries that apply to each other.
- ///
- field(48; "Applies-to ID"; Code[50])
- {
- Caption = 'Applies-to ID';
- }
- ///
- /// Business unit code for decentralized organization reporting.
- ///
- field(50; "Business Unit Code"; Code[20])
- {
- Caption = 'Business Unit Code';
- TableRelation = "Business Unit";
- }
- ///
- /// Journal batch name where the original transaction was entered.
- ///
- field(51; "Journal Batch Name"; Code[10])
- {
- Caption = 'Journal Batch Name';
- ToolTip = 'Specifies the name of the journal batch.';
- TableRelation = "Posted Gen. Journal Batch".Name where("Journal Template Name" = field("Journal Template Name"));
- }
- ///
- /// Reason code explaining the purpose or cause of the transaction.
- ///
- field(52; "Reason Code"; Code[10])
- {
- Caption = 'Reason Code';
- TableRelation = "Reason Code";
- }
- ///
- /// Recurring posting method for repeating transactions.
- ///
- field(53; "Recurring Method"; Enum "Gen. Journal Recurring Method")
- {
- BlankZero = true;
- Caption = 'Recurring Method';
- }
- ///
- /// Expiration date for recurring journal transactions.
- ///
- field(54; "Expiration Date"; Date)
- {
- Caption = 'Expiration Date';
- }
- ///
- /// Frequency formula for recurring transaction intervals.
- ///
- field(55; "Recurring Frequency"; DateFormula)
- {
- Caption = 'Recurring Frequency';
- }
- ///
- /// General posting type for G/L account transactions (Purchase, Sale, Settlement).
- ///
- field(57; "Gen. Posting Type"; Enum "General Posting Type")
- {
- Caption = 'Gen. Posting Type';
- ToolTip = 'Specifies the general posting type that will be used when you post the entry on this journal line.';
- }
- ///
- /// General business posting group for posting setup determination.
- ///
- field(58; "Gen. Bus. Posting Group"; Code[20])
- {
- Caption = 'Gen. Bus. Posting Group';
- 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.';
- TableRelation = "Gen. Business Posting Group";
- }
- ///
- /// General product posting group for posting setup determination.
- ///
- field(59; "Gen. Prod. Posting Group"; Code[20])
- {
- Caption = 'Gen. Prod. Posting Group';
- 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.';
- TableRelation = "Gen. Product Posting Group";
- }
- ///
- /// VAT calculation type method used for tax calculation.
- ///
- field(60; "VAT Calculation Type"; Enum "Tax Calculation Type")
- {
- Caption = 'VAT Calculation Type';
- Editable = false;
- }
- ///
- /// Indicates if transaction involves European Union 3-party trade.
- ///
- field(61; "EU 3-Party Trade"; Boolean)
- {
- Caption = 'EU 3-Party Trade';
- Editable = false;
- }
- ///
- /// Indicates whether the entry can be applied to other entries.
- ///
- field(62; "Allow Application"; Boolean)
- {
- Caption = 'Allow Application';
- InitValue = true;
- }
- ///
- /// Balance account type used for automatic balancing (G/L Account, Customer, Vendor, Bank Account).
- ///
- field(63; "Bal. Account Type"; Enum "Gen. Journal Account Type")
- {
- Caption = 'Bal. Account Type';
- ToolTip = 'Specifies the code for the balancing account type that should be used in this journal line.';
- }
- ///
- /// General posting type for balancing account transactions.
- ///
- field(64; "Bal. Gen. Posting Type"; Enum "General Posting Type")
- {
- Caption = 'Bal. Gen. Posting Type';
- ToolTip = 'Specifies the general posting type associated with the balancing account that will be used when you post the entry on the journal line.';
- }
- ///
- /// General business posting group for balancing account posting setup.
- ///
- field(65; "Bal. Gen. Bus. Posting Group"; Code[20])
- {
- Caption = 'Bal. Gen. Bus. Posting Group';
- ToolTip = 'Specifies the general business posting group code associated with the balancing account that will be used when you post the entry.';
- TableRelation = "Gen. Business Posting Group";
- }
- ///
- /// General product posting group for balancing account posting setup.
- ///
- field(66; "Bal. Gen. Prod. Posting Group"; Code[20])
- {
- Caption = 'Bal. Gen. Prod. Posting Group';
- ToolTip = 'Specifies the general product posting group code associated with the balancing account that will be used when you post the entry.';
- TableRelation = "Gen. Product Posting Group";
- }
- ///
- /// VAT calculation type for balancing account VAT processing.
- ///
- field(67; "Bal. VAT Calculation Type"; Enum "Tax Calculation Type")
- {
- Caption = 'Bal. VAT Calculation Type';
- Editable = false;
- }
- ///
- /// VAT percentage rate for balancing account transactions.
- ///
- field(68; "Bal. VAT %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Bal. VAT %';
- DecimalPlaces = 0 : 5;
- Editable = false;
- MaxValue = 100;
- MinValue = 0;
- }
- ///
- /// VAT amount calculated for balancing account transactions.
- ///
- field(69; "Bal. VAT Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Bal. VAT Amount';
- }
- ///
- /// Bank payment type for electronic banking transactions.
- ///
- field(70; "Bank Payment Type"; Enum "Bank Payment Type")
- {
- AccessByPermission = TableData "Bank Account" = R;
- Caption = 'Bank Payment Type';
- }
- ///
- /// VAT base amount for the posted transaction on which VAT calculations were performed.
- ///
- field(71; "VAT Base Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'VAT Base Amount';
- }
- ///
- /// VAT base amount for the balancing account on which VAT calculations were performed.
- ///
- field(72; "Bal. VAT Base Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Bal. VAT Base Amount';
- }
- ///
- /// Indicates whether the entry is a correction of a previously posted entry.
- ///
- field(73; Correction; Boolean)
- {
- Caption = 'Correction';
- }
- ///
- /// Indicates whether posted documents should be printed automatically.
- ///
- field(74; "Print Posted Documents"; Boolean)
- {
- Caption = 'Print Posted Documents';
- }
- ///
- /// Indicates whether a check has been printed for this payment transaction.
- ///
- field(75; "Check Printed"; Boolean)
- {
- AccessByPermission = TableData "Check Ledger Entry" = R;
- Caption = 'Check Printed';
- Editable = false;
- }
- ///
- /// Document date from the original source document.
- ///
- field(76; "Document Date"; Date)
- {
- Caption = 'Document Date';
- ClosingDates = true;
- }
- ///
- /// External document number reference from vendor invoice or customer statement.
- ///
- field(77; "External Document No."; Code[35])
- {
- Caption = 'External Document No.';
- }
- ///
- /// Source type indicating the origin of the journal line (Customer, Vendor, Bank Account, etc.).
- ///
- field(78; "Source Type"; Enum "Gen. Journal Source Type")
- {
- Caption = 'Source Type';
- }
- ///
- /// Source number corresponding to the source type (Customer No., Vendor No., etc.).
- ///
- field(79; "Source No."; Code[20])
- {
- Caption = 'Source No.';
- TableRelation = if ("Source Type" = const(Customer)) Customer
- else
- if ("Source Type" = const(Vendor)) Vendor
- else
- if ("Source Type" = const("Bank Account")) "Bank Account"
- else
- if ("Source Type" = const("Fixed Asset")) "Fixed Asset"
- else
- if ("Source Type" = const(Employee)) Employee;
- }
- ///
- /// Number series used for posting document numbering.
- ///
- field(80; "Posting No. Series"; Code[20])
- {
- Caption = 'Posting No. Series';
- TableRelation = "No. Series";
- }
- ///
- /// Tax area code for sales tax jurisdiction determination.
- ///
- field(82; "Tax Area Code"; Code[20])
- {
- Caption = 'Tax Area Code';
- TableRelation = "Tax Area";
- }
- ///
- /// Indicates whether the transaction is subject to sales tax.
- ///
- field(83; "Tax Liable"; Boolean)
- {
- Caption = 'Tax Liable';
- }
- ///
- /// Tax group code for determining applicable tax rates and calculation rules.
- ///
- field(84; "Tax Group Code"; Code[20])
- {
- Caption = 'Tax Group Code';
- TableRelation = "Tax Group";
- }
- ///
- /// Indicates whether use tax applies to this transaction.
- ///
- field(85; "Use Tax"; Boolean)
- {
- Caption = 'Use Tax';
- }
- ///
- /// Tax area code for balancing account tax jurisdiction determination.
- ///
- field(86; "Bal. Tax Area Code"; Code[20])
- {
- Caption = 'Bal. Tax Area Code';
- TableRelation = "Tax Area";
- }
- ///
- /// Indicates whether the balancing account transaction is subject to sales tax.
- ///
- field(87; "Bal. Tax Liable"; Boolean)
- {
- Caption = 'Bal. Tax Liable';
- }
- ///
- /// Tax group code for balancing account tax calculation rules.
- ///
- field(88; "Bal. Tax Group Code"; Code[20])
- {
- Caption = 'Bal. Tax Group Code';
- TableRelation = "Tax Group";
- }
- ///
- /// Indicates whether use tax applies to the balancing account transaction.
- ///
- field(89; "Bal. Use Tax"; Boolean)
- {
- Caption = 'Bal. Use Tax';
- }
- ///
- /// VAT business posting group for VAT setup determination.
- ///
- field(90; "VAT Bus. Posting Group"; Code[20])
- {
- Caption = 'VAT Bus. Posting Group';
- ToolTip = 'Specifies the VAT business posting group code that will be used when you post the entry on the journal line.';
- TableRelation = "VAT Business Posting Group";
- }
- ///
- /// VAT product posting group for VAT setup determination.
- ///
- field(91; "VAT Prod. Posting Group"; Code[20])
- {
- Caption = 'VAT Prod. Posting Group';
- 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.';
- TableRelation = "VAT Product Posting Group";
- }
- ///
- /// VAT business posting group for balancing account VAT setup.
- ///
- field(92; "Bal. VAT Bus. Posting Group"; Code[20])
- {
- Caption = 'Bal. VAT Bus. Posting Group';
- TableRelation = "VAT Business Posting Group";
- }
- ///
- /// VAT product posting group for balancing account VAT setup.
- ///
- field(93; "Bal. VAT Prod. Posting Group"; Code[20])
- {
- Caption = 'Bal. VAT Prod. Posting Group';
- TableRelation = "VAT Product Posting Group";
- }
- ///
- /// Additional currency posting method for multi-currency reporting.
- ///
- field(95; "Additional-Currency Posting"; Option)
- {
- Caption = 'Additional-Currency Posting';
- Editable = false;
- OptionCaption = 'None,Amount Only,Additional-Currency Amount Only';
- OptionMembers = "None","Amount Only","Additional-Currency Amount Only";
- }
- ///
- /// Fixed asset additional currency conversion factor.
- ///
- field(98; "FA Add.-Currency Factor"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'FA Add.-Currency Factor';
- DecimalPlaces = 0 : 15;
- MinValue = 0;
- }
- ///
- /// Currency code of the source document before conversion.
- ///
- field(99; "Source Currency Code"; Code[10])
- {
- Caption = 'Source Currency Code';
- Editable = false;
- TableRelation = Currency;
- }
- ///
- /// Transaction amount in source currency before conversion.
- ///
- field(100; "Source Currency Amount"; Decimal)
- {
- AccessByPermission = TableData Currency = R;
- AutoFormatType = 1;
- AutoFormatExpression = "Source Currency Code";
- Caption = 'Source Currency Amount';
- Editable = false;
- }
- ///
- /// VAT base amount in source currency before conversion.
- ///
- field(101; "Source Curr. VAT Base Amount"; Decimal)
- {
- AccessByPermission = TableData Currency = R;
- AutoFormatType = 1;
- AutoFormatExpression = "Source Currency Code";
- Caption = 'Source Curr. VAT Base Amount';
- Editable = false;
- }
- ///
- /// VAT amount in source currency before conversion.
- ///
- field(102; "Source Curr. VAT Amount"; Decimal)
- {
- AccessByPermission = TableData Currency = R;
- AutoFormatType = 1;
- AutoFormatExpression = "Source Currency Code";
- Caption = 'Source Curr. VAT Amount';
- Editable = false;
- }
- ///
- /// VAT base discount percentage applied to the transaction.
- ///
- field(103; "VAT Base Discount %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'VAT Base Discount %';
- DecimalPlaces = 0 : 5;
- Editable = false;
- MaxValue = 100;
- MinValue = 0;
- }
- ///
- /// VAT amount converted to local currency for posting.
- ///
- field(104; "VAT Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'VAT Amount (LCY)';
- Editable = false;
- }
- ///
- /// VAT base amount converted to local currency for posting.
- ///
- field(105; "VAT Base Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'VAT Base Amount (LCY)';
- Editable = false;
- }
- ///
- /// Balancing account VAT amount converted to local currency for posting.
- ///
- field(106; "Bal. VAT Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Bal. VAT Amount (LCY)';
- Editable = false;
- }
- ///
- /// Balancing account VAT base amount converted to local currency for posting.
- ///
- field(107; "Bal. VAT Base Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Bal. VAT Base Amount (LCY)';
- Editable = false;
- }
- ///
- /// Indicates whether this is a reversing entry that will be automatically reversed.
- ///
- field(108; "Reversing Entry"; Boolean)
- {
- Caption = 'Reversing Entry';
- Editable = false;
- }
- ///
- /// Indicates whether posting zero amounts is allowed for this transaction.
- ///
- field(109; "Allow Zero-Amount Posting"; Boolean)
- {
- Caption = 'Allow Zero-Amount Posting';
- Editable = false;
- }
- ///
- /// Ship-to address code for customer transactions or order address code for vendor transactions.
- ///
- field(110; "Ship-to/Order Address Code"; Code[10])
- {
- Caption = 'Ship-to/Order Address Code';
- TableRelation = if ("Account Type" = const(Customer)) "Ship-to Address".Code where("Customer No." = field("Bill-to/Pay-to No."))
- else
- if ("Account Type" = const(Vendor)) "Order Address".Code where("Vendor No." = field("Bill-to/Pay-to No."))
- else
- if ("Bal. Account Type" = const(Customer)) "Ship-to Address".Code where("Customer No." = field("Bill-to/Pay-to No."))
- else
- if ("Bal. Account Type" = const(Vendor)) "Order Address".Code where("Vendor No." = field("Bill-to/Pay-to No."));
- }
- ///
- /// VAT amount difference allowed for manual VAT correction.
- ///
- field(111; "VAT Difference"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'VAT Difference';
- Editable = false;
- }
- ///
- /// Balancing account VAT amount difference allowed for manual VAT correction.
- ///
- field(112; "Bal. VAT Difference"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Bal. VAT Difference';
- Editable = false;
- }
- ///
- /// Intercompany partner code for intercompany transaction processing.
- ///
- field(113; "IC Partner Code"; Code[20])
- {
- Caption = 'IC Partner Code';
- Editable = false;
- TableRelation = "IC Partner";
- }
- ///
- /// Intercompany transaction direction (Outgoing or Incoming).
- ///
- field(114; "IC Direction"; Enum "IC Direction Type")
- {
- Caption = 'IC Direction';
- }
-#if not CLEANSCHEMA25
- ///
- /// Intercompany partner G/L account number used for intercompany transactions (obsolete field replaced by IC Account No.).
- ///
- field(116; "IC Partner G/L Acc. No."; Code[20])
- {
- Caption = 'IC Partner G/L Acc. No.';
- TableRelation = "IC G/L Account";
- ObsoleteReason = 'Replaced by IC Account No.';
- ObsoleteState = Removed;
- ObsoleteTag = '25.0';
- }
-#endif
- ///
- /// Intercompany partner transaction number for cross-reference tracking.
- ///
- field(117; "IC Partner Transaction No."; Integer)
- {
- Caption = 'IC Partner Transaction No.';
- Editable = false;
- }
- ///
- /// Sell-to customer number or buy-from vendor number for the transaction.
- ///
- field(118; "Sell-to/Buy-from No."; Code[20])
- {
- Caption = 'Sell-to/Buy-from No.';
- TableRelation = if ("Account Type" = const(Customer)) Customer
- else
- if ("Bal. Account Type" = const(Customer)) Customer
- else
- if ("Account Type" = const(Vendor)) Vendor
- else
- if ("Bal. Account Type" = const(Vendor)) Vendor;
- }
- ///
- /// VAT registration number for tax reporting and compliance verification.
- ///
- field(119; "VAT Registration No."; Text[20])
- {
- Caption = 'VAT Registration No.';
- }
- ///
- /// Country or region code for geographic reporting and tax determination.
- ///
- field(120; "Country/Region Code"; Code[10])
- {
- Caption = 'Country/Region Code';
- TableRelation = "Country/Region";
- }
- ///
- /// Indicates whether the transaction is related to a prepayment.
- ///
- field(121; Prepayment; Boolean)
- {
- Caption = 'Prepayment';
- }
- ///
- /// Indicates whether the entry has been financially voided.
- ///
- field(122; "Financial Void"; Boolean)
- {
- Caption = 'Financial Void';
- Editable = false;
- }
- ///
- /// Indicates whether VAT setup should be copied to journal lines.
- ///
- field(123; "Copy VAT Setup to Jnl. Lines"; Boolean)
- {
- Caption = 'Copy VAT Setup to Jnl. Lines';
- Editable = false;
- InitValue = true;
- }
- ///
- /// VAT base amount before payment discount application.
- ///
- field(125; "VAT Base Before Pmt. Disc."; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'VAT Base Before Pmt. Disc.';
- Editable = false;
- }
- ///
- /// Original payment discount amount possible before any adjustments.
- ///
- field(126; "Orig. Pmt. Disc. Possible"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Original Pmt. Disc. Possible';
- Editable = false;
- }
- ///
- /// Original payment discount amount possible in local currency at the time of posting.
- ///
- field(127; "Orig. Pmt. Disc. Possible(LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Orig. Pmt. Disc. Possible (LCY)';
- Editable = false;
- }
- ///
- /// Intercompany account type for intercompany transactions and postings.
- ///
- field(130; "IC Account Type"; Enum "IC Journal Account Type")
- {
- Caption = 'IC Account Type';
- }
- ///
- /// Intercompany account number for intercompany transactions and reconciliation.
- ///
- field(131; "IC Account No."; Code[20])
- {
- Caption = 'IC Account No.';
- TableRelation =
- if ("IC Account Type" = const("G/L Account")) "IC G/L Account" where("Account Type" = const(Posting), Blocked = const(false))
- else
- if ("Account Type" = const(Customer), "IC Account Type" = const("Bank Account")) "IC Bank Account" where("IC Partner Code" = field("IC Partner Code"), Blocked = const(false))
- else
- if ("Account Type" = const(Vendor), "IC Account Type" = const("Bank Account")) "IC Bank Account" where("IC Partner Code" = field("IC Partner Code"), Blocked = const(false))
- else
- if ("Account Type" = const("IC Partner"), "IC Account Type" = const("Bank Account")) "IC Bank Account" where("IC Partner Code" = field("Account No."), Blocked = const(false))
- else
- if ("Bal. Account Type" = const(Customer), "IC Account Type" = const("Bank Account")) "IC Bank Account" where("IC Partner Code" = field("IC Partner Code"), Blocked = const(false))
- else
- if ("Bal. Account Type" = const(Vendor), "IC Account Type" = const("Bank Account")) "IC Bank Account" where("IC Partner Code" = field("IC Partner Code"), Blocked = const(false))
- else
- if ("Bal. Account Type" = const("IC Partner"), "IC Account Type" = const("Bank Account")) "IC Bank Account" where("IC Partner Code" = field("Bal. Account No."), Blocked = const(false));
- }
- ///
- /// Job queue status for background processing and automated journal posting operations.
- ///
- field(160; "Job Queue Status"; Enum "Document Job Queue Status")
- {
- Caption = 'Job Queue Status';
- Editable = false;
- }
- ///
- /// Job queue entry unique identifier for tracking background processing tasks and automation status.
- ///
- field(161; "Job Queue Entry ID"; Guid)
- {
- Caption = 'Job Queue Entry ID';
- Editable = false;
- }
- ///
- /// Incoming document entry number linking posted journal entries to source documents for audit trail and workflow tracking.
- ///
- field(165; "Incoming Document Entry No."; Integer)
- {
- Caption = 'Incoming Document Entry No.';
- TableRelation = "Incoming Document";
- }
- ///
- /// Creditor number for creditor identification in payment processing and vendor management workflows.
- ///
- field(170; "Creditor No."; Code[20])
- {
- Caption = 'Creditor No.';
- }
- ///
- /// Payment reference for transaction tracking and bank reconciliation in electronic payment processing.
- ///
- field(171; "Payment Reference"; Code[50])
- {
- Caption = 'Payment Reference';
- }
- ///
- /// Payment method code defining the payment type and processing rules for transaction execution.
- ///
- field(172; "Payment Method Code"; Code[10])
- {
- Caption = 'Payment Method Code';
- TableRelation = "Payment Method";
- }
- ///
- /// External document number for application tracking and cross-reference with external systems.
- ///
- field(173; "Applies-to Ext. Doc. No."; Code[35])
- {
- Caption = 'Applies-to Ext. Doc. No.';
- }
- ///
- /// Invoice received date for tracking invoice receipt timing and processing workflow management.
- ///
- field(175; "Invoice Received Date"; Date)
- {
-
- }
- ///
- /// Recipient bank account for payment processing and electronic funds transfer operations.
- ///
- field(288; "Recipient Bank Account"; Code[20])
- {
- Caption = 'Recipient Bank Account';
- TableRelation = if ("Account Type" = const(Customer)) "Customer Bank Account".Code where("Customer No." = field("Account No."))
- else
- if ("Account Type" = const(Vendor)) "Vendor Bank Account".Code where("Vendor No." = field("Account No."))
- else
- if ("Account Type" = const(Employee)) Employee."No." where("Employee No. Filter" = field("Account No."))
- else
- if ("Bal. Account Type" = const(Customer)) "Customer Bank Account".Code where("Customer No." = field("Bal. Account No."))
- else
- if ("Bal. Account Type" = const(Vendor)) "Vendor Bank Account".Code where("Vendor No." = field("Bal. Account No."))
- else
- if ("Bal. Account Type" = const(Employee)) Employee."No." where("Employee No. Filter" = field("Bal. Account No."));
- }
- ///
- /// Message to recipient for payment communication and remittance advice in electronic payment processing.
- ///
- field(289; "Message to Recipient"; Text[140])
- {
- Caption = 'Message to Recipient';
- }
- ///
- /// Indicates whether payment data has been exported to external payment file for electronic payment processing.
- ///
- field(290; "Exported to Payment File"; Boolean)
- {
- Caption = 'Exported to Payment File';
- Editable = false;
- }
- ///
- /// Dimension set identifier linking posted entries to dimension combinations for analytical reporting and financial analysis.
- ///
- field(480; "Dimension Set ID"; Integer)
- {
- Caption = 'Dimension Set ID';
- Editable = false;
- TableRelation = "Dimension Set Entry";
- }
- ///
- /// Project task number for job-specific transactions linking posted entries to specific project tasks and work breakdown structure.
- ///
- field(1001; "Job Task No."; Code[20])
- {
- Caption = 'Project Task No.';
- TableRelation = "Job Task"."Job Task No." where("Job No." = field("Job No."));
- }
- ///
- /// Project unit price in local currency for job costing and project profitability calculations.
- ///
- field(1002; "Job Unit Price (LCY)"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatType = 2;
- AutoFormatExpression = '';
- Caption = 'Project Unit Price (LCY)';
- Editable = false;
- }
- ///
- /// Project total price in local currency for job revenue tracking and project financial analysis.
- ///
- field(1003; "Job Total Price (LCY)"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Project Total Price (LCY)';
- Editable = false;
- }
- ///
- /// Project quantity for job consumption tracking and resource utilization calculations.
- ///
- field(1004; "Job Quantity"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatType = 0;
- Caption = 'Project Quantity';
- DecimalPlaces = 0 : 5;
- }
- ///
- /// Project unit cost in local currency for job cost accounting and project profitability analysis.
- ///
- field(1005; "Job Unit Cost (LCY)"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatType = 2;
- AutoFormatExpression = '';
- Caption = 'Project Unit Cost (LCY)';
- Editable = false;
- }
- ///
- /// Project line discount percentage for job pricing adjustments and contract-based discounting.
- ///
- field(1006; "Job Line Discount %"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatType = 0;
- Caption = 'Project Line Discount %';
- }
- ///
- /// Project line discount amount in local currency for job cost and revenue calculations with contract adjustments.
- ///
- field(1007; "Job Line Disc. Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Project Line Disc. Amount (LCY)';
- Editable = false;
- }
- ///
- /// Project unit of measure code for job quantity tracking and resource measurement standardization.
- ///
- field(1008; "Job Unit Of Measure Code"; Code[10])
- {
- Caption = 'Project Unit Of Measure Code';
- TableRelation = "Unit of Measure";
- }
- ///
- /// Project line type defining the nature of job transaction for project classification and billing purposes.
- ///
- field(1009; "Job Line Type"; Enum "Job Line Type")
- {
- AccessByPermission = TableData Job = R;
- Caption = 'Project Line Type';
- }
- ///
- /// Project unit price in job currency for multi-currency project pricing and international project management.
- ///
- field(1010; "Job Unit Price"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatExpression = "Job Currency Code";
- AutoFormatType = 2;
- Caption = 'Project Unit Price';
- }
- ///
- /// Project total price in job currency for multi-currency project revenue tracking and financial reporting.
- ///
- field(1011; "Job Total Price"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatExpression = "Job Currency Code";
- AutoFormatType = 1;
- Caption = 'Project Total Price';
- Editable = false;
- }
- ///
- /// Project unit cost in job currency for multi-currency project cost accounting and international project analysis.
- ///
- field(1012; "Job Unit Cost"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatExpression = "Job Currency Code";
- AutoFormatType = 2;
- Caption = 'Project Unit Cost';
- Editable = false;
- }
- ///
- /// Project total cost in job currency for multi-currency project expense tracking and cost management.
- ///
- field(1013; "Job Total Cost"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatExpression = "Job Currency Code";
- AutoFormatType = 1;
- Caption = 'Project Total Cost';
- Editable = false;
- }
- ///
- /// Project line discount amount in job currency for contract-based pricing adjustments and international project discounting.
- ///
- field(1014; "Job Line Discount Amount"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatExpression = "Job Currency Code";
- AutoFormatType = 1;
- Caption = 'Project Line Discount Amount';
- }
- ///
- /// Project line amount in job currency for multi-currency project revenue and billing calculations.
- ///
- field(1015; "Job Line Amount"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatExpression = "Job Currency Code";
- AutoFormatType = 1;
- Caption = 'Project Line Amount';
- }
- ///
- /// Project total cost in local currency for comprehensive job cost tracking and profitability analysis.
- ///
- field(1016; "Job Total Cost (LCY)"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Project Total Cost (LCY)';
- Editable = false;
- }
- ///
- /// Project line amount in local currency for consolidated job revenue reporting and financial analysis.
- ///
- field(1017; "Job Line Amount (LCY)"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Project Line Amount (LCY)';
- Editable = false;
- }
- ///
- /// Project currency factor for multi-currency job calculations and exchange rate tracking in international projects.
- ///
- field(1018; "Job Currency Factor"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Project Currency Factor';
- }
- ///
- /// Project currency code for multi-currency job transactions and international project financial management.
- ///
- field(1019; "Job Currency Code"; Code[10])
- {
- Caption = 'Project Currency Code';
- }
- ///
- /// Project planning line number linking posted entries to specific job planning lines for project progress tracking.
- ///
- field(1020; "Job Planning Line No."; Integer)
- {
- AccessByPermission = TableData Job = R;
- BlankZero = true;
- Caption = 'Project Planning Line No.';
- }
- ///
- /// Project remaining quantity for job completion tracking and resource planning calculations.
- ///
- field(1030; "Job Remaining Qty."; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatType = 0;
- Caption = 'Project Remaining Qty.';
- DecimalPlaces = 0 : 5;
- }
- ///
- /// Direct debit mandate ID for SEPA direct debit processing and automated payment collections from customer accounts.
- ///
- field(1200; "Direct Debit Mandate ID"; Code[35])
- {
- Caption = 'Direct Debit Mandate ID';
- TableRelation = if ("Account Type" = const(Customer)) "SEPA Direct Debit Mandate" where("Customer No." = field("Account No."));
- }
- ///
- /// Data exchange entry number linking posted entries to external data import processes and bank statement reconciliation.
- ///
- field(1220; "Data Exch. Entry No."; Integer)
- {
- Caption = 'Data Exch. Entry No.';
- Editable = false;
- TableRelation = "Data Exch.";
- }
- ///
- /// Payer information from imported bank statements and electronic payment processing for transaction identification.
- ///
- field(1221; "Payer Information"; Text[50])
- {
- Caption = 'Payer Information';
- }
- ///
- /// Transaction information from electronic payment processing and bank statement imports for detailed payment tracking.
- ///
- field(1222; "Transaction Information"; Text[100])
- {
- Caption = 'Transaction Information';
- }
- ///
- /// Data exchange line number for tracking specific lines within imported bank statement and payment files.
- ///
- field(1223; "Data Exch. Line No."; Integer)
- {
- Caption = 'Data Exch. Line No.';
- Editable = false;
- }
- ///
- /// Applied automatically flag indicating whether the posted entry was matched and applied through automated payment matching processes.
- ///
- field(1224; "Applied Automatically"; Boolean)
- {
- Caption = 'Applied Automatically';
- }
- ///
- /// Deferral code for revenue and expense deferral processing linking posted entries to deferral templates and schedules.
- ///
- field(1700; "Deferral Code"; Code[10])
- {
- Caption = 'Deferral Code';
- ToolTip = 'Specifies the deferral template that governs how expenses or revenue are deferred to the different accounting periods when the expenses or revenue were incurred.';
- TableRelation = "Deferral Template"."Deferral Code";
- }
- ///
- /// Deferral line number for tracking specific lines within deferral schedules and multi-period revenue/expense recognition.
- ///
- field(1701; "Deferral Line No."; Integer)
- {
- Caption = 'Deferral Line No.';
- }
- ///
- /// Campaign number for marketing campaign tracking and sales/purchase transaction analysis by promotional activities.
- ///
- field(5050; "Campaign No."; Code[20])
- {
- Caption = 'Campaign No.';
- TableRelation = Campaign;
- }
- ///
- /// Production order number for manufacturing cost allocation and work-in-process tracking in production-related transactions.
- ///
- field(5400; "Prod. Order No."; Code[20])
- {
- Caption = 'Prod. Order No.';
- Editable = false;
- }
- ///
- /// Fixed asset posting date for FA-specific transaction dating and depreciation calculation in asset management entries.
- ///
- field(5600; "FA Posting Date"; Date)
- {
- AccessByPermission = TableData "Fixed Asset" = R;
- Caption = 'FA Posting Date';
- }
- ///
- /// Fixed asset posting type defining the nature of FA transaction for depreciation, acquisition, disposal, and maintenance operations.
- ///
- field(5601; "FA Posting Type"; Enum "Gen. Journal Line FA Posting Type")
- {
- AccessByPermission = TableData "Fixed Asset" = R;
- Caption = 'FA Posting Type';
- }
- ///
- /// Depreciation book code for fixed asset depreciation tracking and multiple depreciation method management.
- ///
- field(5602; "Depreciation Book Code"; Code[10])
- {
- Caption = 'Depreciation Book Code';
- TableRelation = "Depreciation Book";
- }
- ///
- /// Salvage value for fixed asset depreciation calculations representing the estimated residual value at end of asset life.
- ///
- field(5603; "Salvage Value"; Decimal)
- {
- AccessByPermission = TableData "Fixed Asset" = R;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Salvage Value';
- }
- ///
- /// Number of depreciation days for fixed asset depreciation calculation and pro-rated depreciation in partial periods.
- ///
- field(5604; "No. of Depreciation Days"; Integer)
- {
- AccessByPermission = TableData "Fixed Asset" = R;
- BlankZero = true;
- Caption = 'No. of Depreciation Days';
- }
- ///
- /// Depreciate until FA posting date flag controlling whether depreciation should be calculated up to the FA posting date.
- ///
- field(5605; "Depr. until FA Posting Date"; Boolean)
- {
- AccessByPermission = TableData "Fixed Asset" = R;
- Caption = 'Depr. until FA Posting Date';
- }
- ///
- /// Depreciate acquisition cost flag controlling whether the acquisition cost should be subject to depreciation calculations.
- ///
- field(5606; "Depr. Acquisition Cost"; Boolean)
- {
- AccessByPermission = TableData "Fixed Asset" = R;
- Caption = 'Depr. Acquisition Cost';
- }
- ///
- /// Maintenance code for fixed asset maintenance tracking and service history documentation in asset management systems.
- ///
- field(5609; "Maintenance Code"; Code[10])
- {
- Caption = 'Maintenance Code';
- TableRelation = Maintenance;
- }
- ///
- /// Insurance number linking fixed asset entries to insurance policies for asset protection and risk management tracking.
- ///
- field(5610; "Insurance No."; Code[20])
- {
- Caption = 'Insurance No.';
- TableRelation = Insurance;
- }
- ///
- /// Budgeted fixed asset number for budget tracking and planned asset acquisition management in financial planning processes.
- ///
- field(5611; "Budgeted FA No."; Code[20])
- {
- Caption = 'Budgeted FA No.';
- TableRelation = "Fixed Asset";
- }
- ///
- /// Duplicate in depreciation book code for cross-book depreciation posting and multi-book asset management synchronization.
- ///
- field(5612; "Duplicate in Depreciation Book"; Code[10])
- {
- Caption = 'Duplicate in Depreciation Book';
- TableRelation = "Depreciation Book";
- }
- ///
- /// Use duplication list flag controlling whether the duplication list should be used for cross-book depreciation posting.
- ///
- field(5613; "Use Duplication List"; Boolean)
- {
- AccessByPermission = TableData "Fixed Asset" = R;
- Caption = 'Use Duplication List';
- }
- ///
- /// Fixed asset reclassification entry flag indicating whether this entry represents an asset reclassification transaction.
- ///
- field(5614; "FA Reclassification Entry"; Boolean)
- {
- AccessByPermission = TableData "Fixed Asset" = R;
- Caption = 'FA Reclassification Entry';
- }
- ///
- /// Fixed asset error entry number linking to FA ledger entry for error correction and audit trail purposes.
- ///
- field(5615; "FA Error Entry No."; Integer)
- {
- BlankZero = true;
- Caption = 'FA Error Entry No.';
- TableRelation = "FA Ledger Entry";
- }
- ///
- /// Index entry flag indicating whether this entry represents an indexed transaction for inflation adjustment calculations.
- ///
- field(5616; "Index Entry"; Boolean)
- {
- Caption = 'Index Entry';
- }
- ///
- /// Source line number tracking the original journal line number for audit trail and transaction traceability.
- ///
- field(5617; "Source Line No."; Integer)
- {
- Caption = 'Source Line No.';
- }
- ///
- /// Comment field for additional notes and documentation related to the posted journal line transaction.
- ///
- field(5618; Comment; Text[250])
- {
- Caption = 'Comment';
- }
- ///
- /// Check exported flag indicating whether the check payment has been exported to the bank payment processing system.
- ///
- field(5701; "Check Exported"; Boolean)
- {
- Caption = 'Check Exported';
- }
- ///
- /// Check transmitted flag indicating whether the check payment has been successfully transmitted to the bank.
- ///
- field(5702; "Check Transmitted"; Boolean)
- {
- Caption = 'Check Transmitted';
- }
- ///
- /// Non-deductible VAT percentage for tax calculations where only part of the VAT can be deducted per tax regulations.
- ///
- field(6200; "Non-Deductible VAT %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Non-Deductible VAT %';
- DecimalPlaces = 0 : 5;
- }
- ///
- /// Non-deductible VAT base amount in transaction currency for calculating non-deductible VAT portions per tax legislation.
- ///
- field(6201; "Non-Deductible VAT Base"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Non-Deductible VAT Base';
- }
- ///
- /// Non-deductible VAT amount in transaction currency representing the portion of VAT that cannot be deducted.
- ///
- field(6202; "Non-Deductible VAT Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Non-Deductible VAT Amount';
- }
- ///
- /// Non-deductible VAT base amount in local currency for standardized non-deductible VAT reporting and accounting.
- ///
- field(6203; "Non-Deductible VAT Base LCY"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Non-Deductible VAT Base LCY';
- }
- ///
- /// Non-deductible VAT amount in local currency for consolidated non-deductible VAT reporting and financial analysis.
- ///
- field(6204; "Non-Deductible VAT Amount LCY"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Non-Deductible VAT Amount LCY';
- }
- ///
- /// Non-deductible VAT base amount in additional currency for multi-currency non-deductible VAT tracking and reporting.
- ///
- field(6205; "Non-Deductible VAT Base ACY"; Decimal)
- {
- AutoFormatExpression = GetAdditionalReportingCurrencyCode();
- AutoFormatType = 1;
- Caption = 'Non-Deductible VAT Base ACY';
- }
- ///
- /// Non-deductible VAT amount in additional currency for comprehensive multi-currency non-deductible VAT management.
- ///
- field(6206; "Non-Deductible VAT Amount ACY"; Decimal)
- {
- AutoFormatExpression = GetAdditionalReportingCurrencyCode();
- AutoFormatType = 1;
- Caption = 'Non-Deductible VAT Amount ACY';
- }
- ///
- /// Non-deductible VAT difference for handling variances in non-deductible VAT calculations and adjustments.
- ///
- field(6208; "Non-Deductible VAT Diff."; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = Rec."Currency Code";
- Caption = 'Non-Deductible VAT Difference';
- }
- ///
- /// Account ID for API integration providing GUID-based account identification for external system connectivity.
- ///
- field(8001; "Account Id"; Guid)
- {
- Caption = 'Account Id';
- TableRelation = "G/L Account".SystemId;
- }
- ///
- /// Customer ID for API integration providing GUID-based customer identification for external system connectivity.
- ///
- field(8002; "Customer Id"; Guid)
- {
- Caption = 'Customer Id';
- TableRelation = Customer.SystemId;
- }
- ///
- /// Applies-to invoice ID for API integration providing GUID-based invoice identification for external application matching.
- ///
- field(8003; "Applies-to Invoice Id"; Guid)
- {
- Caption = 'Applies-to Invoice Id';
- TableRelation = "Sales Invoice Header".SystemId;
- }
- ///
- /// Contact graph ID for Microsoft Graph API integration enabling contact synchronization with external systems.
- ///
- field(8004; "Contact Graph Id"; Text[250])
- {
- Caption = 'Contact Graph Id';
- }
- ///
- /// Last modified date time for API integration tracking when the posted journal line was last updated.
- ///
- field(8005; "Last Modified DateTime"; DateTime)
- {
- Caption = 'Last Modified DateTime';
- }
- ///
- /// Journal batch ID for API integration providing GUID-based batch identification for external system connectivity.
- ///
- field(8006; "Journal Batch Id"; Guid)
- {
- Caption = 'Journal Batch Id';
- TableRelation = "Gen. Journal Batch".SystemId;
- }
- ///
- /// Payment method ID for API integration providing GUID-based payment method identification for external systems.
- ///
- field(8007; "Payment Method Id"; Guid)
- {
- Caption = 'Payment Method Id';
- TableRelation = "Payment Method".SystemId;
- }
- ///
- /// General ledger register number linking posted entries to specific G/L register for audit trail and batch tracking.
- ///
- field(8010; "G/L Register No."; Integer)
- {
- Caption = 'G/L Register No.';
- ToolTip = 'Specifies the number of the general ledger register.';
- TableRelation = "G/L Register";
- }
- ///
- /// Indentation level for hierarchical display of posted journal lines in reports and user interface presentations.
- ///
- field(8011; Indentation; Integer)
- {
- Caption = 'Indentation';
- }
- field(11000000; "Transaction Mode Code"; Code[20])
- {
- Caption = 'Transaction Mode Code';
- TableRelation = if ("Account Type" = const(Customer)) "Transaction Mode".Code where("Account Type" = const(Customer))
- else
- if ("Account Type" = const(Vendor)) "Transaction Mode".Code where("Account Type" = const(Vendor))
- else
- if ("Account Type" = const(Employee)) "Transaction Mode".Code where("Account Type" = const(Employee))
- else
- if ("Bal. Account Type" = const(Customer)) "Transaction Mode".Code where("Account Type" = const(Customer))
- else
- if ("Bal. Account Type" = const(Vendor)) "Transaction Mode".Code where("Account Type" = const(Vendor))
- else
- if ("Bal. Account Type" = const(Employee)) "Transaction Mode".Code where("Account Type" = const(Employee));
- }
- }
-
- keys
- {
- key(Key1; "Line No.")
- {
- }
- key(Key2; "Journal Template Name", "Journal Batch Name", "Line No.")
- {
- Clustered = true;
- }
- key(Key3; "G/L Register No.")
- {
- }
- key(Key4; "Document No.", "Posting Date")
- {
- }
- }
-
- fieldgroups
- {
- fieldgroup(DropDown; "Journal Template Name", "Journal Batch Name", "Line No.")
- {
- }
- fieldgroup(Brick; "Journal Template Name", "Journal Batch Name", "Line No.")
- {
- }
- }
-
- protected var
- GeneralLedgerSetup: Record "General Ledger Setup";
- GeneralLedgerSetupRead: Boolean;
-
- local procedure GetAdditionalReportingCurrencyCode(): Code[10]
- begin
- if not GeneralLedgerSetupRead then begin
- GeneralLedgerSetup.Get();
- GeneralLedgerSetupRead := true;
- end;
- exit(GeneralLedgerSetup."Additional Reporting Currency")
- end;
-
- ///
- /// Creates a posted general journal line record from a general journal line during the posting process.
- ///
- /// The source general journal line record to create posted entry from.
- /// The G/L register number for linking to the posting batch.
- /// Indicates whether this is the first line in the posting batch.
- procedure InsertFromGenJournalLine(GenJournalLine: Record "Gen. Journal Line"; GLRegNo: Integer; FirstLine: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInsertFromGenJournalLine(GenJournalLine, IsHandled);
- if IsHandled then
- exit;
-
- Init();
- TransferFields(GenJournalLine);
- "Line No." := 0;
- "G/L Register No." := GLRegNo;
- if not FirstLine then
- Indentation := 1;
- Insert();
- Rec.CopyLinks(GenJournalLine);
-
- OnAfterInsertFromGenJournalLine(GenJournalLine, Rec);
- end;
-
- ///
- /// Integration event triggered before creating a posted general journal line record from a general journal line.
- ///
- /// The source general journal line record.
- /// Set to true to skip the default insertion logic.
- [IntegrationEvent(true, false)]
- local procedure OnBeforeInsertFromGenJournalLine(GenJournalLine: Record "Gen. Journal Line"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Integration event triggered after successfully creating a posted general journal line record from a general journal line.
- ///
- /// The source general journal line record that was used for creation.
- /// The created posted general journal line record.
- [IntegrationEvent(true, false)]
- local procedure OnAfterInsertFromGenJournalLine(GenJournalLine: Record "Gen. Journal Line"; var PostedGenJournalLine: Record "Posted Gen. Journal Line")
- begin
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Ledger/GLEntry.Table.al b/src/Layers/NL/BaseApp/Finance/GeneralLedger/Ledger/GLEntry.Table.al
deleted file mode 100644
index b9e2cdc8b1..0000000000
--- a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Ledger/GLEntry.Table.al
+++ /dev/null
@@ -1,1309 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Finance.GeneralLedger.Ledger;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Consolidation;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Deferral;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.Finance.SalesTax;
-using Microsoft.Finance.VAT.Ledger;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.FixedAssets.FixedAsset;
-using Microsoft.FixedAssets.Ledger;
-using Microsoft.FixedAssets.Maintenance;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.Enums;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.HumanResources.Employee;
-using Microsoft.Intercompany.Partner;
-using Microsoft.Inventory.Ledger;
-using Microsoft.Projects.Project.Job;
-using Microsoft.Purchases.Vendor;
-using Microsoft.Sales.Customer;
-using Microsoft.Utilities;
-using System.Security.AccessControl;
-
-///
-/// Stores all general ledger transactions with complete audit trail and dimensional analysis capabilities.
-/// Central table for financial reporting, analysis, and regulatory compliance with integrated VAT and tax tracking.
-///
-///
-/// Key relationships: G/L Account, Customer Ledger Entry, Vendor Ledger Entry, VAT Entry, Dimension Set Entry.
-/// Extensible via table extensions for additional financial tracking and compliance requirements.
-/// Primary keys: Entry No. Secondary keys: G/L Account No. + Posting Date, Transaction No.
-///
-table 17 "G/L Entry"
-{
- Caption = 'G/L Entry';
- DrillDownPageID = "General Ledger Entries";
- LookupPageID = "General Ledger Entries";
- DataClassification = CustomerContent;
-
- fields
- {
- ///
- /// Unique sequential identifier for the G/L entry.
- ///
- field(1; "Entry No."; Integer)
- {
- Caption = 'Entry No.';
- ToolTip = 'Specifies the number of the entry, which is assigned automatically when the entry is posted.';
- }
- ///
- /// G/L account number that this transaction affects.
- ///
- field(3; "G/L Account No."; Code[20])
- {
- Caption = 'G/L Account No.';
- ToolTip = 'Specifies the number of the account that the entry has been posted to.';
- TableRelation = "G/L Account";
-
- trigger OnValidate()
- begin
- UpdateAccountID();
- end;
- }
- ///
- /// Date when the transaction was posted to the general ledger.
- ///
- field(4; "Posting Date"; Date)
- {
- Caption = 'Posting Date';
- ToolTip = 'Specifies the entry''s posting date.';
- ClosingDates = true;
- }
- ///
- /// Type of document that originated this G/L entry.
- ///
- field(5; "Document Type"; Enum "Gen. Journal Document Type")
- {
- Caption = 'Document Type';
- ToolTip = 'Specifies the Document Type that the entry belongs to.';
- }
- ///
- /// Number of the document that originated this G/L entry.
- ///
- field(6; "Document No."; Code[20])
- {
- Caption = 'Document No.';
- ToolTip = 'Specifies the entry''s Document No.';
-
- trigger OnLookup()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.HyperlinkToDocument("Document No.", "Posting Date");
- end;
- }
- ///
- /// Description text for the G/L entry transaction.
- ///
- field(7; Description; Text[100])
- {
- Caption = 'Description';
- ToolTip = 'Specifies a description of the entry.';
- }
- ///
- /// Balancing account number used in the original journal entry.
- ///
- field(10; "Bal. Account No."; Code[20])
- {
- Caption = 'Bal. Account No.';
- ToolTip = 'Specifies the number of the general ledger, customer, vendor, or bank account that the balancing entry is posted to, such as a cash account for cash purchases.';
- TableRelation = if ("Bal. Account Type" = const("G/L Account")) "G/L Account"
- else
- if ("Bal. Account Type" = const(Customer)) Customer
- else
- if ("Bal. Account Type" = const(Vendor)) Vendor
- else
- if ("Bal. Account Type" = const("Bank Account")) "Bank Account"
- else
- if ("Bal. Account Type" = const("Fixed Asset")) "Fixed Asset"
- else
- if ("Bal. Account Type" = const("IC Partner")) "IC Partner"
- else
- if ("Bal. Account Type" = const(Employee)) Employee;
- }
- ///
- /// Transaction amount in local currency (LCY).
- ///
- field(17; Amount; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Amount (LCY)';
- ToolTip = 'Specifies the Amount of the entry.';
- DataClassification = CustomerContent;
- }
- ///
- /// Transaction amount in the original currency before conversion to LCY.
- ///
- field(18; "Source Currency Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Source Currency Code";
- AutoFormatType = 1;
- Caption = 'Source Currency Amount';
- ToolTip = 'Specifies the source currency amount for G/L entries.';
- DataClassification = CustomerContent;
- }
- ///
- /// VAT amount in the original currency before conversion to LCY.
- ///
- field(19; "Source Currency VAT Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Source Currency Code";
- AutoFormatType = 1;
- Caption = 'Source VAT Currency Amount';
- ToolTip = 'Specifies the source currency VAT amount for G/L entries.';
- DataClassification = CustomerContent;
- }
- ///
- /// Currency code of the original transaction before conversion to LCY.
- ///
- field(20; "Source Currency Code"; Code[10])
- {
- Caption = 'Source Currency Code';
- ToolTip = 'Specifies the source currency code for general ledger entries.';
- TableRelation = Currency;
- DataClassification = SystemMetadata;
- }
- ///
- /// Primary global dimension code for analytical reporting and filtering.
- ///
- field(23; "Global Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,1,1';
- Caption = 'Global Dimension 1 Code';
- ToolTip = 'Specifies the code for the global dimension that is linked to the record or entry for analysis purposes. Two global dimensions, typically for the company''s most important activities, are available on all cards, documents, reports, and lists.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1));
- }
- ///
- /// Secondary global dimension code for analytical reporting and filtering.
- ///
- field(24; "Global Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,1,2';
- Caption = 'Global Dimension 2 Code';
- ToolTip = 'Specifies the code for the global dimension that is linked to the record or entry for analysis purposes. Two global dimensions, typically for the company''s most important activities, are available on all cards, documents, reports, and lists.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2));
- }
- ///
- /// User ID of the person who posted this G/L entry.
- ///
- field(27; "User ID"; Code[50])
- {
- Caption = 'User ID';
- ToolTip = 'Specifies the ID of the user who posted the entry, to be used, for example, in the change log.';
- DataClassification = EndUserIdentifiableInformation;
- TableRelation = User."User Name";
- ValidateTableRelation = false;
- }
- ///
- /// Source code indicating the journal or process that created this entry.
- ///
- field(28; "Source Code"; Code[10])
- {
- Caption = 'Source Code';
- ToolTip = 'Specifies the source code that specifies where the entry was created.';
- TableRelation = "Source Code";
- }
- ///
- /// Indicates whether this entry was created automatically by the system.
- ///
- field(29; "System-Created Entry"; Boolean)
- {
- Caption = 'System-Created Entry';
- }
- ///
- /// Indicates whether this entry belongs to a prior fiscal year.
- ///
- field(30; "Prior-Year Entry"; Boolean)
- {
- Caption = 'Prior-Year Entry';
- }
- ///
- /// Project number associated with this G/L entry for project accounting.
- ///
- field(41; "Job No."; Code[20])
- {
- Caption = 'Project No.';
- ToolTip = 'Specifies the number of the related project.';
- TableRelation = Job;
- }
- ///
- /// Quantity associated with this G/L transaction for unit-based reporting.
- ///
- field(42; Quantity; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Quantity';
- ToolTip = 'Specifies the quantity that was posted on the entry.';
- DecimalPlaces = 0 : 5;
- }
- ///
- /// VAT amount in local currency associated with this G/L entry.
- ///
- field(43; "VAT Amount"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'VAT Amount';
- ToolTip = 'Specifies the amount of VAT that is included in the total amount.';
- }
- ///
- /// Business unit code for multi-company consolidation and reporting.
- ///
- field(45; "Business Unit Code"; Code[20])
- {
- Caption = 'Business Unit Code';
- ToolTip = 'Specifies the Business Unit code of the company from which the entry was consolidated.';
- TableRelation = "Business Unit";
- }
- ///
- /// Journal batch name from the original journal entry.
- ///
- field(46; "Journal Batch Name"; Code[10])
- {
- Caption = 'Journal Batch Name';
- }
- ///
- /// Reason code explaining the purpose of this G/L entry.
- ///
- field(47; "Reason Code"; Code[10])
- {
- Caption = 'Reason Code';
- ToolTip = 'Specifies the reason code, a supplementary source code that enables you to trace the entry.';
- TableRelation = "Reason Code";
- }
- ///
- /// General posting type indicating purchase, sale, or settlement transaction.
- ///
- field(48; "Gen. Posting Type"; Enum "General Posting Type")
- {
- Caption = 'Gen. Posting Type';
- ToolTip = 'Specifies the type of transaction.';
- }
- ///
- /// General business posting group for VAT and tax calculation purposes.
- ///
- field(49; "Gen. Bus. Posting Group"; Code[20])
- {
- Caption = 'Gen. Bus. Posting Group';
- 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.';
- TableRelation = "Gen. Business Posting Group";
- }
- ///
- /// General product posting group for VAT and tax calculation purposes.
- ///
- field(50; "Gen. Prod. Posting Group"; Code[20])
- {
- Caption = 'Gen. Prod. Posting Group';
- 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.';
- TableRelation = "Gen. Product Posting Group";
- }
- ///
- /// Type of balancing account used in the original journal entry.
- ///
- field(51; "Bal. Account Type"; Enum "Gen. Journal Account Type")
- {
- Caption = 'Bal. Account Type';
- ToolTip = 'Specifies the type of account that a balancing entry is posted to, such as BANK for a cash account.';
- }
- ///
- /// Transaction number grouping related G/L entries from the same posting.
- ///
- field(52; "Transaction No."; Integer)
- {
- Caption = 'Transaction No.';
- TableRelation = "G/L Transaction";
- ToolTip = 'Specifies the transaction number that groups related G/L entries from the same posting.';
- }
- ///
- /// Debit amount in local currency when transaction increases account balance.
- ///
- field(53; "Debit Amount"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- BlankZero = true;
- Caption = 'Debit Amount (LCY)';
- ToolTip = 'Specifies the total of the ledger entries that represent debits.';
- }
- ///
- /// Credit amount in local currency when transaction decreases account balance.
- ///
- field(54; "Credit Amount"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- BlankZero = true;
- Caption = 'Credit Amount (LCY)';
- ToolTip = 'Specifies the total of the ledger entries that represent credits.';
- }
- ///
- /// Date of the original source document.
- ///
- field(55; "Document Date"; Date)
- {
- Caption = 'Document Date';
- ClosingDates = true;
- }
- ///
- /// External document number from vendor or customer invoice.
- ///
- field(56; "External Document No."; Code[35])
- {
- Caption = 'External Document No.';
- ToolTip = 'Specifies the entry''s external document number, such as a vendor''s invoice number.';
- }
- ///
- /// Type of source entity that originated this transaction.
- ///
- field(57; "Source Type"; Enum "Gen. Journal Source Type")
- {
- Caption = 'Source Type';
- ToolTip = 'Specifies the source type that applies to the source number that is shown in the Source No. field.';
- }
- ///
- /// Number of the source entity (customer, vendor, etc.) that originated this transaction.
- ///
- field(58; "Source No."; Code[20])
- {
- Caption = 'Source No.';
- ToolTip = 'Specifies the number of the source document that the entry originates from.';
- TableRelation = if ("Source Type" = const(Customer)) Customer
- else
- if ("Source Type" = const(Vendor)) Vendor
- else
- if ("Source Type" = const("Bank Account")) "Bank Account"
- else
- if ("Source Type" = const("Fixed Asset")) "Fixed Asset"
- else
- if ("Source Type" = const(Employee)) Employee;
- }
- ///
- /// Number series used for automatic document numbering.
- ///
- field(59; "No. Series"; Code[20])
- {
- Caption = 'No. Series';
- TableRelation = "No. Series";
- }
- ///
- /// Tax area code for sales tax calculation and reporting.
- ///
- field(60; "Tax Area Code"; Code[20])
- {
- Caption = 'Tax Area Code';
- TableRelation = "Tax Area";
- }
- ///
- /// Indicates whether this transaction is subject to tax.
- ///
- field(61; "Tax Liable"; Boolean)
- {
- Caption = 'Tax Liable';
- }
- ///
- /// Tax group code for sales tax calculation purposes.
- ///
- field(62; "Tax Group Code"; Code[20])
- {
- Caption = 'Tax Group Code';
- TableRelation = "Tax Group";
- }
- ///
- /// Indicates whether this is a use tax transaction.
- ///
- field(63; "Use Tax"; Boolean)
- {
- Caption = 'Use Tax';
- }
- ///
- /// VAT business posting group for VAT calculation and reporting.
- ///
- field(64; "VAT Bus. Posting Group"; Code[20])
- {
- Caption = 'VAT Bus. Posting Group';
- ToolTip = 'Specifies the VAT specification of the involved customer or vendor to link transactions made for this record with the appropriate general ledger account according to the VAT posting setup.';
- TableRelation = "VAT Business Posting Group";
- }
- ///
- /// VAT product posting group for VAT calculation and reporting.
- ///
- field(65; "VAT Prod. Posting Group"; Code[20])
- {
- Caption = 'VAT Prod. Posting Group';
- ToolTip = 'Specifies the VAT specification of the involved item or resource to link transactions made for this record with the appropriate general ledger account according to the VAT posting setup.';
- TableRelation = "VAT Product Posting Group";
- }
- ///
- /// Transaction amount in additional reporting currency.
- ///
- field(68; "Additional-Currency Amount"; Decimal)
- {
- AccessByPermission = TableData Currency = R;
- AutoFormatExpression = GetAdditionalReportingCurrencyCode();
- AutoFormatType = 1;
- Caption = 'Additional-Currency Amount';
- ToolTip = 'Specifies the general ledger entry that is posted if you post in an additional reporting currency.';
- }
- ///
- /// Debit amount in additional reporting currency.
- ///
- field(69; "Add.-Currency Debit Amount"; Decimal)
- {
- AutoFormatExpression = GetAdditionalReportingCurrencyCode();
- AutoFormatType = 1;
- Caption = 'Add.-Currency Debit Amount';
- }
- ///
- /// Credit amount in additional reporting currency.
- ///
- field(70; "Add.-Currency Credit Amount"; Decimal)
- {
- AutoFormatExpression = GetAdditionalReportingCurrencyCode();
- AutoFormatType = 1;
- Caption = 'Add.-Currency Credit Amount';
- }
- ///
- /// Dimension set ID for close income statement process.
- ///
- field(71; "Close Income Statement Dim. ID"; Integer)
- {
- Caption = 'Close Income Statement Dim. ID';
- }
- ///
- /// Intercompany partner code for intercompany transactions.
- ///
- field(72; "IC Partner Code"; Code[20])
- {
- Caption = 'IC Partner Code';
- ToolTip = 'Specifies the code of the intercompany partner that the transaction is related to if the entry was created from an intercompany transaction.';
- TableRelation = "IC Partner";
- }
- ///
- /// Indicates whether this entry has been reversed.
- ///
- field(73; Reversed; Boolean)
- {
- Caption = 'Reversed';
- ToolTip = 'Specifies if the entry has been part of a reverse transaction (correction) made by the Reverse function.';
- }
- ///
- /// Entry number of the reversing entry that canceled this transaction.
- ///
- field(74; "Reversed by Entry No."; Integer)
- {
- BlankZero = true;
- Caption = 'Reversed by Entry No.';
- ToolTip = 'Specifies the number of the correcting entry. If the field Specifies a number, the entry cannot be reversed again.';
- TableRelation = "G/L Entry";
- }
- ///
- /// Entry number of the original entry that was reversed by this transaction.
- ///
- field(75; "Reversed Entry No."; Integer)
- {
- BlankZero = true;
- Caption = 'Reversed Entry No.';
- ToolTip = 'Specifies the number of the original entry that was undone by the reverse transaction.';
- TableRelation = "G/L Entry";
- }
- ///
- /// Flow field displaying the name of the G/L account.
- ///
- field(76; "G/L Account Name"; Text[100])
- {
- CalcFormula = lookup("G/L Account".Name where("No." = field("G/L Account No.")));
- Caption = 'G/L Account Name';
- ToolTip = 'Specifies the name of the account that the entry has been posted to.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Journal template name from the original journal entry.
- ///
- field(78; "Journal Templ. Name"; Code[10])
- {
- Caption = 'Journal Template Name';
- }
- ///
- /// VAT reporting date for VAT submission and compliance.
- ///
- field(79; "VAT Reporting Date"; Date)
- {
- Caption = 'VAT Date';
- ToolTip = 'Specifies the entry''s VAT date.';
- Editable = false;
- }
- ///
- /// G/L Register number for this entry.
- ///
- field(95; "G/L Register No."; Integer)
- {
- Caption = 'G/L Register No.';
- Editable = false;
- TableRelation = "G/L Register";
- ToolTip = 'Specifies the G/L register number that groups related G/L entries from the same posting.';
- }
- ///
- /// Dimension set ID linking to dimension combinations for this entry.
- ///
- field(480; "Dimension Set ID"; Integer)
- {
- Caption = 'Dimension Set ID';
- ToolTip = 'Specifies a reference to a combination of dimension values. The actual values are stored in the Dimension Set Entry table.';
- Editable = false;
- TableRelation = "Dimension Set Entry";
-
- trigger OnLookup()
- begin
- Rec.ShowDimensions();
- end;
- }
- ///
- /// Flow field showing shortcut dimension 3 code for quick dimension analysis.
- ///
- field(481; "Shortcut Dimension 3 Code"; Code[20])
- {
- CaptionClass = '1,2,3';
- Caption = 'Shortcut Dimension 3 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 3, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(3)));
- }
- ///
- /// Flow field showing shortcut dimension 4 code for quick dimension analysis.
- ///
- field(482; "Shortcut Dimension 4 Code"; Code[20])
- {
- CaptionClass = '1,2,4';
- Caption = 'Shortcut Dimension 4 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 4, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(4)));
- }
- ///
- /// Flow field showing shortcut dimension 5 code for quick dimension analysis.
- ///
- field(483; "Shortcut Dimension 5 Code"; Code[20])
- {
- CaptionClass = '1,2,5';
- Caption = 'Shortcut Dimension 5 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 5, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(5)));
- }
- ///
- /// Flow field showing shortcut dimension 6 code for quick dimension analysis.
- ///
- field(484; "Shortcut Dimension 6 Code"; Code[20])
- {
- CaptionClass = '1,2,6';
- Caption = 'Shortcut Dimension 6 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 6, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(6)));
- }
- ///
- /// Flow field showing shortcut dimension 7 code for quick dimension analysis.
- ///
- field(485; "Shortcut Dimension 7 Code"; Code[20])
- {
- CaptionClass = '1,2,7';
- Caption = 'Shortcut Dimension 7 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 7, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(7)));
- }
- ///
- /// Flow field showing shortcut dimension 8 code for quick dimension analysis.
- ///
- field(486; "Shortcut Dimension 8 Code"; Code[20])
- {
- CaptionClass = '1,2,8';
- Caption = 'Shortcut Dimension 8 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 8, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(8)));
- }
-
- ///
- /// Entry number of the last dimension correction applied to this G/L entry.
- ///
- field(495; "Last Dim. Correction Entry No."; Integer)
- {
- Caption = 'Last Dim. Correction Entry No.';
- Editable = false;
- DataClassification = CustomerContent;
- }
-
- ///
- /// Node identifier for the last dimension correction tracking.
- ///
- field(496; "Last Dim. Correction Node"; Integer)
- {
- Caption = 'Last Dim. Correction Node';
- Editable = false;
- DataClassification = CustomerContent;
- }
-
- ///
- /// Count of dimension changes applied to this G/L entry for audit tracking.
- ///
- field(497; "Dimension Changes Count"; Integer)
- {
- Caption = 'Count of Dimension Changes';
- Editable = false;
- DataClassification = CustomerContent;
- }
- ///
- /// Allocation account number for cost and revenue allocation processes.
- ///
- field(2678; "Allocation Account No."; Code[20])
- {
- Caption = 'Allocation Account No.';
- DataClassification = CustomerContent;
- }
- ///
- /// System ID linking to the original allocation journal line.
- ///
- field(2679; "Alloc. Journal Line SystemId"; Guid)
- {
- Caption = 'Allocation Journal Line SystemId';
- DataClassification = SystemMetadata;
- }
- ///
- /// Production order number for manufacturing cost tracking.
- ///
- field(5400; "Prod. Order No."; Code[20])
- {
- Caption = 'Prod. Order No.';
- }
- ///
- /// Type of fixed asset entry linked to this G/L entry.
- ///
- field(5600; "FA Entry Type"; Option)
- {
- AccessByPermission = TableData "Fixed Asset" = R;
- Caption = 'FA Entry Type';
- ToolTip = 'Specifies the number of the fixed asset entry.';
- OptionCaption = ' ,Fixed Asset,Maintenance';
- OptionMembers = " ","Fixed Asset",Maintenance;
- }
- ///
- /// Entry number of the related fixed asset ledger entry.
- ///
- field(5601; "FA Entry No."; Integer)
- {
- BlankZero = true;
- Caption = 'FA Entry No.';
- ToolTip = 'Specifies the number of the fixed asset entry.';
- TableRelation = if ("FA Entry Type" = const("Fixed Asset")) "FA Ledger Entry"
- else
- if ("FA Entry Type" = const(Maintenance)) "Maintenance Ledger Entry";
- }
- ///
- /// Additional comment text for the G/L entry.
- ///
- field(5618; Comment; Text[250])
- {
- Caption = 'Comment';
- }
- ///
- /// Non-deductible VAT amount in local currency.
- ///
- field(6200; "Non-Deductible VAT Amount"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- Caption = 'Non-Deductible VAT Amount';
- ToolTip = 'Specifies the amount of the transaction for which VAT is not applied, due to the type of goods or services purchased.';
- }
- ///
- /// Non-deductible VAT amount in additional reporting currency.
- ///
- field(6201; "Non-Deductible VAT Amount ACY"; Decimal)
- {
- Caption = 'Non-Deductible VAT Amount ACY';
- AutoFormatExpression = GetAdditionalReportingCurrencyCode();
- AutoFormatType = 1;
- }
- ///
- /// Non-deductible VAT amount in source currency.
- ///
- field(6202; "Src. Curr. Non-Ded. VAT Amount"; Decimal)
- {
- Caption = 'Source Currency Non-Deductible VAT Amount';
- ToolTip = 'Specifies the amount in source currency of the transaction for which VAT is not applied, due to the type of goods or services purchased.';
- AutoFormatExpression = Rec."Source Currency Code";
- AutoFormatType = 1;
- }
- ///
- /// Flow field containing the system ID of the related G/L account.
- ///
- field(8001; "Account Id"; Guid)
- {
- CalcFormula = lookup("G/L Account".SystemId where("No." = field("G/L Account No.")));
- Caption = 'Account Id';
- FieldClass = FlowField;
- TableRelation = "G/L Account".SystemId;
-
- trigger OnValidate()
- begin
- UpdateAccountNo();
- end;
- }
- ///
- /// Timestamp of the last modification to this G/L entry record.
- ///
- field(8005; "Last Modified DateTime"; DateTime)
- {
- Caption = 'Last Modified DateTime';
- Editable = false;
- }
- field(11301; Open; Boolean)
- {
- Caption = 'Open';
- InitValue = true;
- }
- field(11302; "Remaining Amount"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- Caption = 'Remaining Amount';
- }
- field(11303; "Closed by Entry No."; Integer)
- {
- Caption = 'Closed by Entry No.';
- }
- field(11304; "Closed at Date"; Date)
- {
- Caption = 'Closed at Date';
- }
- field(11305; "Closed by Amount"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- Caption = 'Closed by Amount';
- }
- field(11306; "Applies-to ID"; Code[50])
- {
- Caption = 'Applies-to ID';
- }
- }
-
- keys
- {
- key(Key1; "Entry No.")
- {
- Clustered = true;
- }
- key(Key2; "G/L Account No.", "Posting Date")
- {
- SumIndexFields = Amount, "Debit Amount", "Credit Amount", "Additional-Currency Amount", "Add.-Currency Debit Amount", "Add.-Currency Credit Amount", "VAT Amount", Quantity, "Source Currency Amount", "Source Currency VAT Amount";
- IncludedFields = Amount, "Additional-Currency Amount";
- }
- key(Key3; "G/L Account No.", "Global Dimension 1 Code", "Global Dimension 2 Code", "Posting Date", "VAT Reporting Date", "Source Currency Code")
- {
- SumIndexFields = Amount, "Debit Amount", "Credit Amount", "Additional-Currency Amount", "Add.-Currency Debit Amount", "Add.-Currency Credit Amount", "VAT Amount", "Source Currency Amount", "Source Currency VAT Amount";
- }
- key(Key4; "G/L Account No.", "Business Unit Code", "Posting Date")
- {
- Enabled = false;
- SumIndexFields = Amount, "Debit Amount", "Credit Amount", "Additional-Currency Amount", "Add.-Currency Debit Amount", "Add.-Currency Credit Amount";
- }
- key(Key5; "G/L Account No.", "Business Unit Code", "Global Dimension 1 Code", "Global Dimension 2 Code", "Posting Date")
- {
- Enabled = false;
- SumIndexFields = Amount, "Debit Amount", "Credit Amount", "Additional-Currency Amount", "Add.-Currency Debit Amount", "Add.-Currency Credit Amount";
- }
- key(Key6; "Document No.", "Posting Date")
- {
- SumIndexFields = Amount, "Debit Amount", "Credit Amount", "Additional-Currency Amount", "Add.-Currency Debit Amount", "Add.-Currency Credit Amount", "VAT Amount";
- }
- key(Key7; "Transaction No.")
- {
- }
- key(Key8; "IC Partner Code")
- {
- }
- key(Key9; "G/L Account No.", "Job No.", "Posting Date")
- {
- SumIndexFields = Amount;
- }
- key(Key10; "Posting Date", "G/L Account No.", "Dimension Set ID")
- {
- SumIndexFields = Amount;
- }
- key(Key11; "Gen. Bus. Posting Group", "Gen. Prod. Posting Group")
- {
- }
- key(Key12; "VAT Bus. Posting Group", "VAT Prod. Posting Group")
- {
- }
- key(Key13; "Closed by Entry No.")
- {
- }
- key(Key14; "Dimension Set ID")
- {
- }
- }
-
- fieldgroups
- {
- fieldgroup(DropDown; "Entry No.", Description, Amount, "G/L Account No.", "Posting Date", "Document Type", "Document No.")
- {
- }
- }
-
- trigger OnInsert()
- begin
- "Last Modified DateTime" := CurrentDateTime;
- end;
-
- trigger OnModify()
- begin
- "Last Modified DateTime" := CurrentDateTime;
- end;
-
- trigger OnRename()
- begin
- "Last Modified DateTime" := CurrentDateTime;
- end;
-
- protected var
- GeneralLedgerSetup: Record "General Ledger Setup";
- GeneralLedgerSetupRead: Boolean;
-
- procedure GetAdditionalReportingCurrencyCode(): Code[10]
- begin
- if not GeneralLedgerSetupRead then begin
- GeneralLedgerSetup.Get();
- GeneralLedgerSetupRead := true;
- end;
- exit(GeneralLedgerSetup."Additional Reporting Currency")
- end;
-
- [InherentPermissions(PermissionObjectType::TableData, Database::"G/L Entry", 'r')]
- procedure GetNextEntryNo(): Integer
- var
- SequenceNoMgt: Codeunit "Sequence No. Mgt.";
- begin
- exit(SequenceNoMgt.GetNextSeqNo(DATABASE::"G/L Entry"));
- end;
-
- ///
- /// Gets the highest entry number from the G/L Entry table.
- ///
- /// The last entry number used
- [InherentPermissions(PermissionObjectType::TableData, Database::"G/L Entry", 'r')]
- procedure GetLastEntryNo(): Integer;
- var
- FindRecordManagement: Codeunit "Find Record Management";
- begin
- exit(FindRecordManagement.GetLastEntryIntFieldValue(Rec, FieldNo("Entry No.")))
- end;
-
- ///
- /// Gets the last entry number and transaction number from the G/L Entry table.
- ///
- /// Returns the last entry number used
- /// Returns the last transaction number used
- [InherentPermissions(PermissionObjectType::TableData, Database::"G/L Entry", 'r')]
- procedure GetLastEntry(var LastEntryNo: Integer; var LastTransactionNo: Integer)
- var
- FindRecordManagement: Codeunit "Find Record Management";
- FieldNoValues: List of [Integer];
- begin
- FieldNoValues.Add(FieldNo("Entry No."));
- FieldNoValues.Add(FieldNo("Transaction No."));
- FindRecordManagement.GetLastEntryIntFieldValues(Rec, FieldNoValues);
- LastEntryNo := FieldNoValues.Get(1);
- LastTransactionNo := FieldNoValues.Get(2);
- end;
-
-#if not CLEAN27
- ///
- /// Gets the additional reporting currency code from General Ledger Setup.
- ///
- /// Additional reporting currency code
- [Obsolete('use GetAdditionalReportingCurrencyCode instead', '27.0')]
- procedure GetCurrencyCode(): Code[10]
- begin
- exit(GetAdditionalReportingCurrencyCode())
- end;
-#endif
- ///
- /// Opens the Value Entries page showing item ledger entries related to this G/L entry.
- ///
- procedure ShowValueEntries()
- var
- GLItemLedgRelation: Record "G/L - Item Ledger Relation";
- ValueEntry: Record "Value Entry";
- TempValueEntry: Record "Value Entry" temporary;
- begin
- OnBeforeShowValueEntries(ValueEntry, GLItemLedgRelation);
-
- GLItemLedgRelation.SetRange("G/L Entry No.", "Entry No.");
- if GLItemLedgRelation.FindSet() then
- repeat
- ValueEntry.Get(GLItemLedgRelation."Value Entry No.");
- TempValueEntry.Init();
- TempValueEntry := ValueEntry;
- TempValueEntry.Insert();
- until GLItemLedgRelation.Next() = 0;
-
- PAGE.RunModal(0, TempValueEntry);
- end;
-
- ///
- /// Opens the Dimension Set Entries page showing dimensions for this G/L entry.
- ///
- procedure ShowDimensions()
- var
- DimMgt: Codeunit DimensionManagement;
- begin
- DimMgt.ShowDimensionSet("Dimension Set ID", StrSubstNo('%1 %2', TableCaption(), "Entry No."));
- end;
-
- ///
- /// Updates debit and credit amounts based on the amount and correction flag.
- ///
- /// Indicates whether this is a correction entry
- procedure UpdateDebitCredit(Correction: Boolean)
- begin
- if ((Amount > 0) and (not Correction)) or
- ((Amount < 0) and Correction)
- then begin
- "Debit Amount" := Amount;
- "Credit Amount" := 0
- end else begin
- "Debit Amount" := 0;
- "Credit Amount" := -Amount;
- end;
-
- if Open then
- "Remaining Amount" := Amount;
-
- if (("Additional-Currency Amount" > 0) and (not Correction)) or
- (("Additional-Currency Amount" < 0) and Correction)
- then begin
- "Add.-Currency Debit Amount" := "Additional-Currency Amount";
- "Add.-Currency Credit Amount" := 0
- end else begin
- "Add.-Currency Debit Amount" := 0;
- "Add.-Currency Credit Amount" := -"Additional-Currency Amount";
- end;
-
- OnAfterUpdateDebitCredit(Rec, Correction);
- end;
-
- ///
- /// Copies values from General Journal Line to G/L Entry fields.
- ///
- /// General journal line to copy from
- procedure CopyFromGenJnlLine(GenJnlLine: Record "Gen. Journal Line")
- begin
- SetVATDate(GenJnlLine);
- "Posting Date" := GenJnlLine."Posting Date";
- "Document Date" := GenJnlLine."Document Date";
- "Document Type" := GenJnlLine."Document Type";
- "Document No." := GenJnlLine."Document No.";
- "External Document No." := GenJnlLine."External Document No.";
- Description := GenJnlLine.Description;
- Comment := GenJnlLine.Comment;
- "Business Unit Code" := GenJnlLine."Business Unit Code";
- "Global Dimension 1 Code" := GenJnlLine."Shortcut Dimension 1 Code";
- "Global Dimension 2 Code" := GenJnlLine."Shortcut Dimension 2 Code";
- "Dimension Set ID" := GenJnlLine."Dimension Set ID";
- "Source Code" := GenJnlLine."Source Code";
- if GenJnlLine."Account Type" = GenJnlLine."Account Type"::"G/L Account" then begin
- if GenJnlLine."Source Type" = GenJnlLine."Source Type"::Employee then
- "Source Type" := "Source Type"::Employee
- else
- "Source Type" := GenJnlLine."Source Type";
- "Source No." := GenJnlLine."Source No.";
- end else begin
- if GenJnlLine."Account Type" = GenJnlLine."Account Type"::Employee then
- "Source Type" := "Source Type"::Employee
- else
- "Source Type" := GenJnlLine."Account Type";
- "Source No." := GenJnlLine."Account No.";
- end;
- if (GenJnlLine."Account Type" = GenJnlLine."Account Type"::"IC Partner") or
- (GenJnlLine."Bal. Account Type" = GenJnlLine."Bal. Account Type"::"IC Partner")
- then
- "Source Type" := "Source Type"::" ";
- "Job No." := GenJnlLine."Job No.";
- Quantity := GenJnlLine.Quantity;
- "Journal Templ. Name" := GenJnlLine."Journal Template Name";
- "Journal Batch Name" := GenJnlLine."Journal Batch Name";
- "Reason Code" := GenJnlLine."Reason Code";
- "User ID" := CopyStr(UserId(), 1, MaxStrLen("User ID"));
- "No. Series" := GenJnlLine."Posting No. Series";
- "IC Partner Code" := GenJnlLine."IC Partner Code";
- "Prod. Order No." := GenJnlLine."Prod. Order No.";
-
- OnAfterCopyGLEntryFromGenJnlLine(Rec, GenJnlLine);
- end;
-
- ///
- /// Copies posting groups from another G/L Entry record.
- ///
- /// G/L entry to copy posting groups from
- procedure CopyPostingGroupsFromGLEntry(GLEntry: Record "G/L Entry")
- begin
- "Gen. Posting Type" := GLEntry."Gen. Posting Type";
- "Gen. Bus. Posting Group" := GLEntry."Gen. Bus. Posting Group";
- "Gen. Prod. Posting Group" := GLEntry."Gen. Prod. Posting Group";
- "VAT Bus. Posting Group" := GLEntry."VAT Bus. Posting Group";
- "VAT Prod. Posting Group" := GLEntry."VAT Prod. Posting Group";
- "Tax Area Code" := GLEntry."Tax Area Code";
- "Tax Liable" := GLEntry."Tax Liable";
- "Tax Group Code" := GLEntry."Tax Group Code";
- "Use Tax" := GLEntry."Use Tax";
-
- OnAfterCopyPostingGroupsFromGLEntry(rec, GLEntry);
- end;
-
- ///
- /// Copies posting groups from VAT Entry record.
- ///
- /// VAT entry to copy posting groups from
- procedure CopyPostingGroupsFromVATEntry(VATEntry: Record "VAT Entry")
- begin
- "Gen. Posting Type" := VATEntry.Type;
- "Gen. Bus. Posting Group" := VATEntry."Gen. Bus. Posting Group";
- "Gen. Prod. Posting Group" := VATEntry."Gen. Prod. Posting Group";
- "VAT Bus. Posting Group" := VATEntry."VAT Bus. Posting Group";
- "VAT Prod. Posting Group" := VATEntry."VAT Prod. Posting Group";
- "Tax Area Code" := VATEntry."Tax Area Code";
- "Tax Liable" := VATEntry."Tax Liable";
- "Tax Group Code" := VATEntry."Tax Group Code";
- "Use Tax" := VATEntry."Use Tax";
-
- OnAfterCopyPostingGroupsFromVATEntry(Rec, VATEntry);
- end;
-
- ///
- /// Copies posting groups from General Journal Line record.
- ///
- /// General journal line to copy posting groups from
- procedure CopyPostingGroupsFromGenJnlLine(GenJnlLine: Record "Gen. Journal Line")
- begin
- "Gen. Posting Type" := GenJnlLine."Gen. Posting Type";
- "Gen. Bus. Posting Group" := GenJnlLine."Gen. Bus. Posting Group";
- "Gen. Prod. Posting Group" := GenJnlLine."Gen. Prod. Posting Group";
- "VAT Bus. Posting Group" := GenJnlLine."VAT Bus. Posting Group";
- "VAT Prod. Posting Group" := GenJnlLine."VAT Prod. Posting Group";
- "Tax Area Code" := GenJnlLine."Tax Area Code";
- "Tax Liable" := GenJnlLine."Tax Liable";
- "Tax Group Code" := GenJnlLine."Tax Group Code";
- "Use Tax" := GenJnlLine."Use Tax";
-
- OnAfterCopyPostingGroupsFromGenJnlLine(Rec, GenJnlLine);
- end;
-
- ///
- /// Copies posting groups from Detailed CV Ledger Entry Buffer record.
- ///
- /// Detailed CV ledger entry buffer to copy from
- /// General posting type option value
- procedure CopyPostingGroupsFromDtldCVBuf(DtldCVLedgEntryBuf: Record "Detailed CV Ledg. Entry Buffer"; GenPostingType: Option " ",Purchase,Sale,Settlement)
- begin
- "Gen. Posting Type" := "General Posting Type".FromInteger(GenPostingType);
- "Gen. Bus. Posting Group" := DtldCVLedgEntryBuf."Gen. Bus. Posting Group";
- "Gen. Prod. Posting Group" := DtldCVLedgEntryBuf."Gen. Prod. Posting Group";
- "VAT Bus. Posting Group" := DtldCVLedgEntryBuf."VAT Bus. Posting Group";
- "VAT Prod. Posting Group" := DtldCVLedgEntryBuf."VAT Prod. Posting Group";
- "Tax Area Code" := DtldCVLedgEntryBuf."Tax Area Code";
- "Tax Liable" := DtldCVLedgEntryBuf."Tax Liable";
- "Tax Group Code" := DtldCVLedgEntryBuf."Tax Group Code";
- "Use Tax" := DtldCVLedgEntryBuf."Use Tax";
-
- OnAfterCopyPostingGroupsFromDtldCVBuf(Rec, DtldCVLedgEntryBuf);
- end;
-
- ///
- /// Integration event raised after copying G/L entry from general journal line.
- /// Enables extensions to modify additional G/L entry fields during posting.
- ///
- /// G/L entry being created
- /// Source general journal line
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyGLEntryFromGenJnlLine(var GLEntry: Record "G/L Entry"; var GenJournalLine: Record "Gen. Journal Line")
- begin
- end;
-
- ///
- /// Copies values from Deferral Posting Buffer to G/L Entry fields.
- ///
- /// Deferral posting buffer to copy from
- procedure CopyFromDeferralPostBuffer(DeferralPostBuffer: Record "Deferral Posting Buffer")
- begin
- "System-Created Entry" := DeferralPostBuffer."System-Created Entry";
- "Gen. Posting Type" := DeferralPostBuffer."Gen. Posting Type";
- "Gen. Bus. Posting Group" := DeferralPostBuffer."Gen. Bus. Posting Group";
- "Gen. Prod. Posting Group" := DeferralPostBuffer."Gen. Prod. Posting Group";
- "VAT Bus. Posting Group" := DeferralPostBuffer."VAT Bus. Posting Group";
- "VAT Prod. Posting Group" := DeferralPostBuffer."VAT Prod. Posting Group";
- "Tax Area Code" := DeferralPostBuffer."Tax Area Code";
- "Tax Liable" := DeferralPostBuffer."Tax Liable";
- "Tax Group Code" := DeferralPostBuffer."Tax Group Code";
- "Use Tax" := DeferralPostBuffer."Use Tax";
-
- OnAfterCopyFromDeferralPostBuffer(Rec, DeferralPostBuffer);
- end;
-
- ///
- /// Updates the Account ID field based on the G/L Account No.
- ///
- procedure UpdateAccountID()
- var
- GLAccount: Record "G/L Account";
- begin
- if "G/L Account No." = '' then begin
- Clear("Account Id");
- exit;
- end;
-
- if not GLAccount.Get("G/L Account No.") then
- exit;
-
- "Account Id" := GLAccount.SystemId;
- end;
-
- local procedure UpdateAccountNo()
- var
- GLAccount: Record "G/L Account";
- begin
- if IsNullGuid("Account Id") then
- exit;
-
- if not GLAccount.GetBySystemId("Account Id") then
- exit;
-
- "G/L Account No." := GLAccount."No.";
- end;
-
- local procedure SetVATDate(var GenJnlLine: Record "Gen. Journal Line")
- begin
- if GenJnlLine."VAT Reporting Date" = 0D then
- "VAT Reporting Date" := GeneralLedgerSetup.GetVATDate(GenJnlLine."Posting Date", GenJnlLine."Document Date")
- else
- "VAT Reporting Date" := GenJnlLine."VAT Reporting Date";
- end;
-
- ///
- /// Integration event raised after copying G/L entry values from deferral posting buffer.
- /// Enables extensions to modify G/L entry fields during deferral posting.
- ///
- /// G/L entry being updated
- /// Source deferral posting buffer
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyFromDeferralPostBuffer(var GLEntry: Record "G/L Entry"; DeferralPostingBuffer: Record "Deferral Posting Buffer")
- begin
- end;
-
- ///
- /// Integration event raised after copying posting groups from detailed CV ledger entry buffer.
- /// Enables extensions to modify posting group assignments during CV entry processing.
- ///
- /// G/L entry being updated
- /// Source detailed CV ledger entry buffer
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPostingGroupsFromDtldCVBuf(var GLEntry: Record "G/L Entry"; DtldCVLedgEntryBuf: Record "Detailed CV Ledg. Entry Buffer")
- begin
- end;
-
- ///
- /// Integration event raised after copying posting groups from another G/L entry.
- /// Enables extensions to modify posting group assignments during G/L entry processing.
- ///
- /// G/L entry being updated
- /// Source G/L entry with posting groups to copy
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPostingGroupsFromGLEntry(var GLEntry: Record "G/L Entry"; FromGLEntry: Record "G/L Entry");
- begin
- end;
-
- ///
- /// Integration event raised after copying posting groups from general journal line.
- /// Enables extensions to modify posting group assignments during journal posting.
- ///
- /// G/L entry being updated
- /// Source general journal line
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPostingGroupsFromGenJnlLine(var GLEntry: Record "G/L Entry"; GenJournalLine: Record "Gen. Journal Line")
- begin
- end;
-
- ///
- /// Integration event raised after copying posting groups from VAT entry.
- /// Enables extensions to modify posting group assignments during VAT processing.
- ///
- /// G/L entry being updated
- /// Source VAT entry
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPostingGroupsFromVATEntry(var GLEntry: Record "G/L Entry"; VATEntry: Record "VAT Entry")
- begin
- end;
-
- ///
- /// Integration event raised after updating debit and credit amounts.
- /// Enables extensions to modify debit/credit calculations during posting.
- ///
- /// G/L entry with updated debit/credit amounts
- /// Indicates whether this is a correction entry
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateDebitCredit(var GLEntry: Record "G/L Entry"; Correction: Boolean)
- begin
- end;
-
- ///
- /// Integration event raised before showing related value entries.
- /// Enables extensions to modify value entry filtering and presentation.
- ///
- /// Value entry record for filtering
- /// G/L item ledger relation record
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowValueEntries(var ValueEntry: Record "Value Entry"; var GLItemLedgRelation: Record "G/L - Item Ledger Relation")
- begin
- end;
-
- ///
- /// Integration event raised by the local functionality report G/L Account Statement.
- /// Enables apps to filter out G/L Entries based on their review status
- ///
- /// G/L entry record for filtering
- /// Specifies whether to filter on reviewed or not reviewed entries
- /// Specifies the date to be used for filtering on review date
- /// Specifies true if and only if the report should skip the G/L entry based on its review status
- [IntegrationEvent(false, false)]
- procedure OnSkipGLEntryByReviewStatus(var GLEntry: Record "G/L Entry"; ReviewStatus: Option All,Reviewed,"Not Reviewed"; EvaluationDate: Date; var Skip: Boolean)
- begin
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Ledger/GeneralLedgerEntries.Page.al b/src/Layers/NL/BaseApp/Finance/GeneralLedger/Ledger/GeneralLedgerEntries.Page.al
index 4b6fc5e688..c0399615ce 100644
--- a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Ledger/GeneralLedgerEntries.Page.al
+++ b/src/Layers/NL/BaseApp/Finance/GeneralLedger/Ledger/GeneralLedgerEntries.Page.al
@@ -203,7 +203,7 @@ page 20 "General Ledger Entries"
}
field("VAT Amount"; Rec."VAT Amount")
{
- ApplicationArea = Basic, Suite;
+ ApplicationArea = VAT;
Editable = false;
Visible = false;
}
@@ -213,13 +213,6 @@ page 20 "General Ledger Entries"
Editable = false;
Visible = false;
}
- field("Remaining Amount"; Rec."Remaining Amount")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ToolTip = 'Specifies the amount that remains to be applied to before the entry is fully applied.';
- Visible = false;
- }
field("Bal. Account Type"; Rec."Bal. Account Type")
{
ApplicationArea = Basic, Suite;
@@ -319,13 +312,6 @@ page 20 "General Ledger Entries"
ApplicationArea = Basic, Suite;
Editable = false;
}
- field(Open; Rec.Open)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ToolTip = 'Specifies if the general ledger entry is open.';
- Visible = false;
- }
field("Dimension Set ID"; Rec."Dimension Set ID")
{
ApplicationArea = Dimensions;
diff --git a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Setup/GeneralLedgerSetup.Page.al b/src/Layers/NL/BaseApp/Finance/GeneralLedger/Setup/GeneralLedgerSetup.Page.al
deleted file mode 100644
index 3bad63b699..0000000000
--- a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Setup/GeneralLedgerSetup.Page.al
+++ /dev/null
@@ -1,951 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Finance.GeneralLedger.Setup;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.Setup;
-using Microsoft.CashFlow.Setup;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.FinancialReports;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.Finance.VAT.Reporting;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.Foundation.Period;
-using System.Security.User;
-using System.Utilities;
-
-///
-/// Setup page for configuring core General Ledger parameters including posting permissions, currency settings, VAT handling, and dimension management.
-/// Provides access to critical financial system configuration affecting all accounting transactions and reporting.
-///
-///
-/// Key configuration areas: posting date controls, VAT settings, currency precision, dimension setup, job queue integration.
-/// Critical system setup affecting all financial transactions, reporting, and compliance requirements.
-/// Includes advanced features for additional reporting currency, unrealized VAT, and automated posting processes.
-///
-page 118 "General Ledger Setup"
-{
- AdditionalSearchTerms = 'finance setup,general ledger setup,g/l setup';
- ApplicationArea = Basic, Suite;
- Caption = 'General Ledger Setup';
- DeleteAllowed = false;
- InsertAllowed = false;
- PageType = Card;
- SourceTable = "General Ledger Setup";
- UsageCategory = Administration;
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field("Allow Posting From"; Rec."Allow Posting From")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Allow Posting To"; Rec."Allow Posting To")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Allow Posting From DateFormula"; Rec."Allow Posting From DateFormula")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- ToolTip = 'Specifies a date formula to calculate the earliest date, relative to today''s date, on which posting to the company books is allowed.';
- }
- field("Allow Posting To DateFormula"; Rec."Allow Posting To DateFormula")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- ToolTip = 'Specifies a date formula to calculate the latest date, relative to today''s date, on which posting to the company books is allowed.';
- }
- field("Allow Deferral Posting From"; Rec."Allow Deferral Posting From")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Allow Deferral Posting To"; Rec."Allow Deferral Posting To")
- {
- ApplicationArea = Basic, Suite;
- }
- field("VAT Reporting Date Usage"; Rec."VAT Reporting Date Usage")
- {
- ApplicationArea = VAT;
-
- trigger OnValidate()
- begin
- if Rec."VAT Reporting Date Usage" = Rec."VAT Reporting Date Usage"::Disabled then
- Rec."VAT Reporting Date" := Rec."VAT Reporting Date"::"Posting Date";
- end;
- }
- group(VATReportingDateGroup)
- {
- Visible = Rec."VAT Reporting Date Usage" <> Rec."VAT Reporting Date Usage"::Disabled;
- ShowCaption = false;
- field("Default VAT Reporting Date"; Rec."VAT Reporting Date")
- {
- ApplicationArea = VAT;
- }
- }
- field("Register Time"; Rec."Register Time")
- {
- ApplicationArea = Jobs;
- Importance = Additional;
- }
- field("Local Address Format"; Rec."Local Address Format")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Local Cont. Addr. Format"; Rec."Local Cont. Addr. Format")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Req.Country/Reg. Code in Addr."; Rec."Req.Country/Reg. Code in Addr.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Inv. Rounding Precision (LCY)"; Rec."Inv. Rounding Precision (LCY)")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the size of the interval to be used when rounding invoice amounts in LCY. Examples: 1.00: Round to whole numbers (no decimals - divisible by 1.00), 0.05: Round to a number divisible by 0.05, 0.01: No rounding (ordinary currency decimals). On the Currencies page, you specify how to round invoices in foreign currencies.';
- }
- field("Inv. Rounding Type (LCY)"; Rec."Inv. Rounding Type (LCY)")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies how to round invoice amounts. The contents of this field determine whether the invoice amount to be rounded will be rounded up or down to the nearest interval as specified in the Invoice Rounding Precision field. If you select Nearest, digits that are higher than or equal to 5 will be rounded up, and digits that are lower than or equal to 5 will be rounded down.';
- }
- field(AmountRoundingPrecision; Rec."Amount Rounding Precision")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Amount Rounding Precision (LCY)';
- }
- field(AmountDecimalPlaces; Rec."Amount Decimal Places")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Amount Decimal Places (LCY)';
- }
- field(UnitAmountRoundingPrecision; Rec."Unit-Amount Rounding Precision")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Unit-Amount Rounding Precision (LCY)';
- }
- field(UnitAmountDecimalPlaces; Rec."Unit-Amount Decimal Places")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Unit-Amount Decimal Places (LCY)';
- }
- field("Allow G/L Acc. Deletion Before"; Rec."Allow G/L Acc. Deletion Before")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Block Deletion of G/L Accounts"; Rec."Block Deletion of G/L Accounts")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Check G/L Account Usage"; Rec."Check G/L Account Usage")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Mark Cr. Memos as Corrections"; Rec."Mark Cr. Memos as Corrections")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Pmt. Disc. Excl. VAT"; Rec."Pmt. Disc. Excl. VAT")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Adjust for Payment Disc."; Rec."Adjust for Payment Disc.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Unrealized VAT"; Rec."Unrealized VAT")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Prepayment Unrealized VAT"; Rec."Prepayment Unrealized VAT")
- {
- ApplicationArea = Prepayments;
- Importance = Additional;
- }
- field("Max. VAT Difference Allowed"; Rec."Max. VAT Difference Allowed")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Tax Invoice Renaming Threshold"; Rec."Tax Invoice Renaming Threshold")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("VAT Rounding Type"; Rec."VAT Rounding Type")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Control VAT Period"; Rec."Control VAT Period")
- {
- ApplicationArea = VAT;
- ToolTip = 'Specifies a way of using VAT Date against VAT Return Periods. If you choose ‘Block posting within closed and warn for released period’, system will not allow postings in closed VAT Return Period, but if the period is not closed, but VAT returns are released or submitted, user will be warned what try to post an entry with VAT Date in this period. If you choose ‘Block posting within closed period’, system will still not allow postings in closed VAT Return Period, but there will be no warnings for release or submitted VAT returns. If you choose ‘Warn when posting in closed period’, system will not block posting entry with VAT Date in the closed VAT return period, but it will show warning message before posting. And if you choose ‘Disabled’ options, system will allow you to post without any control regardless of VAT return or period status.';
- }
- field("Bank Account Nos."; Rec."Bank Account Nos.")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Bill-to/Sell-to VAT Calc."; Rec."Bill-to/Sell-to VAT Calc.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Print VAT specification in LCY"; Rec."Print VAT specification in LCY")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Show Amounts"; Rec."Show Amounts")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- ToolTip = 'Specifies which type of amounts are shown in journals and in ledger entries windows. Amount Only: The Amount and Amount (LCY) fields are shown. Debit/Credit Only: The Debit Amount, Debit Amount (LCY), Credit Amount, and Credit Amount (LCY) fields are shown. All Amounts: All amount fields are shown. ';
- }
- field("Hide Payment Method Code"; Rec."Hide Payment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Hide Company Bank Account"; Rec."Hide Company Bank Account")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field(PostingPreviewType; Rec."Posting Preview Type")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field(SEPANonEuroExport; Rec."SEPA Non-Euro Export")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field(SEPAExportWoBankAccData; Rec."SEPA Export w/o Bank Acc. Data")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Local SEPA Instr. Priority"; Rec."Local SEPA Instr. Priority")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies if you want to use the local SEPA functionality to generate the InstrPrty XML element in documents. Otherwise, the generic functionality will be used';
- }
- field("Journal Templ. Name Mandatory"; Rec."Journal Templ. Name Mandatory")
- {
- ApplicationArea = BasicBE;
- Importance = Additional;
- Visible = false;
-
- trigger OnValidate()
- begin
- IsJournalTemplatesVisible := Rec."Journal Templ. Name Mandatory";
- CurrPage.Update();
- end;
- }
- field(EnableDataCheck; Rec."Enable Data Check")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field(CheckSourceCurrencyConsistency; Rec."Check Source Curr. Consistency")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field(UseConcurrentPosting; Rec."Use Concurrent Posting")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- }
- group(Control1900309501)
- {
- Caption = 'Dimensions';
- field("Global Dimension 1 Code"; Rec."Global Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
- }
- field("Global Dimension 2 Code"; Rec."Global Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
- }
- field("Shortcut Dimension 1 Code"; Rec."Shortcut Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
- Importance = Additional;
- }
- field("Shortcut Dimension 2 Code"; Rec."Shortcut Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
- Importance = Additional;
- }
- field("Shortcut Dimension 3 Code"; Rec."Shortcut Dimension 3 Code")
- {
- ApplicationArea = Dimensions;
- Importance = Additional;
- }
- field("Shortcut Dimension 4 Code"; Rec."Shortcut Dimension 4 Code")
- {
- ApplicationArea = Dimensions;
- Importance = Additional;
- }
- field("Shortcut Dimension 5 Code"; Rec."Shortcut Dimension 5 Code")
- {
- ApplicationArea = Dimensions;
- Importance = Additional;
- }
- field("Shortcut Dimension 6 Code"; Rec."Shortcut Dimension 6 Code")
- {
- ApplicationArea = Dimensions;
- Importance = Additional;
- }
- field("Shortcut Dimension 7 Code"; Rec."Shortcut Dimension 7 Code")
- {
- ApplicationArea = Dimensions;
- Importance = Additional;
- }
- field("Shortcut Dimension 8 Code"; Rec."Shortcut Dimension 8 Code")
- {
- ApplicationArea = Dimensions;
- Importance = Additional;
- }
- }
- group(Currency)
- {
- Caption = 'Currency';
-
- field("LCY Code"; Rec."LCY Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Local Currency Symbol"; Rec."Local Currency Symbol")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Local Currency Description"; Rec."Local Currency Description")
- {
- ApplicationArea = Basic, Suite;
- }
- field("EMU Currency"; Rec."EMU Currency")
- {
- ApplicationArea = BasicEU;
- Importance = Additional;
- }
- }
- group("Background Posting")
- {
- Caption = 'Background Posting';
- field("Post with Job Queue"; Rec."Post with Job Queue")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Post & Print with Job Queue"; Rec."Post & Print with Job Queue")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Job Queue Category Code"; Rec."Job Queue Category Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Notify On Success"; Rec."Notify On Success")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Report Output Type"; Rec."Report Output Type")
- {
- ApplicationArea = Basic, Suite;
- }
- }
- group(Reporting)
- {
- Caption = 'Reporting';
- field("Additional Reporting Currency"; Rec."Additional Reporting Currency")
- {
- ApplicationArea = Suite;
-
- trigger OnValidate()
- var
- ConfirmManagement: Codeunit "Confirm Management";
- Confirmed: Boolean;
- begin
- if Rec."Additional Reporting Currency" <> xRec."Additional Reporting Currency" then begin
- if Rec."Additional Reporting Currency" = '' then
- Confirmed := ConfirmManagement.GetResponseOrDefault(Text002, true)
- else
- Confirmed := ConfirmManagement.GetResponseOrDefault(Text003, true);
- if not Confirmed then
- Error('');
- end;
- end;
- }
- field("VAT Exchange Rate Adjustment"; Rec."VAT Exchange Rate Adjustment")
- {
- ApplicationArea = Suite;
- }
- field("Acc. Receivables Category"; Rec."Acc. Receivables Category")
- {
- ApplicationArea = All;
- Tooltip = 'Specifies the G/L Account Category that will be used for the Account Receivables accounts.';
- }
- field("Acc. Payables Category"; Rec."Acc. Payables Category")
- {
- ApplicationArea = Suite;
- Tooltip = 'Specifies the G/L Account Category that will be used for the Account Payables accounts.';
- }
- group("Financial Reports")
- {
- Caption = 'Financial Reports';
-
- field("Acc. Sched. for Balance Sheet"; Rec."Fin. Rep. for Balance Sheet")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Balance Sheet Report';
- }
- field("Acc. Sched. for Income Stmt."; Rec."Fin. Rep. for Income Stmt.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Income Statement Report';
- }
- field("Acc. Sched. for Cash Flow Stmt"; Rec."Fin. Rep. for Cash Flow Stmt")
- {
- ApplicationArea = Suite;
- Caption = 'Cash Flow Statement Report';
- }
- field("Acc. Sched. for Retained Earn."; Rec."Fin. Rep. for Retained Earn.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Retained Earnings Report';
- }
- field("Fin. Rep. Bal. Sheet Row"; Rec."Fin. Rep. Bal. Sheet Row")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Row Definition for Balance Sheet';
- }
- field("Fin. Rep. Income Stmt. Row"; Rec."Fin. Rep. Income Stmt. Row")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Row Definition for Income Statement';
- }
- field("Fin. Rep. Cash Flow Stmt. Row"; Rec."Fin. Rep. Cash Flow Stmt. Row")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Row Definition for Cash Flow Statement';
- }
- field("Fin. Rep. Retained Earn. Row"; Rec."Fin. Rep. Retained Earn. Row")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Row Definition for Retained Earnings';
- }
- field("Fin. Rep. Bal. Sheet Column"; Rec."Fin. Rep. Bal. Sheet Column")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Column Definition for Balance Sheet';
- }
- field("Fin. Rep. Net Change Column"; Rec."Fin. Rep. Net Change Column")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Column Definition for Net Change';
- }
- field("Fin. Rep. Period Type"; Rec."Fin. Rep. Period Type")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Default View by';
-#if not CLEAN27
- Visible = FinancialReportDefaultsEnabled;
-#endif
- }
- field("Fin. Rep. Neg. Amount Format"; Rec."Fin. Rep. Neg. Amount Format")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Default Negative Amount Format';
-#if not CLEAN27
- Visible = FinancialReportDefaultsEnabled;
-#endif
- }
- field("Fin. Rep. Company Logo Pos."; Rec."Fin. Rep. Company Logo Pos.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Default Company Logo Position';
- }
- field(DefaultFinancialReportStatus; Rec.DefaultFinancialReportStatus)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Default Status';
- }
- }
- }
- group(Application)
- {
- Caption = 'Application';
- field("Appln. Rounding Precision"; Rec."Appln. Rounding Precision")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Pmt. Disc. Tolerance Warning"; Rec."Pmt. Disc. Tolerance Warning")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Pmt. Disc. Tolerance Posting"; Rec."Pmt. Disc. Tolerance Posting")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Payment Discount Grace Period"; Rec."Payment Discount Grace Period")
- {
- ApplicationArea = Basic, Suite;
-
- trigger OnValidate()
- var
- PaymentToleranceMgt: Codeunit "Payment Tolerance Management";
- ConfirmManagement: Codeunit "Confirm Management";
- begin
- if ConfirmManagement.GetResponseOrDefault(Text001, true) then
- PaymentToleranceMgt.CalcGracePeriodCVLedgEntry(Rec."Payment Discount Grace Period");
- end;
- }
- field("Payment Tolerance Warning"; Rec."Payment Tolerance Warning")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Payment Tolerance Posting"; Rec."Payment Tolerance Posting")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Payment Tolerance %"; Rec."Payment Tolerance %")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Max. Payment Tolerance Amount"; Rec."Max. Payment Tolerance Amount")
- {
- ApplicationArea = Basic, Suite;
- }
- field("App. Dimension Posting"; Rec."App. Dimension Posting")
- {
- ApplicationArea = Basic, Suite;
- }
- }
- group(Telebanking)
- {
- Caption = 'Telebanking';
- field("Local Currency"; Rec."Local Currency")
- {
- ApplicationArea = BasicEU;
- ToolTip = 'Specifies whether Euro currency is used as the local currency (LCY).';
- }
- field("Currency Euro"; Rec."Currency Euro")
- {
- ApplicationArea = BasicEU;
- ToolTip = 'Specifies what currency in the Currency table represents the Euro currency.';
- }
- }
- group("Gen. Journal Templates")
- {
- Caption = 'Journal Templates';
- Visible = IsJournalTemplatesVisible;
-
- field("Adjust ARC Jnl. Template Name"; Rec."Adjust ARC Jnl. Template Name")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Adjust ARC Jnl. Batch Name"; Rec."Adjust ARC Jnl. Batch Name")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Apply Jnl. Template Name"; Rec."Apply Jnl. Template Name")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Apply Jnl. Batch Name"; Rec."Apply Jnl. Batch Name")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Job WIP Jnl. Template Name"; Rec."Job WIP Jnl. Template Name")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Job WIP Jnl. Batch Name"; Rec."Job WIP Jnl. Batch Name")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Bank Acc. Recon. Template Name"; Rec."Bank Acc. Recon. Template Name")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Bank Acc. Recon. Batch Name"; Rec."Bank Acc. Recon. Batch Name")
- {
- ApplicationArea = Basic, Suite;
- }
- }
- group("Payroll Transaction Import")
- {
- Caption = 'Payroll Transaction Import';
- Visible = false;
- field("Payroll Trans. Import Format"; Rec."Payroll Trans. Import Format")
- {
- ApplicationArea = Suite;
- Visible = false;
- }
- }
- }
- area(factboxes)
- {
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- Visible = false;
- }
- }
- }
-
- actions
- {
- area(processing)
- {
- group("F&unctions")
- {
- Caption = 'F&unctions';
- Image = "Action";
- action(ChangeGlobalDimensions)
- {
- AccessByPermission = TableData Dimension = M;
- ApplicationArea = Dimensions;
- Caption = 'Change Global Dimensions';
- Ellipsis = true;
- Image = ChangeDimensions;
- RunObject = Page "Change Global Dimensions";
- ToolTip = 'Change one or both of the global dimensions.';
- }
- action("Change Payment &Tolerance")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Change Payment &Tolerance';
- Image = ChangePaymentTolerance;
- ToolTip = 'Change the maximum payment tolerance and/or the payment tolerance percentage.';
-
- trigger OnAction()
- var
- Currency: Record Currency;
- ChangePmtTol: Report "Change Payment Tolerance";
- begin
- Currency.Init();
- ChangePmtTol.SetCurrency(Currency);
- ChangePmtTol.RunModal();
- end;
- }
- }
- }
- area(navigation)
- {
- action("Accounting Periods")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Accounting Periods';
- Image = AccountingPeriods;
- RunObject = Page "Accounting Periods";
- ToolTip = 'Set up the number of accounting periods, such as 12 monthly periods, within the fiscal year and specify which period is the start of the new fiscal year.';
- }
- action(Dimensions)
- {
- ApplicationArea = Dimensions;
- Caption = 'Dimensions';
- Image = Dimensions;
- RunObject = Page Dimensions;
- ToolTip = 'Set up dimensions, such as area, project, or department, that you can assign to sales and purchase documents to distribute costs and analyze transaction history.';
- }
- action("User Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'User Setup';
- Image = UserSetup;
- RunObject = Page "User Setup";
- ToolTip = 'Set up users to restrict access to post to the general ledger.';
- }
- action("Cash Flow Setup")
- {
- ApplicationArea = Suite;
- Caption = 'Cash Flow Setup';
- Image = CashFlowSetup;
- RunObject = Page "Cash Flow Setup";
- ToolTip = 'Set up the accounts where cash flow figures for sales, purchase, and fixed-asset transactions are stored.';
- }
- action("Bank Export/Import Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Bank Export/Import Setup';
- Image = ImportExport;
- RunObject = Page "Bank Export/Import Setup";
- ToolTip = 'Set up the formats for exporting vendor payments and for importing bank statements.';
- }
- group("General Ledger Posting")
- {
- Caption = 'General Ledger Posting';
- action("General Posting Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'General Posting Setup';
- Image = GeneralPostingSetup;
- RunObject = Page "General Posting Setup";
- ToolTip = 'Set up combinations of general business and general product posting groups by specifying account numbers for posting of sales and purchase transactions.';
- }
- action("Gen. Business Posting Groups")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Gen. Business Posting Groups';
- Image = GeneralPostingSetup;
- RunObject = Page "Gen. Business Posting Groups";
- ToolTip = 'Set up the trade-type posting groups that you assign to customer and vendor cards to link transactions with the appropriate general ledger account.';
- }
- action("Gen. Product Posting Groups")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Gen. Product Posting Groups';
- Image = GeneralPostingSetup;
- RunObject = Page "Gen. Product Posting Groups";
- ToolTip = 'Set up the item-type posting groups that you assign to customer and vendor cards to link transactions with the appropriate general ledger account.';
- }
- }
- group("VAT Posting")
- {
- Caption = 'VAT Posting';
- action("VAT Posting Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'VAT Posting Setup';
- Image = VATPostingSetup;
- RunObject = Page "VAT Posting Setup";
- ToolTip = 'Set up how tax must be posted to the general ledger.';
- }
- action("VAT Business Posting Groups")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'VAT Business Posting Groups';
- Image = VATPostingSetup;
- RunObject = Page "VAT Business Posting Groups";
- ToolTip = 'Set up the trade-type posting groups that you assign to customer and vendor cards to link VAT amounts with the appropriate general ledger account.';
- }
- action("VAT Product Posting Groups")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'VAT Product Posting Groups';
- Image = VATPostingSetup;
- RunObject = Page "VAT Product Posting Groups";
- ToolTip = 'Set up the item-type posting groups that you assign to customer and vendor cards to link VAT amounts with the appropriate general ledger account.';
- }
- action("VAT Report Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'VAT Report Setup';
- Image = VATPostingSetup;
- RunObject = Page "VAT Report Setup";
- ToolTip = 'Set up number series and options for the report that you periodically send to the authorities to declare your VAT.';
- }
- }
- group("Bank Posting")
- {
- Caption = 'Bank Posting';
- action("Bank Account Posting Groups")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Bank Account Posting Groups';
- Image = BankAccount;
- RunObject = Page "Bank Account Posting Groups";
- ToolTip = 'Set up posting groups, so that payments in and out of each bank account are posted to the specified general ledger account.';
- }
- }
- group("Journal Templates")
- {
- Caption = 'Journal Templates';
- action("General Journal Templates")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'General Journal Templates';
- Image = JournalSetup;
- RunObject = Page "General Journal Templates";
- ToolTip = 'Set up templates for the journals that you use for bookkeeping tasks. Templates allow you to work in a journal window that is designed for a specific purpose.';
- }
- action("VAT Statement Templates")
- {
- ApplicationArea = VAT;
- Caption = 'VAT Statement Templates';
- Image = VATStatement;
- RunObject = Page "VAT Statement Templates";
- ToolTip = 'Set up the reports that you use to settle VAT and report to the customs and tax authorities.';
- }
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process';
-
- actionref("Change Payment &Tolerance_Promoted"; "Change Payment &Tolerance")
- {
- }
- actionref(ChangeGlobalDimensions_Promoted; ChangeGlobalDimensions)
- {
- }
- }
- group(Category_Category5)
- {
- Caption = 'Posting', Comment = 'Generated from the PromotedActionCategories property index 4.';
-
- actionref("General Posting Setup_Promoted"; "General Posting Setup")
- {
- }
- actionref("Gen. Business Posting Groups_Promoted"; "Gen. Business Posting Groups")
- {
- }
- actionref("Gen. Product Posting Groups_Promoted"; "Gen. Product Posting Groups")
- {
- }
- }
- group(Category_Category4)
- {
- Caption = 'General', Comment = 'Generated from the PromotedActionCategories property index 3.';
-
- actionref("Accounting Periods_Promoted"; "Accounting Periods")
- {
- }
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref("User Setup_Promoted"; "User Setup")
- {
- }
- actionref("Cash Flow Setup_Promoted"; "Cash Flow Setup")
- {
- }
- }
- group(Category_Category6)
- {
- Caption = 'VAT', Comment = 'Generated from the PromotedActionCategories property index 5.';
-
- actionref("VAT Statement Templates_Promoted"; "VAT Statement Templates")
- {
- }
- actionref("VAT Posting Setup_Promoted"; "VAT Posting Setup")
- {
- }
- actionref("VAT Business Posting Groups_Promoted"; "VAT Business Posting Groups")
- {
- }
- actionref("VAT Product Posting Groups_Promoted"; "VAT Product Posting Groups")
- {
- }
- actionref("VAT Report Setup_Promoted"; "VAT Report Setup")
- {
- }
- }
- group(Category_Category7)
- {
- Caption = 'Bank', Comment = 'Generated from the PromotedActionCategories property index 6.';
-
- actionref("Bank Export/Import Setup_Promoted"; "Bank Export/Import Setup")
- {
- }
- actionref("Bank Account Posting Groups_Promoted"; "Bank Account Posting Groups")
- {
- }
- }
- group(Category_Category8)
- {
- Caption = 'Journal Templates', Comment = 'Generated from the PromotedActionCategories property index 7.';
-
- actionref("General Journal Templates_Promoted"; "General Journal Templates")
- {
- }
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- }
- }
-
- trigger OnClosePage()
- var
- SessionSettings: SessionSettings;
- begin
- if IsShortcutDimensionModified() then
- SessionSettings.RequestSessionUpdate(false);
- end;
-
- trigger OnInit()
- var
- FinancialReportMgt: Codeunit "Financial Report Mgt.";
- begin
- FinancialReportMgt.Initialize();
- end;
-
- trigger OnOpenPage()
- var
-#if not CLEAN27
-#pragma warning disable AL0432
- FeatureFinancialReportDef: Codeunit "Feature - Fin. Report Default";
-#pragma warning restore AL0432
-#endif
- begin
- Rec.Reset();
- if not Rec.Get() then begin
- Rec.Init();
- Rec.Insert();
- end;
- xGeneralLedgerSetup := Rec;
-
- IsJournalTemplatesVisible := Rec."Journal Templ. Name Mandatory";
-
-#if not CLEAN27
- FinancialReportDefaultsEnabled := FeatureFinancialReportDef.IsDefaultsFeatureEnabled();
-#endif
- end;
-
- var
- xGeneralLedgerSetup: Record "General Ledger Setup";
- IsJournalTemplatesVisible: Boolean;
-#if not CLEAN27
- FinancialReportDefaultsEnabled: Boolean;
-#endif
-
-#pragma warning disable AA0074
- Text001: Label 'Do you want to change all open entries for every customer and vendor that are not blocked?';
- Text002: Label 'If you delete the additional reporting currency, future general ledger entries are posted in LCY only. Deleting the additional reporting currency does not affect already posted general ledger entries.\\Are you sure that you want to delete the additional reporting currency?';
- Text003: Label 'If you change the additional reporting currency, future general ledger entries are posted in the new reporting currency and in LCY. To enable the additional reporting currency, a batch job opens, and running the batch job recalculates already posted general ledger entries in the new additional reporting currency.\Entries will be deleted in the Analysis View if it is unblocked, and an update will be necessary.\\Are you sure that you want to change the additional reporting currency?';
-#pragma warning restore AA0074
-
- local procedure IsShortcutDimensionModified(): Boolean
- begin
- exit(
- (Rec."Shortcut Dimension 1 Code" <> xGeneralLedgerSetup."Shortcut Dimension 1 Code") or
- (Rec."Shortcut Dimension 2 Code" <> xGeneralLedgerSetup."Shortcut Dimension 2 Code") or
- (Rec."Shortcut Dimension 3 Code" <> xGeneralLedgerSetup."Shortcut Dimension 3 Code") or
- (Rec."Shortcut Dimension 4 Code" <> xGeneralLedgerSetup."Shortcut Dimension 4 Code") or
- (Rec."Shortcut Dimension 5 Code" <> xGeneralLedgerSetup."Shortcut Dimension 5 Code") or
- (Rec."Shortcut Dimension 6 Code" <> xGeneralLedgerSetup."Shortcut Dimension 6 Code") or
- (Rec."Shortcut Dimension 7 Code" <> xGeneralLedgerSetup."Shortcut Dimension 7 Code") or
- (Rec."Shortcut Dimension 8 Code" <> xGeneralLedgerSetup."Shortcut Dimension 8 Code"));
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Setup/GeneralLedgerSetup.Table.al b/src/Layers/NL/BaseApp/Finance/GeneralLedger/Setup/GeneralLedgerSetup.Table.al
deleted file mode 100644
index 66bd42c265..0000000000
--- a/src/Layers/NL/BaseApp/Finance/GeneralLedger/Setup/GeneralLedgerSetup.Table.al
+++ /dev/null
@@ -1,1896 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Finance.GeneralLedger.Setup;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.Finance.Analysis;
-using Microsoft.Finance.Consolidation;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.FinancialReports;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Ledger;
-using Microsoft.Finance.GeneralLedger.Preview;
-using Microsoft.Finance.SalesTax;
-using Microsoft.Finance.VAT.Calculation;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.FixedAssets.Insurance;
-using Microsoft.FixedAssets.Ledger;
-using Microsoft.FixedAssets.Maintenance;
-using Microsoft.Foundation.Enums;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Inventory.Ledger;
-using Microsoft.Inventory.Setup;
-using Microsoft.Projects.Project.Ledger;
-using Microsoft.Projects.Resources.Ledger;
-using Microsoft.Purchases.Payables;
-using Microsoft.Sales.Receivables;
-using System.Environment;
-using System.IO;
-using System.Security.User;
-using System.Telemetry;
-using System.Threading;
-
-///
-/// Core financial system configuration table controlling posting permissions, currency settings, VAT handling, and dimension management.
-/// Manages global financial parameters including rounding precision, job queue integration, and additional reporting currency setup.
-///
-///
-/// Singleton table providing system-wide GL configuration. Key integrations: Currency, VAT, Dimensions, Job Queue.
-/// Extensibility: OnAfterAdjustAddReportingCurrency, OnAfterValidateShortcutDimCode events available.
-/// Critical setup affecting all financial transactions and reporting throughout Business Central.
-///
-table 98 "General Ledger Setup"
-{
- Caption = 'General Ledger Setup';
- DataClassification = CustomerContent;
-
- fields
- {
- ///
- /// Primary key field for the singleton General Ledger Setup record.
- ///
- field(1; "Primary Key"; Code[10])
- {
- AllowInCustomizations = Never;
- Caption = 'Primary Key';
- }
- ///
- /// Earliest date allowed for posting transactions to the general ledger.
- ///
- field(2; "Allow Posting From"; Date)
- {
- Caption = 'Allow Posting From';
- ToolTip = 'Specifies the earliest date on which posting to the company books is allowed.';
-
- trigger OnValidate()
- begin
- CheckAllowedPostingDates(0);
-
- if xRec."Allow Posting From" <> Rec."Allow Posting From" then begin
- if Rec."Allow Posting From" <> 0D then
- Evaluate(Rec."Allow Posting From DateFormula", '');
-
- CheckDateRange();
- end;
- end;
- }
- ///
- /// Latest date allowed for posting transactions to the general ledger.
- ///
- field(3; "Allow Posting To"; Date)
- {
- Caption = 'Allow Posting To';
- ToolTip = 'Specifies the last date on which posting to the company books is allowed.';
-
- trigger OnValidate()
- begin
- CheckAllowedPostingDates(0);
-
- if xRec."Allow Posting To" <> Rec."Allow Posting To" then begin
- if Rec."Allow Posting To" <> 0D then
- Evaluate(Rec."Allow Posting To DateFormula", '');
-
- CheckDateRange();
- end;
- end;
- }
- ///
- /// Records posting time in addition to posting date for audit trail and transaction tracking.
- ///
- field(4; "Register Time"; Boolean)
- {
- Caption = 'Register Time';
- ToolTip = 'Specifies whether to register users'' time usage defined as the time spent from when a user logs in to when the user logs out. Unexpected interruptions, such as idle session timeout, terminal server idle session timeout, or a client crash are not recorded. This setting can be overruled per user by filling in the Register Time field in the User Setup window.';
- }
- ///
- /// Earliest date allowed for posting deferral transactions to the general ledger.
- ///
- field(5; "Allow Deferral Posting From"; Date)
- {
- Caption = 'Allow Deferral Posting From';
- ToolTip = 'Specifies the earliest date on which deferral posting to the company books is allowed.';
-
- trigger OnValidate()
- begin
- CheckAllowedDeferralPostingDates(0);
- end;
- }
- ///
- /// Latest date allowed for posting deferral transactions to the general ledger.
- ///
- field(6; "Allow Deferral Posting To"; Date)
- {
- Caption = 'Allow Deferral Posting To';
- ToolTip = 'Specifies the last date on which deferral posting to the company books is allowed.';
-
- trigger OnValidate()
- begin
- CheckAllowedDeferralPostingDates(0);
- end;
- }
- ///
- /// Default VAT reporting date calculation method used when posting transactions with VAT.
- ///
- field(7; "VAT Reporting Date"; Enum "VAT Reporting Date")
- {
- Caption = 'Default VAT Date';
- ToolTip = 'Specifies the date used to include entries on VAT reports in a VAT period. This is either the date that the document was created or posted, depending on this setting.';
- }
- ///
- /// Controls whether VAT reporting date is enabled, disabled, or controlled by posting date.
- ///
- field(8; "VAT Reporting Date Usage"; Enum "VAT Reporting Date Usage")
- {
- Caption = 'VAT Date Usage';
- ToolTip = 'Specifies the usage of VAT date.';
-
- trigger OnValidate()
- begin
- FeatureTelemetry.LogUsage('0000J2U', VATDateFeatureTok, VATDateFeatureUsageMsg);
- end;
- }
- ///
- /// Calculates payment discounts excluding VAT amounts to reduce VAT-related rounding differences.
- ///
- field(28; "Pmt. Disc. Excl. VAT"; Boolean)
- {
- Caption = 'Pmt. Disc. Excl. VAT';
- ToolTip = 'Specifies if the payment discount is calculated based on amounts including or excluding VAT.';
-
- trigger OnValidate()
- begin
- if "Pmt. Disc. Excl. VAT" then
- TestField("Adjust for Payment Disc.", false)
- else
- TestField("VAT Tolerance %", 0);
- end;
- }
- ///
- /// Flow filter field for date-based filtering in related tables and reports.
- ///
- field(41; "Date Filter"; Date)
- {
- Caption = 'Date Filter';
- FieldClass = FlowFilter;
- }
- ///
- /// Flow filter field for filtering by the first global dimension.
- ///
- field(42; "Global Dimension 1 Filter"; Code[20])
- {
- CaptionClass = '1,3,1';
- Caption = 'Global Dimension 1 Filter';
- FieldClass = FlowFilter;
- TableRelation = "Dimension Value".Code where("Dimension Code" = field("Global Dimension 1 Code"));
- }
- ///
- /// Flow filter field for filtering by the second global dimension.
- ///
- field(43; "Global Dimension 2 Filter"; Code[20])
- {
- CaptionClass = '1,3,2';
- Caption = 'Global Dimension 2 Filter';
- FieldClass = FlowFilter;
- TableRelation = "Dimension Value".Code where("Dimension Code" = field("Global Dimension 2 Code"));
- }
- ///
- /// Flow field calculating total customer balances due filtered by dimensions and date.
- ///
- field(44; "Cust. Balances Due"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Initial Entry Due Date" = field("Date Filter")));
- Caption = 'Cust. Balances Due';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Flow field calculating total vendor balances due filtered by dimensions and date.
- ///
- field(45; "Vendor Balances Due"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- CalcFormula = - sum("Detailed Vendor Ledg. Entry"."Amount (LCY)" where("Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Initial Entry Due Date" = field("Date Filter")));
- Caption = 'Vendor Balances Due';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Enables unrealized VAT functionality for accounting systems using cash-based VAT reporting.
- ///
- field(48; "Unrealized VAT"; Boolean)
- {
- Caption = 'Unrealized VAT';
- ToolTip = 'Specifies whether to handle unrealized VAT, which is VAT that is calculated but not due until the invoice is paid.';
-
- trigger OnValidate()
- begin
- if not "Unrealized VAT" then begin
- VATPostingSetup.SetFilter(
- "Unrealized VAT Type", '>=%1', VATPostingSetup."Unrealized VAT Type"::Percentage);
- if VATPostingSetup.FindFirst() then
- Error(
- Text000, VATPostingSetup.TableCaption(),
- VATPostingSetup."VAT Bus. Posting Group", VATPostingSetup."VAT Prod. Posting Group",
- VATPostingSetup.FieldCaption("Unrealized VAT Type"), VATPostingSetup."Unrealized VAT Type");
- TaxJurisdiction.SetFilter(
- "Unrealized VAT Type", '>=%1', TaxJurisdiction."Unrealized VAT Type"::Percentage);
- if TaxJurisdiction.FindFirst() then
- Error(
- Text001, TaxJurisdiction.TableCaption(),
- TaxJurisdiction.Code, TaxJurisdiction.FieldCaption("Unrealized VAT Type"),
- TaxJurisdiction."Unrealized VAT Type");
- end;
- if "Unrealized VAT" then
- "Prepayment Unrealized VAT" := true
- else
- "Prepayment Unrealized VAT" := false;
- end;
- }
- ///
- /// Automatically adjusts VAT amounts when payment discounts are applied to maintain accurate VAT calculations.
- ///
- field(49; "Adjust for Payment Disc."; Boolean)
- {
- Caption = 'Adjust for Payment Disc.';
- ToolTip = 'Specifies whether to recalculate tax amounts when you post payments that trigger payment discounts.';
-
- trigger OnValidate()
- begin
- if "Adjust for Payment Disc." then begin
- TestField("Pmt. Disc. Excl. VAT", false);
- TestField("VAT Tolerance %", 0);
- end else begin
- VATPostingSetup.SetRange("Adjust for Payment Discount", true);
- if VATPostingSetup.FindFirst() then
- Error(
- Text002, VATPostingSetup.TableCaption(),
- VATPostingSetup."VAT Bus. Posting Group", VATPostingSetup."VAT Prod. Posting Group",
- VATPostingSetup.FieldCaption("Adjust for Payment Discount"));
- TaxJurisdiction.SetRange("Adjust for Payment Discount", true);
- if TaxJurisdiction.FindFirst() then
- Error(
- Text003, TaxJurisdiction.TableCaption(),
- TaxJurisdiction.Code, TaxJurisdiction.FieldCaption("Adjust for Payment Discount"));
- end;
- end;
- }
- ///
- /// Enables background posting of documents using the job queue system for improved user experience.
- ///
- field(50; "Post with Job Queue"; Boolean)
- {
- Caption = 'Post with Job Queue';
- ToolTip = 'Specifies if you use job queues to post general ledger documents in the background.';
-
- trigger OnValidate()
- begin
- if not "Post with Job Queue" then
- "Post & Print with Job Queue" := false;
- end;
- }
- ///
- /// Job queue category code used for organizing posting-related job queue entries.
- ///
- field(51; "Job Queue Category Code"; Code[10])
- {
- Caption = 'Job Queue Category Code';
- ToolTip = 'Specifies the code for the category of the job queue that you want to associate with background posting.';
- TableRelation = "Job Queue Category";
- }
- ///
- /// Priority level for posting job queue entries to control processing order.
- ///
- field(52; "Job Queue Priority for Post"; Integer)
- {
- Caption = 'Job Queue Priority for Post';
- InitValue = 1000;
- MinValue = 0;
-
- trigger OnValidate()
- begin
- if "Job Queue Priority for Post" < 0 then
- Error(Text001);
- end;
- }
- ///
- /// Enables background posting and printing of documents using the job queue system.
- ///
- field(53; "Post & Print with Job Queue"; Boolean)
- {
- Caption = 'Post & Print with Job Queue';
- ToolTip = 'Specifies if you use job queues to post and print general ledger documents in the background.';
-
- trigger OnValidate()
- begin
- if "Post & Print with Job Queue" then
- "Post with Job Queue" := true;
- end;
- }
- ///
- /// Priority level for post and print job queue entries to control processing order.
- ///
- field(54; "Job Q. Prio. for Post & Print"; Integer)
- {
- Caption = 'Job Q. Prio. for Post & Print';
- InitValue = 1000;
- MinValue = 0;
-
- trigger OnValidate()
- begin
- if "Job Queue Priority for Post" < 0 then
- Error(Text001);
- end;
- }
- ///
- /// Shows notification messages when background posting operations complete successfully.
- ///
- field(55; "Notify On Success"; Boolean)
- {
- Caption = 'Notify On Success';
- ToolTip = 'Specifies if a notification is sent when posting and printing is successfully completed.';
- }
- ///
- /// Marks credit memos as corrections for proper VAT and financial reporting compliance.
- ///
- field(56; "Mark Cr. Memos as Corrections"; Boolean)
- {
- Caption = 'Mark Cr. Memos as Corrections';
- ToolTip = 'Specifies whether to automatically mark a new credit memo as a corrective entry. Correction flag does not affect how inventory reconciled with general ledger.';
- }
- ///
- /// Format used for displaying local addresses on documents and reports.
- ///
- field(57; "Local Address Format"; Option)
- {
- Caption = 'Local Address Format';
- ToolTip = 'Specifies the format in which addresses must appear on printouts.';
- OptionCaption = 'Post Code+City,City+Post Code,City+County+Post Code,Blank Line+Post Code+City';
- OptionMembers = "Post Code+City","City+Post Code","City+County+Post Code","Blank Line+Post Code+City";
- }
- ///
- /// Precision used for invoice rounding calculations in local currency.
- ///
- field(58; "Inv. Rounding Precision (LCY)"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- Caption = 'Inv. Rounding Precision (LCY)';
-
- trigger OnValidate()
- begin
- if "Amount Rounding Precision" <> 0 then
- if "Inv. Rounding Precision (LCY)" <> Round("Inv. Rounding Precision (LCY)", "Amount Rounding Precision") then
- Error(
- Text004,
- FieldCaption("Inv. Rounding Precision (LCY)"), "Amount Rounding Precision");
- end;
- }
- ///
- /// Method used for invoice rounding calculations in local currency.
- ///
- field(59; "Inv. Rounding Type (LCY)"; Option)
- {
- Caption = 'Inv. Rounding Type (LCY)';
- OptionCaption = 'Nearest,Up,Down';
- OptionMembers = Nearest,Up,Down;
- }
- ///
- /// Position of contact address information on documents and communications.
- ///
- field(60; "Local Cont. Addr. Format"; Option)
- {
- Caption = 'Local Cont. Addr. Format';
- ToolTip = 'Specifies where you want the contact name to appear in mailing addresses.';
- InitValue = "After Company Name";
- OptionCaption = 'First,After Company Name,Last';
- OptionMembers = First,"After Company Name",Last;
- }
- ///
- /// Default output type for generated reports and documents.
- ///
- field(61; "Report Output Type"; Enum "Setup Report Output Type")
- {
- Caption = 'Report Output Type';
- ToolTip = 'Specifies the output of the report that will be scheduled with a job queue entry when the Post and Print with Job Queue check box is selected.';
- DataClassification = CustomerContent;
-
- trigger OnValidate()
- var
- EnvironmentInformation: Codeunit "Environment Information";
- begin
- if "Report Output Type" = "Report Output Type"::Print then
- if EnvironmentInformation.IsSaaS() then
- TestField("Report Output Type", "Report Output Type"::PDF);
- end;
- }
- ///
- /// Number series used for assigning bank account numbers during bank account creation.
- ///
- field(63; "Bank Account Nos."; Code[20])
- {
- AccessByPermission = TableData "Bank Account" = R;
- Caption = 'Bank Account Nos.';
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to bank accounts.';
- TableRelation = "No. Series";
- }
- ///
- /// Combines G/L entries with identical account, posting date, and dimensions into summary entries.
- ///
- field(65; "Summarize G/L Entries"; Boolean)
- {
- Caption = 'Summarize G/L Entries';
- }
- ///
- /// Decimal places specification for amount fields display and input formatting.
- ///
- field(66; "Amount Decimal Places"; Text[5])
- {
- Caption = 'Amount Decimal Places';
- ToolTip = 'Specifies the number of decimal places that are shown for amounts in LCY. This covers amounts created with all types of transactions and is useful to avoid inconsistencies when viewing or summing different amounts. The default setting, 2:2, specifies that all amounts in LCY are shown with a minimum of 2 decimal places and a maximum of 2 decimal places. You can also enter a fixed number, such as 2, which also means that amounts are shown with two decimals. On the Currencies page, you specify how many decimal places to show for amounts in foreign currencies.';
- InitValue = '2:2';
-
- trigger OnValidate()
- begin
- CheckDecimalPlacesFormat("Amount Decimal Places");
- end;
- }
- ///
- /// Decimal places specification for unit amount fields display and input formatting.
- ///
- field(67; "Unit-Amount Decimal Places"; Text[5])
- {
- Caption = 'Unit-Amount Decimal Places';
- ToolTip = 'Specifies the number of decimal places that are shown for unit amounts, item or resource prices per unit, in LCY. The default setting, 2:5, specifies that unit amounts will be shown with a minimum of two decimal places and a maximum of five decimal places. You can also enter a fixed number, such as 2, to specify that all unit amounts are shown with two decimal places. On the Currencies page, you specify how many decimal places to show for unit amounts in foreign currencies.';
- InitValue = '2:5';
-
- trigger OnValidate()
- begin
- CheckDecimalPlacesFormat("Unit-Amount Decimal Places");
- end;
- }
- ///
- /// Currency code for additional reporting currency used for parallel accounting and reporting.
- ///
- field(68; "Additional Reporting Currency"; Code[10])
- {
- Caption = 'Additional Reporting Currency';
- ToolTip = 'Specifies the currency that will be used as an additional reporting currency.';
- TableRelation = Currency;
-
- trigger OnValidate()
- begin
- if ("Additional Reporting Currency" <> xRec."Additional Reporting Currency") and
- ("Additional Reporting Currency" <> '')
- then begin
- AdjAddReportingCurr.SetAddCurr("Additional Reporting Currency");
- AdjAddReportingCurr.RunModal();
- if not AdjAddReportingCurr.IsExecuted() then
- "Additional Reporting Currency" := xRec."Additional Reporting Currency";
- end;
- if ("Additional Reporting Currency" <> xRec."Additional Reporting Currency") and
- ("Additional Reporting Currency" <> '') and
- AdjAddReportingCurr.IsExecuted()
- then
- DeleteAnalysisView();
- end;
- }
- ///
- /// Tolerance percentage for VAT amount differences to allow minor variances in VAT calculations.
- ///
- field(69; "VAT Tolerance %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'VAT Tolerance %';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
-
- trigger OnValidate()
- begin
- if "VAT Tolerance %" <> 0 then begin
- TestField("Adjust for Payment Disc.", false);
- TestField("Pmt. Disc. Excl. VAT", true);
- end;
- end;
- }
- ///
- /// Indicates whether the local currency participates in European Monetary Union currency system.
- ///
- field(70; "EMU Currency"; Boolean)
- {
- Caption = 'EMU Currency';
- ToolTip = 'Specifies if LCY is an EMU (Economic and Monetary Union) currency.';
- }
- ///
- /// Local Currency Code identifying the company's functional currency for accounting and reporting.
- ///
- field(71; "LCY Code"; Code[10])
- {
- Caption = 'LCY Code';
- ToolTip = 'Specifies the ISO 3 letter currency code for the local currency.';
-
- trigger OnValidate()
- var
- Currency: Record Currency;
- GLEntry: Record "G/L Entry";
- begin
- if (Rec."LCY Code" <> xRec."LCY Code") and (xRec."LCY Code" <> '') then
- if not GLEntry.IsEmpty() then
- Error(CannotUpdateLCYCodeErr);
-
- if "Local Currency Symbol" = '' then
- "Local Currency Symbol" := Currency.ResolveCurrencySymbol("LCY Code");
-
- if "Local Currency Description" = '' then
- "Local Currency Description" := CopyStr(Currency.ResolveCurrencyDescription("LCY Code"), 1, MaxStrLen("Local Currency Description"));
- end;
- }
- ///
- /// Method for adjusting VAT amounts during currency exchange rate adjustments.
- ///
- field(72; "VAT Exchange Rate Adjustment"; Enum "Exch. Rate Adjustment Type")
- {
- Caption = 'VAT Exchange Rate Adjustment';
- ToolTip = 'Specifies how the accounts set up for VAT posting in the VAT Posting Setup window will be adjusted for exchange rate fluctuations.';
- }
- ///
- /// Precision used for rounding monetary amounts in local currency calculations.
- ///
- field(73; "Amount Rounding Precision"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Amount Rounding Precision';
- ToolTip = 'Specifies the size of the interval to be used when rounding amounts in LCY. This covers amounts created with all types of transactions and is useful to avoid inconsistencies when viewing or summing different amounts. Amounts will be rounded to the nearest digit. Example: To have amounts rounded to whole numbers, enter 1.00 in this field. In this case, amounts less than 0.5 will be rounded down and amounts greater than or equal to 0.5 will be rounded up. On the Currencies page, you specify how amounts in foreign currencies are rounded.';
- DecimalPlaces = 0 : 5;
- InitValue = 0.01;
-
- trigger OnValidate()
- begin
- if "Amount Rounding Precision" <> 0 then
- "Inv. Rounding Precision (LCY)" := Round("Inv. Rounding Precision (LCY)", "Amount Rounding Precision");
-
- CheckRoundingError(FieldCaption("Amount Rounding Precision"));
-
- if HideDialog() then
- Message(Text021);
- end;
- }
- ///
- /// Precision used for rounding unit amounts in calculations and display.
- ///
- field(74; "Unit-Amount Rounding Precision"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Unit-Amount Rounding Precision';
- ToolTip = 'Specifies the size of the interval to be used when rounding unit amounts, item or resource prices per unit, in LCY. Amounts will be rounded to the nearest digit. Example: To have unit amounts rounded to whole numbers, enter 1.00 in this field. In this case, amounts less than 0.5 will be rounded down and amounts greater than or equal to 0.5 will be rounded up. On the Currencies page, you specify how unit amounts in foreign currencies are rounded.';
- DecimalPlaces = 0 : 9;
- InitValue = 0.00001;
-
- trigger OnValidate()
- begin
- if HideDialog() then
- Message(Text022);
- end;
- }
- ///
- /// Rounding precision used for payment applications to prevent minor differences from blocking applications.
- ///
- field(75; "Appln. Rounding Precision"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 0;
- Caption = 'Appln. Rounding Precision';
- ToolTip = 'Specifies the rounding difference that will be allowed when you apply entries in LCY to entries in a different currency.';
- MinValue = 0;
- }
- ///
- /// Primary global dimension code used throughout the system for analysis and reporting.
- ///
- field(79; "Global Dimension 1 Code"; Code[20])
- {
- Caption = 'Global Dimension 1 Code';
- ToolTip = 'Specifies the code for a global dimension that is linked to the record or entry for analysis purposes. Two global dimensions, typically for the company''s most important activities, are available on all cards, documents, reports, and lists.';
- Editable = false;
- TableRelation = Dimension;
-
- trigger OnValidate()
- begin
- "Shortcut Dimension 1 Code" := "Global Dimension 1 Code";
- end;
- }
- ///
- /// Secondary global dimension code used throughout the system for analysis and reporting.
- ///
- field(80; "Global Dimension 2 Code"; Code[20])
- {
- Caption = 'Global Dimension 2 Code';
- ToolTip = 'Specifies the code for a global dimension that is linked to the record or entry for analysis purposes. Two global dimensions, typically for the company''s most important activities, are available on all cards, documents, reports, and lists.';
- Editable = false;
- TableRelation = Dimension;
-
- trigger OnValidate()
- begin
- "Shortcut Dimension 2 Code" := "Global Dimension 2 Code";
- end;
- }
- ///
- /// First shortcut dimension code for quick access to dimension values in data entry forms.
- ///
- field(81; "Shortcut Dimension 1 Code"; Code[20])
- {
- Caption = 'Shortcut Dimension 1 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 1, whose dimension values you can then enter directly on journals and sales or purchase lines.';
- Editable = false;
- TableRelation = Dimension;
- }
- ///
- /// Second shortcut dimension code for quick access to dimension values in data entry forms.
- ///
- field(82; "Shortcut Dimension 2 Code"; Code[20])
- {
- Caption = 'Shortcut Dimension 2 Code';
- 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.';
- Editable = false;
- TableRelation = Dimension;
- }
- ///
- /// Third shortcut dimension code for quick access to dimension values in data entry forms.
- ///
- field(83; "Shortcut Dimension 3 Code"; Code[20])
- {
- AccessByPermission = TableData "Dimension Combination" = R;
- Caption = 'Shortcut Dimension 3 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 3, whose dimension values you can then enter directly on journals and sales or purchase lines.';
- TableRelation = Dimension;
-
- trigger OnValidate()
- begin
- UpdateDimValueGlobalDimNo(xRec."Shortcut Dimension 3 Code", "Shortcut Dimension 3 Code", 3);
- end;
- }
- ///
- /// Fourth shortcut dimension code for quick access to dimension values in data entry forms.
- ///
- field(84; "Shortcut Dimension 4 Code"; Code[20])
- {
- AccessByPermission = TableData "Dimension Combination" = R;
- Caption = 'Shortcut Dimension 4 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 4, whose dimension values you can then enter directly on journals and sales or purchase lines.';
- TableRelation = Dimension;
-
- trigger OnValidate()
- begin
- UpdateDimValueGlobalDimNo(xRec."Shortcut Dimension 4 Code", "Shortcut Dimension 4 Code", 4);
- end;
- }
- ///
- /// Fifth shortcut dimension code for quick access to dimension values in data entry forms.
- ///
- field(85; "Shortcut Dimension 5 Code"; Code[20])
- {
- AccessByPermission = TableData "Dimension Combination" = R;
- Caption = 'Shortcut Dimension 5 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 5, whose dimension values you can then enter directly on journals and sales or purchase lines.';
- TableRelation = Dimension;
-
- trigger OnValidate()
- begin
- UpdateDimValueGlobalDimNo(xRec."Shortcut Dimension 5 Code", "Shortcut Dimension 5 Code", 5);
- end;
- }
- ///
- /// Sixth shortcut dimension code for quick access to dimension values in data entry forms.
- ///
- field(86; "Shortcut Dimension 6 Code"; Code[20])
- {
- AccessByPermission = TableData "Dimension Combination" = R;
- Caption = 'Shortcut Dimension 6 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 6, whose dimension values you can then enter directly on journals and sales or purchase lines.';
- TableRelation = Dimension;
-
- trigger OnValidate()
- begin
- UpdateDimValueGlobalDimNo(xRec."Shortcut Dimension 6 Code", "Shortcut Dimension 6 Code", 6);
- end;
- }
- ///
- /// Seventh shortcut dimension code for quick access to dimension values in data entry forms.
- ///
- field(87; "Shortcut Dimension 7 Code"; Code[20])
- {
- AccessByPermission = TableData "Dimension Combination" = R;
- Caption = 'Shortcut Dimension 7 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 7, whose dimension values you can then enter directly on journals and sales or purchase lines.';
- TableRelation = Dimension;
-
- trigger OnValidate()
- begin
- UpdateDimValueGlobalDimNo(xRec."Shortcut Dimension 7 Code", "Shortcut Dimension 7 Code", 7);
- end;
- }
- ///
- /// Eighth shortcut dimension code for quick access to dimension values in data entry forms.
- ///
- field(88; "Shortcut Dimension 8 Code"; Code[20])
- {
- AccessByPermission = TableData "Dimension Combination" = R;
- Caption = 'Shortcut Dimension 8 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 8, whose dimension values you can then enter directly on journals and sales or purchase lines.';
- TableRelation = Dimension;
-
- trigger OnValidate()
- begin
- UpdateDimValueGlobalDimNo(xRec."Shortcut Dimension 8 Code", "Shortcut Dimension 8 Code", 8);
- end;
- }
- ///
- /// Maximum allowed VAT difference amount in local currency for VAT entries and adjustments.
- ///
- field(89; "Max. VAT Difference Allowed"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- Caption = 'Max. VAT Difference Allowed';
- ToolTip = 'Specifies the maximum VAT correction amount allowed for the local currency. For example, if you enter 5 in this field for British Pounds, then you can correct VAT amounts by up to five pounds.';
-
- trigger OnValidate()
- begin
- if "Max. VAT Difference Allowed" <> Round("Max. VAT Difference Allowed") then
- Error(
- Text004,
- FieldCaption("Max. VAT Difference Allowed"), "Amount Rounding Precision");
-
- "Max. VAT Difference Allowed" := Abs("Max. VAT Difference Allowed");
- end;
- }
- ///
- /// Rounding method applied to VAT amounts during calculation and posting.
- ///
- field(90; "VAT Rounding Type"; Option)
- {
- Caption = 'VAT Rounding Type';
- ToolTip = 'Specifies how the program will round VAT when calculated for the local currency. When you enter an Amount Including VAT in a document, the system first calculates and rounds the Amount Excluding VAT, and then calculates by subtraction the VAT Amount because the total amount has to match the Amount Including VAT entered manually. In that case, the VAT Rounding Type does not apply as the Amount Excluding VAT is already rounded using the Amount Rounding Precision.';
- OptionCaption = 'Nearest,Up,Down';
- OptionMembers = Nearest,Up,Down;
- }
- ///
- /// Specifies which accounts to use when posting payment discount tolerance amounts.
- ///
- field(92; "Pmt. Disc. Tolerance Posting"; Option)
- {
- Caption = 'Pmt. Disc. Tolerance Posting';
- ToolTip = 'Specifies the posting method that is used when posting a payment tolerance. Payment Tolerance Accounts: The payment discount tolerance is posted to a special general ledger account set up for payment tolerance. Payment Discount Amount: The payment discount tolerance is posted as a payment discount.';
- OptionCaption = 'Payment Tolerance Accounts,Payment Discount Accounts';
- OptionMembers = "Payment Tolerance Accounts","Payment Discount Accounts";
- }
- ///
- /// Grace period allowed after payment discount due date for payment discount eligibility.
- ///
- field(93; "Payment Discount Grace Period"; DateFormula)
- {
- Caption = 'Payment Discount Grace Period';
- ToolTip = 'Specifies the number of days that a payment or refund can pass the payment discount due date and still receive payment discount.';
- }
- ///
- /// Payment tolerance percentage allowed for customer and vendor payment applications.
- ///
- field(94; "Payment Tolerance %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Payment Tolerance %';
- ToolTip = 'Specifies the percentage that a payment or refund is allowed to be less than the amount on the related invoice or credit memo.';
- DecimalPlaces = 0 : 5;
- Editable = false;
- MaxValue = 100;
- MinValue = 0;
- }
- ///
- /// Maximum payment tolerance amount allowed for customer and vendor payment applications.
- ///
- field(95; "Max. Payment Tolerance Amount"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- Caption = 'Max. Payment Tolerance Amount';
- ToolTip = 'Specifies the maximum allowed amount that a payment or refund can differ from the amount on the related invoice or credit memo.';
- Editable = false;
- MinValue = 0;
- }
- ///
- /// Date before which G/L account deletion checks are performed to prevent accidental deletion.
- ///
- field(97; "Allow G/L Acc. Deletion Before"; Date)
- {
- Caption = 'Check G/L Acc. Deletion After';
- ToolTip = 'Specifies if and when general ledger accounts can be deleted. If you enter a date, G/L accounts with entries on or after this date can be deleted only after confirmation by the user. This setting is only valid when "Block Deletion of G/L accounts" is set to No';
- }
- ///
- /// Enables checking G/L account usage before allowing deletion to prevent loss of transaction history.
- ///
- field(98; "Check G/L Account Usage"; Boolean)
- {
- Caption = 'Check G/L Account Usage';
- ToolTip = 'Specifies that you want the program to protect G/L accounts that are used in setup tables from being deleted.';
- }
- ///
- /// Specifies how payment tolerance amounts are posted to the general ledger when payment tolerances are applied.
- ///
- field(99; "Payment Tolerance Posting"; Option)
- {
- Caption = 'Payment Tolerance Posting';
- ToolTip = 'Specifies the posting method that is used when posting a payment tolerance. Payment Tolerance Accounts: Posts the payment tolerance to a special general ledger account set up for payment tolerance. Payment Discount Amount: Posts the payment tolerance as a payment discount.';
- OptionCaption = 'Payment Tolerance Accounts,Payment Discount Accounts';
- OptionMembers = "Payment Tolerance Accounts","Payment Discount Accounts";
- }
- ///
- /// Controls whether warning messages are displayed when payment discount tolerance limits are exceeded during payment processing.
- ///
- field(100; "Pmt. Disc. Tolerance Warning"; Boolean)
- {
- Caption = 'Pmt. Disc. Tolerance Warning';
- ToolTip = 'Specifies if a warning will appear every time an application occurs between the dates specified in the Payment Discount Date field and the Pmt. Disc. Tolerance Date field in the General Ledger Setup window.';
- }
- ///
- /// Controls whether warning messages are displayed when payment tolerance limits are exceeded during payment processing.
- ///
- field(101; "Payment Tolerance Warning"; Boolean)
- {
- Caption = 'Payment Tolerance Warning';
- ToolTip = 'Specifies whether to display a message when a payment differs from the invoice amount within the specified tolerance, so you can choose how to process it. If you do not enable the message, and a tolerance level is specified, invoices with amounts that are within tolerance will be automatically closed and you cannot choose to leave the remaining amount. Default tolerance levels are specified in the Payment Tolerance % and Max. Payment Tolerance fields, but can also be specified for each customer ledger entry.';
- }
- ///
- /// Tracks the last transaction number used for intercompany transactions to ensure unique numbering.
- ///
- field(102; "Last IC Transaction No."; Integer)
- {
- Caption = 'Last IC Transaction No.';
- }
- ///
- /// Specifies whether VAT calculation is based on bill-to/sell-to customer address or ship-to address for determining tax jurisdiction.
- ///
- field(103; "Bill-to/Sell-to VAT Calc."; Enum "G/L Setup VAT Calculation")
- {
- Caption = 'Bill-to/Sell-to VAT Calc.';
- ToolTip = 'Specifies where the VAT Bus. Posting Group code on an order or invoice is copied from. Bill-to/Pay-to No.: The VAT Bus. Posting Group code on sales invoices and orders is copied from the Bill-to Customer field. The VAT Bus. Posting Group code on purchase invoices and orders is copied from the Pay-to Vendor field. Sell-to/Buy-from No. : The VAT Bus. Posting Group code on sales invoices and orders is copied from the Sell-to Customer field. The VAT Bus. Posting Group code on purchase invoices and orders is copied from the Buy-from Vendor field.';
- }
- ///
- /// Prevents deletion of G/L accounts that are referenced in setup tables or have transaction history when enabled.
- ///
- field(104; "Block Deletion of G/L Accounts"; Boolean)
- {
- Caption = 'Block Deletion of G/L Accounts';
- ToolTip = 'Specifies whether to prevent users from deleting G/L accounts with ledger entries that are after the date in the Check G/L Acc. Deletion After field. For example, blocking deletion helps you avoid losing financial data that your business should keep due to country regional requirements.';
- InitValue = true;
- }
-#if not CLEANSCHEMA25
- ///
- /// Obsolete: Account schedule name for balance sheet financial reporting.
- ///
- field(110; "Acc. Sched. for Balance Sheet"; Code[10])
- {
- Caption = 'Account Schedule for Balance Sheet';
- TableRelation = "Acc. Schedule Name";
- ObsoleteReason = 'Financial Reporting is replacing Account Schedules for financial statements';
- ObsoleteState = Removed;
- ObsoleteTag = '25.0';
-
- trigger OnValidate()
- begin
- Error(AccSchedObsoleteErr);
- end;
- }
- ///
- /// Obsolete: Account schedule name for income statement financial reporting.
- ///
- field(111; "Acc. Sched. for Income Stmt."; Code[10])
- {
- Caption = 'Account Schedule for Income Stmt.';
- TableRelation = "Acc. Schedule Name";
- ObsoleteReason = 'Financial Reporting is replacing Account Schedules for financial statements';
- ObsoleteState = Removed;
- ObsoleteTag = '25.0';
-
- trigger OnValidate()
- begin
- Error(AccSchedObsoleteErr);
- end;
- }
- ///
- /// Obsolete: Account schedule name for cash flow statement financial reporting.
- ///
- field(112; "Acc. Sched. for Cash Flow Stmt"; Code[10])
- {
- Caption = 'Account Schedule for Cash Flow Stmt';
- TableRelation = "Acc. Schedule Name";
- ObsoleteReason = 'Financial Reporting is replacing Account Schedules for financial statements';
- ObsoleteState = Removed;
- ObsoleteTag = '25.0';
-
- trigger OnValidate()
- begin
- Error(AccSchedObsoleteErr);
- end;
- }
- ///
- /// Obsolete: Account schedule name for retained earnings financial reporting.
- ///
- field(113; "Acc. Sched. for Retained Earn."; Code[10])
- {
- Caption = 'Account Schedule for Retained Earn.';
- TableRelation = "Acc. Schedule Name";
- ObsoleteReason = 'Financial Reporting is replacing Account Schedules for financial statements';
- ObsoleteState = Removed;
- ObsoleteTag = '25.0';
-
- trigger OnValidate()
- begin
- Error(AccSchedObsoleteErr);
- end;
- }
-#endif
- ///
- /// Default financial report used for generating balance sheet statements and analysis.
- ///
- field(114; "Fin. Rep. for Balance Sheet"; Code[10])
- {
- Caption = 'Financial Report for Balance Sheet';
- TableRelation = "Financial Report";
- ToolTip = 'Specifies which financial report is used to generate the Balance Sheet report.';
- ValidateTableRelation = false;
- }
- ///
- /// Default financial report used for generating income statement reports and profit/loss analysis.
- ///
- field(115; "Fin. Rep. for Income Stmt."; Code[10])
- {
- Caption = 'Financial Report for Income Stmt.';
- TableRelation = "Financial Report";
- ToolTip = 'Specifies which financial report is used to generate the Income Statement report.';
- ValidateTableRelation = false;
- }
- ///
- /// Default financial report used for generating cash flow statement reports and liquidity analysis.
- ///
- field(116; "Fin. Rep. for Cash Flow Stmt"; Code[10])
- {
- Caption = 'Financial Report for Cash Flow Stmt.';
- TableRelation = "Financial Report";
- ToolTip = 'Specifies which financial report is used to generate the Cash Flow Statement report.';
- ValidateTableRelation = false;
- }
- ///
- /// Default financial report used for generating retained earnings statements and equity analysis.
- ///
- field(117; "Fin. Rep. for Retained Earn."; Code[10])
- {
- Caption = 'Financial Report for Retained Earn.';
- TableRelation = "Financial Report";
- ToolTip = 'Specifies which financial report is used to generate the Retained Earnings report.';
- ValidateTableRelation = false;
- }
- ///
- /// Threshold amount for tax invoice renaming in local currency when processing tax-related transactions.
- ///
- field(120; "Tax Invoice Renaming Threshold"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- Caption = 'Tax Invoice Renaming Threshold';
- ToolTip = 'Specifies that if the amount on a sales invoice or a service invoice exceeds the threshold, then the name of the document is changed to include the words "Tax Invoice", as required by the tax authorities.';
- DataClassification = SystemMetadata;
- }
- ///
- /// Requires country/region code to be specified in customer and vendor addresses for regulatory compliance.
- ///
- field(130; "Req.Country/Reg. Code in Addr."; Boolean)
- {
- Caption = 'Require Country/Region Code in Address';
- ToolTip = 'Specifies whether to clear the Post Code, City, and County fields when the value in the Country/Region Code field is changed.';
- DataClassification = SystemMetadata;
- }
- ///
- /// Controls whether VAT amounts are printed in local currency on reports and documents when foreign currency transactions are involved.
- ///
- field(150; "Print VAT specification in LCY"; Boolean)
- {
- Caption = 'Print VAT specification in LCY';
- ToolTip = 'Specifies that an extra VAT specification in local currency will be included on documents in a foreign currency. This can be used to make tax audits easier when reconciling VAT payables to invoices.';
- }
- ///
- /// Enables unrealized VAT processing for prepayment transactions when prepayments are subject to VAT.
- ///
- field(151; "Prepayment Unrealized VAT"; Boolean)
- {
- Caption = 'Prepayment Unrealized VAT';
- ToolTip = 'Specifies whether to handle unrealized VAT on prepayments.';
-
- trigger OnValidate()
- begin
- if "Unrealized VAT" and xRec."Prepayment Unrealized VAT" then
- Error(DependentFieldActivatedErr, FieldCaption("Prepayment Unrealized VAT"), FieldCaption("Unrealized VAT"));
-
- if not "Prepayment Unrealized VAT" then begin
- VATPostingSetup.SetFilter(
- "Unrealized VAT Type", '>=%1', VATPostingSetup."Unrealized VAT Type"::Percentage);
- if VATPostingSetup.FindFirst() then
- Error(
- Text000, VATPostingSetup.TableCaption(),
- VATPostingSetup."VAT Bus. Posting Group", VATPostingSetup."VAT Prod. Posting Group",
- VATPostingSetup.FieldCaption("Unrealized VAT Type"), VATPostingSetup."Unrealized VAT Type");
- TaxJurisdiction.SetFilter(
- "Unrealized VAT Type", '>=%1', TaxJurisdiction."Unrealized VAT Type"::Percentage);
- if TaxJurisdiction.FindFirst() then
- Error(
- Text001, TaxJurisdiction.TableCaption(),
- TaxJurisdiction.Code, TaxJurisdiction.FieldCaption("Unrealized VAT Type"),
- TaxJurisdiction."Unrealized VAT Type");
- end;
- end;
- }
- ///
- /// Data exchange definition used for importing payroll transaction data from external payroll systems.
- ///
- field(160; "Payroll Trans. Import Format"; Code[20])
- {
- Caption = 'Payroll Trans. Import Format';
- ToolTip = 'Specifies the format of the payroll transaction file that can be imported into the General Journal window.';
- TableRelation = "Data Exch. Def" where(Type = const("Payroll Import"));
-
- trigger OnValidate()
- begin
- FeatureTelemetry.LogUptake('0004H8X', 'Payroll service', Enum::"Feature Uptake Status"::Discovered);
- end;
- }
- ///
- /// Symbol used to represent the local currency in reports and user interface displays.
- ///
- field(162; "Local Currency Symbol"; Text[10])
- {
- Caption = 'Local Currency Symbol';
- ToolTip = 'Specifies the symbol for the local currency that you want to appear on checks and charts, such as $ for USD.';
- }
- ///
- /// Descriptive name for the local currency used in reports and system displays.
- ///
- field(163; "Local Currency Description"; Text[60])
- {
- Caption = 'Local Currency Description';
- ToolTip = 'Specifies the description of the local currency.';
- }
- ///
- /// Controls how amounts are displayed in G/L entries and reports: amount only, debit/credit only, or all amounts.
- ///
- field(164; "Show Amounts"; Option)
- {
- Caption = 'Show Amounts';
- ToolTip = 'Specifies which type of amounts are shown in journals and in ledger entries windows. Amount Only: The Amount and Amount (LCY) fields are shown. Debit/Credit Only: The Debit Amount, Debit Amount (LCY), Credit Amount, and Credit Amount (LCY) fields are shown. All Amounts: All amount fields are shown.';
- OptionCaption = 'Amount Only,Debit/Credit Only,All Amounts';
- OptionMembers = "Amount Only","Debit/Credit Only","All Amounts";
- }
- ///
- /// Determines the type of posting preview shown to users before finalizing transactions.
- ///
- field(169; "Posting Preview Type"; Enum "Posting Preview Type")
- {
- Caption = 'Posting Preview Type';
- ToolTip = 'Specifies the amount of detail to include in the posting preview. Standard gives an overview of entries grouped by type, and you can choose the type of entry to view details. Extended displays the details for G/L entries and VAT entries.';
- }
- ///
- /// Allows SEPA payment export for currencies other than Euro when enabled.
- ///
- field(170; "SEPA Non-Euro Export"; Boolean)
- {
- Caption = 'SEPA Non-Euro Export';
- ToolTip = 'Specifies whether to use SEPA export for journal lines with currencies different from Euro.';
- }
- ///
- /// Enables SEPA payment export without requiring complete bank account data when enabled.
- ///
- field(171; "SEPA Export w/o Bank Acc. Data"; Boolean)
- {
- Caption = 'SEPA Export w/o Bank Acc. Data';
- ToolTip = 'Specifies if it is possible to use SEPA direct debit export by filling in the Bank Branch No. and Bank Account No. fields instead of the IBAN and SWIFT No. fields on the bank account and customer bank account cards.';
- }
- ///
- /// Requires journal template name to be specified when creating general journal lines for better control and validation.
- ///
- field(175; "Journal Templ. Name Mandatory"; Boolean)
- {
- Caption = 'Journal Templ. Name Mandatory';
- ToolTip = 'Specifies if a journal template and batch names are required when posting general ledger transactions. If you want to have template name in posted documents and entries, you must set this field as TRUE.';
- }
- ///
- /// Hides payment method code field in journals and documents when enabled for simplified data entry.
- ///
- field(176; "Hide Payment Method Code"; Boolean)
- {
- Caption = 'Hide Payment Method Code';
- ToolTip = 'Specifies if payment method code is shown in sales and purchase documents.';
- }
- ///
- /// Enables additional data validation checks during posting to ensure data integrity and compliance.
- ///
- field(177; "Enable Data Check"; Boolean)
- {
- Caption = 'Enable Data Check';
- ToolTip = 'Specifies whether Business Central validates the data you enter in documents and journals while you type. For documents, you can turn on the check and messages will be shown in the Document Check FactBox. For journals, messages are always shown in the Journal Check FactBox.';
- }
- ///
- /// Default retention period applied to financial documents for automatic cleanup and compliance management.
- ///
- field(178; "Document Retention Period"; Enum "Docs - Retention Period Def.")
- {
- Caption = 'Documents Retention Period';
- DataClassification = SystemMetadata;
- InitValue = 0;
- }
- ///
- /// Default general journal template used for customer and vendor payment application processes.
- ///
- field(180; "Apply Jnl. Template Name"; Code[10])
- {
- Caption = 'Apply Jnl. Template Name';
- ToolTip = 'Specifies the name of the journal template you want to use for applying customer or vendor ledger entries.';
- TableRelation = "Gen. Journal Template";
- }
- ///
- /// Default general journal batch used for customer and vendor payment application processes.
- ///
- field(181; "Apply Jnl. Batch Name"; Code[10])
- {
- Caption = 'Apply Jnl. Batch Name';
- ToolTip = 'Specifies the name of the journal batch you want to use for applying customer or vendor ledger entries.';
- TableRelation = if ("Apply Jnl. Template Name" = filter(<> '')) "Gen. Journal Batch".Name where("Journal Template Name" = field("Apply Jnl. Template Name"));
-
- trigger OnValidate()
- begin
- TestField("Apply Jnl. Template Name");
- end;
- }
- ///
- /// Default general journal template used for posting job work-in-process entries during job completion processes.
- ///
- field(182; "Job WIP Jnl. Template Name"; Code[10])
- {
- Caption = 'Project WIP Jnl. Template Name';
- ToolTip = 'Specifies the name of the journal template you want to use for posting project WIP to G/L.';
- TableRelation = "Gen. Journal Template";
- }
- ///
- /// Default general journal batch used for posting job work-in-process entries during job completion processes.
- ///
- field(183; "Job WIP Jnl. Batch Name"; Code[10])
- {
- Caption = 'Project WIP Jnl. Batch Name';
- ToolTip = 'Specifies the name of the journal batch you want to use for posting project WIP to G/L.';
- TableRelation = if ("Job WIP Jnl. Template Name" = filter(<> '')) "Gen. Journal Batch".Name where("Journal Template Name" = field("Job WIP Jnl. Template Name"));
-
- trigger OnValidate()
- begin
- TestField("Job WIP Jnl. Template Name");
- end;
- }
- ///
- /// Default general journal template used for additional reporting currency adjustments during currency rate changes.
- ///
- field(184; "Adjust ARC Jnl. Template Name"; Code[10])
- {
- Caption = 'Adjust Add. Rep. Currency Jnl. Template Name';
- ToolTip = 'Specifies the name of the journal template you want to use for posting adjustment of additional reporting currency.';
- TableRelation = "Gen. Journal Template";
- }
- ///
- /// Default general journal batch used for additional reporting currency adjustments during currency rate changes.
- ///
- field(185; "Adjust ARC Jnl. Batch Name"; Code[10])
- {
- Caption = 'Adjust Add. Rep. Currency Jnl. Batch Name';
- ToolTip = 'Specifies the name of the journal batch you want to use for posting adjustment of additional reporting currency.';
- TableRelation = if ("Adjust ARC Jnl. Template Name" = filter(<> '')) "Gen. Journal Batch".Name where("Journal Template Name" = field("Adjust ARC Jnl. Template Name"));
-
- trigger OnValidate()
- begin
- TestField("Adjust ARC Jnl. Template Name");
- end;
- }
- ///
- /// Default general journal template used for bank account reconciliation adjustment entries.
- ///
- field(186; "Bank Acc. Recon. Template Name"; Code[10])
- {
- Caption = 'Bank Acc. Recon. Template Name';
- ToolTip = 'Specifies the name of the journal batch you want to use for posting bank account reconciliation.';
- TableRelation = "Gen. Journal Template";
- }
- ///
- /// Default general journal batch used for bank account reconciliation adjustment entries.
- ///
- field(187; "Bank Acc. Recon. Batch Name"; Code[10])
- {
- Caption = 'Bank Acc. Recon. Batch Name';
- ToolTip = 'Specifies the name of the journal batch you want to use for posting bank account reconciliation.';
- TableRelation = if ("Bank Acc. Recon. Template Name" = filter(<> '')) "Gen. Journal Batch".Name where("Journal Template Name" = field("Bank Acc. Recon. Template Name"));
- }
- ///
- /// Controls VAT period validation and posting restrictions to ensure compliance with tax reporting periods.
- ///
- field(188; "Control VAT Period"; Enum "VAT Period Control")
- {
- Caption = 'Control VAT Period';
- ToolTip = 'Specifies a way of using VAT Date against VAT Return Periods. If you choose Block posting within closed and warn for released period, system will not allow postings in closed VAT Return Period, but if the period is not closed, but VAT returns are released or submitted, user will be warned what try to post an entry with VAT Date in this period. If you choose Block posting within closed period, system will still not allow postings in closed VAT Return Period, but there will be no warnings for release or submitted VAT returns. If you choose ˜Warn when posting in closed period, system will not block posting entry with VAT Date in the closed VAT return period, but it will show warning message before posting. And if you choose ˜Disabled options, system will allow you to post without any control regardless of VAT return or period status.';
-
- trigger OnValidate()
- begin
- FeatureTelemetry.LogUsage('0000JWC', VATDateFeatureTok, VATPeriodControlUsageMsg);
- end;
- }
- ///
- /// Enables this company to be queried from consolidation processes when used as a subsidiary company.
- ///
- field(189; "Allow Query From Consolid."; Boolean)
- {
- Caption = 'Enable company as subsidiary';
- DataClassification = SystemMetadata;
-
- trigger OnValidate()
- var
- ImportConsolidationFromApi: Codeunit "Import Consolidation From API";
- AuditLog: Codeunit "Audit Log";
- begin
- if Rec."Allow Query From Consolid." <> xRec."Allow Query From Consolid." then
- if Rec."Allow Query From Consolid." then begin
- Session.LogSecurityAudit(
- FinancialConsolidationServiceNameTxt, SecurityOperationResult::Success,
- SecurityAuditAllowQueryEnabledTxt,
- AuditCategory::ApplicationManagement);
- AuditLog.LogAuditMessage(
- StrSubstNo(FinConsolidConfiguredLbl, UserSecurityId()),
- SecurityOperationResult::Success, AuditCategory::ApplicationManagement, 4, 0);
- end else
- Session.LogSecurityAudit(
- FinancialConsolidationServiceNameTxt, SecurityOperationResult::Success,
- SecurityAuditAllowQueryDisabledTxt,
- AuditCategory::ApplicationManagement);
- if not Rec."Allow Query From Consolid." then
- exit;
- if not GuiAllowed() then
- Error(PrivacyStatementAckErr);
- if not ImportConsolidationFromApi.GetPrivacyConsentChoice() then
- Error('');
- end;
-
- }
- ///
- /// G/L account category used for classifying accounts receivable accounts in financial reporting.
- ///
- field(190; "Acc. Receivables Category"; Integer)
- {
- TableRelation = "G/L Account Category";
- Caption = 'Account Receivables G/L Account Category';
- }
- ///
- /// Controls which dimension information is posted during exchange rate adjustment processes.
- ///
- field(191; "App. Dimension Posting"; Enum "Exch. Rate Adjmt. Dimensions")
- {
- Caption = 'Dimension Posting';
- ToolTip = 'Specifies dimension source for Realized Gain/Loss application entries.';
- DataClassification = CustomerContent;
- }
- ///
- /// Hides company bank account information in certain displays and reports for security purposes.
- ///
- field(192; "Hide Company Bank Account"; Boolean)
- {
- Caption = 'Hide Company Bank Account';
- ToolTip = 'Specifies whether or not the Company Bank Account can be updated on posted documents.';
- }
- field(193; "Check Source Curr. Consistency"; Boolean)
- {
- Caption = 'Check Source Curr. Consistency';
- ToolTip = 'Specifies whether Business Central validates the total of general ledger entries source currency amount during posting.';
- }
- field(194; "Acc. Payables Category"; Integer)
- {
- TableRelation = "G/L Account Category";
- Caption = 'Account Payables G/L Account Category';
- }
- field(195; "Fin. Rep. Period Type"; Enum "Analysis Period Type")
- {
- Caption = 'Financial Report Period Type';
- ToolTip = 'Specifies by which period amounts are displayed on financial report by default.';
- }
- field(196; "Fin. Rep. Neg. Amount Format"; Enum "Analysis Negative Format")
- {
- Caption = 'Financial Report Default Negative Amt. Format';
- ToolTip = 'Specifies how negative amounts are displayed on the financial report by default.';
- }
- field(197; "Fin. Rep. Company Logo Pos."; Enum "Fin. Report Logo Position")
- {
- Caption = 'Financial Report Company Logo Position';
- ToolTip = 'Specifies how your company logo is displayed on the financial report by default.';
- }
- field(198; "Fin. Rep. Bal. Sheet Row"; Code[10])
- {
- Caption = 'Financial Report Row Definition for Balance Sheet';
- TableRelation = "Acc. Schedule Name";
- ToolTip = 'Specifies the name of the Balance Sheet row on Financial Reports.';
- ValidateTableRelation = false;
- }
- field(199; "Fin. Rep. Income Stmt. Row"; Code[10])
- {
- Caption = 'Financial Report Row Definition for Income Stmt.';
- TableRelation = "Acc. Schedule Name";
- ToolTip = 'Specifies the name of the Income Statement row on Financial Reports.';
- ValidateTableRelation = false;
- }
- field(200; "Fin. Rep. Cash Flow Stmt. Row"; Code[10])
- {
- Caption = 'Financial Report Row Definition for Cash Flow Stmt.';
- TableRelation = "Acc. Schedule Name";
- ToolTip = 'Specifies the name of the Cash Flow Statement row on Financial Reports.';
- ValidateTableRelation = false;
- }
- field(201; "Fin. Rep. Retained Earn. Row"; Code[10])
- {
- Caption = 'Financial Report Row Definition for Retained Earn.';
- TableRelation = "Acc. Schedule Name";
- ToolTip = 'Specifies the name of the Retained Earnings row on Financial Reports.';
- ValidateTableRelation = false;
- }
- field(202; "Fin. Rep. Bal. Sheet Column"; Code[10])
- {
- Caption = 'Financial Report Column Definition for Balance Sheet';
- TableRelation = "Column Layout Name";
- ToolTip = 'Specifies the name of the Balance Sheet column on Financial Reports.';
- ValidateTableRelation = false;
- }
- field(203; "Fin. Rep. Net Change Column"; Code[10])
- {
- Caption = 'Financial Report Column Definition for Net Change';
- TableRelation = "Column Layout Name";
- ToolTip = 'Specifies the name of the Net Change column on Financial Reports.';
- ValidateTableRelation = false;
- }
- field(204; DefaultFinancialReportStatus; Code[10])
- {
- Caption = 'Default Financial Report Status';
- DataClassification = CustomerContent;
- ToolTip = 'Specifies the name of the Default Financial Report Status on Financial Reports.';
- TableRelation = "Financial Report Status";
- }
- field(205; "Allow Posting From DateFormula"; DateFormula)
- {
- Caption = 'Allow Posting From Date Formula';
-
- trigger OnValidate()
- begin
- if xRec."Allow Posting From DateFormula" <> Rec."Allow Posting From DateFormula" then begin
- if Format(Rec."Allow Posting From DateFormula") <> '' then
- Rec.Validate("Allow Posting From", 0D);
-
- CheckDateRange();
- end;
- end;
- }
- field(206; "Allow Posting To DateFormula"; DateFormula)
- {
- Caption = 'Allow Posting To Date Formula';
-
- trigger OnValidate()
- begin
- if xRec."Allow Posting To DateFormula" <> Rec."Allow Posting To DateFormula" then begin
- if Format(Rec."Allow Posting To DateFormula") <> '' then
- Rec.Validate("Allow Posting To", 0D);
-
- CheckDateRange();
- end;
- end;
- }
- field(210; "Use Concurrent Posting"; Boolean)
- {
- Caption = 'Use Concurrent Posting';
- ToolTip = 'Specifies whether to use concurrent posting when posting journals. Concurrent posting can reduce the time it takes to post journals by allowing multiple batches to be posted at the same time. Enabling this option requires additional configuration and setup, such as setting up a batch job to run the concurrent posting process and ensuring that your system has the necessary resources to support concurrent processing.';
- }
- field(11400; "Local SEPA Instr. Priority"; Boolean)
- {
- Caption = 'Local SEPA Instr. Priority';
- InitValue = true;
- }
-#if not CLEANSCHEMA28
- field(11401; "Use New Apply G/L Entries Page"; Boolean)
- {
- Caption = 'Use New Apply G/L Entries Page';
- ObsoleteReason = 'New page 11310 will unconditionally replace the old 11309.';
- ObsoleteTag = '22.0';
- ObsoleteState = Removed;
- }
-#endif
- field(11000000; "Local Currency"; Option)
- {
- Caption = 'Local Currency';
- OptionCaption = ',Euro,Other';
- OptionMembers = ,Euro,Other;
-
- trigger OnValidate()
- begin
- if "Local Currency" = "Local Currency"::Euro then
- "Currency Euro" := '';
- end;
- }
- field(11000002; "Currency Euro"; Code[10])
- {
- Caption = 'Currency Euro';
- TableRelation = Currency;
-
- trigger OnValidate()
- begin
- if "Local Currency" = "Local Currency"::Euro then
- Error(
- Text1000001,
- FieldCaption("Currency Euro"),
- FieldCaption("Local Currency"),
- "Local Currency");
- end;
- }
- }
-
- keys
- {
- key(Key1; "Primary Key")
- {
- Clustered = true;
- }
- }
-
- fieldgroups
- {
- }
-
- var
- Dim: Record Dimension;
- GLEntry: Record "G/L Entry";
- ItemLedgerEntry: Record "Item Ledger Entry";
- JobLedgEntry: Record "Job Ledger Entry";
- ResLedgEntry: Record "Res. Ledger Entry";
- FALedgerEntry: Record "FA Ledger Entry";
- MaintenanceLedgerEntry: Record "Maintenance Ledger Entry";
- InsCoverageLedgerEntry: Record "Ins. Coverage Ledger Entry";
- VATPostingSetup: Record "VAT Posting Setup";
- TaxJurisdiction: Record "Tax Jurisdiction";
- AnalysisView: Record "Analysis View";
- AnalysisViewEntry: Record "Analysis View Entry";
- AnalysisViewBudgetEntry: Record "Analysis View Budget Entry";
- AdjAddReportingCurr: Report "Adjust Add. Reporting Currency";
- UserSetupManagement: Codeunit "User Setup Management";
- FeatureTelemetry: Codeunit "Feature Telemetry";
- ErrorMessage: Boolean;
- RecordHasBeenRead: Boolean;
-
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text000: Label '%1 %2 %3 have %4 to %5.';
- Text001: Label '%1 %2 have %3 to %4.';
- Text002: Label '%1 %2 %3 use %4.';
- Text003: Label '%1 %2 use %3.';
- Text004: Label '%1 must be rounded to the nearest %2.';
-#pragma warning restore AA0470
- Text016: Label 'Enter one number or two numbers separated by a colon. ';
- Text017: Label 'The online Help for this field describes how you can fill in the field.';
-#pragma warning disable AA0470
- Text018: Label 'You cannot change the contents of the %1 field because there are posted ledger entries.';
-#pragma warning restore AA0470
- Text021: Label 'You must close the program and start again in order to activate the amount-rounding feature.';
- Text022: Label 'You must close the program and start again in order to activate the unit-amount rounding feature.';
-#pragma warning disable AA0470
- Text023: Label '%1\You cannot use the same dimension twice in the same setup.';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
-#pragma warning disable AA0470
- DependentFieldActivatedErr: Label 'You cannot change %1 because %2 is selected.';
- Text1000001: Label 'It is not allowed to specify %1 when %2 is %3.';
-#pragma warning restore AA0470
- AccSchedObsoleteErr: Label 'This field is obsolete and it has been replaced by Table 88 Financial Report';
- VATDateFeatureTok: Label 'VAT Date', Locked = true;
- VATPeriodControlUsageMsg: Label 'Control VAT Period is changed', Locked = true;
- VATDateFeatureUsageMsg: Label 'VAT Reporting Date Usage is changed', Locked = true;
- PrivacyStatementAckErr: Label 'Enabling requires privacy statement acknowledgement.';
- CannotUpdateLCYCodeErr: Label 'You cannot update the local currency code because there are posted general ledger entries.';
- FinancialConsolidationServiceNameTxt: Label 'Financial Consolidation', Locked = true;
- SecurityAuditAllowQueryEnabledTxt: Label 'Company was enabled as a subsidiary for cross-tenant Financial Consolidation queries.', Locked = true;
- SecurityAuditAllowQueryDisabledTxt: Label 'Company was disabled as a subsidiary for cross-tenant Financial Consolidation queries.', Locked = true;
- FinConsolidConfiguredLbl: Label 'Financial Consolidation cross-tenant query has been enabled by UserSecurityId %1.', Locked = true;
-
- ///
- /// Validates and corrects the format of decimal places configuration for currency and amount display.
- ///
- /// Decimal places format string to validate and potentially correct
- procedure CheckDecimalPlacesFormat(var DecimalPlaces: Text[5])
- var
- OK: Boolean;
- ColonPlace: Integer;
- DecimalPlacesPart1: Integer;
- DecimalPlacesPart2: Integer;
- Check: Text[5];
- begin
- OK := true;
- ColonPlace := StrPos(DecimalPlaces, ':');
-
- if ColonPlace = 0 then begin
- if not Evaluate(DecimalPlacesPart1, DecimalPlaces) then
- OK := false;
- if (DecimalPlacesPart1 < 0) or (DecimalPlacesPart1 > 9) then
- OK := false;
- end else begin
- Check := CopyStr(DecimalPlaces, 1, ColonPlace - 1);
- if Check = '' then
- OK := false;
- if not Evaluate(DecimalPlacesPart1, Check) then
- OK := false;
- Check := CopyStr(DecimalPlaces, ColonPlace + 1, StrLen(DecimalPlaces));
- if Check = '' then
- OK := false;
- if not Evaluate(DecimalPlacesPart2, Check) then
- OK := false;
- if DecimalPlacesPart1 > DecimalPlacesPart2 then
- OK := false;
- if (DecimalPlacesPart1 < 0) or (DecimalPlacesPart1 > 9) then
- OK := false;
- if (DecimalPlacesPart2 < 0) or (DecimalPlacesPart2 > 9) then
- OK := false;
- end;
-
- if not OK then
- Error(
- Text016 +
- Text017);
-
- if ColonPlace = 0 then
- DecimalPlaces := Format(DecimalPlacesPart1)
- else
- DecimalPlaces := StrSubstNo('%1:%2', DecimalPlacesPart1, DecimalPlacesPart2);
- end;
-
- ///
- /// Returns the appropriate currency code for display, converting between LCY code and empty string as needed.
- ///
- /// Input currency code to convert
- /// Converted currency code: LCY code becomes empty, empty becomes LCY code, others remain unchanged
- procedure GetCurrencyCode(CurrencyCode: Code[10]): Code[10]
- begin
- case CurrencyCode of
- '':
- exit("LCY Code");
- "LCY Code":
- exit('');
- else
- exit(CurrencyCode);
- end;
- end;
-
- ///
- /// Retrieves the local currency symbol for display in user interface and reports.
- ///
- /// Local currency symbol or LCY code if symbol is not defined
- procedure GetCurrencySymbol(): Text[10]
- begin
- if "Local Currency Symbol" <> '' then
- exit("Local Currency Symbol");
-
- exit("LCY Code");
- end;
-
- ///
- /// Ensures the General Ledger Setup record is read from the database only once per session for performance optimization.
- ///
- procedure GetRecordOnce()
- begin
- if RecordHasBeenRead then
- exit;
- Get();
- RecordHasBeenRead := true;
- end;
-
- ///
- /// Updates VAT date based on VAT reporting date configuration and the specified date type.
- ///
- /// New date value to potentially assign
- /// Type of VAT reporting date being processed
- /// VAT date variable to update if date type matches configuration
- procedure UpdateVATDate(NewDate: Date; VATDateType: Enum "VAT Reporting Date"; var VATDate: Date)
- begin
- if ("VAT Reporting Date" = VATDateType) then
- VatDate := NewDate;
- end;
-
- ///
- /// Determines the appropriate VAT date based on posting date, document date, and VAT reporting date configuration.
- ///
- /// Transaction posting date
- /// Document date from source document
- /// VAT date based on configuration: posting date, document date, or posting date if document date is zero
- procedure GetVATDate(PostingDate: Date; DocumentDate: Date): Date
- begin
- Get();
- case "VAT Reporting Date" of
- Enum::"VAT Reporting Date"::"Posting Date":
- exit(PostingDate);
- Enum::"VAT Reporting Date"::"Document Date":
- exit(DocumentDate);
- end;
- exit(PostingDate);
- end;
-
- ///
- /// Validates that rounding precision changes are allowed by checking for existing ledger entries across all modules.
- ///
- /// Name of the field being validated for rounding precision changes
- procedure CheckRoundingError(NameOfField: Text[100])
- begin
- ErrorMessage := false;
- if GLEntry.FindFirst() then
- ErrorMessage := true;
- if ItemLedgerEntry.FindFirst() then
- ErrorMessage := true;
- if JobLedgEntry.FindFirst() then
- ErrorMessage := true;
- if ResLedgEntry.FindFirst() then
- ErrorMessage := true;
- if FALedgerEntry.FindFirst() then
- ErrorMessage := true;
- if MaintenanceLedgerEntry.FindFirst() then
- ErrorMessage := true;
- if InsCoverageLedgerEntry.FindFirst() then
- ErrorMessage := true;
- OnBeforeCheckRoundingError(ErrorMessage);
- if ErrorMessage then
- Error(Text018, NameOfField);
- end;
-
- local procedure DeleteAnalysisView()
- begin
- if AnalysisView.Find('-') then
- repeat
- if AnalysisView.Blocked = false then begin
- AnalysisViewEntry.SetRange("Analysis View Code", AnalysisView.Code);
- AnalysisViewEntry.DeleteAll();
- AnalysisViewBudgetEntry.SetRange("Analysis View Code", AnalysisView.Code);
- AnalysisViewBudgetEntry.DeleteAll();
- AnalysisView."Last Entry No." := 0;
- AnalysisView."Last Budget Entry No." := 0;
- AnalysisView."Last Date Updated" := 0D;
- AnalysisView.Modify();
- end else begin
- AnalysisView."Refresh When Unblocked" := true;
- AnalysisView.Modify();
- end;
- until AnalysisView.Next() = 0;
- end;
-
- ///
- /// Determines whether posting is allowed for the specified date based on setup configuration and extensibility events.
- ///
- /// Date to validate for posting allowance
- /// True if posting is allowed for the specified date, false otherwise
- procedure IsPostingAllowed(PostingDate: Date) Result: Boolean
- begin
- Result := PostingDate >= "Allow Posting From";
- OnAfterIsPostingAllowed(Rec, PostingDate, Result);
- end;
-
- ///
- /// Checks whether background job queue processing is currently active for the general ledger setup.
- ///
- /// True if job queue is active, false otherwise
- procedure JobQueueActive(): Boolean
- begin
- Get();
- exit("Post with Job Queue" or "Post & Print with Job Queue");
- end;
-
- ///
- /// Determines the earliest date allowed for posting based on setup configuration and inventory periods.
- ///
- /// First allowed posting date considering setup and inventory period restrictions
- procedure FirstAllowedPostingDate() AllowedPostingDate: Date
- var
- InvtPeriod: Record "Inventory Period";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeFirstAllowedPostingDate(Rec, AllowedPostingDate, IsHandled);
- if IsHandled then
- exit;
-
- AllowedPostingDate := "Allow Posting From";
- if not InvtPeriod.IsValidDate(AllowedPostingDate) then
- AllowedPostingDate := CalcDate('<+1D>', AllowedPostingDate);
- end;
-
- ///
- /// Updates global dimension number assignments for dimension values when changing global dimension configuration.
- ///
- /// Previous dimension code being replaced
- /// New dimension code being assigned
- /// Global dimension number (1-8) being updated
- procedure UpdateDimValueGlobalDimNo(xDimCode: Code[20]; DimCode: Code[20]; ShortcutDimNo: Integer)
- var
- DimensionValue: Record "Dimension Value";
- DimensionSetEntry: Record "Dimension Set Entry";
- begin
- if Dim.CheckIfDimUsed(DimCode, Enum::"Dim Type Checked".FromInteger(ShortcutDimNo), '', '', 0) then
- Error(Text023, Dim.GetCheckDimErr());
- if xDimCode <> '' then begin
- DimensionValue.SetRange("Dimension Code", xDimCode);
- DimensionValue.ModifyAll("Global Dimension No.", 0);
-
- DimensionSetEntry.UpdateGlobalDimensionNo(xDimCode, 0);
- end;
- if DimCode <> '' then begin
- DimensionValue.SetRange("Dimension Code", DimCode);
- DimensionValue.ModifyAll("Global Dimension No.", ShortcutDimNo);
-
- DimensionSetEntry.UpdateGlobalDimensionNo(DimCode, ShortcutDimNo);
- end;
- OnAfterUpdateDimValueGlobalDimNo(ShortcutDimNo, xDimCode, DimCode);
- Modify();
- end;
-
- local procedure HideDialog(): Boolean
- begin
- exit((CurrFieldNo = 0) or not GuiAllowed);
- end;
-
- local procedure CheckDateRange()
- var
- AllowedFrom: Date;
- AllowedTo: Date;
- begin
- if (Format(Rec."Allow Posting From DateFormula") = '') and (Format(Rec."Allow Posting To DateFormula") = '') then
- exit;
-
- AllowedFrom := Rec."Allow Posting From";
- AllowedTo := Rec."Allow Posting To";
- UserSetupManagement.GetDateRange(
- AllowedFrom, AllowedTo,
- Rec."Allow Posting From DateFormula", Rec."Allow Posting To DateFormula",
- Rec.RecordId());
- end;
-
- procedure UseConcurrentPosting(): Boolean
- begin
- GetRecordOnce();
- exit("Use Concurrent Posting");
- end;
-
- ///
- /// Determines if VAT is enabled in the system based on current VAT posting setup configuration.
- ///
- /// True if VAT posting setup exists and VAT is active, false otherwise
- procedure UseVat(): Boolean
- var
- GeneralLedgerSetupRecordRef: RecordRef;
- UseVATFieldRef: FieldRef;
- UseVATFieldNo: Integer;
- begin
- GeneralLedgerSetupRecordRef.Open(DATABASE::"General Ledger Setup", false);
-
- UseVATFieldNo := 10001;
-
- if not GeneralLedgerSetupRecordRef.FieldExist(UseVATFieldNo) then
- exit(true);
-
- if not GeneralLedgerSetupRecordRef.FindFirst() then
- exit(false);
-
- UseVATFieldRef := GeneralLedgerSetupRecordRef.Field(UseVATFieldNo);
- exit(UseVATFieldRef.Value);
- end;
-
- ///
- /// Validates that posting dates fall within allowed posting periods defined in general ledger setup.
- ///
- /// Type of notification to show (Error or Notification) when validation fails
- procedure CheckAllowedPostingDates(NotificationType: Option Error,Notification)
- begin
- UserSetupManagement.CheckAllowedPostingDatesRange("Allow Posting From",
- "Allow Posting To", NotificationType, DATABASE::"General Ledger Setup");
- end;
-
- ///
- /// Validates that deferral posting dates fall within allowed deferral posting periods.
- ///
- /// Type of notification to show (Error or Notification) when validation fails
- procedure CheckAllowedDeferralPostingDates(NotificationType: Option Error,Notification)
- begin
- UserSetupManagement.CheckAllowedPostingDatesRange(
- "Allow Deferral Posting From", "Allow Deferral Posting To", NotificationType, DATABASE::"User Setup",
- FieldCaption("Allow Deferral Posting From"), FieldCaption("Allow Deferral Posting To"));
- end;
-
- ///
- /// Determines if payment tolerance fields should be visible in the user interface.
- ///
- /// True if payment tolerance percentage or maximum amount is configured
- procedure GetPmtToleranceVisible(): Boolean
- begin
- exit(("Payment Tolerance %" > 0) or ("Max. Payment Tolerance Amount" <> 0));
- end;
-
- ///
- /// Integration event raised before validating rounding error configuration.
- /// Enables custom error message handling and validation logic for rounding tolerances.
- ///
- /// Set to true to suppress standard error message display
- [IntegrationEvent(true, false)]
- local procedure OnBeforeCheckRoundingError(var ErrorMessage: Boolean);
- begin
- end;
-
- ///
- /// Integration event raised after determining if posting is allowed for a given date.
- /// Enables custom posting date validation logic and period override capabilities.
- ///
- /// General Ledger Setup record with posting date configuration
- /// Date being validated for posting allowance
- /// Validation result indicating if posting is allowed for the date
- [IntegrationEvent(true, false)]
- local procedure OnAfterIsPostingAllowed(GeneralLedgerSetup: Record "General Ledger Setup"; PostingDate: Date; var Result: Boolean)
- begin
- end;
-
- ///
- /// Integration event raised before calculating the first allowed posting date.
- /// Enables custom logic for determining earliest allowable posting date based on setup and user permissions.
- ///
- /// General Ledger Setup record with posting period configuration
- /// Calculated first allowed posting date, can be modified by subscribers
- /// Set to true to bypass standard calculation logic
- [IntegrationEvent(false, false)]
- local procedure OnBeforeFirstAllowedPostingDate(GeneralLedgerSetup: Record "General Ledger Setup"; var AllowedPostingDate: Date; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Integration event raised after updating global dimension assignments for dimension values.
- /// Enables custom processing and validation when global dimensions are reconfigured.
- ///
- /// Global dimension number (1-8) that was updated
- /// Previous dimension code that was replaced
- /// New dimension code that was assigned
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateDimValueGlobalDimNo(ShortCutDimNo: Integer; OldDimensionCode: Code[20]; NewDimensionCode: Code[20])
- begin
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Finance/ReceivablesPayables/PaymentToleranceManagement.Codeunit.al b/src/Layers/NL/BaseApp/Finance/ReceivablesPayables/PaymentToleranceManagement.Codeunit.al
index 978ddd0f49..e44d114508 100644
--- a/src/Layers/NL/BaseApp/Finance/ReceivablesPayables/PaymentToleranceManagement.Codeunit.al
+++ b/src/Layers/NL/BaseApp/Finance/ReceivablesPayables/PaymentToleranceManagement.Codeunit.al
@@ -1920,6 +1920,7 @@ codeunit 426 "Payment Tolerance Management"
(DocumentType = DocumentType::"Credit Memo"))
then
PositiveFilter := true;
+
exit(PositiveFilter);
end;
@@ -1930,6 +1931,7 @@ codeunit 426 "Payment Tolerance Management"
(DocumentType = DocumentType::"Credit Memo"))
then
PositiveFilter := true;
+
exit(PositiveFilter);
end;
diff --git a/src/Layers/NL/BaseApp/Finance/RoleCenters/AccPayablesCoordinatorRC.Page.al b/src/Layers/NL/BaseApp/Finance/RoleCenters/AccPayablesCoordinatorRC.Page.al
index 61f70f818e..ae83e482d1 100644
--- a/src/Layers/NL/BaseApp/Finance/RoleCenters/AccPayablesCoordinatorRC.Page.al
+++ b/src/Layers/NL/BaseApp/Finance/RoleCenters/AccPayablesCoordinatorRC.Page.al
@@ -5,8 +5,6 @@
namespace Microsoft.Finance.RoleCenters;
using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.Journal;
-using Microsoft.Bank.Payment;
using Microsoft.EServices.EDocument;
using Microsoft.Finance.GeneralLedger.Journal;
using Microsoft.Finance.GeneralLedger.Ledger;
@@ -220,20 +218,6 @@ page 9002 "Acc. Payables Coordinator RC"
RunObject = Page "Item List";
ToolTip = 'View or edit detailed information for the products that you trade in. The item card can be of type Inventory or Service to specify if the item is a physical unit or a labor time unit. Here you also define if items in inventory or on incoming orders are automatically reserved for outbound documents and whether order tracking links are created between demand and supply to reflect planning actions.';
}
- action(Telebanking)
- {
- ApplicationArea = Advanced;
- Caption = 'Telebanking';
- RunObject = Page "Telebank - Bank Overview";
- ToolTip = 'Prepare to exchange your payments to vendors and collections from customers with your bank electronically. This includes the export of payment and collection data that need to be forwarded to the bank as well as the import of bank statements sent to you by the bank.';
- }
- action("Telebank - Bank Overview")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Telebank - Bank Overview';
- RunObject = Page "Telebank - Bank Overview";
- ToolTip = 'View a list of bank accounts that are set up for electronic bank file transfers.';
- }
action(PurchaseJournals)
{
ApplicationArea = Basic, Suite;
@@ -263,22 +247,6 @@ page 9002 "Acc. Payables Coordinator RC"
Recurring = const(false));
ToolTip = 'Post financial transactions directly to general ledger accounts and other accounts, such as bank, customer, vendor, and employee accounts. Posting with a general journal always creates entries on general ledger accounts. This is true even when, for example, you post a journal line to a customer account, because an entry is posted to a general ledger receivables account through a posting group.';
}
- action("Bank/Giro Journals")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Bank/Giro Journals';
- RunObject = Page "Bank/Giro Journal List";
- RunPageView = where(Type = const("Bank/Giro"));
- ToolTip = 'Reconcile a bank account by comparing incoming and outgoing bank transactions to a physical bank statement or by importing an electronic bank statement file, and apply the related payments to open customer or vendor documents.';
- }
- action("Cash Journals")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Cash Journals';
- RunObject = Page "Cash Journal List";
- RunPageView = where(Type = const(Cash));
- ToolTip = 'Post transactions to the cash account in the general ledger.';
- }
}
area(sections)
{
@@ -398,20 +366,6 @@ page 9002 "Acc. Payables Coordinator RC"
"Applies-to ID" = filter(''));
ToolTip = 'Opens vendor ledger entries for all vendors with invoices that have not been paid yet.';
}
- action("Bank/Giro Journal")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Bank/Giro Journal';
- RunObject = Page "Bank/Giro Journal List";
- ToolTip = 'Reconcile a bank account by comparing incoming and outgoing bank transactions to a physical bank statement or by importing an electronic bank statement file, and apply the related payments to open customer or vendor documents.';
- }
- action("Cash Journal")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Cash Journal';
- RunObject = Page "Cash Journal List";
- ToolTip = 'Post transactions to the cash account in the general ledger.';
- }
separator(Administration)
{
Caption = 'Administration';
diff --git a/src/Layers/NL/BaseApp/Finance/RoleCenters/AccReceivablesAdmRC.Page.al b/src/Layers/NL/BaseApp/Finance/RoleCenters/AccReceivablesAdmRC.Page.al
index 495d5c61cd..6becad3c8f 100644
--- a/src/Layers/NL/BaseApp/Finance/RoleCenters/AccReceivablesAdmRC.Page.al
+++ b/src/Layers/NL/BaseApp/Finance/RoleCenters/AccReceivablesAdmRC.Page.al
@@ -7,7 +7,6 @@ namespace Microsoft.Finance.RoleCenters;
using Microsoft.Bank.BankAccount;
using Microsoft.Bank.Deposit;
using Microsoft.Bank.DirectDebit;
-using Microsoft.Bank.Journal;
using Microsoft.Bank.Payment;
using Microsoft.EServices.EDocument;
using Microsoft.Finance.GeneralLedger.Journal;
@@ -245,22 +244,6 @@ page 9003 "Acc. Receivables Adm. RC"
Recurring = const(false));
ToolTip = 'Post financial transactions directly to general ledger accounts and other accounts, such as bank, customer, vendor, and employee accounts. Posting with a general journal always creates entries on general ledger accounts. This is true even when, for example, you post a journal line to a customer account, because an entry is posted to a general ledger receivables account through a posting group.';
}
- action("Bank/Giro Journals")
- {
- ApplicationArea = Advanced;
- Caption = 'Bank/Giro Journals';
- RunObject = Page "Bank/Giro Journal List";
- RunPageView = where(Type = const("Bank/Giro"));
- ToolTip = 'Reconcile a bank account by comparing incoming and outgoing bank transactions to a physical bank statement or by importing an electronic bank statement file, and apply the related payments to open customer or vendor documents.';
- }
- action("Cash Journals")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Cash Journals';
- RunObject = Page "Cash Journal List";
- RunPageView = where(Type = const(Cash));
- ToolTip = 'Post transactions to the cash account in the general ledger.';
- }
action("Direct Debit Collections")
{
ApplicationArea = Basic, Suite;
diff --git a/src/Layers/NL/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al b/src/Layers/NL/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
index 24f56c9270..ae523df3fb 100644
--- a/src/Layers/NL/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
+++ b/src/Layers/NL/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
@@ -6,8 +6,6 @@ namespace Microsoft.Finance.RoleCenters;
using Microsoft.Bank.BankAccount;
using Microsoft.Bank.Deposit;
-using Microsoft.Bank.Journal;
-using Microsoft.Bank.Payment;
using Microsoft.Bank.Reconciliation;
using Microsoft.Bank.Reports;
using Microsoft.CashFlow.Account;
@@ -73,53 +71,53 @@ page 9001 "Accounting Manager Role Center"
{
area(rolecenter)
{
- part(Control1902304208; "Account Manager Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part(Control99; "Finance Performance")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control103; "Trailing Sales Orders Chart")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control106; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control100; "Cash Flow Forecast Chart")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1907692008; "My Customers")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1902476008; "My Vendors")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control108; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- systempart(Control1901377608; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
+ part(Control1902304208; "Account Manager Activities")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part("User Tasks Activities"; "User Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part(Control99; "Finance Performance")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control103; "Trailing Sales Orders Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control106; "My Job Queue")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control100; "Cash Flow Forecast Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1907692008; "My Customers")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1902476008; "My Vendors")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control108; "Report Inbox Part")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ systempart(Control1901377608; MyNotes)
+ {
+ ApplicationArea = Basic, Suite;
+ }
}
}
@@ -462,20 +460,6 @@ page 9001 "Accounting Manager Role Center"
RunObject = Page "Finance Charge Memo List";
ToolTip = 'Send finance charge memos to customers with delayed payments, typically following a reminder process. Finance charges are calculated automatically and added to the overdue amounts on the customer''s account according to the specified finance charge terms and penalty/interest amounts.';
}
- action(Telebanking)
- {
- ApplicationArea = Advanced;
- Caption = 'Telebanking';
- RunObject = Page "Telebank - Bank Overview";
- ToolTip = 'Prepare to exchange your payments to vendors and collections from customers with your bank electronically. This includes the export of payment and collection data that need to be forwarded to the bank as well as the import of bank statements sent to you by the bank.';
- }
- action("Telebank - Bank Overview")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Telebank - Bank Overview';
- RunObject = Page "Telebank - Bank Overview";
- ToolTip = 'View a list of bank accounts that are set up for electronic bank file transfers.';
- }
action("Incoming Documents")
{
ApplicationArea = Basic, Suite;
@@ -555,22 +539,6 @@ page 9001 "Accounting Manager Role Center"
Recurring = const(false));
ToolTip = 'Post financial transactions directly to general ledger accounts and other accounts, such as bank, customer, vendor, and employee accounts. Posting with a general journal always creates entries on general ledger accounts. This is true even when, for example, you post a journal line to a customer account, because an entry is posted to a general ledger receivables account through a posting group.';
}
- action("Bank/Giro Journals")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Bank/Giro Journals';
- RunObject = Page "Bank/Giro Journal List";
- RunPageView = where(Type = const("Bank/Giro"));
- ToolTip = 'Reconcile a bank account by comparing incoming and outgoing bank transactions to a physical bank statement or by importing an electronic bank statement file, and apply the related payments to open customer or vendor documents.';
- }
- action("Cash Journals")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Cash Journals';
- RunObject = Page "Cash Journal List";
- RunPageView = where(Type = const(Cash));
- ToolTip = 'Post transactions to the cash account in the general ledger.';
- }
}
group("Fixed Assets")
{
@@ -846,41 +814,6 @@ page 9001 "Accounting Manager Role Center"
RunObject = Page "Bank Account Posting Groups";
ToolTip = 'Set up posting groups, so that payments in and out of each bank account are posted to the specified general ledger account.';
}
- action("Elec. Tax Decl. VAT Categories")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Elec. Tax Decl. VAT Categories';
- RunObject = Page "Elec. Tax Decl. VAT Categ.";
- ToolTip = 'Set up all the possible combinations of categories and sub categories that represent a XML element in the electronic VAT declaration. A combination is defined by a code. By entering this code in the Elec. Tax Decl. Category Code field on a VAT statement line, you map the data of the VAT statement directly to a XML element.';
- }
- action("Transaction Modes")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Transaction Modes';
- RunObject = Page "Transaction Mode List";
- ToolTip = 'View or edit the transaction modes that are used for telebanking to manage how an order, invoice, or credit memo for a vendor or customer will be paid for or collected.';
- }
- action("Export Telebanking Protocols")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Export Telebanking Protocols';
- RunObject = Page "Export Protocols";
- ToolTip = 'Set up codes for each set of export protocols to be used when exporting a payment history for processing by the bank.';
- }
- action("Import Telebanking Protocols")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Import Telebanking Protocols';
- RunObject = Page "Import Protocols";
- ToolTip = 'Set up codes for each set of import protocols to be used when importing bank statements.';
- }
- action("Freely Transferable Maximums")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Freely Transferable Maximums';
- RunObject = Page "Freely Transferable Maximums";
- ToolTip = 'Set up freely transferable maximums that denote the maximum amount, for a specific currency, that can be transferred in one payment from one country to another without reason given.';
- }
}
}
area(creation)
@@ -956,13 +889,6 @@ page 9001 "Accounting Manager Role Center"
RunObject = Report "Import Consolidation from DB";
ToolTip = 'Import entries from the business units that will be included in a consolidation. You can use the batch job if the business unit comes from the same database in Business Central as the consolidated company.';
}
- action("Import Bank Statement")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Import Bank Statement';
- RunObject = Codeunit "Import Protocol Management";
- ToolTip = 'Prepare to reconcile the bank account by importing an electronic bank statement with the actual bank transactions.';
- }
action("Bank Account R&econciliation")
{
ApplicationArea = Basic, Suite;
@@ -996,14 +922,6 @@ page 9001 "Accounting Manager Role Center"
Image = PostInventoryToGL;
RunObject = Report "Post Inventory Cost to G/L";
}
- action("Tax Authority - Audit File")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Tax Authority - Audit File';
- Image = "Report";
- RunObject = Report "Tax Authority - Audit File";
- ToolTip = 'Create an audit file that contains all journal transactions from the general ledger. During a tax audit, this file is imported from the tax authority for additional analysis.';
- }
separator(Action97)
{
}
@@ -1034,20 +952,6 @@ page 9001 "Accounting Manager Role Center"
RunObject = Report "Calc. and Post VAT Settlement";
ToolTip = 'Close open VAT entries and transfers purchase and sales VAT amounts to the VAT settlement account. For every VAT posting group, the batch job finds all the VAT entries in the VAT Entry table that are included in the filters in the definition window.';
}
- action("Elec. Tax Declarations")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Elec. Tax Declarations';
- RunObject = Page "Elec. Tax Declaration List";
- ToolTip = 'View the list of VAT and ICP declarations that you send to the tax authorities.';
- }
- action("Elec. Tax Decl. Response Msgs.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Elec. Tax Decl. Response Msgs.';
- RunObject = Page "Elec. Tax Decl. Response Msgs.";
- ToolTip = 'View all the response messages received from the tax authorities. The status of the response message indicates if the message is processed or not.';
- }
separator(Action80)
{
Caption = 'Administration';
@@ -1061,13 +965,6 @@ page 9001 "Accounting Manager Role Center"
RunObject = Page "General Ledger Setup";
ToolTip = 'Post financial transactions directly to general ledger accounts and other accounts, such as bank, customer, vendor, and employee accounts. Posting with a general journal always creates entries on general ledger accounts. This is true even when, for example, you post a journal line to a customer account, because an entry is posted to a general ledger receivables account through a posting group.';
}
- action("Elec. Tax Declaration Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Elec. Tax Declaration Setup';
- RunObject = Page "Elec. Tax Declaration Setup";
- ToolTip = 'Set up the information that will be used to generate an electronic VAT and ICP declaration, such as the Digipoort configuration. ';
- }
action("&Sales && Receivables Setup")
{
ApplicationArea = Basic, Suite;
diff --git a/src/Layers/NL/BaseApp/Finance/RoleCenters/BookkeeperRoleCenter.Page.al b/src/Layers/NL/BaseApp/Finance/RoleCenters/BookkeeperRoleCenter.Page.al
index 77b534155d..b5c6ca133a 100644
--- a/src/Layers/NL/BaseApp/Finance/RoleCenters/BookkeeperRoleCenter.Page.al
+++ b/src/Layers/NL/BaseApp/Finance/RoleCenters/BookkeeperRoleCenter.Page.al
@@ -6,7 +6,6 @@ namespace Microsoft.Finance.RoleCenters;
using Microsoft.Bank.BankAccount;
using Microsoft.Bank.Deposit;
-using Microsoft.Bank.Journal;
using Microsoft.Bank.Payment;
using Microsoft.Bank.Reconciliation;
using Microsoft.Bank.Reports;
@@ -238,7 +237,7 @@ page 9004 "Bookkeeper Role Center"
}
action("G/L - VAT Reconciliation")
{
- ApplicationArea = Basic, Suite;
+ ApplicationArea = VAT;
Caption = 'G/L - VAT Reconciliation';
Image = "Report";
RunObject = Report "G/L - VAT Reconciliation";
@@ -374,20 +373,6 @@ page 9004 "Bookkeeper Role Center"
RunObject = Page "Sales Order List";
ToolTip = 'Record your agreements with customers to sell certain products on certain delivery and payment terms. Sales orders, unlike sales invoices, allow you to ship partially, deliver directly from your vendor to your customer, initiate warehouse handling, and print various customer-facing documents. Sales invoicing is integrated in the sales order process.';
}
- action(Telebanking)
- {
- ApplicationArea = Advanced;
- Caption = 'Telebanking';
- RunObject = Page "Telebank - Bank Overview";
- ToolTip = 'Prepare to exchange your payments to vendors and collections from customers with your bank electronically. This includes the export of payment and collection data that need to be forwarded to the bank as well as the import of bank statements sent to you by the bank.';
- }
- action("Telebank - Bank Overview")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Telebank - Bank Overview';
- RunObject = Page "Telebank - Bank Overview";
- ToolTip = 'View a list of bank accounts that are set up for electronic bank file transfers.';
- }
action(Approvals)
{
ApplicationArea = Basic, Suite;
@@ -426,22 +411,6 @@ page 9004 "Bookkeeper Role Center"
Recurring = const(false));
ToolTip = 'Post financial transactions directly to general ledger accounts and other accounts, such as bank, customer, vendor, and employee accounts. Posting with a general journal always creates entries on general ledger accounts. This is true even when, for example, you post a journal line to a customer account, because an entry is posted to a general ledger receivables account through a posting group.';
}
- action("Bank/Giro Journals")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Bank/Giro Journals';
- RunObject = Page "Bank/Giro Journal List";
- RunPageView = where(Type = const("Bank/Giro"));
- ToolTip = 'Reconcile a bank account by comparing incoming and outgoing bank transactions to a physical bank statement or by importing an electronic bank statement file, and apply the related payments to open customer or vendor documents.';
- }
- action("Cash Journals")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Cash Journals';
- RunObject = Page "Cash Journal List";
- RunPageView = where(Type = const(Cash));
- ToolTip = 'Post transactions to the cash account in the general ledger.';
- }
action(RecurringGeneralJournals)
{
ApplicationArea = Basic, Suite;
@@ -720,13 +689,6 @@ page 9004 "Bookkeeper Role Center"
RunObject = Page "Bank Acc. Reconciliation";
ToolTip = 'Reconcile entries in your bank account ledger entries with the actual transactions in your bank account, according to the latest bank statement.';
}
- action("Import Bank Statement")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Import Bank Statement';
- RunObject = Codeunit "Import Protocol Management";
- ToolTip = 'Prepare to reconcile the bank account by importing an electronic bank statement with the actual bank transactions.';
- }
action("Adjust E&xchange Rates")
{
ApplicationArea = Basic, Suite;
@@ -753,28 +715,6 @@ page 9004 "Bookkeeper Role Center"
RunObject = Report "Calc. and Post VAT Settlement";
ToolTip = 'Close open VAT entries and transfers purchase and sales VAT amounts to the VAT settlement account. For every VAT posting group, the batch job finds all the VAT entries in the VAT Entry table that are included in the filters in the definition window.';
}
- action("Elec. Tax Declarations")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Elec. Tax Declarations';
- RunObject = Page "Elec. Tax Declaration List";
- ToolTip = 'View the list of VAT and ICP declarations that you send to the tax authorities.';
- }
- action("Elec. Tax Decl. Response Msgs.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Elec. Tax Decl. Response Msgs.';
- RunObject = Page "Elec. Tax Decl. Response Msgs.";
- ToolTip = 'View all the response messages received from the tax authorities. The status of the response message indicates if the message is processed or not.';
- }
- action("Tax Authority - Audit File")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Tax Authority - Audit File';
- Image = "Report";
- RunObject = Report "Tax Authority - Audit File";
- ToolTip = 'Create an audit file that contains all journal transactions from the general ledger. During a tax audit, this file is imported from the tax authority for additional analysis.';
- }
separator(Action84)
{
Caption = 'Administration';
diff --git a/src/Layers/NL/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/NL/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index 8b2af58d2b..289c4ff8c6 100644
--- a/src/Layers/NL/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/NL/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -8,7 +8,6 @@ using Microsoft.Bank.BankAccount;
using Microsoft.Bank.Check;
using Microsoft.Bank.Deposit;
using Microsoft.Bank.DirectDebit;
-using Microsoft.Bank.Journal;
using Microsoft.Bank.Ledger;
using Microsoft.Bank.Payment;
using Microsoft.Bank.Reconciliation;
@@ -97,7 +96,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
@@ -128,24 +126,6 @@ page 8901 "Finance Manager Role Center"
RunObject = page "Financial Reports";
Tooltip = 'Open the Account Schedules page.';
}
- action("Bank/Giro Journal")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Bank/Giro Journal';
- RunObject = page "Bank/Giro Journal List";
- }
- action("Cash Journal")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Cash Journal';
- RunObject = page "Cash Journal List";
- }
- action("Telebank - Bank Overview")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Telebank - Bank Overview';
- RunObject = page "Telebank - Bank Overview";
- }
action("Analyses by Dimensions")
{
ApplicationArea = Dimensions;
@@ -244,22 +224,6 @@ page 8901 "Finance Manager Role Center"
}
}
}
- group("Group64")
- {
- Caption = 'Elec. Tax Declaration';
- action("Elec. Tax Declarations")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Elec. Tax Declarations';
- RunObject = page "Elec. Tax Declaration List";
- }
- action("Elec. Tax Decl. Response Msgs.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Elec. Tax Decl. Response Msgs.';
- RunObject = page "Elec. Tax Decl. Response Msgs.";
- }
- }
group("Group3")
{
Caption = 'Intercompany';
@@ -588,18 +552,6 @@ page 8901 "Finance Manager Role Center"
RunObject = report "Foreign Currency Balance";
Tooltip = 'Run the Foreign Currency Balance report.';
}
- action("Tax Authority - Audit File")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Tax Authority - Audit File';
- RunObject = report "Tax Authority - Audit File";
- }
- action("NL Export Financial Data to XM")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'NL Export Financial Data to XML';
- RunObject = report "Export Financial Data to XML";
- }
action("Reconcile Cust. and Vend. Accs")
{
ApplicationArea = Basic, Suite;
@@ -673,50 +625,6 @@ page 8901 "Finance Manager Role Center"
RunObject = page "VAT Report Setup";
Tooltip = 'Open the VAT Report Setup page.';
}
- group("Group62")
- {
- Caption = 'Elec. Tax Declaration';
- action("Elec. Tax Declaration Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Elec. Tax Declaration Setup';
- RunObject = page "Elec. Tax Declaration Setup";
- }
- action("Elec. Tax Decl. VAT Categories")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Elec. Tax Decl. VAT Categories';
- RunObject = page "Elec. Tax Decl. VAT Categ.";
- }
- }
- group("Group63")
- {
- Caption = 'Telebanking';
- action("Transaction Modes")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Transaction Modes';
- RunObject = page "Transaction Mode List";
- }
- action("Export Protocols")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Export Protocols';
- RunObject = page "Export Protocols";
- }
- action("Import Protocols")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Import Protocols';
- RunObject = page "Import Protocols";
- }
- action("Freely Transferable Maximums")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Freely Transferable Maximums';
- RunObject = page "Freely Transferable Maximums";
- }
- }
}
}
group("Group13")
diff --git a/src/Layers/NL/BaseApp/Finance/VAT/Reporting/VATReport.Page.al b/src/Layers/NL/BaseApp/Finance/VAT/Reporting/VATReport.Page.al
index d473b956e4..da8d1af224 100644
--- a/src/Layers/NL/BaseApp/Finance/VAT/Reporting/VATReport.Page.al
+++ b/src/Layers/NL/BaseApp/Finance/VAT/Reporting/VATReport.Page.al
@@ -517,8 +517,8 @@ page 740 "VAT Report"
TempErrorMessage: Record "Error Message" temporary;
begin
TempErrorMessage.CopyFromContext(Rec);
- CurrPage.ErrorMessagesPart.PAGE.SetRecords(TempErrorMessage);
- CurrPage.ErrorMessagesPart.PAGE.Update();
+ CurrPage.ErrorMessagesPart.Page.SetRecords(TempErrorMessage);
+ CurrPage.ErrorMessagesPart.Page.Update();
ErrorsExist := not TempErrorMessage.IsEmpty();
exit(ErrorsExist);
diff --git a/src/Layers/NL/BaseApp/Finance/VAT/Reporting/VATStatement.Page.al b/src/Layers/NL/BaseApp/Finance/VAT/Reporting/VATStatement.Page.al
index 042848f548..6c9bd20a52 100644
--- a/src/Layers/NL/BaseApp/Finance/VAT/Reporting/VATStatement.Page.al
+++ b/src/Layers/NL/BaseApp/Finance/VAT/Reporting/VATStatement.Page.al
@@ -53,11 +53,6 @@ page 317 "VAT Statement"
{
ApplicationArea = Basic, Suite;
}
- field("Elec. Tax Decl. Category Code"; Rec."Elec. Tax Decl. Category Code")
- {
- ApplicationArea = VAT;
- ToolTip = 'Specifies the electronic tax declaration category that is used to map the VAT Statement Line data to an XML element in the electronic statement.';
- }
field(Description; Rec.Description)
{
ApplicationArea = Basic, Suite;
diff --git a/src/Layers/NL/BaseApp/Finance/VAT/Reporting/VATStatementLine.Table.al b/src/Layers/NL/BaseApp/Finance/VAT/Reporting/VATStatementLine.Table.al
index 2b294c1318..2ff0bc5875 100644
--- a/src/Layers/NL/BaseApp/Finance/VAT/Reporting/VATStatementLine.Table.al
+++ b/src/Layers/NL/BaseApp/Finance/VAT/Reporting/VATStatementLine.Table.al
@@ -78,7 +78,6 @@ table 256 "VAT Statement Line"
"Row No." := xRec."Row No.";
Description := xRec.Description;
Type := TempType;
- UpdateElecTaxDeclCategoryCode();
end;
end;
}
@@ -221,11 +220,6 @@ table 256 "VAT Statement Line"
Caption = 'Box No.';
ToolTip = 'Specifies the number on the box that the VAT statement applies to.';
}
- field(11400; "Elec. Tax Decl. Category Code"; Code[10])
- {
- Caption = 'Elec. Tax Decl. Category Code';
- TableRelation = "Elec. Tax Decl. VAT Category";
- }
}
keys
@@ -234,9 +228,6 @@ table 256 "VAT Statement Line"
{
Clustered = true;
}
- key(Key2; "Elec. Tax Decl. Category Code")
- {
- }
}
fieldgroups
@@ -252,22 +243,5 @@ table 256 "VAT Statement Line"
Text000: Label 'must not be %1';
#pragma warning restore AA0470
#pragma warning restore AA0074
-
- local procedure UpdateElecTaxDeclCategoryCode()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateElecTaxDeclCategoryCode(Rec, IsHandled);
- if IsHandled then
- exit;
-
- "Elec. Tax Decl. Category Code" := xRec."Elec. Tax Decl. Category Code";
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateElecTaxDeclCategoryCode(var VATStatementLine: Record "VAT Statement Line"; var IsHandled: Boolean)
- begin
- end;
}
diff --git a/src/Layers/NL/BaseApp/Foundation/Address/CountriesRegions.Page.al b/src/Layers/NL/BaseApp/Foundation/Address/CountriesRegions.Page.al
deleted file mode 100644
index 5767fdfda2..0000000000
--- a/src/Layers/NL/BaseApp/Foundation/Address/CountriesRegions.Page.al
+++ /dev/null
@@ -1,166 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Foundation.Address;
-
-using Microsoft.Finance.VAT.Registration;
-
-page 10 "Countries/Regions"
-{
- ApplicationArea = Basic, Suite;
- Caption = 'Countries/Regions';
- PageType = List;
- SourceTable = "Country/Region";
- UsageCategory = Administration;
-
- layout
- {
- area(content)
- {
- repeater(Control1)
- {
- ShowCaption = false;
- field("Code"; Rec.Code)
- {
- ApplicationArea = Basic, Suite;
- }
- field(Name; Rec.Name)
- {
- ApplicationArea = Basic, Suite;
- }
- field("ISO Code"; Rec."ISO Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field("ISO Numeric Code"; Rec."ISO Numeric Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field("SEPA Allowed"; Rec."SEPA Allowed")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies if the Single Euro Payments Area (SEPA) function is active for the country/region.';
- }
- field("Address Format"; Rec."Address Format")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Contact Address Format"; Rec."Contact Address Format")
- {
- ApplicationArea = Basic, Suite;
- }
- field("County Name"; Rec."County Name")
- {
- ApplicationArea = Basic, Suite;
- }
- field("EU Country/Region Code"; Rec."EU Country/Region Code")
- {
- ApplicationArea = BasicEU, BasicNO;
- }
- field("Intrastat Code"; Rec."Intrastat Code")
- {
- ApplicationArea = BasicEU, BasicNO;
- }
- field("VAT Scheme"; Rec."VAT Scheme")
- {
- ApplicationArea = Basic, Suite;
- }
- }
- }
- area(factboxes)
- {
- part(Control8; "Custom Address Format Factbox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "Country/Region Code" = field(Code);
- Visible = Rec."Address Format" = Rec."Address Format"::Custom;
- }
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- Visible = false;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("&Country/Region")
- {
- Caption = '&Country/Region';
- Image = CountryRegion;
- action("VAT Reg. No. Formats")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'VAT Reg. No. Formats';
- Image = NumberSetup;
- RunObject = Page "VAT Registration No. Formats";
- RunPageLink = "Country/Region Code" = field(Code);
- ToolTip = 'Specify that the tax registration number for an account, such as a customer, corresponds to the standard format for tax registration numbers in an account''s country/region.';
- }
- action(Translations)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Translations';
- Image = Translations;
- ToolTip = 'Opens a window in which you can define the translations for the name of the selected country/region.';
- RunObject = Page "Country/Region Translations";
- RunPageLink = "Country/Region Code" = field(Code);
- }
- action(CustomAddressFormat)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Custom Address Format';
- Enabled = Rec."Address Format" = Rec."Address Format"::Custom;
- Image = Addresses;
- ToolTip = 'Define the scope and order of fields that make up the country/region address.';
-
- trigger OnAction()
- var
- CustomAddressFormat: Record "Custom Address Format";
- CustomAddressFormatPage: Page "Custom Address Format";
- begin
- if Rec."Address Format" <> Rec."Address Format"::Custom then
- exit;
-
- CustomAddressFormat.FilterGroup(2);
- CustomAddressFormat.SetRange("Country/Region Code", Rec.Code);
- CustomAddressFormat.FilterGroup(0);
-
- Clear(CustomAddressFormatPage);
- CustomAddressFormatPage.SetTableView(CustomAddressFormat);
- CustomAddressFormatPage.RunModal();
- end;
- }
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process';
- actionref(CustomAddressFormat_Promoted; CustomAddressFormat)
- {
- }
- }
- group("Category_Country/Region")
- {
- Caption = 'Country/Region';
- actionref("VAT Reg. No. Formats_Promoted"; "VAT Reg. No. Formats")
- {
- }
- actionref(Translations_Promoted; Translations)
- {
- }
- }
- }
- }
-}
diff --git a/src/Layers/NL/BaseApp/Foundation/Address/CountryRegion.Table.al b/src/Layers/NL/BaseApp/Foundation/Address/CountryRegion.Table.al
deleted file mode 100644
index f1447b4a57..0000000000
--- a/src/Layers/NL/BaseApp/Foundation/Address/CountryRegion.Table.al
+++ /dev/null
@@ -1,323 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Foundation.Address;
-
-using Microsoft.Finance.VAT.Registration;
-using Microsoft.Foundation.Company;
-using System.Globalization;
-using System.Reflection;
-using System.Utilities;
-
-table 9 "Country/Region"
-{
- Caption = 'Country/Region';
- LookupPageID = "Countries/Regions";
- DataClassification = CustomerContent;
-
- fields
- {
- field(1; "Code"; Code[10])
- {
- Caption = 'Code';
- ToolTip = 'Specifies the country/region of the address.';
- NotBlank = true;
- }
- field(2; Name; Text[50])
- {
- Caption = 'Name';
- ToolTip = 'Specifies the country/region of the address.';
- }
- field(4; "ISO Code"; Code[2])
- {
- Caption = 'ISO Code';
- ToolTip = 'Specifies a two-letter country code defined in ISO 3166-1.';
- DataClassification = CustomerContent;
-
- trigger OnValidate()
- var
- Regex: Codeunit Regex;
- begin
- if "ISO Code" = '' then
- exit;
- if StrLen("ISO Code") < MaxStrLen("ISO Code") then
- Error(ISOCodeLengthErr, StrLen("ISO Code"), MaxStrLen("ISO Code"), "ISO Code");
- if not Regex.IsMatch("ISO Code", '^[a-zA-Z]*$') then
- FieldError("ISO Code", ASCIILetterErr);
- end;
- }
- field(5; "ISO Numeric Code"; Code[3])
- {
- Caption = 'ISO Numeric Code';
- ToolTip = 'Specifies a three-digit code number defined in ISO 3166-1.';
- DataClassification = CustomerContent;
-
- trigger OnValidate()
- begin
- if "ISO Numeric Code" = '' then
- exit;
- if StrLen("ISO Numeric Code") < MaxStrLen("ISO Numeric Code") then
- Error(ISOCodeLengthErr, StrLen("ISO Numeric Code"), MaxStrLen("ISO Numeric Code"), "ISO Numeric Code");
- if not TypeHelper.IsNumeric("ISO Numeric Code") then
- FieldError("ISO Numeric Code", NumericErr);
- end;
- }
- field(6; "EU Country/Region Code"; Code[10])
- {
- Caption = 'EU Country/Region Code';
- ToolTip = 'Specifies the EU code for the country/region you are doing business with.';
- }
- field(7; "Intrastat Code"; Code[10])
- {
- Caption = 'Intrastat Code';
- ToolTip = 'Specifies an INTRASTAT code for the country/region you are trading with.';
- }
- field(8; "Address Format"; Enum "Country/Region Address Format")
- {
- Caption = 'Address Format';
- ToolTip = 'Specifies the format of the address that is displayed on external-facing documents. You link an address format to a country/region code so that external-facing documents based on cards or documents with that country/region code use the specified address format. NOTE: If the County field is filled in, then the county will be printed above the country/region unless you select the City+County+Post Code option.';
- InitValue = "City+Post Code";
-
- trigger OnValidate()
- begin
- if xRec."Address Format" <> "Address Format" then begin
- if "Address Format" = "Address Format"::Custom then
- InitAddressFormat();
- if xRec."Address Format" = xRec."Address Format"::Custom then
- ClearCustomAddressFormat();
- end;
- end;
- }
- field(9; "Contact Address Format"; Option)
- {
- Caption = 'Contact Address Format';
- ToolTip = 'Specifies where you want the contact name to appear in mailing addresses.';
- InitValue = "After Company Name";
- OptionCaption = 'First,After Company Name,Last';
- OptionMembers = First,"After Company Name",Last;
- }
- field(10; "VAT Scheme"; Code[10])
- {
- Caption = 'VAT Scheme';
- ToolTip = 'Specifies the national body that issues the VAT registration number for the country/region in connection with electronic document sending.';
- }
- field(11; "Last Modified Date Time"; DateTime)
- {
- Caption = 'Last Modified Date Time';
- Editable = false;
- }
- field(12; "County Name"; Text[30])
- {
- Caption = 'County Name';
- ToolTip = 'Specifies the name of the county.';
- }
- field(11400; "SEPA Allowed"; Boolean)
- {
- Caption = 'SEPA Allowed';
- }
- }
-
- keys
- {
- key(Key1; "Code")
- {
- Clustered = true;
- }
- key(Key2; "EU Country/Region Code")
- {
- }
- key(Key3; "Intrastat Code")
- {
- }
- key(Key4; Name)
- {
- }
- }
-
- fieldgroups
- {
- fieldgroup(Brick; "Code", Name, "VAT Scheme")
- {
- }
- fieldgroup(DropDown; "Code", Name)
- {
- }
- }
-
- trigger OnDelete()
- var
- VATRegNoFormat: Record "VAT Registration No. Format";
- CountryRegionTranslation: Record "Country/Region Translation";
- begin
- VATRegNoFormat.SetRange("Country/Region Code", Code);
- VATRegNoFormat.DeleteAll();
-
- CountryRegionTranslation.SetRange("Country/Region Code", Rec.Code);
- if not CountryRegionTranslation.IsEmpty() then
- CountryRegionTranslation.DeleteAll(true);
- end;
-
- trigger OnInsert()
- begin
- "Last Modified Date Time" := CurrentDateTime;
- end;
-
- trigger OnModify()
- begin
- "Last Modified Date Time" := CurrentDateTime;
- end;
-
- trigger OnRename()
- begin
- "Last Modified Date Time" := CurrentDateTime;
- end;
-
- var
- TypeHelper: Codeunit "Type Helper";
-
- CountryRegionNotFilledErr: Label 'You must specify a country or region.';
- ISOCodeLengthErr: Label 'The length of the string is %1, but it must be equal to %2 characters. Value: %3.', Comment = '%1, %2 - numbers, %3 - actual value';
- ASCIILetterErr: Label 'must contain ASCII letters only';
- NumericErr: Label 'must contain numbers only';
-
- procedure IsEUCountry(CountryRegionCode: Code[10]): Boolean
- var
- CountryRegion: Record "Country/Region";
- begin
- if CountryRegionCode = '' then
- Error(CountryRegionNotFilledErr);
-
- if not CountryRegion.Get(CountryRegionCode) then
- Error(CountryRegionNotFilledErr);
-
- exit(CountryRegion."EU Country/Region Code" <> '');
- end;
-
- procedure TranslateName(LanguageCode: Code[10])
- var
- CountryRegionTranslation: Record "Country/Region Translation";
- begin
- if LanguageCode = '' then
- exit;
- if CountryRegionTranslation.Get(Code, LanguageCode) then
- Rec.Name := CountryRegionTranslation.Name;
- end;
-
- procedure GetTranslatedName(LanguageID: Integer): Text[50]
- var
- Language: Codeunit Language;
- LanguageCode: Code[10];
- begin
- LanguageCode := Language.GetLanguageCode(LanguageID);
- exit(GetTranslatedName(LanguageCode));
- end;
-
- procedure GetTranslatedName(LanguageCode: Code[10]): Text[50]
- var
- CountryRegionTranslation: Record "Country/Region Translation";
- begin
- if CountryRegionTranslation.Get(Code, LanguageCode) then
- exit(CountryRegionTranslation.Name);
- exit(Name);
- end;
-
- procedure GetNameInCurrentLanguage(): Text[50]
- var
- Language: Codeunit Language;
- begin
- exit(GetTranslatedName(Language.GetUserLanguageCode()));
- end;
-
- procedure CreateAddressFormat(CountryCode: Code[10]; LinePosition: Integer; FieldID: Integer): Integer
- var
- CustomAddressFormat: Record "Custom Address Format";
- begin
- CustomAddressFormat.Init();
- CustomAddressFormat."Country/Region Code" := Code;
- CustomAddressFormat."Field ID" := FieldID;
- CustomAddressFormat."Line Position" := LinePosition - 1;
- CustomAddressFormat.Insert();
-
- if FieldID <> 0 then
- CreateAddressFormatLine(CountryCode, 1, FieldID, CustomAddressFormat."Line No.");
-
- CustomAddressFormat.BuildAddressFormat();
- CustomAddressFormat.Modify();
-
- exit(CustomAddressFormat."Line No.");
- end;
-
- procedure CreateAddressFormatLine(CountryCode: Code[10]; FieldPosition: Integer; FieldID: Integer; LineNo: Integer)
- var
- CustomAddressFormatLine: Record "Custom Address Format Line";
- begin
- CustomAddressFormatLine.Init();
- CustomAddressFormatLine."Country/Region Code" := CountryCode;
- CustomAddressFormatLine."Line No." := LineNo;
- CustomAddressFormatLine."Field Position" := FieldPosition - 1;
- CustomAddressFormatLine.Validate("Field ID", FieldID);
- CustomAddressFormatLine.Insert();
- end;
-
- procedure InitAddressFormat()
- var
- CompanyInformation: Record "Company Information";
- CustomAddressFormat: Record "Custom Address Format";
- LineNo: Integer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInitAddressFormat(Rec, IsHandled);
- if IsHandled then
- exit;
-
- CreateAddressFormat(Code, 1, CompanyInformation.FieldNo(Name));
- CreateAddressFormat(Code, 2, CompanyInformation.FieldNo("Name 2"));
- CreateAddressFormat(Code, 3, CompanyInformation.FieldNo("Contact Person"));
- CreateAddressFormat(Code, 4, CompanyInformation.FieldNo(Address));
- CreateAddressFormat(Code, 5, CompanyInformation.FieldNo("Address 2"));
- case xRec."Address Format" of
- xRec."Address Format"::"City+Post Code":
- begin
- LineNo := CreateAddressFormat(Code, 6, 0);
- CreateAddressFormatLine(Code, 1, CompanyInformation.FieldNo(City), LineNo);
- CreateAddressFormatLine(Code, 2, CompanyInformation.FieldNo("Post Code"), LineNo);
- end;
- xRec."Address Format"::"Post Code+City",
- xRec."Address Format"::"Blank Line+Post Code+City":
- begin
- LineNo := CreateAddressFormat(Code, 6, 0);
- CreateAddressFormatLine(Code, 1, CompanyInformation.FieldNo("Post Code"), LineNo);
- CreateAddressFormatLine(Code, 2, CompanyInformation.FieldNo(City), LineNo);
- end;
- xRec."Address Format"::"City+County+Post Code":
- begin
- LineNo := CreateAddressFormat(Code, 6, 0);
- CreateAddressFormatLine(Code, 1, CompanyInformation.FieldNo(City), LineNo);
- CreateAddressFormatLine(Code, 2, CompanyInformation.FieldNo(County), LineNo);
- CreateAddressFormatLine(Code, 3, CompanyInformation.FieldNo("Post Code"), LineNo);
- end;
- end;
- CreateAddressFormat(Rec.Code, 7, CompanyInformation.FieldNo("Country/Region Code"));
-
- if LineNo <> 0 then begin
- CustomAddressFormat.Get(Code, LineNo);
- CustomAddressFormat.BuildAddressFormat();
- CustomAddressFormat.Modify();
- end;
- end;
-
- local procedure ClearCustomAddressFormat()
- var
- CustomAddressFormat: Record "Custom Address Format";
- begin
- CustomAddressFormat.SetRange("Country/Region Code", Code);
- CustomAddressFormat.DeleteAll(true);
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitAddressFormat(var CountryRegion: Record "Country/Region"; var IsHandled: Boolean)
- begin
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Foundation/Address/PostCodes.Page.al b/src/Layers/NL/BaseApp/Foundation/Address/PostCodes.Page.al
index 545955971e..fed3aa3edf 100644
--- a/src/Layers/NL/BaseApp/Foundation/Address/PostCodes.Page.al
+++ b/src/Layers/NL/BaseApp/Foundation/Address/PostCodes.Page.al
@@ -64,22 +64,6 @@ page 367 "Post Codes"
{
area(navigation)
{
- group("&Post Code")
- {
- Caption = '&Post Code';
- Image = ZoneCode;
- action("&Ranges")
- {
- ApplicationArea = Basic, Suite;
- Caption = '&Ranges';
- Image = Ranges;
- RunObject = Page "Post Code Ranges";
- RunPageLink = "Post Code" = field(Code),
- City = field(City);
- RunPageView = sorting("Post Code", City, Type, "From No.");
- ToolTip = 'View or edit street names and cities by post codes. When you enter the post code and house number in an address field the program assists you in filling in the corresponding street name and city. If the house number does not fit into a range by the given post code, the Post Code Range window appears with a list of all the street names and cities by the given post code for you to select from.';
- }
- }
}
}
}
diff --git a/src/Layers/NL/BaseApp/Foundation/Company/CompanyInformation.Page.al b/src/Layers/NL/BaseApp/Foundation/Company/CompanyInformation.Page.al
index a7b55ef05b..fe3d971a0d 100644
--- a/src/Layers/NL/BaseApp/Foundation/Company/CompanyInformation.Page.al
+++ b/src/Layers/NL/BaseApp/Foundation/Company/CompanyInformation.Page.al
@@ -126,11 +126,6 @@ page 1 "Company Information"
ApplicationArea = Basic, Suite;
Importance = Additional;
}
- field("Fiscal Entity No."; Rec."Fiscal Entity No.")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the fiscal entity number is the VAT number assigned to a group of companies to report one consolidated VAT declaration.';
- }
field("Registration No."; Rec."Registration No.")
{
ApplicationArea = Basic, Suite;
diff --git a/src/Layers/NL/BaseApp/Foundation/Company/CompanyInformation.Table.al b/src/Layers/NL/BaseApp/Foundation/Company/CompanyInformation.Table.al
index 660e3b32ec..c510ef8565 100644
--- a/src/Layers/NL/BaseApp/Foundation/Company/CompanyInformation.Table.al
+++ b/src/Layers/NL/BaseApp/Foundation/Company/CompanyInformation.Table.al
@@ -503,17 +503,6 @@ table 79 "Company Information"
ToolTip = 'Specifies how dates based on calendar and calendar-related documents are calculated.';
InitValue = '1Y';
}
- field(11400; "Fiscal Entity No."; Text[20])
- {
- Caption = 'Fiscal Entity No.';
-
- trigger OnValidate()
- var
- VATRegNoFormat: Record "VAT Registration No. Format";
- begin
- VATRegNoFormat.Test("Fiscal Entity No.", "Country/Region Code", '', DATABASE::"Company Information");
- end;
- }
}
keys
@@ -777,17 +766,6 @@ table 79 "Company Information"
exit(DevBetaModeTxt);
end;
- procedure GetVATIdentificationNo(PartOfFiscalEntity: Boolean) Result: Text[20]
- begin
- Get();
- if PartOfFiscalEntity then
- Result := "Fiscal Entity No."
- else
- Result := "VAT Registration No.";
- if CopyStr(UpperCase(Result), 1, 2) = 'NL' then
- Result := DelStr(Result, 1, 2);
- end;
-
procedure GetContactUsText(): Text
begin
if ("Phone No." <> '') and ("E-Mail" <> '') then
diff --git a/src/Layers/NL/BaseApp/HumanResources/Employee/Employee.Table.al b/src/Layers/NL/BaseApp/HumanResources/Employee/Employee.Table.al
index 855e04130c..62b0e7a9ab 100644
--- a/src/Layers/NL/BaseApp/HumanResources/Employee/Employee.Table.al
+++ b/src/Layers/NL/BaseApp/HumanResources/Employee/Employee.Table.al
@@ -4,7 +4,6 @@
// ------------------------------------------------------------------------------------------------
namespace Microsoft.HumanResources.Employee;
-using Microsoft.Bank.Payment;
using Microsoft.Bank.Setup;
using Microsoft.CostAccounting.Account;
using Microsoft.CRM.Team;
@@ -15,7 +14,6 @@ using Microsoft.Finance.GeneralLedger.Setup;
using Microsoft.Finance.ReceivablesPayables;
using Microsoft.Foundation.Address;
using Microsoft.Foundation.Company;
-using Microsoft.Foundation.Enums;
using Microsoft.Foundation.NoSeries;
using Microsoft.Foundation.Period;
using Microsoft.HumanResources.Absence;
@@ -457,6 +455,7 @@ table 5200 Employee
Caption = 'Bank Account No.';
MaskType = Concealed;
ToolTip = 'Specifies the number used by the bank for the bank account.';
+
trigger OnValidate()
var
LocalFunctionalityMgt: Codeunit "Local Functionality Mgt.";
@@ -639,27 +638,6 @@ table 5200 Employee
Caption = 'Cost Object Code';
TableRelation = "Cost Object";
}
- field(11000000; "Transaction Mode Code"; Code[20])
- {
- Caption = 'Transaction Mode Code';
- TableRelation = "Transaction Mode".Code where("Account Type" = const(Employee));
-
- trigger OnValidate()
- var
- TransactionMode: Record "Transaction Mode";
- begin
- if "Transaction Mode Code" <> '' then
- TransactionMode.Get(TransactionMode."Account Type"::Employee, "Transaction Mode Code");
- end;
- }
- field(11000001; "Bank Name"; Text[100])
- {
- Caption = 'Bank Name';
- }
- field(11000002; "Bank City"; Text[30])
- {
- Caption = 'Bank City';
- }
}
keys
@@ -773,8 +751,6 @@ table 5200 Employee
trigger OnModify()
var
Resource: Record Resource;
- TransactionMode: Record "Transaction Mode";
- AccountType: Option Customer,Vendor,Employee;
IsHandled: Boolean;
begin
"Last Modified Date Time" := CurrentDateTime;
@@ -786,9 +762,6 @@ table 5200 Employee
if Resource.ReadPermission() then
EmployeeResUpdate.HumanResToRes(xRec, Rec);
- if not TransactionMode.CheckTransactionModePartnerType(AccountType::Employee, "Transaction Mode Code", Enum::"Partner Type"::" ") then
- Error(PartnerTypeMismatchErr);
-
IsHandled := false;
OnModifyOnBeforeEmployeeSalespersonUpdate(Rec, xRec, IsHandled);
if not IsHandled then
@@ -824,7 +797,6 @@ table 5200 Employee
BlockedEmplForJnrlErr: Label 'You cannot create this document because employee %1 is blocked due to privacy.', Comment = '%1 = employee no.';
BlockedEmplForJnrlPostingErr: Label 'You cannot post this document because employee %1 is blocked due to privacy.', Comment = '%1 = employee no.';
EmployeeLinkedToResourceErr: Label 'You cannot link multiple employees to the same resource. Employee %1 is already linked to that resource.', Comment = '%1 = employee no.';
- PartnerTypeMismatchErr: Label 'The Partner Type field must be blank because the transaction is related to an employee.';
BankAccNoMsg: Label 'Bank Account No. %1 may be incorrect.', Comment = '%1 - bank account no';
EmployeeHasLedgerDeleteErr: Label 'You cannot delete Employee %1 because it has ledger entries in a fiscal year that has not been closed yet.', Comment = '%1 = employee no.';
diff --git a/src/Layers/NL/BaseApp/HumanResources/Employee/EmployeeCard.Page.al b/src/Layers/NL/BaseApp/HumanResources/Employee/EmployeeCard.Page.al
deleted file mode 100644
index 15b9808496..0000000000
--- a/src/Layers/NL/BaseApp/HumanResources/Employee/EmployeeCard.Page.al
+++ /dev/null
@@ -1,779 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.HumanResources.Employee;
-
-using Microsoft.CRM.BusinessRelation;
-using Microsoft.CRM.Contact;
-using Microsoft.Finance.Dimension;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Attachment;
-using Microsoft.HumanResources.Absence;
-using Microsoft.HumanResources.Analysis;
-using Microsoft.HumanResources.Comment;
-using Microsoft.HumanResources.Payables;
-using Microsoft.HumanResources.Setup;
-using Microsoft.Utilities;
-using System.Email;
-
-page 5200 "Employee Card"
-{
- Caption = 'Employee Card';
- PageType = Card;
- SourceTable = Employee;
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field("No."; Rec."No.")
- {
- ApplicationArea = All;
- Importance = Standard;
- Visible = NoFieldVisible;
-
- trigger OnAssistEdit()
- begin
- Rec.AssistEdit();
- end;
- }
- field("First Name"; Rec."First Name")
- {
- ApplicationArea = BasicHR;
- Importance = Promoted;
- ShowMandatory = true;
- }
- field("Middle Name"; Rec."Middle Name")
- {
- ApplicationArea = BasicHR;
- }
- field("Last Name"; Rec."Last Name")
- {
- ApplicationArea = BasicHR;
- ShowMandatory = true;
- }
- field("Job Title"; Rec."Job Title")
- {
- ApplicationArea = BasicHR;
- Importance = Promoted;
- }
- field(Initials; Rec.Initials)
- {
- ApplicationArea = Basic, Suite;
- }
- field("Balance (LCY)"; Rec."Balance (LCY)")
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- }
- field("Search Name"; Rec."Search Name")
- {
- ApplicationArea = Basic, Suite;
- }
- field(Gender; Rec.Gender)
- {
- ApplicationArea = Basic, Suite;
- }
- field("Phone No.2"; Rec."Phone No.")
- {
- ApplicationArea = BasicHR;
- Caption = 'Company Phone No.';
- }
- field("Company E-Mail"; Rec."Company E-Mail")
- {
- ApplicationArea = BasicHR;
- ExtendedDatatype = EMail;
- }
- field("Board Member"; Rec."Board Member")
- {
- ApplicationArea = BasicHR;
- }
- field("Manager Role"; Rec."Manager Role")
- {
- ApplicationArea = BasicHR;
- }
- field(Nationality; Rec.Nationality)
- {
- ApplicationArea = BasicHR;
- }
- field("Last Date Modified"; Rec."Last Date Modified")
- {
- ApplicationArea = BasicHR;
- Importance = Additional;
- }
- field("Privacy Blocked"; Rec."Privacy Blocked")
- {
- ApplicationArea = BasicHR;
- Importance = Additional;
- }
- }
- group("Address & Contact")
- {
- Caption = 'Address & Contact';
- group(Control13)
- {
- ShowCaption = false;
- field(Address; Rec.Address)
- {
- ApplicationArea = BasicHR;
- }
- field("Address 2"; Rec."Address 2")
- {
- ApplicationArea = BasicHR;
- }
- field(City; Rec.City)
- {
- ApplicationArea = BasicHR;
- }
- group(Control31)
- {
- ShowCaption = false;
- Visible = IsCountyVisible;
- field(County; Rec.County)
- {
- ApplicationArea = BasicHR;
- }
- }
- field("Post Code"; Rec."Post Code")
- {
- ApplicationArea = BasicHR;
- }
- field("Country/Region Code"; Rec."Country/Region Code")
- {
- ApplicationArea = BasicHR;
-
- trigger OnValidate()
- begin
- IsCountyVisible := FormatAddress.UseCounty(Rec."Country/Region Code");
- end;
- }
- field(ShowMap; ShowMapLbl)
- {
- ApplicationArea = BasicHR;
- Editable = false;
- ShowCaption = false;
- Style = StrongAccent;
- StyleExpr = true;
- ToolTip = 'Specifies the employee''s address on your preferred online map.';
-
- trigger OnDrillDown()
- begin
- CurrPage.Update(true);
- Rec.DisplayMap();
- end;
- }
- }
- group(Control7)
- {
- ShowCaption = false;
- field("Mobile Phone No."; Rec."Mobile Phone No.")
- {
- ApplicationArea = BasicHR;
- Caption = 'Private Phone No.';
- Importance = Promoted;
- }
- field(Pager; Rec.Pager)
- {
- ApplicationArea = Basic, Suite;
- }
- field(Extension; Rec.Extension)
- {
- ApplicationArea = BasicHR;
- Importance = Promoted;
- }
- field("Phone No."; Rec."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Direct Phone No.';
- Importance = Promoted;
- ToolTip = 'Specifies the employee''s telephone number.';
- }
- field("E-Mail"; Rec."E-Mail")
- {
- ApplicationArea = BasicHR;
- Caption = 'Private Email';
- Importance = Promoted;
- }
- field("Alt. Address Code"; Rec."Alt. Address Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Alt. Address Start Date"; Rec."Alt. Address Start Date")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Alt. Address End Date"; Rec."Alt. Address End Date")
- {
- ApplicationArea = Basic, Suite;
- }
- }
- }
- group(Administration)
- {
- Caption = 'Administration';
- field("Employment Date"; Rec."Employment Date")
- {
- ApplicationArea = BasicHR;
- Importance = Promoted;
- }
- field(Status; Rec.Status)
- {
- ApplicationArea = BasicHR;
- Importance = Promoted;
- }
- field("Inactive Date"; Rec."Inactive Date")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Cause of Inactivity Code"; Rec."Cause of Inactivity Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Termination Date"; Rec."Termination Date")
- {
- ApplicationArea = BasicHR;
- }
- field("Grounds for Term. Code"; Rec."Grounds for Term. Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Emplymt. Contract Code"; Rec."Emplymt. Contract Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Statistics Group Code"; Rec."Statistics Group Code")
- {
- ApplicationArea = Suite;
- }
- field("Resource No."; Rec."Resource No.")
- {
- ApplicationArea = BasicHR;
- }
- field("Salespers./Purch. Code"; Rec."Salespers./Purch. Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Engagement Type"; Rec."Engagement Type")
- {
- ApplicationArea = BasicHR;
- }
- field("Collective Bargain. Agmt. Info"; Rec."Collective Bargain. Agmt. Info")
- {
- ApplicationArea = BasicHR;
- }
- }
- group(Personal)
- {
- Caption = 'Personal';
- field("Birth Date"; Rec."Birth Date")
- {
- ApplicationArea = BasicHR;
- Importance = Promoted;
- }
- field("Social Security No."; Rec."Social Security No.")
- {
- ApplicationArea = BasicHR;
- Importance = Promoted;
- MaskType = Concealed;
- }
- field("Union Code"; Rec."Union Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Union Membership No."; Rec."Union Membership No.")
- {
- ApplicationArea = Basic, Suite;
- }
- }
- group(Payments)
- {
- Caption = 'Payments';
- field("Employee Posting Group"; Rec."Employee Posting Group")
- {
- ApplicationArea = BasicHR;
- LookupPageID = "Employee Posting Groups";
- }
- field("Allow Multiple Posting Groups"; Rec."Allow Multiple Posting Groups")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = IsAllowMultiplePostingGroupsVisible;
- }
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = BasicHR;
- Importance = Additional;
- }
- field("Application Method"; Rec."Application Method")
- {
- ApplicationArea = BasicHR;
- }
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = BasicHR;
- }
- field("Bank Branch No."; Rec."Bank Branch No.")
- {
- ApplicationArea = BasicHR;
- MaskType = Concealed;
- }
- field("Bank Account No."; Rec."Bank Account No.")
- {
- ApplicationArea = BasicHR;
- MaskType = Concealed;
- }
- field("Bank Name"; Rec."Bank Name")
- {
- ApplicationArea = BasicHR;
- }
- field("Bank City"; Rec."Bank City")
- {
- ApplicationArea = BasicHR;
- }
- field(IBAN; Rec.IBAN)
- {
- ApplicationArea = BasicHR;
- MaskType = Concealed;
- }
- field("SWIFT Code"; Rec."SWIFT Code")
- {
- ApplicationArea = BasicHR;
- MaskType = Concealed;
- }
- }
- group("Payroll")
- {
- Caption = 'Payroll';
- field("Emp. Payroll"; Rec.Payroll)
- {
- ApplicationArea = BasicHR;
- }
- field("Payroll Currency Code"; Rec."Payroll Currency Code")
- {
- ApplicationArea = BasicHR;
- }
- field("Payroll (LCY)"; Rec."Payroll (LCY)")
- {
- ApplicationArea = BasicHR;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- ToolTip = 'Specifies the value of the Payroll (LCY) field.';
- }
- field("Working Type"; Rec."Working Type")
- {
- ApplicationArea = BasicHR;
- }
- field("Working Hours"; Rec."Working Hours")
- {
- ApplicationArea = BasicHR;
- AutoFormatType = 0;
- ToolTip = 'Specifies the value of the Working Hours field.';
- }
- }
- }
- area(factboxes)
- {
- part(Control3; "Employee Picture")
- {
- ApplicationArea = BasicHR;
- SubPageLink = "No." = field("No.");
- }
- part("Attached Documents List"; "Doc. Attachment List Factbox")
- {
- ApplicationArea = All;
- Caption = 'Documents';
- UpdatePropagation = Both;
- SubPageLink = "Table ID" = const(Database::Employee),
- "No." = field("No.");
- }
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- Visible = true;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("E&mployee")
- {
- Caption = 'E&mployee';
- Image = Employee;
- action("Co&mments")
- {
- ApplicationArea = Comments;
- Caption = 'Co&mments';
- Image = ViewComments;
- RunObject = Page "Human Resource Comment Sheet";
- RunPageLink = "Table Name" = const(Employee),
- "No." = field("No.");
- ToolTip = 'View or add comments for the record.';
- }
- action(Dimensions)
- {
- ApplicationArea = Dimensions;
- Caption = 'Dimensions';
- Image = Dimensions;
- RunObject = Page "Default Dimensions";
- RunPageLink = "Table ID" = const(5200),
- "No." = field("No.");
- 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.';
- }
- action("&Picture")
- {
- ApplicationArea = BasicHR;
- Caption = '&Picture';
- Image = Picture;
- RunObject = Page "Employee Picture";
- RunPageLink = "No." = field("No.");
- ToolTip = 'View or add a picture of the employee or, for example, the company''s logo.';
- }
- action(AlternativeAddresses)
- {
- ApplicationArea = Basic, Suite;
- Caption = '&Alternate Addresses';
- Image = Addresses;
- RunObject = Page "Alternative Address List";
- RunPageLink = "Employee No." = field("No.");
- ToolTip = 'Open the list of addresses that are registered for the employee.';
- }
- action("&Relatives")
- {
- ApplicationArea = Basic, Suite;
- Caption = '&Relatives';
- Image = Relatives;
- RunObject = Page "Employee Relatives";
- RunPageLink = "Employee No." = field("No.");
- ToolTip = 'Open the list of relatives that are registered for the employee.';
- }
- action("Mi&sc. Article Information")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mi&sc. Article Information';
- Image = Filed;
- RunObject = Page "Misc. Article Information";
- RunPageLink = "Employee No." = field("No.");
- ToolTip = 'Open the list of miscellaneous articles that are registered for the employee.';
- }
- action("&Confidential Information")
- {
- ApplicationArea = Basic, Suite;
- Caption = '&Confidential Information';
- Image = Lock;
- RunObject = Page "Confidential Information";
- RunPageLink = "Employee No." = field("No.");
- ToolTip = 'Open the list of any confidential information that is registered for the employee.';
- }
- action("Q&ualifications")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Q&ualifications';
- Image = Certificate;
- RunObject = Page "Employee Qualifications";
- RunPageLink = "Employee No." = field("No.");
- ToolTip = 'Open the list of qualifications that are registered for the employee.';
- }
- action("A&bsences")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'A&bsences';
- Image = Absence;
- RunObject = Page "Employee Absences";
- RunPageLink = "Employee No." = field("No.");
- ToolTip = 'View absence information for the employee.';
- }
- separator(Action23)
- {
- }
- action("Absences by Ca&tegories")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Absences by Ca&tegories';
- Image = AbsenceCategory;
- RunObject = Page "Empl. Absences by Categories";
- RunPageLink = "No." = field("No."),
- "Employee No. Filter" = field("No.");
- ToolTip = 'View categorized absence information for the employee.';
- }
- action("Misc. Articles &Overview")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Misc. Articles &Overview';
- Image = FiledOverview;
- RunObject = Page "Misc. Articles Overview";
- ToolTip = 'View miscellaneous articles that are registered for the employee.';
- }
- action("Co&nfidential Info. Overview")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Co&nfidential Info. Overview';
- Image = ConfidentialOverview;
- RunObject = Page "Confidential Info. Overview";
- ToolTip = 'View confidential information that is registered for the employee.';
- }
- separator(Action61)
- {
- }
- action("Ledger E&ntries")
- {
- ApplicationArea = BasicHR;
- Caption = 'Ledger E&ntries';
- Image = VendorLedger;
- RunObject = Page "Employee Ledger Entries";
- RunPageLink = "Employee No." = field("No.");
- RunPageView = sorting("Employee No.")
- order(descending);
- ShortCutKey = 'Ctrl+F7';
- ToolTip = 'View the history of transactions that have been posted for the selected record.';
- }
- action(Attachments)
- {
- 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;
- }
- action(PayEmployee)
- {
- ApplicationArea = BasicHR;
- Caption = 'Pay Employee';
- Image = SuggestVendorPayments;
- RunObject = Page "Employee Ledger Entries";
- RunPageLink = "Employee No." = field("No."),
- "Remaining Amount" = filter(< 0),
- "Applies-to ID" = filter('');
- ToolTip = 'View employee ledger entries for the record with remaining amount that have not been paid yet.';
- }
- action(Contact)
- {
- ApplicationArea = RelationshipMgmt;
- Caption = 'Contact';
- Image = ContactPerson;
- ToolTip = 'View or edit detailed information about the contact person at the employee.';
-
- trigger OnAction()
- var
- ContBusRel: Record "Contact Business Relation";
- Contact: Record Contact;
- begin
- if ContBusRel.FindByRelation(ContBusRel."Link to Table"::Employee, Rec."No.") then begin
- Contact.Get(ContBusRel."Contact No.");
- Page.Run(Page::"Contact Card", Contact);
- end;
- end;
- }
- }
- group(History)
- {
- Caption = 'History';
- Image = History;
- action("Sent Emails")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sent Emails';
- Image = ShowList;
- ToolTip = 'View a list of emails that you have sent to this employee.';
-
- trigger OnAction()
- var
- Email: Codeunit Email;
- begin
- Email.OpenSentEmails(Database::Employee, Rec.SystemId);
- end;
- }
- }
- }
- area(Processing)
- {
- group("F&unctions")
- {
- Caption = 'F&unctions';
- Image = "Action";
- action(ApplyTemplate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Apply Template';
- Ellipsis = true;
- Image = ApplyTemplate;
- ToolTip = 'Apply a template to update the entity with your standard settings for a certain type of entity.';
-
- trigger OnAction()
- var
- EmployeeTemplMgt: Codeunit "Employee Templ. Mgt.";
- begin
- EmployeeTemplMgt.UpdateEmployeeFromTemplate(Rec);
- end;
- }
- action(SaveAsTemplate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Save as Template';
- Ellipsis = true;
- Image = Save;
- ToolTip = 'Save the employee card as a template that can be reused to create new employee cards. Employee templates contain preset information to help you fill fields on employee cards.';
-
- trigger OnAction()
- var
- EmployeeTemplMgt: Codeunit "Employee Templ. Mgt.";
- begin
- EmployeeTemplMgt.SaveAsTemplate(Rec);
- end;
- }
- }
- action(Email)
- {
- ApplicationArea = All;
- Caption = 'Send Email';
- Image = Email;
- ToolTip = 'Send an email to this employee.';
-
- trigger OnAction()
- var
- TempEmailItem: Record "Email Item" temporary;
- EmailScenario: Enum "Email Scenario";
- begin
- TempEmailItem.AddSourceDocument(Database::Employee, Rec.SystemId);
- if Rec."Company E-Mail" <> '' then
- TempEmailitem."Send to" := Rec."Company E-Mail"
- else
- TempEmailitem."Send to" := Rec."E-Mail";
- TempEmailItem.Send(false, EmailScenario::Default);
- end;
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- actionref(Email_Promoted; Email)
- {
- }
- actionref(PayEmployee_Promoted; PayEmployee)
- {
- }
- }
- group(Category_Category4)
- {
- Caption = 'Employee', Comment = 'Generated from the PromotedActionCategories property index 3.';
-
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref("Co&mments_Promoted"; "Co&mments")
- {
- }
- actionref(Attachments_Promoted; Attachments)
- {
- }
- actionref(Contact_Promoted; Contact)
- {
- }
- actionref("Sent Emails_Promoted"; "Sent Emails")
- {
- }
- actionref("&Picture_Promoted"; "&Picture")
- {
- }
- actionref("&Confidential Information_Promoted"; "&Confidential Information")
- {
- }
- actionref("Q&ualifications_Promoted"; "Q&ualifications")
- {
- }
- actionref("A&bsences_Promoted"; "A&bsences")
- {
- }
- actionref("Ledger E&ntries_Promoted"; "Ledger E&ntries")
- {
- }
- }
- group(Category_Category5)
- {
- Caption = 'Navigate', Comment = 'Generated from the PromotedActionCategories property index 4.';
-
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- }
- }
-
- trigger OnOpenPage()
- begin
- SetNoFieldVisible();
- IsCountyVisible := FormatAddress.UseCounty(Rec."Country/Region Code");
- HumanResourcesSetup.Get();
- IsAllowMultiplePostingGroupsVisible := HumanResourcesSetup."Allow Multiple Posting Groups";
- end;
-
- trigger OnNewRecord(BelowxRec: Boolean)
- var
- DocumentNoVisibility: Codeunit DocumentNoVisibility;
- begin
- if GuiAllowed then
- if Rec."No." = '' then
- if DocumentNoVisibility.EmployeeNoSeriesIsDefault() then
- NewMode := true;
- end;
-
- trigger OnAfterGetCurrRecord()
- var
- Employee: Record Employee;
- EmployeeTemplMgt: Codeunit "Employee Templ. Mgt.";
- begin
- if not NewMode then
- exit;
- NewMode := false;
-
- if EmployeeTemplMgt.InsertEmployeeFromTemplate(Employee) then begin
- Rec.Copy(Employee);
- CurrPage.Update();
- end else
- if EmployeeTemplMgt.TemplatesAreNotEmpty() then
- CurrPage.Close();
- end;
-
- var
- HumanResourcesSetup: Record "Human Resources Setup";
- FormatAddress: Codeunit "Format Address";
- NoFieldVisible: Boolean;
- IsCountyVisible: Boolean;
- NewMode: Boolean;
- IsAllowMultiplePostingGroupsVisible: Boolean;
-
- ShowMapLbl: Label 'Show on Map';
-
- local procedure SetNoFieldVisible()
- var
- DocumentNoVisibility: Codeunit DocumentNoVisibility;
- begin
- NoFieldVisible := DocumentNoVisibility.EmployeeNoIsVisible();
- end;
-}
diff --git a/src/Layers/NL/BaseApp/HumanResources/Payables/ApplyEmployeeEntries.Page.al b/src/Layers/NL/BaseApp/HumanResources/Payables/ApplyEmployeeEntries.Page.al
deleted file mode 100644
index aa302f2829..0000000000
--- a/src/Layers/NL/BaseApp/HumanResources/Payables/ApplyEmployeeEntries.Page.al
+++ /dev/null
@@ -1,1218 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.HumanResources.Payables;
-
-using Microsoft.CRM.Outlook;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.Foundation.Navigate;
-using Microsoft.HumanResources.Employee;
-using Microsoft.Purchases.Payables;
-
-page 234 "Apply Employee Entries"
-{
- Caption = 'Apply Employee Entries';
- DataCaptionFields = "Employee No.";
- DeleteAllowed = false;
- InsertAllowed = false;
- LinksAllowed = false;
- PageType = Worksheet;
- Permissions = TableData "Employee Ledger Entry" = m;
- SourceTable = "Employee Ledger Entry";
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
-#pragma warning disable AA0204
-#pragma warning disable AA0100
- field("TempApplyingEmplLedgEntry.""Posting Date"""; TempApplyingEmplLedgEntry."Posting Date")
- {
- ApplicationArea = BasicHR;
- Caption = 'Posting Date';
- Editable = false;
- ToolTip = 'Specifies the posting date of the entry to be applied.';
- }
- field("TempApplyingEmplLedgEntry.""Document Type"""; TempApplyingEmplLedgEntry."Document Type")
- {
- ApplicationArea = BasicHR;
- Caption = 'Document Type';
- Editable = false;
- ToolTip = 'Specifies the document type of the entry to be applied.';
- }
- field("TempApplyingEmplLedgEntry.""Document No."""; TempApplyingEmplLedgEntry."Document No.")
- {
- ApplicationArea = BasicHR;
- Caption = 'Document No.';
- Editable = false;
- ToolTip = 'Specifies the document number of the entry to be applied.';
- }
-#pragma warning restore AA0100
- field(ApplyingEmployeeNo; TempApplyingEmplLedgEntry."Employee No.")
- {
- ApplicationArea = BasicHR;
- Caption = 'Employee No.';
- Editable = false;
- ToolTip = 'Specifies the employee number of the entry to be applied.';
- Visible = false;
- }
- field(ApplyingDescription; TempApplyingEmplLedgEntry.Description)
- {
- ApplicationArea = BasicHR;
- Caption = 'Description';
- Editable = false;
- ToolTip = 'Specifies the description of the entry to be applied.';
- Visible = false;
- }
-#pragma warning disable AA0100
- field("TempApplyingEmplLedgEntry.""Currency Code"""; TempApplyingEmplLedgEntry."Currency Code")
- {
- ApplicationArea = BasicHR;
- Caption = 'Currency Code';
- Editable = false;
- ToolTip = 'Specifies the code for the currency that amounts are shown in.';
- }
- field("TempApplyingEmplLedgEntry.Amount"; TempApplyingEmplLedgEntry.Amount)
- {
- ApplicationArea = BasicHR;
- Caption = 'Amount';
- Editable = false;
- ToolTip = 'Specifies the amount on the entry to be applied.';
- }
- field("TempApplyingEmplLedgEntry.""Remaining Amount"""; TempApplyingEmplLedgEntry."Remaining Amount")
- {
- ApplicationArea = BasicHR;
- Caption = 'Remaining Amount';
- Editable = false;
- ToolTip = 'Specifies the amount on the entry to be applied.';
- }
-#pragma warning restore AA0100
- }
- repeater(Control1)
- {
- ShowCaption = false;
- field("Applies-to ID"; Rec."Applies-to ID")
- {
- ApplicationArea = All;
- Visible = AppliesToIDVisible;
- trigger OnValidate()
- begin
- if Rec."Applies-to ID" <> '' then
- UpdateCustomAppliesToIDForGenJournal(Rec."Applies-to ID");
- end;
- }
- field("Posting Date"; Rec."Posting Date")
- {
- ApplicationArea = BasicHR;
- Editable = false;
- }
- field("Document Type"; Rec."Document Type")
- {
- ApplicationArea = BasicHR;
- Editable = false;
- ToolTip = 'Specifies the employee entry''s document type.';
- }
- field("Document No."; Rec."Document No.")
- {
- ApplicationArea = BasicHR;
- Editable = false;
- }
- field("Employee No."; Rec."Employee No.")
- {
- ApplicationArea = BasicHR;
- Editable = false;
- ToolTip = 'Specifies the number of the employee account that the entry is linked to.';
- }
- field(Description; Rec.Description)
- {
- ApplicationArea = BasicHR;
- Editable = false;
- }
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = BasicHR;
- }
- field("Original Amount"; Rec."Original Amount")
- {
- ApplicationArea = BasicHR;
- Editable = false;
- Visible = false;
- }
- field(Amount; Rec.Amount)
- {
- ApplicationArea = BasicHR;
- Editable = false;
- Visible = false;
- }
- field("Debit Amount"; Rec."Debit Amount")
- {
- ApplicationArea = BasicHR;
- Visible = false;
- }
- field("Credit Amount"; Rec."Credit Amount")
- {
- ApplicationArea = BasicHR;
- Visible = false;
- }
- field("Remaining Amount"; Rec."Remaining Amount")
- {
- ApplicationArea = BasicHR;
- Editable = false;
- }
-#pragma warning disable AA0100
- field("CalcApplnRemainingAmount(""Remaining Amount"")"; CalcApplnRemainingAmount(Rec."Remaining Amount"))
- {
- ApplicationArea = BasicHR;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Appln. Remaining Amount';
- ToolTip = 'Specifies the amount that remains to be applied to before the entry is totally applied to.';
- }
-#pragma warning restore AA0100
- field("Amount to Apply"; Rec."Amount to Apply")
- {
- ApplicationArea = BasicHR;
-
- trigger OnValidate()
- begin
- CODEUNIT.Run(CODEUNIT::"Empl. Entry-Edit", Rec);
-
- if (xRec."Amount to Apply" = 0) or (Rec."Amount to Apply" = 0) and
- ((ApplnType = ApplnType::"Applies-to ID") or (CalcType = CalcType::Direct))
- then
- SetEmplApplId();
- Rec.Get(Rec."Entry No.");
- AmounttoApplyOnAfterValidate();
- end;
- }
-#pragma warning disable AA0100
- field("CalcApplnAmounttoApply(""Amount to Apply"")"; CalcApplnAmounttoApply(Rec."Amount to Apply"))
- {
- ApplicationArea = BasicHR;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Appln. Amount to Apply';
- ToolTip = 'Specifies the amount to apply.';
- }
-#pragma warning restore AA0100
- field("Payment Reference"; Rec."Payment Reference")
- {
- ApplicationArea = BasicHR;
- }
- field(Open; Rec.Open)
- {
- ApplicationArea = BasicHR;
- Editable = false;
- }
- field(Positive; Rec.Positive)
- {
- ApplicationArea = BasicHR;
- Editable = false;
- }
- field("Global Dimension 1 Code"; Rec."Global Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
- }
- field("Global Dimension 2 Code"; Rec."Global Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
- }
- field("Payments in Process"; Rec."Payments in Process")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the total amount of payments/collections in process.';
- }
- }
- group(Control41)
- {
- ShowCaption = false;
- fixed(Control1903222401)
- {
- ShowCaption = false;
- group("Appln. Currency")
- {
- Caption = 'Appln. Currency';
- field(ApplnCurrencyCode; ApplnCurrencyCode)
- {
- ApplicationArea = BasicHR;
- Editable = false;
- ShowCaption = false;
- TableRelation = Currency;
- ToolTip = 'Specifies the currency code that the amount will be applied in, in case of different currencies.';
- }
- }
- group(Control1900545201)
- {
- Caption = 'Amount to Apply';
- field(AmountToApply; AppliedAmount)
- {
- ApplicationArea = BasicHR;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Amount to Apply';
- Editable = false;
- ToolTip = 'Specifies the sum of the amounts on all the selected employee ledger entries that will be applied by the entry shown in the Available Amount field. The amount is in the currency represented by the code in the Currency Code field.';
- }
- }
- group(Rounding)
- {
- Caption = 'Rounding';
- field(ApplnRounding; ApplnRounding)
- {
- ApplicationArea = BasicHR;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Rounding';
- Editable = false;
- ToolTip = 'Specifies the rounding difference when you apply entries in different currencies to one another. The amount is in the currency represented by the code in the Currency Code field.';
- }
- }
- group("Applied Amount")
- {
- Caption = 'Applied Amount';
- field(AppliedAmount; AppliedAmount + (-PmtDiscAmount) + ApplnRounding)
- {
- ApplicationArea = BasicHR;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Applied Amount';
- Editable = false;
- ToolTip = 'Specifies the sum of the amounts in the Amount to Apply field, Pmt. Disc. Amount field, and the Rounding. The amount is in the currency represented by the code in the Currency Code field.';
- }
- }
- group("Available Amount")
- {
- Caption = 'Available Amount';
- field(ApplyingAmount; ApplyingAmount)
- {
- ApplicationArea = BasicHR;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Available Amount';
- Editable = false;
- ToolTip = 'Specifies the amount of the journal entry, purchase credit memo, or current employee ledger entry that you have selected as the applying entry.';
- }
- }
- group(Balance)
- {
- Caption = 'Balance';
- field(ControlBalance; AppliedAmount + (-PmtDiscAmount) + ApplyingAmount + ApplnRounding)
- {
- ApplicationArea = BasicHR;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Balance';
- Editable = false;
- ToolTip = 'Specifies any extra amount that will remain after the application.';
- }
- }
- }
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("Ent&ry")
- {
- Caption = 'Ent&ry';
- Image = Entry;
- action("Applied E&ntries")
- {
- ApplicationArea = BasicHR;
- Caption = 'Applied E&ntries';
- Image = Approve;
- RunObject = Page "Applied Employee Entries";
- RunPageOnRec = true;
- ToolTip = 'View the ledger entries that have been applied to this 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.ShowDimensions();
- end;
- }
- action("Detailed &Ledger Entries")
- {
- ApplicationArea = BasicHR;
- Caption = 'Detailed &Ledger Entries';
- Image = View;
- RunObject = Page "Detailed Empl. Ledger Entries";
- RunPageLink = "Employee Ledger Entry No." = field("Entry No.");
- RunPageView = sorting("Employee Ledger Entry No.", "Posting Date");
- ShortCutKey = 'Ctrl+F7';
- ToolTip = 'View a summary of all the posted entries and adjustments related to a specific employee ledger entry.';
- }
- action(Navigate)
- {
- ApplicationArea = BasicHR;
- Caption = 'Find entries...';
- Image = Navigate;
- ShortCutKey = 'Ctrl+Alt+Q';
- ToolTip = 'Find entries and documents that exist for the document number and posting date on the selected document. (Formerly this action was named Navigate.)';
- Visible = not IsOfficeAddin;
-
- trigger OnAction()
- begin
- Navigate.SetDoc(Rec."Posting Date", Rec."Document No.");
- Navigate.Run();
- end;
- }
- }
- }
- area(processing)
- {
- group("&Application")
- {
- Caption = '&Application';
- Image = Apply;
- action(ActionSetAppliesToID)
- {
- ApplicationArea = BasicHR;
- Caption = 'Set Applies-to ID';
- Image = SelectLineToApply;
- ShortCutKey = 'Shift+F11';
- ToolTip = 'Set the Applies-to ID field on the posted entry to automatically be filled in with the document number of the entry in the journal.';
-
- trigger OnAction()
- begin
- if (CalcType = CalcType::"Gen. Jnl. Line") and (ApplnType = ApplnType::"Applies-to Doc. No.") then
- Error(CannotSetAppliesToIDErr);
-
- SetEmplApplId();
- end;
- }
- action(ActionPostApplication)
- {
- ApplicationArea = BasicHR;
- Caption = 'Post Application';
- Ellipsis = true;
- Image = PostApplication;
- ShortCutKey = 'F9';
- ToolTip = 'Define the document number of the ledger entry to use to perform the application. In addition, you specify the Posting Date for the application.';
-
- trigger OnAction()
- begin
- PostDirectApplication(false);
- end;
- }
- action(Preview)
- {
- ApplicationArea = BasicHR;
- 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
- PostDirectApplication(true);
- end;
- }
- separator("-")
- {
- Caption = '-';
- }
- action("Show Only Selected Entries to Be Applied")
- {
- ApplicationArea = BasicHR;
- Caption = 'Show Only Selected Entries to Be Applied';
- Image = ShowSelected;
- ToolTip = 'View the selected ledger entries that will be applied to the specified record.';
-
- trigger OnAction()
- begin
- ShowAppliedEntries := not ShowAppliedEntries;
- if ShowAppliedEntries then
- if CalcType = CalcType::"Gen. Jnl. Line" then
- Rec.SetRange("Applies-to ID", GenJnlLine."Applies-to ID")
- else begin
- EmplEntryApplID := CopyStr(UserId(), 1, 50);
- if EmplEntryApplID = '' then
- EmplEntryApplID := '***';
- Rec.SetRange("Applies-to ID", EmplEntryApplID);
- end
- else
- Rec.SetRange("Applies-to ID");
- end;
- }
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- actionref(ActionSetAppliesToID_Promoted; ActionSetAppliesToID)
- {
- }
- actionref(ActionPostApplication_Promoted; ActionPostApplication)
- {
- }
- actionref(Preview_Promoted; Preview)
- {
- }
- actionref(Navigate_Promoted; Navigate)
- {
- }
- actionref("Show Only Selected Entries to Be Applied_Promoted"; "Show Only Selected Entries to Be Applied")
- {
- }
- }
- group(Category_Category4)
- {
- Caption = 'Entry', Comment = 'Generated from the PromotedActionCategories property index 3.';
-
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref("Applied E&ntries_Promoted"; "Applied E&ntries")
- {
- }
- actionref("Detailed &Ledger Entries_Promoted"; "Detailed &Ledger Entries")
- {
- }
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- begin
- if ApplnType = ApplnType::"Applies-to Doc. No." then
- CalcApplnAmount();
- end;
-
- trigger OnInit()
- begin
- AppliesToIDVisible := true;
- end;
-
- trigger OnModifyRecord(): Boolean
- begin
- CODEUNIT.Run(CODEUNIT::"Empl. Entry-Edit", Rec);
- if Rec."Applies-to ID" <> xRec."Applies-to ID" then
- CalcApplnAmount();
- exit(false);
- end;
-
- trigger OnOpenPage()
- var
- OfficeMgt: Codeunit "Office Management";
- begin
- if CalcType = CalcType::Direct then begin
- Empl.Get(Rec."Employee No.");
- ApplnCurrencyCode := Empl."Currency Code";
- FindApplyingEntry();
- end;
-
- AppliesToIDVisible := ApplnType <> ApplnType::"Applies-to Doc. No.";
-
- GLSetup.Get();
-
- if CalcType = CalcType::"Gen. Jnl. Line" then
- CalcApplnAmount();
- PostingDone := false;
- IsOfficeAddin := OfficeMgt.IsAvailable();
- end;
-
- trigger OnQueryClosePage(CloseAction: Action): Boolean
- begin
- if CloseAction = ACTION::LookupOK then
- LookupOKOnPush();
- if ApplnType = ApplnType::"Applies-to Doc. No." then begin
- CheckEarlierPostingDate();
- if OK then begin
- if Rec."Amount to Apply" = 0 then
- Rec."Amount to Apply" := Rec."Remaining Amount";
- CODEUNIT.Run(CODEUNIT::"Empl. Entry-Edit", Rec);
- end;
- end;
-
- if CheckActionPerformed() then begin
- Rec := TempApplyingEmplLedgEntry;
- Rec."Applying Entry" := false;
- if AppliesToID = '' then begin
- Rec."Applies-to ID" := '';
- Rec."Amount to Apply" := 0;
- end;
- CODEUNIT.Run(CODEUNIT::"Empl. Entry-Edit", Rec);
- end;
- end;
-
- var
- Currency: Record Currency;
- CurrExchRate: Record "Currency Exchange Rate";
- GenJnlLine: Record "Gen. Journal Line";
- Empl: Record Employee;
- GLSetup: Record "General Ledger Setup";
- EmplEntrySetApplID: Codeunit "Empl. Entry-SetAppl.ID";
- GenJnlApply: Codeunit "Gen. Jnl.-Apply";
- Navigate: Page Navigate;
- GenJnlLineApply: Boolean;
- EmplEntryApplID: Code[50];
- AppliesToID: Code[50];
- CustomAppliesToID: Code[50];
- TimesSetCustomAppliesToID: Integer;
- ValidExchRate: Boolean;
- MustSelectEntryErr: Label 'You must select an applying entry before you can post the application.';
- PostingInWrongContextErr: Label 'You must post the application from the window where you entered the applying entry.';
- CannotSetAppliesToIDErr: Label 'You cannot set Applies-to ID field while selecting Applies-to Doc. No field.';
- ShowAppliedEntries: Boolean;
- OK: Boolean;
- EarlierPostingDateErr: Label 'You cannot apply and post an entry to an entry with an earlier posting date.\\Instead, post the document of type %1 with the number %2 and then apply it to the document of type %3 with the number %4.', Comment = '%1 - document type, %2 - document number,%3 - document type,%4 - document number';
- PostingDone: Boolean;
- AppliesToIDVisible: Boolean;
- ActionPerformed: Boolean;
- ApplicationPostedMsg: Label 'The application was successfully posted.';
- ApplicationDateErr: Label 'The posting date entered must not be before the posting date on the employee ledger entry.';
- ApplicationProcessCanceledErr: Label 'Post application process has been canceled.';
- IsOfficeAddin: Boolean;
-
- protected var
- TempApplyingEmplLedgEntry: Record "Employee Ledger Entry" temporary;
- AppliedEmplLedgEntry: Record "Employee Ledger Entry";
- GenJnlLine2: Record "Gen. Journal Line";
- EmplLedgEntry: Record "Employee Ledger Entry";
- ApplnDate: Date;
- ApplnRoundingPrecision: Decimal;
- ApplnRounding: Decimal;
- ApplnType: Enum "Vendor Apply-to Type";
- AmountRoundingPrecision: Decimal;
- AppliedAmount: Decimal;
- ApplyingAmount: Decimal;
- PmtDiscAmount: Decimal;
- ApplnCurrencyCode: Code[10];
- DifferentCurrenciesInAppln: Boolean;
- CalcType: Enum "Vendor Apply Calculation Type";
-
- local procedure CheckEarlierPostingDate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckEarlierPostingDate(TempApplyingEmplLedgEntry, Rec, CalcType.AsInteger(), IsHandled);
- if IsHandled then
- exit;
-
- if OK and (TempApplyingEmplLedgEntry."Posting Date" < Rec."Posting Date") then begin
- OK := false;
- Error(
- EarlierPostingDateErr, TempApplyingEmplLedgEntry."Document Type", TempApplyingEmplLedgEntry."Document No.",
- Rec."Document Type", Rec."Document No.");
- end;
- end;
-
- procedure SetGenJnlLine(NewGenJnlLine: Record "Gen. Journal Line"; ApplnTypeSelect: Integer)
- begin
- GenJnlLine := NewGenJnlLine;
- GenJnlLineApply := true;
-
- if GenJnlLine."Account Type" = GenJnlLine."Account Type"::Employee then
- ApplyingAmount := GenJnlLine.Amount;
- if GenJnlLine."Bal. Account Type" = GenJnlLine."Bal. Account Type"::Employee then
- ApplyingAmount := -GenJnlLine.Amount;
- ApplnDate := GenJnlLine."Posting Date";
- ApplnCurrencyCode := GenJnlLine."Currency Code";
- CalcType := CalcType::"Gen. Jnl. Line";
-
- case ApplnTypeSelect of
- GenJnlLine.FieldNo("Applies-to Doc. No."):
- ApplnType := ApplnType::"Applies-to Doc. No.";
- GenJnlLine.FieldNo("Applies-to ID"):
- ApplnType := ApplnType::"Applies-to ID";
- end;
-
- SetApplyingEmplLedgEntry();
- end;
-
- procedure SetEmplLedgEntry(NewEmplLedgEntry: Record "Employee Ledger Entry")
- begin
- Rec := NewEmplLedgEntry;
- end;
-
- procedure SetApplyingEmplLedgEntry()
- var
- Employee: Record Employee;
- begin
- OnBeforeSetApplyingEmplLedgEntry(TempApplyingEmplLedgEntry, GenJnlLine);
- case CalcType of
- CalcType::Direct:
- begin
- if Rec."Applying Entry" then begin
- if TempApplyingEmplLedgEntry."Entry No." <> 0 then
- EmplLedgEntry := TempApplyingEmplLedgEntry;
- CODEUNIT.Run(CODEUNIT::"Empl. Entry-Edit", Rec);
- if Rec."Applies-to ID" = '' then
- SetEmplApplId();
- Rec.CalcFields(Amount);
- TempApplyingEmplLedgEntry := Rec;
- if EmplLedgEntry."Entry No." <> 0 then begin
- Rec := EmplLedgEntry;
- Rec."Applying Entry" := false;
- SetEmplApplId();
- end;
- Rec.SetFilter("Entry No.", '<> %1', TempApplyingEmplLedgEntry."Entry No.");
- ApplyingAmount := TempApplyingEmplLedgEntry."Remaining Amount";
- ApplnDate := TempApplyingEmplLedgEntry."Posting Date";
- ApplnCurrencyCode := TempApplyingEmplLedgEntry."Currency Code";
- end;
- CalcApplnAmount();
- end;
- CalcType::"Gen. Jnl. Line":
- begin
- TempApplyingEmplLedgEntry."Posting Date" := GenJnlLine."Posting Date";
- TempApplyingEmplLedgEntry."Document Type" := GenJnlLine."Document Type";
- TempApplyingEmplLedgEntry."Document No." := GenJnlLine."Document No.";
- if GenJnlLine."Bal. Account Type" = GenJnlLine."Bal. Account Type"::Employee then begin
- TempApplyingEmplLedgEntry."Employee No." := GenJnlLine."Bal. Account No.";
- Employee.Get(TempApplyingEmplLedgEntry."Employee No.");
- TempApplyingEmplLedgEntry.Description := CopyStr(Employee.FullName(), 1, MaxStrLen(TempApplyingEmplLedgEntry.Description));
- end else begin
- TempApplyingEmplLedgEntry."Employee No." := GenJnlLine."Account No.";
- TempApplyingEmplLedgEntry.Description := GenJnlLine.Description;
- end;
- TempApplyingEmplLedgEntry."Currency Code" := GenJnlLine."Currency Code";
- TempApplyingEmplLedgEntry.Amount := GenJnlLine.Amount;
- TempApplyingEmplLedgEntry."Remaining Amount" := GenJnlLine.Amount;
- CalcApplnAmount();
- end;
- end;
- end;
-
- procedure SetEmplApplId()
- begin
- CurrPage.SetSelectionFilter(EmplLedgEntry);
- CheckEmplApplId(EmplLedgEntry);
-
- if TempApplyingEmplLedgEntry."Entry No." <> 0 then
- GenJnlApply.CheckAgainstApplnCurrency(
- ApplnCurrencyCode, Rec."Currency Code", GenJnlLine."Account Type"::Employee, true);
- OnSetCustApplIdAfterCheckAgainstApplnCurrency(Rec, CalcType.AsInteger(), GenJnlLine);
-
- EmplLedgEntry.Copy(Rec);
- CurrPage.SetSelectionFilter(EmplLedgEntry);
-
- if GenJnlLineApply then
- EmplEntrySetApplID.SetApplId(EmplLedgEntry, TempApplyingEmplLedgEntry, GenJnlLine."Applies-to ID")
- else
- EmplEntrySetApplID.SetApplId(EmplLedgEntry, TempApplyingEmplLedgEntry, '');
-
- ActionPerformed := EmplLedgEntry."Applies-to ID" <> '';
- CalcApplnAmount();
- end;
-
- procedure CheckEmplApplId(var EmplLedgerEntry: Record "Employee Ledger Entry")
- var
- RaiseError: Boolean;
- begin
- if EmplLedgerEntry.FindSet() then
- repeat
- if CalcType = CalcType::"Gen. Jnl. Line" then begin
- RaiseError := TempApplyingEmplLedgEntry."Posting Date" < EmplLedgerEntry."Posting Date";
- OnCheckEmplApplIdOnBeforeEarlierPostingDateError(TempApplyingEmplLedgEntry, EmplLedgerEntry, RaiseError, CalcType);
- if RaiseError then
- Error(
- EarlierPostingDateErr, TempApplyingEmplLedgEntry."Document Type", TempApplyingEmplLedgEntry."Document No.",
- EmplLedgerEntry."Document Type", EmplLedgerEntry."Document No.");
- end;
- until EmplLedgerEntry.Next() = 0;
- end;
-
- protected procedure CalcApplnAmount()
- begin
- OnBeforeCalcApplnAmount(Rec, GenJnlLine, AppliedEmplLedgEntry, CalcType.AsInteger(), ApplnType.AsInteger());
-
- AppliedAmount := 0;
- PmtDiscAmount := 0;
- DifferentCurrenciesInAppln := false;
-
- case CalcType of
- CalcType::Direct:
- begin
- FindAmountRounding();
- EmplEntryApplID := CopyStr(UserId(), 1, 50);
- if EmplEntryApplID = '' then
- EmplEntryApplID := '***';
-
- EmplLedgEntry := TempApplyingEmplLedgEntry;
-
- AppliedEmplLedgEntry.SetCurrentKey("Employee No.", Open, Positive);
- AppliedEmplLedgEntry.SetRange("Employee No.", Rec."Employee No.");
- AppliedEmplLedgEntry.SetRange(Open, true);
- if AppliesToID = '' then
- AppliedEmplLedgEntry.SetRange("Applies-to ID", EmplEntryApplID)
- else
- AppliedEmplLedgEntry.SetRange("Applies-to ID", AppliesToID);
-
- if TempApplyingEmplLedgEntry."Entry No." <> 0 then begin
- EmplLedgEntry.CalcFields("Remaining Amount");
- AppliedEmplLedgEntry.SetFilter("Entry No.", '<>%1', EmplLedgEntry."Entry No.");
- end;
-
- HandleChosenEntries(0, EmplLedgEntry."Remaining Amount", EmplLedgEntry."Currency Code", EmplLedgEntry."Posting Date");
- end;
- CalcType::"Gen. Jnl. Line":
- begin
- FindAmountRounding();
- if GenJnlLine."Bal. Account Type" = GenJnlLine."Bal. Account Type"::Employee then
- CODEUNIT.Run(CODEUNIT::"Exchange Acc. G/L Journal Line", GenJnlLine);
-
- case ApplnType of
- ApplnType::"Applies-to Doc. No.":
- begin
- AppliedEmplLedgEntry := Rec;
- AppliedEmplLedgEntry.CalcFields("Remaining Amount");
- if AppliedEmplLedgEntry."Currency Code" <> ApplnCurrencyCode then begin
- AppliedEmplLedgEntry."Remaining Amount" :=
- CurrExchRate.ExchangeAmtFCYToFCY(
- ApplnDate, AppliedEmplLedgEntry."Currency Code", ApplnCurrencyCode, AppliedEmplLedgEntry."Remaining Amount");
- AppliedEmplLedgEntry."Amount to Apply" :=
- CurrExchRate.ExchangeAmtFCYToFCY(
- ApplnDate, AppliedEmplLedgEntry."Currency Code", ApplnCurrencyCode, AppliedEmplLedgEntry."Amount to Apply");
- end;
-
- if AppliedEmplLedgEntry."Amount to Apply" <> 0 then
- AppliedAmount := Round(AppliedEmplLedgEntry."Amount to Apply", AmountRoundingPrecision)
- else
- AppliedAmount := Round(AppliedEmplLedgEntry."Remaining Amount", AmountRoundingPrecision);
-
- if not DifferentCurrenciesInAppln then
- DifferentCurrenciesInAppln := ApplnCurrencyCode <> AppliedEmplLedgEntry."Currency Code";
- CheckRounding();
- end;
- ApplnType::"Applies-to ID":
- begin
- GenJnlLine2 := GenJnlLine;
- AppliedEmplLedgEntry.SetCurrentKey("Employee No.", Open, Positive);
- AppliedEmplLedgEntry.SetRange("Employee No.", GenJnlLine."Account No.");
- AppliedEmplLedgEntry.SetRange(Open, true);
- AppliedEmplLedgEntry.SetRange("Applies-to ID", GenJnlLine."Applies-to ID");
-
- HandleChosenEntries(1, GenJnlLine2.Amount, GenJnlLine2."Currency Code", GenJnlLine2."Posting Date");
- end;
- end;
- end;
- end;
-
- OnAfterCalcApplnAmount(Rec, AppliedAmount, ApplyingAmount);
- end;
-
- internal procedure GetCustomAppliesToID(): Code[50]
- begin
- if TimesSetCustomAppliesToID <> 1 then
- exit('');
- exit(CustomAppliesToID);
- end;
-
- local procedure UpdateCustomAppliesToIDForGenJournal(NewAppliesToID: Code[50])
- begin
- if (not GenJnlLineApply) or (ApplnType <> ApplnType::"Applies-to ID") then
- exit;
- if JournalHasDocumentNo(NewAppliesToID) then
- exit;
- if (CustomAppliesToID = '') or ((CustomAppliesToID <> '') and (CustomAppliesToID <> NewAppliesToID)) then
- TimesSetCustomAppliesToID += 1;
-
- CustomAppliesToID := NewAppliesToID;
- end;
-
- local procedure JournalHasDocumentNo(AppliesToIDCode: Code[50]): Boolean
- var
- GenJournalLine: Record "Gen. Journal Line";
- begin
- GenJournalLine.SetRange("Journal Template Name", GenJnlLine."Journal Template Name");
- GenJournalLine.SetRange("Journal Batch Name", GenJnlLine."Journal Batch Name");
- GenJournalLine.SetRange("Document No.", CopyStr(AppliesToIDCode, 1, MaxStrLen(GenJournalLine."Document No.")));
- exit(not GenJournalLine.IsEmpty());
- end;
-
- local procedure CalcApplnRemainingAmount(Amt: Decimal) ApplnRemainingAmount: Decimal
- begin
- ValidExchRate := true;
- if ApplnCurrencyCode = Rec."Currency Code" then
- exit(Amt);
-
- if ApplnDate = 0D then
- ApplnDate := Rec."Posting Date";
- ApplnRemainingAmount :=
- CurrExchRate.ApplnExchangeAmtFCYToFCY(
- ApplnDate, Rec."Currency Code", ApplnCurrencyCode, Amt, ValidExchRate);
-
- OnAfterCalcApplnRemainingAmount(Rec, ApplnRemainingAmount);
- end;
-
- local procedure CalcApplnAmounttoApply(AmounttoApply: Decimal) ApplnAmountToApply: Decimal
- begin
- ValidExchRate := true;
-
- if ApplnCurrencyCode = Rec."Currency Code" then
- exit(AmounttoApply);
-
- if ApplnDate = 0D then
- ApplnDate := Rec."Posting Date";
- ApplnAmountToApply :=
- CurrExchRate.ApplnExchangeAmtFCYToFCY(
- ApplnDate, Rec."Currency Code", ApplnCurrencyCode, AmounttoApply, ValidExchRate);
-
- OnAfterCalcApplnAmountToApply(Rec, ApplnAmountToApply);
- end;
-
- local procedure FindAmountRounding()
- begin
- if ApplnCurrencyCode = '' then begin
- Currency.Init();
- Currency.Code := '';
- Currency.InitRoundingPrecision();
- end else
- if ApplnCurrencyCode <> Currency.Code then
- Currency.Get(ApplnCurrencyCode);
-
- AmountRoundingPrecision := Currency."Amount Rounding Precision";
- end;
-
- protected procedure CheckRounding()
- begin
- ApplnRounding := 0;
-
- case CalcType of
- CalcType::"Purchase Header":
- exit;
- CalcType::"Gen. Jnl. Line":
- if (GenJnlLine."Document Type" <> GenJnlLine."Document Type"::Payment) and
- (GenJnlLine."Document Type" <> GenJnlLine."Document Type"::Refund)
- then
- exit;
- end;
-
- if ApplnCurrencyCode = '' then
- ApplnRoundingPrecision := GLSetup."Appln. Rounding Precision"
- else begin
- if ApplnCurrencyCode <> Rec."Currency Code" then
- Currency.Get(ApplnCurrencyCode);
- ApplnRoundingPrecision := Currency."Appln. Rounding Precision";
- end;
-
- if (Abs((AppliedAmount - PmtDiscAmount) + ApplyingAmount) <= ApplnRoundingPrecision) and DifferentCurrenciesInAppln then
- ApplnRounding := -((AppliedAmount - PmtDiscAmount) + ApplyingAmount);
- end;
-
- procedure GetEmplLedgEntry(var EmplLedgEntry2: Record "Employee Ledger Entry")
- begin
- EmplLedgEntry2 := Rec;
- end;
-
- local procedure FindApplyingEntry()
- begin
- if CalcType = CalcType::Direct then begin
- EmplEntryApplID := CopyStr(UserId(), 1, 50);
- if EmplEntryApplID = '' then
- EmplEntryApplID := '***';
-
- EmplLedgEntry.SetCurrentKey("Employee No.", "Applies-to ID", Open);
- EmplLedgEntry.SetRange("Employee No.", Rec."Employee No.");
- if AppliesToID = '' then
- EmplLedgEntry.SetRange("Applies-to ID", EmplEntryApplID)
- else
- EmplLedgEntry.SetRange("Applies-to ID", AppliesToID);
- EmplLedgEntry.SetRange(Open, true);
- EmplLedgEntry.SetRange("Applying Entry", true);
- OnFindFindApplyingEntryOnAfterEmplLedgEntrySetFilters(Rec, EmplLedgEntry);
- if EmplLedgEntry.FindFirst() then begin
- EmplLedgEntry.CalcFields(Amount, "Remaining Amount");
- TempApplyingEmplLedgEntry := EmplLedgEntry;
- Rec.SetFilter("Entry No.", '<>%1', EmplLedgEntry."Entry No.");
- ApplyingAmount := EmplLedgEntry."Remaining Amount";
- ApplnDate := EmplLedgEntry."Posting Date";
- ApplnCurrencyCode := EmplLedgEntry."Currency Code";
- end;
- CalcApplnAmount();
- end;
- end;
-
- local procedure AmounttoApplyOnAfterValidate()
- begin
- if ApplnType <> ApplnType::"Applies-to Doc. No." then begin
- CalcApplnAmount();
- CurrPage.Update(false);
- end;
- end;
-
- local procedure LookupOKOnPush()
- begin
- OK := true;
- end;
-
- local procedure PostDirectApplication(PreviewMode: Boolean)
- var
- RecBeforeRunPostApplicationEmployeeLedgerEntry: Record "Employee Ledger Entry";
- ApplyUnapplyParameters: Record "Apply Unapply Parameters";
- NewApplyUnapplyParameters: Record "Apply Unapply Parameters";
- EmplEntryApplyPostedEntries: Codeunit "EmplEntry-Apply Posted Entries";
- PostApplication: Page "Post Application";
- ApplicationDate: Date;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforePostDirectApplication(Rec, PreviewMode, IsHandled);
- if IsHandled then
- exit;
-
- if CalcType = CalcType::Direct then begin
- if TempApplyingEmplLedgEntry."Entry No." <> 0 then begin
- Rec := TempApplyingEmplLedgEntry;
- IsTheApplicationValid();
- ApplicationDate := EmplEntryApplyPostedEntries.GetApplicationDate(Rec);
-
- OnPostDirectApplicationBeforeSetValues(ApplicationDate);
- Clear(ApplyUnapplyParameters);
- ApplyUnapplyParameters.CopyFromEmplLedgEntry(Rec);
- GLSetup.GetRecordOnce();
- ApplyUnapplyParameters."Posting Date" := ApplicationDate;
- if GLSetup."Journal Templ. Name Mandatory" then begin
- GLSetup.TestField("Apply Jnl. Template Name");
- GLSetup.TestField("Apply Jnl. Batch Name");
- ApplyUnapplyParameters."Journal Template Name" := GLSetup."Apply Jnl. Template Name";
- ApplyUnapplyParameters."Journal Batch Name" := GLSetup."Apply Jnl. Batch Name";
- end;
- PostApplication.SetParameters(ApplyUnapplyParameters);
- RecBeforeRunPostApplicationEmployeeLedgerEntry := Rec;
- if ACTION::OK = PostApplication.RunModal() then begin
- if Rec."Entry No." <> RecBeforeRunPostApplicationEmployeeLedgerEntry."Entry No." then
- Rec := RecBeforeRunPostApplicationEmployeeLedgerEntry;
- PostApplication.GetParameters(NewApplyUnapplyParameters);
- if NewApplyUnapplyParameters."Posting Date" < ApplicationDate then
- Error(ApplicationDateErr);
- end else
- Error(ApplicationProcessCanceledErr);
-
- OnPostDirectApplicationBeforeApply(GLSetup, NewApplyUnapplyParameters);
- if PreviewMode then
- EmplEntryApplyPostedEntries.PreviewApply(Rec, NewApplyUnapplyParameters)
- else
- EmplEntryApplyPostedEntries.Apply(Rec, NewApplyUnapplyParameters);
-
- if not PreviewMode then begin
- Message(ApplicationPostedMsg);
- PostingDone := true;
- CurrPage.Close();
- end;
- end else
- Error(MustSelectEntryErr);
- end else
- Error(PostingInWrongContextErr);
- end;
-
- local procedure CheckActionPerformed(): Boolean
- begin
- if ActionPerformed then
- exit(false);
- if (not (CalcType = CalcType::Direct) and not OK and not PostingDone) or
- (ApplnType = ApplnType::"Applies-to Doc. No.")
- then
- exit(false);
- exit(CalcType = CalcType::Direct);
- end;
-
- procedure SetAppliesToID(AppliesToID2: Code[50])
- begin
- AppliesToID := AppliesToID2;
- end;
-
- local procedure HandleChosenEntries(Type: Option Direct,GenJnlLine; CurrentAmount: Decimal; CurrencyCode: Code[10]; PostingDate: Date)
- var
- TempAppliedEmplLedgEntry: Record "Employee Ledger Entry" temporary;
- CorrectionAmount: Decimal;
- FromZeroGenJnl: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeHandledChosenEntries(Type, CurrentAmount, CurrencyCode, AppliedEmplLedgEntry, IsHandled);
- if IsHandled then
- exit;
-
- CorrectionAmount := 0;
- if AppliedEmplLedgEntry.FindSet(false) then
- repeat
- TempAppliedEmplLedgEntry := AppliedEmplLedgEntry;
- TempAppliedEmplLedgEntry.Insert();
- until AppliedEmplLedgEntry.Next() = 0
- else
- exit;
-
- FromZeroGenJnl := (CurrentAmount = 0) and (Type = Type::GenJnlLine);
-
- repeat
- if not FromZeroGenJnl then
- TempAppliedEmplLedgEntry.SetRange(Positive, CurrentAmount < 0);
- if TempAppliedEmplLedgEntry.FindFirst() then begin
- ExchangeLedgerEntryAmounts(Type, CurrencyCode, TempAppliedEmplLedgEntry, PostingDate);
- if ((CurrentAmount + TempAppliedEmplLedgEntry."Amount to Apply") * CurrentAmount) >= 0 then
- AppliedAmount := AppliedAmount + CorrectionAmount;
- CurrentAmount := CurrentAmount + TempAppliedEmplLedgEntry."Amount to Apply";
- end else begin
- TempAppliedEmplLedgEntry.SetRange(Positive);
- TempAppliedEmplLedgEntry.FindFirst();
- end;
-
- AppliedAmount := AppliedAmount + TempAppliedEmplLedgEntry."Amount to Apply";
-
- TempAppliedEmplLedgEntry.Delete();
- TempAppliedEmplLedgEntry.SetRange(Positive);
-
- until not TempAppliedEmplLedgEntry.FindFirst();
- CheckRounding();
- end;
-
- local procedure IsTheApplicationValid()
- var
- ApplyToEmployeeLedgerEntry: Record "Employee Ledger Entry";
- IsFirst, IsPositiv, ThereAreEntriesToApply : boolean;
- Counter: Integer;
- AllEntriesHaveTheSameSignErr: Label 'All entries have the same sign this will not lead top an application. Update the application by including entries with opposite sign.';
- begin
- IsFirst := true;
- ThereAreEntriesToApply := false;
- Counter := 0;
- ApplyToEmployeeLedgerEntry.SetCurrentKey("Employee No.", "Applies-to ID");
- ApplyToEmployeeLedgerEntry.SetRange("Employee No.", EmplLedgEntry."Employee No.");
- ApplyToEmployeeLedgerEntry.SetRange("Applies-to ID", EmplLedgEntry."Applies-to ID");
- if ApplyToEmployeeLedgerEntry.FindSet() then
- repeat
- if not IsFirst then
- ThereAreEntriesToApply := (IsPositiv <> ApplyToEmployeeLedgerEntry.Positive)
- else
- IsPositiv := ApplyToEmployeeLedgerEntry.Positive;
- IsFirst := false;
- Counter += 1;
- until (ApplyToEmployeeLedgerEntry.next() = 0) or ThereAreEntriesToApply;
- if not ThereAreEntriesToApply and (Counter > 1) then
- error(AllEntriesHaveTheSameSignErr)
- end;
-
- protected procedure ExchangeLedgerEntryAmounts(Type: Option Direct,GenJnlLine; CurrencyCode: Code[10]; var CalcEmplLedgEntry: Record "Employee Ledger Entry"; PostingDate: Date)
- var
- CalculateCurrency: Boolean;
- IsHandled: Boolean;
- begin
- CalcEmplLedgEntry.CalcFields("Remaining Amount");
-
- if Type = Type::Direct then
- CalculateCurrency := TempApplyingEmplLedgEntry."Entry No." <> 0
- else
- CalculateCurrency := true;
-
- OnBeforeExchangeLedgerEntryAmounts(CalcEmplLedgEntry, EmplLedgEntry, CurrencyCode, CalculateCurrency, IsHandled);
- if IsHandled then
- exit;
-
- if (CurrencyCode <> CalcEmplLedgEntry."Currency Code") and CalculateCurrency then begin
- CalcEmplLedgEntry."Remaining Amount" :=
- CurrExchRate.ExchangeAmount(
- CalcEmplLedgEntry."Remaining Amount", CalcEmplLedgEntry."Currency Code", CurrencyCode, PostingDate);
- CalcEmplLedgEntry."Amount to Apply" :=
- CurrExchRate.ExchangeAmount(
- CalcEmplLedgEntry."Amount to Apply", CalcEmplLedgEntry."Currency Code", CurrencyCode, PostingDate);
- end;
-
- OnAfterExchangeLedgerEntryAmounts(CalcEmplLedgEntry, EmplLedgEntry, CurrencyCode);
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCalcApplnAmount(EmplLedgerEntry: Record "Employee Ledger Entry"; var AppliedAmount: Decimal; var ApplyingAmount: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCalcApplnAmountToApply(EmplLedgerEntry: Record "Employee Ledger Entry"; var ApplnAmountToApply: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCalcApplnRemainingAmount(EmplLedgerEntry: Record "Employee Ledger Entry"; var ApplnRemainingAmount: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnPostDirectApplicationBeforeSetValues(var ApplicationDate: Date)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnPostDirectApplicationBeforeApply(GLSetup: Record "General Ledger Setup"; var NewApplyUnapplyParameters: Record "Apply Unapply Parameters")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCalcApplnAmount(var EmplLedgerEntry: Record "Employee Ledger Entry"; var GenJournalLine: Record "Gen. Journal Line"; var AppliedEmplLedgerEntry: Record "Employee Ledger Entry"; CalculationType: Option; ApplicationType: Option)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckEarlierPostingDate(var TempApplyingEmplLedgEntry: Record "Employee Ledger Entry" temporary; EmplLedgerEntry: Record "Employee Ledger Entry"; CalcType: Option; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeHandledChosenEntries(Type: Option Direct,GenJnlLine; CurrentAmount: Decimal; CurrencyCode: Code[10]; var AppliedEmplLedgerEntry: Record "Employee Ledger Entry"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePostDirectApplication(var EmplLedgerEntry: Record "Employee Ledger Entry"; PreviewMode: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeSetApplyingEmplLedgEntry(var ApplyingEmplLedgEntry: Record "Employee Ledger Entry"; GenJournalLine: Record "Gen. Journal Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnFindFindApplyingEntryOnAfterEmplLedgEntrySetFilters(ApplyingEmplLedgerEntry: Record "Employee Ledger Entry"; var EmplLedgerEntry: Record "Employee Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSetCustApplIdAfterCheckAgainstApplnCurrency(var EmplLedgerEntry: Record "Employee Ledger Entry"; CalcType: Option; GenJnlLine: Record "Gen. Journal Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeExchangeLedgerEntryAmounts(var CalcEmployeeLedgerEntry: Record "Employee Ledger Entry"; EmployeeLedgerEntry: Record "Employee Ledger Entry"; CurrencyCode: Code[10]; CalculateCurrency: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterExchangeLedgerEntryAmounts(var CalcEmployeeLedgerEntry: Record "Employee Ledger Entry"; EmployeeLedgerEntry: Record "Employee Ledger Entry"; CurrencyCode: Code[10])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckEmplApplIdOnBeforeEarlierPostingDateError(var ApplyingEmplLedgEntry: Record "Employee Ledger Entry"; EmplLedgerEntry: Record "Employee Ledger Entry"; var RaiseError: Boolean; CalcType: Enum "Vendor Apply Calculation Type")
- begin
- end;
-}
-#pragma warning restore AA0204
diff --git a/src/Layers/NL/BaseApp/HumanResources/Payables/EmplEntryEdit.Codeunit.al b/src/Layers/NL/BaseApp/HumanResources/Payables/EmplEntryEdit.Codeunit.al
deleted file mode 100644
index 58e85f1593..0000000000
--- a/src/Layers/NL/BaseApp/HumanResources/Payables/EmplEntryEdit.Codeunit.al
+++ /dev/null
@@ -1,43 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.HumanResources.Payables;
-
-codeunit 114 "Empl. Entry-Edit"
-{
- Permissions = TableData "Employee Ledger Entry" = rm,
- TableData "Detailed Employee Ledger Entry" = rm;
- TableNo = "Employee Ledger Entry";
-
- trigger OnRun()
- begin
- EmplLedgEntry := Rec;
- EmplLedgEntry.LockTable();
- EmplLedgEntry.Find();
- if EmplLedgEntry.Open then begin
- EmplLedgEntry."Applies-to ID" := Rec."Applies-to ID";
- EmplLedgEntry."Transaction Mode Code" := Rec."Transaction Mode Code";
- EmplLedgEntry.Validate("Payment Method Code", Rec."Payment Method Code");
- EmplLedgEntry.Validate("Amount to Apply", Rec."Amount to Apply");
- EmplLedgEntry.Validate("Applying Entry", Rec."Applying Entry");
- EmplLedgEntry.Validate("Message to Recipient", Rec."Message to Recipient");
- end;
- EmplLedgEntry.Validate("Exported to Payment File", Rec."Exported to Payment File");
- EmplLedgEntry.Validate("Creditor No.", Rec."Creditor No.");
- EmplLedgEntry.Validate("Payment Reference", Rec."Payment Reference");
- OnBeforeEmplLedgEntryModify(EmplLedgEntry, Rec);
- EmplLedgEntry.TestField("Entry No.", Rec."Entry No.");
- EmplLedgEntry.Modify();
- Rec := EmplLedgEntry;
- end;
-
- var
- EmplLedgEntry: Record "Employee Ledger Entry";
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeEmplLedgEntryModify(var EmplLedgEntry: Record "Employee Ledger Entry"; FromEmplLedgEntry: Record "Employee Ledger Entry")
- begin
- end;
-}
-
diff --git a/src/Layers/NL/BaseApp/HumanResources/Payables/EmplLedgerEntriesPreview.Page.al b/src/Layers/NL/BaseApp/HumanResources/Payables/EmplLedgerEntriesPreview.Page.al
deleted file mode 100644
index 2e34aafd2b..0000000000
--- a/src/Layers/NL/BaseApp/HumanResources/Payables/EmplLedgerEntriesPreview.Page.al
+++ /dev/null
@@ -1,363 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.HumanResources.Payables;
-
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Preview;
-
-page 5239 "Empl. Ledger Entries Preview"
-{
- Caption = 'Employee Entries Preview';
- DataCaptionFields = "Employee No.";
- Editable = false;
- PageType = List;
- SourceTable = "Employee Ledger Entry";
- SourceTableTemporary = true;
-
- layout
- {
- area(content)
- {
- repeater(Control1)
- {
- ShowCaption = false;
- field("Posting Date"; Rec."Posting Date")
- {
- ApplicationArea = BasicHR;
- }
- field("Document Type"; Rec."Document Type")
- {
- ApplicationArea = BasicHR;
- }
- field("Document No."; Rec."Document No.")
- {
- ApplicationArea = BasicHR;
- }
- field("Employee No."; Rec."Employee No.")
- {
- ApplicationArea = BasicHR;
- }
- field("Message to Recipient"; Rec."Message to Recipient")
- {
- ApplicationArea = BasicHR;
- }
- field(Description; Rec.Description)
- {
- ApplicationArea = BasicHR;
- }
- field("Payment Method Code"; Rec."Payment Method Code")
- {
- ApplicationArea = BasicHR;
- }
- field(OriginalAmountFCY; OriginalAmountFCY)
- {
- ApplicationArea = BasicHR;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Original Amount';
- Editable = false;
- ToolTip = 'Specifies the amount on the employee ledger entry before you post.';
-
- trigger OnDrillDown()
- begin
- DrilldownAmounts(2);
- end;
- }
- field(OriginalAmountLCY; OriginalAmountLCY)
- {
- ApplicationArea = BasicHR;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Original Amount (LCY)';
- Editable = false;
- ToolTip = 'Specifies the amount, in local currency, on the employee ledger entry before you post.';
- Visible = false;
-
- trigger OnDrillDown()
- begin
- DrilldownAmounts(2);
- end;
- }
- field(AmountFCY; AmountFCY)
- {
- ApplicationArea = BasicHR;
- AutoFormatType = 1;
- AutoFormatExpression = Rec."Currency Code";
- Caption = 'Amount';
- Editable = false;
- ToolTip = 'Specifies the net amount of all the lines in the employee entry.';
-
- trigger OnDrillDown()
- begin
- DrilldownAmounts(0);
- end;
- }
- field(AmountLCY; AmountLCY)
- {
- ApplicationArea = BasicHR;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Amount (LCY)';
- Editable = false;
- ToolTip = 'Specifies the amount, in local currency, relating to the employee ledger entry';
- Visible = false;
-
- trigger OnDrillDown()
- begin
- DrilldownAmounts(0);
- end;
- }
- field(RemainingAmountFCY; RemainingAmountFCY)
- {
- ApplicationArea = BasicHR;
- AutoFormatType = 1;
- AutoFormatExpression = Rec."Currency Code";
- Caption = 'Remaining Amount';
- Editable = false;
- ToolTip = 'Specifies the remaining amount on the employee ledger entry before you post.';
-
- trigger OnDrillDown()
- begin
- DrilldownAmounts(1);
- end;
- }
- field(RemainingAmountLCY; RemainingAmountLCY)
- {
- ApplicationArea = BasicHR;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Remaining Amount (LCY)';
- Editable = false;
- ToolTip = 'Specifies the remaining amount, in local currency, on the employee ledger entry before you post.';
- Visible = false;
-
- trigger OnDrillDown()
- begin
- DrilldownAmounts(1);
- end;
- }
- field("Bal. Account Type"; Rec."Bal. Account Type")
- {
- ApplicationArea = BasicHR;
- Editable = false;
- Visible = false;
- }
- field("Bal. Account No."; Rec."Bal. Account No.")
- {
- ApplicationArea = BasicHR;
- Editable = false;
- Visible = false;
- }
- field(Open; Rec.Open)
- {
- ApplicationArea = BasicHR;
- }
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = BasicHR;
- }
- field("Entry No."; Rec."Entry No.")
- {
- ApplicationArea = BasicHR;
- }
- field("Global Dimension 1 Code"; Rec."Global Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
- Visible = Dim1Visible;
- }
- field("Global Dimension 2 Code"; Rec."Global Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
- Visible = Dim2Visible;
- }
- field("Shortcut Dimension 3 Code"; Rec."Shortcut Dimension 3 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim3Visible;
- }
- field("Shortcut Dimension 4 Code"; Rec."Shortcut Dimension 4 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim4Visible;
- }
- field("Shortcut Dimension 5 Code"; Rec."Shortcut Dimension 5 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim5Visible;
- }
- field("Shortcut Dimension 6 Code"; Rec."Shortcut Dimension 6 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim6Visible;
- }
- field("Shortcut Dimension 7 Code"; Rec."Shortcut Dimension 7 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim7Visible;
- }
- field("Shortcut Dimension 8 Code"; Rec."Shortcut Dimension 8 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim8Visible;
- }
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("Ent&ry")
- {
- Caption = 'Ent&ry';
- Image = Entry;
- action(Dimensions)
- {
- ApplicationArea = Dimensions;
- Caption = 'Dimensions';
- Ellipsis = true;
- 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()
- var
- GenJnlPostPreview: Codeunit "Gen. Jnl.-Post Preview";
- begin
- GenJnlPostPreview.ShowDimensions(DATABASE::"Employee Ledger Entry", Rec."Entry No.", Rec."Dimension Set ID");
- end;
- }
- action(SetDimensionFilter)
- {
- ApplicationArea = Dimensions;
- Caption = 'Set Dimension Filter';
- Ellipsis = true;
- Image = "Filter";
- ToolTip = 'Limit the entries according to the dimension filters that you specify. NOTE: If you use a high number of dimension combinations, this function may not work and can result in a message that the SQL server only supports a maximum of 2100 parameters.';
-
- trigger OnAction()
- begin
- Rec.SetFilter("Dimension Set ID", DimensionSetIDFilter.LookupFilter());
- end;
- }
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process';
-
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- }
- }
- }
-
- trigger OnAfterGetRecord()
- begin
- CalcAmounts(AmountFCY, AmountLCY, RemainingAmountFCY, RemainingAmountLCY, OriginalAmountFCY, OriginalAmountLCY);
- end;
-
- trigger OnOpenPage()
- begin
- SetDimVisibility();
- end;
-
- var
- TempDetailedEmplLedgEntry: Record "Detailed Employee Ledger Entry" temporary;
- DimensionSetIDFilter: Page "Dimension Set ID Filter";
- AmountFCY: Decimal;
- AmountLCY: Decimal;
- RemainingAmountFCY: Decimal;
- RemainingAmountLCY: Decimal;
- OriginalAmountLCY: Decimal;
- OriginalAmountFCY: Decimal;
-
- protected var
- Dim1Visible: Boolean;
- Dim2Visible: Boolean;
- Dim3Visible: Boolean;
- Dim4Visible: Boolean;
- Dim5Visible: Boolean;
- Dim6Visible: Boolean;
- Dim7Visible: Boolean;
- Dim8Visible: Boolean;
-
- local procedure SetDimVisibility()
- var
- DimensionManagement: Codeunit DimensionManagement;
- begin
- DimensionManagement.UseShortcutDims(Dim1Visible, Dim2Visible, Dim3Visible, Dim4Visible, Dim5Visible, Dim6Visible, Dim7Visible, Dim8Visible);
- end;
-
- procedure Set(var TempEmplLedgerEntry: Record "Employee Ledger Entry" temporary; var TempDetailedEmplLedgEntry2: Record "Detailed Employee Ledger Entry" temporary)
- begin
- if TempEmplLedgerEntry.FindSet() then
- repeat
- Rec := TempEmplLedgerEntry;
- Rec.Insert();
- until TempEmplLedgerEntry.Next() = 0;
-
- if TempDetailedEmplLedgEntry2.FindSet() then
- repeat
- TempDetailedEmplLedgEntry := TempDetailedEmplLedgEntry2;
- TempDetailedEmplLedgEntry.Insert();
- until TempDetailedEmplLedgEntry2.Next() = 0;
- end;
-
- local procedure CalcAmounts(var AmountFCY: Decimal; var AmountLCY: Decimal; var RemainingAmountFCY: Decimal; var RemainingAmountLCY: Decimal; var OriginalAmountFCY: Decimal; var OriginalAmountLCY: Decimal)
- begin
- AmountFCY := 0;
- AmountLCY := 0;
- RemainingAmountLCY := 0;
- RemainingAmountFCY := 0;
- OriginalAmountLCY := 0;
- OriginalAmountFCY := 0;
-
- TempDetailedEmplLedgEntry.SetRange("Employee Ledger Entry No.", Rec."Entry No.");
- if TempDetailedEmplLedgEntry.FindSet() then
- repeat
- if TempDetailedEmplLedgEntry."Entry Type" = TempDetailedEmplLedgEntry."Entry Type"::"Initial Entry" then begin
- OriginalAmountFCY += TempDetailedEmplLedgEntry.Amount;
- OriginalAmountLCY += TempDetailedEmplLedgEntry."Amount (LCY)";
- end;
- if not (TempDetailedEmplLedgEntry."Entry Type" = TempDetailedEmplLedgEntry."Entry Type"::Application)
- then begin
- AmountFCY += TempDetailedEmplLedgEntry.Amount;
- AmountLCY += TempDetailedEmplLedgEntry."Amount (LCY)";
- end;
- RemainingAmountFCY += TempDetailedEmplLedgEntry.Amount;
- RemainingAmountLCY += TempDetailedEmplLedgEntry."Amount (LCY)";
- until TempDetailedEmplLedgEntry.Next() = 0;
- end;
-
- local procedure DrilldownAmounts(AmountType: Option Amount,"Remaining Amount","Original Amount")
- var
- DetailedEmplEntriesPreview: Page "Detailed Empl. Entries Preview";
- begin
- case AmountType of
- AmountType::Amount:
- TempDetailedEmplLedgEntry.SetFilter("Entry Type", '<>%1',
- TempDetailedEmplLedgEntry."Entry Type"::Application);
- AmountType::"Original Amount":
- TempDetailedEmplLedgEntry.SetRange("Entry Type", TempDetailedEmplLedgEntry."Entry Type"::"Initial Entry");
- AmountType::"Remaining Amount":
- TempDetailedEmplLedgEntry.SetRange("Entry Type");
- end;
- DetailedEmplEntriesPreview.Set(TempDetailedEmplLedgEntry);
- DetailedEmplEntriesPreview.RunModal();
- Clear(DetailedEmplEntriesPreview);
- end;
-}
-
diff --git a/src/Layers/NL/BaseApp/HumanResources/Payables/EmployeeLedgerEntries.Page.al b/src/Layers/NL/BaseApp/HumanResources/Payables/EmployeeLedgerEntries.Page.al
deleted file mode 100644
index 70068c4b18..0000000000
--- a/src/Layers/NL/BaseApp/HumanResources/Payables/EmployeeLedgerEntries.Page.al
+++ /dev/null
@@ -1,465 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.HumanResources.Payables;
-
-using Microsoft.Bank.Reconciliation;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Reversal;
-using Microsoft.Foundation.Navigate;
-
-page 5237 "Employee Ledger Entries"
-{
- ApplicationArea = BasicHR;
- Caption = 'Employee Ledger Entries';
- DeleteAllowed = false;
- InsertAllowed = false;
- PageType = List;
- Permissions = TableData "Employee Ledger Entry" = m;
- SourceTable = "Employee Ledger Entry";
- UsageCategory = History;
- AdditionalSearchTerms = 'Employee Check, Employee Expense, Pay Employee';
-
-
- layout
- {
- area(content)
- {
- repeater(Group)
- {
- field("Posting Date"; Rec."Posting Date")
- {
- ApplicationArea = BasicHR;
- Editable = false;
- }
- field("Document Type"; Rec."Document Type")
- {
- ApplicationArea = BasicHR;
- Editable = false;
- }
- field("Document No."; Rec."Document No.")
- {
- ApplicationArea = BasicHR;
- Editable = false;
- }
- field("Employee No."; Rec."Employee No.")
- {
- ApplicationArea = BasicHR;
- Editable = false;
- }
- field("Message to Recipient"; Rec."Message to Recipient")
- {
- ApplicationArea = BasicHR;
- }
- field(Description; Rec.Description)
- {
- ApplicationArea = BasicHR;
- Editable = false;
- }
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = BasicHR;
- Editable = false;
- }
- field("Payment Method Code"; Rec."Payment Method Code")
- {
- ApplicationArea = BasicHR;
- }
- field("Original Amount"; Rec."Original Amount")
- {
- ApplicationArea = BasicHR;
- }
- field("Original Amt. (LCY)"; Rec."Original Amt. (LCY)")
- {
- ApplicationArea = BasicHR;
- ToolTip = 'Specifies the amount that the entry originally consisted of, in LCY.';
- Visible = false;
- }
- field(Amount; Rec.Amount)
- {
- ApplicationArea = BasicHR;
- }
- field("Amount (LCY)"; Rec."Amount (LCY)")
- {
- ApplicationArea = BasicHR;
- ToolTip = 'Specifies the amount of the entry in LCY.';
- Visible = false;
- }
- field("Remaining Amount"; Rec."Remaining Amount")
- {
- ApplicationArea = BasicHR;
- }
- field("Remaining Amt. (LCY)"; Rec."Remaining Amt. (LCY)")
- {
- ApplicationArea = BasicHR;
- }
- field("Bal. Account Type"; Rec."Bal. Account Type")
- {
- ApplicationArea = BasicHR;
- Editable = false;
- Visible = false;
- }
- field("Bal. Account No."; Rec."Bal. Account No.")
- {
- ApplicationArea = BasicHR;
- Editable = false;
- Visible = false;
- }
- field(Open; Rec.Open)
- {
- ApplicationArea = BasicHR;
- Editable = false;
- }
- field("Amount to Apply"; Rec."Amount to Apply")
- {
- ApplicationArea = BasicHR;
- Visible = false;
- }
- field("Applies-to ID"; Rec."Applies-to ID")
- {
- ApplicationArea = BasicHR;
- Visible = false;
- }
- field("Applying Entry"; Rec."Applying Entry")
- {
- ApplicationArea = BasicHR;
- Visible = false;
- }
- field("Exported to Payment File"; Rec."Exported to Payment File")
- {
- ApplicationArea = BasicHR;
- Editable = true;
- Visible = false;
- }
- field("Payment Reference"; Rec."Payment Reference")
- {
- ApplicationArea = BasicHR;
- ToolTip = 'Specifies the payment of the employee document.';
- Visible = false;
- }
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = BasicHR;
- }
- field("Entry No."; Rec."Entry No.")
- {
- ApplicationArea = BasicHR;
- Editable = false;
- }
- field("G/L Register No."; Rec."G/L Register No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Transaction No."; Rec."Transaction No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Global Dimension 1 Code"; Rec."Global Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim1Visible;
- }
- field("Global Dimension 2 Code"; Rec."Global Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim2Visible;
- }
- field("Shortcut Dimension 3 Code"; Rec."Shortcut Dimension 3 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim3Visible;
- }
- field("Shortcut Dimension 4 Code"; Rec."Shortcut Dimension 4 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim4Visible;
- }
- field("Shortcut Dimension 5 Code"; Rec."Shortcut Dimension 5 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim5Visible;
- }
- field("Shortcut Dimension 6 Code"; Rec."Shortcut Dimension 6 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim6Visible;
- }
- field("Shortcut Dimension 7 Code"; Rec."Shortcut Dimension 7 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim7Visible;
- }
- field("Shortcut Dimension 8 Code"; Rec."Shortcut Dimension 8 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim8Visible;
- }
- }
- }
- area(factboxes)
- {
- systempart(RecordLinks; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(RecordNotes; Notes)
- {
- ApplicationArea = Notes;
- Visible = false;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("Ent&ry")
- {
- Caption = 'Ent&ry';
- Image = Entry;
- action("Applied E&ntries")
- {
- ApplicationArea = BasicHR;
- Caption = 'Applied E&ntries';
- Image = Approve;
- RunObject = Page "Applied Employee Entries";
- RunPageOnRec = true;
- Scope = Repeater;
- ToolTip = 'View the ledger entries that have been applied to this record.';
- }
- action(Dimensions)
- {
- AccessByPermission = TableData Dimension = R;
- ApplicationArea = Dimensions;
- Caption = 'Dimensions';
- Image = Dimensions;
- Scope = Repeater;
- ShortCutKey = 'Alt+D';
- ToolTip = 'View or edit dimensions, such as area, project, or department, that you can assign to sales and purchase documents to distribute costs and analyze transaction history.';
-
- trigger OnAction()
- begin
- Rec.ShowDimensions();
- end;
- }
- action("Detailed &Ledger Entries")
- {
- ApplicationArea = BasicHR;
- Caption = 'Detailed &Ledger Entries';
- Image = View;
- RunObject = Page "Detailed Empl. Ledger Entries";
- RunPageLink = "Employee Ledger Entry No." = field("Entry No."),
- "Employee No." = field("Employee No.");
- RunPageView = sorting("Employee Ledger Entry No.", "Posting Date");
- Scope = Repeater;
- ShortCutKey = 'Ctrl+F7';
- ToolTip = 'View a summary of the all posted entries and adjustments related to a specific employee ledger entry';
- }
- action(Navigate)
- {
- ApplicationArea = BasicHR;
- Caption = 'Find entries...';
- Image = Navigate;
- ShortCutKey = 'Ctrl+Alt+Q';
- ToolTip = 'Find entries and documents that exist for the document number and posting date on the selected document. (Formerly this action was named Navigate.)';
-
- trigger OnAction()
- var
- Navigate: Page Navigate;
- begin
- Navigate.SetDoc(Rec."Posting Date", Rec."Document No.");
- Navigate.Run();
- end;
- }
- }
- }
- area(processing)
- {
- group("F&unctions")
- {
- Caption = 'F&unctions';
- Image = "Action";
- action(ActionApplyEntries)
- {
- ApplicationArea = BasicHR;
- Caption = 'Apply Entries';
- Image = ApplyEntries;
- Scope = Repeater;
- ShortCutKey = 'Shift+F11';
- ToolTip = 'Select one or more ledger entries that you want to apply this record to so that the related posted documents are closed as paid or refunded.';
-
- trigger OnAction()
- var
- EmployeeLedgerEntry: Record "Employee Ledger Entry";
- EmplEntryApplyPostedEntries: Codeunit "EmplEntry-Apply Posted Entries";
- begin
- EmployeeLedgerEntry.Copy(Rec);
- EmplEntryApplyPostedEntries.ApplyEmplEntryFormEntry(EmployeeLedgerEntry);
- Rec := EmployeeLedgerEntry;
- Rec.Get(Rec."Entry No.");
- CurrPage.Update();
- end;
- }
- separator(Action9)
- {
- }
- action(UnapplyEntries)
- {
- ApplicationArea = BasicHR;
- Caption = 'Unapply Entries';
- Ellipsis = true;
- Image = UnApply;
- Scope = Repeater;
- ToolTip = 'Unselect one or more ledger entries that you want to unapply this record.';
-
- trigger OnAction()
- var
- EmplEntryApplyPostedEntries: Codeunit "EmplEntry-Apply Posted Entries";
- begin
- EmplEntryApplyPostedEntries.UnApplyEmplLedgEntry(Rec."Entry No.");
- end;
- }
- action(CreatePayment)
- {
- ApplicationArea = BasicHR;
- Caption = 'Create Payment';
- Image = SuggestVendorPayments;
- ToolTip = 'Create a payment journal based on the selected entries.';
-
- trigger OnAction()
- var
- EmployeeLedgerEntry: Record "Employee Ledger Entry";
- GenJournalBatch: Record "Gen. Journal Batch";
- GenJnlManagement: Codeunit GenJnlManagement;
- begin
- CurrPage.SetSelectionFilter(EmployeeLedgerEntry);
- if CreateEmployeePayment.RunModal() = ACTION::OK then begin
- CreateEmployeePayment.MakeGenJnlLines(EmployeeLedgerEntry);
- GetBatchRecord(GenJournalBatch);
- GenJnlManagement.TemplateSelectionFromBatch(GenJournalBatch);
- Clear(CreateEmployeePayment);
- end else
- Clear(CreateEmployeePayment);
- end;
- }
- action(ReverseTransaction)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Reverse Transaction';
- Ellipsis = true;
- Image = ReverseRegister;
- Scope = Repeater;
- ToolTip = 'Reverse an erroneous employee ledger entry.';
-
- trigger OnAction()
- var
- ReversalEntry: Record "Reversal Entry";
- ReversePaymentRec: Codeunit "Reverse Payment Rec. Journal";
- begin
- ReversePaymentRec.ErrorIfEntryIsNotReversable(Rec);
- ReversalEntry.ReverseTransaction(Rec."Transaction No.");
- end;
- }
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- actionref(ActionApplyEntries_Promoted; ActionApplyEntries)
- {
- }
- actionref(UnapplyEntries_Promoted; UnapplyEntries)
- {
- }
- actionref(Navigate_Promoted; Navigate)
- {
- }
- actionref(CreatePayment_Promoted; CreatePayment)
- {
- }
- actionref(ReverseTransaction_Promoted; ReverseTransaction)
- {
- }
- }
- group(Category_Category4)
- {
- Caption = 'Entry', Comment = 'Generated from the PromotedActionCategories property index 3.';
-
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref("Applied E&ntries_Promoted"; "Applied E&ntries")
- {
- }
- actionref("Detailed &Ledger Entries_Promoted"; "Detailed &Ledger Entries")
- {
- }
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- }
- }
-
- trigger OnOpenPage()
- begin
- SetDimVisibility();
- end;
-
- var
- CreateEmployeePayment: Page "Create Employee Payment";
-
- protected var
- Dim1Visible: Boolean;
- Dim2Visible: Boolean;
- Dim3Visible: Boolean;
- Dim4Visible: Boolean;
- Dim5Visible: Boolean;
- Dim6Visible: Boolean;
- Dim7Visible: Boolean;
- Dim8Visible: Boolean;
-
- local procedure SetDimVisibility()
- var
- DimensionManagement: Codeunit DimensionManagement;
- begin
- DimensionManagement.UseShortcutDims(Dim1Visible, Dim2Visible, Dim3Visible, Dim4Visible, Dim5Visible, Dim6Visible, Dim7Visible, Dim8Visible);
- end;
-
- local procedure GetBatchRecord(var GenJournalBatch: Record "Gen. Journal Batch")
- var
- GenJournalTemplate: Record "Gen. Journal Template";
- JournalTemplateName: Code[10];
- JournalBatchName: Code[10];
- begin
- GenJournalTemplate.Reset();
- GenJournalTemplate.SetRange(Type, GenJournalTemplate.Type::Payments);
- GenJournalTemplate.SetRange(Recurring, false);
- if GenJournalTemplate.FindFirst() then
- JournalTemplateName := GenJournalTemplate.Name;
-
- JournalBatchName := CreateEmployeePayment.GetBatchNumber();
-
- GenJournalTemplate.Get(JournalTemplateName);
- GenJournalBatch.Get(JournalTemplateName, JournalBatchName);
- end;
-}
-
diff --git a/src/Layers/NL/BaseApp/HumanResources/Payables/EmployeeLedgerEntry.Table.al b/src/Layers/NL/BaseApp/HumanResources/Payables/EmployeeLedgerEntry.Table.al
deleted file mode 100644
index 32707d71e1..0000000000
--- a/src/Layers/NL/BaseApp/HumanResources/Payables/EmployeeLedgerEntry.Table.al
+++ /dev/null
@@ -1,693 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.HumanResources.Payables;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.Payment;
-using Microsoft.CRM.Team;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Ledger;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.FixedAssets.FixedAsset;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.HumanResources.Employee;
-using Microsoft.Purchases.Vendor;
-using Microsoft.Sales.Customer;
-using System.Security.AccessControl;
-using System.Utilities;
-
-table 5222 "Employee Ledger Entry"
-{
- Caption = 'Employee Ledger Entry';
- DrillDownPageID = "Employee Ledger Entries";
- LookupPageID = "Employee Ledger Entries";
- DataClassification = CustomerContent;
-
- fields
- {
- field(1; "Entry No."; Integer)
- {
- Caption = 'Entry No.';
- ToolTip = 'Specifies the entry number that is assigned to the entry.';
- }
- field(3; "Employee No."; Code[20])
- {
- Caption = 'Employee No.';
- ToolTip = 'Specifies the number of the employee that the entry is linked to.';
- TableRelation = Employee;
- }
- field(4; "Posting Date"; Date)
- {
- Caption = 'Posting Date';
- ToolTip = 'Specifies the employee entry''s posting date.';
- }
- field(5; "Document Type"; Enum "Gen. Journal Document Type")
- {
- Caption = 'Document Type';
- ToolTip = 'Specifies the document type that the employee entry belongs to.';
- }
- field(6; "Document No."; Code[20])
- {
- Caption = 'Document No.';
- ToolTip = 'Specifies the employee entry''s document number.';
- }
- field(7; Description; Text[100])
- {
- Caption = 'Description';
- ToolTip = 'Specifies a description of the employee entry.';
- }
- field(11; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- ToolTip = 'Specifies the currency code for the amount on the line.';
- TableRelation = Currency;
- }
- field(13; Amount; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Employee Ledger Entry".Amount where("Ledger Entry Amount" = const(true),
- "Employee Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Amount';
- ToolTip = 'Specifies the amount of the entry.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(14; "Remaining Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Employee Ledger Entry".Amount where("Employee Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Remaining Amount';
- ToolTip = 'Specifies the amount that remains to be applied to before the entry is totally applied to.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(15; "Original Amt. (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Employee Ledger Entry"."Amount (LCY)" where("Employee Ledger Entry No." = field("Entry No."),
- "Entry Type" = filter("Initial Entry"),
- "Posting Date" = field("Date Filter")));
- Caption = 'Original Amt. (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(16; "Remaining Amt. (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Employee Ledger Entry"."Amount (LCY)" where("Employee Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Remaining Amt. (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(17; "Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Employee Ledger Entry"."Amount (LCY)" where("Ledger Entry Amount" = const(true),
- "Employee Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Amount (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(22; "Employee Posting Group"; Code[20])
- {
- Caption = 'Employee Posting Group';
- TableRelation = "Employee Posting Group";
- }
- field(23; "Global Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,1,1';
- Caption = 'Global Dimension 1 Code';
- ToolTip = 'Specifies the code for the global dimension that is linked to the record or entry for analysis purposes. Two global dimensions, typically for the company''s most important activities, are available on all cards, documents, reports, and lists.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1));
- }
- field(24; "Global Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,1,2';
- Caption = 'Global Dimension 2 Code';
- ToolTip = 'Specifies the code for the global dimension that is linked to the record or entry for analysis purposes. Two global dimensions, typically for the company''s most important activities, are available on all cards, documents, reports, and lists.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2));
- }
- field(25; "Salespers./Purch. Code"; Code[20])
- {
- Caption = 'Salespers./Purch. Code';
- ToolTip = 'Specifies which purchaser is assigned to the employee.';
- TableRelation = "Salesperson/Purchaser";
- }
- field(27; "User ID"; Code[50])
- {
- Caption = 'User ID';
- ToolTip = 'Specifies the ID of the user who posted the entry, to be used, for example, in the change log.';
- DataClassification = EndUserIdentifiableInformation;
- TableRelation = User."User Name";
- }
- field(28; "Source Code"; Code[10])
- {
- Caption = 'Source Code';
- TableRelation = "Source Code";
- }
- field(34; "Applies-to Doc. Type"; Enum "Gen. Journal Document Type")
- {
- Caption = 'Applies-to Doc. Type';
- }
- field(35; "Applies-to Doc. No."; Code[20])
- {
- Caption = 'Applies-to Doc. No.';
- }
- field(36; Open; Boolean)
- {
- Caption = 'Open';
- ToolTip = 'Specifies whether the amount on the entry has been fully paid or there is still a remaining amount that must be applied to.';
- }
- field(43; Positive; Boolean)
- {
- Caption = 'Positive';
- ToolTip = 'Specifies if the entry to be applied is positive.';
- }
- field(44; "Closed by Entry No."; Integer)
- {
- Caption = 'Closed by Entry No.';
- TableRelation = "Employee Ledger Entry";
- }
- field(45; "Closed at Date"; Date)
- {
- Caption = 'Closed at Date';
- }
- field(46; "Closed by Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Closed by Amount';
- ToolTip = 'Specifies the amount that the entry was finally applied to (closed) with.';
- }
- field(47; "Applies-to ID"; Code[50])
- {
- Caption = 'Applies-to ID';
- ToolTip = 'Specifies the ID of entries that will be applied to when you choose the Apply Entries action.';
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- end;
- }
- field(48; "Journal Templ. Name"; Code[10])
- {
- Caption = 'Journal Template Name';
- DataClassification = SystemMetadata;
- }
- field(49; "Journal Batch Name"; Code[10])
- {
- Caption = 'Journal Batch Name';
- }
- field(50; "Reason Code"; Code[10])
- {
- Caption = 'Reason Code';
- TableRelation = "Reason Code";
- }
- field(51; "Bal. Account Type"; Enum "Gen. Journal Account Type")
- {
- Caption = 'Bal. Account Type';
- ToolTip = 'Specifies the type of balancing account that is used for the entry.';
- }
- field(52; "Bal. Account No."; Code[20])
- {
- Caption = 'Bal. Account No.';
- ToolTip = 'Specifies the number of the balancing account that is used for the entry.';
- TableRelation = if ("Bal. Account Type" = const("G/L Account")) "G/L Account"
- else
- if ("Bal. Account Type" = const(Customer)) Customer
- else
- if ("Bal. Account Type" = const(Vendor)) Vendor
- else
- if ("Bal. Account Type" = const("Bank Account")) "Bank Account"
- else
- if ("Bal. Account Type" = const("Fixed Asset")) "Fixed Asset";
- }
- field(53; "Transaction No."; Integer)
- {
- Caption = 'Transaction No.';
- TableRelation = "G/L Transaction";
- ToolTip = 'Specifies the transaction number that groups related G/L entries from the same posting.';
- }
- field(54; "Closed by Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Closed by Amount (LCY)';
- }
- field(58; "Debit Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- BlankZero = true;
- CalcFormula = sum("Detailed Employee Ledger Entry"."Debit Amount" where("Ledger Entry Amount" = const(true),
- "Employee Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Debit Amount';
- ToolTip = 'Specifies the total of the ledger entries that represent debits.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(59; "Credit Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- BlankZero = true;
- CalcFormula = sum("Detailed Employee Ledger Entry"."Credit Amount" where("Ledger Entry Amount" = const(true),
- "Employee Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Credit Amount';
- ToolTip = 'Specifies the total of the ledger entries that represent credits.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(60; "Debit Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- BlankZero = true;
- CalcFormula = sum("Detailed Employee Ledger Entry"."Debit Amount (LCY)" where("Ledger Entry Amount" = const(true),
- "Employee Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Debit Amount (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(61; "Credit Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- BlankZero = true;
- CalcFormula = sum("Detailed Employee Ledger Entry"."Credit Amount (LCY)" where("Ledger Entry Amount" = const(true),
- "Employee Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Credit Amount (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(64; "No. Series"; Code[20])
- {
- Caption = 'No. Series';
- TableRelation = "No. Series";
- }
- field(65; "Closed by Currency Code"; Code[10])
- {
- Caption = 'Closed by Currency Code';
- ToolTip = 'Specifies the currency code of the entry that was applied to (and closed) this employee ledger entry.';
- TableRelation = Currency;
- }
- field(66; "Closed by Currency Amount"; Decimal)
- {
- AccessByPermission = TableData Currency = R;
- AutoFormatExpression = "Closed by Currency Code";
- AutoFormatType = 1;
- Caption = 'Closed by Currency Amount';
- ToolTip = 'Specifies the amount that was finally applied to (and closed) this employee ledger entry.';
- }
- field(73; "Adjusted Currency Factor"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Adjusted Currency Factor';
- DecimalPlaces = 0 : 15;
- }
- field(74; "Original Currency Factor"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Original Currency Factor';
- DecimalPlaces = 0 : 15;
- }
- field(75; "Original Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Employee Ledger Entry".Amount where("Employee Ledger Entry No." = field("Entry No."),
- "Entry Type" = filter("Initial Entry"),
- "Posting Date" = field("Date Filter")));
- Caption = 'Original Amount';
- ToolTip = 'Specifies the amount of the original entry.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(76; "Date Filter"; Date)
- {
- Caption = 'Date Filter';
- FieldClass = FlowFilter;
- }
- field(84; "Amount to Apply"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Amount to Apply';
- ToolTip = 'Specifies the amount to apply.';
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- CalcFields("Remaining Amount");
-
- if AreOppositeSign("Amount to Apply", "Remaining Amount") then
- FieldError("Amount to Apply", MustHaveSameSignErr);
-
- if Abs("Amount to Apply") > Abs("Remaining Amount") then
- FieldError("Amount to Apply", MustNotBeLargerErr);
- end;
- }
- field(86; "Applying Entry"; Boolean)
- {
- Caption = 'Applying Entry';
- ToolTip = 'Specifies whether the entry will be applied to when you choose the Apply Entries action.';
- }
- field(87; Reversed; Boolean)
- {
- Caption = 'Reversed';
- DataClassification = CustomerContent;
- }
- field(88; "Reversed by Entry No."; Integer)
- {
- BlankZero = true;
- Caption = 'Reversed by Entry No.';
- DataClassification = CustomerContent;
- TableRelation = "Employee Ledger Entry";
- }
- field(89; "Reversed Entry No."; Integer)
- {
- BlankZero = true;
- Caption = 'Reversed Entry No.';
- DataClassification = CustomerContent;
- TableRelation = "Employee Ledger Entry";
- }
- field(95; "G/L Register No."; Integer)
- {
- Caption = 'G/L Register No.';
- Editable = false;
- TableRelation = "G/L Register";
- ToolTip = 'Specifies the G/L register number that groups related G/L entries from the same posting.';
- }
- field(170; "Creditor No."; Code[20])
- {
- Caption = 'Creditor No.';
- }
- field(171; "Payment Reference"; Code[50])
- {
- Caption = 'Payment Reference';
- ToolTip = 'Specifies the payment to the employee.';
- trigger OnValidate()
- begin
- if "Payment Reference" <> '' then
- TestField("Creditor No.");
- end;
- }
- field(172; "Payment Method Code"; Code[10])
- {
- Caption = 'Payment Method Code';
- ToolTip = 'Specifies the payment method that was used to make the payment that resulted in the entry.';
- TableRelation = "Payment Method";
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- end;
- }
- field(289; "Message to Recipient"; Text[140])
- {
- Caption = 'Message to Recipient';
- ToolTip = 'Specifies the message exported to the payment file when you use the Export Payments to File function in the Payment Journal window.';
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- end;
- }
- field(290; "Exported to Payment File"; Boolean)
- {
- Caption = 'Exported to Payment File';
- ToolTip = 'Specifies that the entry was created as a result of exporting a payment journal line.';
- Editable = false;
- }
- field(480; "Dimension Set ID"; Integer)
- {
- Caption = 'Dimension Set ID';
- Editable = false;
- TableRelation = "Dimension Set Entry";
-
- trigger OnLookup()
- begin
- Rec.ShowDimensions();
- end;
- }
- field(481; "Shortcut Dimension 3 Code"; Code[20])
- {
- CaptionClass = '1,2,3';
- Caption = 'Shortcut Dimension 3 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 3, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(3)));
- }
- field(482; "Shortcut Dimension 4 Code"; Code[20])
- {
- CaptionClass = '1,2,4';
- Caption = 'Shortcut Dimension 4 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 4, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(4)));
- }
- field(483; "Shortcut Dimension 5 Code"; Code[20])
- {
- CaptionClass = '1,2,5';
- Caption = 'Shortcut Dimension 5 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 5, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(5)));
- }
- field(484; "Shortcut Dimension 6 Code"; Code[20])
- {
- CaptionClass = '1,2,6';
- Caption = 'Shortcut Dimension 6 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 6, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(6)));
- }
- field(485; "Shortcut Dimension 7 Code"; Code[20])
- {
- CaptionClass = '1,2,7';
- Caption = 'Shortcut Dimension 7 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 7, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(7)));
- }
- field(486; "Shortcut Dimension 8 Code"; Code[20])
- {
- CaptionClass = '1,2,8';
- Caption = 'Shortcut Dimension 8 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 8, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(8)));
- }
- field(11000000; "Transaction Mode Code"; Code[20])
- {
- Caption = 'Transaction Mode Code';
- TableRelation = "Transaction Mode".Code where("Account Type" = const(Employee));
- }
- field(11000002; "Payments in Process"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = Rec."Currency Code";
- BlankZero = true;
- CalcFormula = sum("Detail Line"."Amount (Entry)" where("Serial No. (Entry)" = field("Entry No."),
- Status = const("In process"),
- "Account Type" = const(Employee),
- "Connect Batches" = field("Connect Batches Filter"),
- "Connect Lines" = field("Connect Lines Filter"),
- "Our Bank" = field("Our Bank Filter")));
- Caption = 'Payments in Process';
- Editable = false;
- FieldClass = FlowField;
- }
- field(11000003; "Connect Batches Filter"; Code[20])
- {
- Caption = 'Connect Batches Filter';
- FieldClass = FlowFilter;
- }
- field(11000004; "Connect Lines Filter"; Integer)
- {
- Caption = 'Connect Lines Filter';
- FieldClass = FlowFilter;
- }
- field(11000005; "Our Bank Filter"; Code[20])
- {
- Caption = 'Our Bank Filter';
- FieldClass = FlowFilter;
- }
- }
-
- keys
- {
- key(Key1; "Entry No.")
- {
- Clustered = true;
- }
- key(Key2; "Employee No.", "Applies-to ID", Open, Positive)
- {
- }
- }
-
- fieldgroups
- {
- }
-
- var
- MustHaveSameSignErr: Label 'must have the same sign as remaining amount';
- MustNotBeLargerErr: Label 'must not be larger than remaining amount';
-
- procedure CopyFromGenJnlLine(GenJnlLine: Record "Gen. Journal Line")
- begin
- "Employee No." := GenJnlLine."Account No.";
- "Posting Date" := GenJnlLine."Posting Date";
- "Document Type" := GenJnlLine."Document Type";
- "Document No." := GenJnlLine."Document No.";
- Description := GenJnlLine.Description;
- "Currency Code" := GenJnlLine."Currency Code";
- "Employee Posting Group" := GenJnlLine."Posting Group";
- "Global Dimension 1 Code" := GenJnlLine."Shortcut Dimension 1 Code";
- "Global Dimension 2 Code" := GenJnlLine."Shortcut Dimension 2 Code";
- "Dimension Set ID" := GenJnlLine."Dimension Set ID";
- "Salespers./Purch. Code" := GenJnlLine."Salespers./Purch. Code";
- "Source Code" := GenJnlLine."Source Code";
- "Reason Code" := GenJnlLine."Reason Code";
- "Journal Templ. Name" := GenJnlLine."Journal Template Name";
- "Journal Batch Name" := GenJnlLine."Journal Batch Name";
- "User ID" := CopyStr(UserId(), 1, MaxStrLen("User ID"));
- "Bal. Account Type" := GenJnlLine."Bal. Account Type";
- "Bal. Account No." := GenJnlLine."Bal. Account No.";
- "No. Series" := GenJnlLine."Posting No. Series";
- "Applies-to Doc. Type" := GenJnlLine."Applies-to Doc. Type";
- "Applies-to Doc. No." := GenJnlLine."Applies-to Doc. No.";
- "Applies-to ID" := GenJnlLine."Applies-to ID";
- "Transaction Mode Code" := GenJnlLine."Transaction Mode Code";
-
- OnAfterCopyEmployeeLedgerEntryFromGenJnlLine(Rec, GenJnlLine);
- end;
-
- procedure ShowDimensions()
- var
- DimMgt: Codeunit DimensionManagement;
- begin
- DimMgt.ShowDimensionSet("Dimension Set ID", StrSubstNo('%1 %2', TableCaption(), "Entry No."));
- end;
-
- procedure CopyFromCVLedgEntryBuffer(var CVLedgerEntryBuffer: Record "CV Ledger Entry Buffer")
- begin
- "Entry No." := CVLedgerEntryBuffer."Entry No.";
- "Employee No." := CVLedgerEntryBuffer."CV No.";
- "Posting Date" := CVLedgerEntryBuffer."Posting Date";
- "Document Type" := CVLedgerEntryBuffer."Document Type";
- "Document No." := CVLedgerEntryBuffer."Document No.";
- Description := CVLedgerEntryBuffer.Description;
- "Currency Code" := CVLedgerEntryBuffer."Currency Code";
- "Source Code" := CVLedgerEntryBuffer."Source Code";
- "Reason Code" := CVLedgerEntryBuffer."Reason Code";
- Amount := CVLedgerEntryBuffer.Amount;
- "Remaining Amount" := CVLedgerEntryBuffer."Remaining Amount";
- "Original Amount" := CVLedgerEntryBuffer."Original Amount";
- "Original Amt. (LCY)" := CVLedgerEntryBuffer."Original Amt. (LCY)";
- "Remaining Amt. (LCY)" := CVLedgerEntryBuffer."Remaining Amt. (LCY)";
- "Amount (LCY)" := CVLedgerEntryBuffer."Amount (LCY)";
- "Employee Posting Group" := CVLedgerEntryBuffer."CV Posting Group";
- "Global Dimension 1 Code" := CVLedgerEntryBuffer."Global Dimension 1 Code";
- "Global Dimension 2 Code" := CVLedgerEntryBuffer."Global Dimension 2 Code";
- "Dimension Set ID" := CVLedgerEntryBuffer."Dimension Set ID";
- "Salespers./Purch. Code" := CVLedgerEntryBuffer."Salesperson Code";
- "User ID" := CVLedgerEntryBuffer."User ID";
- "Applies-to Doc. Type" := CVLedgerEntryBuffer."Applies-to Doc. Type";
- "Applies-to Doc. No." := CVLedgerEntryBuffer."Applies-to Doc. No.";
- Open := CVLedgerEntryBuffer.Open;
- Positive := CVLedgerEntryBuffer.Positive;
- "Closed by Entry No." := CVLedgerEntryBuffer."Closed by Entry No.";
- "Closed at Date" := CVLedgerEntryBuffer."Closed at Date";
- "Closed by Amount" := CVLedgerEntryBuffer."Closed by Amount";
- "Applies-to ID" := CVLedgerEntryBuffer."Applies-to ID";
- "Journal Templ. Name" := CVLedgerEntryBuffer."Journal Templ. Name";
- "Journal Batch Name" := CVLedgerEntryBuffer."Journal Batch Name";
- "Bal. Account Type" := CVLedgerEntryBuffer."Bal. Account Type";
- "Bal. Account No." := CVLedgerEntryBuffer."Bal. Account No.";
- "Transaction No." := CVLedgerEntryBuffer."Transaction No.";
- "Closed by Amount (LCY)" := CVLedgerEntryBuffer."Closed by Amount (LCY)";
- "Debit Amount" := CVLedgerEntryBuffer."Debit Amount";
- "Credit Amount" := CVLedgerEntryBuffer."Credit Amount";
- "Debit Amount (LCY)" := CVLedgerEntryBuffer."Debit Amount (LCY)";
- "Credit Amount (LCY)" := CVLedgerEntryBuffer."Credit Amount (LCY)";
- "No. Series" := CVLedgerEntryBuffer."No. Series";
- "Closed by Currency Code" := CVLedgerEntryBuffer."Closed by Currency Code";
- "Closed by Currency Amount" := CVLedgerEntryBuffer."Closed by Currency Amount";
- "Adjusted Currency Factor" := CVLedgerEntryBuffer."Adjusted Currency Factor";
- "Original Currency Factor" := CVLedgerEntryBuffer."Original Currency Factor";
- "Amount to Apply" := CVLedgerEntryBuffer."Amount to Apply";
-
- OnAfterCopyEmplLedgerEntryFromCVLedgEntryBuffer(Rec, CVLedgerEntryBuffer);
- end;
-
- procedure RecalculateAmounts(FromCurrencyCode: Code[10]; ToCurrencyCode: Code[10]; PostingDate: Date)
- var
- CurrExchRate: Record "Currency Exchange Rate";
- begin
- if ToCurrencyCode = FromCurrencyCode then
- exit;
- "Remaining Amount" := CurrExchRate.ExchangeAmount("Remaining Amount", FromCurrencyCode, ToCurrencyCode, PostingDate);
- "Amount to Apply" :=
- CurrExchRate.ExchangeAmount("Amount to Apply", FromCurrencyCode, ToCurrencyCode, PostingDate);
-
- OnAfterRecalculateAmounts(Rec, FromCurrencyCode, ToCurrencyCode, PostingDate);
- end;
-
- local procedure AreOppositeSign(Amount1: Decimal; Amount2: Decimal): Boolean
- var
- Math: Codeunit "Math";
- begin
- if (Amount1 = 0) or (Amount2 = 0) then
- exit(false);
-
- exit(Math.Sign(Amount1) <> Math.Sign(Amount2));
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyEmployeeLedgerEntryFromGenJnlLine(var EmployeeLedgerEntry: Record "Employee Ledger Entry"; GenJournalLine: Record "Gen. Journal Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyEmplLedgerEntryFromCVLedgEntryBuffer(var EmployeeLedgerEntry: Record "Employee Ledger Entry"; CVLedgerEntryBuffer: Record "CV Ledger Entry Buffer")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterRecalculateAmounts(var EmployeeLedgerEntry: Record "Employee Ledger Entry"; FromCurrencyCode: Code[10]; ToCurrencyCode: Code[10]; PostingDate: Date)
- begin
- end;
-}
-
diff --git a/src/Layers/NL/BaseApp/Inventory/Intrastat/IntrastatJnlBatch.Table.al b/src/Layers/NL/BaseApp/Inventory/Intrastat/IntrastatJnlBatch.Table.al
index 94f2cf1776..917a21e222 100644
--- a/src/Layers/NL/BaseApp/Inventory/Intrastat/IntrastatJnlBatch.Table.al
+++ b/src/Layers/NL/BaseApp/Inventory/Intrastat/IntrastatJnlBatch.Table.al
@@ -74,6 +74,4 @@ table 262 "Intrastat Jnl. Batch"
{
}
}
-
-
#endif
diff --git a/src/Layers/NL/BaseApp/Local/Bank/Payment/DetailLine.Table.al b/src/Layers/NL/BaseApp/Local/Bank/Payment/DetailLine.Table.al
index c3401e1af7..d4ee214e5f 100644
--- a/src/Layers/NL/BaseApp/Local/Bank/Payment/DetailLine.Table.al
+++ b/src/Layers/NL/BaseApp/Local/Bank/Payment/DetailLine.Table.al
@@ -66,7 +66,7 @@ table 11000003 "Detail Line"
Description :=
CopyStr(
StrSubstNo(
- Text1000001,
+ Text1000001Lbl,
CustLedgEntry."Document Type",
CustLedgEntry."Document No.",
Cust."Our Account No."), 1, MaxStrLen(Description))
@@ -284,7 +284,7 @@ table 11000003 "Detail Line"
ShowExceedMessage := (Abs(Difference) > Abs(CalculateVariation())) and IsDifferentSign("Remaining Amount", Difference);
OnValidateAmountEntryOnAfterCalcShowExceedMessage(Rec, Difference, "Remaining Amount", ShowExceedMessage);
if ShowExceedMessage then
- Message(Text1000004, DelChr(Format(Abs(Difference)) + ' ' + "Currency Code (Entry)", '<>', ' '));
+ Message(Text1000004Lbl, DelChr(Format(Abs(Difference)) + ' ' + "Currency Code (Entry)", '<>', ' '));
if not AmountValidate then begin
AmountValidate := true;
@@ -353,18 +353,18 @@ table 11000003 "Detail Line"
trigger OnRename()
begin
- Error(Text1000000, TableCaption);
+ Error(Text1000000Err, TableCaption);
end;
var
- Text1000000: Label '%1 cannot be renamed';
- Text1000001: Label '%1 %2 vendor no. %3';
- Text1000002: Label '%1 %2 customer no. %3';
- Text1000004: Label 'The outstanding amount is exceeded by %1.';
CurrencyExchangeRate: Record "Currency Exchange Rate";
- AmountValidate: Boolean;
EntryCurrency: Record Currency;
BankCur: Record Currency;
+ AmountValidate: Boolean;
+ Text1000000Err: Label '%1 cannot be renamed', Comment = '%1 - table caption';
+ Text1000001Lbl: Label '%1 %2 vendor no. %3', Comment = '%1 - table caption, %2 - field caption, %3 - vendor number';
+ Text1000002Lbl: Label '%1 %2 customer no. %3', Comment = '%1 - table caption, %2 - field caption, %3 - customer number';
+ Text1000004Lbl: Label 'The outstanding amount is exceeded by %1.', Comment = '%1 - amount';
AmountSignErr: Label 'The sign does not correspond with the outstanding %1 %2 %3.', Comment = '%1 - table caption, %2 - field caption, %3 - field value';
protected var
@@ -433,7 +433,7 @@ table 11000003 "Detail Line"
Description :=
CopyStr(
StrSubstNo(
- Text1000002,
+ Text1000002Lbl,
VendLedgEntry."Document Type",
VendLedgEntry."External Document No.",
Vendor."Our Account No."), 1, MaxStrLen(Description))
diff --git a/src/Layers/NL/BaseApp/Local/Bank/Payment/GetProposalEntries.Report.al b/src/Layers/NL/BaseApp/Local/Bank/Payment/GetProposalEntries.Report.al
index cd835af9d8..1c9e27d79d 100644
--- a/src/Layers/NL/BaseApp/Local/Bank/Payment/GetProposalEntries.Report.al
+++ b/src/Layers/NL/BaseApp/Local/Bank/Payment/GetProposalEntries.Report.al
@@ -29,7 +29,7 @@ report 11000000 "Get Proposal Entries"
dataitem("Cust. Ledger Entry"; "Cust. Ledger Entry")
{
DataItemLink = "Transaction Mode Code" = field(Code);
- DataItemTableView = sorting(Open, "On Hold", "Transaction Mode Code") where(Open = const(true), "On Hold" = const(''));
+ DataItemTableView = sorting("Transaction Mode Code") where(Open = const(true), "On Hold" = const(''));
RequestFilterFields = "Customer No.", "Recipient Bank Account";
trigger OnAfterGetRecord()
@@ -75,7 +75,7 @@ report 11000000 "Get Proposal Entries"
dataitem("Vendor Ledger Entry"; "Vendor Ledger Entry")
{
DataItemLink = "Transaction Mode Code" = field(Code);
- DataItemTableView = sorting(Open, "On Hold", "Transaction Mode Code") where(Open = const(true), "On Hold" = const(''));
+ DataItemTableView = sorting("Transaction Mode Code") where(Open = const(true), "On Hold" = const(''));
RequestFilterFields = "Vendor No.", "Recipient Bank Account";
trigger OnAfterGetRecord()
@@ -277,16 +277,16 @@ report 11000000 "Get Proposal Entries"
if ProposalLine."Description 1" = '' then
ProposalLine."Description 1" := Text1000015;
if StrLen(ProposalLine."Description 1" + ' ' + UseDocumentNo) < MaxStrLen(ProposalLine."Description 1") then
- ProposalLine."Description 1" := DelChr(ProposalLine."Description 1" + ' ' + UseDocumentNo, '<>')
+ ProposalLine."Description 1" := CopyStr(DelChr(ProposalLine."Description 1" + ' ' + UseDocumentNo, '<>'), 1, MaxStrLen(ProposalLine."Description 1"))
else
if StrLen(ProposalLine."Description 2" + ' ' + UseDocumentNo) < MaxStrLen(ProposalLine."Description 2") then
- ProposalLine."Description 2" := DelChr(ProposalLine."Description 2" + ' ' + UseDocumentNo, '<>')
+ ProposalLine."Description 2" := CopyStr(DelChr(ProposalLine."Description 2" + ' ' + UseDocumentNo, '<>'), 1, MaxStrLen(ProposalLine."Description 2"))
else
if StrLen(ProposalLine."Description 3" + ' ' + UseDocumentNo) < MaxStrLen(ProposalLine."Description 3") then
- ProposalLine."Description 3" := DelChr(ProposalLine."Description 3" + ' ' + UseDocumentNo, '<>')
+ ProposalLine."Description 3" := CopyStr(DelChr(ProposalLine."Description 3" + ' ' + UseDocumentNo, '<>'), 1, MaxStrLen(ProposalLine."Description 3"))
else
if StrLen(ProposalLine."Description 4" + ' ' + UseDocumentNo) < MaxStrLen(ProposalLine."Description 4") then
- ProposalLine."Description 4" := DelChr(ProposalLine."Description 4" + ' ' + UseDocumentNo, '<>')
+ ProposalLine."Description 4" := CopyStr(DelChr(ProposalLine."Description 4" + ' ' + UseDocumentNo, '<>'), 1, MaxStrLen(ProposalLine."Description 4"))
else
ProposalLine.Docket := true;
end;
@@ -295,8 +295,8 @@ report 11000000 "Get Proposal Entries"
if ProposalLine.Identification = '' then begin
TrMode.TestField("Identification No. Series");
- ProposalLine."Identification No. Series" := TrMode."Identification No. Series";
- ProposalLine.Identification := NoSeries.GetNextNo(ProposalLine."Identification No. Series", ProposalLine."Transaction Date");
+ ProposalLine."Identification No. Series" := TrMode."Identification No. Series";
+ ProposalLine.Identification := NoSeries.GetNextNo(ProposalLine."Identification No. Series", ProposalLine."Transaction Date");
end;
ProposalLine."Foreign Currency" := DetailLine."Currency Code (Entry)";
@@ -357,7 +357,7 @@ report 11000000 "Get Proposal Entries"
"Value Date" := PmtDiscExpiryDate;
end;
}
- field(PartnerType; PartnerType)
+ field(PartnerTypeReq; PartnerType)
{
ApplicationArea = Basic, Suite;
Caption = 'Partner Type';
@@ -458,6 +458,24 @@ report 11000000 "Get Proposal Entries"
end;
var
+ DetailLine: Record "Detail Line";
+ ProposalLine: Record "Proposal Line";
+ TrMode: Record "Transaction Mode";
+ CompanyInfo: Record "Company Information";
+ ProcessProposalLines: Codeunit "Process Proposal Lines";
+ NumberOfEntries: Integer;
+ NumeratorPostings: Integer;
+ NumberOfDetailLines: Integer;
+ NumeratorDetailLines: Integer;
+ BatchStatus: Dialog;
+ Found: Boolean;
+ IsHandled: Boolean;
+ NoOfErrors: Integer;
+ NumberOfWarnings: Integer;
+ "Value Date": Date;
+ PmtDiscExpiryDate: Date;
+ PartnerType: Enum "Partner Type";
+
Text1000000: Label 'The currency date cannot be in the past.';
Text1000001: Label 'CRONUS';
Text1000002: Label 'The currency date will be reached in %1 days,';
@@ -476,23 +494,6 @@ report 11000000 "Get Proposal Entries"
Text1000015: Label 'Invoice';
Text1000016: Label 'Collection order, see docket';
Text1000017: Label 'Account No. %1';
- DetailLine: Record "Detail Line";
- ProposalLine: Record "Proposal Line";
- TrMode: Record "Transaction Mode";
- CompanyInfo: Record "Company Information";
- ProcessProposalLines: Codeunit "Process Proposal Lines";
- NumberOfEntries: Integer;
- NumeratorPostings: Integer;
- NumberOfDetailLines: Integer;
- NumeratorDetailLines: Integer;
- BatchStatus: Dialog;
- Found: Boolean;
- IsHandled: Boolean;
- NoOfErrors: Integer;
- NumberOfWarnings: Integer;
- "Value Date": Date;
- PmtDiscExpiryDate: Date;
- PartnerType: Enum "Partner Type";
EmployeeNoMsg: Label 'Employee No. %1', Comment = '%1=Employee number;';
local procedure FillDescription()
@@ -506,24 +507,24 @@ report 11000000 "Get Proposal Entries"
DetailLine."Account Type"::Customer:
begin
Cust.Get(DetailLine."Account No.");
- UpdatePropLineDescription(ProposalLine, Cust."Our Account No.", Text1000017);
+ UpdatePropLineDescription(Cust."Our Account No.", Text1000017);
end;
DetailLine."Account Type"::Vendor:
begin
Vend.Get(DetailLine."Account No.");
- UpdatePropLineDescription(ProposalLine, Vend."Our Account No.", Text1000017);
+ UpdatePropLineDescription(Vend."Our Account No.", Text1000017);
end;
DetailLine."Account Type"::Employee:
begin
Empl.Get(DetailLine."Account No.");
- UpdatePropLineDescription(ProposalLine, Empl."No.", EmployeeNoMsg);
+ UpdatePropLineDescription(Empl."No.", EmployeeNoMsg);
end;
end;
OnAfterFillDescription(ProposalLine, DetailLine);
end;
- local procedure UpdatePropLineDescription(var ProposalLine: Record "Proposal Line"; OurAccountNo: Text[20]; CVDescriptionFormat: Text)
+ local procedure UpdatePropLineDescription(OurAccountNo: Text[20]; CVDescriptionFormat: Text)
begin
if ProposalLine.Docket then begin
if ProposalLine."Description 1" <> Text1000016 then
diff --git a/src/Layers/NL/BaseApp/Local/CRM/RoleCenters/SalesMarketingManagerRCNL.PageExt.al b/src/Layers/NL/BaseApp/Local/CRM/RoleCenters/SalesMarketingManagerRCNL.PageExt.al
new file mode 100644
index 0000000000..b3bbe2eb22
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/CRM/RoleCenters/SalesMarketingManagerRCNL.PageExt.al
@@ -0,0 +1,24 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.CRM.RoleCenters;
+
+using Microsoft.Sales.History;
+
+pageextension 11364 "Sales Marketing Manager RC NL" extends "Sales & Marketing Manager RC"
+{
+ actions
+ {
+ addafter("Credit Memos")
+ {
+ action("CMR - Sales Shipment")
+ {
+ ApplicationArea = Warehouse;
+ Caption = 'CMR - Sales Shipment';
+ RunObject = report "CMR - Sales Shipment";
+ Tooltip = 'Use this report to print a CMR document for a sales shipment. The CMR document is a standard consignment note used in international road transport. It contains information about the sender, recipient, and goods being transported, and serves as a contract of carriage between the parties involved.';
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GenJournalLineNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GenJournalLineNL.Codeunit.al
new file mode 100644
index 0000000000..d5d3441f70
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GenJournalLineNL.Codeunit.al
@@ -0,0 +1,68 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.GeneralLedger.Journal;
+
+using Microsoft.HumanResources.Employee;
+using Microsoft.Purchases.Document;
+using Microsoft.Purchases.Vendor;
+using Microsoft.Sales.Customer;
+using Microsoft.Sales.Document;
+
+codeunit 11384 "Gen. Journal Line NL"
+{
+
+ [EventSubscriber(ObjectType::Table, Database::"Gen. Journal Line", 'OnAfterCopyGenJnlLineFromPurchHeaderPayment', '', false, false)]
+ local procedure OnAfterCopyGenJnlLineFromPurchHeaderPayment(PurchaseHeader: Record "Purchase Header"; var GenJournalLine: Record "Gen. Journal Line")
+ begin
+ GenJournalLine."Transaction Mode Code" := PurchaseHeader."Transaction Mode Code";
+ GenJournalLine."Recipient Bank Account" := PurchaseHeader."Bank Account Code";
+ end;
+
+ [EventSubscriber(ObjectType::Table, Database::"Gen. Journal Line", 'OnAfterCopyGenJnlLineFromSalesHeaderPayment', '', false, false)]
+ local procedure OnAfterCopyGenJnlLineFromSalesHeaderPayment(SalesHeader: Record "Sales Header"; var GenJournalLine: Record "Gen. Journal Line")
+ begin
+ GenJournalLine."Transaction Mode Code" := SalesHeader."Transaction Mode Code";
+ GenJournalLine."Recipient Bank Account" := SalesHeader."Bank Account Code";
+ end;
+
+ [EventSubscriber(ObjectType::Table, Database::"Gen. Journal Line", 'OnAfterAccountNoOnValidateGetCustomerAccount', '', false, false)]
+ local procedure OnAfterAccountNoOnValidateGetCustomerAccount(var GenJournalLine: Record "Gen. Journal Line"; var Customer: Record Customer; CallingFieldNo: Integer)
+ begin
+ GenJournalLine."Transaction Mode Code" := Customer."Transaction Mode Code";
+ end;
+
+ [EventSubscriber(ObjectType::Table, Database::"Gen. Journal Line", 'OnAfterAccountNoOnValidateGetCustomerBalAccount', '', false, false)]
+ local procedure OnAfterAccountNoOnValidateGetCustomerBalAccount(var GenJournalLine: Record "Gen. Journal Line"; var Customer: Record Customer; CallingFieldNo: Integer)
+ begin
+ GenJournalLine."Transaction Mode Code" := Customer."Transaction Mode Code";
+ end;
+
+ [EventSubscriber(ObjectType::Table, Database::"Gen. Journal Line", 'OnAfterAccountNoOnValidateGetVendorAccount', '', false, false)]
+ local procedure OnAfterAccountNoOnValidateGetVendorAccount(var GenJournalLine: Record "Gen. Journal Line"; var Vendor: Record Vendor; CallingFieldNo: Integer)
+ begin
+ GenJournalLine."Transaction Mode Code" := Vendor."Transaction Mode Code";
+ end;
+
+ [EventSubscriber(ObjectType::Table, Database::"Gen. Journal Line", 'OnAfterAccountNoOnValidateGetVendorBalAccount', '', false, false)]
+ local procedure OnAfterAccountNoOnValidateGetVendorBalAccount(var GenJournalLine: Record "Gen. Journal Line"; var Vendor: Record Vendor; CallingFieldNo: Integer)
+ begin
+ GenJournalLine."Transaction Mode Code" := Vendor."Transaction Mode Code";
+ end;
+
+ [EventSubscriber(ObjectType::Table, Database::"Gen. Journal Line", 'OnAfterAccountNoOnValidateGetEmployeeBalAccount', '', false, false)]
+ local procedure OnAfterAccountNoOnValidateGetEmployeeBalAccount(var GenJournalLine: Record "Gen. Journal Line"; var Employee: Record Employee; CallingFieldNo: Integer)
+ begin
+ GenJournalLine.Validate("Recipient Bank Account", Employee."No.");
+ GenJournalLine."Transaction Mode Code" := Employee."Transaction Mode Code";
+ end;
+
+ [EventSubscriber(ObjectType::Table, Database::"Gen. Journal Line", 'OnAfterAccountNoOnValidateGetEmployeeAccount', '', false, false)]
+ local procedure OnAfterAccountNoOnValidateGetEmployeeAccount(var GenJournalLine: Record "Gen. Journal Line"; var Employee: Record Employee)
+ begin
+ GenJournalLine.Validate("Recipient Bank Account", Employee."No.");
+ GenJournalLine."Transaction Mode Code" := Employee."Transaction Mode Code";
+ end;
+
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GenJournalLineNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GenJournalLineNL.TableExt.al
new file mode 100644
index 0000000000..ab3b395c8c
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GenJournalLineNL.TableExt.al
@@ -0,0 +1,65 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.GeneralLedger.Journal;
+
+using Microsoft.Bank.Payment;
+
+tableextension 11384 "Gen. Journal Line NL" extends "Gen. Journal Line"
+{
+ fields
+ {
+ field(11000000; "Transaction Mode Code"; Code[20])
+ {
+ Caption = 'Transaction Mode Code';
+ DataClassification = CustomerContent;
+ TableRelation = if ("Account Type" = const(Customer)) "Transaction Mode".Code where("Account Type" = const(Customer))
+ else
+ if ("Account Type" = const(Vendor)) "Transaction Mode".Code where("Account Type" = const(Vendor))
+ else
+ if ("Account Type" = const(Employee)) "Transaction Mode".Code where("Account Type" = const(Employee))
+ else
+ if ("Bal. Account Type" = const(Customer)) "Transaction Mode".Code where("Account Type" = const(Customer))
+ else
+ if ("Bal. Account Type" = const(Vendor)) "Transaction Mode".Code where("Account Type" = const(Vendor))
+ else
+ if ("Bal. Account Type" = const(Employee)) "Transaction Mode".Code where("Account Type" = const(Employee));
+
+ trigger OnValidate()
+ var
+ TrMode: Record "Transaction Mode";
+ begin
+ if "Transaction Mode Code" <> '' then begin
+ case "Account Type" of
+ "Account Type"::Customer:
+ TrMode.Get(TrMode."Account Type"::Customer, "Transaction Mode Code");
+ "Account Type"::Vendor:
+ TrMode.Get(TrMode."Account Type"::Vendor, "Transaction Mode Code");
+ "Account Type"::Employee:
+ TrMode.Get(TrMode."Account Type"::Employee, "Transaction Mode Code");
+ else
+ case "Bal. Account Type" of
+ "Bal. Account Type"::Customer:
+ TrMode.Get(TrMode."Account Type"::Customer, "Transaction Mode Code");
+ "Bal. Account Type"::Vendor:
+ TrMode.Get(TrMode."Account Type"::Vendor, "Transaction Mode Code");
+ "Bal. Account Type"::Employee:
+ TrMode.Get(TrMode."Account Type"::Employee, "Transaction Mode Code");
+ else
+ Error(
+ Text1000000, FieldCaption("Transaction Mode Code"), FieldCaption("Account Type"), FieldCaption("Bal. Account Type"));
+ end;
+ end;
+
+ if TrMode."Payment Terms Code" <> '' then
+ Validate("Payment Terms Code", TrMode."Payment Terms Code");
+ end;
+ end;
+ }
+ }
+
+ var
+ Text1000000: Label '%1 can only be filled in when %2 %3 is equal to Customer or Vendor.';
+}
+
diff --git a/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GenJournalTemplateNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GenJournalTemplateNL.Codeunit.al
new file mode 100644
index 0000000000..da5d4db07f
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GenJournalTemplateNL.Codeunit.al
@@ -0,0 +1,36 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.GeneralLedger.Journal;
+
+using Microsoft.Bank.Journal;
+using Microsoft.Bank.Statement;
+using Microsoft.Foundation.AuditCodes;
+
+codeunit 11340 "Gen. Journal Template NL"
+{
+ [EventSubscriber(ObjectType::Table, Database::"Gen. Journal Template", OnAfterValidateType, '', false, false)]
+ local procedure OnAfterValidateType(var GenJournalTemplate: Record "Gen. Journal Template"; SourceCodeSetup: Record "Source Code Setup")
+ begin
+ if GenJournalTemplate.Recurring then
+ exit;
+
+ case GenJournalTemplate.Type of
+ GenJournalTemplate.Type::Cash:
+ begin
+ GenJournalTemplate."Source Code" := SourceCodeSetup."Cash Journal";
+ GenJournalTemplate."Page ID" := PAGE::"Cash Journal";
+ GenJournalTemplate."Posting Report ID" := REPORT::"CBG Posting - Test";
+ GenJournalTemplate."Test Report ID" := REPORT::"CBG Posting - Test";
+ end;
+ GenJournalTemplate.Type::Bank:
+ begin
+ GenJournalTemplate."Source Code" := SourceCodeSetup."Bank Journal";
+ GenJournalTemplate."Page ID" := PAGE::"Bank/Giro Journal";
+ GenJournalTemplate."Posting Report ID" := REPORT::"CBG Posting - Test";
+ GenJournalTemplate."Test Report ID" := REPORT::"CBG Posting - Test";
+ end;
+ end;
+ end;
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GenJournalTemplateNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GenJournalTemplateNL.TableExt.al
new file mode 100644
index 0000000000..9fa46bd13c
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GenJournalTemplateNL.TableExt.al
@@ -0,0 +1,22 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.GeneralLedger.Journal;
+
+using Microsoft.Bank.Statement;
+
+tableextension 11383 "Gen. Journal Template NL" extends "Gen. Journal Template"
+{
+ fields
+ {
+ field(11402; "No. of CBG Statements"; Integer)
+ {
+ CalcFormula = count("CBG Statement" where("Journal Template Name" = field(Name)));
+ Caption = 'No. of CBG Statements';
+ Editable = false;
+ FieldClass = FlowField;
+ }
+ }
+}
+
diff --git a/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GenJournalTemplateTypeNL.EnumExt.al b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GenJournalTemplateTypeNL.EnumExt.al
new file mode 100644
index 0000000000..04dcd38e54
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GenJournalTemplateTypeNL.EnumExt.al
@@ -0,0 +1,17 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.GeneralLedger.Journal;
+
+enumextension 11389 "Gen. Journal Template Type NL" extends "Gen. Journal Template Type"
+{
+ value(11; Cash)
+ {
+ Caption = 'Cash';
+ }
+ value(12; Bank)
+ {
+ Caption = 'Bank';
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GeneralJournalNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GeneralJournalNL.PageExt.al
new file mode 100644
index 0000000000..b1ca8a3587
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/GeneralJournalNL.PageExt.al
@@ -0,0 +1,25 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.GeneralLedger.Journal;
+
+pageextension 11360 "General Journal NL" extends "General Journal"
+{
+ layout
+ {
+ addafter("Reason Code")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the transaction mode used in telebanking.';
+ }
+ field("Recipient Bank Account"; Rec."Recipient Bank Account")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the bank account that the amount will be transferred to after it has been exported from the payment journal.';
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/PostedGenJournalLineNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/PostedGenJournalLineNL.TableExt.al
new file mode 100644
index 0000000000..4462a78522
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Journal/PostedGenJournalLineNL.TableExt.al
@@ -0,0 +1,31 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.GeneralLedger.Journal;
+
+using Microsoft.Bank.Payment;
+
+tableextension 11387 "Posted Gen. Journal Line NL" extends "Posted Gen. Journal Line"
+{
+ fields
+ {
+ field(11000000; "Transaction Mode Code"; Code[20])
+ {
+ Caption = 'Transaction Mode Code';
+ DataClassification = CustomerContent;
+ TableRelation = if ("Account Type" = const(Customer)) "Transaction Mode".Code where("Account Type" = const(Customer))
+ else
+ if ("Account Type" = const(Vendor)) "Transaction Mode".Code where("Account Type" = const(Vendor))
+ else
+ if ("Account Type" = const(Employee)) "Transaction Mode".Code where("Account Type" = const(Employee))
+ else
+ if ("Bal. Account Type" = const(Customer)) "Transaction Mode".Code where("Account Type" = const(Customer))
+ else
+ if ("Bal. Account Type" = const(Vendor)) "Transaction Mode".Code where("Account Type" = const(Vendor))
+ else
+ if ("Bal. Account Type" = const(Employee)) "Transaction Mode".Code where("Account Type" = const(Employee));
+ }
+ }
+}
+
diff --git a/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Ledger/GLEntryNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Ledger/GLEntryNL.Codeunit.al
new file mode 100644
index 0000000000..52cd97c248
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Ledger/GLEntryNL.Codeunit.al
@@ -0,0 +1,16 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.GeneralLedger.Ledger;
+
+codeunit 11382 "G/L Entry NL"
+{
+
+ [EventSubscriber(ObjectType::Table, Database::"G/L Entry", OnAfterUpdateDebitCredit, '', false, false)]
+ local procedure OnAfterUpdateDebitCredit(var GLEntry: Record "G/L Entry"; Correction: Boolean)
+ begin
+ if GLEntry.Open then
+ GLEntry."Remaining Amount" := GLEntry.Amount;
+ end;
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Ledger/GLEntryNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Ledger/GLEntryNL.TableExt.al
new file mode 100644
index 0000000000..605b49d140
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Ledger/GLEntryNL.TableExt.al
@@ -0,0 +1,55 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.GeneralLedger.Ledger;
+
+tableextension 11382 "G/L Entry NL" extends "G/L Entry"
+{
+ fields
+ {
+ field(11301; Open; Boolean)
+ {
+ Caption = 'Open';
+ DataClassification = CustomerContent;
+ InitValue = true;
+ }
+ field(11302; "Remaining Amount"; Decimal)
+ {
+ AutoFormatExpression = '';
+ AutoFormatType = 1;
+ Caption = 'Remaining Amount';
+ DataClassification = CustomerContent;
+ }
+ field(11303; "Closed by Entry No."; Integer)
+ {
+ Caption = 'Closed by Entry No.';
+ DataClassification = CustomerContent;
+ }
+ field(11304; "Closed at Date"; Date)
+ {
+ Caption = 'Closed at Date';
+ DataClassification = CustomerContent;
+ }
+ field(11305; "Closed by Amount"; Decimal)
+ {
+ AutoFormatExpression = '';
+ AutoFormatType = 1;
+ Caption = 'Closed by Amount';
+ DataClassification = CustomerContent;
+ }
+ field(11306; "Applies-to ID"; Code[50])
+ {
+ Caption = 'Applies-to ID';
+ DataClassification = CustomerContent;
+ }
+ }
+
+ keys
+ {
+ key(Key14; "Closed by Entry No.")
+ {
+ }
+ }
+}
+
diff --git a/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Ledger/GeneralLedgerEntriesNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Ledger/GeneralLedgerEntriesNL.PageExt.al
new file mode 100644
index 0000000000..a83224c865
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Ledger/GeneralLedgerEntriesNL.PageExt.al
@@ -0,0 +1,32 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.GeneralLedger.Ledger;
+
+pageextension 11363 "General Ledger Entries NL" extends "General Ledger Entries"
+{
+ layout
+ {
+ addafter(NonDeductibleVATAmount)
+ {
+ field("Remaining Amount"; Rec."Remaining Amount")
+ {
+ ApplicationArea = Basic, Suite;
+ Editable = false;
+ ToolTip = 'Specifies the amount that remains to be applied to before the entry is fully applied.';
+ Visible = false;
+ }
+ }
+ addafter("Transaction No.")
+ {
+ field(Open; Rec.Open)
+ {
+ ApplicationArea = Basic, Suite;
+ Editable = false;
+ ToolTip = 'Specifies if the general ledger entry is open.';
+ Visible = false;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Setup/GeneralLedgerSetupNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Setup/GeneralLedgerSetupNL.PageExt.al
new file mode 100644
index 0000000000..ef5069f15d
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Setup/GeneralLedgerSetupNL.PageExt.al
@@ -0,0 +1,38 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.GeneralLedger.Setup;
+
+pageextension 11386 "General Ledger Setup NL" extends "General Ledger Setup"
+{
+ layout
+ {
+ addafter(SEPAExportWoBankAccData)
+ {
+ field("Local SEPA Instr. Priority"; Rec."Local SEPA Instr. Priority")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies if you want to use the local SEPA functionality to generate the InstrPrty XML element in documents. Otherwise, the generic functionality will be used';
+ }
+ }
+ addafter(Application)
+ {
+ group(Telebanking)
+ {
+ Caption = 'Telebanking';
+ field("Local Currency"; Rec."Local Currency")
+ {
+ ApplicationArea = BasicEU;
+ ToolTip = 'Specifies whether Euro currency is used as the local currency (LCY).';
+ }
+ field("Currency Euro"; Rec."Currency Euro")
+ {
+ ApplicationArea = BasicEU;
+ ToolTip = 'Specifies what currency in the Currency table represents the Euro currency.';
+ }
+ }
+ }
+ }
+}
+
diff --git a/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Setup/GeneralLedgerSetupNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Setup/GeneralLedgerSetupNL.TableExt.al
new file mode 100644
index 0000000000..fce0762893
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/GeneralLedger/Setup/GeneralLedgerSetupNL.TableExt.al
@@ -0,0 +1,63 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.GeneralLedger.Setup;
+
+using Microsoft.Finance.Currency;
+
+tableextension 11385 "General Ledger Setup NL" extends "General Ledger Setup"
+{
+ fields
+ {
+ field(11400; "Local SEPA Instr. Priority"; Boolean)
+ {
+ Caption = 'Local SEPA Instr. Priority';
+ DataClassification = CustomerContent;
+ InitValue = true;
+ }
+#if not CLEANSCHEMA28
+ field(11401; "Use New Apply G/L Entries Page"; Boolean)
+ {
+ Caption = 'Use New Apply G/L Entries Page';
+ DataClassification = CustomerContent;
+ ObsoleteReason = 'New page 11310 will unconditionally replace the old 11309.';
+ ObsoleteTag = '22.0';
+ ObsoleteState = Removed;
+ }
+#endif
+ field(11000000; "Local Currency"; Option)
+ {
+ Caption = 'Local Currency';
+ DataClassification = CustomerContent;
+ OptionCaption = ',Euro,Other';
+ OptionMembers = ,Euro,Other;
+
+ trigger OnValidate()
+ begin
+ if "Local Currency" = "Local Currency"::Euro then
+ "Currency Euro" := '';
+ end;
+ }
+ field(11000002; "Currency Euro"; Code[10])
+ {
+ Caption = 'Currency Euro';
+ DataClassification = CustomerContent;
+ TableRelation = Currency;
+
+ trigger OnValidate()
+ begin
+ if "Local Currency" = "Local Currency"::Euro then
+ Error(
+ Text1000001,
+ FieldCaption("Currency Euro"),
+ FieldCaption("Local Currency"),
+ "Local Currency");
+ end;
+ }
+ }
+
+ var
+ Text1000001: Label 'It is not allowed to specify %1 when %2 is %3.';
+}
+
diff --git a/src/Layers/NL/BaseApp/Local/Finance/RoleCenters/AccPayablesCoordRCNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Finance/RoleCenters/AccPayablesCoordRCNL.PageExt.al
new file mode 100644
index 0000000000..b78286fd1d
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/RoleCenters/AccPayablesCoordRCNL.PageExt.al
@@ -0,0 +1,69 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.RoleCenters;
+
+using Microsoft.Bank.Journal;
+using Microsoft.Bank.Payment;
+using Microsoft.Finance.GeneralLedger.Journal;
+
+pageextension 11356 "Acc. Payables Coord. RC NL" extends "Acc. Payables Coordinator RC"
+{
+ actions
+ {
+ addafter(Items)
+ {
+ action(Telebanking)
+ {
+ ApplicationArea = Advanced;
+ Caption = 'Telebanking';
+ RunObject = Page "Telebank - Bank Overview";
+ ToolTip = 'Prepare to exchange your payments to vendors and collections from customers with your bank electronically. This includes the export of payment and collection data that need to be forwarded to the bank as well as the import of bank statements sent to you by the bank.';
+ }
+ action("Telebank - Bank Overview")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Telebank - Bank Overview';
+ RunObject = Page "Telebank - Bank Overview";
+ ToolTip = 'View a list of bank accounts that are set up for electronic bank file transfers.';
+ }
+ }
+ addafter(GeneralJournals)
+ {
+ action("Bank/Giro Journals")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Bank/Giro Journals';
+ RunObject = Page "Bank/Giro Journal List";
+ RunPageView = where(Type = const("Bank/Giro"));
+ ToolTip = 'Reconcile a bank account by comparing incoming and outgoing bank transactions to a physical bank statement or by importing an electronic bank statement file, and apply the related payments to open customer or vendor documents.';
+ }
+ action("Cash Journals")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Cash Journals';
+ RunObject = Page "Cash Journal List";
+ RunPageView = where(Type = const(Cash));
+ ToolTip = 'Post transactions to the cash account in the general ledger.';
+ }
+ }
+ addafter(VendorPayments)
+ {
+ action("Bank/Giro Journal")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Bank/Giro Journal';
+ RunObject = Page "Bank/Giro Journal List";
+ ToolTip = 'Reconcile a bank account by comparing incoming and outgoing bank transactions to a physical bank statement or by importing an electronic bank statement file, and apply the related payments to open customer or vendor documents.';
+ }
+ action("Cash Journal")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Cash Journal';
+ RunObject = Page "Cash Journal List";
+ ToolTip = 'Post transactions to the cash account in the general ledger.';
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/Finance/RoleCenters/AccReceivablesAdmRCNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Finance/RoleCenters/AccReceivablesAdmRCNL.PageExt.al
new file mode 100644
index 0000000000..566696a39c
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/RoleCenters/AccReceivablesAdmRCNL.PageExt.al
@@ -0,0 +1,34 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.RoleCenters;
+
+using Microsoft.Bank.Journal;
+using Microsoft.Finance.GeneralLedger.Journal;
+
+pageextension 11357 "Acc. Receivables Adm. RC NL" extends "Acc. Receivables Adm. RC"
+{
+ actions
+ {
+ addafter(GeneralJournals)
+ {
+ action("Bank/Giro Journals")
+ {
+ ApplicationArea = Advanced;
+ Caption = 'Bank/Giro Journals';
+ RunObject = Page "Bank/Giro Journal List";
+ RunPageView = where(Type = const("Bank/Giro"));
+ ToolTip = 'Reconcile a bank account by comparing incoming and outgoing bank transactions to a physical bank statement or by importing an electronic bank statement file, and apply the related payments to open customer or vendor documents.';
+ }
+ action("Cash Journals")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Cash Journals';
+ RunObject = Page "Cash Journal List";
+ RunPageView = where(Type = const(Cash));
+ ToolTip = 'Post transactions to the cash account in the general ledger.';
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/Finance/RoleCenters/AccountingManagerRCNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Finance/RoleCenters/AccountingManagerRCNL.PageExt.al
new file mode 100644
index 0000000000..8e0334cde3
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/RoleCenters/AccountingManagerRCNL.PageExt.al
@@ -0,0 +1,140 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.RoleCenters;
+
+using Microsoft.Bank.Journal;
+using Microsoft.Bank.Payment;
+using Microsoft.Bank.Reconciliation;
+using Microsoft.Finance.GeneralLedger.Journal;
+using Microsoft.Finance.VAT.Reporting;
+
+pageextension 11355 "Accounting Manager RC NL" extends "Accounting Manager Role Center"
+{
+ actions
+ {
+ addafter("Finance Charge Memos")
+ {
+ action(Telebanking)
+ {
+ ApplicationArea = Advanced;
+ Caption = 'Telebanking';
+ RunObject = Page "Telebank - Bank Overview";
+ ToolTip = 'Prepare to exchange your payments to vendors and collections from customers with your bank electronically. This includes the export of payment and collection data that need to be forwarded to the bank as well as the import of bank statements sent to you by the bank.';
+ }
+ action("Telebank - Bank Overview")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Telebank - Bank Overview';
+ RunObject = Page "Telebank - Bank Overview";
+ ToolTip = 'View a list of bank accounts that are set up for electronic bank file transfers.';
+ }
+ }
+ addafter(GeneralJournals)
+ {
+ action("Bank/Giro Journals")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Bank/Giro Journals';
+ RunObject = Page "Bank/Giro Journal List";
+ RunPageView = where(Type = const("Bank/Giro"));
+ ToolTip = 'Reconcile a bank account by comparing incoming and outgoing bank transactions to a physical bank statement or by importing an electronic bank statement file, and apply the related payments to open customer or vendor documents.';
+ }
+ action("Cash Journals")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Cash Journals';
+ RunObject = Page "Cash Journal List";
+ RunPageView = where(Type = const(Cash));
+ ToolTip = 'Post transactions to the cash account in the general ledger.';
+ }
+ }
+ addafter("Bank Account Posting Groups")
+ {
+ action("Elec. Tax Decl. VAT Categories")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Elec. Tax Decl. VAT Categories';
+ RunObject = Page "Elec. Tax Decl. VAT Categ.";
+ ToolTip = 'Set up all the possible combinations of categories and sub categories that represent a XML element in the electronic VAT declaration. A combination is defined by a code. By entering this code in the Elec. Tax Decl. Category Code field on a VAT statement line, you map the data of the VAT statement directly to a XML element.';
+ }
+ action("Transaction Modes")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Transaction Modes';
+ RunObject = Page "Transaction Mode List";
+ ToolTip = 'View or edit the transaction modes that are used for telebanking to manage how an order, invoice, or credit memo for a vendor or customer will be paid for or collected.';
+ }
+ action("Export Telebanking Protocols")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Export Telebanking Protocols';
+ RunObject = Page "Export Protocols";
+ ToolTip = 'Set up codes for each set of export protocols to be used when exporting a payment history for processing by the bank.';
+ }
+ action("Import Telebanking Protocols")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Import Telebanking Protocols';
+ RunObject = Page "Import Protocols";
+ ToolTip = 'Set up codes for each set of import protocols to be used when importing bank statements.';
+ }
+ action("Freely Transferable Maximums")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Freely Transferable Maximums';
+ RunObject = Page "Freely Transferable Maximums";
+ ToolTip = 'Set up freely transferable maximums that denote the maximum amount, for a specific currency, that can be transferred in one payment from one country to another without reason given.';
+ }
+ }
+ addafter("Import Co&nsolidation from Database")
+ {
+ action("Import Bank Statement")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Import Bank Statement';
+ RunObject = Codeunit "Import Protocol Management";
+ ToolTip = 'Prepare to reconcile the bank account by importing an electronic bank statement with the actual bank transactions.';
+ }
+ }
+ addafter("P&ost Inventory Cost to G/L")
+ {
+ action("Tax Authority - Audit File")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Tax Authority - Audit File';
+ Image = "Report";
+ RunObject = Report "Tax Authority - Audit File";
+ ToolTip = 'Create an audit file that contains all journal transactions from the general ledger. During a tax audit, this file is imported from the tax authority for additional analysis.';
+ }
+ }
+ addafter("Calc. and Pos&t VAT Settlement")
+ {
+ action("Elec. Tax Declarations")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Elec. Tax Declarations';
+ RunObject = Page "Elec. Tax Declaration List";
+ ToolTip = 'View the list of VAT and ICP declarations that you send to the tax authorities.';
+ }
+ action("Elec. Tax Decl. Response Msgs.")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Elec. Tax Decl. Response Msgs.';
+ RunObject = Page "Elec. Tax Decl. Response Msgs.";
+ ToolTip = 'View all the response messages received from the tax authorities. The status of the response message indicates if the message is processed or not.';
+ }
+ }
+ addafter("General &Ledger Setup")
+ {
+ action("Elec. Tax Declaration Setup")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Elec. Tax Declaration Setup';
+ RunObject = Page "Elec. Tax Declaration Setup";
+ ToolTip = 'Set up the information that will be used to generate an electronic VAT and ICP declaration, such as the Digipoort configuration. ';
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/Finance/RoleCenters/BookkeeperRCNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Finance/RoleCenters/BookkeeperRCNL.PageExt.al
new file mode 100644
index 0000000000..1e5def493c
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/RoleCenters/BookkeeperRCNL.PageExt.al
@@ -0,0 +1,89 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.RoleCenters;
+
+using Microsoft.Bank.Journal;
+using Microsoft.Bank.Payment;
+using Microsoft.Bank.Reconciliation;
+using Microsoft.Finance.GeneralLedger.Journal;
+using Microsoft.Finance.VAT.Reporting;
+
+pageextension 11358 "Bookkeeper RC NL" extends "Bookkeeper Role Center"
+{
+ actions
+ {
+ addafter("Sales Orders")
+ {
+ action(Telebanking)
+ {
+ ApplicationArea = Advanced;
+ Caption = 'Telebanking';
+ RunObject = Page "Telebank - Bank Overview";
+ ToolTip = 'Prepare to exchange your payments to vendors and collections from customers with your bank electronically. This includes the export of payment and collection data that need to be forwarded to the bank as well as the import of bank statements sent to you by the bank.';
+ }
+ action("Telebank - Bank Overview")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Telebank - Bank Overview';
+ RunObject = Page "Telebank - Bank Overview";
+ ToolTip = 'View a list of bank accounts that are set up for electronic bank file transfers.';
+ }
+ }
+ addafter(GeneralJournals)
+ {
+ action("Bank/Giro Journals")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Bank/Giro Journals';
+ RunObject = Page "Bank/Giro Journal List";
+ RunPageView = where(Type = const("Bank/Giro"));
+ ToolTip = 'Reconcile a bank account by comparing incoming and outgoing bank transactions to a physical bank statement or by importing an electronic bank statement file, and apply the related payments to open customer or vendor documents.';
+ }
+ action("Cash Journals")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Cash Journals';
+ RunObject = Page "Cash Journal List";
+ RunPageView = where(Type = const(Cash));
+ ToolTip = 'Post transactions to the cash account in the general ledger.';
+ }
+ }
+ addafter("B&ank Account Reconciliations")
+ {
+ action("Import Bank Statement")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Import Bank Statement';
+ RunObject = Codeunit "Import Protocol Management";
+ ToolTip = 'Prepare to reconcile the bank account by importing an electronic bank statement with the actual bank transactions.';
+ }
+ }
+ addafter("Calc. and Pos&t VAT Settlement")
+ {
+ action("Elec. Tax Declarations")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Elec. Tax Declarations';
+ RunObject = Page "Elec. Tax Declaration List";
+ ToolTip = 'View the list of VAT and ICP declarations that you send to the tax authorities.';
+ }
+ action("Elec. Tax Decl. Response Msgs.")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Elec. Tax Decl. Response Msgs.';
+ RunObject = Page "Elec. Tax Decl. Response Msgs.";
+ ToolTip = 'View all the response messages received from the tax authorities. The status of the response message indicates if the message is processed or not.';
+ }
+ action("Tax Authority - Audit File")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Tax Authority - Audit File';
+ Image = "Report";
+ RunObject = Report "Tax Authority - Audit File";
+ ToolTip = 'Create an audit file that contains all journal transactions from the general ledger. During a tax audit, this file is imported from the tax authority for additional analysis.';
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/Finance/RoleCenters/FinanceManagerRCNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Finance/RoleCenters/FinanceManagerRCNL.PageExt.al
new file mode 100644
index 0000000000..d26dddb1ff
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/RoleCenters/FinanceManagerRCNL.PageExt.al
@@ -0,0 +1,121 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.RoleCenters;
+
+using Microsoft.Bank.Journal;
+using Microsoft.Bank.Payment;
+using Microsoft.Bank.Reconciliation;
+using Microsoft.Finance.GeneralLedger.Journal;
+using Microsoft.Finance.GeneralLedger.Reports;
+using Microsoft.Finance.VAT.Reporting;
+
+pageextension 11359 "Finance Manager RC NL" extends "Finance Manager Role Center"
+{
+ actions
+ {
+ addafter("Account Schedules")
+ {
+ action("Bank/Giro Journal")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Bank/Giro Journal';
+ RunObject = page "Bank/Giro Journal List";
+ }
+ action("Cash Journal")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Cash Journal';
+ RunObject = page "Cash Journal List";
+ }
+ action("Telebank - Bank Overview")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Telebank - Bank Overview';
+ RunObject = page "Telebank - Bank Overview";
+ }
+ }
+ addafter(Group1)
+ {
+ group("Group64")
+ {
+ Caption = 'Elec. Tax Declaration';
+ action("Elec. Tax Declarations")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Elec. Tax Declarations';
+ RunObject = page "Elec. Tax Declaration List";
+ }
+ action("Elec. Tax Decl. Response Msgs.")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Elec. Tax Decl. Response Msgs.';
+ RunObject = page "Elec. Tax Decl. Response Msgs.";
+ }
+ }
+ }
+ addafter("Foreign Currency Balance")
+ {
+ action("Tax Authority - Audit File")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Tax Authority - Audit File';
+ RunObject = report "Tax Authority - Audit File";
+ }
+ action("NL Export Financial Data to XM")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'NL Export Financial Data to XML';
+ RunObject = report "Export Financial Data to XML";
+ }
+ }
+ addafter("VAT Report Setup")
+ {
+ group("Group62")
+ {
+ Caption = 'Elec. Tax Declaration';
+ action("Elec. Tax Declaration Setup")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Elec. Tax Declaration Setup';
+ RunObject = page "Elec. Tax Declaration Setup";
+ }
+ action("Elec. Tax Decl. VAT Categories")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Elec. Tax Decl. VAT Categories';
+ RunObject = page "Elec. Tax Decl. VAT Categ.";
+ }
+ }
+ group("Group63")
+ {
+ Caption = 'Telebanking';
+ action("Transaction Modes")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Transaction Modes';
+ RunObject = page "Transaction Mode List";
+ }
+ action("Export Protocols")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Export Protocols';
+ RunObject = page "Export Protocols";
+ }
+ action("Import Protocols")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Import Protocols';
+ RunObject = page "Import Protocols";
+ }
+ action("Freely Transferable Maximums")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Freely Transferable Maximums';
+ RunObject = page "Freely Transferable Maximums";
+ }
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Finance/VAT/Registration/VATRegNoFormatNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Finance/VAT/Registration/VATRegNoFormatNL.Codeunit.al
new file mode 100644
index 0000000000..a84555e449
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/VAT/Registration/VATRegNoFormatNL.Codeunit.al
@@ -0,0 +1,144 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.VAT.Registration;
+
+using Microsoft.Foundation.Company;
+using System.Reflection;
+
+///
+/// Defines country-specific VAT registration number formats for validation and duplicate checking.
+/// Provides pattern matching capabilities and business rules enforcement for VAT numbers across different jurisdictions.
+///
+codeunit 13381 "VAT Reg. No. Format NL"
+{
+ [EventSubscriber(ObjectType::Table, Database::"VAT Registration No. Format", OnBeforeCheckCompanyInfo, '', false, false)]
+ local procedure OnBeforeCheckCompanyInfo(VATRegNo: Text[20]; var IsHandled: Boolean)
+ var
+ CompanyInformation: Record "Company Information";
+ Mod11ErrorText: Text;
+ Mod97ErrorText: Text;
+ Number: Integer;
+ begin
+ if not CompanyInformation.Get() then
+ exit;
+
+ if UpperCase(CopyStr(VATRegNo, 1, 2)) <> 'NL' then
+ if CompanyInformation."Country/Region Code" <> 'NL' then
+ exit // Not an NL VAT Registration No.
+ else
+ if not Evaluate(Number, CopyStr(VATRegNo, 1, 2)) then
+ exit; // Not an NL VAT Registration No.
+
+ // last two chars must be digits
+ Number := 0;
+ if not Evaluate(Number, CopyStr(VATRegNo, StrLen(VATRegNo) - 1)) then
+ Error(SummaryTwoErr, VATRegNoFormatErr, VATRegNoLastTwoCharsErr);
+ if Number = 0 then
+ Error(SummaryTwoErr, VATRegNoFormatErr, VATRegNoLastTwoCharsErr);
+
+ Mod11ErrorText := ValidateVATMod11Algorithm(VATRegNo);
+ Mod97ErrorText := ValidateVATMod97Algorithm(VATRegNo);
+ if (Mod11ErrorText <> '') and (Mod97ErrorText <> '') then
+ Error(SummaryThreeErr, VATRegNoFormatErr, Mod11ErrorText, Mod97ErrorText);
+
+ IsHandled := true;
+ end;
+
+ local procedure ValidateVATMod11Algorithm(VATRegNo: Text[20]): Text;
+ var
+ TypeHelper: Codeunit "Type Helper";
+ i: Integer;
+ Digit: Integer;
+ Weight: Integer;
+ Total: Integer;
+ begin
+ if UpperCase(CopyStr(VATRegNo, 1, 2)) = 'NL' then
+ VATRegNo := DelStr(VATRegNo, 1, 2);
+
+ if CopyStr(VATRegNo, 1, 3) = '000' then
+ exit(VATRegNoShouldNotStartWithErr);
+
+ for i := 1 to 8 do begin
+ if TypeHelper.IsDigit(VATRegNo[i]) then
+ Evaluate(Digit, Format(VATRegNo[i]))
+ else
+ exit(VATMod11NotAllowedCharErr);
+ Weight := 10 - i;
+ Total := Total + Digit * Weight;
+ end;
+
+ if TypeHelper.IsDigit(VATRegNo[9]) then
+ Evaluate(Digit, Format(VATRegNo[9]))
+ else
+ exit(VATMod11NotAllowedCharErr);
+ Total := Total mod 11;
+
+ if Digit <> Total then
+ exit(VATMod11Err);
+ end;
+
+ local procedure ValidateVATMod97Algorithm(VATRegNo: Text[20]): Text
+ var
+ TypeHelper: Codeunit "Type Helper";
+ VATDigitTextBuilder: TextBuilder;
+ VATDigitString: Text;
+ CurrChar: Char;
+ CurrNumber: Integer;
+ Remainder: Integer;
+ i: Integer;
+ begin
+ // Valid from January 1, 2020 for natural persons who are VAT entrepreneurs.
+ // Positions 1-2 must be NL, positions 13-14 must be digits. Positions 3-12 can contain digits, uppercase letters, '+' and '*'.
+ // Each letter is replaced by two-digit number, where 'A' = 10, 'B' = 11, ..., 'Z' = 35; '+' = 36, '*' = 37.
+ // Remainder of division the converted VAT number by 97 must be equal to 1.
+ // Example: NL123456789B13 is converted to 2321 123456789 11 13, i.e. to 23211234567891113 integer number. 23211234567891113 mod 97 = 1, it is a valid VAT number.
+ if CopyStr(VATRegNo, 1, 2) <> 'NL' then
+ exit(VATFirstTwoCharsErr);
+
+ if StrLen(VATRegNo) <> 14 then
+ exit(VATLengthErr);
+
+ for i := 1 to StrLen(VATRegNo) do begin
+ CurrChar := VATRegNo[i];
+ case true of
+ TypeHelper.IsDigit(CurrChar):
+ CurrNumber := CurrChar - '0'; // convert char digit to int, '1' -> 1 etc.
+ TypeHelper.IsUpper(CurrChar):
+ CurrNumber := CurrChar - 55; // convert uppercase letter to int, 'A' -> 10 etc.
+ CurrChar = '+':
+ CurrNumber := 36; // special case for '+' and '*'
+ CurrChar = '*':
+ CurrNumber := 37;
+ else
+ exit(VATMod97NotAllowedCharErr);
+ end;
+ VATDigitTextBuilder.Append(Format(CurrNumber));
+ end;
+
+ // string is used instead of integer to avoid Integer/BigInteger overflow.
+ VATDigitString := VATDigitTextBuilder.ToText();
+ for i := 1 to StrLen(VATDigitString) do begin
+ CurrChar := VATDigitString[i];
+ CurrNumber := CurrChar - '0';
+ Remainder := (Remainder * 10 + CurrNumber) mod 97;
+ end;
+
+ if Remainder <> 1 then
+ exit(VATMod97Err);
+ end;
+
+ var
+ VATRegNoFormatErr: Label 'The entered VAT Registration number is not in agreement with the format specified for electronic tax declaration: ';
+ VATRegNoShouldNotStartWithErr: Label 'The VAT Registration number should not start with ''''000''''.';
+ VATRegNoLastTwoCharsErr: Label 'The last two characters of the VAT Registration number must be digits, but not equal to ''''00''''.';
+ VATLengthErr: Label 'The VAT registration number must be 14 characters long.';
+ VATFirstTwoCharsErr: Label 'The first two characters of the VAT registration number must be ''NL''.';
+ VATMod11NotAllowedCharErr: Label 'The VAT registration number must have the format NLdddddddddBdd where d is a digit.';
+ VATMod97NotAllowedCharErr: Label 'The VAT registration number for a natural person must have the format NLXXXXXXXXXXdd where d is a digit, and x can be a digit, an uppercase letter, ''+'', or ''*''.';
+ VATMod11Err: Label 'The VAT registration number is not valid according to the Modulus-11 checksum algorithm.';
+ VATMod97Err: Label 'The VAT registration number is not valid according to the Modulus-97 checksum algorithm.';
+ SummaryTwoErr: Label '%1%2', Comment = '%1, %2 - error text';
+ SummaryThreeErr: Label '%1%2 %3', Comment = '%1, %2, %3 - error text';
+}
diff --git a/src/Layers/NL/BaseApp/Local/Finance/VAT/Reporting/CreateElecICPDeclaration.Report.al b/src/Layers/NL/BaseApp/Local/Finance/VAT/Reporting/CreateElecICPDeclaration.Report.al
index 5c3ca4f259..ff540338c2 100644
--- a/src/Layers/NL/BaseApp/Local/Finance/VAT/Reporting/CreateElecICPDeclaration.Report.al
+++ b/src/Layers/NL/BaseApp/Local/Finance/VAT/Reporting/CreateElecICPDeclaration.Report.al
@@ -26,7 +26,7 @@ report 11404 "Create Elec. ICP Declaration"
DataItemTableView = sorting(Number) where(Number = filter(0 | 1 | 2));
dataitem("VAT Entry"; "VAT Entry")
{
- DataItemTableView = sorting(Type, "Country/Region Code", "VAT Registration No.", "EU 3-Party Trade", "VAT Bus. Posting Group", "VAT Prod. Posting Group", "VAT Calculation Type", "Document Type", "Posting Date") where(Type = const(Sale), "VAT Calculation Type" = const("Reverse Charge VAT"), "Document Type" = filter(Invoice | "Credit Memo"));
+ DataItemTableView = sorting(Type, "Country/Region Code", "VAT Registration No.", "VAT Bus. Posting Group", "VAT Prod. Posting Group", "Posting Date") where(Type = const(Sale), "VAT Calculation Type" = const("Reverse Charge VAT"), "Document Type" = filter(Invoice | "Credit Memo"));
RequestFilterFields = "VAT Bus. Posting Group", "VAT Prod. Posting Group";
trigger OnAfterGetRecord()
diff --git a/src/Layers/NL/BaseApp/Local/Finance/VAT/Reporting/VATStatementLineNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Finance/VAT/Reporting/VATStatementLineNL.Codeunit.al
new file mode 100644
index 0000000000..453e82043d
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/VAT/Reporting/VATStatementLineNL.Codeunit.al
@@ -0,0 +1,16 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.VAT.Reporting;
+
+codeunit 11366 "VAT Statement Line NL"
+{
+
+ [EventSubscriber(ObjectType::Table, Database::"VAT Statement Line", OnAfterValidateEvent, 'Type', false, false)]
+ local procedure OnAfterValidateEventType(var Rec: Record "VAT Statement Line"; xRec: Record "VAT Statement Line")
+ begin
+ if Rec.Type <> xRec.Type then
+ Rec.UpdateElecTaxDeclCategoryCode();
+ end;
+}
diff --git a/src/Layers/NL/BaseApp/Local/Finance/VAT/Reporting/VATStatementLineNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Finance/VAT/Reporting/VATStatementLineNL.TableExt.al
new file mode 100644
index 0000000000..0963d3448f
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/VAT/Reporting/VATStatementLineNL.TableExt.al
@@ -0,0 +1,43 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.VAT.Reporting;
+
+tableextension 11388 "VAT Statement Line NL" extends "VAT Statement Line"
+{
+ fields
+ {
+ field(11400; "Elec. Tax Decl. Category Code"; Code[10])
+ {
+ Caption = 'Elec. Tax Decl. Category Code';
+ DataClassification = CustomerContent;
+ TableRelation = "Elec. Tax Decl. VAT Category";
+ }
+ }
+
+ keys
+ {
+ key(Key2; "Elec. Tax Decl. Category Code")
+ {
+ }
+ }
+
+ procedure UpdateElecTaxDeclCategoryCode()
+ var
+ IsHandled: Boolean;
+ begin
+ IsHandled := false;
+ OnBeforeUpdateElecTaxDeclCategoryCode(Rec, IsHandled);
+ if IsHandled then
+ exit;
+
+ "Elec. Tax Decl. Category Code" := xRec."Elec. Tax Decl. Category Code";
+ end;
+
+ [IntegrationEvent(false, false)]
+ local procedure OnBeforeUpdateElecTaxDeclCategoryCode(var VATStatementLine: Record "VAT Statement Line"; var IsHandled: Boolean)
+ begin
+ end;
+}
+
diff --git a/src/Layers/NL/BaseApp/Local/Finance/VAT/Reporting/VATStatementNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Finance/VAT/Reporting/VATStatementNL.PageExt.al
new file mode 100644
index 0000000000..0c141c9d52
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Finance/VAT/Reporting/VATStatementNL.PageExt.al
@@ -0,0 +1,24 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Finance.VAT.Reporting;
+
+pageextension 11391 "VAT Statement NL" extends "VAT Statement"
+{
+ layout
+ {
+ addafter("Row No.")
+ {
+ field("Elec. Tax Decl. Category Code"; Rec."Elec. Tax Decl. Category Code")
+ {
+ ApplicationArea = VAT;
+ ToolTip = 'Specifies the electronic tax declaration category that is used to map the VAT Statement Line data to an XML element in the electronic statement.';
+ }
+ }
+ modify("Box No.")
+ {
+ Visible = false;
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Foundation/Address/CountriesRegionsNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Foundation/Address/CountriesRegionsNL.PageExt.al
new file mode 100644
index 0000000000..49ee0e0a70
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Foundation/Address/CountriesRegionsNL.PageExt.al
@@ -0,0 +1,20 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Foundation.Address;
+
+pageextension 11381 "Countries/Regions NL" extends "Countries/Regions"
+{
+ layout
+ {
+ addafter("ISO Numeric Code")
+ {
+ field("SEPA Allowed"; Rec."SEPA Allowed")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies if the Single Euro Payments Area (SEPA) function is active for the country/region.';
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Foundation/Address/CountryRegionNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Foundation/Address/CountryRegionNL.TableExt.al
new file mode 100644
index 0000000000..8d528a6c93
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Foundation/Address/CountryRegionNL.TableExt.al
@@ -0,0 +1,18 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Foundation.Address;
+
+tableextension 11380 "Country/Region NL" extends "Country/Region"
+{
+ fields
+ {
+ field(11400; "SEPA Allowed"; Boolean)
+ {
+ Caption = 'SEPA Allowed';
+ DataClassification = CustomerContent;
+ }
+ }
+}
+
diff --git a/src/Layers/NL/BaseApp/Local/Foundation/Address/PostCodeRange.Table.al b/src/Layers/NL/BaseApp/Local/Foundation/Address/PostCodeRange.Table.al
index a71586d44e..a038ac594b 100644
--- a/src/Layers/NL/BaseApp/Local/Foundation/Address/PostCodeRange.Table.al
+++ b/src/Layers/NL/BaseApp/Local/Foundation/Address/PostCodeRange.Table.al
@@ -51,13 +51,13 @@ table 11406 "Post Code Range"
case Type of
Type::" ", Type::"House Boat", Type::"House Trailer":
if "From No." <> 0 then
- FieldError("From No.", StrSubstNo(Text001, FieldCaption(Type), Type));
+ FieldError("From No.", StrSubstNo(MustBe0Lbl, FieldCaption(Type), Type));
Type::Odd:
if "From No." mod 2 <> 1 then
- FieldError("From No.", StrSubstNo(Text002, FieldCaption(Type), Type));
+ FieldError("From No.", StrSubstNo(MustBeOddLbl, FieldCaption(Type), Type));
Type::Even:
if "From No." mod 2 <> 0 then
- FieldError("From No.", StrSubstNo(Text003, FieldCaption(Type), Type));
+ FieldError("From No.", StrSubstNo(MustBeEvenLbl, FieldCaption(Type), Type));
end;
end;
}
@@ -71,13 +71,13 @@ table 11406 "Post Code Range"
case Type of
Type::" ", Type::"House Boat", Type::"House Trailer":
if "To No." <> 0 then
- FieldError("To No.", StrSubstNo(Text001, FieldCaption(Type), Type));
+ FieldError("To No.", StrSubstNo(MustBe0Lbl, FieldCaption(Type), Type));
Type::Odd:
if "To No." mod 2 <> 1 then
- FieldError("To No.", StrSubstNo(Text002, FieldCaption(Type), Type));
+ FieldError("To No.", StrSubstNo(MustBeOddLbl, FieldCaption(Type), Type));
Type::Even:
if "To No." mod 2 <> 0 then
- FieldError("To No.", StrSubstNo(Text003, FieldCaption(Type), Type));
+ FieldError("To No.", StrSubstNo(MustBeEvenLbl, FieldCaption(Type), Type));
end;
end;
}
@@ -122,9 +122,9 @@ table 11406 "Post Code Range"
end;
var
- Text001: Label 'must be 0 if %1 is %2';
- Text002: Label 'must be odd if %1 is %2';
- Text003: Label 'must be even if %1 is %2';
+ MustBe0Lbl: Label 'must be 0 if %1 is %2', Comment = '%1 = Field Caption (Type), %2 = Type value';
+ MustBeOddLbl: Label 'must be odd if %1 is %2', Comment = '%1 = Field Caption (Type), %2 = Type value';
+ MustBeEvenLbl: Label 'must be even if %1 is %2', Comment = '%1 = Field Caption (Type), %2 = Type value';
protected var
PostCode: Record "Post Code";
diff --git a/src/Layers/NL/BaseApp/Local/Foundation/Address/PostCodesNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Foundation/Address/PostCodesNL.PageExt.al
new file mode 100644
index 0000000000..290869ce70
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Foundation/Address/PostCodesNL.PageExt.al
@@ -0,0 +1,32 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Foundation.Address;
+
+pageextension 11392 "Post Codes NL" extends "Post Codes"
+{
+ actions
+ {
+ addlast(processing)
+ {
+ group("&Post Code")
+ {
+ Caption = '&Post Code';
+ Image = ZoneCode;
+ action("&Ranges")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = '&Ranges';
+ Image = Ranges;
+ RunObject = Page "Post Code Ranges";
+ RunPageLink = "Post Code" = field(Code),
+ City = field(City);
+ RunPageView = sorting("Post Code", City, Type, "From No.");
+ ToolTip = 'View or edit street names and cities by post codes. When you enter the post code and house number in an address field the program assists you in filling in the corresponding street name and city. If the house number does not fit into a range by the given post code, the Post Code Range window appears with a list of all the street names and cities by the given post code for you to select from.';
+ }
+ }
+ }
+ }
+}
+
diff --git a/src/Layers/NL/BaseApp/Foundation/AuditCodes/SourceCodeSetupNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Foundation/AuditCodes/SourceCodeSetupNL.PageExt.al
similarity index 100%
rename from src/Layers/NL/BaseApp/Foundation/AuditCodes/SourceCodeSetupNL.PageExt.al
rename to src/Layers/NL/BaseApp/Local/Foundation/AuditCodes/SourceCodeSetupNL.PageExt.al
diff --git a/src/Layers/NL/BaseApp/Foundation/AuditCodes/SourceCodeSetupNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Foundation/AuditCodes/SourceCodeSetupNL.TableExt.al
similarity index 100%
rename from src/Layers/NL/BaseApp/Foundation/AuditCodes/SourceCodeSetupNL.TableExt.al
rename to src/Layers/NL/BaseApp/Local/Foundation/AuditCodes/SourceCodeSetupNL.TableExt.al
diff --git a/src/Layers/NL/BaseApp/Local/Foundation/Company/COmpanyInformationNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Foundation/Company/COmpanyInformationNL.Codeunit.al
new file mode 100644
index 0000000000..d55e16f7ad
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Foundation/Company/COmpanyInformationNL.Codeunit.al
@@ -0,0 +1,22 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Foundation.Company;
+
+using Microsoft.Utilities;
+
+codeunit 11361 "Company Information NL"
+{
+
+ [EventSubscriber(ObjectType::Table, Database::"Company Information", 'OnAfterValidateEvent', 'Bank Account No.', false, false)]
+ local procedure OnAfterValidateEventBankAccountNo(var Rec: Record "Company Information"; var xRec: Record "Company Information")
+ begin
+ if not LocalFunctionalityMgt.CheckBankAccNo(Rec."Bank Account No.", Rec."Country/Region Code", Rec."Bank Account No.") then
+ Message(IncorrectAccountNoMsg, Rec."Bank Account No.");
+ end;
+
+ var
+ LocalFunctionalityMgt: Codeunit "Local Functionality Mgt.";
+ IncorrectAccountNoMsg: Label 'Bank Account No. %1 may be incorrect.', Comment = '%1 - Bank Account No.';
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/Foundation/Company/CompanyInformationNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Foundation/Company/CompanyInformationNL.PageExt.al
new file mode 100644
index 0000000000..18277e7e6c
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Foundation/Company/CompanyInformationNL.PageExt.al
@@ -0,0 +1,25 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Foundation.Company;
+
+pageextension 11361 "Company Information NL" extends "Company Information"
+{
+ layout
+ {
+ addafter("Industrial Classification")
+ {
+ field("Fiscal Entity No."; Rec."Fiscal Entity No.")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the fiscal entity number is the VAT number assigned to a group of companies to report one consolidated VAT declaration.';
+ }
+ }
+ modify("EORI Number")
+ {
+ Visible = true;
+ }
+ }
+}
+
diff --git a/src/Layers/NL/BaseApp/Local/Foundation/Company/CompanyInformationNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Foundation/Company/CompanyInformationNL.TableExt.al
new file mode 100644
index 0000000000..b80b996ff8
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Foundation/Company/CompanyInformationNL.TableExt.al
@@ -0,0 +1,38 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Foundation.Company;
+
+using Microsoft.Finance.VAT.Registration;
+
+tableextension 11379 "Company Information NL" extends "Company Information"
+{
+ fields
+ {
+ field(11400; "Fiscal Entity No."; Text[20])
+ {
+ Caption = 'Fiscal Entity No.';
+ DataClassification = CustomerContent;
+
+ trigger OnValidate()
+ var
+ VATRegNoFormat: Record "VAT Registration No. Format";
+ begin
+ VATRegNoFormat.Test("Fiscal Entity No.", "Country/Region Code", '', DATABASE::"Company Information");
+ end;
+ }
+ }
+
+ procedure GetVATIdentificationNo(PartOfFiscalEntity: Boolean) Result: Text[20]
+ begin
+ Get();
+ if PartOfFiscalEntity then
+ Result := "Fiscal Entity No."
+ else
+ Result := "VAT Registration No.";
+ if CopyStr(UpperCase(Result), 1, 2) = 'NL' then
+ Result := DelStr(Result, 1, 2);
+ end;
+}
+
diff --git a/src/Layers/NL/BaseApp/Local/HumanResources/Employee/EmployeeCardNL.PageExt.al b/src/Layers/NL/BaseApp/Local/HumanResources/Employee/EmployeeCardNL.PageExt.al
new file mode 100644
index 0000000000..ef6333d73c
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/HumanResources/Employee/EmployeeCardNL.PageExt.al
@@ -0,0 +1,30 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.HumanResources.Employee;
+
+pageextension 11352 "Employee Card NL" extends "Employee Card"
+{
+ layout
+ {
+ addafter("Application Method")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = BasicHR;
+ }
+ }
+ addafter("Bank Account No.")
+ {
+ field("Bank Name"; Rec."Bank Name")
+ {
+ ApplicationArea = BasicHR;
+ }
+ field("Bank City"; Rec."Bank City")
+ {
+ ApplicationArea = BasicHR;
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/HumanResources/Employee/EmployeeNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/HumanResources/Employee/EmployeeNL.Codeunit.al
new file mode 100644
index 0000000000..b7708b8033
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/HumanResources/Employee/EmployeeNL.Codeunit.al
@@ -0,0 +1,35 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.HumanResources.Employee;
+
+using Microsoft.Bank.Payment;
+using Microsoft.Foundation.Enums;
+using Microsoft.Utilities;
+
+codeunit 11364 "Employee NL"
+{
+
+ [EventSubscriber(ObjectType::Table, Database::Employee, 'OnAfterModifyEvent', '', false, false)]
+ local procedure OnAfterModifyEvent(var Rec: Record Employee; var xRec: Record Employee)
+ var
+ TransactionMode: Record "Transaction Mode";
+ AccountType: Option Customer,Vendor,Employee;
+ begin
+ if not TransactionMode.CheckTransactionModePartnerType(AccountType::Employee, Rec."Transaction Mode Code", Enum::"Partner Type"::" ") then
+ Error(PartnerTypeMismatchErr);
+ end;
+
+ [EventSubscriber(ObjectType::Table, Database::Employee, 'OnAfterValidateEvent', 'Bank Account No.', false, false)]
+ local procedure OnAfterValidateBankAccountNoEvent(var Rec: Record Employee; var xRec: Record Employee)
+ begin
+ if not LocalFunctionalityMgt.CheckBankAccNo(Rec."Bank Account No.", Rec."Country/Region Code", Rec."Bank Account No.") then
+ Message(BankAccNoMsg, Rec."Bank Account No.");
+ end;
+
+ var
+ LocalFunctionalityMgt: Codeunit "Local Functionality Mgt.";
+ BankAccNoMsg: Label 'Bank Account No. %1 may be incorrect.', Comment = '%1 - bank account no';
+ PartnerTypeMismatchErr: Label 'The Partner Type field must be blank because the transaction is related to an employee.';
+}
diff --git a/src/Layers/NL/BaseApp/Local/HumanResources/Employee/EmployeeNL.TableExt.al b/src/Layers/NL/BaseApp/Local/HumanResources/Employee/EmployeeNL.TableExt.al
new file mode 100644
index 0000000000..8398d86958
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/HumanResources/Employee/EmployeeNL.TableExt.al
@@ -0,0 +1,39 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.HumanResources.Employee;
+
+using Microsoft.Bank.Payment;
+
+tableextension 11352 "Employee NL" extends "Employee"
+{
+ fields
+ {
+ field(11000000; "Transaction Mode Code"; Code[20])
+ {
+ Caption = 'Transaction Mode Code';
+ DataClassification = CustomerContent;
+ TableRelation = "Transaction Mode".Code where("Account Type" = const(Employee));
+
+ trigger OnValidate()
+ var
+ TransactionMode: Record "Transaction Mode";
+ begin
+ if "Transaction Mode Code" <> '' then
+ TransactionMode.Get(TransactionMode."Account Type"::Employee, "Transaction Mode Code");
+ end;
+ }
+ field(11000001; "Bank Name"; Text[100])
+ {
+ Caption = 'Bank Name';
+ DataClassification = CustomerContent;
+ }
+ field(11000002; "Bank City"; Text[30])
+ {
+ Caption = 'Bank City';
+ DataClassification = CustomerContent;
+ }
+ }
+}
+
diff --git a/src/Layers/NL/BaseApp/Local/HumanResources/Payables/ApplyEmployeeEntriesNL.PageExt.al b/src/Layers/NL/BaseApp/Local/HumanResources/Payables/ApplyEmployeeEntriesNL.PageExt.al
new file mode 100644
index 0000000000..40a28da998
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/HumanResources/Payables/ApplyEmployeeEntriesNL.PageExt.al
@@ -0,0 +1,20 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.HumanResources.Payables;
+
+pageextension 11354 "Apply Employee Entries NL" extends "Apply Employee Entries"
+{
+ layout
+ {
+ addafter("Global Dimension 2 Code")
+ {
+ field("Payments in Process"; Rec."Payments in Process")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the total amount of payments/collections in process.';
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/HumanResources/Payables/EmplEntryEditNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/HumanResources/Payables/EmplEntryEditNL.Codeunit.al
new file mode 100644
index 0000000000..1ef8407d08
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/HumanResources/Payables/EmplEntryEditNL.Codeunit.al
@@ -0,0 +1,16 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.HumanResources.Payables;
+
+codeunit 11356 "Empl. Entry-Edit NL"
+{
+
+ [EventSubscriber(ObjectType::Codeunit, Codeunit::"Empl. Entry-Edit", OnBeforeEmplLedgEntryModify, '', false, false)]
+ local procedure OnBeforeEmplLedgEntryModify(var EmplLedgEntry: Record "Employee Ledger Entry"; FromEmplLedgEntry: Record "Employee Ledger Entry")
+ begin
+ if EmplLedgEntry.Open then
+ EmplLedgEntry."Transaction Mode Code" := FromEmplLedgEntry."Transaction Mode Code";
+ end;
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/HumanResources/Payables/EmplLedgerEntriesPreviewNL.PageExt.al b/src/Layers/NL/BaseApp/Local/HumanResources/Payables/EmplLedgerEntriesPreviewNL.PageExt.al
new file mode 100644
index 0000000000..40a0f3d7ca
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/HumanResources/Payables/EmplLedgerEntriesPreviewNL.PageExt.al
@@ -0,0 +1,20 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.HumanResources.Payables;
+
+pageextension 11339 "EmplLedgerEntriesPreview NL" extends "Empl. Ledger Entries Preview"
+{
+ layout
+ {
+ addafter(Open)
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = BasicHR;
+ }
+ }
+ }
+}
+
diff --git a/src/Layers/NL/BaseApp/Local/HumanResources/Payables/EmployeeLedgerEntriesNL.PageExt.al b/src/Layers/NL/BaseApp/Local/HumanResources/Payables/EmployeeLedgerEntriesNL.PageExt.al
new file mode 100644
index 0000000000..c6657593de
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/HumanResources/Payables/EmployeeLedgerEntriesNL.PageExt.al
@@ -0,0 +1,20 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.HumanResources.Payables;
+
+pageextension 11337 "Employee Ledger Entries NL" extends "Employee Ledger Entries"
+{
+ layout
+ {
+ addafter("Payment Reference")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = BasicHR;
+ }
+ }
+ }
+}
+
diff --git a/src/Layers/NL/BaseApp/Local/HumanResources/Payables/EmployeeLedgerEntryNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/HumanResources/Payables/EmployeeLedgerEntryNL.Codeunit.al
new file mode 100644
index 0000000000..6080ddcbc5
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/HumanResources/Payables/EmployeeLedgerEntryNL.Codeunit.al
@@ -0,0 +1,17 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.HumanResources.Payables;
+
+using Microsoft.Finance.GeneralLedger.Journal;
+
+codeunit 11362 "Employee Ledger Entry NL"
+{
+
+ [EventSubscriber(ObjectType::Table, Database::"Employee Ledger Entry", 'OnAfterCopyEmployeeLedgerEntryFromGenJnlLine', '', false, false)]
+ local procedure OnAfterCopyEmployeeLedgerEntryFromGenJnlLine(var EmployeeLedgerEntry: Record "Employee Ledger Entry"; GenJournalLine: Record "Gen. Journal Line")
+ begin
+ EmployeeLedgerEntry."Transaction Mode Code" := GenJournalLine."Transaction Mode Code";
+ end;
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/HumanResources/Payables/EmployeeLedgerEntryNL.TableExt.al b/src/Layers/NL/BaseApp/Local/HumanResources/Payables/EmployeeLedgerEntryNL.TableExt.al
new file mode 100644
index 0000000000..fb491aa253
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/HumanResources/Payables/EmployeeLedgerEntryNL.TableExt.al
@@ -0,0 +1,58 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.HumanResources.Payables;
+
+using Microsoft.Bank.Payment;
+
+tableextension 11362 "Employee Ledger Entry NL" extends "Employee Ledger Entry"
+{
+ fields
+ {
+ field(11000000; "Transaction Mode Code"; Code[20])
+ {
+ Caption = 'Transaction Mode Code';
+ DataClassification = CustomerContent;
+ TableRelation = "Transaction Mode".Code where("Account Type" = const(Employee));
+ }
+ field(11000002; "Payments in Process"; Decimal)
+ {
+ AutoFormatType = 1;
+ AutoFormatExpression = Rec."Currency Code";
+ BlankZero = true;
+ CalcFormula = sum("Detail Line"."Amount (Entry)" where("Serial No. (Entry)" = field("Entry No."),
+ Status = const("In process"),
+ "Account Type" = const(Employee),
+ "Connect Batches" = field("Connect Batches Filter"),
+ "Connect Lines" = field("Connect Lines Filter"),
+ "Our Bank" = field("Our Bank Filter")));
+ Caption = 'Payments in Process';
+ Editable = false;
+ FieldClass = FlowField;
+ }
+ field(11000003; "Connect Batches Filter"; Code[20])
+ {
+ Caption = 'Connect Batches Filter';
+ FieldClass = FlowFilter;
+ }
+ field(11000004; "Connect Lines Filter"; Integer)
+ {
+ Caption = 'Connect Lines Filter';
+ FieldClass = FlowFilter;
+ }
+ field(11000005; "Our Bank Filter"; Code[20])
+ {
+ Caption = 'Our Bank Filter';
+ FieldClass = FlowFilter;
+ }
+ }
+
+ keys
+ {
+ key(TransactionMode; "Transaction Mode Code")
+ {
+ }
+ }
+}
+
diff --git a/src/Layers/NL/BaseApp/Local/Permissions/localnl.permissionsetext.al b/src/Layers/NL/BaseApp/Local/Permissions/localnl.permissionsetext.al
new file mode 100644
index 0000000000..b6a8e2c224
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Permissions/localnl.permissionsetext.al
@@ -0,0 +1,41 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace System.Security.AccessControl;
+
+using Microsoft.Bank.Payment;
+using Microsoft.Bank.Reconciliation;
+using Microsoft.Bank.Statement;
+using Microsoft.Finance.GeneralLedger.Review;
+using Microsoft.Finance.VAT.Reporting;
+using Microsoft.Foundation.Address;
+
+permissionsetextension 1001 "LOCAL NL" extends "LOCAL"
+{
+
+ Permissions = tabledata "Audit File Buffer" = RIMD,
+ tabledata "CBG Statement" = RIMD,
+ tabledata "CBG Statement Line" = RIMD,
+ tabledata "CBG Statement Line Add. Info." = RIMD,
+ tabledata "Detail Line" = RIMD,
+ tabledata "Elec. Tax Decl. Error Log" = RIMD,
+ tabledata "Elec. Tax Decl. Response Msg." = RIMD,
+ tabledata "Elec. Tax Decl. VAT Category" = RIMD,
+ tabledata "Elec. Tax Declaration Header" = RIMD,
+ tabledata "Elec. Tax Declaration Line" = RIMD,
+ tabledata "Elec. Tax Declaration Setup" = RIMD,
+ tabledata "Export Protocol" = RIMD,
+ tabledata "Freely Transferable Maximum" = RIMD,
+ tabledata "G/L Entry Application Buffer" = RIMD,
+ tabledata "Import Protocol" = RIMD,
+ tabledata "Payment History" = RIMD,
+ tabledata "Payment History Export Buffer" = RIMD,
+ tabledata "Payment History Line" = RIMD,
+ tabledata "Post Code Range" = RIMD,
+ tabledata "Post Code Update Log Entry" = RIMD,
+ tabledata "Proposal Line" = RIMD,
+ tabledata "Reconciliation Buffer" = RIMD,
+ tabledata "Reporting ICP" = RIMD,
+ tabledata "Transaction Mode" = RIMD;
+}
diff --git a/src/Layers/NL/BaseApp/Local/Permissions/localreadnl.permissionsetext.al b/src/Layers/NL/BaseApp/Local/Permissions/localreadnl.permissionsetext.al
new file mode 100644
index 0000000000..398a90c355
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Permissions/localreadnl.permissionsetext.al
@@ -0,0 +1,41 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace System.Security.AccessControl;
+
+using Microsoft.Bank.Payment;
+using Microsoft.Bank.Reconciliation;
+using Microsoft.Bank.Statement;
+using Microsoft.Finance.GeneralLedger.Review;
+using Microsoft.Finance.VAT.Reporting;
+using Microsoft.Foundation.Address;
+
+permissionsetextension 1002 "LOCAL READ NL" extends "LOCAL READ"
+{
+
+ Permissions = tabledata "Audit File Buffer" = R,
+ tabledata "CBG Statement" = R,
+ tabledata "CBG Statement Line" = R,
+ tabledata "CBG Statement Line Add. Info." = R,
+ tabledata "Detail Line" = R,
+ tabledata "Elec. Tax Decl. Error Log" = R,
+ tabledata "Elec. Tax Decl. Response Msg." = R,
+ tabledata "Elec. Tax Decl. VAT Category" = R,
+ tabledata "Elec. Tax Declaration Header" = R,
+ tabledata "Elec. Tax Declaration Line" = R,
+ tabledata "Elec. Tax Declaration Setup" = R,
+ tabledata "Export Protocol" = R,
+ tabledata "Freely Transferable Maximum" = R,
+ tabledata "G/L Entry Application Buffer" = R,
+ tabledata "Import Protocol" = R,
+ tabledata "Payment History" = R,
+ tabledata "Payment History Export Buffer" = R,
+ tabledata "Payment History Line" = R,
+ tabledata "Post Code Range" = R,
+ tabledata "Post Code Update Log Entry" = R,
+ tabledata "Proposal Line" = R,
+ tabledata "Reconciliation Buffer" = R,
+ tabledata "Reporting ICP" = R,
+ tabledata "Transaction Mode" = R;
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchCrMemoHdrNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchCrMemoHdrNL.TableExt.al
new file mode 100644
index 0000000000..2bbe89b899
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchCrMemoHdrNL.TableExt.al
@@ -0,0 +1,27 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.History;
+
+using Microsoft.Bank.Payment;
+using Microsoft.Purchases.Vendor;
+
+tableextension 11314 PurchCrMemoHdrNL extends "Purch. Cr. Memo Hdr."
+{
+ fields
+ {
+ field(11000000; "Transaction Mode"; Code[20])
+ {
+ Caption = 'Transaction Mode';
+ DataClassification = CustomerContent;
+ TableRelation = "Transaction Mode".Code where("Account Type" = const(Vendor));
+ }
+ field(11000001; "Bank Account"; Code[20])
+ {
+ Caption = 'Bank Account';
+ DataClassification = CustomerContent;
+ TableRelation = "Vendor Bank Account".Code where("Vendor No." = field("Buy-from Vendor No."));
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchCrMemoSubformNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchCrMemoSubformNL.Codeunit.al
new file mode 100644
index 0000000000..f95147ca0a
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchCrMemoSubformNL.Codeunit.al
@@ -0,0 +1,15 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Document;
+
+codeunit 11325 PurchCrMemoSubformNL
+{
+ [EventSubscriber(ObjectType::Page, Page::"Purch. Cr. Memo Subform", 'OnAfterNoOnAfterValidate', '', false, false)]
+ local procedure OnAfterNoOnAfterValidate(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line")
+ begin
+ if PurchaseLine.Type = PurchaseLine.Type::"G/L Account" then
+ PurchaseLine.Validate(Quantity, 1);
+ end;
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchCrMemoSubformNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchCrMemoSubformNL.PageExt.al
new file mode 100644
index 0000000000..0de8e3c193
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchCrMemoSubformNL.PageExt.al
@@ -0,0 +1,34 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Document;
+
+pageextension 11324 PurchCrMemoSubformNL extends "Purch. Cr. Memo Subform"
+{
+ layout
+ {
+ addafter(NonDeductibleVATAmount)
+ {
+ field(Amount; Rec.Amount)
+ {
+ ApplicationArea = Basic, Suite;
+ BlankZero = true;
+ ToolTip = 'Specifies the sum of amounts in the Line Amount field on the document lines.';
+ Visible = false;
+ }
+ field("Amount Including VAT"; Rec."Amount Including VAT")
+ {
+ ApplicationArea = Basic, Suite;
+ BlankZero = true;
+ ToolTip = 'Specifies the net amount, including VAT, for this line.';
+ Visible = false;
+
+ trigger OnValidate()
+ begin
+ DeltaUpdateTotals();
+ end;
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchInvHeaderNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchInvHeaderNL.TableExt.al
new file mode 100644
index 0000000000..ce4d4c8eb7
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchInvHeaderNL.TableExt.al
@@ -0,0 +1,27 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.History;
+
+using Microsoft.Bank.Payment;
+using Microsoft.Purchases.Vendor;
+
+tableextension 11313 PurchInvHeaderNL extends "Purch. Inv. Header"
+{
+ fields
+ {
+ field(11000000; "Transaction Mode"; Code[20])
+ {
+ Caption = 'Transaction Mode';
+ DataClassification = CustomerContent;
+ TableRelation = "Transaction Mode".Code where("Account Type" = const(Vendor));
+ }
+ field(11000001; "Bank Account"; Code[20])
+ {
+ Caption = 'Bank Account';
+ DataClassification = CustomerContent;
+ TableRelation = "Vendor Bank Account".Code where("Vendor No." = field("Buy-from Vendor No."));
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchInvoiceSubformNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchInvoiceSubformNL.Codeunit.al
new file mode 100644
index 0000000000..4d1917294f
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchInvoiceSubformNL.Codeunit.al
@@ -0,0 +1,15 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Document;
+
+codeunit 11327 PurchInvoiceSubformNL
+{
+ [EventSubscriber(ObjectType::Page, Page::"Purch. Invoice Subform", 'OnAfterNoOnAfterValidate', '', false, false)]
+ local procedure OnAfterNoOnAfterValidate(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line")
+ begin
+ if PurchaseLine.Type = PurchaseLine.Type::"G/L Account" then
+ PurchaseLine.Validate(Quantity, 1);
+ end;
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchInvoiceSubformNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchInvoiceSubformNL.PageExt.al
new file mode 100644
index 0000000000..6562a0440d
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchInvoiceSubformNL.PageExt.al
@@ -0,0 +1,34 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Document;
+
+pageextension 11326 PurchInvoiceSubformNL extends "Purch. Invoice Subform"
+{
+ layout
+ {
+ addafter(NonDeductibleVATAmount)
+ {
+ field(Amount; Rec.Amount)
+ {
+ ApplicationArea = Basic, Suite;
+ BlankZero = true;
+ ToolTip = 'Specifies the sum of amounts in the Line Amount field on the document lines.';
+ Visible = false;
+ }
+ field("Amount Including VAT"; Rec."Amount Including VAT")
+ {
+ ApplicationArea = Basic, Suite;
+ BlankZero = true;
+ ToolTip = 'Specifies the net amount, including VAT, for this line.';
+ Visible = false;
+
+ trigger OnValidate()
+ begin
+ DeltaUpdateTotals();
+ end;
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseCreditMemoNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseCreditMemoNL.PageExt.al
new file mode 100644
index 0000000000..947a71b005
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseCreditMemoNL.PageExt.al
@@ -0,0 +1,23 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Document;
+
+pageextension 11311 PurchaseCreditMemoNL extends "Purchase Credit Memo"
+{
+ layout
+ {
+ addafter("Payment Method Code")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ field("Bank Account Code"; Rec."Bank Account Code")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseHeaderNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseHeaderNL.Codeunit.al
new file mode 100644
index 0000000000..549a0ecf2c
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseHeaderNL.Codeunit.al
@@ -0,0 +1,23 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Document;
+
+using Microsoft.Purchases.Vendor;
+
+codeunit 11323 PurchaseHeaderNL
+{
+ [EventSubscriber(ObjectType::Table, Database::"Purchase Header", 'OnAfterCopyPayToVendorFieldsFromVendor', '', false, false)]
+ local procedure OnAfterCopyPayToVendorFieldsFromVendor(var PurchaseHeader: Record "Purchase Header"; Vendor: Record Vendor; xPurchaseHeader: Record "Purchase Header")
+ begin
+ PurchaseHeader."Transaction Mode Code" := Vendor."Transaction Mode Code";
+ PurchaseHeader."Bank Account Code" := Vendor."Preferred Bank Account Code";
+ end;
+
+ [EventSubscriber(ObjectType::Table, Database::"Purchase Header", 'OnValidatePurchaseHeaderPayToVendorNoOnBeforeCheckDocType', '', false, false)]
+ local procedure OnValidatePurchaseHeaderPayToVendorNoOnBeforeCheckDocType(Vendor: Record Vendor; var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; SkipPayToContact: Boolean)
+ begin
+ PurchaseHeader.Validate("Transaction Mode Code");
+ end;
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseHeaderNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseHeaderNL.TableExt.al
new file mode 100644
index 0000000000..7791727491
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseHeaderNL.TableExt.al
@@ -0,0 +1,41 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Document;
+
+using Microsoft.Bank.Payment;
+using Microsoft.Purchases.Vendor;
+
+tableextension 11306 PurchaseHeaderNL extends "Purchase Header"
+{
+ fields
+ {
+ field(11000000; "Transaction Mode Code"; Code[20])
+ {
+ Caption = 'Transaction Mode Code';
+ DataClassification = CustomerContent;
+ TableRelation = "Transaction Mode".Code where("Account Type" = const(Vendor));
+
+ trigger OnValidate()
+ var
+ TransactionMode: Record "Transaction Mode";
+ begin
+ if "Transaction Mode Code" <> '' then begin
+ TransactionMode.Get(TransactionMode."Account Type"::Vendor, "Transaction Mode Code");
+ if TransactionMode."Payment Method Code" <> '' then
+ Validate("Payment Method Code", TransactionMode."Payment Method Code");
+ if TransactionMode."Payment Terms Code" <> '' then
+ Validate("Payment Terms Code", TransactionMode."Payment Terms Code");
+ end;
+ end;
+ }
+ field(11000001; "Bank Account Code"; Code[20])
+ {
+ Caption = 'Bank Account Code';
+ DataClassification = CustomerContent;
+ TableRelation = "Vendor Bank Account".Code where("Vendor No." = field("Pay-to Vendor No."));
+ }
+ }
+}
+
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseInvoiceNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseInvoiceNL.PageExt.al
new file mode 100644
index 0000000000..237d22b785
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseInvoiceNL.PageExt.al
@@ -0,0 +1,23 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Document;
+
+pageextension 11308 PurchaseInvoiceNL extends "Purchase Invoice"
+{
+ layout
+ {
+ addafter("Payment Method Code")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ field("Bank Account Code"; Rec."Bank Account Code")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseLineNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseLineNL.TableExt.al
new file mode 100644
index 0000000000..ed349b6e69
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseLineNL.TableExt.al
@@ -0,0 +1,18 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Document;
+
+tableextension 11307 PurchaseLineNL extends "Purchase Line"
+{
+ fields
+ {
+ field(11303; "Suggested Line"; Boolean)
+ {
+ Caption = 'Suggested Line';
+ DataClassification = SystemMetadata;
+ Editable = false;
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseOrderNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseOrderNL.PageExt.al
new file mode 100644
index 0000000000..3e1dcdeb78
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseOrderNL.PageExt.al
@@ -0,0 +1,23 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Document;
+
+pageextension 11309 PurchaseOrderNL extends "Purchase Order"
+{
+ layout
+ {
+ addafter("Payment Method Code")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ field("Bank Account Code"; Rec."Bank Account Code")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseQuoteNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseQuoteNL.PageExt.al
new file mode 100644
index 0000000000..78c7d2f89d
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseQuoteNL.PageExt.al
@@ -0,0 +1,23 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Document;
+
+pageextension 11310 PurchaseQuoteNL extends "Purchase Quote"
+{
+ layout
+ {
+ addafter("Payment Method Code")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ field("Bank Account Code"; Rec."Bank Account Code")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseReturnOrderNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseReturnOrderNL.PageExt.al
new file mode 100644
index 0000000000..fbf8e08893
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Document/PurchaseReturnOrderNL.PageExt.al
@@ -0,0 +1,23 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Document;
+
+pageextension 11312 PurchaseReturnOrderNL extends "Purchase Return Order"
+{
+ layout
+ {
+ addafter("Payment Method Code")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ field("Bank Account Code"; Rec."Bank Account Code")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/History/PostedPurchaseCrMemoNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Purchases/History/PostedPurchaseCrMemoNL.PageExt.al
new file mode 100644
index 0000000000..244c3ac795
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/History/PostedPurchaseCrMemoNL.PageExt.al
@@ -0,0 +1,25 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.History;
+
+pageextension 11316 PostedPurchaseCrMemoNL extends "Posted Purchase Credit Memo"
+{
+ layout
+ {
+ addafter("Applies-to Doc. No.")
+ {
+ field("Transaction Mode"; Rec."Transaction Mode")
+ {
+ ApplicationArea = Basic, Suite;
+ Editable = false;
+ }
+ field("Bank Account"; Rec."Bank Account")
+ {
+ ApplicationArea = Basic, Suite;
+ Editable = false;
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/History/PostedPurchaseInvoiceNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Purchases/History/PostedPurchaseInvoiceNL.PageExt.al
new file mode 100644
index 0000000000..964f6bd7ef
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/History/PostedPurchaseInvoiceNL.PageExt.al
@@ -0,0 +1,25 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.History;
+
+pageextension 11315 PostedPurchaseInvoiceNL extends "Posted Purchase Invoice"
+{
+ layout
+ {
+ addafter("Payment Method Code")
+ {
+ field("Transaction Mode"; Rec."Transaction Mode")
+ {
+ ApplicationArea = Basic, Suite;
+ Editable = false;
+ }
+ field("Bank Account"; Rec."Bank Account")
+ {
+ ApplicationArea = Basic, Suite;
+ Editable = false;
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Payables/ApplyVendorEntriesNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Payables/ApplyVendorEntriesNL.PageExt.al
new file mode 100644
index 0000000000..438645ea64
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Payables/ApplyVendorEntriesNL.PageExt.al
@@ -0,0 +1,19 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Payables;
+
+pageextension 11319 ApplyVendorEntriesNL extends "Apply Vendor Entries"
+{
+ layout
+ {
+ addafter(Positive)
+ {
+ field("Payments in Process"; Rec."Payments in Process")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Payables/VendEntryEditNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Purchases/Payables/VendEntryEditNL.Codeunit.al
new file mode 100644
index 0000000000..d362b74f67
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Payables/VendEntryEditNL.Codeunit.al
@@ -0,0 +1,15 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Payables;
+
+codeunit 11320 VendEntryEditNL
+{
+ [EventSubscriber(ObjectType::Codeunit, Codeunit::"Vend. Entry-Edit", 'OnBeforeVendLedgEntryModify', '', false, false)]
+ local procedure OnBeforeVendLedgEntryModify(var VendLedgEntry: Record "Vendor Ledger Entry"; FromVendLedgEntry: Record "Vendor Ledger Entry")
+ begin
+ VendLedgEntry."Transaction Mode Code" := FromVendLedgEntry."Transaction Mode Code";
+ VendLedgEntry."Recipient Bank Account" := FromVendLedgEntry."Recipient Bank Account";
+ end;
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Payables/VendorLedgerEntriesNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Payables/VendorLedgerEntriesNL.PageExt.al
new file mode 100644
index 0000000000..fff335203e
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Payables/VendorLedgerEntriesNL.PageExt.al
@@ -0,0 +1,31 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Payables;
+
+pageextension 11318 VendorLedgerEntriesNL extends "Vendor Ledger Entries"
+{
+ layout
+ {
+ addafter("Remaining Amt. (LCY)")
+ {
+ field("Payments in Process"; Rec."Payments in Process")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ }
+
+ addafter("Payment Method Code")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ field("Recipient Bank Account"; Rec."Recipient Bank Account")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Payables/VendorLedgerEntryNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Purchases/Payables/VendorLedgerEntryNL.Codeunit.al
new file mode 100644
index 0000000000..981b0368b2
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Payables/VendorLedgerEntryNL.Codeunit.al
@@ -0,0 +1,16 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Payables;
+
+using Microsoft.Finance.GeneralLedger.Journal;
+
+codeunit 11328 VendorLedgerEntryNL
+{
+ [EventSubscriber(ObjectType::Table, Database::"Vendor Ledger Entry", 'OnAfterCopyVendLedgerEntryFromGenJnlLine', '', false, false)]
+ local procedure OnAfterCopyVendLedgerEntryFromGenJnlLine(var VendorLedgerEntry: Record "Vendor Ledger Entry"; GenJournalLine: Record "Gen. Journal Line")
+ begin
+ VendorLedgerEntry."Transaction Mode Code" := GenJournalLine."Transaction Mode Code";
+ end;
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Payables/VendorLedgerEntryNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Payables/VendorLedgerEntryNL.TableExt.al
new file mode 100644
index 0000000000..2c3cdb27a1
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Payables/VendorLedgerEntryNL.TableExt.al
@@ -0,0 +1,57 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Payables;
+
+using Microsoft.Bank.Payment;
+
+tableextension 11317 "Vendor Ledger Entry NL" extends "Vendor Ledger Entry"
+{
+ fields
+ {
+ field(11000000; "Transaction Mode Code"; Code[20])
+ {
+ Caption = 'Transaction Mode Code';
+ DataClassification = CustomerContent;
+ TableRelation = "Transaction Mode".Code where("Account Type" = const(Vendor));
+ }
+ field(11000002; "Payments in Process"; Decimal)
+ {
+ AutoFormatExpression = "Currency Code";
+ AutoFormatType = 1;
+ BlankZero = true;
+ CalcFormula = sum("Detail Line"."Amount (Entry)" where("Serial No. (Entry)" = field("Entry No."),
+ Status = const("In process"),
+ "Account Type" = const(Vendor),
+ "Connect Batches" = field("Connect Batches Filter"),
+ "Connect Lines" = field("Connect Lines Filter"),
+ "Our Bank" = field("Our Bank Filter")));
+ Caption = 'Payments in Process';
+ Editable = false;
+ FieldClass = FlowField;
+ }
+ field(11000003; "Connect Batches Filter"; Code[20])
+ {
+ Caption = 'Connect Batches Filter';
+ FieldClass = FlowFilter;
+ }
+ field(11000004; "Connect Lines Filter"; Integer)
+ {
+ Caption = 'Connect Lines Filter';
+ FieldClass = FlowFilter;
+ }
+ field(11000005; "Our Bank Filter"; Code[20])
+ {
+ Caption = 'Our Bank Filter';
+ FieldClass = FlowFilter;
+ }
+ }
+
+ keys
+ {
+ key(TransactionMode; "Transaction Mode Code")
+ {
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Posting/PurchPostPrepayNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Purchases/Posting/PurchPostPrepayNL.Codeunit.al
new file mode 100644
index 0000000000..a26cddb880
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Posting/PurchPostPrepayNL.Codeunit.al
@@ -0,0 +1,18 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Posting;
+
+using Microsoft.Finance.GeneralLedger.Journal;
+using Microsoft.Purchases.Document;
+
+codeunit 11321 PurchPostPrepayNL
+{
+ [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purchase-Post Prepayments", 'OnPostVendorEntryOnAfterInitNewLine', '', false, false)]
+ local procedure OnPostVendorEntryOnAfterInitNewLine(var GenJnlLine: Record "Gen. Journal Line"; PurchHeader: Record "Purchase Header")
+ begin
+ GenJnlLine."Transaction Mode Code" := PurchHeader."Transaction Mode Code";
+ GenJnlLine."Recipient Bank Account" := PurchHeader."Bank Account Code";
+ end;
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/RoleCenters/PurchasingMgrRoleCenterNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Purchases/RoleCenters/PurchasingMgrRoleCenterNL.PageExt.al
new file mode 100644
index 0000000000..ee230a865d
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/RoleCenters/PurchasingMgrRoleCenterNL.PageExt.al
@@ -0,0 +1,23 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.RoleCenters;
+
+using Microsoft.Purchases.History;
+
+pageextension 11322 "PurchasingMgrRoleCenterNL" extends "Purchasing Manager Role Center"
+{
+ actions
+ {
+ addafter("Credit Memos")
+ {
+ action("CMR - Return Shipment")
+ {
+ ApplicationArea = Suite;
+ Caption = 'CMR - Return Shipment';
+ RunObject = report "CMR - Return Shipment";
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Vendor/StandardVendorPurchaseCodeNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Purchases/Vendor/StandardVendorPurchaseCodeNL.Codeunit.al
new file mode 100644
index 0000000000..142612e242
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Vendor/StandardVendorPurchaseCodeNL.Codeunit.al
@@ -0,0 +1,17 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Vendor;
+
+using Microsoft.Purchases.Document;
+
+codeunit 11330 StandardVendorPurchaseCodeNL
+{
+ [EventSubscriber(ObjectType::Table, Database::"Standard Vendor Purchase Code", 'OnBeforeApplyStdCodesToPurchaseLines', '', false, false)]
+ local procedure OnBeforeApplyStdCodesToPurchaseLines(var PurchLine: Record "Purchase Line"; StdPurchLine: Record "Standard Purchase Line")
+ begin
+ if not StdPurchLine.EmptyLine() then
+ PurchLine."Suggested Line" := true;
+ end;
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorBankAccCardNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorBankAccCardNL.PageExt.al
new file mode 100644
index 0000000000..f79e407bf5
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorBankAccCardNL.PageExt.al
@@ -0,0 +1,49 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Vendor;
+
+pageextension 11303 VendorBankAccCardNL extends "Vendor Bank Account Card"
+{
+ layout
+ {
+ addafter(Transfer)
+ {
+ group("Account Holder")
+ {
+ Caption = 'Account Holder';
+ field("Account Holder Name"; Rec."Account Holder Name")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ field("Account Holder Address"; Rec."Account Holder Address")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ field("Account Holder Post Code"; Rec."Account Holder Post Code")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Account Holder Post Code/City';
+ }
+ field("Account Holder City"; Rec."Account Holder City")
+ {
+ ApplicationArea = Basic, Suite;
+ ShowCaption = false;
+ }
+ field("Acc. Hold. Country/Region Code"; Rec."Acc. Hold. Country/Region Code")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ field("National Bank Code"; Rec."National Bank Code")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ field("Abbrev. National Bank Code"; Rec."Abbrev. National Bank Code")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorBankAccountNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorBankAccountNL.TableExt.al
new file mode 100644
index 0000000000..f59c5df3dc
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorBankAccountNL.TableExt.al
@@ -0,0 +1,97 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Vendor;
+
+using Microsoft.Foundation.Address;
+using Microsoft.Utilities;
+
+tableextension 11302 VendorBankAccountNL extends "Vendor Bank Account"
+{
+ fields
+ {
+ field(11000000; "Account Holder Name"; Text[100])
+ {
+ Caption = 'Account Holder Name';
+ DataClassification = EndUserIdentifiableInformation;
+ }
+ field(11000001; "Account Holder Address"; Text[100])
+ {
+ Caption = 'Account Holder Address';
+ DataClassification = EndUserIdentifiableInformation;
+ }
+ field(11000002; "Account Holder Post Code"; Code[20])
+ {
+ Caption = 'Account Holder Post Code';
+ DataClassification = EndUserIdentifiableInformation;
+ TableRelation = if ("Acc. Hold. Country/Region Code" = const('')) "Post Code"
+ else
+ if ("Acc. Hold. Country/Region Code" = filter(<> '')) "Post Code" where("Country/Region Code" = field("Acc. Hold. Country/Region Code"));
+ ValidateTableRelation = false;
+
+ trigger OnValidate()
+ begin
+ PostCode.ValidatePostCode("Account Holder City", "Account Holder Post Code", County, "Acc. Hold. Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
+ end;
+ }
+ field(11000003; "Account Holder City"; Text[30])
+ {
+ Caption = 'Account Holder City';
+ DataClassification = EndUserIdentifiableInformation;
+ TableRelation = if ("Acc. Hold. Country/Region Code" = const('')) "Post Code".City
+ else
+ if ("Acc. Hold. Country/Region Code" = filter(<> '')) "Post Code".City where("Country/Region Code" = field("Acc. Hold. Country/Region Code"));
+ ValidateTableRelation = false;
+
+ trigger OnValidate()
+ begin
+ PostCode.ValidateCity("Account Holder City", "Account Holder Post Code", County, "Acc. Hold. Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
+ end;
+ }
+ field(11000004; "Acc. Hold. Country/Region Code"; Code[10])
+ {
+ Caption = 'Acc. Hold. Country/Region Code';
+ DataClassification = EndUserIdentifiableInformation;
+ TableRelation = "Country/Region";
+ }
+ field(11000005; "National Bank Code"; Code[10])
+ {
+ Caption = 'National Bank Code';
+ DataClassification = EndUserIdentifiableInformation;
+ }
+ field(11000007; "Abbrev. National Bank Code"; Code[3])
+ {
+ Caption = 'Abbrev. National Bank Code';
+ DataClassification = EndUserIdentifiableInformation;
+ }
+
+ modify("Bank Account No.")
+ {
+ trigger OnAfterValidate()
+ var
+ LocalFunctionalityMgt: Codeunit "Local Functionality Mgt.";
+ begin
+ if not LocalFunctionalityMgt.CheckBankAccNo("Bank Account No.", "Country/Region Code", "Bank Account No.") then
+ Message(BankAccNoMayBeIncorrectMsg, "Bank Account No.");
+ end;
+ }
+ }
+
+ trigger OnInsert()
+ var
+ Vendor: Record Vendor;
+ begin
+ Vendor.SetLoadFields(Name, Address, "Post Code", City, "Country/Region Code");
+ Vendor.Get("Vendor No.");
+ "Account Holder Name" := Vendor.Name;
+ "Account Holder Address" := Vendor.Address;
+ "Account Holder Post Code" := Vendor."Post Code";
+ "Account Holder City" := Vendor.City;
+ "Acc. Hold. Country/Region Code" := Vendor."Country/Region Code";
+ end;
+
+ var
+ PostCode: Record "Post Code";
+ BankAccNoMayBeIncorrectMsg: Label 'Bank Account No. %1 may be incorrect.';
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorCardNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorCardNL.PageExt.al
new file mode 100644
index 0000000000..2588eb082d
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorCardNL.PageExt.al
@@ -0,0 +1,35 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Vendor;
+
+pageextension 11301 VendorCardNL extends "Vendor Card"
+{
+ layout
+ {
+ addafter("Payment Terms Code")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the transaction mode used in telebanking.';
+ }
+ }
+ addafter(City)
+ {
+#if not CLEAN29
+ group(Control198)
+ {
+ ObsoleteReason = 'Replaced by Control1199';
+ ObsoleteState = Pending;
+ ObsoleteTag = '29.0';
+ }
+#endif
+ }
+ modify("EORI Number")
+ {
+ Visible = true;
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorNL.TableExt.al
new file mode 100644
index 0000000000..6605057cf3
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorNL.TableExt.al
@@ -0,0 +1,129 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Vendor;
+
+using Microsoft.Bank.Payment;
+
+tableextension 11300 "Vendor NL" extends Vendor
+{
+ fields
+ {
+ field(11000000; "Transaction Mode Code"; Code[20])
+ {
+ Caption = 'Transaction Mode Code';
+ DataClassification = CustomerContent;
+ TableRelation = "Transaction Mode".Code where("Account Type" = const(Vendor));
+
+ trigger OnValidate()
+ var
+ TransactionMode: Record "Transaction Mode";
+ begin
+ if "Transaction Mode Code" <> '' then begin
+ TransactionMode.Get(TransactionMode."Account Type"::Vendor, "Transaction Mode Code");
+ if TransactionMode."Payment Method Code" <> '' then
+ "Payment Method Code" := TransactionMode."Payment Method Code";
+ if TransactionMode."Payment Terms Code" <> '' then
+ "Payment Terms Code" := TransactionMode."Payment Terms Code";
+ end;
+ end;
+ }
+
+ modify(Name)
+ {
+ trigger OnAfterValidate()
+ begin
+ UpdateVendorBankAccounts(FieldCaption(Name));
+ end;
+ }
+
+ modify(Address)
+ {
+ trigger OnAfterValidate()
+ begin
+ UpdateVendorBankAccounts(FieldCaption(Address));
+ end;
+ }
+
+ modify(City)
+ {
+ trigger OnAfterValidate()
+ begin
+ UpdateVendorBankAccounts(FieldCaption(City));
+ end;
+ }
+
+ modify("Country/Region Code")
+ {
+ trigger OnAfterValidate()
+ begin
+ UpdateVendorBankAccounts(FieldCaption("Country/Region Code"));
+ end;
+ }
+
+ modify("Post Code")
+ {
+ trigger OnAfterValidate()
+ begin
+ UpdateVendorBankAccounts(FieldCaption("Post Code"));
+ end;
+ }
+
+ modify("Partner Type")
+ {
+ trigger OnAfterValidate()
+ var
+ TransactionMode: Record "Transaction Mode";
+ AccountType: Option Customer,Vendor,Employee;
+ begin
+ if not TransactionMode.CheckTransactionModePartnerType(AccountType::Vendor, "Transaction Mode Code", "Partner Type") then
+ if not Confirm(PartnerTypeMismatchMsg, false) then
+ Error('');
+ end;
+ }
+ }
+
+ var
+ UpdateBankAccountsQst: Label 'Do you want to update the bank accounts for this vendor to reflect the new value of %1?', Comment = '%1 = Field Caption';
+ PartnerTypeMismatchMsg: Label 'The Partner Type does not match the Partner Type defined in Transaction Mode. Do you still want to change the Partner Type?';
+
+ [Scope('OnPrem')]
+ procedure UpdateVendorBankAccounts(UseFieldCaption: Text[250])
+ var
+ VendBankAcc: Record "Vendor Bank Account";
+ IsHandled: Boolean;
+ begin
+ IsHandled := false;
+ OnBeforeUpdateVendorBankAccounts(Rec, IsHandled, VendBankAcc);
+ if (not GuiAllowed) or IsHandled then
+ exit;
+
+ VendBankAcc.SetRange("Vendor No.", "No.");
+ if VendBankAcc.FindSet() then begin
+ IsHandled := false;
+ OnUpdateVendorBankAccountsOnBeforeConfirm(Rec, IsHandled);
+ if not IsHandled then
+ if not Confirm(StrSubstNo(UpdateBankAccountsQst, UseFieldCaption)) then
+ exit;
+ repeat
+ VendBankAcc."Account Holder Name" := Name;
+ VendBankAcc."Account Holder Address" := Address;
+ VendBankAcc."Account Holder Post Code" := "Post Code";
+ VendBankAcc."Account Holder City" := City;
+ VendBankAcc."Acc. Hold. Country/Region Code" := "Country/Region Code";
+ VendBankAcc.Modify();
+ until VendBankAcc.Next() = 0;
+ end;
+ end;
+
+ [IntegrationEvent(false, false)]
+ local procedure OnUpdateVendorBankAccountsOnBeforeConfirm(var Vendor: Record Vendor; var IsHandled: Boolean)
+ begin
+ end;
+
+ [IntegrationEvent(true, false)]
+ local procedure OnBeforeUpdateVendorBankAccounts(var Vendor: Record Vendor; var IsHandled: Boolean; var VendorBankAccount: Record "Vendor Bank Account")
+ begin
+ end;
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorTemplCardNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorTemplCardNL.PageExt.al
new file mode 100644
index 0000000000..e7cad9ad26
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorTemplCardNL.PageExt.al
@@ -0,0 +1,20 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Vendor;
+
+pageextension 11305 VendorTemplCardNL extends "Vendor Templ. Card"
+{
+ layout
+ {
+ addafter("Payment Terms Code")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the transaction mode used in telebanking.';
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorTemplNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorTemplNL.TableExt.al
new file mode 100644
index 0000000000..1e9f42da67
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorTemplNL.TableExt.al
@@ -0,0 +1,20 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Purchases.Vendor;
+
+using Microsoft.Bank.Payment;
+
+tableextension 11304 VendorTemplNL extends "Vendor Templ."
+{
+ fields
+ {
+ field(11000000; "Transaction Mode Code"; Code[20])
+ {
+ Caption = 'Transaction Mode Code';
+ DataClassification = CustomerContent;
+ TableRelation = "Transaction Mode".Code where("Account Type" = const(Vendor));
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/RoleCenters/AdministratorMainRCNL.PageExt.al b/src/Layers/NL/BaseApp/Local/RoleCenters/AdministratorMainRCNL.PageExt.al
new file mode 100644
index 0000000000..ca01556444
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/RoleCenters/AdministratorMainRCNL.PageExt.al
@@ -0,0 +1,27 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.RoleCenters;
+
+using Microsoft.Foundation.Address;
+
+pageextension 11350 "Administrator Main RC NL" extends "Administrator Main Role Center"
+{
+ actions
+ {
+ addafter("Electronic Document Formats")
+ {
+ action("Post Code Updates")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Post Code Updates';
+ RunObject = page "Post Code Updates";
+ }
+ }
+ modify("Post Codes")
+ {
+ Visible = false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/RoleCenters/AdministratorRCNL.PageExt.al b/src/Layers/NL/BaseApp/Local/RoleCenters/AdministratorRCNL.PageExt.al
new file mode 100644
index 0000000000..694f445a7e
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/RoleCenters/AdministratorRCNL.PageExt.al
@@ -0,0 +1,94 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.RoleCenters;
+
+using Microsoft.Bank.Payment;
+using Microsoft.Bank.Reconciliation;
+using Microsoft.Finance.Analysis;
+using Microsoft.Finance.VAT.Reporting;
+
+
+pageextension 11351 "Administrator RC NL" extends "Administrator Role Center"
+{
+ actions
+ {
+ addafter("Analysis View")
+ {
+ group(Telebanking)
+ {
+ Caption = 'Telebanking';
+ action("Transaction Modes")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Transaction Modes';
+ RunObject = Page "Transaction Mode List";
+ ToolTip = 'View or edit the transaction modes that are used for telebanking to manage how an order, invoice, or credit memo for a vendor or customer will be paid for or collected.';
+ }
+ action("Export Protocols")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Export Protocols';
+ RunObject = Page "Export Protocols";
+ ToolTip = 'Set up codes for each set of export protocols to be used when exporting a payment history for processing by the bank.';
+ }
+ action("Import Protocols")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Import Protocols';
+ RunObject = Page "Import Protocols";
+ ToolTip = 'Set up codes for each set of import protocols to be used when importing bank statements.';
+ }
+ action("Freely Transferable Maximums")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Freely Transferable Maximums';
+ RunObject = Page "Freely Transferable Maximums";
+ ToolTip = 'Set up freely transferable maximums that denote the maximum amount, for a specific currency, that can be transferred in one payment from one country to another without reason given.';
+ }
+ }
+ group("Tax Declaration")
+ {
+ Caption = 'Tax Declaration';
+ action("Elec. Tax Decl. VAT Categories")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Elec. Tax Decl. VAT Categories';
+ RunObject = Page "Elec. Tax Decl. VAT Categ.";
+ ToolTip = 'Set up all the possible combinations of categories and sub categories that represent a XML element in the electronic VAT declaration. A combination is defined by a code. By entering this code in the Elec. Tax Decl. Category Code field on a VAT statement line, you map the data of the VAT statement directly to a XML element.';
+ }
+ }
+ }
+ addafter("&General Ledger Setup")
+ {
+ action("Elec. Tax Declaration Setup")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Elec. Tax Declaration Setup';
+ RunObject = Page "Elec. Tax Declaration Setup";
+ ToolTip = 'Set up the information that will be used to generate an electronic VAT and ICP declaration, such as the Digipoort configuration. ';
+ }
+ }
+ addafter(SalesAnalysisColumnTmpl)
+ {
+ action(Action121)
+ {
+ ApplicationArea = Advanced;
+ Caption = 'Sales Analysis View List';
+ RunObject = Page "Analysis View List";
+ ToolTip = 'View the list of views that you use to analyze the dynamics of your sales volumes. You can also use the report to analyze your customers'' performance and sales prices.';
+ }
+ }
+ addafter(PurchaseAnalysisColumnTmpl)
+ {
+ action(Action125)
+ {
+ ApplicationArea = Advanced;
+ Caption = 'Purchase Analysis View List';
+ RunObject = Page "Analysis View List";
+ ToolTip = 'View the list of views that you use to analyze the dynamics of your purchase volumes. You can also use the report to analyze your vendors'' performance and purchase prices.';
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/RoleCenters/SmallBusinessOwnerRCNL.PageExt.al b/src/Layers/NL/BaseApp/Local/RoleCenters/SmallBusinessOwnerRCNL.PageExt.al
new file mode 100644
index 0000000000..7ce8b72f78
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/RoleCenters/SmallBusinessOwnerRCNL.PageExt.al
@@ -0,0 +1,79 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.RoleCenters;
+
+using Microsoft.Bank.Journal;
+using Microsoft.Bank.Payment;
+using Microsoft.Bank.Reconciliation;
+using Microsoft.Finance.GeneralLedger.Journal;
+using Microsoft.Finance.VAT.Reporting;
+
+pageextension 11362 "Small Business Owner RC NL" extends "Small Business Owner RC"
+{
+ actions
+ {
+ addafter(Items)
+ {
+ action(Telebanking)
+ {
+ ApplicationArea = Advanced;
+ Caption = 'Telebanking';
+ RunObject = Page "Telebank - Bank Overview";
+ ToolTip = 'Prepare to exchange your payments to vendors and collections from customers with your bank electronically. This includes the export of payment and collection data that need to be forwarded to the bank as well as the import of bank statements sent to you by the bank.';
+ }
+ action("Telebank - Bank Overview")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Telebank - Bank Overview';
+ RunObject = Page "Telebank - Bank Overview";
+ ToolTip = 'View a list of bank accounts that are set up for electronic bank file transfers using the Telebanking functionality.';
+ }
+ }
+ addafter(GeneralJournals)
+ {
+ action("Bank/Giro Journals")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Bank/Giro Journals';
+ RunObject = Page "Bank/Giro Journal List";
+ ToolTip = 'Reconcile a bank account by comparing incoming and outgoing bank transactions to a physical bank statement or by importing an electronic bank statement file, and apply the related payments to open customer or vendor documents.';
+ }
+ action("Cash Journals")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Cash Journals';
+ RunObject = Page "Cash Journal List";
+ ToolTip = 'Post transactions to the cash account in the general ledger.';
+ }
+ }
+ addafter("&Bank Account Reconciliation")
+ {
+ action("Import Bank Statement")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Import Bank Statement';
+ RunObject = Codeunit "Import Protocol Management";
+ ToolTip = 'Prepare to reconcile the bank account by importing an electronic bank statement with the actual bank transactions.';
+ }
+ }
+ addafter("Calc. and Post VAT Settlem&ent")
+ {
+ action("Elec. Tax Declarations")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Elec. Tax Declarations';
+ RunObject = Page "Elec. Tax Declaration List";
+ ToolTip = 'View the list of VAT and ICP declarations that you send to the tax authorities.';
+ }
+ action("Elec. Tax Decl. Response Msgs.")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Elec. Tax Decl. Response Msgs.';
+ RunObject = Page "Elec. Tax Decl. Response Msgs.";
+ ToolTip = 'View all the response messages received from the tax authorities. The status of the response message indicates if the message is processed or not.';
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerBankAccCardNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerBankAccCardNL.PageExt.al
new file mode 100644
index 0000000000..9f567e1b83
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerBankAccCardNL.PageExt.al
@@ -0,0 +1,60 @@
+// ------------------------------------------------------------------------------------------------
+// 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.Customer;
+
+using Microsoft.Bank.DirectDebit;
+
+///
+/// Extends the Customer Bank Account Card page with NL-specific account holder fields and direct debit mandate.
+///
+pageextension 11463 "Customer Bank Acc. Card NL" extends "Customer Bank Account Card"
+{
+ layout
+ {
+ addafter(IBAN)
+ {
+ field("Direct Debit Mandate ID"; Rec."Direct Debit Mandate ID")
+ {
+ ApplicationArea = Basic, Suite;
+ LookupPageID = "SEPA Direct Debit Mandates";
+ ToolTip = 'Specifies the direct debit mandate of the customer that this bank account is for.';
+ }
+ }
+ addlast(content)
+ {
+ group("Account Holder")
+ {
+ Caption = 'Account Holder';
+
+ field("Account Holder Name"; Rec."Account Holder Name")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the bank account owner''s name.';
+ }
+ field("Account Holder Address"; Rec."Account Holder Address")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the bank account owner''s address.';
+ }
+ field("Account Holder Post Code"; Rec."Account Holder Post Code")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Account Holder Post Code/City';
+ ToolTip = 'Specifies the bank account owner''s postal code.';
+ }
+ field("Account Holder City"; Rec."Account Holder City")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the bank account owner''s city.';
+ }
+ field("Acc. Hold. Country/Region Code"; Rec."Acc. Hold. Country/Region Code")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the country/region of the bank account holder.';
+ }
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerBankAccountNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerBankAccountNL.TableExt.al
new file mode 100644
index 0000000000..a58ca22ccd
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerBankAccountNL.TableExt.al
@@ -0,0 +1,199 @@
+// ------------------------------------------------------------------------------------------------
+// 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.Customer;
+
+using Microsoft.Bank.DirectDebit;
+using Microsoft.Bank.Payment;
+using Microsoft.Foundation.Address;
+using Microsoft.Utilities;
+
+///
+/// Extends the Customer Bank Account table with NL-specific account holder and telebanking fields.
+/// Adds telebanking update logic to existing W1 fields via modify() blocks.
+///
+tableextension 11463 "Customer Bank Account NL" extends "Customer Bank Account"
+{
+ fields
+ {
+ ///
+ /// Specifies the bank account owner's name.
+ ///
+ field(11000000; "Account Holder Name"; Text[100])
+ {
+ Caption = 'Account Holder Name';
+ DataClassification = EndUserIdentifiableInformation;
+ }
+ ///
+ /// Specifies the bank account owner's street address.
+ ///
+ field(11000001; "Account Holder Address"; Text[100])
+ {
+ Caption = 'Account Holder Address';
+ DataClassification = EndUserIdentifiableInformation;
+ }
+ ///
+ /// Specifies the bank account owner's postal code.
+ ///
+ field(11000002; "Account Holder Post Code"; Code[20])
+ {
+ Caption = 'Account Holder Post Code';
+ DataClassification = EndUserIdentifiableInformation;
+ TableRelation = if ("Acc. Hold. Country/Region Code" = const('')) "Post Code"
+ else
+ if ("Acc. Hold. Country/Region Code" = filter(<> '')) "Post Code" where("Country/Region Code" = field("Acc. Hold. Country/Region Code"));
+ ValidateTableRelation = false;
+
+ trigger OnValidate()
+ var
+ PostCode: Record "Post Code";
+ begin
+ PostCode.ValidatePostCode("Account Holder City", "Account Holder Post Code", County, "Acc. Hold. Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
+ end;
+ }
+ ///
+ /// Specifies the bank account owner's city.
+ ///
+ field(11000003; "Account Holder City"; Text[30])
+ {
+ Caption = 'Account Holder City';
+ DataClassification = EndUserIdentifiableInformation;
+ TableRelation = if ("Acc. Hold. Country/Region Code" = const('')) "Post Code".City
+ else
+ if ("Acc. Hold. Country/Region Code" = filter(<> '')) "Post Code".City where("Country/Region Code" = field("Acc. Hold. Country/Region Code"));
+ ValidateTableRelation = false;
+
+ trigger OnValidate()
+ var
+ PostCode: Record "Post Code";
+ begin
+ PostCode.ValidateCity("Account Holder City", "Account Holder Post Code", County, "Acc. Hold. Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
+ end;
+ }
+ ///
+ /// Specifies the country or region of the bank account holder.
+ ///
+ field(11000004; "Acc. Hold. Country/Region Code"; Code[10])
+ {
+ Caption = 'Acc. Hold. Country/Region Code';
+ DataClassification = EndUserIdentifiableInformation;
+ TableRelation = "Country/Region";
+ }
+ ///
+ /// Specifies the national bank code for this bank account.
+ ///
+ field(11000005; "National Bank Code"; Code[10])
+ {
+ Caption = 'National Bank Code';
+ DataClassification = EndUserIdentifiableInformation;
+ }
+ ///
+ /// Specifies an abbreviated national bank code for this bank account.
+ ///
+ field(11000007; "Abbrev. National Bank Code"; Code[3])
+ {
+ Caption = 'Abbrev. National Bank Code';
+ DataClassification = EndUserIdentifiableInformation;
+ }
+ ///
+ /// Specifies the direct debit mandate used for collecting payments from this bank account.
+ ///
+ field(11000008; "Direct Debit Mandate ID"; Code[35])
+ {
+ Caption = 'Direct Debit Mandate ID';
+ DataClassification = CustomerContent;
+ TableRelation = "SEPA Direct Debit Mandate" where("Customer No." = field("Customer No."),
+ "Customer Bank Account Code" = field(Code));
+
+ trigger OnValidate()
+ begin
+ UpdateMandateID();
+ end;
+ }
+ modify("Bank Account No.")
+ {
+ trigger OnAfterValidate()
+ var
+ LocalFunctionalityMgt: Codeunit "Local Functionality Mgt.";
+ begin
+ if not LocalFunctionalityMgt.CheckBankAccNo("Bank Account No.", "Country/Region Code", "Bank Account No.") then
+ Message(BankAccNoMayBeIncorrectMsg, "Bank Account No.");
+ UpdateBankAccountNo();
+ end;
+ }
+
+ modify(IBAN)
+ {
+ trigger OnAfterValidate()
+ begin
+ UpdateIBAN();
+ end;
+ }
+
+ modify("SWIFT Code")
+ {
+ trigger OnAfterValidate()
+ begin
+ UpdateSWIFT();
+ end;
+ }
+
+ }
+
+ trigger OnInsert()
+ var
+ Customer: Record Customer;
+ begin
+ Customer.SetLoadFields("Name", "Address", "Post Code", City, "Country/Region Code");
+ Customer.Get("Customer No.");
+ "Account Holder Name" := Customer.Name;
+ "Account Holder Address" := Customer.Address;
+ "Account Holder Post Code" := Customer."Post Code";
+ "Account Holder City" := Customer.City;
+ "Acc. Hold. Country/Region Code" := Customer."Country/Region Code";
+ end;
+
+ var
+ BankAccNoMayBeIncorrectMsg: Label 'Bank Account No. %1 may be incorrect.', Comment = '%1 = Bank Account No.';
+
+ local procedure UpdateMandateID()
+ var
+ ProposalLine: Record "Proposal Line";
+ begin
+ if FindProposalLines(ProposalLine) then
+ ProposalLine.ModifyAll("Direct Debit Mandate ID", "Direct Debit Mandate ID");
+ end;
+
+ local procedure UpdateIBAN()
+ var
+ ProposalLine: Record "Proposal Line";
+ begin
+ if FindProposalLines(ProposalLine) then
+ ProposalLine.ModifyAll(IBAN, IBAN);
+ end;
+
+ local procedure UpdateSWIFT()
+ var
+ ProposalLine: Record "Proposal Line";
+ begin
+ if FindProposalLines(ProposalLine) then
+ ProposalLine.ModifyAll("SWIFT Code", "SWIFT Code");
+ end;
+
+ local procedure UpdateBankAccountNo()
+ var
+ ProposalLine: Record "Proposal Line";
+ begin
+ if FindProposalLines(ProposalLine) then
+ ProposalLine.ModifyAll("Bank Account No.", "Bank Account No.");
+ end;
+
+ local procedure FindProposalLines(var ProposalLine: Record "Proposal Line"): Boolean
+ begin
+ ProposalLine.SetRange("Account Type", ProposalLine."Account Type"::Customer);
+ ProposalLine.SetRange("Account No.", "Customer No.");
+ ProposalLine.SetRange(Bank, Code);
+ exit(not ProposalLine.IsEmpty());
+ end;
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerCardNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerCardNL.PageExt.al
new file mode 100644
index 0000000000..cdd58003d3
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerCardNL.PageExt.al
@@ -0,0 +1,39 @@
+// ------------------------------------------------------------------------------------------------
+// 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.Customer;
+
+///
+/// Extends the Customer Card page with NL-specific telebanking fields.
+///
+pageextension 11462 "Customer Card NL" extends "Customer Card"
+{
+ layout
+ {
+ addafter("Block Payment Tolerance")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the transaction mode commonly used in telebanking for this customer.';
+ }
+ }
+ }
+
+ actions
+ {
+ addafter(Action76)
+ {
+ action(SalesPerPeriod)
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales Per Period';
+ Image = Sales;
+ RunObject = Page "Sales Stats. Per Period";
+ RunPageLink = "Customer No. Filter" = field("No.");
+ ToolTip = 'View sales information for the customer by period.';
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerNL.Codeunit.al
new file mode 100644
index 0000000000..2b5d2d03c9
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerNL.Codeunit.al
@@ -0,0 +1,29 @@
+// ------------------------------------------------------------------------------------------------
+// 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.Customer;
+
+using Microsoft.Bank.Payment;
+
+///
+/// NL-specific event subscribers for the Customer table.
+/// Handles Transaction Mode checks during Partner Type validation and contact updates.
+///
+codeunit 11473 "Customer NL"
+{
+ Access = Internal;
+
+ [EventSubscriber(ObjectType::Table, Database::Customer, 'OnBeforeModifyContactUpdate', '', false, false)]
+ local procedure OnBeforeModifyContactUpdate(var Customer: Record Customer)
+ var
+ TransactionMode: Record "Transaction Mode";
+ AccountType: Option Customer,Vendor,Employee;
+ begin
+ if not TransactionMode.CheckTransactionModePartnerType(AccountType::Customer, Customer."Transaction Mode Code", Customer."Partner Type") then
+ Error(PartnerTypeMismatchErr);
+ end;
+
+ var
+ PartnerTypeMismatchErr: Label 'The Partner Type does not match the Partner Type defined in Transaction Mode.';
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerNL.TableExt.al
new file mode 100644
index 0000000000..29cb4ceb30
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerNL.TableExt.al
@@ -0,0 +1,133 @@
+// ------------------------------------------------------------------------------------------------
+// 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.Customer;
+
+using Microsoft.Bank.Payment;
+
+///
+/// Extends the Customer table with NL-specific telebanking fields.
+/// Propagates customer address changes to CustomerBankAccount holder fields via modify() blocks.
+///
+tableextension 11462 "Customer NL" extends Customer
+{
+ fields
+ {
+ ///
+ /// Specifies the transaction mode commonly used in telebanking for this customer.
+ ///
+ field(11000000; "Transaction Mode Code"; Code[20])
+ {
+ Caption = 'Transaction Mode Code';
+ DataClassification = CustomerContent;
+ TableRelation = "Transaction Mode".Code where("Account Type" = const(Customer));
+
+ trigger OnValidate()
+ var
+ TransactionMode: Record "Transaction Mode";
+ begin
+ if "Transaction Mode Code" <> '' then begin
+ TransactionMode.Get(TransactionMode."Account Type"::Customer, "Transaction Mode Code");
+ if TransactionMode."Payment Method Code" <> '' then
+ "Payment Method Code" := TransactionMode."Payment Method Code";
+ if TransactionMode."Payment Terms Code" <> '' then
+ "Payment Terms Code" := TransactionMode."Payment Terms Code";
+ end;
+ end;
+ }
+ modify(Name)
+ {
+ trigger OnAfterValidate()
+ begin
+ UpdateCustomerBankAccounts(FieldCaption(Name));
+ end;
+ }
+ modify(Address)
+ {
+ trigger OnAfterValidate()
+ begin
+ UpdateCustomerBankAccounts(FieldCaption(Address));
+ end;
+ }
+ modify(City)
+ {
+ trigger OnAfterValidate()
+ begin
+ UpdateCustomerBankAccounts(FieldCaption(City));
+ end;
+ }
+ modify("Country/Region Code")
+ {
+ trigger OnAfterValidate()
+ begin
+ UpdateCustomerBankAccounts(FieldCaption("Country/Region Code"));
+ end;
+ }
+ modify("Post Code")
+ {
+ trigger OnAfterValidate()
+ begin
+ UpdateCustomerBankAccounts(FieldCaption("Post Code"));
+ end;
+ }
+ modify("Partner Type")
+ {
+ trigger OnAfterValidate()
+ var
+ TransactionMode: Record "Transaction Mode";
+ AccountType: Option Customer,Vendor,Employee;
+ IsHandled: Boolean;
+ begin
+ IsHandled := false;
+ OnBeforeValidatePartnerType(IsHandled);
+ if IsHandled then
+ exit;
+
+ if not TransactionMode.CheckTransactionModePartnerType(AccountType::Customer, "Transaction Mode Code", "Partner Type") then
+ if not Confirm(PartnerTypeMismatchQst, false) then
+ Error('')
+ end;
+ }
+ }
+
+ var
+ UpdateBankAccountsQst: Label 'Do you want to update the bank accounts for this customer to reflect the new value of %1?', Comment = '%1 = Field Caption';
+ PartnerTypeMismatchQst: Label 'The Partner Type does not match the Partner Type defined in Transaction Mode. Do you still want to change the Partner Type?';
+
+ [Scope('OnPrem')]
+ procedure UpdateCustomerBankAccounts(UseFieldCaption: Text[250])
+ var
+ CustBankAcc: Record "Customer Bank Account";
+ IsHandled: Boolean;
+ begin
+ IsHandled := false;
+ OnBeforeUpdateCustomerBankAccounts(Rec, IsHandled);
+ if (not GuiAllowed) or IsHandled then
+ exit;
+ CustBankAcc.SetRange("Customer No.", "No.");
+ if CustBankAcc.FindSet() then begin
+ if not Confirm(StrSubstNo(UpdateBankAccountsQst, UseFieldCaption)) then
+ exit;
+ repeat
+ CustBankAcc."Account Holder Name" := Name;
+ CustBankAcc."Account Holder Address" := Address;
+ CustBankAcc."Account Holder Post Code" := "Post Code";
+ CustBankAcc."Account Holder City" := City;
+ CustBankAcc."Acc. Hold. Country/Region Code" := "Country/Region Code";
+ CustBankAcc.Modify();
+ until CustBankAcc.Next() = 0;
+ end;
+ end;
+
+ [IntegrationEvent(false, false)]
+ local procedure OnBeforeUpdateCustomerBankAccounts(var Customer: Record Customer; var IsHandled: Boolean)
+ begin
+ end;
+
+ [IntegrationEvent(true, false)]
+ local procedure OnBeforeValidatePartnerType(var IsHandled: Boolean)
+ begin
+ end;
+}
+
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerTemplCardNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerTemplCardNL.PageExt.al
new file mode 100644
index 0000000000..422cfdc7c1
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerTemplCardNL.PageExt.al
@@ -0,0 +1,23 @@
+// ------------------------------------------------------------------------------------------------
+// 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.Customer;
+
+///
+/// Extends the Customer Templ. Card page with NL-specific telebanking fields.
+///
+pageextension 11464 "Customer Templ. Card NL" extends "Customer Templ. Card"
+{
+ layout
+ {
+ addafter("Block Payment Tolerance")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the transaction mode commonly used in telebanking for customers created from this template.';
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerTemplNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerTemplNL.TableExt.al
new file mode 100644
index 0000000000..401f27bf24
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerTemplNL.TableExt.al
@@ -0,0 +1,26 @@
+// ------------------------------------------------------------------------------------------------
+// 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.Customer;
+
+using Microsoft.Bank.Payment;
+
+///
+/// Extends the Customer Templ. table with NL-specific telebanking fields.
+///
+tableextension 11464 "Customer Templ. NL" extends "Customer Templ."
+{
+ fields
+ {
+ ///
+ /// Specifies the transaction mode commonly used in telebanking for customers created from this template.
+ ///
+ field(11000000; "Transaction Mode Code"; Code[20])
+ {
+ Caption = 'Transaction Mode Code';
+ DataClassification = CustomerContent;
+ TableRelation = "Transaction Mode".Code where("Account Type" = const(Customer));
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerbankAccountListNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerbankAccountListNL.PageExt.al
new file mode 100644
index 0000000000..c523af22c9
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerbankAccountListNL.PageExt.al
@@ -0,0 +1,24 @@
+// ------------------------------------------------------------------------------------------------
+// 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.Customer;
+
+using Microsoft.Bank.DirectDebit;
+
+pageextension 11344 "Customer Bank Account List NL" extends "Customer Bank Account List"
+{
+ layout
+ {
+ addafter(IBAN)
+ {
+ field("Direct Debit Mandate ID"; Rec."Direct Debit Mandate ID")
+ {
+ ApplicationArea = Basic, Suite;
+ LookupPageID = "SEPA Direct Debit Mandates";
+ ToolTip = 'Specifies the direct debit mandate of the customer that this bank account is for.';
+ Visible = false;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Document/SalesCreditMemoNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Sales/Document/SalesCreditMemoNL.PageExt.al
new file mode 100644
index 0000000000..8c2eaaf385
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Document/SalesCreditMemoNL.PageExt.al
@@ -0,0 +1,28 @@
+// ------------------------------------------------------------------------------------------------
+// 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;
+
+///
+/// Extends the Sales Credit Memo page with NL-specific telebanking fields.
+///
+pageextension 11467 "Sales Credit Memo NL" extends "Sales Credit Memo"
+{
+ layout
+ {
+ addafter("Customer Posting Group")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the transaction mode used in telebanking.';
+ }
+ field("Bank Account Code"; Rec."Bank Account Code")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the customer''s bank account that is used for payments and collections through telebanking.';
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Document/SalesHeaderNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Sales/Document/SalesHeaderNL.Codeunit.al
new file mode 100644
index 0000000000..1e2fa70eba
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Document/SalesHeaderNL.Codeunit.al
@@ -0,0 +1,29 @@
+// ------------------------------------------------------------------------------------------------
+// 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.Sales.Customer;
+
+///
+/// NL-specific event subscribers for the Sales Header table.
+/// Sets NL telebanking fields when the bill-to customer is updated.
+///
+codeunit 11474 "Sales Header NL"
+{
+ Access = Internal;
+
+ [EventSubscriber(ObjectType::Table, Database::"Sales Header", 'OnAfterSetFieldsBilltoCustomer', '', false, false)]
+ local procedure OnAfterSetFieldsBilltoCustomer(var SalesHeader: Record "Sales Header"; Customer: Record Customer; xSalesHeader: Record "Sales Header"; SkipBillToContact: Boolean; CurrentFieldNo: Integer)
+ begin
+ SalesHeader."Transaction Mode Code" := Customer."Transaction Mode Code";
+ SalesHeader."Bank Account Code" := Customer."Preferred Bank Account Code";
+ end;
+
+ [EventSubscriber(ObjectType::Table, Database::"Sales Header", 'OnAfterValidateBillToCustomerPaymentFields', '', false, false)]
+ local procedure OnAfterValidateBillToCustomerPaymentFields(var SalesHeader: Record "Sales Header")
+ begin
+ SalesHeader.Validate("Transaction Mode Code");
+ end;
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Document/SalesHeaderNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Sales/Document/SalesHeaderNL.TableExt.al
new file mode 100644
index 0000000000..e25c4064f0
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Document/SalesHeaderNL.TableExt.al
@@ -0,0 +1,49 @@
+// ------------------------------------------------------------------------------------------------
+// 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.Bank.Payment;
+using Microsoft.Sales.Customer;
+
+///
+/// Extends the Sales Header table with NL-specific telebanking fields.
+///
+tableextension 11465 "Sales Header NL" extends "Sales Header"
+{
+ fields
+ {
+ ///
+ /// Specifies the transaction mode used in telebanking for this sales document.
+ ///
+ field(11000000; "Transaction Mode Code"; Code[20])
+ {
+ Caption = 'Transaction Mode Code';
+ DataClassification = CustomerContent;
+ TableRelation = "Transaction Mode".Code where("Account Type" = const(Customer));
+
+ trigger OnValidate()
+ var
+ TrMode: Record "Transaction Mode";
+ begin
+ if "Transaction Mode Code" <> '' then begin
+ TrMode.Get(TrMode."Account Type"::Customer, "Transaction Mode Code");
+ if TrMode."Payment Method Code" <> '' then
+ Validate("Payment Method Code", TrMode."Payment Method Code");
+ if TrMode."Payment Terms Code" <> '' then
+ Validate("Payment Terms Code", TrMode."Payment Terms Code");
+ end;
+ end;
+ }
+ ///
+ /// Specifies the customer's bank account used for payments and collections through telebanking.
+ ///
+ field(11000001; "Bank Account Code"; Code[20])
+ {
+ Caption = 'Bank Account Code';
+ DataClassification = CustomerContent;
+ TableRelation = "Customer Bank Account".Code where("Customer No." = field("Bill-to Customer No."));
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Document/SalesInvoiceNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Sales/Document/SalesInvoiceNL.PageExt.al
new file mode 100644
index 0000000000..54b137718e
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Document/SalesInvoiceNL.PageExt.al
@@ -0,0 +1,28 @@
+// ------------------------------------------------------------------------------------------------
+// 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;
+
+///
+/// Extends the Sales Invoice page with NL-specific telebanking fields.
+///
+pageextension 11466 "Sales Invoice NL" extends "Sales Invoice"
+{
+ layout
+ {
+ addafter("Direct Debit Mandate ID")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the transaction mode used in telebanking.';
+ }
+ field("Bank Account Code"; Rec."Bank Account Code")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the customer''s bank account that is used for payments and collections through telebanking.';
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Document/SalesOrderNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Sales/Document/SalesOrderNL.PageExt.al
new file mode 100644
index 0000000000..710332e822
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Document/SalesOrderNL.PageExt.al
@@ -0,0 +1,28 @@
+// ------------------------------------------------------------------------------------------------
+// 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;
+
+///
+/// Extends the Sales Order page with NL-specific telebanking fields.
+///
+pageextension 11465 "Sales Order NL" extends "Sales Order"
+{
+ layout
+ {
+ addafter("Customer Posting Group")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the transaction mode used in telebanking.';
+ }
+ field("Bank Account Code"; Rec."Bank Account Code")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the customer''s bank account that is used for payments and collections through telebanking.';
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Document/SalesQuoteNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Sales/Document/SalesQuoteNL.PageExt.al
new file mode 100644
index 0000000000..6dfae1b973
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Document/SalesQuoteNL.PageExt.al
@@ -0,0 +1,28 @@
+// ------------------------------------------------------------------------------------------------
+// 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;
+
+///
+/// Extends the Sales Quote page with NL-specific telebanking fields.
+///
+pageextension 11468 "Sales Quote NL" extends "Sales Quote"
+{
+ layout
+ {
+ addafter("Payment Terms Code")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the transaction mode used in telebanking.';
+ }
+ field("Bank Account Code"; Rec."Bank Account Code")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the customer''s bank account that is used for payments and collections through telebanking.';
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Document/SalesReturnOrderNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Sales/Document/SalesReturnOrderNL.PageExt.al
new file mode 100644
index 0000000000..8c2d01b24f
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Document/SalesReturnOrderNL.PageExt.al
@@ -0,0 +1,28 @@
+// ------------------------------------------------------------------------------------------------
+// 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;
+
+///
+/// Extends the Sales Return Order page with NL-specific telebanking fields.
+///
+pageextension 11469 "Sales Return Order NL" extends "Sales Return Order"
+{
+ layout
+ {
+ addafter("Payment Method Code")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = SalesReturnOrder;
+ ToolTip = 'Specifies the transaction mode used in telebanking.';
+ }
+ field("Bank Account Code"; Rec."Bank Account Code")
+ {
+ ApplicationArea = SalesReturnOrder;
+ ToolTip = 'Specifies the customer''s bank account that is used for payments and collections through telebanking.';
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/History/PostedSalesCreditMemoNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Sales/History/PostedSalesCreditMemoNL.PageExt.al
new file mode 100644
index 0000000000..88f4f0dfcf
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/History/PostedSalesCreditMemoNL.PageExt.al
@@ -0,0 +1,30 @@
+// ------------------------------------------------------------------------------------------------
+// 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.History;
+
+///
+/// Extends the Posted Sales Credit Memo page with NL-specific telebanking fields.
+///
+pageextension 11472 "Posted Sales Credit Memo NL" extends "Posted Sales Credit Memo"
+{
+ layout
+ {
+ addafter("Payment Method Code")
+ {
+ field("Transaction Mode"; Rec."Transaction Mode")
+ {
+ ApplicationArea = Basic, Suite;
+ Editable = false;
+ ToolTip = 'Specifies the transaction mode used in telebanking.';
+ }
+ field("Bank Account"; Rec."Bank Account")
+ {
+ ApplicationArea = Basic, Suite;
+ Editable = false;
+ ToolTip = 'Specifies the customer''s bank account used for payments and collections through telebanking.';
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/History/PostedSalesInvoiceNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Sales/History/PostedSalesInvoiceNL.PageExt.al
new file mode 100644
index 0000000000..10c8c21c50
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/History/PostedSalesInvoiceNL.PageExt.al
@@ -0,0 +1,30 @@
+// ------------------------------------------------------------------------------------------------
+// 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.History;
+
+///
+/// Extends the Posted Sales Invoice page with NL-specific telebanking fields.
+///
+pageextension 11471 "Posted Sales Invoice NL" extends "Posted Sales Invoice"
+{
+ layout
+ {
+ addafter("Location Code")
+ {
+ field("Transaction Mode"; Rec."Transaction Mode")
+ {
+ ApplicationArea = Basic, Suite;
+ Editable = false;
+ ToolTip = 'Specifies the transaction mode used in telebanking.';
+ }
+ field("Bank Account"; Rec."Bank Account")
+ {
+ ApplicationArea = Basic, Suite;
+ Editable = false;
+ ToolTip = 'Specifies the customer''s bank account used for payments and collections through telebanking.';
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/History/SalesCrMemoHeaderNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Sales/History/SalesCrMemoHeaderNL.TableExt.al
new file mode 100644
index 0000000000..4cd921ad31
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/History/SalesCrMemoHeaderNL.TableExt.al
@@ -0,0 +1,36 @@
+// ------------------------------------------------------------------------------------------------
+// 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.History;
+
+using Microsoft.Bank.Payment;
+using Microsoft.Sales.Customer;
+
+///
+/// Extends the Sales Cr. Memo Header table with NL-specific telebanking fields.
+///
+tableextension 11467 "Sales Cr. Memo Header NL" extends "Sales Cr.Memo Header"
+{
+ fields
+ {
+ ///
+ /// Specifies the transaction mode used in telebanking for this posted sales credit memo.
+ ///
+ field(11000000; "Transaction Mode"; Code[20])
+ {
+ Caption = 'Transaction Mode';
+ DataClassification = CustomerContent;
+ TableRelation = "Transaction Mode".Code where("Account Type" = const(Customer));
+ }
+ ///
+ /// Specifies the customer's bank account used for payments and collections through telebanking.
+ ///
+ field(11000001; "Bank Account"; Code[20])
+ {
+ Caption = 'Bank Account';
+ DataClassification = CustomerContent;
+ TableRelation = "Customer Bank Account".Code where("Customer No." = field("Sell-to Customer No."));
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/History/SalesInvoiceHeaderNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Sales/History/SalesInvoiceHeaderNL.TableExt.al
new file mode 100644
index 0000000000..2fb6071766
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/History/SalesInvoiceHeaderNL.TableExt.al
@@ -0,0 +1,36 @@
+// ------------------------------------------------------------------------------------------------
+// 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.History;
+
+using Microsoft.Bank.Payment;
+using Microsoft.Sales.Customer;
+
+///
+/// Extends the Sales Invoice Header table with NL-specific telebanking fields.
+///
+tableextension 11466 "Sales Invoice Header NL" extends "Sales Invoice Header"
+{
+ fields
+ {
+ ///
+ /// Specifies the transaction mode used in telebanking for this posted sales invoice.
+ ///
+ field(11000000; "Transaction Mode"; Code[20])
+ {
+ Caption = 'Transaction Mode';
+ DataClassification = CustomerContent;
+ TableRelation = "Transaction Mode".Code where("Account Type" = const(Customer));
+ }
+ ///
+ /// Specifies the customer's bank account used for payments and collections through telebanking.
+ ///
+ field(11000001; "Bank Account"; Code[20])
+ {
+ Caption = 'Bank Account';
+ DataClassification = CustomerContent;
+ TableRelation = "Customer Bank Account".Code where("Customer No." = field("Sell-to Customer No."));
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Posting/SalesPostPrepayNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Sales/Posting/SalesPostPrepayNL.Codeunit.al
new file mode 100644
index 0000000000..e33c01ebcc
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Posting/SalesPostPrepayNL.Codeunit.al
@@ -0,0 +1,18 @@
+// ------------------------------------------------------------------------------------------------
+// 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.Posting;
+
+using Microsoft.Finance.GeneralLedger.Journal;
+using Microsoft.Sales.Document;
+
+codeunit 11339 SalesPostPrepayNL
+{
+ [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post Prepayments", 'OnBeforePostCustomerEntry', '', false, false)]
+ local procedure OnBeforePostCustomerEntry(var GenJnlLine: Record "Gen. Journal Line"; SalesHeader: Record "Sales Header")
+ begin
+ GenJnlLine."Transaction Mode Code" := SalesHeader."Transaction Mode Code";
+ GenJnlLine."Recipient Bank Account" := SalesHeader."Bank Account Code";
+ end;
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Receivables/ApplyCustomerEntriesNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Sales/Receivables/ApplyCustomerEntriesNL.PageExt.al
new file mode 100644
index 0000000000..b0a2eddc14
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Receivables/ApplyCustomerEntriesNL.PageExt.al
@@ -0,0 +1,20 @@
+// ------------------------------------------------------------------------------------------------
+// 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.Receivables;
+
+pageextension 11332 "Apply Customer Entries NL" extends "Apply Customer Entries"
+{
+ layout
+ {
+ addafter(Positive)
+ {
+ field("Payments in Process"; Rec."Payments in Process")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the total amount of payments/collections in process.';
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Receivables/CustEntryEditNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Sales/Receivables/CustEntryEditNL.Codeunit.al
new file mode 100644
index 0000000000..2fa95e5da7
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Receivables/CustEntryEditNL.Codeunit.al
@@ -0,0 +1,14 @@
+// ------------------------------------------------------------------------------------------------
+// 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.Receivables;
+
+codeunit 11322 CustEntryEditNL
+{
+ [EventSubscriber(ObjectType::Codeunit, Codeunit::"Cust. Entry-Edit", 'OnBeforeCustLedgEntryModify', '', false, false)]
+ local procedure OnBeforeCustLedgEntryModify(var CustLedgEntry: Record "Cust. Ledger Entry"; FromCustLedgEntry: Record "Cust. Ledger Entry")
+ begin
+ CustLedgEntry."Transaction Mode Code" := FromCustLedgEntry."Transaction Mode Code";
+ end;
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Receivables/CustLedgerEntryNL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Sales/Receivables/CustLedgerEntryNL.Codeunit.al
new file mode 100644
index 0000000000..9bf5e01b4b
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Receivables/CustLedgerEntryNL.Codeunit.al
@@ -0,0 +1,16 @@
+// ------------------------------------------------------------------------------------------------
+// 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.Receivables;
+
+using Microsoft.Finance.GeneralLedger.Journal;
+
+codeunit 11329 CustLedgerEntryNL
+{
+ [EventSubscriber(ObjectType::Table, Database::"Cust. Ledger Entry", 'OnAfterCopyCustLedgerEntryFromGenJnlLine', '', false, false)]
+ local procedure OnAfterCopyVendLedgerEntryFromGenJnlLine(var CustLedgerEntry: Record "Cust. Ledger Entry"; GenJournalLine: Record "Gen. Journal Line")
+ begin
+ CustLedgerEntry."Transaction Mode Code" := GenJournalLine."Transaction Mode Code";
+ end;
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Receivables/CustLedgerEntryNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Sales/Receivables/CustLedgerEntryNL.TableExt.al
new file mode 100644
index 0000000000..0127d9d552
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Receivables/CustLedgerEntryNL.TableExt.al
@@ -0,0 +1,79 @@
+// ------------------------------------------------------------------------------------------------
+// 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.Receivables;
+
+using Microsoft.Bank.Payment;
+
+///
+/// Extends the Cust. Ledger Entry table with NL-specific telebanking and payment processing fields.
+///
+tableextension 11468 "Cust. Ledger Entry NL" extends "Cust. Ledger Entry"
+{
+ fields
+ {
+ ///
+ /// Specifies the transaction mode used in telebanking for this customer ledger entry.
+ ///
+ field(11000000; "Transaction Mode Code"; Code[20])
+ {
+ Caption = 'Transaction Mode Code';
+ DataClassification = CustomerContent;
+ TableRelation = "Transaction Mode".Code where("Account Type" = const(Customer));
+
+ trigger OnValidate()
+ begin
+ end;
+ }
+ ///
+ /// Specifies the total amount of payments or collections in process for this entry.
+ ///
+ field(11000002; "Payments in Process"; Decimal)
+ {
+ AutoFormatType = 1;
+ AutoFormatExpression = Rec."Currency Code";
+ BlankZero = true;
+ CalcFormula = sum("Detail Line"."Amount (Entry)" where("Serial No. (Entry)" = field("Entry No."),
+ Status = const("In process"),
+ "Account Type" = const(Customer),
+ "Connect Batches" = field("Connect Batches Filter"),
+ "Connect Lines" = field("Connect Lines Filter"),
+ "Our Bank" = field("Our Bank Filter")));
+ Caption = 'Payments in Process';
+ Editable = false;
+ FieldClass = FlowField;
+ }
+ ///
+ /// Specifies the filter for connect batches used in telebanking payment processing.
+ ///
+ field(11000003; "Connect Batches Filter"; Code[20])
+ {
+ Caption = 'Connect Batches Filter';
+ FieldClass = FlowFilter;
+ }
+ ///
+ /// Specifies the filter for connect lines used in telebanking payment processing.
+ ///
+ field(11000004; "Connect Lines Filter"; Integer)
+ {
+ Caption = 'Connect Lines Filter';
+ FieldClass = FlowFilter;
+ }
+ ///
+ /// Specifies the filter for the bank used in telebanking payment processing.
+ ///
+ field(11000005; "Our Bank Filter"; Code[20])
+ {
+ Caption = 'Our Bank Filter';
+ FieldClass = FlowFilter;
+ }
+ }
+
+ keys
+ {
+ key(TransactionMode; "Transaction Mode Code")
+ {
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Receivables/CustomerLedgerEntriesNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Sales/Receivables/CustomerLedgerEntriesNL.PageExt.al
new file mode 100644
index 0000000000..409f8a23b7
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Receivables/CustomerLedgerEntriesNL.PageExt.al
@@ -0,0 +1,31 @@
+// ------------------------------------------------------------------------------------------------
+// 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.Receivables;
+
+///
+/// Extends the Customer Ledger Entries page with NL-specific telebanking fields.
+///
+pageextension 11470 "Customer Ledger Entries NL" extends "Customer Ledger Entries"
+{
+ layout
+ {
+ addafter("Remaining Amt. (LCY)")
+ {
+ field("Payments in Process"; Rec."Payments in Process")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the total amount of payments/collections in process.';
+ }
+ }
+ addafter("G/L Register No.")
+ {
+ field("Transaction Mode Code"; Rec."Transaction Mode Code")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the way a ledger entry can be paid or collected through telebanking.';
+ }
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/Local/Sales/Setup/SalesReceivablesSetupNL.TableExt.al b/src/Layers/NL/BaseApp/Local/Sales/Setup/SalesReceivablesSetupNL.TableExt.al
new file mode 100644
index 0000000000..c7f1e139b6
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Sales/Setup/SalesReceivablesSetupNL.TableExt.al
@@ -0,0 +1,23 @@
+// ------------------------------------------------------------------------------------------------
+// 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.Setup;
+
+///
+/// Extends the Sales and Receivables Setup table with NL-specific configuration fields.
+///
+tableextension 11469 "Sales Receivables Setup NL" extends "Sales & Receivables Setup"
+{
+ fields
+ {
+ ///
+ /// Specifies whether orders are enabled in the NL sales workflow.
+ ///
+ field(11316; Orders; Boolean)
+ {
+ Caption = 'Orders';
+ DataClassification = CustomerContent;
+ }
+ }
+}
diff --git a/src/Layers/NL/BaseApp/SandboxCleanuplocal.Codeunit.al b/src/Layers/NL/BaseApp/Local/SandboxCleanuplocal.Codeunit.al
similarity index 100%
rename from src/Layers/NL/BaseApp/SandboxCleanuplocal.Codeunit.al
rename to src/Layers/NL/BaseApp/Local/SandboxCleanuplocal.Codeunit.al
diff --git a/src/Layers/NL/BaseApp/Upgrade/ElecTaxDeclUpgrade.Codeunit.al b/src/Layers/NL/BaseApp/Local/Upgrade/ElecTaxDeclUpgrade.Codeunit.al
similarity index 73%
rename from src/Layers/NL/BaseApp/Upgrade/ElecTaxDeclUpgrade.Codeunit.al
rename to src/Layers/NL/BaseApp/Local/Upgrade/ElecTaxDeclUpgrade.Codeunit.al
index dc37ccdb06..6149713d1f 100644
--- a/src/Layers/NL/BaseApp/Upgrade/ElecTaxDeclUpgrade.Codeunit.al
+++ b/src/Layers/NL/BaseApp/Local/Upgrade/ElecTaxDeclUpgrade.Codeunit.al
@@ -34,16 +34,15 @@ codeunit 104171 "Elec. Tax. Decl. Upgrade"
exit;
if ElecTaxDeclarationSetup.Get() then begin
- ElecTaxDeclarationSetup.Validate("Tax Decl. Schema Version", SchemaVersionTxt);
- ElecTaxDeclarationSetup.Validate("Tax Decl. BD Data Endpoint", BDDataEndpointTxt);
- ElecTaxDeclarationSetup.Validate("Tax Decl. BD Tuples Endpoint", BDTuplesEndpointTxt);
- ElecTaxDeclarationSetup.Validate("Tax Decl. Schema Endpoint", TaxDeclarationSchemaEndpointTxt);
- ElecTaxDeclarationSetup.Validate("ICP Decl. Schema Endpoint", ICPDeclarationSchemaEndpointTxt);
- ElecTaxDeclarationSetup.Modify(true);
+ ElecTaxDeclarationSetup."Tax Decl. Schema Version" := SchemaVersionTxt;
+ ElecTaxDeclarationSetup."Tax Decl. BD Data Endpoint" := BDDataEndpointTxt;
+ ElecTaxDeclarationSetup."Tax Decl. BD Tuples Endpoint" := BDTuplesEndpointTxt;
+ ElecTaxDeclarationSetup."Tax Decl. Schema Endpoint" := TaxDeclarationSchemaEndpointTxt;
+ ElecTaxDeclarationSetup."ICP Decl. Schema Endpoint" := ICPDeclarationSchemaEndpointTxt;
+ ElecTaxDeclarationSetup.Modify(false);
end;
UpgradeTag.SetUpgradeTag(UpgradeTagDefCountry.GetElecTaxDeclSetupUpgradeTag());
end;
-
}
diff --git a/src/Layers/NL/BaseApp/Upgrade/UPGSEPANL.Codeunit.al b/src/Layers/NL/BaseApp/Local/Upgrade/UPGSEPANL.Codeunit.al
similarity index 87%
rename from src/Layers/NL/BaseApp/Upgrade/UPGSEPANL.Codeunit.al
rename to src/Layers/NL/BaseApp/Local/Upgrade/UPGSEPANL.Codeunit.al
index 4999108a53..42de9666ff 100644
--- a/src/Layers/NL/BaseApp/Upgrade/UPGSEPANL.Codeunit.al
+++ b/src/Layers/NL/BaseApp/Local/Upgrade/UPGSEPANL.Codeunit.al
@@ -13,7 +13,7 @@ codeunit 104170 "UPG SEPA NL"
begin
if not HybridDeployment.VerifyCanStartUpgrade(CompanyName()) then
exit;
-
+
UpgradeLocalSEPAInstrPrtyInGenLedgSetup();
end;
@@ -27,8 +27,8 @@ codeunit 104170 "UPG SEPA NL"
exit;
if GeneralLedgerSetup.Get() then begin
- GeneralLedgerSetup.Validate("Local SEPA Instr. Priority", true);
- GeneralLedgerSetup.Modify(true);
+ GeneralLedgerSetup."Local SEPA Instr. Priority" := true;
+ GeneralLedgerSetup.Modify(false);
end;
UpgradeTag.SetUpgradeTag(UpgradeTagDefCountry.GetLocalSEPAInstrPrtyUpgradeTag());
diff --git a/src/Layers/NL/BaseApp/Upgrade/UpgradeTagDefCountry.Codeunit.al b/src/Layers/NL/BaseApp/Local/Upgrade/UpgradeTagDefCountry.Codeunit.al
similarity index 100%
rename from src/Layers/NL/BaseApp/Upgrade/UpgradeTagDefCountry.Codeunit.al
rename to src/Layers/NL/BaseApp/Local/Upgrade/UpgradeTagDefCountry.Codeunit.al
diff --git a/src/Layers/NL/BaseApp/Local/Warehouse/RoleCenters/WarehouseManagerRCNL.PageExt.al b/src/Layers/NL/BaseApp/Local/Warehouse/RoleCenters/WarehouseManagerRCNL.PageExt.al
new file mode 100644
index 0000000000..d9f4a2d5bd
--- /dev/null
+++ b/src/Layers/NL/BaseApp/Local/Warehouse/RoleCenters/WarehouseManagerRCNL.PageExt.al
@@ -0,0 +1,24 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Warehouse.RoleCenters;
+
+using Microsoft.Inventory.Transfer;
+
+pageextension 11389 "Warehouse Manager RC NL" extends "Warehouse Manager Role Center"
+{
+ actions
+ {
+ addafter("Whse. - Shipment")
+ {
+ action("CMR - Transfer Shipment")
+ {
+ ApplicationArea = Warehouse;
+ Caption = 'CMR - Transfer Shipment';
+ RunObject = report "CMR - Transfer Shipment";
+ ToolTip = 'Run the CMR - Transfer Shipment report to print the CMR for transfer shipments.';
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Purchases/Document/PurchCrMemoSubform.Page.al b/src/Layers/NL/BaseApp/Purchases/Document/PurchCrMemoSubform.Page.al
index d6dced6588..6c799114ea 100644
--- a/src/Layers/NL/BaseApp/Purchases/Document/PurchCrMemoSubform.Page.al
+++ b/src/Layers/NL/BaseApp/Purchases/Document/PurchCrMemoSubform.Page.al
@@ -423,25 +423,6 @@ page 98 "Purch. Cr. Memo Subform"
ApplicationArea = Basic, Suite;
Visible = ShowNonDedVATInLines;
}
- field(Amount; Rec.Amount)
- {
- ApplicationArea = Basic, Suite;
- BlankZero = true;
- ToolTip = 'Specifies the sum of amounts in the Line Amount field on the document lines.';
- Visible = false;
- }
- field("Amount Including VAT"; Rec."Amount Including VAT")
- {
- ApplicationArea = Basic, Suite;
- BlankZero = true;
- ToolTip = 'Specifies the net amount, including VAT, for this line.';
- Visible = false;
-
- trigger OnValidate()
- begin
- DeltaUpdateTotals();
- end;
- }
field("Allow Item Charge Assignment"; Rec."Allow Item Charge Assignment")
{
ApplicationArea = ItemCharges;
diff --git a/src/Layers/NL/BaseApp/Purchases/Document/PurchInvoiceSubform.Page.al b/src/Layers/NL/BaseApp/Purchases/Document/PurchInvoiceSubform.Page.al
index 6e838255e1..2101e2f65d 100644
--- a/src/Layers/NL/BaseApp/Purchases/Document/PurchInvoiceSubform.Page.al
+++ b/src/Layers/NL/BaseApp/Purchases/Document/PurchInvoiceSubform.Page.al
@@ -349,7 +349,6 @@ page 55 "Purch. Invoice Subform"
field("Tax Area Code"; Rec."Tax Area Code")
{
ApplicationArea = SalesTax;
- Visible = false;
trigger OnValidate()
begin
@@ -444,25 +443,6 @@ page 55 "Purch. Invoice Subform"
ApplicationArea = Basic, Suite;
Visible = ShowNonDedVATInLines;
}
- field(Amount; Rec.Amount)
- {
- ApplicationArea = Basic, Suite;
- BlankZero = true;
- ToolTip = 'Specifies the sum of amounts in the Line Amount field on the document lines.';
- Visible = false;
- }
- field("Amount Including VAT"; Rec."Amount Including VAT")
- {
- ApplicationArea = Basic, Suite;
- BlankZero = true;
- ToolTip = 'Specifies the net amount, including VAT, for this line.';
- Visible = false;
-
- trigger OnValidate()
- begin
- DeltaUpdateTotals();
- end;
- }
field("Allow Item Charge Assignment"; Rec."Allow Item Charge Assignment")
{
ApplicationArea = ItemCharges;
diff --git a/src/Layers/NL/BaseApp/Purchases/Document/PurchaseCreditMemo.Page.al b/src/Layers/NL/BaseApp/Purchases/Document/PurchaseCreditMemo.Page.al
index 4e171033d3..b0a9c58009 100644
--- a/src/Layers/NL/BaseApp/Purchases/Document/PurchaseCreditMemo.Page.al
+++ b/src/Layers/NL/BaseApp/Purchases/Document/PurchaseCreditMemo.Page.al
@@ -434,16 +434,6 @@ page 52 "Purchase Credit Memo"
Editable = IsPostingGroupEditable;
Importance = Additional;
}
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the transaction mode used in telebanking.';
- }
- field("Bank Account Code"; Rec."Bank Account Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the vendor''s bank account that is used for payments and collections through telebanking.';
- }
field("Payment Terms Code"; Rec."Payment Terms Code")
{
ApplicationArea = Basic, Suite;
@@ -1621,8 +1611,6 @@ page 52 "Purchase Credit Memo"
begin
JobQueueUsed := PurchSetup.JobQueueActive();
SetExtDocNoMandatoryCondition();
- PurchSetup.GetRecordOnce();
-
IsPowerAutomatePrivacyNoticeApproved := PrivacyNotice.GetPrivacyNoticeApprovalState(FlowServiceManagement.GetPowerAutomatePrivacyNoticeId()) = "Privacy Notice Approval State"::Agreed;
end;
diff --git a/src/Layers/NL/BaseApp/Purchases/Document/PurchaseHeader.Table.al b/src/Layers/NL/BaseApp/Purchases/Document/PurchaseHeader.Table.al
deleted file mode 100644
index 350fcba066..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/Document/PurchaseHeader.Table.al
+++ /dev/null
@@ -1,9443 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.Document;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.Payment;
-using Microsoft.CRM.BusinessRelation;
-using Microsoft.CRM.Campaign;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Outlook;
-using Microsoft.CRM.Team;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Deferral;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Posting;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.Finance.SalesTax;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.BatchProcessing;
-using Microsoft.Foundation.Company;
-using Microsoft.Foundation.ExtendedText;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Foundation.PaymentTerms;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Foundation.Shipping;
-using Microsoft.Intercompany;
-using Microsoft.Intercompany.Partner;
-using Microsoft.Intercompany.Setup;
-using Microsoft.Inventory;
-using Microsoft.Inventory.Intrastat;
-using Microsoft.Inventory.Item;
-using Microsoft.Inventory.Location;
-using Microsoft.Inventory.Setup;
-using Microsoft.Inventory.Tracking;
-using Microsoft.Pricing.Calculation;
-using Microsoft.Projects.Project.Job;
-using Microsoft.Projects.Resources.Resource;
-using Microsoft.Purchases.Archive;
-using Microsoft.Purchases.Comment;
-using Microsoft.Purchases.History;
-using Microsoft.Purchases.Payables;
-using Microsoft.Purchases.Posting;
-using Microsoft.Purchases.Remittance;
-using Microsoft.Purchases.Setup;
-using Microsoft.Purchases.Vendor;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.Document;
-using Microsoft.Sales.History;
-using Microsoft.Utilities;
-using Microsoft.Warehouse.Request;
-using System.Automation;
-using System.Environment.Configuration;
-using System.Globalization;
-using System.Reflection;
-using System.Security.User;
-using System.Threading;
-using System.Utilities;
-
-table 38 "Purchase Header"
-{
- Caption = 'Purchase Header';
- DataCaptionFields = "No.", "Buy-from Vendor Name";
- LookupPageID = "Purchase List";
- DataClassification = CustomerContent;
-
- fields
- {
- field(1; "Document Type"; Enum "Purchase Document Type")
- {
- Caption = 'Document Type';
- }
- field(2; "Buy-from Vendor No."; Code[20])
- {
- Caption = 'Buy-from Vendor No.';
- TableRelation = Vendor;
- ToolTip = 'Specifies the vendor who will deliver the goods or services. Each vendor has a unique number to help you track related documents. The number can come from a number series or be added manually.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateBuyFromVendorNo(Rec, xRec, CurrFieldNo, SkipBuyFromContact, IsHandled);
- if IsHandled then
- exit;
-
- if "No." = '' then
- InitRecord();
- TestStatusOpen();
-
- if ("Buy-from Vendor No." <> xRec."Buy-from Vendor No.") and
- (xRec."Buy-from Vendor No." <> '')
- then begin
- CheckDropShipmentLineExists();
- if ConfirmUpdateField(FieldNo("Buy-from Vendor No.")) then begin
- if InitFromVendor("Buy-from Vendor No.", FieldCaption("Buy-from Vendor No.")) then
- exit;
-
- CheckReceiptInfo(PurchLine, false);
- CheckPrepmtInfo(PurchLine);
- CheckReturnInfo(PurchLine, false);
-
- PurchLine.Reset();
- end else begin
- Rec := xRec;
- exit;
- end;
- end;
-
- GetVend("Buy-from Vendor No.");
- CheckBlockedVendOnDocs(Vend);
- if not ApplicationAreaMgmt.IsSalesTaxEnabled() then
- Vend.TestField("Gen. Bus. Posting Group");
- OnAfterCheckBuyFromVendor(Rec, xRec, Vend);
-
- "Buy-from Vendor Name" := Vend.Name;
- "Buy-from Vendor Name 2" := Vend."Name 2";
- CopyBuyFromVendorAddressFieldsFromVendor(Vend, false);
- if not SkipBuyFromContact then
- "Buy-from Contact" := Vend.Contact;
- "Gen. Bus. Posting Group" := Vend."Gen. Bus. Posting Group";
- "VAT Bus. Posting Group" := Vend."VAT Bus. Posting Group";
- "Tax Area Code" := Vend."Tax Area Code";
- "Tax Liable" := Vend."Tax Liable";
- "VAT Country/Region Code" := Vend."Country/Region Code";
- "VAT Registration No." := Vend."VAT Registration No.";
- Validate("Lead Time Calculation", Vend."Lead Time Calculation");
- "Shipment Method Code" := Vend."Shipment Method Code";
- "Self-Billing Invoice" := Vend."Self-Billing Agreement" and Rec."Document Type" in [Rec."Document Type"::Order, Rec."Document Type"::Invoice];
-
- IsHandled := false;
- OnValidateBuyFromVendorNoOnBeforeAssignResponsibilityCenter(Rec, xRec, CurrFieldNo, IsHandled);
- if not IsHandled then
- "Responsibility Center" := UserSetupMgt.GetRespCenter(1, Vend."Responsibility Center");
- ValidateEmptySellToCustomerAndLocation();
- OnAfterCopyBuyFromVendorFieldsFromVendor(Rec, Vend, xRec);
-
- if "Buy-from Vendor No." = xRec."Pay-to Vendor No." then
- if ReceivedPurchLinesExist() or ReturnShipmentExist() then begin
- TestField("VAT Bus. Posting Group", xRec."VAT Bus. Posting Group");
- TestField("Gen. Bus. Posting Group", xRec."Gen. Bus. Posting Group");
- end;
-
- "Buy-from IC Partner Code" := Vend."IC Partner Code";
- "Send IC Document" := ("Buy-from IC Partner Code" <> '') and ("IC Direction" = "IC Direction"::Outgoing);
-
- OnValidateBuyFromVendorNoOnValidateBuyFromVendorNoOnBeforeValidatePayToVendor(Rec);
- if Vend."Pay-to Vendor No." <> '' then
- Validate("Pay-to Vendor No.", Vend."Pay-to Vendor No.")
- else begin
- if "Buy-from Vendor No." = "Pay-to Vendor No." then
- SkipPayToContact := true;
- Validate("Pay-to Vendor No.", "Buy-from Vendor No.");
- SkipPayToContact := false;
- end;
- "Order Address Code" := '';
-
- OnValidateBuyFromVendorNoOnAfterValidatePayToVendor(Rec);
-
- CopyPayToVendorAddressFieldsFromVendor(Vend, false);
- if IsCreditDocType() then begin
- "Ship-to Name" := Vend.Name;
- "Ship-to Name 2" := Vend."Name 2";
- CopyShipToVendorAddressFieldsFromVendor(Vend, true);
- "Ship-to Contact" := Vend.Contact;
- "Shipment Method Code" := Vend."Shipment Method Code";
- if Vend."Location Code" <> '' then
- Validate("Location Code", Vend."Location Code");
- end;
-
- OnValidateBuyFromVendorNoBeforeRecreateLines(Rec, CurrFieldNo, Vend);
-
- if (xRec."Buy-from Vendor No." <> "Buy-from Vendor No.") or
- (xRec."Currency Code" <> "Currency Code") or
- (xRec."Gen. Bus. Posting Group" <> "Gen. Bus. Posting Group") or
- (xRec."VAT Bus. Posting Group" <> "VAT Bus. Posting Group")
- then
- RecreatePurchLines(BuyFromVendorTxt);
-
- if not Insertmode and ("Buy-from Vendor No." <> '') then
- StandardCodesMgtGlobal.CheckCreatePurchRecurringLines(Rec);
-
- OnValidateBuyFromVendorNoOnAfterRecreateLines(Rec, xRec, CurrFieldNo);
-
- if not SkipBuyFromContact then
- UpdateBuyFromCont("Buy-from Vendor No.");
-
- OnValidateBuyFromVendorNoOnAfterUpdateBuyFromCont(Rec, xRec, CurrFieldNo, SkipBuyFromContact);
-
- if (xRec."Buy-from Vendor No." <> '') and (xRec."Buy-from Vendor No." <> "Buy-from Vendor No.") then begin
- Rec.RecallModifyAddressNotification(GetModifyVendorAddressNotificationId());
- if Rec."Remit-to Code" <> '' then
- Rec.Validate("Remit-to Code", '');
- end else
- SelectDefaultRemitAddress(Rec);
- end;
- }
- field(3; "No."; Code[20])
- {
- Caption = 'No.';
- ToolTip = 'Specifies a unique number that identifies the purchase order. The number can be generated automatically from a number series, or you can number each of them manually.';
-
- trigger OnValidate()
- begin
- if "No." <> xRec."No." then begin
- GetPurchSetup();
- NoSeries.TestManual(GetNoSeriesCode());
- "No. Series" := '';
- end;
- end;
- }
- field(4; "Pay-to Vendor No."; Code[20])
- {
- Caption = 'Pay-to Vendor No.';
- NotBlank = true;
- TableRelation = Vendor;
- ToolTip = 'Specifies the number of the vendor that you received the invoice from.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePayToVendorNo(Rec, xRec, Confirmed, IsHandled);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- if (xRec."Pay-to Vendor No." <> "Pay-to Vendor No.") and
- (xRec."Pay-to Vendor No." <> '')
- then
- if ConfirmUpdateField(FieldNo("Pay-to Vendor No.")) then begin
- OnValidatePayToVendorNoOnAfterConfirmed(Rec);
- PurchLine.SetRange("Document Type", "Document Type");
- PurchLine.SetRange("Document No.", "No.");
-
- CheckReceiptInfo(PurchLine, true);
- CheckPrepmtInfo(PurchLine);
- CheckReturnInfo(PurchLine, true);
-
- PurchLine.Reset();
- end else
- "Pay-to Vendor No." := xRec."Pay-to Vendor No.";
-
- OnValidatePayToVendorNoOnBeforeGetPayToVend(Rec);
- GetVend("Pay-to Vendor No.");
- CheckBlockedVendOnDocs(Vend);
- Vend.TestField("Vendor Posting Group");
- PostingSetupMgt.CheckVendPostingGroupPayablesAccount("Vendor Posting Group");
- OnAfterCheckPayToVendor(Rec, xRec, Vend);
-
- "Pay-to Name" := Vend.Name;
- "Pay-to Name 2" := Vend."Name 2";
- CopyPayToVendorAddressFieldsFromVendor(Vend, false);
- if not SkipPayToContact then
- "Pay-to Contact" := Vend.Contact;
- "Payment Terms Code" := Vend."Payment Terms Code";
- "Prepmt. Payment Terms Code" := Vend."Payment Terms Code";
- "Payment Method Code" := Vend."Payment Method Code";
- "Price Calculation Method" := Vend.GetPriceCalculationMethod();
- "Transaction Mode Code" := Vend."Transaction Mode Code";
- "Bank Account Code" := Vend."Preferred Bank Account Code";
-
- if "Buy-from Vendor No." = Vend."No." then
- "Shipment Method Code" := Vend."Shipment Method Code";
- "Vendor Posting Group" := Vend."Vendor Posting Group";
- OnAfterCopyPayToVendorFieldsFromVendor(Rec, Vend, xRec);
-
- GLSetup.Get();
- if GLSetup."Bill-to/Sell-to VAT Calc." = GLSetup."Bill-to/Sell-to VAT Calc."::"Bill-to/Pay-to No." then begin
- "VAT Bus. Posting Group" := Vend."VAT Bus. Posting Group";
- "VAT Country/Region Code" := Vend."Country/Region Code";
- "VAT Registration No." := Vend."VAT Registration No.";
- "Gen. Bus. Posting Group" := Vend."Gen. Bus. Posting Group";
- end;
- "Prices Including VAT" := Vend."Prices Including VAT";
- "Currency Code" := Vend."Currency Code";
- "Invoice Disc. Code" := Vend."Invoice Disc. Code";
- "Language Code" := Vend."Language Code";
- "Format Region" := Vend."Format Region";
- SetPurchaserCode(Vend."Purchaser Code", "Purchaser Code");
- Validate("Payment Terms Code");
- Validate("Prepmt. Payment Terms Code");
- Validate("Payment Method Code");
- Validate("Transaction Mode Code");
- Validate("Currency Code");
- Validate("Creditor No.", Vend."Creditor No.");
- OnValidatePurchaseHeaderPayToVendorNoOnBeforeCheckDocType(Vend, Rec, xRec, SkipPayToContact);
-
- if "Document Type" = "Document Type"::Order then
- Validate("Prepayment %", Vend."Prepayment %");
-
- if "Pay-to Vendor No." = xRec."Pay-to Vendor No." then
- if ReceivedPurchLinesExist() then
- TestField("Currency Code", xRec."Currency Code");
-
- CreateDimensionsFromValidatePayToVendorNo();
-
- OnValidatePaytoVendorNoBeforeRecreateLines(Rec, CurrFieldNo);
-
- if (xRec."Buy-from Vendor No." = "Buy-from Vendor No.") and
- (xRec."Pay-to Vendor No." <> "Pay-to Vendor No.")
- then
- RecreatePurchLines(PayToVendorTxt);
-
- if not SkipPayToContact then
- UpdatePayToCont("Pay-to Vendor No.");
-
- "Pay-to IC Partner Code" := Vend."IC Partner Code";
-
- OnValidatePayToVendorNoOnBeforeRecallModifyAddressNotification(Rec, xRec, Vend);
- if (xRec."Pay-to Vendor No." <> '') and (xRec."Pay-to Vendor No." <> "Pay-to Vendor No.") then
- Rec.RecallModifyAddressNotification(GetModifyPayToVendorAddressNotificationId());
- end;
- }
- field(5; "Pay-to Name"; Text[100])
- {
- Caption = 'Pay-to Name';
- TableRelation = Vendor.Name;
- ToolTip = 'Specifies the name of the vendor who you received the invoice from.';
- ValidateTableRelation = false;
-
- trigger OnValidate()
- var
- Vendor: Record Vendor;
- begin
- if Rec."Pay-to Name" <> xRec."Pay-to Name" then
- if ShouldSearchForVendorByName("Pay-to Vendor No.") then
- Validate("Pay-to Vendor No.", Vendor.GetVendorNo("Pay-to Name"));
- end;
- }
- field(6; "Pay-to Name 2"; Text[50])
- {
- Caption = 'Pay-to Name 2';
- ToolTip = 'Specifies an additional part of the name of the vendor who you receive the invoice or credit memo from.';
- }
- field(7; "Pay-to Address"; Text[100])
- {
- Caption = 'Pay-to Address';
- ToolTip = 'Specifies the address of the vendor sending the invoice.';
-
- trigger OnValidate()
- begin
- ModifyPayToVendorAddress();
- end;
- }
- field(8; "Pay-to Address 2"; Text[50])
- {
- Caption = 'Pay-to Address 2';
- ToolTip = 'Specifies additional address information.';
-
- trigger OnValidate()
- begin
- ModifyPayToVendorAddress();
- end;
- }
- field(9; "Pay-to City"; Text[30])
- {
- Caption = 'Pay-to City';
- ToolTip = 'Specifies the city of the vendor on the purchase document.';
- TableRelation = if ("Pay-to Country/Region Code" = const('')) "Post Code".City
- else
- if ("Pay-to Country/Region Code" = filter(<> '')) "Post Code".City where("Country/Region Code" = field("Pay-to Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnLookup()
- begin
- LookupPostCode("Pay-to City", "Pay-to Post Code", "Pay-to County", "Pay-to Country/Region Code", CurrFieldNo);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePayToCity(Rec, PostCode, CurrFieldNo, IsHandled);
- if not IsHandled then
- PostCode.ValidateCity(
- "Pay-to City", "Pay-to Post Code", "Pay-to County", "Pay-to Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- ModifyPayToVendorAddress();
- end;
- }
- field(10; "Pay-to Contact"; Text[100])
- {
- Caption = 'Pay-to Contact';
- ToolTip = 'Specifies the name of the person to contact about an invoice from this vendor.';
-
- trigger OnLookup()
- var
- Contact: Record Contact;
- begin
- Contact.FilterGroup(2);
- LookupContact("Pay-to Vendor No.", "Pay-to Contact No.", Contact);
- if PAGE.RunModal(0, Contact) = ACTION::LookupOK then
- Validate("Pay-to Contact No.", Contact."No.");
- Contact.FilterGroup(0);
- end;
-
- trigger OnValidate()
- begin
- ModifyPayToVendorAddress();
- end;
- }
- field(11; "Your Reference"; Text[35])
- {
- Caption = 'Your Reference';
- ToolTip = 'Specifies the vendor''s reference.';
- }
- field(12; "Ship-to Code"; Code[10])
- {
- Caption = 'Ship-to Code';
- ToolTip = 'Specifies a code for an alternate shipment address if you want to ship to another address than the one that has been entered automatically. This field is also used in case of drop shipment.';
- TableRelation = "Ship-to Address".Code where("Customer No." = field("Sell-to Customer No."));
-
- trigger OnValidate()
- var
- ShipToAddr: Record "Ship-to Address";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShipToCode(Rec, xRec, ShipToAddr, IsHandled);
- if IsHandled then
- exit;
-
- CheckShipToCodeChange(Rec, xRec);
-
- if "Ship-to Code" <> '' then begin
- ShipToAddr.Get("Sell-to Customer No.", "Ship-to Code");
- SetShipToAddress(
- ShipToAddr.Name, ShipToAddr."Name 2", ShipToAddr.Address, ShipToAddr."Address 2",
- ShipToAddr.City, ShipToAddr."Post Code", ShipToAddr.County, ShipToAddr."Country/Region Code");
- "Ship-to Phone No." := ShipToAddr."Phone No.";
- "Ship-to Contact" := ShipToAddr.Contact;
- if ShipToAddr."Shipment Method Code" <> '' then
- "Shipment Method Code" := ShipToAddr."Shipment Method Code"
- else
- if "Sell-to Customer No." <> '' then
- if Cust.Get("Sell-to Customer No.") then
- "Shipment Method Code" := Cust."Shipment Method Code";
- if ShipToAddr."Location Code" <> '' then
- Validate("Location Code", ShipToAddr."Location Code");
- OnValidateShipToCodeOnAfterCopyFromShipToAddr(Rec, ShipToAddr);
- end else begin
- TestField("Sell-to Customer No.");
- Cust.Get("Sell-to Customer No.");
- SetShipToAddress(
- Cust.Name, Cust."Name 2", Cust.Address, Cust."Address 2",
- Cust.City, Cust."Post Code", Cust.County, Cust."Country/Region Code");
- "Ship-to Phone No." := Cust."Phone No.";
- "Ship-to Contact" := Cust.Contact;
- "Shipment Method Code" := Cust."Shipment Method Code";
- if Cust."Location Code" <> '' then
- Validate("Location Code", Cust."Location Code");
- OnValidateShipToCodeOnAfterCopyFromSellToCust(Rec, Cust);
- end;
-
- OnAfterValidateShipToCode(Rec, Cust, ShipToAddr);
- end;
- }
- field(13; "Ship-to Name"; Text[100])
- {
- Caption = 'Ship-to Name';
- ToolTip = 'Specifies the name of the customer at the address that the items are shipped to.';
- }
- field(14; "Ship-to Name 2"; Text[50])
- {
- Caption = 'Ship-to Name 2';
- ToolTip = 'Specifies an additional part of the name of the customer that items on the purchase order were shipped to, as a drop shipment.';
- }
- field(15; "Ship-to Address"; Text[100])
- {
- Caption = 'Ship-to Address';
- ToolTip = 'Specifies the address that you want the items in the purchase order to be shipped to.';
- }
- field(16; "Ship-to Address 2"; Text[50])
- {
- Caption = 'Ship-to Address 2';
- ToolTip = 'Specifies additional address information.';
- }
- field(17; "Ship-to City"; Text[30])
- {
- Caption = 'Ship-to City';
- ToolTip = 'Specifies the city of the vendor on the purchase document.';
- TableRelation = if ("Ship-to Country/Region Code" = const('')) "Post Code".City
- else
- if ("Ship-to Country/Region Code" = filter(<> '')) "Post Code".City where("Country/Region Code" = field("Ship-to Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnLookup()
- begin
- LookupPostCode("Ship-to City", "Ship-to Post Code", "Ship-to County", "Ship-to Country/Region Code", CurrFieldNo);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShipToCity(Rec, PostCode, CurrFieldNo, IsHandled);
- if not IsHandled then
- PostCode.ValidateCity(
- "Ship-to City", "Ship-to Post Code", "Ship-to County", "Ship-to Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- end;
- }
- field(18; "Ship-to Contact"; Text[100])
- {
- Caption = 'Ship-to Contact';
- ToolTip = 'Specifies the name of the contact person at the address that the items are shipped to.';
- }
- field(19; "Order Date"; Date)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- Caption = 'Order Date';
- ToolTip = 'Specifies the date when the order was created.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateOrderDate(Rec, xRec, IsHandled, CurrFieldNo);
- if IsHandled then
- exit;
-
- if ("Document Type" in ["Document Type"::Quote, "Document Type"::Order]) and
- not ("Order Date" = xRec."Order Date")
- then
- PriceMessageIfPurchLinesExist(FieldCaption("Order Date"));
- end;
- }
- field(20; "Posting Date"; Date)
- {
- Caption = 'Posting Date';
- ToolTip = 'Specifies the date when the posting of the purchase document will be recorded.';
-
- trigger OnValidate()
- var
- PurchasesPayablesSetup: Record "Purchases & Payables Setup";
- SkipJobCurrFactorUpdate: Boolean;
- IsHandled: Boolean;
- NeedUpdateCurrencyFactor: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePostingDate(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Posting Date");
- TestNoSeriesDate(
- "Posting No.", "Posting No. Series",
- FieldCaption("Posting No."), FieldCaption("Posting No. Series"));
- TestNoSeriesDate(
- "Prepayment No.", "Prepayment No. Series",
- FieldCaption("Prepayment No."), FieldCaption("Prepayment No. Series"));
- TestNoSeriesDate(
- "Prepmt. Cr. Memo No.", "Prepmt. Cr. Memo No. Series",
- FieldCaption("Prepmt. Cr. Memo No."), FieldCaption("Prepmt. Cr. Memo No. Series"));
-
- GLSetup.Get();
- GLSetup.UpdateVATDate("Posting Date", Enum::"VAT Reporting Date"::"Posting Date", "VAT Reporting Date");
- Validate("VAT Reporting Date");
-
- PurchasesPayablesSetup.SetLoadFields("Link Doc. Date To Posting Date");
- PurchasesPayablesSetup.Get();
-
- if ("Incoming Document Entry No." = 0) and PurchasesPayablesSetup."Link Doc. Date To Posting Date" then
- ValidateDocumentDateWithPostingDate();
-
- if ("Document Type" in ["Document Type"::Invoice, "Document Type"::"Credit Memo"]) and
- not ("Posting Date" = xRec."Posting Date")
- then
- PriceMessageIfPurchLinesExist(FieldCaption("Posting Date"));
-
- OnValidatePostingDateOnBeforeResetInvoiceDiscountValue(Rec, xRec, CurrFieldNo);
- ResetInvoiceDiscountValue();
-
- NeedUpdateCurrencyFactor := "Currency Code" <> '';
- OnValidatePostingDateOnBeforeCheckNeedUpdateCurrencyFactor(Rec, xRec, Confirmed, NeedUpdateCurrencyFactor);
- if NeedUpdateCurrencyFactor then begin
- UpdateCurrencyFactor();
- if ("Currency Factor" <> xRec."Currency Factor") and not GetCalledFromWhseDoc() then
- SkipJobCurrFactorUpdate := not ConfirmCurrencyFactorUpdate();
- end;
- OnValidatePostingDateOnAfterCheckNeedUpdateCurrencyFactor(Rec, xRec, SkipJobCurrFactorUpdate);
-
- if "Posting Date" <> xRec."Posting Date" then
- if DeferralHeadersExist() then
- ConfirmUpdateDeferralDate();
-
- if PurchLinesExist() then
- JobUpdatePurchLines(SkipJobCurrFactorUpdate);
- end;
- }
- field(21; "Expected Receipt Date"; Date)
- {
- Caption = 'Expected Receipt Date';
- 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.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateExpectedReceiptDate(Rec, xRec, IsHandled, CurrFieldNo);
- if IsHandled then
- exit;
-
- if "Expected Receipt Date" <> 0D then
- UpdatePurchLinesByFieldNo(FieldNo("Expected Receipt Date"), CurrFieldNo <> 0);
- end;
- }
- field(22; "Posting Description"; Text[100])
- {
- Caption = 'Posting Description';
- ToolTip = 'Specifies additional posting information for the document. After you post the document, the description can add detail to vendor and customer ledger entries.';
- }
- field(23; "Payment Terms Code"; Code[10])
- {
- Caption = 'Payment Terms Code';
- ToolTip = 'Specifies a formula that calculates the payment due date, payment discount date, and payment discount amount.';
- TableRelation = "Payment Terms";
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- if ("Payment Terms Code" <> '') and ("Document Date" <> 0D) then begin
- PaymentTerms.Get("Payment Terms Code");
- if IsCreditDocType() and not PaymentTerms."Calc. Pmt. Disc. on Cr. Memos" then begin
- IsHandled := false;
- OnValidatePaymentTermsCodeOnBeforeValidateDueDate(Rec, xRec, CurrFieldNo, IsHandled);
- if not IsHandled then
- Validate("Due Date", "Document Date");
- Validate("Pmt. Discount Date", 0D);
- Validate("Payment Discount %", 0);
- end else begin
- IsHandled := false;
- OnValidatePaymentTermsCodeOnBeforeCalcDueDate(Rec, xRec, FieldNo("Payment Terms Code"), CurrFieldNo, IsHandled);
- if not IsHandled then
- "Due Date" := CalcDate(PaymentTerms."Due Date Calculation", "Document Date");
- IsHandled := false;
- OnValidatePaymentTermsCodeOnBeforeCalcPmtDiscDate(Rec, xRec, FieldNo("Payment Terms Code"), CurrFieldNo, IsHandled, UpdateDocumentDate);
- if not IsHandled then
- "Pmt. Discount Date" := CalcDate(PaymentTerms."Discount Date Calculation", "Document Date");
- if not UpdateDocumentDate then
- Validate("Payment Discount %", PaymentTerms."Discount %")
- end;
- end else begin
- IsHandled := false;
- OnValidatePaymentTermsCodeOnBeforeValidateDueDateWhenBlank(Rec, xRec, CurrFieldNo, IsHandled);
- if not IsHandled then
- Validate("Due Date", "Document Date");
- if not UpdateDocumentDate then begin
- OnValidatePaymentTermsCodeOnBeforeValidatePmtDiscountWhenBlank(Rec);
- Validate("Pmt. Discount Date", 0D);
- Validate("Payment Discount %", 0);
- end;
- end;
- if xRec."Payment Terms Code" = "Prepmt. Payment Terms Code" then
- Validate("Prepmt. Payment Terms Code", "Payment Terms Code");
- end;
- }
- field(24; "Due Date"; Date)
- {
- Caption = 'Due Date';
- ToolTip = 'Specifies when the purchase invoice is due for payment.';
- }
- field(25; "Payment Discount %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Payment Discount %';
- ToolTip = 'Specifies the payment discount percent granted if payment is made on or before the date in the Pmt. Discount Date field.';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePaymentDiscountPercent(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- if not (CurrFieldNo in [0, FieldNo("Posting Date"), FieldNo("Document Date")]) then
- TestStatusOpen();
- GLSetup.Get();
- if "Payment Discount %" < GLSetup."VAT Tolerance %" then
- "VAT Base Discount %" := "Payment Discount %"
- else
- "VAT Base Discount %" := GLSetup."VAT Tolerance %";
- Validate("VAT Base Discount %");
- end;
- }
- field(26; "Pmt. Discount Date"; Date)
- {
- Caption = 'Pmt. Discount Date';
- ToolTip = 'Specifies the date on which the amount in the entry must be paid for a payment discount to be granted.';
- }
- field(27; "Shipment Method Code"; Code[10])
- {
- Caption = 'Shipment Method Code';
- ToolTip = 'Specifies the delivery conditions of the related shipment, such as free on board (FOB).';
- TableRelation = "Shipment Method";
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShipmentMethodCode(Rec, IsHandled);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- end;
- }
- field(28; "Location Code"; Code[10])
- {
- Caption = 'Location Code';
- ToolTip = 'Specifies the code for the location where the items are to be received. When you select the vendor and the vendor has a location assigned, the value is taken from the Vendor card. If the vendor has no location, but a Responsibility Center is populated, the location code is taken from the Responsibility Center. If neither is specified, the value is taken from Company Information. This field acts as the default location for new lines. You can update the location code for individual lines as needed.';
- TableRelation = Location where("Use As In-Transit" = const(false));
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- OnBeforeValidateLocationCode(Rec, IsHandled, xRec, CurrFieldNo);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- if ("Location Code" <> xRec."Location Code") and
- (xRec."Buy-from Vendor No." = "Buy-from Vendor No.")
- then
- MessageIfPurchLinesExist(FieldCaption("Location Code"));
-
- UpdateShipToAddress();
- UpdateInboundWhseHandlingTime();
- if "Location Code" <> xRec."Location Code" then
- CreateDimFromDefaultDim(Rec.FieldNo("Location Code"));
- end;
- }
- field(29; "Shortcut Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,2,1';
- Caption = 'Shortcut Dimension 1 Code';
- 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.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1),
- Blocked = const(false));
-
- trigger OnValidate()
- begin
- Rec.ValidateShortcutDimCode(1, "Shortcut Dimension 1 Code");
- end;
- }
- field(30; "Shortcut Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,2,2';
- Caption = 'Shortcut Dimension 2 Code';
- 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.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2),
- Blocked = const(false));
-
- trigger OnValidate()
- begin
- Rec.ValidateShortcutDimCode(2, "Shortcut Dimension 2 Code");
- end;
- }
- field(31; "Vendor Posting Group"; Code[20])
- {
- Caption = 'Vendor Posting Group';
- ToolTip = 'Specifies the vendor''s market type to link business transactions to.';
- TableRelation = "Vendor Posting Group";
-
- trigger OnValidate()
- begin
- CheckVendorPostingGroupChange();
- end;
- }
- field(32; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- ToolTip = 'Specifies the code of the currency of the amounts on the purchase lines.';
- TableRelation = Currency;
-
- trigger OnValidate()
- var
- StandardCodesMgt: Codeunit "Standard Codes Mgt.";
- XRecOfSameRec, CurrencyCodeChanged : Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateCurrencyCode(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- XRecOfSameRec := (xRec."No." = Rec."No.") and (xRec."Document Type" = Rec."Document Type");
- CurrencyCodeChanged := ("Currency Code" <> xRec."Currency Code") and XRecOfSameRec;
- if (not (CurrFieldNo in [0, FieldNo("Posting Date")])) or CurrencyCodeChanged then
- TestStatusOpen();
-
- ResetInvoiceDiscountValue();
-
- if (CurrFieldNo <> FieldNo("Currency Code")) and (not CurrencyCodeChanged) then
- UpdateCurrencyFactor(CurrencyCodeChanged)
- else
- if "Currency Code" <> xRec."Currency Code" then
- UpdateCurrencyFactor(CurrencyCodeChanged)
- else
- if "Currency Code" <> '' then begin
- UpdateCurrencyFactor(CurrencyCodeChanged);
- if "Currency Factor" <> xRec."Currency Factor" then
- ConfirmCurrencyFactorUpdate();
- end;
-
- if ShouldCheckShowRecurringSalesLines(xRec, Rec) then
- StandardCodesMgt.CheckShowPurchRecurringLinesNotification(Rec);
- end;
- }
- field(33; "Currency Factor"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Currency Factor';
- DecimalPlaces = 0 : 15;
- Editable = false;
- MinValue = 0;
-
- trigger OnValidate()
- begin
- ResetInvoiceDiscountValue();
-
- if "Currency Factor" <> xRec."Currency Factor" then
- UpdatePurchLinesByFieldNo(FieldNo("Currency Factor"), CurrFieldNo <> 0);
- end;
- }
- field(35; "Prices Including VAT"; Boolean)
- {
- Caption = 'Prices Including VAT';
- ToolTip = 'Specifies if the Unit Price and Line Amount fields on document lines should be shown with or without VAT.';
-
- trigger OnValidate()
- var
- PurchLine: Record "Purchase Line";
- Currency: Record Currency;
- ConfirmManagement: Codeunit "Confirm Management";
- RecalculatePrice: Boolean;
- VatFactor: Decimal;
- LineInvDiscAmt: Decimal;
- InvDiscRounding: Decimal;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePricesIncludingVAT(Rec, PurchLine, IsHandled, xRec);
- if IsHandled then
- exit;
-
- TestStatusOpen();
-
- if "Prices Including VAT" <> xRec."Prices Including VAT" then begin
- PurchLine.SetRange("Document Type", "Document Type");
- PurchLine.SetRange("Document No.", "No.");
- PurchLine.SetFilter("Direct Unit Cost", '<>%1', 0);
- PurchLine.SetFilter("VAT %", '<>%1', 0);
- if PurchLine.Find('-') then begin
- if GetHideValidationDialog() or not GuiAllowed then
- RecalculatePrice := true
- else
- RecalculatePrice :=
- ConfirmManagement.GetResponseOrDefault(
- StrSubstNo(
- Text025 +
- Text027,
- FieldCaption("Prices Including VAT"), PurchLine.FieldCaption("Direct Unit Cost")),
- true);
- OnAfterConfirmPurchPrice(Rec, PurchLine, RecalculatePrice);
- PurchLine.SetPurchHeader(Rec);
-
- Currency.Initialize("Currency Code");
-
- if not RecalculatePrice and "Prices Including VAT" then begin
- PurchLine.FindSet();
- repeat
- PurchLine.Amount := Round(PurchLine.CalcLineAmount() / (1 + PurchLine."VAT %" / 100), Currency."Amount Rounding Precision");
- PurchLine."Amount Including VAT" := Round(PurchLine.CalcLineAmount(), Currency."Amount Rounding Precision");
- PurchLine.Modify();
- until PurchLine.Next() = 0;
- end;
-
- PurchLine.FindSet();
- repeat
- PurchLine.TestField("Quantity Invoiced", 0);
- PurchLine.TestField("Prepmt. Amt. Inv.", 0);
- if not RecalculatePrice then begin
- PurchLine."VAT Difference" := 0;
- PurchLine.UpdateAmounts();
- end else begin
- VatFactor := 1 + PurchLine."VAT %" / 100;
- if VatFactor = 0 then
- VatFactor := 1;
- if not "Prices Including VAT" then
- VatFactor := 1 / VatFactor;
- if PurchLine."VAT Calculation Type" = PurchLine."VAT Calculation Type"::"Full VAT" then
- VatFactor := 1;
- PurchLine."Direct Unit Cost" :=
- Round(PurchLine."Direct Unit Cost" * VatFactor, Currency."Unit-Amount Rounding Precision");
- PurchLine."Line Discount Amount" :=
- Round(
- PurchLine.Quantity * PurchLine."Direct Unit Cost" * PurchLine."Line Discount %" / 100,
- Currency."Amount Rounding Precision");
- LineInvDiscAmt := InvDiscRounding + PurchLine."Inv. Discount Amount" * VatFactor;
- PurchLine."Inv. Discount Amount" := Round(LineInvDiscAmt, Currency."Amount Rounding Precision");
- InvDiscRounding := LineInvDiscAmt - PurchLine."Inv. Discount Amount";
- if PurchLine."VAT Calculation Type" = PurchLine."VAT Calculation Type"::"Full VAT" then
- PurchLine."Line Amount" := PurchLine."Amount Including VAT"
- else
- if "Prices Including VAT" then
- PurchLine."Line Amount" := PurchLine."Amount Including VAT" + PurchLine."Inv. Discount Amount"
- else
- PurchLine."Line Amount" := PurchLine.Amount + PurchLine."Inv. Discount Amount";
- UpdatePrepmtAmounts(PurchLine);
- end;
- OnValidatePricesIncludingVATOnBeforePurchLineModify(Rec, PurchLine, Currency, RecalculatePrice);
- PurchLine.Modify();
- until PurchLine.Next() = 0;
- end;
- OnAfterChangePricesIncludingVAT(Rec);
- end;
- end;
- }
- field(37; "Invoice Disc. Code"; Code[20])
- {
- Caption = 'Invoice Disc. Code';
-
- trigger OnValidate()
- begin
- TestStatusOpen();
- MessageIfPurchLinesExist(FieldCaption("Invoice Disc. Code"));
- end;
- }
- field(41; "Language Code"; Code[10])
- {
- Caption = 'Language Code';
- ToolTip = 'Specifies the language to be used on printouts for this document.';
- TableRelation = Language;
-
- trigger OnValidate()
- begin
- MessageIfPurchLinesExist(FieldCaption("Language Code"));
- end;
- }
- field(42; "Format Region"; Text[80])
- {
- Caption = 'Format Region';
- ToolTip = 'Specifies the format to be used on printouts for this document.';
- TableRelation = "Language Selection"."Language Tag";
- }
- field(43; "Purchaser Code"; Code[20])
- {
- Caption = 'Purchaser Code';
- TableRelation = "Salesperson/Purchaser" where(Blocked = const(false));
- ToolTip = 'Specifies which purchaser is assigned to the vendor.';
-
- trigger OnValidate()
- var
- ApprovalEntry: Record "Approval Entry";
- EnumAssignmentMgt: Codeunit "Enum Assignment Management";
- begin
- ValidatePurchaserOnPurchHeader(Rec, false, false);
-
- ApprovalEntry.SetRange("Table ID", Database::"Purchase Header");
- ApprovalEntry.SetRange("Document Type", EnumAssignmentMgt.GetPurchApprovalDocumentType("Document Type"));
- ApprovalEntry.SetRange("Document No.", "No.");
- ApprovalEntry.SetFilter(Status, '%1|%2', ApprovalEntry.Status::Created, ApprovalEntry.Status::Open);
- if not ApprovalEntry.IsEmpty() then
- Error(Text042, FieldCaption("Purchaser Code"));
-
- CreateDimFromDefaultDim(Rec.FieldNo("Purchaser Code"));
- end;
- }
- field(45; "Order Class"; Code[10])
- {
- Caption = 'Order Class';
- }
- field(46; Comment; Boolean)
- {
- CalcFormula = exist("Purch. Comment Line" where("Document Type" = field("Document Type"),
- "No." = field("No."),
- "Document Line No." = const(0)));
- Caption = 'Comment';
- Editable = false;
- FieldClass = FlowField;
- }
- field(47; "No. Printed"; Integer)
- {
- Caption = 'No. Printed';
- Editable = false;
- }
- field(51; "On Hold"; Code[3])
- {
- Caption = 'On Hold';
- ToolTip = 'Specifies that the related entry represents an unpaid invoice for which either a payment suggestion, a reminder, or a finance charge memo exists.';
- }
- field(52; "Applies-to Doc. Type"; Enum "Gen. Journal Document Type")
- {
- Caption = 'Applies-to Doc. Type';
- ToolTip = 'Specifies the type of the posted document that this document or journal line will be applied to when you post, for example to register payment.';
- }
- field(53; "Applies-to Doc. No."; Code[20])
- {
- Caption = 'Applies-to Doc. No.';
- ToolTip = 'Specifies the number of the posted document that this document or journal line will be applied to when you post, for example to register payment.';
-
- trigger OnLookup()
- var
- GenJnlLine: Record "Gen. Journal Line";
- GenJnlApply: Codeunit "Gen. Jnl.-Apply";
- ApplyVendEntries: Page "Apply Vendor Entries";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupAppliesToDocNo(Rec, VendLedgEntry, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Bal. Account No.", '');
- VendLedgEntry.SetCurrentKey("Vendor No.", Open, Positive, "Due Date");
- VendLedgEntry.SetRange("Vendor No.", "Pay-to Vendor No.");
- VendLedgEntry.SetRange(Open, true);
- if "Applies-to Doc. No." <> '' then begin
- VendLedgEntry.SetRange("Document Type", "Applies-to Doc. Type");
- VendLedgEntry.SetRange("Document No.", "Applies-to Doc. No.");
- if VendLedgEntry.FindFirst() then;
- VendLedgEntry.SetRange("Document Type");
- VendLedgEntry.SetRange("Document No.");
- end else
- if "Applies-to Doc. Type" <> "Applies-to Doc. Type"::" " then begin
- VendLedgEntry.SetRange("Document Type", "Applies-to Doc. Type");
- if VendLedgEntry.FindFirst() then;
- VendLedgEntry.SetRange("Document Type");
- end else
- if Amount <> 0 then begin
- VendLedgEntry.SetRange(Positive, Amount < 0);
- if VendLedgEntry.FindFirst() then;
- VendLedgEntry.SetRange(Positive);
- end;
- ApplyVendEntries.SetPurch(Rec, VendLedgEntry, PurchHeader.FieldNo("Applies-to Doc. No."));
- ApplyVendEntries.SetTableView(VendLedgEntry);
- ApplyVendEntries.SetRecord(VendLedgEntry);
- ApplyVendEntries.LookupMode(true);
- if ApplyVendEntries.RunModal() = ACTION::LookupOK then begin
- ApplyVendEntries.GetVendLedgEntry(VendLedgEntry);
- GenJnlApply.CheckAgainstApplnCurrency(
- "Currency Code", VendLedgEntry."Currency Code", GenJnlLine."Account Type"::Vendor, true);
- "Applies-to Doc. Type" := VendLedgEntry."Document Type";
- "Applies-to Doc. No." := VendLedgEntry."Document No.";
- OnAfterAppliesToDocNoOnLookup(Rec, VendLedgEntry);
- end;
- Clear(ApplyVendEntries);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateAppliesToDocNo(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "Applies-to Doc. No." <> '' then
- TestField("Bal. Account No.", '');
-
- if ("Applies-to Doc. No." <> xRec."Applies-to Doc. No.") and (xRec."Applies-to Doc. No." <> '') and
- ("Applies-to Doc. No." <> '')
- then begin
- SetAmountToApply("Applies-to Doc. No.", "Buy-from Vendor No.");
- SetAmountToApply(xRec."Applies-to Doc. No.", "Buy-from Vendor No.");
- end else
- if ("Applies-to Doc. No." <> xRec."Applies-to Doc. No.") and (xRec."Applies-to Doc. No." = '') then
- SetAmountToApply("Applies-to Doc. No.", "Buy-from Vendor No.")
- else
- if ("Applies-to Doc. No." <> xRec."Applies-to Doc. No.") and ("Applies-to Doc. No." = '') then
- SetAmountToApply(xRec."Applies-to Doc. No.", "Buy-from Vendor No.");
- end;
- }
- field(55; "Bal. Account No."; Code[20])
- {
- Caption = 'Bal. Account No.';
- TableRelation = if ("Bal. Account Type" = const("G/L Account")) "G/L Account"
- else
- if ("Bal. Account Type" = const("Bank Account")) "Bank Account";
-
- trigger OnValidate()
- begin
- if "Bal. Account No." <> '' then
- case "Bal. Account Type" of
- "Bal. Account Type"::"G/L Account":
- begin
- GLAcc.Get("Bal. Account No.");
- GLAcc.CheckGLAcc();
- GLAcc.TestField("Direct Posting", true);
- end;
- "Bal. Account Type"::"Bank Account":
- begin
- BankAcc.Get("Bal. Account No.");
- BankAcc.TestField(Blocked, false);
- BankAcc.TestField("Currency Code", "Currency Code");
- end;
- end;
- end;
- }
- field(56; "Recalculate Invoice Disc."; Boolean)
- {
- CalcFormula = exist("Purchase Line" where("Document Type" = field("Document Type"),
- "Document No." = field("No."),
- "Recalculate Invoice Disc." = const(true)));
- Caption = 'Recalculate Invoice Disc.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(57; Receive; Boolean)
- {
- Caption = 'Receive';
- }
- field(58; Invoice; Boolean)
- {
- Caption = 'Invoice';
- }
- field(59; "Print Posted Documents"; Boolean)
- {
- Caption = 'Print Posted Documents';
- }
- field(60; Amount; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Purchase Line".Amount where("Document Type" = field("Document Type"),
- "Document No." = field("No.")));
- Caption = 'Amount';
- ToolTip = 'Specifies the sum of amounts on all the lines in the document. This will include invoice discounts.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(61; "Amount Including VAT"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Purchase Line"."Amount Including VAT" where("Document Type" = field("Document Type"),
- "Document No." = field("No.")));
- Caption = 'Amount Including VAT';
- ToolTip = 'Specifies the sum of amounts, including VAT, on all the lines in the document. This will include invoice discounts.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(62; "Receiving No."; Code[20])
- {
- Caption = 'Receiving No.';
- }
- field(63; "Posting No."; Code[20])
- {
- Caption = 'Posting No.';
- }
- field(64; "Last Receiving No."; Code[20])
- {
- Caption = 'Last Receiving No.';
- Editable = false;
- TableRelation = "Purch. Rcpt. Header";
- }
- field(65; "Last Posting No."; Code[20])
- {
- Caption = 'Last Posting No.';
- Editable = false;
- TableRelation = "Purch. Inv. Header";
- }
- field(66; "Vendor Order No."; Code[35])
- {
- Caption = 'Vendor Order No.';
- ToolTip = 'Specifies the vendor''s order number.';
- }
- field(67; "Vendor Shipment No."; Code[35])
- {
- Caption = 'Vendor Shipment No.';
- ToolTip = 'Specifies the vendor''s shipment number.';
-
- trigger OnValidate()
- var
- WhsePurchRelease: Codeunit "Whse.-Purch. Release";
- begin
- if (xRec."Vendor Shipment No." <> "Vendor Shipment No.") and (Status = Status::Released) and
- ("Document Type" in ["Document Type"::Order, "Document Type"::"Return Order"])
- then
- WhsePurchRelease.UpdateExternalDocNoForReleasedOrder(Rec);
- end;
- }
- field(68; "Vendor Invoice No."; Code[35])
- {
- Caption = 'Vendor Invoice No.';
- ToolTip = 'Specifies the document number of the original document you received from the vendor. You can require the document number for posting, or let it be optional. By default, it''s required, so that this document references the original. Making document numbers optional removes a step from the posting process. For example, if you attach the original invoice as a PDF, you might not need to enter the document number. To specify whether document numbers are required, in the Purchases & Payables Setup window, select or clear the Ext. Doc. No. Mandatory field.';
-
- trigger OnValidate()
- var
- VendorLedgerEntry: Record "Vendor Ledger Entry";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateVendorInvoiceNo(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "Vendor Invoice No." <> '' then
- if FindPostedDocumentWithSameExternalDocNo(VendorLedgerEntry, "Vendor Invoice No.") then
- ShowExternalDocAlreadyExistNotification(VendorLedgerEntry)
- else
- RecallExternalDocAlreadyExistsNotification();
- end;
- }
- field(69; "Vendor Cr. Memo No."; Code[35])
- {
- Caption = 'Vendor Cr. Memo No.';
- ToolTip = 'Specifies the document number of the original document you received from the vendor. You can require the document number for posting, or let it be optional. By default, it''s required, so that this document references the original. Making document numbers optional removes a step from the posting process. For example, if you attach the original invoice as a PDF, you might not need to enter the document number. To specify whether document numbers are required, in the Purchases & Payables Setup window, select or clear the Ext. Doc. No. Mandatory field.';
-
- trigger OnValidate()
- var
- VendorLedgerEntry: Record "Vendor Ledger Entry";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateVendorCrMemoNo(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "Vendor Cr. Memo No." <> '' then
- if FindPostedDocumentWithSameExternalDocNo(VendorLedgerEntry, "Vendor Cr. Memo No.") then
- ShowExternalDocAlreadyExistNotification(VendorLedgerEntry)
- else
- RecallExternalDocAlreadyExistsNotification();
- end;
- }
- field(70; "VAT Registration No."; Text[20])
- {
- Caption = 'VAT Registration No.';
- }
- field(72; "Sell-to Customer No."; Code[20])
- {
- Caption = 'Sell-to Customer No.';
- ToolTip = 'Specifies the number of the customer that the items are shipped to directly from your vendor, as a drop shipment.';
- TableRelation = Customer;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateSellToCustomerNo(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if ("Document Type" = "Document Type"::Order) and
- (xRec."Sell-to Customer No." <> "Sell-to Customer No.")
- then begin
- PurchLine.SetRange("Document Type", PurchLine."Document Type"::Order);
- PurchLine.SetRange("Document No.", "No.");
- PurchLine.SetFilter("Sales Order Line No.", '<>0');
- if not PurchLine.IsEmpty() then
- Error(
- YouCannotChangeFieldErr,
- FieldCaption("Sell-to Customer No."));
-
- CheckSpecialOrderSalesLineLink();
- end;
-
- if ("Sell-to Customer No." <> xRec."Sell-to Customer No.") then
- if ("Sell-to Customer No." = '') then
- UpdateLocationCode('')
- else
- SetShipToCodeEmpty();
- end;
- }
- field(73; "Reason Code"; Code[10])
- {
- Caption = 'Reason Code';
- ToolTip = 'Specifies the reason code, a supplementary source code that enables you to trace the document.';
- TableRelation = "Reason Code";
- }
- field(74; "Gen. Bus. Posting Group"; Code[20])
- {
- Caption = 'Gen. Bus. Posting Group';
- TableRelation = "Gen. Business Posting Group";
-
- trigger OnValidate()
- begin
- TestStatusOpen();
- if (xRec."Buy-from Vendor No." = "Buy-from Vendor No.") and
- (xRec."Gen. Bus. Posting Group" <> "Gen. Bus. Posting Group")
- then begin
- if GenBusPostingGrp.ValidateVatBusPostingGroup(GenBusPostingGrp, "Gen. Bus. Posting Group") then begin
- "VAT Bus. Posting Group" := GenBusPostingGrp."Def. VAT Bus. Posting Group";
- OnValidateGenBusPostingGroupOnAfterSetVATBusPostingGroup(Rec, xRec, GenBusPostingGrp);
- end;
- RecreatePurchLines(FieldCaption("Gen. Bus. Posting Group"));
- end;
- end;
- }
- field(76; "Transaction Type"; Code[10])
- {
- Caption = 'Transaction Type';
- ToolTip = 'Specifies the type of transaction that the document represents, for the purpose of reporting to INTRASTAT.';
- TableRelation = "Transaction Type";
-
- trigger OnValidate()
- begin
- UpdatePurchLinesByFieldNo(FieldNo("Transaction Type"), CurrFieldNo <> 0);
- end;
- }
- field(77; "Transport Method"; Code[10])
- {
- Caption = 'Transport Method';
- ToolTip = 'Specifies the transport method, for the purpose of reporting to INTRASTAT.';
- TableRelation = "Transport Method";
-
- trigger OnValidate()
- begin
- UpdatePurchLinesByFieldNo(FieldNo("Transport Method"), CurrFieldNo <> 0);
- end;
- }
- field(78; "VAT Country/Region Code"; Code[10])
- {
- Caption = 'VAT Country/Region Code';
- TableRelation = "Country/Region";
- }
- field(79; "Buy-from Vendor Name"; Text[100])
- {
- Caption = 'Buy-from Vendor Name';
- TableRelation = Vendor.Name;
- ToolTip = 'Specifies the name of the vendor that you’re buying from. By default, the same vendor is suggested as the pay-to vendor. If needed, you can specify a different pay-to vendor on the document.';
- ValidateTableRelation = false;
-
- trigger OnValidate()
- var
- Vendor: Record Vendor;
- LookupStateManager: Codeunit "Lookup State Manager";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateBuyFromVendorName(Rec, Vendor, IsHandled);
- if IsHandled then begin
- if LookupStateManager.IsRecordSaved() then
- LookupStateManager.ClearSavedRecord();
- exit;
- end;
-
- if LookupStateManager.IsRecordSaved() then begin
- Vendor := LookupStateManager.GetSavedRecord();
- if Vendor."No." <> '' then begin
- LookupStateManager.ClearSavedRecord();
- Validate("Buy-from Vendor No.", Vendor."No.");
- OnLookupBuyfromVendorNameOnAfterSuccessfulLookup(Rec);
- end;
- end else
- if Rec."Buy-from Vendor Name" <> xRec."Buy-from Vendor Name" then
- if ShouldSearchForVendorByName("Buy-from Vendor No.") then
- Validate("Buy-from Vendor No.", Vendor.GetVendorNo("Buy-from Vendor Name"));
- end;
- }
- field(80; "Buy-from Vendor Name 2"; Text[50])
- {
- Caption = 'Buy-from Vendor Name 2';
- ToolTip = 'Specifies an additional part of the name of the vendor that you’re buying from.';
- }
- field(81; "Buy-from Address"; Text[100])
- {
- Caption = 'Buy-from Address';
- ToolTip = 'Specifies the address of the vendor who ships the items.';
-
- trigger OnValidate()
- begin
- UpdatePayToAddressFromBuyFromAddress(FieldNo("Pay-to Address"));
- ModifyVendorAddress();
- end;
- }
- field(82; "Buy-from Address 2"; Text[50])
- {
- Caption = 'Buy-from Address 2';
- ToolTip = 'Specifies additional address information.';
-
- trigger OnValidate()
- begin
- UpdatePayToAddressFromBuyFromAddress(FieldNo("Pay-to Address 2"));
- ModifyVendorAddress();
- end;
- }
- field(83; "Buy-from City"; Text[30])
- {
- Caption = 'Buy-from City';
- ToolTip = 'Specifies the city of the vendor on the purchase document.';
- TableRelation = if ("Buy-from Country/Region Code" = const('')) "Post Code".City
- else
- if ("Buy-from Country/Region Code" = filter(<> '')) "Post Code".City where("Country/Region Code" = field("Buy-from Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnLookup()
- var
- IsHandled: boolean;
- begin
- IsHandled := false;
- OnBuyFromCityOnBeforeOnLookup(Rec, PostCode, IsHandled);
- if IsHandled then
- exit;
- LookupPostCode("Buy-from City", "Buy-from Post Code", "Buy-from County", "Buy-from Country/Region Code", CurrFieldNo);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateBuyFromCity(Rec, PostCode, CurrFieldNo, IsHandled);
- if not IsHandled then
- PostCode.ValidateCity(
- "Buy-from City", "Buy-from Post Code", "Buy-from County", "Buy-from Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- UpdatePayToAddressFromBuyFromAddress(FieldNo("Pay-to City"));
- ModifyVendorAddress();
- end;
- }
- field(84; "Buy-from Contact"; Text[100])
- {
- Caption = 'Buy-from Contact';
- ToolTip = 'Specifies the name of the contact person at the vendor who delivered the items.';
-
- trigger OnLookup()
- begin
- LookupBuyFromContact();
- end;
-
- trigger OnValidate()
- begin
- ModifyVendorAddress();
- end;
- }
- field(85; "Pay-to Post Code"; Code[20])
- {
- Caption = 'Pay-to Post Code';
- ToolTip = 'Specifies the post code of the vendor that you received the invoice from.';
- TableRelation = if ("Pay-to Country/Region Code" = const('')) "Post Code"
- else
- if ("Pay-to Country/Region Code" = filter(<> '')) "Post Code" where("Country/Region Code" = field("Pay-to Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnLookup()
- begin
- LookupPostCode("Pay-to City", "Pay-to Post Code", "Pay-to County", "Pay-to Country/Region Code", CurrFieldNo);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePayToPostCode(Rec, PostCode, CurrFieldNo, IsHandled);
- if not IsHandled then
- PostCode.ValidatePostCode(
- "Pay-to City", "Pay-to Post Code", "Pay-to County", "Pay-to Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- ModifyPayToVendorAddress();
- end;
- }
- field(86; "Pay-to County"; Text[30])
- {
- CaptionClass = '5,6,' + "Pay-to Country/Region Code";
- Caption = 'Pay-to County';
- ToolTip = 'Specifies the state, province or county of the address.';
-
- trigger OnValidate()
- begin
- ModifyPayToVendorAddress();
- end;
- }
- field(87; "Pay-to Country/Region Code"; Code[10])
- {
- Caption = 'Pay-to Country/Region Code';
- ToolTip = 'Specifies the country/region code of the address.';
- TableRelation = "Country/Region";
-
- trigger OnValidate()
- var
- FormatAddress: Codeunit "Format Address";
- begin
- if not FormatAddress.UseCounty(Rec."Pay-to Country/Region Code") then
- "Pay-to County" := '';
- ModifyPayToVendorAddress();
- end;
- }
- field(88; "Buy-from Post Code"; Code[20])
- {
- Caption = 'Buy-from Post Code';
- ToolTip = 'Specifies the post code of the vendor who delivered the items.';
- TableRelation = if ("Buy-from Country/Region Code" = const('')) "Post Code"
- else
- if ("Buy-from Country/Region Code" = filter(<> '')) "Post Code" where("Country/Region Code" = field("Buy-from Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnLookup()
- begin
- if BuyFromPostCodeOnBeforeLookupHandled() then
- exit;
-
- LookupPostCode("Buy-from City", "Buy-from Post Code", "Buy-from County", "Buy-from Country/Region Code", CurrFieldNo);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateBuyFromPostCode(Rec, PostCode, CurrFieldNo, IsHandled);
- if not IsHandled then
- PostCode.ValidatePostCode(
- "Buy-from City", "Buy-from Post Code", "Buy-from County", "Buy-from Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- UpdatePayToAddressFromBuyFromAddress(FieldNo("Pay-to Post Code"));
- ModifyVendorAddress();
- end;
- }
- field(89; "Buy-from County"; Text[30])
- {
- CaptionClass = '5,5,' + "Buy-from Country/Region Code";
- Caption = 'Buy-from County';
- ToolTip = 'Specifies the state, province or county of the address.';
-
- trigger OnValidate()
- begin
- UpdatePayToAddressFromBuyFromAddress(FieldNo("Pay-to County"));
- ModifyVendorAddress();
- end;
- }
- field(90; "Buy-from Country/Region Code"; Code[10])
- {
- Caption = 'Buy-from Country/Region Code';
- ToolTip = 'Specifies the city of the vendor who delivered the items.';
- TableRelation = "Country/Region";
-
- trigger OnValidate()
- var
- FormatAddress: Codeunit "Format Address";
- begin
- if not FormatAddress.UseCounty(Rec."Buy-from Country/Region Code") then
- "Buy-from County" := '';
- UpdatePayToAddressFromBuyFromAddress(FieldNo("Pay-to Country/Region Code"));
- ModifyVendorAddress();
- end;
- }
- field(91; "Ship-to Post Code"; Code[20])
- {
- Caption = 'Ship-to Post Code';
- ToolTip = 'Specifies the postal code of the address that the items are shipped to.';
- TableRelation = if ("Ship-to Country/Region Code" = const('')) "Post Code"
- else
- if ("Ship-to Country/Region Code" = filter(<> '')) "Post Code" where("Country/Region Code" = field("Ship-to Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnLookup()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnShipToPostCodeOnBeforeOnLookup(Rec, IsHandled, PostCode);
- if IsHandled then
- exit;
-
- LookupPostCode("Ship-to City", "Ship-to Post Code", "Ship-to County", "Ship-to Country/Region Code", CurrFieldNo);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShipToPostCode(Rec, PostCode, CurrFieldNo, IsHandled);
- if not IsHandled then
- PostCode.ValidatePostCode(
- "Ship-to City", "Ship-to Post Code", "Ship-to County", "Ship-to Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- end;
- }
- field(92; "Ship-to County"; Text[30])
- {
- CaptionClass = '5,4,' + "Ship-to Country/Region Code";
- Caption = 'Ship-to County';
- ToolTip = 'Specifies the state, province or county of the address.';
- }
- field(93; "Ship-to Country/Region Code"; Code[10])
- {
- Caption = 'Ship-to Country/Region Code';
- ToolTip = 'Specifies the country/region code of the address that the items are shipped to.';
- TableRelation = "Country/Region";
- }
- field(94; "Bal. Account Type"; enum "Payment Balance Account Type")
- {
- Caption = 'Bal. Account Type';
- }
- field(95; "Order Address Code"; Code[10])
- {
- Caption = 'Order Address Code';
- ToolTip = 'Specifies the order address of the related vendor.';
- TableRelation = "Order Address".Code where("Vendor No." = field("Buy-from Vendor No."));
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- if "Order Address Code" <> '' then
- CopyAddressInfoFromOrderAddress()
- else begin
- GetVend("Buy-from Vendor No.");
- IsHandled := false;
- OnValidateOrderAddressCodeOnBeforeCopyBuyFromVendorAddressFieldsFromVendor(Rec, Vend, IsHandled);
- if not IsHandled then begin
- "Buy-from Vendor Name" := Vend.Name;
- "Buy-from Vendor Name 2" := Vend."Name 2";
- CopyBuyFromVendorAddressFieldsFromVendor(Vend, true);
- end;
-
- OnValidateOrderAddressCodeOnAfterCopyBuyFromVendorAddressFieldsFromVendor(Rec, Vend);
-
- if IsCreditDocType() then begin
- "Ship-to Name" := Vend.Name;
- "Ship-to Name 2" := Vend."Name 2";
- CopyShipToVendorAddressFieldsFromVendor(Vend, true);
- "Ship-to Contact" := Vend.Contact;
- "Shipment Method Code" := Vend."Shipment Method Code";
- IsHandled := false;
- OnValidateOrderAddressCodeOnBeforeUpdateLocationCode(Rec, xRec, CurrFieldNo, IsHandled);
- if not IsHandled then
- if Vend."Location Code" <> '' then
- Validate("Location Code", Vend."Location Code");
- end
- end;
- end;
- }
- field(97; "Entry Point"; Code[10])
- {
- Caption = 'Entry Point';
- ToolTip = 'Specifies the code of the port of entry where the items pass into your country/region, for reporting to Intrastat.';
- TableRelation = "Entry/Exit Point";
-
- trigger OnValidate()
- begin
- UpdatePurchLinesByFieldNo(FieldNo("Entry Point"), CurrFieldNo <> 0);
- end;
- }
- field(98; Correction; Boolean)
- {
- Caption = 'Correction';
- ToolTip = 'Specifies the entry as a corrective entry. You can use the field if you need to post a corrective entry to a vendor account. If you place a check mark in this field when posting a corrective entry, the system will post a negative debit instead of a credit or a negative credit instead of a debit. Correction flag does not affect how inventory reconciled with general ledger.';
- }
- field(99; "Document Date"; Date)
- {
- Caption = 'Document Date';
- ToolTip = 'Specifies the date when the related document was created.';
-
- trigger OnValidate()
- begin
- GLSetup.Get();
- GLSetup.UpdateVATDate("Document Date", Enum::"VAT Reporting Date"::"Document Date", "VAT Reporting Date");
- Validate("VAT Reporting Date");
-
- if (xRec."Document Date" <> "Document Date") or ReplaceDocumentDate then
- UpdateDocumentDate := true;
- Validate("Payment Terms Code");
- Validate("Prepmt. Payment Terms Code");
- UpdateDocumentDate := false;
- end;
- }
- field(101; "Area"; Code[10])
- {
- Caption = 'Area';
- ToolTip = 'Specifies the destination country or region for the purpose of Intrastat reporting.';
- TableRelation = Area;
-
- trigger OnValidate()
- begin
- UpdatePurchLinesByFieldNo(FieldNo(Area), CurrFieldNo <> 0);
- end;
- }
- field(102; "Transaction Specification"; Code[10])
- {
- Caption = 'Transaction Specification';
- ToolTip = 'Specifies a specification of the document''s transaction, for the purpose of reporting to INTRASTAT.';
- TableRelation = "Transaction Specification";
-
- trigger OnValidate()
- begin
- UpdatePurchLinesByFieldNo(FieldNo("Transaction Specification"), CurrFieldNo <> 0);
- end;
- }
- field(104; "Payment Method Code"; Code[10])
- {
- Caption = 'Payment Method Code';
- ToolTip = 'Specifies how to make payment, such as with bank transfer, cash, or check.';
- TableRelation = "Payment Method";
-
- trigger OnValidate()
- begin
- PaymentMethod.Init();
- if "Payment Method Code" <> '' then
- PaymentMethod.Get("Payment Method Code");
- "Bal. Account Type" := PaymentMethod."Bal. Account Type";
- "Bal. Account No." := PaymentMethod."Bal. Account No.";
- if "Bal. Account No." <> '' then begin
- TestField("Applies-to Doc. No.", '');
- TestField("Applies-to ID", '');
- end;
- end;
- }
- field(107; "No. Series"; Code[20])
- {
- Caption = 'No. Series';
- Editable = false;
- TableRelation = "No. Series";
- }
- field(108; "Posting No. Series"; Code[20])
- {
- Caption = 'Posting No. Series';
- TableRelation = "No. Series";
-
- trigger OnLookup()
- begin
- PurchHeader := Rec;
- GetPurchSetup();
- PurchHeader.TestNoSeries();
- if NoSeries.LookupRelatedNoSeries(GetPostingNoSeriesCode(), PurchHeader."Posting No. Series") then
- PurchHeader.Validate("Posting No. Series");
- Rec := PurchHeader;
- end;
-
- trigger OnValidate()
- begin
- if "Posting No. Series" <> '' then begin
- GetPurchSetup();
- TestNoSeries();
- NoSeries.TestAreRelated(GetPostingNoSeriesCode(), "Posting No. Series");
- end;
- TestField("Posting No.", '');
- end;
- }
- field(109; "Receiving No. Series"; Code[20])
- {
- Caption = 'Receiving No. Series';
- TableRelation = "No. Series";
-
- trigger OnLookup()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupReceivingNoSeries(rec, IsHandled);
- if IsHandled then
- exit;
-
- PurchHeader := Rec;
- GetPurchSetup();
- PurchSetup.TestField("Posted Receipt Nos.");
- if NoSeries.LookupRelatedNoSeries(PurchSetup."Posted Receipt Nos.", PurchHeader."Receiving No. Series") then
- PurchHeader.Validate("Receiving No. Series");
- Rec := PurchHeader;
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateReceivingNoSeries(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "Receiving No. Series" <> '' then begin
- GetPurchSetup();
- PurchSetup.TestField("Posted Receipt Nos.");
- NoSeries.TestAreRelated(PurchSetup."Posted Receipt Nos.", "Receiving No. Series");
- end;
- TestField("Receiving No.", '');
- end;
- }
- field(114; "Tax Area Code"; Code[20])
- {
- Caption = 'Tax Area Code';
- ToolTip = 'Specifies the tax area code used for this purchase to calculate and post sales tax.';
- TableRelation = "Tax Area";
-
- trigger OnValidate()
- begin
- TestStatusOpen();
- MessageIfPurchLinesExist(FieldCaption("Tax Area Code"));
- end;
- }
- field(115; "Tax Liable"; Boolean)
- {
- Caption = 'Tax Liable';
- ToolTip = 'Specifies if this vendor charges you sales tax for purchases.';
-
- trigger OnValidate()
- begin
- TestStatusOpen();
- MessageIfPurchLinesExist(FieldCaption("Tax Liable"));
- end;
- }
- field(116; "VAT Bus. Posting Group"; Code[20])
- {
- Caption = 'VAT Bus. Posting Group';
- ToolTip = 'Specifies the VAT specification of the involved customer or vendor to link transactions made for this record with the appropriate general ledger account according to the VAT posting setup.';
- TableRelation = "VAT Business Posting Group";
-
- trigger OnValidate()
- begin
- TestStatusOpen();
- if (xRec."Buy-from Vendor No." = "Buy-from Vendor No.") and
- (xRec."VAT Bus. Posting Group" <> "VAT Bus. Posting Group")
- then
- RecreatePurchLines(FieldCaption("VAT Bus. Posting Group"));
- end;
- }
- field(118; "Applies-to ID"; Code[50])
- {
- Caption = 'Applies-to ID';
- ToolTip = 'Specifies the ID of entries that will be applied to when you choose the Apply Entries action.';
-
- trigger OnValidate()
- var
- TempVendLedgEntry: Record "Vendor Ledger Entry" temporary;
- VendEntrySetApplID: Codeunit "Vend. Entry-SetAppl.ID";
- begin
- if "Applies-to ID" <> '' then
- TestField("Bal. Account No.", '');
- if ("Applies-to ID" <> xRec."Applies-to ID") and (xRec."Applies-to ID" <> '') then begin
- VendLedgEntry.SetCurrentKey("Vendor No.", Open);
- VendLedgEntry.SetRange("Vendor No.", "Pay-to Vendor No.");
- VendLedgEntry.SetRange(Open, true);
- VendLedgEntry.SetRange("Applies-to ID", xRec."Applies-to ID");
- if VendLedgEntry.FindFirst() then
- VendEntrySetApplID.SetApplId(VendLedgEntry, TempVendLedgEntry, '');
- VendLedgEntry.Reset();
- end;
- end;
- }
- field(119; "VAT Base Discount %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'VAT Base Discount %';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- GLSetup.Get();
- if "VAT Base Discount %" > GLSetup."VAT Tolerance %" then begin
- if GetHideValidationDialog() or not GuiAllowed then
- Confirmed := true
- else begin
- IsHandled := false;
- OnValidateVATBaseDiscountOnBeforeConfirm(Rec, IsHandled, Confirmed);
- if not IsHandled then
- Confirmed :=
- Confirm(
- Text007 +
- Text008, false,
- FieldCaption("VAT Base Discount %"),
- GLSetup.FieldCaption("VAT Tolerance %"),
- GLSetup.TableCaption());
- end;
-
- if not Confirmed then
- "VAT Base Discount %" := xRec."VAT Base Discount %";
- end;
-
- if ("VAT Base Discount %" = xRec."VAT Base Discount %") and (CurrFieldNo <> 0) then
- exit;
-
- IsHandled := false;
- OnValidateVATBaseAmountPercOnBeforeUpdatePurchAmountLines(Rec, xRec, CurrFieldNo, IsHandled);
- if not IsHandled then
- UpdatePurchAmountLines();
- end;
- }
- field(120; Status; Enum "Purchase Document Status")
- {
- Caption = 'Status';
- ToolTip = 'Specifies whether the record is open, waiting to be approved, invoiced for prepayment, or released to the next stage of processing.';
- Editable = false;
- }
- field(121; "Invoice Discount Calculation"; Option)
- {
- Caption = 'Invoice Discount Calculation';
- Editable = false;
- OptionCaption = 'None,%,Amount';
- OptionMembers = "None","%",Amount;
- }
- field(122; "Invoice Discount Value"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Invoice Discount Value';
- Editable = false;
- }
- field(123; "Send IC Document"; Boolean)
- {
- Caption = 'Send IC Document';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateSendICDocument(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if "Send IC Document" then begin
- TestField("Buy-from IC Partner Code");
- TestField("IC Direction", "IC Direction"::Outgoing);
- end;
- end;
- }
- field(124; "IC Status"; Enum "Purchase Document IC Status")
- {
- Caption = 'IC Status';
- }
- field(125; "Buy-from IC Partner Code"; Code[20])
- {
- Caption = 'Buy-from IC Partner Code';
- Editable = false;
- TableRelation = "IC Partner";
- }
- field(126; "Pay-to IC Partner Code"; Code[20])
- {
- Caption = 'Pay-to IC Partner Code';
- Editable = false;
- TableRelation = "IC Partner";
- }
- field(127; "IC Reference Document No."; Code[20])
- {
- Caption = 'IC Reference Document No.';
- Editable = false;
- }
- field(129; "IC Direction"; Enum "IC Direction Type")
- {
- Caption = 'IC Direction';
-
- trigger OnValidate()
- begin
- if "IC Direction" = "IC Direction"::Incoming then
- "Send IC Document" := false;
- end;
- }
- field(130; "Prepayment No."; Code[20])
- {
- Caption = 'Prepayment No.';
- }
- field(131; "Last Prepayment No."; Code[20])
- {
- Caption = 'Last Prepayment No.';
- TableRelation = "Purch. Inv. Header";
- }
- field(132; "Prepmt. Cr. Memo No."; Code[20])
- {
- Caption = 'Prepmt. Cr. Memo No.';
- }
- field(133; "Last Prepmt. Cr. Memo No."; Code[20])
- {
- Caption = 'Last Prepmt. Cr. Memo No.';
- TableRelation = "Purch. Cr. Memo Hdr.";
- }
- field(134; "Prepayment %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Prepayment %';
- ToolTip = 'Specifies the prepayment percentage to use to calculate the prepayment for purchase.';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
-
- trigger OnValidate()
- begin
- if "Prepayment %" > 100 then
- error(MaxAllowedValueIs100Err);
- if xRec."Prepayment %" <> "Prepayment %" then
- UpdatePurchLinesByFieldNo(FieldNo("Prepayment %"), CurrFieldNo <> 0);
- end;
- }
- field(135; "Prepayment No. Series"; Code[20])
- {
- Caption = 'Prepayment No. Series';
- TableRelation = "No. Series";
-
- trigger OnLookup()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupPrepmtNoSeries(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- PurchHeader := Rec;
- GetPurchSetup();
- PurchSetup.TestField("Posted Prepmt. Inv. Nos.");
- if NoSeries.LookupRelatedNoSeries(GetPostingPrepaymentNoSeriesCode(), PurchHeader."Prepayment No. Series") then
- PurchHeader.Validate("Prepayment No. Series");
- Rec := PurchHeader;
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePrepmtNoSeries(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if "Prepayment No. Series" <> '' then begin
- GetPurchSetup();
- PurchSetup.TestField("Posted Prepmt. Inv. Nos.");
- NoSeries.TestAreRelated(GetPostingPrepaymentNoSeriesCode(), "Prepayment No. Series");
- end;
- TestField("Prepayment No.", '');
- end;
- }
- field(136; "Compress Prepayment"; Boolean)
- {
- Caption = 'Compress Prepayment';
- ToolTip = 'Specifies that prepayments on the purchase order are combined if they have the same general ledger account for prepayments or the same dimensions.';
- InitValue = true;
- }
- field(137; "Prepayment Due Date"; Date)
- {
- Caption = 'Prepayment Due Date';
- ToolTip = 'Specifies when the prepayment invoice for this purchase order is due.';
- }
- field(138; "Prepmt. Cr. Memo No. Series"; Code[20])
- {
- Caption = 'Prepmt. Cr. Memo No. Series';
- TableRelation = "No. Series";
-
- trigger OnLookup()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupPrepmtCrMemoNoSeries(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- PurchHeader := Rec;
- GetPurchSetup();
- PurchSetup.TestField("Posted Prepmt. Cr. Memo Nos.");
- if NoSeries.LookupRelatedNoSeries(GetPostingPrepaymentNoSeriesCode(), PurchHeader."Prepmt. Cr. Memo No. Series") then
- PurchHeader.Validate("Prepmt. Cr. Memo No. Series");
- Rec := PurchHeader;
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePrepmtCrMemoNoSeries(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if "Prepmt. Cr. Memo No. Series" <> '' then begin
- GetPurchSetup();
- PurchSetup.TestField("Posted Prepmt. Cr. Memo Nos.");
- NoSeries.TestAreRelated(GetPostingPrepaymentNoSeriesCode(), "Prepmt. Cr. Memo No. Series");
- end;
- TestField("Prepmt. Cr. Memo No.", '');
- end;
- }
- field(139; "Prepmt. Posting Description"; Text[100])
- {
- Caption = 'Prepmt. Posting Description';
- }
- field(142; "Prepmt. Pmt. Discount Date"; Date)
- {
- Caption = 'Prepmt. Pmt. Discount Date';
- ToolTip = 'Specifies the last date the vendor can pay the prepayment invoice and still receive a payment discount on the prepayment amount.';
- }
- field(143; "Prepmt. Payment Terms Code"; Code[10])
- {
- Caption = 'Prepmt. Payment Terms Code';
- ToolTip = 'Specifies the code that represents the payment terms for prepayment invoices related to the purchase document.';
- TableRelation = "Payment Terms";
-
- trigger OnValidate()
- var
- PaymentTerms: Record "Payment Terms";
- IsHandled: Boolean;
- begin
- if ("Prepmt. Payment Terms Code" <> '') and ("Document Date" <> 0D) then begin
- PaymentTerms.Get("Prepmt. Payment Terms Code");
- if IsCreditDocType() and not PaymentTerms."Calc. Pmt. Disc. on Cr. Memos" then begin
- IsHandled := false;
- OnValidatePrepmtPaymentTermsCodeOnCaseIfOnBeforeValidatePrepaymentDueDate(Rec, xRec, CurrFieldNo, IsHandled);
- if not IsHandled then
- Validate("Prepayment Due Date", "Document Date");
- Validate("Prepmt. Pmt. Discount Date", 0D);
- Validate("Prepmt. Payment Discount %", 0);
- end else begin
- IsHandled := false;
- OnValidatePaymentTermsCodeOnBeforeCalcDueDate(Rec, xRec, FieldNo("Prepmt. Payment Terms Code"), CurrFieldNo, IsHandled);
- if not IsHandled then
- "Prepayment Due Date" := CalcDate(PaymentTerms."Due Date Calculation", "Document Date");
- IsHandled := false;
- OnValidatePaymentTermsCodeOnBeforeCalcPmtDiscDate(Rec, xRec, FieldNo("Prepmt. Payment Terms Code"), CurrFieldNo, IsHandled, UpdateDocumentDate);
- if not IsHandled then
- "Prepmt. Pmt. Discount Date" := CalcDate(PaymentTerms."Discount Date Calculation", "Document Date");
- if not UpdateDocumentDate then
- Validate("Prepmt. Payment Discount %", PaymentTerms."Discount %")
- end;
- end else begin
- IsHandled := false;
- OnValidatePrepmtPaymentTermsCodeOnCaseElseOnBeforeValidatePrepaymentDueDate(Rec, xRec, CurrFieldNo, IsHandled);
- if not IsHandled then
- Validate("Prepayment Due Date", "Document Date");
- if not UpdateDocumentDate then begin
- Validate("Prepmt. Pmt. Discount Date", 0D);
- Validate("Prepmt. Payment Discount %", 0);
- end;
- end;
- end;
- }
- field(144; "Prepmt. Payment Discount %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Prepmt. Payment Discount %';
- ToolTip = 'Specifies the payment discount percent granted on the prepayment if the vendor pays on or before the date entered in the Prepmt. Pmt. Discount Date field.';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePrepmtPaymentDiscountPercent(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- if not (CurrFieldNo in [0, FieldNo("Posting Date"), FieldNo("Document Date")]) then
- TestStatusOpen();
- GLSetup.Get();
- if "Payment Discount %" < GLSetup."VAT Tolerance %" then
- "VAT Base Discount %" := "Payment Discount %"
- else
- "VAT Base Discount %" := GLSetup."VAT Tolerance %";
- Validate("VAT Base Discount %");
- end;
- }
- field(151; "Quote No."; Code[20])
- {
- Caption = 'Quote No.';
- ToolTip = 'Specifies the quote number for the purchase order.';
- Editable = false;
- }
- field(160; "Job Queue Status"; Enum "Document Job Queue Status")
- {
- Caption = 'Job Queue Status';
- ToolTip = 'Specifies the status of a job queue entry that handles the posting of purchase orders.';
- Editable = false;
-
- trigger OnLookup()
- 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(161; "Job Queue Entry ID"; Guid)
- {
- Caption = 'Job Queue Entry ID';
- Editable = false;
- }
- field(165; "Incoming Document Entry No."; Integer)
- {
- Caption = 'Incoming Document Entry No.';
- ToolTip = 'Specifies the number of the incoming document that this purchase document is created for.';
- TableRelation = "Incoming Document";
-
- trigger OnValidate()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- if "Incoming Document Entry No." = xRec."Incoming Document Entry No." then
- exit;
- if "Incoming Document Entry No." = 0 then
- IncomingDocument.RemoveReferenceToWorkingDocument(xRec."Incoming Document Entry No.")
- else
- IncomingDocument.SetPurchDoc(Rec);
- end;
- }
- field(170; "Creditor No."; Code[20])
- {
- Caption = 'Creditor No.';
- ToolTip = 'Specifies the number of the vendor.';
- }
- field(171; "Payment Reference"; Code[50])
- {
- Caption = 'Payment Reference';
- ToolTip = 'Specifies the payment of the purchase invoice.';
- }
- field(175; "Invoice Received Date"; Date)
- {
- ToolTip = 'Specifies the date when the related document was received.';
-
- }
- field(178; "Journal Templ. Name"; Code[10])
- {
- Caption = 'Journal Template Name';
- ToolTip = 'Specifies the name of the journal template in which the purchase header is to be posted.';
- TableRelation = "Gen. Journal Template" where(Type = filter(Purchases));
-
- trigger OnValidate()
- begin
- PurchSetup.Get();
- TestNoSeries();
- Validate("Posting No. Series", GenJournalTemplate."Posting No. Series");
- end;
- }
- field(179; "VAT Reporting Date"; Date)
- {
- Caption = 'VAT Date';
- ToolTip = 'Specifies the date used to include entries on VAT reports in a VAT period. This is either the date that the document was created or posted, depending on your setting on the General Ledger Setup page.';
- Editable = false;
-
- trigger OnValidate()
- begin
- if "VAT Reporting Date" = 0D then
- InitVATDate();
- end;
- }
- field(180; "Self-Billing Invoice"; Boolean)
- {
- Caption = 'Self-Billing Invoice';
- }
- field(210; "Ship-to Phone No."; Text[30])
- {
- Caption = 'Ship-to Phone No.';
- ToolTip = 'Specifies the telephone number of the company''s shipping address.';
- ExtendedDatatype = PhoneNo;
- }
- field(300; "A. Rcd. Not Inv. Ex. VAT (LCY)"; Decimal)
- {
- AutoFormatExpression = '';
- CalcFormula = sum("Purchase Line"."A. Rcd. Not Inv. Ex. VAT (LCY)" where("Document Type" = field("Document Type"),
- "Document No." = field("No.")));
- Caption = 'Amount Received Not Invoiced (LCY)';
- ToolTip = 'Specifies the amount excluding VAT for the items on the order that have been received but are not yet invoiced.';
- FieldClass = FlowField;
- AutoFormatType = 1;
- }
- field(301; "Amt. Rcd. Not Invoiced (LCY)"; Decimal)
- {
- AutoFormatExpression = '';
- CalcFormula = sum("Purchase Line"."Amt. Rcd. Not Invoiced (LCY)" where("Document Type" = field("Document Type"),
- "Document No." = field("No.")));
- Caption = 'Amount Received Not Invoiced (LCY) Incl. VAT';
- ToolTip = 'Specifies the sum, in LCY, for items that have been received but have not yet been invoiced. The value in the Amt. Rcd. Not Invoiced (LCY) field is used for entries in the Purchase Line table of document type Order to calculate and update the contents of this field.';
- FieldClass = FlowField;
- AutoFormatType = 1;
- }
- field(480; "Dimension Set ID"; Integer)
- {
- Caption = 'Dimension Set ID';
- Editable = false;
- TableRelation = "Dimension Set Entry";
-
- trigger OnLookup()
- begin
- Rec.ShowDocDim();
- end;
-
- trigger OnValidate()
- begin
- DimMgt.UpdateGlobalDimFromDimSetID("Dimension Set ID", "Shortcut Dimension 1 Code", "Shortcut Dimension 2 Code");
- end;
- }
- field(1000; "Remit-to Code"; Code[20])
- {
- Caption = 'Remit-to Code';
- ToolTip = 'Specifies the code for the vendor''s remit address for this invoice.';
- TableRelation = "Remit Address".Code where("Vendor No." = field("Buy-from Vendor No."));
- }
- field(1305; "Invoice Discount Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Purchase Line"."Inv. Discount Amount" where("Document No." = field("No."),
- "Document Type" = field("Document Type")));
- Caption = 'Invoice Discount Amount';
- Editable = false;
- FieldClass = FlowField;
- }
- field(5043; "No. of Archived Versions"; Integer)
- {
- CalcFormula = max("Purchase Header Archive"."Version No." where("Document Type" = field("Document Type"),
- "No." = field("No."),
- "Doc. No. Occurrence" = field("Doc. No. Occurrence")));
- Caption = 'No. of Archived Versions';
- ToolTip = 'Specifies the number of archived versions for this document.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(5048; "Doc. No. Occurrence"; Integer)
- {
- Caption = 'Doc. No. Occurrence';
- }
- field(5050; "Campaign No."; Code[20])
- {
- Caption = 'Campaign No.';
- ToolTip = 'Specifies the campaign number the document is linked to.';
- TableRelation = Campaign;
-
- trigger OnValidate()
- begin
- UpdatePurchLinesByFieldNo(FieldNo("Campaign No."), CurrFieldNo <> 0);
- CreateDimFromDefaultDim(Rec.FieldNo("Campaign No."));
- end;
- }
- field(5052; "Buy-from Contact No."; Code[20])
- {
- Caption = 'Buy-from Contact No.';
- ToolTip = 'Specifies the number of your contact at the vendor.';
- TableRelation = Contact;
-
- trigger OnLookup()
- begin
- BuyfromContactLookup();
- end;
-
- trigger OnValidate()
- var
- Cont: Record Contact;
- begin
- TestStatusOpen();
-
- if "Buy-from Contact No." <> '' then
- if Cont.Get("Buy-from Contact No.") then
- Cont.CheckIfPrivacyBlockedGeneric();
-
- if ("Buy-from Contact No." <> xRec."Buy-from Contact No.") and
- (xRec."Buy-from Contact No." <> '')
- then
- if ConfirmUpdateField(FieldNo("Buy-from Contact No.")) then begin
- if InitFromContact("Buy-from Contact No.", "Buy-from Vendor No.", FieldCaption("Buy-from Contact No.")) then
- exit
- end else begin
- Rec := xRec;
- exit;
- end;
-
- if ("Buy-from Vendor No." <> '') and ("Buy-from Contact No." <> '') then
- CheckContactRelatedToVendorCompany("Buy-from Contact No.", "Buy-from Vendor No.", FieldNo("Buy-from Contact No."));
-
- if ("Buy-from Contact No." <> xRec."Buy-from Contact No.") then
- UpdateBuyFromVend("Buy-from Contact No.");
-
- UpdateBuyFromVendorTemplateCode();
- end;
- }
- field(5053; "Pay-to Contact No."; Code[20])
- {
- Caption = 'Pay-to Contact No.';
- ToolTip = 'Specifies the number of the contact who sends the invoice.';
- TableRelation = Contact;
-
- trigger OnLookup()
- var
- Cont: Record Contact;
- ContBusinessRelation: Record "Contact Business Relation";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupPayToContactNo(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if "Pay-to Vendor No." <> '' then
- if Cont.Get("Pay-to Contact No.") then
- Cont.SetRange("Company No.", Cont."Company No.")
- else
- if ContBusinessRelation.FindByRelation(ContBusinessRelation."Link to Table"::Vendor, "Pay-to Vendor No.") then
- Cont.SetRange("Company No.", ContBusinessRelation."Contact No.")
- else
- Cont.SetRange("No.", '');
-
- if "Pay-to Contact No." <> '' then
- if Cont.Get("Pay-to Contact No.") then;
- if PAGE.RunModal(0, Cont) = ACTION::LookupOK then begin
- xRec := Rec;
- Validate("Pay-to Contact No.", Cont."No.");
- end;
- end;
-
- trigger OnValidate()
- var
- Cont: Record Contact;
- begin
- TestStatusOpen();
-
- if "Pay-to Contact No." <> '' then
- if Cont.Get("Pay-to Contact No.") then
- Cont.CheckIfPrivacyBlockedGeneric();
-
- if ("Pay-to Contact No." <> xRec."Pay-to Contact No.") and
- (xRec."Pay-to Contact No." <> '')
- then
- if ConfirmUpdateField(FieldNo("Pay-to Contact No.")) then begin
- if InitFromContact("Pay-to Contact No.", "Pay-to Vendor No.", FieldCaption("Pay-to Contact No.")) then
- exit
- end else begin
- "Pay-to Contact No." := xRec."Pay-to Contact No.";
- exit;
- end;
-
- if ("Pay-to Vendor No." <> '') and ("Pay-to Contact No." <> '') then begin
- Cont.Get("Pay-to Contact No.");
- CheckContactRelatedToVendorCompany("Pay-to Contact No.", "Pay-to Vendor No.", FieldNo("Pay-to Contact No."));
- end;
-
- UpdatePayToVend("Pay-to Contact No.");
- end;
- }
- field(5056; "Buy-from Vendor Templ. Code"; Code[20])
- {
- Caption = 'Buy-from Vendor Template Code';
- ToolTip = 'Specifies the code for the template to create a new vendors';
- TableRelation = "Vendor Templ.";
-
- trigger OnValidate()
- var
- BuyFromVendorTemplate: Record "Vendor Templ.";
- begin
- EnsureDocumentTypeIsQuote();
- TestStatusOpen();
-
- if not InsertMode and
- ("Buy-from Vendor Templ. Code" <> xRec."Buy-from Vendor Templ. Code") and
- (xRec."Buy-from Vendor Templ. Code" <> '')
- then begin
- if GetHideValidationDialog() or not GuiAllowed() then
- Confirmed := true
- else
- Confirmed := Confirm(ConfirmChangeQst, false, FieldCaption("Buy-from Vendor Templ. Code"));
-
- if Confirmed then begin
- if InitFromTemplate("Buy-from Vendor Templ. Code", FieldCaption("Buy-from Vendor Templ. Code")) then
- exit
- end else begin
- "Buy-from Vendor Templ. Code" := xRec."Buy-from Vendor Templ. Code";
- exit;
- end;
- end;
-
- if BuyFromVendorTemplate.Get("Buy-from Vendor Templ. Code") then
- CopyFromNewBuyFromVendorTemplate(BuyFromVendorTemplate);
-
- if not InsertMode and
- ((xRec."Buy-from Vendor Templ. Code" <> "Buy-from Vendor Templ. Code") or
- (xRec."Currency Code" <> "Currency Code"))
- then
- RecreatePurchLines(CopyStr(FieldCaption("Buy-from Vendor Templ. Code"), 1, 100));
- end;
- }
- field(5057; "Pay-to Vendor Templ. Code"; Code[20])
- {
- Caption = 'Pay-to Vendor Template Code';
- TableRelation = "Vendor Templ.";
-
- trigger OnValidate()
- var
- PayToVendorTemplate: Record "Vendor Templ.";
- begin
- TestField("Document Type", "Document Type"::Quote);
- TestStatusOpen();
-
- if not InsertMode and
- ("Pay-to Vendor Templ. Code" <> xRec."Pay-to Vendor Templ. Code") and
- (xRec."Pay-to Vendor Templ. Code" <> '')
- then begin
- if GetHideValidationDialog() or not GuiAllowed then
- Confirmed := true
- else
- Confirmed := Confirm(ConfirmChangeQst, false, FieldCaption("Pay-to Vendor Templ. Code"));
-
- if Confirmed then begin
- if InitFromTemplate("Pay-to Vendor Templ. Code", FieldCaption("Pay-to Vendor Templ. Code")) then
- exit;
- end else begin
- "Pay-to Vendor Templ. Code" := xRec."Pay-to Vendor Templ. Code";
- exit;
- end;
- end;
-
- if PayToVendorTemplate.Get("Pay-to Vendor Templ. Code") then
- InitFromPayToVendorTemplate(PayToVendorTemplate);
-
- CreateDimFromDefaultDim(Rec.FieldNo("Pay-to Vendor Templ. Code"));
-
- if not InsertMode and
- (xRec."Buy-from Vendor Templ. Code" = "Buy-from Vendor Templ. Code") and
- (xRec."Pay-to Vendor Templ. Code" <> "Pay-to Vendor Templ. Code")
- then
- RecreatePurchLines(CopyStr(FieldCaption("Pay-to Vendor Templ. Code"), 1, 100));
- end;
- }
- field(5700; "Responsibility Center"; Code[10])
- {
- Caption = 'Responsibility Center';
- ToolTip = 'Specifies the code of the responsibility center, such as a distribution hub, that is associated with the involved user, company, customer, or vendor.';
- TableRelation = "Responsibility Center";
-
- trigger OnValidate()
- begin
- TestStatusOpen();
- if not UserSetupMgt.CheckRespCenter(1, "Responsibility Center") then
- Error(
- Text028,
- RespCenter.TableCaption(), UserSetupMgt.GetPurchasesFilter());
-
- UpdateLocationCode('');
- UpdateInboundWhseHandlingTime();
-
- UpdateShipToAddress();
-
- CreateDimFromDefaultDim(Rec.FieldNo("Responsibility Center"));
-
- if xRec."Responsibility Center" <> "Responsibility Center" then begin
- RecreatePurchLines(FieldCaption("Responsibility Center"));
- "Assigned User ID" := '';
- end;
- end;
- }
- field(5751; "Partially Invoiced"; Boolean)
- {
- CalcFormula = exist("Purchase Line" where("Document Type" = field("Document Type"),
- "Document No." = field("No."),
- Type = filter(<> " "),
- "Location Code" = field("Location Filter"),
- "Quantity Invoiced" = filter(<> 0)));
- Caption = 'Partially Invoiced';
- Editable = false;
- FieldClass = FlowField;
- }
- field(5752; "Completely Received"; Boolean)
- {
- CalcFormula = min("Purchase Line"."Completely Received" where("Document Type" = field("Document Type"),
- "Document No." = field("No."),
- Type = filter(<> " "),
- "Location Code" = field("Location Filter")));
- Caption = 'Completely Received';
- ToolTip = 'Specifies if all the items on the order have been shipped or, in the case of inbound items, completely received.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(5753; "Posting from Whse. Ref."; Integer)
- {
- AccessByPermission = TableData Location = R;
- Caption = 'Posting from Whse. Ref.';
- }
- field(5754; "Location Filter"; Code[10])
- {
- Caption = 'Location Filter';
- FieldClass = FlowFilter;
- TableRelation = Location;
- }
- field(5755; "Received Not Invoiced"; Boolean)
- {
- CalcFormula = min("Purchase Line"."Completely Received" where("Document Type" = field("Document Type"),
- "Document No." = field("No."),
- Type = filter(<> " "),
- "Location Code" = field("Location Filter"),
- "Quantity Invoiced" = filter(= 0)));
- Caption = 'Received Not Invoiced';
- Editable = false;
- FieldClass = FlowField;
- }
- field(5790; "Requested Receipt Date"; Date)
- {
- Caption = 'Requested Receipt Date';
- 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.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateRequestedReceiptDate(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- if "Promised Receipt Date" <> 0D then
- Error(
- Text034,
- FieldCaption("Requested Receipt Date"),
- FieldCaption("Promised Receipt Date"));
-
- if "Requested Receipt Date" <> xRec."Requested Receipt Date" then
- UpdatePurchLinesByFieldNo(FieldNo("Requested Receipt Date"), CurrFieldNo <> 0);
- end;
- }
- field(5791; "Promised Receipt Date"; Date)
- {
- Caption = 'Promised Receipt Date';
- ToolTip = 'Specifies the date that the vendor has promised to deliver the order.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePromisedReceiptDate(Rec, xRec, IsHandled, CurrFieldNo);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- if "Promised Receipt Date" <> xRec."Promised Receipt Date" then
- UpdatePurchLinesByFieldNo(FieldNo("Promised Receipt Date"), CurrFieldNo <> 0);
- end;
- }
- field(5792; "Lead Time Calculation"; DateFormula)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- Caption = 'Lead Time Calculation';
- ToolTip = 'Specifies a date formula for the amount of time it takes to replenish the item.';
-
- trigger OnValidate()
- begin
- LeadTimeMgt.CheckLeadTimeIsNotNegative("Lead Time Calculation");
-
- if "Lead Time Calculation" <> xRec."Lead Time Calculation" then
- UpdatePurchLinesByFieldNo(FieldNo("Lead Time Calculation"), CurrFieldNo <> 0);
- end;
- }
- field(5793; "Inbound Whse. Handling Time"; DateFormula)
- {
- AccessByPermission = TableData Location = R;
- Caption = 'Inbound Whse. Handling Time';
- ToolTip = 'Specifies the time it takes to make items part of available inventory, after the items have been posted as received.';
-
- trigger OnValidate()
- begin
- if "Inbound Whse. Handling Time" <> xRec."Inbound Whse. Handling Time" then
- UpdatePurchLinesByFieldNo(FieldNo("Inbound Whse. Handling Time"), CurrFieldNo <> 0);
- end;
- }
- field(5796; "Date Filter"; Date)
- {
- Caption = 'Date Filter';
- FieldClass = FlowFilter;
- }
- field(5800; "Vendor Authorization No."; Code[35])
- {
- Caption = 'Vendor Authorization No.';
- ToolTip = 'Specifies the compensation agreement identification number, sometimes referred to as the RMA No. (Returns Materials Authorization).';
- }
- field(5801; "Return Shipment No."; Code[20])
- {
- Caption = 'Return Shipment No.';
- }
- field(5802; "Return Shipment No. Series"; Code[20])
- {
- Caption = 'Return Shipment No. Series';
- TableRelation = "No. Series";
-
- trigger OnLookup()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupReturnShipmentNoSeries(Rec, IsHandled);
- if IsHandled then
- exit;
-
- PurchHeader := Rec;
- GetPurchSetup();
- PurchSetup.TestField("Posted Return Shpt. Nos.");
- if NoSeries.LookupRelatedNoSeries(PurchSetup."Posted Return Shpt. Nos.", PurchHeader."Return Shipment No. Series") then
- PurchHeader.Validate("Return Shipment No. Series");
- Rec := PurchHeader;
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateReturnShipmentNoSeries(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "Return Shipment No. Series" <> '' then begin
- GetPurchSetup();
- PurchSetup.TestField("Posted Return Shpt. Nos.");
- NoSeries.TestAreRelated(PurchSetup."Posted Return Shpt. Nos.", "Return Shipment No. Series");
- end;
- TestField("Return Shipment No.", '');
- end;
- }
- field(5803; Ship; Boolean)
- {
- Caption = 'Ship';
- }
- field(5804; "Last Return Shipment No."; Code[20])
- {
- Caption = 'Last Return Shipment No.';
- Editable = false;
- TableRelation = "Return Shipment Header";
- }
- field(5850; "Receipt on Invoice"; Boolean)
- {
- Caption = 'Receipt on Invoice';
- ToolTip = 'Specifies whether the receipt is posted with the invoice.';
-
- trigger OnValidate()
- var
- MatchedOrderLineMgmt: Codeunit "Matched Order Line Mgmt.";
- begin
- if "Receipt on Invoice" then
- MatchedOrderLineMgmt.CheckReceiptOnInvoiceAllowed(Rec);
-
- MatchedOrderLineMgmt.RefreshMatchedOrderLineReceipt(Rec);
- end;
- }
- field(7000; "Price Calculation Method"; Enum "Price Calculation Method")
- {
- Caption = 'Price Calculation Method';
- }
- field(9000; "Assigned User ID"; Code[50])
- {
- Caption = 'Assigned User ID';
- ToolTip = 'Specifies the ID of the user who is responsible for the document.';
- DataClassification = EndUserIdentifiableInformation;
- TableRelation = "User Setup";
-
- trigger OnValidate()
- begin
- if not UserSetupMgt.CheckRespCenter(1, "Responsibility Center", "Assigned User ID") then
- Error(
- Text049, "Assigned User ID",
- RespCenter.TableCaption(), UserSetupMgt.GetPurchasesFilter("Assigned User ID"));
- end;
- }
- field(9001; "Pending Approvals"; Integer)
- {
- CalcFormula = count("Approval Entry" where("Table ID" = const(38),
- "Document Type" = field("Document Type"),
- "Document No." = field("No."),
- Status = filter(Open | Created)));
- Caption = 'Pending Approvals';
- FieldClass = FlowField;
- }
- field(11301; "Doc. Amount Incl. VAT"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Doc. Amount Incl. VAT';
- ToolTip = 'Specifies the total amount (including VAT) of the purchase invoice or credit memo as specified in the external document. When this value comes from an e-document service, it''s value can''t be changed.';
-
- trigger OnValidate()
- var
- Currency: Record Currency;
- TotalPurchaseLine: Record "Purchase Line";
- DocumentTotals: Codeunit "Document Totals";
- VATAmount: Decimal;
- begin
- if PurchLine."VAT Calculation Type" <> PurchLine."VAT Calculation Type"::"Normal VAT" then
- exit;
- if not ("Document Type" in ["Document Type"::Invoice, "Document Type"::"Credit Memo"]) then
- exit;
- if not FindSuggestedPurchLine(PurchLine) then
- exit;
-
- Currency.Initialize("Currency Code");
- Currency.TestField("Amount Rounding Precision");
- DocumentTotals.CalculatePurchaseTotals(TotalPurchaseLine, VATAmount, PurchLine);
- UpdateDocAmountVAT("Doc. Amount Incl. VAT", VATAmount, TotalPurchaseLine."Amount Including VAT", Currency."Amount Rounding Precision");
- end;
- }
- field(11302; "Doc. Amount VAT"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Doc. Amount VAT';
- ToolTip = 'Specifies the VAT amount of the purchase invoice or credit memo as specified in the external document. When this values comes from an e-document service, it''s value can''t be changed.';
-
- trigger OnValidate()
- var
- Currency: Record Currency;
- TotalPurchaseLine: Record "Purchase Line";
- DocumentTotals: Codeunit "Document Totals";
- DocAmountVAT: Decimal;
- VATAmount: Decimal;
- begin
- if not ("Document Type" in ["Document Type"::Invoice, "Document Type"::"Credit Memo"]) then
- exit;
-
- if FindSuggestedPurchLine(PurchLine) and (PurchLine."VAT Calculation Type" = PurchLine."VAT Calculation Type"::"Normal VAT") then begin
- Currency.Initialize("Currency Code");
- Currency.TestField("Amount Rounding Precision");
- DocumentTotals.CalculatePurchaseTotals(TotalPurchaseLine, VATAmount, PurchLine);
- DocAmountVAT := CalcDocAmountVAT(
- "Doc. Amount Incl. VAT", VATAmount, TotalPurchaseLine."Amount Including VAT", Currency."Amount Rounding Precision");
-
- if CheckDifferenceInclVAT("Doc. Amount VAT", DocAmountVAT, Currency) then
- Error(
- ErrorInfo.Create(
- StrSubstNo(WarnDocAmountVatTxt, FieldCaption("Doc. Amount VAT"), Format(DocAmountVAT)),
- true,
- Rec));
- end else
- if "Doc. Amount VAT" > "Doc. Amount Incl. VAT" then
- Error(
- ErrorInfo.Create(
- StrSubstNo(WarnDocAmountVatTxt, FieldCaption("Doc. Amount VAT"), Format("Doc. Amount Incl. VAT")),
- true,
- Rec));
- end;
- }
- field(11000000; "Transaction Mode Code"; Code[20])
- {
- Caption = 'Transaction Mode Code';
- TableRelation = "Transaction Mode".Code where("Account Type" = const(Vendor));
-
- trigger OnValidate()
- var
- TrMode: Record "Transaction Mode";
- begin
- if "Transaction Mode Code" <> '' then begin
- TrMode.Get(TrMode."Account Type"::Vendor, "Transaction Mode Code");
- if TrMode."Payment Method Code" <> '' then
- Validate("Payment Method Code", TrMode."Payment Method Code");
- if TrMode."Payment Terms Code" <> '' then
- Validate("Payment Terms Code", TrMode."Payment Terms Code");
- end;
- end;
- }
- field(11000001; "Bank Account Code"; Code[20])
- {
- Caption = 'Bank Account Code';
- TableRelation = "Vendor Bank Account".Code where("Vendor No." = field("Pay-to Vendor No."));
- }
- }
-
- keys
- {
- key(Key1; "Document Type", "No.")
- {
- Clustered = true;
- }
- key(Key2; "No.", "Document Type")
- {
- }
- key(Key3; "Document Type", "Buy-from Vendor No.")
- {
- }
- key(Key4; "Document Type", "Pay-to Vendor No.")
- {
- }
- key(Key5; "Buy-from Vendor No.")
- {
- }
- key(Key6; "Incoming Document Entry No.")
- {
- }
- key(Key7; "Document Date")
- {
- }
- key(Key8; Status, "Expected Receipt Date", "Location Code", "Responsibility Center")
- {
- }
- key(Key9; "Assigned User ID")
- {
- }
- key(Key10; "Document Type", "Buy-from Contact No.")
- {
- }
- }
-
- fieldgroups
- {
- fieldgroup(DropDown; "No.", "Buy-from Vendor Name", "Amount Including VAT")
- {
- }
- }
-
- trigger OnDelete()
- var
- PurchCommentLine: Record "Purch. Comment Line";
- PostPurchDelete: Codeunit "PostPurch-Delete";
- ArchiveManagement: Codeunit ArchiveManagement;
- ShowPostedDocsToPrint: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeOnDelete(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if not UserSetupMgt.CheckRespCenter(1, "Responsibility Center") then
- Error(
- Text023,
- RespCenter.TableCaption(), UserSetupMgt.GetPurchasesFilter());
-
- ArchiveManagement.AutoArchivePurchDocument(Rec);
- PostPurchDelete.DeleteHeader(
- Rec, PurchRcptHeader, PurchInvHeader, PurchCrMemoHeader,
- ReturnShptHeader, PurchInvHeaderPrepmt, PurchCrMemoHeaderPrepmt);
- Validate("Applies-to ID", '');
- Rec.Validate("Incoming Document Entry No.", 0);
-
- DeleteRecordInApprovalRequest();
- PurchLine.LockTable();
-
- DeleteWarehouseRequest();
-
- PurchLine.SetRange("Document Type", "Document Type");
- PurchLine.SetRange("Document No.", "No.");
- PurchLine.SetRange(Type, PurchLine.Type::"Charge (Item)");
- DeletePurchaseLines();
- PurchLine.SetRange(Type);
- DeletePurchaseLines();
-
- PurchCommentLine.SetRange("Document Type", "Document Type");
- PurchCommentLine.SetRange("No.", "No.");
- PurchCommentLine.DeleteAll();
-
- ShowPostedDocsToPrint :=
- (PurchRcptHeader."No." <> '') or (PurchInvHeader."No." <> '') or (PurchCrMemoHeader."No." <> '') or
- (ReturnShptHeader."No." <> '') or (PurchInvHeaderPrepmt."No." <> '') or (PurchCrMemoHeaderPrepmt."No." <> '');
- OnBeforeShowPostedDocsToPrintCreatedMsg(ShowPostedDocsToPrint, HideValidationDialog, Rec);
- if ShowPostedDocsToPrint then
- Message(PostedDocsToPrintCreatedMsg);
- end;
-
- trigger OnInsert()
- var
- IsHandled: Boolean;
- begin
- OnBeforeOnInsert(Rec, IsHandled);
- if IsHandled then
- exit;
-
- InitInsert();
- Insertmode := true;
-
- SetBuyFromVendorFromFilter();
-
- if GetFilterContNo() <> '' then
- Validate("Buy-from Contact No.", GetFilterContNo());
-
- if "Purchaser Code" = '' then
- SetDefaultPurchaser();
-
- if "Buy-from Vendor No." <> '' then
- StandardCodesMgtGlobal.CheckCreatePurchRecurringLines(Rec);
- end;
-
- trigger OnRename()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeOnRename(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- Error(Text003, TableCaption);
- end;
-
- var
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text003: Label 'You cannot rename a %1.';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- ConfirmChangeQst: Label 'Do you want to change %1?', Comment = '%1 = a Field Caption like Currency Code';
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text005: Label 'You cannot reset %1 because the document still has one or more lines.';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- YouCannotChangeFieldErr: Label 'You cannot change %1 because the order is associated with one or more sales orders.', Comment = '%1 - fieldcaption';
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text007: Label '%1 is greater than %2 in the %3 table.\';
-#pragma warning restore AA0470
- Text008: Label 'Confirm change?';
- Text009: Label 'Deleting this document will cause a gap in the number series for receipts. An empty receipt %1 will be created to fill this gap in the number series.\\Do you want to continue?', Comment = '%1 = Document No.';
- Text012: Label 'Deleting this document will cause a gap in the number series for posted invoices. An empty posted invoice %1 will be created to fill this gap in the number series.\\Do you want to continue?', Comment = '%1 = Document No.';
- Text014: Label 'Deleting this document will cause a gap in the number series for posted credit memos. An empty posted credit memo %1 will be created to fill this gap in the number series.\\Do you want to continue?', Comment = '%1 = Document No.';
-#pragma warning restore AA0074
- RecreatePurchLinesMsg: Label 'If you change %1, the existing purchase lines will be deleted and new purchase lines based on the new information in the header will be created.\\Do you want to continue?', Comment = '%1: FieldCaption';
- ResetItemChargeAssignMsg: Label 'If you change %1, the existing purchase lines will be deleted and new purchase lines based on the new information in the header will be created.\The amount of the item charge assignment will be reset to 0.\\Do you want to continue?', Comment = '%1: FieldCaption';
-#pragma warning disable AA0470
- LinesNotUpdatedMsg: Label 'You have changed %1 on the purchase header, but it has not been changed on the existing purchase lines.', Comment = 'You have changed Posting Date on the purchase header, but it has not been changed on the existing purchase lines.';
-#pragma warning restore AA0470
- LinesNotUpdatedDateMsg: Label 'You have changed the %1 on the purchase header, which might affect the prices and discounts on the purchase lines.', Comment = '%1: OrderDate';
-#pragma warning disable AA0074
- Text020: Label 'You must update the existing purchase lines manually.';
-#pragma warning restore AA0074
- AffectExchangeRateMsg: Label 'The change may affect the exchange rate that is used for price calculation on the purchase lines.';
-#pragma warning disable AA0074
- Text022: Label 'Do you want to update the exchange rate?';
-#pragma warning disable AA0470
- Text023: Label 'You cannot delete this document. Your identification is set up to process from %1 %2 only.';
- Text025: Label 'You have modified the %1 field. Note that the recalculation of VAT may cause penny differences, so you must check the amounts afterwards. ';
- Text027: Label 'Do you want to update the %2 field on the lines to reflect the new value of %1?';
- Text028: Label 'Your identification is set up to process from %1 %2 only.';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- MaxAllowedValueIs100Err: Label 'The values must be less than or equal 100.';
-#pragma warning disable AA0074
- Text029: Label 'Deleting this document will cause a gap in the number series for return shipments. An empty return shipment %1 will be created to fill this gap in the number series.\\Do you want to continue?', Comment = '%1 = Document No.';
-#pragma warning restore AA0074
- DoYouWantToKeepExistingDimensionsQst: Label 'This will change the dimension specified on the document. Do you want to recalculate/update dimensions?';
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text032: Label 'You have modified %1.\\Do you want to update the lines?', Comment = 'You have modified Currency Factor.\\Do you want to update the lines?';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- ReviewLinesManuallyMsg: Label 'You should review the lines and manually update prices and discounts if needed.';
- UpdateLinesOrderDateAutomaticallyQst: Label 'Do you want to update the order date for existing lines?';
- DifferentDatesQst: Label 'Posting Date %1 is different from Work Date %2.\\Do you want to continue?', Comment = '%1 - Posting Date, %2 - work date';
- DifferentDatesErr: Label 'Posting Date %1 is different from Work Date %2.\\Batch posting cannot be used.', Comment = '%1 - Posting Date, %2 - work date';
- PurchLineMatchedToOrderLineErr: Label 'You cannot change the field because line %1 is matched to order line.', Comment = '%1 - Line No.';
- GLSetup: Record "General Ledger Setup";
- GLAcc: Record "G/L Account";
- xPurchLine: Record "Purchase Line";
- VendLedgEntry: Record "Vendor Ledger Entry";
- Vend: Record Vendor;
- PaymentTerms: Record "Payment Terms";
- PaymentMethod: Record "Payment Method";
- CurrExchRate: Record "Currency Exchange Rate";
- Cust: Record Customer;
- CompanyInfo: Record "Company Information";
- PostCode: Record "Post Code";
- BankAcc: Record "Bank Account";
- PurchRcptHeader: Record "Purch. Rcpt. Header";
- PurchInvHeader: Record "Purch. Inv. Header";
- PurchCrMemoHeader: Record "Purch. Cr. Memo Hdr.";
- ReturnShptHeader: Record "Return Shipment Header";
- PurchInvHeaderPrepmt: Record "Purch. Inv. Header";
- PurchCrMemoHeaderPrepmt: Record "Purch. Cr. Memo Hdr.";
- GenBusPostingGrp: Record "Gen. Business Posting Group";
- RespCenter: Record "Responsibility Center";
- Location: Record Location;
- WhseRequest: Record "Warehouse Request";
- InvtSetup: Record "Inventory Setup";
- GenJournalTemplate: Record "Gen. Journal Template";
- GlobalNoSeries: Record "No. Series";
- SalespersonPurchaser: Record "Salesperson/Purchaser";
- NoSeries: Codeunit "No. Series";
- DimMgt: Codeunit DimensionManagement;
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- UserSetupMgt: Codeunit "User Setup Management";
- LeadTimeMgt: Codeunit "Lead-Time Management";
- PostingSetupMgt: Codeunit PostingSetupManagement;
- StandardCodesMgtGlobal: Codeunit "Standard Codes Mgt.";
- ApplicationAreaMgmt: Codeunit "Application Area Mgmt.";
- CurrencyDate: Date;
- Confirmed: Boolean;
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text034: Label 'You cannot change the %1 when the %2 has been filled in.';
- Text037: Label 'Contact %1 %2 is not related to vendor %3.';
- Text038: Label 'Contact %1 %2 is related to a different company than vendor %3.';
- Text039: Label 'Contact %1 %2 is not related to a vendor.';
- Text040: Label 'You can not change the %1 field because %2 %3 has %4 = %5 and the %6 has already been assigned %7 %8.';
- Text042: Label 'You must cancel the approval process if you wish to change the %1.';
- Text045: Label 'Deleting this document will cause a gap in the number series for prepayment invoices. An empty prepayment invoice %1 will be created to fill this gap in the number series.\\Do you want to continue?';
- Text046: Label 'Deleting this document will cause a gap in the number series for prepayment credit memos. An empty prepayment credit memo %1 will be created to fill this gap in the number series.\\Do you want to continue?';
- Text049: Label '%1 is set up to process from %2 %3 only.';
-#pragma warning restore AA0470
- Text050: Label 'Reservations exist for this order. These reservations will be canceled if a date conflict is caused by this change.\\Do you want to continue?';
- Text051: Label 'You may have changed a dimension.\\Do you want to update the lines?';
-#pragma warning disable AA0470
- Text052: Label 'The %1 field on the purchase order %2 must be the same as on sales order %3.';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- ReplaceDocumentDate: Boolean;
-#pragma warning disable AA0470
- PrepaymentInvoicesNotPaidErr: Label 'You cannot post the document of type %1 with the number %2 before all related prepayment invoices are posted.', Comment = 'You cannot post the document of type Order with the number 1001 before all related prepayment invoices are posted.';
-#pragma warning restore AA0470
- StatisticsInsuffucientPermissionsErr: Label 'You don''t have permission to view statistics.';
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text054: Label 'There are unpaid prepayment invoices that are related to the document of type %1 with the number %2.';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- DeferralLineQst: Label 'You have changed the %1 on the purchase header, do you want to update the deferral schedules for the lines with this date?', Comment = '%1=The posting date on the document.';
- PostedDocsToPrintCreatedMsg: Label 'One or more related posted documents have been generated during deletion to fill gaps in the posting number series. You can view or print the documents from the respective document archive.';
- BuyFromVendorTxt: Label 'Buy-from Vendor';
- PayToVendorTxt: Label 'Pay-to Vendor';
- DocumentNotPostedClosePageQst: Label 'The document has been saved but is not yet posted.\\Are you sure you want to exit?';
- SelectNoSeriesAllowed: Boolean;
- MixedDropshipmentErr: Label 'You cannot print the purchase order because it contains one or more lines for drop shipment in addition to regular purchase lines.';
- ModifyVendorAddressNotificationLbl: Label 'Update the address';
- DontShowAgainActionLbl: Label 'Don''t show again';
- ModifyVendorAddressNotificationMsg: Label 'The address you entered for %1 is different from the Vendor''s existing address.', Comment = '%1=Vendor name';
- ModifyBuyFromVendorAddressNotificationNameTxt: Label 'Update Buy-from Vendor Address';
- ModifyBuyFromVendorAddressNotificationDescriptionTxt: Label 'Warn if the Buy-from address on purchase documents is different from the Vendor''s existing address.';
- ModifyPayToVendorAddressNotificationNameTxt: Label 'Update Pay-to Vendor Address';
- ModifyPayToVendorAddressNotificationDescriptionTxt: Label 'Warn if the Pay-to address on purchase documents is different from the Vendor''s existing address.';
- PurchaseAlreadyExistsTxt: Label 'Purchase %1 %2 already exists for this vendor.', Comment = '%1 = Document Type; %2 = Document No.';
- ShowVendLedgEntryTxt: Label 'Show the vendor ledger entry.';
- ShowDocAlreadyExistNotificationNameTxt: Label 'Purchase document with same external document number already exists.';
- ShowDocAlreadyExistNotificationDescriptionTxt: Label 'Warn if purchase document with same external document number already exists.';
- DuplicatedCaptionsNotAllowedErr: Label 'Field captions must not be duplicated when using this method. Use UpdatePurchLinesByFieldNo instead.';
-#pragma warning disable AA0470
- SplitMessageTxt: Label '%1\%2', Comment = 'Some message text 1.\Some message text 2.';
-#pragma warning restore AA0470
- FullPurchaseTypesTxt: Label 'Purchase Quote,Purchase Order,Purchase Invoice,Purchase Credit Memo,Purchase Blanket Order,Purchase Return Order';
- RecreatePurchaseLinesCancelErr: Label 'Change in the existing purchase lines for the field %1 is cancelled by user.', Comment = '%1 - Field Name, Sample:You must delete the existing purchase lines before you can change Currency Code.';
- WarnZeroQuantityPostingTxt: Label 'Warn before posting Purchase lines with 0 quantity';
- WarnZeroQuantityPostingDescriptionTxt: Label 'Warn before posting lines on Purchase documents where quantity is 0.';
- WarnDocAmountVatTxt: Label '%1 must not be more than %2.', comment = '%1 - Doc. Amount VAT; %2 - DocAmountVAT';
- CreateVendorQst: Label 'You cannot Release Quote or Make Order unless you specify a vendor on the quote.\\Do you want to create vendor(s) now?';
- SelectVendorTemplateQst: Label 'Do you want to select the vendor template?';
- CalledFromWhseDoc: Boolean;
-
- protected var
- PurchSetup: Record "Purchases & Payables Setup";
- PurchHeader: Record "Purchase Header";
- PurchLine: Record "Purchase Line";
- InsertMode: Boolean;
- HideValidationDialog: Boolean;
- StatusCheckSuspended: Boolean;
- SkipBuyFromContact: Boolean;
- SkipPayToContact: Boolean;
- SkipTaxCalculation: Boolean;
- UpdateDocumentDate: Boolean;
-
- ///
- /// Initializes a new purchase header with a new document number from the number series.
- ///
- procedure InitInsert()
- var
- PurchaseHeader2: Record "Purchase Header";
- NoSeriesCode: Code[20];
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInitInsert(Rec, xRec, IsHandled);
- if not IsHandled then
- if "No." = '' then begin
- TestNoSeries();
- NoSeriesCode := GetNoSeriesCode();
- "No. Series" := NoSeriesCode;
- if NoSeries.AreRelated("No. Series", xRec."No. Series") then
- "No. Series" := xRec."No. Series";
- "No." := NoSeries.GetNextNo("No. Series", "Posting Date");
- PurchaseHeader2.ReadIsolation(IsolationLevel::ReadUncommitted);
- PurchaseHeader2.SetLoadFields("No.");
- while PurchaseHeader2.Get("Document Type", "No.") do
- "No." := NoSeries.GetNextNo("No. Series", "Posting Date");
- end;
-
- OnInitInsertOnBeforeInitRecord(Rec, xRec);
- InitRecord();
- end;
-
- ///
- /// Initializes a new purchase header with default values.
- ///
- procedure InitRecord()
- var
- IsHandled, SkipInitialization : Boolean;
- begin
- GetPurchSetup();
- IsHandled := false;
- OnBeforeInitRecord(Rec, IsHandled, xRec, PurchSetup, GLSetup, SkipInitialization);
- if SkipInitialization then
- exit;
- if not IsHandled then
- InitPostingNoSeries();
-
- if "Document Type" = "Document Type"::Invoice then
- "Expected Receipt Date" := WorkDate();
-
- if not ("Document Type" in ["Document Type"::"Blanket Order", "Document Type"::Quote]) and
- ("Posting Date" = 0D)
- then
- "Posting Date" := WorkDate();
-
- if PurchSetup."Default Posting Date" = PurchSetup."Default Posting Date"::"No Date" then
- "Posting Date" := 0D;
-
- "Order Date" := WorkDate();
- "Document Date" := WorkDate();
-
- InitVATDate();
-
- OnInitRecordOnAfterAssignDates(Rec);
-
- ValidateEmptySellToCustomerAndLocation();
-
- if IsCreditDocType() then begin
- GLSetup.Get();
- Correction := GLSetup."Mark Cr. Memos as Corrections";
- end;
-
- InitPostingDescription();
-
- UpdateInboundWhseHandlingTime();
-
- IsHandled := false;
- OnInitRecordOnBeforeAssignResponsibilityCenter(Rec, IsHandled);
- if not IsHandled then
- "Responsibility Center" := UserSetupMgt.GetRespCenter(1, "Responsibility Center");
- GetNextArchiveDocOccurrenceNo();
-
- OnAfterInitRecord(Rec);
- end;
-
- local procedure InitNoSeries()
- begin
- if xRec."Receiving No." <> '' then begin
- "Receiving No. Series" := xRec."Receiving No. Series";
- "Receiving No." := xRec."Receiving No.";
- end;
- if xRec."Posting No." <> '' then begin
- "Posting No. Series" := xRec."Posting No. Series";
- "Posting No." := xRec."Posting No.";
- end;
- if xRec."Return Shipment No." <> '' then begin
- "Return Shipment No. Series" := xRec."Return Shipment No. Series";
- "Return Shipment No." := xRec."Return Shipment No.";
- end;
- if xRec."Prepayment No." <> '' then begin
- "Prepayment No. Series" := xRec."Prepayment No. Series";
- "Prepayment No." := xRec."Prepayment No.";
- end;
- if xRec."Prepmt. Cr. Memo No." <> '' then begin
- "Prepmt. Cr. Memo No. Series" := xRec."Prepmt. Cr. Memo No. Series";
- "Prepmt. Cr. Memo No." := xRec."Prepmt. Cr. Memo No.";
- end;
-
- OnAfterInitNoSeries(Rec, xRec);
- end;
-
- ///
- /// Initializes the posting description with formatted document type and number text for the purchase header.
- ///
- procedure InitPostingDescription()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInitPostingDescription(Rec, IsHandled);
- if IsHandled then
- exit;
-
- Rec."Posting Description" := Format(Rec."Document Type") + ' ' + Rec."No.";
- end;
-
- local procedure InitVATDate()
- begin
- "VAT Reporting Date" := GLSetup.GetVATDate("Posting Date", "Document Date");
- end;
-
- ///
- /// Sets global StandardCodesMgtGlobal codeunit to a new instance.
- ///
- /// The new codeunit instance to set.
- procedure SetStandardCodesMgt(var StandardCodesMgtNew: Codeunit "Standard Codes Mgt.")
- begin
- StandardCodesMgtGlobal := StandardCodesMgtNew;
- end;
-
- ///
- /// Opens a page to select related number series for the purchase header and updates the document number with the selected number series.
- ///
- ///
- /// Purchase header record before the change. The no series code from this record will be highlighted by default on the open page.
- ///
- /// True if the document number has changed, otherwise false.
- procedure AssistEdit(OldPurchHeader: Record "Purchase Header"): Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeAssistEdit(Rec, OldPurchHeader, IsHandled);
- if IsHandled then
- exit;
-
- GetPurchSetup();
- TestNoSeries();
- if NoSeries.LookupRelatedNoSeries(GetNoSeriesCode(), OldPurchHeader."No. Series", "No. Series") then begin
- "No." := NoSeries.GetNextNo("No. Series");
- exit(true);
- end;
- end;
-
- ///
- /// Checks if the number series for different types of purchase documents are filled in the purchase setup.
- ///
- procedure TestNoSeries()
- var
- IsHandled: Boolean;
- begin
- GetPurchSetup();
- IsHandled := false;
- OnBeforeTestNoSeries(Rec, IsHandled);
- if not IsHandled then begin
- case "Document Type" of
- "Document Type"::Quote:
- PurchSetup.TestField("Quote Nos.");
- "Document Type"::Order:
- PurchSetup.TestField("Order Nos.");
- "Document Type"::Invoice:
- PurchSetup.TestField("Invoice Nos.");
- "Document Type"::"Return Order":
- PurchSetup.TestField("Return Order Nos.");
- "Document Type"::"Credit Memo":
- PurchSetup.TestField("Credit Memo Nos.");
- "Document Type"::"Blanket Order":
- PurchSetup.TestField("Blanket Order Nos.");
- end;
- GLSetup.GetRecordOnce();
- if not GLSetup."Journal Templ. Name Mandatory" then
- case "Document Type" of
- "Document Type"::Invoice:
- PurchSetup.TestField("Posted Invoice Nos.");
- "Document Type"::"Credit Memo":
- PurchSetup.TestField("Posted Credit Memo Nos.");
- end
- else begin
- PurchSetup.GetRecordOnce();
- if not IsCreditDocType() then begin
- PurchSetup.TestField("P. Invoice Template Name");
- if "Journal Templ. Name" = '' then
- GenJournalTemplate.Get(PurchSetup."P. Invoice Template Name")
- else
- GenJournalTemplate.Get("Journal Templ. Name");
- end else begin
- PurchSetup.TestField("P. Cr. Memo Template Name");
- if "Journal Templ. Name" = '' then
- GenJournalTemplate.Get(PurchSetup."P. Cr. Memo Template Name")
- else
- GenJournalTemplate.Get("Journal Templ. Name");
- end;
- GenJournalTemplate.TestField("Posting No. Series");
- GlobalNoSeries.Get(GenJournalTemplate."Posting No. Series");
- GlobalNoSeries.TestField("Default Nos.", true);
- end;
- end;
-
- OnAfterTestNoSeries(Rec, PurchSetup);
- end;
-
- ///
- /// Returns the number series code from the purchase setup based on the document type of the purchase header.
- ///
- /// Number series code.
- procedure GetNoSeriesCode(): Code[20]
- var
- NoSeriesCode: Code[20];
- IsHandled: Boolean;
- begin
- GetPurchSetup();
- IsHandled := false;
- OnBeforeGetNoSeriesCode(PurchSetup, NoSeriesCode, IsHandled, Rec);
- if IsHandled then
- exit(NoSeriesCode);
-
- case "Document Type" of
- "Document Type"::Quote:
- NoSeriesCode := PurchSetup."Quote Nos.";
- "Document Type"::Order:
- NoSeriesCode := PurchSetup."Order Nos.";
- "Document Type"::Invoice:
- NoSeriesCode := PurchSetup."Invoice Nos.";
- "Document Type"::"Return Order":
- NoSeriesCode := PurchSetup."Return Order Nos.";
- "Document Type"::"Credit Memo":
- NoSeriesCode := PurchSetup."Credit Memo Nos.";
- "Document Type"::"Blanket Order":
- NoSeriesCode := PurchSetup."Blanket Order Nos.";
- end;
- OnAfterGetNoSeriesCode(Rec, PurchSetup, NoSeriesCode);
-
- if not SelectNoSeriesAllowed then
- exit(NoSeriesCode);
-
- if NoSeries.IsAutomatic(NoSeriesCode) then
- exit(NoSeriesCode);
-
- if NoSeries.HasRelatedSeries(NoSeriesCode) then
- if NoSeries.LookupRelatedNoSeries(NoSeriesCode, "No. Series") then
- exit("No. Series");
-
- exit(NoSeriesCode);
- end;
-
- local procedure GetNextArchiveDocOccurrenceNo()
- var
- ArchiveManagement: Codeunit ArchiveManagement;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetNextArchiveDocOccurrenceNo(Rec, IsHandled);
- if IsHandled then
- exit;
-
- "Doc. No. Occurrence" :=
- ArchiveManagement.GetNextOccurrenceNo(Database::"Purchase Header", Rec."Document Type".AsInteger(), Rec."No.");
- end;
-
- local procedure GetPostingNoSeriesCode() PostingNos: Code[20]
- var
- IsHandled: Boolean;
- begin
- GetPurchSetup();
- IsHandled := false;
- OnBeforeGetPostingNoSeriesCode(Rec, PurchSetup, PostingNos, IsHandled);
- if IsHandled then
- exit(PostingNos);
-
- GLSetup.GetRecordOnce();
- if not GLSetup."Journal Templ. Name mandatory" then
- if IsCreditDocType() then
- PostingNos := PurchSetup."Posted Credit Memo Nos."
- else
- PostingNos := PurchSetup."Posted Invoice Nos."
- else begin
- GenJournalTemplate.Get("Journal Templ. Name");
- PostingNos := GenJournalTemplate."Posting No. Series";
- end;
-
- OnAfterGetPostingNoSeriesCode(Rec, PostingNos);
- end;
-
- local procedure GetPostingPrepaymentNoSeriesCode() PostingNos: Code[20]
- begin
- if IsCreditDocType() then
- PostingNos := PurchSetup."Posted Prepmt. Cr. Memo Nos."
- else
- PostingNos := PurchSetup."Posted Prepmt. Inv. Nos.";
-
- OnAfterGetPrepaymentPostingNoSeriesCode(Rec, PostingNos);
- end;
-
- ///
- /// Checks if the number series has to be assigned chronologically after various documents are already posted.
- ///
- /// Posted document number.
- /// Number series code to check.
- /// Posted document number field caption.
- /// Number series field caption.
- procedure TestNoSeriesDate(No: Code[20]; NoSeriesCode: Code[20]; NoCapt: Text[1024]; NoSeriesCapt: Text[1024])
- begin
- if (No <> '') and (NoSeriesCode <> '') then begin
- GlobalNoSeries.Get(NoSeriesCode);
- if GlobalNoSeries."Date Order" then
- Error(
- Text040,
- FieldCaption("Posting Date"), NoSeriesCapt, NoSeriesCode,
- GlobalNoSeries.FieldCaption("Date Order"), GlobalNoSeries."Date Order", "Document Type",
- NoCapt, No);
- end;
- end;
-
- ///
- /// Opens a confirmation dialog to confirm the deletion of the purchase header.
- /// This check is to confirm with the user that gaps will happen in the posted documents if the document is deleted.
- ///
- /// True if purchase header should be deleted, otherwise false.
- procedure ConfirmDeletion() Result: Boolean
- var
- SourceCode: Record "Source Code";
- SourceCodeSetup: Record "Source Code Setup";
- PostPurchDelete: Codeunit "PostPurch-Delete";
- ConfirmManagement: Codeunit "Confirm Management";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeConfirmDeletion(Rec, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- SourceCodeSetup.Get();
- SourceCodeSetup.TestField("Deleted Document");
- SourceCode.Get(SourceCodeSetup."Deleted Document");
-
- PostPurchDelete.InitDeleteHeader(
- Rec, PurchRcptHeader, PurchInvHeader, PurchCrMemoHeader,
- ReturnShptHeader, PurchInvHeaderPrepmt, PurchCrMemoHeaderPrepmt, SourceCode.Code);
-
- if PurchRcptHeader."No." <> '' then
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text009, PurchRcptHeader."No."), true) then
- exit;
- if PurchInvHeader."No." <> '' then
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text012, PurchInvHeader."No."), true) then
- exit;
- if PurchCrMemoHeader."No." <> '' then
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text014, PurchCrMemoHeader."No."), true) then
- exit;
- if ReturnShptHeader."No." <> '' then
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text029, ReturnShptHeader."No."), true) then
- exit;
- if "Prepayment No." <> '' then
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text045, PurchInvHeaderPrepmt."No."), true) then
- exit;
- if "Prepmt. Cr. Memo No." <> '' then
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text046, PurchCrMemoHeaderPrepmt."No."), true) then
- exit;
- exit(true);
- end;
-
- local procedure GetPurchSetup()
- begin
- PurchSetup.Get();
- OnAfterGetPurchSetup(Rec, PurchSetup, CurrFieldNo);
- end;
-
- ///
- /// Updates the global Vend record if it doesn't already match the provided vendor no.
- ///
- /// Vendor number to set.
- procedure GetVend(VendNo: Code[20])
- var
- GetVendor: Boolean;
- begin
- GetVendor := VendNo <> Vend."No.";
- OnBeforeGetVend(Rec, Vend, VendNo, GetVendor);
- if GetVendor then
- Vend.Get(VendNo);
- end;
-
- ///
- /// Returns document status field style expression based on the status of the purchase header.
- ///
- /// Status style expression.
- procedure GetStatusStyleText() StatusStyleText: Text
- begin
- if Status = Status::Open then
- StatusStyleText := 'Favorable'
- else
- StatusStyleText := 'Strong';
-
- OnAfterGetStatusStyleText(Rec, StatusStyleText);
- end;
-
- ///
- /// Checks if the purchase lines exists for purchase header.
- ///
- /// True if purchase lines exists, otherwise false.
- procedure PurchLinesExist(): Boolean
- var
- IsHandled, Result : Boolean;
- begin
- IsHandled := false;
- Result := false;
- OnBeforePurchLinesExist(Rec, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- PurchLine.Reset();
- PurchLine.ReadIsolation := IsolationLevel::ReadUncommitted;
- PurchLine.SetRange("Document Type", "Document Type");
- PurchLine.SetRange("Document No.", "No.");
- exit(not PurchLine.IsEmpty);
- end;
-
- local procedure ResetInvoiceDiscountValue()
- begin
- if "Invoice Discount Value" <> 0 then begin
- CalcFields("Invoice Discount Amount");
- if "Invoice Discount Amount" = 0 then
- "Invoice Discount Value" := 0;
- end;
- end;
-
- procedure LookupBuyFromContact()
- var
- Contact: Record Contact;
- begin
- if "Buy-from Vendor No." = '' then
- exit;
-
- Contact.FilterGroup(2);
- LookupContact("Buy-from Vendor No.", "Buy-from Contact No.", Contact);
- if PAGE.RunModal(0, Contact) = ACTION::LookupOK then begin
- Validate("Buy-from Contact No.", Contact."No.");
- OnLookupBuyFromContactOnAfterValidateBuyFromContactNo(Rec, Contact);
- end;
- Contact.FilterGroup(0);
- end;
-
- procedure PerformManualRelease(var PurchaseHeader: Record "Purchase Header")
- var
- BatchProcessingMgt: Codeunit "Batch Processing Mgt.";
- NoOfSelected: Integer;
- NoOfSkipped: Integer;
- PrevFilterGroup: Integer;
- begin
- NoOfSelected := PurchaseHeader.Count();
- PrevFilterGroup := PurchaseHeader.FilterGroup();
- PurchaseHeader.FilterGroup(10);
- PurchaseHeader.SetFilter(Status, '<>%1', PurchaseHeader.Status::Released);
- NoOfSkipped := NoOfSelected - PurchaseHeader.Count;
- BatchProcessingMgt.BatchProcess(PurchaseHeader, Codeunit::"Purchase Manual Release", Enum::"Error Handling Options"::"Show Error", NoOfSelected, NoOfSkipped);
- PurchaseHeader.SetRange(Status);
- PurchaseHeader.FilterGroup(PrevFilterGroup);
- end;
-
- procedure PerformManualRelease()
- var
- ReleasePurchDoc: Codeunit "Release Purchase Document";
- IsHandled: Boolean;
- begin
- OnBeforePerformManualRelease(Rec, IsHandled);
- if not IsHandled then
- if Rec.Status <> Rec.Status::Released then begin
- ReleasePurchDoc.PerformManualRelease(Rec);
- Commit();
- end;
- end;
-
- procedure PerformManualReopen(var PurchaseHeader: Record "Purchase Header")
- var
- BatchProcessingMgt: Codeunit "Batch Processing Mgt.";
- NoOfSelected: Integer;
- NoOfSkipped: Integer;
- begin
- NoOfSelected := PurchaseHeader.Count();
- PurchaseHeader.SetFilter(Status, '<>%1', PurchaseHeader.Status::Open);
- NoOfSkipped := NoOfSelected - PurchaseHeader.Count;
- BatchProcessingMgt.BatchProcess(PurchaseHeader, Codeunit::"Purchase Manual Reopen", Enum::"Error Handling Options"::"Show Error", NoOfSelected, NoOfSkipped);
- end;
-
- ///
- /// Recreates purchase lines for a purchase document when the provided field in the purchase header is changed.
- ///
- ///
- /// Opens confirmation dialog to confirm the deletion of existing purchase lines
- /// and then recreates the purchase lines based on the new information in the purchase header.
- /// It also handles item charge assignments and extended text lines.
- ///
- /// Field that is changed.
- procedure RecreatePurchLines(ChangedFieldName: Text[100])
- var
- TempPurchLine: Record "Purchase Line" temporary;
- ItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)";
- TempItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)" temporary;
- TempInteger: Record "Integer" temporary;
- TempPurchCommentLine: Record "Purch. Comment Line" temporary;
- TransferExtendedText: Codeunit "Transfer Extended Text";
- ConfirmManagement: Codeunit "Confirm Management";
- ExtendedTextAdded: Boolean;
- ConfirmText: Text;
- IsHandled: Boolean;
- ShouldCreatePurchLines: Boolean;
- begin
- IsHandled := false;
- OnRecreatePurchLinesOnBeforePurchLinesExists(Rec, xRec, ChangedFieldName, IsHandled);
- if IsHandled then
- exit;
-
- if not PurchLinesExist() then
- exit;
-
- IsHandled := false;
- OnBeforeRecreatePurchLinesHandler(Rec, xRec, ChangedFieldName, IsHandled);
- if IsHandled then
- exit;
-
- IsHandled := false;
- OnRecreatePurchLinesOnBeforeConfirm(Rec, xRec, ChangedFieldName, HideValidationDialog, Confirmed, IsHandled);
- if not IsHandled then
- if GetHideValidationDialog() then
- Confirmed := true
- else begin
- if HasItemChargeAssignment() then
- ConfirmText := ResetItemChargeAssignMsg
- else
- ConfirmText := RecreatePurchLinesMsg;
- Confirmed := ConfirmManagement.GetResponseOrDefault(StrSubstNo(ConfirmText, ChangedFieldName), true);
- end;
-
- if Confirmed then begin
- PurchLine.LockTable();
- ItemChargeAssgntPurch.LockTable();
- Modify();
- OnBeforeRecreatePurchLines(Rec);
-
- PurchLine.Reset();
- PurchLine.SetRange("Document Type", "Document Type");
- PurchLine.SetRange("Document No.", "No.");
- OnRecreatePurchLinesOnAfterPurchLineSetFilters(PurchLine);
- if PurchLine.FindSet() then begin
- RecreateTempPurchLines(TempPurchLine);
- StorePurchCommentLineToTemp(TempPurchCommentLine);
- DeletePurchCommentLines();
-
- TransferItemChargeAssgntPurchToTemp(ItemChargeAssgntPurch, TempItemChargeAssgntPurch);
-
- DeletePurchLines(PurchLine);
-
- PurchLine.Init();
- PurchLine."Line No." := 0;
- OnRecreatePurchLinesOnBeforeTempPurchLineFindSet(TempPurchLine);
- TempPurchLine.FindSet();
- ExtendedTextAdded := false;
- repeat
- ShouldCreatePurchLines := not TempPurchLine.IsExtendedText();
- OnRecreatePurchLinesOnAfterCalcShouldCreatePurchLines(TempPurchLine, ShouldCreatePurchLines, PurchLine);
- if ShouldCreatePurchLines then begin
- PurchLine.Init();
- PurchLine."Line No." := PurchLine."Line No." + 10000;
- PurchLine."Price Calculation Method" := "Price Calculation Method";
- PurchLine.Validate(Type, TempPurchLine.Type);
- OnRecreatePurchLinesOnAfterValidateType(PurchLine, TempPurchLine);
- if TempPurchLine."No." = '' then begin
- PurchLine.Description := TempPurchLine.Description;
- PurchLine."Description 2" := TempPurchLine."Description 2";
- end else begin
- PurchLine.Validate("No.", TempPurchLine."No.");
- IsHandled := false;
- OnRecreatePurchLinesOnBeforeTransferSavedFields(Rec, TempPurchLine, IsHandled, PurchLine);
- if not IsHandled then
- if PurchLine.Type <> PurchLine.Type::" " then
- case true of
- TempPurchLine."Drop Shipment":
- TransferSavedFieldsDropShipment(PurchLine, TempPurchLine);
- TempPurchLine."Special Order":
- TransferSavedFieldsSpecialOrder(PurchLine, TempPurchLine);
- else
- TransferSavedFields(PurchLine, TempPurchLine);
- end;
- end;
-
- OnRecreatePurchLinesOnBeforeInsertPurchLine(PurchLine, TempPurchLine, ChangedFieldName);
- PurchLine.Insert();
- ExtendedTextAdded := false;
-
- OnAfterRecreatePurchLine(PurchLine, TempPurchLine, Rec);
-
- if PurchLine.Type = PurchLine.Type::Item then
- RecreatePurchLinesFillItemChargeAssignment(PurchLine, TempPurchLine, TempItemChargeAssgntPurch);
-
- if PurchLine.Type = PurchLine.Type::"Charge (Item)" then begin
- TempInteger.Init();
- TempInteger.Number := PurchLine."Line No.";
- TempInteger.Insert();
- end;
- end else
- if not ExtendedTextAdded then begin
- TransferExtendedText.PurchCheckIfAnyExtText(PurchLine, true);
- TransferExtendedText.InsertPurchExtText(PurchLine);
- OnAfterTransferExtendedTextForPurchaseLineRecreation(PurchLine, TempPurchLine);
- PurchLine.FindLast();
- ExtendedTextAdded := true;
- end;
- RestorePurchCommentLine(TempPurchCommentLine, TempPurchLine."Line No.", PurchLine."Line No.");
- OnRecreatePurchLineOnAfterProcessAttachedToLineNo(TempPurchLine, PurchLine);
- until TempPurchLine.Next() = 0;
-
- OnRecreatePurchLinesOnAfterProcessTempPurchLines(TempPurchLine, Rec, xRec, ChangedFieldName);
-
- RestorePurchCommentLine(TempPurchCommentLine, 0, 0);
-
- RecreateItemChargeAssgntPurch(TempItemChargeAssgntPurch, TempPurchLine, TempInteger);
-
- TempPurchLine.SetRange(Type);
- TempPurchLine.DeleteAll();
- OnAfterDeleteAllTempPurchLines(Rec);
- end;
- end else
- Error(RecreatePurchaseLinesCancelErr, ChangedFieldName);
-
- OnAfterRecreatePurchLines(Rec, ChangedFieldName);
- end;
-
- ///
- /// Inserts existing purchase comment lines into a temporary record.
- ///
- /// Return value: Inserted purchase comment lines.
- procedure StorePurchCommentLineToTemp(var TempPurchCommentLine: Record "Purch. Comment Line" temporary)
- var
- PurchCommentLine: Record "Purch. Comment Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeStorePurchCommentLineToTemp(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- PurchCommentLine.SetRange("Document Type", "Document Type");
- PurchCommentLine.SetRange("No.", "No.");
- if PurchCommentLine.FindSet() then
- repeat
- TempPurchCommentLine := PurchCommentLine;
- TempPurchCommentLine.Insert();
- until PurchCommentLine.Next() = 0;
- end;
-
- ///
- /// Inserts purchase comment lines for the purchase line of the document from the provided temporary purchase comment line record set.
- ///
- /// Temporary purchase comment line record set to insert.
- /// Previous purchase line number.
- /// New purchase line number.
- procedure RestorePurchCommentLine(var TempPurchCommentLine: Record "Purch. Comment Line" temporary; OldDocumentLineNo: Integer; NewDocumentLineNo: Integer)
- var
- PurchCommentLine: Record "Purch. Comment Line";
- begin
- TempPurchCommentLine.SetRange("Document Type", "Document Type");
- TempPurchCommentLine.SetRange("No.", "No.");
- TempPurchCommentLine.SetRange("Document Line No.", OldDocumentLineNo);
- if TempPurchCommentLine.FindSet() then
- repeat
- PurchCommentLine := TempPurchCommentLine;
- PurchCommentLine."Document Line No." := NewDocumentLineNo;
- PurchCommentLine.Insert();
- until TempPurchCommentLine.Next() = 0;
- end;
-
- local procedure RecreatePurchLinesFillItemChargeAssignment(PurchLine: Record "Purchase Line"; var TempPurchLine: Record "Purchase Line" temporary; var TempItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)" temporary)
- begin
- ClearItemAssgntPurchFilter(TempItemChargeAssgntPurch);
- TempItemChargeAssgntPurch.SetRange("Applies-to Doc. Type", TempPurchLine."Document Type");
- TempItemChargeAssgntPurch.SetRange("Applies-to Doc. No.", TempPurchLine."Document No.");
- TempItemChargeAssgntPurch.SetRange("Applies-to Doc. Line No.", TempPurchLine."Line No.");
- if TempItemChargeAssgntPurch.FindSet() then
- repeat
- if not TempItemChargeAssgntPurch.Mark() then begin
- TempItemChargeAssgntPurch."Applies-to Doc. Line No." := PurchLine."Line No.";
- TempItemChargeAssgntPurch.Description := PurchLine.Description;
- TempItemChargeAssgntPurch.Modify();
- TempItemChargeAssgntPurch.Mark(true);
- end;
- until TempItemChargeAssgntPurch.Next() = 0;
- end;
-
- local procedure RecreateItemChargeAssgntPurch(var TempItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)" temporary; var TempPurchLine: Record "Purchase Line" temporary; var TempInteger: Record "Integer" temporary)
- var
- ItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)";
- begin
- ClearItemAssgntPurchFilter(TempItemChargeAssgntPurch);
- TempPurchLine.SetRange(Type, TempPurchLine.Type::"Charge (Item)");
- if TempPurchLine.FindSet() then
- repeat
- TempItemChargeAssgntPurch.SetRange("Document Line No.", TempPurchLine."Line No.");
- if TempItemChargeAssgntPurch.FindSet() then begin
- repeat
- TempInteger.FindFirst();
- ItemChargeAssgntPurch.Init();
- ItemChargeAssgntPurch := TempItemChargeAssgntPurch;
- ItemChargeAssgntPurch."Document Line No." := TempInteger.Number;
- ItemChargeAssgntPurch.Validate("Qty. to Assign", 0);
- ItemChargeAssgntPurch.Insert();
- until TempItemChargeAssgntPurch.Next() = 0;
- TempInteger.Delete();
- end;
- until TempPurchLine.Next() = 0;
-
- ClearItemAssgntPurchFilter(TempItemChargeAssgntPurch);
- TempItemChargeAssgntPurch.DeleteAll();
- end;
-
- local procedure TransferSavedFields(var DestinationPurchaseLine: Record "Purchase Line"; var SourcePurchaseLine: Record "Purchase Line")
- begin
- OnBeforeTransferSavedFields(DestinationPurchaseLine, SourcePurchaseLine);
-
- DestinationPurchaseLine.Validate("Unit of Measure Code", SourcePurchaseLine."Unit of Measure Code");
- DestinationPurchaseLine.Validate("Variant Code", SourcePurchaseLine."Variant Code");
- OnTransferSavedFieldsOnAfterSetVariantCode(DestinationPurchaseLine, SourcePurchaseLine);
- if SourcePurchaseLine.IsProdOrder() then begin
- DestinationPurchaseLine.Description := SourcePurchaseLine.Description;
- DestinationPurchaseLine.Validate("VAT Prod. Posting Group", SourcePurchaseLine."VAT Prod. Posting Group");
- DestinationPurchaseLine.Validate("Gen. Prod. Posting Group", SourcePurchaseLine."Gen. Prod. Posting Group");
- DestinationPurchaseLine.Validate("Expected Receipt Date", SourcePurchaseLine."Expected Receipt Date");
- DestinationPurchaseLine.Validate("Requested Receipt Date", SourcePurchaseLine."Requested Receipt Date");
- DestinationPurchaseLine.Validate("Qty. per Unit of Measure", SourcePurchaseLine."Qty. per Unit of Measure");
- end;
- TransferSavedJobFields(DestinationPurchaseLine, SourcePurchaseLine);
- if SourcePurchaseLine.Quantity <> 0 then
- DestinationPurchaseLine.Validate(Quantity, SourcePurchaseLine.Quantity);
- if ("Currency Code" = xRec."Currency Code") and (PurchLine."Direct Unit Cost" = 0) then
- DestinationPurchaseLine.Validate("Direct Unit Cost", SourcePurchaseLine."Direct Unit Cost");
-
- OnAfterTransferSavedFields(DestinationPurchaseLine, SourcePurchaseLine);
- end;
-
- local procedure TransferSavedJobFields(var DestinationPurchaseLine: Record "Purchase Line"; SourcePurchaseLine: Record "Purchase Line")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeTransferSavedJobFields(DestinationPurchaseLine, SourcePurchaseLine, IsHandled);
- if IsHandled then
- exit;
-
- if (SourcePurchaseLine."Job No." <> '') and (SourcePurchaseLine."Job Task No." <> '') then begin
- DestinationPurchaseLine.Validate("Job No.", SourcePurchaseLine."Job No.");
- DestinationPurchaseLine.Validate("Job Task No.", SourcePurchaseLine."Job Task No.");
- DestinationPurchaseLine."Job Line Type" := SourcePurchaseLine."Job Line Type";
- end;
- end;
-
- ///
- /// Updates certain fields from a source purchase line to a destination purchase line for a drop shipment scenario.
- /// It also updates the corresponding sales order line.
- ///
- /// Purchase line that will be updated.
- /// Temporary purchase line before the changes.
- procedure TransferSavedFieldsDropShipment(var DestinationPurchaseLine: Record "Purchase Line"; var SourcePurchaseLine: Record "Purchase Line")
- var
- SalesLine: Record "Sales Line";
- CopyDocMgt: Codeunit "Copy Document Mgt.";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeTransferSavedFieldsDropShipment(DestinationPurchaseLine, SourcePurchaseLine, IsHandled);
- if IsHandled then
- exit;
-
- SalesLine.Get(
- SalesLine."Document Type"::Order,
- SourcePurchaseLine."Sales Order No.",
- SourcePurchaseLine."Sales Order Line No.");
- CopyDocMgt.TransfldsFromSalesToPurchLine(SalesLine, DestinationPurchaseLine);
- DestinationPurchaseLine."Drop Shipment" := SourcePurchaseLine."Drop Shipment";
- DestinationPurchaseLine."Purchasing Code" := SalesLine."Purchasing Code";
- DestinationPurchaseLine."Sales Order No." := SourcePurchaseLine."Sales Order No.";
- DestinationPurchaseLine."Sales Order Line No." := SourcePurchaseLine."Sales Order Line No.";
- Evaluate(DestinationPurchaseLine."Inbound Whse. Handling Time", '<0D>');
- DestinationPurchaseLine.Validate("Inbound Whse. Handling Time");
- SalesLine.Validate("Unit Cost (LCY)", DestinationPurchaseLine."Unit Cost (LCY)");
- SalesLine."Purchase Order No." := DestinationPurchaseLine."Document No.";
- SalesLine."Purch. Order Line No." := DestinationPurchaseLine."Line No.";
- SalesLine.Modify();
- end;
-
- local procedure TransferSavedFieldsSpecialOrder(var DestinationPurchaseLine: Record "Purchase Line"; var SourcePurchaseLine: Record "Purchase Line")
- var
- SalesLine: Record "Sales Line";
- CopyDocMgt: Codeunit "Copy Document Mgt.";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeTransferSavedFieldsSpecialOrder(DestinationPurchaseLine, SourcePurchaseLine, IsHandled);
- if IsHandled then
- exit;
-
- SalesLine.Get(
- SalesLine."Document Type"::Order,
- SourcePurchaseLine."Special Order Sales No.",
- SourcePurchaseLine."Special Order Sales Line No.");
- CopyDocMgt.TransfldsFromSalesToPurchLine(SalesLine, DestinationPurchaseLine);
- DestinationPurchaseLine."Special Order" := SourcePurchaseLine."Special Order";
- DestinationPurchaseLine."Purchasing Code" := SalesLine."Purchasing Code";
- DestinationPurchaseLine."Special Order Sales No." := SourcePurchaseLine."Special Order Sales No.";
- DestinationPurchaseLine."Special Order Sales Line No." := SourcePurchaseLine."Special Order Sales Line No.";
- DestinationPurchaseLine.Validate("Unit of Measure Code", SourcePurchaseLine."Unit of Measure Code");
- if SourcePurchaseLine.Quantity <> 0 then
- DestinationPurchaseLine.Validate(Quantity, SourcePurchaseLine.Quantity);
-
- SalesLine.Validate("Unit Cost (LCY)", DestinationPurchaseLine."Unit Cost (LCY)");
- SalesLine."Special Order Purchase No." := DestinationPurchaseLine."Document No.";
- SalesLine."Special Order Purch. Line No." := DestinationPurchaseLine."Line No.";
- OnTransferSavedFieldsSpecialOrderOnBeforeSalesLineModify(DestinationPurchaseLine, SourcePurchaseLine, SalesLine);
- SalesLine.Modify();
- end;
-
- ///
- /// Displays a message if purchase lines exist for the purchase header and the changed field was not updated on the lines.
- ///
- ///
- /// Message states that the user must update the existing purchase lines manually.
- ///
- /// Changed purchase header field caption.
- procedure MessageIfPurchLinesExist(ChangedFieldName: Text[100])
- var
- MessageText: Text;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeMessageIfPurchLinesExist(Rec, ChangedFieldName, IsHandled);
- if IsHandled then
- exit;
-
- if PurchLinesExist() and not GetHideValidationDialog() then begin
- MessageText := StrSubstNo(LinesNotUpdatedMsg, ChangedFieldName);
- MessageText := StrSubstNo(SplitMessageTxt, MessageText, Text020);
- Message(MessageText);
- end;
- end;
-
- ///
- /// Displays a message to the user if there are existing purchase lines and a provided field in the purchase header has been changed,
- /// which might affect the prices and discounts on the purchase lines.
- ///
- ///
- /// The message informs the user that the lines have not been updated and must be updated manually.
- /// If the changed field is the order date, it offers to update the order dates of the purchase lines automatically.
- ///
- /// Changed purchase header field caption.
- procedure PriceMessageIfPurchLinesExist(ChangedFieldName: Text[100])
- var
- ConfirmManagement: Codeunit "Confirm Management";
- MessageText: Text;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforePriceMessageIfPurchLinesExist(Rec, ChangedFieldName, IsHandled);
- if IsHandled then
- exit;
-
- if PurchLinesExist() and not GetHideValidationDialog() then begin
- MessageText := StrSubstNo(LinesNotUpdatedDateMsg, ChangedFieldName);
- if "Currency Code" <> '' then
- MessageText := StrSubstNo(SplitMessageTxt, MessageText, AffectExchangeRateMsg);
-
- if (ChangedFieldName.Contains(FieldCaption("Order Date"))) then begin
- Confirmed := ConfirmManagement.GetResponseOrDefault(StrSubstNo(SplitMessageTxt, MessageText, UpdateLinesOrderDateAutomaticallyQst), false);
- if Confirmed then
- UpdatePurchLinesByFieldNo(FieldNo("Order Date"), false);
- end else
- Message(StrSubstNo(SplitMessageTxt, MessageText, ReviewLinesManuallyMsg));
- end;
- end;
-
- ///
- /// Updates currency factor on the purchase header and recreates purchase lines if the currency code has changed.
- ///
- procedure UpdateCurrencyFactor()
- begin
- UpdateCurrencyFactor(Rec."Currency Code" <> xRec."Currency Code");
- end;
-
- local procedure UpdateCurrencyFactor(CurrencyCodeChanged: Boolean)
- var
- UpdateCurrencyExchangeRates: Codeunit "Update Currency Exchange Rates";
- Updated: Boolean;
- begin
- OnBeforeUpdateCurrencyFactor(Rec, Updated, CurrExchRate, CurrFieldNo);
- if Updated then
- exit;
-
- if "Currency Code" <> '' then begin
- if Rec."Posting Date" <> 0D then
- CurrencyDate := "Posting Date"
- else
- CurrencyDate := WorkDate();
- OnUpdateCurrencyFactorOnAfterCurrencyDateSet(Rec, CurrencyDate, CurrFieldNo);
-
- if UpdateCurrencyExchangeRates.ExchangeRatesForCurrencyExist(CurrencyDate, "Currency Code") then begin
- "Currency Factor" := CurrExchRate.ExchangeRate(CurrencyDate, "Currency Code");
- if CurrencyCodeChanged then
- RecreatePurchLines(FieldCaption("Currency Code"));
- end else
- UpdateCurrencyExchangeRates.ShowMissingExchangeRatesNotification("Currency Code");
- end else begin
- "Currency Factor" := 0;
- if CurrencyCodeChanged then
- RecreatePurchLines(FieldCaption("Currency Code"));
- end;
-
- OnAfterUpdateCurrencyFactor(Rec, GetHideValidationDialog());
- end;
-
- ///
- /// Updates currency factor on the purchase header if confirmed by the user.
- ///
- /// True if the currency factor has been updated, otherwise false.
- procedure ConfirmCurrencyFactorUpdate(): Boolean
- var
- ForceConfirm: Boolean;
- IsHandled: Boolean;
- begin
- OnBeforeConfirmUpdateCurrencyFactor(Rec, HideValidationDialog, ForceConfirm);
- if GetHideValidationDialog() or not GuiAllowed or ForceConfirm then
- Confirmed := true
- else begin
- IsHandled := false;
- OnConfirmCurrencyFactorUpdateOnBeforeConfirm(Rec, IsHandled, Confirmed);
- if not IsHandled then
- Confirmed := Confirm(Text022, false);
- end;
- if Confirmed then
- Validate("Currency Factor")
- else
- "Currency Factor" := xRec."Currency Factor";
- OnAfterConfirmUpdateCurrencyFactor(Rec, HideValidationDialog);
- exit(Confirmed);
- end;
-
- ///
- /// Returns the value of the global flag HideValidationDialog.
- ///
- /// The value of the global flag HideValidationDialog.
- procedure GetHideValidationDialog(): Boolean
- begin
- exit(HideValidationDialog);
- end;
-
- ///
- /// Sets the value of the global flag HideValidationDialog.
- ///
- ///
- /// Global flag HideValidationDialog is used to hide various confirmation/message/other dialogs.
- ///
- /// The new value to set.
- procedure SetHideValidationDialog(NewHideValidationDialog: Boolean)
- begin
- HideValidationDialog := NewHideValidationDialog;
- end;
-
- ///
- /// Updates the location code with the specified location code. If it's empty, it takes location code from user setup management.
- /// Otherwise, validates the location code with the provided value.
- ///
- /// New location code value.
- procedure UpdateLocationCode(LocationCode: Code[10])
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateLocationCode(Rec, LocationCode, IsHandled);
- if not IsHandled then
- Validate("Location Code", UserSetupMgt.GetLocation(1, LocationCode, "Responsibility Center"));
- end;
-
- ///
- /// Updates purchase lines if the provided field in the purchase header is changed and the confirmation is accepted.
- ///
- /// Changed purchase header field caption.
- ///
- /// If true, confirmation message is show to update the lines, otherwise confirmation is not shown.
- ///
- procedure UpdatePurchLines(ChangedFieldName: Text[100]; AskQuestion: Boolean)
- var
- "Field": Record "Field";
- begin
- Field.SetRange(TableNo, Database::"Purchase Header");
- Field.SetRange("Field Caption", ChangedFieldName);
- Field.SetFilter(ObsoleteState, '<>%1', Field.ObsoleteState::Removed);
- Field.Find('-');
- if Field.Next() <> 0 then
- Error(DuplicatedCaptionsNotAllowedErr);
- UpdatePurchLinesByFieldNo(Field."No.", AskQuestion);
-
- OnAfterUpdatePurchLines(Rec);
- end;
-
- local procedure UpdatePurchAmountLines()
- var
- PurchLine: Record "Purchase Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdatePurchLineAmounts(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- PurchLine.Reset();
- PurchLine.SetRange("Document Type", "Document Type");
- PurchLine.SetRange("Document No.", "No.");
- PurchLine.SetFilter(Type, '<>%1', PurchLine.Type::" ");
- PurchLine.SetFilter(Quantity, '<>0');
- PurchLine.LockTable();
- if PurchLine.FindSet() then begin
- Modify();
- repeat
- PurchLine.UpdateAmounts();
- PurchLine.Modify();
- until PurchLine.Next() = 0;
- end;
- end;
-
- ///
- /// Updates purchase lines if the provided field in the purchase header is changed.
- ///
- /// Changed purchase header field number.
- ///
- /// If true, confirmation message is show to update the lines, otherwise confirmation is not shown.
- ///
- procedure UpdatePurchLinesByFieldNo(ChangedFieldNo: Integer; AskQuestion: Boolean)
- var
- "Field": Record "Field";
- PurchLineReserve: Codeunit "Purch. Line-Reserve";
- Question: Text[250];
- IsHandled: Boolean;
- ShouldConfirmReservationDateConflict: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdatePurchLinesByFieldNo(Rec, ChangedFieldNo, AskQuestion, IsHandled);
- if IsHandled then
- exit;
-
- if not PurchLinesExist() then
- exit;
-
- if not Field.Get(Database::"Purchase Header", ChangedFieldNo) then
- Field.Get(Database::"Purchase Line", ChangedFieldNo);
-
- if AskQuestion then begin
- Question := StrSubstNo(Text032, Field."Field Caption");
- if GuiAllowed and not HideValidationDialog then
- if DIALOG.Confirm(Question, true) then begin
- ShouldConfirmReservationDateConflict := ChangedFieldNo in [FieldNo("Expected Receipt Date"),
- FieldNo("Requested Receipt Date"),
- FieldNo("Promised Receipt Date"),
- FieldNo("Lead Time Calculation"),
- FieldNo("Inbound Whse. Handling Time")];
- OnUpdatePurchLinesByFieldNoOnAfterCalcShouldConfirmReservationDateConflict(Rec, ChangedFieldNo, ShouldConfirmReservationDateConflict);
- if ShouldConfirmReservationDateConflict then
- ConfirmReservationDateConflict(ChangedFieldNo);
- end
- else
- exit;
- end;
-
- PurchLine.LockTable();
- OnUpdatePurchLinesByFieldNoOnBeforeModifyRec(Rec, PurchLine);
- Modify();
-
- PurchLine.Reset();
- PurchLine.SetRange("Document Type", "Document Type");
- PurchLine.SetRange("Document No.", "No.");
- OnUpdatePurchLinesByFieldNoOnAfterPurchLineSetFilters(Rec, xRec, PurchLine, ChangedFieldNo);
- if PurchLine.FindSet() then
- repeat
- xPurchLine := PurchLine;
- IsHandled := false;
- OnUpdatePurchLinesByFieldNoOnBeforeValidateFields(PurchLine, xPurchLine, ChangedFieldNo, Rec, IsHandled);
- if not IsHandled then
- case ChangedFieldNo of
- FieldNo("Expected Receipt Date"):
- if PurchLine."No." <> '' then
- PurchLine.Validate("Expected Receipt Date", "Expected Receipt Date");
- FieldNo("Currency Factor"):
- if PurchLine.Type <> PurchLine.Type::" " then
- PurchLine.Validate("Direct Unit Cost");
- FieldNo("Transaction Type"):
- PurchLine.Validate("Transaction Type", "Transaction Type");
- FieldNo("Transport Method"):
- PurchLine.Validate("Transport Method", "Transport Method");
- FieldNo("Entry Point"):
- PurchLine.Validate("Entry Point", "Entry Point");
- FieldNo(Area):
- PurchLine.Validate(Area, Area);
- FieldNo("Transaction Specification"):
- PurchLine.Validate("Transaction Specification", "Transaction Specification");
- FieldNo("Requested Receipt Date"):
- if PurchLine."No." <> '' then
- PurchLine.Validate("Requested Receipt Date", "Requested Receipt Date");
- FieldNo("Prepayment %"):
- if PurchLine."No." <> '' then
- PurchLine.Validate("Prepayment %", "Prepayment %");
- FieldNo("Promised Receipt Date"):
- if PurchLine."No." <> '' then
- PurchLine.Validate("Promised Receipt Date", "Promised Receipt Date");
- FieldNo("Lead Time Calculation"):
- if PurchLine."No." <> '' then
- PurchLine.Validate("Lead Time Calculation", "Lead Time Calculation");
- FieldNo("Inbound Whse. Handling Time"):
- if PurchLine."No." <> '' then
- PurchLine.Validate("Inbound Whse. Handling Time", "Inbound Whse. Handling Time");
- PurchLine.FieldNo("Deferral Code"):
- if PurchLine."No." <> '' then
- PurchLine.Validate("Deferral Code");
- FieldNo("Order Date"):
- if PurchLine."No." <> '' then begin
- PurchLine.Validate("Order Date", "Order Date");
- PurchLine.UpdateDirectUnitCost(0);
- end;
- FieldNo("Campaign No."):
- if PurchLine."No." <> '' then
- PurchLine.UpdateDirectUnitCost(0);
- else
- OnUpdatePurchLinesByChangedFieldName(Rec, PurchLine, Field.FieldName, ChangedFieldNo, xRec);
- end;
- OnUpdatePurchLinesByFieldNoOnBeforeLineModify(Rec, xRec, PurchLine);
- PurchLine.Modify(true);
- PurchLineReserve.VerifyChange(PurchLine, xPurchLine);
- until PurchLine.Next() = 0;
-
- OnAfterUpdatePurchLinesByFieldNo(Rec, xRec, ChangedFieldNo);
- end;
-
- ///
- /// Checks if reservation entry exists for the purchase header and opens a confirmation dialog if the user wants to continue.
- /// These reservations will be canceled if a date conflict is caused by the changed field.
- /// This is an overload that sets ChangedFieldNo to 0.
- ///
- procedure ConfirmReservationDateConflict()
- begin
- ConfirmReservationDateConflict(0);
- end;
-
- ///
- /// Checks if reservation entry exists for the purchase header and opens a confirmation dialog if the user wants to continue.
- /// These reservations will be canceled if a date conflict is caused by the changed field.
- ///
- /// Changed purchase header field number.
- procedure ConfirmReservationDateConflict(ChangedFieldNo: Integer)
- var
- ReservationEngineMgt: Codeunit "Reservation Engine Mgt.";
- ConfirmManagement: Codeunit "Confirm Management";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeConfirmResvDateConflict(Rec, IsHandled, ChangedFieldNo);
- if IsHandled then
- exit;
-
- if ReservationEngineMgt.ResvExistsForPurchHeader(Rec) then
- if not ConfirmManagement.GetResponseOrDefault(Text050, true) then
- Error('');
- end;
-
- ///
- /// Creates dimensions for the purchase header based on the provided default dimension sources.
- ///
- ///
- /// If purchase lines exist and the dimension set has changed the dimensions are updated on the lines.
- ///
- /// The list of default dimension sources.
- procedure CreateDim(DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])
- var
- SourceCodeSetup: Record "Source Code Setup";
- OldDimSetID: Integer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateDim(Rec, IsHandled, DefaultDimSource, CurrFieldNo);
- if IsHandled then
- exit;
-
- SourceCodeSetup.Get();
-
- "Shortcut Dimension 1 Code" := '';
- "Shortcut Dimension 2 Code" := '';
- OldDimSetID := "Dimension Set ID";
- "Dimension Set ID" :=
- DimMgt.GetRecDefaultDimID(
- Rec, CurrFieldNo, DefaultDimSource, SourceCodeSetup.Purchases, "Shortcut Dimension 1 Code", "Shortcut Dimension 2 Code", 0, 0);
-
- OnCreateDimOnBeforeUpdateLines(Rec, xRec, CurrFieldNo, OldDimSetID, DefaultDimSource);
-
- if (OldDimSetID <> "Dimension Set ID") and (OldDimSetID <> 0) and GuiAllowed and not GetHideValidationDialog() then
- if CouldDimensionsBeKept() then
- if not ConfirmKeepExistingDimensions(OldDimSetID) then begin
- "Dimension Set ID" := OldDimSetID;
- DimMgt.UpdateGlobalDimFromDimSetID(Rec."Dimension Set ID", Rec."Shortcut Dimension 1 Code", Rec."Shortcut Dimension 2 Code");
- end;
-
- OnCreateDimOnAfterConfirmKeepExisting(Rec, xRec, CurrFieldNo, OldDimSetID, DefaultDimSource);
-
- if (OldDimSetID <> "Dimension Set ID") and PurchLinesExist() then begin
- Modify();
- UpdateAllLineDim("Dimension Set ID", OldDimSetID);
- end;
- end;
-
-
- local procedure ConfirmKeepExistingDimensions(OldDimSetID: Integer) Confirmed: Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeConfirmKeepExistingDimensions(Rec, xRec, CurrFieldNo, OldDimSetID, Confirmed, IsHandled);
- if IsHandled then
- exit(Confirmed);
-
- Confirmed := Confirm(DoYouWantToKeepExistingDimensionsQst);
- end;
-
- ///
- /// Determines if the dimensions of a purchase header could be kept the same when certain fields are changed.
- ///
- /// True if the dimensions could be kept, otherwise false.
- procedure CouldDimensionsBeKept() Result: Boolean;
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCouldDimensionsBeKept(Rec, xRec, Result, IsHandled);
- if not IsHandled then begin
- if (xRec."Buy-from Vendor No." <> '') and (xRec."Buy-from Vendor No." <> Rec."Buy-from Vendor No.") then
- exit(false);
- if (xRec."Pay-to Vendor No." <> '') and (xRec."Pay-to Vendor No." <> Rec."Pay-to Vendor No.") then
- exit(false);
- if (Rec."Location Code" = '') and (xRec."Location Code" <> '') and (CurrFieldNo = Rec.FieldNo("Location Code")) then
- exit(true);
- if (xRec."Location Code" <> Rec."Location Code") and ((CurrFieldNo = Rec.FieldNo("Location Code"))
- or ((Rec."Sell-to Customer No." <> '') and (xRec."Sell-to Customer No." <> Rec."Sell-to Customer No."))) then
- exit(true);
- if (xRec."Purchaser Code" <> '') and (xRec."Purchaser Code" <> Rec."Purchaser Code") then
- exit(true);
- if (xRec."Responsibility Center" <> '') and (xRec."Responsibility Center" <> Rec."Responsibility Center") then
- exit(true);
- if (xRec."Sell-to Customer No." <> '') and (xRec."Sell-to Customer No." <> Rec."Sell-to Customer No.") then
- exit(true);
- end;
- OnAfterCouldDimensionsBeKept(Rec, xRec, Result);
- end;
-
- ///
- /// Verifies whether the provided shortcut dimension code and value are valid.
- ///
- ///
- /// If purchase lines exist, the dimensions are updated on the lines.
- ///
- /// Number of the shortcut dimension.
- /// Value of the shortcut dimension.
- procedure ValidateShortcutDimCode(FieldNumber: Integer; var ShortcutDimCode: Code[20])
- var
- OldDimSetID: Integer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShortcutDimCode(Rec, xRec, FieldNumber, ShortcutDimCode, IsHandled);
- if IsHandled then
- exit;
-
- OldDimSetID := "Dimension Set ID";
- DimMgt.ValidateShortcutDimValues(FieldNumber, ShortcutDimCode, "Dimension Set ID");
- if "No." <> '' then
- Modify();
-
- if OldDimSetID <> "Dimension Set ID" then begin
- OnValidateShortcutDimCodeOnBeforeUpdateAllLineDim(Rec, xRec, FieldNumber);
- if not IsNullGuid(Rec.SystemId) then
- Modify();
- if PurchLinesExist() then
- UpdateAllLineDim("Dimension Set ID", OldDimSetID);
- end;
-
- OnAfterValidateShortcutDimCode(Rec, xRec, FieldNumber, ShortcutDimCode);
- end;
-
- local procedure ValidateDocumentDateWithPostingDate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateDocumentDateWithPostingDate(Rec, CurrFieldNo, IsHandled, xRec);
- if IsHandled then
- exit;
-
- Validate("Document Date", "Posting Date");
- end;
-
- ///
- /// Determines if purchase lines that are already received exist.
- ///
- /// True if received purchase lines exists, otherwise false.
- procedure ReceivedPurchLinesExist(): Boolean
- begin
- PurchLine.Reset();
- PurchLine.ReadIsolation := IsolationLevel::ReadUncommitted;
- PurchLine.SetRange("Document Type", "Document Type");
- PurchLine.SetRange("Document No.", "No.");
- PurchLine.SetFilter("Quantity Received", '<>0');
- exit(not PurchLine.IsEmpty());
- end;
-
- ///
- /// Determines if purchase lines that are already returned exist.
- ///
- /// True if return shipment exists, otherwise false.
- procedure ReturnShipmentExist(): Boolean
- begin
- PurchLine.Reset();
- PurchLine.ReadIsolation := IsolationLevel::ReadUncommitted;
- PurchLine.SetRange("Document Type", "Document Type");
- PurchLine.SetRange("Document No.", "No.");
- PurchLine.SetFilter("Return Qty. Shipped", '<>0');
- exit(not PurchLine.IsEmpty());
- end;
-
- ///
- /// Updates the shipping address details of a purchase header based on the location or the company information.
- ///
- ///
- /// If the purchase header is a credit document, the procedure is not executed.
- ///
- procedure UpdateShipToAddress()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateShipToAddress(Rec, IsHandled, CurrFieldNo);
- if IsHandled then
- exit;
-
- if IsCreditDocType() then begin
- OnAfterUpdateShipToAddress(Rec);
- exit;
- end;
-
- if ("Location Code" <> '') and Location.Get("Location Code") and ("Sell-to Customer No." = '') then begin
- SetShipToAddress(
- Location.Name, Location."Name 2", Location.Address, Location."Address 2",
- Location.City, Location."Post Code", Location.County, Location."Country/Region Code");
- "Ship-to Phone No." := Location."Phone No.";
- "Ship-to Contact" := Location.Contact;
- OnUpdateShipToAddressOnAfterCopyFromLocation(Rec, Location);
- end;
-
- if ("Location Code" = '') and ("Sell-to Customer No." = '') then begin
- CompanyInfo.Get();
- "Ship-to Code" := '';
- SetShipToAddress(
- CompanyInfo."Ship-to Name", CompanyInfo."Ship-to Name 2", CompanyInfo."Ship-to Address", CompanyInfo."Ship-to Address 2",
- CompanyInfo."Ship-to City", CompanyInfo."Ship-to Post Code", CompanyInfo."Ship-to County",
- CompanyInfo."Ship-to Country/Region Code");
- "Ship-to Phone No." := CompanyInfo."Ship-to Phone No.";
- "Ship-to Contact" := CompanyInfo."Ship-to Contact";
- OnUpdateShipToAddressOnAfterCopyFromCompany(Rec, CompanyInfo);
- end;
-
- OnAfterUpdateShipToAddress(Rec);
- end;
-
- local procedure DeletePurchaseLines()
- var
- ReservMgt: Codeunit "Reservation Management";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeDeletePurchaseLines(PurchLine, IsHandled, Rec);
- if IsHandled then
- exit;
-
- if PurchLine.FindSet() then begin
- ReservMgt.DeleteDocumentReservation(
- Database::"Purchase Line", "Document Type".AsInteger(), "No.", GetHideValidationDialog());
- repeat
- PurchLine.SuspendStatusCheck(true);
- PurchLine.Delete(true);
- until PurchLine.Next() = 0;
- end;
- end;
-
- local procedure DeleteRecordInApprovalRequest()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeDeleteRecordInApprovalRequest(Rec, IsHandled);
- if IsHandled then
- exit;
-
- ApprovalsMgmt.OnDeleteRecordInApprovalRequest(RecordId);
- end;
-
- local procedure ClearItemAssgntPurchFilter(var TempItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)" temporary)
- begin
- TempItemChargeAssgntPurch.SetRange("Document Line No.");
- TempItemChargeAssgntPurch.SetRange("Applies-to Doc. Type");
- TempItemChargeAssgntPurch.SetRange("Applies-to Doc. No.");
- TempItemChargeAssgntPurch.SetRange("Applies-to Doc. Line No.");
- end;
-
- local procedure CheckReceiptInfo(var PurchLine: Record "Purchase Line"; PayTo: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckReceiptInfo(Rec, xRec, PurchLine, PayTo, IsHandled);
- if IsHandled then
- exit;
-
- if "Document Type" = "Document Type"::Order then
- PurchLine.SetFilter("Quantity Received", '<>0')
- else
- if "Document Type" = "Document Type"::Invoice then begin
- if not PayTo then
- PurchLine.SetRange("Buy-from Vendor No.", xRec."Buy-from Vendor No.");
- PurchLine.SetFilter("Receipt No.", '<>%1', '');
- end;
-
- if PurchLine.FindFirst() then
- if "Document Type" = "Document Type"::Order then
- PurchLine.TestField("Quantity Received", 0)
- else
- PurchLine.TestField("Receipt No.", '');
- PurchLine.SetRange("Receipt No.");
- PurchLine.SetRange("Quantity Received");
- if not PayTo then
- PurchLine.SetRange("Buy-from Vendor No.");
-
- // Check if there are matched order lines and use testfield to raise error
- if "Document Type" = "Document Type"::Invoice then begin
- PurchLine.SetFilter("Matched Order Lines", '>0');
- if PurchLine.FindFirst() then
- Error(PurchLineMatchedToOrderLineErr, PurchLine."Line No.");
- PurchLine.SetRange("Matched Order Lines");
- end;
- end;
-
- local procedure CheckPrepmtInfo(var PurchLine: Record "Purchase Line")
- begin
- if "Document Type" = "Document Type"::Order then begin
- PurchLine.SetFilter("Prepmt. Amt. Inv.", '<>0');
- if PurchLine.Find('-') then
- PurchLine.TestField("Prepmt. Amt. Inv.", 0);
- PurchLine.SetRange("Prepmt. Amt. Inv.");
- end;
- end;
-
- local procedure CheckReturnInfo(var PurchLine: Record "Purchase Line"; PayTo: Boolean)
- begin
- if "Document Type" = "Document Type"::"Return Order" then
- PurchLine.SetFilter("Return Qty. Shipped", '<>0')
- else
- if "Document Type" = "Document Type"::"Credit Memo" then begin
- if not PayTo then
- PurchLine.SetRange("Buy-from Vendor No.", xRec."Buy-from Vendor No.");
- PurchLine.SetFilter("Return Shipment No.", '<>%1', '');
- end;
-
- if PurchLine.FindFirst() then
- if "Document Type" = "Document Type"::"Return Order" then
- PurchLine.TestField("Return Qty. Shipped", 0)
- else
- PurchLine.TestField("Return Shipment No.", '');
- end;
-
- local procedure CheckShipToCodeChange(PurchHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckShipToCodeChange(PurchHeader, IsHandled, xPurchaseHeader);
- if IsHandled then
- exit;
-
- if (PurchHeader."Document Type" = PurchHeader."Document Type"::Order) and (xRec."Ship-to Code" <> PurchHeader."Ship-to Code") then begin
- PurchLine.SetRange("Document Type", PurchLine."Document Type"::Order);
- PurchLine.SetRange("Document No.", PurchHeader."No.");
- PurchLine.SetFilter("Sales Order Line No.", '<>0');
- if not PurchLine.IsEmpty() then
- Error(YouCannotChangeFieldErr, PurchHeader.FieldCaption("Ship-to Code"));
- end;
- end;
-
- local procedure CheckSpecialOrderSalesLineLink()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckSpecialOrderSalesLineLink(Rec, IsHandled);
- if IsHandled then
- exit;
-
- PurchLine.SetRange("Sales Order Line No.");
- PurchLine.SetFilter("Special Order Sales Line No.", '<>0');
- if not PurchLine.IsEmpty() then
- Error(
- YouCannotChangeFieldErr,
- FieldCaption("Sell-to Customer No."));
- end;
-
- local procedure CheckShipToCode(ShipToCode: Code[20])
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckShipToCode(Rec, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Ship-to Code", ShipToCode);
- end;
-
- ///
- /// Updates the buy-from contact details of a purchase header based on the provided vendor number.
- ///
- ///
- /// If the contact linked to a specific business relation is found, buy-from contact information is updated from the contact.
- ///
- /// Vendor number from which details are taken.
- procedure UpdateBuyFromCont(VendorNo: Code[20])
- var
- ContBusRel: Record "Contact Business Relation";
- Vend: Record Vendor;
- OfficeContact: Record Contact;
- OfficeMgt: Codeunit "Office Management";
- begin
- if OfficeMgt.GetContact(OfficeContact, VendorNo) then begin
- SetHideValidationDialog(true);
- UpdateBuyFromVend(OfficeContact."No.");
- SetHideValidationDialog(false);
- end else
- if Vend.Get(VendorNo) then begin
- if Vend."Primary Contact No." <> '' then
- "Buy-from Contact No." := Vend."Primary Contact No."
- else
- "Buy-from Contact No." := ContBusRel.GetContactNo(ContBusRel."Link to Table"::Vendor, "Buy-from Vendor No.");
- "Buy-from Contact" := Vend.Contact;
- end;
-
- if "Buy-from Contact No." <> '' then
- if OfficeContact.Get("Buy-from Contact No.") then
- OfficeContact.CheckIfPrivacyBlockedGeneric();
-
- OnAfterUpdateBuyFromCont(Rec, Vend, OfficeContact);
- end;
-
- procedure TestPostingDate(BatchPost: Boolean)
- begin
- PurchSetup.Get();
- if not PurchSetup."Posting Date Check on Posting" then
- exit;
- if not GuiAllowed then
- exit;
- if "Posting Date" <> WorkDate() then begin
- if BatchPost then
- Error(DifferentDatesErr, "Posting Date", WorkDate());
- if not Confirm(DifferentDatesQst, false, "Posting Date", WorkDate()) then
- Error('');
- end;
- end;
-
- local procedure UpdatePayToCont(VendorNo: Code[20])
- var
- ContBusRel: Record "Contact Business Relation";
- Vend: Record Vendor;
- Contact: Record Contact;
- begin
- if Vend.Get(VendorNo) then begin
- if Vend."Primary Contact No." <> '' then
- "Pay-to Contact No." := Vend."Primary Contact No."
- else
- "Pay-to Contact No." := ContBusRel.GetContactNo(ContBusRel."Link to Table"::Vendor, "Pay-to Vendor No.");
- "Pay-to Contact" := Vend.Contact;
- end;
-
- if "Pay-to Contact No." <> '' then
- if Contact.Get("Pay-to Contact No.") then
- Contact.CheckIfPrivacyBlockedGeneric();
-
- OnAfterUpdatePayToCont(Rec, Vend, Contact);
- end;
-
- local procedure UpdateBuyFromVend(ContactNo: Code[20])
- var
- ContBusinessRelation: Record "Contact Business Relation";
- Vend: Record Vendor;
- Cont: Record Contact;
- SearchContact: Record Contact;
- VendorTempl: Record "Vendor Templ.";
- ShouldUpdateFromContact: Boolean;
- ContactBusinessRelationFound: Boolean;
- begin
- ShouldUpdateFromContact := Cont.Get(ContactNo);
- OnUpdateBuyFromVendOnAfterGetContact(Rec, Cont, ShouldUpdateFromContact);
- if ShouldUpdateFromContact then begin
- "Buy-from Contact No." := Cont."No.";
- if Cont.Type = Cont.Type::Person then
- "Buy-from Contact" := Cont.Name
- else
- if Vend.Get("Buy-from Vendor No.") then
- "Buy-from Contact" := Vend.Contact
- else
- "Buy-from Contact" := ''
- end else begin
- "Buy-from Contact" := '';
- exit;
- end;
-
- if Cont.Type = Cont.Type::Person then
- ContactBusinessRelationFound := ContBusinessRelation.FindByContact(ContBusinessRelation."Link to Table"::Vendor, Cont."No.");
-
- if not ContactBusinessRelationFound then
- ContactBusinessRelationFound := ContBusinessRelation.FindByContact(ContBusinessRelation."Link to Table"::Vendor, Cont."Company No.");
-
- if ContactBusinessRelationFound then begin
- if ("Buy-from Vendor No." <> '') and
- ("Buy-from Vendor No." <> ContBusinessRelation."No.")
- then
- Error(Text037, Cont."No.", Cont.Name, "Buy-from Vendor No.");
- if "Buy-from Vendor No." = '' then begin
- SkipBuyFromContact := true;
- Validate("Buy-from Vendor No.", ContBusinessRelation."No.");
- SkipBuyFromContact := false;
- end;
- end else begin
- if "Document Type" = "Document Type"::Quote then begin
- if not GetContactAsCompany(Cont, SearchContact) then
- SearchContact := Cont;
-
- "Buy-from Vendor Name" := SearchContact."Company Name";
- "Buy-from Vendor Name 2" := SearchContact."Name 2";
- SetShipToAddress(
- SearchContact."Company Name", SearchContact."Name 2", SearchContact.Address, SearchContact."Address 2",
- SearchContact.City, SearchContact."Post Code", SearchContact.County, SearchContact."Country/Region Code");
- "Ship-to Phone No." := SearchContact."Phone No.";
- if ("Buy-from Vendor Templ. Code" = '') and (not VendorTempl.IsEmpty) then
- Validate("Buy-from Vendor Templ. Code", Cont.FindNewVendorTemplate());
- end else
- ContactIsNotRelatedToVendorError(Cont, ContactNo);
-
- "Buy-from Contact" := Cont.Name;
- end;
- OnCheckBuyFromContactOnAfterFindByContact(Rec, ContBusinessRelation, Cont);
-
- UpdateBuyFromVendContact(Vend, Cont);
-
- if "Document Type" = "Document Type"::Quote then begin
- if Vend.Get("Buy-from Vendor No.") or Vend.Get(ContBusinessRelation."No.") then begin
- if Vend."Copy Buy-from Add. to Qte From" = Vend."Copy Buy-from Add. to Qte From"::Company then
- GetContactAsCompany(Cont, Cont);
- end else
- GetContactAsCompany(Cont, Cont);
-
- "Buy-from Address" := Cont.Address;
- "Buy-from Address 2" := Cont."Address 2";
- "Buy-from City" := Cont.City;
- "Buy-from Post Code" := Cont."Post Code";
- "Buy-from County" := Cont.County;
- "Buy-from Country/Region Code" := Cont."Country/Region Code";
- end;
-
- if ("Buy-from Vendor No." = "Pay-to Vendor No.") or
- ("Pay-to Vendor No." = '')
- then
- Validate("Pay-to Contact No.", "Buy-from Contact No.");
-
- OnAfterUpdateBuyFromVend(Rec, Cont);
- end;
-
- local procedure UpdatePayToVend(ContactNo: Code[20])
- var
- ContBusinessRelation: Record "Contact Business Relation";
- Vend: Record Vendor;
- Cont: Record Contact;
- SearchContact: Record Contact;
- VendorTempl: Record "Vendor Templ.";
- ShouldUpdateFromContact: Boolean;
- ContactBusinessRelationFound: Boolean;
- begin
- ShouldUpdateFromContact := Cont.Get(ContactNo);
- OnUpdatePayToVendOnAfterGetContact(Rec, Cont, ShouldUpdateFromContact);
- if ShouldUpdateFromContact then begin
- "Pay-to Contact No." := Cont."No.";
- if Cont.Type = Cont.Type::Person then
- "Pay-to Contact" := Cont.Name
- else
- if Vend.Get("Pay-to Vendor No.") then
- "Pay-to Contact" := Vend.Contact
- else
- "Pay-to Contact" := '';
- end else begin
- "Pay-to Contact" := '';
- exit;
- end;
-
- OnUpdatePayToVendOnBeforeFindByContact(Rec, Vend, Cont);
- if Cont.Type = Cont.Type::Person then
- ContactBusinessRelationFound := ContBusinessRelation.FindByContact(ContBusinessRelation."Link to Table"::Vendor, Cont."No.");
-
- if not ContactBusinessRelationFound then
- ContactBusinessRelationFound := ContBusinessRelation.FindByContact(ContBusinessRelation."Link to Table"::Vendor, Cont."Company No.");
-
- if ContactBusinessRelationFound then begin
- if "Pay-to Vendor No." = '' then begin
- SkipPayToContact := true;
- Validate("Pay-to Vendor No.", ContBusinessRelation."No.");
- SkipPayToContact := false;
- end else
- if "Pay-to Vendor No." <> ContBusinessRelation."No." then
- Error(Text037, Cont."No.", Cont.Name, "Pay-to Vendor No.");
- end else
- if "Document Type" = "Document Type"::Quote then begin
- if not GetContactAsCompany(Cont, SearchContact) then
- SearchContact := Cont;
-
- "Pay-to Name" := SearchContact."Company Name";
- "Pay-to Name 2" := SearchContact."Name 2";
- "Pay-to Address" := SearchContact.Address;
- "Pay-to Address 2" := SearchContact."Address 2";
- "Pay-to City" := SearchContact.City;
- "Pay-to Post Code" := SearchContact."Post Code";
- "Pay-to County" := SearchContact.County;
- "Pay-to Country/Region Code" := SearchContact."Country/Region Code";
- "VAT Registration No." := SearchContact."VAT Registration No.";
- Validate("Currency Code", SearchContact."Currency Code");
- "Language Code" := SearchContact."Language Code";
- "Format Region" := SearchContact."Format Region";
-
- if ("Pay-to Vendor Templ. Code" = '') and (not VendorTempl.IsEmpty) then
- Validate("Pay-to Vendor Templ. Code", Cont.FindNewVendorTemplate());
- end else
- ContactIsNotRelatedToVendorError(Cont, ContactNo);
-
- OnAfterUpdatePayToVend(Rec, Cont);
- end;
-
- local procedure ContactIsNotRelatedToVendorError(Cont: Record Contact; ContactNo: Code[20])
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeContactIsNotRelatedToVendorError(Cont, ContactNo, IsHandled);
- if IsHandled then
- exit;
-
- Error(Text039, Cont."No.", Cont.Name);
- end;
-
- ///
- /// Creates inventory put-away, pick, or movement documents for a released purchase document.
- ///
- procedure CreateInvtPutAwayPick()
- var
- WhseRequest: Record "Warehouse Request";
- begin
- TestField(Status, Status::Released);
-
- WhseRequest.Reset();
- WhseRequest.SetCurrentKey("Source Document", "Source No.");
- case "Document Type" of
- "Document Type"::Order:
- WhseRequest.SetRange("Source Document", WhseRequest."Source Document"::"Purchase Order");
- "Document Type"::"Return Order":
- WhseRequest.SetRange("Source Document", WhseRequest."Source Document"::"Purchase Return Order");
- end;
- WhseRequest.SetRange("Source No.", "No.");
- REPORT.RunModal(REPORT::"Create Invt Put-away/Pick/Mvmt", true, false, WhseRequest);
- end;
-
- ///
- /// Opens a page for editing dimensions for the purchase header.
- /// If dimensions are changed, they're updated on the purchase lines as well.
- ///
- procedure ShowDocDim()
- var
- OldDimSetID: Integer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeShowDocDim(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- OldDimSetID := "Dimension Set ID";
- "Dimension Set ID" :=
- DimMgt.EditDimensionSet(
- Rec, "Dimension Set ID", StrSubstNo('%1 %2', "Document Type", "No."),
- "Shortcut Dimension 1 Code", "Shortcut Dimension 2 Code");
- OnShowDocDimOnAfterSetDimensionSetID(Rec, xRec);
-
- if OldDimSetID <> "Dimension Set ID" then begin
- OnShowDocDimOnBeforePurchHeaderModify(Rec);
- Modify();
- if PurchLinesExist() then
- UpdateAllLineDim("Dimension Set ID", OldDimSetID);
- end;
- end;
-
- ///
- /// Updates the dimensions of purchase lines in a purchase document when the dimensions of the purchase header are changed.
- ///
- /// New dimension set ID.
- /// Previous dimension set ID.
- procedure UpdateAllLineDim(NewParentDimSetID: Integer; OldParentDimSetID: Integer)
- var
- xPurchaseLine: Record "Purchase Line";
- ConfirmManagement: Codeunit "Confirm Management";
- NewDimSetID: Integer;
- ReceivedShippedItemLineDimChangeConfirmed: Boolean;
- IsHandled: Boolean;
- DefaultAnswer: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateAllLineDim(Rec, NewParentDimSetID, OldParentDimSetID, IsHandled, xRec);
- if IsHandled then
- exit;
-
- if NewParentDimSetID = OldParentDimSetID then
- exit;
- if not GetHideValidationDialog() then begin
- DefaultAnswer := true;
- OnUpdateAllLineDimOnBeforeConfirmUpdateAllLineDim(Rec, DefaultAnswer);
- if not ConfirmManagement.GetResponseOrDefault(Text051, DefaultAnswer) then
- exit;
- end;
-
- PurchLine.Reset();
- PurchLine.SetRange("Document Type", "Document Type");
- PurchLine.SetRange("Document No.", "No.");
- OnUpdateAllLineDimOnAfterPurchLineSetFilters(PurchLine);
- PurchLine.LockTable();
- if PurchLine.Find('-') then
- repeat
- OnUpdateAllLineDimOnBeforeGetPurchLineNewDimsetID(PurchLine, NewParentDimSetID, OldParentDimSetID);
- NewDimSetID := DimMgt.GetDeltaDimSetID(PurchLine."Dimension Set ID", NewParentDimSetID, OldParentDimSetID);
- OnUpdateAllLineDimOnAfterGetPurchLineNewDimsetID(Rec, xRec, PurchLine, NewDimSetID, NewParentDimSetID, OldParentDimSetID);
- if PurchLine."Dimension Set ID" <> NewDimSetID then begin
- xPurchaseLine := PurchLine;
- PurchLine."Dimension Set ID" := NewDimSetID;
-
- if not GetHideValidationDialog() and GuiAllowed then
- VerifyReceivedShippedItemLineDimChange(ReceivedShippedItemLineDimChangeConfirmed);
-
- DimMgt.UpdateGlobalDimFromDimSetID(
- PurchLine."Dimension Set ID", PurchLine."Shortcut Dimension 1 Code", PurchLine."Shortcut Dimension 2 Code");
-
- OnUpdateAllLineDimOnBeforePurchLineModify(PurchLine, xPurchaseLine);
- PurchLine.Modify();
- end;
- until PurchLine.Next() = 0;
- end;
-
- local procedure VerifyReceivedShippedItemLineDimChange(var ReceivedShippedItemLineDimChangeConfirmed: Boolean)
- begin
- if PurchLine.IsReceivedShippedItemDimChanged() then
- if not ReceivedShippedItemLineDimChangeConfirmed then
- ReceivedShippedItemLineDimChangeConfirmed := PurchLine.ConfirmReceivedShippedItemDimChange();
- end;
-
- ///
- /// Updates amount to apply value of the vendor ledger entry based on the applies-to document number and the vendor number.
- ///
- ///
- /// Procedure is executed after applies-to document number field is validated
- /// by selecting a vendor entry from apply vendor entries page.
- ///
- /// Applies-to document no. used in filtering the ledger entry.
- /// Vendor no. to filter the ledger entry for.
- procedure SetAmountToApply(AppliesToDocNo: Code[20]; VendorNo: Code[20])
- var
- VendLedgEntry: Record "Vendor Ledger Entry";
- begin
- OnBeforeSetAmountToApply(Rec, VendLedgEntry);
-
- VendLedgEntry.SetCurrentKey("Document No.");
- VendLedgEntry.SetRange("Document No.", AppliesToDocNo);
- VendLedgEntry.SetRange("Vendor No.", VendorNo);
- VendLedgEntry.SetRange(Open, true);
- if VendLedgEntry.FindFirst() then begin
- if VendLedgEntry."Amount to Apply" = 0 then begin
- VendLedgEntry.CalcFields("Remaining Amount");
- OnSetAmountToApplyAfterOnCalcRemainingAmount(VendLedgEntry);
- VendLedgEntry."Amount to Apply" := VendLedgEntry."Remaining Amount";
- end else
- VendLedgEntry."Amount to Apply" := 0;
- VendLedgEntry."Accepted Payment Tolerance" := 0;
- VendLedgEntry."Accepted Pmt. Disc. Tolerance" := false;
- CODEUNIT.Run(CODEUNIT::"Vend. Entry-Edit", VendLedgEntry);
- end;
- end;
-
- ///
- /// Updates the ship-to information of a purchase header based on the associated location.
- /// If location code is not specified in the purchase header, the information is updated from company information.
- ///
- procedure SetShipToForSpecOrder()
- begin
- if Location.Get("Location Code") then begin
- "Ship-to Code" := '';
- SetShipToAddress(
- Location.Name, Location."Name 2", Location.Address, Location."Address 2",
- Location.City, Location."Post Code", Location.County, Location."Country/Region Code");
- "Ship-to Phone No." := Location."Phone No.";
- "Ship-to Contact" := Location.Contact;
- "Location Code" := Location.Code;
- end else begin
- CompanyInfo.Get();
- "Ship-to Code" := '';
- SetShipToAddress(
- CompanyInfo."Ship-to Name", CompanyInfo."Ship-to Name 2", CompanyInfo."Ship-to Address", CompanyInfo."Ship-to Address 2",
- CompanyInfo."Ship-to City", CompanyInfo."Ship-to Post Code", CompanyInfo."Ship-to County",
- CompanyInfo."Ship-to Country/Region Code");
- "Ship-to Phone No." := CompanyInfo."Ship-to Phone No.";
- "Ship-to Contact" := CompanyInfo."Ship-to Contact";
- "Location Code" := '';
- end;
-
- OnAfterSetShipToForSpecOrder(Rec, Location, CompanyInfo);
- end;
-
- local procedure JobUpdatePurchLines(SkipJobCurrFactorUpdate: Boolean)
- begin
- PurchLine.SetFilter("Job No.", '<>%1', '');
- PurchLine.SetFilter("Job Task No.", '<>%1', '');
- PurchLine.LockTable();
- if PurchLine.FindSet(true) then begin
- PurchLine.SetPurchHeader(Rec);
- repeat
- JobUpdatePurchaseLine(SkipJobCurrFactorUpdate);
- until PurchLine.Next() = 0;
- end;
- end;
-
- local procedure JobUpdatePurchaseLine(SkipJobCurrFactorUpdate: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeJobUpdatePurchaseLine(PurchLine, IsHandled);
- if IsHandled then
- exit;
-
- if not SkipJobCurrFactorUpdate then
- PurchLine.JobSetCurrencyFactor();
- PurchLine.CreateTempJobJnlLine(false);
- PurchLine.UpdateJobPrices();
- PurchLine.Modify();
- end;
-
- ///
- /// Opens a page with posted document lines that can be reversed. After the user selects the lines,
- /// they're copied to the current document.
- ///
- procedure GetPstdDocLinesToReverse()
- var
- PurchPostedDocLines: Page "Posted Purchase Document Lines";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetPstdDocLinesToReverse(Rec, IsHandled);
- if IsHandled then
- exit;
-
- GetVend("Buy-from Vendor No.");
- PurchPostedDocLines.SetToPurchHeader(Rec);
- PurchPostedDocLines.SetRecord(Vend);
- PurchPostedDocLines.LookupMode := true;
- if PurchPostedDocLines.RunModal() = ACTION::LookupOK then
- PurchPostedDocLines.CopyLineToDoc();
-
- Clear(PurchPostedDocLines);
-
- OnAfterGetPstdDocLinesToReverse(Rec);
- end;
-
- ///
- /// Filters the purchase header for responsibility center set in the user setup or company information.
- /// The filter is set in filter group 2 and is hidden from the user.
- ///
- ///
- /// Responsibility filter is set from user setup purchase responsibility control filter field if this field is filled,
- /// otherwise it is set from the company information responsibility center field.
- ///
- procedure SetSecurityFilterOnRespCenter()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetSecurityFilterOnRespCenter(Rec, IsHandled);
- if (not IsHandled) and (UserSetupMgt.GetPurchasesFilter() <> '') then begin
- FilterGroup(2);
- SetRange("Responsibility Center", UserSetupMgt.GetPurchasesFilter());
- FilterGroup(0);
- end;
-
- Rec.SetRange("Date Filter", 0D, WorkDate());
- OnAfterSetSecurityFilterOnRespCenter(Rec);
- end;
-
- ///
- /// Calculates invoice discount for a purchase header if calculate invoice discount is enabled in the purchase setup.
- ///
- procedure CalcInvDiscForHeader()
- var
- PurchaseInvDisc: Codeunit "Purch.-Calc.Discount";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCalcInvDiscForHeader(Rec, IsHandled);
- if IsHandled then
- exit;
-
- GetPurchSetup();
- if PurchSetup."Calc. Inv. Discount" then
- PurchaseInvDisc.CalculateIncDiscForHeader(Rec);
- end;
-
- ///
- /// Updates ship-to information of a purchase header based on the provided sales header.
- /// If purchase lines exist, it compares the shipping information between the purchase and sales header
- /// and throws an error in case of a mismatch.
- ///
- /// Sales header from which information is updated.
- /// If true the procedure is executed and errors are shown.
- procedure AddShipToAddress(SalesHeader: Record "Sales Header"; ShowError: Boolean)
- var
- PurchLine2: Record "Purchase Line";
- begin
- if ShowError then begin
- PurchLine2.Reset();
- PurchLine2.SetRange("Document Type", "Document Type"::Order);
- PurchLine2.SetRange("Document No.", "No.");
- if not PurchLine2.IsEmpty() then begin
- if "Ship-to Name" <> SalesHeader."Ship-to Name" then
- Error(Text052, FieldCaption("Ship-to Name"), "No.", SalesHeader."No.");
- if "Ship-to Name 2" <> SalesHeader."Ship-to Name 2" then
- Error(Text052, FieldCaption("Ship-to Name 2"), "No.", SalesHeader."No.");
- if "Ship-to Address" <> SalesHeader."Ship-to Address" then
- Error(Text052, FieldCaption("Ship-to Address"), "No.", SalesHeader."No.");
- if "Ship-to Address 2" <> SalesHeader."Ship-to Address 2" then
- Error(Text052, FieldCaption("Ship-to Address 2"), "No.", SalesHeader."No.");
- if "Ship-to Post Code" <> SalesHeader."Ship-to Post Code" then
- Error(Text052, FieldCaption("Ship-to Post Code"), "No.", SalesHeader."No.");
- if "Ship-to Country/Region Code" <> SalesHeader."Ship-to Country/Region Code" then
- Error(Text052, FieldCaption("Ship-to Country/Region Code"), "No.", SalesHeader."No.");
- if "Ship-to County" <> SalesHeader."Ship-to County" then
- Error(Text052, FieldCaption("Ship-to County"), "No.", SalesHeader."No.");
- if "Ship-to City" <> SalesHeader."Ship-to City" then
- Error(Text052, FieldCaption("Ship-to City"), "No.", SalesHeader."No.");
- if "Ship-to Phone No." <> SalesHeader."Ship-to Phone No." then
- Error(Text052, FieldCaption("Ship-to Phone No."), "No.", SalesHeader."No.");
- if "Ship-to Contact" <> SalesHeader."Ship-to Contact" then
- Error(Text052, FieldCaption("Ship-to Contact"), "No.", SalesHeader."No.");
- end else begin
- // no purchase line exists
- SetShipToAddress(
- SalesHeader."Ship-to Name", SalesHeader."Ship-to Name 2", SalesHeader."Ship-to Address",
- SalesHeader."Ship-to Address 2", SalesHeader."Ship-to City", SalesHeader."Ship-to Post Code",
- SalesHeader."Ship-to County", SalesHeader."Ship-to Country/Region Code");
- "Ship-to Phone No." := SalesHeader."Ship-to Phone No.";
- "Ship-to Contact" := SalesHeader."Ship-to Contact";
- end;
- end;
-
- OnAfterAddShipToAddress(Rec, SalesHeader, ShowError);
- end;
-
- local procedure BuyFromPostCodeOnBeforeLookupHandled() IsHandled: Boolean
- begin
- OnBeforeBuyFromPostCodeOnBeforeLookupHandled(Rec, PostCode, IsHandled);
- end;
-
- local procedure CopyAddressInfoFromOrderAddress()
- var
- OrderAddress: Record "Order Address";
- IsHandled: Boolean;
- begin
- OrderAddress.Get("Buy-from Vendor No.", "Order Address Code");
- IsHandled := false;
- OnCopyAddressInfoFromOrderAddressOnBeforeCopyBuyFromVendorAddressFieldsFromOrderAddress(Rec, xRec, OrderAddress, IsHandled);
- if not IsHandled then begin
- "Buy-from Vendor Name" := OrderAddress.Name;
- "Buy-from Vendor Name 2" := OrderAddress."Name 2";
- "Buy-from Address" := OrderAddress.Address;
- "Buy-from Address 2" := OrderAddress."Address 2";
- "Buy-from City" := OrderAddress.City;
- "Buy-from Contact" := OrderAddress.Contact;
- "Buy-from Post Code" := OrderAddress."Post Code";
- "Buy-from County" := OrderAddress.County;
- "Buy-from Country/Region Code" := OrderAddress."Country/Region Code";
- end;
-
- if IsCreditDocType() then begin
- SetShipToAddress(
- OrderAddress.Name, OrderAddress."Name 2", OrderAddress.Address, OrderAddress."Address 2",
- OrderAddress.City, OrderAddress."Post Code", OrderAddress.County, OrderAddress."Country/Region Code");
- "Ship-to Phone No." := OrderAddress."Phone No.";
- "Ship-to Contact" := OrderAddress.Contact;
- end;
- OnAfterCopyAddressInfoFromOrderAddress(OrderAddress, Rec);
- end;
-
- ///
- /// Determines if the drop shipment order exists.
- ///
- /// Sales header record to check.
- /// True if drop shipment order exist, otherwise false.
- procedure DropShptOrderExists(SalesHeader: Record "Sales Header"): Boolean
- var
- SalesLine2: Record "Sales Line";
- begin
- // returns TRUE if sales is either Drop Shipment of Special Order
- SalesLine2.Reset();
- SalesLine2.SetRange("Document Type", SalesLine2."Document Type"::Order);
- SalesLine2.SetRange("Document No.", SalesHeader."No.");
- SalesLine2.SetRange("Drop Shipment", true);
- exit(not SalesLine2.IsEmpty());
- end;
-
- ///
- /// Determines if the special order exist.
- ///
- /// Sales header record to check.
- /// True if special order exist, otherwise false.
- procedure SpecialOrderExists(SalesHeader: Record "Sales Header"): Boolean
- var
- SalesLine3: Record "Sales Line";
- begin
- SalesLine3.Reset();
- SalesLine3.SetRange("Document Type", SalesLine3."Document Type"::Order);
- SalesLine3.SetRange("Document No.", SalesHeader."No.");
- SalesLine3.SetRange("Special Order", true);
- exit(not SalesLine3.IsEmpty());
- end;
-
- local procedure CheckDropShipmentLineExists()
- var
- SalesShipmentLine: Record "Sales Shipment Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckDropShipmentLineExists(SalesShipmentLine, IsHandled);
- if IsHandled then
- exit;
-
- SalesShipmentLine.SetRange("Purchase Order No.", "No.");
- SalesShipmentLine.SetRange("Drop Shipment", true);
- if not SalesShipmentLine.IsEmpty() then
- Error(YouCannotChangeFieldErr, FieldCaption("Buy-from Vendor No."));
- end;
-
- ///
- /// Determines if there's anything left to receive for the document.
- ///
- /// True if all lines in a purchase document have quantity to receive 0, otherwise false.
- procedure QtyToReceiveIsZero(): Boolean
- begin
- PurchLine.Reset();
- PurchLine.SetRange("Document Type", "Document Type");
- PurchLine.SetRange("Document No.", "No.");
- PurchLine.SetFilter("Qty. to Receive", '<>0');
- OnQtyToReceiveIsZeroOnAfterSetFilters(PurchLine);
- exit(PurchLine.IsEmpty);
- end;
-
- ///
- /// Determines if a purchase document is approved for posting.
- /// For orders, it additionally checks if the payment and prepayment conditions are met.
- ///
- /// True if a purchase document is approved for posting, otherwise false.
- procedure IsApprovedForPosting() Approved: Boolean
- var
- PrepaymentMgt: Codeunit "Prepayment Mgt.";
- IsHandled: Boolean;
- begin
- if ApprovalsMgmt.PrePostApprovalCheckPurch(Rec) then begin
- TestPurchasePrepayment();
- Approved := true;
- if "Document Type" = "Document Type"::Order then
- if PrepaymentMgt.TestPurchasePayment(Rec) then begin
- IsHandled := false;
- OnIsApprovedForPostingOnBeforeError(Rec, IsHandled, Approved);
- if not IsHandled then
- Error(Text054, "Document Type", "No.");
- end;
- OnAfterIsApprovedForPosting(Rec, Approved);
- end;
- end;
-
- ///
- /// Determines if a purchase document is approved for posting.
- /// It checks if the prepayment and payment conditions are met.
- ///
- /// True if a purchase document is approved for posting, otherwise false.
- procedure IsApprovedForPostingBatch() Approved: Boolean
- begin
- Approved := ApprovedForPostingBatch();
- OnAfterIsApprovedForPostingBatch(Rec, Approved);
- end;
-
- [TryFunction]
- local procedure ApprovedForPostingBatch()
- var
- PrepaymentMgt: Codeunit "Prepayment Mgt.";
- begin
- if ApprovalsMgmt.PrePostApprovalCheckPurch(Rec) then begin
- TestPurchasePrepayment();
- if PrepaymentMgt.TestPurchasePayment(Rec) then
- Error(Text054, "Document Type", "No.");
- end;
- end;
-
- ///
- /// Determines if the total amount including VAT of an incoming document matches the total amount including VAT
- /// of the purchase document.
- ///
- ///
- /// Used to check if the invoice can be posted.
- ///
- /// True if the total matches, otherwise false.
- procedure IsTotalValid(): Boolean
- var
- IncomingDocument: Record "Incoming Document";
- PurchaseLine: Record "Purchase Line";
- TempTotalPurchaseLine: Record "Purchase Line" temporary;
- GeneralLedgerSetup: Record "General Ledger Setup";
- DocumentTotals: Codeunit "Document Totals";
- VATAmount: Decimal;
- IsHandled, Result : Boolean;
- begin
- OnBeforeIsTotalValid(Rec, IsHandled);
- if IsHandled then
- exit(true);
-
- if not IncomingDocument.Get(Rec."Incoming Document Entry No.") then
- exit(true);
-
- if IncomingDocument."Amount Incl. VAT" = 0 then
- exit(true);
-
- PurchaseLine.SetRange("Document Type", "Document Type");
- PurchaseLine.SetRange("Document No.", "No.");
- PurchaseLine.SetFilter(Type, '<>%1', PurchaseLine.Type::" ");
- if not PurchaseLine.FindFirst() then
- exit(true);
-
- GeneralLedgerSetup.Get();
- if (IncomingDocument."Currency Code" <> PurchaseLine."Currency Code") and
- (IncomingDocument."Currency Code" <> GeneralLedgerSetup."LCY Code")
- then
- exit(true);
-
- IsHandled := false;
- OnBeforeCheckIsTotalValid(IncomingDocument, Rec, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- TempTotalPurchaseLine.Init();
- DocumentTotals.PurchaseCalculateTotalsWithInvoiceRounding(PurchaseLine, VATAmount, TempTotalPurchaseLine);
-
- exit(IncomingDocument."Amount Incl. VAT" = TempTotalPurchaseLine."Amount Including VAT");
- end;
-
- ///
- /// Posts a purchase document by running the provided codeunit if the document is approved for posting.
- ///
- ///
- /// The transaction is committed before the posting codeunit is run.
- /// After the posting codeunit is executed any errors that occur during the posting operation are shown.
- ///
- /// Posting codeunit id that needs to be executed.
- /// True if the document was successfully posted, otherwise false.
- procedure SendToPosting(PostingCodeunitID: Integer) IsSuccess: Boolean
- var
- ErrorContextElement: Codeunit "Error Context Element";
- ErrorMessageMgt: Codeunit "Error Message Management";
- ErrorMessageHandler: Codeunit "Error Message Handler";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSendToPosting(Rec, IsSuccess, IsHandled, PostingCodeunitID);
- if IsHandled then
- exit(IsSuccess);
-
- if not IsApprovedForPosting() then
- exit;
-
- Commit();
- ErrorMessageMgt.Activate(ErrorMessageHandler);
- ErrorMessageMgt.PushContext(ErrorContextElement, RecordId, 0, '');
- IsSuccess := CODEUNIT.Run(PostingCodeunitID, Rec);
- if not IsSuccess then begin
- if Rec.Status <> Rec.Status::Released then
- DeleteWarehouseRequest();
- ErrorMessageHandler.ShowErrors();
- end;
- end;
-
- local procedure DeleteWarehouseRequest()
- begin
- WhseRequest.SetRange("Source Type", Database::"Purchase Line");
- WhseRequest.SetRange("Source Subtype", "Document Type");
- WhseRequest.SetRange("Source No.", "No.");
- if not WhseRequest.IsEmpty() then
- WhseRequest.DeleteAll(true);
- end;
-
- ///
- /// Cancels a background posting job for a purchase document.
- ///
- procedure CancelBackgroundPosting()
- var
- PurchasePostViaJobQueue: Codeunit "Purchase Post via Job Queue";
- begin
- PurchasePostViaJobQueue.CancelQueueEntry(Rec);
- end;
-
- ///
- /// Retrieves the full document type name based on the purchase header document type.
- ///
- /// Retrieved document type name.
- procedure GetDocTypeTxt() TypeText: Text[50]
- var
- ReportDistributionMgt: Codeunit "Report Distribution Management";
- begin
- TypeText := ReportDistributionMgt.GetFullDocumentTypeText(Rec);
- end;
-
- ///
- /// Adds the shipping information from a special order. If lines exist, it compares the current shipping information
- /// with the information on the special order and throws an error if there's a mismatch.
- ///
- /// Sales header to which ship-to information is compared.
- /// If true the procedure is executed and errors are shown.
- procedure AddSpecialOrderToAddress(var SalesHeader: Record "Sales Header"; ShowError: Boolean)
- var
- PurchaseHeader: Record "Purchase Header";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeAddSpecialOrderToAddress(Rec, SalesHeader, IsHandled, ShowError);
- if IsHandled then
- exit;
-
- if ShowError then
- if PurchLinesExist() then begin
- PurchaseHeader := Rec;
- PurchaseHeader.SetShipToForSpecOrder();
- if "Ship-to Name" <> PurchaseHeader."Ship-to Name" then
- Error(Text052, FieldCaption("Ship-to Name"), "No.", SalesHeader."No.");
- if "Ship-to Name 2" <> PurchaseHeader."Ship-to Name 2" then
- Error(Text052, FieldCaption("Ship-to Name 2"), "No.", SalesHeader."No.");
- if "Ship-to Address" <> PurchaseHeader."Ship-to Address" then
- Error(Text052, FieldCaption("Ship-to Address"), "No.", SalesHeader."No.");
- if "Ship-to Address 2" <> PurchaseHeader."Ship-to Address 2" then
- Error(Text052, FieldCaption("Ship-to Address 2"), "No.", SalesHeader."No.");
- if "Ship-to Post Code" <> PurchaseHeader."Ship-to Post Code" then
- Error(Text052, FieldCaption("Ship-to Post Code"), "No.", SalesHeader."No.");
- if "Ship-to City" <> PurchaseHeader."Ship-to City" then
- Error(Text052, FieldCaption("Ship-to City"), "No.", SalesHeader."No.");
- if "Ship-to Phone No." <> PurchaseHeader."Ship-to Phone No." then
- Error(Text052, FieldCaption("Ship-to Phone No."), "No.", SalesHeader."No.");
- if "Ship-to Contact" <> PurchaseHeader."Ship-to Contact" then
- Error(Text052, FieldCaption("Ship-to Contact"), "No.", SalesHeader."No.");
- end else
- SetShipToForSpecOrder();
-
- OnAfterAddSpecialOrderToAddress(Rec, SalesHeader, ShowError);
- end;
-
-
- ///
- /// Returns true or false whether any line has "Quantity Invoiced" not 0.
- ///
- procedure InvoicedLineExists(): Boolean
- var
- PurchLine: Record "Purchase Line";
- begin
- PurchLine.SetRange("Document Type", "Document Type");
- PurchLine.SetRange("Document No.", "No.");
- PurchLine.SetFilter(Type, '<>%1', PurchLine.Type::" ");
- PurchLine.SetFilter("Quantity Invoiced", '<>%1', 0);
- exit(not PurchLine.IsEmpty);
- end;
-
- ///
- /// Creates a dimension set for the purchase lines that have a prepayment amount.
- ///
- procedure CreateDimSetForPrepmtAccDefaultDim()
- var
- PurchaseLine: Record "Purchase Line";
- TempPurchaseLine: Record "Purchase Line" temporary;
- DefaultDimSource: List of [Dictionary of [Integer, Code[20]]];
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateDimSetForPrepmtAccDefaultDim(Rec, IsHandled);
- if IsHandled then
- exit;
-
- PurchaseLine.SetRange("Document Type", "Document Type");
- PurchaseLine.SetRange("Document No.", "No.");
- PurchaseLine.SetFilter("Prepmt. Amt. Inv.", '<>%1', 0);
- if PurchaseLine.FindSet() then
- repeat
- CollectParamsInBufferForCreateDimSet(TempPurchaseLine, PurchaseLine);
- until PurchaseLine.Next() = 0;
- TempPurchaseLine.Reset();
- TempPurchaseLine.MarkedOnly(false);
- if TempPurchaseLine.FindSet() then
- repeat
- InitPurchaseLineDefaultDimSource(DefaultDimSource, TempPurchaseLine);
- OnCreateDimSetForPrepmtAccDefaultDimOnBeforeTempPurchaseLineCreateDim(DefaultDimSource, TempPurchaseLine);
- TempPurchaseLine.CreateDim(DefaultDimSource);
- until TempPurchaseLine.Next() = 0;
- end;
-
- local procedure InitPurchaseLineDefaultDimSource(var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; SourcePurchaseLine: Record "Purchase Line")
- var
- IsHandled: Boolean;
- begin
- Clear(DefaultDimSource);
- IsHandled := false;
- OnBeforeInitPurchaseLineDefaultDimSource(Rec, DefaultDimSource, SourcePurchaseLine, IsHandled);
- if IsHandled then
- exit;
-
- DimMgt.AddDimSource(DefaultDimSource, Database::"G/L Account", SourcePurchaseLine."No.");
- DimMgt.AddDimSource(DefaultDimSource, Database::Job, SourcePurchaseLine."Job No.");
- DimMgt.AddDimSource(DefaultDimSource, Database::"Responsibility Center", SourcePurchaseLine."Responsibility Center");
-
- OnAfterInitPurchaseLineDefaultDimSource(Rec, DefaultDimSource, SourcePurchaseLine);
- end;
-
- local procedure CollectParamsInBufferForCreateDimSet(var TempPurchaseLine: Record "Purchase Line" temporary; PurchaseLine: Record "Purchase Line")
- var
- GenPostingSetup: Record "General Posting Setup";
- DefaultDimension: Record "Default Dimension";
- begin
- TempPurchaseLine.SetRange("Gen. Bus. Posting Group", PurchaseLine."Gen. Bus. Posting Group");
- TempPurchaseLine.SetRange("Gen. Prod. Posting Group", PurchaseLine."Gen. Prod. Posting Group");
- if not TempPurchaseLine.FindFirst() then begin
- GenPostingSetup.Get(PurchaseLine."Gen. Bus. Posting Group", PurchaseLine."Gen. Prod. Posting Group");
- GenPostingSetup.TestField("Purch. Prepayments Account");
- DefaultDimension.SetRange("Table ID", Database::"G/L Account");
- DefaultDimension.SetRange("No.", GenPostingSetup."Purch. Prepayments Account");
- CollectParamsInBufferForCreateDimSetOnBeforeInsertTempPurchaseLineInBuffer(GenPostingSetup, DefaultDimension);
- InsertTempPurchaseLineInBuffer(TempPurchaseLine, PurchaseLine,
- GenPostingSetup."Purch. Prepayments Account", DefaultDimension.IsEmpty);
- end else
- if not TempPurchaseLine.Mark() then begin
- TempPurchaseLine.SetRange("Job No.", PurchaseLine."Job No.");
- TempPurchaseLine.SetRange("Responsibility Center", PurchaseLine."Responsibility Center");
- OnCollectParamsInBufferForCreateDimSetOnAfterSetTempPurchLineFilters(TempPurchaseLine, PurchaseLine);
- if TempPurchaseLine.IsEmpty() then
- InsertTempPurchaseLineInBuffer(TempPurchaseLine, PurchaseLine, TempPurchaseLine."No.", false)
- end;
- end;
-
- local procedure InsertTempPurchaseLineInBuffer(var TempPurchaseLine: Record "Purchase Line" temporary; PurchaseLine: Record "Purchase Line"; AccountNo: Code[20]; DefaultDimenstionsNotExist: Boolean)
- begin
- TempPurchaseLine.Init();
- TempPurchaseLine."Document Type" := PurchaseLine."Document Type";
- TempPurchaseLine."Document No." := PurchaseLine."Document No.";
- TempPurchaseLine."Line No." := PurchaseLine."Line No.";
- TempPurchaseLine."No." := AccountNo;
- TempPurchaseLine."Job No." := PurchaseLine."Job No.";
- TempPurchaseLine."Responsibility Center" := PurchaseLine."Responsibility Center";
- TempPurchaseLine."Gen. Bus. Posting Group" := PurchaseLine."Gen. Bus. Posting Group";
- TempPurchaseLine."Gen. Prod. Posting Group" := PurchaseLine."Gen. Prod. Posting Group";
- TempPurchaseLine.Mark := DefaultDimenstionsNotExist;
- OnInsertTempPurchLineInBufferOnBeforeTempPurchLineInsert(TempPurchaseLine, PurchaseLine);
- TempPurchaseLine.Insert();
- end;
-
- ///
- /// Transfers item charge assignments to the temporary record set and deletes them from the original record.
- ///
- /// Item charge assignment record set to transfer.
- /// Return value: Temporary item charge assignment record set to transfer to.
- procedure TransferItemChargeAssgntPurchToTemp(var ItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)"; var TempItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)" temporary)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeTransferItemChargeAssgntPurchToTemp(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- ItemChargeAssgntPurch.SetRange("Document Type", "Document Type");
- ItemChargeAssgntPurch.SetRange("Document No.", "No.");
- if ItemChargeAssgntPurch.FindSet() then begin
- repeat
- TempItemChargeAssgntPurch := ItemChargeAssgntPurch;
- TempItemChargeAssgntPurch.Insert();
- until ItemChargeAssgntPurch.Next() = 0;
- ItemChargeAssgntPurch.DeleteAll();
- end;
- end;
-
- ///
- /// Prepares the opening document statistics for a purchase document. It checks the user's permissions,
- /// calculates the invoice discount, creates a dimension set for order documents, and commits any changes made.
- ///
- procedure PrepareOpeningDocumentStatistics()
- var
- [SecurityFiltering(SecurityFilter::Ignored)]
- PurchaseHeader: Record "Purchase Header";
- [SecurityFiltering(SecurityFilter::Ignored)]
- PurchaseLine: Record "Purchase Line";
- begin
- if not PurchaseHeader.WritePermission() or not PurchaseLine.WritePermission() then
- Error(StatisticsInsuffucientPermissionsErr);
-
- CalcInvDiscForHeader();
- if IsOrderDocument() then
- CreateDimSetForPrepmtAccDefaultDim();
-
- OnAfterPrepareOpeningDocumentStatistics(Rec);
-
- Commit();
- end;
-
- local procedure IsOrderDocument(): Boolean
- begin
- case "Document Type" of
- "Document Type"::Order,
- "Document Type"::"Blanket Order",
- "Document Type"::"Return Order":
- exit(true);
- end;
-
- exit(false);
- end;
-
- [IntegrationEvent(true, false)]
- procedure OnCheckPurchasePostRestrictions()
- begin
- end;
-
- ///
- /// Triggers the OnCheckPurchasePostRestrictions event to check any additional restrictions before releasing a purchase document.
- ///
- procedure CheckPurchasePostRestrictions()
- begin
- OnCheckPurchasePostRestrictions();
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnCheckPurchaseReleaseRestrictions()
- begin
- end;
-
- ///
- /// Checks any restrictions before releasing a purchase document.
- ///
- procedure CheckPurchaseReleaseRestrictions()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- OnCheckPurchaseReleaseRestrictions();
- ApprovalsMgmt.PrePostApprovalCheckPurch(Rec);
- end;
-
- ///
- /// Sets the status of a purchase document.
- ///
- /// New status to set.
- procedure SetStatus(NewStatus: Option)
- begin
- Status := Enum::"Purchase Document Status".FromInteger(NewStatus);
- Modify();
- end;
-
- ///
- /// Triggers an event after a purchase document is posted.
- ///
- /// Gen journal post line codeunit that was used to post the document.
- /// Posted purchase receipt document no.
- /// Posted return shipment document no.
- /// Posted purchase invoice document no.
- /// Posted purchase credit memo document no.
- procedure TriggerOnAfterPostPurchaseDoc(var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; PurchRcpHdrNo: Code[20]; RetShptHdrNo: Code[20]; PurchInvHdrNo: Code[20]; PurchCrMemoHdrNo: Code[20])
- var
- PurchPost: Codeunit "Purch.-Post";
- begin
- PurchPost.OnAfterPostPurchaseDoc(Rec, GenJnlPostLine, PurchRcpHdrNo, RetShptHdrNo, PurchInvHdrNo, PurchCrMemoHdrNo, false);
- end;
-
- ///
- /// Determines if deferral header exists for a purchase document.
- ///
- /// True if deferral header exists, otherwise false.
- procedure DeferralHeadersExist(): Boolean
- var
- DeferralHeader: Record "Deferral Header";
- begin
- DeferralHeader.SetRange("Deferral Doc. Type", "Deferral Document Type"::Purchase);
- DeferralHeader.SetRange("Gen. Jnl. Template Name", '');
- DeferralHeader.SetRange("Gen. Jnl. Batch Name", '');
- DeferralHeader.SetRange("Document Type", "Document Type");
- DeferralHeader.SetRange("Document No.", "No.");
- exit(not DeferralHeader.IsEmpty);
- end;
-
- local procedure ConfirmUpdateDeferralDate()
- begin
- if GetHideValidationDialog() or not GuiAllowed then
- Confirmed := true
- else
- Confirmed := Confirm(DeferralLineQst, false, FieldCaption("Posting Date"));
- if Confirmed then
- UpdatePurchLinesByFieldNo(PurchLine.FieldNo("Deferral Code"), false);
- end;
-
- local procedure ConfirmUpdateField(UpdatingFieldNo: Integer) Result: Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeConfirmUpdateField(Rec, xRec, UpdatingFieldNo, CurrFieldNo, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if GetHideValidationDialog() or not GuiAllowed then
- Result := true
- else
- Result := Confirm(ConfirmChangeQst, false, GetUpdatedFieldCaption(UpdatingFieldNo));
- end;
-
- ///
- /// Returns field caption for the provided field number.
- ///
- /// Field number that was updated.
- /// Field caption for the provided UpdatingFieldNo field number.
- procedure GetUpdatedFieldCaption(UpdatingFieldNo: Integer): Text
- var
- RecRef: RecordRef;
- FldRef: FieldRef;
- begin
- case UpdatingFieldNo of
- FieldNo("Buy-from Vendor No."):
- exit(BuyFromVendorTxt);
- FieldNo("Pay-to Vendor No."):
- exit(PayToVendorTxt);
- end;
-
- RecRef.Get(RecordId);
- FldRef := RecRef.Field(UpdatingFieldNo);
- exit(FldRef.Caption);
- end;
-
- ///
- /// Determines if the document type is a credit document.
- ///
- /// True if the document type is return order or credit memo, otherwise false.
- procedure IsCreditDocType(): Boolean
- var
- CreditDocType: Boolean;
- begin
- CreditDocType := "Document Type" in ["Document Type"::"Return Order", "Document Type"::"Credit Memo"];
- OnBeforeIsCreditDocType(Rec, CreditDocType);
- exit(CreditDocType);
- end;
-
- ///
- /// Updates the buy-from vendor no. of a purchase header based on a single-value filter applied to the buy-from vendor no. field.
- ///
- ///
- /// Single-value filter is retrieved from the current filter group or filter group 2.
- /// If it exists, it's used to update the buy-from vendor no.
- ///
- procedure SetBuyFromVendorFromFilter()
- var
- BuyFromVendorNo: Code[20];
- begin
- BuyFromVendorNo := GetFilterVendNo();
- if BuyFromVendorNo = '' then begin
- FilterGroup(2);
- BuyFromVendorNo := GetFilterVendNo();
- FilterGroup(0);
- end;
- if BuyFromVendorNo <> '' then begin
- Clear(xRec);
- Validate("Buy-from Vendor No.", BuyFromVendorNo);
- end;
-
- OnAfterSetBuyFromVendorFromFilter(Rec);
- end;
-
- ///
- /// Moves the filter on buy-from vendor no. from the current filter group to filter group 2.
- ///
- procedure CopyBuyFromVendorFilter()
- var
- BuyFromVendorFilter: Text;
- begin
- BuyFromVendorFilter := GetFilter("Buy-from Vendor No.");
- if BuyFromVendorFilter <> '' then begin
- FilterGroup(2);
- SetFilter("Buy-from Vendor No.", BuyFromVendorFilter);
- FilterGroup(0)
- end;
- end;
-
- local procedure GetFilterVendNo(): Code[20]
- begin
- if GetFilter("Buy-from Vendor No.") <> '' then
- if GetRangeMin("Buy-from Vendor No.") = GetRangeMax("Buy-from Vendor No.") then
- exit(GetRangeMax("Buy-from Vendor No."));
- end;
-
- ///
- /// Determines if purchase header has buy-from information.
- ///
- /// True if purchase header has buy-from information, otherwise false.
- procedure HasBuyFromAddress() Result: Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeHasBuyFromAddress(Rec, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- case true of
- "Buy-from Address" <> '':
- exit(true);
- "Buy-from Address 2" <> '':
- exit(true);
- "Buy-from City" <> '':
- exit(true);
- "Buy-from Country/Region Code" <> '':
- exit(true);
- "Buy-from County" <> '':
- exit(true);
- "Buy-from Post Code" <> '':
- exit(true);
- "Buy-from Contact" <> '':
- exit(true);
- end;
-
- exit(false);
- end;
-
- ///
- /// Determines if purchase header has ship-to information.
- ///
- /// True if purchase header has ship-to information, otherwise false.
- procedure HasShipToAddress() Result: Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeHasShipToAddress(Rec, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- case true of
- "Ship-to Address" <> '':
- exit(true);
- "Ship-to Address 2" <> '':
- exit(true);
- "Ship-to City" <> '':
- exit(true);
- "Ship-to Country/Region Code" <> '':
- exit(true);
- "Ship-to County" <> '':
- exit(true);
- "Ship-to Post Code" <> '':
- exit(true);
- "Ship-to Phone No." <> '':
- exit(true);
- "Ship-to Contact" <> '':
- exit(true);
- end;
-
- exit(false);
- end;
-
- ///
- /// Determines if purchase header has pay-to information.
- ///
- /// True if purchase header has pay-to information, otherwise false.
- procedure HasPayToAddress() Result: Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeHasPayToAddress(Rec, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- case true of
- "Pay-to Address" <> '':
- exit(true);
- "Pay-to Address 2" <> '':
- exit(true);
- "Pay-to City" <> '':
- exit(true);
- "Pay-to Country/Region Code" <> '':
- exit(true);
- "Pay-to County" <> '':
- exit(true);
- "Pay-to Post Code" <> '':
- exit(true);
- "Pay-to Contact" <> '':
- exit(true);
- end;
-
- exit(false);
- end;
-
- ///
- /// Determines if the purchase header has any item charge assignments.
- ///
- /// True if item charge assignments exists, otherwise false.
- procedure HasItemChargeAssignment(): Boolean
- var
- ItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)";
- begin
- ItemChargeAssgntPurch.SetRange("Document Type", "Document Type");
- ItemChargeAssgntPurch.SetRange("Document No.", "No.");
- ItemChargeAssgntPurch.SetFilter("Amount to Assign", '<>%1', 0);
- exit(not ItemChargeAssgntPurch.IsEmpty());
- end;
-
- local procedure CopyBuyFromVendorAddressFieldsFromVendor(var BuyFromVendor: Record Vendor; ForceCopy: Boolean)
- begin
- if BuyFromVendorIsReplaced() or ShouldCopyAddressFromBuyFromVendor(BuyFromVendor) or ForceCopy then begin
- "Buy-from Vendor Templ. Code" := '';
- "Buy-from Address" := BuyFromVendor.Address;
- "Buy-from Address 2" := BuyFromVendor."Address 2";
- "Buy-from City" := BuyFromVendor.City;
- "Buy-from Post Code" := BuyFromVendor."Post Code";
- "Buy-from County" := BuyFromVendor.County;
- "Buy-from Country/Region Code" := BuyFromVendor."Country/Region Code";
- OnAfterCopyBuyFromVendorAddressFieldsFromVendor(Rec, BuyFromVendor);
- end;
- end;
-
- local procedure CopyShipToVendorAddressFieldsFromVendor(var BuyFromVendor: Record Vendor; ForceCopy: Boolean)
- begin
- if BuyFromVendorIsReplaced() or (not HasShipToAddress()) or ForceCopy then begin
- "Ship-to Address" := BuyFromVendor.Address;
- "Ship-to Address 2" := BuyFromVendor."Address 2";
- "Ship-to City" := BuyFromVendor.City;
- "Ship-to Post Code" := BuyFromVendor."Post Code";
- "Ship-to County" := BuyFromVendor.County;
- Validate("Ship-to Country/Region Code", BuyFromVendor."Country/Region Code");
- "Ship-to Phone No." := BuyFromVendor."Phone No.";
- OnAfterCopyShipToVendorAddressFieldsFromVendor(Rec, BuyFromVendor);
- end;
- end;
-
- local procedure CopyPayToVendorAddressFieldsFromVendor(var PayToVendor: Record Vendor; ForceCopy: Boolean)
- begin
- if PayToVendorIsReplaced() or ShouldCopyAddressFromPayToVendor(PayToVendor) or ForceCopy then begin
- "Pay-to Vendor Templ. Code" := '';
- "Pay-to Address" := PayToVendor.Address;
- "Pay-to Address 2" := PayToVendor."Address 2";
- "Pay-to City" := PayToVendor.City;
- "Pay-to Post Code" := PayToVendor."Post Code";
- "Pay-to County" := PayToVendor.County;
- "Pay-to Country/Region Code" := PayToVendor."Country/Region Code";
- OnAfterCopyPayToVendorAddressFieldsFromVendor(Rec, PayToVendor);
- end;
- end;
-
- ///
- /// Sets the ship-to information for a purchase document from the provided parameters.
- ///
- /// Ship-to name to set.
- /// Ship-to name 2 to set.
- /// Ship-to address to set.
- /// Ship-to address 2 to set.
- /// Ship-to city to set.
- /// Ship-to post code to set.
- /// Ship-to county to set.
- /// Ship-to country/region code to set.
- procedure SetShipToAddress(ShipToName: Text[100]; ShipToName2: Text[50]; ShipToAddress: Text[100]; ShipToAddress2: Text[50]; ShipToCity: Text[30]; ShipToPostCode: Code[20]; ShipToCounty: Text[30]; ShipToCountryRegionCode: Code[10])
- begin
- "Ship-to Name" := ShipToName;
- "Ship-to Name 2" := ShipToName2;
- "Ship-to Address" := ShipToAddress;
- "Ship-to Address 2" := ShipToAddress2;
- "Ship-to City" := ShipToCity;
- "Ship-to Post Code" := ShipToPostCode;
- "Ship-to County" := ShipToCounty;
- "Ship-to Country/Region Code" := ShipToCountryRegionCode;
- end;
-
- local procedure ShouldCopyAddressFromBuyFromVendor(BuyFromVendor: Record Vendor): Boolean
- begin
- exit((not HasBuyFromAddress()) and BuyFromVendor.HasAddress());
- end;
-
- local procedure ShouldCopyAddressFromPayToVendor(PayToVendor: Record Vendor): Boolean
- begin
- exit((not HasPayToAddress()) and PayToVendor.HasAddress());
- end;
-
- ///
- /// Determines whether a search for a vendor should be performed by name for the provided vendor no.
- ///
- /// Vendor number to check.
- /// True if vendor should be searched by name, otherwise false.
- procedure ShouldSearchForVendorByName(VendorNo: Code[20]) Result: Boolean
- var
- Vendor: Record Vendor;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeShouldSearchForVendorByName(VendorNo, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if VendorNo = '' then
- exit(true);
-
- GetPurchSetup();
- if PurchSetup."Disable Search by Name" then
- exit(false);
-
- if not Vendor.Get(VendorNo) then
- exit(true);
-
- exit(not Vendor."Disable Search by Name");
- end;
-
- local procedure BuyFromVendorIsReplaced(): Boolean
- begin
- exit((xRec."Buy-from Vendor No." <> '') and (xRec."Buy-from Vendor No." <> "Buy-from Vendor No."));
- end;
-
- local procedure PayToVendorIsReplaced(): Boolean
- begin
- exit((xRec."Pay-to Vendor No." <> '') and (xRec."Pay-to Vendor No." <> "Pay-to Vendor No."));
- end;
-
- ///
- /// Copies the buy-from information to pay-to information for a purchase document if the pay-to vendor no.
- /// is the same as the buy-from vendor no.
- ///
- procedure CopyBuyFromAddressToPayToAddress()
- begin
- if "Pay-to Vendor No." = "Buy-from Vendor No." then begin
- "Pay-to Address" := "Buy-from Address";
- "Pay-to Address 2" := "Buy-from Address 2";
- "Pay-to Post Code" := "Buy-from Post Code";
- "Pay-to Country/Region Code" := "Buy-from Country/Region Code";
- "Pay-to City" := "Buy-from City";
- "Pay-to County" := "Buy-from County";
- OnAfterCopyBuyFromAddressToPayToAddress(Rec);
- end;
- end;
-
- local procedure UpdatePayToAddressFromBuyFromAddress(FieldNumber: Integer)
- begin
- if ("Order Address Code" = '') and PayToAddressEqualsOldBuyFromAddress() then
- case FieldNumber of
- FieldNo("Pay-to Address"):
- if xRec."Buy-from Address" = "Pay-to Address" then
- "Pay-to Address" := "Buy-from Address";
- FieldNo("Pay-to Address 2"):
- if xRec."Buy-from Address 2" = "Pay-to Address 2" then
- "Pay-to Address 2" := "Buy-from Address 2";
- FieldNo("Pay-to City"), FieldNo("Pay-to Post Code"):
- begin
- if xRec."Buy-from City" = "Pay-to City" then
- "Pay-to City" := "Buy-from City";
- if xRec."Buy-from Post Code" = "Pay-to Post Code" then
- "Pay-to Post Code" := "Buy-from Post Code";
- if xRec."Buy-from County" = "Pay-to County" then
- "Pay-to County" := "Buy-from County";
- if xRec."Buy-from Country/Region Code" = "Pay-to Country/Region Code" then
- "Pay-to Country/Region Code" := "Buy-from Country/Region Code";
- end;
- FieldNo("Pay-to County"):
- if xRec."Buy-from County" = "Pay-to County" then
- "Pay-to County" := "Buy-from County";
- FieldNo("Pay-to Country/Region Code"):
- if xRec."Buy-from Country/Region Code" = "Pay-to Country/Region Code" then
- "Pay-to Country/Region Code" := "Buy-from Country/Region Code";
- end;
- OnAfterUpdatePayToAddressFromBuyFromAddress(Rec, xRec, FieldNumber);
- end;
-
- local procedure PayToAddressEqualsOldBuyFromAddress() Result: Boolean
- begin
- Result := (xRec."Buy-from Address" = "Pay-to Address") and
- (xRec."Buy-from Address 2" = "Pay-to Address 2") and
- (xRec."Buy-from City" = "Pay-to City") and
- (xRec."Buy-from County" = "Pay-to County") and
- (xRec."Buy-from Post Code" = "Pay-to Post Code") and
- (xRec."Buy-from Country/Region Code" = "Pay-to Country/Region Code");
- OnAfterPayToAddressEqualsOldBuyFromAddress(Rec, xRec, Result);
- end;
-
- ///
- /// Raises a dialog to confirm closing a page if unposted lines exist.
- ///
- /// True if page should be closed, otherwise false.
- procedure ConfirmCloseUnposted() Result: Boolean
- var
- InstructionMgt: Codeunit "Instruction Mgt.";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeConfirmCloseUnposted(Rec, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if PurchLinesExist() then
- if InstructionMgt.IsUnpostedEnabledForRecord(Rec) then
- exit(InstructionMgt.ShowConfirm(DocumentNotPostedClosePageQst, InstructionMgt.QueryPostOnCloseCode()));
- exit(true)
- end;
-
- ///
- /// Initializes a purchase header from the provided purchase header.
- ///
- /// Purchase header to copy information from.
- procedure InitFromPurchHeader(SourcePurchHeader: Record "Purchase Header")
- begin
- "Document Date" := SourcePurchHeader."Document Date";
- "Invoice Received Date" := SourcePurchHeader."Invoice Received Date";
- "Expected Receipt Date" := SourcePurchHeader."Expected Receipt Date";
- "Shortcut Dimension 1 Code" := SourcePurchHeader."Shortcut Dimension 1 Code";
- "Shortcut Dimension 2 Code" := SourcePurchHeader."Shortcut Dimension 2 Code";
- "Dimension Set ID" := SourcePurchHeader."Dimension Set ID";
- "Location Code" := SourcePurchHeader."Location Code";
- SetShipToAddress(
- SourcePurchHeader."Ship-to Name", SourcePurchHeader."Ship-to Name 2", SourcePurchHeader."Ship-to Address",
- SourcePurchHeader."Ship-to Address 2", SourcePurchHeader."Ship-to City", SourcePurchHeader."Ship-to Post Code",
- SourcePurchHeader."Ship-to County", SourcePurchHeader."Ship-to Country/Region Code");
- "Ship-to Phone No." := SourcePurchHeader."Ship-to Phone No.";
- "Ship-to Contact" := SourcePurchHeader."Ship-to Contact";
-
- OnInitFromPurchHeader(Rec, SourcePurchHeader);
- end;
-
- local procedure InitFromVendor(VendorNo: Code[20]; VendorCaption: Text): Boolean
- begin
- PurchLine.SetRange("Document Type", "Document Type");
- PurchLine.SetRange("Document No.", "No.");
- if VendorNo = '' then begin
- if not PurchLine.IsEmpty() then
- Error(Text005, VendorCaption);
- OnInitFromVendorOnBeforeInit(Rec, xRec);
- Init();
- "No. Series" := xRec."No. Series";
- OnInitFromVendorOnBeforeInitRecord(Rec, xRec);
- InitRecord();
- InitNoSeries();
- exit(true);
- end;
-
- OnAfterInitFromVendor(Rec, xRec, VendorNo, VendorCaption);
- end;
-
- local procedure InitFromContact(ContactNo: Code[20]; VendorNo: Code[20]; ContactCaption: Text): Boolean
- begin
- PurchLine.SetRange("Document Type", "Document Type");
- PurchLine.SetRange("Document No.", "No.");
- if (ContactNo = '') and (VendorNo = '') then begin
- if not PurchLine.IsEmpty() then
- Error(Text005, ContactCaption);
- OnInitFromContactOnBeforeInit(Rec, xRec);
- Init();
- GetPurchSetup();
- "No. Series" := xRec."No. Series";
- OnInitFromContactOnBeforeInitRecord(Rec, xRec);
- InitRecord();
- InitNoSeries();
- exit(true);
- end;
- end;
-
- local procedure LookupContact(VendorNo: Code[20]; ContactNo: Code[20]; var Contact: Record Contact)
- var
- ContactBusinessRelation: Record "Contact Business Relation";
- begin
- if ContactBusinessRelation.FindByRelation(ContactBusinessRelation."Link to Table"::Vendor, VendorNo) then
- Contact.SetRange("Company No.", ContactBusinessRelation."Contact No.")
- else
- Contact.SetRange("Company No.", '');
- if ContactNo <> '' then
- if Contact.Get(ContactNo) then;
- end;
-
- ///
- /// Opens a contact lookup page and validates the buy-from contact no. field with the selected contact.
- ///
- /// True if the contact was validated, otherwise false.
- procedure BuyfromContactLookup(): Boolean
- var
- Contact: Record Contact;
- ContactBusinessRelation: Record "Contact Business Relation";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupBuyFromContactNo(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if "Buy-from Vendor No." <> '' then
- if Contact.Get("Buy-from Contact No.") then
- Contact.SetRange("Company No.", Contact."Company No.")
- else
- if ContactBusinessRelation.FindByRelation(ContactBusinessRelation."Link to Table"::Vendor, "Buy-from Vendor No.") then
- Contact.SetRange("Company No.", ContactBusinessRelation."Contact No.")
- else
- Contact.SetRange("No.", '');
-
- if "Buy-from Contact No." <> '' then
- if Contact.Get("Buy-from Contact No.") then;
- if Page.RunModal(0, Contact) = Action::LookupOK then begin
- xRec := Rec;
- CurrFieldNo := FieldNo("Buy-from Contact No.");
- Validate("Buy-from Contact No.", Contact."No.");
- exit(true);
- end;
- exit(false);
- end;
-
- ///
- /// Sends selected purchase document reports to the vendors. Before this procedure is called,
- /// purchase documents are selected on the page and then selection filter is used to filter the selected documents.
- ///
- ///
- /// Checks if the document has mixed drop shipment, selects a report from report selection based on the document type,
- /// shows profile selection window and then send the selected reports to the vendors.
- ///
- procedure SendRecords()
- var
- DocumentSendingProfile: Record "Document Sending Profile";
- ReportSelections: Record "Report Selections";
- DocTxt: Text[150];
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSendRecords(Rec, IsHandled);
- if IsHandled then
- exit;
-
- CheckMixedDropShipment();
- OnSendRecordsOnAfterCheckMixedDropShipment(Rec);
-
- GetReportSelectionsUsageFromDocumentType(ReportSelections.Usage, DocTxt);
-
- IsHandled := false;
- OnSendRecordsOnBeforeSendVendorRecords(ReportSelections.Usage, Rec, DocTxt, IsHandled);
- if not IsHandled then
- DocumentSendingProfile.SendVendorRecords(
- ReportSelections.Usage.AsInteger(), Rec, DocTxt, "Buy-from Vendor No.", "No.",
- FieldNo("Buy-from Vendor No."), FieldNo("No."));
- end;
-
- ///
- /// Prints selected purchase document reports. Before this procedure is called,
- /// purchase documents are selected on the page and then selection filter is used to filter the selected documents.
- ///
- ///
- /// Request window for the report will be displayed if true, otherwise the default settings are used.
- ///
- procedure PrintRecords(ShowRequestForm: Boolean)
- var
- DocumentSendingProfile: Record "Document Sending Profile";
- DummyReportSelections: Record "Report Selections";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforePrintRecords(Rec, ShowRequestForm, IsHandled);
- if IsHandled then
- exit;
-
- CheckMixedDropShipment();
- OnPrintRecordsOnAfterCheckMixedDropShipment(Rec);
-
- IsHandled := false;
- OnPrintRecordsOnBeforeTrySendToPrinterVendor(Rec, IsHandled, ShowRequestForm);
- if not IsHandled then
- DocumentSendingProfile.TrySendToPrinterVendor(
- DummyReportSelections.Usage::"P.Order".AsInteger(), Rec, FieldNo("Buy-from Vendor No."), ShowRequestForm);
- end;
-
- ///
- /// Sends a purchase order document report with a specified document sending profile.
- ///
- ///
- /// If the document has mixed drop shipments, error message is raised.
- ///
- ///
- /// Document sending profile that will be used to send the selected report to the vendor.
- ///
- procedure SendProfile(var DocumentSendingProfile: Record "Document Sending Profile")
- var
- ReportSelections: Record "Report Selections";
- IsHandled: Boolean;
- DocTxt: Text[150];
- begin
- IsHandled := false;
- OnBeforeSendProfile(Rec, DocumentSendingProfile, IsHandled);
- if IsHandled then
- exit;
-
- CheckMixedDropShipment();
- GetReportSelectionsUsageFromDocumentType(ReportSelections.Usage, DocTxt);
- IsHandled := false;
- OnSendProfileOnBeforeSendVendor(Rec, IsHandled);
- if not IsHandled then
- DocumentSendingProfile.SendVendor(
- ReportSelections.Usage.AsInteger(), Rec, "No.", "Buy-from Vendor No.",
- DocTxt, FieldNo("Buy-from Vendor No."), FieldNo("No."));
- end;
-
- local procedure CheckMixedDropShipment()
- begin
- if HasMixedDropShipment() then
- Error(MixedDropshipmentErr);
- end;
-
- local procedure HasMixedDropShipment() Result: Boolean
- var
- PurchaseLine: Record "Purchase Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeHasMixedDropShipment(Rec, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- PurchaseLine.SetRange("Document Type", "Document Type");
- PurchaseLine.SetRange("Document No.", "No.");
- PurchaseLine.SetFilter("No.", '<>%1', '');
- PurchaseLine.SetFilter(Type, '%1|%2', PurchaseLine.Type::Item, PurchaseLine.Type::"Fixed Asset");
- PurchaseLine.SetRange("Drop Shipment", true);
- if PurchaseLine.IsEmpty() then
- exit(false);
-
- PurchaseLine.SetRange("Drop Shipment", false);
- if PurchaseLine.FindSet() then
- repeat
- if PurchaseLine.IsInventoriableItem() or (PurchaseLine.Type = PurchaseLine.Type::"Fixed Asset") then
- exit(true);
- until PurchaseLine.Next() = 0;
-
- exit(false);
- end;
-
- local procedure SetDefaultPurchaser()
- var
- UserSetupPurchaserCode: Code[20];
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetDefaultPurchaser(Rec, IsHandled);
- if IsHandled then
- exit;
-
- UserSetupPurchaserCode := GetUserSetupPurchaserCode();
- if UserSetupPurchaserCode <> '' then
- if SalespersonPurchaser.Get(UserSetupPurchaserCode) then
- if not SalespersonPurchaser.VerifySalesPersonPurchaserPrivacyBlocked(SalespersonPurchaser) then
- Validate("Purchaser Code", UserSetupPurchaserCode);
- end;
-
- ///
- /// Retrieves the salesperson/purchaser code of the current user from the user setup.
- ///
- /// Salesperson/purchaser code of the current user from the user setup.
- procedure GetUserSetupPurchaserCode(): Code[20]
- var
- UserSetup: Record "User Setup";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetUserSetupPurchaserCode(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if not UserSetup.Get(UserId) then
- exit;
-
- exit(UserSetup."Salespers./Purch. Code");
- end;
-
- procedure InitPostingNoSeries()
- var
- PostingNoSeries: Code[20];
- begin
- GLSetup.GetRecordOnce();
- if GLSetup."Journal Templ. Name Mandatory" then begin
- if "Journal Templ. Name" = '' then begin
- if not IsCreditDocType() then
- GenJournalTemplate.Get(PurchSetup."P. Invoice Template Name")
- else
- GenJournalTemplate.Get(PurchSetup."P. Cr. Memo Template Name");
- "Journal Templ. Name" := GenJournalTemplate.Name;
- end else
- if GenJournalTemplate.Name = '' then
- GenJournalTemplate.Get("Journal Templ. Name");
- PostingNoSeries := GenJournalTemplate."Posting No. Series";
- end else
- if IsCreditDocType() then
- PostingNoSeries := PurchSetup."Posted Credit Memo Nos."
- else
- PostingNoSeries := PurchSetup."Posted Invoice Nos.";
-
- case "Document Type" of
- "Document Type"::Quote, "Document Type"::Order:
- begin
- if NoSeries.IsAutomatic(PostingNoSeries) then
- "Posting No. Series" := PostingNoSeries;
- if NoSeries.IsAutomatic(PurchSetup."Posted Receipt Nos.") then
- "Receiving No. Series" := PurchSetup."Posted Receipt Nos.";
- if "Document Type" = "Document Type"::Order then begin
- if NoSeries.IsAutomatic(PurchSetup."Posted Prepmt. Inv. Nos.") then
- "Prepayment No. Series" := PurchSetup."Posted Prepmt. Inv. Nos.";
- if NoSeries.IsAutomatic(PurchSetup."Posted Prepmt. Cr. Memo Nos.") then
- "Prepmt. Cr. Memo No. Series" := PurchSetup."Posted Prepmt. Cr. Memo Nos.";
- end;
- end;
- "Document Type"::Invoice:
- begin
- if ("No. Series" <> '') and (PurchSetup."Invoice Nos." = PostingNoSeries) then
- "Posting No. Series" := "No. Series"
- else
- if NoSeries.IsAutomatic(PostingNoSeries) then
- "Posting No. Series" := PostingNoSeries;
- if PurchSetup."Receipt on Invoice" then
- if NoSeries.IsAutomatic(PurchSetup."Posted Receipt Nos.") then
- "Receiving No. Series" := PurchSetup."Posted Receipt Nos.";
- end;
- "Document Type"::"Return Order":
- begin
- if NoSeries.IsAutomatic(PostingNoSeries) then
- "Posting No. Series" := PostingNoSeries;
- if NoSeries.IsAutomatic(PurchSetup."Posted Return Shpt. Nos.") then
- "Return Shipment No. Series" := PurchSetup."Posted Return Shpt. Nos.";
- end;
- "Document Type"::"Credit Memo":
- begin
- if ("No. Series" <> '') and (PurchSetup."Credit Memo Nos." = PostingNoSeries) then
- "Posting No. Series" := "No. Series"
- else
- if NoSeries.IsAutomatic(PostingNoSeries) then
- "Posting No. Series" := PostingNoSeries;
- if PurchSetup."Return Shipment on Credit Memo" then
- if NoSeries.IsAutomatic(PurchSetup."Posted Return Shpt. Nos.") then
- "Return Shipment No. Series" := PurchSetup."Posted Return Shpt. Nos.";
- end;
- end;
-
- OnAfterInitPostingNoSeries(Rec, xRec);
- end;
-
- local procedure SetShipToCodeEmpty()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetShipToCodeEmpty(Rec, IsHandled);
- if IsHandled then
- exit;
-
- Rec.Validate("Ship-to Code", '');
- end;
-
- ///
- /// Removes the filter from buy-from vendor no. if the number has changed
- /// Updates remittance address for the record if the default remit address for the vendor exists.
- ///
- /// Purchase header record after validation.
- /// Purchase header record before validation.
- procedure OnAfterValidateBuyFromVendorNo(var PurchaseHeader: Record "Purchase Header"; var xPurchaseHeader: Record "Purchase Header")
- begin
- if PurchaseHeader.GetFilter("Buy-from Vendor No.") = xPurchaseHeader."Buy-from Vendor No." then
- if PurchaseHeader."Buy-from Vendor No." <> xPurchaseHeader."Buy-from Vendor No." then
- PurchaseHeader.SetRange("Buy-from Vendor No.");
-
- SelectDefaultRemitAddress(PurchaseHeader);
- end;
-
- ///
- /// Sets the default remittance address on the provided purchase header.
- ///
- /// Return value: Purchase header to update.
- procedure SelectDefaultRemitAddress(var PurchaseHeader: Record "Purchase Header")
- var
- RemitAddress: Record "Remit Address";
- begin
- RemitAddress.SetRange("Vendor No.", PurchaseHeader."Buy-from Vendor No.");
- RemitAddress.SetRange(Default, true);
- if not RemitAddress.IsEmpty() then begin
- RemitAddress.FindFirst();
- PurchaseHeader.Validate("Remit-to Code", RemitAddress.Code);
- end;
- end;
-
- ///
- /// Raises a confirmation to update the deferral schedules on the lines to reflect the changed dates.
- /// If user confirms the update, the purchase lines are updated.
- ///
- ///
- /// If true, the purchase header's posting date will be replaced with the specified PostingDateReq.
- /// Posting date to replace.
- ///
- /// Vat reporting date to replace.
- procedure BatchConfirmUpdateDeferralDate(var BatchConfirm: Option " ",Skip,Update; ReplacePostingDate: Boolean; PostingDateReq: Date; ReplaceVATDate: Boolean; VATDateReq: Date)
- begin
- if ((not ReplacePostingDate) and (not ReplaceVATDate)) or (BatchConfirm = BatchConfirm::Skip) then
- exit;
- if (PostingDateReq = "Posting Date") and (VATDateReq = "VAT Reporting Date") then
- exit;
- if not DeferralHeadersExist() then
- exit;
-
- if ReplacePostingDate then
- "Posting Date" := PostingDateReq;
- if ReplaceVATDate then
- "VAT Reporting Date" := VATDateReq;
-
- case BatchConfirm of
- BatchConfirm::" ":
- begin
- ConfirmUpdateDeferralDate();
- if Confirmed then
- BatchConfirm := BatchConfirm::Update
- else
- BatchConfirm := BatchConfirm::Skip;
- end;
- BatchConfirm::Update:
- UpdatePurchLinesByFieldNo(PurchLine.FieldNo("Deferral Code"), false);
- end;
- Commit();
- end;
-
- procedure BatchConfirmUpdatePostingDate(ReplacePostingDate: Boolean; PostingDateReq: Date; ReplaceDocDate: Boolean)
- begin
- if not ReplacePostingDate then
- exit;
- if (PostingDateReq = "Posting Date") then
- exit;
- if DeferralHeadersExist() then
- exit;
-
- if ReplacePostingDate then begin
- "Posting Date" := PostingDateReq;
- Validate("Currency Code");
- end;
-
- if ReplacePostingDate and ReplaceDocDate and ("Document Date" <> PostingDateReq) then begin
- SetReplaceDocumentDate();
- Validate("Document Date", PostingDateReq);
- end;
-
- Commit();
- end;
-
- ///
- /// Sets the global flag SelectNoSeriesAllowed to true.
- ///
- ///
- /// The global flag is used to determine if the lookup for the number series can been shown.
- ///
- procedure SetAllowSelectNoSeries()
- begin
- SelectNoSeriesAllowed := true;
- end;
-
- local procedure ModifyPayToVendorAddress()
- var
- Vendor: Record Vendor;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeModifyPayToVendorAddress(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- GetPurchSetup();
- if PurchSetup."Ignore Updated Addresses" then
- exit;
- if IsCreditDocType() then
- exit;
- if ("Pay-to Vendor No." <> "Buy-from Vendor No.") and Vendor.Get("Pay-to Vendor No.") then
- if HasPayToAddress() and HasDifferentPayToAddress(Vendor) then
- ShowModifyAddressNotification(GetModifyPayToVendorAddressNotificationId(),
- ModifyVendorAddressNotificationLbl, ModifyVendorAddressNotificationMsg,
- 'CopyPayToVendorAddressFieldsFromSalesDocument', "Pay-to Vendor No.",
- "Pay-to Name", FieldName("Pay-to Vendor No."));
- end;
-
- local procedure ModifyVendorAddress()
- var
- Vendor: Record Vendor;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeModifyVendorAddress(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- GetPurchSetup();
- if PurchSetup."Ignore Updated Addresses" then
- exit;
- if IsCreditDocType() then
- exit;
- if Vendor.Get("Buy-from Vendor No.") and HasBuyFromAddress() and HasDifferentBuyFromAddress(Vendor) then
- ShowModifyAddressNotification(GetModifyVendorAddressNotificationId(),
- ModifyVendorAddressNotificationLbl, ModifyVendorAddressNotificationMsg,
- 'CopyBuyFromVendorAddressFieldsFromSalesDocument', "Buy-from Vendor No.",
- "Buy-from Vendor Name", FieldName("Buy-from Vendor No."));
- end;
-
- local procedure ShowModifyAddressNotification(NotificationID: Guid; NotificationLbl: Text; NotificationMsg: Text; NotificationFunctionTok: Text; VendorNumber: Code[20]; VendorName: Text[100]; VendorNumberFieldName: Text)
- var
- MyNotifications: Record "My Notifications";
- NotificationLifecycleMgt: Codeunit "Notification Lifecycle Mgt.";
- ModifyVendorAddressNotification: Notification;
- begin
- if not MyNotifications.IsEnabled(NotificationID) then
- exit;
-
- ModifyVendorAddressNotification.Id := NotificationID;
- ModifyVendorAddressNotification.Message := StrSubstNo(NotificationMsg, VendorName);
- ModifyVendorAddressNotification.AddAction(NotificationLbl, CODEUNIT::"Document Notifications", NotificationFunctionTok);
- ModifyVendorAddressNotification.AddAction(
- DontShowAgainActionLbl, CODEUNIT::"Document Notifications", 'HidePurchaseNotificationForCurrentUser');
- ModifyVendorAddressNotification.Scope := NOTIFICATIONSCOPE::LocalScope;
- ModifyVendorAddressNotification.SetData(FieldName("Document Type"), Format("Document Type"));
- ModifyVendorAddressNotification.SetData(FieldName("No."), "No.");
- ModifyVendorAddressNotification.SetData(VendorNumberFieldName, VendorNumber);
- NotificationLifecycleMgt.SendNotification(ModifyVendorAddressNotification, RecordId);
- end;
-
- ///
- /// Recalls a sent notification for the provided notification GUID.
- ///
- ///
- /// If it is a credit document or if notification isn't enabled, it won't recall the notification.
- ///
- /// GUID of the notification to recall.
- procedure RecallModifyAddressNotification(NotificationID: Guid)
- var
- MyNotifications: Record "My Notifications";
- ModifyVendorAddressNotification: Notification;
- begin
- if IsCreditDocType() or (not MyNotifications.IsEnabled(NotificationID)) then
- exit;
- ModifyVendorAddressNotification.Id := NotificationID;
- ModifyVendorAddressNotification.Recall();
- end;
-
- ///
- /// Returns a GUID for a notification that warns the user if the buy-from address on purchase documents is different
- /// from the vendor's existing address.
- ///
- /// Notification GUID.
- procedure GetModifyVendorAddressNotificationId(): Guid
- begin
- exit('CF3D0CD3-C54A-47D1-8A3F-57A6CCBA8DDE');
- end;
-
- ///
- /// Returns a GUID for a notification that warns if the pay-to address on purchase documents is different
- /// from the vendor's existing address.
- ///
- /// Notification GUID.
- procedure GetModifyPayToVendorAddressNotificationId(): Guid
- begin
- exit('16E45B3A-CB9F-4B2C-9F08-2BCE39E9E980');
- end;
-
- ///
- /// Returns a GUID for a notification that warns if purchase document with same external document number already exists.
- ///
- /// Notification GUID.
- procedure GetShowExternalDocAlreadyExistNotificationId(): Guid
- begin
- exit('D87F624C-D3BE-4E6B-A369-D18AE269181A');
- end;
-
- ///
- /// Returns a GUID for a notification that warns if the invoice discount amount for the purchase line record has been reset.
- ///
- /// Notification GUID.
- procedure GetLineInvoiceDiscountResetNotificationId(): Guid
- begin
- exit('3DC9C8BC-0512-4A49-B587-256C308EBCAA');
- end;
-
- ///
- /// Returns a GUID for a notification that warns before posting lines on purchase documents where quantity is 0.
- ///
- /// Notification GUID.
- procedure GetWarnWhenZeroQuantityPurchaseLinePosting(): Guid
- begin
- exit('68354b20-7f89-11ec-a8a3-0242ac120002');
- end;
-
- ///
- /// Inserts the default notification to warn if the buy-from address on purchase documents is different
- /// from the vendor's existing address.
- ///
- ///
- /// Notification is enabled by default.
- ///
- procedure SetModifyVendorAddressNotificationDefaultState()
- var
- MyNotifications: Record "My Notifications";
- begin
- MyNotifications.InsertDefault(GetModifyVendorAddressNotificationId(),
- ModifyBuyFromVendorAddressNotificationNameTxt, ModifyBuyFromVendorAddressNotificationDescriptionTxt, true);
- end;
-
- ///
- /// Inserts the default notification to warn if pay-to address on purchase documents is different
- /// from the vendor's existing address.
- ///
- ///
- /// Notification is enabled by default.
- ///
- procedure SetModifyPayToVendorAddressNotificationDefaultState()
- var
- MyNotifications: Record "My Notifications";
- begin
- MyNotifications.InsertDefault(GetModifyPayToVendorAddressNotificationId(),
- ModifyPayToVendorAddressNotificationNameTxt, ModifyPayToVendorAddressNotificationDescriptionTxt, true);
- end;
-
- ///
- /// Inserts the default notification to warn if purchase document with same external document number already exists.
- ///
- /// If true, the notification is enabled.
- procedure SetShowExternalDocAlreadyExistNotificationDefaultState(DefaultState: Boolean)
- var
- MyNotifications: Record "My Notifications";
- begin
- MyNotifications.InsertDefault(GetShowExternalDocAlreadyExistNotificationId(),
- ShowDocAlreadyExistNotificationNameTxt, ShowDocAlreadyExistNotificationDescriptionTxt, DefaultState);
- end;
-
- ///
- /// Disables a specified notification for the current user.
- ///
- /// GUID of the notification that needs to be disabled.
- procedure DontNotifyCurrentUserAgain(NotificationID: Guid)
- var
- MyNotifications: Record "My Notifications";
- begin
- if not MyNotifications.Disable(NotificationID) then
- case NotificationID of
- GetModifyVendorAddressNotificationId():
- MyNotifications.InsertDefault(NotificationID, ModifyBuyFromVendorAddressNotificationNameTxt,
- ModifyBuyFromVendorAddressNotificationDescriptionTxt, false);
- GetModifyPayToVendorAddressNotificationId():
- MyNotifications.InsertDefault(NotificationID, ModifyPayToVendorAddressNotificationNameTxt,
- ModifyPayToVendorAddressNotificationDescriptionTxt, false);
- end;
- end;
-
- local procedure HasDifferentBuyFromAddress(Vendor: Record Vendor) Result: Boolean
- begin
- Result := ("Buy-from Address" <> Vendor.Address) or
- ("Buy-from Address 2" <> Vendor."Address 2") or
- ("Buy-from City" <> Vendor.City) or
- ("Buy-from Country/Region Code" <> Vendor."Country/Region Code") or
- ("Buy-from County" <> Vendor.County) or
- ("Buy-from Post Code" <> Vendor."Post Code") or
- ("Buy-from Contact" <> Vendor.Contact);
- OnAfterHasDifferentBuyFromAddress(Rec, Vendor, Result);
- end;
-
- local procedure HasDifferentPayToAddress(Vendor: Record Vendor) Result: Boolean
- begin
- Result := ("Pay-to Address" <> Vendor.Address) or
- ("Pay-to Address 2" <> Vendor."Address 2") or
- ("Pay-to City" <> Vendor.City) or
- ("Pay-to Country/Region Code" <> Vendor."Country/Region Code") or
- ("Pay-to County" <> Vendor.County) or
- ("Pay-to Post Code" <> Vendor."Post Code") or
- ("Pay-to Contact" <> Vendor.Contact);
- OnAfterHasDifferentPayToAddress(Rec, Vendor, Result);
- end;
-
- ///
- /// Inserts the default notification to warn before posting lines on purchase documents where quantity is 0.
- ///
- ///
- /// Notification is enabled by default.
- ///
- procedure SetWarnZeroQuantityPurchasePosting()
- var
- MyNotifications: Record "My Notifications";
- begin
- MyNotifications.InsertDefault(GetWarnWhenZeroQuantityPurchaseLinePosting(),
- WarnZeroQuantityPostingTxt, WarnZeroQuantityPostingDescriptionTxt, true);
- end;
-
- ///
- /// Finds a posted purchase document for the provided external document no.
- ///
- /// Return value: Retrieved vendor ledger entry record.
- /// Document no. to find the posted document for.
- /// True if a document exists, otherwise false.
- procedure FindPostedDocumentWithSameExternalDocNo(var VendorLedgerEntry: Record "Vendor Ledger Entry"; ExternalDocumentNo: Code[35]): Boolean
- var
- VendorMgt: Codeunit "Vendor Mgt.";
- begin
- VendorMgt.SetFilterForExternalDocNo(
- VendorLedgerEntry, GetGenJnlDocumentType(), ExternalDocumentNo, "Pay-to Vendor No.", "Document Date");
- exit(VendorLedgerEntry.FindFirst())
- end;
-
- ///
- /// Applies the filter for the headers that have received lines.
- ///
- ///
- /// The purchase order is marked if it has any lines with a quantity received not equal to zero.
- ///
- procedure FilterPartialReceived()
- var
- PurchaseHeaderOriginal: Record "Purchase Header";
- ReceiveFilter: Text;
- IsMarked: Boolean;
- ReceiveValue: Boolean;
- begin
- ReceiveFilter := GetFilter(Receive);
- SetRange(Receive);
- Evaluate(ReceiveValue, ReceiveFilter);
-
- PurchaseHeaderOriginal := Rec;
- if FindSet() then
- repeat
- if not HasReceivedLines() then
- IsMarked := not ReceiveValue
- else
- IsMarked := ReceiveValue;
- Mark(IsMarked);
- until Next() = 0;
-
- Rec := PurchaseHeaderOriginal;
- MarkedOnly(true);
- end;
-
- ///
- /// Applies the filter for the headers that have partially invoiced lines.
- ///
- ///
- /// The purchase order is marked if it has any lines with a quantity invoiced not equal to zero.
- ///
- procedure FilterPartialInvoiced()
- var
- PurchaseHeaderOriginal: Record "Purchase Header";
- InvoiceFilter: Text;
- IsMarked: Boolean;
- InvoiceValue: Boolean;
- begin
- InvoiceFilter := GetFilter(Invoice);
- SetRange(Invoice);
- Evaluate(InvoiceValue, InvoiceFilter);
-
- PurchaseHeaderOriginal := Rec;
- if FindSet() then
- repeat
- if not HasInvoicedLines() then
- IsMarked := not InvoiceValue
- else
- IsMarked := InvoiceValue;
- Mark(IsMarked);
- until Next() = 0;
-
- Rec := PurchaseHeaderOriginal;
- MarkedOnly(true);
- end;
-
- local procedure HasReceivedLines(): Boolean
- var
- PurchaseLine: Record "Purchase Line";
- begin
- PurchaseLine.SetRange("Document Type", "Document Type");
- PurchaseLine.SetRange("Document No.", "No.");
- PurchaseLine.SetFilter("No.", '<>%1', '');
- PurchaseLine.SetFilter("Quantity Received", '<>%1', 0);
- exit(not PurchaseLine.IsEmpty);
- end;
-
- local procedure HasInvoicedLines(): Boolean
- var
- PurchaseLine: Record "Purchase Line";
- begin
- PurchaseLine.SetRange("Document Type", "Document Type");
- PurchaseLine.SetRange("Document No.", "No.");
- PurchaseLine.SetFilter("No.", '<>%1', '');
- PurchaseLine.SetFilter("Quantity Invoiced", '<>%1', 0);
- exit(not PurchaseLine.IsEmpty);
- end;
-
- local procedure ShowExternalDocAlreadyExistNotification(VendorLedgerEntry: Record "Vendor Ledger Entry")
- var
- NotificationLifecycleMgt: Codeunit "Notification Lifecycle Mgt.";
- InstructionMgt: Codeunit "Instruction Mgt.";
- DocAlreadyExistNotification: Notification;
- MyNotifications: Record "My Notifications";
- begin
- if not MyNotifications.IsEnabled(GetShowExternalDocAlreadyExistNotificationId()) then
- exit;
-
- InstructionMgt.CreateMissingMyNotificationsWithDefaultState(GetShowExternalDocAlreadyExistNotificationId());
-
- if not IsDocAlreadyExistNotificationEnabled() then
- exit;
-
- DocAlreadyExistNotification.Id := GetShowExternalDocAlreadyExistNotificationId();
- DocAlreadyExistNotification.Message :=
- StrSubstNo(PurchaseAlreadyExistsTxt, VendorLedgerEntry."Document Type", VendorLedgerEntry."External Document No.");
- DocAlreadyExistNotification.AddAction(ShowVendLedgEntryTxt, CODEUNIT::"Document Notifications", 'ShowVendorLedgerEntry');
- DocAlreadyExistNotification.Scope := NOTIFICATIONSCOPE::LocalScope;
- DocAlreadyExistNotification.SetData(FieldName("Document Type"), Format("Document Type"));
- DocAlreadyExistNotification.SetData(FieldName("No."), "No.");
- DocAlreadyExistNotification.SetData(VendorLedgerEntry.FieldName("Entry No."), Format(VendorLedgerEntry."Entry No."));
- NotificationLifecycleMgt.SendNotificationWithAdditionalContext(
- DocAlreadyExistNotification, RecordId, GetShowExternalDocAlreadyExistNotificationId());
- end;
-
- local procedure GetGenJnlDocumentType(): Enum "Gen. Journal Document Type"
- var
- RefGenJournalLine: Record "Gen. Journal Line";
- begin
- case "Document Type" of
- "Document Type"::"Blanket Order",
- "Document Type"::Quote,
- "Document Type"::Invoice,
- "Document Type"::Order:
- exit(RefGenJournalLine."Document Type"::Invoice);
- else
- exit(RefGenJournalLine."Document Type"::"Credit Memo");
- end;
- end;
-
- local procedure RecallExternalDocAlreadyExistsNotification()
- var
- NotificationLifecycleMgt: Codeunit "Notification Lifecycle Mgt.";
- begin
- if not IsDocAlreadyExistNotificationEnabled() then
- exit;
-
- NotificationLifecycleMgt.RecallNotificationsForRecordWithAdditionalContext(
- RecordId, GetShowExternalDocAlreadyExistNotificationId(), true);
- end;
-
- ///
- /// Determines if the notification which warns if purchase document with same external document number
- /// already exists is enabled.
- ///
- /// True if the notification is enabled, otherwise false.
- procedure IsDocAlreadyExistNotificationEnabled(): Boolean
- var
- InstructionMgt: Codeunit "Instruction Mgt.";
- begin
- exit(InstructionMgt.IsMyNotificationEnabled(GetShowExternalDocAlreadyExistNotificationId()));
- end;
-
- ///
- /// Determines if the ship-to information in the purchase header record matches the ship-to information
- /// in the company information.
- ///
- /// True if ship-to information is equal, otherwise false.
- procedure ShipToAddressEqualsCompanyShipToAddress(): Boolean
- var
- CompanyInformation: Record "Company Information";
- begin
- CompanyInformation.Get();
- exit(IsShipToAddressEqualToCompanyShipToAddress(Rec, CompanyInformation));
- end;
-
- local procedure IsShipToAddressEqualToCompanyShipToAddress(PurchaseHeader: Record "Purchase Header"; CompanyInformation: Record "Company Information") Result: Boolean
- begin
- Result :=
- (PurchaseHeader."Ship-to Address" = CompanyInformation."Ship-to Address") and
- (PurchaseHeader."Ship-to Address 2" = CompanyInformation."Ship-to Address 2") and
- (PurchaseHeader."Ship-to City" = CompanyInformation."Ship-to City") and
- (PurchaseHeader."Ship-to County" = CompanyInformation."Ship-to County") and
- (PurchaseHeader."Ship-to Post Code" = CompanyInformation."Ship-to Post Code") and
- (PurchaseHeader."Ship-to Country/Region Code" = CompanyInformation."Ship-to Country/Region Code") and
- (PurchaseHeader."Ship-to Name" = CompanyInformation."Ship-to Name") and
- (PurchaseHeader."Ship-to Phone No." = CompanyInformation."Ship-to Phone No.");
-
- OnAfterIsShipToAddressEqualToCompanyShipToAddress(Rec, CompanyInformation, Result);
- end;
-
- ///
- /// Determines if ship-to information is equal to the buy-from information in the purchase header record.
- ///
- /// True if the information is equal, otherwise false.
- procedure BuyFromAddressEqualsShipToAddress() Result: Boolean
- begin
- Result :=
- ("Ship-to Address" = "Buy-from Address") and
- ("Ship-to Address 2" = "Buy-from Address 2") and
- ("Ship-to City" = "Buy-from City") and
- ("Ship-to County" = "Buy-from County") and
- ("Ship-to Post Code" = "Buy-from Post Code") and
- ("Ship-to Country/Region Code" = "Buy-from Country/Region Code") and
- ("Ship-to Name" = "Buy-from Vendor Name");
-
- OnAfterBuyFromAddressEqualsShipToAddress(Rec, Result);
- end;
-
- ///
- /// Determines if buy-from information is equal to the pay-to information in the purchase header record.
- ///
- /// True if the information is equal, otherwise false.
- procedure BuyFromAddressEqualsPayToAddress() Result: Boolean
- begin
- Result :=
- ("Pay-to Address" = "Buy-from Address") and
- ("Pay-to Address 2" = "Buy-from Address 2") and
- ("Pay-to City" = "Buy-from City") and
- ("Pay-to County" = "Buy-from County") and
- ("Pay-to Post Code" = "Buy-from Post Code") and
- ("Pay-to Country/Region Code" = "Buy-from Country/Region Code") and
- ("Pay-to Contact No." = "Buy-from Contact No.") and
- ("Pay-to Contact" = "Buy-from Contact");
-
- OnAfterBuyFromAddressEqualsPayToAddress(Rec, Result);
- end;
-
- local procedure SetPurchaserCode(PurchaserCodeToCheck: Code[20]; var PurchaserCodeToAssign: Code[20])
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetPurchaserCode(Rec, PurchaserCodeToCheck, PurchaserCodeToAssign, IsHandled);
- if IsHandled then
- exit;
-
- if PurchaserCodeToCheck = '' then
- PurchaserCodeToCheck := GetUserSetupPurchaserCode();
- if SalespersonPurchaser.Get(PurchaserCodeToCheck) then begin
- if SalespersonPurchaser.VerifySalesPersonPurchaserPrivacyBlocked(SalespersonPurchaser) then
- PurchaserCodeToAssign := ''
- else
- PurchaserCodeToAssign := PurchaserCodeToCheck;
- end else
- PurchaserCodeToAssign := '';
- end;
-
- ///
- /// Checks if the document can be created/posted depending on the privacy blocked of the purchaser.
- ///
- /// Purchase header on which purchaser code has been changed.
- /// Determines if the check is completed during a write transaction.
- /// Determines if the check is completed during the posting.
- procedure ValidatePurchaserOnPurchHeader(PurchaseHeader2: Record "Purchase Header"; IsTransaction: Boolean; IsPostAction: Boolean)
- begin
- if PurchaseHeader2."Purchaser Code" <> '' then
- if SalespersonPurchaser.Get(PurchaseHeader2."Purchaser Code") then
- if SalespersonPurchaser.VerifySalesPersonPurchaserPrivacyBlocked(SalespersonPurchaser) then begin
- if IsTransaction then
- Error(
- ErrorInfo.Create(
- SalespersonPurchaser.GetPrivacyBlockedTransactionText(SalespersonPurchaser, IsPostAction, false),
- true,
- SalespersonPurchaser));
- if not IsTransaction then
- Error(
- ErrorInfo.Create(
- SalespersonPurchaser.GetPrivacyBlockedGenericText(SalespersonPurchaser, false),
- true,
- SalespersonPurchaser));
- end;
- end;
-
- local procedure GetReportSelectionsUsageFromDocumentType(var ReportSelectionsUsage: Enum "Report Selection Usage"; var DocTxt: Text[150])
- var
- ReportSelections: Record "Report Selections";
- ReportDistributionMgt: Codeunit "Report Distribution Management";
- ReportUsage: Option;
- begin
- DocTxt := ReportDistributionMgt.GetFullDocumentTypeText(Rec);
-
- case "Document Type" of
- "Document Type"::Order:
- ReportSelectionsUsage := ReportSelections.Usage::"P.Order";
- "Document Type"::Quote:
- ReportSelectionsUsage := ReportSelections.Usage::"P.Quote";
- "Document Type"::Invoice:
- ReportSelectionsUsage := ReportSelections.Usage::"P.Invoice";
- "Document Type"::"Credit Memo":
- ReportSelectionsUsage := ReportSelections.Usage::"P.Cr.Memo";
- "Document Type"::"Blanket Order":
- ReportSelectionsUsage := ReportSelections.Usage::"P.Blanket";
- "Document Type"::"Return Order":
- ReportSelectionsUsage := ReportSelections.Usage::"P.Return";
- end;
-
- ReportUsage := ReportSelectionsUsage.AsInteger();
- OnAfterGetReportSelectionsUsageFromDocumentType(Rec, ReportUsage, DocTxt);
- ReportSelectionsUsage := Enum::"Report Selection Usage".FromInteger(ReportUsage);
- end;
-
- ///
- /// Returns the value of the global variable SkipTaxCalculation.
- ///
- /// The value of the global variable SkipTaxCalculation.
- procedure CanCalculateTax(): Boolean
- begin
- exit(SkipTaxCalculation);
- end;
-
- ///
- /// Sets the value of the global variable SkipTaxCalculation.
- ///
- /// The new value to set.
- procedure SetSkipTaxCalulation(Skip: Boolean)
- begin
- SkipTaxCalculation := Skip;
- end;
-
- ///
- /// Resets the sell-to customer to an empty value and updates the location.
- /// from the global Vend record on the purchase header.
- ///
- ///
- /// Updates the global Vend with buy-from vendor no. of the purchase header.
- ///
- procedure ValidateEmptySellToCustomerAndLocation()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateEmptySellToCustomerAndLocation(Rec, Vend, IsHandled, xRec);
- if not IsHandled then begin
- Validate("Sell-to Customer No.", '');
-
- if "Buy-from Vendor No." <> '' then
- GetVend("Buy-from Vendor No.");
- UpdateLocationCode(Vend."Location Code");
- end;
-
- OnAfterValidateEmptySellToCustomerAndLocation(Rec, Vend);
- end;
-
- ///
- /// Checks if there are any blocked items or resources in the purchase lines of the purchase header.
- ///
- procedure CheckForBlockedLines()
- var
- CurrentPurchLine: Record "Purchase Line";
- Item: Record Item;
- ItemVariant: Record "Item Variant";
- Resource: Record Resource;
- begin
- CurrentPurchLine.SetCurrentKey("Document Type", "Document No.", Type);
- CurrentPurchLine.SetRange("Document Type", "Document Type");
- CurrentPurchLine.SetRange("Document No.", "No.");
- CurrentPurchLine.SetFilter(Type, '%1|%2', CurrentPurchLine.Type::Item, CurrentPurchLine.Type::Resource);
- CurrentPurchLine.SetFilter("No.", '<>''''');
- if "Document Type" = "Document Type"::"Blanket Order" then
- CurrentPurchLine.SetFilter("Qty. to Receive", '<>0');
-
- if CurrentPurchLine.FindSet() then
- repeat
- case CurrentPurchLine.Type of
- CurrentPurchLine.Type::Item:
- begin
- Item.Get(CurrentPurchLine."No.");
- Item.TestField(Blocked, false);
-
- if CurrentPurchLine."Variant Code" <> '' then begin
- ItemVariant.SetLoadFields(Blocked);
- ItemVariant.Get(CurrentPurchLine."No.", CurrentPurchLine."Variant Code");
- ItemVariant.TestField(Blocked, false);
- end
- end;
- CurrentPurchLine.Type::Resource:
- begin
- Resource.Get(CurrentPurchLine."No.");
- Resource.CheckResourcePrivacyBlocked(false);
- Resource.TestField(Blocked, false);
- end;
- end;
- until CurrentPurchLine.Next() = 0;
- end;
-
- ///
- /// Determines if purchase document status is not pending approval.
- ///
- /// True if status is not pending approval, otherwise false.
- procedure TestStatusIsNotPendingApproval() NotPending: Boolean;
- begin
- NotPending := Status <> Status::"Pending Approval";
-
- OnTestStatusIsNotPendingApproval(Rec, NotPending);
- end;
-
- ///
- /// Determines if purchase document status is not pending prepayment.
- ///
- /// True if status is not pending prepayment, otherwise false.
- procedure TestStatusIsNotPendingPrepayment() NotPending: Boolean;
- begin
- NotPending := Status <> Status::"Pending Prepayment";
-
- OnTestStatusIsNotPendingPrepayment(Rec, NotPending);
- end;
-
- ///
- /// Determines if purchase document status is not released.
- ///
- /// True if status is not released, otherwise false.
- procedure TestStatusIsNotReleased() NotReleased: Boolean;
- begin
- NotReleased := Status <> Status::Released;
-
- OnTestStatusIsNotReleased(Rec, NotReleased);
- end;
-
- ///
- /// Checks if purchase document status is open. If it is not, an error is raised.
- ///
- ///
- /// If global flag StatusCheckSuspended is set to true, the procedure is not executed.
- ///
- procedure TestStatusOpen()
- begin
- OnBeforeTestStatusOpen(Rec, xRec, CurrFieldNo);
-
- if StatusCheckSuspended then
- exit;
-
- TestField(Status, Status::Open);
-
- OnAfterTestStatusOpen();
- end;
-
- ///
- /// Sets the value of the global flag StatusCheckSuspended.
- ///
- ///
- /// The global flag is used to suspend the check if the document status is open.
- ///
- /// The new value to set.
- procedure SuspendStatusCheck(Suspend: Boolean)
- begin
- StatusCheckSuspended := Suspend;
- end;
-
- ///
- /// Updates the inbound warehouse handling time of the purchase header.
- ///
- ///
- /// If the purchase header's location code is empty,
- /// the inbound warehouse handling time is updated using the handling time from inventory setup.
- ///
- procedure UpdateInboundWhseHandlingTime()
- begin
- if "Location Code" = '' then begin
- if InvtSetup.Get() then
- "Inbound Whse. Handling Time" := InvtSetup."Inbound Whse. Handling Time";
- end else begin
- if Location.Get("Location Code") then;
- "Inbound Whse. Handling Time" := Location."Inbound Whse. Handling Time";
- end;
-
- OnAfterUpdateInboundWhseHandlingTime(Rec, CurrFieldNo);
- end;
-
- ///
- /// Returns the document type caption.
- ///
- /// Full text description of the document type field.
- procedure GetFullDocTypeTxt() FullDocTypeTxt: Text
- var
- IsHandled: Boolean;
- begin
- OnBeforeGetFullDocTypeTxt(Rec, FullDocTypeTxt, IsHandled);
-
- if IsHandled then
- exit;
-
- FullDocTypeTxt := SelectStr("Document Type".AsInteger() + 1, FullPurchaseTypesTxt);
- end;
-
- local procedure LookupPostCode(var City: Text[30]; var PCode: Code[20]; var County: Text[30]; var CountryRegionCode: Code[10]; CalledFromFieldNo: Integer)
- var
- xRecPurchaseHeader: Record "Purchase Header";
- begin
- xRecPurchaseHeader := Rec;
- PostCode.LookupPostCode(City, PCode, County, CountryRegionCode);
- OnLookupPostCode(CalledFromFieldNo, xRecPurchaseHeader, Rec);
- end;
-
- ///
- /// Runs the copy purchase document report for the purchase header.
- ///
- ///
- /// The report creates new purchase documents based on the existing one.
- ///
- procedure CopyDocument()
- var
- CopyPurchaseDocument: Report "Copy Purchase Document";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCopyDocument(Rec, IsHandled);
- if IsHandled then
- exit;
-
- CopyPurchaseDocument.SetPurchHeader(Rec);
- CopyPurchaseDocument.RunModal();
- end;
-
- local procedure CheckContactRelatedToVendorCompany(ContactNo: Code[20]; VendorNo: Code[20]; CurrFieldNo: Integer);
- var
- Contact: Record Contact;
- ContactBusinessRelation: Record "Contact Business Relation";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckContactRelatedToVendorCompany(Rec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- Contact.Get(ContactNo);
- if ContactBusinessRelation.FindByRelation(Enum::"Contact Business Relation Link to Table"::Vendor, VendorNo) then
- if (ContactBusinessRelation."Contact No." <> Contact."Company No.") and (ContactBusinessRelation."Contact No." <> Contact."No.") then
- Error(Text038, Contact."No.", Contact.Name, VendorNo);
- end;
-
- local procedure CheckBlockedVendOnDocs(Vend: Record Vendor)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckBlockedVendOnDocs(Rec, xRec, Vend, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- Vend.CheckBlockedVendOnDocs(Vend, false);
- end;
-
- ///
- /// Opens vendor lookup page to select a vendor. Buy-from vendor name field is updated with the selected vendor name.
- ///
- /// Return value: Selected vendor name.
- /// True if vendor is selected, otherwise false.
- procedure LookupBuyFromVendorName(var VendorName: Text): Boolean
- var
- Vendor: Record Vendor;
- LookupStateManager: Codeunit "Lookup State Manager";
- RecVariant: Variant;
- SearchVendorName: Text;
- begin
- SearchVendorName := VendorName;
- Vendor.SetFilter("Date Filter", GetFilter("Date Filter"));
- if "Buy-from Vendor No." <> '' then
- Vendor.Get("Buy-from Vendor No.");
-
- if Vendor.SelectVendor(Vendor) then begin
- if Rec."Buy-from Vendor Name" = Vendor.Name then
- VendorName := SearchVendorName
- else
- VendorName := Vendor.Name;
- RecVariant := Vendor;
- LookupStateManager.SaveRecord(RecVariant);
- exit(true);
- end;
- end;
-
- ///
- /// Opens vendor lookup page to select a vendor. Pay-to name field is updated with the selected vendor name.
- ///
- /// Return value: Selected vendor name.
- /// True if vendor is selected, otherwise false.
- procedure LookupPayToVendorName(var VendorName: Text): Boolean
- var
- Vendor: Record Vendor;
- LookupStateManager: Codeunit "Lookup State Manager";
- RecVariant: Variant;
- SearchVendorName: Text;
- begin
- SearchVendorName := VendorName;
- Vendor.SetFilter("Date Filter", GetFilter("Date Filter"));
- if "Pay-to Vendor No." <> '' then
- Vendor.Get("Pay-To Vendor No.");
-
- if Vendor.SelectVendor(Vendor) then begin
- if Rec."Pay-To Name" = Vendor.Name then
- VendorName := SearchVendorName
- else
- VendorName := Vendor.Name;
- RecVariant := Vendor;
- LookupStateManager.SaveRecord(RecVariant);
- exit(true);
- end;
- end;
-
- local procedure CheckVendorPostingGroupChange()
- var
- PayToVendor: Record Vendor;
- PostingGroupChangeInterface: Interface "Posting Group Change Method";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckVendorPostingGroupChange(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if ("Vendor Posting Group" <> xRec."Vendor Posting Group") and (xRec."Vendor Posting Group" <> '') then begin
- TestField("Pay-to Vendor No.");
- PayToVendor.Get("Pay-to Vendor No.");
- GetPurchSetup();
- if PurchSetup."Allow Multiple Posting Groups" then begin
- PayToVendor.TestField("Allow Multiple Posting Groups");
- PostingGroupChangeInterface := PurchSetup."Check Multiple Posting Groups";
- PostingGroupChangeInterface.ChangePostingGroup("Vendor Posting Group", xRec."Vendor Posting Group", Rec);
- end;
- end;
- end;
-
- ///
- /// Collects all purchase lines of the document into a temporary record set.
- ///
- ///
- /// If the purchase line's nonstock flag is true, it's set to false upon recreation on the actual line.
- ///
- /// Return value: Created temporary purchase line record set.
- procedure RecreateTempPurchLines(var TempPurchLine: Record "Purchase Line")
- begin
- repeat
- TestPurchLineFieldsBeforeRecreate();
- TempPurchLine := PurchLine;
- if PurchLine.Nonstock then begin
- PurchLine.Nonstock := false;
- PurchLine.Modify();
- end;
- OnRecreatePurchLinesOnBeforeTempPurchLineInsert(TempPurchLine, PurchLine);
- if not IsServiceChargeLine(PurchLine) then
- TempPurchLine.Insert();
- OnRecreateTempPurchLinesOnAfterTempPurchLineInsert(Rec, PurchLine, TempPurchLine);
- until PurchLine.Next() = 0;
- end;
-
- local procedure IsServiceChargeLine(PurchLine: Record "Purchase Line"): Boolean
- begin
- if PurchLine."System-Created Entry" then
- if PurchLine.Type = PurchLine.Type::"G/L Account" then
- if PurchLine.IsServiceCharge() then
- exit(true);
- end;
-
- local procedure TestPurchLineFieldsBeforeRecreate()
- var
- SalesHeader: Record "Sales Header";
- MatchedOrderLineMgmt: Codeunit "Matched Order Line Mgmt.";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeTestPurchLineFieldsBeforeRecreate(Rec, PurchLine, IsHandled);
- if IsHandled then
- exit;
-
- PurchLine.TestField("Quantity Received", 0);
- PurchLine.TestField("Quantity Invoiced", 0);
- PurchLine.TestField("Return Qty. Shipped", 0);
- PurchLine.CalcFields("Reserved Qty. (Base)");
- PurchLine.TestField("Reserved Qty. (Base)", 0);
- PurchLine.TestField("Receipt No.", '');
- MatchedOrderLineMgmt.IsLineMatched(PurchLine, true);
-
- PurchLine.TestField("Return Shipment No.", '');
- PurchLine.TestField("Blanket Order No.", '');
- IsHandled := false;
- OnRecreatePurchLinesOnDropShipmentSpecialOrder(PurchLine, IsHandled);
- if not IsHandled then
- if PurchLine."Drop Shipment" or PurchLine."Special Order" then begin
- case true of
- PurchLine."Drop Shipment":
- SalesHeader.Get(SalesHeader."Document Type"::Order, PurchLine."Sales Order No.");
- PurchLine."Special Order":
- SalesHeader.Get(SalesHeader."Document Type"::Order, PurchLine."Special Order Sales No.");
- end;
- TestField("Sell-to Customer No.", SalesHeader."Sell-to Customer No.");
- CheckShipToCode(SalesHeader."Ship-to Code");
- end;
-
- PurchLine.TestField("Prepmt. Amt. Inv.", 0);
- end;
-
- ///
- /// Deletes all purchase comment lines.
- ///
- procedure DeletePurchCommentLines()
- var
- PurchCommentLine: Record "Purch. Comment Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeDeletePurchCommentLines(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- PurchCommentLine.DeleteComments("Document Type".AsInteger(), "No.");
- end;
-
- ///
- /// Delets all lines in the provided record set.
- ///
- ///
- /// This procedure uses DeleteAll, if the record set is not filtered correctly, all purchase lines will be deleted.
- ///
- /// Filtered purchase line record set to delete the lines from.
- procedure DeletePurchLines(var PurchLine: Record "Purchase Line")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeDeletePurchLines(Rec, xRec, PurchLine, IsHandled);
- if IsHandled then
- exit;
-
- PurchLine.DeleteAll(true);
- end;
-
- ///
- /// Returns the value of the global flag CalledFromWhseDoc.
- ///
- /// The value of the global flag CalledFromWhseDoc.
- procedure GetCalledFromWhseDoc(): Boolean
- begin
- exit(CalledFromWhseDoc);
- end;
-
- ///
- /// Sets the value of the global flag CalledFromWhseDoc.
- ///
- /// The new value to set.
- procedure SetCalledFromWhseDoc(NewCalledFromWhseDoc: Boolean)
- begin
- CalledFromWhseDoc := NewCalledFromWhseDoc;
- end;
-
- ///
- /// Sets the value of the global flag ReplaceDocumentDate to true.
- ///
- procedure SetReplaceDocumentDate()
- begin
- ReplaceDocumentDate := true;
- end;
-
- local procedure UpdatePrepmtAmounts(var PurchaseLine: Record "Purchase Line")
- var
- Currency: Record Currency;
- begin
- Currency.Initialize("Currency Code");
- if "Document Type" = "Document Type"::Order then begin
- PurchaseLine."Prepmt. Line Amount" := Round(
- PurchaseLine."Line Amount" * PurchaseLine."Prepayment %" / 100, Currency."Amount Rounding Precision");
- if Abs(PurchaseLine."Inv. Discount Amount" + PurchaseLine."Prepmt. Line Amount") > Abs(PurchaseLine."Line Amount") then
- PurchaseLine."Prepmt. Line Amount" := PurchaseLine."Line Amount" - PurchaseLine."Inv. Discount Amount";
- end;
- end;
-
- ///
- /// Returns the posting date from purchase header if it's available, otherwise it returns the current work date.
- ///
- /// Document's posting date or work date.
- procedure GetUseDate(): Date
- begin
- if "Posting Date" = 0D then
- exit(WorkDate());
-
- exit("Posting Date");
- end;
-
- local procedure CreateDimensionsFromValidatePayToVendorNo()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateDimensionsFromValidatePayToVendorNo(Rec, IsHandled);
- if IsHandled then
- exit;
-
- CreateDimFromDefaultDim(Rec.FieldNo("Pay-to Vendor No."));
- end;
-
- ///
- /// Initializes the dimensions for the document from default dimensions for the related entry specified in the field.
- ///
- /// The field number for which to initialize the dimensions.
- procedure CreateDimFromDefaultDim(FieldNo: Integer)
- var
- DefaultDimSource: List of [Dictionary of [Integer, Code[20]]];
- begin
- InitDefaultDimensionSources(DefaultDimSource, FieldNo);
- CreateDim(DefaultDimSource);
- end;
-
- local procedure InitDefaultDimensionSources(var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; FieldNo: Integer)
- begin
- DimMgt.AddDimSource(DefaultDimSource, Database::Vendor, Rec."Pay-to Vendor No.", FieldNo = Rec.FieldNo("Pay-to Vendor No."));
- DimMgt.AddDimSource(DefaultDimSource, Database::"Salesperson/Purchaser", Rec."Purchaser Code", FieldNo = Rec.FieldNo("Purchaser Code"));
- DimMgt.AddDimSource(DefaultDimSource, Database::Campaign, Rec."Campaign No.", FieldNo = Rec.FieldNo("Campaign No."));
- DimMgt.AddDimSource(DefaultDimSource, Database::"Responsibility Center", Rec."Responsibility Center", FieldNo = Rec.FieldNo("Responsibility Center"));
- DimMgt.AddDimSource(DefaultDimSource, Database::"Vendor Templ.", Rec."Pay-to Vendor Templ. Code", FieldNo = Rec.FieldNo("Pay-to Vendor Templ. Code"));
- DimMgt.AddDimSource(DefaultDimSource, Database::Location, Rec."Location Code", FieldNo = Rec.FieldNo("Location Code"));
-
- OnAfterInitDefaultDimensionSources(Rec, DefaultDimSource, FieldNo);
- end;
-
- local procedure ShouldCheckShowRecurringSalesLines(var xHeader: Record "Purchase Header"; var Header: Record "Purchase Header"): Boolean
- begin
- exit(
- (xHeader."Pay-to Vendor No." <> '') and
- (Header."No." <> '') and
- (Header."Currency Code" <> xHeader."Currency Code")
- );
- end;
-
- ///
- /// Determines if the purchase lines of the purchase header are editable
- /// based on whether a buy-from vendor no. has been specified.
- ///
- /// True if purchase lines are editable, otherwise false.
- procedure PurchaseLinesEditable() IsEditable: Boolean;
- begin
- if "Document Type" = "Document Type"::Quote then
- IsEditable := (Rec."Buy-from Vendor No." <> '') or (Rec."Buy-from Vendor Templ. Code" <> '') or (Rec."Buy-from Contact No." <> '') or (Rec.GetFilter("Buy-from Contact No.") <> '')
- else
- IsEditable := Rec."Buy-from Vendor No." <> '';
-
- OnAfterPurchaseLinesEditable(Rec, IsEditable);
- end;
-
- internal procedure GetQtyReservedFromStockState() Result: Enum "Reservation From Stock"
- var
- PurchLineReserve: Codeunit "Purch. Line-Reserve";
- QtyReservedFromStock: Decimal;
- begin
- QtyReservedFromStock := PurchLineReserve.GetReservedQtyFromInventory(Rec);
- if QtyReservedFromStock = 0 then
- exit(Result::None);
-
- if QtyReservedFromStock = CalculateReservableOutstandingQuantityBase() then
- exit(Result::Full);
-
- exit(Result::Partial);
- end;
-
- local procedure CalculateReservableOutstandingQuantityBase() OutstandingQtyBase: Decimal
- var
- RemQtyBaseInvtItemPurchaseLine: Query RemQtyBaseInvtItemPurchaseLine;
- begin
- RemQtyBaseInvtItemPurchaseLine.SetPurchaseLineFilter(Rec);
- if RemQtyBaseInvtItemPurchaseLine.Open() then
- if RemQtyBaseInvtItemPurchaseLine.Read() then
- OutstandingQtyBase := RemQtyBaseInvtItemPurchaseLine.Outstanding_Qty___Base_;
- RemQtyBaseInvtItemPurchaseLine.Close();
- end;
-
- ///
- /// Checks if there are unpaid prepayment invoices for the purchase document and raise an error if there are.
- ///
- procedure TestPurchasePrepayment()
- var
- PrepaymentMgt: Codeunit "Prepayment Mgt.";
- begin
- if PrepaymentMgt.TestPurchasePrepayment(Rec) then
- Error(PrepaymentInvoicesNotPaidErr, Rec."Document Type", Rec."No.");
- end;
-
- local procedure FindSuggestedPurchLine(var PurchaseLine: Record "Purchase Line"): Boolean
- begin
- PurchaseLine.Reset();
- PurchaseLine.SetRange("Document Type", "Document Type");
- PurchaseLine.SetRange("Document No.", "No.");
- PurchaseLine.SetFilter("VAT %", '<>%1', 0);
- if PurchaseLine.FindFirst() then
- exit(true);
- PurchaseLine.SetFilter(Type, '<>%1', PurchLine.Type::" ");
- exit(PurchaseLine.FindFirst())
- end;
-
- ///
- /// Calculates the VAT Amount of the Purchase Header that is entered.
- ///
- /// The field "Doc. Amount Incl. VAT of the Purchase Header".
- /// The total VAT amount of all the purchase lines
- /// The rounding precision of the Currency of the Purchase Header"
- /// VAT Amount of the Purchase Header.
- procedure CalcDocAmountVAT(DocAmountInclVAT: Decimal; VATAmount: Decimal; TotalPurchLineAmtInclVAT: Decimal; CurrencyAmtRoundingPrecision: Decimal): Decimal
- begin
- if TotalPurchLineAmtInclVAT <> 0 then
- exit(Round(DocAmountInclVAT * VATAmount / TotalPurchLineAmtInclVAT, CurrencyAmtRoundingPrecision));
-
- exit(0);
- end;
-
- local procedure CheckDifferenceInclVAT(HeaderDocAmountVAT: Decimal; LineDocAmountVAT: Decimal; Currency: Record Currency): Boolean
- var
- PurchasePayablesSetup: Record "Purchases & Payables Setup";
- TotalVATDifference: Decimal;
- begin
- PurchasePayablesSetup.Get();
-
- if HeaderDocAmountVAT = LineDocAmountVAT then
- exit(false);
-
- if PurchasePayablesSetup."Allow VAT Difference" then begin
- TotalVATDifference := Abs(HeaderDocAmountVAT) - Abs(LineDocAmountVAT);
- if Abs(TotalVATDifference) > Currency."Max. VAT Difference Allowed" then
- exit(true)
- end else
- exit(true);
- end;
-
- local procedure UpdateDocAmountVAT(DocAmountInclVAT: Decimal; VATAmount: Decimal; TotalPurchLineAmtInclVAT: Decimal; CurrencyAmtRoundingPrecision: Decimal)
- begin
- "Doc. Amount VAT" := CalcDocAmountVAT(DocAmountInclVAT, VATAmount, TotalPurchLineAmtInclVAT, CurrencyAmtRoundingPrecision);
- end;
-
- procedure SendICPurchaseDoc(var PurchaseHeader: Record "Purchase Header")
- var
- ICInOutboxMgt: Codeunit ICInboxOutboxMgt;
- begin
- if PurchaseHeader.FindSet() then
- repeat
- if ApprovalsMgmt.PrePostApprovalCheckPurch(PurchaseHeader) then
- ICInOutboxMgt.SendPurchDoc(PurchaseHeader, false);
- until PurchaseHeader.Next() = 0;
- end;
-
- procedure UpdatePurchaseOrderLineIfExist()
- var
- PurchaseCrMemoHeader: Record "Purch. Cr. Memo Hdr.";
- CorrectPostedPurchInvoice: Codeunit "Correct Posted Purch. Invoice";
- IsHandled: Boolean;
- begin
- PurchaseCrMemoHeader.SetLoadFields("Pre-Assigned No.");
- PurchaseCrMemoHeader.SetRange("Pre-Assigned No.", Rec."No.");
- if not PurchaseCrMemoHeader.FindFirst() then
- exit;
-
- IsHandled := false;
- OnBeforeUpdatePurchaseOrderLineIfExist(Rec, IsHandled);
- if IsHandled then
- exit;
-
- CorrectPostedPurchInvoice.UpdatePurchaseOrderLineIfExist(PurchaseCrMemoHeader."No.");
- end;
-
- ///
- /// Retrieves the company contact associated with the provided contact.
- ///
- /// The contact record to get the associated company contact for.
- /// Return value: associated company contact.
- /// True if company contact was found, otherwise false.
- protected procedure GetContactAsCompany(Contact: Record Contact; var SearchContact: Record Contact): Boolean;
- begin
- if Contact."Company No." <> '' then
- exit(SearchContact.Get(Contact."Company No."));
- end;
-
- ///
- /// Checks if buy-from and pay-to vendor numbers are filled. If not, it creates vendors based on the associated
- /// contact and vendor template, and assigns the new vendor number to the document.
- ///
- ///
- /// The transaction is committed after each vendor record is created.
- /// Procedure are used in release purchase quote or make order from quote processes.
- ///
- /// If set to true, a confirmation dialog to create a vendor will be shown, otherwise not.
- /// True if buy-from and pay-to vendor numbers are filled, otherwise false.
- internal procedure CheckVendorCreated(Prompt: Boolean): Boolean
- var
- Cont: Record Contact;
- ConfirmManagement: Codeunit "Confirm Management";
- begin
- if ("Pay-to Vendor No." <> '') and ("Buy-from Vendor No." <> '') then
- exit(true);
-
- if Prompt then
- if not ConfirmManagement.GetResponseOrDefault(CreateVendorQst, true) then
- exit(false);
-
- if "Buy-from Vendor No." = '' then begin
- TestField("Buy-from Contact No.");
- TestField("Buy-from Vendor Templ. Code");
- GetContact(Cont, "Buy-from Contact No.");
-
- CreateVendorFromBuyFromVendorTemplate(Cont);
- Commit();
- Get("Document Type"::Quote, "No.");
- end;
-
- if "Pay-to Vendor No." = '' then begin
- TestField("Pay-to Contact No.");
- TestField("Pay-to Vendor Templ. Code");
- GetContact(Cont, "Pay-to Contact No.");
-
- CreateVendorFromPayToVendorTemplate(Cont);
- Commit();
- Get("Document Type"::Quote, "No.");
- end;
-
- exit(("Pay-to Vendor No." <> '') and ("Buy-from Vendor No." <> ''));
- end;
-
- ///
- /// Opens a page for selecting a vendor template to use for creating a new vendor.
- ///
- ///
- /// If Buy-from contact has no business relations a confirmation for template selection is raised.
- /// If the user confirms, it commits any changes
- /// and returns the code of the new vendor template selected by the user.
- ///
- /// Vendor template code.
- internal procedure SelectPurchaseHeaderNewVendorTemplate(): Code[20]
- var
- Contact: Record Contact;
- ConfirmManagement: Codeunit "Confirm Management";
- begin
- Contact.Get("Buy-from Contact No.");
- if (Contact.Type = Contact.Type::Person) and (Contact."Company No." <> '') then
- Contact.Get(Contact."Company No.");
-
- if not Contact.ContactToVendBusinessRelationExist() then
- if ConfirmManagement.GetResponse(SelectVendorTemplateQst, false) then begin
- Commit();
-
- exit(Contact.LookupNewVendorTemplate());
- end;
- end;
-
- local procedure CreateVendorFromBuyFromVendorTemplate(Contact: Record Contact)
- begin
- Contact.CreateVendorFromTemplate("Buy-from Vendor Templ. Code");
- end;
-
- local procedure CreateVendorFromPayToVendorTemplate(Contact: Record Contact)
- begin
- Contact.CreateVendorFromTemplate("Pay-to Vendor Templ. Code");
- end;
-
- local procedure UpdateBuyFromVendContact(Vendor: Record Vendor; Contact: Record Contact)
- begin
- if (Contact.Type = Contact.Type::Company) and Vendor.Get("Buy-from Vendor No.") then
- "Buy-from Contact" := Vendor.Contact
- else
- if Contact.Type = Contact.Type::Company then
- "Buy-from Contact" := ''
- else
- "Buy-from Contact" := Contact.Name;
- end;
-
- local procedure InitFromTemplate(TemplateCode: Code[20]; TemplateCaption: Text): Boolean
- var
- PurchaseLine: Record "Purchase Line";
- begin
- PurchaseLine.Reset();
- PurchaseLine.SetRange("Document Type", "Document Type");
- PurchaseLine.SetRange("Document No.", "No.");
- if TemplateCode = '' then begin
- if not PurchaseLine.IsEmpty() then
- Error(Text005, TemplateCaption);
-
- Init();
- GetPurchSetup();
- "No. Series" := xRec."No. Series";
- InitRecord();
- InitNoSeries();
-
- exit(true);
- end;
- end;
-
- local procedure CopyFromNewBuyFromVendorTemplate(BuyFromVendorTemplate: Record "Vendor Templ.")
- begin
- if not ApplicationAreaMgmt.IsSalesTaxEnabled() then
- BuyFromVendorTemplate.TestField("Gen. Bus. Posting Group");
-
- "Gen. Bus. Posting Group" := BuyFromVendorTemplate."Gen. Bus. Posting Group";
- "VAT Bus. Posting Group" := BuyFromVendorTemplate."VAT Bus. Posting Group";
- if "Pay-to Vendor No." = '' then
- Validate("Pay-to Vendor Templ. Code", "Buy-from Vendor Templ. Code");
- end;
-
- local procedure InitFromPayToVendorTemplate(PayToVendorTemplate: Record "Vendor Templ.")
- begin
- PayToVendorTemplate.TestField("Vendor Posting Group");
- "Vendor Posting Group" := PayToVendorTemplate."Vendor Posting Group";
- "Invoice Disc. Code" := PayToVendorTemplate."Invoice Disc. Code";
- Validate("Payment Terms Code", PayToVendorTemplate."Payment Terms Code");
- Validate("Payment Method Code", PayToVendorTemplate."Payment Method Code");
- "Prices Including VAT" := PayToVendorTemplate."Prices Including VAT";
- "Shipment Method Code" := PayToVendorTemplate."Shipment Method Code";
- end;
-
- local procedure GetContact(var Contact: Record Contact; ContactNo: Code[20])
- begin
- Contact.Get(ContactNo);
- if (Contact.Type = Contact.Type::Person) and (Contact."Company No." <> '') then
- Contact.Get(Contact."Company No.");
- end;
-
- local procedure EnsureDocumentTypeIsQuote()
- begin
- Rec.TestField("Document Type", "Document Type"::Quote);
- end;
-
- local procedure UpdateBuyFromVendorTemplateCode()
- begin
- if ("Document Type" = "Document Type"::Quote) and ("Buy-from Vendor No." = '') and ("Buy-from Vendor Templ. Code" = '') and (GetFilterContNo() = '') then
- Validate("Buy-from Vendor Templ. Code", SelectPurchaseHeaderNewVendorTemplate());
- end;
-
- local procedure GetFilterContNo(): Code[20]
- begin
- if GetFilter("Buy-from Contact No.") <> '' then
- if GetRangeMin("Buy-from Contact No.") = GetRangeMax("Buy-from Contact No.") then
- exit(GetRangeMax("Buy-from Contact No."));
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitDefaultDimensionSources(var PurchaseHeader: Record "Purchase Header"; var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; FieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterHasDifferentBuyFromAddress(var PurchaseHeader: Record "Purchase Header"; Vendor: Record Vendor; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterHasDifferentPayToAddress(var PurchaseHeader: Record "Purchase Header"; Vendor: Record Vendor; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetFullDocTypeTxt(var PurchaseHeader: Record "Purchase Header"; var FullDocTypeTxt: Text; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeGetNoSeriesCode(PurchSetup: Record "Purchases & Payables Setup"; var NoSeriesCode: Code[20]; var IsHandled: Boolean; var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetNextArchiveDocOccurrenceNo(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetPostingNoSeriesCode(var PurchaseHeader: Record "Purchase Header"; PurchasesPayablesSetup: Record "Purchases & Payables Setup"; var PostingNos: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterAddShipToAddress(var PurchaseHeader: Record "Purchase Header"; SalesHeader: Record "Sales Header"; ShowError: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterAddSpecialOrderToAddress(var PurchaseHeader: Record "Purchase Header"; SalesHeader: Record "Sales Header"; ShowError: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnAfterCopyAddressInfoFromOrderAddress(var OrderAddress: Record "Order Address"; var PurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCouldDimensionsBeKept(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitRecord(var PurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitNoSeries(var PurchHeader: Record "Purchase Header"; xPurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterChangePricesIncludingVAT(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckBuyFromVendor(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; Vendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckPayToVendor(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; Vendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterConfirmPurchPrice(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyBuyFromVendorFieldsFromVendor(var PurchaseHeader: Record "Purchase Header"; Vendor: Record Vendor; xPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPayToVendorFieldsFromVendor(var PurchaseHeader: Record "Purchase Header"; Vendor: Record Vendor; xPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyBuyFromVendorAddressFieldsFromVendor(var PurchaseHeader: Record "Purchase Header"; BuyFromVendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPayToVendorAddressFieldsFromVendor(var PurchaseHeader: Record "Purchase Header"; PayToVendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyShipToVendorAddressFieldsFromVendor(var PurchaseHeader: Record "Purchase Header"; BuyFromVendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterRecreatePurchLine(var PurchLine: Record "Purchase Line"; var TempPurchLine: Record "Purchase Line" temporary; var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterDeleteAllTempPurchLines(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterIsApprovedForPosting(PurchaseHeader: Record "Purchase Header"; var Approved: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterIsApprovedForPostingBatch(PurchaseHeader: Record "Purchase Header"; var Approved: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetNoSeriesCode(var PurchHeader: Record "Purchase Header"; PurchSetup: Record "Purchases & Payables Setup"; var NoSeriesCode: Code[20])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetPostingNoSeriesCode(PurchaseHeader: Record "Purchase Header"; var PostingNos: Code[20])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetPrepaymentPostingNoSeriesCode(PurchaseHeader: Record "Purchase Header"; var PostingNos: Code[20])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetPurchSetup(PurchaseHeader: Record "Purchase Header"; var PurchasesPayablesSetup: Record "Purchases & Payables Setup"; CalledByFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetReportSelectionsUsageFromDocumentType(PurchaseHeader: Record "Purchase Header"; var ReportSelectionsUsage: Option; var DocTxt: Text[150]);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetStatusStyleText(PurchaseHeader: Record "Purchase Header"; var StatusStyleText: Text)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetBuyFromVendorFromFilter(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetSecurityFilterOnRespCenter(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetShipToForSpecOrder(var PurchaseHeader: Record "Purchase Header"; Location: Record Location; CompanyInformation: Record "Company Information")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterPurchaseLinesEditable(PurchaseHeader: Record "Purchase Header"; var IsEditable: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterTestNoSeries(var PurchHeader: Record "Purchase Header"; PurchSetup: Record "Purchases & Payables Setup")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterTransferSavedFields(var DestinationPurchaseLine: Record "Purchase Line"; SourcePurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnTransferSavedFieldsOnAfterSetVariantCode(var DestinationPurchaseLine: Record "Purchase Line"; SourcePurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateBuyFromVend(var PurchaseHeader: Record "Purchase Header"; Contact: Record Contact)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateBuyFromCont(var PurchaseHeader: Record "Purchase Header"; Vendor: Record Vendor; Contact: Record Contact)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdatePayToAddressFromBuyFromAddress(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; FieldNumber: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdatePayToCont(var PurchaseHeader: Record "Purchase Header"; Vendor: Record Vendor; Contact: Record Contact)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdatePayToVend(var PurchaseHeader: Record "Purchase Header"; Contact: Record Contact)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdatePurchLinesByFieldNo(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; ChangedFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateShipToAddress(var PurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateCurrencyFactor(var PurchaseHeader: Record "Purchase Header"; HideValidationDialog: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateInboundWhseHandlingTime(var PurchaseHeader: Record "Purchase Header"; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateShipToCode(var PurchHeader: Record "Purchase Header"; Cust: Record Customer; ShipToAddr: Record "Ship-to Address")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterAppliesToDocNoOnLookup(var PurchaseHeader: Record "Purchase Header"; VendorLedgerEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateAllLineDimOnAfterPurchLineSetFilters(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdatePurchLinesByFieldNoOnBeforeModifyRec(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdatePurchLinesByFieldNoOnAfterCalcShouldConfirmReservationDateConflict(var PurchaseHeader: Record "Purchase Header"; ChangedFieldNo: Integer; var ShouldConfirmReservationDateConflict: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdatePurchLinesByFieldNoOnAfterPurchLineSetFilters(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; ChangedFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdatePurchLinesByChangedFieldName(PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; ChangedFieldName: Text[100]; ChangedFieldNo: Integer; xPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateShortcutDimCodeOnBeforeUpdateAllLineDim(var PurcasehHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; FieldNumber: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateShortcutDimCode(var PurchHeader: Record "Purchase Header"; xPurchHeader: Record "Purchase Header"; FieldNumber: Integer; var ShortcutDimCode: Code[20])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterTransferExtendedTextForPurchaseLineRecreation(var PurchLine: Record "Purchase Line"; var TempPurchaseLine: Record "Purchase Line" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePurchaseHeaderPayToVendorNoOnBeforeCheckDocType(Vendor: Record Vendor; var PurchaseHeader: Record "Purchase Header"; var xPurchaseHeader: Record "Purchase Header"; SkipPayToContact: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePostingDateOnBeforeResetInvoiceDiscountValue(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeAddSpecialOrderToAddress(var PurchaseHeader: Record "Purchase Header"; var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; ShowError: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeAssistEdit(var PurchaseHeader: Record "Purchase Header"; OldPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeBuyFromPostCodeOnBeforeLookupHandled(var PurchaseHeader: Record "Purchase Header"; PostCode: Record "Post Code"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCalcInvDiscForHeader(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCouldDimensionsBeKept(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckReceiptInfo(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; PayTo: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckShipToCodeChange(PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; xPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckSpecialOrderSalesLineLink(PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckShipToCode(PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeConfirmDeletion(var PurchaseHeader: Record "Purchase Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeConfirmKeepExistingDimensions(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; FieldNo: Integer; OldDimSetID: Integer; var Confirmed: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterConfirmUpdateCurrencyFactor(var PurchaseHeader: Record "Purchase Header"; var HideValidationDialog: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeConfirmUpdateCurrencyFactor(var PurchaseHeader: Record "Purchase Header"; var HideValidationDialog: Boolean; var ForceConfirm: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeContactIsNotRelatedToVendorError(Contact: Record Contact; ContactNo: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateDim(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateDimSetForPrepmtAccDefaultDim(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateDimensionsFromValidatePayToVendorNo(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeConfirmResvDateConflict(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; ChangedFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeConfirmUpdateField(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; UpdatingFieldNo: Integer; CurrentFieldNo: Integer; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeDeletePurchaseLines(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeDeleteRecordInApprovalRequest(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitInsert(var PurchaseHeader: Record "Purchase Header"; var xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitRecord(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; xPurchaseHeader: Record "Purchase Header"; PurchSetup: Record "Purchases & Payables Setup"; GLSetup: Record "General Ledger Setup"; var SkipInitialization: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitPostingDescription(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeIsCreditDocType(PurchaseHeader: Record "Purchase Header"; var CreditDocType: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeIsTotalValid(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeHasBuyFromAddress(var PurchaseHeader: Record "Purchase Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeHasShipToAddress(var PurchaseHeader: Record "Purchase Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeHasPayToAddress(var PurchaseHeader: Record "Purchase Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupAppliesToDocNo(var PurchaseHeader: Record "Purchase Header"; var VendorLedgEntry: Record "Vendor Ledger Entry"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateAppliesToDocNo(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupReceivingNoSeries(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupReturnShipmentNoSeries(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeMessageIfPurchLinesExist(var PurchaseHeader: Record "Purchase Header"; ChangedFieldName: Text[100]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeModifyPayToVendorAddress(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeModifyVendorAddress(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOnDelete(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetShipToCodeEmpty(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShouldSearchForVendorByName(VendorNo: Code[20]; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTransferSavedJobFields(var DestinationPurchaseLine: Record "Purchase Line"; SourcePurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTransferSavedFields(var DestinationPurchaseLine: Record "Purchase Line"; SourcePurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateCurrencyFactor(var PurchaseHeader: Record "Purchase Header"; var Updated: Boolean; var CurrencyExchangeRate: Record "Currency Exchange Rate"; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdatePurchLineAmounts(var PurchaseHeader: Record "Purchase Header"; var xPurchaseHeader: Record "Purchase Header"; CurrentFieldNo: Integer; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeJobUpdatePurchaseLine(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeRecreatePurchLines(var PurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeRecreatePurchLinesHandler(var PurchHeader: Record "Purchase Header"; xPurchHeader: Record "Purchase Header"; ChangedFieldName: Text[100]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetSecurityFilterOnRespCenter(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckContactRelatedToVendorCompany(PurchaseHeader: Record "Purchase Header"; CurrFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowDocDim(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSendToPosting(var PurchaseHeader: Record "Purchase Header"; var IsSuccess: Boolean; var IsHandled: Boolean; PostingCodeunitID: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSendRecords(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePrintRecords(var PurchaseHeader: Record "Purchase Header"; ShowRequestForm: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSendProfile(var PurchaseHeader: Record "Purchase Header"; var DocumentSendingProfile: Record "Document Sending Profile"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetDefaultPurchaser(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetPurchaserCode(var PurchaseHeader: Record "Purchase Header"; PurchaserCodeToCheck: Code[20]; var PurchaserCodeToAssign: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTestNoSeries(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTransferSavedFieldsDropShipment(var DestinationPurchaseLine: Record "Purchase Line"; var SourcePurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTransferSavedFieldsSpecialOrder(var DestinationPurchaseLine: Record "Purchase Line"; var SourcePurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateAllLineDim(var PurchaseHeader: Record "Purchase Header"; NewParentDimSetID: Integer; OldParentDimSetID: Integer; var IsHandled: Boolean; xPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateLocationCode(var PurchaseHeader: Record "Purchase Header"; LocationCode: Code[10]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdatePurchLinesByFieldNo(var PurchaseHeader: Record "Purchase Header"; ChangedFieldNo: Integer; var AskQuestion: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateShipToAddress(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateBuyFromVendorNo(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; CallingFieldNo: Integer; var SkipBuyFromContact: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePostingDate(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; CallingFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateEmptySellToCustomerAndLocation(var PurchaseHeader: Record "Purchase Header"; Vendor: Record Vendor; var IsHandled: Boolean; var xPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCollectParamsInBufferForCreateDimSetOnAfterSetTempPurchLineFilters(var TempPurchaseLine: Record "Purchase Line" temporary; PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure CollectParamsInBufferForCreateDimSetOnBeforeInsertTempPurchaseLineInBuffer(var GeneralPostingSetup: Record "General Posting Setup"; var DefaultDimension: Record "Default Dimension")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePayToVendorNo(var PurchaseHeader: Record "Purchase Header"; var xPurchaseHeader: Record "Purchase Header"; var Confirmed: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePricesIncludingVAT(var PurchaseHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var IsHandled: Boolean; var xPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateLocationCode(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; xPurchaseHeader: Record "Purchase Header"; CurrFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShortcutDimCode(var PurchaseHeader: Record "Purchase Header"; var xPurchaseHeader: Record "Purchase Header"; FieldNumber: Integer; var ShortcutDimCode: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- procedure OnBeforeValidateShipmentMethodCode(var PurchaseHeader: Record "Purchase Header"; var IsHandled: boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateDocumentDateWithPostingDate(var PurchaseHeader: Record "Purchase Header"; CallingFieldNo: Integer; var IsHandled: Boolean; xPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- procedure OnBuyFromCityOnBeforeOnLookup(var PurchaseHeader: Record "Purchase Header"; PostCode: record "Post Code"; var IsHandled: boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCreateDimOnBeforeUpdateLines(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; CurrentFieldNo: Integer; OldDimSetID: Integer; DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInsertTempPurchLineInBufferOnBeforeTempPurchLineInsert(var TempPurchaseLine: Record "Purchase Line" temporary; PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecreatePurchLinesOnAfterValidateType(var PurchaseLine: Record "Purchase Line"; TempPurchaseLine: Record "Purchase Line" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecreatePurchLinesOnBeforeInsertPurchLine(var PurchaseLine: Record "Purchase Line"; var TempPurchaseLine: Record "Purchase Line" temporary; ChangedFieldName: Text[100])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecreatePurchLinesOnBeforeTempPurchLineInsert(var TempPurchaseLine: Record "Purchase Line" temporary; PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecreatePurchLineOnAfterProcessAttachedToLineNo(var TempPurchaseLine: Record "Purchase Line" temporary; PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecreatePurchLinesOnAfterProcessTempPurchLines(var TempPurchaseLine: Record "Purchase Line" temporary; var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; ChangedFieldName: Text[100])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecreatePurchLinesOnAfterCalcShouldCreatePurchLines(var TempPurchaseLine: Record "Purchase Line" temporary; var ShouldCreatePurchLines: Boolean; var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnPrintRecordsOnAfterCheckMixedDropShipment(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSendRecordsOnAfterCheckMixedDropShipment(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnShipToPostCodeOnBeforeOnLookup(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; PostCode: Record "Post Code")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnShowDocDimOnAfterSetDimensionSetID(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateBuyFromVendorNoOnAfterRecreateLines(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; CallingFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateBuyFromVendorNoBeforeRecreateLines(var PurchaseHeader: Record "Purchase Header"; CallingFieldNo: Integer; var Vendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateBuyFromVendorNoOnAfterUpdateBuyFromCont(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; CallingFieldNo: Integer; var SkipBuyFromContact: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateBuyFromVendorNoOnValidateBuyFromVendorNoOnBeforeValidatePayToVendor(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateBuyFromVendorNoOnAfterValidatePayToVendor(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOnRename(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowPostedDocsToPrintCreatedMsg(var ShowPostedDocsToPrint: Boolean; HideValidationDialog: Boolean; var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterPrepareOpeningDocumentStatistics(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeTestStatusOpen(var PurchHeader: Record "Purchase Header"; xPurchHeader: Record "Purchase Header"; CallingFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnAfterTestStatusOpen()
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdatePurchLines(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitFromPurchHeader(var PurchaseHeader: Record "Purchase Header"; SourcePurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitFromContactOnBeforeInitRecord(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitFromVendorOnBeforeInitRecord(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitInsertOnBeforeInitRecord(var PurchaseHeader: Record "Purchase Header"; var xPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitRecordOnAfterAssignDates(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecreatePurchLinesOnBeforeConfirm(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; ChangedFieldName: Text[100]; HideValidationDialog: Boolean; var Confirmed: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnPrintRecordsOnBeforeTrySendToPrinterVendor(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; ShowRequestForm: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSendProfileOnBeforeSendVendor(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnQtyToReceiveIsZeroOnAfterSetFilters(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnTestStatusIsNotPendingApproval(PurchaseHeader: Record "Purchase Header"; var NotPending: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnTestStatusIsNotPendingPrepayment(PurchaseHeader: Record "Purchase Header"; var NotPending: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnTestStatusIsNotReleased(PurchaseHeader: Record "Purchase Header"; var NotReleased: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnTransferSavedFieldsSpecialOrderOnBeforeSalesLineModify(var DestinationPurchaseLine: Record "Purchase Line"; var SourcePurchaseLine: Record "Purchase Line"; var SalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateAllLineDimOnBeforePurchLineModify(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateCurrencyFactorOnAfterCurrencyDateSet(var PurchaseHeader: Record "Purchase Header"; var CurrencyDate: Date; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdatePurchLinesByFieldNoOnBeforeLineModify(var PurchaseHeader: Record "Purchase Header"; var xPurchaseHeader: Record "Purchase Header"; PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdatePurchLinesByFieldNoOnBeforeValidateFields(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; var ChangedFieldNo: Integer; var PurchaseHeader: record "Purchase Header"; var IsHandled: boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateOrderAddressCodeOnAfterCopyBuyFromVendorAddressFieldsFromVendor(var PurchaseHeader: Record "Purchase Header"; Vend: Record Vendor);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateOrderAddressCodeOnBeforeCopyBuyFromVendorAddressFieldsFromVendor(var PurchaseHeader: Record "Purchase Header"; Vend: Record Vendor; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateOrderAddressCodeOnBeforeUpdateLocationCode(var PurchaseHeader: Record "Purchase Header"; var xPurchaseHeader: Record "Purchase Header"; CurrentFieldNo: Integer; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePaymentTermsCodeOnBeforeCalcDueDate(var PurchaseHeader: Record "Purchase Header"; var xPurchaseHeader: Record "Purchase Header"; CalledByFieldNo: Integer; CallingFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePaymentTermsCodeOnBeforeCalcPmtDiscDate(var PurchaseHeader: Record "Purchase Header"; var xPurchaseHeader: Record "Purchase Header"; CalledByFieldNo: Integer; CallingFieldNo: Integer; var IsHandled: Boolean; var UpdateDocumentDate: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePaymentTermsCodeOnBeforeValidatePmtDiscountWhenBlank(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePaymentTermsCodeOnBeforeValidateDueDate(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePaymentTermsCodeOnBeforeValidateDueDateWhenBlank(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePayToVendorNoOnBeforeGetPayToVend(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePayToVendorNoOnBeforeRecallModifyAddressNotification(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; Vendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePaytoVendorNoBeforeRecreateLines(var PurchaseHeader: Record "Purchase Header"; CallingFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePricesIncludingVATOnBeforePurchLineModify(var PurchaseHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; Currency: Record Currency; RecalculatePrice: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateVATBaseAmountPercOnBeforeUpdatePurchAmountLines(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnLookupPostCode(CalledFromFieldNo: Integer; xRecPurchaseHeader: Record "Purchase Header"; var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnLookupBuyfromVendorNameOnAfterSuccessfulLookup(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecreatePurchLinesOnAfterPurchLineSetFilters(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecreatePurchLinesOnDropShipmentSpecialOrder(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyDocument(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecreatePurchLinesOnBeforeTempPurchLineFindSet(var TempPurchLine: Record "Purchase Line" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateAllLineDimOnBeforeGetPurchLineNewDimsetID(var PurchLine: Record "Purchase Line"; NewParentDimSetID: Integer; OldParentDimSetID: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateAllLineDimOnAfterGetPurchLineNewDimsetID(PurchHeader: Record "Purchase Header"; xPurchHeader: Record "Purchase Header"; PurchaseLine: Record "Purchase Line"; var NewDimSetID: Integer; NewParentDimSetID: Integer; OldParentDimSetID: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateBuyFromVendOnAfterGetContact(var PurchaseHeader: Record "Purchase Header"; var Cont: Record Contact; var ShouldUpdateFromContact: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdatePayToVendOnAfterGetContact(var PurchaseHeader: Record "Purchase Header"; var Cont: Record Contact; var ShouldUpdateFromContact: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdatePayToVendOnBeforeFindByContact(var PurchaseHeader: Record "Purchase Header"; Vendor: Record Vendor; Contact: Record Contact)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePromisedReceiptDate(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; CUrrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateReceivingNoSeries(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateReturnShipmentNoSeries(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateRequestedReceiptDate(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckBlockedVendOnDocs(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var Vend: Record Vendor; CurrFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTestPurchLineFieldsBeforeRecreate(var PurchaseHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecreateTempPurchLinesOnAfterTempPurchLineInsert(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var TempPurchaseLine: Record "Purchase Line" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeDeletePurchCommentLines(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeStorePurchCommentLineToTemp(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTransferItemChargeAssgntPurchToTemp(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeDeletePurchLines(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecreatePurchLinesOnBeforeTransferSavedFields(var Rec: Record "Purchase Header"; var TempPurchLine: Record "Purchase Line" temporary; var IsHandled: Boolean; var PurchaseLine: record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyBuyFromAddressToPayToAddress(var Rec: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePrepmtPaymentTermsCodeOnCaseElseOnBeforeValidatePrepaymentDueDate(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; CurrFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePrepmtPaymentTermsCodeOnCaseIfOnBeforeValidatePrepaymentDueDate(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; CurrFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateGenBusPostingGroupOnAfterSetVATBusPostingGroup(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; GenBusPostingGrp: Record "Gen. Business Posting Group")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetAmountToApply(var PurchaseHeader: Record "Purchase Header"; var VendLedgEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitPostingNoSeries(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePayToCity(var PurchaseHeader: Record "Purchase Header"; var PostCode: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePayToPostCode(var PurchaseHeader: Record "Purchase Header"; var PostCode: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShipToCity(var PurchaseHeader: Record "Purchase Header"; var PostCode: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShipToPostCode(var PurchaseHeader: Record "Purchase Header"; var PostCode: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateBuyFromCity(var PurchaseHeader: Record "Purchase Header"; var PostCode: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateBuyFromPostCode(var PurchaseHeader: Record "Purchase Header"; var PostCode: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateShipToCodeOnAfterCopyFromShipToAddr(var PurchaseHeader: Record "Purchase Header"; ShipToAddress: Record "Ship-to Address")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateShipToCodeOnAfterCopyFromSellToCust(var PurchaseHeader: Record "Purchase Header"; Customer: Record Customer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateShipToAddressOnAfterCopyFromLocation(var PurchaseHeader: Record "Purchase Header"; Location: Record Location)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateShipToAddressOnAfterCopyFromCompany(var PurchaseHeader: Record "Purchase Header"; CompanyInformation: Record "Company Information")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShipToCode(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var ShipToAddr: Record "Ship-to Address"; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupBuyFromContactNo(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupPayToContactNo(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterRecreatePurchLines(var PurchaseHeader: Record "Purchase Header"; ChangedFieldName: Text[100])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateOrderDate(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; CurrFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateExpectedReceiptDate(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; CallingFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateSendICDocument(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSendRecordsOnBeforeSendVendorRecords(ReportUsage: Enum "Report Selection Usage"; var PurchaseHeader: Record "Purchase Header"; DocTxt: Text[150]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePaymentDiscountPercent(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePrepmtPaymentDiscountPercent(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
-#pragma warning disable AS0077
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetUserSetupPurchaserCode(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-#pragma warning restore AS0077
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckBuyFromContactOnAfterFindByContact(var PurchHeader: Record "Purchase Header"; var ContBusinessRelation: Record "Contact Business Relation"; var Contact: Record Contact)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckVendorPostingGroupChange(var PurchaseHeader: Record "Purchase Header"; var xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOnInsert(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePurchLinesExist(var Rec: Record "Purchase Header"; var Result: Boolean; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePostingDateOnBeforeCheckNeedUpdateCurrencyFactor(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var IsConfirmed: Boolean; var NeedUpdateCurrencyFactor: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePostingDateOnAfterCheckNeedUpdateCurrencyFactor(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var SkipJobCurrFactorUpdate: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateBuyFromVendorName(var PurchaseHeader: Record "Purchase Header"; var Vendor: Record Vendor; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePriceMessageIfPurchLinesExist(var PurchaseHeader: Record "Purchase Header"; ChangedFieldName: Text[100]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnShowDocDimOnBeforePurchHeaderModify(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCreateDimSetForPrepmtAccDefaultDimOnBeforeTempPurchaseLineCreateDim(var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecreatePurchLinesOnBeforePurchLinesExists(var PurchHeader: Record "Purchase Header"; xPurchHeader: Record "Purchase Header"; ChangedFieldName: Text[100]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitPurchaseLineDefaultDimSource(var PurchaseHeader: Record "Purchase Header"; var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; SourcePurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitPurchaseLineDefaultDimSource(var PurchaseHeader: Record "Purchase Header"; var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; SourcePurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateSellToCustomerNo(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeConfirmCloseUnposted(var PurchaseHeader: Record "Purchase Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateCurrencyCode(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckDropShipmentLineExists(var SalesShipmentLine: Record "Sales Shipment Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterBuyFromAddressEqualsPayToAddress(PurchaseHeader: Record "Purchase Header"; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterIsShipToAddressEqualToCompanyShipToAddress(PurchaseHeader: Record "Purchase Header"; CompanyInformation: Record "Company Information"; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterBuyFromAddressEqualsShipToAddress(PurchaseHeader: Record "Purchase Header"; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePayToVendorNoOnAfterConfirmed(var PurchaseHeader: Record "Purchase Header");
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeHasMixedDropShipment(var PurchaseHeader: Record "Purchase Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateBuyFromVendorNoOnBeforeAssignResponsibilityCenter(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; CallingFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitRecordOnBeforeAssignResponsibilityCenter(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateAllLineDimOnBeforeConfirmUpdateAllLineDim(var PurchaseHeader: Record "Purchase Header"; var DefaultAnswer: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSetAmountToApplyAfterOnCalcRemainingAmount(var VendorLedgerEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePerformManualRelease(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateVATBaseDiscountOnBeforeConfirm(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; var Confirmed: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnConfirmCurrencyFactorUpdateOnBeforeConfirm(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; var Confirmed: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnIsApprovedForPostingOnBeforeError(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; var Approved: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterPayToAddressEqualsOldBuyFromAddress(PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyAddressInfoFromOrderAddressOnBeforeCopyBuyFromVendorAddressFieldsFromOrderAddress(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; OrderAddress: Record "Order Address"; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitFromVendor(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; VendorNo: Code[20]; VendorCaption: Text)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCreateDimOnAfterConfirmKeepExisting(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header"; CurrentFieldNo: Integer; OldDimSetID: Integer; DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupPrepmtCrMemoNoSeries(var PurchaseHeader: Record "Purchase Header"; var xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePrepmtCrMemoNoSeries(var PurchaseHeader: Record "Purchase Header"; var xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetPstdDocLinesToReverse(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetPstdDocLinesToReverse(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnAfterValidateEmptySellToCustomerAndLocation(var PurchaseHeader: Record "Purchase Header"; var Vendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateVendorInvoiceNo(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateVendorCrMemoNo(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckIsTotalValid(IncomingDocument: Record "Incoming Document"; PurchaseHeader: Record "Purchase Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdatePurchaseOrderLineIfExist(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupPrepmtNoSeries(var PurchaseHeader: Record "Purchase Header"; var xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePrepmtNoSeries(var PurchaseHeader: Record "Purchase Header"; var xPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetVend(PurchaseHeader: Record "Purchase Header"; var Vendor: Record Vendor; VendorNo: Code[20]; var GetVendor: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitFromVendorOnBeforeInit(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitFromContactOnBeforeInit(var PurchaseHeader: Record "Purchase Header"; xPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnLookupBuyFromContactOnAfterValidateBuyFromContactNo(var PurchaseHeader: Record "Purchase Header"; Contact: Record Contact)
- begin
- end;
-}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Purchases/Document/PurchaseInvoice.Page.al b/src/Layers/NL/BaseApp/Purchases/Document/PurchaseInvoice.Page.al
index ea485b3396..78ea6f9f5c 100644
--- a/src/Layers/NL/BaseApp/Purchases/Document/PurchaseInvoice.Page.al
+++ b/src/Layers/NL/BaseApp/Purchases/Document/PurchaseInvoice.Page.al
@@ -446,16 +446,6 @@ page 51 "Purchase Invoice"
Editable = IsPostingGroupEditable;
Importance = Additional;
}
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the transaction mode used in telebanking.';
- }
- field("Bank Account Code"; Rec."Bank Account Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the vendor''s bank account that is used for payments and collections through telebanking.';
- }
field("Payment Terms Code"; Rec."Payment Terms Code")
{
ApplicationArea = Basic, Suite;
@@ -1827,7 +1817,6 @@ page 51 "Purchase Invoice"
JobQueuesUsed := PurchSetup.JobQueueActive();
SetExtDocNoMandatoryCondition();
ShowShippingOptionsWithLocation := ApplicationAreaMgmtFacade.IsLocationEnabled() or ApplicationAreaMgmtFacade.IsAllDisabled();
-
IsPowerAutomatePrivacyNoticeApproved := PrivacyNotice.GetPrivacyNoticeApprovalState(FlowServiceManagement.GetPowerAutomatePrivacyNoticeId()) = "Privacy Notice Approval State"::Agreed;
end;
diff --git a/src/Layers/NL/BaseApp/Purchases/Document/PurchaseLine.Table.al b/src/Layers/NL/BaseApp/Purchases/Document/PurchaseLine.Table.al
deleted file mode 100644
index 24fa4c0138..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/Document/PurchaseLine.Table.al
+++ /dev/null
@@ -1,12319 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.Document;
-
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.AllocationAccount;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Deferral;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.Finance.SalesTax;
-using Microsoft.Finance.VAT.Calculation;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.FixedAssets.Depreciation;
-using Microsoft.FixedAssets.FixedAsset;
-using Microsoft.FixedAssets.Insurance;
-using Microsoft.FixedAssets.Maintenance;
-using Microsoft.FixedAssets.Posting;
-using Microsoft.FixedAssets.Setup;
-using Microsoft.Foundation.Attachment;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.Calendar;
-using Microsoft.Foundation.Enums;
-using Microsoft.Foundation.ExtendedText;
-using Microsoft.Foundation.Navigate;
-using Microsoft.Foundation.UOM;
-using Microsoft.Intercompany.GLAccount;
-using Microsoft.Intercompany.Partner;
-using Microsoft.Inventory;
-using Microsoft.Inventory.Availability;
-using Microsoft.Inventory.Intrastat;
-using Microsoft.Inventory.Item;
-using Microsoft.Inventory.Item.Catalog;
-using Microsoft.Inventory.Ledger;
-using Microsoft.Inventory.Location;
-using Microsoft.Inventory.Setup;
-using Microsoft.Inventory.Tracking;
-using Microsoft.Pricing.Calculation;
-using Microsoft.Pricing.PriceList;
-using Microsoft.Projects.Project.Job;
-using Microsoft.Projects.Project.Journal;
-using Microsoft.Projects.Project.Planning;
-using Microsoft.Projects.Resources.Resource;
-using Microsoft.Purchases.Comment;
-using Microsoft.Purchases.History;
-using Microsoft.Purchases.Posting;
-using Microsoft.Purchases.Pricing;
-using Microsoft.Purchases.Setup;
-using Microsoft.Purchases.Vendor;
-using Microsoft.Sales.Document;
-using Microsoft.Utilities;
-using Microsoft.Warehouse.Document;
-using Microsoft.Warehouse.Journal;
-using Microsoft.Warehouse.Request;
-using Microsoft.Warehouse.Setup;
-using Microsoft.Warehouse.Structure;
-using System.Environment.Configuration;
-using System.Utilities;
-
-table 39 "Purchase Line"
-{
- Caption = 'Purchase Line';
- DrillDownPageID = "Purchase Lines";
- LookupPageID = "Purchase Lines";
- Permissions = TableData "Purchase Line" = m;
- DataClassification = CustomerContent;
-
- fields
- {
- field(1; "Document Type"; Enum "Purchase Document Type")
- {
- Caption = 'Document Type';
- ToolTip = 'Specifies the type of document that you are about to create.';
- }
- field(2; "Buy-from Vendor No."; Code[20])
- {
- Caption = 'Buy-from Vendor No.';
- ToolTip = 'Specifies the name of the vendor who delivered the items.';
- Editable = false;
- TableRelation = Vendor;
- }
- field(3; "Document No."; Code[20])
- {
- Caption = 'Document No.';
- ToolTip = 'Specifies the document number.';
- TableRelation = "Purchase Header"."No." where("Document Type" = field("Document Type"));
- }
- field(4; "Line No."; Integer)
- {
- Caption = 'Line No.';
- ToolTip = 'Specifies the line''s number.';
- }
- field(5; Type; Enum "Purchase Line Type")
- {
- Caption = 'Type';
- ToolTip = 'Specifies the line type.';
-
- trigger OnValidate()
- var
- TempPurchLine: Record "Purchase Line" temporary;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateType(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- GetPurchHeader();
- TestStatusOpen();
-
- TestField("Qty. Rcd. Not Invoiced", 0);
- TestField("Quantity Received", 0);
- TestField("Receipt No.", '');
- MatchedOrderLineMgmt.IsLineMatched(Rec, true);
-
- TestField("Return Qty. Shipped Not Invd.", 0);
- TestField("Return Qty. Shipped", 0);
- TestField("Return Shipment No.", '');
-
- TestField("Prepmt. Amt. Inv.", 0);
-
- CheckAssociatedSalesOrder();
- CheckAssociatedProdOrder();
-
- if Type <> xRec.Type then begin
- case xRec.Type of
- Type::Item:
- if Quantity <> 0 then begin
- PurchHeader.TestField(Status, PurchHeader.Status::Open);
- PurchLineReserve.VerifyChange(Rec, xRec);
- CalcFields("Reserved Qty. (Base)");
- TestField("Reserved Qty. (Base)", 0);
- PurchasesWarehouseMgt.PurchaseLineVerifyChange(Rec, xRec);
- OnValidateTypeOnAfterCheckItem(Rec, xRec);
- end;
- Type::"Fixed Asset":
- if Quantity <> 0 then
- PurchHeader.TestField(Status, PurchHeader.Status::Open);
- Type::"Charge (Item)":
- DeleteChargeChargeAssgnt("Document Type", "Document No.", "Line No.");
- Type::" ":
- if ("Attached to Line No." <> 0) and (Quantity = 0) then
- Error(ChangeExtendedTextErr, FieldCaption(Type));
- end;
- if xRec."Deferral Code" <> '' then
- DeferralUtilities.RemoveOrSetDeferralSchedule('',
- Enum::"Deferral Document Type"::Purchase.AsInteger(), '', '',
- xRec."Document Type".AsInteger(), xRec."Document No.", xRec."Line No.",
- xRec.GetDeferralAmount(), PurchHeader."Posting Date", '', xRec."Currency Code", true);
- end;
- OnValidateTypeOnBeforeInitRec(Rec, xRec, CurrFieldNo);
- TempPurchLine := Rec;
- Init();
- SystemId := TempPurchLine.SystemId;
-
- if xRec."Line Amount" <> 0 then
- "Recalculate Invoice Disc." := xRec."Allow Invoice Disc.";
-
- Type := TempPurchLine.Type;
- "System-Created Entry" := TempPurchLine."System-Created Entry";
- OnValidateTypeOnCopyFromTempPurchLine(Rec, TempPurchLine, xRec);
- Validate("FA Posting Type");
-
- if Type = Type::Item then
- "Allow Item Charge Assignment" := true
- else
- "Allow Item Charge Assignment" := false;
-
- OnAfterValidateTypePurchaseLine(Rec, xRec, TempPurchLine);
- end;
- }
- field(6; "No."; Code[20])
- {
- CaptionClass = GetCaptionClass(FieldNo("No."));
- Caption = 'No.';
- ToolTip = 'Specifies the number of the involved entry or record, according to the specified number series.';
- ValidateTableRelation = false;
- TableRelation = if (Type = const(" ")) "Standard Text"
- else
- if (Type = const("G/L Account"), "System-Created Entry" = const(false)) "G/L Account" where("Direct Posting" = const(true), "Account Type" = const(Posting), Blocked = const(false))
- else
- if (Type = const("G/L Account"), "System-Created Entry" = const(true)) "G/L Account"
- else
- if (Type = const("Fixed Asset")) "Fixed Asset"
- else
- if (Type = const("Charge (Item)")) "Item Charge"
- else
- if (Type = const(Item), "Document Type" = filter(<> "Credit Memo" & <> "Return Order")) Item where(Blocked = const(false), "Purchasing Blocked" = const(false))
- else
- if (Type = const(Item), "Document Type" = filter("Credit Memo" | "Return Order")) Item where(Blocked = const(false))
- else
- if (Type = const("Allocation Account")) "Allocation Account"
- else
- if (Type = const(Resource)) Resource;
-
- trigger OnValidate()
- var
- TempPurchLine: Record "Purchase Line" temporary;
- IsHandled: Boolean;
- ShouldAssignQuantityFromXRec: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateNo(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- GetPurchSetup();
- Rec."No." := FindOrCreateRecordByNo(Rec."No.");
-
- TestStatusOpen();
- TestField("Qty. Rcd. Not Invoiced", 0);
- TestField("Quantity Received", 0);
-
- IsHandled := false;
- OnValidateNoOnBeforeCheckReceiptNo(Rec, xRec, IsHandled);
- if not IsHandled then begin
- TestField("Receipt No.", '');
- MatchedOrderLineMgmt.IsLineMatched(Rec, true);
- end;
- TestField("Prepmt. Amt. Inv.", 0);
-
- TestReturnFieldsZero();
-
- CheckAssociatedSalesOrder();
- CheckAssociatedProdOrder();
-
- OnValidateNoOnAfterChecks(Rec, xRec, CurrFieldNo);
-
- if "No." <> xRec."No." then begin
- if (Quantity <> 0) and ItemExists(xRec."No.") then begin
- PurchLineReserve.VerifyChange(Rec, xRec);
- CalcFields("Reserved Qty. (Base)");
- TestField("Reserved Qty. (Base)", 0);
- if Type = Type::Item then
- PurchasesWarehouseMgt.PurchaseLineVerifyChange(Rec, xRec);
- OnValidateNoOnAfterVerifyChange(Rec, xRec);
- if CurrFieldNo = Rec.FieldNo("No.") then
- CheckWarehouse(false);
- end;
- if Type = Type::Item then
- DeleteItemChargeAssignment("Document Type", "Document No.", "Line No.");
- if Type = Type::"Charge (Item)" then
- DeleteChargeChargeAssgnt("Document Type", "Document No.", "Line No.");
- end;
-
- OnValidateNoOnBeforeInitRec(Rec, xRec, CurrFieldNo);
- TempPurchLine := Rec;
- Init();
- SystemId := TempPurchLine.SystemId;
- if xRec."Line Amount" <> 0 then
- "Recalculate Invoice Disc." := xRec."Allow Invoice Disc.";
- Type := TempPurchLine.Type;
- "No." := TempPurchLine."No.";
- IsHandled := false;
- OnValidateNoOnCopyFromTempPurchLine(Rec, TempPurchLine, xRec, IsHandled);
- if IsHandled then
- exit;
- if "No." = '' then
- exit;
-
- if HasTypeToFillMandatoryFields() then begin
- Quantity := TempPurchLine.Quantity;
- "Outstanding Qty. (Base)" := TempPurchLine."Outstanding Qty. (Base)";
- end;
-
- "System-Created Entry" := TempPurchLine."System-Created Entry";
-
- OnBeforeAssignHeaderValues(Rec, PurchHeader);
-
- GetPurchHeader();
- InitHeaderDefaults(PurchHeader, TempPurchLine);
- UpdateLeadTimeFields();
- UpdateDates();
-
- OnAfterAssignHeaderValues(Rec, PurchHeader);
-
- case Type of
- Type::" ":
- CopyFromStandardText();
- Type::"G/L Account":
- CopyFromGLAccount(TempPurchLine);
- Type::Item:
- CopyFromItem();
- Type::Resource:
- CopyFromResource();
- Type::"Fixed Asset":
- CopyFromFixedAsset();
- Type::"Charge (Item)":
- CopyFromItemCharge();
- end;
-
- OnAfterAssignFieldsForNo(Rec, xRec, PurchHeader);
-
- if Type <> Type::" " then begin
- PostingSetupMgt.CheckGenPostingSetupPurchAccount("Gen. Bus. Posting Group", "Gen. Prod. Posting Group");
- PostingSetupMgt.CheckVATPostingSetupPurchAccount("VAT Bus. Posting Group", "VAT Prod. Posting Group");
- end;
-
- IsHandled := false;
- OnBeforeValidateVATProdPostingGroup(Rec, xRec, IsHandled);
- if not IsHandled then
- if HasTypeToFillMandatoryFields() and not (Type = Type::"Fixed Asset") then
- Validate("VAT Prod. Posting Group");
-
- UpdatePrepmtSetupFields();
-
- if HasTypeToFillMandatoryFields() then begin
- PlanPriceCalcByField(FieldNo("No."));
- IsHandled := false;
- OnValidateNoOnBeforeAssignQtyFromXRec(Rec, xRec, IsHandled);
- ShouldAssignQuantityFromXRec := (not IsHandled) and (not QuantityDefaultedFromGLAccount());
- if ShouldAssignQuantityFromXRec then
- Quantity := xRec.Quantity;
- OnValidateNoOnAfterAssignQtyFromXRec(Rec, TempPurchLine);
- Validate("Unit of Measure Code");
- InitOutstandingAndQtyToShipReceive(TempPurchLine);
- UpdateWithWarehouseReceive();
- UpdateJobFields();
- end;
-
- CreateDimFromDefaultDim(Rec.FieldNo("No."));
-
- GetPurchHeader();
- UpdateItemReference();
- UpdateDirectUnitCostByField(FieldNo("No."));
-
- GetDefaultBin();
-
- IsHandled := false;
- OnValidateNoOnBeforeJobTaskIsSet(PurchHeader, Rec, xRec, TempPurchLine, IsHandled);
- if not IsHandled then
- if JobTaskIsSet() then begin
- CreateTempJobJnlLine(true);
- UpdateJobPrices();
- UpdateDimensionsFromJobTask();
- end;
-
- OnAfterValidateNoPurchaseLine(Rec, xRec, TempPurchLine, PurchHeader);
- end;
- }
- field(7; "Location Code"; Code[10])
- {
- Caption = 'Location Code';
- TableRelation = Location where("Use As In-Transit" = const(false));
- ToolTip = 'Specifies the code for the location where the items on the line will be located.';
-
- trigger OnValidate()
- var
- ConfirmManagement: Codeunit "Confirm Management";
- IsHandled, ShouldExit : Boolean;
- begin
- TestStatusOpen();
- IsHandled := false;
- ShouldExit := false;
- OnValidateLocationCodeOnAfterTestStatusOpen(Rec, xRec, IsHandled, ShouldExit);
- if ShouldExit then
- exit;
-
- if xRec."Location Code" <> "Location Code" then begin
- if ("Prepmt. Amt. Inv." <> 0) and (not IsHandled) then
- if not ConfirmManagement.GetResponseOrDefault(
- StrSubstNo(
- Text046, FieldCaption("Direct Unit Cost"), FieldCaption("Location Code"), PRODUCTNAME.Full()), true)
- then begin
- "Location Code" := xRec."Location Code";
- exit;
- end;
- CheckLineNotShippedOrReceived();
- end;
-
- IsHandled := false;
- OnValidateLocationCodeOnBeforeDropShipmentError(Rec, IsHandled, xRec);
- if not IsHandled then
- if "Drop Shipment" then
- Error(Text001, FieldCaption("Location Code"), "Sales Order No.");
-
- IsHandled := false;
- OnValidateLocationCodeOnBeforeSpecialOrderError(Rec, IsHandled, CurrFieldNo, xRec);
- if not IsHandled then
- if "Special Order" then
- Error(Text001, FieldCaption("Location Code"), "Special Order Sales No.");
-
- if "Location Code" <> xRec."Location Code" then begin
- InitItemAppl();
- if IsInventoriableItem() then
- PostingSetupMgt.CheckInvtPostingSetupInventoryAccount("Location Code", "Posting Group");
- end;
-
- if (xRec."Location Code" <> "Location Code") and (Quantity <> 0) then begin
- PurchLineReserve.VerifyChange(Rec, xRec);
- PurchasesWarehouseMgt.PurchaseLineVerifyChange(Rec, xRec);
- UpdateWithWarehouseReceive();
- end;
- "Bin Code" := '';
-
- if Type = Type::Item then
- if "Location Code" <> xRec."Location Code" then
- PlanPriceCalcByField(FieldNo("Location Code"));
-
- IsHandled := false;
- OnValidateLocationCodeOnBeforeSetInboundWhseHandlingTime(CurrFieldNo, Rec, xRec, IsHandled);
- if not IsHandled then
- if "Location Code" = '' then begin
- if InvtSetup.Get() then
- "Inbound Whse. Handling Time" := InvtSetup."Inbound Whse. Handling Time";
- end else
- if Location.Get("Location Code") then
- "Inbound Whse. Handling Time" := Location."Inbound Whse. Handling Time";
-
- UpdateLeadTimeFields();
- UpdateDates();
-
- GetDefaultBin();
- CheckWMS();
- MatchedOrderLineMgmt.CheckReceiptOnInvoiceAllowedForLocation("Location Code", GetPurchHeader());
-
- if "Document Type" = "Document Type"::"Return Order" then
- ValidateReturnReasonCode(FieldNo("Location Code"));
-
- UpdateDirectUnitCostByField(FieldNo("Location Code"));
- CreateDimFromDefaultDim(Rec.FieldNo("Location Code"));
- OnAfterValidateLocationCode(Rec, xRec);
- end;
- }
- field(8; "Posting Group"; Code[20])
- {
- Caption = 'Posting Group';
- Editable = false;
- TableRelation = if (Type = const(Item)) "Inventory Posting Group"
- else
- if (Type = const("Fixed Asset")) "FA Posting Group";
- }
- field(10; "Expected Receipt Date"; Date)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- Caption = 'Expected Receipt Date';
- ToolTip = 'Specifies the date that you expect the items to be available in your warehouse.';
-
- trigger OnValidate()
- var
- CustomCalendarChange: array[2] of Record "Customized Calendar Change";
- IsHandled: Boolean;
- begin
- if not TrackingBlocked then begin
- IsHandled := false;
- OnValidateExpectedReceiptDateOnBeforeCheckDateConflict(Rec, IsHandled);
- if not IsHandled then
- CheckDateConflict.PurchLineCheck(Rec, CurrFieldNo <> 0);
- end;
-
- if "Expected Receipt Date" <> 0D then begin
- CustomCalendarChange[1].SetSource(CalChange."Source Type"::Location, "Location Code", '', '');
- ValidatePlannedReceiptDateWithCustomCalendarChange(CustomCalendarChange);
- end else
- Validate("Planned Receipt Date", "Expected Receipt Date");
- end;
- }
- field(11; Description; Text[100])
- {
- Caption = 'Description';
- 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.';
- TableRelation = if (Type = const("G/L Account"), "System-Created Entry" = const(false)) "G/L Account".Name where("Direct Posting" = const(true), "Account Type" = const(Posting), Blocked = const(false))
- else
- if (Type = const("G/L Account"), "System-Created Entry" = const(true)) "G/L Account".Name
- else
- if (Type = const(Item), "Document Type" = filter(<> "Credit Memo" & <> "Return Order")) Item.Description where(Blocked = const(false), "Purchasing Blocked" = const(false))
- else
- if (Type = const(Item), "Document Type" = filter("Credit Memo" | "Return Order")) Item.Description where(Blocked = const(false))
- else
- if (Type = const("Fixed Asset")) "Fixed Asset".Description
- else
- if (Type = const("Charge (Item)")) "Item Charge".Description
- else
- if (Type = const("Allocation Account")) "Allocation Account".Name
- else
- if (Type = const(Resource)) Resource.Name;
- ValidateTableRelation = false;
-
- trigger OnValidate()
- var
- FindRecordMgt: Codeunit "Find Record Management";
- ReturnValue: Text[50];
- IsHandled: Boolean;
- ShouldErrorForFindDescription: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateDescription(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- if Type = Type::" " then
- exit;
-
- if "No." <> '' then
- exit;
-
- case Type of
- Type::Item:
- ValidateItemDescription();
- else begin
- ReturnValue := FindRecordMgt.FindNoByDescription(Type.AsInteger(), Description, true);
- if ReturnValue <> '' then begin
- CurrFieldNo := FieldNo("No.");
- Validate("No.", CopyStr(ReturnValue, 1, MaxStrLen("No.")));
- end;
- end;
- end;
-
- ShouldErrorForFindDescription := ("No." = '') and GuiAllowed();
- OnValidateDescriptionOnAfterCalcShouldErrorForFindDescription(Rec, xRec, ShouldErrorForFindDescription);
- if ShouldErrorForFindDescription then
- Error(CannotFindDescErr, Type, Description);
- end;
- }
- field(12; "Description 2"; Text[50])
- {
- Caption = 'Description 2';
- ToolTip = 'Specifies information in addition to the description.';
- }
- field(13; "Unit of Measure"; Text[50])
- {
- Caption = 'Unit of Measure';
- ToolTip = 'Specifies the unit of measure.';
-
- trigger OnValidate()
- begin
- if CurrFieldNo = Rec.FieldNo("Unit of Measure") then
- CheckWarehouse(false);
- end;
- }
- field(15; Quantity; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Quantity';
- DecimalPlaces = 0 : 5;
- ToolTip = 'Specifies the number of units of the item specified on the line.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- DoInitOutstanding: Boolean;
- ShouldCheckWithReturnQtyShipped: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateQuantity(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- IsHandled := false;
- OnValidateQuantityOnBeforeDropShptCheck(Rec, xRec, CurrFieldNo, IsHandled);
-
- Quantity := UOMMgt.RoundAndValidateQty(Quantity, "Qty. Rounding Precision", FieldCaption(Quantity));
-
- if not IsHandled then
- if "Drop Shipment" and ("Document Type" <> "Document Type"::Invoice) then
- Error(
- Text001, FieldCaption(Quantity), "Sales Order No.");
-
- "Quantity (Base)" := CalcBaseQty(Quantity, FieldCaption(Quantity), FieldCaption("Quantity (Base)"));
- OnValidateQuantityOnAfterCalcBaseQty(Rec, xRec);
-
- if CurrFieldNo = Rec.FieldNo(Quantity) then
- CheckWarehouse(false);
-
- ShouldCheckWithReturnQtyShipped := IsCreditDocType();
- OnValidateQuantityOnAfterShouldCheckWithReturnQtyShipped(Rec, ShouldCheckWithReturnQtyShipped);
- if ShouldCheckWithReturnQtyShipped then begin
- if (Quantity * "Return Qty. Shipped" < 0) or
- ((Abs(Quantity) < Abs("Return Qty. Shipped")) and ("Return Shipment No." = ''))
- then
- FieldError(Quantity, StrSubstNo(Text004, FieldCaption("Return Qty. Shipped")));
- if ("Quantity (Base)" * "Return Qty. Shipped (Base)" < 0) or
- ((Abs("Quantity (Base)") < Abs("Return Qty. Shipped (Base)")) and ("Return Shipment No." = ''))
- then
- FieldError("Quantity (Base)", StrSubstNo(Text004, FieldCaption("Return Qty. Shipped (Base)")));
- end else begin
- IsHandled := false;
- OnValidateQuantityOnBeforeCheckWithQuantityReceived(Rec, IsHandled);
- if not IsHandled then begin
- if (Quantity * "Quantity Received" < 0) or
- ((Abs(Quantity) < Abs("Quantity Received")) and ("Receipt No." = ''))
- then
- FieldError(Quantity, StrSubstNo(Text004, FieldCaption("Quantity Received")));
- if ("Quantity (Base)" * "Qty. Received (Base)" < 0) or
- ((Abs("Quantity (Base)") < Abs("Qty. Received (Base)")) and ("Receipt No." = ''))
- then
- FieldError("Quantity (Base)", StrSubstNo(Text004, FieldCaption("Qty. Received (Base)")));
- end;
- end;
-
- if (Type = Type::"Charge (Item)") and (CurrFieldNo <> 0) then begin
- if (Quantity = 0) and ("Qty. to Assign" <> 0) then
- FieldError("Qty. to Assign", StrSubstNo(Text011, FieldCaption(Quantity), Quantity));
- if (Quantity * "Qty. Assigned" < 0) or (Abs(Quantity) < Abs("Qty. Assigned")) then
- FieldError(Quantity, StrSubstNo(Text004, FieldCaption("Qty. Assigned")));
- end;
-
- OnValidateQuantityOnBeforeCheckRcptRetShptRelation(Rec, CurrFieldNo);
- if "Receipt No." <> '' then
- CheckReceiptRelation()
- else
- if "Return Shipment No." <> '' then
- CheckRetShptRelation();
-
- DoInitOutstanding := (xRec.Quantity <> Quantity) or (xRec."Quantity (Base)" <> "Quantity (Base)") or ("No." = xRec."No.");
- OnValidateQuantityOnAfterCalcDoInitOutstanding(Rec, xRec, CurrFieldNo, DoInitOutstanding);
- if DoInitOutstanding then begin
- InitOutstanding();
- if IsCreditDocType() then
- InitQtyToShip()
- else begin
- IsHandled := false;
- OnValidateQuantityOnBeforeInitQtyToReceive(Rec, CurrFieldNo, IsHandled);
- if not IsHandled then
- InitQtyToReceive();
- end;
- OnValidateQuantityOnAfterInitQty(Rec, CurrFieldNo);
- end;
- if (Quantity * xRec.Quantity < 0) or (Quantity = 0) then
- InitItemAppl();
-
- if Quantity <> xRec.Quantity then
- PlanPriceCalcByField(FieldNo(Quantity));
- ValidateLineDiscountPctForNotItemType();
-
- OnValidateQuantityOnAfterPlanPriceCalcByField(Rec, xRec);
-
- if Type = Type::"Charge (Item)" then
- "Line Discount %" := 0;
-
- UpdateWithWarehouseReceive();
- if (xRec.Quantity <> Quantity) or (xRec."Quantity (Base)" <> "Quantity (Base)") then begin
- OnBeforeVerifyReservedQty(Rec, xRec, FieldNo(Quantity));
- PurchLineReserve.VerifyQuantity(Rec, xRec);
- IsHandled := false;
- OnValidateQuantityOnBeforePurchaseLineVerifyChange(Rec, StatusCheckSuspended, IsHandled, xRec);
- if not IsHandled then
- PurchasesWarehouseMgt.PurchaseLineVerifyChange(Rec, xRec);
- CheckApplToItemLedgEntry();
- end;
-
- OnValidateQuantityOnBeforeResetAmounts(Rec, xRec);
- if (xRec.Quantity <> Quantity) and (Quantity = 0) and
- ((Amount <> 0) or ("Amount Including VAT" <> 0) or ("VAT Base Amount" <> 0))
- then begin
- Amount := 0;
- "Amount Including VAT" := 0;
- "VAT Base Amount" := 0;
- NonDeductibleVAT.ClearNonDeductibleVAT(Rec);
- end;
-
- UpdateDirectUnitCostByField(FieldNo(Quantity));
- UpdatePrePaymentAmounts();
-
- if "Job Planning Line No." <> 0 then
- Validate("Job Planning Line No.");
-
- if JobTaskIsSet() then begin
- CreateTempJobJnlLine(true);
- UpdateJobPrices();
- end;
-
- IsHandled := false;
- OnValidateQuantityOnBeforeCheckWMS(Rec, IsHandled);
- if not IsHandled then
- CheckWMS();
- end;
- }
- field(16; "Outstanding Quantity"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Outstanding Quantity';
- ToolTip = 'Specifies how many units on the order line have not yet been received.';
- DecimalPlaces = 0 : 5;
- Editable = false;
- }
- field(17; "Qty. to Invoice"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Qty. to Invoice';
- DecimalPlaces = 0 : 5;
- ToolTip = 'Specifies the quantity that remains to be invoiced. It is calculated as Quantity - Qty. Invoiced.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateQtyToInvoice(Rec, IsHandled);
- if IsHandled then
- exit;
-
- "Qty. to Invoice" := UOMMgt.RoundAndValidateQty("Qty. to Invoice", "Qty. Rounding Precision", FieldCaption("Qty. to Invoice"));
-
- if "Qty. to Invoice" = MaxQtyToInvoice() then
- InitQtyToInvoice()
- else begin
- "Qty. to Invoice (Base)" := CalcBaseQty("Qty. to Invoice", FieldCaption("Qty. to Invoice"), FieldCaption("Qty. to Invoice (Base)"));
- if ("Qty. per Unit of Measure" <> 0) and not IsSubcontractingCreditMemo() then
- ValidateQuantityInvIsBalanced();
- end;
- if ("Qty. to Invoice" * Quantity < 0) or (Abs("Qty. to Invoice") > Abs(MaxQtyToInvoice())) then
- Error(CannotInvoiceErrorInfo());
-
- if ("Qty. to Invoice (Base)" * "Quantity (Base)" < 0) or (Abs("Qty. to Invoice (Base)") > Abs(MaxQtyToInvoiceBase())) then
- Error(
- Text007,
- MaxQtyToInvoiceBase());
- "VAT Difference" := 0;
- NonDeductibleVAT.InitNonDeductibleVATDiff(Rec);
- CalcInvDiscToInvoice();
- CalcPrepaymentToDeduct();
-
- if "Job Planning Line No." <> 0 then
- Validate("Job Planning Line No.");
- end;
- }
- field(18; "Qty. to Receive"; Decimal)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- AutoFormatType = 0;
- Caption = 'Qty. to Receive';
- ToolTip = 'Specifies the quantity of items that remains to be received.';
- DecimalPlaces = 0 : 5;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- ShouldCheckLocationRequireReceive: Boolean;
- begin
- "Qty. to Receive" := UOMMgt.RoundAndValidateQty("Qty. to Receive", "Qty. Rounding Precision", FieldCaption("Qty. to Receive"));
- ShouldCheckLocationRequireReceive := "Qty. to Receive" <> 0;
- OnValidateQtyToReceiveOnAfterCalcShouldCheckLocationRequireReceive(Rec, ShouldCheckLocationRequireReceive);
- if ShouldCheckLocationRequireReceive then
- CheckLocationRequireReceive();
-
- IsHandled := false;
- OnValidateQtyToReceiveOnAfterCheck(Rec, CurrFieldNo, IsHandled);
- if not IsHandled then
- if "Qty. to Receive" = Quantity - "Quantity Received" then begin
- IsHandled := false;
- OnValidateQtyToReceiveOnBeforeInitQtyToReceive(Rec, CurrFieldNo, IsHandled);
- if not IsHandled then
- InitQtyToReceive();
- end else begin
- "Qty. to Receive (Base)" := CalcBaseQty("Qty. to Receive", FieldCaption("Qty. to Receive"), FieldCaption("Qty. to Receive (Base)"));
- if "Qty. per Unit of Measure" <> 0 then
- ValidateQuantityReceiveIsBalanced();
- OnValidateQtyToReceiveOnAfterCalcQtyToReceiveBase(Rec, CurrFieldNo);
- InitQtyToInvoice();
- end;
-
- IsHandled := false;
- OnValidateQtyToReceiveOnAfterInitQty(Rec, xRec, CurrFieldNo, IsHandled);
- if not OverReceiptProcessing() then
- if not IsHandled then begin
- if not CanReceiveQty() then
- Error(CannotReceiveErrorInfo());
-
- if not CanReceiveBaseQty() then
- Error(Text009, "Outstanding Qty. (Base)");
- end;
-
- OnValidateQtyToReceiveOnAfterCheckQty(Rec, CurrFieldNo);
-
- if (CurrFieldNo <> 0) and (Type = Type::Item) and ("Qty. to Receive" < 0) then
- CheckApplToItemLedgEntry();
-
- if "Job Planning Line No." <> 0 then
- Validate("Job Planning Line No.");
- end;
- }
- field(22; "Direct Unit Cost"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 2;
- CaptionClass = GetCaptionClass(FieldNo("Direct Unit Cost"));
- Caption = 'Direct Unit Cost';
- ToolTip = 'Specifies the cost of one unit of the selected item or resource.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnValidateDirectUnitCostOnBeforeValidateLineDiscPct(Rec, IsHandled);
- if not IsHandled then
- Validate("Line Discount %");
- end;
- }
- field(23; "Unit Cost (LCY)"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 2;
- Caption = 'Unit Cost (LCY)';
- ToolTip = 'Specifies the cost, in LCY, of one unit of the item or resource on the line.';
-
- trigger OnValidate()
- var
- Item: Record Item;
- begin
- TestStatusOpen();
- TestField("No.");
- TestFieldQuantity(FieldNo("Unit Cost (LCY)"));
-
- if IsProdOrder() then
- Error(
- Text99000000,
- FieldCaption("Unit Cost (LCY)"));
-
- if CurrFieldNo = FieldNo("Unit Cost (LCY)") then
- if Type = Type::Item then begin
- GetItem(Item);
- if Item."Costing Method" = Item."Costing Method"::Standard then
- Error(
- Text010,
- FieldCaption("Unit Cost (LCY)"), Item.FieldCaption("Costing Method"), Item."Costing Method");
- end;
-
- UnitCostCurrency := "Unit Cost (LCY)";
- GetPurchHeader();
- if PurchHeader."Currency Code" <> '' then begin
- PurchHeader.TestField("Currency Factor");
- GetGLSetup();
- UnitCostCurrency :=
- Round(
- CurrExchRate.ExchangeAmtLCYToFCY(
- GetDate(), "Currency Code",
- "Unit Cost (LCY)", PurchHeader."Currency Factor"),
- GLSetup."Unit-Amount Rounding Precision");
- end;
-
- OnValidateUnitCostLCYOnAfterUpdateUnitCostCurrency(Rec, UnitCostCurrency);
-
- "Indirect Cost %" := 0;
- CalcIndirectCostPercent();
-
- UpdateSalesCostFromUnitCostLCY();
-
- if JobTaskIsSet() then begin
- CreateTempJobJnlLine(false);
- TempJobJnlLine.Validate("Unit Cost (LCY)", "Unit Cost (LCY)");
- UpdateJobPrices();
- end
- end;
- }
- field(25; "VAT %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'VAT %';
- DecimalPlaces = 0 : 5;
- Editable = false;
- }
- field(27; "Line Discount %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Line Discount %';
- ToolTip = 'Specifies the discount percentage that is granted for the item on the line.';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
-
- trigger OnValidate()
- begin
- ValidateLineDiscountPercent(true);
- NotifyOnMissingSetup(FieldNo("Line Discount Amount"));
- end;
- }
- field(28; "Line Discount Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Line Discount Amount';
- ToolTip = 'Specifies the discount amount that is granted for the item on the line.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateLineDiscountAmount(Rec, IsHandled);
- if IsHandled then
- exit;
-
- GetPurchHeader();
- "Line Discount Amount" := Round("Line Discount Amount", Currency."Amount Rounding Precision");
- TestStatusOpen();
- TestField(Quantity);
- if xRec."Line Discount Amount" <> "Line Discount Amount" then
- UpdateLineDiscPct();
- "Inv. Discount Amount" := 0;
- "Inv. Disc. Amount to Invoice" := 0;
- OnLineDiscountAmountOnValidateOnBeforeUpdateAmounts(Rec);
- UpdateAmounts();
- UpdateUnitCost();
- NotifyOnMissingSetup(FieldNo("Line Discount Amount"));
- end;
- }
- field(29; Amount; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Amount';
- ToolTip = 'Specifies the net amount, excluding any invoice discount amount, that must be paid for products on the line.';
- Editable = false;
-
- trigger OnValidate()
- begin
- GetPurchHeader();
- Amount := Round(Amount, Currency."Amount Rounding Precision");
- case "VAT Calculation Type" of
- "VAT Calculation Type"::"Normal VAT",
- "VAT Calculation Type"::"Reverse Charge VAT",
- "VAT Calculation Type"::"No Taxable VAT":
- begin
- "VAT Base Amount" :=
- Round(Amount * (1 - GetVatBaseDiscountPct(PurchHeader) / 100), Currency."Amount Rounding Precision");
- "Amount Including VAT" :=
- Round(Amount + "VAT Base Amount" * GetVATPct() / 100, Currency."Amount Rounding Precision");
- OnValidateAmountOnAfterCalculateNormalVAT(Rec, PurchHeader, Currency);
- end;
- "VAT Calculation Type"::"Full VAT":
- if Amount <> 0 then
- FieldError(Amount,
- StrSubstNo(
- Text011, FieldCaption("VAT Calculation Type"),
- "VAT Calculation Type"));
- "VAT Calculation Type"::"Sales Tax":
- begin
- PurchHeader.TestField("VAT Base Discount %", 0);
- "VAT Base Amount" := Amount;
- if "Use Tax" then
- "Amount Including VAT" := "VAT Base Amount"
- else begin
- "Amount Including VAT" :=
- Amount +
- Round(
- SalesTaxCalculate.CalculateTax(
- "Tax Area Code", "Tax Group Code", "Tax Liable", PurchHeader."Posting Date",
- "VAT Base Amount", "Quantity (Base)", PurchHeader."Currency Factor"),
- Currency."Amount Rounding Precision");
- OnAfterSalesTaxCalculate(Rec, PurchHeader, Currency);
- if "VAT Base Amount" <> 0 then
- "VAT %" :=
- Round(100 * ("Amount Including VAT" - "VAT Base Amount") / "VAT Base Amount", 0.00001)
- else
- ClearVATpct();
- end;
- end;
- end;
-
- InitOutstandingAmount();
- UpdateUnitCost();
- end;
- }
- field(30; "Amount Including VAT"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Amount Including VAT';
- Editable = false;
-
- trigger OnValidate()
- begin
- GetPurchHeader();
- "Amount Including VAT" := Round("Amount Including VAT", Currency."Amount Rounding Precision");
- case "VAT Calculation Type" of
- "VAT Calculation Type"::"Normal VAT",
- "VAT Calculation Type"::"Reverse Charge VAT",
- "VAT Calculation Type"::"No Taxable VAT":
- begin
- Amount :=
- Round(
- "Amount Including VAT" /
- (1 + (1 - GetVatBaseDiscountPct(PurchHeader) / 100) * GetVATPct() / 100),
- Currency."Amount Rounding Precision");
- "VAT Base Amount" :=
- Round(Amount * (1 - GetVatBaseDiscountPct(PurchHeader) / 100), Currency."Amount Rounding Precision");
- OnValidateAmountIncludingVATOnAfterCalculateNormalVAT(Rec, PurchHeader, Currency);
- end;
- "VAT Calculation Type"::"Full VAT":
- begin
- Amount := 0;
- "VAT Base Amount" := 0;
- end;
- "VAT Calculation Type"::"Sales Tax":
- begin
- PurchHeader.TestField("VAT Base Discount %", 0);
- if "Use Tax" then begin
- Amount := "Amount Including VAT";
- "VAT Base Amount" := Amount;
- end else begin
- Amount :=
- Round(
- SalesTaxCalculate.ReverseCalculateTax(
- "Tax Area Code", "Tax Group Code", "Tax Liable", PurchHeader."Posting Date",
- "Amount Including VAT", "Quantity (Base)", PurchHeader."Currency Factor"),
- Currency."Amount Rounding Precision");
- OnAfterSalesTaxCalculateReverse(Rec, PurchHeader, Currency);
- "VAT Base Amount" := Amount;
- if "VAT Base Amount" <> 0 then
- "VAT %" :=
- Round(100 * ("Amount Including VAT" - "VAT Base Amount") / "VAT Base Amount", 0.00001)
- else
- ClearVATPct();
- end;
- end;
- end;
-
- InitOutstandingAmount();
- UpdateUnitCost();
- end;
- }
- field(31; "Unit Price (LCY)"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 2;
- Caption = 'Unit Price (LCY)';
- ToolTip = 'Specifies the price, in LCY, of one unit of the item or resource. You can enter a price manually or have it entered according to the Price/Profit Calculation field on the related card.';
- }
- field(32; "Allow Invoice Disc."; Boolean)
- {
- Caption = 'Allow Invoice Disc.';
- ToolTip = 'Specifies if the invoice line is included when the invoice discount is calculated.';
- InitValue = true;
-
- trigger OnValidate()
- begin
- TestStatusOpen();
- if ("VAT Calculation Type" = "VAT Calculation Type"::"Full VAT") and "Allow Invoice Disc." then
- Error(CannotAllowInvDiscountErr, FieldCaption("Allow Invoice Disc."));
-
- if "Allow Invoice Disc." <> xRec."Allow Invoice Disc." then begin
- if not "Allow Invoice Disc." then begin
- "Inv. Discount Amount" := 0;
- "Inv. Disc. Amount to Invoice" := 0;
- end;
- "Recalculate Invoice Disc." := true;
- UpdateAmounts();
- UpdateUnitCost();
- end;
- end;
- }
- field(34; "Gross Weight"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Gross Weight';
- ToolTip = 'Specifies the gross weight of one unit of the item. In the purchase statistics window, the gross weight on the line is included in the total gross weight of all the lines for the particular purchase document.';
- DecimalPlaces = 0 : 5;
- }
- field(35; "Net Weight"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Net Weight';
- ToolTip = 'Specifies the net weight of one unit of the item. In the purchase statistics window, the net weight on the line is included in the total net weight of all the lines for the particular purchase document.';
- DecimalPlaces = 0 : 5;
- }
- field(36; "Units per Parcel"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Units per Parcel';
- ToolTip = 'Specifies the number of units per parcel of the item. In the purchase statistics window, the number of units per parcel on the line helps to determine the total number of units for all the lines for the particular purchase document.';
- DecimalPlaces = 0 : 5;
- }
- field(37; "Unit Volume"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Unit Volume';
- ToolTip = 'Specifies the volume of one unit of the item. In the purchase statistics window, the volume of one unit of the item on the line is included in the total volume of all the lines for the particular purchase document.';
- DecimalPlaces = 0 : 5;
- }
- field(38; "Appl.-to Item Entry"; Integer)
- {
- AccessByPermission = TableData Item = R;
- Caption = 'Appl.-to Item Entry';
- ToolTip = 'Specifies the number of the item ledger entry that the document or journal line is applied -to.';
-
- trigger OnLookup()
- begin
- SelectItemEntry();
- end;
-
- trigger OnValidate()
- begin
- if "Appl.-to Item Entry" <> 0 then
- "Location Code" := CheckApplToItemLedgEntry();
- end;
- }
- field(40; "Shortcut Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,2,1';
- Caption = 'Shortcut Dimension 1 Code';
- 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.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1),
- Blocked = const(false));
-
- trigger OnValidate()
- begin
- Rec.ValidateShortcutDimCode(1, "Shortcut Dimension 1 Code");
- end;
- }
- field(41; "Shortcut Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,2,2';
- Caption = 'Shortcut Dimension 2 Code';
- 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.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2),
- Blocked = const(false));
-
- trigger OnValidate()
- begin
- Rec.ValidateShortcutDimCode(2, "Shortcut Dimension 2 Code");
- end;
- }
- field(45; "Job No."; Code[20])
- {
- Caption = 'Project No.';
- ToolTip = 'Specifies the number of the related project. If you fill in this field and the Project Task No. field, then a project ledger entry will be posted together with the purchase line.';
- TableRelation = Job;
-
- trigger OnValidate()
- var
- Job: Record Job;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateJobNo(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- TestField("Drop Shipment", false);
- TestField("Special Order", false);
- TestField("Receipt No.", '');
- MatchedOrderLineMgmt.IsLineMatched(Rec, true);
-
- if "Document Type" = "Document Type"::Order then
- TestField("Quantity Received", 0);
-
- if CheckReservationForJobNo() then
- TestField("Job No.", '');
-
- if (xRec."Job No." <> "Job No.") and (Quantity <> 0) then
- if Type = Type::Item then
- PurchasesWarehouseMgt.PurchaseLineVerifyChange(Rec, xRec);
-
- PlanPriceCalcByField(FieldNo("Job No."));
- InitJobFields();
-
- if "Job No." = '' then begin
- CreateDimFromDefaultDim(Rec.FieldNo("Job No."));
- exit;
- end;
-
- VerifyLineTypeForJob();
- CheckWMS();
-
- IsHandled := false;
- OnValidateJobNoOnBeforeGetJob(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- Job.Get("Job No.");
- Job.TestBlocked();
- "Job Currency Code" := Job."Currency Code";
-
- CreateDimFromDefaultDim(Rec.FieldNo("Job No."));
-
- UpdateDirectUnitCostByField(FieldNo("Job No."));
-
- if (xRec."Line Discount %" <> "Line Discount %") and ("Line Discount Amount" <> 0) then
- UpdateLineDiscPct();
- end;
- }
- field(54; "Indirect Cost %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Indirect Cost %';
- 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.';
- DecimalPlaces = 0 : 5;
- MinValue = 0;
-
- trigger OnValidate()
- var
- Item: Record Item;
- ShouldCheckCostingMethod: Boolean;
- begin
- TestField("No.");
- TestStatusOpen();
-
- CheckLineTypeOnIndirectCostPercentUpdate();
-
- ShouldCheckCostingMethod := (Type = Type::Item) and (not IsProdOrder());
- OnValidateIndirectCostOnAfterCalcShouldCheckCostingMethod(Rec, ShouldCheckCostingMethod);
- if ShouldCheckCostingMethod then begin
- GetItem(Item);
- Item.TestField(Type, Item.Type::Inventory);
- if Item."Costing Method" = Item."Costing Method"::Standard then
- Error(
- Text010,
- FieldCaption("Indirect Cost %"), Item.FieldCaption("Costing Method"), Item."Costing Method");
- end;
-
- UpdateUnitCost();
- end;
- }
- field(56; "Recalculate Invoice Disc."; Boolean)
- {
- Caption = 'Recalculate Invoice Disc.';
- Editable = false;
- }
- field(57; "Outstanding Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Outstanding Amount';
- Editable = false;
-
- trigger OnValidate()
- var
- Currency2: Record Currency;
- begin
- GetPurchHeader();
- Currency2.InitRoundingPrecision();
- if PurchHeader."Currency Code" <> '' then
- "Outstanding Amount (LCY)" :=
- Round(
- CurrExchRate.ExchangeAmtFCYToLCY(
- GetDate(), "Currency Code",
- "Outstanding Amount", PurchHeader."Currency Factor"),
- Currency2."Amount Rounding Precision")
- else
- "Outstanding Amount (LCY)" :=
- Round("Outstanding Amount", Currency2."Amount Rounding Precision");
-
- "Outstanding Amt. Ex. VAT (LCY)" :=
- Round("Outstanding Amount (LCY)" / (1 + "VAT %" / 100), Currency2."Amount Rounding Precision");
- end;
- }
- field(58; "Qty. Rcd. Not Invoiced"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Qty. Rcd. Not Invoiced';
- DecimalPlaces = 0 : 5;
- Editable = false;
- }
- field(59; "Amt. Rcd. Not Invoiced"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Amt. Rcd. Not Invoiced';
- Editable = false;
-
- trigger OnValidate()
- var
- Currency2: Record Currency;
- begin
- GetPurchHeader();
- Currency2.InitRoundingPrecision();
- if PurchHeader."Currency Code" <> '' then
- "Amt. Rcd. Not Invoiced (LCY)" :=
- Round(
- CurrExchRate.ExchangeAmtFCYToLCY(
- GetDate(), "Currency Code",
- "Amt. Rcd. Not Invoiced", PurchHeader."Currency Factor"),
- Currency2."Amount Rounding Precision")
- else
- "Amt. Rcd. Not Invoiced (LCY)" :=
- Round("Amt. Rcd. Not Invoiced", Currency2."Amount Rounding Precision");
-
- "A. Rcd. Not Inv. Ex. VAT (LCY)" :=
- Round("Amt. Rcd. Not Invoiced (LCY)" / (1 + "VAT %" / 100), Currency2."Amount Rounding Precision");
- end;
- }
- field(60; "Quantity Received"; Decimal)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- AutoFormatType = 0;
- Caption = 'Quantity Received';
- DecimalPlaces = 0 : 5;
- Editable = false;
- ToolTip = 'Specifies how many units of the item on the line have been posted as received.';
-
- }
- field(61; "Quantity Invoiced"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Quantity Invoiced';
- ToolTip = 'Specifies how many units of the item on the line have been posted as invoiced.';
- DecimalPlaces = 0 : 5;
- Editable = false;
- }
- field(63; "Receipt No."; Code[20])
- {
- Caption = 'Receipt No.';
- Editable = false;
- }
- field(64; "Receipt Line No."; Integer)
- {
- Caption = 'Receipt Line No.';
- Editable = false;
- }
- field(65; "Order No."; Code[20])
- {
- Caption = 'Order No.';
- ToolTip = 'Specifies the order number this line is associated with.';
- }
- field(66; "Order Line No."; Integer)
- {
- Caption = 'Order Line No.';
- }
- field(67; "Profit %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Profit %';
- DecimalPlaces = 0 : 5;
- Editable = false;
- }
- field(68; "Pay-to Vendor No."; Code[20])
- {
- Caption = 'Pay-to Vendor No.';
- Editable = false;
- TableRelation = Vendor;
- }
- field(69; "Inv. Discount Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Inv. Discount Amount';
- Editable = false;
- ToolTip = 'Specifies the total calculated invoice discount amount for the line.';
-
- trigger OnValidate()
- begin
- UpdateAmounts();
- UpdateUnitCost();
- CalcInvDiscToInvoice();
- end;
- }
- field(70; "Vendor Item No."; Text[50])
- {
- Caption = 'Vendor Item No.';
-
- trigger OnValidate()
- begin
- if PurchHeader."Send IC Document" and
- ("IC Partner Ref. Type" = "IC Partner Ref. Type"::"Vendor Item No.")
- then
- "IC Partner Reference" := "Vendor Item No.";
- end;
- }
- field(71; "Sales Order No."; Code[20])
- {
- Caption = 'Sales Order No.';
- Editable = false;
- TableRelation = if ("Drop Shipment" = const(true)) "Sales Header"."No." where("Document Type" = const(Order));
-
- trigger OnValidate()
- begin
- if (xRec."Sales Order No." <> "Sales Order No.") and (Quantity <> 0) then begin
- PurchLineReserve.VerifyChange(Rec, xRec);
- PurchasesWarehouseMgt.PurchaseLineVerifyChange(Rec, xRec);
- end;
- end;
- }
- field(72; "Sales Order Line No."; Integer)
- {
- Caption = 'Sales Order Line No.';
- Editable = false;
- TableRelation = if ("Drop Shipment" = const(true)) "Sales Line"."Line No." where("Document Type" = const(Order),
- "Document No." = field("Sales Order No."));
-
- trigger OnValidate()
- begin
- if (xRec."Sales Order Line No." <> "Sales Order Line No.") and (Quantity <> 0) then begin
- PurchLineReserve.VerifyChange(Rec, xRec);
- PurchasesWarehouseMgt.PurchaseLineVerifyChange(Rec, xRec);
- end;
- end;
- }
- field(73; "Drop Shipment"; Boolean)
- {
- AccessByPermission = TableData "Drop Shpt. Post. Buffer" = R;
- Caption = 'Drop Shipment';
- ToolTip = 'Specifies if your vendor ships the items directly to your customer.';
- Editable = false;
-
- trigger OnValidate()
- begin
- if (xRec."Drop Shipment" <> "Drop Shipment") and (Quantity <> 0) then begin
- PurchLineReserve.VerifyChange(Rec, xRec);
- PurchasesWarehouseMgt.PurchaseLineVerifyChange(Rec, xRec);
- end;
- if "Drop Shipment" then begin
- "Bin Code" := '';
- Evaluate("Inbound Whse. Handling Time", '<0D>');
- Validate("Inbound Whse. Handling Time");
- Evaluate("Safety Lead Time", '<0D>');
- Validate("Safety Lead Time");
- InitOutstanding();
- InitQtyToReceive();
- end;
- end;
- }
- field(74; "Gen. Bus. Posting Group"; Code[20])
- {
- Caption = 'Gen. Bus. Posting Group';
- 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.';
- TableRelation = "Gen. Business Posting Group";
-
- trigger OnValidate()
- var
- ValidateVATBusPostingGroup: Boolean;
- begin
- ValidateVATBusPostingGroup := xRec."Gen. Bus. Posting Group" <> "Gen. Bus. Posting Group";
- OnValidateGenBusPostingGroupOnBeforeValidateVATBusPostingGroup(Rec, ValidateVATBusPostingGroup);
- if ValidateVATBusPostingGroup then
- if GenBusPostingGrp.ValidateVatBusPostingGroup(GenBusPostingGrp, "Gen. Bus. Posting Group") then
- Validate("VAT Bus. Posting Group", GenBusPostingGrp."Def. VAT Bus. Posting Group");
- end;
- }
- field(75; "Gen. Prod. Posting Group"; Code[20])
- {
- Caption = 'Gen. Prod. Posting Group';
- 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.';
- TableRelation = "Gen. Product Posting Group";
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateGenProdPostingGroup(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- if xRec."Gen. Prod. Posting Group" <> "Gen. Prod. Posting Group" then
- if GenProdPostingGrp.ValidateVatProdPostingGroup(GenProdPostingGrp, "Gen. Prod. Posting Group") then
- Validate("VAT Prod. Posting Group", GenProdPostingGrp."Def. VAT Prod. Posting Group");
- end;
- }
- field(77; "VAT Calculation Type"; Enum "Tax Calculation Type")
- {
- Caption = 'VAT Calculation Type';
- Editable = false;
- }
- field(78; "Transaction Type"; Code[10])
- {
- Caption = 'Transaction Type';
- TableRelation = "Transaction Type";
- }
- field(79; "Transport Method"; Code[10])
- {
- Caption = 'Transport Method';
- TableRelation = "Transport Method";
- }
- field(80; "Attached to Line No."; Integer)
- {
- Caption = 'Attached to Line No.';
- ToolTip = 'Specifies the line number to which this purchase line is attached.';
- Editable = false;
- TableRelation = "Purchase Line"."Line No." where("Document Type" = field("Document Type"),
- "Document No." = field("Document No."));
- }
- field(81; "Entry Point"; Code[10])
- {
- Caption = 'Entry Point';
- TableRelation = "Entry/Exit Point";
- }
- field(82; "Area"; Code[10])
- {
- Caption = 'Area';
- TableRelation = Area;
- }
- field(83; "Transaction Specification"; Code[10])
- {
- Caption = 'Transaction Specification';
- TableRelation = "Transaction Specification";
- }
- field(85; "Tax Area Code"; Code[20])
- {
- Caption = 'Tax Area Code';
- ToolTip = 'Specifies the tax area that is used to calculate and post sales tax.';
- TableRelation = "Tax Area";
-
- trigger OnValidate()
- begin
- UpdateAmounts();
- end;
- }
- field(86; "Tax Liable"; Boolean)
- {
- Caption = 'Tax Liable';
- ToolTip = 'Specifies if this vendor charges you sales tax for purchases.';
-
- trigger OnValidate()
- begin
- UpdateAmounts();
- end;
- }
- field(87; "Tax Group Code"; Code[20])
- {
- Caption = 'Tax Group Code';
- ToolTip = 'Specifies the tax group that is used to calculate and post sales tax.';
- TableRelation = "Tax Group";
-
- trigger OnValidate()
- begin
- TestStatusOpen();
- UpdateAmounts();
- end;
- }
- field(88; "Use Tax"; Boolean)
- {
- Caption = 'Use Tax';
- 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.';
-
- trigger OnValidate()
- begin
- UpdateAmounts();
- end;
- }
- field(89; "VAT Bus. Posting Group"; Code[20])
- {
- Caption = 'VAT Bus. Posting Group';
- ToolTip = 'Specifies the vendor''s VAT specification to link transactions made for this vendor with the appropriate general ledger account according to the VAT posting setup.';
- TableRelation = "VAT Business Posting Group";
-
- trigger OnValidate()
- begin
- Validate("VAT Prod. Posting Group");
- end;
- }
- field(90; "VAT Prod. Posting Group"; Code[20])
- {
- Caption = 'VAT Prod. Posting Group';
- 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.';
- TableRelation = "VAT Product Posting Group";
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- ShouldUpdateUnitCost: Boolean;
- begin
- TestStatusOpen();
-
- IsHandled := false;
- OnValidateVATProdPostingGroupOnAfterTestStatusOpen(Rec, IsHandled, xRec);
- if not IsHandled then begin
- CheckPrepmtAmtInvEmpty();
- IsHandled := false;
- OnValidateVATProdPostingGroupOnBeforeGetVATPostingSetup(Rec, VATPostingSetup, IsHandled, xRec);
- if not IsHandled then
- VATPostingSetup.Get("VAT Bus. Posting Group", "VAT Prod. Posting Group");
- OnValidateVATProdPostingGroupOnAfterVATPostingSetupGet(VATPostingSetup);
- ClearVATDifference();
- NonDeductibleVAT.InitNonDeductibleVATDiff(Rec);
- GetPurchHeader();
- CopyFromVATPostingSetup(VATPostingSetup);
- NonDeductibleVAT.SetNonDeductiblePct(Rec);
-
- IsHandled := false;
- OnValidateVATProdPostingGroupOnBeforeCheckVATCalcType(Rec, VATPostingSetup, IsHandled, CurrFieldNo);
- if not IsHandled then
- case "VAT Calculation Type" of
- "VAT Calculation Type"::"Reverse Charge VAT",
- "VAT Calculation Type"::"Sales Tax":
- ClearVATPct();
- "VAT Calculation Type"::"Full VAT":
- begin
- TestField(Type, Type::"G/L Account");
- TestField("No.", VATPostingSetup.GetPurchAccount(false));
- end;
- end;
- ShouldUpdateUnitCost := PurchHeader."Prices Including VAT" and (Rec.Type in [Rec.Type::"G/L Account", Rec.Type::Item, Rec.Type::Resource]);
- OnValidateVATProdPostingGroupOnAfterCalcShouldUpdateUnitCost(Rec, VATPostingSetup, ShouldUpdateUnitCost);
- if ShouldUpdateUnitCost then
- Validate("Direct Unit Cost",
- Round(
- "Direct Unit Cost" * (100 + GetVATPct()) / (100 + xRec.GetVATPct()),
- Currency."Unit-Amount Rounding Precision"));
- UpdateAmounts();
- end;
- end;
- }
- field(91; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- ToolTip = 'Specifies the currency that is used on the entry.';
- Editable = false;
- TableRelation = Currency;
- }
- field(92; "Outstanding Amount (LCY)"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- Caption = 'Outstanding Amount (LCY)';
- ToolTip = 'Specifies the amount for the items on the order that have not yet been received in LCY.';
- Editable = false;
- }
- field(93; "Amt. Rcd. Not Invoiced (LCY)"; Decimal)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- AutoFormatExpression = '';
- AutoFormatType = 1;
- Caption = 'Amt. Rcd. Not Invoiced (LCY)';
- ToolTip = 'Specifies the sum, in LCY, for items that have been received but have not yet been invoiced. The value in the Amt. Rcd. Not Invoiced (LCY) field is used for entries in the Purchase Line table of document type Order to calculate and update the contents of this field.';
- Editable = false;
- }
- field(95; "Reserved Quantity"; Decimal)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- AutoFormatType = 0;
- CalcFormula = sum("Reservation Entry".Quantity where("Source ID" = field("Document No."),
- "Source Ref. No." = field("Line No."),
- "Source Type" = const(39),
-#pragma warning disable AL0603
- "Source Subtype" = field("Document Type"),
-#pragma warning restore
- "Reservation Status" = const(Reservation)));
- Caption = 'Reserved Quantity';
- ToolTip = 'Specifies how many item units on this line have been reserved.';
- DecimalPlaces = 0 : 5;
- Editable = false;
- FieldClass = FlowField;
- }
- field(97; "Blanket Order No."; Code[20])
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- Caption = 'Blanket Order No.';
- ToolTip = 'Specifies the number of the blanket order that the record originates from.';
- TableRelation = "Purchase Header"."No." where("Document Type" = const("Blanket Order"));
-
- trigger OnLookup()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupBlanketOrderNo(Rec, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Quantity Received", 0);
- BlanketOrderLookup();
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- TestField("Quantity Received", 0);
-
- IsHandled := false;
- OnValidateBlanketOrderNoOnAfterCheck(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if "Blanket Order No." = '' then
- "Blanket Order Line No." := 0
- else
- Validate("Blanket Order Line No.");
- end;
- }
- field(98; "Blanket Order Line No."; Integer)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- Caption = 'Blanket Order Line No.';
- ToolTip = 'Specifies the number of the blanket order line that the record originates from.';
- TableRelation = "Purchase Line"."Line No." where("Document Type" = const("Blanket Order"),
- "Document No." = field("Blanket Order No."));
-
- trigger OnLookup()
- begin
- BlanketOrderLookup();
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateBlanketOrderLineNo(Rec, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Quantity Received", 0);
- if "Blanket Order Line No." <> 0 then begin
- PurchLine2.Get("Document Type"::"Blanket Order", "Blanket Order No.", "Blanket Order Line No.");
- PurchLine2.TestField(Type, Type);
- PurchLine2.TestField("No.", "No.");
- PurchLine2.TestField("Pay-to Vendor No.", "Pay-to Vendor No.");
- PurchLine2.TestField("Buy-from Vendor No.", "Buy-from Vendor No.");
- if "Drop Shipment" or "Special Order" then begin
- PurchLine2.TestField("Variant Code", "Variant Code");
- PurchLine2.TestField("Location Code", "Location Code");
- PurchLine2.TestField("Unit of Measure Code", "Unit of Measure Code");
- end else begin
- Validate("Variant Code", PurchLine2."Variant Code");
- Validate("Location Code", PurchLine2."Location Code");
- Validate("Unit of Measure Code", PurchLine2."Unit of Measure Code");
- end;
- Validate("Direct Unit Cost", PurchLine2."Direct Unit Cost");
- Validate("Line Discount %", PurchLine2."Line Discount %");
- OnAfterValidateBlanketOrderLineNo(Rec, PurchLine2);
- end;
- end;
- }
- field(99; "VAT Base Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'VAT Base Amount';
- Editable = false;
- }
- field(100; "Unit Cost"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 2;
- Caption = 'Unit Cost';
- Editable = false;
- }
- field(101; "System-Created Entry"; Boolean)
- {
- Caption = 'System-Created Entry';
- Editable = false;
- }
- field(103; "Line Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CaptionClass = GetCaptionClass(FieldNo("Line Amount"));
- Caption = 'Line Amount';
- ToolTip = 'Specifies the net amount, excluding any invoice discount amount, that must be paid for products on the line.';
-
- trigger OnValidate()
- var
- MaxLineAmount: Decimal;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateLineAmount(Rec, xRec, CurrFieldNo, IsHandled, Currency);
- if IsHandled then
- exit;
-
- TestField(Type);
- TestField(Quantity);
- CheckDirectUnitCost();
-
- GetPurchHeader();
- "Line Amount" := Round("Line Amount", Currency."Amount Rounding Precision");
- MaxLineAmount := Round(Quantity * "Direct Unit Cost", Currency."Amount Rounding Precision");
- OnValidateLineAmountOnAfterCalcMaxLineAmount(Rec, MaxLineAmount, Currency);
-
- CheckLineAmount(MaxLineAmount);
-
- IsHandled := false;
- OnValidateLineAmountBeforeValidateLineDiscountAmount(Rec, Currency, IsHandled, CurrFieldNo);
- if not IsHandled then
- Validate("Line Discount Amount", MaxLineAmount - "Line Amount");
- end;
- }
- field(104; "VAT Difference"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'VAT Difference';
- Editable = false;
- }
- field(105; "Inv. Disc. Amount to Invoice"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Inv. Disc. Amount to Invoice';
- ToolTip = 'Specifies the actual invoice discount amount that will be posted for the line on the invoice.';
- Editable = false;
- }
- field(106; "VAT Identifier"; Code[20])
- {
- Caption = 'VAT Identifier';
- Editable = false;
- }
- field(107; "IC Partner Ref. Type"; Enum "IC Partner Reference Type")
- {
- AccessByPermission = TableData "IC G/L Account" = R;
- Caption = 'IC Partner Ref. Type';
- ToolTip = 'Specifies the item or account in your IC partner''s company that corresponds to the item or account on the line.';
-
- trigger OnValidate()
- var
- Item: Record Item;
- begin
- if "IC Partner Code" <> '' then
- "IC Partner Ref. Type" := "IC Partner Ref. Type"::"G/L Account";
- if "IC Partner Ref. Type" <> xRec."IC Partner Ref. Type" then
- "IC Partner Reference" := '';
- if "IC Partner Ref. Type" = "IC Partner Ref. Type"::"Common Item No." then begin
- GetItem(Item);
- Item.TestField("Common Item No.");
- "IC Partner Reference" := Item."Common Item No.";
- end;
- end;
- }
- field(108; "IC Partner Reference"; Code[20])
- {
- AccessByPermission = TableData "IC G/L Account" = R;
- Caption = 'IC Partner Reference';
- 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.';
-
- trigger OnLookup()
- var
- ICGLAccount: Record "IC G/L Account";
- Item: Record Item;
- ItemVendorCatalog: Record "Item Vendor";
- begin
- if "No." <> '' then
- case "IC Partner Ref. Type" of
- "IC Partner Ref. Type"::"G/L Account":
- begin
- if ICGLAccount.Get("IC Partner Reference") then;
- if PAGE.RunModal(PAGE::"IC G/L Account List", ICGLAccount) = ACTION::LookupOK then
- Validate("IC Partner Reference", ICGLAccount."No.");
- end;
- "IC Partner Ref. Type"::Item:
- begin
- if Item.Get("IC Partner Reference") then;
- if PAGE.RunModal(PAGE::"Item List", Item) = ACTION::LookupOK then
- Validate("IC Partner Reference", Item."No.");
- end;
- "IC Partner Ref. Type"::"Vendor Item No.":
- begin
- GetPurchHeader();
- ItemVendorCatalog.SetCurrentKey("Vendor No.");
- ItemVendorCatalog.SetRange("Vendor No.", PurchHeader."Buy-from Vendor No.");
- if PAGE.RunModal(PAGE::"Vendor Item Catalog", ItemVendorCatalog) = ACTION::LookupOK then
- Validate("IC Partner Reference", ItemVendorCatalog."Vendor Item No.");
- end;
- end;
- end;
- }
- field(109; "Prepayment %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Prepayment %';
- ToolTip = 'Specifies the prepayment percentage to use to calculate the prepayment for purchases.';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
-
- trigger OnValidate()
- begin
- TestStatusOpen();
- UpdatePrepmtSetupFields();
-
- if HasTypeToFillMandatoryFields() then
- UpdateAmounts();
- UpdateBaseAmounts(Amount, "Amount Including VAT", "VAT Base Amount");
- end;
- }
- field(110; "Prepmt. Line Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CaptionClass = GetCaptionClass(FieldNo("Prepmt. Line Amount"));
- Caption = 'Prepmt. Line Amount';
- 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.';
- MinValue = 0;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePrepmtLineAmount(Rec, PrePaymentLineAmountEntered, IsHandled);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- PrePaymentLineAmountEntered := true;
- TestField("Line Amount");
- if "Prepmt. Line Amount" < "Prepmt. Amt. Inv." then
- FieldError("Prepmt. Line Amount", StrSubstNo(Text038, "Prepmt. Amt. Inv."));
- if "Prepmt. Line Amount" > "Line Amount" then
- FieldError("Prepmt. Line Amount", StrSubstNo(Text039, "Line Amount"));
- Validate("Prepayment %", "Prepmt. Line Amount" * 100 / "Line Amount");
- end;
- }
- field(111; "Prepmt. Amt. Inv."; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CaptionClass = GetCaptionClass(FieldNo("Prepmt. Amt. Inv."));
- Caption = 'Prepmt. Amt. Inv.';
- ToolTip = 'Specifies the prepayment amount that has already been invoiced to the customer for this purchase line.';
- Editable = false;
- }
- field(112; "Prepmt. Amt. Incl. VAT"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Prepmt. Amt. Incl. VAT';
- Editable = false;
- }
- field(113; "Prepayment Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Prepayment Amount';
- Editable = false;
- }
- field(114; "Prepmt. VAT Base Amt."; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Prepmt. VAT Base Amt.';
- Editable = false;
- }
- field(115; "Prepayment VAT %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Prepayment VAT %';
- DecimalPlaces = 0 : 5;
- Editable = false;
- MinValue = 0;
- }
- field(116; "Prepmt. VAT Calc. Type"; Enum "Tax Calculation Type")
- {
- Caption = 'Prepmt. VAT Calc. Type';
- Editable = false;
- }
- field(117; "Prepayment VAT Identifier"; Code[20])
- {
- Caption = 'Prepayment VAT Identifier';
- Editable = false;
- }
- field(118; "Prepayment Tax Area Code"; Code[20])
- {
- Caption = 'Prepayment Tax Area Code';
- TableRelation = "Tax Area";
-
- trigger OnValidate()
- begin
- UpdateAmounts();
- end;
- }
- field(119; "Prepayment Tax Liable"; Boolean)
- {
- Caption = 'Prepayment Tax Liable';
-
- trigger OnValidate()
- begin
- UpdateAmounts();
- end;
- }
- field(120; "Prepayment Tax Group Code"; Code[20])
- {
- Caption = 'Prepayment Tax Group Code';
- TableRelation = "Tax Group";
-
- trigger OnValidate()
- begin
- TestStatusOpen();
- UpdateAmounts();
- end;
- }
- field(121; "Prepmt Amt to Deduct"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CaptionClass = GetCaptionClass(FieldNo("Prepmt Amt to Deduct"));
- Caption = 'Prepmt Amt to Deduct';
- ToolTip = 'Specifies the prepayment amount that has already been deducted from ordinary invoices posted for this purchase order line.';
- MinValue = 0;
-
- trigger OnValidate()
- begin
- if "Prepmt Amt to Deduct" > "Prepmt. Amt. Inv." - "Prepmt Amt Deducted" then
- FieldError(
- "Prepmt Amt to Deduct",
- StrSubstNo(Text039, "Prepmt. Amt. Inv." - "Prepmt Amt Deducted"));
-
- if "Prepmt Amt to Deduct" > "Qty. to Invoice" * "Direct Unit Cost" then
- FieldError(
- "Prepmt Amt to Deduct",
- StrSubstNo(Text039, "Qty. to Invoice" * "Direct Unit Cost"));
- if ("Prepmt. Amt. Inv." - "Prepmt Amt to Deduct" - "Prepmt Amt Deducted") >
- (Quantity - "Qty. to Invoice" - "Quantity Invoiced") * "Direct Unit Cost"
- then
- FieldError(
- "Prepmt Amt to Deduct",
- StrSubstNo(Text038,
- "Prepmt. Amt. Inv." - "Prepmt Amt Deducted" -
- (Quantity - "Qty. to Invoice" - "Quantity Invoiced") * "Direct Unit Cost"));
- end;
- }
- field(122; "Prepmt Amt Deducted"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CaptionClass = GetCaptionClass(FieldNo("Prepmt Amt Deducted"));
- Caption = 'Prepmt Amt Deducted';
- ToolTip = 'Specifies the prepayment amount that has already been deducted from ordinary invoices posted for this purchase order line.';
- Editable = false;
- }
- field(123; "Prepayment Line"; Boolean)
- {
- Caption = 'Prepayment Line';
- Editable = false;
- }
- field(124; "Prepmt. Amount Inv. Incl. VAT"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Prepmt. Amount Inv. Incl. VAT';
- Editable = false;
- }
- field(129; "Prepmt. Amount Inv. (LCY)"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- Caption = 'Prepmt. Amount Inv. (LCY)';
- Editable = false;
- }
- field(130; "IC Partner Code"; Code[20])
- {
- Caption = 'IC Partner Code';
- ToolTip = 'Specifies the code of the intercompany partner that the transaction is related to if the entry was created from an intercompany transaction.';
- TableRelation = "IC Partner";
-
- trigger OnValidate()
- begin
- if "IC Partner Code" <> '' then begin
- TestField(Type, Type::"G/L Account");
- GetPurchHeader();
- PurchHeader.TestField("Buy-from IC Partner Code", '');
- PurchHeader.TestField("Pay-to IC Partner Code", '');
- Validate("IC Partner Ref. Type", "IC Partner Ref. Type"::"G/L Account");
- end;
- end;
- }
- field(132; "Prepmt. VAT Amount Inv. (LCY)"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- Caption = 'Prepmt. VAT Amount Inv. (LCY)';
- Editable = false;
- }
- field(135; "Prepayment VAT Difference"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Prepayment VAT Difference';
- Editable = false;
- }
- field(136; "Prepmt VAT Diff. to Deduct"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Prepmt VAT Diff. to Deduct';
- Editable = false;
- }
- field(137; "Prepmt VAT Diff. Deducted"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Prepmt VAT Diff. Deducted';
- Editable = false;
- }
- field(138; "IC Item Reference No."; Code[50])
- {
- AccessByPermission = TableData "Item Reference" = R;
- Caption = 'IC Item Reference No.';
-
- trigger OnLookup()
- var
- ItemReference: Record "Item Reference";
- ItemVendorCatalog: Record "Item Vendor";
- begin
- if "No." <> '' then
- case "IC Partner Ref. Type" of
- "IC Partner Ref. Type"::"Cross Reference":
- begin
- GetPurchHeader();
- ItemReference.Reset();
- ItemReference.SetCurrentKey("Reference Type", "Reference Type No.");
- ItemReference.SetFilter(
- "Reference Type", '%1|%2',
- ItemReference."Reference Type"::Vendor, ItemReference."Reference Type"::" ");
- ItemReference.SetFilter("Reference Type No.", '%1|%2', PurchHeader."Buy-from Vendor No.", '');
- if PAGE.RunModal(PAGE::"Item Reference List", ItemReference) = ACTION::LookupOK then
- Validate("IC Item Reference No.", ItemReference."Reference No.");
- end;
- "IC Partner Ref. Type"::"Vendor Item No.":
- begin
- GetPurchHeader();
- ItemVendorCatalog.SetCurrentKey("Vendor No.");
- ItemVendorCatalog.SetRange("Vendor No.", PurchHeader."Buy-from Vendor No.");
- if PAGE.RunModal(PAGE::"Vendor Item Catalog", ItemVendorCatalog) = ACTION::LookupOK then
- Validate("IC Item Reference No.", ItemVendorCatalog."Vendor Item No.");
- end;
- end;
- end;
- }
- field(140; "Outstanding Amt. Ex. VAT (LCY)"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- Caption = 'Outstanding Amt. Ex. VAT (LCY)';
- }
- field(141; "A. Rcd. Not Inv. Ex. VAT (LCY)"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- Caption = 'A. Rcd. Not Inv. Ex. VAT (LCY)';
- }
- field(145; "Pmt. Discount Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Pmt. Discount Amount';
-
- trigger OnValidate()
- begin
- TestField(Quantity);
- UpdateAmounts();
- end;
- }
- field(146; "Prepmt. Pmt. Discount Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Prepmt. Pmt. Discount Amount';
- Editable = false;
- }
- field(480; "Dimension Set ID"; Integer)
- {
- Caption = 'Dimension Set ID';
- Editable = false;
- TableRelation = "Dimension Set Entry";
-
- trigger OnLookup()
- begin
- Rec.ShowDimensions();
- end;
-
- trigger OnValidate()
- begin
- DimMgt.UpdateGlobalDimFromDimSetID("Dimension Set ID", "Shortcut Dimension 1 Code", "Shortcut Dimension 2 Code");
- end;
- }
- field(1001; "Job Task No."; Code[20])
- {
- Caption = 'Project Task No.';
- ToolTip = 'Specifies the number of the related project task.';
- TableRelation = "Job Task"."Job Task No." where("Job No." = field("Job No."));
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateJobTaskNo(xRec, IsHandled, CurrFieldNo, TempJobJnlLine);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- TestField("Receipt No.", '');
- MatchedOrderLineMgmt.IsLineMatched(Rec, true);
-
- if "Job Task No." <> xRec."Job Task No." then begin
- Validate("Job Planning Line No.", 0);
- if "Document Type" = "Document Type"::Order then
- TestField("Quantity Received", 0);
- if (Type = Type::Item) and (Quantity <> 0) then
- PurchasesWarehouseMgt.PurchaseLineVerifyChange(Rec, xRec);
- PlanPriceCalcByField(FieldNo("Job Task No."));
- end;
-
- if "Job Task No." = '' then begin
- Clear(TempJobJnlLine);
- "Job Line Type" := "Job Line Type"::" ";
- UpdateJobPrices();
- CreateDimFromDefaultDim(0);
- exit;
- end;
-
- JobSetCurrencyFactor();
- UpdateDirectUnitCostByField(FieldNo("Job Task No."));
- if JobTaskIsSet() then begin
- CreateTempJobJnlLine(true);
- UpdateJobPrices();
- end;
- UpdateDimensionsFromJobTask();
-
- if (xRec."Line Discount %" <> "Line Discount %") and
- (xRec."Job Task No." <> "Job Task No.") and
- ("Line Discount Amount" <> 0)
- then
- UpdateLineDiscPct();
- end;
- }
- field(1002; "Job Line Type"; Enum "Job Line Type")
- {
- AccessByPermission = TableData Job = R;
- Caption = 'Project Line Type';
- ToolTip = 'Specifies a Project Planning Line together with the posting of a project ledger entry.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateJobLineType(Rec, IsHandled);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- TestField("Receipt No.", '');
- MatchedOrderLineMgmt.IsLineMatched(Rec, true);
-
- if "Document Type" = "Document Type"::Order then
- TestField("Quantity Received", 0);
-
- if "Job Planning Line No." <> 0 then
- Error(Text048, FieldCaption("Job Line Type"), FieldCaption("Job Planning Line No."));
- end;
- }
- field(1003; "Job Unit Price"; Decimal)
- {
- AutoFormatType = 2;
- AutoFormatExpression = "Job Currency Code";
- AccessByPermission = TableData Job = R;
- BlankZero = true;
- Caption = 'Project Unit Price';
- ToolTip = 'Specifies the sales price per unit that applies to the item or general ledger expense that will be posted.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateJobUnitPrice(Rec, TempJobJnlLine, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Receipt No.", '');
- MatchedOrderLineMgmt.IsLineMatched(Rec, true);
-
- if "Document Type" = "Document Type"::Order then
- TestField("Quantity Received", 0);
-
- if JobTaskIsSet() then begin
- CreateTempJobJnlLine(false);
- TempJobJnlLine.Validate("Unit Price", "Job Unit Price");
- UpdateJobPrices();
- end;
- end;
- }
- field(1004; "Job Total Price"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatExpression = "Job Currency Code";
- AutoFormatType = 1;
- BlankZero = true;
- Caption = 'Project Total Price';
- ToolTip = 'Specifies the gross amount of the line that the purchase line applies to.';
- Editable = false;
- }
- field(1005; "Job Line Amount"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatExpression = "Job Currency Code";
- AutoFormatType = 1;
- BlankZero = true;
- Caption = 'Project Line Amount';
- ToolTip = 'Specifies the line amount of the project ledger entry that is related to the purchase line.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- OnBeforeValidateJobLineAmount(Rec, TempJobJnlLine, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Receipt No.", '');
- MatchedOrderLineMgmt.IsLineMatched(Rec, true);
-
- if "Document Type" = "Document Type"::Order then
- TestField("Quantity Received", 0);
-
- if JobTaskIsSet() then begin
- CreateTempJobJnlLine(false);
- TempJobJnlLine.Validate("Line Amount", "Job Line Amount");
- UpdateJobPrices();
- end;
- end;
- }
- field(1006; "Job Line Discount Amount"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatExpression = "Job Currency Code";
- AutoFormatType = 1;
- BlankZero = true;
- Caption = 'Project Line Discount Amount';
- ToolTip = 'Specifies the line discount amount of the project ledger entry that is related to the purchase line.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateJobLineDiscountAmount(Rec, TempJobJnlLine, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Receipt No.", '');
- MatchedOrderLineMgmt.IsLineMatched(Rec, true);
-
- if "Document Type" = "Document Type"::Order then
- TestField("Quantity Received", 0);
-
- if JobTaskIsSet() then begin
- CreateTempJobJnlLine(false);
- TempJobJnlLine.Validate("Line Discount Amount", "Job Line Discount Amount");
- UpdateJobPrices();
- end;
- end;
- }
- field(1007; "Job Line Discount %"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatType = 0;
- BlankZero = true;
- Caption = 'Project Line Discount %';
- ToolTip = 'Specifies the line discount percentage of the project ledger entry that is related to the purchase line.';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateJobLineDiscountPercent(Rec, TempJobJnlLine, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Receipt No.", '');
- MatchedOrderLineMgmt.IsLineMatched(Rec, true);
-
- if "Document Type" = "Document Type"::Order then
- TestField("Quantity Received", 0);
-
- if JobTaskIsSet() then begin
- CreateTempJobJnlLine(false);
- TempJobJnlLine.Validate("Line Discount %", "Job Line Discount %");
- UpdateJobPrices();
- end;
- end;
- }
- field(1008; "Job Unit Price (LCY)"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatExpression = '';
- AutoFormatType = 2;
- BlankZero = true;
- Caption = 'Project Unit Price (LCY)';
- Editable = false;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateJobUnitPriceLCY(Rec, TempJobJnlLine, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Receipt No.", '');
- MatchedOrderLineMgmt.IsLineMatched(Rec, true);
-
- if "Document Type" = "Document Type"::Order then
- TestField("Quantity Received", 0);
-
- if JobTaskIsSet() then begin
- CreateTempJobJnlLine(false);
- TempJobJnlLine.Validate("Unit Price (LCY)", "Job Unit Price (LCY)");
- UpdateJobPrices();
- end;
- end;
- }
- field(1009; "Job Total Price (LCY)"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatExpression = '';
- AutoFormatType = 1;
- BlankZero = true;
- Caption = 'Project Total Price (LCY)';
- Editable = false;
- }
- field(1010; "Job Line Amount (LCY)"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatExpression = '';
- AutoFormatType = 1;
- BlankZero = true;
- Caption = 'Project Line Amount (LCY)';
- Editable = false;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateJobLineAmountLCY(Rec, TempJobJnlLine, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Receipt No.", '');
- MatchedOrderLineMgmt.IsLineMatched(Rec, true);
-
- if "Document Type" = "Document Type"::Order then
- TestField("Quantity Received", 0);
-
- if JobTaskIsSet() then begin
- CreateTempJobJnlLine(false);
- TempJobJnlLine.Validate("Line Amount (LCY)", "Job Line Amount (LCY)");
- UpdateJobPrices();
- end;
- end;
- }
- field(1011; "Job Line Disc. Amount (LCY)"; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatExpression = '';
- AutoFormatType = 1;
- BlankZero = true;
- Caption = 'Project Line Disc. Amount (LCY)';
- Editable = false;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateJobLineDiscAmountLCY(Rec, TempJobJnlLine, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Receipt No.", '');
- MatchedOrderLineMgmt.IsLineMatched(Rec, true);
-
- if "Document Type" = "Document Type"::Order then
- TestField("Quantity Received", 0);
-
- if JobTaskIsSet() then begin
- CreateTempJobJnlLine(false);
- TempJobJnlLine.Validate("Line Discount Amount (LCY)", "Job Line Disc. Amount (LCY)");
- UpdateJobPrices();
- end;
- end;
- }
- field(1012; "Job Currency Factor"; Decimal)
- {
- AutoFormatType = 0;
- BlankZero = true;
- Caption = 'Project Currency Factor';
- }
- field(1013; "Job Currency Code"; Code[20])
- {
- Caption = 'Project Currency Code';
- }
- field(1019; "Job Planning Line No."; Integer)
- {
- AccessByPermission = TableData Job = R;
- BlankZero = true;
- Caption = 'Project Planning Line No.';
- ToolTip = 'Specifies the project planning line number that the usage should be linked to when the project journal is posted. You can only link to project planning lines that have the Apply Usage Link option enabled.';
-
- trigger OnLookup()
- var
- JobPlanningLine: Record "Job Planning Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateJobPlanningLineNo(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- JobPlanningLine.SetRange("Job No.", "Job No.");
- JobPlanningLine.SetRange("Job Task No.", "Job Task No.");
- case Type of
- Type::"G/L Account":
- JobPlanningLine.SetRange(Type, JobPlanningLine.Type::"G/L Account");
- Type::Item:
- JobPlanningLine.SetRange(Type, JobPlanningLine.Type::Item);
- end;
- JobPlanningLine.SetRange("No.", "No.");
- JobPlanningLine.SetRange("Usage Link", true);
- JobPlanningLine.SetRange("System-Created Entry", false);
-
- if PAGE.RunModal(0, JobPlanningLine) = ACTION::LookupOK then
- Validate("Job Planning Line No.", JobPlanningLine."Line No.");
- end;
-
- trigger OnValidate()
- var
- JobPlanningLine: Record "Job Planning Line";
- IsHandled: Boolean;
- begin
- if "Job Planning Line No." <> 0 then begin
- JobPlanningLine.Get("Job No.", "Job Task No.", "Job Planning Line No.");
- JobPlanningLine.TestField("Job No.", "Job No.");
- JobPlanningLine.TestField("Job Task No.", "Job Task No.");
- case Type of
- Type::"G/L Account":
- begin
- IsHandled := false;
- OnValidateJobPlanningLineNoOnBeforeGLAccountTest(Rec, JobPlanningLine, IsHandled);
- if not IsHandled then
- JobPlanningLine.TestField(Type, JobPlanningLine.Type::"G/L Account");
- end;
- Type::Item:
- JobPlanningLine.TestField(Type, JobPlanningLine.Type::Item);
- end;
-
- IsHandled := false;
- OnValidateJobPlanningLineNoOnBeforeTestFields(Rec, JobPlanningLine, IsHandled);
- if not IsHandled then begin
- JobPlanningLine.TestField("No.", "No.");
- JobPlanningLine.TestField("Usage Link", true);
- JobPlanningLine.TestField("System-Created Entry", false);
- end;
- "Job Line Type" := JobPlanningLine.ConvertToJobLineType();
- Validate(
- "Job Remaining Qty.",
- JobPlanningLine."Remaining Qty." - UOMMgt.CalcQtyFromBase("Qty. to Invoice (Base)", JobPlanningLine."Qty. per Unit of Measure"))
- end else
- Validate("Job Remaining Qty.", 0);
- end;
- }
- field(1030; "Job Remaining Qty."; Decimal)
- {
- AccessByPermission = TableData Job = R;
- AutoFormatType = 0;
- Caption = 'Project Remaining Qty.';
- ToolTip = 'Specifies the quantity that remains to complete a project.';
- DecimalPlaces = 0 : 5;
-
- trigger OnValidate()
- var
- JobPlanningLine: Record "Job Planning Line";
- begin
- if ("Job Remaining Qty." <> 0) and ("Job Planning Line No." = 0) then
- Error(Text047, FieldCaption("Job Remaining Qty."), FieldCaption("Job Planning Line No."));
-
- if "Job Planning Line No." <> 0 then begin
- JobPlanningLine.SetLoadFields("No.", "Variant Code", Quantity, "Unit of Measure Code", "Qty. per Unit of Measure", "Qty. Rounding Precision (Base)");
- JobPlanningLine.Get("Job No.", "Job Task No.", "Job Planning Line No.");
- if JobPlanningLine.Quantity >= 0 then begin
- if "Job Remaining Qty." < 0 then
- "Job Remaining Qty." := 0;
- end else
- if "Job Remaining Qty." > 0 then
- "Job Remaining Qty." := 0;
- end;
- "Job Remaining Qty." := UOMMgt.RoundAndValidateQty("Job Remaining Qty.", "Qty. Rounding Precision", FieldCaption("Job Remaining Qty."));
- "Job Remaining Qty. (Base)" := CalcBaseQtyForJobPlanningLine("Job Remaining Qty.", FieldCaption("Job Remaining Qty."), FieldCaption("Job Remaining Qty. (Base)"), JobPlanningLine);
- end;
- }
- field(1031; "Job Remaining Qty. (Base)"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Project Remaining Qty. (Base)';
- }
- field(1700; "Deferral Code"; Code[10])
- {
- Caption = '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.';
- TableRelation = "Deferral Template"."Deferral Code";
-
- trigger OnValidate()
- var
- DeferralPostDate: Date;
- begin
- GetPurchHeader();
- DeferralPostDate := GetDeferralPostDate(PurchHeader);
-
- DeferralUtilities.DeferralCodeOnValidate(
- "Deferral Code", Enum::"Deferral Document Type"::Purchase.AsInteger(), '', '',
- "Document Type".AsInteger(), "Document No.", "Line No.",
- GetDeferralAmount(), DeferralPostDate,
- Description, PurchHeader."Currency Code");
-
- if "Document Type" = "Document Type"::"Return Order" then
- "Returns Deferral Start Date" :=
- DeferralUtilities.GetDeferralStartDate(
- Enum::"Deferral Document Type"::Purchase.AsInteger(),
- "Document Type".AsInteger(), "Document No.", "Line No.", "Deferral Code", PurchHeader."Posting Date");
- end;
- }
- field(1702; "Returns Deferral Start Date"; Date)
- {
- Caption = 'Returns Deferral Start Date';
- ToolTip = 'Specifies the starting date of the returns deferral period.';
-
- trigger OnValidate()
- var
- DeferralHeader: Record "Deferral Header";
- DeferralUtilities: Codeunit "Deferral Utilities";
- begin
- GetPurchHeader();
- if DeferralHeader.Get(
- Enum::"Deferral Document Type"::Purchase, '', '', "Document Type", "Document No.", "Line No.")
- then
- DeferralUtilities.CreateDeferralSchedule(
- "Deferral Code", Enum::"Deferral Document Type"::Purchase.AsInteger(), '', '',
- "Document Type".AsInteger(), "Document No.", "Line No.", GetDeferralAmount(),
- DeferralHeader."Calc. Method", "Returns Deferral Start Date",
- DeferralHeader."No. of Periods", true,
- DeferralHeader."Schedule Description", false,
- PurchHeader."Currency Code");
- end;
- }
- field(2675; "Selected Alloc. Account No."; Code[20])
- {
- Caption = 'Allocation Account No.';
- ToolTip = 'Specifies the allocation account number that will be used to distribute the amounts during the posting process.';
- DataClassification = CustomerContent;
- TableRelation = "Allocation Account";
- }
- field(2677; "Alloc. Acc. Modified by User"; Boolean)
- {
- Caption = 'Allocation Account Distributions Modified';
- FieldClass = FlowField;
- CalcFormula = exist(Microsoft.Finance.AllocationAccount."Alloc. Acc. Manual Override" where("Parent System Id" = field(SystemId), "Parent Table Id" = const(Database::"Purchase Line")));
- }
- field(2678; "Allocation Account No."; Code[20])
- {
- Caption = 'Posting Allocation Account No.';
- DataClassification = CustomerContent;
- TableRelation = "Allocation Account";
- }
- field(2679; "Alloc. Purch. Line SystemId"; Guid)
- {
- Caption = 'Allocation Purchase Line SystemId';
- DataClassification = SystemMetadata;
- }
- field(2700; "Invoicing From Line SystemId"; Guid)
- {
- Caption = 'Invoicing From Line SystemId';
- DataClassification = SystemMetadata;
- Editable = false;
- }
- field(2701; "Matched Order Lines"; Integer)
- {
- BlankZero = true;
- CalcFormula = count("Matched Order Line" where("Document Line SystemId" = field(SystemId), "Matched Rcpt./Shpt. Line SysId" = const('00000000-0000-0000-0000-000000000000')));
- Caption = 'Matched Order Lines';
- Editable = false;
- FieldClass = FlowField;
- }
- field(2702; "Matched Inv./Cr. Memo Lines"; Integer)
- {
- BlankZero = true;
- CalcFormula = count("Matched Order Line" where("Matched Order Line SystemId" = field(SystemId), "Matched Rcpt./Shpt. Line SysId" = const('00000000-0000-0000-0000-000000000000')));
- Caption = 'Matched Invoice/Cr. Memo Lines';
- Editable = false;
- FieldClass = FlowField;
- }
- field(5402; "Variant Code"; Code[10])
- {
- Caption = 'Variant Code';
- ToolTip = 'Specifies the variant of the item on the line.';
- TableRelation = if (Type = const(Item), "Document Type" = filter(<> "Credit Memo" & <> "Return Order")) "Item Variant".Code where("Item No." = field("No."), Blocked = const(false), "Purchasing Blocked" = const(false))
- else
- if (Type = const(Item), "Document Type" = filter("Credit Memo" | "Return Order")) "Item Variant".Code where("Item No." = field("No."), Blocked = const(false));
-
- trigger OnValidate()
- var
- ItemVariant: Record "Item Variant";
- IsHandled: Boolean;
- begin
- if "Variant Code" <> '' then begin
- Rec.TestField(Type, Rec.Type::Item);
-
- IsHandled := false;
- OnValidateVariantCodeBeforeCheckBlocked(Rec, IsHandled);
- if not IsHandled then begin
- ItemVariant.SetLoadFields("Purchasing Blocked");
- ItemVariant.Get(Rec."No.", Rec."Variant Code");
- if ItemVariant."Purchasing Blocked" then
- if IsCreditDocType() then
- SendBlockedItemVariantNotification();
- end;
- end;
- TestStatusOpen();
-
- if xRec."Variant Code" <> "Variant Code" then begin
- TestField("Qty. Rcd. Not Invoiced", 0);
- TestField("Receipt No.", '');
- TestField("Return Qty. Shipped Not Invd.", 0);
- TestField("Return Shipment No.", '');
- MatchedOrderLineMgmt.IsLineMatched(Rec, true);
- end;
-
- IsHandled := false;
- OnValidateVariantCodeOnBeforeDropShipmentError(Rec, IsHandled);
- if not IsHandled then
- if "Drop Shipment" then
- Error(Text001, FieldCaption("Variant Code"), "Sales Order No.");
-
- OnValidateVariantCodeOnAfterValidationChecks(Rec, xRec, CurrFieldNo);
-
- if Type = Type::Item then
- if "Variant Code" <> xRec."Variant Code" then
- PlanPriceCalcByField(FieldNo("Variant Code"));
-
- if (xRec."Variant Code" <> "Variant Code") and (Quantity <> 0) then begin
- PurchLineReserve.VerifyChange(Rec, xRec);
- PurchasesWarehouseMgt.PurchaseLineVerifyChange(Rec, xRec);
- InitItemAppl();
- end;
-
- UpdateLeadTimeFields();
- UpdateDates();
- GetDefaultBin();
- IsHandled := false;
- OnValidateVariantCodeOnBeforeUpdateItemReference(Rec, IsHandled);
- if not IsHandled then
- if Type = Type::Item then
- UpdateItemReference();
-
- OnValidateVariantCodeOnAfterUpdateItemReference(Rec, CurrFieldNo);
-
- if JobTaskIsSet() then begin
- CreateTempJobJnlLine(true);
- UpdateJobPrices();
- end;
- UpdateDirectUnitCostByField(FieldNo("Variant Code"));
- end;
- }
- field(5403; "Bin Code"; Code[20])
- {
- Caption = 'Bin Code';
- ToolTip = 'Specifies the bin where the items are picked or put away.';
- TableRelation = if ("Document Type" = filter(Order | Invoice),
- Quantity = filter(< 0)) "Bin Content"."Bin Code" where("Location Code" = field("Location Code"),
- "Item No." = field("No."),
- "Variant Code" = field("Variant Code"))
- else
- if ("Document Type" = filter("Return Order" | "Credit Memo"),
- Quantity = filter(>= 0)) "Bin Content"."Bin Code" where("Location Code" = field("Location Code"),
- "Item No." = field("No."),
- "Variant Code" = field("Variant Code"))
- else
- Bin.Code where("Location Code" = field("Location Code"));
-
- trigger OnLookup()
- var
- WMSManagement: Codeunit "WMS Management";
- BinCode: Code[20];
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupBinCode(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if not IsInbound() and ("Quantity (Base)" <> 0) then
- BinCode := WMSManagement.BinContentLookUp("Location Code", "No.", "Variant Code", '', "Bin Code")
- else
- BinCode := WMSManagement.BinLookUp("Location Code", "No.", "Variant Code", '');
-
- if BinCode <> '' then
- Validate("Bin Code", BinCode);
- end;
-
- trigger OnValidate()
- var
- Item: Record Item;
- WMSManagement: Codeunit "WMS Management";
- IsHandled: Boolean;
- begin
- if "Bin Code" <> '' then
- if not IsInbound() and ("Quantity (Base)" <> 0) then
- WMSManagement.FindBinContent("Location Code", "Bin Code", "No.", "Variant Code", '')
- else
- WMSManagement.FindBin("Location Code", "Bin Code", '');
-
- if "Drop Shipment" then
- ShowBinCodeCannotBeChangedError();
-
- IsHandled := false;
- OnValidateBinCodeOnBeforeTestFields(Rec, IsHandled);
- if IsHandled then
- exit;
-
- TestField(Type, Type::Item);
- TestField("Location Code");
-
- GetItem(Item);
- Item.TestField(Type, Item.Type::Inventory);
-
- if "Bin Code" <> '' then begin
- GetLocation("Location Code");
- Location.TestField("Bin Mandatory");
- CheckWarehouse(true);
- end;
- end;
- }
- field(5404; "Qty. per Unit of Measure"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Qty. per Unit of Measure';
- DecimalPlaces = 0 : 5;
- Editable = false;
- InitValue = 1;
- }
- field(5405; "Qty. Rounding Precision"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Qty. Rounding Precision';
- InitValue = 0;
- DecimalPlaces = 0 : 5;
- MinValue = 0;
- MaxValue = 1;
- Editable = false;
- }
- field(5406; "Qty. Rounding Precision (Base)"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Qty. Rounding Precision (Base)';
- InitValue = 0;
- DecimalPlaces = 0 : 5;
- MinValue = 0;
- MaxValue = 1;
- Editable = false;
- }
- field(5407; "Unit of Measure Code"; Code[10])
- {
- Caption = 'Unit of Measure Code';
- TableRelation = if (Type = const(Item),
- "No." = filter(<> '')) "Item Unit of Measure".Code where("Item No." = field("No."))
- else
- if (Type = const(Resource), "No." = filter(<> '')) "Resource Unit of Measure".Code where("Resource No." = field("No."))
- else
- if (Type = filter("Charge (Item)" | "Fixed Asset" | "G/L Account")) "Unit of Measure";
- 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()
- var
- Item: Record Item;
- Resource: Record Resource;
- IsHandled: Boolean;
- ShouldUpdateItemReference, ShouldUpdateNonSubcontractingDocument : Boolean;
- begin
- TestStatusOpen();
- TestField("Quantity Received", 0);
- TestField("Qty. Received (Base)", 0);
- TestField("Qty. Rcd. Not Invoiced", 0);
- TestField("Return Qty. Shipped", 0);
- TestField("Return Qty. Shipped (Base)", 0);
- if "Unit of Measure Code" <> xRec."Unit of Measure Code" then begin
- TestField("Receipt No.", '');
- TestField("Return Shipment No.", '');
- MatchedOrderLineMgmt.IsLineMatched(Rec, true);
- end;
-
- IsHandled := false;
- OnValidateUnitOfMeasureCodeOnBeforeDropShipmentError(Rec, IsHandled, xRec, CurrFieldNo);
- if not IsHandled then
- if "Drop Shipment" then
- Error(Text001, FieldCaption("Unit of Measure Code"), "Sales Order No.");
-
- if (xRec."Unit of Measure Code" <> "Unit of Measure Code") and (Quantity <> 0) then begin
- PurchasesWarehouseMgt.PurchaseLineVerifyChange(Rec, xRec);
- PlanPriceCalcByField(FieldNo("Unit of Measure Code"));
- end;
- SetUnitOfMeasure();
- ShouldUpdateItemReference := Type = Type::Item;
- ShouldUpdateNonSubcontractingDocument := not IsProdOrder();
- OnValidateUnitOfMeasureCodeOnAfterCalcShouldUpdateItemReference(Rec, ShouldUpdateItemReference, ShouldUpdateNonSubcontractingDocument);
- if ShouldUpdateItemReference then
- UpdateItemReference();
- if ShouldUpdateNonSubcontractingDocument then
- case Type of
- Type::Item:
- begin
- GetItem(Item);
- AssignFieldsForQtyPerUOM(Item, CurrFieldNo);
-
- OnAfterAssignItemUOM(Rec, Item, CurrFieldNo);
- if "Qty. per Unit of Measure" > xRec."Qty. per Unit of Measure" then
- InitItemAppl();
-
- UpdateUOMQtyPerStockQty();
- end;
- Type::Resource:
- begin
- GetResource(Resource);
- "Qty. per Unit of Measure" := UoMMgt.GetResQtyPerUnitOfMeasure(Resource, "Unit of Measure Code");
- OnAfterAssignResourceUOM(Rec, Resource, CurrFieldNo);
- if "Unit of Measure Code" <> xRec."Unit of Measure Code" then
- PlanPriceCalcByField(FieldNo("Unit of Measure Code"));
- end;
- Type::" ",
- Type::"Charge (Item)",
- Type::"Fixed Asset",
- Type::"G/L Account":
- "Qty. per Unit of Measure" := 1;
- end
- else
- "Qty. per Unit of Measure" := 0;
-
- OnValidateUnitOfMeasureCodeOnBeforeValidateQuantity(Rec, xRec, Item);
- Validate(Quantity);
- UpdateDirectUnitCostByField(FieldNo("Unit of Measure Code"));
- end;
- }
- field(5415; "Quantity (Base)"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Quantity (Base)';
- DecimalPlaces = 0 : 5;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateQuantityBase(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Qty. per Unit of Measure", 1);
- if "Quantity (Base)" <> xRec."Quantity (Base)" then
- PlanPriceCalcByField(FieldNo("Quantity (Base)"));
- Validate(Quantity, "Quantity (Base)");
- UpdateDirectUnitCostByField(FieldNo("Quantity (Base)"));
- end;
- }
- field(5416; "Outstanding Qty. (Base)"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Outstanding Qty. (Base)';
- DecimalPlaces = 0 : 5;
- Editable = false;
- }
- field(5417; "Qty. to Invoice (Base)"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Qty. to Invoice (Base)';
- DecimalPlaces = 0 : 5;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateQtytoInvoiceBase(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Qty. per Unit of Measure", 1);
- Validate("Qty. to Invoice", "Qty. to Invoice (Base)");
- end;
- }
- field(5418; "Qty. to Receive (Base)"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Qty. to Receive (Base)';
- DecimalPlaces = 0 : 5;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateQtytoReceiveBase(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Qty. per Unit of Measure", 1);
- Validate("Qty. to Receive", "Qty. to Receive (Base)");
- end;
- }
- field(5458; "Qty. Rcd. Not Invoiced (Base)"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Qty. Rcd. Not Invoiced (Base)';
- DecimalPlaces = 0 : 5;
- Editable = false;
- }
- field(5460; "Qty. Received (Base)"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Qty. Received (Base)';
- DecimalPlaces = 0 : 5;
- Editable = false;
- }
- field(5461; "Qty. Invoiced (Base)"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Qty. Invoiced (Base)';
- DecimalPlaces = 0 : 5;
- Editable = false;
- }
- field(5495; "Reserved Qty. (Base)"; Decimal)
- {
- AutoFormatType = 0;
- CalcFormula = sum("Reservation Entry"."Quantity (Base)" where("Source Type" = const(39),
-#pragma warning disable AL0603
- "Source Subtype" = field("Document Type"),
-#pragma warning restore
- "Source ID" = field("Document No."),
- "Source Ref. No." = field("Line No."),
- "Reservation Status" = const(Reservation)));
- Caption = 'Reserved Qty. (Base)';
- ToolTip = 'Specifies the value in the Reserved Quantity field, expressed in the base unit of measure.';
- DecimalPlaces = 0 : 5;
- Editable = false;
- FieldClass = FlowField;
- }
- field(5600; "FA Posting Date"; Date)
- {
- Caption = 'FA Posting Date';
- ToolTip = 'Specifies the FA posting date if you have selected Fixed Asset in the Type field for this line.';
- }
- field(5601; "FA Posting Type"; Enum "Purchase FA Posting Type")
- {
- AccessByPermission = TableData "Fixed Asset" = R;
- Caption = 'FA Posting Type';
- ToolTip = 'Specifies the FA posting type if you have selected Fixed Asset in the Type field for this line.';
-
- trigger OnValidate()
- begin
- if Type = Type::"Fixed Asset" then begin
- TestField("Job No.", '');
- if "FA Posting Type" = "FA Posting Type"::" " then
- "FA Posting Type" := "FA Posting Type"::"Acquisition Cost";
- GetFAPostingGroup();
- end else begin
- "Depreciation Book Code" := '';
- "FA Posting Date" := 0D;
- "Salvage Value" := 0;
- "Depr. until FA Posting Date" := false;
- "Depr. Acquisition Cost" := false;
- "Maintenance Code" := '';
- "Insurance No." := '';
- "Budgeted FA No." := '';
- "Duplicate in Depreciation Book" := '';
- "Use Duplication List" := false;
- end;
- end;
- }
- field(5602; "Depreciation Book Code"; Code[10])
- {
- Caption = 'Depreciation Book Code';
- ToolTip = 'Specifies the code for the depreciation book to which the line will be posted if you have selected Fixed Asset in the Type field for this line.';
- TableRelation = "Depreciation Book";
-
- trigger OnValidate()
- begin
- GetFAPostingGroup();
- end;
- }
- field(5603; "Salvage Value"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Salvage Value';
- }
- field(5605; "Depr. until FA Posting Date"; Boolean)
- {
- AccessByPermission = TableData "Fixed Asset" = R;
- Caption = 'Depr. until FA Posting Date';
- ToolTip = 'Specifies if depreciation was calculated until the FA posting date of the line.';
- }
- field(5606; "Depr. Acquisition Cost"; Boolean)
- {
- AccessByPermission = TableData "Fixed Asset" = R;
- Caption = 'Depr. Acquisition Cost';
- ToolTip = 'Specifies if, when this line was posted, the additional acquisition cost posted on the line was depreciated in proportion to the amount by which the fixed asset had already been depreciated.';
- }
- field(5609; "Maintenance Code"; Code[10])
- {
- Caption = 'Maintenance Code';
- TableRelation = Maintenance;
- }
- field(5610; "Insurance No."; Code[20])
- {
- Caption = 'Insurance No.';
- ToolTip = 'Specifies an insurance number if you have selected the Acquisition Cost option in the FA Posting Type field.';
- TableRelation = Insurance;
- }
- field(5611; "Budgeted FA No."; Code[20])
- {
- Caption = 'Budgeted FA No.';
- ToolTip = 'Specifies the number of a fixed asset with the Budgeted Asset check box selected. When you post the journal or document line, an additional entry is created for the budgeted fixed asset where the amount has the opposite sign.';
- TableRelation = "Fixed Asset";
-
- trigger OnValidate()
- var
- FixedAsset: Record "Fixed Asset";
- begin
- if "Budgeted FA No." <> '' then begin
- FixedAsset.Get("Budgeted FA No.");
- FixedAsset.TestField("Budgeted Asset", true);
- end;
- end;
- }
- field(5612; "Duplicate in Depreciation Book"; Code[10])
- {
- Caption = 'Duplicate in Depreciation Book';
- ToolTip = 'Specifies a depreciation book code if you want the journal line to be posted to that depreciation book, as well as to the depreciation book in the Depreciation Book Code field.';
- TableRelation = "Depreciation Book";
-
- trigger OnValidate()
- begin
- "Use Duplication List" := false;
- end;
- }
- field(5613; "Use Duplication List"; Boolean)
- {
- AccessByPermission = TableData "Fixed Asset" = R;
- Caption = 'Use Duplication List';
- ToolTip = 'Specifies, if the type is Fixed Asset, that information on the line is to be posted to all the assets defined depreciation books.';
-
- trigger OnValidate()
- begin
- "Duplicate in Depreciation Book" := '';
- end;
- }
- field(5700; "Responsibility Center"; Code[10])
- {
- Caption = 'Responsibility Center';
- Editable = false;
- TableRelation = "Responsibility Center";
-
- trigger OnValidate()
- begin
- CreateDimFromDefaultDim(Rec.FieldNo("Responsibility Center"));
- end;
- }
- field(5709; "Item Category Code"; Code[20])
- {
- Caption = 'Item Category Code';
- TableRelation = "Item Category";
- }
- field(5710; Nonstock; Boolean)
- {
- AccessByPermission = TableData "Nonstock Item" = R;
- Caption = 'Catalog';
- ToolTip = 'Specifies that this item is a catalog item.';
- }
- field(5711; "Purchasing Code"; Code[10])
- {
- Caption = 'Purchasing Code';
- Editable = false;
- TableRelation = Purchasing;
- ToolTip = 'Specifies the purchasing code associated with the purchase line.';
-
- trigger OnValidate()
- var
- PurchasingCode: Record Purchasing;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePurchasingCode(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if PurchasingCode.Get("Purchasing Code") then begin
- "Drop Shipment" := PurchasingCode."Drop Shipment";
- "Special Order" := PurchasingCode."Special Order";
- OnValidatePurchasingCodeOnAfterAssignFields(Rec, PurchasingCode);
- end else
- "Drop Shipment" := false;
-
- Validate("Drop Shipment", "Drop Shipment");
- end;
- }
- field(5713; "Special Order"; Boolean)
- {
- Caption = 'Special Order';
-
- trigger OnValidate()
- begin
- if (xRec."Special Order" <> "Special Order") and (Quantity <> 0) then
- PurchasesWarehouseMgt.PurchaseLineVerifyChange(Rec, xRec);
- end;
- }
- field(5714; "Special Order Sales No."; Code[20])
- {
- AccessByPermission = TableData "Drop Shpt. Post. Buffer" = R;
- Caption = 'Special Order Sales No.';
- TableRelation = if ("Special Order" = const(true)) "Sales Header"."No." where("Document Type" = const(Order));
-
- trigger OnValidate()
- begin
- if (xRec."Special Order Sales No." <> "Special Order Sales No.") and (Quantity <> 0) then
- PurchasesWarehouseMgt.PurchaseLineVerifyChange(Rec, xRec);
- end;
- }
- field(5715; "Special Order Sales Line No."; Integer)
- {
- AccessByPermission = TableData "Drop Shpt. Post. Buffer" = R;
- Caption = 'Special Order Sales Line No.';
- TableRelation = if ("Special Order" = const(true)) "Sales Line"."Line No." where("Document Type" = const(Order),
- "Document No." = field("Special Order Sales No."));
-
- trigger OnValidate()
- begin
- if (xRec."Special Order Sales Line No." <> "Special Order Sales Line No.") and (Quantity <> 0) then
- PurchasesWarehouseMgt.PurchaseLineVerifyChange(Rec, xRec);
- end;
- }
- field(5725; "Item Reference No."; Code[50])
- {
- AccessByPermission = TableData "Item Reference" = R;
- Caption = 'Item Reference No.';
- ToolTip = 'Specifies the referenced item number.';
- ExtendedDatatype = Barcode;
-
- trigger OnLookup()
- begin
- GetPurchHeader();
- ItemReferenceMgt.PurchaseReferenceNoLookUp(Rec, PurchHeader);
- end;
-
- trigger OnValidate()
- var
- ItemReference: Record "Item Reference";
- begin
- GetPurchHeader();
- "Buy-from Vendor No." := PurchHeader."Buy-from Vendor No.";
- ItemReferenceMgt.ValidatePurchaseReferenceNo(Rec, PurchHeader, ItemReference, true, CurrFieldNo);
- end;
- }
- field(5726; "Item Reference Unit of Measure"; Code[10])
- {
- AccessByPermission = TableData "Item Reference" = R;
- Caption = 'Item Reference Unit of Measure';
- TableRelation = if (Type = const(Item)) "Item Unit of Measure".Code where("Item No." = field("No."));
- }
- field(5727; "Item Reference Type"; Enum "Item Reference Type")
- {
- Caption = 'Item Reference Type';
- }
- field(5728; "Item Reference Type No."; Code[30])
- {
- Caption = 'Item Reference Type No.';
- }
- field(5750; "Whse. Outstanding Qty. (Base)"; Decimal)
- {
- AccessByPermission = TableData Location = R;
- AutoFormatType = 0;
- BlankZero = true;
- CalcFormula = sum("Warehouse Receipt Line"."Qty. Outstanding (Base)" where("Source Type" = const(39),
-#pragma warning disable AL0603
- "Source Subtype" = field("Document Type"),
-#pragma warning restore
- "Source No." = field("Document No."),
- "Source Line No." = field("Line No.")));
- Caption = 'Whse. Outstanding Qty. (Base)';
- DecimalPlaces = 0 : 5;
- Editable = false;
- FieldClass = FlowField;
- }
- field(5752; "Completely Received"; Boolean)
- {
- Caption = 'Completely Received';
- Editable = false;
- }
- field(5790; "Requested Receipt Date"; Date)
- {
- Caption = 'Requested Receipt Date';
- 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.';
-
- trigger OnValidate()
- var
- CustomCalendarChange: array[2] of Record "Customized Calendar Change";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateRequestedReceiptDate(Rec, xRec, CustomCalendarChange, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- if (CurrFieldNo <> 0) and
- ("Promised Receipt Date" <> 0D)
- then
- Error(
- Text023,
- FieldCaption("Requested Receipt Date"),
- FieldCaption("Promised Receipt Date"));
-
- if "Requested Receipt Date" <> 0D then begin
- CustomCalendarChange[1].SetSource(CalChange."Source Type"::Vendor, "Buy-from Vendor No.", '', '');
- CustomCalendarChange[2].SetSource(CalChange."Source Type"::Location, "Location Code", '', '');
- UpdateOrderDateFromRequestedReceiptDate(CustomCalendarChange);
- end else
- if "Requested Receipt Date" <> xRec."Requested Receipt Date" then
- GetUpdateBasicDates();
- end;
- }
- field(5791; "Promised Receipt Date"; Date)
- {
- AccessByPermission = TableData "Order Promising Line" = R;
- Caption = 'Promised Receipt Date';
- ToolTip = 'Specifies the date that the vendor has promised to deliver the order.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePromisedReceiptDate(Rec, CurrFieldNo, IsHandled, xRec);
- if IsHandled then
- exit;
-
- if CurrFieldNo <> 0 then
- if "Promised Receipt Date" <> 0D then
- Validate("Planned Receipt Date", "Promised Receipt Date")
- else
- Validate("Requested Receipt Date")
- else
- Validate("Planned Receipt Date", "Promised Receipt Date");
- end;
- }
- field(5792; "Lead Time Calculation"; DateFormula)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- Caption = 'Lead Time Calculation';
- ToolTip = 'Specifies a date formula for the amount of time it takes to replenish the item.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateLeadTimeCalculation(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- LeadTimeMgt.CheckLeadTimeIsNotNegative("Lead Time Calculation");
-
- if "Requested Receipt Date" <> 0D then
- Validate("Planned Receipt Date")
- else
- GetUpdateBasicDates();
- end;
- }
- field(5793; "Inbound Whse. Handling Time"; DateFormula)
- {
- AccessByPermission = TableData Location = R;
- Caption = 'Inbound Whse. Handling Time';
- ToolTip = 'Specifies the time it takes to make items part of available inventory, after the items have been posted as received.';
-
- trigger OnValidate()
- begin
- if ("Promised Receipt Date" <> 0D) or
- ("Requested Receipt Date" <> 0D)
- then
- Validate("Planned Receipt Date")
- else
- Validate("Expected Receipt Date");
- end;
- }
- field(5794; "Planned Receipt Date"; Date)
- {
- AccessByPermission = TableData "Order Promising Line" = R;
- Caption = 'Planned Receipt Date';
- 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).';
-
- trigger OnValidate()
- var
- CustomCalendarChange: array[2] of Record "Customized Calendar Change";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePlannedReceiptDate(Rec, xRec, CurrFieldNo, TrackingBlocked, IsHandled);
- if IsHandled then
- exit;
-
- if "Promised Receipt Date" <> 0D then begin
- if "Planned Receipt Date" <> 0D then begin
- CustomCalendarChange[1].SetSource(CalChange."Source Type"::Location, "Location Code", '', '');
- "Expected Receipt Date" :=
- CalendarMgmt.CalcDateBOC(InternalLeadTimeDays("Planned Receipt Date"), "Planned Receipt Date", CustomCalendarChange, false)
- end else
- "Expected Receipt Date" := "Planned Receipt Date";
- end else
- if "Planned Receipt Date" <> 0D then begin
- CustomCalendarChange[1].SetSource(CalChange."Source Type"::Vendor, "Buy-from Vendor No.", '', '');
- CustomCalendarChange[2].SetSource(CalChange."Source Type"::Location, "Location Code", '', '');
- UpdateOrderDateFromPlannedReceiptDate(CustomCalendarChange);
- CustomCalendarChange[1].SetSource(CalChange."Source Type"::Location, "Location Code", '', '');
- "Expected Receipt Date" :=
- CalendarMgmt.CalcDateBOC(InternalLeadTimeDays("Planned Receipt Date"), "Planned Receipt Date", CustomCalendarChange, false)
- end else
- if "Requested Receipt Date" <> 0D then
- Validate("Requested Receipt Date")
- else
- GetUpdateBasicDates();
-
- if not TrackingBlocked then
- CheckDateConflict.PurchLineCheck(Rec, CurrFieldNo <> 0);
- end;
- }
- field(5795; "Order Date"; Date)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- Caption = 'Order Date';
- ToolTip = 'Specifies the date when the order was created.';
-
- trigger OnValidate()
- var
- CustomCalendarChange: array[2] of Record "Customized Calendar Change";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateOrderDate(Rec, xRec, CurrFieldNo, TrackingBlocked, IsHandled);
- if IsHandled then
- exit;
-
- if (CurrFieldNo <> 0) and
- ("Document Type" = "Document Type"::Order) and
- ("Order Date" < WorkDate()) and
- ("Order Date" <> 0D)
- then
- ShowEarlyOrderDateMessage();
-
- if "Order Date" <> 0D then begin
- CustomCalendarChange[1].SetSource(CalChange."Source Type"::Vendor, "Buy-from Vendor No.", '', '');
- CustomCalendarChange[2].SetSource(CalChange."Source Type"::Location, "Location Code", '', '');
- UpdatePlannedReceiptDateFromOrderDate(CustomCalendarChange);
- end;
-
- if "Planned Receipt Date" <> 0D then begin
- CustomCalendarChange[1].SetSource(CalChange."Source Type"::Location, "Location Code", '', '');
- "Expected Receipt Date" :=
- CalendarMgmt.CalcDateBOC(InternalLeadTimeDays("Planned Receipt Date"), "Planned Receipt Date", CustomCalendarChange, false)
- end else
- "Expected Receipt Date" := "Planned Receipt Date";
-
- if not TrackingBlocked then begin
- IsHandled := false;
- OnValidateOrderDateOnBeforeCheckDateConflict(Rec, CurrFieldNo, IsHandled);
- if not IsHandled then
- CheckDateConflict.PurchLineCheck(Rec, CurrFieldNo <> 0);
- end;
-
-
- OnAfterValidateOrderDate(Rec, xRec, CurrFieldNo);
- end;
- }
- field(5800; "Allow Item Charge Assignment"; Boolean)
- {
- AccessByPermission = TableData "Item Charge" = R;
- Caption = 'Allow Item Charge Assignment';
- ToolTip = 'Specifies that you can assign item charges to this line.';
- InitValue = true;
-
- trigger OnValidate()
- begin
- CheckItemChargeAssgnt();
- end;
- }
- field(5801; "Qty. to Assign"; Decimal)
- {
- AutoFormatType = 0;
- CalcFormula = sum("Item Charge Assignment (Purch)"."Qty. to Assign" where("Document Type" = field("Document Type"),
- "Document No." = field("Document No."),
- "Document Line No." = field("Line No.")));
- Caption = 'Qty. to Assign';
- ToolTip = 'Specifies how many units of the item charge will be assigned to the line.';
- DecimalPlaces = 0 : 5;
- Editable = false;
- FieldClass = FlowField;
- }
- field(5802; "Qty. Assigned"; Decimal)
- {
- AutoFormatType = 0;
- CalcFormula = sum("Item Charge Assignment (Purch)"."Qty. Assigned" where("Document Type" = field("Document Type"),
- "Document No." = field("Document No."),
- "Document Line No." = field("Line No.")));
- Caption = 'Qty. Assigned';
- ToolTip = 'Specifies how much of the item charge that has been assigned.';
- DecimalPlaces = 0 : 5;
- Editable = false;
- FieldClass = FlowField;
- }
- field(5803; "Return Qty. to Ship"; Decimal)
- {
- AccessByPermission = TableData "Return Shipment Header" = R;
- AutoFormatType = 0;
- Caption = 'Return Qty. to Ship';
- ToolTip = 'Specifies the quantity of items that remains to be shipped.';
- DecimalPlaces = 0 : 5;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- if (CurrFieldNo <> 0) and
- IsInventoriableItem() and
- ("Return Qty. to Ship" <> 0) and
- (not "Drop Shipment")
- then
- CheckWarehouse(true);
-
- "Return Qty. to Ship" := UOMMgt.RoundAndValidateQty("Return Qty. to Ship", "Qty. Rounding Precision", FieldCaption("Return Qty. to Ship"));
-
- OnValidateReturnQtyToShipOnAfterCheck(Rec, CurrFieldNo);
-
- if "Return Qty. to Ship" = Quantity - "Return Qty. Shipped" then
- InitQtyToShip()
- else begin
- "Return Qty. to Ship (Base)" := CalcBaseQty("Return Qty. to Ship", FieldCaption("Return Qty. to Ship"), FieldCaption("Return Qty. to Ship (Base)"));
- if "Qty. per Unit of Measure" <> 0 then
- ValidateQuantityReturnIsBalanced();
- InitQtyToInvoice();
- end;
-
- IsHandled := false;
- OnValidateReturnQtyToShipOnAfterInitQty(Rec, xRec, CurrFieldNo, IsHandled);
- if not IsHandled then begin
- if ("Return Qty. to Ship" * Quantity < 0) or
- (Abs("Return Qty. to Ship") > Abs("Outstanding Quantity")) or
- (Quantity * "Outstanding Quantity" < 0)
- then
- Error(Text020, "Outstanding Quantity");
- if ("Return Qty. to Ship (Base)" * "Quantity (Base)" < 0) or
- (Abs("Return Qty. to Ship (Base)") > Abs("Outstanding Qty. (Base)")) or
- ("Quantity (Base)" * "Outstanding Qty. (Base)" < 0)
- then
- Error(Text021, "Outstanding Qty. (Base)");
- end;
-
- if (CurrFieldNo <> 0) and (Type = Type::Item) and ("Return Qty. to Ship" > 0) then
- CheckApplToItemLedgEntry();
- end;
- }
- field(5804; "Return Qty. to Ship (Base)"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Return Qty. to Ship (Base)';
- DecimalPlaces = 0 : 5;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateReturnQtytoShipBase(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Qty. per Unit of Measure", 1);
- Validate("Return Qty. to Ship", "Return Qty. to Ship (Base)");
- end;
- }
- field(5805; "Return Qty. Shipped Not Invd."; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Return Qty. Shipped Not Invd.';
- DecimalPlaces = 0 : 5;
- Editable = false;
- }
- field(5806; "Ret. Qty. Shpd Not Invd.(Base)"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Ret. Qty. Shpd Not Invd.(Base)';
- DecimalPlaces = 0 : 5;
- Editable = false;
- }
- field(5807; "Return Shpd. Not Invd."; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Return Shpd. Not Invd.';
- Editable = false;
-
- trigger OnValidate()
- var
- Currency2: Record Currency;
- begin
- GetPurchHeader();
- Currency2.InitRoundingPrecision();
- if PurchHeader."Currency Code" <> '' then
- "Return Shpd. Not Invd. (LCY)" :=
- Round(
- CurrExchRate.ExchangeAmtFCYToLCY(
- GetDate(), "Currency Code",
- "Return Shpd. Not Invd.", PurchHeader."Currency Factor"),
- Currency2."Amount Rounding Precision")
- else
- "Return Shpd. Not Invd. (LCY)" :=
- Round("Return Shpd. Not Invd.", Currency2."Amount Rounding Precision");
- end;
- }
- field(5808; "Return Shpd. Not Invd. (LCY)"; Decimal)
- {
- AutoFormatExpression = '';
- AutoFormatType = 1;
- Caption = 'Return Shpd. Not Invd. (LCY)';
- Editable = false;
- }
- field(5809; "Return Qty. Shipped"; Decimal)
- {
- AccessByPermission = TableData "Return Shipment Header" = R;
- AutoFormatType = 0;
- Caption = 'Return Qty. Shipped';
- ToolTip = 'Specifies how many units of the item on the line have been posted as shipped.';
- DecimalPlaces = 0 : 5;
- Editable = false;
- }
- field(5810; "Return Qty. Shipped (Base)"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Return Qty. Shipped (Base)';
- DecimalPlaces = 0 : 5;
- Editable = false;
- }
- field(5812; "Item Charge Qty. to Handle"; Decimal)
- {
- AutoFormatType = 0;
- CalcFormula = sum("Item Charge Assignment (Purch)"."Qty. to Handle" where("Document Type" = field("Document Type"),
- "Document No." = field("Document No."),
- "Document Line No." = field("Line No.")));
- Caption = 'Item Charge Qty. to Handle';
- ToolTip = 'Specifies how many items the item charge will be assigned to on the line. It can be either equal to Qty. to Assign or to zero. If it is zero, the item charge will not be assigned to the line.';
- DecimalPlaces = 0 : 5;
- Editable = false;
- FieldClass = FlowField;
- }
- field(6200; "Non-Deductible VAT %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Non-Deductible VAT %';
- DecimalPlaces = 0 : 5;
-
- trigger OnValidate()
- begin
- NonDeductibleVAT.CheckPrepmtWithNonDeductubleVATInPurchaseLine(Rec);
- NonDeductibleVAT.CheckNonDeductibleVATPctIsAllowed(Rec);
- UpdateAmounts();
- end;
- }
- field(6201; "Non-Deductible VAT Base"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Non-Deductible VAT Base';
- ToolTip = 'Specifies the amount of VAT that is not deducted due to the type of goods or services purchased.';
- Editable = false;
- }
- field(6202; "Non-Deductible VAT Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Non-Deductible VAT Amount';
- ToolTip = 'Specifies the amount of the transaction for which VAT is not applied, due to the type of goods or services purchased.';
- Editable = false;
- }
- field(6203; "Non-Deductible VAT Diff."; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Non-Deductible VAT Difference';
- Editable = false;
- }
- field(6204; "Prepmt. Non-Deduct. VAT Base"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Prepmt. Non-Deductible VAT Base';
- Editable = false;
- }
- field(6205; "Prepmt. Non-Deduct. VAT Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Prepmt. on-Deductible VAT Amount';
- Editable = false;
- }
- field(6206; "Item Charge Has Non.Ded. VAT"; Boolean)
- {
- Caption = 'Item Charge Has Non-Deductible VAT';
- Editable = false;
- }
- field(6600; "Return Shipment No."; Code[20])
- {
- Caption = 'Return Shipment No.';
- Editable = false;
- }
- field(6601; "Return Shipment Line No."; Integer)
- {
- Caption = 'Return Shipment Line No.';
- Editable = false;
- }
- field(6608; "Return Reason Code"; Code[10])
- {
- Caption = 'Return Reason Code';
- ToolTip = 'Specifies the code explaining why the item was returned.';
- TableRelation = "Return Reason";
-
- trigger OnValidate()
- begin
- ValidateReturnReasonCode(FieldNo("Return Reason Code"));
- end;
- }
- field(6609; Subtype; Option)
- {
- Caption = 'Subtype';
- OptionCaption = ' ,Item - Inventory,Item - Service,Comment';
- OptionMembers = " ","Item - Inventory","Item - Service",Comment;
- }
- field(6610; "Copied From Posted Doc."; Boolean)
- {
- Caption = 'Copied From Posted Doc.';
- }
- field(7000; "Price Calculation Method"; Enum "Price Calculation Method")
- {
- Caption = 'Price Calculation Method';
- }
- field(7010; "Attached Doc Count"; Integer)
- {
- BlankNumbers = DontBlank;
- CalcFormula = count("Document Attachment" where("Table ID" = const(39),
- "No." = field("Document No."),
- "Document Type" = field("Document Type"),
- "Line No." = field("Line No.")));
- Caption = 'Attached Doc Count';
- ToolTip = 'Specifies the number of attachments.';
- FieldClass = FlowField;
- InitValue = 0;
- }
- field(7011; "Attached Lines Count"; Integer)
- {
- CalcFormula = count("Purchase Line" where("Document Type" = field("Document Type"),
- "Document No." = field("Document No."),
- "Attached to Line No." = field("Line No."),
- Quantity = filter(<> 0)));
- Caption = 'Attached Lines Count';
- ToolTip = 'Specifies the number of non-inventory product lines attached to the purchase line.';
- Editable = false;
- FieldClass = FlowField;
- BlankZero = true;
- }
- field(8509; "Over-Receipt Quantity"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Over-Receipt Quantity';
- ToolTip = 'Specifies over-receipt quantity.';
- DecimalPlaces = 0 : 5;
- MinValue = 0;
-
- trigger OnValidate()
- var
- OverReceiptCode: Record "Over-Receipt Code";
- PurchaseHeader: Record "Purchase Header";
- OverReceiptMgt: Codeunit "Over-Receipt Mgt.";
- Handled: Boolean;
- begin
- OnValidateOverReceiptQuantity(Rec, xRec, CurrFieldNo, Handled);
- if Handled then
- exit;
- if not OverReceiptMgt.IsOverReceiptAllowed() then begin
- "Over-Receipt Quantity" := 0;
- "Over-Receipt Approval Status" := "Over-Receipt Approval Status"::" ";
- exit;
- end;
-
- if xRec."Over-Receipt Quantity" = "Over-Receipt Quantity" then
- exit;
- PurchaseHeader.Get(Rec."Document Type", Rec."Document No.");
- PurchaseHeader.TestField("Document Type", PurchHeader."Document Type"::Order);
- PurchaseHeader.TestField(Status, PurchHeader.Status::Released);
- TestField(Type, Type::Item);
- TestField("No.");
- if "Over-Receipt Quantity" <> 0 then begin
- if "Over-Receipt Code" = '' then
- "Over-Receipt Code" := OverReceiptMgt.GetDefaultOverReceiptCode(Rec);
- TestField("Over-Receipt Code");
- end;
- if "Over-Receipt Quantity" <> 0 then
- CheckLocationRequireReceive();
-
- if ("Over-Receipt Code" <> '') then begin
- OverReceiptMgt.VerifyOverReceiptQuantity(Rec, xRec);
- OverReceiptCode.Get("Over-Receipt Code");
- if OverReceiptCode."Required Approval" then
- "Over-Receipt Approval Status" := "Over-Receipt Approval Status"::Pending;
- end;
-
- SuspendStatusCheck(true);
- Validate(Quantity, Quantity - xRec."Over-Receipt Quantity" + "Over-Receipt Quantity");
- Validate("Direct Unit Cost");
- if "Over-Receipt Quantity" = 0 then begin
- "Over-Receipt Approval Status" := "Over-Receipt Approval Status"::" ";
- OverReceiptMgt.RecallOverReceiptNotification(PurchaseHeader.RecordId());
- end else
- OverReceiptMgt.ShowOverReceiptNotificationFromLine(PurchaseHeader."No.");
- end;
- }
- field(8510; "Over-Receipt Code"; Code[20])
- {
- Caption = 'Over-Receipt Code';
- ToolTip = 'Specifies over-receipt code.';
- TableRelation = "Over-Receipt Code";
-
- trigger OnValidate()
- begin
- if ((Rec."Over-Receipt Code" = '') and (xRec."Over-Receipt Code" <> '')) then
- Validate("Over-Receipt Quantity", 0);
- end;
- }
- field(8511; "Over-Receipt Approval Status"; Enum "Over-Receipt Approval Status")
- {
- Caption = 'Over-Receipt Approval Status';
- }
- field(8512; "Buy-from Vendor Name"; Text[100])
- {
- CalcFormula = lookup(Vendor.Name where("No." = field("Buy-from Vendor No.")));
- Caption = 'Buy-from Vendor Name';
- Editable = false;
- FieldClass = FlowField;
- }
- field(11303; "Suggested Line"; Boolean)
- {
- Caption = 'Suggested Line';
- Editable = false;
- }
- field(12100; "No. of Fixed Asset Cards"; Integer)
- {
- BlankZero = true;
- Caption = 'No. of Fixed Asset Cards';
- ToolTip = 'Specifies the number of fixed assets that is being purchased.';
- MinValue = 0;
-
- trigger OnValidate()
- begin
- if "No. of Fixed Asset Cards" <> 0 then begin
- TestField(Type, Type::"Fixed Asset");
- CheckAcquisitionCost();
- if not ("Document Type" in ["Purchase Document Type"::Invoice, "Purchase Document Type"::Order]) then
- Error(InvoiceOrOrderDocTypeErr, FieldCaption("Document Type"), "Purchase Document Type"::Invoice, "Purchase Document Type"::Order);
- end;
- end;
- }
- field(99000755; "Overhead Rate"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Overhead Rate';
- DecimalPlaces = 0 : 5;
-
- trigger OnValidate()
- begin
- Validate("Indirect Cost %");
- end;
- }
- field(99000756; "MPS Order"; Boolean)
- {
- Caption = 'MPS Order';
- }
- field(99000757; "Planning Flexibility"; Enum "Reservation Planning Flexibility")
- {
- Caption = 'Planning Flexibility';
- ToolTip = 'Specifies whether the supply represented by this line is considered by the planning system when calculating action messages.';
-
- trigger OnValidate()
- begin
- if "Planning Flexibility" <> xRec."Planning Flexibility" then
- PurchLineReserve.UpdatePlanningFlexibility(Rec);
- end;
- }
- field(99000758; "Safety Lead Time"; DateFormula)
- {
- Caption = 'Safety Lead Time';
-
- trigger OnValidate()
- begin
- Validate("Inbound Whse. Handling Time");
- end;
- }
- }
-
- keys
- {
- key(Key1; "Document Type", "Document No.", "Line No.")
- {
- Clustered = true;
- }
- key(Key3; "Document Type", Type, "No.", "Variant Code", "Drop Shipment", "Location Code", "Expected Receipt Date")
- {
- IncludedFields = "Outstanding Qty. (Base)";
- }
- key(Key4; "Document Type", "Pay-to Vendor No.", "Currency Code", "Document No.")
- {
-#pragma warning disable AS0038
- IncludedFields = "Outstanding Amount", "Amt. Rcd. Not Invoiced", "Outstanding Amount (LCY)", "Amt. Rcd. Not Invoiced (LCY)", "Prepmt. Amount Inv. (LCY)", "Prepmt. VAT Amount Inv. (LCY)";
-#pragma warning RESTORE AS0038
- }
- key(Key7; "Document Type", "Blanket Order No.", "Blanket Order Line No.")
- {
- }
- key(Key9; "Document Type", "Document No.", "Location Code")
- {
- IncludedFields = Amount, "Amount Including VAT", "VAT Base Amount";
- }
- key(Key10; "Document Type", "Receipt No.", "Receipt Line No.")
- {
- IncludedFields = Quantity;
- }
- key(Key11; Type, "No.", "Variant Code", "Drop Shipment", "Location Code", "Document Type", "Expected Receipt Date")
- {
- MaintainSQLIndex = false;
- }
- key(Key12; "Document Type", "Buy-from Vendor No.")
- {
- }
- key(Key13; "Document Type", "Job No.", "Job Task No.", "Document No.")
- {
- IncludedFields = "Outstanding Amt. Ex. VAT (LCY)", "A. Rcd. Not Inv. Ex. VAT (LCY)";
- }
- key(Key16; "Recalculate Invoice Disc.")
- {
- }
- key(Key18; "Location Code", "Quantity Invoiced")
- {
- }
- key(Key19; "Completely Received")
- {
- IncludedFields = Type, "Location Code";
- }
- key(Key20; "Document Type", "Document No.", "Drop Shipment")
- {
- IncludedFields = Quantity;
- }
- key(Key21; "Document Type", "Document No.", Type, "No.", "System-Created Entry")
- {
- IncludedFields = Quantity, "Outstanding Quantity", "Return Qty. Shipped", "Quantity Received", "Line Amount", Amount, "Amount Including VAT", "Inv. Discount Amount";
- }
- key(Key22; "Document Type", "Document No.", "VAT Identifier", "Line No.")
- {
- IncludedFields = "VAT %", "Tax Area Code", "Tax Group Code", "VAT Calculation Type", "Line Amount", "Inv. Discount Amount", Amount, "Amount Including VAT", "Quantity (Base)", "VAT Difference";
- }
- key(Key23; "Attached to Line No.")
- {
- }
- key(Key24; "No.", Type)
- {
- }
- }
-
- fieldgroups
- {
- fieldgroup(DropDown; "No.", Description, "Line Amount", Quantity, "Unit of Measure Code")
- {
- }
- }
-
- trigger OnDelete()
- var
- PurchCommentLine: Record "Purch. Comment Line";
- SalesOrderLine: Record "Sales Line";
- IsHandled: Boolean;
- ShouldModifySalesOrderLine: Boolean;
- begin
- IsHandled := false;
- OnDeleteOnBeforeTestStatusOpen(Rec, IsHandled);
- if not IsHandled then
- TestStatusOpen();
-
- if (Rec.Quantity <> 0) and Rec.ItemExists(Rec."No.") then begin
- PurchLineReserve.DeleteLine(Rec);
- IsHandled := false;
- OnDeleteOnBeforeCheckQtyNotInvoiced(Rec, IsHandled);
- if not IsHandled then begin
- if not IsMatchedToReceiptOrOrder() then
- TestField("Qty. Rcd. Not Invoiced", 0);
- if "Return Shipment No." = '' then
- TestField("Return Qty. Shipped Not Invd.", 0);
- end;
-
- IsHandled := false;
- OnDeleteOnBeforePurchaseLineDelete(Rec, IsHandled);
- if not IsHandled then begin
- CalcFields("Reserved Qty. (Base)");
- TestField("Reserved Qty. (Base)", 0);
- PurchasesWarehouseMgt.PurchaseLineDelete(Rec);
- end;
- end;
-
- if ("Document Type" = "Document Type"::Order) and (Quantity <> "Quantity Invoiced") then
- TestField("Prepmt. Amt. Inv.", "Prepmt Amt Deducted");
-
- ShouldModifySalesOrderLine := "Sales Order Line No." <> 0;
- OnDeleteOnAfterCalcShouldModifySalesOrderLine(Rec, ShouldModifySalesOrderLine);
- if ShouldModifySalesOrderLine then begin
- LockTable();
- SalesOrderLine.LockTable();
- SalesOrderLine.Get(SalesOrderLine."Document Type"::Order, "Sales Order No.", "Sales Order Line No.");
- SalesOrderLine."Purchase Order No." := '';
- SalesOrderLine."Purch. Order Line No." := 0;
- SalesOrderLine.Modify();
- end;
-
- UpdateSpecialSalesOrderLineFromOnDelete(SalesOrderLine);
-
- CatalogItemMgt.DelNonStockPurch(Rec);
-
- if "Document Type" = "Document Type"::"Blanket Order" then begin
- PurchLine2.Reset();
- PurchLine2.SetCurrentKey("Document Type", "Blanket Order No.", "Blanket Order Line No.");
- PurchLine2.SetRange("Blanket Order No.", "Document No.");
- PurchLine2.SetRange("Blanket Order Line No.", "Line No.");
- OnDeleteOnAfterSetPurchLineFilters(PurchLine2);
- if PurchLine2.FindFirst() then
- PurchLine2.TestField("Blanket Order Line No.", 0);
- end;
-
- if Type = Type::Item then
- DeleteItemChargeAssignment("Document Type", "Document No.", "Line No.");
-
- if Type = Type::"Charge (Item)" then
- DeleteChargeChargeAssgnt("Document Type", "Document No.", "Line No.");
-
- if "Line No." <> 0 then begin
- PurchLine2.Reset();
- PurchLine2.SetRange("Document Type", "Document Type");
- PurchLine2.SetRange("Document No.", "Document No.");
- PurchLine2.SetRange("Attached to Line No.", "Line No.");
- PurchLine2.SetFilter("Line No.", '<>%1', "Line No.");
- OnDeleteOnBeforePurchLineDeleteAll(PurchLine2);
- PurchLine2.DeleteAll(true);
- OnDeleteOnAfterPurchLineDeleteAll(Rec, PurchLine2);
- end;
-
- PurchCommentLine.SetRange("Document Type", "Document Type");
- PurchCommentLine.SetRange("No.", "Document No.");
- PurchCommentLine.SetRange("Document Line No.", "Line No.");
- if not PurchCommentLine.IsEmpty() then
- PurchCommentLine.DeleteAll();
-
- // In case we have roundings on VAT or Sales Tax, we should update some other line
- if (Type <> Type::" ") and ("Line No." <> 0) and not IsExtendedText() and
- (Quantity <> 0) and (Amount <> 0) and (Amount <> "Amount Including VAT") and not StatusCheckSuspended
- then begin
- Quantity := 0;
- "Quantity (Base)" := 0;
- "Qty. to Invoice" := 0;
- "Qty. to Invoice (Base)" := 0;
- "Line Discount Amount" := 0;
- "Inv. Discount Amount" := 0;
- "Inv. Disc. Amount to Invoice" := 0;
- OnDeleteOnBeforeUpdateAmounts(Rec);
- UpdateAmounts();
- OnDeleteOnAfterUpdateAmounts(Rec);
- end;
-
- if "Deferral Code" <> '' then
- DeferralUtilities.DeferralCodeOnDelete(
- Enum::"Deferral Document Type"::Purchase.AsInteger(), '', '',
- "Document Type".AsInteger(), "Document No.", "Line No.");
-
- MatchedOrderLineMgmt.DeleteMatchedOrderLines(Rec);
- end;
-
- trigger OnInsert()
- begin
- TestStatusOpen();
- if not HasPurchHeader then
- Error(CannotInsertPurchLineWithoutHeaderErr);
-
- if Quantity <> 0 then begin
- OnBeforeVerifyReservedQty(Rec, xRec, 0);
- PurchLineReserve.VerifyQuantity(Rec, xRec);
- end;
- LockTable();
- OnInsertOnAfterLockTable(Rec, CurrFieldNo);
- if ("Deferral Code" <> '') and (GetDeferralAmount() <> 0) then
- UpdateDeferralAmounts();
- PurchHeader."No." := '';
- end;
-
- trigger OnModify()
- begin
- if ("Document Type" = "Document Type"::"Blanket Order") and
- ((Type <> xRec.Type) or ("No." <> xRec."No."))
- then begin
- PurchLine2.Reset();
- PurchLine2.SetCurrentKey("Document Type", "Blanket Order No.", "Blanket Order Line No.");
- PurchLine2.SetRange("Blanket Order No.", "Document No.");
- PurchLine2.SetRange("Blanket Order Line No.", "Line No.");
- OnModifyOnAfterSetFilters(Rec, PurchLine2);
- if PurchLine2.FindSet() then
- repeat
- PurchLine2.TestField(Type, Type);
- PurchLine2.TestField("No.", "No.");
- until PurchLine2.Next() = 0;
- end;
-
- if ((Quantity <> 0) or (xRec.Quantity <> 0)) and ItemExists(xRec."No.") then
- PurchLineReserve.VerifyChange(Rec, xRec);
- OnAfterModifyOnAfterVerifyChange(Rec, CurrFieldNo);
- end;
-
- trigger OnRename()
- begin
- Error(Text000, TableCaption);
- end;
-
-#if not CLEAN28
- [Obsolete('Not used for anything', '28.0')]
- procedure SetSkipEnsurePositiveLineNo(NewSkipEnsurePositiveLineNo: Boolean)
- begin
- end;
-#endif
-
- var
- PurchHeader: Record "Purchase Header";
- PurchLine2: Record "Purchase Line";
- GLAcc: Record "G/L Account";
- CurrExchRate: Record "Currency Exchange Rate";
- VATPostingSetup: Record "VAT Posting Setup";
- GenBusPostingGrp: Record "Gen. Business Posting Group";
- GenProdPostingGrp: Record "Gen. Product Posting Group";
- UnitOfMeasure: Record "Unit of Measure";
- ItemCharge: Record "Item Charge";
- SKU: Record "Stockkeeping Unit";
- InvtSetup: Record "Inventory Setup";
- Location: Record Location;
- GLSetup: Record "General Ledger Setup";
- CalChange: Record "Customized Calendar Change";
- TempJobJnlLine: Record "Job Journal Line" temporary;
- PurchSetup: Record "Purchases & Payables Setup";
- SalesTaxCalculate: Codeunit "Sales Tax Calculate";
- PurchLineReserve: Codeunit "Purch. Line-Reserve";
- PurchasesWarehouseMgt: Codeunit "Purchases Warehouse Mgt.";
- UOMMgt: Codeunit "Unit of Measure Management";
- DimMgt: Codeunit DimensionManagement;
- ItemReferenceMgt: Codeunit "Item Reference Management";
- CatalogItemMgt: Codeunit "Catalog Item Management";
- LeadTimeMgt: Codeunit "Lead-Time Management";
- CalendarMgmt: Codeunit "Calendar Management";
- CheckDateConflict: Codeunit "Reservation-Check Date Confl.";
- DeferralUtilities: Codeunit "Deferral Utilities";
- PostingSetupMgt: Codeunit PostingSetupManagement;
- ApplicationAreaMgmt: Codeunit "Application Area Mgmt.";
- NonDeductibleVAT: Codeunit "Non-Deductible VAT";
- MatchedOrderLineMgmt: Codeunit "Matched Order Line Mgmt.";
- FieldCausedPriceCalculation: Integer;
- GLSetupRead: Boolean;
- UnitCostCurrency: Decimal;
- UpdateFromVAT: Boolean;
- HasBeenShown: Boolean;
- PrePaymentLineAmountEntered: Boolean;
- PurchSetupRead: Boolean;
- HasPurchHeader: Boolean;
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text000: Label 'You cannot rename a %1.';
- Text001: Label 'You cannot change %1 because the order line is associated with sales order %2.';
- Text002: Label 'Prices including VAT cannot be calculated when %1 is %2.';
- Text004: Label 'must not be less than %1';
-#pragma warning restore AA0470
- Text006: Label 'You can''t invoice more than %1 units.', Comment = '%1 - the field value';
-#pragma warning disable AA0470
- Text007: Label 'You cannot invoice more than %1 base units.';
- Text008: Label 'You cannot receive more than %1 units.';
- Text009: Label 'You cannot receive more than %1 base units.';
- Text010: Label 'You cannot change %1 when %2 is %3.';
- Text011: Label ' must be 0 when %1 is %2';
- Text016: Label '%1 is required for %2 = %3.';
- Text018: Label '%1 %2 is earlier than the work date %3.';
- Text020: Label 'You cannot return more than %1 units.';
- Text021: Label 'You cannot return more than %1 base units.';
- Text022: Label 'You cannot change %1, if item charge is already posted.';
- Text023: Label 'You cannot change the %1 when the %2 has been filled in.';
-#pragma warning restore AA0470
- Text029: Label 'must be positive.';
- Text030: Label 'must be negative.';
-#pragma warning disable AA0470
- Text032: Label '%1 must not be greater than the sum of %2 and %3.';
-#pragma warning restore AA0470
- Text033: Label 'Warehouse ';
- Text034: Label 'Inventory ';
-#pragma warning disable AA0470
- Text035: Label '%1 units for %2 %3 have already been returned or transferred. Therefore, only %4 units can be returned.';
- Text037: Label 'cannot be %1.';
- Text038: Label 'cannot be less than %1.';
- Text039: Label 'cannot be more than %1.';
- Text042: Label 'You cannot return more than the %1 units that you have received for %2 %3.';
- Text043: Label 'must be positive when %1 is not 0.';
- Text046: Label '%3 will not update %1 when changing %2 because a prepayment invoice has been posted. Do you want to continue?', Comment = '%1 - product name';
- Text047: Label '%1 can only be set when %2 is set.';
- Text048: Label '%1 cannot be changed when %2 is set.';
- Text049: Label 'You have changed one or more dimensions on the %1, which is already shipped. When you post the line with the changed dimension to General Ledger, amounts on the Inventory Interim account will be out of balance when reported per dimension.\\Do you want to keep the changed dimension?';
-#pragma warning restore AA0470
- Text050: Label 'Cancelled.';
- Text051: Label 'must have the same sign as the receipt';
-#pragma warning disable AA0470
- Text052: Label 'The quantity that you are trying to invoice is greater than the quantity in receipt %1.';
-#pragma warning restore AA0470
- Text053: Label 'must have the same sign as the return shipment';
-#pragma warning disable AA0470
- Text054: Label 'The quantity that you are trying to invoice is greater than the quantity in return shipment %1.';
- Text99000000: Label 'You cannot change %1 when the purchase order is associated to a production order.';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- MustNotBeSpecifiedErr: Label 'must not be specified when %1 = %2', Comment = '%1 - the field name, %2 - the field value';
- WhseRequirementMsg: Label '%1 is required for this line. The entered information may be disregarded by warehouse activities.', Comment = '%1=Document';
- QtyInvoiceNotValidTitleLbl: Label 'Qty. to Invoice isn''t valid';
- QtyInvoiceActionLbl: Label 'Set value to %1', Comment = '%1 - Qty. to Invoice';
- QtyInvoiceActionDescriptionLbl: Label 'Corrects %1 value to %2', Comment = '%1 - Qty. to Invoice field caption, %2 - Quantity';
- QtyReceiveNotValidTitleLbl: Label 'Qty. to Receive isn''t valid';
- QtyReceiveActionLbl: Label 'Set value to %1', comment = '%1=Qty. to Receive';
- QtyReceiveActionDescriptionLbl: Label 'Corrects %1 value to %2', Comment = '%1 - Qty. to Receive field caption, %2 - Quantity';
- ItemChargeAssignmentErr: Label 'You can only assign Item Charges for Line Types of Charge (Item).';
- CannotFindDescErr: Label 'Cannot find %1 with Description %2.\\Make sure to use the correct type.', Comment = '%1 = Type caption %2 = Description';
- CommentLbl: Label 'Comment';
- LineDiscountPctErr: Label 'The value in the Line Discount % field must be between 0 and 100.';
- PurchasingBlockedErr: Label 'You cannot purchase %1 %2 because the %3 check box is selected on the %1 card.', Comment = '%1 - Table Caption (Item), %2 - Item No., %3 - Field Caption';
- CannotChangePrepaidServiceChargeErr: Label 'You cannot change the line because it will affect service charges that are already invoiced as part of a prepayment.';
- LineInvoiceDiscountAmountResetTok: Label 'The value in the Inv. Discount Amount field in %1 has been cleared.', Comment = '%1 - Record ID';
- BlockedItemNotificationMsg: Label 'Item %1 is blocked, but it is allowed on this type of document.', Comment = '%1 is Item No.';
- BlockedItemVariantNotificationMsg: Label 'Item Variant %1 for Item %2 is blocked, but it is allowed on this type of document.', Comment = '%1 - Item Variant Code, %2 - Item No.';
- InvDiscForPrepmtExceededErr: Label 'You cannot enter an invoice discount for purchase document %1.\\You must cancel the prepayment invoice first and then you will be able to update the invoice discount.', Comment = '%1 - document number';
- CannotAllowInvDiscountErr: Label 'The value of the %1 field is not valid when the VAT Calculation Type field is set to "Full VAT".', Comment = '%1 is the name of not valid field';
- CannotChangeVATGroupWithPrepmInvErr: Label 'You cannot change the VAT product posting group because prepayment invoices have been posted.\\You need to post the prepayment credit memo to be able to change the VAT product posting group.';
- CannotChangePrepmtAmtDiffVAtPctErr: Label 'You cannot change the prepayment amount because the prepayment invoice has been posted with a different VAT percentage. Please check the settings on the prepayment G/L account.';
- LineAmountInvalidErr: Label 'You have set the line amount to a value that results in a discount that is not valid. Consider increasing the unit cost instead.';
- ChangeExtendedTextErr: Label 'You cannot change %1 for Extended Text Line.', Comment = '%1= Field Caption';
- InvoiceOrOrderDocTypeErr: Label '%1 must be either %2 or %3.', Comment = '%1 - Document Type; %2, %3 - Purchase Document Type, Invoice or Order';
- CannotInsertPurchLineWithoutHeaderErr: Label 'You cannot insert a purchase line without a purchase header.';
- MustSpecifyErr: Label 'You must either specify %1 or %2.', Comment = '%1 = Field Caption; %2 = Field Caption';
-
- protected var
- Currency: Record Currency;
- HideValidationDialog: Boolean;
- StatusCheckSuspended: Boolean;
- SkipTaxCalculation: Boolean;
- TrackingBlocked: Boolean;
-
- ///
- /// Initializes outstanding quantities and amounts of the purchase line.
- ///
- procedure InitOutstanding()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInitOutstanding(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if IsCreditDocType() then begin
- "Outstanding Quantity" := Quantity - "Return Qty. Shipped";
- "Outstanding Qty. (Base)" := "Quantity (Base)" - "Return Qty. Shipped (Base)";
- "Return Qty. Shipped Not Invd." := "Return Qty. Shipped" - "Quantity Invoiced";
- "Ret. Qty. Shpd Not Invd.(Base)" := "Return Qty. Shipped (Base)" - "Qty. Invoiced (Base)";
- end else begin
- "Outstanding Quantity" := Quantity - "Quantity Received";
- "Outstanding Qty. (Base)" := "Quantity (Base)" - "Qty. Received (Base)";
- "Qty. Rcd. Not Invoiced" := "Quantity Received" - "Quantity Invoiced";
- "Qty. Rcd. Not Invoiced (Base)" := "Qty. Received (Base)" - "Qty. Invoiced (Base)";
- end;
-
- OnAfterInitOutstandingQty(Rec, xRec);
- "Completely Received" := (Quantity <> 0) and ("Outstanding Quantity" = 0);
- OnInitOutstandingOnBeforeInitOutstandingAmount(Rec, xRec);
- InitOutstandingAmount();
- end;
-
- ///
- /// Initializes the outstanding amounts of the purchase line.
- ///
- procedure InitOutstandingAmount()
- var
- AmountInclVAT: Decimal;
- begin
- if Quantity = 0 then begin
- "Outstanding Amount" := 0;
- "Outstanding Amount (LCY)" := 0;
- "Outstanding Amt. Ex. VAT (LCY)" := 0;
- "Amt. Rcd. Not Invoiced" := 0;
- "Amt. Rcd. Not Invoiced (LCY)" := 0;
- "Return Shpd. Not Invd." := 0;
- "Return Shpd. Not Invd. (LCY)" := 0;
- end else begin
- GetPurchHeader();
- AmountInclVAT := "Amount Including VAT";
- Validate(
- "Outstanding Amount",
- Round(
- AmountInclVAT * "Outstanding Quantity" / Quantity,
- Currency."Amount Rounding Precision"));
- if IsCreditDocType() then
- Validate(
- "Return Shpd. Not Invd.",
- Round(
- AmountInclVAT * "Return Qty. Shipped Not Invd." / Quantity,
- Currency."Amount Rounding Precision"))
- else
- Validate(
- "Amt. Rcd. Not Invoiced",
- Round(
- AmountInclVAT * "Qty. Rcd. Not Invoiced" / Quantity,
- Currency."Amount Rounding Precision"));
- end;
-
- OnAfterInitOutstandingAmount(Rec, xRec, PurchHeader, Currency);
- end;
-
- ///
- /// Initializes the quantity to receive and quantity to invoice of the purchase line.
- ///
- procedure InitQtyToReceive()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInitQtyToReceive(Rec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- GetPurchSetup();
- if (PurchSetup."Default Qty. to Receive" = PurchSetup."Default Qty. to Receive"::Remainder) or
- ("Document Type" = "Document Type"::Invoice)
- then begin
- "Qty. to Receive" := "Outstanding Quantity";
- "Qty. to Receive (Base)" := "Outstanding Qty. (Base)";
- end else
- if "Qty. to Receive" <> 0 then
- "Qty. to Receive (Base)" :=
- MaxQtyToReceiveBase(CalcBaseQty("Qty. to Receive", FieldCaption("Qty. to Receive"), FieldCaption("Qty. to Receive (Base)")));
- OnAfterInitQtyToReceive(Rec, CurrFieldNo);
-
- InitQtyToInvoice();
- end;
-
- ///
- /// Initializes the return quantity to ship and quantity to invoice of the purchase line.
- ///
- procedure InitQtyToShip()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInitQtyToShip(Rec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- GetPurchSetup();
- if (PurchSetup."Default Qty. to Receive" = PurchSetup."Default Qty. to Receive"::Remainder) or
- ("Document Type" = "Document Type"::"Credit Memo")
- then begin
- "Return Qty. to Ship" := "Outstanding Quantity";
- "Return Qty. to Ship (Base)" := "Outstanding Qty. (Base)";
- end else
- if "Return Qty. to Ship" <> 0 then
- "Return Qty. to Ship (Base)" := CalcBaseQty("Return Qty. to Ship", FieldCaption("Return Qty. to Ship"), FieldCaption("Return Qty. to Ship (Base)"));
- OnAfterInitQtyToShip(Rec, CurrFieldNo);
-
- InitQtyToInvoice();
- end;
-
- ///
- /// Initializes the quantity to invoice and vat of the purchase line.
- /// Calculates invoice disc. amount to invoice.
- ///
- ///
- /// If document type is not an invoice, prepayment amount to deduct is calculated.
- ///
- procedure InitQtyToInvoice()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInitQtyToInvoice(Rec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- "Qty. to Invoice" := MaxQtyToInvoice();
- "Qty. to Invoice (Base)" := MaxQtyToInvoiceBase();
- "VAT Difference" := 0;
- NonDeductibleVAT.InitNonDeductibleVATDiff(Rec);
-
- OnBeforeCalcInvDiscToInvoice(Rec, CurrFieldNo);
- CalcInvDiscToInvoice();
- if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then
- CalcPrepaymentToDeduct();
-
- OnAfterInitQtyToInvoice(Rec, CurrFieldNo);
- end;
-
- local procedure InitOutstandingAndQtyToShipReceive(var TempPurchLine: Record "Purchase Line" temporary)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInitOutstandingAndQtyToShipReceive(Rec, TempPurchLine, IsHandled, xRec);
- if IsHandled then
- exit;
-
- if Quantity <> 0 then begin
- InitOutstanding();
- if IsCreditDocType() then
- InitQtyToShip()
- else
- InitQtyToReceive();
- end;
- end;
-
- local procedure InitItemAppl()
- begin
- "Appl.-to Item Entry" := 0;
- end;
-
- procedure InitHeaderDefaults(PurchHeader: Record "Purchase Header"; var TempPurchLine: Record "Purchase Line" temporary)
- var
- IsHandled: Boolean;
- begin
- CheckBuyFromVendorNo(PurchHeader);
-
- "Buy-from Vendor No." := PurchHeader."Buy-from Vendor No.";
- "Currency Code" := PurchHeader."Currency Code";
- "Expected Receipt Date" := PurchHeader."Expected Receipt Date";
- "Shortcut Dimension 1 Code" := PurchHeader."Shortcut Dimension 1 Code";
- "Shortcut Dimension 2 Code" := PurchHeader."Shortcut Dimension 2 Code";
- "Dimension Set ID" := PurchHeader."Dimension Set ID";
- "Location Code" := PurchHeader."Location Code";
- "Transaction Type" := PurchHeader."Transaction Type";
- "Transport Method" := PurchHeader."Transport Method";
- "Pay-to Vendor No." := PurchHeader."Pay-to Vendor No.";
- "Price Calculation Method" := PurchHeader."Price Calculation Method";
- "Gen. Bus. Posting Group" := PurchHeader."Gen. Bus. Posting Group";
- IsHandled := false;
- OnInitHeaderDefaultsOnBeforeSetVATBusPostingGroup(Rec, IsHandled);
- if not IsHandled then
- "VAT Bus. Posting Group" := PurchHeader."VAT Bus. Posting Group";
- "Entry Point" := PurchHeader."Entry Point";
- Area := PurchHeader.Area;
- "Transaction Specification" := PurchHeader."Transaction Specification";
- "Tax Area Code" := PurchHeader."Tax Area Code";
- "Tax Liable" := PurchHeader."Tax Liable";
- if not "System-Created Entry" and ("Document Type" = "Document Type"::Order) and HasTypeToFillMandatoryFields() or
- IsServiceCharge()
- then
- "Prepayment %" := PurchHeader."Prepayment %";
- "Prepayment Tax Area Code" := PurchHeader."Tax Area Code";
- "Prepayment Tax Liable" := PurchHeader."Tax Liable";
- "Responsibility Center" := PurchHeader."Responsibility Center";
- "Requested Receipt Date" := PurchHeader."Requested Receipt Date";
- "Promised Receipt Date" := PurchHeader."Promised Receipt Date";
- "Inbound Whse. Handling Time" := PurchHeader."Inbound Whse. Handling Time";
- "Order Date" := PurchHeader."Order Date";
-
- OnAfterInitHeaderDefaults(Rec, PurchHeader, TempPurchLine);
- end;
-
- local procedure InitJobFields()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInitJobFields(Rec, xRec, IsHandled, CurrFieldNo);
- if IsHandled then
- exit;
-
- if "Job No." <> xRec."Job No." then begin
- Validate("Job Task No.", '');
- Validate("Job Planning Line No.", 0);
- end;
- end;
-
- ///
- /// Calculates maximum quantity that can be invoiced for the purchase line.
- ///
- /// Maximum quantity that can be invoiced.
- procedure MaxQtyToInvoice(): Decimal
- var
- MaxQty: Decimal;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeMaxQtyToInvoice(Rec, MaxQty, IsHandled);
- if IsHandled then
- exit(MaxQty);
-
- if "Prepayment Line" then
- exit(1);
-
- if IsCreditDocType() then
- exit("Return Qty. Shipped" + "Return Qty. to Ship" - "Quantity Invoiced");
- if "Document Type" = "Document Type"::"Blanket Order" then
- exit(Quantity - "Quantity Invoiced");
- exit("Quantity Received" + "Qty. to Receive" - "Quantity Invoiced");
- end;
-
- ///
- /// Calculates maximum quantity (base) that can be invoiced for the purchase line.
- ///
- /// Maximum quantity (base) that can be invoiced.
- procedure MaxQtyToInvoiceBase(): Decimal
- var
- MaxQtyBase: Decimal;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeMaxQtyToInvoiceBase(Rec, MaxQtyBase, IsHandled);
- if IsHandled then
- exit(MaxQtyBase);
-
- if IsCreditDocType() then
- exit("Return Qty. Shipped (Base)" + "Return Qty. to Ship (Base)" - "Qty. Invoiced (Base)");
- if "Document Type" = "Document Type"::"Blanket Order" then
- exit("Quantity (Base)" - "Qty. Invoiced (Base)");
- exit("Qty. Received (Base)" + "Qty. to Receive (Base)" - "Qty. Invoiced (Base)");
- end;
-
- ///
- /// Returns the maximum quantity (base) that can be received for a given quantity.
- ///
- /// Quantity (base).
- /// The maximum quantity (base) thant can be received.
- procedure MaxQtyToReceiveBase(QtyToReceiveBase: Decimal): Decimal
- begin
- if Abs(QtyToReceiveBase) > Abs("Outstanding Qty. (Base)") then
- exit("Outstanding Qty. (Base)");
-
- exit(QtyToReceiveBase);
- end;
-
- internal procedure GetVatBaseDiscountPct(PurchaseHeader: Record "Purchase Header") Result: Decimal
- begin
- Result := PurchaseHeader."VAT Base Discount %";
- OnAfterGetVatBaseDiscountPct(Rec, PurchaseHeader, Result);
- end;
-
- ///
- /// Calculates and sets the invoices discount amount to invoice and updates vat.
- ///
- procedure CalcInvDiscToInvoice()
- var
- OldInvDiscAmtToInv: Decimal;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCalcInvDiscToInvoiceProcedure(Rec, Currency, IsHandled);
- if not IsHandled then begin
- GetPurchHeader();
- OldInvDiscAmtToInv := "Inv. Disc. Amount to Invoice";
- if Quantity = 0 then
- Validate("Inv. Disc. Amount to Invoice", 0)
- else
- Validate(
- "Inv. Disc. Amount to Invoice",
- Round(
- "Inv. Discount Amount" * "Qty. to Invoice" / Quantity,
- Currency."Amount Rounding Precision"));
-
- if OldInvDiscAmtToInv <> "Inv. Disc. Amount to Invoice" then begin
- "Amount Including VAT" := "Amount Including VAT" - "VAT Difference";
- ClearVATDifference();
- NonDeductibleVAT.InitNonDeductibleVATDiff(Rec);
- end;
- NotifyOnMissingSetup(FieldNo("Inv. Discount Amount"));
-
- end;
- OnAfterCalcInvDiscToInvoice(Rec, OldInvDiscAmtToInv);
- end;
-
- ///
- /// Calculates the line amount minus inv. discount amount for the purchase line.
- ///
- /// Line amount minus inv. discount amount.
- procedure CalcLineAmount() LineAmount: Decimal
- begin
- LineAmount := "Line Amount" - "Inv. Discount Amount";
-
- OnAfterCalcLineAmount(Rec, LineAmount);
- end;
-
- local procedure CanReceiveQty(): Boolean
- begin
- if Abs("Qty. to Receive") > Abs("Outstanding Quantity") then
- exit(false);
-
- if ("Qty. to Receive" < 0) and (Quantity > 0) or
- ("Qty. to Receive" > 0) and (Quantity < 0)
- then
- exit(false);
-
- if ("Outstanding Quantity" < 0) and (Quantity > 0) or
- ("Outstanding Quantity" > 0) and (Quantity < 0)
- then
- exit(false);
-
- exit(true);
- end;
-
- local procedure CanReceiveBaseQty(): Boolean
- begin
- if Abs("Qty. to Receive (Base)") > Abs("Outstanding Qty. (Base)") then
- exit(false);
-
- if ("Qty. to Receive (Base)" < 0) and ("Quantity (Base)" > 0) or
- ("Qty. to Receive (Base)" > 0) and ("Quantity (Base)" < 0)
- then
- exit(false);
-
- if ("Outstanding Qty. (Base)" < 0) and ("Quantity (Base)" > 0) or
- ("Outstanding Qty. (Base)" > 0) and ("Quantity (Base)" < 0)
- then
- exit(false);
-
- exit(true);
- end;
-
- procedure CheckLineAmount(MaxLineAmount: Decimal)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckLineAmount(Rec, MaxLineAmount, IsHandled, CurrFieldNo);
- if IsHandled then
- exit;
-
- if "Line Amount" < 0 then
- if "Line Amount" < MaxLineAmount then
- Error(LineAmountInvalidErr);
-
- if "Line Amount" > 0 then
- if "Line Amount" > MaxLineAmount then
- Error(LineAmountInvalidErr);
- end;
-
- procedure CheckLineTypeOnIndirectCostPercentUpdate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckLineTypeOnIndirectCostPercentUpdate(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if Type <> Type::Item then
- TestField("Indirect Cost %", 0);
- end;
-
- local procedure CalcQtyPerUnitOfMeasure(Item: Record Item)
- begin
- "Qty. per Unit of Measure" := UOMMgt.GetQtyPerUnitOfMeasure(Item, "Unit of Measure Code");
- OnAfterCalcQtyPerUnitOfMeasure(Rec, Item, CurrfieldNo);
- end;
-
- local procedure CalcIndirectCostPercent()
- var
- IndirectCostPercent: Decimal;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCalcIndirectCostPercent(Rec, UnitCostCurrency, IsHandled);
- if IsHandled then
- exit;
-
- if ("Direct Unit Cost" <> 0) and
- ("Direct Unit Cost" <> ("Line Discount Amount" / Quantity))
- then begin
- IndirectCostPercent :=
- Round(
- (UnitCostCurrency - "Direct Unit Cost" + "Line Discount Amount" / Quantity) /
- ("Direct Unit Cost" - "Line Discount Amount" / Quantity) * 100, 0.00001);
- if IndirectCostPercent >= 0 then begin
- "Indirect Cost %" := IndirectCostPercent;
- CheckLineTypeOnIndirectCostPercentUpdate();
- end;
- end;
- end;
-
- local procedure CopyFromStandardText()
- var
- StandardText: Record "Standard Text";
- begin
- "Tax Area Code" := '';
- "Tax Liable" := false;
- StandardText.Get("No.");
- Description := StandardText.Description;
- "Allow Item Charge Assignment" := false;
- OnAfterAssignStdTxtValues(Rec, StandardText);
- end;
-
- local procedure CopyFromGLAccount(var TempPurchaseLine: Record "Purchase Line" temporary)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCopyFromGLAccount(Rec, xRec, CurrFieldNo, IsHandled);
- if not IsHandled then begin
- GLAcc.Get("No.");
- GLAcc.CheckGLAcc();
- if not "System-Created Entry" then
- GLAcc.TestField("Direct Posting", true);
- Description := GLAcc.Name;
- "Gen. Prod. Posting Group" := GLAcc."Gen. Prod. Posting Group";
- "VAT Prod. Posting Group" := GLAcc."VAT Prod. Posting Group";
- "Tax Group Code" := GLAcc."Tax Group Code";
- "Allow Invoice Disc." := false;
- "Allow Item Charge Assignment" := false;
- OnNotHandledCopyFromGLAccount(Rec, GLAcc);
- InitDeferralCode();
- SetDefaultGLAccountQuantity();
- end;
- OnAfterAssignGLAccountValues(Rec, GLAcc, PurchHeader, xRec, TempPurchaseLine);
- end;
-
- local procedure CopyFromItem()
- var
- Item: Record Item;
- PrepaymentMgt: Codeunit "Prepayment Mgt.";
- IsHandled: Boolean;
- begin
- GetItem(Item);
- GetGLSetup();
- IsHandled := false;
- OnBeforeCopyFromItem(Rec, Item, IsHandled);
- if not IsHandled then begin
- Item.TestField(Blocked, false);
- Item.TestField("Gen. Prod. Posting Group");
- if Item."Purchasing Blocked" then
- if IsCreditDocType() then
- SendBlockedItemNotification()
- else
- Error(PurchasingBlockedErr, Item.TableCaption(), Item."No.", Item.FieldCaption("Purchasing Blocked"));
- if Item.Type = Item.Type::Inventory then begin
- Item.TestField("Inventory Posting Group");
- "Posting Group" := Item."Inventory Posting Group";
- end;
- MatchedOrderLineMgmt.CheckReceiptOnInvoiceAllowedForItem(Item, GetPurchHeader());
- end;
-
- OnCopyFromItemOnAfterCheck(Rec, Item, CurrFieldNo);
-
- Description := Item.Description;
- "Description 2" := Item."Description 2";
- UpdateUnitPriceLCYFromItem(Item);
- "Units per Parcel" := Item."Units per Parcel";
- "Indirect Cost %" := Item."Indirect Cost %";
- "Overhead Rate" := Item."Overhead Rate";
- "Allow Invoice Disc." := Item."Allow Invoice Disc.";
- "Gen. Prod. Posting Group" := Item."Gen. Prod. Posting Group";
- "VAT Prod. Posting Group" := Item."VAT Prod. Posting Group";
- "Tax Group Code" := Item."Tax Group Code";
- Nonstock := Item."Created From Nonstock Item";
- "Item Category Code" := Item."Item Category Code";
- "Allow Item Charge Assignment" := true;
- PrepaymentMgt.SetPurchPrepaymentPct(Rec, PurchHeader."Posting Date");
- if IsInventoriableItem() then
- PostingSetupMgt.CheckInvtPostingSetupInventoryAccount("Location Code", "Posting Group");
-
- if Item."Price Includes VAT" then begin
- if not VATPostingSetup.Get(Item."VAT Bus. Posting Gr. (Price)", Item."VAT Prod. Posting Group") then
- VATPostingSetup.Init();
- case VATPostingSetup."VAT Calculation Type" of
- VATPostingSetup."VAT Calculation Type"::"Reverse Charge VAT":
- VATPostingSetup."VAT %" := 0;
- VATPostingSetup."VAT Calculation Type"::"Sales Tax":
- Error(
- Text002,
- VATPostingSetup.FieldCaption("VAT Calculation Type"),
- VATPostingSetup."VAT Calculation Type");
- end;
- IsHandled := false;
- OnCopyFromItemOnBeforeAssignUnitPriceLCY(Rec, GLSetup, VATPostingSetup, IsHandled);
- if not IsHandled then
- "Unit Price (LCY)" :=
- Round("Unit Price (LCY)" / (1 + VATPostingSetup."VAT %" / 100),
- GLSetup."Unit-Amount Rounding Precision");
- end;
-
- if PurchHeader."Language Code" <> '' then
- GetItemTranslation();
-
- OnCopyFromItemOnAfterGetItemTranslation(Rec, Item);
-
- if Item."Purch. Unit of Measure" <> '' then
- "Unit of Measure Code" := Item."Purch. Unit of Measure"
- else
- "Unit of Measure Code" := Item."Base Unit of Measure";
- InitDeferralCode();
- OnAfterAssignItemValues(Rec, Item, CurrFieldNo, PurchHeader);
- end;
-
- local procedure UpdateUnitPriceLCYFromItem(Item: Record Item)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateUnitPriceLCYFromItem(Rec, Item, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- "Unit Price (LCY)" := Item."Unit Price";
- end;
-
- local procedure UpdateOrderDateFromRequestedReceiptDate(CustomCalendarChange: array[2] of Record "Customized Calendar Change")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateOrderDateFromRequestedReceiptDate(Rec, CustomCalendarChange, IsHandled);
- if IsHandled then
- exit;
-
- Validate("Order Date",
- CalendarMgmt.CalcDateBOC2(AdjustDateFormula("Lead Time Calculation"), "Requested Receipt Date", CustomCalendarChange, true));
- end;
-
- local procedure UpdatePlannedReceiptDateFromOrderDate(CustomCalendarChange: array[2] of Record "Customized Calendar Change")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdatePlannedReceiptDateFromOrderDate(Rec, CustomCalendarChange, IsHandled);
- if IsHandled then
- exit;
-
- "Planned Receipt Date" :=
- CalendarMgmt.CalcDateBOC(AdjustDateFormula("Lead Time Calculation"), "Order Date", CustomCalendarChange, true);
- end;
-
- local procedure UpdateOrderDateFromPlannedReceiptDate(CustomCalendarChange: array[2] of Record "Customized Calendar Change")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateOrderDateFromPlannedReceiptDate(Rec, CustomCalendarChange, IsHandled);
- if IsHandled then
- exit;
-
- "Order Date" :=
- CalendarMgmt.CalcDateBOC2(AdjustDateFormula("Lead Time Calculation"), "Planned Receipt Date", CustomCalendarChange, true);
- end;
-
- local procedure CopyFromFixedAsset()
- var
- FixedAsset: Record "Fixed Asset";
- begin
- FixedAsset.Get("No.");
- FixedAsset.TestField(Inactive, false);
- FixedAsset.TestField(Blocked, false);
- GetFAPostingGroup();
- Description := FixedAsset.Description;
- "Description 2" := FixedAsset."Description 2";
- "Allow Invoice Disc." := false;
- "Allow Item Charge Assignment" := false;
- OnAfterAssignFixedAssetValues(Rec, FixedAsset, PurchHeader);
- end;
-
- local procedure CopyFromItemCharge()
- begin
- ItemCharge.Get("No.");
- Description := ItemCharge.Description;
- "Gen. Prod. Posting Group" := ItemCharge."Gen. Prod. Posting Group";
- "VAT Prod. Posting Group" := ItemCharge."VAT Prod. Posting Group";
- "Tax Group Code" := ItemCharge."Tax Group Code";
- "Allow Invoice Disc." := false;
- "Allow Item Charge Assignment" := false;
- "Indirect Cost %" := 0;
- "Overhead Rate" := 0;
- OnAfterAssignItemChargeValues(Rec, ItemCharge, PurchHeader);
- end;
-
- local procedure SelectItemEntry()
- var
- ItemLedgEntry: Record "Item Ledger Entry";
- begin
- TestProdOrderNo();
- ItemLedgEntry.SetCurrentKey("Item No.", Open);
- ItemLedgEntry.SetRange("Item No.", "No.");
- ItemLedgEntry.SetRange(Open, true);
- ItemLedgEntry.SetRange(Positive, true);
- OnSelectItemEntryOnBeforeSetRangeLocationCode(Rec, ItemLedgEntry);
- if "Location Code" <> '' then
- ItemLedgEntry.SetRange("Location Code", "Location Code");
- ItemLedgEntry.SetRange("Variant Code", "Variant Code");
- OnSelectItemEntryOnAfterItemLedgEntrySetFilters(Rec, ItemLedgEntry);
-
- if PAGE.RunModal(PAGE::"Item Ledger Entries", ItemLedgEntry) = ACTION::LookupOK then
- Validate("Appl.-to Item Entry", ItemLedgEntry."Entry No.");
- end;
-
- ///
- /// Assigns given purchase header to the global variable and initializes the currency variable.
- ///
- /// Purchase header to be set.
- procedure SetPurchHeader(NewPurchHeader: Record "Purchase Header")
- begin
- PurchHeader := NewPurchHeader;
- HasPurchHeader := true;
-
- if PurchHeader."Currency Code" = '' then
- Currency.InitRoundingPrecision()
- else begin
- PurchHeader.TestField("Currency Factor");
- Currency.Get(PurchHeader."Currency Code");
- Currency.TestField("Amount Rounding Precision");
- end;
- end;
-
- ///
- /// Retrieves the global purchase header for the current purchase line.
- ///
- /// Purchase header of the current purchase line.
- procedure GetPurchHeader(): Record "Purchase Header"
- begin
- GetPurchHeader(PurchHeader, Currency);
- exit(PurchHeader);
- end;
-
- ///
- /// Gets the purchase header and currency for the current purchase line.
- ///
- /// Return value: Purchase header of the purchase line.
- /// Return value: Currency of the purchase line.
- procedure GetPurchHeader(var OutPurchHeader: Record "Purchase Header"; var OutCurrency: Record Currency)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetPurchHeader(Rec, PurchHeader, IsHandled, Currency, HasPurchHeader);
- if IsHandled then
- exit;
-
- TestField("Document No.");
- if ("Document Type" <> PurchHeader."Document Type") or ("Document No." <> PurchHeader."No.") then
- if PurchHeader.Get(Rec."Document Type", Rec."Document No.") then begin
- HasPurchHeader := true;
- if PurchHeader."Currency Code" = '' then
- Currency.InitRoundingPrecision()
- else begin
- PurchHeader.TestField("Currency Factor");
- Currency.Get(PurchHeader."Currency Code");
- Currency.TestField("Amount Rounding Precision");
- end
- end else begin
- Clear(PurchHeader);
- HasPurchHeader := false;
- end;
-
- OnAfterGetPurchHeader(Rec, PurchHeader, Currency);
- OutPurchHeader := PurchHeader;
- OutCurrency := Currency;
- end;
-
- ///
- /// Returns the item record.
- ///
- /// The item record.
- procedure GetItem(): Record Item
- var
- Item: Record Item;
- begin
- TestField("No.");
- Item.Get("No.");
- exit(Item);
- end;
-
- local procedure GetItem(var Item: Record Item)
- begin
- TestField("No.");
- Item.Get("No.");
-
- OnAfterGetItem(Item, Rec);
- end;
-
- ///
- /// Returns remaining unreserved quantity and quantity (base) of the purchase line.
- ///
- /// Return value: Remaining unreserved quantity.
- /// Return value: Remaining unreserved quantity (base).
- procedure GetRemainingQty(var RemainingQty: Decimal; var RemainingQtyBase: Decimal)
- begin
- CalcFields("Reserved Quantity", "Reserved Qty. (Base)");
- RemainingQty := "Outstanding Quantity" - Abs("Reserved Quantity");
- RemainingQtyBase := "Outstanding Qty. (Base)" - Abs("Reserved Qty. (Base)");
- end;
-
- ///
- /// Returns reservation quantities.
- ///
- /// Return value: Reserved quantity.
- /// Return value: Reserved quantity (base).
- /// Return value: Quantity to reserve.
- /// Return value: Quantity to reserve (base).
- /// Qty per unit of measure.
- procedure GetReservationQty(var QtyReserved: Decimal; var QtyReservedBase: Decimal; var QtyToReserve: Decimal; var QtyToReserveBase: Decimal) Result: Decimal
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetReservationQty(Rec, QtyReserved, QtyReservedBase, QtyToReserve, QtyToReserveBase, Result, IsHandled);
- if not IsHandled then begin
- CalcFields("Reserved Quantity", "Reserved Qty. (Base)");
- if "Document Type" = "Document Type"::"Return Order" then begin
- "Reserved Quantity" := -"Reserved Quantity";
- "Reserved Qty. (Base)" := -"Reserved Qty. (Base)";
- end;
- QtyReserved := "Reserved Quantity";
- QtyReservedBase := "Reserved Qty. (Base)";
- QtyToReserve := "Outstanding Quantity";
- QtyToReserveBase := "Outstanding Qty. (Base)";
- Result := "Qty. per Unit of Measure";
- end;
- OnAfterGetReservationQty(Rec, QtyReserved, QtyReservedBase, QtyToReserve, QtyToReserveBase, Result);
- end;
-
- ///
- /// Returns a text that consists of the document type, document no. and line number separated by a space.
- ///
- /// Formated text.
- procedure GetSourceCaption(): Text
- begin
- exit(StrSubstNo('%1 %2 %3', "Document Type", "Document No.", "No."));
- end;
-
- ///
- /// Initializes the reservation entries from the purchase line.
- ///
- /// Return value: Initialized reservation entry.
- procedure SetReservationEntry(var ReservEntry: Record "Reservation Entry")
- begin
- ReservEntry.SetSource(Database::"Purchase Line", "Document Type".AsInteger(), "Document No.", "Line No.", '', 0);
- ReservEntry.SetItemData("No.", Description, "Location Code", "Variant Code", "Qty. per Unit of Measure");
- if Type <> Type::Item then
- ReservEntry."Item No." := '';
- ReservEntry."Expected Receipt Date" := "Expected Receipt Date";
- ReservEntry."Shipment Date" := "Expected Receipt Date";
- ReservEntry."Planning Flexibility" := "Planning Flexibility";
-
- OnAfterSetReservationEntry(ReservEntry, Rec);
- end;
-
- ///
- /// Filters reservation entry from the purchase line.
- ///
- /// Return value: Filtered reservation entry.
- procedure SetReservationFilters(var ReservEntry: Record "Reservation Entry")
- begin
- ReservEntry.SetSourceFilter(Database::"Purchase Line", "Document Type".AsInteger(), "Document No.", "Line No.", false);
- ReservEntry.SetSourceFilter('', 0);
-
- OnAfterSetReservationFilters(ReservEntry, Rec);
- end;
-
- ///
- /// Checks if reservation entry exists for the purchase line.
- ///
- /// True if reservation entry exists, otherwise false
- procedure ReservEntryExist(): Boolean
- var
- ReservEntry: Record "Reservation Entry";
- begin
- ReservEntry.InitSortingAndFilters(false);
- SetReservationFilters(ReservEntry);
- exit(not ReservEntry.IsEmpty);
- end;
-
- ///
- /// Returns line amount excluding VAT for the purchase line.
- ///
- ///
- /// If the prices includes VAT in its prices, it calculates the line amount excluding VAT.
- ///
- /// Line amount excluding VAT.
- procedure GetLineAmountExclVAT(): Decimal
- begin
- if "Document No." = '' then
- exit(0);
- GetPurchHeader();
- if not PurchHeader."Prices Including VAT" then
- exit("Line Amount");
-
- exit(Round("Line Amount" / (1 + "VAT %" / 100), Currency."Amount Rounding Precision"));
- end;
-
- ///
- /// Returns line amount including VAT for the purchase line.
- ///
- ///
- /// If the prices does not include VAT in its prices, it calculates the line amount including VAT.
- ///
- /// Line amount including VAT.
- procedure GetLineAmountInclVAT(): Decimal
- begin
- if "Document No." = '' then
- exit(0);
- GetPurchHeader();
- if PurchHeader."Prices Including VAT" then
- exit("Line Amount");
-
- exit(Round("Line Amount" * (1 + "VAT %" / 100), Currency."Amount Rounding Precision"));
- end;
-
- ///
- /// Sets the global flag HasBeenShown to true.
- ///
- ///
- /// The global flag is used to determine if the message which states that the order date is earlier than the work date has been shown.
- ///
- procedure SetHasBeenShown()
- begin
- HasBeenShown := true;
- end;
-
- ///
- /// Checks if the procedure has been called from the field that was previously planned.
- ///
- /// Field that called the price calculation.
- /// True if the if the calculation is triggered by the planned field, otherwise false.
- procedure IsPriceCalcCalledByField(CurrPriceFieldNo: Integer): Boolean;
- begin
- exit(FieldCausedPriceCalculation = CurrPriceFieldNo);
- end;
-
- ///
- /// Sets the field that initiates the price calculation if it is not already set.
- ///
- /// Field number that cause price calculation.
- procedure PlanPriceCalcByField(CurrPriceFieldNo: Integer)
- begin
- if FieldCausedPriceCalculation = 0 then
- FieldCausedPriceCalculation := CurrPriceFieldNo;
- end;
-
- ///
- /// Clears the field number that is planned to initiate the price calculation.
- ///
- procedure ClearFieldCausedPriceCalculation()
- begin
- FieldCausedPriceCalculation := 0;
- end;
-
- ///
- /// Updates the direct unit cost of the purchase line.
- ///
- /// Field number that called direct unit cost calculation.
- procedure UpdateDirectUnitCost(CalledByFieldNo: Integer)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateDirectUnitCostProcedure(Rec, CalledByFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- ClearFieldCausedPriceCalculation();
- PlanPriceCalcByField(CalledByFieldNo);
- UpdateDirectUnitCostByField(CalledByFieldNo);
- end;
-
- local procedure UpdateDirectUnitCostByField(CalledByFieldNo: Integer)
- var
- BlanketOrderPurchaseLine: Record "Purchase Line";
- PriceCalculation: Interface "Price Calculation";
- IsHandled: Boolean;
- ShouldExit: Boolean;
- begin
- if not IsPriceCalcCalledByField(CalledByFieldNo) then
- exit;
-
- IsHandled := false;
- OnBeforeUpdateDirectUnitCost(Rec, xRec, CalledByFieldNo, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- if (CurrFieldNo <> 0) and IsProdOrder() then
- UpdateAmounts();
-
- ShouldExit := ((CalledByFieldNo <> CurrFieldNo) and (CurrFieldNo <> 0)) or IsProdOrder();
-
- OverturnExitConditionForNoViaDescription(CalledByFieldNo, ShouldExit);
- OverturnExitConditionForDefaultGLAccountQuantityValidation(ShouldExit);
- OnUpdateDirectUnitCostByFieldOnAfterCalcShouldExit(Rec, xRec, CalledByFieldNo, CurrFieldNo, ShouldExit);
- if ShouldExit then
- exit;
-
- case Type of
- Type::"G/L Account",
- Type::Item,
- Type::Resource:
- begin
- GetPurchHeader();
- IsHandled := false;
- OnUpdateDirectUnitCostOnBeforeFindPrice(PurchHeader, Rec, CalledByFieldNo, CurrFieldNo, IsHandled, xRec);
- if not IsHandled then
- if not BlanketOrderIsRelated(BlanketOrderPurchaseLine) then begin
- GetPriceCalculationHandler(PurchHeader, PriceCalculation);
- if not ("Copied From Posted Doc." and IsCreditDocType()) then begin
- PriceCalculation.ApplyPrice(CalledByFieldNo);
- PriceCalculation.ApplyDiscount();
- end;
- GetLineWithCalculatedPrice(PriceCalculation);
- end else begin
- Validate("Direct Unit Cost", BlanketOrderPurchaseLine."Direct Unit Cost");
- Validate("Line Discount %", BlanketOrderPurchaseLine."Line Discount %");
-
- OnUpdateDirectUnitCostByFieldOnAfterSetBlanketOrderPriceFields(PurchHeader, BlanketOrderPurchaseLine, Rec, CalledByFieldNo, CurrFieldNo);
- end;
- if (xRec."Direct Unit Cost" <> Rec."Direct Unit Cost") or not (CalledByFieldNo in [FieldNo("Job Task No."), FieldNo("Job No.")]) then
- Validate("Direct Unit Cost");
- end;
- end;
-
- OnUpdateDirectUnitCostByFieldOnBeforeUpdateItemReference(Rec, CalledByFieldNo);
- if Type = Type::Item then
- if CalledByFieldNo in [FieldNo("No."), FieldNo("Variant Code")] then
- UpdateItemReference();
-
- ClearFieldCausedPriceCalculation();
- OnAfterUpdateDirectUnitCost(Rec, xRec, CalledByFieldNo, CurrFieldNo);
- end;
-
- local procedure BlanketOrderIsRelated(var BlanketOrderPurchaseLine: Record "Purchase Line"): Boolean
- var
- IsHandled, Result : Boolean;
- begin
- IsHandled := false;
- Result := false;
- OnBeforeBlanketOrderIsRelated(Rec, BlanketOrderPurchaseLine, IsHandled, Result);
- if IsHandled then
- exit(Result);
-
- if "Blanket Order Line No." = 0 then exit;
- BlanketOrderPurchaseLine.SetLoadFields("Direct Unit Cost", "Line Discount %");
- OnBlanketOrderIsRelatedOnAfterSetLoadFields(BlanketOrderPurchaseLine);
- if BlanketOrderPurchaseLine.Get("Document Type"::"Blanket Order", "Blanket Order No.", "Blanket Order Line No.") then
- exit(true);
- end;
-
- local procedure GetLineWithCalculatedPrice(var PriceCalculation: Interface "Price Calculation")
- var
- Line: Variant;
- begin
- PriceCalculation.GetLine(Line);
- Rec := Line;
- end;
-
- ///
- /// Gets price calculation interface implementation for the purchase line.
- ///
- /// Purchase header that is used to get price calculation implementation.
- /// Return value: Price calculation interface inplementation.
- procedure GetPriceCalculationHandler(PurchaseHeader: Record "Purchase Header"; var PriceCalculation: Interface "Price Calculation")
- var
- PriceCalculationMgt: codeunit "Price Calculation Mgt.";
- LineWithPrice: Interface "Line With Price";
- PriceType: Enum "Price Type";
- begin
- if (PurchaseHeader."No." = '') and ("Document No." <> '') then
- PurchaseHeader.Get(Rec."Document Type", Rec."Document No.");
- GetLineWithPrice(LineWithPrice);
- LineWithPrice.SetLine(PriceType::Purchase, PurchaseHeader, Rec);
- PriceCalculationMgt.GetHandler(LineWithPrice, PriceCalculation);
- end;
-
- ///
- /// Gets the default or overridden line with price interface implementation.
- ///
- /// Return value: line with price implementation.
- procedure GetLineWithPrice(var LineWithPrice: Interface "Line With Price")
- var
- PurchaseLinePrice: Codeunit "Purchase Line - Price";
- begin
- LineWithPrice := PurchaseLinePrice;
- OnAfterGetLineWithPrice(LineWithPrice);
- end;
-
- ///
- /// Wrapper for price calculation method CountDiscount.
- /// Returns the count of price list lines containing discounts suitable for the purchase line.
- ///
- /// If true, it expands the filter criteria applied to the price list line.
- /// The number of price list lines with discounts.
- procedure CountDiscount(ShowAll: Boolean): Integer;
- var
- PriceCalculation: Interface "Price Calculation";
- begin
- GetPriceCalculationHandler(PurchHeader, PriceCalculation);
- exit(PriceCalculation.CountDiscount(ShowAll));
- end;
-
- ///
- /// Wrapper for price calculation method CountPrice.
- /// Returns the count of price list lines containing prices suitable for the purchase line.
- ///
- /// If true, it expands the filter criteria applied to the price list line.
- /// The number of price list lines with prices.
- procedure CountPrice(ShowAll: Boolean): Integer;
- var
- PriceCalculation: Interface "Price Calculation";
- begin
- GetPriceCalculationHandler(PurchHeader, PriceCalculation);
- exit(PriceCalculation.CountPrice(ShowAll));
- end;
-
- ///
- /// Wrapper for price calculation method IsDiscountExists.
- /// Returns true if there are any price list lines containing discounts that are applicable to the purchase line.
- ///
- /// If true, it expands the filter criteria applied to the price list line.
- /// Returns true if at least one price list line is found, otherwise false.
- procedure DiscountExists(ShowAll: Boolean): Boolean;
- var
- PriceCalculation: Interface "Price Calculation";
- begin
- GetPriceCalculationHandler(PurchHeader, PriceCalculation);
- exit(PriceCalculation.IsDiscountExists(ShowAll));
- end;
-
- ///
- /// Wrapper for price calculation method IsPriceExists.
- /// Returns true if there are any price list lines containing prices that are applicable to the purchase line.
- ///
- /// If true, it expands the filter criteria applied to the price list line.
- /// Returns true if at least one price list line is found, otherwise false.
- procedure PriceExists(ShowAll: Boolean): Boolean;
- var
- PriceCalculation: Interface "Price Calculation";
- begin
- GetPriceCalculationHandler(PurchHeader, PriceCalculation);
- exit(PriceCalculation.IsPriceExists(ShowAll));
- end;
-
- ///
- /// Wrapper for price calculation method PickDiscount.
- /// Opens a price list selection to choose discounts suitable for the purchase line.
- /// The discounts are assigned to the purchase line after selection.
- ///
- procedure PickDiscount()
- var
- PriceCalculation: Interface "Price Calculation";
- begin
- GetPriceCalculationHandler(PurchHeader, PriceCalculation);
- PriceCalculation.PickDiscount();
- GetLineWithCalculatedPrice(PriceCalculation);
- end;
-
- ///
- /// Wrapper for price calculation method PickPrice.
- /// Opens a price list selection to choose prices suitable for the purchase line.
- /// The prices are assigned to the purchase line after selection.
- ///
- procedure PickPrice()
- var
- PriceCalculation: Interface "Price Calculation";
- begin
- GetPriceCalculationHandler(PurchHeader, PriceCalculation);
- PriceCalculation.PickPrice();
- GetLineWithCalculatedPrice(PriceCalculation);
- end;
-
- ///
- /// Updates the purchase line's price and discount based on the item reference number.
- ///
- procedure UpdateReferencePriceAndDiscount();
- var
- PriceCalculation: Interface "Price Calculation";
- begin
- GetPriceCalculationHandler(PurchHeader, PriceCalculation);
- PriceCalculation.ApplyPrice(FieldNo("Item Reference No."));
- PriceCalculation.ApplyDiscount();
- GetLineWithCalculatedPrice(PriceCalculation);
- end;
-
- ///
- /// Updates the unit cost of the purchase line.
- ///
- procedure UpdateUnitCost()
- var
- Item: Record Item;
- DiscountAmountPerQty: Decimal;
- ShouldCalcStandardUnitCostLCY: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateUnitCost(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- GetPurchHeader();
- GetGLSetup();
- if Quantity = 0 then
- DiscountAmountPerQty := 0
- else
- DiscountAmountPerQty :=
- Round(("Line Discount Amount" + "Inv. Discount Amount") / Quantity,
- GLSetup."Unit-Amount Rounding Precision");
- OnUpdateUnitCostOnAfterCalcDiscountAmountPerQty(Rec, DiscountAmountPerQty);
-
- if "VAT Calculation Type" = "VAT Calculation Type"::"Full VAT" then
- "Unit Cost" := 0
- else
- if PurchHeader."Prices Including VAT" then
- "Unit Cost" :=
- ("Direct Unit Cost" - DiscountAmountPerQty) * (1 + "Indirect Cost %" / 100) / (1 + GetVATPct() / 100) +
- GetOverheadRateFCY() - "VAT Difference"
- else
- "Unit Cost" :=
- ("Direct Unit Cost" - DiscountAmountPerQty) * (1 + "Indirect Cost %" / 100) +
- GetOverheadRateFCY();
-
- OnUpdateUnitCostOnBeforeUpdateUnitCostLCY(Rec, xRec, PurchHeader, CurrFieldNo, Item, SKU, Currency, GLSetup);
-
- if PurchHeader."Currency Code" <> '' then begin
- PurchHeader.TestField("Currency Factor");
- "Unit Cost (LCY)" :=
- CurrExchRate.ExchangeAmtFCYToLCY(
- GetDate(), "Currency Code",
- "Unit Cost", PurchHeader."Currency Factor");
- end else
- "Unit Cost (LCY)" := "Unit Cost";
-
- ShouldCalcStandardUnitCostLCY := (Type = Type::Item) and (not IsProdOrder());
- OnUpdateUnitCostOnBeforeCalcStandardUnitCostLCY(Rec, ShouldCalcStandardUnitCostLCY);
- if ShouldCalcStandardUnitCostLCY then begin
- GetItem(Item);
- if Item."Costing Method" = Item."Costing Method"::Standard then begin
- if GetSKU() then
- "Unit Cost (LCY)" := SKU."Unit Cost" * "Qty. per Unit of Measure"
- else
- "Unit Cost (LCY)" := Item."Unit Cost" * "Qty. per Unit of Measure";
- OnUpdateUnitCostOnAfterCalcStandardUnitCostLCY(Rec);
- end;
- end;
-
- "Unit Cost (LCY)" := Round("Unit Cost (LCY)", GLSetup."Unit-Amount Rounding Precision");
- if PurchHeader."Currency Code" <> '' then
- Currency.TestField("Unit-Amount Rounding Precision");
- "Unit Cost" := Round("Unit Cost", Currency."Unit-Amount Rounding Precision");
-
- OnAfterUpdateUnitCost(Rec, xRec, PurchHeader, Item, SKU, Currency, GLSetup);
-
- UpdateSalesCost();
-
- if JobTaskIsSet() and not UpdateFromVAT and not "Prepayment Line" then begin
- CreateTempJobJnlLine(false);
- TempJobJnlLine.Validate("Unit Cost (LCY)", "Unit Cost (LCY)");
- UpdateJobPrices();
- end;
- end;
-
- ///
- /// Updates line, vat, prepayment and deferral amounts of the purchase line.
- /// Initializes outstanding amounts.
- ///
- ///
- /// If purchase line type is charge (item), it updates item charge assignment.
- ///
- procedure UpdateAmounts()
- var
- VATBaseAmount: Decimal;
- NonDeductAmount: Decimal;
- LineAmountChanged: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateAmounts(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- if Type = Type::" " then
- exit;
-
- GetPurchHeader();
-
- VATBaseAmount := "VAT Base Amount";
- NonDeductAmount := NonDeductibleVAT.GetNonDeductibleVATAmount(Rec);
- "Recalculate Invoice Disc." := "Recalculate Invoice Disc." or "Allow Invoice Disc.";
-
- UpdateLineAmount(LineAmountChanged);
-
- if not "Prepayment Line" then
- UpdatePrepmtAmounts();
-
- OnAfterUpdateAmounts(Rec, xRec, CurrFieldNo);
-
- UpdateVATAmounts();
- if VATBaseAmount <> "VAT Base Amount" then
- LineAmountChanged := true;
- LineAmountChanged := LineAmountChanged or (NonDeductAmount <> NonDeductibleVAT.GetNonDeductibleVATAmount(Rec));
-
- if LineAmountChanged then begin
- UpdateDeferralAmounts();
- LineAmountChanged := false;
- end;
-
- InitOutstandingAmount();
-
- if Type = Type::"Charge (Item)" then
- UpdateItemChargeAssgnt();
-
- CalcPrepaymentToDeduct();
-
- OnAfterUpdateAmountsDone(Rec, xRec, CurrFieldNo);
- end;
-
- local procedure UpdateJobFields()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateJobFields(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if xRec."Job No." <> '' then
- Validate("Job No.", xRec."Job No.");
- "Job Line Type" := xRec."Job Line Type";
- if xRec."Job Task No." <> '' then begin
- Validate("Job Task No.", xRec."Job Task No.");
- if "No." = xRec."No." then
- Validate("Job Planning Line No.", xRec."Job Planning Line No.");
- end;
- end;
-
- local procedure UpdateSpecialSalesOrderLineFromOnDelete(SalesOrderLine: Record "Sales Line")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateSpecialSalesOrderLineFromOnDelete(Rec, SalesOrderLine, IsHandled);
- if IsHandled then
- exit;
-
- if ("Special Order Sales Line No." <> 0) and ("Quantity Invoiced" = 0) then begin
- LockTable();
- SalesOrderLine.LockTable();
- if SalesOrderLine.Get(
- SalesOrderLine."Document Type"::Order, "Special Order Sales No.", "Special Order Sales Line No.")
- then begin
- SalesOrderLine."Special Order Purchase No." := '';
- SalesOrderLine."Special Order Purch. Line No." := 0;
- SalesOrderLine.Modify();
- end;
- end;
- end;
-
- ///
- /// Updates amounts, vat amounts and vat procentage of the purchase line.
- ///
- procedure UpdateVATAmounts()
- var
- PurchLine2: Record "Purchase Line";
- TotalLineAmount: Decimal;
- TotalInvDiscAmount: Decimal;
- TotalAmount: Decimal;
- TotalAmountInclVAT: Decimal;
- TotalVATDifference: Decimal;
- TotalQuantityBase: Decimal;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateVATAmounts(Rec, IsHandled);
- if IsHandled then
- exit;
-
- GetPurchHeader();
- PurchLine2.SetRange("Document Type", "Document Type");
- PurchLine2.SetRange("Document No.", "Document No.");
- PurchLine2.SetFilter("Line No.", '<>%1', "Line No.");
- PurchLine2.SetRange("VAT Identifier", "VAT Identifier");
- PurchLine2.SetRange("Tax Group Code", "Tax Group Code");
- PurchLine2.SetRange("Tax Area Code", "Tax Area Code");
- OnUpdateVATAmountsOnAfterSetFilters(Rec, PurchLine2);
-
- if "Line Amount" = "Inv. Discount Amount" then begin
- Amount := 0;
- "VAT Base Amount" := 0;
- "Amount Including VAT" := 0;
- NonDeductibleVAT.ClearNonDeductibleVAT(Rec);
- OnUpdateVATAmountsOnBeforePurchLineModify(Rec, PurchLine2);
- if (Quantity = 0) and (xRec.Quantity <> 0) and (xRec.Amount <> 0) then begin
- if "Line No." <> 0 then
- Modify();
- PurchLine2.SetFilter(Amount, '<>0');
- if PurchLine2.Find('<>') then begin
- OnUpdateVATAmountsOnBeforeValidateLineDiscountPercent(Rec, PurchLine2);
- PurchLine2.ValidateLineDiscountPercent(false);
- PurchLine2.Modify();
- end;
- end;
- end else begin
- TotalLineAmount := 0;
- TotalInvDiscAmount := 0;
- TotalAmount := 0;
- TotalAmountInclVAT := 0;
- TotalQuantityBase := 0;
- if ("VAT Calculation Type" = "VAT Calculation Type"::"Sales Tax") or
- (("VAT Calculation Type" in
- ["VAT Calculation Type"::"Normal VAT",
- "VAT Calculation Type"::"Reverse Charge VAT",
- "VAT Calculation Type"::"No Taxable VAT"]) and ("VAT %" <> 0))
- then begin
- PurchLine2.SetFilter("VAT %", '<>0');
- if not PurchLine2.IsEmpty() then begin
- PurchLine2.CalcSums("Line Amount", "Inv. Discount Amount", Amount, "Amount Including VAT", "Quantity (Base)", "VAT Difference");
- TotalLineAmount := PurchLine2."Line Amount";
- TotalInvDiscAmount := PurchLine2."Inv. Discount Amount";
- TotalAmount := PurchLine2.Amount;
- TotalAmountInclVAT := PurchLine2."Amount Including VAT";
- TotalVATDifference := PurchLine2."VAT Difference";
- TotalQuantityBase := PurchLine2."Quantity (Base)";
- OnAfterUpdateTotalAmounts(Rec, PurchLine2, TotalAmount, TotalAmountInclVAT, TotalLineAmount, TotalInvDiscAmount);
- end;
- end;
-
- OnUpdateVATAmountsOnBeforeCalcAmounts(
- Rec, PurchLine2, TotalAmount, TotalAmountInclVAT, TotalLineAmount, TotalInvDiscAmount, TotalQuantityBase, TotalVATDifference, IsHandled);
- if IsHandled then
- exit;
-
- if PurchHeader."Prices Including VAT" then
- case "VAT Calculation Type" of
- "VAT Calculation Type"::"Normal VAT",
- "VAT Calculation Type"::"Reverse Charge VAT",
- "VAT Calculation Type"::"No Taxable VAT":
- begin
- Amount :=
- Round(
- (TotalLineAmount - TotalInvDiscAmount + CalcLineAmount()) / (1 + GetVATPct() / 100),
- Currency."Amount Rounding Precision") -
- TotalAmount;
- "VAT Base Amount" :=
- Round(
- Amount * (1 - GetVatBaseDiscountPct(PurchHeader) / 100),
- Currency."Amount Rounding Precision");
- "Amount Including VAT" :=
- TotalLineAmount + "Line Amount" -
- Round(
- (TotalAmount + Amount) * (GetVatBaseDiscountPct(PurchHeader) / 100) * GetVATPct() / 100,
- Currency."Amount Rounding Precision", Currency.VATRoundingDirection()) -
- TotalAmountInclVAT - TotalInvDiscAmount - "Inv. Discount Amount";
- NonDeductibleVAT.Update(Rec, Currency);
- OnUpdateVATAmountsOnAfterCalcNormalVATAmountsForPricesIncludingVAT(Rec, PurchHeader, Currency, TotalAmount, TotalAmountInclVAT, PurchLine2);
- end;
- "VAT Calculation Type"::"Full VAT":
- begin
- Amount := 0;
- "VAT Base Amount" := 0;
- "Amount Including VAT" := ROUND(CalcLineAmount(), Currency."Amount Rounding Precision");
- NonDeductibleVAT.Update(Rec, Currency);
- end;
- "VAT Calculation Type"::"Sales Tax":
- begin
- PurchHeader.TestField("VAT Base Discount %", 0);
- "Amount Including VAT" :=
- Round(CalcLineAmount(), Currency."Amount Rounding Precision");
- if "Use Tax" then
- Amount := "Amount Including VAT"
- else
- Amount :=
- Round(
- SalesTaxCalculate.ReverseCalculateTax(
- "Tax Area Code", "Tax Group Code", "Tax Liable", PurchHeader."Posting Date",
- TotalAmountInclVAT + "Amount Including VAT", TotalQuantityBase + "Quantity (Base)",
- PurchHeader."Currency Factor"),
- Currency."Amount Rounding Precision") -
- TotalAmount;
- OnAfterSalesTaxCalculateReverse(Rec, PurchHeader, Currency);
- "VAT Base Amount" := Amount;
- if "VAT Base Amount" <> 0 then
- "VAT %" :=
- Round(100 * ("Amount Including VAT" - "VAT Base Amount") / "VAT Base Amount", 0.00001)
- else
- ClearVATPct();
- end;
- end
- else
- case "VAT Calculation Type" of
- "VAT Calculation Type"::"Normal VAT",
- "VAT Calculation Type"::"Reverse Charge VAT",
- "VAT Calculation Type"::"No Taxable VAT":
- begin
- Amount := Round(CalcLineAmount(), Currency."Amount Rounding Precision");
- "VAT Base Amount" :=
- Round(Amount * (1 - GetVatBaseDiscountPct(PurchHeader) / 100), Currency."Amount Rounding Precision");
- "Amount Including VAT" :=
- TotalAmount + Amount +
- Round(
- (TotalAmount + Amount) * (1 - GetVatBaseDiscountPct(PurchHeader) / 100) * GetVATPct() / 100,
- Currency."Amount Rounding Precision", Currency.VATRoundingDirection()) -
- TotalAmountInclVAT + TotalVATDifference;
- NonDeductibleVAT.Update(Rec, Currency);
- OnUpdateVATAmountsOnAfterCalcNormalVATAmountsForPricesExcludingVAT(Rec, PurchHeader, Currency, TotalAmount, TotalAmountInclVAT, PurchLine2);
- end;
- "VAT Calculation Type"::"Full VAT":
- begin
- Amount := 0;
- "VAT Base Amount" := 0;
- "Amount Including VAT" := CalcLineAmount();
- NonDeductibleVAT.Update(Rec, Currency);
- end;
- "VAT Calculation Type"::"Sales Tax":
- begin
- Amount := Round(CalcLineAmount(), Currency."Amount Rounding Precision");
- "VAT Base Amount" := Amount;
- if "Use Tax" then
- "Amount Including VAT" := Amount
- else
- "Amount Including VAT" :=
- TotalAmount + Amount +
- Round(
- SalesTaxCalculate.CalculateTax(
- "Tax Area Code", "Tax Group Code", "Tax Liable", PurchHeader."Posting Date",
- TotalAmount + Amount, TotalQuantityBase + "Quantity (Base)",
- PurchHeader."Currency Factor"),
- Currency."Amount Rounding Precision") -
- TotalAmountInclVAT;
- OnAfterSalesTaxCalculate(Rec, PurchHeader, Currency);
- if "VAT Base Amount" <> 0 then
- "VAT %" :=
- Round(100 * ("Amount Including VAT" - "VAT Base Amount") / "VAT Base Amount", 0.00001)
- else
- ClearVATPct();
- end;
- end;
- end;
-
- OnAfterUpdateVATAmounts(Rec, TotalLineAmount, TotalInvDiscAmount, TotalAmount, TotalAmountInclVAT, TotalVATDifference, TotalQuantityBase);
- end;
-
- ///
- /// Checks prepayment setups and assigns prepayment fields to the purchase line.
- ///
- procedure UpdatePrepmtSetupFields()
- var
- GenPostingSetup: Record "General Posting Setup";
- GLAcc: Record "G/L Account";
- VATPostingSetupRetrieved: Boolean;
- SkipClear: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdatePrepmtSetupFields(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if ("Prepayment %" <> 0) and HasTypeToFillMandatoryFields() then begin
- TestField("Document Type", "Document Type"::Order);
- TestField("No.");
- NonDeductibleVAT.CheckPrepmtWithNonDeductubleVATInPurchaseLine(Rec);
- GenPostingSetup.Get("Gen. Bus. Posting Group", "Gen. Prod. Posting Group");
- if GenPostingSetup."Purch. Prepayments Account" <> '' then begin
- GLAcc.Get(GenPostingSetup."Purch. Prepayments Account");
- VATPostingSetupRetrieved := false;
- OnUpdatePrepmtSetupFieldsOnBeforeGetVATPostingSetup(Rec, GLAcc, VATPostingSetup, VATPostingSetupRetrieved);
- if not VATPostingSetupRetrieved then
- VATPostingSetup.Get("VAT Bus. Posting Group", GLAcc."VAT Prod. Posting Group");
- VATPostingSetup.TestField("VAT Calculation Type", "VAT Calculation Type");
- NonDeductibleVAT.CheckPrepmtVATPostingSetup(VATPostingSetup);
- end else begin
- SkipClear := false;
- OnUpdatePrepmtSetupFieldsOnBeforeClearVATPostingSetup(Rec, VATPostingSetup, SkipClear);
- if not SkipClear then
- Clear(VATPostingSetup);
- end;
- OnAfterGetPostingSetup(Rec, VATPostingSetup);
- if ("Prepayment VAT %" <> 0) and ("Prepayment VAT %" <> VATPostingSetup."VAT %") and ("Prepmt. Amt. Inv." <> 0) then
- Error(CannotChangePrepmtAmtDiffVAtPctErr);
- CopyPrepaymentFromVATPostingSetup(VATPostingSetup);
- "Prepayment Tax Group Code" := GLAcc."Tax Group Code";
- end;
- end;
-
- local procedure UpdateSalesCostFromUnitCostLCY()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateSalesCostFromUnitCostLCY(Rec, IsHandled);
- if IsHandled then
- exit;
-
- UpdateSalesCost();
- end;
-
- ///
- /// Updates unit costs of the purchase line.
- ///
- procedure UpdateSalesCost()
- var
- SalesOrderLine: Record "Sales Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnUpdateSalesCostOnBeforeGetSalesOrderLine(Rec, IsHandled);
- if IsHandled then
- exit;
-
- case true of
- "Sales Order Line No." <> 0: // Drop Shipment
- SalesOrderLine.Get(SalesOrderLine."Document Type"::Order, "Sales Order No.", "Sales Order Line No.");
- "Special Order Sales Line No." <> 0: // Special Order
- if not
- SalesOrderLine.Get(SalesOrderLine."Document Type"::Order, "Special Order Sales No.", "Special Order Sales Line No.")
- then
- exit;
- else
- exit;
- end;
-
- IsHandled := false;
- OnBeforeUpdateSalesCost(Rec, SalesOrderLine, IsHandled);
- if IsHandled then
- exit;
-
- SalesOrderLine."Unit Cost (LCY)" := "Unit Cost (LCY)" * SalesOrderLine."Qty. per Unit of Measure" / "Qty. per Unit of Measure";
- SalesOrderLine."Unit Cost" := "Unit Cost" * SalesOrderLine."Qty. per Unit of Measure" / "Qty. per Unit of Measure";
- SalesOrderLine.Validate("Unit Cost (LCY)");
- SalesOrderLine.Modify();
-
- OnAfterUpdateSalesCost(Rec, SalesOrderLine);
- end;
-
- procedure GetFAPostingGroup()
- var
- LocalGLAcc: Record "G/L Account";
- FAPostingGr: Record "FA Posting Group";
- FADeprBook: Record "FA Depreciation Book";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetFAPostingGroup(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if (Type <> Type::"Fixed Asset") or ("No." = '') then
- exit;
- if "Depreciation Book Code" = '' then
- if not FindDefaultFADeprBook() then
- exit;
-
- if "FA Posting Type" = "FA Posting Type"::" " then
- "FA Posting Type" := "FA Posting Type"::"Acquisition Cost";
- FADeprBook.Get("No.", "Depreciation Book Code");
- FADeprBook.TestField("FA Posting Group");
- FAPostingGr.GetPostingGroup(FADeprBook."FA Posting Group", FADeprBook."Depreciation Book Code");
- IsHandled := false;
- OnGetFAPostingGroupOnBeforeLocalGLAccGet(Rec, FAPostingGr, LocalGLAcc, IsHandled);
- if not IsHandled then
- case "FA Posting Type" of
- "FA Posting Type"::"Acquisition Cost":
- LocalGLAcc.Get(FAPostingGr.GetAcquisitionCostAccount());
- "FA Posting Type"::Appreciation:
- LocalGLAcc.Get(FAPostingGr.GetAppreciationAccount());
- "FA Posting Type"::Maintenance:
- LocalGLAcc.Get(FAPostingGr.GetMaintenanceExpenseAccount());
- end;
-
- IsHandled := false;
- OnGetFAPostingGroupOnBeforeCheckGLAcc(Rec, LocalGLAcc, FADeprBook, IsHandled);
- if not IsHandled then begin
- LocalGLAcc.CheckGLAcc();
- if not ApplicationAreaMgmt.IsSalesTaxEnabled() then
- LocalGLAcc.TestField("Gen. Prod. Posting Group");
- "Posting Group" := FADeprBook."FA Posting Group";
- "Gen. Prod. Posting Group" := LocalGLAcc."Gen. Prod. Posting Group";
- "Tax Group Code" := LocalGLAcc."Tax Group Code";
- end;
- ValidateVATProdPostingGroupFromGLAcc(LocalGLAcc);
-
- OnAfterGetFAPostingGroup(Rec, LocalGLAcc);
- end;
-
- local procedure ValidateVATProdPostingGroupFromGLAcc(GLAccount: Record "G/L Account")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateVATProdPostingGroupFromGLAcc(Rec, IsHandled);
- if IsHandled then
- exit;
-
- Validate("VAT Prod. Posting Group", GLAccount."VAT Prod. Posting Group");
- end;
-
- local procedure FindDefaultFADeprBook() Result: Boolean
- var
- FASetup: Record "FA Setup";
- FADeprBook: Record "FA Depreciation Book";
- DefaultFADeprBook: Record "FA Depreciation Book";
- SetFADeprBook: Record "FA Depreciation Book";
- begin
- FASetup.Get();
-
- DefaultFADeprBook.SetRange("FA No.", "No.");
- DefaultFADeprBook.SetRange("Default FA Depreciation Book", true);
-
- SetFADeprBook.SetRange("FA No.", "No.");
-
- case true of
- SetFADeprBook.Count = 1:
- begin
- SetFADeprBook.FindFirst();
- "Depreciation Book Code" := SetFADeprBook."Depreciation Book Code";
- end;
- DefaultFADeprBook.FindFirst():
- "Depreciation Book Code" := DefaultFADeprBook."Depreciation Book Code";
- FADeprBook.Get("No.", FASetup."Default Depr. Book"):
- "Depreciation Book Code" := FASetup."Default Depr. Book"
- else
- "Depreciation Book Code" := '';
- end;
- Result := "Depreciation Book Code" <> '';
-
- OnAfterFindDefaultFADeprBook(Rec, Result);
- end;
-
- ///
- /// Updates unit cost, unit price and direct unit cost for the purchase line.
- ///
- procedure UpdateUOMQtyPerStockQty()
- var
- Item: Record Item;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateUOMQtyPerStockQty(Rec, xRec, Item, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- GetItem(Item);
- "Unit Cost (LCY)" := Item."Unit Cost" * "Qty. per Unit of Measure";
- "Unit Price (LCY)" := Item."Unit Price" * "Qty. per Unit of Measure";
- GetPurchHeader();
- if PurchHeader."Currency Code" <> '' then
- "Unit Cost" :=
- CurrExchRate.ExchangeAmtLCYToFCY(
- GetDate(), PurchHeader."Currency Code",
- "Unit Cost (LCY)", PurchHeader."Currency Factor")
- else
- "Unit Cost" := "Unit Cost (LCY)";
- if "Unit of Measure Code" <> xRec."Unit of Measure Code" then
- PlanPriceCalcByField(FieldNo("Unit of Measure Code"));
- UpdateDirectUnitCostByField(FieldNo("Unit of Measure Code"));
- end;
-
- ///
- /// Opens a selection of items page. After that, selected items are added to purchase lines.
- ///
- ///
- /// If document type is not return order or credit memo, selection shows only items that have purchasing blocked field set to false.
- ///
- procedure SelectMultipleItems()
- var
- ItemListPage: Page "Item List";
- SelectionFilter: Text;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSelectMultipleItems(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if IsCreditDocType() then
- SelectionFilter := ItemListPage.SelectActiveItems()
- else
- SelectionFilter := ItemListPage.SelectActiveItemsForPurchase();
- if SelectionFilter <> '' then
- AddItems(SelectionFilter);
-
- OnAfterSelectMultipleItems(Rec);
- end;
-
- ///
- /// Adds items to the purchase lines based on a selection filter.
- ///
- /// Filter text of the selected items.
- procedure AddItems(SelectionFilter: Text)
- var
- Item: Record Item;
- PurchLine: Record "Purchase Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeAddItems(Rec, SelectionFilter, IsHandled);
- if IsHandled then
- exit;
-
- InitNewLine(PurchLine);
- Item.SetFilter("No.", SelectionFilter);
- if Item.FindSet() then
- repeat
- AddItem(PurchLine, Item."No.");
- until Item.Next() = 0;
- end;
-
- ///
- /// Inserts an item to the purchase line.
- ///
- ///
- /// If purchase line has automatic ext. texts enabled, it inserts extended texts to purchase line.
- ///
- /// Return value: Inserted purchase line.
- /// Item number to be inserted.
- procedure AddItem(var PurchLine: Record "Purchase Line"; ItemNo: Code[20])
- var
- LastPurchLine: Record "Purchase Line";
- begin
- PurchLine.Init();
- PurchLine."Line No." += 10000;
- PurchLine.Validate(Type, Type::Item);
- PurchLine.Validate("No.", ItemNo);
- OnAddItemOnBeforeInsert(PurchLine);
- PurchLine.Insert(true);
-
- TransferExtendedTexts(PurchLine, LastPurchLine);
-
- OnAfterAddItem(PurchLine, LastPurchLine);
- end;
-
- ///
- /// Transfers extended texts for the purchase line.
- ///
- ///
- /// If purchase line has automatic ext. texts enabled, it inserts extended texts to purchase line.
- /// This procedure can be called independently to apply extended text logic without initializing a new line.
- ///
- /// The purchase line to process.
- /// Return value: The last purchase line after extended text insertion.
- procedure TransferExtendedTexts(var PurchaseLine: Record "Purchase Line"; var LastPurchaseLine: Record "Purchase Line")
- var
- TransferExtendedText: Codeunit "Transfer Extended Text";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeTransferExtendedTexts(PurchaseLine, LastPurchaseLine, IsHandled);
- if IsHandled then
- exit;
-
- if TransferExtendedText.PurchCheckIfAnyExtText(PurchaseLine, false) then begin
- TransferExtendedText.InsertPurchExtTextRetLast(PurchaseLine, LastPurchaseLine);
- PurchaseLine."Line No." := LastPurchaseLine."Line No."
- end;
- end;
-
- ///
- /// Initializes a new purchase line based on the current purchase line.
- ///
- /// Return value: Initialized purchase line.
- procedure InitNewLine(var NewPurchLine: Record "Purchase Line")
- var
- PurchLine: Record "Purchase Line";
- begin
- NewPurchLine.Copy(Rec);
- PurchLine.SetRange("Document Type", NewPurchLine."Document Type");
- PurchLine.SetRange("Document No.", NewPurchLine."Document No.");
- if PurchLine.FindLast() then
- NewPurchLine."Line No." := PurchLine."Line No."
- else
- NewPurchLine."Line No." := 0;
- end;
-
- procedure ShowOrderTracking()
- var
- OrderTracking: Page "Order Tracking";
- begin
- OrderTracking.SetVariantRec(Rec, Rec."No.", Rec."Outstanding Qty. (Base)", Rec."Expected Receipt Date", Rec."Expected Receipt Date");
- OrderTracking.RunModal();
- end;
-
-
- ///
- /// Opens the reservation page for an item in a purchase line.
- ///
- procedure ShowReservation()
- var
- Reservation: Page Reservation;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeShowReservation(Rec, IsHandled);
- if IsHandled then
- exit;
-
- TestField(Type, Type::Item);
- TestProdOrderNo();
- TestField("No.");
- Clear(Reservation);
- Reservation.SetReservSource(Rec);
- Reservation.RunModal();
- end;
-
- ///
- /// Opens a reservation entries page for the current purchase line.
- ///
- /// If true, execution is halted until the page is closed.
- procedure ShowReservationEntries(Modal: Boolean)
- var
- ReservEntry: Record "Reservation Entry";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeShowReservationEntries(Rec, IsHandled);
- if IsHandled then
- exit;
-
- TestField(Type, Type::Item);
- TestField("No.");
- ReservEntry.InitSortingAndFilters(true);
- SetReservationFilters(ReservEntry);
- if Modal then
- PAGE.RunModal(PAGE::"Reservation Entries", ReservEntry)
- else
- PAGE.Run(PAGE::"Reservation Entries", ReservEntry);
- end;
-
- local procedure ShowBinCodeCannotBeChangedError()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeShowBinCodeCannotBeChangedError(Rec, IsHandled);
- if IsHandled then
- exit;
-
- Error(Text001, FieldCaption("Bin Code"), "Sales Order No.");
- end;
-
- local procedure ShowEarlyOrderDateMessage()
- var
- ShowMessage: Boolean;
- begin
- ShowMessage := not (HideValidationDialog or HasBeenShown) and GuiAllowed;
- OnShowEarlyOrderDateMessageOnAfterCalcShowMessage(Rec, ShowMessage);
- if ShowMessage then begin
- Message(Text018, FieldCaption("Order Date"), "Order Date", WorkDate());
- HasBeenShown := true;
- end;
- end;
-
- ///
- /// Returns the posting date from the related purchase header if it's available, otherwise it returns the current work date.
- ///
- /// Document's posting date or work date.
- procedure GetDate(): Date
- var
- ResultDate: Date;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- ResultDate := 0D;
- OnBeforeGetDate(Rec, ResultDate, IsHandled);
- if IsHandled then
- exit(ResultDate);
-
- GetPurchHeader();
- if PurchHeader."Posting Date" <> 0D then
- exit(PurchHeader."Posting Date");
- exit(WorkDate());
- end;
-
- ///
- /// Returns a signed decimal value based on the document type of the purchase line.
- ///
- /// The value to sign.
- /// Signed value.
- procedure Signed(Value: Decimal): Decimal
- var
- Result: Decimal;
- begin
- case "Document Type" of
- "Document Type"::Quote,
- "Document Type"::Order,
- "Document Type"::Invoice,
- "Document Type"::"Blanket Order":
- exit(Value);
- "Document Type"::"Return Order",
- "Document Type"::"Credit Memo":
- exit(-Value);
- else begin
- Result := 0;
- OnGetSignedValue(Rec, Value, Result);
- exit(Result);
- end;
-
- end;
- end;
-
- ///
- /// Opens a page to select blanket order line for the current purchase line.
- /// Selected blanket order line information is assigned to the purchase line.
- ///
- procedure BlanketOrderLookup()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeBlanketOrderLookup(Rec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- PurchLine2.Reset();
- PurchLine2.SetCurrentKey("Document Type", Type, "No.");
- PurchLine2.SetRange("Document Type", "Document Type"::"Blanket Order");
- PurchLine2.SetRange(Type, Type);
- PurchLine2.SetRange("No.", "No.");
- PurchLine2.SetRange("Pay-to Vendor No.", "Pay-to Vendor No.");
- PurchLine2.SetRange("Buy-from Vendor No.", "Buy-from Vendor No.");
- if PAGE.RunModal(PAGE::"Purchase Lines", PurchLine2) = ACTION::LookupOK then begin
- PurchLine2.TestField("Document Type", "Document Type"::"Blanket Order");
- "Blanket Order No." := PurchLine2."Document No.";
- Validate("Blanket Order Line No.", PurchLine2."Line No.");
- end;
-
- OnAfterBlanketOrderLookup(Rec);
- end;
-
- ///
- /// Sets TrackingBlocked flag to the given value. Also sets global Blocked flag of purchase line reserve codeunit.
- ///
- ///
- /// This flag is used to disallow changes to existing reservation entries for the purchase line.
- ///
- /// Flag value to set.
- procedure BlockDynamicTracking(SetBlock: Boolean)
- begin
- TrackingBlocked := SetBlock;
- PurchLineReserve.Block(SetBlock);
- end;
-
- ///
- /// Opens a page for editing dimensions for the purchase line.
- /// Upon closing the page, it updates the dimensions on the purcahse line.
- ///
- /// True if the dimensions were changed, otherwise false.
- procedure ShowDimensions() IsChanged: Boolean
- var
- OldDimSetID: Integer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeShowDimensions(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- OldDimSetID := "Dimension Set ID";
- "Dimension Set ID" :=
- DimMgt.EditDimensionSet("Dimension Set ID", StrSubstNo('%1 %2 %3', "Document Type", "Document No.", "Line No."));
- OnShowDimensionsOnAfterEditDimensionSet(Rec, OldDimSetID);
- VerifyItemLineDim();
- DimMgt.UpdateGlobalDimFromDimSetID("Dimension Set ID", "Shortcut Dimension 1 Code", "Shortcut Dimension 2 Code");
- IsChanged := OldDimSetID <> "Dimension Set ID";
-
- OnAfterShowDimensions(Rec, xRec);
- end;
-
- ///
- /// Opens a page for editing item tracking lines for the purchase line.
- ///
- procedure OpenItemTrackingLines()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeOpenItemTrackingLines(Rec, IsHandled);
- if IsHandled then
- exit;
-
- TestField(Type, Type::Item);
- TestField("No.");
- OnOpenItemTrackingLinesOnAfterCheck(Rec);
-
- TestField("Quantity (Base)");
-
- PurchLineReserve.CallItemTracking(Rec);
- end;
-
- ///
- /// Creates dimensions for the purchase line based on the provided default dimension sources.
- ///
- /// The list of default dimension sources.
- procedure CreateDim(DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])
- var
- SourceCodeSetup: Record "Source Code Setup";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateDim(Rec, IsHandled, CurrFieldNo, DefaultDimSource);
- if IsHandled then
- exit;
-
- SourceCodeSetup.Get();
-
- "Shortcut Dimension 1 Code" := '';
- "Shortcut Dimension 2 Code" := '';
- GetPurchHeader();
- "Dimension Set ID" :=
- DimMgt.GetRecDefaultDimID(
- Rec, CurrFieldNo, DefaultDimSource, SourceCodeSetup.Purchases,
- "Shortcut Dimension 1 Code", "Shortcut Dimension 2 Code", PurchHeader."Dimension Set ID", Database::Vendor);
- OnCreateDimOnBeforeUpdateGlobalDimFromDimSetID(Rec);
- DimMgt.UpdateGlobalDimFromDimSetID("Dimension Set ID", "Shortcut Dimension 1 Code", "Shortcut Dimension 2 Code");
-
- OnAfterCreateDim(Rec, CurrFieldNo, xRec);
- end;
-
- local procedure ValidateItemDescription()
- var
- Item: Record Item;
- ReturnValue: Text[50];
- DescriptionIsNo: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateItemDescription(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if IsReceivedFromOcr() then
- exit;
-
- if StrLen(Description) <= MaxStrLen(Item."No.") then
- DescriptionIsNo := Item.Get(Description)
- else
- DescriptionIsNo := false;
-
- if not DescriptionIsNo then begin
- Item.SetRange(Blocked, false);
- if not IsCreditDocType() then
- Item.SetRange("Purchasing Blocked", false);
-
- // looking for an item with exact description
- Item.SetRange(Description, Description);
- if Item.FindFirst() then begin
- CurrFieldNo := FieldNo("No.");
- Validate("No.", Item."No.");
- exit;
- end;
-
- // looking for an item with similar description
- Item.SetFilter(Description, '''@' + ConvertStr(Description, '''', '?') + '''');
- if Item.FindFirst() then begin
- CurrFieldNo := FieldNo("No.");
- Validate("No.", Item."No.");
- exit;
- end;
- end;
-
- if Item.TryGetItemNoOpenCard(ReturnValue, Description, false, false, false) then
- case ReturnValue of
- '', "No.":
- Description := xRec.Description;
- else begin
- CurrFieldNo := FieldNo("No.");
- Validate("No.", CopyStr(ReturnValue, 1, MaxStrLen(Item."No.")));
- end;
- end;
- end;
-
- ///
- /// Verifies whether the provided shortcut dimension code and value are valid.
- ///
- ///
- /// If the dimensions of a received or shipped item have changed in a purchase line, the confirmation is shown.
- ///
- /// Number of the shortcut dimension.
- /// Value of the shortcut dimension.
- procedure ValidateShortcutDimCode(FieldNumber: Integer; var ShortcutDimCode: Code[20])
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShortcutDimCode(Rec, xRec, FieldNumber, ShortcutDimCode, IsHandled);
- if IsHandled then
- exit;
-
- DimMgt.ValidateShortcutDimValues(FieldNumber, ShortcutDimCode, "Dimension Set ID");
- VerifyItemLineDim();
-
- OnAfterValidateShortcutDimCode(Rec, xRec, FieldNumber, ShortcutDimCode);
- end;
-
- local procedure ValidateLineDiscountPctForNotItemType()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateLineDiscountPctForNotItemType(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if Type <> Type::Item then
- Validate("Line Discount %");
- end;
-
- local procedure ValidateQuantityInvIsBalanced()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateQuantityInvIsBalanced(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- UOMMgt.ValidateQtyIsBalanced(Quantity, "Quantity (Base)", "Qty. to Invoice", "Qty. to Invoice (Base)", "Quantity Invoiced", "Qty. Invoiced (Base)");
- end;
-
- local procedure ValidateQuantityReceiveIsBalanced()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateQuantityReceiveIsBalanced(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- UOMMgt.ValidateQtyIsBalanced(Quantity, "Quantity (Base)", "Qty. to Receive", "Qty. to Receive (Base)", "Quantity Received", "Qty. Received (Base)");
- end;
-
- local procedure ValidateQuantityReturnIsBalanced()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateQuantityReturnIsBalanced(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- UOMMgt.ValidateQtyIsBalanced(Quantity, "Quantity (Base)", "Return Qty. to Ship", "Return Qty. to Ship (Base)", "Return Qty. Shipped", "Return Qty. Shipped (Base)");
- end;
-
- local procedure AssignFieldsForQtyPerUOM(Item: Record Item; FieldNo: Integer)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeAssignFieldsForQtyPerUOM(Rec, Item, FieldNo, IsHandled, xRec);
- if IsHandled then
- exit;
-
- CalcQtyPerUnitOfMeasure(Item);
- "Gross Weight" := Item."Gross Weight" * "Qty. per Unit of Measure";
- "Net Weight" := Item."Net Weight" * "Qty. per Unit of Measure";
- "Unit Volume" := Item."Unit Volume" * "Qty. per Unit of Measure";
- "Units per Parcel" := Round(Item."Units per Parcel" / "Qty. per Unit of Measure", UOMMgt.QtyRndPrecision());
- "Qty. Rounding Precision" := UOMMgt.GetQtyRoundingPrecision(Item, "Unit of Measure Code");
- "Qty. Rounding Precision (Base)" := UOMMgt.GetQtyRoundingPrecision(Item, Item."Base Unit of Measure");
- end;
-
- local procedure ValidatePlannedReceiptDateWithCustomCalendarChange(CustomCalendarChange: array[2] of Record "Customized Calendar Change")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePlannedReceiptDateWithCustomCalendarChange(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- Validate(
- "Planned Receipt Date",
- CalendarMgmt.CalcDateBOC2(ReversedInternalLeadTimeDays("Expected Receipt Date"), "Expected Receipt Date", CustomCalendarChange, false))
- end;
-
- ///
- /// Opens a page for selecting a dimension code, then assigns the selected value to the presented number of the shortcut dimension.
- ///
- /// Number of the shortcut dimension.
- /// Return value: Value of the selected shortcut dimension.
- procedure LookupShortcutDimCode(FieldNumber: Integer; var ShortcutDimCode: Code[20])
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupShortcutDimCode(Rec, xRec, FieldNumber, ShortcutDimCode, IsHandled);
- if IsHandled then
- exit;
-
- DimMgt.LookupDimValueCode(FieldNumber, ShortcutDimCode);
- Rec.ValidateShortcutDimCode(FieldNumber, ShortcutDimCode);
- end;
-
- ///
- /// Gets an array of shortcut dimension values from the dimensions of the purchase line.
- ///
- /// Return value: The array of shortcut dimension values.
- procedure ShowShortcutDimCode(var ShortcutDimCode: array[8] of Code[20])
- begin
- DimMgt.GetShortcutDimensions(Rec."Dimension Set ID", ShortcutDimCode);
- end;
-
- local procedure GetSKU() Result: Boolean
- begin
- TestField("No.");
- if (SKU."Location Code" = "Location Code") and
- (SKU."Item No." = "No.") and
- (SKU."Variant Code" = "Variant Code")
- then
- exit(true);
- if SKU.Get("Location Code", "No.", "Variant Code") then
- exit(true);
-
- Result := false;
- OnAfterGetSKU(Rec, Result);
- end;
-
- ///
- /// Opens item charge assignment page, where receipt lines can be selected and additional cost is passed to the selected items.
- ///
- ///
- /// If the purchase line type is not an item (charge), a message is displayed, and the procedure is ended.
- ///
- procedure ShowItemChargeAssgnt()
- var
- ItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)";
- AssignItemChargePurch: Codeunit "Item Charge Assgnt. (Purch.)";
- ItemChargeAssgnts: Page "Item Charge Assignment (Purch)";
- ItemChargeAssgntLineAmt, NonDedVATAmount : Decimal;
- IsHandled, IncludeNonDedVATAmount : Boolean;
- begin
- Get("Document Type", "Document No.", "Line No.");
- CheckNoAndQuantityForItemChargeAssgnt();
-
- if Type <> Type::"Charge (Item)" then begin
- Message(ItemChargeAssignmentErr);
- exit;
- end;
-
- GetPurchHeader();
- if PurchHeader."Currency Code" = '' then
- Currency.InitRoundingPrecision()
- else
- Currency.Get(PurchHeader."Currency Code");
- if ("Inv. Discount Amount" = 0) and
- ("Line Discount Amount" = 0) and
- (not PurchHeader."Prices Including VAT")
- then begin
- ItemChargeAssgntLineAmt := "Line Amount";
- NonDedVATAmount := NonDeductibleVAT.GetNonDeductibleVATAmountForItemCost(Rec);
- if NonDedVATAmount <> 0 then begin
- ItemChargeAssgntLineAmt += NonDedVATAmount;
- IncludeNonDedVATAmount := true;
- end;
- end else
- if PurchHeader."Prices Including VAT" then
- ItemChargeAssgntLineAmt :=
- Round(CalcLineAmount() / (1 + GetVATPct() / 100), Currency."Amount Rounding Precision") + NonDeductibleVAT.GetNonDeductibleVATAmountForItemCost(Rec)
- else
- ItemChargeAssgntLineAmt := CalcLineAmount();
-
- ItemChargeAssgntPurch.Reset();
- ItemChargeAssgntPurch.SetRange("Document Type", "Document Type");
- ItemChargeAssgntPurch.SetRange("Document No.", "Document No.");
- ItemChargeAssgntPurch.SetRange("Document Line No.", "Line No.");
- ItemChargeAssgntPurch.SetRange("Item Charge No.", "No.");
- if not ItemChargeAssgntPurch.FindLast() then begin
- ItemChargeAssgntPurch."Document Type" := "Document Type";
- ItemChargeAssgntPurch."Document No." := "Document No.";
- ItemChargeAssgntPurch."Document Line No." := "Line No.";
- ItemChargeAssgntPurch."Item Charge No." := "No.";
- ItemChargeAssgntPurch."Unit Cost" :=
- Round(ItemChargeAssgntLineAmt / Quantity,
- Currency."Unit-Amount Rounding Precision");
- end;
-
- IsHandled := false;
- OnShowItemChargeAssgntOnBeforeCalcItemCharge(Rec, ItemChargeAssgntLineAmt, Currency, IsHandled, ItemChargeAssgntPurch);
- if not IsHandled then
- ItemChargeAssgntLineAmt :=
- Round(ItemChargeAssgntLineAmt * ("Qty. to Invoice" / Quantity), Currency."Amount Rounding Precision");
-
- if IsCreditDocType() then
- AssignItemChargePurch.CreateDocChargeAssgnt(ItemChargeAssgntPurch, "Return Shipment No.")
- else
- AssignItemChargePurch.CreateDocChargeAssgnt(ItemChargeAssgntPurch, "Receipt No.");
- Clear(AssignItemChargePurch);
-
- if IncludeNonDedVATAmount then begin
- Rec."Item Charge Has Non.Ded. VAT" := IncludeNonDedVATAmount;
- Rec.Modify();
- end;
-
- Commit();
-
- ItemChargeAssgnts.Initialize(Rec, ItemChargeAssgntLineAmt);
- ItemChargeAssgnts.RunModal();
-
- CalcFields("Qty. to Assign");
- OnAfterShowItemChargeAssgnt(Rec, ItemChargeAssgntPurch, ItemChargeAssgnts);
- end;
-
- ///
- /// Updates item chage assignment amounts and unit cost for the pruchase line.
- ///
- ///
- /// If the document type is a blanket order, the procedure is ended.
- /// If the quantity invoiced is greater than the sum of the quantity assigned and the quantity to assign, an error message is displayed.
- ///
- procedure UpdateItemChargeAssgnt()
- var
- ItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)";
- ShareOfVAT: Decimal;
- TotalQtyToAssign: Decimal;
- TotalAmtToAssign: Decimal;
- TotalQtyToHandle: Decimal;
- TotalAmtToHandle: Decimal;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateItemChargeAssgnt(Rec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- if "Document Type" = "Document Type"::"Blanket Order" then
- exit;
-
- CalcFields("Qty. Assigned", "Qty. to Assign", "Item Charge Qty. to Handle");
- if Abs("Quantity Invoiced") > Abs(("Qty. Assigned" + "Qty. to Assign")) then
- Error(Text032, FieldCaption("Quantity Invoiced"), FieldCaption("Qty. Assigned"), FieldCaption("Qty. to Assign"));
-
- ItemChargeAssgntPurch.SetRange("Document Type", "Document Type");
- ItemChargeAssgntPurch.SetRange("Document No.", "Document No.");
- ItemChargeAssgntPurch.SetRange("Document Line No.", "Line No.");
- ItemChargeAssgntPurch.CalcSums("Qty. to Assign", "Qty. to Handle");
- TotalQtyToAssign := ItemChargeAssgntPurch."Qty. to Assign";
- TotalQtyToHandle := ItemChargeAssgntPurch."Qty. to Handle";
- if (CurrFieldNo <> 0) and ("Unit Cost" <> xRec."Unit Cost") then begin
- ItemChargeAssgntPurch.SetFilter("Qty. Assigned", '<>0');
- if not ItemChargeAssgntPurch.IsEmpty() then
- Error(Text022,
- FieldCaption("Unit Cost"));
- ItemChargeAssgntPurch.SetRange("Qty. Assigned");
- end;
-
- if (CurrFieldNo <> 0) and (Quantity <> xRec.Quantity) then begin
- ItemChargeAssgntPurch.SetFilter("Qty. Assigned", '<>0');
- if not ItemChargeAssgntPurch.IsEmpty() then
- Error(Text022,
- FieldCaption(Quantity));
- ItemChargeAssgntPurch.SetRange("Qty. Assigned");
- end;
-
- if ItemChargeAssgntPurch.FindSet(true) and (Quantity <> 0) then begin
- GetPurchHeader();
- TotalAmtToAssign := CalcTotalAmtToAssign(TotalQtyToAssign);
- TotalAmtToHandle := CalcTotalAmtToAssign(TotalQtyToHandle);
- repeat
- ShareOfVAT := 1;
- if PurchHeader."Prices Including VAT" then
- ShareOfVAT := 1 + "VAT %" / 100;
- if ItemChargeAssgntPurch."Unit Cost" <>
- Round(CalcLineAmount() / Quantity / ShareOfVAT, Currency."Unit-Amount Rounding Precision")
- then
- ItemChargeAssgntPurch."Unit Cost" :=
- Round(CalcLineAmount() / Quantity / ShareOfVAT, Currency."Unit-Amount Rounding Precision");
- if TotalQtyToAssign <> 0 then begin
- ItemChargeAssgntPurch."Amount to Assign" :=
- Round(ItemChargeAssgntPurch."Qty. to Assign" / TotalQtyToAssign * TotalAmtToAssign,
- Currency."Amount Rounding Precision");
- TotalQtyToAssign -= ItemChargeAssgntPurch."Qty. to Assign";
- TotalAmtToAssign -= ItemChargeAssgntPurch."Amount to Assign";
- if TotalQtyToHandle <> 0 then begin
- ItemChargeAssgntPurch."Amount to Handle" :=
- Round(ItemChargeAssgntPurch."Qty. to Handle" / TotalQtyToHandle * TotalAmtToHandle,
- Currency."Amount Rounding Precision");
- TotalQtyToHandle -= ItemChargeAssgntPurch."Qty. to Handle";
- TotalAmtToHandle -= ItemChargeAssgntPurch."Amount to Handle";
- end;
- end;
- OnUpdateItemChargeAssgntOnBeforeItemChargeAssignmentPurchModify(Rec, ItemChargeAssgntPurch);
- ItemChargeAssgntPurch.Modify();
- until ItemChargeAssgntPurch.Next() = 0;
- CalcFields("Qty. to Assign", "Item Charge Qty. to Handle");
- end;
- end;
-
- ///
- /// Deletes item charge assignments that are applied to purchase document line.
- /// The provided parameters filter out item charge assignments to delete.
- ///
- /// Purchase document type.
- /// Purchase document no.
- /// Purchase document line no.
- procedure DeleteItemChargeAssignment(DocType: Enum "Purchase Document Type"; DocNo: Code[20]; DocLineNo: Integer)
- var
- ItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)";
- begin
- ItemChargeAssgntPurch.SetRange("Applies-to Doc. Type", DocType);
- ItemChargeAssgntPurch.SetRange("Applies-to Doc. No.", DocNo);
- ItemChargeAssgntPurch.SetRange("Applies-to Doc. Line No.", DocLineNo);
- if not ItemChargeAssgntPurch.IsEmpty() then
- ItemChargeAssgntPurch.DeleteAll(true);
- OnAfterDeleteItemChargeAssignment(Rec, xRec, CurrFieldNo);
- end;
-
- ///
- /// Deletes item charge assignments for a purchase document line.
- /// The provided parameters filter out item charge assignments to delete.
- ///
- ///
- /// If document type is not a blanket order and quantity invoiced is not 0,
- /// the procedure tests if qty. assigned and quantity invoiced are not zero.
- ///
- /// Purchase document type.
- /// Purchase document no.
- /// Purchase document line no.
- procedure DeleteChargeChargeAssgnt(DocType: Enum "Purchase Document Type"; DocNo: Code[20]; DocLineNo: Integer)
- var
- ItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)";
- begin
- if DocType <> "Document Type"::"Blanket Order" then
- if "Quantity Invoiced" <> 0 then begin
- CalcFields("Qty. Assigned");
- TestField("Qty. Assigned", "Quantity Invoiced");
- end;
-
- ItemChargeAssgntPurch.Reset();
- ItemChargeAssgntPurch.SetRange("Document Type", DocType);
- ItemChargeAssgntPurch.SetRange("Document No.", DocNo);
- ItemChargeAssgntPurch.SetRange("Document Line No.", DocLineNo);
- if not ItemChargeAssgntPurch.IsEmpty() then
- ItemChargeAssgntPurch.DeleteAll();
-
- OnAfterDeleteChargeChargeAssgntProcedure(Rec, xRec, CurrFieldNo);
- end;
-
- ///
- /// Checks if there are any item charge assignments assigned for the purchase line.
- /// If so, it checks if item charge assignment is allowed and if the quantity to assign is zero.
- ///
- procedure CheckItemChargeAssgnt()
- var
- ItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)";
- begin
- ItemChargeAssgntPurch.SetRange("Applies-to Doc. Type", "Document Type");
- ItemChargeAssgntPurch.SetRange("Applies-to Doc. No.", "Document No.");
- ItemChargeAssgntPurch.SetRange("Applies-to Doc. Line No.", "Line No.");
- ItemChargeAssgntPurch.SetRange("Document Type", "Document Type");
- ItemChargeAssgntPurch.SetRange("Document No.", "Document No.");
- if ItemChargeAssgntPurch.FindSet() then begin
- TestField("Allow Item Charge Assignment");
- repeat
- ItemChargeAssgntPurch.TestField("Qty. to Assign", 0);
- until ItemChargeAssgntPurch.Next() = 0;
- end;
- end;
-
- procedure CheckAssociatedSalesOrder()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckAssosiatedSalesOrder(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- if "Drop Shipment" then
- Error(Text001, FieldCaption("No."), "Sales Order No.");
- if "Special Order" then
- Error(Text001, FieldCaption("No."), "Special Order Sales No.");
- end;
-
- local procedure CheckAssociatedProdOrder()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckAssosiatedProdOrder(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- OnAfterCheckAssosiatedProdOrder(Rec);
- end;
-
- local procedure CheckLineNotShippedOrReceived()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckLineNotShippedOrReceived(Rec, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Qty. Rcd. Not Invoiced", 0);
- TestField("Receipt No.", '');
- MatchedOrderLineMgmt.IsLineMatched(Rec, true);
-
- TestField("Return Qty. Shipped Not Invd.", 0);
- TestField("Return Shipment No.", '');
- end;
-
- local procedure CheckNoAndQuantityForItemChargeAssgnt()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckNoAndQuantityForItemChargeAssgnt(Rec, IsHandled);
- if IsHandled then
- exit;
-
- TestField("No.");
- TestField(Quantity);
- end;
-
- ///
- /// Returns the value of global SkipTaxCalculation flag.
- ///
- /// The value of global SkipTaxCalculation flag.
- procedure GetSkipTaxCalculation(): Boolean
- begin
- exit(SkipTaxCalculation);
- end;
-
- ///
- /// Sets the global flag SkipTaxCalculation value.
- ///
- /// The value to set.
- procedure SetSkipTaxCalulation(Skip: Boolean)
- begin
- SkipTaxCalculation := Skip;
- end;
-
- ///
- /// Sets the global HideValidationDialog flag.
- ///
- /// The new value of the flag.
- procedure SetHideValidationDialog(NewHideValidationDialog: Boolean)
- begin
- HideValidationDialog := NewHideValidationDialog;
- OnAfterSetHideValidationDialog(Rec, NewHideValidationDialog);
- end;
-
- ///
- /// Gets the global HideValidationDialog flag.
- ///
- /// The value of the flag.
- procedure GetHideValidationDialog(): Boolean
- begin
- exit(HideValidationDialog);
- end;
-
- ///
- /// Gets a caption class for a field.
- ///
- /// The number of the field to get the caption class for.
- /// The caption class of a field.
- procedure GetCaptionClass(FieldNumber: Integer): Text[80]
- var
- PurchLineCaptionClassMgmt: Codeunit "Purch. Line CaptionClass Mgmt";
- begin
- exit(PurchLineCaptionClassMgmt.GetPurchaseLineCaptionClass(Rec, FieldNumber));
- end;
-
- ///
- /// Checks whether the purchase header of the line is open.
- ///
- ///
- /// The check is performed exclusively for non-system generated lines, type changes, and lines with non-blank type.
- ///
- procedure TestStatusOpen()
- var
- IsHandled: Boolean;
- begin
- GetPurchHeader();
- IsHandled := false;
- OnBeforeTestStatusOpen(Rec, PurchHeader, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- if StatusCheckSuspended then
- exit;
-
- if not "System-Created Entry" then
- if (xRec.Type <> Type) or HasTypeToFillMandatoryFields() then
- PurchHeader.TestField(Status, PurchHeader.Status::Open);
-
- OnAfterTestStatusOpen(Rec, PurchHeader);
- end;
-
- ///
- /// Returns the value of the global variable StatusCheckSuspended.
- ///
- /// The value of the global variable StatusCheckSuspended.
- procedure GetSuspendedStatusCheck(): Boolean
- begin
- exit(StatusCheckSuspended);
- end;
-
- ///
- /// Sets the value of the global variable StatusCheckSuspended.
- ///
- /// The new value to set.
- procedure SuspendStatusCheck(Suspend: Boolean)
- begin
- StatusCheckSuspended := Suspend;
- end;
-
- ///
- /// Updates Lead Time fields based on the item, location, variant, and vendor for the purchase line.
- ///
- ///
- /// If the purchase line type is not item, the procedure is ended.
- ///
- procedure UpdateLeadTimeFields()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateLeadTimeFields(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if Type = Type::Item then begin
- GetPurchHeader();
-
- Evaluate("Lead Time Calculation",
- LeadTimeMgt.PurchaseLeadTime(
- "No.", "Location Code", "Variant Code",
- "Buy-from Vendor No."));
- if Format("Lead Time Calculation") = '' then
- "Lead Time Calculation" := PurchHeader."Lead Time Calculation";
- Evaluate("Safety Lead Time", LeadTimeMgt.SafetyLeadTime("No.", "Location Code", "Variant Code"));
- end;
- end;
-
- ///
- /// Updates the expected receipt date or order date of a purchase line with the corresponding date in the purchase header.
- ///
- procedure GetUpdateBasicDates()
- begin
- GetPurchHeader();
- if PurchHeader."Expected Receipt Date" <> 0D then
- Validate("Expected Receipt Date", PurchHeader."Expected Receipt Date")
- else
- Validate("Order Date", PurchHeader."Order Date");
- end;
-
- ///
- /// Updates purchase line dates based on the promised receipt date or requested receipt date.
- /// If both dates are empty, the procedure updates the expected receipt date or oreder date of a purchase line
- /// with the corresponding date in the purchase header.
- ///
- procedure UpdateDates()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateDates(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "Promised Receipt Date" <> 0D then
- Validate("Promised Receipt Date")
- else
- if "Requested Receipt Date" <> 0D then
- Validate("Requested Receipt Date")
- else
- GetUpdateBasicDates();
-
- OnAfterUpdateDates(Rec);
- end;
-
- ///
- /// Returns the total lead time in days for a purchase line, taking into account the safety lead time and inbound whse. handling time.
- /// Used to calculate expected receipt date for the purchase line.
- ///
- /// Planned receipt date of the purchase line.
- /// Total lead time in days.
- procedure InternalLeadTimeDays(PurchDate: Date): Text[30]
- var
- TotalDays: DateFormula;
- begin
- Evaluate(
- TotalDays, '<' + Format(CalcDate("Safety Lead Time", CalcDate("Inbound Whse. Handling Time", PurchDate)) - PurchDate) + 'D>');
- OnAfterInternalLeadTimeDays(Rec, PurchDate, TotalDays);
- exit(Format(TotalDays));
- end;
-
- local procedure ReversedInternalLeadTimeDays(PurchDate: Date): Text[30]
- var
- TotalDays: DateFormula;
- ReversedSafetyLeadTime: DateFormula;
- ReversedWhseHandlingTime: DateFormula;
- begin
- CalendarMgmt.ReverseDateFormula(ReversedSafetyLeadTime, "Safety Lead Time");
- CalendarMgmt.ReverseDateFormula(ReversedWhseHandlingTime, "Inbound Whse. Handling Time");
- Evaluate(
- TotalDays, '<' + Format(PurchDate - CalcDate(ReversedWhseHandlingTime, CalcDate(ReversedSafetyLeadTime, PurchDate))) + 'D>');
-
- OnAfterReversedInternalLeadTimeDays(Rec, PurchDate, ReversedWhseHandlingTime, TotalDays);
- exit(Format(TotalDays));
- end;
-
- ///
- /// Updates VAT and related amounts on all lines of the document.
- ///
- ///
- /// If parameter QtyType is Shipping procedure is ended without updating the lines.
- ///
- /// The type of quantity to consider for the update (Qty, QtyToInvoice, QtyToReceive).
- /// The purchase header of the document. The purchase lines are filtered based on this document.
- /// Purhcase line record that will be iterated through. Any existing filters on this record will narrow down the lines to consider.
- /// Calculated VAT amount set. For each purchase line, the corresponding VAT amount line will be extracted from this collection.
- /// True if any line was modified, otherwise false.
- procedure UpdateVATOnLines(QtyType: Option General,Invoicing,Shipping; var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line") LineWasModified: Boolean
- var
- TempVATAmountLineRemainder: Record "VAT Amount Line" temporary;
- Currency: Record Currency;
- NewAmount: Decimal;
- NewAmountIncludingVAT: Decimal;
- NewVATBaseAmount: Decimal;
- VATAmount: Decimal;
- NonDedVATAmount: Decimal;
- VATDifference: Decimal;
- NonDedVATDifference: Decimal;
- InvDiscAmount: Decimal;
- LineAmountToInvoice: Decimal;
- LineAmountToInvoiceDiscounted: Decimal;
- DeferralAmount: Decimal;
- IsHandled: Boolean;
- IsLineAmountToInvoiceSimple: Boolean;
- begin
- LineWasModified := false;
- if QtyType = QtyType::Shipping then
- exit;
- if PurchHeader."Currency Code" = '' then
- Currency.InitRoundingPrecision()
- else
- Currency.Get(PurchHeader."Currency Code");
-
- TempVATAmountLineRemainder.DeleteAll();
-
- IsHandled := false;
- OnUpdateVATOnLinesOnBeforeProcessPurchLines(Rec, xRec, PurchHeader, VATAmountLine, TempVATAmountLineRemainder, LineWasModified, IsHandled, QtyType);
- if IsHandled then
- exit(LineWasModified);
-
- PurchLine.SetRange("Document Type", PurchHeader."Document Type");
- PurchLine.SetRange("Document No.", PurchHeader."No.");
- SetLoadFieldsForInvDiscoundCalculation(PurchLine);
- OnUpdateVATOnLinesOnAfterSetFilters(PurchLine, PurchHeader);
- PurchLine.LockTable();
- if PurchLine.FindSet() then
- repeat
- if not PurchLine.ZeroAmountLine(QtyType) then begin
- OnUpdateVATOnLinesOnBeforeProcessPurchLine(PurchLine, PurchHeader, VATAmountLine, QtyType);
- DeferralAmount := PurchLine.GetDeferralAmount();
- FindVATAmountLine(PurchLine, VATAmountLine);
- if VATAmountLine.Modified then begin
- if not FindVATAmountLine(PurchLine, TempVATAmountLineRemainder) then begin
- TempVATAmountLineRemainder := VATAmountLine;
- TempVATAmountLineRemainder.Init();
- TempVATAmountLineRemainder.Insert();
- end;
-
- IsLineAmountToInvoiceSimple := QtyType = QtyType::General;
-
- if not IsLineAmountToInvoiceSimple then
- OnAfterCheckIsLineAmountToInvoiceSimple(PurchHeader, IsLineAmountToInvoiceSimple);
-
- if IsLineAmountToInvoiceSimple then
- LineAmountToInvoice := PurchLine."Line Amount"
- else
- LineAmountToInvoice :=
- Round(PurchLine."Line Amount" * PurchLine."Qty. to Invoice" / PurchLine.Quantity, Currency."Amount Rounding Precision");
-
- if PurchLine."Allow Invoice Disc." then begin
- if (VATAmountLine."Inv. Disc. Base Amount" = 0) or (LineAmountToInvoice = 0) then
- InvDiscAmount := 0
- else begin
- if IsLineAmountToInvoiceSimple then
- LineAmountToInvoice := PurchLine."Line Amount"
- else
- LineAmountToInvoice :=
- Round(PurchLine."Line Amount" * PurchLine."Qty. to Invoice" / PurchLine.Quantity, Currency."Amount Rounding Precision");
- LineAmountToInvoiceDiscounted :=
- VATAmountLine."Invoice Discount Amount" * LineAmountToInvoice /
- VATAmountLine."Inv. Disc. Base Amount";
- TempVATAmountLineRemainder."Invoice Discount Amount" :=
- TempVATAmountLineRemainder."Invoice Discount Amount" + LineAmountToInvoiceDiscounted;
- InvDiscAmount :=
- Round(
- TempVATAmountLineRemainder."Invoice Discount Amount", Currency."Amount Rounding Precision");
- TempVATAmountLineRemainder."Invoice Discount Amount" :=
- TempVATAmountLineRemainder."Invoice Discount Amount" - InvDiscAmount;
- end;
- if IsLineAmountToInvoiceSimple then begin
- PurchLine."Inv. Discount Amount" := InvDiscAmount;
- PurchLine.CalcInvDiscToInvoice();
- end else
- PurchLine."Inv. Disc. Amount to Invoice" := InvDiscAmount;
- end else
- InvDiscAmount := 0;
-
- OnUpdateVATOnLinesOnBeforeCalculateAmounts(PurchLine, PurchHeader);
- if QtyType = QtyType::General then begin
- if PurchHeader."Prices Including VAT" then begin
- if (VATAmountLine.CalcLineAmount() = 0) or (PurchLine."Line Amount" = 0) then begin
- VATAmount := 0;
- NonDedVATAmount := 0;
- NewAmountIncludingVAT := 0;
- end else begin
- VATAmount :=
- TempVATAmountLineRemainder."VAT Amount" +
- VATAmountLine."VAT Amount" * PurchLine.CalcLineAmount() / VATAmountLine.CalcLineAmount();
- NonDedVATAmount :=
- NonDeductibleVAT.GetNonDedVATAmountFromVATAmountLine(TempVATAmountLineRemainder, VATAmountLine, Currency, PurchLine.CalcLineAmount(), VATAmountLine.CalcLineAmount());
- NewAmountIncludingVAT :=
- TempVATAmountLineRemainder."Amount Including VAT" +
- VATAmountLine."Amount Including VAT" * PurchLine.CalcLineAmount() / VATAmountLine.CalcLineAmount();
- end;
- NewAmount :=
- Round(NewAmountIncludingVAT, Currency."Amount Rounding Precision") -
- Round(VATAmount, Currency."Amount Rounding Precision");
- NewVATBaseAmount :=
- Round(
- NewAmount * (1 - GetVatBaseDiscountPct(PurchHeader) / 100),
- Currency."Amount Rounding Precision");
- end else begin
- if PurchLine."VAT Calculation Type" = PurchLine."VAT Calculation Type"::"Full VAT" then begin
- VATAmount := PurchLine.CalcLineAmount();
- NewAmount := 0;
- NewVATBaseAmount := 0;
- end else begin
- NewAmount := PurchLine.CalcLineAmount();
- NewVATBaseAmount :=
- Round(
- NewAmount * (1 - GetVatBaseDiscountPct(PurchHeader) / 100),
- Currency."Amount Rounding Precision");
- IsHandled := false;
- OnUpdateVATOnLinesOnBeforeCalcNotFullVATAmount(Rec, PurchHeader, Currency, VATAmountLine, TempVATAmountLineRemainder, NewVATBaseAmount, VATAmount, IsHandled);
- if not IsHandled then
- if VATAmountLine."VAT Base" = 0 then begin
- VATAmount := 0;
- NonDedVATAmount := 0;
- end else begin
- VATAmount :=
- TempVATAmountLineRemainder."VAT Amount" +
- VATAmountLine."VAT Amount" * NewAmount / VATAmountLine."VAT Base";
- NonDedVATAmount :=
- NonDeductibleVAT.GetNonDedVATAmountFromVATAmountLine(TempVATAmountLineRemainder, VATAmountLine, Currency, NewAmount, VATAmountLine."VAT Base");
- end;
- end;
- NewAmountIncludingVAT := NewAmount + Round(VATAmount, Currency."Amount Rounding Precision");
- end;
- OnUpdateVATOnLinesOnAfterCalculateNewAmount(
- Rec, PurchHeader, VATAmountLine, TempVATAmountLineRemainder, NewAmountIncludingVAT, VATAmount,
- NewAmount, NewVATBaseAmount, PurchLine);
- end else begin
- if VATAmountLine.CalcLineAmount() = 0 then
- ClearVATDifference()
- else
- VATDifference :=
- TempVATAmountLineRemainder."VAT Difference" +
- VATAmountLine."VAT Difference" * (LineAmountToInvoice - InvDiscAmount) / VATAmountLine.CalcLineAmount();
- if LineAmountToInvoice = 0 then begin
- PurchLine.ClearVATDifference();
- NonDedVATAmount := 0;
- NonDeductibleVAT.InitNonDeductibleVATDiff(Rec);
- end else begin
- PurchLine."VAT Difference" := Round(VATDifference, Currency."Amount Rounding Precision");
- NonDedVATAmount :=
- NonDeductibleVAT.GetNonDedVATAmountFromVATAmountLine(
- TempVATAmountLineRemainder, VATAmountLine, Currency, LineAmountToInvoice - InvDiscAmount, VATAmountLine.CalcLineAmount());
- NonDeductibleVAT.SetNonDedVATAmountDiffInPurchLine(
- PurchLine, TempVATAmountLineRemainder, NonDedVATDifference, VATAmountLine, Currency,
- LineAmountToInvoice - InvDiscAmount, VATAmountLine.CalcLineAmount());
- end;
- OnUpdateVATOnLinesOnAfterCalculateVATDifference(
- Rec, PurchHeader, VATAmountLine, TempVATAmountLineRemainder, QtyType, PurchLine, LineAmountToInvoice, InvDiscAmount);
- end;
- OnUpdateVATOnLinesOnAfterCalculateAmounts(PurchLine, PurchHeader);
-
- if QtyType = QtyType::General then begin
- if not PurchLine."Prepayment Line" then
- PurchLine.UpdatePrepmtAmounts();
- PurchLine.UpdateBaseAmounts(NewAmount, Round(NewAmountIncludingVAT, Currency."Amount Rounding Precision"), NewVATBaseAmount);
- NonDeductibleVAT.SetNonDedVATAmountInPurchLine(PurchLine, NonDedVATAmount);
- OnUpdateVATOnLinesOnAfterUpdateBaseAmounts(PurchHeader, PurchLine, TempVATAmountLineRemainder, VATAmountLine, Currency);
- end;
- OnUpdateVATOnLinesOnBeforeInitOutstanding(Rec, QtyType);
- PurchLine.InitOutstanding();
- if not ((PurchLine.Type = PurchLine.Type::"Charge (Item)") and (PurchLine."Quantity Invoiced" <> PurchLine."Qty. Assigned")) then begin
- PurchLine.SetUpdateFromVAT(true);
- PurchLine.UpdateUnitCost();
- end;
- if PurchLine.Type = PurchLine.Type::"Charge (Item)" then
- PurchLine.UpdateItemChargeAssgnt();
- OnUpdateVATOnLinesOnBeforeModifyPurchLine(PurchLine, VATAmount);
- PurchLine.Modify();
- LineWasModified := true;
-
- if (PurchLine."Deferral Code" <> '') and (DeferralAmount <> PurchLine.GetDeferralAmount()) then
- PurchLine.UpdateDeferralAmounts();
-
- TempVATAmountLineRemainder."Amount Including VAT" :=
- NewAmountIncludingVAT - Round(NewAmountIncludingVAT, Currency."Amount Rounding Precision");
- TempVATAmountLineRemainder."VAT Amount" := VATAmount - NewAmountIncludingVAT + NewAmount;
- TempVATAmountLineRemainder."VAT Difference" := VATDifference - PurchLine."VAT Difference";
- OnUpdateVATOnLinesOnBeforeTempVATAmountLineRemainderModify(Rec, TempVATAmountLineRemainder, VATAmount, NewVATBaseAmount, PurchLine);
- TempVATAmountLineRemainder.Modify();
- end;
- end;
- until PurchLine.Next() = 0;
- VATAmountLine.Reset();
- PurchLine.SetLoadFields();
-
- OnAfterUpdateVATOnLines(PurchHeader, PurchLine, VATAmountLine, QtyType);
- end;
-
- ///
- /// Calculates the VAT amounts for purchase lines based on the quantity type, and updates the VAT amount lines accordingly.
- ///
- ///
- /// VATAmountLine parameter must be temporary, because DeleteAll is called for it.
- ///
- /// The type of quantity to consider for the update (Qty, QtyToInvoice, QtyToReceive).
- /// The purchase header of the document. The purchase lines are filtered based on this document.
- /// Purhcase line record that will be iterated through. Any existing filters on this record will narrow down the lines to consider.
- /// Return value: Calculated and inserted VAT amount lines.
- procedure CalcVATAmountLines(QtyType: Option General,Invoicing,Shipping; var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line")
- var
- TempVATAmountLineRemainder: Record "VAT Amount Line" temporary;
- TotalVATAmount: Decimal;
- QtyToHandle: Decimal;
- AmtToHandle: Decimal;
- RoundingLineInserted: Boolean;
- IsHandled: Boolean;
- ShouldProcessRounding: Boolean;
- begin
- if IsCalcVATAmountLinesHandled(PurchHeader, PurchLine, VATAmountLine, QtyType) then
- exit;
-
- Currency.Initialize(PurchHeader."Currency Code");
-
- VATAmountLine.DeleteAll();
-
- PurchLine.SetRange("Document Type", PurchHeader."Document Type");
- PurchLine.SetRange("Document No.", PurchHeader."No.");
- SetLoadFieldsForInvDiscoundCalculation(PurchLine);
- OnCalcVATAmountLinesOnAfterSetFilters(PurchLine, PurchHeader);
- if PurchLine.FindSet() then
- repeat
- if not PurchLine.ZeroAmountLine(QtyType) then begin
- OnCalcVATAmountLinesOnBeforeProcessPurchLine(PurchLine, PurchHeader, VATAmountLine, QtyType);
- if (PurchLine.Type = PurchLine.Type::"G/L Account") and not PurchLine."Prepayment Line" then
- RoundingLineInserted := ((PurchLine."No." = PurchLine.GetVPGInvRoundAcc(PurchHeader)) and PurchLine."System-Created Entry") or RoundingLineInserted;
- if PurchLine."VAT Calculation Type" in
- [PurchLine."VAT Calculation Type"::"Reverse Charge VAT", PurchLine."VAT Calculation Type"::"Sales Tax"]
- then
- PurchLine.ClearVATPct();
-
- if not FindVATAmountLine(PurchLine, VATAmountLine) then begin
- InsertVATAmountLine(PurchLine, VATAmountLine);
- OnCalcVATAmountLinesAfterVATAmountLineInsertNewLine(PurchLine, VATAmountLine);
- end;
-
- case QtyType of
- QtyType::General:
- begin
- VATAmountLine.Quantity += PurchLine."Quantity (Base)";
- NonDeductibleVAT.AddNonDedAmountsOfPurchLineToVATAmountLine(VATAmountLine, TempVATAmountLineRemainder, PurchLine, Currency, 1, 1);
- OnCalcVATAmountLinesOnBeforeVATAmountLineSumLine(Rec, VATAmountLine, QtyType, PurchLine);
- SumVATAmountLine(PurchHeader, PurchLine, VATAmountLine, QtyType, AmtToHandle, QtyToHandle);
- end;
- QtyType::Invoicing:
- begin
- IsHandled := false;
- OnCalcVATAmountLinesOnBeforeAssignQuantities(PurchHeader, PurchLine, VATAmountLine, QtyToHandle, IsHandled);
- if not IsHandled then
- case true of
- (PurchLine."Document Type" in [PurchLine."Document Type"::Order, PurchLine."Document Type"::Invoice]) and
- (not PurchHeader.Receive) and PurchHeader.Invoice and (not PurchLine."Prepayment Line"):
- if not PurchLine.IsMatchedToReceiptOrOrder() then begin
- QtyToHandle := PurchLine.GetAbsMin(PurchLine."Qty. to Invoice", PurchLine."Qty. Rcd. Not Invoiced");
- VATAmountLine.Quantity += PurchLine.GetAbsMin(PurchLine."Qty. to Invoice (Base)", PurchLine."Qty. Rcd. Not Invoiced (Base)");
- end else begin
- QtyToHandle := PurchLine."Qty. to Invoice";
- VATAmountLine.Quantity += PurchLine."Qty. to Invoice (Base)";
- end;
- PurchLine.IsCreditDocType() and (not PurchHeader.Ship) and PurchHeader.Invoice:
- if PurchLine."Return Shipment No." = '' then begin
- QtyToHandle := PurchLine.GetAbsMin(PurchLine."Qty. to Invoice", PurchLine."Return Qty. Shipped Not Invd.");
- VATAmountLine.Quantity += PurchLine.GetAbsMin(PurchLine."Qty. to Invoice (Base)", PurchLine."Ret. Qty. Shpd Not Invd.(Base)");
- end else begin
- QtyToHandle := PurchLine."Qty. to Invoice";
- VATAmountLine.Quantity += PurchLine."Qty. to Invoice (Base)";
- end;
- else begin
- QtyToHandle := PurchLine."Qty. to Invoice";
- VATAmountLine.Quantity += PurchLine."Qty. to Invoice (Base)";
- end;
- end;
- OnCalcVATAmountLinesOnQtyTypeInvoicingOnBeforeCalcAmtToHandle(PurchLine, PurchHeader, QtyToHandle, VATAmountLine);
- AmtToHandle := PurchLine.GetLineAmountToHandleInclPrepmt(QtyToHandle);
- NonDeductibleVAT.AddNonDedAmountsOfPurchLineToVATAmountLine(VATAmountLine, TempVATAmountLineRemainder, PurchLine, Currency, QtyToHandle, PurchLine.Quantity);
- OnCalcVATAmountLinesOnBeforeVATAmountLineSumLine(Rec, VATAmountLine, QtyType, PurchLine);
- SumVATAmountLine(PurchHeader, PurchLine, VATAmountLine, QtyType, AmtToHandle, QtyToHandle);
- end;
- QtyType::Shipping:
- begin
- IsHandled := false;
- OnCalcVATAmountLinesOnBeforeAssignShippingQuantities(PurchHeader, PurchLine, VATAmountLine, QtyToHandle, IsHandled);
- if not IsHandled then
- if PurchLine.IsCreditDocType() then begin
- QtyToHandle := PurchLine."Return Qty. to Ship";
- VATAmountLine.Quantity += PurchLine."Return Qty. to Ship (Base)";
- end else begin
- QtyToHandle := PurchLine."Qty. to Receive";
- VATAmountLine.Quantity += PurchLine."Qty. to Receive (Base)";
- end;
- OnCalcVATAmountLinesOnQtyTypeShippingOnBeforeCalcAmtToHandle(PurchLine, PurchHeader, QtyToHandle, VATAmountLine);
- AmtToHandle := PurchLine.GetLineAmountToHandleInclPrepmt(QtyToHandle);
- OnCalcVATAmountLinesOnBeforeVATAmountLineSumLine(Rec, VATAmountLine, QtyType, PurchLine);
- SumVATAmountLine(PurchHeader, PurchLine, VATAmountLine, QtyType, AmtToHandle, QtyToHandle);
- end;
- end;
- TotalVATAmount += PurchLine."Amount Including VAT" - PurchLine.Amount;
- OnCalcVATAmountLinesOnAfterCalcLineTotals(VATAmountLine, PurchHeader, PurchLine, Currency, QtyType, TotalVATAmount);
- end;
- until PurchLine.Next() = 0;
- VATAmountLine.Reset();
- PurchLine.SetLoadFields();
-
- OnCalcVATAmountLinesOnBeforeVATAmountLineUpdateLines(PurchLine, VATAmountLine, TotalVATAmount);
- VATAmountLine.UpdateLines(
- TotalVATAmount, Currency, PurchHeader."Currency Factor", PurchHeader."Prices Including VAT",
- PurchHeader."VAT Base Discount %", PurchHeader."Tax Area Code", PurchHeader."Tax Liable", PurchHeader."Posting Date");
-
- ShouldProcessRounding := RoundingLineInserted and (TotalVATAmount <> 0);
- OnCalcVATAmountLinesOnAfterCalcShouldProcessRounding(PurchLine, VATAmountLine, TotalVATAmount, Currency, ShouldProcessRounding);
- if ShouldProcessRounding then
- if GetVATAmountLineOfMaxAmt(VATAmountLine, PurchLine) then begin
- VATAmountLine."VAT Amount" += TotalVATAmount;
- VATAmountLine."Amount Including VAT" += TotalVATAmount;
- VATAmountLine."Calculated VAT Amount" += TotalVATAmount;
- VATAmountLine.Modify();
- end;
-
- OnAfterCalcVATAmountLines(PurchHeader, PurchLine, VATAmountLine, QtyType);
- end;
-
- local procedure FindVATAmountLine(var PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line" temporary): Boolean
- begin
- VATAmountLine.Reset();
- VATAmountLine.SetRange("VAT Identifier", PurchaseLine."VAT Identifier");
- VATAmountLine.SetRange("VAT Calculation Type", PurchaseLine."VAT Calculation Type");
- VATAmountLine.SetRange("Tax Group Code", PurchaseLine."Tax Group Code");
- VATAmountLine.SetRange("Use Tax", PurchaseLine."Use Tax");
- VATAmountLine.SetRange(Positive, PurchaseLine."Line Amount" >= 0);
- OnFindVATAmountLineOnAfterSetFilters(PurchaseLine, VATAmountLine);
- exit(VATAmountLine.FindFirst());
- end;
-
- local procedure InsertVATAmountLine(var PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line")
- begin
- VATAmountLine.Init();
- VATAmountLine."VAT Identifier" := PurchaseLine."VAT Identifier";
- VATAmountLine."VAT Calculation Type" := PurchaseLine."VAT Calculation Type";
- VATAmountLine."Tax Group Code" := PurchaseLine."Tax Group Code";
- VATAmountLine."Use Tax" := PurchaseLine."Use Tax";
- VATAmountLine."VAT %" := PurchaseLine."VAT %";
- VATAmountLine.Modified := true;
- VATAmountLine.Positive := PurchaseLine."Line Amount" >= 0;
- VATAmountLine."Includes Prepayment" := false;
- VATAmountLine."Non-Deductible VAT %" := PurchaseLine."Non-Deductible VAT %";
- OnInsertVATAmountOnBeforeInsert(PurchaseLine, VATAmountLine);
- VATAmountLine.Insert();
- end;
-
- local procedure SumVATAmountLine(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line"; QtyType: Option General,Invoicing,Shipping; AmtToHandle: Decimal; QtyToHandle: Decimal)
- begin
- case QtyType of
- QtyType::General:
- begin
- VATAmountLine."Line Amount" += PurchaseLine."Line Amount";
- if PurchaseLine."Allow Invoice Disc." then
- VATAmountLine."Inv. Disc. Base Amount" += PurchaseLine."Line Amount";
- VATAmountLine."Invoice Discount Amount" += PurchaseLine."Inv. Discount Amount";
- end;
- QtyType::Invoicing:
- if PurchaseHeader."Invoice Discount Calculation" <> PurchaseHeader."Invoice Discount Calculation"::Amount then begin
- VATAmountLine."Line Amount" += AmtToHandle;
- if PurchaseLine."Allow Invoice Disc." then
- VATAmountLine."Inv. Disc. Base Amount" += AmtToHandle;
- VATAmountLine."Invoice Discount Amount" += Round(PurchaseLine."Inv. Discount Amount" * QtyToHandle / PurchaseLine.Quantity, Currency."Amount Rounding Precision");
- end else begin
- VATAmountLine."Line Amount" += AmtToHandle;
- if PurchaseLine."Allow Invoice Disc." then
- VATAmountLine."Inv. Disc. Base Amount" += AmtToHandle;
- VATAmountLine."Invoice Discount Amount" += PurchaseLine."Inv. Disc. Amount to Invoice";
- end;
- QtyType::Shipping:
- begin
- VATAmountLine."Line Amount" += AmtToHandle;
- if PurchaseLine."Allow Invoice Disc." then
- VATAmountLine."Inv. Disc. Base Amount" += AmtToHandle;
- VATAmountLine."Invoice Discount Amount" += Round(PurchaseLine."Inv. Discount Amount" * QtyToHandle / PurchaseLine.Quantity, Currency."Amount Rounding Precision");
- end;
- end;
- VATAmountLine."VAT Difference" += PurchaseLine."VAT Difference";
- if PurchaseLine."Prepayment Line" then
- VATAmountLine."Includes Prepayment" := true;
- OnSumVATAmountLineOnBeforeModify(PurchaseLine, VATAmountLine);
- VATAmountLine.Modify();
- end;
-
- ///
- /// Retrieves the VAT amount line corresponding to the purchase line with the highest absolute amount from the set of VAT amount lines.
- ///
- /// Return value: The VAT amount line with the maximum absolute amount.
- /// The purchase line record to filter the VAT amount line set.
- /// True if a VAT amount line was found, otherwise false.
- procedure GetVATAmountLineOfMaxAmt(var VATAmountLine: Record "VAT Amount Line"; PurchaseLine: Record "Purchase Line") Found: Boolean
- var
- VATAmount1: Decimal;
- VATAmount2: Decimal;
- IsPositive1: Boolean;
- IsPositive2: Boolean;
- begin
- VATAmountLine.SetRange("VAT Identifier", PurchaseLine."VAT Identifier");
- VATAmountLine.SetRange("VAT Calculation Type", PurchaseLine."VAT Calculation Type");
- VATAmountLine.SetRange("Tax Group Code", PurchaseLine."Tax Group Code");
- VATAmountLine.SetRange("Use Tax", false);
- VATAmountLine.SetRange(Positive, false);
- if VATAmountLine.FindFirst() then begin
- VATAmount1 := VATAmountLine."VAT Amount";
- IsPositive1 := VATAmountLine.Positive;
- end;
- VATAmountLine.SetRange(Positive, true);
- if VATAmountLine.FindFirst() then begin
- VATAmount2 := VATAmountLine."VAT Amount";
- IsPositive2 := VATAmountLine.Positive;
- end;
- if Abs(VATAmount1) >= Abs(VATAmount2) then begin
- VATAmountLine.SetRange(Positive, IsPositive1);
- exit(VATAmountLine.FindFirst());
- end;
- VATAmountLine.SetRange(Positive, IsPositive2);
- Found := VATAmountLine.FindFirst();
- VATAmountLine.Reset();
- end;
-
- ///
- /// Updates the quantities to receive or return for a purchase line based on the document type, quantity, and the location.
- ///
- procedure UpdateWithWarehouseReceive()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateWithWarehouseReceive(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if IsInventoriableItem() then
- case true of
- ("Document Type" in ["Document Type"::Quote, "Document Type"::Order]) and (Quantity >= 0):
- if Location.RequireReceive("Location Code") then
- Validate("Qty. to Receive", 0)
- else
- Validate("Qty. to Receive", "Outstanding Quantity");
- ("Document Type" in ["Document Type"::Quote, "Document Type"::Order]) and (Quantity < 0):
- if Location.RequireShipment("Location Code") then
- Validate("Qty. to Receive", 0)
- else
- Validate("Qty. to Receive", "Outstanding Quantity");
- ("Document Type" = "Document Type"::"Return Order") and (Quantity >= 0):
- if Location.RequireShipment("Location Code") then
- Validate("Return Qty. to Ship", 0)
- else
- Validate("Return Qty. to Ship", "Outstanding Quantity");
- ("Document Type" = "Document Type"::"Return Order") and (Quantity < 0):
- if Location.RequireReceive("Location Code") then
- Validate("Return Qty. to Ship", 0)
- else
- Validate("Return Qty. to Ship", "Outstanding Quantity");
- end;
-
- GetPurchHeader();
- OnAfterUpdateWithWarehouseReceive(PurchHeader, Rec);
-
- SetDefaultQuantity();
- end;
-
- ///
- /// Checks warehouse requirements for a purchase line.
- ///
- ///
- /// The check is only conducted under the condition that the purchase line is inbound, the item in the purchase line has an inventory type, and the location has a mandatory bin.
- ///
- /// If true, then error or message is shown to inform the user about the requirements or issues.
- procedure CheckWarehouse(ShowDialogMessage: Boolean)
- var
- Location2: Record Location;
- WarehouseSetup: Record "Warehouse Setup";
- WhseValidateSourceLine: Codeunit "Whse. Validate Source Line";
- WMSManagement: Codeunit "WMS Management";
- ShowDialog: Option " ",Message,Error;
- DialogText: Text[50];
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckWarehouse(Rec, IsHandled, ShowDialogMessage);
- if IsHandled then
- exit;
-
- if IsProdOrder() then
- exit;
-
- GetLocation("Location Code");
- if "Location Code" = '' then begin
- WarehouseSetup.SetLoadFields("Require Pick", "Require Put-away", "Require Receive", "Require Shipment");
- WarehouseSetup.Get();
- Location2."Require Shipment" := WarehouseSetup."Require Shipment";
- Location2."Require Pick" := WarehouseSetup."Require Pick";
- Location2."Require Receive" := WarehouseSetup."Require Receive";
- Location2."Require Put-away" := WarehouseSetup."Require Put-away";
- end else
- Location2 := Location;
-
- OnCheckWarehouseOnAfterSetLocation2(Rec, Location2);
-
- if IsInbound() and IsInventoriableItem() and Location2."Bin Mandatory" then
- WMSManagement.CheckWarehouse(Location2.Code, Rec."Bin Code", Rec."No.", Rec."Variant Code", Rec."Unit of Measure Code", Quantity);
-
- if ShowDialogMessage then begin
- DialogText := Text033;
- if ("Document Type" in ["Document Type"::Order, "Document Type"::"Return Order"]) and
- Location2."Directed Put-away and Pick"
- then begin
- ShowDialog := ShowDialog::Error;
- if (("Document Type" = "Document Type"::Order) and (Quantity >= 0)) or
- (("Document Type" = "Document Type"::"Return Order") and (Quantity < 0))
- then
- DialogText :=
- CopyStr(DialogText + Location2.GetRequirementText(Location2.FieldNo("Require Receive")), 1, MaxStrLen(DialogText))
- else
- DialogText :=
- CopyStr(DialogText + Location2.GetRequirementText(Location2.FieldNo("Require Shipment")), 1, MaxStrLen(DialogText));
- end else begin
- if (("Document Type" = "Document Type"::Order) and (Quantity >= 0) and
- (Location2."Require Receive" or Location2."Require Put-away")) or
- (("Document Type" = "Document Type"::"Return Order") and (Quantity < 0) and
- (Location2."Require Receive" or Location2."Require Put-away"))
- then begin
- if WhseValidateSourceLine.WhseLinesExist(
- Database::"Purchase Line", "Document Type".AsInteger(), "Document No.", "Line No.", 0, Quantity)
- then
- ShowDialog := ShowDialog::Error
- else
- if Location2."Require Receive" then
- ShowDialog := ShowDialog::Message;
- if Location2."Require Receive" then
- DialogText :=
- CopyStr(DialogText + Location2.GetRequirementText(Location2.FieldNo("Require Receive")), 1, MaxStrLen(DialogText))
- else begin
- DialogText := Text034;
- DialogText :=
- CopyStr(DialogText + Location2.GetRequirementText(Location2.FieldNo("Require Put-away")), 1, MaxStrLen(DialogText));
- end;
- end;
-
- if (("Document Type" = "Document Type"::Order) and (Quantity < 0) and
- (Location2."Require Shipment" or Location2."Require Pick")) or
- (("Document Type" = "Document Type"::"Return Order") and (Quantity >= 0) and
- (Location2."Require Shipment" or Location2."Require Pick"))
- then begin
- if WhseValidateSourceLine.WhseLinesExist(
- Database::"Purchase Line", "Document Type".AsInteger(), "Document No.", "Line No.", 0, Quantity)
- then
- ShowDialog := ShowDialog::Error
- else
- if Location2."Require Shipment" then
- ShowDialog := ShowDialog::Message;
- if Location2."Require Shipment" then
- DialogText :=
- CopyStr(DialogText + Location2.GetRequirementText(Location2.FieldNo("Require Shipment")), 1, MaxStrLen(DialogText))
- else begin
- DialogText := Text034;
- DialogText :=
- CopyStr(DialogText + Location2.GetRequirementText(Location2.FieldNo("Require Pick")), 1, MaxStrLen(DialogText));
- end;
- end;
- end;
-
- OnCheckWarehouseOnBeforeShowDialog(Rec, Location2, ShowDialog, DialogText);
- case ShowDialog of
- ShowDialog::Message:
- Message(WhseRequirementMsg, DialogText);
- ShowDialog::Error:
- Error(Text016, DialogText, FieldCaption("Line No."), "Line No.")
- end;
- end;
-
- HandleDedicatedBin(true);
- end;
-
- ///
- /// Calculates the overhead rate in foreign currency for the purchase line.
- ///
- /// Overhead rate in foreign currency.
- protected procedure GetOverheadRateFCY() Result: Decimal
- var
- Item: Record Item;
- QtyPerUOM: Decimal;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetOverheadRateFCY(Rec, QtyPerUOM, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if not IsProdOrder() then
- QtyPerUOM := "Qty. per Unit of Measure"
- else begin
- GetItem(Item);
- QtyPerUOM := UOMMgt.GetQtyPerUnitOfMeasure(Item, "Unit of Measure Code");
- end;
- OnAfterGetQtyPerUOM(QtyPerUOM);
-
- exit(
- CurrExchRate.ExchangeAmtLCYToFCY(
- GetDate(), "Currency Code", "Overhead Rate" * QtyPerUOM, PurchHeader."Currency Factor"));
- end;
-
- ///
- /// Gets the translation of an item's description based on the language code of the purchase header
- /// and updates the description fields of the purchase line.
- ///
- procedure GetItemTranslation()
- var
- ItemTranslation: Record "Item Translation";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetItemTranslation(Rec, IsHandled);
- if IsHandled then
- exit;
-
- GetPurchHeader();
- if ItemTranslation.Get("No.", "Variant Code", PurchHeader."Language Code") then begin
- Description := ItemTranslation.Description;
- "Description 2" := ItemTranslation."Description 2";
- OnAfterGetItemTranslation(Rec, PurchHeader, ItemTranslation);
- end;
- end;
-
- local procedure GetGLSetup()
- begin
- if not GLSetupRead then
- GLSetup.Get();
- GLSetupRead := true;
- end;
-
- local procedure GetPurchSetup()
- begin
- if not PurchSetupRead then
- PurchSetup.Get();
- PurchSetupRead := true;
-
- OnAfterGetPurchSetup(Rec, PurchSetup);
- end;
-
- ///
- /// Formats a date formula parameter and returns it as a text.
- ///
- /// Date formula to adjust.
- /// Formated date formula as text.
- procedure AdjustDateFormula(DateFormulatoAdjust: DateFormula): Text[30]
- begin
- if Format(DateFormulatoAdjust) <> '' then
- exit(Format(DateFormulatoAdjust));
- Evaluate(DateFormulatoAdjust, '<0D>');
- exit(Format(DateFormulatoAdjust));
- end;
-
- local procedure GetLocation(LocationCode: Code[10])
- begin
- if LocationCode = '' then
- Clear(Location)
- else
- if Location.Code <> LocationCode then
- Location.Get(LocationCode);
- end;
-
- ///
- /// Generates a unique identifier text for a purchase line record which is used for item tracking or drop shipment creation.
- ///
- /// Generated text
- procedure RowID1(): Text[250]
- var
- ItemTrackingMgt: Codeunit "Item Tracking Management";
- begin
- exit(
- ItemTrackingMgt.ComposeRowID(
- Database::"Purchase Line", "Document Type".AsInteger(), "Document No.", '', 0, "Line No."));
- end;
-
- local procedure GetDefaultBin()
- var
- WMSManagement: Codeunit "WMS Management";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetDefaultBin(Rec, IsHandled, xRec);
- if IsHandled then
- exit;
-
- if (Type <> Type::Item) or IsNonInventoriableItem() then
- exit;
-
- "Bin Code" := '';
- if "Drop Shipment" then
- exit;
-
- if ("Location Code" <> '') and ("No." <> '') then begin
- GetLocation("Location Code");
- if Location."Bin Mandatory" and not Location."Directed Put-away and Pick" then begin
- WMSManagement.GetDefaultBin("No.", "Variant Code", "Location Code", "Bin Code");
- HandleDedicatedBin(false);
- end;
- end;
-
- OnAfterGetDefaultBin(Rec);
- end;
-
- ///
- /// Determines if a purchase line is inbound based on the document type and quantity.
- ///
- /// True if purchase line is inbound, otherwise false.
- procedure IsInbound(): Boolean
- var
- IsInboundDocument: Boolean;
- begin
- case "Document Type" of
- "Document Type"::Order, "Document Type"::Invoice, "Document Type"::Quote, "Document Type"::"Blanket Order":
- exit("Quantity (Base)" > 0);
- "Document Type"::"Return Order", "Document Type"::"Credit Memo":
- exit("Quantity (Base)" < 0);
- end;
-
- IsInboundDocument := false;
- OnAfterIsInbound(Rec, IsInboundDocument);
- exit(IsInboundDocument);
- end;
-
- local procedure HandleDedicatedBin(IssueWarning: Boolean)
- var
- WhseIntegrationMgt: Codeunit "Whse. Integration Management";
- begin
- OnBeforeHandleDedicatedBin(Rec, xRec, IssueWarning);
- if not IsInbound() and ("Quantity (Base)" <> 0) then
- WhseIntegrationMgt.CheckIfBinDedicatedOnSrcDoc("Location Code", "Bin Code", IssueWarning);
- end;
-
- local procedure VerifyLineTypeForJob()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeVerifyLineTypeForJob(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if not (Type in [Type::Item, Type::"G/L Account"]) then
- FieldError("Job No.", StrSubstNo(MustNotBeSpecifiedErr, FieldCaption(Type), Type));
- end;
-
- ///
- /// Checks if an item with a given item number exists in the Item table, but only if the type of the purchase line is item.
- ///
- /// Item number to check.
- /// True if the item exists, otherwise false.
- procedure ItemExists(ItemNo: Code[20]): Boolean
- var
- Item2: Record Item;
- begin
- if Type = Type::Item then
- if not Item2.Get(ItemNo) then
- exit(false);
- exit(true);
- end;
-
- ///
- /// Finds or creates a record by a given number and returns the number of the found or created record.
- ///
- /// A record number to find or create.
- /// Number of the found or newly created record.
- procedure FindOrCreateRecordByNo(SourceNo: Code[20]): Code[20]
- var
- Item: Record Item;
- FindRecordManagement: Codeunit "Find Record Management";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeFindOrCreateRecordByNo(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit("No.");
-
- GetPurchSetup();
-
- if (SourceNo = '') then
- exit('');
- if Type = Type::Item then
- exit(Item.GetFirstItemNoFromLookup(SourceNo))
- else
- exit(FindRecordManagement.FindNoFromTypedValue(Type.AsInteger(), "No.", not "System-Created Entry"));
-
- exit(SourceNo);
- end;
-
- ///
- /// Returns smaller absolute value between QtyToHandle and QtyHandled to ensure that the quantity being handled
- /// does not exceed the quantity that is available to handle.
- ///
- /// Quantity to handle value.
- /// Quantity handled value.
- /// Smaller absolute value.
- procedure GetAbsMin(QtyToHandle: Decimal; QtyHandled: Decimal) Result: Decimal
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetAbsMin(Rec, QtyToHandle, QtyHandled, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if Abs(QtyHandled) < Abs(QtyToHandle) then
- exit(QtyHandled);
-
- exit(QtyToHandle);
- end;
-
- local procedure CheckApplToItemLedgEntry() Result: Code[10]
- var
- ItemLedgEntry: Record "Item Ledger Entry";
- ApplyRec: Record "Item Application Entry";
- ReturnedQty: Decimal;
- RemainingtobeReturnedQty: Decimal;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckApplToItemLedgEntry(Rec, ItemLedgEntry, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if "Appl.-to Item Entry" = 0 then
- exit;
-
- if IsMatchedToReceiptOrOrder() then
- exit;
-
- TestField(Type, Type::Item);
- TestField(Quantity);
- if Signed(Quantity) > 0 then
- TestProdOrderNo();
- if IsCreditDocType() then begin
- if Quantity < 0 then
- FieldError(Quantity, Text029);
- end else
- if Quantity > 0 then
- FieldError(Quantity, Text030);
- ItemLedgEntry.Get("Appl.-to Item Entry");
- ItemLedgEntry.TestField(Positive, true);
- ItemLedgEntry.CheckTrackingDoesNotExist(RecordId, FieldCaption("Appl.-to Item Entry"));
-
- ItemLedgEntry.TestField("Item No.", "No.");
- ItemLedgEntry.TestField("Variant Code", "Variant Code");
-
- // Track qty in both alternative and base UOM for better error checking and reporting
- if Abs("Quantity (Base)") > ItemLedgEntry.Quantity then
- Error(
- Text042,
- ItemLedgEntry.Quantity, ItemLedgEntry.FieldCaption("Document No."),
- ItemLedgEntry."Document No.");
-
- if IsCreditDocType() then
- if Abs("Outstanding Qty. (Base)") > ItemLedgEntry."Remaining Quantity" then begin
- ReturnedQty := ApplyRec.Returned(ItemLedgEntry."Entry No.");
- RemainingtobeReturnedQty := ItemLedgEntry.Quantity - ReturnedQty;
- if not ("Qty. per Unit of Measure" = 0) then begin
- ReturnedQty := Round(ReturnedQty / "Qty. per Unit of Measure", UOMMgt.QtyRndPrecision());
- RemainingtobeReturnedQty := Round(RemainingtobeReturnedQty / "Qty. per Unit of Measure", UOMMgt.QtyRndPrecision());
- end;
-
- if ((("Qty. per Unit of Measure" = 0) and (RemainingtobeReturnedQty < Abs("Outstanding Qty. (Base)"))) or
- (("Qty. per Unit of Measure" <> 0) and (RemainingtobeReturnedQty < Abs("Outstanding Quantity"))))
- then
- Error(
- Text035,
- ReturnedQty, ItemLedgEntry.FieldCaption("Document No."),
- ItemLedgEntry."Document No.", RemainingtobeReturnedQty);
- end;
-
- exit(ItemLedgEntry."Location Code");
- end;
-
- ///
- /// Updates prepayment amount to deduct of the purchase line.
- ///
- procedure CalcPrepaymentToDeduct()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCalcPrepaymentToDeduct(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if ("Qty. to Invoice" <> 0) and ("Prepmt. Amt. Inv." <> 0) then begin
- GetPurchHeader();
- if ("Prepayment %" = 100) and not IsFinalInvoice() then
- "Prepmt Amt to Deduct" := GetLineAmountToHandle("Qty. to Invoice") - "Inv. Disc. Amount to Invoice"
- else
- "Prepmt Amt to Deduct" :=
- Round(
- ("Prepmt. Amt. Inv." - "Prepmt Amt Deducted") *
- "Qty. to Invoice" / (Quantity - "Quantity Invoiced"), Currency."Amount Rounding Precision")
- end else
- "Prepmt Amt to Deduct" := 0
- end;
-
- ///
- /// Determines if the current purchase line is the final invoice based on the quantity and quantity to invoice.
- ///
- /// True if it is a final invoice, otherwise false.
- procedure IsFinalInvoice(): Boolean
- begin
- exit("Qty. to Invoice" = Quantity - "Quantity Invoiced");
- end;
-
- ///
- /// Calculates the line amount to handle for a purchase line based on the quantity to handle.
- ///
- ///
- /// Calculated line amount includes the line discount amount.
- ///
- /// Quantity to handle.
- /// Calculated line amount to handle.
- procedure GetLineAmountToHandle(QtyToHandle: Decimal): Decimal
- var
- LineAmount: Decimal;
- LineDiscAmount: Decimal;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetLineAmountToHandle(Rec, Currency, QtyToHandle, LineAmount, LineDiscAmount, IsHandled);
- if IsHandled then
- exit(LineAmount - LineDiscAmount);
-
- if "Line Discount %" = 100 then
- exit(0);
-
- GetPurchHeader();
-
- if "Prepmt Amt to Deduct" = 0 then
- LineAmount := Round(QtyToHandle * "Direct Unit Cost", Currency."Amount Rounding Precision")
- else
- if Quantity <> 0 then begin
- LineAmount := Round(Quantity * "Direct Unit Cost", Currency."Amount Rounding Precision");
- LineAmount := Round(QtyToHandle * LineAmount / Quantity, Currency."Amount Rounding Precision");
- end else
- LineAmount := 0;
-
- if QtyToHandle <> Quantity then
- LineDiscAmount := Round(LineAmount * "Line Discount %" / 100, Currency."Amount Rounding Precision")
- else
- LineDiscAmount := "Line Discount Amount";
-
- OnAfterGetLineAmountToHandle(Rec, QtyToHandle, LineAmount, LineDiscAmount);
- exit(LineAmount - LineDiscAmount);
- end;
-
- ///
- /// Returns the line amount to handle for a purchase line, including prepayment.
- ///
- ///
- /// Prepayment amounts are included in the calculations only if purchase line has to be fully prepaid.
- ///
- /// Quantity to handle.
- /// Calculated line amount to handle.
- procedure GetLineAmountToHandleInclPrepmt(QtyToHandle: Decimal): Decimal
- var
- PurchasePostPrepayments: Codeunit "Purchase-Post Prepayments";
- DocType: Option Invoice,"Credit Memo",Statistic;
- begin
- if "Line Discount %" = 100 then
- exit(0);
-
- if IsCreditDocType() then
- DocType := DocType::"Credit Memo"
- else
- DocType := DocType::Invoice;
-
- if ("Prepayment %" = 100) and not "Prepayment Line" and ("Prepmt Amt to Deduct" <> 0) then
- if PurchasePostPrepayments.PrepmtAmount(Rec, DocType) <= 0 then
- exit("Prepmt Amt to Deduct" + "Inv. Disc. Amount to Invoice");
- exit(GetLineAmountToHandle(QtyToHandle));
- end;
-
- ///
- /// Determines if the purchase line has a job task set.
- ///
- ///
- /// If job task is set, then journal lines can be created.
- ///
- /// True if the job task is set, otherwise false.
- procedure JobTaskIsSet(): Boolean
- var
- JobTaskSet: Boolean;
- begin
- JobTaskSet := ("Job No." <> '') and ("Job Task No." <> '') and (Type in [Type::"G/L Account", Type::Item]);
- OnBeforeJobTaskIsSet(Rec, JobTaskSet);
- exit(JobTaskSet);
- end;
-
- ///
- /// Creates a temporary global job journal line based on the purchase line.
- ///
- ///
- /// If true, it recalculates amounts from unit cost of the purchase line,
- /// otherwise it sets the amounts directly from the purchase line.
- ///
- procedure CreateTempJobJnlLine(GetPrices: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateTempJobJnlLine(TempJobJnlLine, Rec, xRec, GetPrices, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- GetPurchHeader();
- Clear(TempJobJnlLine);
- TempJobJnlLine.DontCheckStdCost();
- TempJobJnlLine.Validate("Job No.", "Job No.");
- TempJobJnlLine.Validate("Job Task No.", "Job Task No.");
- TempJobJnlLine.Validate("Posting Date", PurchHeader."Posting Date");
- TempJobJnlLine.SetCurrencyFactor("Job Currency Factor");
- if Type = Type::"G/L Account" then
- TempJobJnlLine.Validate(Type, TempJobJnlLine.Type::"G/L Account")
- else
- TempJobJnlLine.Validate(Type, TempJobJnlLine.Type::Item);
- OnCreateTempJobJnlLineOnBeforeTempJobJnlLineValidateNo(TempJobJnlLine, Rec);
- TempJobJnlLine.Validate("No.", "No.");
- TempJobJnlLine.Validate(Quantity, Quantity);
- TempJobJnlLine.Validate("Variant Code", "Variant Code");
- TempJobJnlLine.Validate("Unit of Measure Code", "Unit of Measure Code");
-
- if not GetPrices then begin
- if xRec."Line No." <> 0 then begin
- TempJobJnlLine."Unit Cost" := xRec."Unit Cost";
- TempJobJnlLine."Unit Cost (LCY)" := xRec."Unit Cost (LCY)";
- TempJobJnlLine."Unit Price" := xRec."Job Unit Price";
- TempJobJnlLine."Line Amount" := xRec."Job Line Amount";
- TempJobJnlLine."Line Discount %" := xRec."Job Line Discount %";
- TempJobJnlLine."Line Discount Amount" := xRec."Job Line Discount Amount";
- end else begin
- TempJobJnlLine."Unit Cost" := "Unit Cost";
- TempJobJnlLine."Unit Cost (LCY)" := "Unit Cost (LCY)";
- TempJobJnlLine."Unit Price" := "Job Unit Price";
- TempJobJnlLine."Line Amount" := "Job Line Amount";
- TempJobJnlLine."Line Discount %" := "Job Line Discount %";
- TempJobJnlLine."Line Discount Amount" := "Job Line Discount Amount";
- end;
- TempJobJnlLine.Validate("Unit Price");
- end else
- TempJobJnlLine.Validate("Unit Cost (LCY)", "Unit Cost (LCY)");
-
- OnAfterCreateTempJobJnlLine(TempJobJnlLine, Rec, xRec, GetPrices, CurrFieldNo);
- end;
-
- ///
- /// Updates the job prices in the purchase line record based on the purchase receipt line,
- /// or the global job journal line if receipt line doesn't exist.
- ///
- procedure UpdateJobPrices()
- var
- PurchRcptLine: Record "Purch. Rcpt. Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateJobPrices(Rec, TempJobJnlLine, PurchRcptLine, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- if "Receipt No." = '' then begin
- "Job Unit Price" := TempJobJnlLine."Unit Price";
- "Job Total Price" := TempJobJnlLine."Total Price";
- "Job Unit Price (LCY)" := TempJobJnlLine."Unit Price (LCY)";
- "Job Total Price (LCY)" := TempJobJnlLine."Total Price (LCY)";
- "Job Line Amount (LCY)" := TempJobJnlLine."Line Amount (LCY)";
- "Job Line Disc. Amount (LCY)" := TempJobJnlLine."Line Discount Amount (LCY)";
- "Job Line Amount" := TempJobJnlLine."Line Amount";
- "Job Line Discount %" := TempJobJnlLine."Line Discount %";
- "Job Line Discount Amount" := TempJobJnlLine."Line Discount Amount";
- end else begin
- PurchRcptLine.Get("Receipt No.", "Receipt Line No.");
- "Job Unit Price" := PurchRcptLine."Job Unit Price";
- "Job Total Price" := PurchRcptLine."Job Total Price";
- "Job Unit Price (LCY)" := PurchRcptLine."Job Unit Price (LCY)";
- "Job Total Price (LCY)" := PurchRcptLine."Job Total Price (LCY)";
- "Job Line Amount (LCY)" := PurchRcptLine."Job Line Amount (LCY)";
- "Job Line Disc. Amount (LCY)" := PurchRcptLine."Job Line Disc. Amount (LCY)";
- "Job Line Amount" := PurchRcptLine."Job Line Amount";
- "Job Line Discount %" := PurchRcptLine."Job Line Discount %";
- "Job Line Discount Amount" := PurchRcptLine."Job Line Discount Amount";
- end;
-
- OnAfterUpdateJobPrices(Rec, TempJobJnlLine, PurchRcptLine);
- end;
-
- ///
- /// Updates the job currency factor from the temporary global job journal line.
- ///
- procedure JobSetCurrencyFactor()
- var
- IsHandled: Boolean;
- begin
- GetPurchHeader();
- IsHandled := false;
- OnBeforeJobSetCurrencyFactor(Rec, IsHandled);
- if IsHandled then
- exit;
-
- Clear(TempJobJnlLine);
- TempJobJnlLine.Validate("Job No.", "Job No.");
- TempJobJnlLine.Validate("Job Task No.", "Job Task No.");
- TempJobJnlLine.Validate("Posting Date", PurchHeader."Posting Date");
- "Job Currency Factor" := TempJobJnlLine."Currency Factor";
- end;
-
- ///
- /// Sets the value of the global variable UpdateFromVAT.
- ///
- /// The new value to set.
- procedure SetUpdateFromVAT(UpdateFromVAT2: Boolean)
- begin
- UpdateFromVAT := UpdateFromVAT2;
- end;
-
- ///
- /// Initializes the quantity to receive and invoice.
- /// Additionally, claculates the invoice discount and prepayment amounts.
- ///
- procedure InitQtyToReceive2()
- begin
- "Qty. to Receive" := "Outstanding Quantity";
- "Qty. to Receive (Base)" := "Outstanding Qty. (Base)";
-
- OnAfterInitQtyToReceive2(Rec, CurrFieldNo);
-
- "Qty. to Invoice" := MaxQtyToInvoice();
- "Qty. to Invoice (Base)" := MaxQtyToInvoiceBase();
- "VAT Difference" := 0;
- NonDeductibleVAT.InitNonDeductibleVATDiff(Rec);
-
- OnInitQtyToReceive2OnBeforeCalcInvDiscToInvoice(Rec, xRec);
-
- CalcInvDiscToInvoice();
-
- CalcPrepaymentToDeduct();
-
- if "Job Planning Line No." <> 0 then
- Validate("Job Planning Line No.");
-
- OnAfterInitQtyToReceive2Procedure(Rec);
- end;
-
- ///
- /// Toggles the filter for lines with errors between displaying all lines and only lines with errors.
- ///
- ///
- /// Return value: A toggle for showing all lines or just lines with errors. After switching the filter,
- /// the toggle is returned with the opposite value.
- ///
- procedure SwitchLinesWithErrorsFilter(var ShowAllLinesEnabled: Boolean)
- var
- TempLineErrorMessage: Record "Error Message" temporary;
- DocumentErrorsMgt: Codeunit "Document Errors Mgt.";
- begin
- if ShowAllLinesEnabled then begin
- MarkedOnly(false);
- ShowAllLinesEnabled := false;
- end else begin
- DocumentErrorsMgt.GetErrorMessages(TempLineErrorMessage);
- if TempLineErrorMessage.FindSet() then
- repeat
- if Rec.Get(TempLineErrorMessage."Context Record ID") then
- Rec.Mark(true)
- until TempLineErrorMessage.Next() = 0;
- MarkedOnly(true);
- ShowAllLinesEnabled := true;
- end;
- end;
-
- ///
- /// Resets qty. to receive values to zero if the document type is an order and the purchase setup has default qty. to receive blank.
- ///
- procedure ClearQtyIfBlank()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeClearQtyIfBlank(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "Document Type" = "Document Type"::Order then begin
- GetPurchSetup();
- if PurchSetup."Default Qty. to Receive" = PurchSetup."Default Qty. to Receive"::Blank then begin
- "Qty. to Receive" := 0;
- "Qty. to Receive (Base)" := 0;
- end;
- end;
- OnAfterClearQtyIfBlank(Rec, xRec, PurchSetup);
- end;
-
- ///
- /// Opens a page to show comments for the purchase line.
- ///
- procedure ShowLineComments()
- var
- PurchCommentLine: Record "Purch. Comment Line";
- begin
- TestField("Document No.");
- TestField("Line No.");
- PurchCommentLine.ShowComments("Document Type".AsInteger(), "Document No.", "Line No.");
- end;
-
- ///
- /// Resets quantities to receive/return and invoice to zero based on the purchase setup setting for default qty. to receive.
- ///
- procedure SetDefaultQuantity()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetDefaultQuantity(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- GetPurchSetup();
- if PurchSetup."Default Qty. to Receive" = PurchSetup."Default Qty. to Receive"::Blank then begin
- if (("Document Type" = "Document Type"::Order) and ("Over-Receipt Quantity" = 0)) or ("Document Type" = "Document Type"::Quote) then begin
- "Qty. to Receive" := 0;
- "Qty. to Receive (Base)" := 0;
- "Qty. to Invoice" := 0;
- "Qty. to Invoice (Base)" := 0;
- end;
- if "Document Type" = "Document Type"::"Return Order" then begin
- "Return Qty. to Ship" := 0;
- "Return Qty. to Ship (Base)" := 0;
- "Qty. to Invoice" := 0;
- "Qty. to Invoice (Base)" := 0;
- end;
- end;
-
- OnAfterSetDefaultQuantity(Rec, xRec);
- end;
-
- local procedure SetDefaultGLAccountQuantity()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetDefaultGLAccountQuantity(Rec, IsHandled);
- if IsHandled then
- exit;
-
- GetPurchSetup();
- if PurchSetup."Default G/L Account Quantity" then
- Validate(Quantity, 1);
- end;
-
- local procedure QuantityDefaultedFromGLAccount(): Boolean
- begin
- if Rec.Type <> Rec.Type::"G/L Account" then
- exit(false);
- GetPurchSetup();
- exit(PurchSetup."Default G/L Account Quantity");
- end;
-
- ///
- /// Recalculates prepayment amounts to reflect changes in quantity.
- ///
- ///
- /// If the document type in not an invoice or the prepayment percentage is 0, the prepayment amounts are not updated.
- ///
- procedure UpdatePrePaymentAmounts()
- var
- ReceiptLine: Record "Purch. Rcpt. Line";
- PurchOrderLine: Record "Purchase Line";
- PurchOrderHeader: Record "Purchase Header";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdatePrepmtAmounts(Rec, PurchHeader, IsHandled, CurrFieldNo);
- if IsHandled then
- exit;
-
- if ("Document Type" <> "Document Type"::Invoice) or ("Prepayment %" = 0) then
- exit;
-
- if not ReceiptLine.Get("Receipt No.", "Receipt Line No.") then begin
- "Prepmt Amt to Deduct" := 0;
- "Prepmt VAT Diff. to Deduct" := 0;
- end else
- if PurchOrderLine.Get(PurchOrderLine."Document Type"::Order, ReceiptLine."Order No.", ReceiptLine."Order Line No.") then begin
- if ("Prepayment %" = 100) and (Quantity <> PurchOrderLine.Quantity - PurchOrderLine."Quantity Invoiced") then
- "Prepmt Amt to Deduct" := GetLineAmountToHandle(Quantity) - "Inv. Disc. Amount to Invoice"
- else
- "Prepmt Amt to Deduct" :=
- Round((PurchOrderLine."Prepmt. Amt. Inv." - PurchOrderLine."Prepmt Amt Deducted") *
- Quantity / (PurchOrderLine.Quantity - PurchOrderLine."Quantity Invoiced"), Currency."Amount Rounding Precision");
- "Prepmt VAT Diff. to Deduct" := "Prepayment VAT Difference" - "Prepmt VAT Diff. Deducted";
- PurchOrderHeader.Get(PurchOrderHeader."Document Type"::Order, PurchOrderLine."Document No.");
- end else begin
- "Prepmt Amt to Deduct" := 0;
- "Prepmt VAT Diff. to Deduct" := 0;
- end;
-
- GetPurchHeader();
- PurchHeader.TestField("Prices Including VAT", PurchOrderHeader."Prices Including VAT");
- if PurchHeader."Prices Including VAT" then begin
- "Prepmt. Amt. Incl. VAT" := "Prepmt Amt to Deduct";
- "Prepayment Amount" :=
- Round(
- "Prepmt Amt to Deduct" / (1 + ("Prepayment VAT %" / 100)),
- Currency."Amount Rounding Precision");
- end else begin
- "Prepmt. Amt. Incl. VAT" :=
- Round(
- "Prepmt Amt to Deduct" * (1 + ("Prepayment VAT %" / 100)),
- Currency."Amount Rounding Precision");
- "Prepayment Amount" := "Prepmt Amt to Deduct";
- end;
- "Prepmt. Line Amount" := "Prepmt Amt to Deduct";
- "Prepmt. Amt. Inv." := "Prepmt. Line Amount";
- "Prepmt. VAT Base Amt." := "Prepayment Amount";
- "Prepmt. Amount Inv. Incl. VAT" := "Prepmt. Amt. Incl. VAT";
- "Prepmt Amt Deducted" := 0;
-
- OnAfterUpdatePrePaymentAmounts(Rec);
- end;
-
- local procedure SetUnitOfMeasure()
- var
- UnitOfMeasureTranslation: Record "Unit of Measure Translation";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetUnitOfMeasure(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "Unit of Measure Code" = '' then
- "Unit of Measure" := ''
- else begin
- UnitOfMeasure.Get("Unit of Measure Code");
- "Unit of Measure" := UnitOfMeasure.Description;
- GetPurchHeader();
- if PurchHeader."Language Code" <> '' then begin
- UnitOfMeasureTranslation.SetRange(Code, "Unit of Measure Code");
- UnitOfMeasureTranslation.SetRange("Language Code", PurchHeader."Language Code");
- if UnitOfMeasureTranslation.FindFirst() then
- "Unit of Measure" := UnitOfMeasureTranslation.Description;
- end;
- end;
- end;
-
- ///
- /// Sets the vendor item number for the purchase line.
- ///
- procedure SetVendorItemNo()
- var
- Item: Record Item;
- ItemVend: Record "Item Vendor";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetVendorItemNo(Rec, IsHandled);
- if IsHandled then
- exit;
-
- GetItem(Item);
- ItemVend.Init();
- ItemVend."Vendor No." := "Buy-from Vendor No.";
- ItemVend."Variant Code" := "Variant Code";
- Item.FindItemVend(ItemVend, "Location Code");
- Validate("Vendor Item No.", ItemVend."Vendor Item No.");
- OnAfterSetVendorItemNo(Rec, ItemVend, Item);
- end;
-
- ///
- /// Determines if the line has a zero amount. It always returns true for a line with a blank type.
- ///
- ///
- /// The type of quantity to check.
- /// Only Invoicing option makes a difference by checking if quantity to invoice is zero, other options are ignored.
- ///
- /// True if the line has a zero amount, otherwise false.
- procedure ZeroAmountLine(QtyType: Option General,Invoicing,Shipping) Result: Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeZeroAmountLine(Rec, QtyType, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if Type = Type::" " then
- exit(true);
- if Quantity = 0 then
- exit(true);
- if "Direct Unit Cost" = 0 then
- exit(true);
- if QtyType = QtyType::Invoicing then
- if "Qty. to Invoice" = 0 then
- exit(true);
- exit(false);
- end;
-
- ///
- /// Sets filters on the purchase line for item lines, a specified document type, and various flow filters set in the provided item record.
- ///
- /// Item record to filter the purchase lines with.
- /// The document type to filter the purchase lines with.
- procedure FilterLinesWithItemToPlan(var Item: Record Item; DocumentType: Enum "Purchase Document Type")
- begin
- Reset();
- SetCurrentKey("Document Type", Type, "No.", "Variant Code", "Drop Shipment", "Location Code", "Expected Receipt Date");
- SetRange("Document Type", DocumentType);
- SetRange(Type, Type::Item);
- SetRange("No.", Item."No.");
- SetFilter("Variant Code", Item.GetFilter("Variant Filter"));
- SetFilter("Location Code", Item.GetFilter("Location Filter"));
- SetFilter("Drop Shipment", Item.GetFilter("Drop Shipment Filter"));
- SetFilter("Expected Receipt Date", Item.GetFilter("Date Filter"));
- SetFilter("Shortcut Dimension 1 Code", Item.GetFilter("Global Dimension 1 Filter"));
- SetFilter("Shortcut Dimension 2 Code", Item.GetFilter("Global Dimension 2 Filter"));
- SetFilter("Outstanding Qty. (Base)", '<>0');
- SetFilter("Unit of Measure Code", Item.GetFilter("Unit of Measure Filter"));
-
- OnAfterFilterLinesWithItemToPlan(Rec, Item, DocumentType.AsInteger());
- end;
-
- ///
- /// Retrieves a record set of item purchase lines that match the provided document type and various filters set on the item.
- ///
- /// Item record to filter the purchase lines with.
- /// The document type to filter the purchase lines with.
- /// True if any purchase line was found, otherwise false.
- procedure FindLinesWithItemToPlan(var Item: Record Item; DocumentType: Enum "Purchase Document Type"): Boolean
- begin
- FilterLinesWithItemToPlan(Item, DocumentType);
- exit(Find('-'));
- end;
-
- ///
- /// Determines if any purchase lines exist that match the provided document type and various flow filters set on the item.
- ///
- /// Item record to filter the purchase lines with.
- /// The document type to filter the purchase lines with.
- /// True if any purchase lines exist, otherwise false.
- procedure LinesWithItemToPlanExist(var Item: Record Item; DocumentType: Enum "Purchase Document Type"): Boolean
- begin
- FilterLinesWithItemToPlan(Item, DocumentType);
- exit(not IsEmpty);
- end;
-
- ///
- /// Sets filters on the purchase line for item lines that match the provided reservation entry.
- ///
- /// Reservation entry to filter the purchase lines with.
- /// The document type to filter the purchase lines with.
- /// Date filter to apply to the expected receipt date field.
- /// A flag to determine if the quantity (base) filter should be positive or negative.
- procedure FilterLinesForReservation(ReservationEntry: Record "Reservation Entry"; DocumentType: Enum "Purchase Document Type"; AvailabilityFilter: Text; Positive: Boolean)
- var
- IsHandled: Boolean;
- begin
- Reset();
- SetCurrentKey(
- "Document Type", Type, "No.", "Variant Code", "Drop Shipment", "Location Code", "Expected Receipt Date");
- SetRange("Document Type", DocumentType);
- SetRange(Type, Type::Item);
- SetRange("No.", ReservationEntry."Item No.");
- IsHandled := false;
- OnFilterLinesForReservationOnBeforeSetFilterVariantCode(Rec, ReservationEntry, Positive, IsHandled);
- if not IsHandled then
- SetRange("Variant Code", ReservationEntry."Variant Code");
- SetRange("Drop Shipment", false);
- SetRange("Location Code", ReservationEntry."Location Code");
- SetFilter("Expected Receipt Date", AvailabilityFilter);
- if Positive and (DocumentType <> "Document Type"::"Return Order") then
- SetFilter("Quantity (Base)", '>0')
- else
- SetFilter("Quantity (Base)", '<0');
- SetRange("Job No.", ' ');
-
- OnAfterFilterLinesForReservation(Rec, ReservationEntry, DocumentType, AvailabilityFilter, Positive);
- end;
-
- ///
- /// Retrieves the invoice rounding account number from the vendor posting group associated with the purchase header.
- ///
- /// Purchase header to filter from.
- /// Invoice rounding account number from the vendor posting group.
- procedure GetVPGInvRoundAcc(var PurchHeader: Record "Purchase Header") AccountNo: Code[20]
- var
- Vendor: Record Vendor;
- VendorPostingGroup: Record "Vendor Posting Group";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetVPGInvRoundAcc(PurchHeader, Vendor, AccountNo, IsHandled);
- if IsHandled then
- exit(AccountNo);
-
- GetPurchSetup();
- if PurchSetup."Invoice Rounding" then
- if Vendor.Get(PurchHeader."Pay-to Vendor No.") then
- VendorPostingGroup.Get(Vendor."Vendor Posting Group");
-
- exit(VendorPostingGroup."Invoice Rounding Account");
- end;
-
- local procedure CheckReceiptRelation()
- var
- PurchRcptLine: Record "Purch. Rcpt. Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckReceiptRelation(Rec, IsHandled);
- if IsHandled then
- exit;
-
- PurchRcptLine.Get("Receipt No.", "Receipt Line No.");
- if (Quantity * PurchRcptLine."Qty. Rcd. Not Invoiced") < 0 then
- FieldError("Qty. to Invoice", Text051);
- if Abs(Quantity) > Abs(PurchRcptLine."Qty. Rcd. Not Invoiced") then
- Error(Text052, PurchRcptLine."Document No.");
-
- OnAfterCheckReceiptRelation(Rec, PurchRcptLine);
- end;
-
- local procedure CheckRetShptRelation()
- var
- ReturnShptLine: Record "Return Shipment Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckRetShptRelation(Rec, IsHandled);
- if IsHandled then
- exit;
-
- ReturnShptLine.Get("Return Shipment No.", "Return Shipment Line No.");
- if (Quantity * (ReturnShptLine.Quantity - ReturnShptLine."Quantity Invoiced")) < 0 then
- FieldError("Qty. to Invoice", Text053);
- if Abs(Quantity) > Abs(ReturnShptLine.Quantity - ReturnShptLine."Quantity Invoiced") then
- Error(Text054, ReturnShptLine."Document No.");
-
- OnAfterCheckRetShptRelation(Rec, ReturnShptLine);
- end;
-
- local procedure VerifyItemLineDim()
- begin
- if IsReceivedShippedItemDimChanged() then
- ConfirmReceivedShippedItemDimChange();
- end;
-
- ///
- /// Determines if the dimensions have changed on an already received or shipped item line.
- ///
- /// True if the dimensions have changed, otherwise false.
- procedure IsReceivedShippedItemDimChanged(): Boolean
- begin
- exit(("Dimension Set ID" <> xRec."Dimension Set ID") and (Type = Type::Item) and
- (("Qty. Rcd. Not Invoiced" <> 0) or ("Return Qty. Shipped Not Invd." <> 0)));
- end;
-
- ///
- /// Checks if the purchase line is a service charge.
- ///
- /// True if the line is a service charge line, otherwise false.
- procedure IsServiceCharge(): Boolean
- var
- VendorPostingGroup: Record "Vendor Posting Group";
- ServiceCharged: Boolean;
- begin
- if Type <> Type::"G/L Account" then
- exit(false);
-
- GetPurchHeader();
- ServiceCharged := VendorPostingGroup.Get(PurchHeader."Vendor Posting Group");
- ServiceCharged := VendorPostingGroup."Service Charge Acc." = "No.";
- OnAfterIsServiceCharge(Rec, ServiceCharged);
- exit(ServiceCharged);
- end;
-
- ///
- /// Raises a confirmation dialog to confirm the change of dimensions on an already received or shipped item line.
- ///
- /// True if the user confirms the change, otherwise an error is thrown.
- procedure ConfirmReceivedShippedItemDimChange() Result: Boolean
- var
- ConfirmManagement: Codeunit "Confirm Management";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeConfirmReceivedShippedItemDimChange(Rec, IsHandled, Result);
- if IsHandled then
- exit(Result);
-
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text049, TableCaption), true) then
- Error(Text050);
-
- exit(true);
- end;
-
- ///
- /// Initializes the type of the purchase line.
- ///
- procedure InitType()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInitType(Rec, xRec, PurchHeader, IsHandled);
- if IsHandled then
- exit;
-
- if "Document No." <> '' then begin
- if not PurchHeader.Get("Document Type", "Document No.") then
- exit;
- if (PurchHeader.Status = PurchHeader.Status::Released) and
- (xRec.Type in [xRec.Type::Item, xRec.Type::"Fixed Asset"])
- then
- Type := Type::" "
- else
- Type := xRec.Type;
- end;
-
- OnAfterInitType(rec, xRec, PurchHeader);
- end;
-
- ///
- /// Returns the default document line type from the purchase setup if it is not blank.
- ///
- /// The document default line type from the purchase setup, otherwise blank.
- procedure GetDefaultLineType(): Enum "Purchase Line Type"
- begin
- GetPurchSetup();
- if PurchSetup."Document Default Line Type" <> PurchSetup."Document Default Line Type"::" " then
- exit(PurchSetup."Document Default Line Type");
- end;
-
- local procedure CheckWMS()
- begin
- if CurrFieldNo <> 0 then
- CheckLocationOnWMS();
- if "Document Type" = "Document Type"::"Return Order" then
- if ("Job No." <> '') and (Type = Type::Item) then
- if Location.Get("Location Code") then
- EnsureDirectedPutawayandPickFalse(Location);
- end;
-
- local procedure EnsureDirectedPutawayandPickFalse(var Location: Record Location)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeEnsureDirectedPutawayandPickFalse(Rec, Location, IsHandled);
- if IsHandled then
- exit;
-
- Location.TestField("Directed Put-away and Pick", false);
- end;
-
- ///
- /// Checks if the line has receipt/shipment when it's mandatory by the location, but only performs this check
- /// if the item in the line is inventoriable.
- ///
- procedure CheckLocationOnWMS()
- var
- DialogText: Text;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckLocationOnWMS(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if (Type = Type::Item) and IsInventoriableItem() then begin
- DialogText := Text033;
- if "Quantity (Base)" <> 0 then
- case "Document Type" of
- "Document Type"::Invoice:
- if not IsMatchedToReceiptOrOrder() then
- if Location.Get("Location Code") and Location."Directed Put-away and Pick" then begin
- DialogText += Location.GetRequirementText(Location.FieldNo("Require Receive"));
- Error(Text016, DialogText, FieldCaption("Line No."), "Line No.");
- end;
- "Document Type"::"Credit Memo":
- if "Return Shipment No." = '' then
- if Location.Get("Location Code") and Location."Directed Put-away and Pick" then begin
- DialogText += Location.GetRequirementText(Location.FieldNo("Require Shipment"));
- Error(Text016, DialogText, FieldCaption("Line No."), "Line No.");
- end;
- end;
- end;
- end;
-
- ///
- /// Determines if the line is a non-inventoriable item line.
- ///
- /// True if the line is a non-inventoriable item line, otherwise false.
- procedure IsNonInventoriableItem(): Boolean
- var
- Item: Record Item;
- begin
- if Type <> Type::Item then
- exit(false);
- if "No." = '' then
- exit(false);
- Item.SetLoadFields(Type);
- GetItem(Item);
- exit(Item.IsNonInventoriableType());
- end;
-
- ///
- /// Determines if the line is an inventoriable item line.
- ///
- /// True if the line is an inventoriable item line, otherwise false.
- procedure IsInventoriableItem(): Boolean
- var
- Item: Record Item;
- begin
- if Type <> Type::Item then
- exit(false);
- if "No." = '' then
- exit(false);
- Item.SetLoadFields(Type);
- GetItem(Item);
- exit(Item.IsInventoriableType());
- end;
-
- ///
- /// Determines if the line is an extended text line.
- ///
- /// True if the line is an extended text line, otherwise false.
- procedure IsExtendedText(): Boolean
- begin
- exit((Type = Type::" ") and ("Attached to Line No." <> 0) and (Quantity = 0));
- end;
-
- procedure IsSubcontractingCreditMemo() Result: Boolean
- begin
- OnIsSubcontractingCreditMemo(Rec, Result);
- end;
-
- ///
- /// Retrieves the journal template name if g/l setup has a journal template name mandatory field set to true.
- ///
- /// Journal template name if g/l setup has a journal template name mandatory field set to true.
- procedure GetJnlTemplateName(): Code[10]
- begin
- GLSetup.Get();
- if not GLSetup."Journal Templ. Name Mandatory" then
- exit('');
-
- if "IC Partner Code" = '' then begin
- GetPurchHeader();
- exit(PurchHeader."Journal Templ. Name");
- end;
-
- GetPurchSetup();
- if IsCreditDocType() then begin
- PurchSetup.TestField("IC Purch. Cr. Memo Templ. Name");
- exit(PurchSetup."IC Purch. Cr. Memo Templ. Name");
- end;
- PurchSetup.TestField("IC Purch. Invoice Templ. Name");
- exit(PurchSetup."IC Purch. Invoice Templ. Name");
- end;
-
- local procedure CheckReservationForJobNo(): Boolean
- var
- ReservEntry: Record "Reservation Entry";
- begin
- SetReservationFilters(ReservEntry);
- ReservEntry.SetRange(
- "Reservation Status", ReservEntry."Reservation Status"::Reservation, ReservEntry."Reservation Status"::Tracking);
- exit(not ReservEntry.IsEmpty);
- end;
-
- local procedure ValidateReturnReasonCode(CallingFieldNo: Integer)
- var
- ReturnReason: Record "Return Reason";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateReturnReasonCode(Rec, CallingFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- if CallingFieldNo = 0 then
- exit;
- if "Return Reason Code" = '' then
- PlanPriceCalcByField(CallingFieldNo);
-
- if ReturnReason.Get("Return Reason Code") then begin
- if (CallingFieldNo <> FieldNo("Location Code")) and (ReturnReason."Default Location Code" <> '') then
- Validate("Location Code", ReturnReason."Default Location Code");
- if ReturnReason."Inventory Value Zero" then
- Validate("Direct Unit Cost", 0)
- else
- PlanPriceCalcByField(CallingFieldNo);
- end;
- UpdateDirectUnitCostByField(CallingFieldNo);
- end;
-
- ///
- /// Updates the line discount percentage for the purchase line.
- /// Additionally, updates line, vat, prepayment and deferral amounts, initializes outstanding amounts and updates the unit cost.
- ///
- /// If true, invoice discount amounts will be set to 0.
- procedure ValidateLineDiscountPercent(DropInvoiceDiscountAmount: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateLineDiscountPercent(Rec, DropInvoiceDiscountAmount, IsHandled);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- IsHandled := false;
- OnValidateLineDiscountPercentOnAfterTestStatusOpen(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- GetPurchHeader();
- "Line Discount Amount" :=
- Round(
- Round(Quantity * "Direct Unit Cost", Currency."Amount Rounding Precision") *
- "Line Discount %" / 100,
- Currency."Amount Rounding Precision");
- if DropInvoiceDiscountAmount then begin
- "Inv. Discount Amount" := 0;
- "Inv. Disc. Amount to Invoice" := 0;
- end;
- OnValidateLineDiscountPercentOnBeforeUpdateAmounts(Rec);
- UpdateAmounts();
- UpdateUnitCost();
- end;
-
- local procedure NotifyOnMissingSetup(FieldNumber: Integer)
- var
- DiscountNotificationMgt: Codeunit "Discount Notification Mgt.";
- begin
- if CurrFieldNo = 0 then
- exit;
- GetPurchSetup();
- DiscountNotificationMgt.RecallNotification(PurchSetup.RecordId);
- if (FieldNumber = FieldNo("Line Discount Amount")) and ("Line Discount Amount" = 0) then
- exit;
- DiscountNotificationMgt.NotifyAboutMissingSetup(
- PurchSetup.RecordId, "Gen. Bus. Posting Group", "Gen. Prod. Posting Group",
- PurchSetup."Discount Posting", PurchSetup."Discount Posting"::"Invoice Discounts");
- end;
-
- local procedure UpdateDimensionsFromJobTask()
- var
- SourceCodeSetup: Record "Source Code Setup";
- DimSetArrID: array[10] of Integer;
- DimValue1: Code[20];
- DimValue2: Code[20];
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateDimensionsFromJobTask(Rec, CurrFieldNo, IsHandled);
- if not IsHandled then begin
- SourceCodeSetup.Get();
- DimSetArrID[1] := "Dimension Set ID";
- DimSetArrID[2] :=
- DimMgt.CreateDimSetFromJobTaskDim("Job No.",
- "Job Task No.", DimValue1, DimValue2);
- DimMgt.CreateDimForPurchLineWithHigherPriorities(
- Rec, CurrFieldNo, DimSetArrID[3], DimValue1, DimValue2, SourceCodeSetup.Purchases, Database::Job);
-
- "Dimension Set ID" :=
- DimMgt.GetCombinedDimensionSetID(
- DimSetArrID, DimValue1, DimValue2);
-
- "Shortcut Dimension 1 Code" := DimValue1;
- "Shortcut Dimension 2 Code" := DimValue2;
- end;
- OnAfterUpdateDimensionsFromJobTask(Rec);
- end;
-
- local procedure UpdateItemReference()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateItemReference(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- ItemReferenceMgt.EnterPurchaseItemReference(Rec);
-
- UpdateICPartner();
-
- if Type <> Type::Item then
- exit;
-
- UpdateVendorItemNoFromItemReference();
- end;
-
- local procedure UpdateVendorItemNoFromItemReference()
- begin
- if "Item Reference No." = '' then
- SetVendorItemNo()
- else
- Validate("Vendor Item No.", "Item Reference No.");
- OnAfterUpdateVendorItemNoFromItemReference(Rec, xRec);
- end;
-
- ///
- /// Updates the intercompany partner information on the purchase line if the purchase header has outgoing intercompany direction.
- ///
- procedure UpdateICPartner()
- var
- ICPartner: Record "IC Partner";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateICPartner(Rec, GLAcc, PurchHeader, IsHandled);
- if not IsHandled then
- if PurchHeader."Send IC Document" and (PurchHeader."IC Direction" = PurchHeader."IC Direction"::Outgoing) then
- case Type of
- Type::" ", Type::"Charge (Item)":
- begin
- "IC Partner Ref. Type" := Type;
- "IC Partner Reference" := "No.";
- end;
- Type::"G/L Account":
- begin
- "IC Partner Ref. Type" := Type;
- "IC Partner Reference" := GLAcc."Default IC Partner G/L Acc. No";
- end;
- Type::Item:
- begin
- ICPartner.Get(PurchHeader."Buy-from IC Partner Code");
- case ICPartner."Outbound Purch. Item No. Type" of
- ICPartner."Outbound Purch. Item No. Type"::"Common Item No.":
- Validate("IC Partner Ref. Type", "IC Partner Ref. Type"::"Common Item No.");
- ICPartner."Outbound Purch. Item No. Type"::"Internal No.":
- begin
- Validate("IC Partner Ref. Type", "IC Partner Ref. Type"::Item);
- "IC Partner Reference" := "No.";
- end;
- ICPartner."Outbound Purch. Item No. Type"::"Cross Reference":
- begin
- Validate("IC Partner Ref. Type", "IC Partner Ref. Type"::"Cross Reference");
- UpdateICPartnerItemReference();
- end;
- ICPartner."Outbound Purch. Item No. Type"::"Vendor Item No.":
- begin
- "IC Partner Ref. Type" := "IC Partner Ref. Type"::"Vendor Item No.";
- "IC Item Reference No." := "Vendor Item No.";
- end;
- end;
- end;
- Type::"Fixed Asset":
- begin
- "IC Partner Ref. Type" := "IC Partner Ref. Type"::" ";
- "IC Partner Reference" := '';
- end;
- end;
-
- OnAfterUpdateICPartner(Rec, PurchHeader);
- end;
-
- local procedure UpdateICPartnerItemReference()
- var
- ItemReference: Record "Item Reference";
- ToDate: Date;
- begin
- ItemReference.SetRange("Reference Type", "Item Reference Type"::Vendor);
- ItemReference.SetRange("Reference Type No.", "Buy-from Vendor No.");
- ItemReference.SetRange("Item No.", "No.");
- ItemReference.SetRange("Variant Code", "Variant Code");
- ItemReference.SetRange("Unit of Measure", "Unit of Measure Code");
- ToDate := Rec.GetDateForCalculations();
- if ToDate <> 0D then begin
- ItemReference.SetFilter("Starting Date", '<=%1', ToDate);
- ItemReference.SetFilter("Ending Date", '>=%1|%2', ToDate, 0D);
- end;
- if ItemReference.FindFirst() then
- "IC Item Reference No." := ItemReference."Reference No."
- else
- "IC Partner Reference" := "No.";
- end;
-
- local procedure CalcTotalAmtToAssign(TotalQtyToAssign: Decimal) TotalAmtToAssign: Decimal
- begin
- TotalAmtToAssign := CalcLineAmount() * TotalQtyToAssign / Quantity;
-
- if PurchHeader."Prices Including VAT" then
- TotalAmtToAssign := TotalAmtToAssign / (1 + "VAT %" / 100) - "VAT Difference";
-
- TotalAmtToAssign := Round(TotalAmtToAssign, Currency."Amount Rounding Precision");
-
- OnAfterCalcTotalAmtToAssign(Rec, PurchHeader, Currency, TotalQtyToAssign, TotalAmtToAssign);
- end;
-
- ///
- /// Checks if the current purchase line record has a type that requires mandatory fields to be filled.
- ///
- ///
- /// By default, only the blank type will return false, but this behavior can be altered by an event subscriber.
- ///
- /// True if purchase line has a type that requires mandatory fields to be filled, otherwise false.
- procedure HasTypeToFillMandatoryFields() ReturnValue: Boolean
- begin
- ReturnValue := Type <> Type::" ";
-
- OnAfterHasTypeToFillMandatoryFields(Rec, ReturnValue);
- end;
-
- ///
- /// Gets the defferal amount for the purchase line to be used in deferral schedules.
- ///
- /// The deferral amount.
- procedure GetDeferralAmount() DeferralAmount: Decimal
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetDeferralAmount(Rec, DeferralAmount, IsHandled);
- if IsHandled then
- exit;
-
- if "VAT Base Amount" <> 0 then
- DeferralAmount := "VAT Base Amount"
- else
- DeferralAmount := CalcLineAmount();
-
- OnAfterGetDeferralAmount(Rec, DeferralAmount);
- end;
-
- local procedure GetDeferralPostDate(PurchaseHeader: Record "Purchase Header") DeferralPostDate: Date
- begin
- DeferralPostDate := PurchaseHeader."Posting Date";
- OnAfterGetDeferralPostDate(Rec, PurchaseHeader, DeferralPostDate);
- end;
-
- ///
- /// Removes or updates the deferral schedule for the purchase line.
- ///
- procedure UpdateDeferralAmounts()
- var
- DeferralPostDate: Date;
- AdjustStartDate: Boolean;
- begin
- GetPurchHeader();
- OnUpdateDeferralAmountsOnBeforeSetDeferralPostDate(PurchHeader, Rec, DeferralPostDate);
- if DeferralPostDate = 0D then
- DeferralPostDate := PurchHeader."Posting Date";
- AdjustStartDate := true;
- if "Document Type" = "Document Type"::"Return Order" then begin
- if "Returns Deferral Start Date" = 0D then
- "Returns Deferral Start Date" := PurchHeader."Posting Date";
- DeferralPostDate := "Returns Deferral Start Date";
- AdjustStartDate := false;
- end;
-
- DeferralUtilities.RemoveOrSetDeferralSchedule(
- "Deferral Code", Enum::"Deferral Document Type"::Purchase.AsInteger(), '', '',
- "Document Type".AsInteger(), "Document No.", "Line No.",
- GetDeferralAmount(), DeferralPostDate, Description, PurchHeader."Currency Code", AdjustStartDate);
- end;
-
- ///
- /// Opens a page with deferral schedule for the purchase line.
- ///
- ///
- /// If the deferral schedule doesn't exist yet, a new one is created and commited before the page is opened.
- ///
- /// Posting date which is used as a start date on the deferral schedule if it needs to be created.
- /// Currency code to use for a new deferral schedule.
- /// True if deferral schedule was changed, otherwise false.
- procedure ShowDeferrals(PostingDate: Date; CurrencyCode: Code[10]): Boolean
- var
- IsHandled: Boolean;
- ReturnValue: Boolean;
- begin
- IsHandled := false;
- OnBeforeShowDeferrals(Rec, ReturnValue, IsHandled);
- if IsHandled then
- exit(ReturnValue);
-
- exit(
- DeferralUtilities.OpenLineScheduleEdit(
- "Deferral Code", Enum::"Deferral Document Type"::Purchase.AsInteger(), '', '',
- "Document Type".AsInteger(), "Document No.", "Line No.",
- GetDeferralAmount(), PostingDate, Description, CurrencyCode));
- end;
-
- ///
- /// Initializes the deferral code for the purchase line based on its type.
- ///
- procedure InitDeferralCode()
- var
- Item: Record Item;
- Resource: Record Resource;
- GLAccount: Record "G/L Account";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInitDeferralCode(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "Document Type" in
- ["Document Type"::Order, "Document Type"::Invoice, "Document Type"::"Credit Memo", "Document Type"::"Return Order"]
- then
- case Type of
- Type::"G/L Account":
- begin
- GLAccount.Get("No.");
- Validate("Deferral Code", GLAccount."Default Deferral Template Code");
- end;
- Type::Item:
- begin
- GetItem(Item);
- Validate("Deferral Code", Item."Default Deferral Template Code");
- end;
- Type::Resource:
- begin
- GetResource(Resource);
- Validate("Deferral Code", Resource."Default Deferral Template Code");
- end;
- end;
- end;
-
- ///
- /// Initializes the deferral code for the purchase if the type is g/l account, item or resource.
- ///
- procedure DefaultDeferralCode()
- begin
- if Type in [Type::"G/L Account", Type::Item, Type::Resource] then
- InitDeferralCode();
- end;
-
- ///
- /// Determines if the document type is a credit document.
- ///
- /// True if the document type is return order or credit memo, otherwise false.
- procedure IsCreditDocType() Result: Boolean
- begin
- Result := "Document Type" in ["Document Type"::"Return Order", "Document Type"::"Credit Memo"];
- OnAfterIsCreditDocType(Rec, Result);
- end;
-
- ///
- /// Determines if the document type of the line is order or invoice.
- ///
- /// True if the document type is order or invoice, otherwise false.
- procedure IsInvoiceDocType() Result: Boolean
- begin
- Result := "Document Type" in ["Document Type"::Order, "Document Type"::Invoice];
- OnAfterIsInvoiceDocType(Rec, Result);
- end;
-
- ///
- /// Determines if incoming document came from OCR.
- ///
- ///
- /// If there's no incoming document associated with the purchase document, the procedure returns false.
- ///
- /// True, if incoming document has ocr status success, otherwise false.
- procedure IsReceivedFromOcr(): Boolean
- var
- IncomingDocument: Record "Incoming Document";
- begin
- GetPurchHeader();
- if not IncomingDocument.Get(PurchHeader."Incoming Document Entry No.") then
- exit(false);
- exit(IncomingDocument."OCR Status" = IncomingDocument."OCR Status"::Success);
- end;
-
- local procedure TestReturnFieldsZero()
- begin
- TestField("Return Qty. Shipped Not Invd.", 0);
- TestField("Return Qty. Shipped", 0);
- TestField("Return Shipment No.", '');
- end;
-
- ///
- /// Checks if item unit of measure code can be edited.
- ///
- ///
- /// If this is not an item line or if item is not selected the procedure always returns true.
- ///
- /// True if item unit of measure code can be edited, otherwise false.
- procedure CanEditUnitOfMeasureCode(): Boolean
- var
- ItemUnitOfMeasure: Record "Item Unit of Measure";
- begin
- if (Type = Type::Item) and ("No." <> '') then begin
- ItemUnitOfMeasure.SetRange("Item No.", "No.");
- exit(ItemUnitOfMeasure.Count > 1);
- end;
- exit(true);
- end;
-
- ///
- /// Verifies that the pruchase line is an item line and the fields match the provided values.
- /// If the values do not match, an error is thrown.
- ///
- /// The item number to match.
- /// The variant code to match.
- /// The location code to match.
- procedure TestItemFields(ItemNo: Code[20]; VariantCode: Code[10]; LocationCode: Code[10])
- begin
- TestField(Type, Type::Item);
- TestField("No.", ItemNo);
- TestField("Variant Code", VariantCode);
- TestField("Location Code", LocationCode);
- end;
-
- ///
- /// Clears global PurchHeader variable.
- ///
- procedure ClearPurchaseHeader()
- begin
- Clear(PurchHeader);
- end;
-
- local procedure GetBlockedItemNotificationID(): Guid
- begin
- exit('963A9FD3-11E8-4CAA-BE3A-7F8CEC9EF8EC');
- end;
-
- local procedure SendBlockedItemNotification()
- var
- NotificationLifecycleMgt: Codeunit "Notification Lifecycle Mgt.";
- NotificationToSend: Notification;
- begin
- NotificationToSend.Id := GetBlockedItemNotificationID();
- NotificationToSend.Recall();
- NotificationToSend.Message := StrSubstNo(BlockedItemNotificationMsg, "No.");
- NotificationLifecycleMgt.SendNotification(NotificationToSend, RecordId);
- end;
-
- local procedure GetBlockedItemVariantNotificationID(): Guid
- begin
- exit('1113AAF8-EC5B-4F80-BB38-09A770130E59');
- end;
-
- local procedure SendBlockedItemVariantNotification()
- var
- NotificationLifecycleMgt: Codeunit "Notification Lifecycle Mgt.";
- NotificationToSend: Notification;
- begin
- NotificationToSend.Id := GetBlockedItemVariantNotificationID();
- NotificationToSend.Recall();
- NotificationToSend.Message := StrSubstNo(BlockedItemVariantNotificationMsg, Rec."Variant Code", Rec."No.");
- NotificationLifecycleMgt.SendNotification(NotificationToSend, Rec.RecordId());
- end;
-
- ///
- /// Sends a notification when the invoice discount amount for the purchase line record has been reset.
- ///
- procedure SendLineInvoiceDiscountResetNotification()
- var
- NotificationLifecycleMgt: Codeunit "Notification Lifecycle Mgt.";
- NotificationToSend: Notification;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSendLineInvoiceDiscountResetNotification(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if ("Inv. Discount Amount" = 0) and (xRec."Inv. Discount Amount" <> 0) and ("Line Amount" <> 0) then begin
- NotificationToSend.Id := PurchHeader.GetLineInvoiceDiscountResetNotificationId();
- NotificationToSend.Message := StrSubstNo(LineInvoiceDiscountAmountResetTok, RecordId);
-
- NotificationLifecycleMgt.SendNotification(NotificationToSend, RecordId);
- end;
- end;
-
- ///
- /// Gets the formated text of the line type for the purchase line.
- ///
- ///
- /// If line type is blank, comment label is returned.
- ///
- /// Formated text of the line type.
- procedure FormatType() FormattedType: Text[20]
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeFormatType(Rec, FormattedType, IsHandled);
- if IsHandled then
- exit(FormattedType);
-
- if Type = Type::" " then
- exit(CommentLbl);
-
- exit(Format(Type));
- end;
-
- ///
- /// Renames the number of all purchase lines corresponding to the specified line type and number.
- ///
- ///
- /// Used when related entities are renamed.
- ///
- /// Filter lines based on this line type.
- /// The old number to rename from.
- /// The new number to rename to.
- procedure RenameNo(LineType: Enum "Purchase Document Type"; OldNo: Code[20]; NewNo: Code[20])
- begin
- Reset();
- SetRange(Type, LineType);
- SetRange("No.", OldNo);
- if not Rec.IsEmpty() then
- ModifyAll("No.", NewNo, true);
- end;
-
- local procedure UpdateLineDiscPct()
- var
- LineDiscountPct: Decimal;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateLineDiscPct(Rec, Currency, IsHandled, CurrFieldNo);
- if IsHandled then
- exit;
-
- if Round(Quantity * "Direct Unit Cost", Currency."Amount Rounding Precision") <> 0 then begin
- LineDiscountPct := Round(
- "Line Discount Amount" / Round(Quantity * "Direct Unit Cost", Currency."Amount Rounding Precision") * 100,
- 0.00001);
- if not (LineDiscountPct in [0 .. 100]) then
- Error(LineDiscountPctErr);
- "Line Discount %" := LineDiscountPct;
- end else
- "Line Discount %" := 0;
-
- OnAfterUpdateLineDiscPct(Rec);
- end;
-
- ///
- /// Updates the base amounts for the purchase line.
- ///
- /// Value to which amount will be updated.
- /// Value to which amount including VAT will be uptaded.
- /// Value to which VAT base amount will be uptaded.
- procedure UpdateBaseAmounts(NewAmount: Decimal; NewAmountIncludingVAT: Decimal; NewVATBaseAmount: Decimal)
- begin
- Amount := NewAmount;
- "Amount Including VAT" := NewAmountIncludingVAT;
- "VAT Base Amount" := NewVATBaseAmount;
-
- OnAfterUpdateBaseAmounts(Rec, xRec, CurrFieldNo, NewAmount, NewAmountIncludingVAT, NewVATBaseAmount);
- end;
-
- ///
- /// Updates the prepayment amounts for the purchase line.
- ///
- procedure UpdatePrepmtAmounts()
- var
- OutstandingAmountExclTax: Decimal;
- begin
- if (Rec.Quantity <> 0) and (Rec."Outstanding Quantity" = 0) and (Rec."Qty. Rcd. Not Invoiced" = 0) then
- if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then
- exit;
-
- if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then begin
- OutstandingAmountExclTax := CalculateOutstandingAmountExclTax();
- "Prepayment VAT Difference" := 0;
- if not PrePaymentLineAmountEntered then begin
- "Prepmt. Line Amount" := Round((OutstandingAmountExclTax) * "Prepayment %" / 100, Currency."Amount Rounding Precision");
- "Prepmt. Line Amount" := "Prepmt. Line Amount" + "Prepmt Amt Deducted";
- end;
- PrePaymentLineAmountEntered := false;
- end;
-
- if not IsTemporary() then
- CheckPrepmtAmounts();
- end;
-
- local procedure CalculateOutstandingAmountExclTax(): Decimal
- var
- OutstandingAmount: Decimal;
- QuantityNotInvoiced: Decimal;
- begin
- if Rec.Quantity = 0 then
- exit(0);
- QuantityNotInvoiced := (Rec.Quantity - Rec."Quantity Invoiced");
- OutstandingAmount := round(((Rec."Line Amount" - Rec."Inv. Discount Amount") * QuantityNotInvoiced) / Rec.Quantity, Currency."Amount Rounding Precision");
- exit(OutstandingAmount);
- end;
-
- local procedure CheckPrepmtAmounts()
- var
- RemLineAmountToInvoice: Decimal;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckPrepmtAmounts(Rec, PurchHeader, CurrFieldNo, IsHandled, xRec);
- if IsHandled then
- exit;
-
- if "Prepayment %" <> 0 then begin
- if "System-Created Entry" then
- if Type = Type::"G/L Account" then
- if not IsServiceCharge() then
- exit;
- if Quantity < 0 then
- FieldError(Quantity, StrSubstNo(Text043, FieldCaption("Prepayment %")));
- if "Direct Unit Cost" < 0 then
- FieldError("Direct Unit Cost", StrSubstNo(Text043, FieldCaption("Prepayment %")));
- end;
- if PurchHeader."Document Type" <> PurchHeader."Document Type"::Invoice then begin
- if (("Prepmt. Line Amount" + Currency."Amount Rounding Precision") < "Prepmt. Amt. Inv.") and (PurchHeader.Status <> PurchHeader.Status::Released) then begin
- if IsServiceCharge() then
- Error(CannotChangePrepaidServiceChargeErr);
- if "Inv. Discount Amount" <> 0 then
- Error(InvDiscForPrepmtExceededErr, "Document No.");
- FieldError("Prepmt. Line Amount", StrSubstNo(Text037, "Prepmt. Amt. Inv."));
- end;
- if "Prepmt. Line Amount" <> 0 then begin
- RemLineAmountToInvoice :=
- Round("Line Amount" * (Quantity - "Quantity Invoiced") / Quantity, Currency."Amount Rounding Precision");
- if RemLineAmountToInvoice < ("Prepmt Amt to Deduct" - "Prepmt Amt Deducted") then
- FieldError("Prepmt Amt to Deduct", StrSubstNo(Text039, RemLineAmountToInvoice + "Prepmt Amt Deducted"));
- end;
- end else
- if (CurrFieldNo <> 0) and ("Line Amount" <> xRec."Line Amount") and
- ("Prepmt. Amt. Inv." <> 0) and ("Prepayment %" = 100)
- then begin
- if "Line Amount" < xRec."Line Amount" then
- FieldError("Line Amount", StrSubstNo(Text038, xRec."Line Amount"));
- FieldError("Line Amount", StrSubstNo(Text039, xRec."Line Amount"));
- end;
- end;
-
- local procedure CheckPrepmtAmtInvEmpty()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckPrepmtAmtInvEmpty(Rec, IsHandled, xRec);
- if IsHandled then
- exit;
-
- if ("Prepmt. Amt. Inv." <> 0) and (Rec."VAT Prod. Posting Group" <> xRec."VAT Prod. Posting Group") then
- Error(CannotChangeVATGroupWithPrepmInvErr);
- end;
-
- local procedure IsCalcVATAmountLinesHandled(PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line"; QtyType: Option General,Invoicing,Shipping) IsHandled: Boolean
- begin
- IsHandled := false;
- OnBeforeCalcVATAmountLines(PurchHeader, PurchLine, VATAmountLine, IsHandled, QtyType);
- exit(IsHandled);
- end;
-
- local procedure OverReceiptProcessing() Result: Boolean
- var
- OverReceiptMgt: Codeunit "Over-Receipt Mgt.";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeOverReceiptProcessing(Rec, xRec, CurrFieldNo, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if not OverReceiptMgt.IsOverReceiptAllowed() or (Abs("Qty. to Receive") <= Abs("Outstanding Quantity")) then
- exit(false);
-
- if (Rec."Over-Receipt Code" = '') and (OverReceiptMgt.GetDefaultOverReceiptCode(Rec) = '') then
- exit(false);
-
- Validate("Over-Receipt Quantity", "Qty. to Receive" - Quantity + "Quantity Received" + "Over-Receipt Quantity");
- exit(true);
- end;
-
- ///
- /// Returns resource record from the resource number on the purchase line.
- ///
- /// Resource record.
- procedure GetResource(): Record Resource
- var
- Resource: Record Resource;
- begin
- TestField("No.");
- Resource.Get("No.");
- exit(Resource);
- end;
-
- local procedure GetResource(var Resource: Record Resource)
- begin
- TestField("No.");
- Resource.Get("No.")
- end;
-
- local procedure CopyFromResource()
- var
- Resource: Record Resource;
- begin
- GetResource(Resource);
- Resource.CheckResourcePrivacyBlocked(false);
- Resource.TestField(Blocked, false);
- Resource.TestField("Gen. Prod. Posting Group");
- Description := Resource.Name;
- "Description 2" := Resource."Name 2";
- "Unit of Measure Code" := Resource."Base Unit of Measure";
- "Gen. Prod. Posting Group" := Resource."Gen. Prod. Posting Group";
- "VAT Prod. Posting Group" := Resource."VAT Prod. Posting Group";
- "Tax Group Code" := Resource."Tax Group Code";
- "Allow Item Charge Assignment" := false;
- "Direct Unit Cost" := Resource."Direct Unit Cost";
- InitDeferralCode();
-
- OnAfterAssignResourceValues(Rec, Resource);
- end;
-
- local procedure CheckBuyFromVendorNo(PurchaseHeader: Record "Purchase Header")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckBuyFromVendorNo(PurchaseHeader, IsHandled);
- if IsHandled then
- exit;
-
- if PurchaseHeader."Document Type" = PurchaseHeader."Document Type"::Quote then
- CheckQuoteVendorTemplateCode(PurchaseHeader)
- else
- PurchaseHeader.TestField("Buy-from Vendor No.");
- end;
-
- local procedure UpdateLineAmount(var LineAmountChanged: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateLineAmount(Rec, xRec, Currency, LineAmountChanged, IsHandled);
- if IsHandled then
- exit;
-
- if Rec."Line Amount" <> xRec."Line Amount" then begin
- ClearVATDifference();
- NonDeductibleVAT.InitNonDeductibleVATDiff(Rec);
- LineAmountChanged := true;
- end;
- if "Line Amount" <> Round(Quantity * "Direct Unit Cost", Currency."Amount Rounding Precision") - "Line Discount Amount" then begin
- "Line Amount" :=
- Round(Quantity * "Direct Unit Cost", Currency."Amount Rounding Precision") - "Line Discount Amount";
- ClearVATDifference();
- NonDeductibleVAT.InitNonDeductibleVATDiff(Rec);
- LineAmountChanged := true;
- end;
- OnAfterUpdateLineAmount(Rec, xRec, Currency, LineAmountChanged);
- end;
-
- local procedure CheckLocationRequireReceive();
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckLocationRequireReceive(Rec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- GetLocation("Location Code");
- if (CurrFieldNo <> 0) and IsInventoriableItem() and (not "Drop Shipment") then begin
- if Location."Require Receive" then
- CheckWarehouse(true);
- IsHandled := false;
- OnCheckLocationRequireReceiveOnBeforePurchaseLineVerifyChange(Rec, xRec, IsHandled);
- if not IsHandled then
- PurchasesWarehouseMgt.PurchaseLineVerifyChange(Rec, xRec);
- end;
- end;
-
- local procedure CheckDirectUnitCost()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckDirectUnitCost(Rec, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Direct Unit Cost");
- end;
-
- ///
- /// Open a page with the purchase lines related to the blanket order line.
- ///
- /// The document type of the purchase lines to show.
- procedure ShowBlanketOrderPurchaseLines(DocumentType: Enum "Purchase Document Type")
- var
- RelatedPurchLine: Record "Purchase Line";
- begin
- RelatedPurchLine.Reset();
- RelatedPurchLine.SetCurrentKey("Document Type", "Blanket Order No.", "Blanket Order Line No.");
- RelatedPurchLine.SetRange("Document Type", DocumentType);
- RelatedPurchLine.SetRange("Blanket Order No.", Rec."Document No.");
- RelatedPurchLine.SetRange("Blanket Order Line No.", Rec."Line No.");
- PAGE.RunModal(PAGE::"Purchase Lines", RelatedPurchLine);
- end;
-
- ///
- /// Open a page with the posted purchase receipt lines related to the blanket order line.
- ///
- procedure ShowBlanketOrderPostedReceiptLines()
- var
- PurchRcptLine: Record "Purch. Rcpt. Line";
- begin
- PurchRcptLine.Reset();
- PurchRcptLine.SetCurrentKey("Blanket Order No.", "Blanket Order Line No.");
- PurchRcptLine.SetRange("Blanket Order No.", Rec."Document No.");
- PurchRcptLine.SetRange("Blanket Order Line No.", Rec."Line No.");
- PAGE.RunModal(PAGE::"Posted Purchase Receipt Lines", PurchRcptLine);
- end;
-
- ///
- /// Open a page with the posted purchase invoice lines related to the blanket order line.
- ///
- procedure ShowBlanketOrderPostedInvoiceLines()
- var
- PurchInvLine: Record "Purch. Inv. Line";
- begin
- PurchInvLine.Reset();
- PurchInvLine.SetCurrentKey("Blanket Order No.", "Blanket Order Line No.");
- PurchInvLine.SetRange("Blanket Order No.", Rec."Document No.");
- PurchInvLine.SetRange("Blanket Order Line No.", Rec."Line No.");
- PAGE.RunModal(PAGE::"Posted Purchase Invoice Lines", PurchInvLine);
- end;
-
- ///
- /// Open a page with the posted return shipment lines related to the blanket order line.
- ///
- procedure ShowBlanketOrderPostedReturnReceiptLines()
- var
- ReturnShptLine: Record "Return Shipment Line";
- begin
- ReturnShptLine.Reset();
- ReturnShptLine.SetCurrentKey("Blanket Order No.", "Blanket Order Line No.");
- ReturnShptLine.SetRange("Blanket Order No.", Rec."Document No.");
- ReturnShptLine.SetRange("Blanket Order Line No.", Rec."Line No.");
- PAGE.RunModal(PAGE::"Posted Return Shipment Lines", ReturnShptLine);
- end;
-
- ///
- /// Open a page with the posted purchase credit memo lines related to the blanket order line.
- ///
- procedure ShowBlanketOrderPostedCreditMemoLines()
- var
- PurchCrMemoLine: Record "Purch. Cr. Memo Line";
- begin
- PurchCrMemoLine.Reset();
- PurchCrMemoLine.SetCurrentKey("Blanket Order No.", "Blanket Order Line No.");
- PurchCrMemoLine.SetRange("Blanket Order No.", Rec."Document No.");
- PurchCrMemoLine.SetRange("Blanket Order Line No.", Rec."Line No.");
- PAGE.RunModal(PAGE::"Posted Purchase Cr. Memo Lines", PurchCrMemoLine);
- end;
-
- local procedure TestFieldQuantity(CurrentFieldNo: Integer)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeTestFieldQuantity(Rec, CurrentFieldNo, IsHandled);
- if not IsHandled then
- TestField(Quantity);
- end;
-
- procedure CalcBaseQty(Qty: Decimal; FromFieldName: Text; ToFieldName: Text): Decimal
- begin
- OnBeforeCalcBaseQty(Rec, Qty, FromFieldName, ToFieldName);
- exit(UOMMgt.CalcBaseQty(
- "No.", "Variant Code", "Unit of Measure Code", Qty, "Qty. per Unit of Measure", "Qty. Rounding Precision (Base)", FieldCaption("Qty. Rounding Precision"), FromFieldName, ToFieldName));
- end;
-
- local procedure CalcBaseQtyForJobPlanningLine(Qty: Decimal; FromFieldName: Text; ToFieldName: Text; JobPlanningLine: Record "Job Planning Line"): Decimal
- begin
- exit(UOMMgt.CalcBaseQty(
- JobPlanningLine."No.", JobPlanningLine."Variant Code", JobPlanningLine."Unit of Measure Code", Qty, JobPlanningLine."Qty. per Unit of Measure", JobPlanningLine."Qty. Rounding Precision (Base)", FieldCaption("Qty. Rounding Precision"), FromFieldName, ToFieldName));
- end;
-
- ///
- /// Initializes the dimensions for the purchase line if default dimensions are defined for the related entry.
- ///
- /// The field number for which to initialize the dimensions.
- procedure CreateDimFromDefaultDim(FieldNo: Integer)
- var
- DefaultDimSource: List of [Dictionary of [Integer, Code[20]]];
- IsHandled: Boolean;
- begin
- InitDefaultDimensionSources(DefaultDimSource, FieldNo);
-
- IsHandled := false;
- OnCreateDimFromDefaultDimOnBeforeCreateDim(Rec, DefaultDimSource, FieldNo, IsHandled);
- if not IsHandled then
- if DimMgt.IsDefaultDimDefinedForTable(GetTableValuePair(FieldNo)) then
- CreateDim(DefaultDimSource);
-
- OnAfterCreateDimFromDefaultDim(Rec, DefaultDimSource, FieldNo);
- end;
-
- ///
- /// Returns a dictionary mapping table IDs to field values for the purchase line for a specified field no.
- ///
- /// Field number to map.
- /// Dictionary which has mapped provided field value with its corresponding table id.
- procedure GetTableValuePair(FieldNo: Integer) TableValuePair: Dictionary of [Integer, Code[20]]
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInitTableValuePair(TableValuePair, FieldNo, IsHandled, Rec);
- if IsHandled then
- exit;
-
- case true of
- FieldNo = Rec.FieldNo("No."):
- TableValuePair.Add(DimMgt.PurchLineTypeToTableID(Type), Rec."No.");
- FieldNo = Rec.FieldNo("Responsibility Center"):
- TableValuePair.Add(Database::"Responsibility Center", Rec."Responsibility Center");
- FieldNo = Rec.FieldNo("Job No."):
- TableValuePair.Add(Database::Job, Rec."Job No.");
- FieldNo = Rec.FieldNo("Location Code"):
- TableValuePair.Add(Database::Location, Rec."Location Code");
- end;
- OnAfterInitTableValuePair(TableValuePair, FieldNo, Rec);
- end;
-
- local procedure InitDefaultDimensionSources(var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; FieldNo: Integer)
- begin
- DimMgt.AddDimSource(DefaultDimSource, DimMgt.PurchLineTypeToTableID(Rec.Type), Rec."No.", FieldNo = Rec.FieldNo("No."));
- DimMgt.AddDimSource(DefaultDimSource, Database::Job, Rec."Job No.", FieldNo = Rec.FieldNo("Job No."));
- DimMgt.AddDimSource(DefaultDimSource, Database::"Responsibility Center", Rec."Responsibility Center", FieldNo = Rec.FieldNo("Responsibility Center"));
- DimMgt.AddDimSource(DefaultDimSource, Database::Location, Rec."Location Code", FieldNo = Rec.FieldNo("Location Code"));
-
- OnAfterInitDefaultDimensionSources(Rec, DefaultDimSource, FieldNo);
- end;
-
- ///
- /// Saves the selected record from the lookup to the lookup state manager.
- ///
- /// The reference to the selected record from the lookup.
- procedure SaveLookupSelection(SelectedRecordRef: RecordRef)
- var
- GLAccount: Record "G/L Account";
- Item: Record Item;
- Resource: Record Resource;
- FixedAsset: Record "Fixed Asset";
- AllocationAccount: Record "Allocation Account";
- ItemCharge2: Record "Item Charge";
- LookupStateManager: Codeunit "Lookup State Manager";
- NewNo: Code[20];
- RecVariant: Variant;
- begin
- case Rec.Type of
- Rec.Type::Item:
- begin
- SelectedRecordRef.SetTable(Item);
- RecVariant := Item;
- NewNo := Item."No.";
- LookupStateManager.SaveRecord(RecVariant);
- end;
- Rec.Type::"G/L Account":
- begin
- SelectedRecordRef.SetTable(GLAccount);
- RecVariant := GLAccount;
- NewNo := GLAccount."No.";
- LookupStateManager.SaveRecord(RecVariant);
- end;
- Rec.Type::Resource:
- begin
- SelectedRecordRef.SetTable(Resource);
- RecVariant := Resource;
- NewNo := Resource."No.";
- LookupStateManager.SaveRecord(RecVariant);
- end;
- Rec.Type::"Fixed Asset":
- begin
- SelectedRecordRef.SetTable(FixedAsset);
- RecVariant := FixedAsset;
- NewNo := FixedAsset."No.";
- LookupStateManager.SaveRecord(RecVariant);
- end;
- Rec.Type::"Charge (Item)":
- begin
- SelectedRecordRef.SetTable(ItemCharge2);
- RecVariant := ItemCharge2;
- NewNo := ItemCharge2."No.";
- LookupStateManager.SaveRecord(RecVariant);
- end;
- Rec.Type::"Allocation Account":
- begin
- SelectedRecordRef.SetTable(AllocationAccount);
- RecVariant := AllocationAccount;
- NewNo := AllocationAccount."No.";
- LookupStateManager.SaveRecord(RecVariant);
- end;
- end;
- if (Rec."No." = '') and (NewNo <> '') then
- Rec.Validate("No.", NewNo);
- end;
-
- procedure AttachToInventoryItemLine(var SelectedPurchLine: Record "Purchase Line")
- var
- InvtItemPurchLine: Record "Purchase Line";
- TempPurchaseLine: Record "Purchase Line" temporary;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeAttachToInventoryItemLine(SelectedPurchLine, IsHandled);
- if IsHandled then
- exit;
-
- SelectedPurchLine.SetFilter(Type, '>%1', SelectedPurchLine.Type::" ");
- SelectedPurchLine.SetFilter(Quantity, '<>0');
- if not SelectedPurchLine.FindSet() then
- exit;
-
- InvtItemPurchLine.SetRange("Document Type", SelectedPurchLine."Document Type");
- InvtItemPurchLine.SetRange("Document No.", SelectedPurchLine."Document No.");
- InvtItemPurchLine.SetRange(Type, SelectedPurchLine.Type::Item);
- InvtItemPurchLine.SetRange("Attached to Line No.", 0);
- if InvtItemPurchLine.FindSet() then
- repeat
- if InvtItemPurchLine.IsInventoriableItem() then begin
- TempPurchaseLine := InvtItemPurchLine;
- TempPurchaseLine.Insert();
- end;
- until InvtItemPurchLine.Next() = 0;
-
- if PAGE.RunModal(PAGE::"Purchase Lines", TempPurchaseLine) = ACTION::LookupOK then
- if TempPurchaseLine."Line No." <> 0 then
- repeat
- if not SelectedPurchLine.IsInventoriableItem() then begin
- SelectedPurchLine."Attached to Line No." := TempPurchaseLine."Line No.";
- SelectedPurchLine.Modify();
- end;
- until SelectedPurchLine.Next() = 0;
- end;
-
- ///
- /// Restores the selected record from the lookup state manager to the purchase line.
- ///
- procedure RestoreLookupSelection()
- var
- GLAccount: Record "G/L Account";
- Item: Record Item;
- Resource: Record Resource;
- FixedAsset: Record "Fixed Asset";
- ItemCharge2: Record "Item Charge";
- LookupStateManager: Codeunit "Lookup State Manager";
- RecRef: RecordRef;
- RecVariant: Variant;
- begin
- if LookupStateManager.IsRecordSaved() then begin
- case Rec.Type of
- Rec.Type::Item:
- begin
- RecVariant := LookupStateManager.GetSavedRecord();
- RecRef.GetTable(RecVariant);
- if RecRef.Number = Database::Item then begin
- Item := RecVariant;
- Rec.Validate("No.", Item."No.");
- end;
- end;
- Rec.Type::"G/L Account":
- begin
- RecVariant := LookupStateManager.GetSavedRecord();
- RecRef.GetTable(RecVariant);
- if RecRef.Number = Database::"G/L Account" then begin
- GLAccount := RecVariant;
- Rec.Validate("No.", GLAccount."No.");
- end;
- end;
- Rec.Type::Resource:
- begin
- RecVariant := LookupStateManager.GetSavedRecord();
- RecRef.GetTable(RecVariant);
- if RecRef.Number = Database::Resource then begin
- Resource := RecVariant;
- Rec.Validate("No.", Resource."No.");
- end;
- end;
- Rec.Type::"Fixed Asset":
- begin
- RecVariant := LookupStateManager.GetSavedRecord();
- RecRef.GetTable(RecVariant);
- if RecRef.Number = Database::"Fixed Asset" then begin
- FixedAsset := RecVariant;
- Rec.Validate("No.", FixedAsset."No.");
- end;
- end;
- Rec.Type::"Charge (Item)":
- begin
- RecVariant := LookupStateManager.GetSavedRecord();
- RecRef.GetTable(RecVariant);
- if RecRef.Number = Database::"Item Charge" then begin
- ItemCharge2 := RecVariant;
- Rec.Validate("No.", ItemCharge2."No.");
- end;
- end;
- end;
- LookupStateManager.ClearSavedRecord();
- end;
- end;
-
- ///
- /// Gets the date required for purchase line calculations.
- ///
- /// The date for calculations.
- procedure GetDateForCalculations() CalculationDate: Date;
- var
- FromPurchaseHeader: Record "Purchase Header";
- begin
- if Rec."Document No." <> '' then
- FromPurchaseHeader := Rec.GetPurchHeader();
- CalculationDate := GetDateForCalculations(FromPurchaseHeader);
- end;
-
- ///
- /// Gets the date required for purchase line calculations.
- ///
- /// The purchase header to get the date from.
- /// The date for calculations.
- procedure GetDateForCalculations(FromPurchaseHeader: Record "Purchase Header") CalculationDate: Date;
- begin
- if FromPurchaseHeader."Document Type" in [FromPurchaseHeader."Document Type"::Invoice, FromPurchaseHeader."Document Type"::"Credit Memo"] then
- CalculationDate := FromPurchaseHeader."Posting Date"
- else
- CalculationDate := FromPurchaseHeader."Order Date";
- if CalculationDate = 0D then
- CalculationDate := WorkDate();
- end;
-
- local procedure SetLoadFieldsForInvDiscoundCalculation(var PurchaseLine: Record "Purchase Line")
- begin
- PurchaseLine.SetLoadFields(
- "Document Type", "Document No.", Type, "No.", "Receipt No.", "Return Shipment No.", "Deferral Code",
- Quantity, "Quantity (Base)", "Qty. to Invoice", "Qty. to Invoice (Base)", "Qty. Rcd. Not Invoiced", "Qty. Rcd. Not Invoiced (Base)", "Ret. Qty. Shpd Not Invd.(Base)", "Return Qty. Shipped (Base)",
- "Return Qty. Shipped Not Invd.", "Qty. to Receive", "Qty. to Receive (Base)", "Return Qty. to Ship", "Return Qty. to Ship (Base)", "Return Qty. Shipped", "Outstanding Quantity", "Outstanding Qty. (Base)",
- "Quantity Invoiced", "Qty. Invoiced (Base)", "Quantity Received", "Qty. Received (Base)", "Qty. per Unit of Measure", "Reserved Quantity",
- "Unit Cost", "Amount Including VAT", Amount, "Line Amount", "Inv. Discount Amount", "Inv. Disc. Amount to Invoice", "VAT Difference", "VAT Base Amount",
- "Outstanding Amount", "Outstanding Amount (LCY)", "Amt. Rcd. Not Invoiced", "Amt. Rcd. Not Invoiced (LCY)", "Return Shpd. Not Invd.", "Return Shpd. Not Invd. (LCY)",
- "System-Created Entry", "VAT Identifier", "VAT Calculation Type", "Tax Group Code", "VAT %", "Allow Invoice Disc.", "Prepayment Line", "Completely Received");
- end;
-
- ///
- /// Checks if the quantity to post for the purchase line meets the specified quantity in the reservation entries.
- ///
- /// Quantity that will be posted.
- /// Reservation from stock type.
- /// True if the reserved quantity meets the quantity in the reservation entries, otherwise false.
- procedure CheckIfPurchaseLineMeetsReservedFromStockSetting(QtyToPost: Decimal; ReservedFromStock: Enum "Reservation From Stock") Result: Boolean
- var
- QtyReservedFromStock: Decimal;
- begin
- Result := true;
-
- if not Rec.IsInventoriableItem() then
- exit(true);
-
- if ReservedFromStock = ReservedFromStock::" " then
- exit(true);
-
- QtyReservedFromStock := PurchLineReserve.GetReservedQtyFromInventory(Rec);
-
- case ReservedFromStock of
- ReservedFromStock::Full:
- if QtyToPost <> QtyReservedFromStock then
- Result := false;
- ReservedFromStock::"Full and Partial":
- if QtyReservedFromStock = 0 then
- Result := false;
- else
- OnCheckIfPurchaseLineMeetsReservedFromStockSetting(QtyToPost, ReservedFromStock, Result);
- end;
-
- exit(Result);
- end;
-
- local procedure CannotInvoiceErrorInfo(): ErrorInfo
- var
- ErrorMesageManagement: Codeunit "Error Message Management";
- begin
- exit(ErrorMesageManagement.BuildActionableErrorInfo(
- QtyInvoiceNotValidTitleLbl,
- StrSubstNo(Text006, MaxQtyToInvoice()),
- Rec.RecordId,
- StrSubstNo(QtyInvoiceActionLbl, MaxQtyToInvoice()),
- Codeunit::"Purchase Line - Price",
- 'SetPurchaseQtyInvoice',
- StrSubstNo(QtyInvoiceActionDescriptionLbl, Rec.FieldCaption("Qty. to Invoice"), Rec.Quantity)));
- end;
-
- local procedure CannotReceiveErrorInfo(): ErrorInfo
- var
- ErrorMesageManagement: Codeunit "Error Message Management";
- begin
- exit(ErrorMesageManagement.BuildActionableErrorInfo(
- QtyReceiveNotValidTitleLbl,
- StrSubstNo(Text008, "Outstanding Quantity"),
- Rec.RecordId,
- StrSubstNo(QtyReceiveActionLbl, "Outstanding Quantity"),
- Codeunit::"Purchase Line - Price",
- 'SetPurchaseReceiveQty',
- StrSubstNo(QtyReceiveActionDescriptionLbl, Rec.FieldCaption("Qty. to Receive"), Rec.Quantity)));
- end;
-
- local procedure CheckQuoteVendorTemplateCode(PurchaseHeader: Record "Purchase Header")
- begin
- if (PurchaseHeader."Buy-from Vendor No." = '') and
- (PurchaseHeader."Buy-from Vendor Templ. Code" = '')
- then
- Error(
- MustSpecifyErr,
- PurchaseHeader.FieldCaption("Buy-from Vendor No."),
- PurchaseHeader.FieldCaption("Buy-from Vendor Templ. Code"));
-
- if (PurchaseHeader."Pay-to Vendor No." = '') and
- (PurchaseHeader."Pay-to Vendor Templ. Code" = '')
- then
- Error(
- MustSpecifyErr,
- PurchaseHeader.FieldCaption("Pay-to Vendor No."),
- PurchaseHeader.FieldCaption("Pay-to Vendor Templ. Code"));
- end;
-
- local procedure OverturnExitConditionForNoViaDescription(CalledByFieldNo: Integer; var ShouldExit: Boolean)
- begin
- if (CalledByFieldNo = FieldNo("No.")) and (CurrFieldNo = FieldNo(Description)) and (ShouldExit) then
- ShouldExit := false;
- end;
-
- local procedure OverturnExitConditionForDefaultGLAccountQuantityValidation(var ShouldExit: Boolean)
- begin
- if not ShouldExit then
- exit;
-
- if Quantity <> 1 then
- exit;
-
- if QuantityDefaultedFromGLAccount() then
- ShouldExit := false;
- end;
-
- procedure IsProdOrder() Result: Boolean
- begin
- OnIsProdOrder(Rec, Result);
- end;
-
- procedure IsWorkCenter() Result: Boolean
- begin
- OnIsWorkCenter(Rec, Result);
- end;
-
- procedure TestProdOrderNo()
- begin
- OnTestProdOrderNo(Rec);
- end;
-
- procedure TestWorkCenterNo()
- begin
- OnTestWorkCenterNo(Rec);
- end;
-
- internal procedure ClearVATPct()
- begin
- "VAT %" := 0;
- OnAfterClearVATPct(Rec);
- end;
-
- internal procedure ClearPrepaymentVATPct()
- begin
- "Prepayment VAT %" := 0;
- OnAfterClearPrepaymentVATPct(Rec);
- end;
-
- internal procedure ClearVATDifference()
- begin
- "VAT Difference" := 0;
- OnAfterClearVATDifference(Rec);
- end;
-
- procedure GetVATPct() VATPct: Decimal
- begin
- VATPct := "VAT %";
- OnAfterGetVATPct(Rec, VATPct);
- end;
-
- internal procedure GetPrepaymentVATPct() PrepaymentVATPct: Decimal
- begin
- PrepaymentVATPct := "Prepayment VAT %";
- OnAfterGetPrepaymentVATPct(Rec, PrepaymentVATPct);
- end;
-
- internal procedure CopyFromVATPostingSetup(var VATPostingSetupFrom: Record "VAT Posting Setup")
- begin
- "VAT %" := VATPostingSetup."VAT %";
- "VAT Calculation Type" := VATPostingSetup."VAT Calculation Type";
- if "VAT Calculation Type" = "VAT Calculation Type"::"Full VAT" then
- Validate("Allow Invoice Disc.", false);
- "VAT Identifier" := VATPostingSetup."VAT Identifier";
-
- OnAfterCopyFromVATPostingSetup(Rec, VATPostingSetupFrom);
- end;
-
- internal procedure CopyPrepaymentFromVATPostingSetup(var VATPostingSetupFrom: Record "VAT Posting Setup")
- begin
- "Prepayment VAT %" := VATPostingSetup."VAT %";
- "Prepmt. VAT Calc. Type" := VATPostingSetup."VAT Calculation Type";
- "Prepayment VAT Identifier" := VATPostingSetup."VAT Identifier";
- if "Prepmt. VAT Calc. Type" in ["Prepmt. VAT Calc. Type"::"Reverse Charge VAT", "Prepmt. VAT Calc. Type"::"Sales Tax"] then
- ClearPrepaymentVATPct();
-
- OnAfterCopyPrepaymentFromVATPostingSetup(Rec, VATPostingSetupFrom);
- end;
-
- internal procedure TestPurchaseJobFields()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeTestPurchaseJobFields(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if Rec."Job No." = '' then
- exit;
-
- Rec.TestField("Job Task No.");
- end;
-
- local procedure CheckAcquisitionCost()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckAcquisitionCost(Rec, IsHandled);
- if IsHandled then
- exit;
- TestField("FA Posting Type", "FA Posting Type"::"Acquisition Cost");
- end;
-
- internal procedure IsMatchedToReceiptOrOrder(): Boolean
- begin
- exit(("Receipt No." <> '') or IsMatchedToOrder());
- end;
-
- internal procedure IsMatchedToOrder(): Boolean
- begin
- CalcFields("Matched Order Lines");
- exit("Matched Order Lines" > 0);
- end;
-
- internal procedure IsMatchedToInvoiceCreditMemo(): Boolean
- begin
- CalcFields("Matched Inv./Cr. Memo Lines");
- exit("Matched Inv./Cr. Memo Lines" > 0);
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitDefaultDimensionSources(var PurchaseLine: Record "Purchase Line"; var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; FieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterAddItem(var PurchaseLine: Record "Purchase Line"; LastPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTransferExtendedTexts(var PurchaseLine: Record "Purchase Line"; var LastPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterAssignFieldsForNo(var PurchLine: Record "Purchase Line"; var xPurchLine: Record "Purchase Line"; PurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterAssignHeaderValues(var PurchLine: Record "Purchase Line"; PurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterAssignStdTxtValues(var PurchLine: Record "Purchase Line"; StandardText: Record "Standard Text")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterAssignGLAccountValues(var PurchLine: Record "Purchase Line"; GLAccount: Record "G/L Account"; PurchHeader: Record "Purchase Header"; xPurchaseLine: Record "Purchase Line"; var TempPurchaseLine: Record "Purchase Line" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterAssignItemValues(var PurchLine: Record "Purchase Line"; Item: Record Item; CurrentFieldNo: Integer; PurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterAssignItemChargeValues(var PurchLine: Record "Purchase Line"; ItemCharge: Record "Item Charge"; PurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterAssignFixedAssetValues(var PurchLine: Record "Purchase Line"; FixedAsset: Record "Fixed Asset"; PurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterAssignItemUOM(var PurchLine: Record "Purchase Line"; Item: Record Item; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterBlanketOrderLookup(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterDeleteItemChargeAssignment(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterDeleteChargeChargeAssgntProcedure(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetDeferralAmount(PurchaseLine: Record "Purchase Line"; var DeferralAmount: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetItem(var Item: Record Item; var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetItemTranslation(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; ItemTranslation: Record "Item Translation")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetPurchHeader(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; var Currency: Record Currency)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetPurchSetup(var PurchaseLine: Record "Purchase Line"; var PurchSetup: Record "Purchases & Payables Setup")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetFAPostingGroup(var PurchaseLine: Record "Purchase Line"; GLAccount: Record "G/L Account")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnAfterGetLineWithPrice(var LineWithPrice: Interface "Line With Price")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnAfterGetReservationQty(var PurchLine: Record "Purchase Line"; var QtyReserved: Decimal; var QtyReservedBase: Decimal; var QtyToReserve: Decimal; var QtyToReserveBase: Decimal; var Result: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterFilterLinesWithItemToPlan(var PurchaseLine: Record "Purchase Line"; var Item: Record Item; DocumentType: Option)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterFilterLinesForReservation(var PurchaseLine: Record "Purchase Line"; ReservationEntry: Record "Reservation Entry"; DocumentType: Enum "Purchase Document Type"; AvailabilityFilter: Text; Positive: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterFindDefaultFADeprBook(var PurchaseLine: Record "Purchase Line"; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterHasTypeToFillMandatoryFields(var PurchaseLine: Record "Purchase Line"; var ReturnValue: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitType(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateDirectUnitCost(var PurchLine: Record "Purchase Line"; xPurchLine: Record "Purchase Line"; CalledByFieldNo: Integer; CurrFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateLineDiscPct(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeAssignFieldsForQtyPerUOM(var PurchaseLine: Record "Purchase Line"; Item: Record Item; FieldNo: Integer; var IsHandled: Boolean; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeHandleDedicatedBin(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; IssueWarning: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetAbsMin(PurchaseLine: Record "Purchase Line"; QtyToHandle: Decimal; QtyHandled: Decimal; var Result: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateItemReference(var Rec: Record "Purchase Line"; xRec: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateItemChargeAssgnt(var PurchaseLine: Record "Purchase Line"; CallingFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateDirectUnitCost(var PurchLine: Record "Purchase Line"; xPurchLine: Record "Purchase Line"; CalledByFieldNo: Integer; CurrFieldNo: Integer; var Handled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateDirectUnitCostProcedure(var PurchLine: Record "Purchase Line"; CalledByFieldNo: Integer; var Handled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateOrderDateFromPlannedReceiptDate(var PurchaseLine: Record "Purchase Line"; CustomCalendarChange: array[2] of Record "Customized Calendar Change"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdatePlannedReceiptDateFromOrderDate(var PurchaseLine: Record "Purchase Line"; CustomCalendarChange: array[2] of Record "Customized Calendar Change"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateOrderDateFromRequestedReceiptDate(var PurchaseLine: Record "Purchase Line"; CustomCalendarChange: array[2] of Record "Customized Calendar Change"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeVerifyReservedQty(var PurchLine: Record "Purchase Line"; xPurchLine: Record "Purchase Line"; CalledByFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitHeaderDefaults(var PurchLine: Record "Purchase Line"; PurchHeader: Record "Purchase Header"; var TempPurchLine: record "Purchase Line" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitOutstandingQty(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitOutstandingAmount(var PurchLine: Record "Purchase Line"; xPurchLine: Record "Purchase Line"; PurchHeader: Record "Purchase Header"; Currency: Record Currency)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitQtyToInvoice(var PurchLine: Record "Purchase Line"; CurrFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitQtyToShip(var PurchLine: Record "Purchase Line"; CurrFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitQtyToReceive(var PurchLine: Record "Purchase Line"; CurrFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitQtyToReceive2(var PurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitQtyToReceive2Procedure(var PurchLine: Record "Purchase Line");
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetDefaultQuantity(var PurchLine: Record "Purchase Line"; var xPurchLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetDefaultGLAccountQuantity(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCalcInvDiscToInvoice(var PurchaseLine: Record "Purchase Line"; OldInvDiscAmtToInv: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCalcLineAmount(var PurchaseLine: Record "Purchase Line"; var LineAmount: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCalcVATAmountLines(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line"; QtyType: Option General,Invoicing,Shipping)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCalcQtyPerUnitOfMeasure(var PurchaseLine: Record "Purchase Line"; Item: Record Item; CallingFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCalcTotalAmtToAssign(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header"; Currency: Record Currency; TotalQtyToAssign: Decimal; var TotalAmtToAssign: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckReceiptRelation(PurchaseLine: Record "Purchase Line"; PurchRcptLine: Record "Purch. Rcpt. Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckRetShptRelation(var PurchaseLine: Record "Purchase Line"; ReturnShipmentLine: Record "Return Shipment Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCreateDim(var PurchLine: Record "Purchase Line"; CallingFieldNo: Integer; xPurchLine: Record "Purchase Line");
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetDeferralPostDate(var PurchaseLine: Record "Purchase Line"; PurchHeader: Record "Purchase Header"; var DeferralPostDate: Date);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetLineAmountToHandle(PurchLine: Record "Purchase Line"; QtyToHandle: Decimal; var LineAmount: Decimal; var LineDiscAmount: Decimal)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnAfterGetQtyPerUOM(var QtyPerUOM: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterSalesTaxCalculate(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header"; Currency: Record Currency)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterSalesTaxCalculateReverse(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header"; Currency: Record Currency)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterSelectMultipleItems(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetReservationFilters(var ReservEntry: Record "Reservation Entry"; PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterShowDimensions(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterShowItemChargeAssgnt(var PurchaseLine: Record "Purchase Line"; var ItemChargeAssgnmtPurch: Record "Item Charge Assignment (Purch)"; var ItemChargeAssignmentPurchPage: Page "Item Charge Assignment (Purch)")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterTestStatusOpen(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateDates(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateAmounts(var PurchLine: Record "Purchase Line"; var xPurchLine: Record "Purchase Line"; CurrFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateAmountsDone(var PurchLine: Record "Purchase Line"; var xPurchLine: Record "Purchase Line"; CurrFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateBaseAmounts(var PurchLine: Record "Purchase Line"; var xPurchLine: Record "Purchase Line"; CurrFieldNo: Integer; NewAmount: Decimal; NewAmountIncludingVAT: Decimal; NewVATBaseAmount: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateUnitCost(var PurchLine: Record "Purchase Line"; xPurchLine: Record "Purchase Line"; PurchHeader: Record "Purchase Header"; Item: Record Item; StockkeepingUnit: Record "Stockkeeping Unit"; Currency: Record Currency; GLSetup: Record "General Ledger Setup")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateICPartner(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateJobPrices(var PurchLine: Record "Purchase Line"; JobJnlLine: Record "Job Journal Line"; PurchRcptLine: Record "Purch. Rcpt. Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateWithWarehouseReceive(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateVATAmounts(var PurchaseLine: Record "Purchase Line"; TotalLineAmount: Decimal; TotalInvDiscAmount: Decimal; TotalAmount: Decimal; TotalAmountInclVAT: Decimal; TotalVATDifference: Decimal; TotalQuantityBase: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateVATOnLines(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line"; QtyType: Option General,Invoicing,Shipping)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateSalesCost(var PurchaseLine: Record "Purchase Line"; var SalesOrderLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateTotalAmounts(var PurchaseLine: Record "Purchase Line"; var PurchaseLine2: Record "Purchase Line"; var TotalAmount: Decimal; var TotalAmountInclVAT: Decimal; var TotalLineAmount: Decimal; var TotalInvDiscAmount: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeAddItems(var PurchaseLine: Record "Purchase Line"; SelectionFilter: Text; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeAssignHeaderValues(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCalcBaseQty(var PurchaseLine: Record "Purchase Line"; Qty: Decimal; FromFieldName: Text; ToFieldName: Text);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCalcInvDiscToInvoiceProcedure(var PurchaseLine: Record "Purchase Line"; Currency: Record Currency; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCalcIndirectCostPercent(var PurchaseLine: Record "Purchase Line"; UnitCostCurrency: Decimal; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCalcPrepaymentToDeduct(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeClearQtyIfBlank(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckAssosiatedSalesOrder(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckAssosiatedProdOrder(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckPrepmtAmounts(var PurchaseLine: Record "Purchase Line"; PurchHeader: Record "Purchase Header"; CurrentFieldNo: Integer; var IsHandled: Boolean; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckPrepmtAmtInvEmpty(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckWarehouse(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; var ShowDialogMessage: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckLocationOnWMS(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckNoAndQuantityForItemChargeAssgnt(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyFromItem(var PurchaseLine: Record "Purchase Line"; var Item: Record Item; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyFromGLAccount(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CallingFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnNotHandledCopyFromGLAccount(var PurchaseLine: Record "Purchase Line"; GLAccount: Record "G/L Account")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateDim(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; CurrentFieldNo: Integer; DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeBlanketOrderLookup(var PurchaseLine: Record "Purchase Line"; CallingFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCalcInvDiscToInvoice(var PurchaseLine: Record "Purchase Line"; CallingFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCalcVATAmountLines(PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line"; var IsHandled: Boolean; QtyType: Option General,Invoicing,Shipping)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckDirectUnitCost(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateTempJobJnlLine(var TempJobJournalLine: Record "Job Journal Line" temporary; PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; GetPrices: Boolean; CallingFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetDefaultBin(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; xPurchaseLine: record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetDeferralAmount(var PurchaseLine: Record "Purchase Line"; var DeferralAmount: Decimal; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetItemTranslation(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetFAPostingGroup(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetSKU(PurchaseLine: Record "Purchase Line"; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeEnsureDirectedPutawayandPickFalse(var PurchaseLine: Record "Purchase Line"; Location: Record Location; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeFindOrCreateRecordByNo(var PurchLine: Record "Purchase Line"; xPurchLine: Record "Purchase Line"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeFormatType(PurchaseLine: Record "Purchase Line"; var FormattedType: Text[20]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetVPGInvRoundAcc(PurchHeader: Record "Purchase Header"; Vendor: Record Vendor; var AccountNo: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetReservationQty(var PurchaseLine: Record "Purchase Line"; var QtyReserved: Decimal; var QtyReservedBase: Decimal; var QtyToReserve: Decimal; var QtyToReserveBase: Decimal; var Result: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitJobFields(var PurchLine: Record "Purchase Line"; var xPurchLine: Record "Purchase Line"; var IsHandled: Boolean; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitDeferralCode(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitQtyToInvoice(var PurchaseLine: Record "Purchase Line"; CurrFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitQtyToReceive(var PurchaseLine: Record "Purchase Line"; CurrFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitQtyToShip(var PurchaseLine: Record "Purchase Line"; CurrFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitOutstandingAndQtyToShipReceive(var PurchaseLine: Record "Purchase Line"; var TempPurchLine: Record "Purchase Line" temporary; var IsHandled: Boolean; var xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeJobSetCurrencyFactor(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeJobTaskIsSet(PurchLine: Record "Purchase Line"; var IsJobLine: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupBinCode(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupBlanketOrderNo(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupShortcutDimCode(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line"; FieldNumber: Integer; var ShortcutDimCode: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeMaxQtyToInvoice(PurchaseLine: Record "Purchase Line"; var MaxQty: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeMaxQtyToInvoiceBase(PurchaseLine: Record "Purchase Line"; var MaxQty: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOpenItemTrackingLines(PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSelectMultipleItems(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetUnitOfMeasure(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetVendorItemNo(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowDeferrals(PurchaseLine: Record "Purchase Line"; var ReturnValue: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowDimensions(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowReservation(PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowReservationEntries(PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowBinCodeCannotBeChangedError(PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnShowEarlyOrderDateMessageOnAfterCalcShowMessage(PurchaseLine: Record "Purchase Line"; var ShowMessage: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTestStatusOpen(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; xPurchaseLine: Record "Purchase Line"; CallingFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateDates(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateJobFields(var PurchLine: Record "Purchase Line"; var xPurchLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateJobPrices(var PurchLine: Record "Purchase Line"; JobJnlLine: Record "Job Journal Line"; PurchRcptLine: Record "Purch. Rcpt. Line"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateLeadTimeFields(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateLineDiscPct(var PurchaseLine: Record "Purchase Line"; Currency: Record Currency; var IsHandled: Boolean; CurrentFiledNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdatePrepmtAmounts(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdatePrepmtSetupFields(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdatePrepmtSetupFieldsOnBeforeGetVATPostingSetup(var PurchaseLine: Record "Purchase Line"; GLAccount: Record "G/L Account"; var VATPostingSetup: Record "VAT Posting Setup"; var VATPostingSetupRetrieved: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdatePrepmtSetupFieldsOnBeforeClearVATPostingSetup(var PurchaseLine: Record "Purchase Line"; var VATPostingSetup: Record "VAT Posting Setup"; var SkipClear: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateAmounts(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateVATAmounts(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateSalesCost(var PurchaseLine: Record "Purchase Line"; var SalesOrderLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateSpecialSalesOrderLineFromOnDelete(var PurchaseLine: Record "Purchase Line"; var SalesOrderLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesCostOnBeforeGetSalesOrderLine(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateSalesCostFromUnitCostLCY(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateUnitCost(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateUnitPriceLCYFromItem(var PurchaseLine: Record "Purchase Line"; Item: Record "Item"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateUOMQtyPerStockQty(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; var Item: Record Item; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateWithWarehouseReceive(var PurchaseLine: Record "Purchase Line"; var InHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateBlanketOrderLineNo(var PurchaseLine: Record "Purchase Line"; var InHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateDescription(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var InHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateGenProdPostingGroup(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var InHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateJobPlanningLineNo(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateOrderDate(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; TrackingBlocked: Boolean; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateVATProdPostingGroupFromGLAcc(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateLeadTimeCalculation(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var InHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePlannedReceiptDate(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; TrackingBlocked: Boolean; var InHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateItemDescription(var PurchaseLine: Record "Purchase Line"; var InHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateLineDiscountAmount(var PurchaseLine: Record "Purchase Line"; var InHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePlannedReceiptDateWithCustomCalendarChange(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line"; var InHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePrepmtLineAmount(var PurchaseLine: Record "Purchase Line"; PrePaymentLineAmountEntered: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePromisedReceiptDate(var PurchaseLine: Record "Purchase Line"; CallingFieldNo: Integer; var IsHandled: Boolean; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateLineDiscountPctForNotItemType(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateQuantityInvIsBalanced(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateQuantityReceiveIsBalanced(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateQuantityReturnIsBalanced(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateReturnReasonCode(var PurchaseLine: Record "Purchase Line"; CallingFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateType(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateQtytoInvoiceBase(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var InHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateQtytoReceiveBase(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var InHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateReturnQtytoShipBase(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var InHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckLineAmount(var PurchaseLine: Record "Purchase Line"; MaxLineAmount: Decimal; var IsHandled: Boolean; CalledByFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckLineTypeOnIndirectCostPercentUpdate(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeVerifyLineTypeForJob(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCreateTempJobJnlLine(var JobJournalLine: Record "Job Journal Line"; PurchLine: Record "Purchase Line"; xPurchLine: Record "Purchase Line"; GetPrices: Boolean; CurrFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateShortcutDimCode(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line"; FieldNumber: Integer; var ShortcutDimCode: Code[20])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateLocationCode(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShortcutDimCode(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line"; FieldNumber: Integer; var ShortcutDimCode: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCalcVATAmountLinesOnAfterCalcLineTotals(var VATAmountLine: Record "VAT Amount Line"; PurchaseHeader: Record "Purchase Header"; PurchaseLine: Record "Purchase Line"; Currency: Record Currency; QtyType: Option General,Invoicing,Shipping; var TotalVATAmount: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCalcVATAmountLinesAfterVATAmountLineInsertNewLine(var PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCalcVATAmountLinesOnAfterSetFilters(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCalcVATAmountLinesOnBeforeVATAmountLineSumLine(PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line"; QtyType: Option General,Invoicing,Shipping; var PurchaseLine2: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCalcVATAmountLinesOnBeforeProcessPurchLine(var PurchaseLine: Record "Purchase Line"; var PurchHeader: Record "Purchase Header"; var VATAmountLine: Record "VAT Amount Line"; QtyType: Option General,Invoicing,Shipping)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCalcVATAmountLinesOnQtyTypeInvoicingOnBeforeCalcAmtToHandle(var PurchLine: Record "Purchase Line"; var PurchHeader: Record "Purchase Header"; var QtyToHandle: Decimal; var VATAmountLine: record "VAT Amount Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckLocationRequireReceiveOnBeforePurchaseLineVerifyChange(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckWarehouseOnBeforeShowDialog(var PurchLine: Record "Purchase Line"; Location2: Record Location; var ShowDialog: Option " ",Message,Error; var DialogText: Text[50])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyFromItemOnAfterCheck(var PurchaseLine: Record "Purchase Line"; Item: Record Item; CallingFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCreateDimOnBeforeUpdateGlobalDimFromDimSetID(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCreateTempJobJnlLineOnBeforeTempJobJnlLineValidateNo(var TempJobJnlLine: Record "Job Journal Line" temporary; PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnDeleteOnAfterSetPurchLineFilters(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnDeleteOnBeforePurchLineDeleteAll(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnDeleteOnBeforeTestStatusOpen(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnGetFAPostingGroupOnBeforeLocalGLAccGet(PurchaseLine: Record "Purchase Line"; FAPostingGroup: Record "FA Posting Group"; var GLAccount: Record "G/L Account"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSendLineInvoiceDiscountResetNotification(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnFilterLinesForReservationOnBeforeSetFilterVariantCode(var PurchaseLine: Record "Purchase Line"; var ReservationEntry: Record "Reservation Entry"; var Positive: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitQtyToReceive2OnBeforeCalcInvDiscToInvoice(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitOutstandingOnBeforeInitOutstandingAmount(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnShowItemChargeAssgntOnBeforeCalcItemCharge(var PurchaseLine: Record "Purchase Line"; var ItemChargeAssgntLineAmt: Decimal; Currency: Record Currency; var IsHandled: Boolean; var ItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateDirectUnitCostOnBeforeFindPrice(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; CalledByFieldNo: Integer; CallingFieldNo: Integer; var IsHandled: Boolean; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateDeferralAmountsOnBeforeSetDeferralPostDate(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var DeferralPostDate: Date)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateUnitCostOnBeforeUpdateUnitCostLCY(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header"; CurrentFieldNo: Integer; Item: Record Item; SKU: Record "Stockkeeping Unit"; Currency: Record Currency; GLSetup: Record "General Ledger Setup")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnAfterSetFilters(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnAfterCalculateAmounts(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnAfterCalculateNewAmount(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header"; VATAmountLine: Record "VAT Amount Line"; VATAmountLineReminder: Record "VAT Amount Line"; var NewAmountIncludingVAT: Decimal; VATAmount: Decimal; var NewAmount: Decimal; var NewVATBaseAmount: Decimal; var CurrentPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnAfterCalculateVATDifference(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header"; VATAmountLine: Record "VAT Amount Line"; var TempVATAmountLineReminder: Record "VAT Amount Line" temporary; QtyType: Option General,Invoicing,Shipping; var CurrentPurchaseLine: Record "Purchase Line"; LineAmountToInvoice: Decimal; InvDiscAmount: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnBeforeCalculateAmounts(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnBeforeInitOutstanding(var PurchaseLine: Record "Purchase Line"; QtyType: Option General,Invoicing,Shipping);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnBeforeTempVATAmountLineRemainderModify(var PurchaseLine: Record "Purchase Line"; var TempVATAmountLineRemainder: Record "VAT Amount Line"; VATAmount: Decimal; NewVATBaseAmount: Decimal; var CurrentPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnBeforeCalcNotFullVATAmount(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header"; var Currency: record Currency; var VATAmountLine: Record "VAT Amount Line"; var TempVATAmountLineRemainder: Record "VAT Amount Line"; NewVATBaseAmount: decimal; VATAmount: decimal; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateJobNoOnBeforeGetJob(var PurchLine: Record "Purchase Line"; var xPurchLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateBinCodeOnBeforeTestFields(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateDescriptionOnAfterCalcShouldErrorForFindDescription(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line"; var ShouldErrorForFindDescription: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateExpectedReceiptDateOnBeforeCheckDateConflict(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateLineAmountOnAfterCalcMaxLineAmount(var PurchaseLine: Record "Purchase Line"; var MaxLineAmount: Decimal; var Currency: Record Currency)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateLineDiscountPercentOnAfterTestStatusOpen(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line"; CallingFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateLineDiscountPercentOnBeforeUpdateAmounts(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateLocationCodeOnBeforeDropShipmentError(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateLocationCodeOnBeforeSpecialOrderError(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; CurrFieldNo: Integer; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateTypeOnAfterCheckItem(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateTypeOnBeforeInitRec(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CallingFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateTypeOnCopyFromTempPurchLine(var PurchLine: Record "Purchase Line"; TempPurchaseLine: Record "Purchase Line" temporary; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateNoOnCopyFromTempPurchLine(var PurchLine: Record "Purchase Line"; TempPurchaseLine: Record "Purchase Line" temporary; xPurchLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateNoOnAfterAssignQtyFromXRec(var PurchaseLine: Record "Purchase Line"; TempPurchaseLine: Record "Purchase Line" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateNoOnAfterChecks(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CallingFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateNoOnAfterVerifyChange(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateNoOnBeforeInitRec(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CallingFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePurchasingCodeOnAfterAssignFields(var PurchaseLine: Record "Purchase Line"; Purchasing: Record Purchasing)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQtyToReceiveOnAfterCheck(var PurchaseLine: Record "Purchase Line"; CallingFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQtyToReceiveOnAfterInitQty(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line"; CallingFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQtyToReceiveOnBeforeInitQtyToReceive(var PurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQtyToReceiveOnAfterCalcQtyToReceiveBase(var PurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQtyToReceiveOnAfterCalcShouldCheckLocationRequireReceive(var PurchaseLine: Record "Purchase Line"; var ShouldCheckLocationRequireReceive: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQuantityOnBeforeDropShptCheck(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CallingFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQuantityOnBeforeInitQtyToReceive(var PurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQuantityOnBeforePurchaseLineVerifyChange(var PurchaseLine: Record "Purchase Line"; StatusCheckSuspended: Boolean; var IsHandled: Boolean; var xPurchaseLine: Record "Purchase Line");
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateReturnQtyToShipOnAfterCheck(var PurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateReturnQtyToShipOnAfterInitQty(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateUnitCostLCYOnAfterUpdateUnitCostCurrency(var PurchaseLine: Record "Purchase Line"; var UnitCostCurrency: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateUnitOfMeasureCodeOnBeforeDropShipmentError(PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateUnitOfMeasureCodeOnAfterCalcShouldUpdateItemReference(var PurchaseLine: Record "Purchase Line"; var ShouldUpdateItemReference: Boolean; var ShouldUpdateNonSubcontractingDocument: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateVariantCodeOnAfterValidationChecks(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CallingFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateVariantCodeOnBeforeDropShipmentError(PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateVATProdPostingGroupOnAfterVATPostingSetupGet(var VATPostingSetup: Record "VAT Posting Setup")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateVATProdPostingGroupOnAfterCalcShouldUpdateUnitCost(var PurchaseLine: Record "Purchase Line"; VATPostingSetup: Record "VAT Posting Setup"; var ShouldUpdateUnitCost: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateVATProdPostingGroupOnBeforeCheckVATCalcType(var PurchaseLine: Record "Purchase Line"; var VATPostingSetup: Record "VAT Posting Setup"; var IsHandled: Boolean; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateOverReceiptQuantity(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CalledByFieldNo: Integer; var Handled: Boolean)
- begin
- end;
-
- ///
- /// Determines if the line is a charge item line that has been at least partially assigned.
- ///
- /// True if the line is a charge item line that has been at least partially assigned, otherwise false.
- procedure AssignedItemCharge(): Boolean
- begin
- exit((Type = Type::"Charge (Item)") and ("No." <> '') and ("Qty. to Assign" < Quantity));
- end;
-
- ///
- /// Opens a page with deferral schedule for the purchase line.
- ///
- ///
- /// If the deferral schedule doesn't exist yet, a new one is created and commited before the page is opened.
- ///
- procedure ShowDeferralSchedule()
- var
- PurchaseHeader: Record "Purchase Header";
- begin
- PurchaseHeader.Get(Rec."Document Type", Rec."Document No.");
- ShowDeferrals(PurchaseHeader."Posting Date", PurchaseHeader."Currency Code");
- end;
-
- procedure RecalculateAmounts(DocumentType: Enum "Purchase Document Type"; DocumentNo: Code[20]; ExcludeLineNo: Integer)
- var
- PurchaseLine: Record "Purchase Line";
- begin
- PurchaseLine.SetRange("Document Type", DocumentType);
- PurchaseLine.SetRange("Document No.", DocumentNo);
- PurchaseLine.SetFilter("Line No.", '<>%1', ExcludeLineNo);
- PurchaseLine.SetFilter("Direct Unit Cost", '<>%1', 0);
- if PurchaseLine.FindSet(true) then
- repeat
- PurchaseLine.UpdateAmounts();
- PurchaseLine.Modify(true);
- until PurchaseLine.Next() = 0;
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterAssignResourceValues(var PurchaseLine: Record "Purchase Line"; Resource: Record Resource)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterAssignResourceUOM(var PurchaseLine: Record "Purchase Line"; Resource: Record Resource; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateVendorItemNoFromItemReference(var Rec: Record "Purchase Line"; xRec: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateBlanketOrderNoOnAfterCheck(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckBuyFromVendorNo(PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInternalLeadTimeDays(PurchaseLine: Record "Purchase Line"; PurchDate: Date; var TotalDays: DateFormula);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetPurchHeader(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean; var Currency: Record Currency; var HasPurchHeader: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeUpdateLineAmount(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; Currency: Record Currency; var LineAmountChanged: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeValidateJobTaskNo(xPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; CurrentFieldNo: Integer; var TempJobJournalLine: Record "Job Journal Line" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateNo(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeCheckLocationRequireReceive(var PurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeCheckLineNotShippedOrReceived(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterIsCreditDocType(PurchaseLine: Record "Purchase Line"; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterIsInvoiceDocType(var PurchaseLine: Record "Purchase Line"; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQuantityOnBeforeCheckRcptRetShptRelation(var PurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQuantityOnAfterCalcBaseQty(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQuantityOnAfterCalcDoInitOutstanding(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CallingFieldNo: Integer; var DoInitOutstanding: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQuantityOnAfterPlanPriceCalcByField(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateQtyToInvoice(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateQuantityBase(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CallingFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateVariantCodeOnBeforeUpdateItemReference(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateVariantCodeOnAfterUpdateItemReference(var PurchaseLine: Record "Purchase Line"; CallingFeildNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateRequestedReceiptDate(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; var CustomCalendarChange: array[2] of Record "Customized Calendar Change"; CurrFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckApplToItemLedgEntry(var PurchaseLine: Record "Purchase Line"; ItemLedgEntry: Record "Item Ledger Entry"; var Result: Code[10]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckReceiptRelation(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckRetShptRelation(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetOverheadRateFCY(var PurchaseLine: Record "Purchase Line"; var QtyPerUOM: Decimal; var Result: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnDeleteOnBeforePurchaseLineDelete(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnDeleteOnBeforeCheckQtyNotInvoiced(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyFromItemOnBeforeAssignUnitPriceLCY(var PurchaseLine: Record "Purchase Line"; var GLSetup: Record "General Ledger Setup"; var VATPostingSetup: Record "VAT Posting Setup"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSelectItemEntryOnBeforeSetRangeLocationCode(var PurchaseLine: Record "Purchase Line"; var ItemLedgEntry: Record "Item Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSelectItemEntryOnAfterItemLedgEntrySetFilters(var PurchaseLine: Record "Purchase Line"; var ItemLedgEntry: Record "Item Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateDirectUnitCostByFieldOnBeforeUpdateItemReference(var PurchaseLine: Record "Purchase Line"; var CalledByFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATAmountsOnAfterCalcNormalVATAmountsForPricesIncludingVAT(var PurchaseLine: Record "Purchase Line"; PurchHeader: Record "Purchase Header"; Currency: Record Currency; TotalAmount: Decimal; TotalAmountInclVAT: Decimal; var PurchaseLine2: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATAmountsOnAfterCalcNormalVATAmountsForPricesExcludingVAT(var PurchaseLine: Record "Purchase Line"; PurchHeader: Record "Purchase Header"; Currency: Record Currency; TotalAmount: Decimal; TotalAmountInclVAT: Decimal; var PurchaseLine2: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATAmountsOnAfterSetFilters(var PurchaseLine: Record "Purchase Line"; var PurchaseLine2: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATAmountsOnBeforePurchLineModify(var PurchaseLine: Record "Purchase Line"; var PurchLine2: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnBeforeProcessPurchLines(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; var PurchHeader: Record "Purchase Header"; var VATAmountLine: Record "VAT Amount Line"; var TempVATAmountLineRemainder: Record "VAT Amount Line" temporary; var LineWasModified: Boolean; var IsHandled: Boolean; QtyType: Option General,Invoicing,Shipping)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnBeforeProcessPurchLine(var PurchaseLine: Record "Purchase Line"; var PurchHeader: Record "Purchase Header"; var VATAmountLine: Record "VAT Amount Line"; QtyType: Option General,Invoicing,Shipping)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitType(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; var PurchHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOverReceiptProcessing(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrFieldNo: Integer; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTestFieldQuantity(var PurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateVATProdPostingGroup(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateLineDiscountPercent(var PurchaseLine: Record "Purchase Line"; DropInvoiceDiscountAmount: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateLocationCodeOnAfterTestStatusOpen(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; var ShouldExit: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateDimensionsFromJobTask(var PurchaseLine: Record "Purchase Line"; CurrFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitHeaderDefaultsOnBeforeSetVATBusPostingGroup(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateNoOnBeforeAssignQtyFromXRec(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAddItemOnBeforeInsert(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateVATProdPostingGroupOnAfterTestStatusOpen(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; var xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetReservationEntry(var ReservEntry: Record "Reservation Entry"; var PurchaseLine: Record "Purchase Line");
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetDefaultQuantity(var PurchLine: Record "Purchase Line"; var xPurchLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateICPartner(var PurchLine: Record "Purchase Line"; GLAcc: Record "G/L Account"; var PurchHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePurchasingCode(var PurchLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateLineAmountBeforeValidateLineDiscountAmount(var PurchLine: Record "Purchase Line"; Currency: Record Currency; var IsHandled: Boolean; CurrFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitOutstanding(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateQuantity(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateOrderDate(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateAmountOnAfterCalculateNormalVAT(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; var Currency: Record Currency)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateAmountIncludingVATOnAfterCalculateNormalVAT(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; var Currency: Record Currency)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQuantityOnBeforeCheckWithQuantityReceived(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQuantityOnAfterShouldCheckWithReturnQtyShipped(var PurchaseLine: Record "Purchase Line"; var ShouldCalcWithReturnQtyShipped: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQuantityOnBeforeCheckWMS(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQuantityOnAfterInitQty(var PurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATAmountsOnBeforeValidateLineDiscountPercent(PurchaseLine: Record "Purchase Line"; var PurchLine2: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateUnitOfMeasureCodeOnBeforeValidateQuantity(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; Item: Record Item)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnDeleteOnAfterCalcShouldModifySalesOrderLine(var PurchaseLine: Record "Purchase Line"; var ShouldModifySalesOrderLine: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetLineAmountToHandle(PurchaseLine: Record "Purchase Line"; var Currency: Record Currency; QtyToHandle: Decimal; var LineAmount: Decimal; var LineDiscAmount: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateUnitCostOnAfterCalcDiscountAmountPerQty(var PurchaseLine: Record "Purchase Line"; var DiscountAmountPerQty: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnDeleteOnAfterPurchLineDeleteAll(var PurchaseLine: Record "Purchase Line"; var PurchLine2: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateUnitCostOnAfterCalcStandardUnitCostLCY(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQtyToReceiveOnAfterCheckQty(var PurchaseLine: Record "Purchase Line"; CurrFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateVATProdPostingGroupOnBeforeGetVATPostingSetup(var PurchaseLine: Record "Purchase Line"; var VATPostingSetup: Record "VAT Posting Setup"; var IsHandled: Boolean; var xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateQuantityOnBeforeResetAmounts(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateJobLineDiscAmountLCY(var PurchaseLine: Record "Purchase Line"; var TempJobJnlLine: Record "Job Journal Line" temporary; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateJobLineType(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateJobUnitPrice(var PurchaseLine: Record "Purchase Line"; var TempJobJnlLine: Record "Job Journal Line" temporary; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateJobNo(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateJobLineDiscountPercent(var PurchaseLine: Record "Purchase Line"; var TempJobJnlLine: Record "Job Journal Line" temporary; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateJobLineDiscountAmount(var PurchaseLine: Record "Purchase Line"; var TempJobJnlLine: Record "Job Journal Line" temporary; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateJobUnitPriceLCY(var PurchaseLine: Record "Purchase Line"; var TempJobJnlLine: Record "Job Journal Line" temporary; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateJobLineAmount(var PurchaseLine: Record "Purchase Line"; var TempJobJnlLine: Record "Job Journal Line" temporary; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateJobLineAmountLCY(var PurchaseLine: Record "Purchase Line"; var TempJobJnlLine: Record "Job Journal Line" temporary; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnLineDiscountAmountOnValidateOnBeforeUpdateAmounts(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnModifyOnAfterSetFilters(var PurchaseLine: Record "Purchase Line"; var PurchaseLine2: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnAfterUpdateBaseAmounts(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var TempVATAmountLineRemainder: Record "VAT Amount Line" temporary; var VATAmountLine: Record "VAT Amount Line"; Currency: Record Currency)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateNoOnBeforeCheckReceiptNo(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnDeleteOnAfterUpdateAmounts(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnDeleteOnBeforeUpdateAmounts(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitTableValuePair(var TableValuePair: Dictionary of [Integer, Code[20]]; FieldNo: Integer; var IsHandled: Boolean; var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitTableValuePair(var TableValuePair: Dictionary of [Integer, Code[20]]; FieldNo: Integer; var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckWarehouseOnAfterSetLocation2(var PurchaseLine: Record "Purchase Line"; var Location2: Record Location)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateLineAmount(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CurrentFieldNo: Integer; var IsHandled: Boolean; Currency: Record Currency)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeZeroAmountLine(var PurchaseLine: Record "Purchase Line"; QtyType: Option General,Invoicing,Shipping; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCalcVATAmountLinesOnBeforeAssignQuantities(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var VATAmountLine: record "VAT Amount Line"; var QtyToHandle: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCreateDimFromDefaultDimOnBeforeCreateDim(PurchaseLine: Record "Purchase Line"; DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; FieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCreateDimFromDefaultDim(var PurchaseLine: Record "Purchase Line"; var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; FieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetDefaultBin(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATAmountsOnBeforeCalcAmounts(var PurchaseLine: Record "Purchase Line"; var PurchaseLine2: Record "Purchase Line"; var TotalAmount: Decimal; TotalAmountInclVAT: Decimal; var TotalLineAmount: Decimal; var TotalInvDiscAmount: Decimal; var TotalQuantityBase: Decimal; TotalVATDifference: Decimal; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetDate(var PurchaseLine: Record "Purchase Line"; var ResultDate: Date; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnGetSignedValue(var PurchaseLine: Record "Purchase Line"; Value: Decimal; var Result: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateTypePurchaseLine(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line"; var TempPurchaseLine: Record "Purchase Line" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateNoPurchaseLine(var PurchaseLine: Record "Purchase Line"; var xPurchaseLine: Record "Purchase Line"; var TempPurchaseLine: Record "Purchase Line" temporary; PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeAttachToInventoryItemLine(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateJobPlanningLineNoOnBeforeGLAccountTest(var PurchaseLine: Record "Purchase Line"; var JobPlanningLine: Record "Job Planning Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateJobPlanningLineNoOnBeforeTestFields(var PurchaseLine: Record "Purchase Line"; var JobPlanningLine: Record "Job Planning Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterIsInbound(PurchaseLine: Record "Purchase Line"; var IsInboundDocument: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeBlanketOrderIsRelated(var CurrentPurchaseLine: Record "Purchase Line"; var BlanketOrderPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBlanketOrderIsRelatedOnAfterSetLoadFields(var BlanketOrderPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateDirectUnitCostByFieldOnAfterSetBlanketOrderPriceFields(PurchaseHeader: Record "Purchase Header"; BlanketOrderPurchaseLine: Record "Purchase Line"; var CurrentPurchaseLine: Record "Purchase Line"; CalledByFieldNo: Integer; CurrentFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdatePrePaymentAmounts(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
-#pragma warning disable AS0077
- [IntegrationEvent(true, false)]
- local procedure OnValidateNoOnBeforeJobTaskIsSet(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; TempPurchaseLine: Record "Purchase Line" temporary; var IsHandled: Boolean)
- begin
- end;
-#pragma warning restore AS0077
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateVariantCodeBeforeCheckBlocked(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateBlanketOrderLineNo(var PurchaseLine: Record "Purchase Line"; BlanketOrderPurchLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckIfPurchaseLineMeetsReservedFromStockSetting(QtyToPost: Decimal; ReservedFromStock: Enum "Reservation From Stock"; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCalcVATAmountLinesOnAfterCalcShouldProcessRounding(var PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line"; var TotalVATAmount: Decimal; Currency: Record Currency; var ShouldProcessRounding: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCalcVATAmountLinesOnBeforeVATAmountLineUpdateLines(var PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line"; var TotalVATAmount: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetVendorItemNo(var PurchaseLine: Record "Purchase Line"; ItemVendor: Record "Item Vendor"; Item: Record Item)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnShowDimensionsOnAfterEditDimensionSet(var PurchaseLine: Record "Purchase Line"; OldDimensionSetId: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyFromItemOnAfterGetItemTranslation(var PurchaseLine: Record "Purchase Line"; var Item: Record Item)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateDirectUnitCostOnBeforeValidateLineDiscPct(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeConfirmReceivedShippedItemDimChange(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetVatBaseDiscountPct(var PurchaseLine: Record "Purchase Line"; var PurchaseHeader: Record "Purchase Header"; var Result: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateDirectUnitCostByFieldOnAfterCalcShouldExit(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; CalledByFieldNo: Integer; CurrFieldNo: Integer; var ShouldExit: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateDimensionsFromJobTask(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterClearQtyIfBlank(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; PurchasePayablesSetup: Record "Purchases & Payables Setup")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnTestProdOrderNo(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnTestWorkCenterNo(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSumVATAmountLineOnBeforeModify(var PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnIsProdOrder(var PurchaseLine: Record "Purchase Line"; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnIsWorkCenter(var PurchaseLine: Record "Purchase Line"; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInsertVATAmountOnBeforeInsert(var PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnIsSubcontractingCreditMemo(var PurchaseLine: Record "Purchase Line"; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnOpenItemTrackingLinesOnAfterCheck(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckAssosiatedProdOrder(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnFindVATAmountLineOnAfterSetFilters(var PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterReversedInternalLeadTimeDays(PurchaseLine: Record "Purchase Line"; PurchDate: Date; ReversedWhseHandlingTime: DateFormula; var TotalDays: DateFormula)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetPostingSetup(var PurchaseLine: Record "Purchase Line"; var VATPostingSetup: Record "VAT Posting Setup")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterClearVATPct(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterClearPrepaymentVATPct(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterClearVATDifference(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetVATPct(var PurchaseLine: Record "Purchase Line"; var VATPct: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetPrepaymentVATPct(var PurchaseLine: Record "Purchase Line"; var PrepaymentVATPct: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyFromVATPostingSetup(var PurchaseLine: Record "Purchase Line"; var VATPostingSetupFrom: Record "VAT Posting Setup")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPrepaymentFromVATPostingSetup(var PurchaseLine: Record "Purchase Line"; var VATPostingSetupFrom: Record "VAT Posting Setup")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnGetFAPostingGroupOnBeforeCheckGLAcc(var PurchaseLine: Record "Purchase Line"; var GLAccount: Record "G/L Account"; FADeprBook: Record "FA Depreciation Book"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnAfterUpdateLineAmount(var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; Currency: Record Currency; var LineAmountChanged: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateLocationCodeOnBeforeSetInboundWhseHandlingTime(CurrFieldNo: Integer; var PurchaseLine: Record "Purchase Line"; xPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnValidateOrderDateOnBeforeCheckDateConflict(var PurchaseLine: Record "Purchase Line"; CurrFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateUnitCostOnBeforeCalcStandardUnitCostLCY(var PurchaseLine: Record "Purchase Line"; var ShouldCalcStandardUnitCostLCY: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateIndirectCostOnAfterCalcShouldCheckCostingMethod(var PurchaseLine: Record "Purchase Line"; var ShouldCheckCostingMethod: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnBeforeModifyPurchLine(var PurchaseLine: Record "Purchase Line"; VATAmount: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTestPurchaseJobFields(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInsertOnAfterLockTable(var PurchaseLine: Record "Purchase Line"; CurrFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterModifyOnAfterVerifyChange(var PurchaseLine: Record "Purchase Line"; CurrFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateItemChargeAssgntOnBeforeItemChargeAssignmentPurchModify(var PurchaseLine: Record "Purchase Line"; var ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckAcquisitionCost(var PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckIsLineAmountToInvoiceSimple(PurchHeader: Record "Purchase Header"; var IsLineAmountToInvoiceSimple: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCalcVATAmountLinesOnBeforeAssignShippingQuantities(var PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var VATAmountLine: record "VAT Amount Line"; var QtyToHandle: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCalcVATAmountLinesOnQtyTypeShippingOnBeforeCalcAmtToHandle(var PurchLine: Record "Purchase Line"; var PurchHeader: Record "Purchase Header"; var QtyToHandle: Decimal; var VATAmountLine: record "VAT Amount Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterIsServiceCharge(var PurchaseLine: Record "Purchase Line"; var ServiceCharged: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateGenBusPostingGroupOnBeforeValidateVATBusPostingGroup(var PurchaseLine: Record "Purchase Line"; var ValidateVATBusPostingGroup: Boolean)
- begin
- end;
-
- ///
- /// Raised after setting the hide validation dialog flag on the purchase line.
- ///
- /// The purchase line being processed.
- /// The new hide validation dialog value.
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetHideValidationDialog(var PurchaseLine: Record "Purchase Line"; NewHideValidationDialog: Boolean)
- begin
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Purchases/Document/PurchaseOrder.Page.al b/src/Layers/NL/BaseApp/Purchases/Document/PurchaseOrder.Page.al
index 5aea68dcaf..400c0d95dd 100644
--- a/src/Layers/NL/BaseApp/Purchases/Document/PurchaseOrder.Page.al
+++ b/src/Layers/NL/BaseApp/Purchases/Document/PurchaseOrder.Page.al
@@ -447,16 +447,6 @@ page 50 "Purchase Order"
Editable = IsPostingGroupEditable;
Importance = Additional;
}
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the transaction mode used in telebanking.';
- }
- field("Bank Account Code"; Rec."Bank Account Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the vendor''s bank account that is used for payments and collections through telebanking.';
- }
field("Payment Terms Code"; Rec."Payment Terms Code")
{
ApplicationArea = Suite;
diff --git a/src/Layers/NL/BaseApp/Purchases/Document/PurchaseQuote.Page.al b/src/Layers/NL/BaseApp/Purchases/Document/PurchaseQuote.Page.al
index 3ca9b35202..da78b8e473 100644
--- a/src/Layers/NL/BaseApp/Purchases/Document/PurchaseQuote.Page.al
+++ b/src/Layers/NL/BaseApp/Purchases/Document/PurchaseQuote.Page.al
@@ -60,6 +60,7 @@ page 49 "Purchase Quote"
trigger OnValidate()
begin
+ IsPurchaseLinesEditable := Rec.PurchaseLinesEditable();
Rec.OnAfterValidateBuyFromVendorNo(Rec, xRec);
CurrPage.Update();
end;
@@ -386,16 +387,6 @@ page 49 "Purchase Quote"
Importance = Additional;
Visible = IsPaymentMethodCodeVisible;
}
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = Advanced;
- ToolTip = 'Specifies the transaction mode used in telebanking.';
- }
- field("Bank Account Code"; Rec."Bank Account Code")
- {
- ApplicationArea = Advanced;
- ToolTip = 'Specifies the vendor''s bank account that is used for payments and collections through telebanking.';
- }
field("Transaction Type"; Rec."Transaction Type")
{
ApplicationArea = Basic, Suite;
diff --git a/src/Layers/NL/BaseApp/Purchases/Document/PurchaseReturnOrder.Page.al b/src/Layers/NL/BaseApp/Purchases/Document/PurchaseReturnOrder.Page.al
deleted file mode 100644
index d6dcce8c84..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/Document/PurchaseReturnOrder.Page.al
+++ /dev/null
@@ -1,2026 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.Document;
-
-using Microsoft.CRM.Contact;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.VAT.Calculation;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Attachment;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Intercompany;
-using Microsoft.Intercompany.GLAccount;
-using Microsoft.Purchases.Comment;
-using Microsoft.Purchases.History;
-using Microsoft.Purchases.Payables;
-using Microsoft.Purchases.Posting;
-using Microsoft.Purchases.Setup;
-using Microsoft.Purchases.Vendor;
-using Microsoft.Utilities;
-using Microsoft.Warehouse.Activity;
-using Microsoft.Warehouse.Document;
-using Microsoft.Warehouse.InventoryDocument;
-using Microsoft.Warehouse.Request;
-using System.Automation;
-using System.Security.User;
-using System.Threading;
-
-page 6640 "Purchase Return Order"
-{
- Caption = 'Purchase Return Order';
- PageType = Document;
- RefreshOnActivate = true;
- SourceTable = "Purchase Header";
- SourceTableView = where("Document Type" = filter("Return Order"));
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field("No."; Rec."No.")
- {
- ApplicationArea = PurchReturnOrder;
- Importance = Promoted;
- ToolTip = 'Specifies the number of the involved entry or record, according to the specified number series.';
- Visible = DocNoVisible;
-
- trigger OnAssistEdit()
- begin
- if Rec.AssistEdit(xRec) then
- CurrPage.Update();
- end;
- }
- field("Buy-from Vendor No."; Rec."Buy-from Vendor No.")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Vendor No.';
- Importance = Additional;
- NotBlank = true;
- ToolTip = 'Specifies the number of the vendor who returns the products.';
-
- trigger OnValidate()
- begin
- IsPurchaseLinesEditable := Rec.PurchaseLinesEditable();
- Rec.OnAfterValidateBuyFromVendorNo(Rec, xRec);
- CurrPage.Update();
- end;
- }
- field("Buy-from Vendor Name"; Rec."Buy-from Vendor Name")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Vendor Name';
- Importance = Promoted;
- ShowMandatory = true;
- ToolTip = 'Specifies the name of the vendor who returns the products.';
-
- trigger OnAfterLookup(Selected: RecordRef)
- var
- Vendor: Record Vendor;
- begin
- Selected.SetTable(Vendor);
- if Rec."Buy-from Vendor No." <> Vendor."No." then begin
- Rec.Validate("Buy-from Vendor No.", Vendor."No.");
- if Rec."Buy-from Vendor No." <> Vendor."No." then
- error('');
- IsPurchaseLinesEditable := Rec.PurchaseLinesEditable();
- CurrPage.Update();
- end;
- end;
-
- trigger OnValidate()
- begin
- Rec.OnAfterValidateBuyFromVendorNo(Rec, xRec);
- CurrPage.Update();
- end;
- }
- field("Buy-from Vendor Name 2"; Rec."Buy-from Vendor Name 2")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Vendor Name 2';
- Importance = Additional;
- QuickEntry = false;
- Visible = false;
- }
- group("Buy-from")
- {
- Caption = 'Buy-from';
- field("Buy-from Address"; Rec."Buy-from Address")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Address';
- Importance = Additional;
- ToolTip = 'Specifies the vendor''s buy-from address.';
- }
- field("Buy-from Address 2"; Rec."Buy-from Address 2")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Address 2';
- Importance = Additional;
- ToolTip = 'Specifies an additional part of the vendor''s buy-from address.';
- }
- field("Buy-from City"; Rec."Buy-from City")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'City';
- Importance = Additional;
- }
- group(Control69)
- {
- ShowCaption = false;
- Visible = IsBuyFromCountyVisible;
- field("Buy-from County"; Rec."Buy-from County")
- {
- ApplicationArea = PurchReturnOrder;
- CaptionClass = '5,1,' + Rec."Buy-from Country/Region Code";
- Importance = Additional;
- ToolTip = 'Specifies the county of the address.';
- }
- }
- field("Buy-from Post Code"; Rec."Buy-from Post Code")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Post Code';
- Importance = Additional;
- ToolTip = 'Specifies the postal code.';
- }
- field("Buy-from Country/Region Code"; Rec."Buy-from Country/Region Code")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Country/Region';
- Importance = Additional;
- ToolTip = 'Specifies the country or region of the address.';
-
- trigger OnValidate()
- begin
- IsBuyFromCountyVisible := FormatAddress.UseCounty(Rec."Buy-from Country/Region Code");
- end;
- }
- field("Buy-from Contact No."; Rec."Buy-from Contact No.")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Contact No.';
- Importance = Additional;
-
- trigger OnLookup(var Text: Text): Boolean
- begin
- if not Rec.BuyfromContactLookup() then
- exit(false);
- Text := Rec."Buy-from Contact No.";
- CurrPage.Update();
- exit(true);
- end;
-
- trigger OnValidate()
- begin
- if xRec."Buy-from Contact No." <> Rec."Buy-from Contact No." then
- CurrPage.Update();
- end;
- }
- field(BuyFromContactPhoneNo; BuyFromContact."Phone No.")
- {
- ApplicationArea = Suite;
- Caption = 'Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the vendor contact person.';
- }
- field(BuyFromContactMobilePhoneNo; BuyFromContact."Mobile Phone No.")
- {
- ApplicationArea = Suite;
- Caption = 'Mobile Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the vendor contact person.';
- }
- field(BuyFromContactEmail; BuyFromContact."E-Mail")
- {
- ApplicationArea = Suite;
- Caption = 'Email';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the email address of the vendor contact person.';
- }
- }
- field("Buy-from Contact"; Rec."Buy-from Contact")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Contact';
- Editable = Rec."Buy-from Vendor No." <> '';
- ToolTip = 'Specifies the name of the vendor contact person.';
-
- trigger OnLookup(var Text: Text): Boolean
- begin
- Rec.LookupBuyFromContact();
- CurrPage.Update();
- end;
- }
- field("Document Date"; Rec."Document Date")
- {
- ApplicationArea = PurchReturnOrder;
- }
- field("Posting Date"; Rec."Posting Date")
- {
- ApplicationArea = PurchReturnOrder;
- Importance = Additional;
- ToolTip = 'Specifies the posting date of the record.';
-
- trigger OnValidate()
- begin
- SaveInvoiceDiscountAmount();
- end;
- }
- field("VAT Reporting Date"; Rec."VAT Reporting Date")
- {
- ApplicationArea = VAT;
- Importance = Additional;
- Editable = VATDateEnabled;
- Visible = VATDateEnabled;
- }
- field("No. of Archived Versions"; Rec."No. of Archived Versions")
- {
- ApplicationArea = PurchReturnOrder;
- Importance = Additional;
- }
- field("Order Date"; Rec."Order Date")
- {
- ApplicationArea = PurchReturnOrder;
- Importance = Additional;
- }
- field("Vendor Authorization No."; Rec."Vendor Authorization No.")
- {
- ApplicationArea = PurchReturnOrder;
- Importance = Additional;
- ToolTip = 'Specifies the identification number of a compensation agreement. This number is sometimes referred to as the RMA No.(Returns Materials Authorization).';
- }
- field("Vendor Cr. Memo No."; Rec."Vendor Cr. Memo No.")
- {
- ApplicationArea = PurchReturnOrder;
- Importance = Promoted;
- ShowMandatory = true;
- ToolTip = 'Specifies the number that the vendor uses for the credit memo you are creating in this purchase return order.';
- }
- field("Purchaser Code"; Rec."Purchaser Code")
- {
- ApplicationArea = PurchReturnOrder;
-
- trigger OnValidate()
- begin
- PurchaserCodeOnAfterValidate();
- end;
- }
- field("Campaign No."; Rec."Campaign No.")
- {
- ApplicationArea = RelationshipMgmt;
- }
- field("Responsibility Center"; Rec."Responsibility Center")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- field("Assigned User ID"; Rec."Assigned User ID")
- {
- ApplicationArea = PurchReturnOrder;
- Importance = Additional;
- }
- field("Job Queue Status"; Rec."Job Queue Status")
- {
- ApplicationArea = All;
- Importance = Additional;
- ToolTip = 'Specifies the status of a job queue entry that handles the posting of purchase return orders.';
- Visible = JobQueueUsed;
-
- 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(Status; Rec.Status)
- {
- ApplicationArea = PurchReturnOrder;
- Importance = Promoted;
- StyleExpr = StatusStyleTxt;
- ToolTip = 'Specifies whether the document is open, released, pending approval, or pending prepayment.';
- }
- field("Language Code"; Rec."Language Code")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Format Region"; Rec."Format Region")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- }
- part(PurchLines; "Purchase Return Order Subform")
- {
- ApplicationArea = PurchReturnOrder;
- Editable = IsPurchaseLinesEditable;
- Enabled = IsPurchaseLinesEditable;
- SubPageLink = "Document No." = field("No.");
- UpdatePropagation = Both;
- }
- group("Invoice Details")
- {
- Caption = 'Invoice Details';
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = PurchReturnOrder;
- Importance = Promoted;
- ToolTip = 'Specifies the currency that is used on the entry.';
-
- trigger OnAssistEdit()
- begin
- if Rec."Posting Date" <> 0D then
- ChangeExchangeRate.SetParameter(Rec."Currency Code", Rec."Currency Factor", Rec."Posting Date")
- else
- ChangeExchangeRate.SetParameter(Rec."Currency Code", Rec."Currency Factor", WorkDate());
- if ChangeExchangeRate.RunModal() = ACTION::OK then begin
- Rec.Validate("Currency Factor", ChangeExchangeRate.GetParameter());
- SaveInvoiceDiscountAmount();
- end;
- Clear(ChangeExchangeRate);
- end;
-
- trigger OnValidate()
- begin
- CurrPage.SaveRecord();
- PurchCalcDiscByType.ApplyDefaultInvoiceDiscount(0, Rec);
- end;
- }
- field("Expected Receipt Date"; Rec."Expected Receipt Date")
- {
- ApplicationArea = PurchReturnOrder;
- Importance = Promoted;
- }
- field("Prices Including VAT"; Rec."Prices Including VAT")
- {
- ApplicationArea = VAT;
-
- trigger OnValidate()
- begin
- PricesIncludingVATOnAfterValid();
- end;
- }
- field("VAT Bus. Posting Group"; Rec."VAT Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Vendor Posting Group"; Rec."Vendor Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Editable = IsPostingGroupEditable;
- Importance = Additional;
- }
- field("Payment Terms Code"; Rec."Payment Terms Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Payment Method Code"; Rec."Payment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = IsPaymentMethodCodeVisible;
- }
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = PurchReturnOrder;
- ToolTip = 'Specifies the transaction mode used in telebanking.';
- }
- field("Bank Account Code"; Rec."Bank Account Code")
- {
- ApplicationArea = PurchReturnOrder;
- ToolTip = 'Specifies the vendor''s bank account that is used for payments and collections through telebanking.';
- }
- field("Shortcut Dimension 1 Code"; Rec."Shortcut Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
-
- trigger OnValidate()
- begin
- ShortcutDimension1CodeOnAfterV();
- end;
- }
- field("Shortcut Dimension 2 Code"; Rec."Shortcut Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
-
- trigger OnValidate()
- begin
- ShortcutDimension2CodeOnAfterV();
- end;
- }
- field("Location Code"; Rec."Location Code")
- {
- ApplicationArea = Location;
- Importance = Promoted;
- ToolTip = 'Specifies the code for the location from where the items are shipped. When you select the vendor and the vendor has a location assigned, the value is taken from the Vendor card. If the vendor has no location, but a Responsibility Center is populated, the location code is taken from the Responsibility Center. If neither is specified, the value is taken from Company Information. This field acts as the default location for new lines. You can update the location code for individual lines as needed.';
- }
- field("Applies-to Doc. Type"; Rec."Applies-to Doc. Type")
- {
- ApplicationArea = PurchReturnOrder;
- Importance = Promoted;
- }
- field("Applies-to Doc. No."; Rec."Applies-to Doc. No.")
- {
- ApplicationArea = PurchReturnOrder;
- Importance = Promoted;
- }
- field("Applies-to ID"; Rec."Applies-to ID")
- {
- ApplicationArea = PurchReturnOrder;
- }
- field("Journal Templ. Name"; Rec."Journal Templ. Name")
- {
- ApplicationArea = PurchReturnOrder;
- Visible = IsJournalTemplNameVisible;
- }
- field("Tax Liable"; Rec."Tax Liable")
- {
- ApplicationArea = SalesTax;
- ToolTip = 'Specifies that purchases from the vendor on the purchase header are liable for sales tax.';
- }
- field("Tax Area Code"; Rec."Tax Area Code")
- {
- ApplicationArea = SalesTax;
-
- trigger OnValidate()
- begin
- CurrPage.PurchLines.PAGE.RedistributeTotalsOnAfterValidate();
- end;
- }
- }
- group("Shipping and Payment")
- {
- Caption = 'Shipping and Payment';
- group(Control45)
- {
- ShowCaption = false;
- field(ShipToOptions; ShipToOptions)
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Ship-to';
- OptionCaption = 'Default (Vendor Address),Alternate Vendor Address,Custom Address';
- ToolTip = 'Specifies the address that the products on the purchase document are shipped to. Default (Company Address): The same as the company address specified in the Company Information window. Location: One of the company''s location addresses. Custom Address: Any ship-to address that you specify in the fields below.';
-
- trigger OnValidate()
- begin
- ValidateShippingOption();
- end;
- }
- }
- group(Control48)
- {
- ShowCaption = false;
- Visible = ShipToOptions = ShipToOptions::"Alternate Vendor Address";
- field("Order Address Code"; Rec."Order Address Code")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Alternate Vendor Address Code';
- }
- }
- group(Control62)
- {
- ShowCaption = false;
- field("Ship-to Name"; Rec."Ship-to Name")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Name';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- Importance = Additional;
- ToolTip = 'Specifies the name of the vendor sending the order.';
- }
- field("Ship-to Name 2"; Rec."Ship-to Name 2")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Name 2';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- Importance = Additional;
- ToolTip = 'Specifies an additional part of the name for the order address of the vendor.';
- QuickEntry = false;
- Visible = false;
- }
- field("Ship-to Address"; Rec."Ship-to Address")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Address';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- Importance = Additional;
- ToolTip = 'Specifies the vendor''s buy-from address.';
- }
- field("Ship-to Address 2"; Rec."Ship-to Address 2")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Address 2';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- Importance = Additional;
- ToolTip = 'Specifies an additional part of the vendor''s buy-from address.';
- }
- field("Ship-to City"; Rec."Ship-to City")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'City';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- Importance = Additional;
- }
- group(Control174)
- {
- ShowCaption = false;
- Visible = IsShipToCountyVisible;
- field("Ship-to County"; Rec."Ship-to County")
- {
- ApplicationArea = PurchReturnOrder;
- CaptionClass = '5,1,' + Rec."Ship-to Country/Region Code";
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- Importance = Additional;
- ToolTip = 'Specifies the county of the address.';
- }
- }
- field("Ship-to Post Code"; Rec."Ship-to Post Code")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Post Code';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- Importance = Additional;
- ToolTip = 'Specifies the postal code.';
- }
- field("Ship-to Country/Region Code"; Rec."Ship-to Country/Region Code")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Country/Region Code';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- Importance = Additional;
- ToolTip = 'Specifies the country or region of the address.';
-
- trigger OnValidate()
- begin
- IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
- end;
- }
- field("Ship-to Phone No."; Rec."Ship-to Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- Importance = Additional;
- }
- field("Ship-to Contact"; Rec."Ship-to Contact")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Contact';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- Importance = Additional;
- ToolTip = 'Specifies the name of the vendor contact person.';
- }
- }
- group("Pay-to")
- {
- Caption = 'Pay-to';
- field("Pay-to Name"; Rec."Pay-to Name")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Name';
- Importance = Promoted;
- ToolTip = 'Specifies the name of the vendor sending the order.';
-
- trigger OnValidate()
- begin
- if Rec.GetFilter("Pay-to Vendor No.") = xRec."Pay-to Vendor No." then
- if Rec."Pay-to Vendor No." <> xRec."Pay-to Vendor No." then
- Rec.SetRange("Pay-to Vendor No.");
-
- CurrPage.Update();
- end;
- }
- field("Pay-to Name 2"; Rec."Pay-to Name 2")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Name 2';
- Importance = Additional;
- QuickEntry = false;
- Visible = false;
- }
- field("Pay-to Address"; Rec."Pay-to Address")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Address';
- Editable = Rec."Buy-from Vendor No." <> Rec."Pay-to Vendor No.";
- Enabled = Rec."Buy-from Vendor No." <> Rec."Pay-to Vendor No.";
- Importance = Additional;
- ToolTip = 'Specifies the vendor''s buy-from address.';
- }
- field("Pay-to Address 2"; Rec."Pay-to Address 2")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Address 2';
- Editable = Rec."Buy-from Vendor No." <> Rec."Pay-to Vendor No.";
- Enabled = Rec."Buy-from Vendor No." <> Rec."Pay-to Vendor No.";
- Importance = Additional;
- ToolTip = 'Specifies an additional part of the vendor''s buy-from address.';
- }
- field("Pay-to City"; Rec."Pay-to City")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'City';
- Editable = Rec."Buy-from Vendor No." <> Rec."Pay-to Vendor No.";
- Enabled = Rec."Buy-from Vendor No." <> Rec."Pay-to Vendor No.";
- Importance = Additional;
- }
- group(Control79)
- {
- ShowCaption = false;
- Visible = IsPayToCountyVisible;
- field("Pay-to County"; Rec."Pay-to County")
- {
- ApplicationArea = PurchReturnOrder;
- CaptionClass = '5,1,' + Rec."Pay-to Country/Region Code";
- Editable = Rec."Buy-from Vendor No." <> Rec."Pay-to Vendor No.";
- Enabled = Rec."Buy-from Vendor No." <> Rec."Pay-to Vendor No.";
- Importance = Additional;
- ToolTip = 'Specifies the county of the address.';
- }
- }
- field("Pay-to Post Code"; Rec."Pay-to Post Code")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Post Code';
- Editable = Rec."Buy-from Vendor No." <> Rec."Pay-to Vendor No.";
- Enabled = Rec."Buy-from Vendor No." <> Rec."Pay-to Vendor No.";
- Importance = Additional;
- ToolTip = 'Specifies the postal code.';
- }
- field("Pay-to Country/Region Code"; Rec."Pay-to Country/Region Code")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Country/Region';
- Editable = Rec."Buy-from Vendor No." <> Rec."Pay-to Vendor No.";
- Enabled = Rec."Buy-from Vendor No." <> Rec."Pay-to Vendor No.";
- Importance = Additional;
- ToolTip = 'Specifies the country or region of the address.';
-
- trigger OnValidate()
- begin
- IsPayToCountyVisible := FormatAddress.UseCounty(Rec."Pay-to Country/Region Code");
- end;
- }
- field("Pay-to Contact No."; Rec."Pay-to Contact No.")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Contact No.';
- Enabled = Rec."Buy-from Vendor No." <> Rec."Pay-to Vendor No.";
- Importance = Additional;
- Visible = Rec."Buy-from Vendor No." <> Rec."Pay-to Vendor No.";
- }
- field(PayToContactPhoneNo; PayToContact."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the vendor contact person.';
- }
- field(PayToContactMobilePhoneNo; PayToContact."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mobile Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the vendor contact person.';
- }
- field(PayToContactEmail; PayToContact."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = Email;
- ToolTip = 'Specifies the email address of the vendor contact person.';
- }
- field("Pay-to Contact"; Rec."Pay-to Contact")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Contact';
- Editable = Rec."Buy-from Vendor No." <> Rec."Pay-to Vendor No.";
- Enabled = Rec."Buy-from Vendor No." <> Rec."Pay-to Vendor No.";
- Importance = Additional;
- ToolTip = 'Specifies the name of the vendor contact person.';
- }
- }
- }
- group("Foreign Trade")
- {
- Caption = 'Foreign Trade';
- field("Transaction Specification"; Rec."Transaction Specification")
- {
- ApplicationArea = BasicEU, BasicNO;
- }
- field("Transaction Type"; Rec."Transaction Type")
- {
- ApplicationArea = BasicEU, BasicNO;
- }
- field("Transport Method"; Rec."Transport Method")
- {
- ApplicationArea = BasicEU, BasicNO;
- }
- field("Entry Point"; Rec."Entry Point")
- {
- ApplicationArea = BasicEU, BasicNO;
- }
- field("Area"; Rec.Area)
- {
- ApplicationArea = BasicEU, BasicNO;
- }
- }
- }
- area(factboxes)
- {
- part(PurchaseDocCheckFactbox; "Purch. Doc. Check Factbox")
- {
- ApplicationArea = All;
- Caption = 'Document Check';
- Visible = PurchaseDocCheckFactboxVisible;
- SubPageLink = "No." = field("No."),
- "Document Type" = field("Document Type");
- }
- part("Attached Documents List"; "Doc. Attachment List Factbox")
- {
- ApplicationArea = All;
- Caption = 'Documents';
- UpdatePropagation = Both;
- SubPageLink = "Table ID" = const(Database::"Purchase Header"),
- "No." = field("No."),
- "Document Type" = field("Document Type");
- }
- part(Control21; "Pending Approval FactBox")
- {
- ApplicationArea = PurchReturnOrder;
- SubPageLink = "Table ID" = const(38),
- "Document Type" = field("Document Type"),
- "Document No." = field("No."),
- Status = const(Open);
- Visible = OpenApprovalEntriesExistForCurrUser;
- }
- part(ApprovalFactBox; "Approval FactBox")
- {
- ApplicationArea = PurchReturnOrder;
- Visible = false;
- }
- part(Control1901138007; "Vendor Details FactBox")
- {
- ApplicationArea = PurchReturnOrder;
- SubPageLink = "No." = field("Buy-from Vendor No."),
- "Date Filter" = field("Date Filter");
- Visible = false;
- }
- part(Control1904651607; "Vendor Statistics FactBox")
- {
- ApplicationArea = PurchReturnOrder;
- SubPageLink = "No." = field("Pay-to Vendor No."),
- "Date Filter" = field("Date Filter");
- }
- part(IncomingDocAttachFactBox; "Incoming Doc. Attach. FactBox")
- {
- ApplicationArea = Suite;
- ShowFilter = false;
- Visible = false;
- }
- part(Control1903435607; "Vendor Hist. Buy-from FactBox")
- {
- ApplicationArea = PurchReturnOrder;
- SubPageLink = "No." = field("Buy-from Vendor No."),
- "Date Filter" = field("Date Filter");
- }
- part(Control1906949207; "Vendor Hist. Pay-to FactBox")
- {
- ApplicationArea = PurchReturnOrder;
- SubPageLink = "No." = field("Pay-to Vendor No."),
- "Date Filter" = field("Date Filter");
- Visible = false;
- }
- part(Control3; "Purchase Line FactBox")
- {
- ApplicationArea = PurchReturnOrder;
- Provider = PurchLines;
- SubPageLink = "Document Type" = field("Document Type"),
- "Document No." = field("Document No."),
- "Line No." = field("Line No.");
- }
- part(WorkflowStatus; "Workflow Status FactBox")
- {
- ApplicationArea = PurchReturnOrder;
- Editable = false;
- Enabled = false;
- ShowFilter = false;
- Visible = ShowWorkflowStatus;
- }
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("&Return Order")
- {
- Caption = '&Return Order';
- Image = Return;
- action(PurchaseOrderStatistics)
- {
- 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 "Purchase Order Statistics";
- RunPageOnRec = true;
- }
- action(Vendor)
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Vendor';
- Enabled = Rec."Buy-from Vendor No." <> '';
- Image = Vendor;
- RunObject = Page "Vendor Card";
- RunPageLink = "No." = field("Buy-from Vendor No.");
- ShortCutKey = 'Shift+F7';
- ToolTip = 'View or edit detailed information about the vendor on the purchase document.';
- }
- action(VendorStatistics)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor Statistics';
- Enabled = Rec."Buy-from Vendor No." <> '';
- Image = Statistics;
- RunObject = Page "Vendor Statistics";
- RunPageLink = "No." = field("Buy-from Vendor No."),
- "Date Filter" = field("Date Filter");
- ToolTip = 'View statistical information, such as the value of posted entries, for the buy-from vendor on the purchase document.';
- }
- action(Dimensions)
- {
- AccessByPermission = TableData Dimension = R;
- ApplicationArea = Dimensions;
- Caption = 'Dimensions';
- Enabled = Rec."No." <> '';
- 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();
- CurrPage.SaveRecord();
- end;
- }
- action(Approvals)
- {
- AccessByPermission = TableData "Approval Entry" = R;
- ApplicationArea = PurchReturnOrder;
- 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.OpenApprovalsPurchase(Rec);
- end;
- }
- action("Co&mments")
- {
- ApplicationArea = Comments;
- Caption = 'Co&mments';
- Image = ViewComments;
- RunObject = Page "Purch. Comment Sheet";
- RunPageLink = "Document Type" = field("Document Type"),
- "No." = field("No."),
- "Document Line No." = const(0);
- ToolTip = 'View or add comments for the record.';
- }
- }
- group(Documents)
- {
- Caption = 'Documents';
- Image = Documents;
- action("Return Shipments")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Return Shipments';
- Image = Shipment;
- RunObject = Page "Posted Return Shipments";
- RunPageLink = "Return Order No." = field("No.");
- RunPageView = sorting("Return Order No.");
- ToolTip = 'Open the posted return shipments related to this order.';
- }
- action("Cred&it Memos")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Cred&it Memos';
- Image = CreditMemo;
- ToolTip = 'View a list of ongoing credit memos for the order.';
-
- trigger OnAction()
- var
- TempPurchCrMemoHdr: Record "Purch. Cr. Memo Hdr." temporary;
- PurchGetReturnShipment: Codeunit "Purch.-Get Return Shipments";
- begin
- PurchGetReturnShipment.GetPurchRetOrderCrMemos(TempPurchCrMemoHdr, Rec."No.");
- Page.Run(Page::"Posted Purchase Credit Memos", TempPurchCrMemoHdr);
- end;
- }
- separator(Action136)
- {
- }
- }
- group(Warehouse)
- {
- Caption = 'Warehouse';
- Image = Warehouse;
- action("Warehouse Shipment Lines")
- {
- ApplicationArea = Warehouse;
- Caption = 'Warehouse Shipment Lines';
- Image = ShipmentLines;
- RunObject = Page "Whse. Shipment Lines";
- RunPageLink = "Source Type" = const(39),
-#pragma warning disable AL0603
- "Source Subtype" = field("Document Type"),
-#pragma warning restore
- "Source No." = field("No.");
- RunPageView = sorting("Source Type", "Source Subtype", "Source No.", "Source Line No.");
- ToolTip = 'View ongoing warehouse shipments for the document, in advanced warehouse configurations.';
- }
- action("In&vt. Put-away/Pick Lines")
- {
- ApplicationArea = Warehouse;
- Caption = 'In&vt. Put-away/Pick Lines';
- Image = PickLines;
- RunObject = Page "Warehouse Activity List";
- RunPageLink = "Source Document" = const("Purchase Return Order"),
- "Source No." = field("No.");
- RunPageView = sorting("Source Document", "Source No.", "Location Code");
- ToolTip = 'View items that are inbound or outbound on inventory put-away or inventory pick documents for the purchase return order.';
- }
- action("Whse. Pick Lines")
- {
- ApplicationArea = Warehouse;
- Caption = 'Warehouse Pick Lines';
- Image = PickLines;
- RunObject = page "Warehouse Activity Lines";
- RunPageLink = "Source Document" = const("Purchase Return Order"), "Source No." = field("No.");
- RunPageView = sorting("Source Type", "Source Subtype", "Source No.");
- ToolTip = 'View ongoing warehouse picks for the document, in advanced warehouse configurations.';
- }
- }
- }
- area(processing)
- {
- group(Approval)
- {
- Caption = 'Approval';
- action(Approve)
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Approve';
- Image = Approve;
- ToolTip = 'Approve the requested changes.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.ApproveRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Reject)
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Reject';
- Image = Reject;
- ToolTip = 'Reject the requested changes.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.RejectRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Delegate)
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Delegate';
- Image = Delegate;
- ToolTip = 'Delegate the requested changes to the substitute approver.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.DelegateRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Comment)
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Comments';
- Image = ViewComments;
- ToolTip = 'View or add comments for the record.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.GetApprovalComment(Rec);
- end;
- }
- }
- action("&Print")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = '&Print';
- Ellipsis = true;
- Image = Print;
- ToolTip = 'Prepare to print the document. The report request window for the document opens where you can specify what to include on the print-out.';
-
- trigger OnAction()
- begin
- DocPrint.PrintPurchHeader(Rec);
- end;
- }
- action(Email)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Send by Email';
- Ellipsis = true;
- Image = Email;
- ToolTip = 'Finalize and prepare to email the document. The Send Email window opens prefilled with the vendor''s email address so you can add or edit information.';
-
- trigger OnAction()
- var
- DocPrint: Codeunit "Document-Print";
- begin
- DocPrint.EmailPurchHeader(Rec);
- end;
- }
- action(Send)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Send';
- Ellipsis = true;
- Image = SendToMultiple;
- ToolTip = 'Prepare to send the document according to the vendor''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()
- var
- PurchaseHeader: Record "Purchase Header";
- begin
- PurchaseHeader := Rec;
- CurrPage.SetSelectionFilter(PurchaseHeader);
- PurchaseHeader.SendRecords();
- end;
- }
- action(AttachAsPDF)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Attach as PDF';
- Image = PrintAttachment;
- ToolTip = 'Create a PDF file and attach it to the document.';
-
- trigger OnAction()
- var
- PurchaseHeader: Record "Purchase Header";
- begin
- PurchaseHeader := Rec;
- PurchaseHeader.SetRecFilter();
- DocPrint.PrintPurchaseHeaderToDocumentAttachment(PurchaseHeader);
- end;
- }
- group(Release)
- {
- Caption = 'Release';
- Image = ReleaseDoc;
- action("Re&lease")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Re&lease';
- Enabled = Rec.Status <> Rec.Status::Released;
- 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()
- begin
- Rec.PerformManualRelease();
- CurrPage.PurchLines.PAGE.ClearTotalPurchaseHeader();
- end;
- }
- action(Reopen)
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Re&open';
- Enabled = Rec.Status <> Rec.Status::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
- ReleasePurchDoc: Codeunit "Release Purchase Document";
- begin
- ReleasePurchDoc.PerformManualReopen(Rec);
- CurrPage.PurchLines.PAGE.ClearTotalPurchaseHeader();
- end;
- }
- separator(Action690)
- {
- }
- }
- group("F&unctions")
- {
- Caption = 'F&unctions';
- Image = "Action";
- action(GetPostedDocumentLinesToReverse)
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Get Posted Doc&ument Lines to Reverse';
- Ellipsis = true;
- Image = ReverseLines;
- ToolTip = 'Copy one or more posted purchase document lines in order to reverse the original order.';
-
- trigger OnAction()
- begin
- Rec.GetPstdDocLinesToReverse();
- CurrPage.PurchLines.Page.PurchaseDocTotalsNotUpToDate();
- CurrPage.PurchLines.Page.Update(false);
- end;
- }
- group(IncomingDocument)
- {
- Caption = 'Incoming Document';
- Image = Documents;
- action(IncomingDocCard)
- {
- ApplicationArea = Suite;
- Caption = 'View Incoming Document';
- Enabled = HasIncomingDocument;
- Image = ViewOrder;
- ToolTip = 'View any incoming document records and file attachments that exist for the entry or document, for example for auditing purposes';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.ShowCardFromEntryNo(Rec."Incoming Document Entry No.");
- end;
- }
- action(SelectIncomingDoc)
- {
- AccessByPermission = TableData "Incoming Document" = R;
- ApplicationArea = Suite;
- Caption = 'Select Incoming Document';
- Image = SelectLineToApply;
- ToolTip = 'Select an incoming document record and file attachment that you want to link to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- Rec.Validate("Incoming Document Entry No.", IncomingDocument.SelectIncomingDocument(Rec."Incoming Document Entry No.", Rec.RecordId));
- end;
- }
- action(IncomingDocAttachFile)
- {
- ApplicationArea = Suite;
- Caption = 'Create Incoming Document from File';
- Ellipsis = true;
- Enabled = (Rec."Incoming Document Entry No." = 0) and (Rec."No." <> '');
- Image = Attach;
- ToolTip = 'Create an incoming document from a file that you select from the disk. The file will be attached to the incoming document record.';
-
- trigger OnAction()
- var
- IncomingDocumentAttachment: Record "Incoming Document Attachment";
- begin
- IncomingDocumentAttachment.NewAttachmentFromPurchaseDocument(Rec);
- end;
- }
- action(RemoveIncomingDoc)
- {
- ApplicationArea = Suite;
- Caption = 'Remove Incoming Document';
- Enabled = HasIncomingDocument;
- Image = RemoveLine;
- ToolTip = 'Remove any incoming document records and file attachments.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- if IncomingDocument.Get(Rec."Incoming Document Entry No.") then
- IncomingDocument.RemoveLinkToRelatedRecord();
- Rec."Incoming Document Entry No." := 0;
- Rec.Modify(true);
- end;
- }
- }
- action("Apply Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Apply Entries';
- Image = ApplyEntries;
- ShortCutKey = 'Shift+F11';
- ToolTip = 'Apply open entries for the relevant account type.';
-
- trigger OnAction()
- begin
- CODEUNIT.Run(CODEUNIT::"Purchase Header Apply", Rec);
- end;
- }
- separator(Action130)
- {
- }
- action(CalculateInvoiceDiscount)
- {
- AccessByPermission = TableData "Vendor Invoice Disc." = R;
- ApplicationArea = PurchReturnOrder;
- Caption = 'Calculate &Invoice Discount';
- Image = CalculateInvoiceDiscount;
- ToolTip = 'Calculate the discount that can be granted based on all lines in the purchase document.';
-
- trigger OnAction()
- begin
- ApproveCalcInvDisc();
- PurchCalcDiscByType.ResetRecalculateInvoiceDisc(Rec);
- end;
- }
- separator(Action132)
- {
- }
- action(CopyDocument)
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Copy Document';
- Ellipsis = true;
- Enabled = Rec."No." <> '';
- Image = CopyDocument;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Process;
- ToolTip = 'Copy document lines and header information from another purchase document to this document. You can copy a posted purchase invoice into a new purchase invoice to quickly create a similar document.';
-
- trigger OnAction()
- begin
- Rec.CopyDocument();
- if Rec.Get(Rec."Document Type", Rec."No.") then;
- CurrPage.PurchLines.Page.ForceTotalsCalculation();
- CurrPage.Update();
- end;
- }
- action("Move Negative Lines")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Move Negative Lines';
- Ellipsis = true;
- Image = MoveNegativeLines;
- ToolTip = 'Prepare to create a replacement purchase order in a purchase return process.';
-
- trigger OnAction()
- begin
- Clear(MoveNegPurchLines);
- MoveNegPurchLines.SetPurchHeader(Rec);
- MoveNegPurchLines.RunModal();
- MoveNegPurchLines.ShowDocument();
- end;
- }
- action("Archive Document")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Archive Document';
- Image = Archive;
- ToolTip = 'Send the document to the archive, for example because it is too soon to delete it. Later, you delete or reprocess the archived document.';
-
- trigger OnAction()
- begin
- ArchiveManagement.ArchivePurchDocument(Rec);
- CurrPage.Update(false);
- end;
- }
- action("Send IC Return Order")
- {
- AccessByPermission = TableData "IC G/L Account" = R;
- ApplicationArea = Intercompany;
- Caption = 'Send IC Return Order';
- Image = IntercompanyOrder;
- ToolTip = 'Prepare to send the return order to an intercompany partner.';
-
- trigger OnAction()
- var
- ICInOutMgt: Codeunit ICInboxOutboxMgt;
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- if ApprovalsMgmt.PrePostApprovalCheckPurch(Rec) then
- ICInOutMgt.SendPurchDoc(Rec, false);
- end;
- }
- separator(Action134)
- {
- }
- }
- group("Request Approval")
- {
- Caption = 'Request Approval';
- Image = Approval;
- action(SendApprovalRequest)
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Send A&pproval Request';
- Enabled = not OpenApprovalEntriesExist;
- Image = SendApprovalRequest;
- ToolTip = 'Request approval of the document.';
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- if ApprovalsMgmt.CheckPurchaseApprovalPossible(Rec) then
- ApprovalsMgmt.OnSendPurchaseDocForApproval(Rec);
- end;
- }
- action(CancelApprovalRequest)
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Cancel Approval Re&quest';
- Enabled = CanCancelApprovalForRecord;
- Image = CancelApprovalRequest;
- ToolTip = 'Cancel the approval request.';
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.OnCancelPurchaseApprovalRequest(Rec);
- end;
- }
- separator(Action137)
- {
- }
- }
- group(Action19)
- {
- Caption = 'Warehouse';
- Image = Warehouse;
- action("Create &Warehouse Shipment")
- {
- AccessByPermission = TableData "Warehouse Shipment Header" = R;
- ApplicationArea = Warehouse;
- Caption = 'Create &Warehouse Shipment';
- Image = NewShipment;
- ToolTip = 'Create a warehouse shipment to start a pick a ship process according to an advanced warehouse configuration.';
-
- trigger OnAction()
- var
- GetSourceDocOutbound: Codeunit "Get Source Doc. Outbound";
- begin
- Rec.PerformManualRelease();
- CurrPage.PurchLines.PAGE.ClearTotalPurchaseHeader();
-
- GetSourceDocOutbound.CreateFromPurchaseReturnOrder(Rec);
- end;
- }
- action("Create Inventor&y Put-away/Pick")
- {
- AccessByPermission = TableData "Posted Invt. Pick Header" = R;
- ApplicationArea = Warehouse;
- Caption = 'Create Inventor&y Put-away/Pick';
- Ellipsis = true;
- Image = CreateInventoryPickup;
- ToolTip = 'Create an inventory put-away or inventory pick to handle items on the document according to a basic warehouse configuration that does not require warehouse receipt or shipment documents.';
-
- trigger OnAction()
- begin
- Rec.PerformManualRelease();
- CurrPage.PurchLines.PAGE.ClearTotalPurchaseHeader();
-
- Rec.CreateInvtPutAwayPick();
- end;
- }
- separator(Action135)
- {
- }
- }
- group("P&osting")
- {
- Caption = 'P&osting';
- Image = Post;
- action(Post)
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'P&ost';
- Ellipsis = true;
- 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
- PostDocument(CODEUNIT::"Purch.-Post (Yes/No)");
- end;
- }
- action(Preview)
- {
- ApplicationArea = PurchReturnOrder;
- 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()
- var
- PurchPostYesNo: Codeunit "Purch.-Post (Yes/No)";
- begin
- PurchPostYesNo.Preview(Rec);
- end;
- }
- action(TestReport)
- {
- ApplicationArea = PurchReturnOrder;
- 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.PrintPurchHeader(Rec);
- end;
- }
- action(PostAndPrint)
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Post and &Print';
- Ellipsis = true;
- 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
- PostDocument(CODEUNIT::"Purch.-Post + Print");
- end;
- }
- action(PostBatch)
- {
- ApplicationArea = PurchReturnOrder;
- 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()
- begin
- REPORT.RunModal(REPORT::"Batch Post Purch. Ret. Orders", true, true, Rec);
- CurrPage.Update(false);
- end;
- }
- action(RemoveFromJobQueue)
- {
- ApplicationArea = All;
- Caption = 'Remove From Job Queue';
- Image = RemoveLine;
- ToolTip = 'Remove the scheduled processing of this record from the job queue.';
- Visible = JobQueueVisible;
-
- trigger OnAction()
- begin
- Rec.CancelBackgroundPosting();
- 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;
- }
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- group(Category_Category6)
- {
- Caption = 'Posting', Comment = 'Generated from the PromotedActionCategories property index 5.';
- ShowAs = SplitButton;
-
- actionref(Post_Promoted; Post)
- {
- }
- actionref(PostAndPrint_Promoted; PostAndPrint)
- {
- }
- actionref(Preview_Promoted; Preview)
- {
- }
- actionref(PostBatch_Promoted; PostBatch)
- {
- }
- }
- group(Category_Category5)
- {
- Caption = 'Release', Comment = 'Generated from the PromotedActionCategories property index 4.';
- ShowAs = SplitButton;
-
- actionref("Re&lease_Promoted"; "Re&lease")
- {
- }
- actionref(Reopen_Promoted; Reopen)
- {
- }
- }
- actionref("Create &Warehouse Shipment_Promoted"; "Create &Warehouse Shipment")
- {
- }
- actionref("Apply Entries_Promoted"; "Apply Entries")
- {
- }
- actionref("Archive Document_Promoted"; "Archive Document")
- {
- }
- }
- group(Category_Category7)
- {
- Caption = 'Prepare', Comment = 'Generated from the PromotedActionCategories property index 6.';
-
- actionref(CopyDocument_Promoted; CopyDocument)
- {
- }
- actionref(GetPostedDocumentLinesToReverse_Promoted; GetPostedDocumentLinesToReverse)
- {
- }
- group("Category_Incoming Document")
- {
- Caption = 'Incoming Document';
-
- actionref(IncomingDocAttachFile_Promoted; IncomingDocAttachFile)
- {
- }
- actionref(SelectIncomingDoc_Promoted; SelectIncomingDoc)
- {
- }
- actionref(IncomingDocCard_Promoted; IncomingDocCard)
- {
- }
- actionref(RemoveIncomingDoc_Promoted; RemoveIncomingDoc)
- {
- }
- }
- actionref(CalculateInvoiceDiscount_Promoted; CalculateInvoiceDiscount)
- {
- }
- actionref("Move Negative Lines_Promoted"; "Move Negative Lines")
- {
- }
- }
- group(Category_Category4)
- {
- Caption = 'Approve', Comment = 'Generated from the PromotedActionCategories property index 3.';
-
- actionref(Approve_Promoted; Approve)
- {
- }
- actionref(Reject_Promoted; Reject)
- {
- }
- actionref(Comment_Promoted; Comment)
- {
- }
- actionref(Delegate_Promoted; Delegate)
- {
- }
- }
- group(Category_Category10)
- {
- Caption = 'Print/Send', Comment = 'Generated from the PromotedActionCategories property index 9.';
-
- actionref(Email_Promoted; Email)
- {
- }
- actionref("&Print_Promoted"; "&Print")
- {
- }
- actionref(Send_Promoted; Send)
- {
- }
- actionref(AttachAsPDF_Promoted; AttachAsPDF)
- {
- }
- }
- group(Category_Category9)
- {
- Caption = 'Request Approval', Comment = 'Generated from the PromotedActionCategories property index 8.';
-
- actionref(SendApprovalRequest_Promoted; SendApprovalRequest)
- {
- }
- actionref(CancelApprovalRequest_Promoted; CancelApprovalRequest)
- {
- }
- }
- group(Category_Category8)
- {
- Caption = 'Invoice', Comment = 'Generated from the PromotedActionCategories property index 7.';
- }
- group(Category_Category11)
- {
- Caption = 'Return Order', Comment = 'Generated from the PromotedActionCategories property index 10.';
-
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref(PurchaseOrderStatistics_Promoted; PurchaseOrderStatistics)
- {
- }
- actionref("Co&mments_Promoted"; "Co&mments")
- {
- }
- actionref(DocAttach_Promoted; DocAttach)
- {
- }
- actionref(Approvals_Promoted; Approvals)
- {
- }
- separator(Navigate_Separator)
- {
- }
- actionref(Vendor_Promoted; Vendor)
- {
- }
- actionref("Return Shipments_Promoted"; "Return Shipments")
- {
- }
- actionref("Cred&it Memos_Promoted"; "Cred&it Memos")
- {
- }
- }
- group(Category_Category12)
- {
- Caption = 'Navigate', Comment = 'Generated from the PromotedActionCategories property index 11.';
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- begin
- SetControlAppearance();
- CurrPage.IncomingDocAttachFactBox.PAGE.LoadDataFromRecord(Rec);
- CurrPage.ApprovalFactBox.PAGE.UpdateApprovalEntriesFromSourceRecord(Rec.RecordId);
- ShowWorkflowStatus := CurrPage.WorkflowStatus.PAGE.SetFilterOnWorkflowRecord(Rec.RecordId);
- StatusStyleTxt := Rec.GetStatusStyleText();
- end;
-
- trigger OnAfterGetRecord()
- begin
- CalculateCurrentShippingOption();
- BuyFromContact.GetOrClear(Rec."Buy-from Contact No.");
- PayToContact.GetOrClear(Rec."Pay-to Contact No.");
- CurrPage.IncomingDocAttachFactBox.Page.SetCurrentRecordID(Rec.RecordId);
-
- OnAfterOnAfterGetRecord(Rec);
- end;
-
- trigger OnDeleteRecord(): Boolean
- begin
- CurrPage.SaveRecord();
- exit(Rec.ConfirmDeletion());
- end;
-
- trigger OnInit()
- begin
- JobQueueUsed := PurchSetup.JobQueueActive();
- end;
-
- trigger OnNewRecord(BelowxRec: Boolean)
- begin
- Rec."Responsibility Center" := UserMgt.GetPurchasesFilter();
- if (not DocNoVisible) and (Rec."No." = '') then
- Rec.SetBuyFromVendorFromFilter();
- end;
-
- trigger OnOpenPage()
- var
- VATReportingDateMgt: Codeunit "VAT Reporting Date Mgt";
- begin
- SetDocNoVisible();
-
- Rec.SetSecurityFilterOnRespCenter();
-
- if (Rec."No." <> '') and (Rec."Buy-from Vendor No." = '') then
- DocumentIsPosted := (not Rec.Get(Rec."Document Type", Rec."No."));
-
- ActivateFields();
-
- CheckShowBackgrValidationNotification();
- VATDateEnabled := VATReportingDateMgt.IsVATDateEnabled();
- end;
-
- trigger OnQueryClosePage(CloseAction: Action): Boolean
- var
- ShowConfirmCloseUnposted: Boolean;
- begin
- ShowConfirmCloseUnposted := not DocumentIsPosted;
- OnQueryClosePageOnAfterCalcShowConfirmCloseUnposted(Rec, ShowConfirmCloseUnposted);
- if ShowConfirmCloseUnposted then
- exit(Rec.ConfirmCloseUnposted());
- end;
-
- var
- BuyFromContact: Record Contact;
- PayToContact: Record Contact;
- PurchSetup: Record "Purchases & Payables Setup";
- GLSetup: Record "General Ledger Setup";
- MoveNegPurchLines: Report "Move Negative Purchase Lines";
- DocPrint: Codeunit "Document-Print";
- ReportPrint: Codeunit "Test Report-Print";
- UserMgt: Codeunit "User Setup Management";
- ArchiveManagement: Codeunit ArchiveManagement;
- PurchCalcDiscByType: Codeunit "Purch - Calc Disc. By Type";
- FormatAddress: Codeunit "Format Address";
- ChangeExchangeRate: Page "Change Exchange Rate";
- JobQueueVisible: Boolean;
- JobQueueUsed: Boolean;
- StatusStyleTxt: Text;
- DocNoVisible: Boolean;
- OpenApprovalEntriesExist: Boolean;
- OpenApprovalEntriesExistForCurrUser: Boolean;
- ShowWorkflowStatus: Boolean;
- CanCancelApprovalForRecord: Boolean;
- DocumentIsPosted: Boolean;
- OpenPostedPurchaseReturnOrderQst: Label 'The return order is posted as number %1 and moved to the Posted Purchase Credit Memos window.\\Do you want to open the posted credit memo?', Comment = '%1 = posted document number';
- IsBuyFromCountyVisible: Boolean;
- IsPayToCountyVisible: Boolean;
- IsShipToCountyVisible: Boolean;
- PurchaseDocCheckFactboxVisible: Boolean;
- IsJournalTemplNameVisible: Boolean;
- IsPaymentMethodCodeVisible: Boolean;
- IsPurchaseLinesEditable: Boolean;
- VATDateEnabled: Boolean;
- HasIncomingDocument: Boolean;
-
- protected var
- ShipToOptions: Option "Default (Vendor Address)","Alternate Vendor Address","Custom Address";
- IsPostingGroupEditable: Boolean;
-
- local procedure ActivateFields()
- begin
- IsBuyFromCountyVisible := FormatAddress.UseCounty(Rec."Buy-from Country/Region Code");
- IsPayToCountyVisible := FormatAddress.UseCounty(Rec."Pay-to Country/Region Code");
- IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
- GLSetup.Get();
- IsJournalTemplNameVisible := GLSetup."Journal Templ. Name Mandatory";
- IsPaymentMethodCodeVisible := not GLSetup."Hide Payment Method Code";
- IsPurchaseLinesEditable := Rec.PurchaseLinesEditable();
- end;
-
- procedure CallPostDocument(PostingCodeunitID: Integer)
- begin
- PostDocument(PostingCodeunitID);
- end;
-
- local procedure PostDocument(PostingCodeunitID: Integer)
- var
- PurchaseHeader: Record "Purchase Header";
- InstructionMgt: Codeunit "Instruction Mgt.";
- LinesInstructionMgt: Codeunit "Lines Instruction Mgt.";
- DocumentIsScheduledForPosting: Boolean;
- IsHandled: Boolean;
- begin
- LinesInstructionMgt.PurchaseCheckAllLinesHaveQuantityAssigned(Rec);
- Rec.SendToPosting(PostingCodeunitID);
-
- PurchaseHeader.SetRange("Document Type", Rec."Document Type");
- PurchaseHeader.SetRange("No.", Rec."No.");
- DocumentIsPosted := PurchaseHeader.IsEmpty();
-
- DocumentIsScheduledForPosting := Rec."Job Queue Status" = Rec."Job Queue Status"::"Scheduled for Posting";
- OnPostDocumentOnAfterCalcDocumentIsScheduledForPosting(Rec, DocumentIsScheduledForPosting, DocumentIsPosted);
- if DocumentIsScheduledForPosting then
- CurrPage.Close();
- CurrPage.Update(false);
-
- IsHandled := false;
- OnPostDocumentBeforeNavigateAfterPosting(Rec, PostingCodeunitID, DocumentIsPosted, IsHandled);
- if IsHandled then
- exit;
-
- if PostingCodeunitID <> CODEUNIT::"Purch.-Post (Yes/No)" then
- exit;
-
- if InstructionMgt.IsEnabled(InstructionMgt.ShowPostedConfirmationMessageCode()) then
- ShowPostedConfirmationMessage();
- end;
-
- local procedure ApproveCalcInvDisc()
- begin
- CurrPage.PurchLines.PAGE.ApproveCalcInvDisc();
- end;
-
- local procedure SaveInvoiceDiscountAmount()
- var
- DocumentTotals: Codeunit "Document Totals";
- begin
- CurrPage.SaveRecord();
- DocumentTotals.PurchaseRedistributeInvoiceDiscountAmountsOnDocument(Rec);
- CurrPage.Update(false);
- end;
-
- local procedure PurchaserCodeOnAfterValidate()
- begin
- CurrPage.PurchLines.PAGE.UpdateForm(true);
- end;
-
- local procedure ShortcutDimension1CodeOnAfterV()
- begin
- CurrPage.PurchLines.PAGE.UpdateForm(true);
- end;
-
- local procedure ShortcutDimension2CodeOnAfterV()
- begin
- CurrPage.PurchLines.PAGE.UpdateForm(true);
- end;
-
- local procedure PricesIncludingVATOnAfterValid()
- begin
- CurrPage.PurchLines.Page.ForceTotalsCalculation();
- CurrPage.Update();
- end;
-
- local procedure SetDocNoVisible()
- var
- DocumentNoVisibility: Codeunit DocumentNoVisibility;
- DocType: Option Quote,"Order",Invoice,"Credit Memo","Blanket Order","Return Order",Reminder,FinChMemo;
- begin
- DocNoVisible := DocumentNoVisibility.PurchaseDocumentNoIsVisible(DocType::"Return Order", Rec."No.");
- end;
-
- local procedure SetControlAppearance()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- DocumentErrorsMgt: Codeunit "Document Errors Mgt.";
- begin
- JobQueueVisible := Rec."Job Queue Status" = Rec."Job Queue Status"::"Scheduled for Posting";
- HasIncomingDocument := Rec."Incoming Document Entry No." <> 0;
-
- OpenApprovalEntriesExistForCurrUser := ApprovalsMgmt.HasOpenApprovalEntriesForCurrentUser(Rec.RecordId());
- OpenApprovalEntriesExist := ApprovalsMgmt.HasOpenApprovalEntries(Rec.RecordId());
- CanCancelApprovalForRecord := ApprovalsMgmt.CanCancelApprovalForRecord(Rec.RecordId());
- PurchaseDocCheckFactboxVisible := DocumentErrorsMgt.BackgroundValidationEnabled();
- IsPurchaseLinesEditable := Rec.PurchaseLinesEditable();
- SetPostingGroupEditable();
- end;
-
- procedure RunBackgroundCheck()
- begin
- CurrPage.PurchaseDocCheckFactbox.Page.CheckErrorsInBackground(Rec);
- end;
-
- local procedure CheckShowBackgrValidationNotification()
- var
- DocumentErrorsMgt: Codeunit "Document Errors Mgt.";
- begin
- if DocumentErrorsMgt.CheckShowEnableBackgrValidationNotification() then
- SetControlAppearance();
- end;
-
- procedure SetPostingGroupEditable()
- var
- PayToVendor: Record Vendor;
- begin
- if PayToVendor.Get(Rec."Pay-to Vendor No.") then
- IsPostingGroupEditable := PayToVendor."Allow Multiple Posting Groups";
- end;
-
- local procedure ShowPostedConfirmationMessage()
- var
- ReturnOrderPurchaseHeader: Record "Purchase Header";
- PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.";
- InstructionMgt: Codeunit "Instruction Mgt.";
- begin
- if not ReturnOrderPurchaseHeader.Get(Rec."Document Type", Rec."No.") then begin
- PurchCrMemoHdr.SetRange("No.", Rec."Last Posting No.");
- if PurchCrMemoHdr.FindFirst() then
- if InstructionMgt.ShowConfirm(StrSubstNo(OpenPostedPurchaseReturnOrderQst, PurchCrMemoHdr."No."),
- InstructionMgt.ShowPostedConfirmationMessageCode())
- then
- InstructionMgt.ShowPostedDocument(PurchCrMemoHdr, Page::"Purchase Return Order");
- end;
- end;
-
- local procedure ValidateShippingOption()
- begin
- OnBeforeValidateShipToOptions(Rec, ShipToOptions);
-
- case ShipToOptions of
- ShipToOptions::"Default (Vendor Address)":
- begin
- Rec.Validate("Order Address Code", '');
- Rec.Validate("Buy-from Vendor No.");
- end;
- ShipToOptions::"Alternate Vendor Address":
- Rec.Validate("Order Address Code", '');
- end;
-
- OnAfterValidateShipToOptions(Rec, ShipToOptions);
- end;
-
- local procedure CalculateCurrentShippingOption()
- begin
- case true of
- Rec."Order Address Code" <> '':
- ShipToOptions := ShipToOptions::"Alternate Vendor Address";
- Rec.BuyFromAddressEqualsShipToAddress():
- ShipToOptions := ShipToOptions::"Default (Vendor Address)";
- else
- ShipToOptions := ShipToOptions::"Custom Address";
- end;
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnAfterOnAfterGetRecord(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShipToOptions(var PurchaseHeader: Record "Purchase Header"; ShipToOptions: Option)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateShipToOptions(var PurchaseHeader: Record "Purchase Header"; ShipToOptions: Option)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnPostDocumentBeforeNavigateAfterPosting(var PurchaseHeader: Record "Purchase Header"; var PostingCodeunitID: Integer; DocumentIsPosted: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnQueryClosePageOnAfterCalcShowConfirmCloseUnposted(var PurchaseHeader: Record "Purchase Header"; var ShowConfirmCloseUnposted: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnPostDocumentOnAfterCalcDocumentIsScheduledForPosting(var PurchaseHeader: Record "Purchase Header"; var DocumentIsScheduledForPosting: Boolean; var DocumentIsPosted: Boolean)
- begin
- end;
-}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Purchases/History/PostedPurchaseCreditMemo.Page.al b/src/Layers/NL/BaseApp/Purchases/History/PostedPurchaseCreditMemo.Page.al
deleted file mode 100644
index 13ec6f9667..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/History/PostedPurchaseCreditMemo.Page.al
+++ /dev/null
@@ -1,876 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.History;
-
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Outlook;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.VAT.Calculation;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Attachment;
-using Microsoft.Purchases.Comment;
-using Microsoft.Purchases.Vendor;
-using System.Automation;
-
-page 140 "Posted Purchase Credit Memo"
-{
- Caption = 'Posted Purchase Credit Memo';
- InsertAllowed = false;
- PageType = Document;
- RefreshOnActivate = true;
- SourceTable = "Purch. Cr. Memo Hdr.";
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field("No."; Rec."No.")
- {
- ApplicationArea = All;
- Editable = false;
- Importance = Promoted;
- }
- field("Buy-from Vendor No."; Rec."Buy-from Vendor No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor No.';
- Editable = false;
- Visible = false;
- }
- field("Buy-from Vendor Name"; Rec."Buy-from Vendor Name")
- {
- ApplicationArea = All;
- Caption = 'Vendor';
- Editable = false;
- Importance = Promoted;
- TableRelation = Vendor.Name;
- }
- field("Buy-from Vendor Name 2"; Rec."Buy-from Vendor Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor Name 2';
- Editable = false;
- Importance = Additional;
- Visible = false;
- }
- group("Buy-from")
- {
- Caption = 'Buy-from';
- field("Buy-from Address"; Rec."Buy-from Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = false;
- Importance = Additional;
- }
- field("Buy-from Address 2"; Rec."Buy-from Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = false;
- Importance = Additional;
- }
- field("Buy-from City"; Rec."Buy-from City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = false;
- Importance = Additional;
- }
- group(Control37)
- {
- ShowCaption = false;
- Visible = IsBuyFromCountyVisible;
- field("Buy-from County"; Rec."Buy-from County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Buy-from Country/Region Code";
- Editable = false;
- Importance = Additional;
- }
- }
- field("Buy-from Post Code"; Rec."Buy-from Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = false;
- Importance = Additional;
- ToolTip = 'Specifies the postal code.';
- }
- field("Buy-from Country/Region Code"; Rec."Buy-from Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Editable = false;
- Importance = Additional;
- }
- field("Buy-from Contact No."; Rec."Buy-from Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact No.';
- Editable = false;
- Importance = Additional;
- }
- field(BuyFromContactPhoneNo; BuyFromContact."Phone No.")
- {
- ApplicationArea = Suite;
- Caption = 'Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the vendor contact person.';
- }
- field(BuyFromContactMobilePhoneNo; BuyFromContact."Mobile Phone No.")
- {
- ApplicationArea = Suite;
- Caption = 'Mobile Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the vendor contact person.';
- }
- field(BuyFromContactEmail; BuyFromContact."E-Mail")
- {
- ApplicationArea = Suite;
- Caption = 'Email';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the email address of the vendor contact person.';
- }
- }
- field("Buy-from Contact"; Rec."Buy-from Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = false;
- ToolTip = 'Specifies the name of the person to contact at the vendor who shipped the items.';
- }
- field("Posting Date"; Rec."Posting Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Promoted;
- }
- field("VAT Reporting Date"; Rec."VAT Reporting Date")
- {
- ApplicationArea = VAT;
- Importance = Promoted;
- Editable = false;
- Visible = VATDateEnabled;
- }
- field("Document Date"; Rec."Document Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Pre-Assigned No."; Rec."Pre-Assigned No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Vendor Cr. Memo No."; Rec."Vendor Cr. Memo No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Promoted;
- }
- field("Order Address Code"; Rec."Order Address Code")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Purchaser Code"; Rec."Purchaser Code")
- {
- ApplicationArea = Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Responsibility Center"; Rec."Responsibility Center")
- {
- ApplicationArea = Suite;
- Editable = false;
- Importance = Additional;
- }
- field(Cancelled; Rec.Cancelled)
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Style = Unfavorable;
- StyleExpr = Rec.Cancelled;
-
- trigger OnDrillDown()
- begin
- Rec.ShowCorrectiveInvoice();
- end;
- }
- field(Corrective; Rec.Corrective)
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Style = Unfavorable;
- StyleExpr = Rec.Corrective;
-
- trigger OnDrillDown()
- begin
- Rec.ShowCancelledInvoice();
- end;
- }
- field("No. Printed"; Rec."No. Printed")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- }
- part(PurchCrMemoLines; "Posted Purch. Cr. Memo Subform")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "Document No." = field("No.");
- }
- group("Invoice Details")
- {
- Caption = 'Credit Memo Details';
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- Importance = Promoted;
-
- trigger OnAssistEdit()
- var
- UpdateCurrencyFactor: Codeunit "Update Currency Factor";
- begin
- ChangeExchangeRate.SetParameter(Rec."Currency Code", Rec."Currency Factor", Rec."Posting Date");
- ChangeExchangeRate.Editable(false);
- if ChangeExchangeRate.RunModal() = ACTION::OK then begin
- Rec."Currency Factor" := ChangeExchangeRate.GetParameter();
- UpdateCurrencyFactor.ModifyPostedPurchaseCreditMemo(Rec);
- end;
- Clear(ChangeExchangeRate);
- end;
- }
- field("Shortcut Dimension 1 Code"; Rec."Shortcut Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Importance = Additional;
- }
- field("Shortcut Dimension 2 Code"; Rec."Shortcut Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Importance = Additional;
- }
- field("Location Code"; Rec."Location Code")
- {
- ApplicationArea = Location;
- Editable = false;
- }
- field("Vendor Posting Group"; Rec."Vendor Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Applies-to Doc. Type"; Rec."Applies-to Doc. Type")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Applies-to Doc. No."; Rec."Applies-to Doc. No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Transaction Mode"; Rec."Transaction Mode")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ToolTip = 'Specifies the transaction mode used in telebanking.';
- }
- field("Bank Account"; Rec."Bank Account")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ToolTip = 'Specifies the vendor''s bank account used for payments and collections through telebanking.';
- }
- field(Correction; Rec.Correction)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- }
- group("Shipping and Payment")
- {
- Caption = 'Shipping and Payment';
- group("Ship-to")
- {
- Caption = 'Ship-to';
- field("Ship-to Name"; Rec."Ship-to Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name';
- Editable = false;
- ToolTip = 'Specifies the name of the company at the address to which the items in the purchase order were shipped.';
- }
- field("Ship-to Address"; Rec."Ship-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = false;
- }
- field("Ship-to Address 2"; Rec."Ship-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = false;
- }
- field("Ship-to City"; Rec."Ship-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = false;
- }
- group(Control43)
- {
- ShowCaption = false;
- Visible = IsShipToCountyVisible;
- field("Ship-to County"; Rec."Ship-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Ship-to Country/Region Code";
- Editable = false;
- }
- }
- field("Ship-to Post Code"; Rec."Ship-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = false;
- ToolTip = 'Specifies the postal code.';
- }
- field("Ship-to Country/Region Code"; Rec."Ship-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Editable = false;
- }
- field("Ship-to Phone No."; Rec."Ship-to Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Editable = false;
- }
- field("Ship-to Contact"; Rec."Ship-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = false;
- }
- }
- group("Pay-to")
- {
- Caption = 'Pay-to';
- field("Pay-to Name"; Rec."Pay-to Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name';
- Editable = false;
- Importance = Promoted;
- }
- field("Pay-to Name 2"; Rec."Pay-to Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name 2';
- Editable = false;
- Importance = Additional;
- Visible = false;
- }
- field("Pay-to Address"; Rec."Pay-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = false;
- Importance = Additional;
- }
- field("Pay-to Address 2"; Rec."Pay-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = false;
- Importance = Additional;
- }
- field("Pay-to City"; Rec."Pay-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = false;
- Importance = Additional;
- }
- group(Control46)
- {
- ShowCaption = false;
- Visible = IsPayToCountyVisible;
- field("Pay-to County"; Rec."Pay-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Pay-to Country/Region Code";
- Editable = false;
- Importance = Additional;
- }
- }
- field("Pay-to Post Code"; Rec."Pay-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = false;
- Importance = Additional;
- ToolTip = 'Specifies the postal code.';
- }
- field("Pay-to Country/Region Code"; Rec."Pay-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Editable = false;
- Importance = Additional;
- }
- field("Pay-to Contact No."; Rec."Pay-to Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact No.';
- Editable = false;
- Importance = Additional;
- }
- field(PayToContactPhoneNo; PayToContact."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the vendor contact person.';
- }
- field(PayToContactMobilePhoneNo; PayToContact."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mobile Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the vendor contact person.';
- }
- field(PayToContactEmail; PayToContact."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = Email;
- ToolTip = 'Specifies the email address of the vendor contact person..';
- }
- field("Pay-to Contact"; Rec."Pay-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = false;
- }
- }
- }
- }
- area(factboxes)
- {
- part("Attached Documents List"; "Doc. Attachment List Factbox")
- {
- ApplicationArea = All;
- Caption = 'Documents';
- UpdatePropagation = Both;
- SubPageLink = "Table ID" = const(Database::"Purch. Cr. Memo Hdr."),
- "No." = field("No.");
- }
- part(IncomingDocAttachFactBox; "Incoming Doc. Attach. FactBox")
- {
- ApplicationArea = Basic, Suite;
- ShowFilter = false;
- Visible = not IsOfficeAddin;
- }
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("&Cr. Memo")
- {
- Caption = '&Cr. Memo';
- Image = CreditMemo;
- action(Statistics)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Statistics';
- Image = Statistics;
- RunObject = Page "Purch. Credit Memo Statistics";
- RunPageLink = "No." = field("No.");
- ShortCutKey = 'F7';
- ToolTip = 'View statistical information, such as the value of posted entries, for the record.';
- }
- action("Co&mments")
- {
- ApplicationArea = Comments;
- Caption = 'Co&mments';
- Image = ViewComments;
- RunObject = Page "Purch. Comment Sheet";
- RunPageLink = "Document Type" = const("Posted Credit Memo"),
- "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.ShowDimensions();
- end;
- }
- action(Approvals)
- {
- AccessByPermission = TableData "Posted 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.ShowPostedApprovalEntries(Rec.RecordId);
- 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;
- }
- }
- }
- area(processing)
- {
- action(Vendor)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor';
- Image = Vendor;
- RunObject = Page "Vendor Card";
- RunPageLink = "No." = field("Buy-from Vendor No.");
- ShortCutKey = 'Shift+F7';
- ToolTip = 'View or edit detailed information about the vendor on the purchase document.';
- }
- action("&Print")
- {
- ApplicationArea = Basic, Suite;
- 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.';
- Visible = not IsOfficeAddin;
-
- trigger OnAction()
- begin
- PurchCrMemoHeader := Rec;
- CurrPage.SetSelectionFilter(PurchCrMemoHeader);
- PurchCrMemoHeader.PrintRecords(true);
- end;
- }
- action(AttachAsPDF)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Attach as PDF';
- Image = PrintAttachment;
- ToolTip = 'Create a PDF file and attach it to the document.';
-
- trigger OnAction()
- begin
- PurchCrMemoHeader := Rec;
- CurrPage.SetSelectionFilter(PurchCrMemoHeader);
- Rec.PrintToDocumentAttachment(PurchCrMemoHeader);
- end;
- }
- action("&Navigate")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Find entries...';
- Image = Navigate;
- ShortCutKey = 'Ctrl+Alt+Q';
- ToolTip = 'Find entries and documents that exist for the document number and posting date on the selected document. (Formerly this action was named Navigate.)';
- Visible = not IsOfficeAddin;
-
- trigger OnAction()
- begin
- Rec.Navigate();
- end;
- }
- action("Update Document")
- {
- ApplicationArea = Suite;
- Caption = 'Update Document';
- Image = Edit;
- ToolTip = 'Add new information that is relevant to the document. You can only edit a few fields because the document has already been posted.';
-
- trigger OnAction()
- var
- PstdPurchCrMemoUpdate: Page "Pstd. Purch. Cr.Memo - Update";
- begin
- PstdPurchCrMemoUpdate.LookupMode := true;
- PstdPurchCrMemoUpdate.SetRec(Rec);
- PstdPurchCrMemoUpdate.RunModal();
- end;
- }
- group(Cancel)
- {
- Caption = 'Cancel';
- action(CancelCrMemo)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Cancel';
- Image = Cancel;
- ToolTip = 'Create and post a purchase invoice that reverses this posted purchase credit memo. This posted purchase credit memo will be canceled.';
- Visible = not Rec.Cancelled and Rec.Corrective;
-
- trigger OnAction()
- begin
- CODEUNIT.Run(CODEUNIT::"Cancel PstdPurchCrM (Yes/No)", Rec);
- end;
- }
- action(ShowInvoice)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Show Canceled/Corrective Invoice';
- Image = Invoice;
- Scope = Repeater;
- ToolTip = 'Open the posted purchase invoice that was created when you canceled the posted purchase credit memo. If the posted purchase credit memo is the result of a canceled purchase invoice, then canceled invoice will open.';
- Visible = Rec.Cancelled or Rec.Corrective;
-
- trigger OnAction()
- begin
- Rec.ShowCanceledOrCorrInvoice();
- end;
- }
- }
- group(IncomingDocument)
- {
- Caption = 'Incoming Document';
- Image = Documents;
- action(IncomingDocCard)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'View Incoming Document';
- Enabled = HasIncomingDocument;
- Image = ViewOrder;
- ToolTip = 'View any incoming document records and file attachments that exist for the entry or document.';
- Visible = not IsOfficeAddin;
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.ShowCard(Rec."No.", Rec."Posting Date");
- end;
- }
- action(SelectIncomingDoc)
- {
- AccessByPermission = TableData "Incoming Document" = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Select Incoming Document';
- Enabled = not HasIncomingDocument;
- Image = SelectLineToApply;
- ToolTip = 'Select an incoming document record and file attachment that you want to link to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.SelectIncomingDocumentForPostedDocument(Rec."No.", Rec."Posting Date", Rec.RecordId);
- end;
- }
- action(IncomingDocAttachFile)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Incoming Document from File';
- Ellipsis = true;
- Enabled = not HasIncomingDocument;
- Image = Attach;
- ToolTip = 'Create an incoming document record by selecting a file to attach, and then link the incoming document record to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocumentAttachment: Record "Incoming Document Attachment";
- begin
- IncomingDocumentAttachment.NewAttachmentFromPostedDocument(Rec."No.", Rec."Posting Date");
- end;
- }
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process';
-
- actionref("&Navigate_Promoted"; "&Navigate")
- {
- }
- actionref(CancelCrMemo_Promoted; CancelCrMemo)
- {
- }
- actionref(ShowInvoice_Promoted; ShowInvoice)
- {
- }
- }
- group(Category_Category6)
- {
- Caption = 'Print/Send', Comment = 'Generated from the PromotedActionCategories property index 5.';
-
- actionref("&Print_Promoted"; "&Print")
- {
- }
- actionref(AttachAsPDF_Promoted; AttachAsPDF)
- {
- }
- }
- group(Category_Category4)
- {
- Caption = 'Cancel', Comment = 'Generated from the PromotedActionCategories property index 3.';
-
- }
- group(Category_Category7)
- {
- Caption = 'Credit Memo', Comment = 'Generated from the PromotedActionCategories property index 6.';
-
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref(Statistics_Promoted; Statistics)
- {
- }
- actionref("Co&mments_Promoted"; "Co&mments")
- {
- }
- actionref(DocAttach_Promoted; DocAttach)
- {
- }
- actionref(Approvals_Promoted; Approvals)
- {
- }
- actionref(Vendor_Promoted; Vendor)
- {
- }
- }
- group("Category_Incoming Document")
- {
- Caption = 'Incoming Document';
-
- actionref(IncomingDocAttachFile_Promoted; IncomingDocAttachFile)
- {
- }
- actionref(SelectIncomingDoc_Promoted; SelectIncomingDoc)
- {
- }
- actionref(IncomingDocCard_Promoted; IncomingDocCard)
- {
- }
- }
- group(Category_Category5)
- {
- Caption = 'Navigate', Comment = 'Generated from the PromotedActionCategories property index 4.';
-
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- HasIncomingDocument := IncomingDocument.PostedDocExists(Rec."No.", Rec."Posting Date");
- CurrPage.IncomingDocAttachFactBox.PAGE.LoadDataFromRecord(Rec);
- end;
-
- trigger OnAfterGetRecord()
- begin
- BuyFromContact.GetOrClear(Rec."Buy-from Contact No.");
- PayToContact.GetOrClear(Rec."Pay-to Contact No.");
- end;
-
- trigger OnOpenPage()
- var
- OfficeMgt: Codeunit "Office Management";
- VATReportingDateMgt: Codeunit "VAT Reporting Date Mgt";
- begin
- Rec.SetSecurityFilterOnRespCenter();
- IsOfficeAddin := OfficeMgt.IsAvailable();
-
- ActivateFields();
- VATDateEnabled := VATReportingDateMgt.IsVATDateEnabled();
- end;
-
- var
- PurchCrMemoHeader: Record "Purch. Cr. Memo Hdr.";
- BuyFromContact: Record Contact;
- PayToContact: Record Contact;
- FormatAddress: Codeunit "Format Address";
- ChangeExchangeRate: Page "Change Exchange Rate";
- HasIncomingDocument: Boolean;
- IsOfficeAddin: Boolean;
- IsBuyFromCountyVisible: Boolean;
- IsPayToCountyVisible: Boolean;
- IsShipToCountyVisible: Boolean;
- VATDateEnabled: Boolean;
-
- local procedure ActivateFields()
- begin
- IsBuyFromCountyVisible := FormatAddress.UseCounty(Rec."Buy-from Country/Region Code");
- IsPayToCountyVisible := FormatAddress.UseCounty(Rec."Pay-to Country/Region Code");
- IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Purchases/History/PostedPurchaseInvoice.Page.al b/src/Layers/NL/BaseApp/Purchases/History/PostedPurchaseInvoice.Page.al
deleted file mode 100644
index b54f35cc3e..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/History/PostedPurchaseInvoice.Page.al
+++ /dev/null
@@ -1,1173 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.History;
-
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Outlook;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.VAT.Calculation;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Attachment;
-using Microsoft.Inventory.Tracking;
-using Microsoft.Purchases.Comment;
-using Microsoft.Purchases.Document;
-using Microsoft.Purchases.Remittance;
-using Microsoft.Purchases.Vendor;
-using System.Automation;
-
-page 138 "Posted Purchase Invoice"
-{
- Caption = 'Posted Purchase Invoice';
- InsertAllowed = false;
- PageType = Document;
- RefreshOnActivate = true;
- SourceTable = "Purch. Inv. Header";
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field("No."; Rec."No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Buy-from Vendor No."; Rec."Buy-from Vendor No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor No.';
- Editable = false;
- Visible = false;
- }
- field("Buy-from Vendor Name"; Rec."Buy-from Vendor Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor';
- Editable = false;
- TableRelation = Vendor.Name;
- }
- field("Buy-from Vendor Name 2"; Rec."Buy-from Vendor Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor Name 2';
- Editable = false;
- Importance = Additional;
- Visible = false;
- }
- group("Buy-from")
- {
- Caption = 'Buy-from';
- field("Buy-from Address"; Rec."Buy-from Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = false;
- Importance = Additional;
- }
- field("Buy-from Address 2"; Rec."Buy-from Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = false;
- Importance = Additional;
- }
- field("Buy-from City"; Rec."Buy-from City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = false;
- Importance = Additional;
- }
- group(Control51)
- {
- ShowCaption = false;
- Visible = IsBuyFromCountyVisible;
- field("Buy-from County"; Rec."Buy-from County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Buy-from Country/Region Code";
- Editable = false;
- Importance = Additional;
- }
- }
- field("Buy-from Post Code"; Rec."Buy-from Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = false;
- Importance = Additional;
- ToolTip = 'Specifies the postal code.';
- }
- field("Buy-from Country/Region Code"; Rec."Buy-from Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Editable = false;
- Importance = Additional;
- }
- field("Buy-from Contact No."; Rec."Buy-from Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact No.';
- Editable = false;
- Importance = Additional;
- }
- field(BuyFromContactPhoneNo; BuyFromContact."Phone No.")
- {
- ApplicationArea = Suite;
- Caption = 'Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the vendor contact person.';
- }
- field(BuyFromContactMobilePhoneNo; BuyFromContact."Mobile Phone No.")
- {
- ApplicationArea = Suite;
- Caption = 'Mobile Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the vendor contact person.';
- }
- field(BuyFromContactEmail; BuyFromContact."E-Mail")
- {
- ApplicationArea = Suite;
- Caption = 'Email';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the email address of the vendor contact person.';
- }
- }
- field("Buy-from Contact"; Rec."Buy-from Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = false;
- ToolTip = 'Specifies the name of the person to contact at the vendor who shipped the items.';
- }
- field("Posting Date"; Rec."Posting Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Promoted;
- }
- field("VAT Reporting Date"; Rec."VAT Reporting Date")
- {
- ApplicationArea = VAT;
- Editable = false;
- Visible = VATDateEnabled;
- }
- field("Document Date"; Rec."Document Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Due Date"; Rec."Due Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Promoted;
- }
- field("Quote No."; Rec."Quote No.")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- field("Order No."; Rec."Order No.")
- {
- ApplicationArea = Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Vendor Invoice No."; Rec."Vendor Invoice No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Promoted;
- }
- field("Vendor Order No."; Rec."Vendor Order No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Pre-Assigned No."; Rec."Pre-Assigned No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- field("No. Printed"; Rec."No. Printed")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Order Address Code"; Rec."Order Address Code")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Purchaser Code"; Rec."Purchaser Code")
- {
- ApplicationArea = Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Responsibility Center"; Rec."Responsibility Center")
- {
- ApplicationArea = Suite;
- Editable = false;
- Importance = Additional;
- }
- field(Cancelled; Rec.Cancelled)
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Style = Unfavorable;
- StyleExpr = Rec.Cancelled;
-
- trigger OnDrillDown()
- begin
- Rec.ShowCorrectiveCreditMemo();
- end;
- }
- field(Corrective; Rec.Corrective)
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Style = Unfavorable;
- StyleExpr = Rec.Corrective;
-
- trigger OnDrillDown()
- begin
- Rec.ShowCancelledCreditMemo();
- end;
- }
- field("Dispute Status"; Rec."Dispute Status")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- Importance = Additional;
- ToolTip = 'Specifies if there is an ongoing dispute for this document.';
- }
- }
- part(PurchInvLines; "Posted Purch. Invoice Subform")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "Document No." = field("No.");
- }
- group("Invoice Details")
- {
- Caption = 'Invoice Details';
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- Importance = Promoted;
-
- trigger OnAssistEdit()
- var
- UpdateCurrencyFactor: Codeunit "Update Currency Factor";
- ChangeExchangeRate: Page "Change Exchange Rate";
- begin
- ChangeExchangeRate.SetParameter(Rec."Currency Code", Rec."Currency Factor", Rec."Posting Date");
- ChangeExchangeRate.Editable(false);
- if ChangeExchangeRate.RunModal() = ACTION::OK then begin
- Rec."Currency Factor" := ChangeExchangeRate.GetParameter();
- UpdateCurrencyFactor.ModifyPostedPurchaseInvoice(Rec);
- end;
- end;
- }
- field("Expected Receipt Date"; Rec."Expected Receipt Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Promoted;
- }
- field("Payment Terms Code"; Rec."Payment Terms Code")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Promoted;
- }
- field("Payment Method Code"; Rec."Payment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- ToolTip = 'Specifies the method of payment to vendors. The program has copied the code from the Payment Method Code field on the purchase header.';
- }
- field("Shortcut Dimension 1 Code"; Rec."Shortcut Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- }
- field("Shortcut Dimension 2 Code"; Rec."Shortcut Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- }
- field("Payment Discount %"; Rec."Payment Discount %")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Pmt. Discount Date"; Rec."Pmt. Discount Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Tax Liable"; Rec."Tax Liable")
- {
- ApplicationArea = SalesTax;
- Editable = false;
- }
- field("Tax Area Code"; Rec."Tax Area Code")
- {
- ApplicationArea = SalesTax;
- Editable = false;
- }
- field("Transaction Mode"; Rec."Transaction Mode")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ToolTip = 'Specifies the transaction mode used in telebanking.';
- }
- field("Bank Account"; Rec."Bank Account")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ToolTip = 'Specifies the vendor''s bank account used for payments and collections through telebanking.';
- }
- field("Location Code"; Rec."Location Code")
- {
- ApplicationArea = Location;
- Editable = false;
- Importance = Additional;
- }
- field("Shipment Method Code"; Rec."Shipment Method Code")
- {
- ApplicationArea = Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Payment Reference"; Rec."Payment Reference")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Creditor No."; Rec."Creditor No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Vendor Posting Group"; Rec."Vendor Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- }
- group("Shipping and Payment")
- {
- Caption = 'Shipping and Payment';
- group("Ship-to")
- {
- Caption = 'Ship-to';
- field("Ship-to Code"; Rec."Ship-to Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address Code';
- Editable = false;
- Importance = Promoted;
- }
- field("Ship-to Name"; Rec."Ship-to Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name';
- Editable = false;
- ToolTip = 'Specifies the name of the company at the address to which the items in the purchase order were shipped.';
- }
- field("Ship-to Name 2"; Rec."Ship-to Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name 2';
- Editable = false;
- Importance = Additional;
- Visible = false;
- }
- field("Ship-to Address"; Rec."Ship-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = false;
- }
- field("Ship-to Address 2"; Rec."Ship-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = false;
- }
- field("Ship-to City"; Rec."Ship-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = false;
- }
- group(Control58)
- {
- ShowCaption = false;
- Visible = IsShipToCountyVisible;
- field("Ship-to County"; Rec."Ship-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Ship-to Country/Region Code";
- Editable = false;
- }
- }
- field("Ship-to Post Code"; Rec."Ship-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = false;
- ToolTip = 'Specifies the postal code.';
- }
- field("Ship-to Country/Region Code"; Rec."Ship-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Editable = false;
- }
- field("Ship-to Phone No."; Rec."Ship-to Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Editable = false;
- }
- field("Ship-to Contact"; Rec."Ship-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = false;
- }
- }
- group("Pay-to")
- {
- Caption = 'Pay-to';
- field("Pay-to Name"; Rec."Pay-to Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name';
- Editable = false;
- Importance = Promoted;
- }
- field("Pay-to Name 2"; Rec."Pay-to Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name 2';
- Editable = false;
- Importance = Additional;
- Visible = false;
- }
- field("Pay-to Address"; Rec."Pay-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = false;
- Importance = Additional;
- }
- field("Pay-to Address 2"; Rec."Pay-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = false;
- Importance = Additional;
- }
- field("Pay-to City"; Rec."Pay-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = false;
- Importance = Additional;
- }
- group(Control60)
- {
- ShowCaption = false;
- Visible = IsPayToCountyVisible;
- field("Pay-to County"; Rec."Pay-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Pay-to Country/Region Code";
- Editable = false;
- Importance = Additional;
- }
- }
- field("Pay-to Post Code"; Rec."Pay-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = false;
- Importance = Additional;
- ToolTip = 'Specifies the postal code.';
- }
- field("Pay-to Country/Region Code"; Rec."Pay-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Editable = false;
- Importance = Additional;
- }
- field("Pay-to Contact No."; Rec."Pay-to Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact No.';
- Editable = false;
- Importance = Additional;
- }
- field(PayToContactPhoneNo; PayToContact."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the vendor contact person.';
- }
- field(PayToContactMobilePhoneNo; PayToContact."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mobile Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the vendor contact person.';
- }
- field(PayToContactEmail; PayToContact."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = Email;
- ToolTip = 'Specifies the email address of the vendor contact person.';
- }
- field("Pay-to Contact"; Rec."Pay-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = false;
- }
- }
- group("Remit-to")
- {
- field("Remit-to Code"; Rec."Remit-to Code")
- {
- Editable = false;
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- group("Remit-to information")
- {
- ShowCaption = false;
- Visible = true;
-
- field("Remit-to Name"; RemitAddressBuffer.Name)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name';
- Editable = false;
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the name of the company at the address that this invoice was remitted to.';
- }
- field("Remit-to Address"; RemitAddressBuffer.Address)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = false;
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the address that this invoice was remitted to.';
- }
- field("Remit-to Address 2"; RemitAddressBuffer."Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = false;
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies additional address information.';
- }
- field("Remit-to City"; RemitAddressBuffer.City)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = false;
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the city that this invoice was remitted to.';
- }
- group("Remit-to County group")
- {
- ShowCaption = false;
- Visible = IsRemitToCountyVisible;
- field("Remit-to County"; RemitAddressBuffer.County)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'County';
- Editable = false;
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the state, province or county of the address.';
- }
- }
- field("Remit-to Post Code"; RemitAddressBuffer."Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = false;
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the postal code that this invoice was remitted to.';
- }
- field("Remit-to Country/Region Code"; RemitAddressBuffer."Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Editable = false;
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the country/region code that this invoice was remitted to.';
- }
- field("Remit-to Contact"; RemitAddressBuffer.Contact)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = false;
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the name of a contact person for the address that this invoice was remitted to.';
- }
- }
- }
- }
- }
- area(factboxes)
- {
- part("Attached Documents List"; "Doc. Attachment List Factbox")
- {
- ApplicationArea = All;
- Caption = 'Documents';
- UpdatePropagation = Both;
- SubPageLink = "Table ID" = const(Database::"Purch. Inv. Header"),
- "No." = field("No.");
- }
- part(IncomingDocAttachFactBox; "Incoming Doc. Attach. FactBox")
- {
- ApplicationArea = Basic, Suite;
- ShowFilter = false;
- Visible = not IsOfficeAddin;
- }
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("&Invoice")
- {
- Caption = '&Invoice';
- Image = Invoice;
- action(Statistics)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Statistics';
- Image = Statistics;
- RunObject = Page "Purchase Invoice Statistics";
- RunPageLink = "No." = field("No.");
- ShortCutKey = 'F7';
- ToolTip = 'View statistical information, such as the value of posted entries, for the record.';
- }
- action("Co&mments")
- {
- ApplicationArea = Comments;
- Caption = 'Co&mments';
- Image = ViewComments;
- RunObject = Page "Purch. Comment Sheet";
- RunPageLink = "Document Type" = const("Posted Invoice"),
- "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.ShowDimensions();
- end;
- }
- action(Approvals)
- {
- AccessByPermission = TableData "Posted 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.ShowPostedApprovalEntries(Rec.RecordId);
- end;
- }
- }
- }
- area(processing)
- {
- action(Print)
- {
- ApplicationArea = Basic, Suite;
- 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.';
- Visible = not IsOfficeAddin;
-
- trigger OnAction()
- begin
- PurchInvHeader := Rec;
- CurrPage.SetSelectionFilter(PurchInvHeader);
- PurchInvHeader.PrintRecords(true);
- end;
- }
- action(AttachAsPDF)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Attach as PDF';
- Image = PrintAttachment;
- ToolTip = 'Create a PDF file and attach it to the document.';
-
- trigger OnAction()
- var
- PurchInvHeader: Record "Purch. Inv. Header";
- begin
- PurchInvHeader := Rec;
- PurchInvHeader.SetRecFilter();
- Rec.PrintToDocumentAttachment(PurchInvHeader);
- end;
- }
- group(Correct)
- {
- Caption = 'Correct';
- action(CorrectInvoice)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Correct';
- Image = Undo;
- ToolTip = 'Reverse this posted invoice. A credit memo will be created and matched with the invoice, and the invoice will be canceled. Shipments for the invoice will be reversed. To create a new invoice with the same information, use the Copy function. When you copy an invoice, remember to post shipments for the new invoice.';
- Visible = not Rec.Cancelled;
-
- trigger OnAction()
- var
- CorrectPstdPurchInvYesNo: Codeunit "Correct PstdPurchInv (Yes/No)";
- begin
- if CorrectPstdPurchInvYesNo.CorrectInvoice(Rec) then
- CurrPage.Close();
- end;
- }
- action(CancelInvoice)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Cancel';
- Image = Cancel;
- ToolTip = 'Create and post a purchase credit memo that reverses this posted purchase invoice. This posted purchase invoice will be canceled.';
- Visible = not Rec.Cancelled;
-
- trigger OnAction()
- var
- CancelPstdPurchInvYesNo: Codeunit "Cancel PstdPurchInv (Yes/No)";
- begin
- if CancelPstdPurchInvYesNo.CancelInvoice(Rec) then
- CurrPage.Close();
- end;
- }
- action(CreateCreditMemo)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Corrective Credit Memo';
- Image = CreateCreditMemo;
- ToolTip = 'Create a credit memo for this posted invoice that you complete and post manually to reverse the posted invoice.';
-
- trigger OnAction()
- var
- PurchaseHeader: Record "Purchase Header";
- CorrectPostedPurchInvoice: Codeunit "Correct Posted Purch. Invoice";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateCreditMemoOnAction(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if CorrectPostedPurchInvoice.CreateCreditMemoCopyDocument(Rec, PurchaseHeader) then begin
- PAGE.Run(PAGE::"Purchase Credit Memo", PurchaseHeader);
- CurrPage.Close();
- end;
- end;
- }
- action(ShowCreditMemo)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Show Canceled/Corrective Credit Memo';
- Image = CreditMemo;
- ToolTip = 'Open the posted purchase credit memo that was created when you canceled the posted purchase invoice. If the posted purchase invoice is the result of a canceled purchase credit memo, then the canceled purchase credit memo will open.';
- Visible = Rec.Cancelled or Rec.Corrective;
-
- trigger OnAction()
- begin
- Rec.ShowCanceledOrCorrCrMemo();
- end;
- }
- }
- group("Actions")
- {
- Caption = 'Actions';
- Image = Invoice;
- action(Vendor)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor';
- Image = Vendor;
- RunObject = Page "Vendor Card";
- RunPageLink = "No." = field("Buy-from Vendor No.");
- ShortCutKey = 'Shift+F7';
- ToolTip = 'View or edit detailed information about the vendor on the purchase document.';
- }
- action(Navigate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Find entries...';
- Image = Navigate;
- ShortCutKey = 'Ctrl+Alt+Q';
- ToolTip = 'Find entries and documents that exist for the document number and posting date on the selected document. (Formerly this action was named Navigate.)';
- Visible = not IsOfficeAddin;
-
- trigger OnAction()
- begin
- Rec.Navigate();
- 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;
- }
- action(MatchedOrderLines)
- {
- ApplicationArea = All;
- Caption = 'Matched Order Lines';
- Image = TransferToLines;
- ToolTip = 'View order lines matched to this purchase invoice.';
-
- trigger OnAction()
- var
- MatchedOrderLines: Page "Matched Order Lines";
- begin
- MatchedOrderLines.InitializePage("Matched Order Line Source"::"Posted Purchase Invoice", true, Rec.SystemId);
- MatchedOrderLines.RunModal();
- end;
- }
- }
- action("&Navigate")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Find entries...';
- Image = Navigate;
- ShortCutKey = 'Ctrl+Alt+Q';
- ToolTip = 'Find entries and documents that exist for the document number and posting date on the selected document. (Formerly this action was named Navigate.)';
- Visible = false;
-
- trigger OnAction()
- begin
- Rec.Navigate();
- end;
- }
- group(IncomingDocument)
- {
- Caption = 'Incoming Document';
- Image = Documents;
- action(IncomingDocCard)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'View Incoming Document';
- Enabled = HasIncomingDocument;
- Image = ViewOrder;
- ToolTip = 'View any incoming document records and file attachments that exist for the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.ShowCard(Rec."No.", Rec."Posting Date");
- end;
- }
- action(SelectIncomingDoc)
- {
- AccessByPermission = TableData "Incoming Document" = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Select Incoming Document';
- Enabled = not HasIncomingDocument;
- Image = SelectLineToApply;
- ToolTip = 'Select an incoming document record and file attachment that you want to link to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.SelectIncomingDocumentForPostedDocument(Rec."No.", Rec."Posting Date", Rec.RecordId);
- end;
- }
- action(IncomingDocAttachFile)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Incoming Document from File';
- Ellipsis = true;
- Enabled = not HasIncomingDocument;
- Image = Attach;
- ToolTip = 'Create an incoming document record by selecting a file to attach, and then link the incoming document record to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocumentAttachment: Record "Incoming Document Attachment";
- begin
- IncomingDocumentAttachment.NewAttachmentFromPostedDocument(Rec."No.", Rec."Posting Date");
- end;
- }
- }
- action("Update Document")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Update Document';
- Image = Edit;
- ToolTip = 'Add new information that is relevant to the document, such as a payment reference. You can only edit a few fields because the document has already been posted.';
-
- trigger OnAction()
- var
- PostedPurchInvoiceUpdate: Page "Posted Purch. Invoice - Update";
- begin
- PostedPurchInvoiceUpdate.LookupMode := true;
- PostedPurchInvoiceUpdate.SetRec(Rec);
- PostedPurchInvoiceUpdate.RunModal();
- end;
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- actionref("Update Document_Promoted"; "Update Document")
- {
- }
- actionref(Navigate_Promoted; Navigate)
- {
- }
- group(Category_Category4)
- {
- Caption = 'Correct', Comment = 'Generated from the PromotedActionCategories property index 3.';
- ShowAs = SplitButton;
-
- actionref(CorrectInvoice_Promoted; CorrectInvoice)
- {
- }
- actionref(CancelInvoice_Promoted; CancelInvoice)
- {
- }
- actionref(CreateCreditMemo_Promoted; CreateCreditMemo)
- {
- }
- actionref(ShowCreditMemo_Promoted; ShowCreditMemo)
- {
- }
- }
- }
- group(Category_Category6)
- {
- Caption = 'Print/Send', Comment = 'Generated from the PromotedActionCategories property index 5.';
-
- actionref(Print_Promoted; Print)
- {
- }
- actionref(AttachAsPDF_Promoted; AttachAsPDF)
- {
- }
- }
- group(Category_Category5)
- {
- Caption = 'Invoice', Comment = 'Generated from the PromotedActionCategories property index 4.';
-
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref(Statistics_Promoted; Statistics)
- {
- }
- actionref(DocAttach_Promoted; DocAttach)
- {
- }
- actionref(Approvals_Promoted; Approvals)
- {
- }
- actionref("Co&mments_Promoted"; "Co&mments")
- {
- }
- separator(Navigate_Separator)
- {
- }
- actionref(Vendor_Promoted; Vendor)
- {
- }
- actionref(MatchedOrderLines_Promoted; MatchedOrderLines)
- {
- }
- }
- group("Category_Incoming Document")
- {
- Caption = 'Incoming Document';
-
- actionref(IncomingDocAttachFile_Promoted; IncomingDocAttachFile)
- {
- }
- actionref(IncomingDocCard_Promoted; IncomingDocCard)
- {
- }
- actionref(SelectIncomingDoc_Promoted; SelectIncomingDoc)
- {
- }
- }
- group(Category_Category7)
- {
- Caption = 'Navigate', Comment = 'Generated from the PromotedActionCategories property index 6.';
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- HasIncomingDocument := IncomingDocument.PostedDocExists(Rec."No.", Rec."Posting Date");
- if GuiAllowed() then
- CurrPage.IncomingDocAttachFactBox.PAGE.LoadDataFromRecord(Rec);
- end;
-
- trigger OnAfterGetRecord()
- begin
- BuyFromContact.GetOrClear(Rec."Buy-from Contact No.");
- PayToContact.GetOrClear(Rec."Pay-to Contact No.");
- FillRemitToFields();
- end;
-
- trigger OnOpenPage()
- var
- OfficeMgt: Codeunit "Office Management";
- VATReportingDateMgt: Codeunit "VAT Reporting Date Mgt";
- begin
- Rec.SetSecurityFilterOnRespCenter();
- if GuiAllowed() then
- IsOfficeAddin := OfficeMgt.IsAvailable();
-
- ActivateFields();
- VATDateEnabled := VATReportingDateMgt.IsVATDateEnabled();
- end;
-
- var
- PurchInvHeader: Record "Purch. Inv. Header";
- BuyFromContact: Record Contact;
- PayToContact: Record Contact;
- RemitAddressBuffer: Record "Remit Address Buffer";
- FormatAddress: Codeunit "Format Address";
- HasIncomingDocument: Boolean;
- IsOfficeAddin: Boolean;
- IsBuyFromCountyVisible: Boolean;
- IsPayToCountyVisible: Boolean;
- IsShipToCountyVisible: Boolean;
- IsRemitToCountyVisible: Boolean;
- VATDateEnabled: Boolean;
-
- local procedure ActivateFields()
- begin
- IsBuyFromCountyVisible := FormatAddress.UseCounty(Rec."Buy-from Country/Region Code");
- IsPayToCountyVisible := FormatAddress.UseCounty(Rec."Pay-to Country/Region Code");
- IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
- end;
-
- local procedure FillRemitToFields()
- var
- RemitAddress: Record "Remit Address";
- begin
- RemitAddress.SetRange("Vendor No.", Rec."Buy-from Vendor No.");
- RemitAddress.SetRange(Code, Rec."Remit-to Code");
- if not RemitAddress.IsEmpty() then begin
- RemitAddress.FindFirst();
- FormatAddress.VendorRemitToAddress(RemitAddress, RemitAddressBuffer);
- IsRemitToCountyVisible := FormatAddress.UseCounty(RemitAddress."Country/Region Code");
- end;
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateCreditMemoOnAction(var PurchInvHeader: Record "Purch. Inv. Header"; var IsHandled: Boolean)
- begin
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Purchases/History/PurchCrMemoHdr.Table.al b/src/Layers/NL/BaseApp/Purchases/History/PurchCrMemoHdr.Table.al
deleted file mode 100644
index 9ea039c581..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/History/PurchCrMemoHdr.Table.al
+++ /dev/null
@@ -1,884 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.History;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.Payment;
-using Microsoft.CRM.Campaign;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Team;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Deferral;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.SalesTax;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.Navigate;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Foundation.PaymentTerms;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Foundation.Shipping;
-using Microsoft.Inventory.Intrastat;
-using Microsoft.Inventory.Location;
-using Microsoft.Pricing.Calculation;
-using Microsoft.Purchases.Comment;
-using Microsoft.Purchases.Payables;
-using Microsoft.Purchases.Vendor;
-using Microsoft.Sales.Customer;
-using Microsoft.Utilities;
-using System.Automation;
-using System.Globalization;
-using System.Security.AccessControl;
-using System.Security.User;
-
-table 124 "Purch. Cr. Memo Hdr."
-{
- Caption = 'Purch. Cr. Memo Hdr.';
- DataCaptionFields = "No.", "Buy-from Vendor Name";
- DrillDownPageID = "Posted Purchase Credit Memos";
- LookupPageID = "Posted Purchase Credit Memos";
- DataClassification = CustomerContent;
-
- fields
- {
- field(2; "Buy-from Vendor No."; Code[20])
- {
- Caption = 'Buy-from Vendor No.';
- NotBlank = true;
- TableRelation = Vendor;
- ToolTip = 'Specifies the number of the vendor that you shipped the items on the credit memo to.';
- }
- field(3; "No."; Code[20])
- {
- Caption = 'No.';
- ToolTip = 'Specifies the posted credit memo number.';
- }
- field(4; "Pay-to Vendor No."; Code[20])
- {
- Caption = 'Pay-to Vendor No.';
- NotBlank = true;
- TableRelation = Vendor;
- ToolTip = 'Specifies the number of the vendor that you received the credit memo from.';
- }
- field(5; "Pay-to Name"; Text[100])
- {
- Caption = 'Pay-to Name';
- ToolTip = 'Specifies the name of the vendor that you received the credit memo from.';
- }
- field(6; "Pay-to Name 2"; Text[50])
- {
- Caption = 'Pay-to Name 2';
- ToolTip = 'Specifies an additional part of the name of the vendor who you received the credit memo from.';
- }
- field(7; "Pay-to Address"; Text[100])
- {
- Caption = 'Pay-to Address';
- ToolTip = 'Specifies the address of the vendor that you received the credit memo from.';
- }
- field(8; "Pay-to Address 2"; Text[50])
- {
- Caption = 'Pay-to Address 2';
- ToolTip = 'Specifies additional address information.';
- }
- field(9; "Pay-to City"; Text[30])
- {
- Caption = 'Pay-to City';
- ToolTip = 'Specifies the city of the vendor on the purchase document.';
- TableRelation = "Post Code".City;
- ValidateTableRelation = false;
- }
- field(10; "Pay-to Contact"; Text[100])
- {
- Caption = 'Pay-to Contact';
- ToolTip = 'Specifies the name of the person you should contact at the vendor who you received the credit memo from.';
- }
- field(11; "Your Reference"; Text[35])
- {
- Caption = 'Your Reference';
- }
- field(12; "Ship-to Code"; Code[10])
- {
- Caption = 'Ship-to Code';
- ToolTip = 'Specifies a code for an alternate shipment address if you want to ship to another address than the one that has been entered automatically. This field is also used in case of drop shipment.';
- TableRelation = "Ship-to Address".Code where("Customer No." = field("Sell-to Customer No."));
- }
- field(13; "Ship-to Name"; Text[100])
- {
- Caption = 'Ship-to Name';
- ToolTip = 'Specifies the name of the customer at the address that the items are shipped to.';
- }
- field(14; "Ship-to Name 2"; Text[50])
- {
- Caption = 'Ship-to Name 2';
- }
- field(15; "Ship-to Address"; Text[100])
- {
- Caption = 'Ship-to Address';
- ToolTip = 'Specifies the address that the items in the purchase order were shipped to.';
- }
- field(16; "Ship-to Address 2"; Text[50])
- {
- Caption = 'Ship-to Address 2';
- ToolTip = 'Specifies additional address information.';
- }
- field(17; "Ship-to City"; Text[30])
- {
- Caption = 'Ship-to City';
- ToolTip = 'Specifies the city of the vendor on the purchase document.';
- TableRelation = "Post Code".City;
- ValidateTableRelation = false;
- }
- field(18; "Ship-to Contact"; Text[100])
- {
- Caption = 'Ship-to Contact';
- ToolTip = 'Specifies the name of a contact person at the address that the items were shipped to.';
- }
- field(20; "Posting Date"; Date)
- {
- Caption = 'Posting Date';
- ToolTip = 'Specifies the date the credit memo was posted.';
- }
- field(21; "Expected Receipt Date"; Date)
- {
- Caption = 'Expected Receipt Date';
- }
- field(22; "Posting Description"; Text[100])
- {
- Caption = 'Posting Description';
- ToolTip = 'Specifies any text that is entered to accompany the posting, for example for information to auditors.';
- }
- field(23; "Payment Terms Code"; Code[10])
- {
- Caption = 'Payment Terms Code';
- TableRelation = "Payment Terms";
- }
- field(24; "Due Date"; Date)
- {
- Caption = 'Due Date';
- ToolTip = 'Specifies when the credit memo is due. The program calculates the date using the Payment Terms Code and Posting Date fields on the purchase header.';
- }
- field(25; "Payment Discount %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Payment Discount %';
- DecimalPlaces = 0 : 5;
- }
- field(26; "Pmt. Discount Date"; Date)
- {
- Caption = 'Pmt. Discount Date';
- }
- field(27; "Shipment Method Code"; Code[10])
- {
- Caption = 'Shipment Method Code';
- TableRelation = "Shipment Method";
- }
- field(28; "Location Code"; Code[10])
- {
- Caption = 'Location Code';
- ToolTip = 'Specifies the code for the location used when you posted the credit memo.';
- TableRelation = Location where("Use As In-Transit" = const(false));
- }
- field(29; "Shortcut Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,2,1';
- Caption = 'Shortcut Dimension 1 Code';
- 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.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1));
- }
- field(30; "Shortcut Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,2,2';
- Caption = 'Shortcut Dimension 2 Code';
- 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.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2));
- }
- field(31; "Vendor Posting Group"; Code[20])
- {
- Caption = 'Vendor Posting Group';
- ToolTip = 'Specifies the vendor''s market type to link business transactions made for the vendor with the appropriate account in the general ledger.';
- Editable = false;
- TableRelation = "Vendor Posting Group";
- }
- field(32; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- ToolTip = 'Specifies the currency code used to calculate the amounts on the credit memo.';
- Editable = false;
- TableRelation = Currency;
- }
- field(33; "Currency Factor"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Currency Factor';
- DecimalPlaces = 0 : 15;
- MinValue = 0;
- }
- field(35; "Prices Including VAT"; Boolean)
- {
- Caption = 'Prices Including VAT';
- }
- field(37; "Invoice Disc. Code"; Code[20])
- {
- Caption = 'Invoice Disc. Code';
- }
- field(41; "Language Code"; Code[10])
- {
- Caption = 'Language Code';
- TableRelation = Language;
- }
- field(42; "Format Region"; Text[80])
- {
- Caption = 'Format Region';
- TableRelation = "Language Selection"."Language Tag";
- }
- field(43; "Purchaser Code"; Code[20])
- {
- Caption = 'Purchaser Code';
- ToolTip = 'Specifies which purchaser is assigned to the vendor.';
- TableRelation = "Salesperson/Purchaser";
- }
- field(46; Comment; Boolean)
- {
- CalcFormula = exist("Purch. Comment Line" where("Document Type" = const("Posted Credit Memo"),
- "No." = field("No."),
- "Document Line No." = const(0)));
- Caption = 'Comment';
- Editable = false;
- FieldClass = FlowField;
- }
- field(47; "No. Printed"; Integer)
- {
- Caption = 'No. Printed';
- ToolTip = 'Specifies how many times the document has been printed.';
- Editable = false;
- }
- field(51; "On Hold"; Code[3])
- {
- Caption = 'On Hold';
- }
- field(52; "Applies-to Doc. Type"; Enum "Gen. Journal Document Type")
- {
- Caption = 'Applies-to Doc. Type';
- ToolTip = 'Specifies the type of the posted document that this document or journal line will be applied to when you post, for example to register payment.';
- }
- field(53; "Applies-to Doc. No."; Code[20])
- {
- Caption = 'Applies-to Doc. No.';
- ToolTip = 'Specifies the number of the posted document that this document or journal line will be applied to when you post, for example to register payment.';
-
- trigger OnLookup()
- var
- VendLedgEntry: Record "Vendor Ledger Entry";
- begin
- VendLedgEntry.SetCurrentKey("Document No.");
- VendLedgEntry.SetRange("Document Type", "Applies-to Doc. Type");
- VendLedgEntry.SetRange("Document No.", "Applies-to Doc. No.");
- OnLookupAppliesToDocNoOnAfterSetFilters(VendLedgEntry, Rec);
- PAGE.Run(0, VendLedgEntry);
- end;
- }
- field(55; "Bal. Account No."; Code[20])
- {
- Caption = 'Bal. Account No.';
- TableRelation = if ("Bal. Account Type" = const("G/L Account")) "G/L Account"
- else
- if ("Bal. Account Type" = const("Bank Account")) "Bank Account";
- }
- field(60; Amount; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Purch. Cr. Memo Line".Amount where("Document No." = field("No.")));
- Caption = 'Amount';
- ToolTip = 'Specifies the total, in the currency of the credit memo, of the amounts on all the credit memo lines.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(61; "Amount Including VAT"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Purch. Cr. Memo Line"."Amount Including VAT" where("Document No." = field("No.")));
- Caption = 'Amount Including VAT';
- ToolTip = 'Specifies the total of the amounts, including VAT, on all the lines on the document.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(69; "Vendor Cr. Memo No."; Code[35])
- {
- Caption = 'Vendor Cr. Memo No.';
- ToolTip = 'Specifies the vendor''s number for this credit memo.';
- }
- field(70; "VAT Registration No."; Text[20])
- {
- Caption = 'VAT Registration No.';
- }
- field(72; "Sell-to Customer No."; Code[20])
- {
- Caption = 'Sell-to Customer No.';
- TableRelation = Customer;
- }
- field(73; "Reason Code"; Code[10])
- {
- Caption = 'Reason Code';
- TableRelation = "Reason Code";
- }
- field(74; "Gen. Bus. Posting Group"; Code[20])
- {
- Caption = 'Gen. Bus. Posting Group';
- TableRelation = "Gen. Business Posting Group";
- }
- field(76; "Transaction Type"; Code[10])
- {
- Caption = 'Transaction Type';
- TableRelation = "Transaction Type";
- }
- field(77; "Transport Method"; Code[10])
- {
- Caption = 'Transport Method';
- TableRelation = "Transport Method";
- }
- field(78; "VAT Country/Region Code"; Code[10])
- {
- Caption = 'VAT Country/Region Code';
- TableRelation = "Country/Region";
- }
- field(79; "Buy-from Vendor Name"; Text[100])
- {
- Caption = 'Buy-from Vendor Name';
- ToolTip = 'Specifies the name of the vendor who shipped the items.';
- }
- field(80; "Buy-from Vendor Name 2"; Text[50])
- {
- Caption = 'Buy-from Vendor Name 2';
- ToolTip = 'Specifies an additional part of the name of the vendor that you’re buying from.';
- }
- field(81; "Buy-from Address"; Text[100])
- {
- Caption = 'Buy-from Address';
- ToolTip = 'Specifies the address of the vendor who shipped the items.';
- }
- field(82; "Buy-from Address 2"; Text[50])
- {
- Caption = 'Buy-from Address 2';
- ToolTip = 'Specifies additional address information.';
- }
- field(83; "Buy-from City"; Text[30])
- {
- Caption = 'Buy-from City';
- ToolTip = 'Specifies the city of the vendor on the purchase document.';
- TableRelation = "Post Code".City;
- ValidateTableRelation = false;
- }
- field(84; "Buy-from Contact"; Text[100])
- {
- Caption = 'Buy-from Contact';
- ToolTip = 'Specifies the name of the contact person at the vendor who delivered the items.';
- }
- field(85; "Pay-to Post Code"; Code[20])
- {
- Caption = 'Pay-to Post Code';
- ToolTip = 'Specifies the post code of the vendor that you received the invoice from.';
- TableRelation = "Post Code";
- ValidateTableRelation = false;
- }
- field(86; "Pay-to County"; Text[30])
- {
- CaptionClass = '5,6,' + "Pay-to Country/Region Code";
- Caption = 'Pay-to County';
- ToolTip = 'Specifies the state, province or county as a part of the address.';
- }
- field(87; "Pay-to Country/Region Code"; Code[10])
- {
- Caption = 'Pay-to Country/Region Code';
- ToolTip = 'Specifies the country or region of the ship-to address.';
- TableRelation = "Country/Region";
- }
- field(88; "Buy-from Post Code"; Code[20])
- {
- Caption = 'Buy-from Post Code';
- ToolTip = 'Specifies the post code of the vendor who delivered the items.';
- TableRelation = "Post Code";
- ValidateTableRelation = false;
- }
- field(89; "Buy-from County"; Text[30])
- {
- CaptionClass = '5,5,' + "Buy-from Country/Region Code";
- Caption = 'Buy-from County';
- ToolTip = 'Specifies the state, province or county as a part of the address.';
- }
- field(90; "Buy-from Country/Region Code"; Code[10])
- {
- Caption = 'Buy-from Country/Region Code';
- ToolTip = 'Specifies the country or region of the ship-to address.';
- TableRelation = "Country/Region";
- }
- field(91; "Ship-to Post Code"; Code[20])
- {
- Caption = 'Ship-to Post Code';
- ToolTip = 'Specifies the postal code of the address that the items are shipped to.';
- TableRelation = "Post Code";
- ValidateTableRelation = false;
- }
- field(92; "Ship-to County"; Text[30])
- {
- CaptionClass = '5,4,' + "Ship-to Country/Region Code";
- Caption = 'Ship-to County';
- ToolTip = 'Specifies the state, province or county as a part of the address.';
- }
- field(93; "Ship-to Country/Region Code"; Code[10])
- {
- Caption = 'Ship-to Country/Region Code';
- ToolTip = 'Specifies the country or region of the ship-to address.';
- TableRelation = "Country/Region";
- }
- field(94; "Bal. Account Type"; enum "Payment Balance Account Type")
- {
- Caption = 'Bal. Account Type';
- }
- field(95; "Order Address Code"; Code[10])
- {
- Caption = 'Order Address Code';
- ToolTip = 'Specifies the order address of the related vendor.';
- TableRelation = "Order Address".Code where("Vendor No." = field("Buy-from Vendor No."));
- }
- field(97; "Entry Point"; Code[10])
- {
- Caption = 'Entry Point';
- TableRelation = "Entry/Exit Point";
- }
- field(98; Correction; Boolean)
- {
- Caption = 'Correction';
- ToolTip = 'Specifies the entry was posted as a corrective entry.';
- }
- field(99; "Document Date"; Date)
- {
- Caption = 'Document Date';
- ToolTip = 'Specifies the date on which the purchase document was created.';
- }
- field(101; "Area"; Code[10])
- {
- Caption = 'Area';
- TableRelation = Area;
- }
- field(102; "Transaction Specification"; Code[10])
- {
- Caption = 'Transaction Specification';
- TableRelation = "Transaction Specification";
- }
- field(104; "Payment Method Code"; Code[10])
- {
- Caption = 'Payment Method Code';
- TableRelation = "Payment Method";
- }
- field(107; "Pre-Assigned No. Series"; Code[20])
- {
- Caption = 'Pre-Assigned No. Series';
- TableRelation = "No. Series";
- }
- field(108; "No. Series"; Code[20])
- {
- Caption = 'No. Series';
- Editable = false;
- TableRelation = "No. Series";
- }
- field(111; "Pre-Assigned No."; Code[20])
- {
- Caption = 'Pre-Assigned No.';
- ToolTip = 'Specifies the number of the credit memo that the posted credit memo was created from.';
- }
- field(112; "User ID"; Code[50])
- {
- Caption = 'User ID';
- DataClassification = EndUserIdentifiableInformation;
- TableRelation = User."User Name";
- }
- field(113; "Source Code"; Code[10])
- {
- Caption = 'Source Code';
- TableRelation = "Source Code";
- }
- field(114; "Tax Area Code"; Code[20])
- {
- Caption = 'Tax Area Code';
- TableRelation = "Tax Area";
- }
- field(115; "Tax Liable"; Boolean)
- {
- Caption = 'Tax Liable';
- }
- field(116; "VAT Bus. Posting Group"; Code[20])
- {
- Caption = 'VAT Bus. Posting Group';
- TableRelation = "VAT Business Posting Group";
- }
- field(119; "VAT Base Discount %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'VAT Base Discount %';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
- }
- field(138; "Prepmt. Cr. Memo No. Series"; Code[20])
- {
- Caption = 'Prepmt. Cr. Memo No. Series';
- TableRelation = "No. Series";
- }
- field(140; "Prepayment Credit Memo"; Boolean)
- {
- Caption = 'Prepayment Credit Memo';
- }
- field(141; "Prepayment Order No."; Code[20])
- {
- Caption = 'Prepayment Order No.';
- }
- field(179; "VAT Reporting Date"; Date)
- {
- Caption = 'VAT Date';
- ToolTip = 'Specifies the VAT date on the invoice.';
- Editable = false;
- }
- field(210; "Ship-to Phone No."; Text[30])
- {
- Caption = 'Ship-to Phone No.';
- ToolTip = 'Specifies the telephone number of the company''s shipping address.';
- ExtendedDatatype = PhoneNo;
- }
- field(480; "Dimension Set ID"; Integer)
- {
- Caption = 'Dimension Set ID';
- Editable = false;
- TableRelation = "Dimension Set Entry";
-
- trigger OnLookup()
- begin
- Rec.ShowDimensions();
- end;
- }
- field(1302; Paid; Boolean)
- {
- CalcFormula = - exist("Vendor Ledger Entry" where("Entry No." = field("Vendor Ledger Entry No."),
- Open = filter(true)));
- Caption = 'Paid';
- ToolTip = 'Specifies if the posted purchase invoice that relates to this purchase credit memo is paid. The check box will also be selected if a credit memo for the remaining amount has been applied.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(1303; "Remaining Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = - sum("Detailed Vendor Ledg. Entry".Amount where("Vendor Ledger Entry No." = field("Vendor Ledger Entry No.")));
- Caption = 'Remaining Amount';
- ToolTip = 'Specifies the amount that remains to be paid for the posted purchase invoice that relates to this purchase credit memo.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(1304; "Vendor Ledger Entry No."; Integer)
- {
- Caption = 'Vendor Ledger Entry No.';
- Editable = false;
- TableRelation = "Vendor Ledger Entry"."Entry No.";
- }
- field(1305; "Invoice Discount Amount"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = Rec."Currency Code";
- CalcFormula = sum("Purch. Cr. Memo Line"."Inv. Discount Amount" where("Document No." = field("No.")));
- Caption = 'Invoice Discount Amount';
- Editable = false;
- FieldClass = FlowField;
- }
- field(1310; Cancelled; Boolean)
- {
- CalcFormula = exist("Cancelled Document" where("Source ID" = const(124),
- "Cancelled Doc. No." = field("No.")));
- Caption = 'Cancelled';
- ToolTip = 'Specifies if the posted purchase invoice that relates to this purchase credit memo has been either corrected or canceled.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(1311; Corrective; Boolean)
- {
- CalcFormula = exist("Cancelled Document" where("Source ID" = const(122),
- "Cancelled By Doc. No." = field("No.")));
- Caption = 'Corrective';
- ToolTip = 'Specifies if the posted purchase invoice has been either corrected or canceled by this purchase credit memo .';
- Editable = false;
- FieldClass = FlowField;
- }
- field(5050; "Campaign No."; Code[20])
- {
- Caption = 'Campaign No.';
- TableRelation = Campaign;
- }
- field(5052; "Buy-from Contact No."; Code[20])
- {
- Caption = 'Buy-from Contact No.';
- ToolTip = 'Specifies the number of the contact who you sent the purchase credit memo to.';
- TableRelation = Contact;
- }
- field(5053; "Pay-to Contact No."; Code[20])
- {
- Caption = 'Pay-to Contact No.';
- ToolTip = 'Specifies the number of the contact at the vendor who handles the credit memo.';
- TableRelation = Contact;
- }
- field(5700; "Responsibility Center"; Code[10])
- {
- Caption = 'Responsibility Center';
- ToolTip = 'Specifies the code for the responsibility center that serves the vendor on this purchase document.';
- TableRelation = "Responsibility Center";
- }
- field(6601; "Return Order No."; Code[20])
- {
- AccessByPermission = TableData "Return Shipment Header" = R;
- Caption = 'Return Order No.';
- }
- field(6602; "Return Order No. Series"; Code[20])
- {
- Caption = 'Return Order No. Series';
- TableRelation = "No. Series";
- }
- field(7000; "Price Calculation Method"; Enum "Price Calculation Method")
- {
- Caption = 'Price Calculation Method';
- }
- field(8001; "Draft Cr. Memo SystemId"; Guid)
- {
- Caption = 'Draft Cr. Memo System Id';
- DataClassification = SystemMetadata;
- }
- field(11000000; "Transaction Mode"; Code[20])
- {
- Caption = 'Transaction Mode';
- TableRelation = "Transaction Mode".Code where("Account Type" = const(Vendor));
-
- trigger OnValidate()
- var
- begin
- end;
- }
- field(11000001; "Bank Account"; Code[20])
- {
- Caption = 'Bank Account';
- TableRelation = "Vendor Bank Account".Code where("Vendor No." = field("Buy-from Vendor No."));
- }
- }
-
- keys
- {
- key(Key1; "No.")
- {
- Clustered = true;
- }
- key(Key2; "Pre-Assigned No.")
- {
- }
- key(Key3; "Vendor Cr. Memo No.", "Posting Date")
- {
- }
- key(Key4; "Return Order No.")
- {
- }
- key(Key5; "Buy-from Vendor No.")
- {
- }
- key(Key6; "Prepayment Order No.")
- {
- }
- key(Key7; "Pay-to Vendor No.")
- {
- }
- key(Key8; "Posting Date")
- {
- }
- }
-
- fieldgroups
- {
- fieldgroup(DropDown; "No.", "Buy-from Vendor No.", "Pay-to Vendor No.", "Posting Date", "Posting Description")
- {
- }
- }
-
- trigger OnDelete()
- var
- PostedDeferralHeader: Record "Posted Deferral Header";
- PostPurchDelete: Codeunit "PostPurch-Delete";
- begin
- PostPurchDelete.IsDocumentDeletionAllowed("Posting Date");
- LockTable();
- PostPurchDelete.DeletePurchCrMemoLines(Rec);
-
- PurchCommentLine.SetRange("Document Type", PurchCommentLine."Document Type"::"Posted Credit Memo");
- PurchCommentLine.SetRange("No.", "No.");
- PurchCommentLine.DeleteAll();
-
- ApprovalsMgmt.DeletePostedApprovalEntries(RecordId);
- PostedDeferralHeader.DeleteForDoc(
- "Deferral Document Type"::Purchase.AsInteger(), '', '',
- PurchCommentLine."Document Type"::"Posted Credit Memo".AsInteger(), "No.");
- end;
-
- var
- PurchCrMemoHeader: Record "Purch. Cr. Memo Hdr.";
- PurchCommentLine: Record "Purch. Comment Line";
- DimMgt: Codeunit DimensionManagement;
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- UserSetupMgt: Codeunit "User Setup Management";
-
- procedure PrintRecords(ShowRequestPage: Boolean)
- var
- ReportSelection: Record "Report Selections";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforePrintRecords(Rec, ShowRequestPage, IsHandled);
- if not IsHandled then begin
- PurchCrMemoHeader.Copy(Rec);
- ReportSelection.PrintWithDialogForVend(
- ReportSelection.Usage::"P.Cr.Memo", PurchCrMemoHeader, ShowRequestPage, PurchCrMemoHeader.FieldNo("Buy-from Vendor No."));
- end;
- end;
-
- procedure PrintToDocumentAttachment(var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.")
- begin
- if PurchCrMemoHdr.FindSet() then
- repeat
- DoPrintToDocumentAttachment(PurchCrMemoHdr);
- until PurchCrMemoHdr.Next() = 0;
- end;
-
- local procedure DoPrintToDocumentAttachment(PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.")
- var
- ReportSelections: Record "Report Selections";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeDoPrintToDocumentAttachment(PurchCrMemoHdr, IsHandled);
- if IsHandled then
- exit;
-
- PurchCrMemoHdr.SetRecFilter();
- ReportSelections.SaveAsDocumentAttachment(
- ReportSelections.Usage::"P.Cr.Memo".AsInteger(), PurchCrMemoHdr, PurchCrMemoHdr."No.", PurchCrMemoHdr."Buy-from Vendor No.", true);
- end;
-
- procedure Navigate()
- var
- NavigatePage: Page Navigate;
- begin
- NavigatePage.SetDoc("Posting Date", "No.");
- NavigatePage.SetRec(Rec);
- NavigatePage.Run();
- end;
-
- procedure ShowDimensions()
- begin
- DimMgt.ShowDimensionSet("Dimension Set ID", StrSubstNo('%1 %2', TableCaption(), "No."));
- end;
-
- procedure SetSecurityFilterOnRespCenter()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetSecurityFilterOnRespCenter(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if UserSetupMgt.GetPurchasesFilter() <> '' then begin
- FilterGroup(2);
- SetRange("Responsibility Center", UserSetupMgt.GetPurchasesFilter());
- FilterGroup(0);
- end;
- end;
-
- procedure ShowCanceledOrCorrInvoice()
- begin
- CalcFields(Cancelled, Corrective);
- case true of
- Cancelled:
- Rec.ShowCorrectiveInvoice();
- Corrective:
- Rec.ShowCancelledInvoice();
- end;
- end;
-
- procedure ShowCorrectiveInvoice()
- var
- CancelledDocument: Record "Cancelled Document";
- PurchInvHeader: Record "Purch. Inv. Header";
- IsHandled: Boolean;
- begin
- CalcFields(Cancelled);
- if not Cancelled then
- exit;
-
- if CancelledDocument.FindPurchCancelledCrMemo("No.") then begin
- PurchInvHeader.Get(CancelledDocument."Cancelled By Doc. No.");
- IsHandled := false;
- OnShowCorrectiveInvoiceOnBeforeOpenPage(PurchInvHeader, IsHandled);
- if not IsHandled then
- PAGE.Run(PAGE::"Posted Purchase Invoice", PurchInvHeader);
- end;
- end;
-
- procedure ShowCancelledInvoice()
- var
- CancelledDocument: Record "Cancelled Document";
- PurchInvHeader: Record "Purch. Inv. Header";
- IsHandled: Boolean;
- begin
- CalcFields(Corrective);
- if not Corrective then
- exit;
-
- if CancelledDocument.FindPurchCorrectiveCrMemo("No.") then begin
- PurchInvHeader.Get(CancelledDocument."Cancelled Doc. No.");
- IsHandled := false;
- OnShowCancelledInvoiceOnBeforeOpenPage(PurchInvHeader, IsHandled);
- if not IsHandled then
- PAGE.Run(PAGE::"Posted Purchase Invoice", PurchInvHeader);
- end;
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePrintRecords(var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; ShowRequestPage: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetSecurityFilterOnRespCenter(var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnLookupAppliesToDocNoOnAfterSetFilters(var VendLedgEntry: Record "Vendor Ledger Entry"; PurchCrMemoHeader: Record "Purch. Cr. Memo Hdr.")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeDoPrintToDocumentAttachment(var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnShowCorrectiveInvoiceOnBeforeOpenPage(var PurchInvHeader: Record "Purch. Inv. Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnShowCancelledInvoiceOnBeforeOpenPage(var PurchInvHeader: Record "Purch. Inv. Header"; var IsHandled: Boolean)
- begin
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Purchases/History/PurchInvHeader.Table.al b/src/Layers/NL/BaseApp/Purchases/History/PurchInvHeader.Table.al
deleted file mode 100644
index b985efe9bb..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/History/PurchInvHeader.Table.al
+++ /dev/null
@@ -1,958 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.History;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.Payment;
-using Microsoft.CRM.Campaign;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Team;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Deferral;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.SalesTax;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.Navigate;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Foundation.PaymentTerms;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Foundation.Shipping;
-using Microsoft.Inventory.Intrastat;
-using Microsoft.Inventory.Location;
-using Microsoft.Pricing.Calculation;
-using Microsoft.Purchases.Comment;
-using Microsoft.Purchases.Payables;
-using Microsoft.Purchases.Remittance;
-using Microsoft.Purchases.Vendor;
-using Microsoft.Sales.Customer;
-using Microsoft.Utilities;
-using System.Automation;
-using System.Globalization;
-using System.Security.AccessControl;
-using System.Security.User;
-
-table 122 "Purch. Inv. Header"
-{
- Caption = 'Purch. Inv. Header';
- DataCaptionFields = "No.", "Buy-from Vendor Name";
- DrillDownPageID = "Posted Purchase Invoices";
- LookupPageID = "Posted Purchase Invoices";
- DataClassification = CustomerContent;
-
- fields
- {
- field(2; "Buy-from Vendor No."; Code[20])
- {
- Caption = 'Buy-from Vendor No.';
- NotBlank = true;
- ToolTip = 'Specifies the identifier of the vendor that you bought the items from.';
- TableRelation = Vendor;
- }
- field(3; "No."; Code[20])
- {
- Caption = 'No.';
- ToolTip = 'Specifies the posted invoice number.';
- }
- field(4; "Pay-to Vendor No."; Code[20])
- {
- Caption = 'Pay-to Vendor No.';
- NotBlank = true;
- TableRelation = Vendor;
- ToolTip = 'Specifies the number of the vendor that you received the invoice from.';
- }
- field(5; "Pay-to Name"; Text[100])
- {
- Caption = 'Pay-to Name';
- ToolTip = 'Specifies the name of the vendor who you received the invoice from.';
- }
- field(6; "Pay-to Name 2"; Text[50])
- {
- Caption = 'Pay-to Name 2';
- ToolTip = 'Specifies an additional part of the name of the vendor who you receive the invoice from.';
- }
- field(7; "Pay-to Address"; Text[100])
- {
- Caption = 'Pay-to Address';
- ToolTip = 'Specifies the address of the vendor that you received the invoice from.';
- }
- field(8; "Pay-to Address 2"; Text[50])
- {
- Caption = 'Pay-to Address 2';
- ToolTip = 'Specifies additional address information.';
- }
- field(9; "Pay-to City"; Text[30])
- {
- Caption = 'Pay-to City';
- ToolTip = 'Specifies the city of the vendor on the purchase document.';
- TableRelation = "Post Code".City;
- ValidateTableRelation = false;
- }
- field(10; "Pay-to Contact"; Text[100])
- {
- Caption = 'Pay-to Contact';
- ToolTip = 'Specifies the name of the person you should contact at the vendor who you received the invoice from.';
- }
- field(11; "Your Reference"; Text[35])
- {
- Caption = 'Your Reference';
- }
- field(12; "Ship-to Code"; Code[10])
- {
- Caption = 'Ship-to Code';
- ToolTip = 'Specifies the address on purchase orders shipped with a drop shipment directly from the vendor to a customer.';
- TableRelation = "Ship-to Address".Code where("Customer No." = field("Sell-to Customer No."));
- }
- field(13; "Ship-to Name"; Text[100])
- {
- Caption = 'Ship-to Name';
- ToolTip = 'Specifies the name of the customer at the address that the items are shipped to.';
- }
- field(14; "Ship-to Name 2"; Text[50])
- {
- Caption = 'Ship-to Name 2';
- ToolTip = 'Specifies an additional part of the name of the company at the address to which the items in the purchase order were shipped.';
- }
- field(15; "Ship-to Address"; Text[100])
- {
- Caption = 'Ship-to Address';
- ToolTip = 'Specifies the address that the items in the purchase order were shipped to.';
- }
- field(16; "Ship-to Address 2"; Text[50])
- {
- Caption = 'Ship-to Address 2';
- ToolTip = 'Specifies additional address information.';
- }
- field(17; "Ship-to City"; Text[30])
- {
- Caption = 'Ship-to City';
- ToolTip = 'Specifies the city of the vendor on the purchase document.';
- TableRelation = "Post Code".City;
- ValidateTableRelation = false;
- }
- field(18; "Ship-to Contact"; Text[100])
- {
- Caption = 'Ship-to Contact';
- ToolTip = 'Specifies the name of a contact person at the address that the items in the purchase order were shipped to.';
- }
- field(19; "Order Date"; Date)
- {
- Caption = 'Order Date';
- }
- field(20; "Posting Date"; Date)
- {
- Caption = 'Posting Date';
- ToolTip = 'Specifies the date the purchase header was posted.';
- }
- field(21; "Expected Receipt Date"; Date)
- {
- Caption = 'Expected Receipt Date';
- ToolTip = 'Specifies the date on which the invoiced items were expected.';
- }
- field(22; "Posting Description"; Text[100])
- {
- Caption = 'Posting Description';
- ToolTip = 'Specifies any text that is entered to accompany the posting, for example for information to auditors.';
- }
- field(23; "Payment Terms Code"; Code[10])
- {
- Caption = 'Payment Terms Code';
- ToolTip = 'Specifies the code to use to find the payment terms that apply to the purchase header.';
- TableRelation = "Payment Terms";
- }
- field(24; "Due Date"; Date)
- {
- Caption = 'Due Date';
- ToolTip = 'Specifies when the invoice is due. The program calculates the date using the Payment Terms Code and Document Date fields on the purchase header.';
- }
- field(25; "Payment Discount %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Payment Discount %';
- ToolTip = 'Specifies the payment discount percent granted if payment is made on or before the date in the Pmt. Discount Date field.';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
- }
- field(26; "Pmt. Discount Date"; Date)
- {
- Caption = 'Pmt. Discount Date';
- ToolTip = 'Specifies the date on which the amount in the entry must be paid for a payment discount to be granted.';
- }
- field(27; "Shipment Method Code"; Code[10])
- {
- Caption = 'Shipment Method Code';
- ToolTip = 'Specifies the delivery conditions of the related shipment, such as free on board (FOB).';
- TableRelation = "Shipment Method";
- }
- field(28; "Location Code"; Code[10])
- {
- Caption = 'Location Code';
- ToolTip = 'Specifies the code for the location where the items are registered.';
- TableRelation = Location where("Use As In-Transit" = const(false));
- }
- field(29; "Shortcut Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,2,1';
- Caption = 'Shortcut Dimension 1 Code';
- 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.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1));
- }
- field(30; "Shortcut Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,2,2';
- Caption = 'Shortcut Dimension 2 Code';
- 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.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2));
- }
- field(31; "Vendor Posting Group"; Code[20])
- {
- Caption = 'Vendor Posting Group';
- ToolTip = 'Specifies the vendor''s market type to link business transactions made for the vendor with the appropriate account in the general ledger.';
- Editable = false;
- TableRelation = "Vendor Posting Group";
- }
- field(32; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- ToolTip = 'Specifies the currency code used to calculate the amounts on the invoice.';
- Editable = false;
- TableRelation = Currency;
- }
- field(33; "Currency Factor"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Currency Factor';
- DecimalPlaces = 0 : 15;
- MinValue = 0;
- }
- field(35; "Prices Including VAT"; Boolean)
- {
- Caption = 'Prices Including VAT';
- }
- field(37; "Invoice Disc. Code"; Code[20])
- {
- Caption = 'Invoice Disc. Code';
- }
- field(41; "Language Code"; Code[10])
- {
- Caption = 'Language Code';
- TableRelation = Language;
- }
- field(42; "Format Region"; Text[80])
- {
- Caption = 'Format Region';
- TableRelation = "Language Selection"."Language Tag";
- }
- field(43; "Purchaser Code"; Code[20])
- {
- Caption = 'Purchaser Code';
- ToolTip = 'Specifies which purchaser is assigned to the vendor.';
- TableRelation = "Salesperson/Purchaser";
- }
- field(44; "Order No."; Code[20])
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- Caption = 'Order No.';
- ToolTip = 'Specifies the number of the purchase order that this invoice was posted from.';
- }
- field(46; Comment; Boolean)
- {
- CalcFormula = exist("Purch. Comment Line" where("Document Type" = const("Posted Invoice"),
- "No." = field("No."),
- "Document Line No." = const(0)));
- Caption = 'Comment';
- Editable = false;
- FieldClass = FlowField;
- }
- field(47; "No. Printed"; Integer)
- {
- Caption = 'No. Printed';
- ToolTip = 'Specifies how many times the document has been printed.';
- Editable = false;
- }
- field(51; "On Hold"; Code[3])
- {
- Caption = 'On Hold';
- }
- field(52; "Applies-to Doc. Type"; Enum "Gen. Journal Document Type")
- {
- Caption = 'Applies-to Doc. Type';
- }
- field(53; "Applies-to Doc. No."; Code[20])
- {
- Caption = 'Applies-to Doc. No.';
-
- trigger OnLookup()
- var
- VendLedgEntry: Record "Vendor Ledger Entry";
- begin
- VendLedgEntry.SetCurrentKey("Document No.");
- VendLedgEntry.SetRange("Document Type", "Applies-to Doc. Type");
- VendLedgEntry.SetRange("Document No.", "Applies-to Doc. No.");
- OnLookupAppliesToDocNoOnAfterSetFilters(VendLedgEntry, Rec);
- PAGE.Run(0, VendLedgEntry);
- end;
- }
- field(55; "Bal. Account No."; Code[20])
- {
- Caption = 'Bal. Account No.';
- TableRelation = if ("Bal. Account Type" = const("G/L Account")) "G/L Account"
- else
- if ("Bal. Account Type" = const("Bank Account")) "Bank Account";
- }
- field(60; Amount; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Purch. Inv. Line".Amount where("Document No." = field("No.")));
- Caption = 'Amount';
- ToolTip = 'Specifies the total, in the currency of the invoice, of the amounts on all the invoice lines.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(61; "Amount Including VAT"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Purch. Inv. Line"."Amount Including VAT" where("Document No." = field("No.")));
- Caption = 'Amount Including VAT';
- ToolTip = 'Specifies the total of the amounts, including VAT, on all the lines on the document.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(66; "Vendor Order No."; Code[35])
- {
- Caption = 'Vendor Order No.';
- ToolTip = 'Specifies the vendor''s order number.';
- }
- field(68; "Vendor Invoice No."; Code[35])
- {
- Caption = 'Vendor Invoice No.';
- ToolTip = 'Specifies the vendor''s own invoice number.';
- }
- field(70; "VAT Registration No."; Text[20])
- {
- Caption = 'VAT Registration No.';
- }
- field(72; "Sell-to Customer No."; Code[20])
- {
- Caption = 'Sell-to Customer No.';
- TableRelation = Customer;
- }
- field(73; "Reason Code"; Code[10])
- {
- Caption = 'Reason Code';
- TableRelation = "Reason Code";
- }
- field(74; "Gen. Bus. Posting Group"; Code[20])
- {
- Caption = 'Gen. Bus. Posting Group';
- TableRelation = "Gen. Business Posting Group";
- }
- field(76; "Transaction Type"; Code[10])
- {
- Caption = 'Transaction Type';
- TableRelation = "Transaction Type";
- }
- field(77; "Transport Method"; Code[10])
- {
- Caption = 'Transport Method';
- TableRelation = "Transport Method";
- }
- field(78; "VAT Country/Region Code"; Code[10])
- {
- Caption = 'VAT Country/Region Code';
- TableRelation = "Country/Region";
- }
- field(79; "Buy-from Vendor Name"; Text[100])
- {
- Caption = 'Buy-from Vendor Name';
- ToolTip = 'Specifies the name of the vendor who shipped the items.';
- }
- field(80; "Buy-from Vendor Name 2"; Text[50])
- {
- Caption = 'Buy-from Vendor Name 2';
- ToolTip = 'Specifies an additional part of the name of the vendor that you’re buying from.';
- }
- field(81; "Buy-from Address"; Text[100])
- {
- Caption = 'Buy-from Address';
- ToolTip = 'Specifies the address of the vendor who shipped the items.';
- }
- field(82; "Buy-from Address 2"; Text[50])
- {
- Caption = 'Buy-from Address 2';
- ToolTip = 'Specifies additional address information.';
- }
- field(83; "Buy-from City"; Text[30])
- {
- Caption = 'Buy-from City';
- ToolTip = 'Specifies the city of the vendor on the purchase document.';
- TableRelation = "Post Code".City;
- ValidateTableRelation = false;
- }
- field(84; "Buy-from Contact"; Text[100])
- {
- Caption = 'Buy-from Contact';
- ToolTip = 'Specifies the name of the contact person at the vendor who delivered the items.';
- }
- field(85; "Pay-to Post Code"; Code[20])
- {
- Caption = 'Pay-to Post Code';
- ToolTip = 'Specifies the post code of the vendor that you received the invoice from.';
- TableRelation = "Post Code";
- ValidateTableRelation = false;
- }
- field(86; "Pay-to County"; Text[30])
- {
- CaptionClass = '5,6,' + "Pay-to Country/Region Code";
- Caption = 'Pay-to County';
- ToolTip = 'Specifies the state, province or county as a part of the address.';
- }
- field(87; "Pay-to Country/Region Code"; Code[10])
- {
- Caption = 'Pay-to Country/Region Code';
- ToolTip = 'Specifies the country or region of the ship-to address.';
- TableRelation = "Country/Region";
- }
- field(88; "Buy-from Post Code"; Code[20])
- {
- Caption = 'Buy-from Post Code';
- ToolTip = 'Specifies the post code of the vendor who delivered the items.';
- TableRelation = "Post Code";
- ValidateTableRelation = false;
- }
- field(89; "Buy-from County"; Text[30])
- {
- CaptionClass = '5,5,' + "Buy-from Country/Region Code";
- Caption = 'Buy-from County';
- ToolTip = 'Specifies the state, province or county as a part of the address.';
- }
- field(90; "Buy-from Country/Region Code"; Code[10])
- {
- Caption = 'Buy-from Country/Region Code';
- ToolTip = 'Specifies the country or region of the ship-to address.';
- TableRelation = "Country/Region";
- }
- field(91; "Ship-to Post Code"; Code[20])
- {
- Caption = 'Ship-to Post Code';
- ToolTip = 'Specifies the postal code of the address that the items are shipped to.';
- TableRelation = "Post Code";
- ValidateTableRelation = false;
- }
- field(92; "Ship-to County"; Text[30])
- {
- CaptionClass = '5,4,' + "Ship-to Country/Region Code";
- Caption = 'Ship-to County';
- ToolTip = 'Specifies the state, province or county as a part of the address.';
- }
- field(93; "Ship-to Country/Region Code"; Code[10])
- {
- Caption = 'Ship-to Country/Region Code';
- ToolTip = 'Specifies the country or region of the ship-to address.';
- TableRelation = "Country/Region";
- }
- field(94; "Bal. Account Type"; enum "Payment Balance Account Type")
- {
- Caption = 'Bal. Account Type';
- }
- field(95; "Order Address Code"; Code[10])
- {
- Caption = 'Order Address Code';
- ToolTip = 'Specifies the order address of the related vendor.';
- TableRelation = "Order Address".Code where("Vendor No." = field("Buy-from Vendor No."));
- }
- field(97; "Entry Point"; Code[10])
- {
- Caption = 'Entry Point';
- TableRelation = "Entry/Exit Point";
- }
- field(98; Correction; Boolean)
- {
- Caption = 'Correction';
- }
- field(99; "Document Date"; Date)
- {
- Caption = 'Document Date';
- ToolTip = 'Specifies the date on which the purchase document was created.';
- }
- field(101; "Area"; Code[10])
- {
- Caption = 'Area';
- TableRelation = Area;
- }
- field(102; "Transaction Specification"; Code[10])
- {
- Caption = 'Transaction Specification';
- TableRelation = "Transaction Specification";
- }
- field(104; "Payment Method Code"; Code[10])
- {
- Caption = 'Payment Method Code';
- ToolTip = 'Specifies how to make payment, such as with bank transfer, cash, or check.';
- TableRelation = "Payment Method";
- }
- field(107; "Pre-Assigned No. Series"; Code[20])
- {
- Caption = 'Pre-Assigned No. Series';
- TableRelation = "No. Series";
- }
- field(108; "No. Series"; Code[20])
- {
- Caption = 'No. Series';
- Editable = false;
- TableRelation = "No. Series";
- }
- field(110; "Order No. Series"; Code[20])
- {
- Caption = 'Order No. Series';
- TableRelation = "No. Series";
- }
- field(111; "Pre-Assigned No."; Code[20])
- {
- Caption = 'Pre-Assigned No.';
- ToolTip = 'Specifies the number of the purchase document that the posted invoice was created for.';
- }
- field(112; "User ID"; Code[50])
- {
- Caption = 'User ID';
- DataClassification = EndUserIdentifiableInformation;
- TableRelation = User."User Name";
- }
- field(113; "Source Code"; Code[10])
- {
- Caption = 'Source Code';
- TableRelation = "Source Code";
- }
- field(114; "Tax Area Code"; Code[20])
- {
- Caption = 'Tax Area Code';
- ToolTip = 'Specifies the tax area that is used to calculate and post sales tax.';
- TableRelation = "Tax Area";
- }
- field(115; "Tax Liable"; Boolean)
- {
- Caption = 'Tax Liable';
- ToolTip = 'Specifies if the customer or vendor is liable for sales tax.';
- }
- field(116; "VAT Bus. Posting Group"; Code[20])
- {
- Caption = 'VAT Bus. Posting Group';
- TableRelation = "VAT Business Posting Group";
- }
- field(119; "VAT Base Discount %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'VAT Base Discount %';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
- }
- field(135; "Prepayment No. Series"; Code[20])
- {
- Caption = 'Prepayment No. Series';
- TableRelation = "No. Series";
- }
- field(140; "Prepayment Invoice"; Boolean)
- {
- Caption = 'Prepayment Invoice';
- }
- field(141; "Prepayment Order No."; Code[20])
- {
- Caption = 'Prepayment Order No.';
- }
- field(151; "Quote No."; Code[20])
- {
- Caption = 'Quote No.';
- ToolTip = 'Specifies the number of the purchase quote document if a quote was used to start the purchase process.';
- Editable = false;
- }
- field(170; "Creditor No."; Code[20])
- {
- Caption = 'Creditor No.';
- ToolTip = 'Specifies the number of the vendor.';
- }
- field(171; "Payment Reference"; Code[50])
- {
- Caption = 'Payment Reference';
- ToolTip = 'Specifies the payment of the purchase invoice.';
- }
- field(179; "VAT Reporting Date"; Date)
- {
- Caption = 'VAT Date';
- ToolTip = 'Specifies the VAT date on the invoice.';
- Editable = false;
- }
- field(180; "Self-Billing Invoice"; Boolean)
- {
- Caption = 'Self-Billing Invoice';
- }
- field(210; "Ship-to Phone No."; Text[30])
- {
- Caption = 'Ship-to Phone No.';
- ToolTip = 'Specifies the telephone number of the company''s shipping address.';
- ExtendedDatatype = PhoneNo;
- }
- field(480; "Dimension Set ID"; Integer)
- {
- Caption = 'Dimension Set ID';
- Editable = false;
- TableRelation = "Dimension Set Entry";
-
- trigger OnLookup()
- begin
- Rec.ShowDimensions();
- end;
- }
- field(1000; "Remit-to Code"; Code[20])
- {
- Caption = 'Remit-to Code';
- ToolTip = 'Specifies the code for the vendor''s remit address for this invoice.';
- Editable = false;
- TableRelation = "Remit Address".Code where("Vendor No." = field("Buy-from Vendor No."));
- }
- field(1302; Closed; Boolean)
- {
- CalcFormula = - exist("Vendor Ledger Entry" where("Entry No." = field("Vendor Ledger Entry No."),
- Open = filter(true)));
- Caption = 'Closed';
- ToolTip = 'Specifies if the posted purchase invoice is paid. The check box will also be selected if a credit memo for the remaining amount has been applied.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(1303; "Remaining Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = - sum("Detailed Vendor Ledg. Entry".Amount where("Vendor Ledger Entry No." = field("Vendor Ledger Entry No.")));
- Caption = 'Remaining Amount';
- ToolTip = 'Specifies the remaining amount of the invoice.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(1304; "Vendor Ledger Entry No."; Integer)
- {
- Caption = 'Vendor Ledger Entry No.';
- Editable = false;
- TableRelation = "Vendor Ledger Entry"."Entry No.";
- }
- field(1305; "Invoice Discount Amount"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = Rec."Currency Code";
- CalcFormula = sum("Purch. Inv. Line"."Inv. Discount Amount" where("Document No." = field("No.")));
- Caption = 'Invoice Discount Amount';
- Editable = false;
- FieldClass = FlowField;
- }
- field(1310; Cancelled; Boolean)
- {
- CalcFormula = exist("Cancelled Document" where("Source ID" = const(122),
- "Cancelled Doc. No." = field("No.")));
- Caption = 'Cancelled';
- ToolTip = 'Specifies if the posted purchase invoice has been either corrected or canceled.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(1311; Corrective; Boolean)
- {
- CalcFormula = exist("Cancelled Document" where("Source ID" = const(124),
- "Cancelled By Doc. No." = field("No.")));
- Caption = 'Corrective';
- ToolTip = 'Specifies if the posted purchase invoice is a corrective document.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(1340; "Dispute Status"; Code[10])
- {
- Caption = 'Dispute Status';
- ToolTip = 'Specifies if there is an ongoing dispute for this document.';
- TableRelation = "Dispute Status";
- DataClassification = CustomerContent;
- }
- field(5050; "Campaign No."; Code[20])
- {
- Caption = 'Campaign No.';
- TableRelation = Campaign;
- }
- field(5052; "Buy-from Contact No."; Code[20])
- {
- Caption = 'Buy-from Contact No.';
- ToolTip = 'Specifies the number of the contact you bought the items from.';
- TableRelation = Contact;
- }
- field(5053; "Pay-to Contact No."; Code[20])
- {
- Caption = 'Pay-to Contact No.';
- ToolTip = 'Specifies the number of the contact you received the invoice from.';
- TableRelation = Contact;
- }
- field(5700; "Responsibility Center"; Code[10])
- {
- Caption = 'Responsibility Center';
- ToolTip = 'Specifies the code for the responsibility center that serves the vendor on this purchase document.';
- TableRelation = "Responsibility Center";
- }
- field(7000; "Price Calculation Method"; Enum "Price Calculation Method")
- {
- Caption = 'Price Calculation Method';
- }
- field(8001; "Draft Invoice SystemId"; Guid)
- {
- Caption = 'Draft Invoice SystemId';
- DataClassification = SystemMetadata;
- }
- field(11000000; "Transaction Mode"; Code[20])
- {
- Caption = 'Transaction Mode';
- TableRelation = "Transaction Mode".Code where("Account Type" = const(Vendor));
- }
- field(11000001; "Bank Account"; Code[20])
- {
- Caption = 'Bank Account';
- TableRelation = "Vendor Bank Account".Code where("Vendor No." = field("Buy-from Vendor No."));
- }
- }
-
- keys
- {
- key(Key1; "No.")
- {
- Clustered = true;
- }
- key(Key2; "Order No.")
- {
- }
- key(Key3; "Pre-Assigned No.")
- {
- }
- key(Key4; "Vendor Invoice No.", "Posting Date")
- {
- }
- key(Key5; "Buy-from Vendor No.")
- {
- }
- key(Key6; "Prepayment Order No.", "Prepayment Invoice")
- {
- }
- key(Key7; "Pay-to Vendor No.")
- {
- }
- key(Key8; "Posting Date")
- {
- }
- key(Key9; "Due Date")
- {
- }
- }
-
- fieldgroups
- {
- fieldgroup(DropDown; "No.", "Buy-from Vendor No.", "Pay-to Vendor No.", "Posting Date", "Posting Description")
- {
- }
- fieldgroup(Brick; "No.", "Buy-from Vendor Name", Amount, "Due Date", "Amount Including VAT")
- {
- }
- }
-
- trigger OnDelete()
- var
- PostedDeferralHeader: Record "Posted Deferral Header";
- PostPurchDelete: Codeunit "PostPurch-Delete";
- begin
- PostPurchDelete.IsDocumentDeletionAllowed("Posting Date");
- LockTable();
- PostPurchDelete.DeletePurchInvLines(Rec);
-
- PurchCommentLine.SetRange("Document Type", PurchCommentLine."Document Type"::"Posted Invoice");
- PurchCommentLine.SetRange("No.", "No.");
- PurchCommentLine.DeleteAll();
-
- ApprovalsMgmt.DeletePostedApprovalEntries(RecordId);
- PostedDeferralHeader.DeleteForDoc(
- Enum::"Deferral Document Type"::Purchase.AsInteger(), '', '',
- PurchCommentLine."Document Type"::"Posted Invoice".AsInteger(), "No.");
- end;
-
- var
- PurchInvHeader: Record "Purch. Inv. Header";
- PurchCommentLine: Record "Purch. Comment Line";
- DimMgt: Codeunit DimensionManagement;
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- UserSetupMgt: Codeunit "User Setup Management";
-
- procedure IsFullyOpen(): Boolean
- var
- FullyOpen: Boolean;
- IsHandled: Boolean;
- begin
- OnBeforCheckIfPurchaseInvoiceFullyOpen(Rec, FullyOpen, IsHandled);
- if IsHandled then
- exit(FullyOpen);
-
- CalcFields("Amount Including VAT", "Remaining Amount");
- exit("Amount Including VAT" = "Remaining Amount");
- end;
-
- procedure PrintRecords(ShowRequestPage: Boolean)
- var
- ReportSelection: Record "Report Selections";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforePrintRecords(Rec, ShowRequestPage, IsHandled);
- if not IsHandled then begin
- PurchInvHeader.Copy(Rec);
- if PurchInvHeader."Self-Billing Invoice" then
- ReportSelection.PrintWithDialogForVend(
- ReportSelection.Usage::"P.Self Billing Invoice", PurchInvHeader, ShowRequestPage, PurchInvHeader.FieldNo("Buy-from Vendor No."))
- else
- ReportSelection.PrintWithDialogForVend(
- ReportSelection.Usage::"P.Invoice", PurchInvHeader, ShowRequestPage, PurchInvHeader.FieldNo("Buy-from Vendor No."));
- end;
- end;
-
- procedure PrintToDocumentAttachment(var PurchInvHeaderLocal: Record "Purch. Inv. Header")
- begin
- if PurchInvHeaderLocal.FindSet() then
- repeat
- DoPrintToDocumentAttachment(PurchInvHeaderLocal);
- until PurchInvHeaderLocal.Next() = 0;
- end;
-
- local procedure DoPrintToDocumentAttachment(PurchInvHeaderLocal: Record "Purch. Inv. Header")
- var
- ReportSelections: Record "Report Selections";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeDoPrintToDocumentAttachment(PurchInvHeaderLocal, IsHandled);
- if IsHandled then
- exit;
-
- PurchInvHeaderLocal.SetRecFilter();
- if PurchInvHeaderLocal."Self-Billing Invoice" then
- ReportSelections.SaveAsDocumentAttachment(
- ReportSelections.Usage::"P.Self Billing Invoice".AsInteger(), PurchInvHeaderLocal, PurchInvHeaderLocal."No.", PurchInvHeaderLocal."Buy-from Vendor No.", true)
- else
- ReportSelections.SaveAsDocumentAttachment(
- ReportSelections.Usage::"P.Invoice".AsInteger(), PurchInvHeaderLocal, PurchInvHeaderLocal."No.", PurchInvHeaderLocal."Buy-from Vendor No.", true);
- end;
-
- procedure Navigate()
- var
- NavigatePage: Page Navigate;
- begin
- NavigatePage.SetDoc("Posting Date", "No.");
- NavigatePage.SetRec(Rec);
- NavigatePage.Run();
- end;
-
- procedure ShowDimensions()
- begin
- DimMgt.ShowDimensionSet("Dimension Set ID", StrSubstNo('%1 %2', TableCaption(), "No."));
- end;
-
- procedure SetSecurityFilterOnRespCenter()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetSecurityFilterOnRespCenter(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if UserSetupMgt.GetPurchasesFilter() <> '' then begin
- FilterGroup(2);
- SetRange("Responsibility Center", UserSetupMgt.GetPurchasesFilter());
- FilterGroup(0);
- end;
- end;
-
- procedure ShowCanceledOrCorrCrMemo()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeShowCanceledOrCorrCrMemo(Rec, IsHandled);
- if IsHandled then
- exit;
-
- CalcFields(Cancelled, Corrective);
- case true of
- Cancelled:
- Rec.ShowCorrectiveCreditMemo();
- Corrective:
- Rec.ShowCancelledCreditMemo();
- end;
- end;
-
- procedure ShowCorrectiveCreditMemo()
- var
- CancelledDocument: Record "Cancelled Document";
- PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.";
- begin
- CalcFields(Cancelled);
- if not Cancelled then
- exit;
-
- if CancelledDocument.FindPurchCancelledInvoice("No.") then begin
- PurchCrMemoHdr.Get(CancelledDocument."Cancelled By Doc. No.");
- PAGE.Run(PAGE::"Posted Purchase Credit Memo", PurchCrMemoHdr);
- end;
- end;
-
- procedure ShowCancelledCreditMemo()
- var
- CancelledDocument: Record "Cancelled Document";
- PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.";
- begin
- CalcFields(Corrective);
- if not Corrective then
- exit;
-
- if CancelledDocument.FindPurchCorrectiveInvoice("No.") then begin
- PurchCrMemoHdr.Get(CancelledDocument."Cancelled Doc. No.");
- PAGE.Run(PAGE::"Posted Purchase Credit Memo", PurchCrMemoHdr);
- end;
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePrintRecords(var PurchInvHeader: Record "Purch. Inv. Header"; ShowRequestPage: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowCanceledOrCorrCrMemo(var PurchInvHeader: Record "Purch. Inv. Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeDoPrintToDocumentAttachment(var PurchInvHeaderLocal: Record "Purch. Inv. Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnLookupAppliesToDocNoOnAfterSetFilters(var VendLedgEntry: Record "Vendor Ledger Entry"; PurchInvHeader: Record "Purch. Inv. Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetSecurityFilterOnRespCenter(var PurchInvHeader: Record "Purch. Inv. Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforCheckIfPurchaseInvoiceFullyOpen(var PurchInvHeader: Record "Purch. Inv. Header"; var FullyOpen: Boolean; var IsHandled: Boolean)
- begin
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Purchases/Payables/ApplyVendorEntries.Page.al b/src/Layers/NL/BaseApp/Purchases/Payables/ApplyVendorEntries.Page.al
deleted file mode 100644
index 481c2b6063..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/Payables/ApplyVendorEntries.Page.al
+++ /dev/null
@@ -1,1774 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.Payables;
-
-using Microsoft.CRM.Outlook;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.Foundation.Navigate;
-using Microsoft.Purchases.Document;
-using Microsoft.Purchases.Posting;
-using Microsoft.Purchases.Remittance;
-using Microsoft.Purchases.Setup;
-using Microsoft.Purchases.Vendor;
-
-page 233 "Apply Vendor Entries"
-{
- Caption = 'Apply Vendor Entries';
- DataCaptionFields = "Vendor No.";
- DeleteAllowed = false;
- InsertAllowed = false;
- LinksAllowed = false;
- PageType = Worksheet;
- SourceTable = "Vendor Ledger Entry";
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
-#pragma warning disable AA0100
- field("ApplyingVendLedgEntry.""Posting Date"""; TempApplyingVendLedgEntry."Posting Date")
-#pragma warning restore AA0100
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posting Date';
- Editable = false;
- ToolTip = 'Specifies the posting date of the entry to be applied. This date is used to find the correct exchange rate when applying entries in different currencies.';
- }
-#pragma warning disable AA0100
- field("ApplyingVendLedgEntry.""Document Type"""; TempApplyingVendLedgEntry."Document Type")
-#pragma warning restore AA0100
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Document Type';
- Editable = false;
- ToolTip = 'Specifies the document type of the entry to be applied.';
- }
-#pragma warning disable AA0100
- field("ApplyingVendLedgEntry.""Document No."""; TempApplyingVendLedgEntry."Document No.")
-#pragma warning restore AA0100
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Document No.';
- Editable = false;
- ToolTip = 'Specifies the document number of the entry to be applied.';
- }
- field(ApplyingVendorNo; TempApplyingVendLedgEntry."Vendor No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor No.';
- Editable = false;
- ToolTip = 'Specifies the vendor number of the entry to be applied.';
- Visible = false;
- }
- field(ApplyingVendorName; TempApplyingVendLedgEntry."Vendor Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor Name';
- Editable = false;
- ToolTip = 'Specifies the vendor name of the entry to be applied.';
- Visible = VendNameVisible;
- }
- field(ApplyingDescription; TempApplyingVendLedgEntry.Description)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Description';
- Editable = false;
- ToolTip = 'Specifies the description of the entry to be applied.';
- Visible = false;
- }
-#pragma warning disable AA0100
- field("ApplyingVendLedgEntry.""Currency Code"""; TempApplyingVendLedgEntry."Currency Code")
-#pragma warning restore AA0100
- {
- ApplicationArea = Suite;
- Caption = 'Currency Code';
- Editable = false;
- ToolTip = 'Specifies the code for the currency that amounts are shown in.';
- }
- field("ApplyingVendLedgEntry.Amount"; TempApplyingVendLedgEntry.Amount)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Amount';
- Editable = false;
- ToolTip = 'Specifies the amount on the entry to be applied.';
- }
-#pragma warning disable AA0100
- field("ApplyingVendLedgEntry.""Remaining Amount"""; TempApplyingVendLedgEntry."Remaining Amount")
-#pragma warning restore AA0100
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Remaining Amount';
- Editable = false;
- ToolTip = 'Specifies the amount on the entry to be applied.';
- }
- }
- repeater(Control1)
- {
- ShowCaption = false;
- field(AppliesToID; Rec."Applies-to ID")
- {
- ApplicationArea = All;
- Visible = AppliesToIDVisible;
-
- trigger OnValidate()
- begin
- if Rec."Applies-to ID" = xRec."Applies-to ID" then
- exit;
-
- if (CalcType = CalcType::"Gen. Jnl. Line") and (ApplnType = ApplnType::"Applies-to Doc. No.") then
- Error(CannotSetAppliesToIDErr);
-
- SetVendApplId(true);
- Rec.Get(Rec."Entry No.");
- if Rec."Applies-to ID" <> '' then
- UpdateCustomAppliesToIDForGenJournal(Rec."Applies-to ID");
-
- CurrPage.Update(false);
- end;
- }
- field("Posting Date"; Rec."Posting Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Document Type"; Rec."Document Type")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- StyleExpr = StyleTxt;
- }
- field("Document No."; Rec."Document No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- StyleExpr = StyleTxt;
- }
- field("External Document No."; Rec."External Document No.")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Vendor No."; Rec."Vendor No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Vendor Name"; Rec."Vendor Name")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = VendNameVisible;
- }
- field(Description; Rec.Description)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- }
- field("Original Amount"; Rec."Original Amount")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field(Amount; Rec.Amount)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Debit Amount"; Rec."Debit Amount")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Credit Amount"; Rec."Credit Amount")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Remaining Amount"; Rec."Remaining Amount")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
-#pragma warning disable AA0100
- field("CalcApplnRemainingAmount(""Remaining Amount"")"; CalcApplnRemainingAmount(Rec."Remaining Amount"))
-#pragma warning restore AA0100
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Appln. Remaining Amount';
- ToolTip = 'Specifies the amount that remains to be applied to before the entry is totally applied to.';
- }
- field("Amount to Apply"; Rec."Amount to Apply")
- {
- ApplicationArea = Basic, Suite;
-
- trigger OnValidate()
- begin
- CODEUNIT.Run(CODEUNIT::"Vend. Entry-Edit", Rec);
-
- if (xRec."Amount to Apply" = 0) or (Rec."Amount to Apply" = 0) and
- ((ApplnType = ApplnType::"Applies-to ID") or (CalcType = CalcType::Direct))
- then
- SetVendApplId(false);
- Rec.Get(Rec."Entry No.");
- AmountToApplyOnAfterValidate();
- end;
- }
- field(ApplnAmountToApply; CalcApplnAmountToApply(Rec."Amount to Apply"))
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Appln. Amount to Apply';
- ToolTip = 'Specifies the amount to apply.';
- }
- field("Due Date"; Rec."Due Date")
- {
- ApplicationArea = Basic, Suite;
- StyleExpr = StyleTxt;
- }
- field("Pmt. Discount Date"; Rec."Pmt. Discount Date")
- {
- ApplicationArea = Basic, Suite;
-
- trigger OnValidate()
- begin
- RecalcApplnAmount();
- end;
- }
- field("Pmt. Disc. Tolerance Date"; Rec."Pmt. Disc. Tolerance Date")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Payment Reference"; Rec."Payment Reference")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Original Pmt. Disc. Possible"; Rec."Original Pmt. Disc. Possible")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Remaining Pmt. Disc. Possible"; Rec."Remaining Pmt. Disc. Possible")
- {
- ApplicationArea = Basic, Suite;
-
- trigger OnValidate()
- begin
- RecalcApplnAmount();
- end;
- }
-#pragma warning disable AA0100
- field("CalcApplnRemainingAmount(""Remaining Pmt. Disc. Possible"")"; CalcApplnRemainingAmount(Rec."Remaining Pmt. Disc. Possible"))
-#pragma warning restore AA0100
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Appln. Pmt. Disc. Possible';
- ToolTip = 'Specifies the discount that you can obtain if the entry is applied to before the payment discount date.';
- }
- field("Max. Payment Tolerance"; Rec."Max. Payment Tolerance")
- {
- ApplicationArea = Basic, Suite;
- }
- field(Open; Rec.Open)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field(Positive; Rec.Positive)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Payments in Process"; Rec."Payments in Process")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the total amount of payments/collections in process.';
- }
- field("Remit-to Code"; Rec."Remit-to Code")
- {
- ApplicationArea = Basic, Suite;
- Visible = true;
- TableRelation = "Remit Address".Code where("Vendor No." = field("Vendor No."));
- }
- field("Global Dimension 1 Code"; Rec."Global Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
- }
- field("Global Dimension 2 Code"; Rec."Global Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
- }
- }
- group(Control41)
- {
- ShowCaption = false;
- fixed(Control1903222401)
- {
- ShowCaption = false;
- group("Appln. Currency")
- {
- Caption = 'Appln. Currency';
- field(ApplnCurrencyCode; ApplnCurrencyCode)
- {
- ApplicationArea = Suite;
- Editable = false;
- ShowCaption = false;
- TableRelation = Currency;
- ToolTip = 'Specifies the currency code that the amount will be applied in, in case of different currencies.';
- }
- }
- group(Control1900545201)
- {
- Caption = 'Amount to Apply';
- field(AmountToApply; AppliedAmount)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Amount to Apply';
- Editable = false;
- ToolTip = 'Specifies the sum of the amounts on all the selected vendor ledger entries that will be applied by the entry shown in the Available Amount field. The amount is in the currency represented by the code in the Currency Code field.';
- }
- }
- group("Pmt. Disc. Amount")
- {
- Caption = 'Pmt. Disc. Amount';
- field(PmtDiscountAmount; -PmtDiscAmount)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Pmt. Disc. Amount';
- Editable = false;
- ToolTip = 'Specifies the sum of the payment discount amounts granted on all the selected vendor ledger entries that will be applied by the entry shown in the Available Amount field. The amount is in the currency represented by the code in the Currency Code field.';
- }
- }
- group(Rounding)
- {
- Caption = 'Rounding';
- field(ApplnRounding; ApplnRounding)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Rounding';
- Editable = false;
- ToolTip = 'Specifies the rounding difference when you apply entries in different currencies to one another. The amount is in the currency represented by the code in the Currency Code field.';
- }
- }
- group("Applied Amount")
- {
- Caption = 'Applied Amount';
- field(AppliedAmount; AppliedAmount + (-PmtDiscAmount) + ApplnRounding)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Applied Amount';
- Editable = false;
- ToolTip = 'Specifies the sum of the amounts in the Amount to Apply field, Pmt. Disc. Amount field, and the Rounding. The amount is in the currency represented by the code in the Currency Code field.';
- }
- }
- group("Available Amount")
- {
- Caption = 'Available Amount';
- field(ApplyingAmount; ApplyingAmount)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Available Amount';
- Editable = false;
- ToolTip = 'Specifies the amount of the journal entry, purchase credit memo, or current vendor ledger entry that you have selected as the applying entry.';
- }
- }
- group(Balance)
- {
- Caption = 'Balance';
- field(ControlBalance; AppliedAmount + (-PmtDiscAmount) + ApplyingAmount + ApplnRounding)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Balance';
- Editable = false;
- ToolTip = 'Specifies any extra amount that will remain after the application.';
- }
- }
- }
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("Ent&ry")
- {
- Caption = 'Ent&ry';
- Image = Entry;
- action("Applied E&ntries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Applied E&ntries';
- Image = Approve;
- RunObject = Page "Applied Vendor Entries";
- RunPageOnRec = true;
- ToolTip = 'View the ledger entries that have been applied to this 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.ShowDimensions();
- end;
- }
- action("Detailed &Ledger Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Detailed &Ledger Entries';
- Image = View;
- RunObject = Page "Detailed Vendor Ledg. Entries";
- RunPageLink = "Vendor Ledger Entry No." = field("Entry No.");
- RunPageView = sorting("Vendor Ledger Entry No.", "Posting Date");
- ShortCutKey = 'Ctrl+F7';
- ToolTip = 'View a summary of the all posted entries and adjustments related to a specific vendor ledger entry.';
- }
- action(Navigate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Find entries...';
- Image = Navigate;
- ShortCutKey = 'Ctrl+Alt+Q';
- ToolTip = 'Find entries and documents that exist for the document number and posting date on the selected document. (Formerly this action was named Navigate.)';
- Visible = not IsOfficeAddin;
-
- trigger OnAction()
- begin
- Navigate.SetDoc(Rec."Posting Date", Rec."Document No.");
- Navigate.Run();
- end;
- }
- }
- }
- area(processing)
- {
- group("&Application")
- {
- Caption = '&Application';
- Image = Apply;
- action(ActionSetAppliesToID)
- {
- ApplicationArea = Basic, Suite;
- Visible = AppliesToIDVisible;
- Caption = 'Set Applies-to ID';
- Image = SelectLineToApply;
- ShortCutKey = 'Shift+F11';
- ToolTip = 'Set the Applies-to ID field on the posted entry to automatically be filled in with the document number of the entry in the journal.';
-
- trigger OnAction()
- begin
- if (CalcType = CalcType::"Gen. Jnl. Line") and (ApplnType = ApplnType::"Applies-to Doc. No.") then
- Error(CannotSetAppliesToIDErr);
-
- SetVendApplId(false);
- end;
- }
- action(ActionPostApplication)
- {
- ApplicationArea = Basic, Suite;
- Visible = CalledFromEntry;
- Caption = 'Post Application';
- Ellipsis = true;
- Image = PostApplication;
- ShortCutKey = 'F9';
- ToolTip = 'Define the document number of the ledger entry to use to perform the application. In addition, you specify the Posting Date for the application.';
-
- trigger OnAction()
- begin
- PostDirectApplication(false);
- end;
- }
- action(Preview)
- {
- ApplicationArea = Basic, Suite;
- Visible = CalledFromEntry;
- 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
- PostDirectApplication(true);
- end;
- }
- separator("-")
- {
- Caption = '-';
- }
- action("Show Only Selected Entries to Be Applied")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Show Only Selected Entries to Be Applied';
- Image = ShowSelected;
- ToolTip = 'View the selected ledger entries that will be applied to the specified record.';
-
- trigger OnAction()
- begin
- ShowAppliedEntries := not ShowAppliedEntries;
- if ShowAppliedEntries then
- if CalcType = CalcType::"Gen. Jnl. Line" then
- Rec.SetRange("Applies-to ID", GenJnlLine."Applies-to ID")
- else begin
- VendEntryApplID := CopyStr(UserId(), 1, MaxStrLen(VendEntryApplID));
- if VendEntryApplID = '' then
- VendEntryApplID := '***';
- Rec.SetRange("Applies-to ID", VendEntryApplID);
- end
- else
- Rec.SetRange("Applies-to ID");
- end;
- }
- }
- action(ShowPostedDocument)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Show Posted Document';
- Image = Document;
- ToolTip = 'Show details for the posted payment, invoice, or credit memo.';
-
- trigger OnAction()
- begin
- Rec.ShowDoc();
- end;
- }
- action(ShowDocumentAttachment)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Show Document Attachment';
- Enabled = HasDocumentAttachment;
- Image = Attach;
- ToolTip = 'View documents or images that are attached to the posted invoice or credit memo.';
-
- trigger OnAction()
- begin
- Rec.ShowPostedDocAttachment();
- end;
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- actionref(ActionSetAppliesToID_Promoted; ActionSetAppliesToID)
- {
- }
- actionref(ActionPostApplication_Promoted; ActionPostApplication)
- {
- }
- group(Category_Category4)
- {
- Caption = 'Line', Comment = 'Generated from the PromotedActionCategories property index 3.';
- ShowAs = SplitButton;
-
- actionref(ShowPostedDocument_Promoted; ShowPostedDocument)
- {
- }
- actionref(ShowDocumentAttachment_Promoted; ShowDocumentAttachment)
- {
- }
- }
- actionref(Preview_Promoted; Preview)
- {
- }
- actionref("Show Only Selected Entries to Be Applied_Promoted"; "Show Only Selected Entries to Be Applied")
- {
- }
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- group(Category_Category5)
- {
- Caption = 'Entry', Comment = 'Generated from the PromotedActionCategories property index 4.';
-
- actionref(Navigate_Promoted; Navigate)
- {
- }
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref("Applied E&ntries_Promoted"; "Applied E&ntries")
- {
- }
- actionref("Detailed &Ledger Entries_Promoted"; "Detailed &Ledger Entries")
- {
- }
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- begin
- if ApplnType = ApplnType::"Applies-to Doc. No." then
- CalcApplnAmount();
- HasDocumentAttachment := Rec.HasPostedDocAttachment();
- end;
-
- trigger OnAfterGetRecord()
- begin
- StyleTxt := Rec.SetStyle();
- end;
-
- trigger OnInit()
- begin
- AppliesToIDVisible := true;
- end;
-
- trigger OnModifyRecord(): Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnModifyRecordOnBeforeRunCodeunitVendEntryEdit(CalcType, AppliedVendLedgEntry, IsHandled);
- if not IsHandled then
- CODEUNIT.Run(CODEUNIT::"Vend. Entry-Edit", Rec);
- if Rec."Applies-to ID" <> xRec."Applies-to ID" then
- CalcApplnAmount();
- exit(false);
- end;
-
- local procedure JournalHasDocumentNo(AppliesToIDCode: Code[50]): Boolean
- var
- GenJournalLine: Record "Gen. Journal Line";
- begin
- GenJournalLine.SetRange("Journal Template Name", GenJnlLine."Journal Template Name");
- GenJournalLine.SetRange("Journal Batch Name", GenJnlLine."Journal Batch Name");
- GenJournalLine.SetRange("Document No.", CopyStr(AppliesToIDCode, 1, MaxStrLen(GenJournalLine."Document No.")));
- exit(not GenJournalLine.IsEmpty());
- end;
-
- trigger OnOpenPage()
- var
- OfficeMgt: Codeunit "Office Management";
- begin
- if CalcType = CalcType::Direct then begin
- Vend.Get(Rec."Vendor No.");
- ApplnCurrencyCode := Vend."Currency Code";
- FindApplyingEntry();
- end;
-
- ActivateFields();
- PurchSetup.Get();
- VendNameVisible := PurchSetup."Copy Vendor Name to Entries";
-
-
- GLSetup.Get();
-
- if CalcType = CalcType::"Gen. Jnl. Line" then
- CalcApplnAmount();
- PostingDone := false;
- IsOfficeAddin := OfficeMgt.IsAvailable();
-
- OnAfterOpenPage(Rec, TempApplyingVendLedgEntry);
- end;
-
- trigger OnQueryClosePage(CloseAction: Action): Boolean
- var
- RaiseError: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeOnQueryClosePage(CloseAction, TempApplyingVendLedgEntry, ApplnType, Rec, CalcType, IsHandled);
- if not IsHandled then begin
- if CloseAction = ACTION::LookupOK then
- LookupOKOnPush();
- if ApplnType = ApplnType::"Applies-to Doc. No." then begin
- if OK then begin
- RaiseError := TempApplyingVendLedgEntry."Posting Date" < Rec."Posting Date";
- OnBeforeEarlierPostingDateError(TempApplyingVendLedgEntry, Rec, RaiseError, CalcType.AsInteger(), PmtDiscAmount);
- if RaiseError then begin
- OK := false;
- Error(
- EarlierPostingDateErr, TempApplyingVendLedgEntry."Document Type", TempApplyingVendLedgEntry."Document No.",
- Rec."Document Type", Rec."Document No.");
- end;
-
- OnQueryClosePageOnAfterEarlierPostingDateTest(TempApplyingVendLedgEntry, Rec, CalcType, OK);
- end;
- if OK then begin
- if Rec."Amount to Apply" = 0 then
- Rec."Amount to Apply" := Rec."Remaining Amount";
- RunVendEntryEdit(Rec);
- end;
- end;
-
- if CheckActionPerformed() then begin
- Rec := TempApplyingVendLedgEntry;
- Rec."Applying Entry" := false;
- if AppliesToID = '' then begin
- Rec."Applies-to ID" := '';
- Rec."Amount to Apply" := 0;
- end;
-
- RunVendEntryEdit(Rec);
- end;
- end;
- end;
-
- var
- PurchHeader: Record "Purchase Header";
- Vend: Record Vendor;
- GLSetup: Record "General Ledger Setup";
- PurchSetup: Record "Purchases & Payables Setup";
- TotalPurchLine: Record "Purchase Line";
- TotalPurchLineLCY: Record "Purchase Line";
- VendEntrySetApplID: Codeunit "Vend. Entry-SetAppl.ID";
- GenJnlApply: Codeunit "Gen. Jnl.-Apply";
- PurchPost: Codeunit "Purch.-Post";
- PaymentToleranceMgt: Codeunit "Payment Tolerance Management";
- Navigate: Page Navigate;
- GenJnlLineApply: Boolean;
- StyleTxt: Text;
- CustomAppliesToID: Code[50];
- ValidExchRate: Boolean;
- MustSelectEntryErr: Label 'You must select an applying entry before you can post the application.';
- PostingInWrongContextErr: Label 'You must post the application from the window where you entered the applying entry.';
- CannotSetAppliesToIDErr: Label 'You cannot set Applies-to ID while selecting Applies-to Doc. No.';
- TimesSetCustomAppliesToID: Integer;
- CalledFromEntry: Boolean;
- ShowAppliedEntries: Boolean;
- OK: Boolean;
- EarlierPostingDateErr: Label 'You cannot apply and post an entry to an entry with an earlier posting date.\\Instead, post the document of type %1 with the number %2 and then apply it to the document of type %3 with the number %4.', Comment = '%1 - document type, %2 - document number,%3 - document type,%4 - document number';
- AppliesToIDVisible: Boolean;
- ApplicationPostedMsg: Label 'The application was successfully posted.';
-#pragma warning disable AA0470
- ApplicationDateErr: Label 'The %1 entered must not be before the %1 on the %2.';
-#pragma warning restore AA0470
- IsOfficeAddin: Boolean;
- HasDocumentAttachment: Boolean;
- VendNameVisible: Boolean;
-
- protected var
- Currency: Record Currency;
- CurrExchRate: Record "Currency Exchange Rate";
- TempApplyingVendLedgEntry: Record "Vendor Ledger Entry" temporary;
- AppliedVendLedgEntry: Record "Vendor Ledger Entry";
- GenJnlLine: Record "Gen. Journal Line";
- GenJnlLine2: Record "Gen. Journal Line";
- VendLedgEntry: Record "Vendor Ledger Entry";
- ApplnDate: Date;
- ApplnRoundingPrecision: Decimal;
- ApplnRounding: Decimal;
- ApplnType: Enum "Vendor Apply-to Type";
- AmountRoundingPrecision: Decimal;
- VATAmount: Decimal;
- VATAmountText: Text[30];
- AppliedAmount: Decimal;
- ApplyingAmount: Decimal;
- PmtDiscAmount: Decimal;
- VendEntryApplID: Code[50];
- ApplnCurrencyCode: Code[10];
- AppliesToID: Code[50];
- DifferentCurrenciesInAppln: Boolean;
- CalcType: Enum "Vendor Apply Calculation Type";
- PostingDone: Boolean;
-
- procedure SetGenJnlLine(NewGenJnlLine: Record "Gen. Journal Line"; ApplnTypeSelect: Integer)
- begin
- GenJnlLine := NewGenJnlLine;
- GenJnlLineApply := true;
-
- if GenJnlLine."Account Type" = GenJnlLine."Account Type"::Vendor then
- ApplyingAmount := GenJnlLine.Amount;
- if GenJnlLine."Bal. Account Type" = GenJnlLine."Bal. Account Type"::Vendor then
- ApplyingAmount := -GenJnlLine.Amount;
- ApplnDate := GenJnlLine."Posting Date";
- ApplnCurrencyCode := GenJnlLine."Currency Code";
- CalcType := CalcType::"Gen. Jnl. Line";
-
- case ApplnTypeSelect of
- GenJnlLine.FieldNo("Applies-to Doc. No."):
- ApplnType := ApplnType::"Applies-to Doc. No.";
- GenJnlLine.FieldNo("Applies-to ID"):
- ApplnType := ApplnType::"Applies-to ID";
- end;
-
- SetApplyingVendLedgEntry();
- end;
-
- internal procedure GetCustomAppliesToID(): Code[50]
- begin
- if TimesSetCustomAppliesToID <> 1 then
- exit('');
- exit(CustomAppliesToID);
- end;
-
- local procedure UpdateCustomAppliesToIDForGenJournal(NewAppliesToID: Code[50])
- begin
- if (not GenJnlLineApply) or (ApplnType <> ApplnType::"Applies-to ID") then
- exit;
- if JournalHasDocumentNo(NewAppliesToID) then
- exit;
- if (CustomAppliesToID = '') or ((CustomAppliesToID <> '') and (CustomAppliesToID <> NewAppliesToID)) then
- TimesSetCustomAppliesToID += 1;
-
- CustomAppliesToID := NewAppliesToID;
- end;
-
- local procedure RunVendEntryEdit(var VendorLedgerEntry: Record "Vendor Ledger Entry")
- begin
- OnBeforeRunVendEntryEdit(VendorLedgerEntry);
- CODEUNIT.Run(CODEUNIT::"Vend. Entry-Edit", VendorLedgerEntry);
- end;
-
- procedure SetPurch(NewPurchHeader: Record "Purchase Header"; var NewVendLedgEntry: Record "Vendor Ledger Entry"; ApplnTypeSelect: Integer)
- begin
- PurchHeader := NewPurchHeader;
- Rec.CopyFilters(NewVendLedgEntry);
-
- PurchPost.SumPurchLines(
- PurchHeader, 0, TotalPurchLine, TotalPurchLineLCY,
- VATAmount, VATAmountText);
-
- case PurchHeader."Document Type" of
- PurchHeader."Document Type"::"Return Order",
- PurchHeader."Document Type"::"Credit Memo":
- ApplyingAmount := TotalPurchLine."Amount Including VAT"
- else
- ApplyingAmount := -TotalPurchLine."Amount Including VAT";
- end;
-
- ApplnDate := PurchHeader."Posting Date";
- ApplnCurrencyCode := PurchHeader."Currency Code";
- CalcType := CalcType::"Purchase Header";
-
- case ApplnTypeSelect of
- PurchHeader.FieldNo("Applies-to Doc. No."):
- ApplnType := ApplnType::"Applies-to Doc. No.";
- PurchHeader.FieldNo("Applies-to ID"):
- ApplnType := ApplnType::"Applies-to ID";
- end;
-
- SetApplyingVendLedgEntry();
- end;
-
- procedure SetVendLedgEntry(NewVendLedgEntry: Record "Vendor Ledger Entry")
- begin
- Rec := NewVendLedgEntry;
- end;
-
- procedure SetApplyingVendLedgEntry()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetApplyingVendLedgEntry(TempApplyingVendLedgEntry, GenJnlLine, PurchHeader, CalcType, IsHandled);
- if not IsHandled then begin
- case CalcType of
- CalcType::"Purchase Header":
- SetApplyingVendLedgEntryPurchaseHeader();
- CalcType::"Gen. Jnl. Line":
- SetApplyingVendLedgEntryGenJnlLine();
- CalcType::Direct:
- SetApplyingVendLedgEntryDirect();
- end;
-
- CalcApplnAmount();
- end;
-
- OnAfterSetApplyingVendLedgEntry(TempApplyingVendLedgEntry, GenJnlLine, PurchHeader, CalcType);
- end;
-
- local procedure SetApplyingVendLedgEntryPurchaseHeader()
- begin
- TempApplyingVendLedgEntry."Posting Date" := PurchHeader."Posting Date";
- if PurchHeader."Document Type" = PurchHeader."Document Type"::"Return Order" then
- TempApplyingVendLedgEntry."Document Type" := TempApplyingVendLedgEntry."Document Type"::"Credit Memo"
- else
- TempApplyingVendLedgEntry."Document Type" := TempApplyingVendLedgEntry."Document Type"::Invoice;
- TempApplyingVendLedgEntry."Document No." := PurchHeader."No.";
- TempApplyingVendLedgEntry."Vendor No." := PurchHeader."Pay-to Vendor No.";
- TempApplyingVendLedgEntry.Description := PurchHeader."Posting Description";
- TempApplyingVendLedgEntry."Currency Code" := PurchHeader."Currency Code";
- if TempApplyingVendLedgEntry."Document Type" = TempApplyingVendLedgEntry."Document Type"::"Credit Memo" then begin
- TempApplyingVendLedgEntry.Amount := TotalPurchLine."Amount Including VAT";
- TempApplyingVendLedgEntry."Remaining Amount" := TotalPurchLine."Amount Including VAT";
- end else begin
- TempApplyingVendLedgEntry.Amount := -TotalPurchLine."Amount Including VAT";
- TempApplyingVendLedgEntry."Remaining Amount" := -TotalPurchLine."Amount Including VAT";
- end;
- TempApplyingVendLedgEntry."Remit-to Code" := PurchHeader."Remit-to Code";
-
- OnAfterSetApplyingVendLedgEntryPurchaseHeader(TempApplyingVendLedgEntry, PurchHeader);
- end;
-
- local procedure SetApplyingVendLedgEntryGenJnlLine()
- var
- Vendor: Record Vendor;
- begin
- TempApplyingVendLedgEntry."Posting Date" := GenJnlLine."Posting Date";
- TempApplyingVendLedgEntry."Document Type" := GenJnlLine."Document Type";
- TempApplyingVendLedgEntry."Document No." := GenJnlLine."Document No.";
- if GenJnlLine."Bal. Account Type" = GenJnlLine."Bal. Account Type"::Vendor then begin
- TempApplyingVendLedgEntry."Vendor No." := GenJnlLine."Bal. Account No.";
- Vendor.Get(TempApplyingVendLedgEntry."Vendor No.");
- TempApplyingVendLedgEntry.Description := Vendor.Name;
- end else begin
- TempApplyingVendLedgEntry."Vendor No." := GenJnlLine."Account No.";
- TempApplyingVendLedgEntry.Description := GenJnlLine.Description;
- end;
- TempApplyingVendLedgEntry."Currency Code" := GenJnlLine."Currency Code";
- TempApplyingVendLedgEntry.Amount := GenJnlLine.Amount;
- TempApplyingVendLedgEntry."Remaining Amount" := GenJnlLine.Amount;
- TempApplyingVendLedgEntry."Remit-to Code" := GenJnlLine."Remit-to Code";
-
- OnAfterSetApplyingVendLedgEntryGenJnlLine(TempApplyingVendLedgEntry, GenJnlLine);
- end;
-
- local procedure SetApplyingVendLedgEntryDirect()
- begin
- if Rec."Applying Entry" then begin
- if TempApplyingVendLedgEntry."Entry No." <> 0 then
- VendLedgEntry := TempApplyingVendLedgEntry;
- CODEUNIT.Run(CODEUNIT::"Vend. Entry-Edit", Rec);
- if Rec."Applies-to ID" = '' then
- SetVendApplId(false);
- Rec.CalcFields(Amount);
- TempApplyingVendLedgEntry := Rec;
- if VendLedgEntry."Entry No." <> 0 then begin
- Rec := VendLedgEntry;
- Rec."Applying Entry" := false;
- SetVendApplId(false);
- end;
- Rec.SetFilter("Entry No.", '<> %1', TempApplyingVendLedgEntry."Entry No.");
- ApplyingAmount := TempApplyingVendLedgEntry."Remaining Amount";
- ApplnDate := TempApplyingVendLedgEntry."Posting Date";
- ApplnCurrencyCode := TempApplyingVendLedgEntry."Currency Code";
- Rec."Remit-to Code" := TempApplyingVendLedgEntry."Remit-to Code";
- end;
- OnSetApplyingVendLedgEntryOnBeforeCalcTypeDirectCalcApplnAmount(ApplyingAmount, TempApplyingVendLedgEntry, Rec);
- end;
-
- procedure SetVendApplId(CurrentRec: Boolean)
- begin
- CurrPage.SetSelectionFilter(VendLedgEntry);
- CheckVendLedgEntry(VendLedgEntry);
- OnSetVendApplIdOnAfterCheckAgainstApplnCurrency(Rec, CalcType.AsInteger(), GenJnlLine, PurchHeader, TempApplyingVendLedgEntry);
-
- VendLedgEntry.Copy(Rec);
- if CurrentRec then
- VendLedgEntry.SetRecFilter()
- else
- CurrPage.SetSelectionFilter(VendLedgEntry);
-
- OnSetVendApplIdOnAfterSetFilter(Rec, CurrentRec, VendLedgEntry, TempApplyingVendLedgEntry);
-
- CallVendEntrySetApplIDSetApplId();
-
- CalcApplnAmount();
- end;
-
- local procedure CallVendEntrySetApplIDSetApplId()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCallVendEntrySetApplIDSetApplId(VendEntrySetApplID, VendLedgEntry, TempApplyingVendLedgEntry, IsHandled);
- if IsHandled then
- exit;
-
- if GenJnlLineApply then
- VendEntrySetApplID.SetApplId(VendLedgEntry, TempApplyingVendLedgEntry, GenJnlLine."Applies-to ID")
- else
- VendEntrySetApplID.SetApplId(VendLedgEntry, TempApplyingVendLedgEntry, PurchHeader."Applies-to ID");
- end;
-
- procedure CheckVendLedgEntry(var VendorLedgerEntry: Record "Vendor Ledger Entry")
- var
- RaiseError: Boolean;
- begin
- if VendorLedgerEntry.FindSet() then
- repeat
- if CalcType = CalcType::"Gen. Jnl. Line" then begin
- RaiseError := TempApplyingVendLedgEntry."Posting Date" < VendorLedgerEntry."Posting Date";
- OnBeforeEarlierPostingDateError(
- TempApplyingVendLedgEntry, VendorLedgerEntry, RaiseError, CalcType.AsInteger(), PmtDiscAmount);
- if RaiseError then
- Error(
- EarlierPostingDateErr, TempApplyingVendLedgEntry."Document Type", TempApplyingVendLedgEntry."Document No.",
- VendorLedgerEntry."Document Type", VendorLedgerEntry."Document No.");
-
- OnCheckVendLedgEntryOnAfterEarlierPostingDateTest(TempApplyingVendLedgEntry, VendorLedgerEntry, CalcType, OK);
- end;
-
- if TempApplyingVendLedgEntry."Entry No." <> 0 then begin
- OnCheckVendLedgEntryOnBeforeCheckAgainstApplnCurrency(GenJnlLine, VendorLedgerEntry);
- GenJnlApply.CheckAgainstApplnCurrency(
- ApplnCurrencyCode, VendorLedgerEntry."Currency Code", GenJnlLine."Account Type"::Vendor, true);
- end;
- until VendorLedgerEntry.Next() = 0;
- end;
-
- procedure CalcApplnAmount()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCalcApplnAmount(
- Rec, GenJnlLine, PurchHeader, AppliedVendLedgEntry, CalcType, ApplnType, IsHandled,
- ApplnDate, ApplnCurrencyCode, AmountRoundingPrecision, AppliedAmount,
- ApplnRoundingPrecision, PmtDiscAmount, DifferentCurrenciesInAppln, ApplnRounding, ApplyingAmount);
- if not IsHandled then begin
- AppliedAmount := 0;
- PmtDiscAmount := 0;
- DifferentCurrenciesInAppln := false;
-
- case CalcType of
- CalcType::Direct:
- begin
- FindAmountRounding();
- VendEntryApplID := CopyStr(UserId(), 1, MaxStrLen(VendEntryApplID));
- if VendEntryApplID = '' then
- VendEntryApplID := '***';
-
- VendLedgEntry := TempApplyingVendLedgEntry;
-
- AppliedVendLedgEntry.SetCurrentKey("Vendor No.", Open, Positive);
- AppliedVendLedgEntry.SetRange("Vendor No.", Rec."Vendor No.");
- AppliedVendLedgEntry.SetRange(Open, true);
- if AppliesToID = '' then
- AppliedVendLedgEntry.SetRange("Applies-to ID", VendEntryApplID)
- else
- AppliedVendLedgEntry.SetRange("Applies-to ID", AppliesToID);
-
- if TempApplyingVendLedgEntry."Entry No." <> 0 then begin
- VendLedgEntry.CalcFields("Remaining Amount");
- AppliedVendLedgEntry.SetFilter("Entry No.", '<>%1', VendLedgEntry."Entry No.");
-
- OnCalcApplnAmountOnAfterAppliedVendLedgEntrySetFilter(AppliedVendLedgEntry, VendLedgEntry, Rec);
- end;
-
- HandleChosenEntries(
- CalcType::Direct, VendLedgEntry."Remaining Amount", VendLedgEntry."Currency Code", VendLedgEntry."Posting Date");
- end;
- CalcType::"Gen. Jnl. Line":
- begin
- FindAmountRounding();
- if GenJnlLine."Bal. Account Type" = GenJnlLine."Bal. Account Type"::Vendor then
- CODEUNIT.Run(CODEUNIT::"Exchange Acc. G/L Journal Line", GenJnlLine);
-
- case ApplnType of
- ApplnType::"Applies-to Doc. No.":
- begin
- AppliedVendLedgEntry := Rec;
- AppliedVendLedgEntry.CalcFields("Remaining Amount");
- if AppliedVendLedgEntry."Currency Code" <> ApplnCurrencyCode then begin
- AppliedVendLedgEntry."Remaining Amount" :=
- CurrExchRate.ExchangeAmtFCYToFCY(
- ApplnDate, AppliedVendLedgEntry."Currency Code", ApplnCurrencyCode, AppliedVendLedgEntry."Remaining Amount");
- AppliedVendLedgEntry."Remaining Pmt. Disc. Possible" :=
- CurrExchRate.ExchangeAmtFCYToFCY(
- ApplnDate, AppliedVendLedgEntry."Currency Code", ApplnCurrencyCode, AppliedVendLedgEntry."Remaining Pmt. Disc. Possible");
- AppliedVendLedgEntry."Amount to Apply" :=
- CurrExchRate.ExchangeAmtFCYToFCY(
- ApplnDate, AppliedVendLedgEntry."Currency Code", ApplnCurrencyCode, AppliedVendLedgEntry."Amount to Apply");
- end;
-
- if AppliedVendLedgEntry."Amount to Apply" <> 0 then
- AppliedAmount := Round(AppliedVendLedgEntry."Amount to Apply", AmountRoundingPrecision)
- else
- AppliedAmount := Round(AppliedVendLedgEntry."Remaining Amount", AmountRoundingPrecision);
-
- if PaymentToleranceMgt.CheckCalcPmtDiscGenJnlVend(
- GenJnlLine, AppliedVendLedgEntry, 0, false) and
- ((Abs(GenJnlLine.Amount) + ApplnRoundingPrecision >=
- Abs(AppliedAmount - AppliedVendLedgEntry."Remaining Pmt. Disc. Possible")) or
- (GenJnlLine.Amount = 0))
- then
- PmtDiscAmount := AppliedVendLedgEntry."Remaining Pmt. Disc. Possible";
-
- if not DifferentCurrenciesInAppln then
- DifferentCurrenciesInAppln := ApplnCurrencyCode <> AppliedVendLedgEntry."Currency Code";
- CheckRounding();
- end;
- ApplnType::"Applies-to ID":
- begin
- GenJnlLine2 := GenJnlLine;
- AppliedVendLedgEntry.SetCurrentKey("Vendor No.", Open, Positive);
- AppliedVendLedgEntry.SetRange("Vendor No.", GenJnlLine."Account No.");
- AppliedVendLedgEntry.SetRange(Open, true);
- AppliedVendLedgEntry.SetRange("Applies-to ID", GenJnlLine."Applies-to ID");
-
- HandleChosenEntries(
- CalcType::"Gen. Jnl. Line", GenJnlLine2.Amount, GenJnlLine2."Currency Code", GenJnlLine2."Posting Date");
- end;
- end;
- end;
- CalcType::"Purchase Header":
- begin
- FindAmountRounding();
-
- case ApplnType of
- ApplnType::"Applies-to Doc. No.":
- begin
- AppliedVendLedgEntry := Rec;
- AppliedVendLedgEntry.CalcFields("Remaining Amount");
-
- if AppliedVendLedgEntry."Currency Code" <> ApplnCurrencyCode then
- AppliedVendLedgEntry."Remaining Amount" :=
- CurrExchRate.ExchangeAmtFCYToFCY(
- ApplnDate, AppliedVendLedgEntry."Currency Code", ApplnCurrencyCode, AppliedVendLedgEntry."Remaining Amount");
-
- AppliedAmount := AppliedAmount + Round(AppliedVendLedgEntry."Remaining Amount", AmountRoundingPrecision);
-
- if not DifferentCurrenciesInAppln then
- DifferentCurrenciesInAppln := ApplnCurrencyCode <> AppliedVendLedgEntry."Currency Code";
- CheckRounding();
- end;
- ApplnType::"Applies-to ID":
- begin
- AppliedVendLedgEntry.SetCurrentKey("Vendor No.", Open, Positive);
- AppliedVendLedgEntry.SetRange("Vendor No.", PurchHeader."Pay-to Vendor No.");
- AppliedVendLedgEntry.SetRange(Open, true);
- AppliedVendLedgEntry.SetRange("Applies-to ID", PurchHeader."Applies-to ID");
-
- HandleChosenEntries(CalcType::"Purchase Header", ApplyingAmount, ApplnCurrencyCode, ApplnDate);
- end;
- end;
- end;
- end;
- end;
-
- OnAfterCalcApplnAmount(Rec, AppliedAmount, ApplyingAmount, CalcType, AppliedVendLedgEntry, GenJnlLine);
- end;
-
- protected procedure CalcApplnRemainingAmount(Amount: Decimal): Decimal
- var
- ApplnRemainingAmount: Decimal;
- begin
- ValidExchRate := true;
- if ApplnCurrencyCode = Rec."Currency Code" then
- exit(Amount);
-
- if ApplnDate = 0D then
- ApplnDate := Rec."Posting Date";
- ApplnRemainingAmount :=
- CurrExchRate.ApplnExchangeAmtFCYToFCY(
- ApplnDate, Rec."Currency Code", ApplnCurrencyCode, Amount, ValidExchRate);
-
- OnAfterCalcApplnRemainingAmount(Rec, ApplnRemainingAmount);
- exit(ApplnRemainingAmount);
- end;
-
- local procedure CalcApplnAmountToApply(AmountToApply: Decimal): Decimal
- var
- ApplnAmountToApply: Decimal;
- begin
- ValidExchRate := true;
-
- if ApplnCurrencyCode = Rec."Currency Code" then
- exit(AmountToApply);
-
- if ApplnDate = 0D then
- ApplnDate := Rec."Posting Date";
- ApplnAmountToApply :=
- CurrExchRate.ApplnExchangeAmtFCYToFCY(
- ApplnDate, Rec."Currency Code", ApplnCurrencyCode, AmountToApply, ValidExchRate);
-
- OnAfterCalcApplnAmountToApply(Rec, AmountToApply, ApplnAmountToApply);
- exit(ApplnAmountToApply);
- end;
-
- protected procedure FindAmountRounding()
- begin
- if ApplnCurrencyCode = '' then begin
- Currency.Init();
- Currency.Code := '';
- Currency.InitRoundingPrecision();
- end else
- if ApplnCurrencyCode <> Currency.Code then
- Currency.Get(ApplnCurrencyCode);
-
- AmountRoundingPrecision := Currency."Amount Rounding Precision";
- end;
-
- procedure CheckRounding()
- begin
- ApplnRounding := 0;
-
- case CalcType of
- CalcType::"Purchase Header":
- exit;
- CalcType::"Gen. Jnl. Line":
- if (GenJnlLine."Document Type" <> GenJnlLine."Document Type"::Payment) and
- (GenJnlLine."Document Type" <> GenJnlLine."Document Type"::Refund)
- then
- exit;
- end;
-
- if ApplnCurrencyCode = '' then
- ApplnRoundingPrecision := GLSetup."Appln. Rounding Precision"
- else begin
- if ApplnCurrencyCode <> Rec."Currency Code" then
- Currency.Get(ApplnCurrencyCode);
- ApplnRoundingPrecision := Currency."Appln. Rounding Precision";
- end;
-
- if (Abs((AppliedAmount - PmtDiscAmount) + ApplyingAmount) <= ApplnRoundingPrecision) and DifferentCurrenciesInAppln then
- ApplnRounding := -((AppliedAmount - PmtDiscAmount) + ApplyingAmount);
- end;
-
- procedure GetVendLedgEntry(var VendLedgEntry: Record "Vendor Ledger Entry")
- begin
- VendLedgEntry := Rec;
- end;
-
- local procedure FindApplyingEntry()
- begin
- if CalcType = CalcType::Direct then begin
- VendEntryApplID := CopyStr(UserId(), 1, MaxStrLen(VendEntryApplID));
- if VendEntryApplID = '' then
- VendEntryApplID := '***';
-
- VendLedgEntry.SetCurrentKey("Vendor No.", "Applies-to ID", Open);
- VendLedgEntry.SetRange("Vendor No.", Rec."Vendor No.");
- if AppliesToID = '' then
- VendLedgEntry.SetRange("Applies-to ID", VendEntryApplID)
- else
- VendLedgEntry.SetRange("Applies-to ID", AppliesToID);
- VendLedgEntry.SetRange(Open, true);
- VendLedgEntry.SetRange("Applying Entry", true);
- OnFindApplyingEntryOnAfterSetFilters(Rec, VendLedgEntry);
- if VendLedgEntry.FindFirst() then begin
- VendLedgEntry.CalcFields(Amount, "Remaining Amount");
- OnFindApplyingEntryOnBeforeAssignTempApplyingVendLedgEntry(VendLedgEntry);
- TempApplyingVendLedgEntry := VendLedgEntry;
- Rec.SetFilter("Entry No.", '<>%1', VendLedgEntry."Entry No.");
- ApplyingAmount := VendLedgEntry."Remaining Amount";
- ApplnDate := VendLedgEntry."Posting Date";
- ApplnCurrencyCode := VendLedgEntry."Currency Code";
- end;
- OnFindApplyingEntryOnBeforeCalcApplnAmount(Rec);
- CalcApplnAmount();
- end;
- end;
-
- protected procedure HandleChosenEntries(Type: Enum "Vendor Apply Calculation Type"; CurrentAmount: Decimal; CurrencyCode: Code[10]; PostingDate: Date)
- var
- TempAppliedVendLedgEntry: Record "Vendor Ledger Entry" temporary;
- PossiblePmtDisc: Decimal;
- OldPmtDisc: Decimal;
- CorrectionAmount: Decimal;
- RemainingAmountExclDiscounts: Decimal;
- CanUseDisc: Boolean;
- FromZeroGenJnl: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeHandledChosenEntries(
- Type.AsInteger(), CurrentAmount, CurrencyCode, PostingDate, AppliedVendLedgEntry, IsHandled, VendLedgEntry,
- PmtDiscAmount, AppliedAmount, DifferentCurrenciesInAppln, ApplnCurrencyCode, GenJnlLine2);
- if IsHandled then
- exit;
-
- if not AppliedVendLedgEntry.FindSet(false) then
- exit;
-
- repeat
- TempAppliedVendLedgEntry := AppliedVendLedgEntry;
- TempAppliedVendLedgEntry.Insert();
- OnHandleChosenEntriesOnAfterTempAppliedVendLedgEntryInsert(TempAppliedVendLedgEntry);
- until AppliedVendLedgEntry.Next() = 0;
-
- FromZeroGenJnl := (CurrentAmount = 0) and (Type = Type::"Gen. Jnl. Line");
-
- repeat
- if not FromZeroGenJnl then
- TempAppliedVendLedgEntry.SetRange(Positive, CurrentAmount < 0);
- if TempAppliedVendLedgEntry.FindFirst() then begin
- ExchangeLedgerEntryAmounts(Type, CurrencyCode, TempAppliedVendLedgEntry, PostingDate);
-
- case Type of
- Type::Direct:
- CanUseDisc := PaymentToleranceMgt.CheckCalcPmtDiscVend(VendLedgEntry, TempAppliedVendLedgEntry, 0, false, false);
- Type::"Gen. Jnl. Line":
- CanUseDisc := PaymentToleranceMgt.CheckCalcPmtDiscGenJnlVend(GenJnlLine2, TempAppliedVendLedgEntry, 0, false)
- else
- CanUseDisc := false;
- end;
-
- if CanUseDisc and
- (Abs(TempAppliedVendLedgEntry."Amount to Apply") >=
- Abs(TempAppliedVendLedgEntry."Remaining Amount" - TempAppliedVendLedgEntry."Remaining Pmt. Disc. Possible"))
- then
- if Abs(CurrentAmount) >
- Abs(TempAppliedVendLedgEntry."Remaining Amount" - TempAppliedVendLedgEntry."Remaining Pmt. Disc. Possible")
- then begin
- PmtDiscAmount += TempAppliedVendLedgEntry."Remaining Pmt. Disc. Possible";
- CurrentAmount += TempAppliedVendLedgEntry."Remaining Amount" - TempAppliedVendLedgEntry."Remaining Pmt. Disc. Possible";
- end else
- if Abs(CurrentAmount) =
- Abs(TempAppliedVendLedgEntry."Remaining Amount" - TempAppliedVendLedgEntry."Remaining Pmt. Disc. Possible")
- then begin
- PmtDiscAmount += TempAppliedVendLedgEntry."Remaining Pmt. Disc. Possible";
- CurrentAmount +=
- TempAppliedVendLedgEntry."Remaining Amount" - TempAppliedVendLedgEntry."Remaining Pmt. Disc. Possible";
- AppliedAmount += CorrectionAmount;
- end else
- if FromZeroGenJnl then begin
- PmtDiscAmount += TempAppliedVendLedgEntry."Remaining Pmt. Disc. Possible";
- CurrentAmount +=
- TempAppliedVendLedgEntry."Remaining Amount" - TempAppliedVendLedgEntry."Remaining Pmt. Disc. Possible";
- end else begin
- PossiblePmtDisc := TempAppliedVendLedgEntry."Remaining Pmt. Disc. Possible";
- RemainingAmountExclDiscounts :=
- TempAppliedVendLedgEntry."Remaining Amount" - PossiblePmtDisc - TempAppliedVendLedgEntry."Max. Payment Tolerance";
- if Abs(CurrentAmount) + Abs(CalcOppositeEntriesAmount(TempAppliedVendLedgEntry)) >=
- Abs(RemainingAmountExclDiscounts)
- then begin
- PmtDiscAmount += PossiblePmtDisc;
- AppliedAmount += CorrectionAmount;
- end;
- CurrentAmount +=
- TempAppliedVendLedgEntry."Remaining Amount" - TempAppliedVendLedgEntry."Remaining Pmt. Disc. Possible";
- end
- else begin
- if ((CurrentAmount + TempAppliedVendLedgEntry."Amount to Apply") * CurrentAmount) >= 0 then
- AppliedAmount += CorrectionAmount;
- CurrentAmount += TempAppliedVendLedgEntry."Amount to Apply";
- end;
- end else begin
- TempAppliedVendLedgEntry.SetRange(Positive);
- TempAppliedVendLedgEntry.FindFirst();
- ExchangeLedgerEntryAmounts(Type, CurrencyCode, TempAppliedVendLedgEntry, PostingDate);
- end;
-
- if OldPmtDisc <> PmtDiscAmount then
- AppliedAmount += TempAppliedVendLedgEntry."Remaining Amount"
- else
- AppliedAmount += TempAppliedVendLedgEntry."Amount to Apply";
- OldPmtDisc := PmtDiscAmount;
-
- if PossiblePmtDisc <> 0 then
- CorrectionAmount := TempAppliedVendLedgEntry."Remaining Amount" - TempAppliedVendLedgEntry."Amount to Apply"
- else
- CorrectionAmount := 0;
-
- if not DifferentCurrenciesInAppln then
- DifferentCurrenciesInAppln := ApplnCurrencyCode <> TempAppliedVendLedgEntry."Currency Code";
-
- TempAppliedVendLedgEntry.Delete();
- TempAppliedVendLedgEntry.SetRange(Positive);
-
- until not TempAppliedVendLedgEntry.FindFirst();
- CheckRounding();
- end;
-
- local procedure AmountToApplyOnAfterValidate()
- begin
- if ApplnType <> ApplnType::"Applies-to Doc. No." then begin
- CalcApplnAmount();
- CurrPage.Update(false);
- end;
- end;
-
- local procedure RecalcApplnAmount()
- begin
- CurrPage.Update(true);
- CalcApplnAmount();
- end;
-
- local procedure LookupOKOnPush()
- begin
- OK := true;
- end;
-
- local procedure PostDirectApplication(PreviewMode: Boolean)
- var
- RecBeforeRunPostApplicationVendorLedgerEntry: Record "Vendor Ledger Entry";
- ApplyUnapplyParameters: Record "Apply Unapply Parameters";
- NewApplyUnapplyParameters: Record "Apply Unapply Parameters";
- VendEntryApplyPostedEntries: Codeunit "VendEntry-Apply Posted Entries";
- PostApplication: Page "Post Application";
- Applied: Boolean;
- ApplicationDate: Date;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforePostDirectApplication(Rec, PreviewMode, IsHandled, TempApplyingVendLedgEntry);
- if IsHandled then
- exit;
-
- if CalcType = CalcType::Direct then begin
- if TempApplyingVendLedgEntry."Entry No." <> 0 then begin
- Rec := TempApplyingVendLedgEntry;
- IsTheApplicationValid();
- ApplicationDate := VendEntryApplyPostedEntries.GetApplicationDate(Rec);
-
- OnPostDirectApplicationBeforeSetValues(ApplicationDate);
- Clear(ApplyUnapplyParameters);
- ApplyUnapplyParameters.CopyFromVendLedgEntry(Rec);
- GLSetup.GetRecordOnce();
- ApplyUnapplyParameters."Posting Date" := ApplicationDate;
- if GLSetup."Journal Templ. Name Mandatory" then begin
- GLSetup.TestField("Apply Jnl. Template Name");
- GLSetup.TestField("Apply Jnl. Batch Name");
- ApplyUnapplyParameters."Journal Template Name" := GLSetup."Apply Jnl. Template Name";
- ApplyUnapplyParameters."Journal Batch Name" := GLSetup."Apply Jnl. Batch Name";
- end;
- PostApplication.SetParameters(ApplyUnapplyParameters);
- RecBeforeRunPostApplicationVendorLedgerEntry := Rec;
- if ACTION::OK = PostApplication.RunModal() then begin
- if Rec."Entry No." <> RecBeforeRunPostApplicationVendorLedgerEntry."Entry No." then
- Rec := RecBeforeRunPostApplicationVendorLedgerEntry;
- PostApplication.GetParameters(NewApplyUnapplyParameters);
- IsHandled := false;
- OnPostDirectApplicationOnBeforeCheckApplicationDate(Rec, NewApplyUnapplyParameters, ApplicationDate, PreviewMode, IsHandled);
- if not IsHandled then
- if NewApplyUnapplyParameters."Posting Date" < ApplicationDate then
- Error(ApplicationDateErr, Rec.FieldCaption("Posting Date"), Rec.TableCaption());
- end else
- exit;
- OnPostDirectApplicationBeforeApply(GLSetup, NewApplyUnapplyParameters);
- if PreviewMode then
- VendEntryApplyPostedEntries.PreviewApply(Rec, NewApplyUnapplyParameters)
- else
- Applied := VendEntryApplyPostedEntries.Apply(Rec, NewApplyUnapplyParameters);
-
- OnPostDirectApplicationOnAfterApply(Rec, NewApplyUnapplyParameters, PreviewMode, Applied);
-
- if (not PreviewMode) and Applied then begin
- Message(ApplicationPostedMsg);
- PostingDone := true;
- CurrPage.Close();
- end;
- end else
- Error(MustSelectEntryErr);
- end else
- Error(PostingInWrongContextErr);
- end;
-
- local procedure CheckActionPerformed() Result: Boolean
- var
- IsHandled: Boolean;
- ActionPerformed: Boolean;
- begin
- ActionPerformed := false;
-
- IsHandled := false;
- OnBeforeCheckActionPerformed(
- ActionPerformed, OK, CalcType.AsInteger(), PostingDone, TempApplyingVendLedgEntry, ApplnType.AsInteger(), Result, IsHandled, AppliesToID);
- if IsHandled then
- exit(Result);
-
- if (not (CalcType = CalcType::Direct) and not OK and not PostingDone) or
- (ApplnType = ApplnType::"Applies-to Doc. No.")
- then
- exit(false);
- exit((CalcType = CalcType::Direct) and not OK and not PostingDone);
- end;
-
- procedure SetAppliesToID(AppliesToID2: Code[50])
- begin
- AppliesToID := AppliesToID2;
- end;
-
- protected procedure ExchangeLedgerEntryAmounts(Type: Enum "Vendor Apply Calculation Type"; CurrencyCode: Code[10]; var CalcVendLedgEntry: Record "Vendor Ledger Entry"; PostingDate: Date)
- var
- CalculateCurrency: Boolean;
- IsHandled: Boolean;
- begin
- CalcVendLedgEntry.CalcFields("Remaining Amount");
-
- if Type = Type::Direct then
- CalculateCurrency := TempApplyingVendLedgEntry."Entry No." <> 0
- else
- CalculateCurrency := true;
-
- OnExchangeLedgerEntryAmountsOnBeforeCalculateAmounts(CalcVendLedgEntry, VendLedgEntry, CurrencyCode, CalculateCurrency, IsHandled);
- if IsHandled then
- exit;
-
- if (CurrencyCode <> CalcVendLedgEntry."Currency Code") and CalculateCurrency then begin
- CalcVendLedgEntry."Remaining Amount" :=
- CurrExchRate.ExchangeAmount(
- CalcVendLedgEntry."Remaining Amount", CalcVendLedgEntry."Currency Code", CurrencyCode, PostingDate);
- CalcVendLedgEntry."Remaining Pmt. Disc. Possible" :=
- CurrExchRate.ExchangeAmount(
- CalcVendLedgEntry."Remaining Pmt. Disc. Possible", CalcVendLedgEntry."Currency Code", CurrencyCode, PostingDate);
- CalcVendLedgEntry."Amount to Apply" :=
- CurrExchRate.ExchangeAmount(
- CalcVendLedgEntry."Amount to Apply", CalcVendLedgEntry."Currency Code", CurrencyCode, PostingDate);
- end;
-
- OnAfterExchangeLedgerEntryAmounts(CalcVendLedgEntry, VendLedgEntry, CurrencyCode, PostingDate);
- end;
-
- local procedure IsTheApplicationValid()
- var
- ApplyToVendorLedgerEntry: Record "Vendor Ledger Entry";
- IsFirst, IsPositiv, ThereAreEntriesToApply : boolean;
- Counter: Integer;
- AllEntriesHaveTheSameSignErr: Label 'All entries have the same sign this will not lead to an application. Update the application by including entries with opposite sign.';
- begin
- IsFirst := true;
- ThereAreEntriesToApply := false;
- Counter := 0;
- ApplyToVendorLedgerEntry.SetCurrentKey("Vendor No.", "Applies-to ID");
- ApplyToVendorLedgerEntry.SetRange("Vendor No.", VendLedgEntry."Vendor No.");
- ApplyToVendorLedgerEntry.SetRange("Applies-to ID", VendLedgEntry."Applies-to ID");
- if ApplyToVendorLedgerEntry.FindSet() then
- repeat
- if not IsFirst then
- ThereAreEntriesToApply := (IsPositiv <> ApplyToVendorLedgerEntry.Positive)
- else
- IsPositiv := ApplyToVendorLedgerEntry.Positive;
- IsFirst := false;
- Counter += 1;
- until (ApplyToVendorLedgerEntry.next() = 0) or ThereAreEntriesToApply;
- if not ThereAreEntriesToApply and (Counter > 1) then
- error(AllEntriesHaveTheSameSignErr)
- end;
-
- local procedure ActivateFields()
- begin
- CalledFromEntry := CalcType = CalcType::Direct;
- AppliesToIDVisible := ApplnType <> ApplnType::"Applies-to Doc. No.";
- end;
-
-
- procedure CalcOppositeEntriesAmount(var TempAppliedVendorLedgerEntry: Record "Vendor Ledger Entry" temporary) Result: Decimal
- var
- SavedAppliedVendorLedgerEntry: Record "Vendor Ledger Entry";
- CurrPosFilter: Text;
- begin
- CurrPosFilter := TempAppliedVendorLedgerEntry.GetFilter(Positive);
- if CurrPosFilter <> '' then begin
- SavedAppliedVendorLedgerEntry := TempAppliedVendorLedgerEntry;
- TempAppliedVendorLedgerEntry.SetRange(Positive, not TempAppliedVendorLedgerEntry.Positive);
- if TempAppliedVendorLedgerEntry.FindSet() then
- repeat
- TempAppliedVendorLedgerEntry.CalcFields("Remaining Amount");
- Result += TempAppliedVendorLedgerEntry."Remaining Amount";
- until TempAppliedVendorLedgerEntry.Next() = 0;
- TempAppliedVendorLedgerEntry.SetFilter(Positive, CurrPosFilter);
- TempAppliedVendorLedgerEntry := SavedAppliedVendorLedgerEntry;
- end;
- end;
-
- procedure GetApplnCurrencyCode(): Code[10]
- begin
- exit(ApplnCurrencyCode);
- end;
-
- procedure GetCalcType(): Integer
- begin
- exit(CalcType.AsInteger());
- end;
-
- procedure SetCalcType(NewCalcType: Enum "Vendor Apply Calculation Type")
- begin
- CalcType := NewCalcType;
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnAfterCalcApplnAmount(VendorLedgerEntry: Record "Vendor Ledger Entry"; var AppliedAmount: Decimal; var ApplyingAmount: Decimal; CalcType: Enum "Vendor Apply Calculation Type"; var AppliedVendLedgEntry: Record "Vendor Ledger Entry"; var GenJournalLine: Record "Gen. Journal Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCalcApplnAmountToApply(VendorLedgerEntry: Record "Vendor Ledger Entry"; var ApplnAmountToApply: Decimal; var ApplnAmtToApply: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCalcApplnRemainingAmount(VendorLedgerEntry: Record "Vendor Ledger Entry"; var ApplnRemainingAmount: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterExchangeLedgerEntryAmounts(var CalcVendorLedgerEntry: Record "Vendor Ledger Entry"; VendorLedgerEntry: Record "Vendor Ledger Entry"; CurrencyCode: Code[10]; PostingDate: Date)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterOpenPage(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var ApplyingVendLedgEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnAfterSetApplyingVendLedgEntry(var TempApplyingVendorLedgerEntry: Record "Vendor Ledger Entry"; GenJournalLine: Record "Gen. Journal Line"; PurchaseHeader: Record "Purchase Header"; CalcType: Enum "Vendor Apply Calculation Type")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeCallVendEntrySetApplIDSetApplId(VendEntrySetApplID: Codeunit "Vend. Entry-SetAppl.ID"; var VendorLedgerEntry: Record "Vendor Ledger Entry"; var TempApplyingVendLedgEntry: Record "Vendor Ledger Entry"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCalcApplnAmount(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var GenJournalLine: Record "Gen. Journal Line"; PurchaseHeader: record "Purchase Header"; AppliedVendLedgEntry: Record "Vendor Ledger Entry"; CalcType: Enum "Vendor Apply Calculation Type"; ApplnType: Enum "Vendor Apply-to Type"; var IsHandled: Boolean; ApplnDate: Date; ApplnCurrencyCode: Code[10]; AmountRoundingPrecision: Decimal; var AppliedAmount: Decimal; ApplnRoundingPrecision: Decimal; var PmtDiscAmount: Decimal; var DifferentCurrenciesInAppln: Boolean; var ApplnRounding: Decimal; ApplyingAmount: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckActionPerformed(ActionPerformed: Boolean; OK: Boolean; CalcType: Option Direct,GenJnlLine,PurchHeader; PostingDone: Boolean; ApplyingVendLedgEntry: Record "Vendor Ledger Entry" temporary; ApplnType: Option " ","Applies-to Doc. No.","Applies-to ID"; var Result: Boolean; var IsHandled: Boolean; AppliesToID: Code[50])
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnFindApplyingEntryOnBeforeCalcApplnAmount(var VendorLedgerEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnFindApplyingEntryOnBeforeAssignTempApplyingVendLedgEntry(var VendorLedgerEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeHandledChosenEntries(Type: Option Direct,GenJnlLine,PurchHeader; CurrentAmount: Decimal; CurrencyCode: Code[10]; PostingDate: Date; var AppliedVendLedgEntry: Record "Vendor Ledger Entry"; var IsHandled: Boolean; var VendorLedgerEntry: Record "Vendor Ledger Entry"; var PmtDiscAmount: Decimal; var AppliedAmount: Decimal; var DifferentCurrenciesInAppln: Boolean; ApplnCurrencyCode: Code[10]; GenJournalLine2: Record "Gen. Journal Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeEarlierPostingDateError(ApplyingVendLedgEntry: Record "Vendor Ledger Entry"; VendorLedgerEntry: Record "Vendor Ledger Entry"; var RaiseError: Boolean; CalcType: Option; PmtDiscAmount: Decimal)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforePostDirectApplication(var VendorLedgerEntry: Record "Vendor Ledger Entry"; PreviewMode: Boolean; var IsHandled: Boolean; var TempApplyingVendLedgEntry: Record "Vendor Ledger Entry" temporary)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeSetApplyingVendLedgEntry(var ApplyingVendLedgEntry: Record "Vendor Ledger Entry"; GenJournalLine: Record "Gen. Journal Line"; PurchHeader: Record "Purchase Header"; var CalcType: enum "Vendor Apply Calculation Type"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeRunVendEntryEdit(var VendorLedgerEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnFindApplyingEntryOnAfterSetFilters(ApplyingVendLedgEntry: Record "Vendor Ledger Entry"; var VendorLedgerEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnHandleChosenEntriesOnAfterTempAppliedVendLedgEntryInsert(var TempAppliedVendorLedgerEntry: Record "Vendor Ledger Entry" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnPostDirectApplicationBeforeSetValues(var ApplicationDate: Date)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnPostDirectApplicationBeforeApply(GLSetup: Record "General Ledger Setup"; var NewApplyUnapplyParameters: Record "Apply Unapply Parameters")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnSetApplyingVendLedgEntryOnBeforeCalcTypeDirectCalcApplnAmount(var ApplyingAmount: Decimal; var ApplyingVendorLedgerEntry: Record "Vendor Ledger Entry"; var VendorLedgerEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSetVendApplIdOnAfterCheckAgainstApplnCurrency(var VendorLedgerEntry: Record "Vendor Ledger Entry"; CalcType: Option Direct,GenJnlLine,PurchHeader; GenJnlLine: Record "Gen. Journal Line"; PurchHeader: Record "Purchase Header"; ApplyingVendLedgEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetApplyingVendLedgEntryPurchaseHeader(var TempApplyingVendLedgEntry: Record "Vendor Ledger Entry" temporary; var PurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetApplyingVendLedgEntryGenJnlLine(var TempApplyingVendLedgEntry: Record "Vendor Ledger Entry" temporary; var GenJnlLine: Record "Gen. Journal Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckVendLedgEntryOnBeforeCheckAgainstApplnCurrency(var GenJournalLine: Record "Gen. Journal Line"; VendorLedgerEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckVendLedgEntryOnAfterEarlierPostingDateTest(ApplyingVendorLedgerEntry: Record "Vendor Ledger Entry"; VendorLedgerEntry: Record "Vendor Ledger Entry"; CalcType: Enum "Vendor Apply Calculation Type"; var OK: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnQueryClosePageOnAfterEarlierPostingDateTest(ApplyingVendorLedgerEntry: Record "Vendor Ledger Entry"; VendorLedgerEntry: Record "Vendor Ledger Entry"; CalcType: Enum "Vendor Apply Calculation Type"; var OK: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCalcApplnAmountOnAfterAppliedVendLedgEntrySetFilter(var AppliedVendorLedgerEntry: Record "Vendor Ledger Entry"; VendorLedgerEntry: Record "Vendor Ledger Entry"; var RecVendorLedgerEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSetVendApplIdOnAfterSetFilter(var RecVendorLedgerEntry: Record "Vendor Ledger Entry"; CurrentRec: Boolean; var VendorLedgerEntry: Record "Vendor Ledger Entry"; var TempApplyingVendorLedgerEntry: Record "Vendor Ledger Entry" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnModifyRecordOnBeforeRunCodeunitVendEntryEdit(VendorApplyCalculationType: Enum "Vendor Apply Calculation Type"; var VendorLedgerEntry: Record "Vendor Ledger Entry"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOnQueryClosePage(CloseAction: Action; ApplyingVendorLedgerEntry: Record "Vendor Ledger Entry"; ApplnType: Enum "Vendor Apply-to Type"; VendorLedgerEntry: Record "Vendor Ledger Entry"; CalcType: Enum "Vendor Apply Calculation Type"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnPostDirectApplicationOnBeforeCheckApplicationDate(VendorLedgerEntry: Record "Vendor Ledger Entry"; NewApplyUnapplyParameters: Record "Apply Unapply Parameters"; ApplicationDate: Date; PreviewMode: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnExchangeLedgerEntryAmountsOnBeforeCalculateAmounts(var CalcVendLedgEntry: Record "Vendor Ledger Entry"; VendLedgEntry: Record "Vendor Ledger Entry"; CurrencyCode: Code[10]; CalculateCurrency: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnPostDirectApplicationOnAfterApply(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var NewApplyUnapplyParameters: Record "Apply Unapply Parameters"; PreviewMode: Boolean; Applied: Boolean)
- begin
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Purchases/Payables/VendEntryEdit.Codeunit.al b/src/Layers/NL/BaseApp/Purchases/Payables/VendEntryEdit.Codeunit.al
deleted file mode 100644
index 04d1154725..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/Payables/VendEntryEdit.Codeunit.al
+++ /dev/null
@@ -1,126 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.Payables;
-
-using Microsoft.Sales.Receivables;
-
-codeunit 113 "Vend. Entry-Edit"
-{
- Permissions = TableData "Vendor Ledger Entry" = m,
- TableData "Detailed Vendor Ledg. Entry" = m;
- TableNo = "Vendor Ledger Entry";
-
- trigger OnRun()
- var
- LedgEntryTrackChanges: Codeunit "Ledg. Entry-Track Changes";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeOnRun(Rec, VendLedgEntry, DtldVendLedgEntry, IsHandled);
- if IsHandled then
- exit;
-
- VendLedgEntry := Rec;
- VendLedgEntry.LockTable();
- VendLedgEntry.Find();
- VendLedgEntry."On Hold" := Rec."On Hold";
-
- if LogFieldChanged(VendLedgEntry, Rec) then
- BindSubscription(LedgEntryTrackChanges);
-
- VendLedgEntry."On Hold" := Rec."On Hold";
- if VendLedgEntry.Open then begin
- VendLedgEntry."Due Date" := Rec."Due Date";
- DtldVendLedgEntry.SetCurrentKey("Vendor Ledger Entry No.");
- DtldVendLedgEntry.SetRange("Vendor Ledger Entry No.", VendLedgEntry."Entry No.");
- OnRunOnBeforeDtldVendLedgEntryModifyAll(Rec, DtldVendLedgEntry, VendLedgEntry);
- DtldVendLedgEntry.ModifyAll("Initial Entry Due Date", Rec."Due Date");
- VendLedgEntry."Pmt. Discount Date" := Rec."Pmt. Discount Date";
- VendLedgEntry."Applies-to ID" := Rec."Applies-to ID";
- VendLedgEntry.Validate("Payment Method Code", Rec."Payment Method Code");
- VendLedgEntry.Validate("Payment Reference", Rec."Payment Reference");
- VendLedgEntry.Validate("Remaining Pmt. Disc. Possible", Rec."Remaining Pmt. Disc. Possible");
- VendLedgEntry."Transaction Mode Code" := Rec."Transaction Mode Code";
- VendLedgEntry."Recipient Bank Account" := Rec."Recipient Bank Account";
- VendLedgEntry."Pmt. Disc. Tolerance Date" := Rec."Pmt. Disc. Tolerance Date";
- VendLedgEntry.Validate("Max. Payment Tolerance", Rec."Max. Payment Tolerance");
- VendLedgEntry.Validate("Accepted Payment Tolerance", Rec."Accepted Payment Tolerance");
- VendLedgEntry.Validate("Accepted Pmt. Disc. Tolerance", Rec."Accepted Pmt. Disc. Tolerance");
- VendLedgEntry.Validate("Amount to Apply", Rec."Amount to Apply");
- VendLedgEntry.Validate("Applying Entry", Rec."Applying Entry");
- VendLedgEntry.Validate("Applies-to Ext. Doc. No.", Rec."Applies-to Ext. Doc. No.");
- VendLedgEntry.Validate("Message to Recipient", Rec."Message to Recipient");
- VendLedgEntry.Validate("Recipient Bank Account", Rec."Recipient Bank Account");
- VendLedgEntry.Validate("Remit-to Code", Rec."Remit-to Code");
- end;
- VendLedgEntry.Description := Rec.Description;
- VendLedgEntry.Validate("Exported to Payment File", Rec."Exported to Payment File");
- VendLedgEntry.Validate("Creditor No.", Rec."Creditor No.");
- VendLedgEntry.Validate("Dispute Status", Rec."Dispute Status");
- OnBeforeVendLedgEntryModify(VendLedgEntry, Rec);
- VendLedgEntry.TestField("Entry No.", Rec."Entry No.");
- VendLedgEntry.Modify();
- OnRunOnAfterVendLedgEntryMofidy(VendLedgEntry);
- Rec := VendLedgEntry;
- end;
-
- var
- VendLedgEntry: Record "Vendor Ledger Entry";
- DtldVendLedgEntry: Record "Detailed Vendor Ledg. Entry";
-
- procedure SetOnHold(var VendorLedgerEntry: Record "Vendor Ledger Entry"; NewOnHold: Code[3])
- var
- LedgEntryTrackChanges: Codeunit "Ledg. Entry-Track Changes";
- xOnHold: Code[3];
- begin
- BindSubscription(LedgEntryTrackChanges);
-
- xOnHold := VendorLedgerEntry."On Hold";
- VendorLedgerEntry."On Hold" := NewOnHold;
- if xOnHold <> VendorLedgerEntry."On Hold" then
- VendorLedgerEntry.Modify();
- end;
-
- local procedure LogFieldChanged(CurrVendorLedgerEntry: Record "Vendor Ledger Entry"; NewVendorLedgerEntry: Record "Vendor Ledger Entry"): Boolean
- var
- Changed: Boolean;
- begin
- Changed :=
- (CurrVendorLedgerEntry.Description <> NewVendorLedgerEntry.Description) or
- (CurrVendorLedgerEntry."Due Date" <> NewVendorLedgerEntry."Due Date") or
- (CurrVendorLedgerEntry."Payment Method Code" <> NewVendorLedgerEntry."Payment Method Code") or
- (CurrVendorLedgerEntry."Message to Recipient" <> NewVendorLedgerEntry."Message to Recipient") or
- (CurrVendorLedgerEntry."Recipient Bank Account" <> NewVendorLedgerEntry."Recipient Bank Account") or
- (CurrVendorLedgerEntry."On Hold" <> NewVendorLedgerEntry."On Hold");
- OnAfterLogFieldChanged(CurrVendorLedgerEntry, NewVendorLedgerEntry, Changed);
- exit(Changed);
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeVendLedgEntryModify(var VendLedgEntry: Record "Vendor Ledger Entry"; FromVendLedgEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOnRun(var VendorLedgerEntryRec: Record "Vendor Ledger Entry"; var VendorLedgerEntry: Record "Vendor Ledger Entry"; var DetailedVendLedgerEntry: Record "Detailed Vendor Ledg. Entry"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRunOnBeforeDtldVendLedgEntryModifyAll(FromVendLedgEntry: Record "Vendor Ledger Entry"; var DtldVendLedgEntry: Record "Detailed Vendor Ledg. Entry"; var VendLedgEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRunOnAfterVendLedgEntryMofidy(var VendorLedgerEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterLogFieldChanged(CurrVendorLedgerEntry: Record "Vendor Ledger Entry"; NewVendorLedgerEntry: Record "Vendor Ledger Entry"; var Changed: Boolean)
- begin
- end;
-}
-
diff --git a/src/Layers/NL/BaseApp/Purchases/Payables/VendorLedgerEntries.Page.al b/src/Layers/NL/BaseApp/Purchases/Payables/VendorLedgerEntries.Page.al
deleted file mode 100644
index fdf8670d75..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/Payables/VendorLedgerEntries.Page.al
+++ /dev/null
@@ -1,851 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.Payables;
-
-using Microsoft.Bank.Reconciliation;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Ledger;
-using Microsoft.Finance.GeneralLedger.Reversal;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Foundation.Navigate;
-using Microsoft.Purchases.Remittance;
-using Microsoft.Purchases.Setup;
-using System.Diagnostics;
-using System.Security.User;
-using System.Utilities;
-
-page 29 "Vendor Ledger Entries"
-{
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor Ledger Entries';
- DataCaptionFields = "Vendor No.";
- DeleteAllowed = false;
- InsertAllowed = false;
- PageType = List;
- AboutTitle = 'About Vendor Ledger Entries';
- AboutText = 'Track all financial transactions with vendors, including invoices, payments, credit memos, and refunds, to monitor outstanding balances, payment status, and detailed entry information for each vendor account.';
- Permissions = TableData "Vendor Ledger Entry" = m;
- SourceTable = "Vendor Ledger Entry";
- SourceTableView = sorting("Vendor No.", "Posting Date") order(descending);
- UsageCategory = History;
- AdditionalSearchTerms = 'Vendor Check, Pay Vendor, Vendor Bills';
-
- layout
- {
- area(content)
- {
- repeater(Control1)
- {
- ShowCaption = false;
- field("Posting Date"; Rec."Posting Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Document Date"; Rec."Document Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Invoice Received Date"; Rec."Invoice Received Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Document Type"; Rec."Document Type")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- StyleExpr = StyleTxt;
- }
- field("Document No."; Rec."Document No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- StyleExpr = StyleTxt;
- }
- field("External Document No."; Rec."External Document No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Vendor No."; Rec."Vendor No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Vendor Name"; Rec."Vendor Name")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = VendNameVisible;
- }
- field("Message to Recipient"; Rec."Message to Recipient")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field(Description; Rec.Description)
- {
- ApplicationArea = Basic, Suite;
- Editable = true;
- }
- field("Global Dimension 1 Code"; Rec."Global Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim1Visible;
- }
- field("Global Dimension 2 Code"; Rec."Global Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim2Visible;
- }
- field("Vendor Posting Group"; Rec."Vendor Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ToolTip = 'Specifies the vendor''s market type to link business transactions made for the vendor with the appropriate account in the general ledger.';
- Visible = false;
- }
- field("IC Partner Code"; Rec."IC Partner Code")
- {
- ApplicationArea = Intercompany;
- Editable = false;
- Visible = false;
- }
- field("Purchaser Code"; Rec."Purchaser Code")
- {
- ApplicationArea = Suite;
- Editable = false;
- Visible = false;
- }
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- Editable = false;
- }
- field("Payment Method Code"; Rec."Payment Method Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Payment Reference"; Rec."Payment Reference")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Creditor No."; Rec."Creditor No.")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Original Amount"; Rec."Original Amount")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Original Amt. (LCY)"; Rec."Original Amt. (LCY)")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ToolTip = 'Specifies the amount that the entry originally consisted of, in LCY.';
- Visible = false;
- }
- field(Amount; Rec.Amount)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = AmountVisible;
- }
- field("Amount (LCY)"; Rec."Amount (LCY)")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ToolTip = 'Specifies the amount of the entry in LCY.';
- Visible = AmountVisible;
- }
- field("Debit Amount"; Rec."Debit Amount")
- {
- ApplicationArea = Basic, Suite;
- Visible = DebitCreditVisible;
- }
- field("Debit Amount (LCY)"; Rec."Debit Amount (LCY)")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the total of the ledger entries that represent debits, expressed in LCY.';
- Visible = DebitCreditVisible;
- }
- field("Credit Amount"; Rec."Credit Amount")
- {
- ApplicationArea = Basic, Suite;
- Visible = DebitCreditVisible;
- }
- field("Credit Amount (LCY)"; Rec."Credit Amount (LCY)")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the total of the ledger entries that represent credits, expressed in LCY.';
- Visible = DebitCreditVisible;
- }
- field(RunningBalanceLCY; CalcRunningVendBalance.GetVendorBalanceLCY(Rec))
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Running Balance (LCY)';
- ToolTip = 'Specifies the running balance in LCY.';
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Visible = false;
- }
- field("Remaining Amount"; Rec."Remaining Amount")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Remaining Amt. (LCY)"; Rec."Remaining Amt. (LCY)")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ToolTip = 'Specifies the amount that remains to be applied to before the entry is totally applied to.';
- }
- field("Payments in Process"; Rec."Payments in Process")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the total amount of payments/collections in process.';
- }
- field("Bal. Account Type"; Rec."Bal. Account Type")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Bal. Account No."; Rec."Bal. Account No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Due Date"; Rec."Due Date")
- {
- ApplicationArea = Basic, Suite;
- StyleExpr = StyleTxt;
- }
- field("Pmt. Discount Date"; Rec."Pmt. Discount Date")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Pmt. Disc. Tolerance Date"; Rec."Pmt. Disc. Tolerance Date")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Original Pmt. Disc. Possible"; Rec."Original Pmt. Disc. Possible")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Remaining Pmt. Disc. Possible"; Rec."Remaining Pmt. Disc. Possible")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Max. Payment Tolerance"; Rec."Max. Payment Tolerance")
- {
- ApplicationArea = Basic, Suite;
- }
- field(Open; Rec.Open)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Dispute Status"; Rec."Dispute Status")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("On Hold"; Rec."On Hold")
- {
- ApplicationArea = Basic, Suite;
- }
- field("User ID"; Rec."User ID")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
-
- trigger OnDrillDown()
- var
- UserMgt: Codeunit "User Management";
- begin
- UserMgt.DisplayUserInformation(Rec."User ID");
- end;
- }
- field("Source Code"; Rec."Source Code")
- {
- ApplicationArea = Suite;
- Editable = false;
- Visible = false;
- }
- field("Reason Code"; Rec."Reason Code")
- {
- ApplicationArea = Suite;
- Editable = false;
- Visible = false;
- }
- field(Reversed; Rec.Reversed)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Reversed by Entry No."; Rec."Reversed by Entry No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Reversed Entry No."; Rec."Reversed Entry No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Entry No."; Rec."Entry No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("G/L Register No."; Rec."G/L Register No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Transaction No."; Rec."Transaction No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies in what way a ledger entry can be paid, or collected through telebanking.';
- }
- field("Recipient Bank Account"; Rec."Recipient Bank Account")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the bank account that the amount will be transferred to after it has been exported from the payment journal.';
- }
- field("Exported to Payment File"; Rec."Exported to Payment File")
- {
- ApplicationArea = Basic, Suite;
- Editable = true;
-
- trigger OnValidate()
- var
- ConfirmManagement: Codeunit "Confirm Management";
- begin
- if not ConfirmManagement.GetResponseOrDefault(ExportToPaymentFileConfirmTxt, true) then
- Error('');
- end;
- }
- field("Dimension Set ID"; Rec."Dimension Set ID")
- {
- ApplicationArea = Dimensions;
- Visible = false;
- }
- field(RecipientBankAcc; Rec."Recipient Bank Account")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Shortcut Dimension 3 Code"; Rec."Shortcut Dimension 3 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim3Visible;
- }
- field("Shortcut Dimension 4 Code"; Rec."Shortcut Dimension 4 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim4Visible;
- }
- field("Shortcut Dimension 5 Code"; Rec."Shortcut Dimension 5 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim5Visible;
- }
- field("Shortcut Dimension 6 Code"; Rec."Shortcut Dimension 6 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim6Visible;
- }
- field("Shortcut Dimension 7 Code"; Rec."Shortcut Dimension 7 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim7Visible;
- }
- field("Shortcut Dimension 8 Code"; Rec."Shortcut Dimension 8 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim8Visible;
- }
- field("Closed at Date"; Rec."Closed at Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Remit-to Code"; Rec."Remit-to Code")
- {
- ApplicationArea = Basic, Suite;
- Visible = true;
- TableRelation = "Remit Address".Code where("Vendor No." = field("Vendor No."));
- }
- }
- }
- area(factboxes)
- {
- part(IncomingDocAttachFactBox; "Incoming Doc. Attach. FactBox")
- {
- ApplicationArea = Basic, Suite;
- ShowFilter = false;
- }
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- Visible = false;
- }
- part(GLEntriesPart; "G/L Entries Part")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Related G/L Entries';
- ShowFilter = false;
- SubPageLink = "Posting Date" = field("Posting Date"), "Document No." = field("Document No.");
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("Ent&ry")
- {
- Caption = 'Ent&ry';
- Image = Entry;
- action(AppliedEntries)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Applied E&ntries';
- Image = Approve;
- RunObject = Page "Applied Vendor Entries";
- RunPageOnRec = true;
- Scope = Repeater;
- ToolTip = 'View the ledger entries that have been applied to this record.';
- }
- action(Dimensions)
- {
- AccessByPermission = TableData Dimension = R;
- ApplicationArea = Dimensions;
- Caption = 'Dimensions';
- Image = Dimensions;
- Scope = Repeater;
- ShortCutKey = 'Alt+D';
- ToolTip = 'View or edit dimensions, such as area, project, or department, that you can assign to sales and purchase documents to distribute costs and analyze transaction history.';
-
- trigger OnAction()
- begin
- Rec.ShowDimensions();
- end;
- }
- action(SetDimensionFilter)
- {
- ApplicationArea = Dimensions;
- Caption = 'Set Dimension Filter';
- Ellipsis = true;
- Image = "Filter";
- ToolTip = 'Limit the entries according to the dimension filters that you specify. NOTE: If you use a high number of dimension combinations, this function may not work and can result in a message that the SQL server only supports a maximum of 2100 parameters.';
-
- trigger OnAction()
- begin
- Rec.SetFilter("Dimension Set ID", DimensionSetIDFilter.LookupFilter());
- end;
- }
- action("Detailed &Ledger Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Detailed &Ledger Entries';
- Image = View;
- RunObject = Page "Detailed Vendor Ledg. Entries";
- RunPageLink = "Vendor Ledger Entry No." = field("Entry No."),
- "Vendor No." = field("Vendor No.");
- RunPageView = sorting("Vendor Ledger Entry No.", "Posting Date");
- Scope = Repeater;
- ShortCutKey = 'Ctrl+F7';
- ToolTip = 'View a summary of the all posted entries and adjustments related to a specific vendor ledger entry';
- }
- }
- }
- area(processing)
- {
- group("F&unctions")
- {
- Caption = 'F&unctions';
- Image = "Action";
- action(ActionApplyEntries)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Apply Entries';
- Image = ApplyEntries;
- Scope = Repeater;
- ShortCutKey = 'Shift+F11';
- ToolTip = 'Select one or more ledger entries that you want to apply this record to so that the related posted documents are closed as paid or refunded.';
-
- trigger OnAction()
- var
- VendLedgEntry: Record "Vendor Ledger Entry";
- VendEntryApplyPostEntries: Codeunit "VendEntry-Apply Posted Entries";
- begin
- VendLedgEntry.Copy(Rec);
- VendEntryApplyPostEntries.ApplyVendEntryFormEntry(VendLedgEntry);
- VendLedgEntry.Get(VendLedgEntry."Entry No.");
- Rec := VendLedgEntry;
- CurrPage.Update();
- end;
- }
- action(UnapplyEntries)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Unapply Entries';
- Ellipsis = true;
- Image = UnApply;
- Scope = Repeater;
- ToolTip = 'Unselect one or more ledger entries that you want to unapply this record.';
-
- trigger OnAction()
- var
- VendEntryApplyPostedEntries: Codeunit "VendEntry-Apply Posted Entries";
- begin
- VendEntryApplyPostedEntries.UnApplyVendLedgEntry(Rec."Entry No.");
- end;
- }
- action(ReverseTransaction)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Reverse Transaction';
- Ellipsis = true;
- Image = ReverseRegister;
- Scope = Repeater;
- ToolTip = 'Reverse an erroneous vendor ledger entry.';
-
- trigger OnAction()
- var
- ReversalEntry: Record "Reversal Entry";
- ReversePaymentRec: Codeunit "Reverse Payment Rec. Journal";
- begin
- ReversePaymentRec.ErrorIfEntryIsNotReversable(Rec);
- ReversalEntry.ReverseTransaction(Rec."Transaction No.");
- Clear(CalcRunningVendBalance);
- end;
- }
- group(IncomingDocument)
- {
- Caption = 'Incoming Document';
- Image = Documents;
- action(IncomingDocCard)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'View Incoming Document';
- Enabled = HasIncomingDocument;
- Image = ViewOrder;
- ToolTip = 'View any incoming document records and file attachments that exist for the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.ShowCard(Rec."Document No.", Rec."Posting Date");
- end;
- }
- action(SelectIncomingDoc)
- {
- AccessByPermission = TableData "Incoming Document" = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Select Incoming Document';
- Enabled = not HasIncomingDocument;
- Image = SelectLineToApply;
- ToolTip = 'Select an incoming document record and file attachment that you want to link to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.SelectIncomingDocumentForPostedDocument(Rec."Document No.", Rec."Posting Date", Rec.RecordId);
- end;
- }
- action(IncomingDocAttachFile)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Incoming Document from File';
- Ellipsis = true;
- Enabled = not HasIncomingDocument;
- Image = Attach;
- ToolTip = 'Create an incoming document record by selecting a file to attach, and then link the incoming document record to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocumentAttachment: Record "Incoming Document Attachment";
- begin
- IncomingDocumentAttachment.NewAttachmentFromPostedDocument(Rec."Document No.", Rec."Posting Date");
- end;
- }
- }
- }
- action("&Navigate")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Find entries...';
- Image = Navigate;
- Scope = Repeater;
- ShortCutKey = 'Ctrl+Alt+Q';
- ToolTip = 'Find entries and documents that exist for the document number and posting date on the selected document. (Formerly this action was named Navigate.)';
-
- trigger OnAction()
- begin
- Navigate.SetDoc(Rec."Posting Date", Rec."Document No.");
- Navigate.Run();
- end;
- }
- action("Show Document")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Show Document';
- Image = Document;
- ShortCutKey = 'Return';
- ToolTip = 'Show details for the posted payment, invoice, or credit memo.';
-
- trigger OnAction()
- begin
- Rec.ShowDoc();
- end;
- }
- action(ShowDocumentAttachment)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Show Document Attachment';
- Enabled = HasDocumentAttachment;
- Image = Attach;
- ToolTip = 'View documents or images that are attached to the posted invoice or credit memo.';
-
- trigger OnAction()
- begin
- Rec.ShowPostedDocAttachment();
- end;
- }
- action("Create Payment")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Payment';
- Image = SuggestVendorPayments;
- ToolTip = 'Create a payment journal based on the selected invoices.';
-
- trigger OnAction()
- var
- VendorLedgerEntry: Record "Vendor Ledger Entry";
- GenJournalBatch: Record "Gen. Journal Batch";
- GenJnlManagement: Codeunit GenJnlManagement;
- CreatePayment: Page "Create Payment";
- begin
- CurrPage.SetSelectionFilter(VendorLedgerEntry);
- if CreatePayment.RunModal() = ACTION::OK then begin
- CreatePayment.MakeGenJnlLines(VendorLedgerEntry);
- GetBatchRecord(GenJournalBatch, CreatePayment);
- GenJnlManagement.TemplateSelectionFromBatch(GenJournalBatch);
- Clear(CreatePayment);
- end else
- Clear(CreatePayment);
- end;
- }
- action(ShowChangeHistory)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Show Change History';
- Image = History;
- ToolTip = 'View the history of changes for this entry.';
-
- trigger OnAction()
- var
- ChangeLogEntry: Record "Change Log Entry";
- begin
- SetChangeLogEntriesFilter(ChangeLogEntry);
- Page.RunModal(Page::"Change Log Entries", ChangeLogEntry);
- end;
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- group(Category_Category4)
- {
- Caption = 'Line', Comment = 'Generated from the PromotedActionCategories property index 3.';
- ShowAs = SplitButton;
-
- actionref("Show Document_Promoted"; "Show Document")
- {
- }
- actionref(ShowDocumentAttachment_Promoted; ShowDocumentAttachment)
- {
- }
- }
- group("Category_Apply/Unapply")
- {
- Caption = 'Apply/Unapply';
- ShowAs = SplitButton;
-
- actionref(ActionApplyEntries_Promoted; ActionApplyEntries)
- {
- }
- actionref(UnapplyEntries_Promoted; UnapplyEntries)
- {
- }
- }
- actionref("&Navigate_Promoted"; "&Navigate")
- {
- }
- actionref("Create Payment_Promoted"; "Create Payment")
- {
- }
- actionref(ReverseTransaction_Promoted; ReverseTransaction)
- {
- }
- }
- group(Category_Category5)
- {
- Caption = 'Entry', Comment = 'Generated from the PromotedActionCategories property index 4.';
-
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref(SetDimensionFilter_Promoted; SetDimensionFilter)
- {
- }
- actionref(AppliedEntries_Promoted; AppliedEntries)
- {
- }
- actionref("Detailed &Ledger Entries_Promoted"; "Detailed &Ledger Entries")
- {
- }
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- HasIncomingDocument := IncomingDocument.PostedDocExists(Rec."Document No.", Rec."Posting Date");
- HasDocumentAttachment := Rec.HasPostedDocAttachment();
- if GuiAllowed() then
- CurrPage.IncomingDocAttachFactBox.PAGE.LoadDataFromRecord(Rec);
- end;
-
- trigger OnAfterGetRecord()
- begin
- StyleTxt := Rec.SetStyle();
- end;
-
- trigger OnInit()
- begin
- AmountVisible := true;
- end;
-
- trigger OnModifyRecord(): Boolean
- begin
- CODEUNIT.Run(CODEUNIT::"Vend. Entry-Edit", Rec);
- exit(false);
- end;
-
- trigger OnOpenPage()
- begin
- SetControlVisibility();
- SetDimVisibility();
- if (Rec.GetFilters() <> '') and not Rec.Find() then
- if Rec.FindFirst() then;
- end;
-
- var
- CalcRunningVendBalance: Codeunit "Calc. Running Vend. Balance";
- Navigate: Page Navigate;
- DimensionSetIDFilter: Page "Dimension Set ID Filter";
- HasIncomingDocument: Boolean;
- HasDocumentAttachment: Boolean;
- AmountVisible: Boolean;
- DebitCreditVisible: Boolean;
- VendNameVisible: Boolean;
- ExportToPaymentFileConfirmTxt: Label 'Editing the Exported to Payment File field will change the payment suggestions in the Payment Journal. Edit this field only if you must correct a mistake.\Do you want to continue?';
-
- protected var
- Dim1Visible: Boolean;
- Dim2Visible: Boolean;
- Dim3Visible: Boolean;
- Dim4Visible: Boolean;
- Dim5Visible: Boolean;
- Dim6Visible: Boolean;
- Dim7Visible: Boolean;
- Dim8Visible: Boolean;
- StyleTxt: Text;
-
- local procedure SetDimVisibility()
- var
- DimensionManagement: Codeunit DimensionManagement;
- begin
- DimensionManagement.UseShortcutDims(Dim1Visible, Dim2Visible, Dim3Visible, Dim4Visible, Dim5Visible, Dim6Visible, Dim7Visible, Dim8Visible);
- end;
-
- local procedure SetControlVisibility()
- var
- GLSetup: Record "General Ledger Setup";
- PurchSetup: Record "Purchases & Payables Setup";
- begin
- GLSetup.Get();
- AmountVisible := not (GLSetup."Show Amounts" = GLSetup."Show Amounts"::"Debit/Credit Only");
- DebitCreditVisible := not (GLSetup."Show Amounts" = GLSetup."Show Amounts"::"Amount Only");
- PurchSetup.Get();
- VendNameVisible := PurchSetup."Copy Vendor Name to Entries";
- end;
-
- local procedure GetBatchRecord(var GenJournalBatch: Record "Gen. Journal Batch"; CreatePayment: Page "Create Payment")
- var
- GenJournalTemplate: Record "Gen. Journal Template";
- JournalTemplateName: Code[10];
- JournalBatchName: Code[10];
- begin
- JournalTemplateName := CreatePayment.GetTemplateName();
- JournalBatchName := CreatePayment.GetBatchNumber();
-
- GenJournalTemplate.Get(JournalTemplateName);
- GenJournalBatch.Get(JournalTemplateName, JournalBatchName);
- end;
-
- local procedure SetChangeLogEntriesFilter(var ChangeLogEntry: Record "Change Log Entry")
- begin
- ChangeLogEntry.SetRange("Table No.", Database::"Vendor Ledger Entry");
- ChangeLogEntry.SetRange("Primary Key Field 1 Value", Format(Rec."Entry No.", 0, 9));
- end;
-}
-
diff --git a/src/Layers/NL/BaseApp/Purchases/Payables/VendorLedgerEntry.Table.al b/src/Layers/NL/BaseApp/Purchases/Payables/VendorLedgerEntry.Table.al
deleted file mode 100644
index b5111ae5cc..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/Payables/VendorLedgerEntry.Table.al
+++ /dev/null
@@ -1,1292 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.Payables;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.Payment;
-using Microsoft.CRM.Team;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Ledger;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.FixedAssets.FixedAsset;
-using Microsoft.Foundation.Attachment;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Intercompany.Partner;
-using Microsoft.Purchases.History;
-using Microsoft.Purchases.Remittance;
-using Microsoft.Purchases.Vendor;
-using Microsoft.Sales.Customer;
-using Microsoft.Utilities;
-using System.Security.AccessControl;
-using System.Utilities;
-
-table 25 "Vendor Ledger Entry"
-{
- Caption = 'Vendor Ledger Entry';
- DrillDownPageID = "Vendor Ledger Entries";
- LookupPageID = "Vendor Ledger Entries";
- DataClassification = CustomerContent;
-
- fields
- {
- field(1; "Entry No."; Integer)
- {
- Caption = 'Entry No.';
- ToolTip = 'Specifies the number of the entry, as assigned from the specified number series when the entry was created.';
- }
- field(3; "Vendor No."; Code[20])
- {
- Caption = 'Vendor No.';
- ToolTip = 'Specifies the number of the vendor account that the entry is linked to.';
- TableRelation = Vendor;
- }
- field(4; "Posting Date"; Date)
- {
- Caption = 'Posting Date';
- ToolTip = 'Specifies the vendor entry''s posting date.';
- }
- field(5; "Document Type"; Enum "Gen. Journal Document Type")
- {
- Caption = 'Document Type';
- ToolTip = 'Specifies the document type that the vendor entry belongs to.';
- }
- field(6; "Document No."; Code[20])
- {
- Caption = 'Document No.';
- ToolTip = 'Specifies the vendor entry''s document number.';
-
- trigger OnLookup()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.HyperlinkToDocument("Document No.", "Posting Date");
- end;
- }
- field(7; Description; Text[100])
- {
- Caption = 'Description';
- ToolTip = 'Specifies a description of the vendor entry.';
- }
- field(8; "Vendor Name"; Text[100])
- {
- Caption = 'Vendor Name';
- ToolTip = 'Specifies the name of the vendor account that the entry is linked to.';
- }
- field(11; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- ToolTip = 'Specifies the currency code for the amount on the line.';
- TableRelation = Currency;
- }
- field(13; Amount; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Vendor Ledg. Entry".Amount where("Ledger Entry Amount" = const(true),
- "Vendor Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Amount';
- ToolTip = 'Specifies the amount of the entry.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(14; "Remaining Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Vendor Ledg. Entry".Amount where("Vendor Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Remaining Amount';
- ToolTip = 'Specifies the amount that remains to be applied to before the entry is totally applied to.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(15; "Original Amt. (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Vendor Ledg. Entry"."Amount (LCY)" where("Vendor Ledger Entry No." = field("Entry No."),
- "Entry Type" = filter("Initial Entry"),
- "Posting Date" = field("Date Filter")));
- Caption = 'Original Amt. (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(16; "Remaining Amt. (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Vendor Ledg. Entry"."Amount (LCY)" where("Vendor Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Remaining Amt. (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(17; "Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Vendor Ledg. Entry"."Amount (LCY)" where("Ledger Entry Amount" = const(true),
- "Vendor Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Amount (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(18; "Purchase (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Purchase (LCY)';
- }
- field(20; "Inv. Discount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Inv. Discount (LCY)';
- }
- field(21; "Buy-from Vendor No."; Code[20])
- {
- Caption = 'Buy-from Vendor No.';
- TableRelation = Vendor;
- }
- field(22; "Vendor Posting Group"; Code[20])
- {
- Caption = 'Vendor Posting Group';
- ToolTip = 'Specifies the vendor''s market type to link business transactions to.';
- TableRelation = "Vendor Posting Group";
- }
- field(23; "Global Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,1,1';
- Caption = 'Global Dimension 1 Code';
- ToolTip = 'Specifies the code for the global dimension that is linked to the record or entry for analysis purposes. Two global dimensions, typically for the company''s most important activities, are available on all cards, documents, reports, and lists.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1));
- }
- field(24; "Global Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,1,2';
- Caption = 'Global Dimension 2 Code';
- ToolTip = 'Specifies the code for the global dimension that is linked to the record or entry for analysis purposes. Two global dimensions, typically for the company''s most important activities, are available on all cards, documents, reports, and lists.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2));
- }
- field(25; "Purchaser Code"; Code[20])
- {
- Caption = 'Purchaser Code';
- ToolTip = 'Specifies which purchaser is assigned to the vendor.';
- TableRelation = "Salesperson/Purchaser";
- }
- field(27; "User ID"; Code[50])
- {
- Caption = 'User ID';
- ToolTip = 'Specifies the ID of the user who posted the entry, to be used, for example, in the change log.';
- DataClassification = EndUserIdentifiableInformation;
- TableRelation = User."User Name";
- }
- field(28; "Source Code"; Code[10])
- {
- Caption = 'Source Code';
- ToolTip = 'Specifies the source code that specifies where the entry was created.';
- TableRelation = "Source Code";
- }
- field(33; "On Hold"; Code[3])
- {
- Caption = 'On Hold';
- ToolTip = 'Specifies that the related entry represents an unpaid invoice for which either a payment suggestion, a reminder, or a finance charge memo exists.';
-
- trigger OnValidate()
- var
- GenJournalLine: Record "Gen. Journal Line";
- begin
- if "On Hold" = xRec."On Hold" then
- exit;
- GenJournalLine.Reset();
- GenJournalLine.SetLoadFields("On Hold");
- GenJournalLine.SetRange("Account Type", GenJournalLine."Account Type"::Vendor);
- GenJournalLine.SetRange("Account No.", "Vendor No.");
- GenJournalLine.SetRange("Applies-to Doc. Type", "Document Type");
- GenJournalLine.SetRange("Applies-to Doc. No.", "Document No.");
- GenJournalLine.SetRange("On Hold", xRec."On Hold");
- if GenJournalLine.FindFirst() then
- if not Confirm(
- StrSubstNo(
- NetBalanceOnHoldErr,
- GenJournalLine."Journal Template Name", GenJournalLine."Journal Batch Name", GenJournalLine."Line No."))
- then
- Error('');
- end;
- }
- field(34; "Applies-to Doc. Type"; Enum "Gen. Journal Document Type")
- {
- Caption = 'Applies-to Doc. Type';
- }
- field(35; "Applies-to Doc. No."; Code[20])
- {
- Caption = 'Applies-to Doc. No.';
- }
- field(36; Open; Boolean)
- {
- Caption = 'Open';
- ToolTip = 'Specifies whether the amount on the entry has been fully paid or there is still a remaining amount that must be applied to.';
- }
- field(37; "Due Date"; Date)
- {
- Caption = 'Due Date';
- ToolTip = 'Specifies the due date on the entry.';
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- end;
- }
- field(38; "Pmt. Discount Date"; Date)
- {
- Caption = 'Pmt. Discount Date';
- ToolTip = 'Specifies the date on which the amount in the entry must be paid for a payment discount to be granted.';
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- end;
- }
- field(39; "Original Pmt. Disc. Possible"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Original Pmt. Disc. Possible';
- ToolTip = 'Specifies the discount that you can obtain if the entry is applied to before the payment discount date.';
- Editable = false;
- }
- field(40; "Pmt. Disc. Rcd.(LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Pmt. Disc. Rcd.(LCY)';
- }
- field(42; "Orig. Pmt. Disc. Possible(LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Org. Pmt. Disc. Possible (LCY)';
- Editable = false;
- }
- field(43; Positive; Boolean)
- {
- Caption = 'Positive';
- ToolTip = 'Specifies if the entry to be applied is positive.';
- }
- field(44; "Closed by Entry No."; Integer)
- {
- Caption = 'Closed by Entry No.';
- TableRelation = "Vendor Ledger Entry";
- }
- field(45; "Closed at Date"; Date)
- {
- Caption = 'Closed at Date';
- ToolTip = 'Specifies the date at which the vendor ledger entry was closed.';
- }
- field(46; "Closed by Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Closed by Amount';
- ToolTip = 'Specifies the amount that the entry was finally applied to (closed) with.';
- }
- field(47; "Applies-to ID"; Code[50])
- {
- Caption = 'Applies-to ID';
- ToolTip = 'Specifies the ID of entries that will be applied to when you choose the Apply Entries action.';
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- end;
- }
- field(48; "Journal Templ. Name"; Code[10])
- {
- Caption = 'Journal Template Name';
- }
- field(49; "Journal Batch Name"; Code[10])
- {
- Caption = 'Journal Batch Name';
- }
- field(50; "Reason Code"; Code[10])
- {
- Caption = 'Reason Code';
- ToolTip = 'Specifies the reason code, a supplementary source code that enables you to trace the entry.';
- TableRelation = "Reason Code";
- }
- field(51; "Bal. Account Type"; enum "Gen. Journal Account Type")
- {
- Caption = 'Bal. Account Type';
- ToolTip = 'Specifies the type of account that a balancing entry is posted to, such as BANK for a cash account.';
- }
- field(52; "Bal. Account No."; Code[20])
- {
- Caption = 'Bal. Account No.';
- ToolTip = 'Specifies the number of the general ledger, customer, vendor, or bank account that the balancing entry is posted to, such as a cash account for cash purchases.';
- TableRelation = if ("Bal. Account Type" = const("G/L Account")) "G/L Account"
- else
- if ("Bal. Account Type" = const(Customer)) Customer
- else
- if ("Bal. Account Type" = const(Vendor)) Vendor
- else
- if ("Bal. Account Type" = const("Bank Account")) "Bank Account"
- else
- if ("Bal. Account Type" = const("Fixed Asset")) "Fixed Asset";
- }
- field(53; "Transaction No."; Integer)
- {
- Caption = 'Transaction No.';
- TableRelation = "G/L Transaction";
- ToolTip = 'Specifies the transaction number that groups related G/L entries from the same posting.';
- }
- field(54; "Closed by Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Closed by Amount (LCY)';
- }
- field(58; "Debit Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- BlankZero = true;
- CalcFormula = sum("Detailed Vendor Ledg. Entry"."Debit Amount" where("Ledger Entry Amount" = const(true),
- "Vendor Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Debit Amount';
- ToolTip = 'Specifies the total of the ledger entries that represent debits.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(59; "Credit Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- BlankZero = true;
- CalcFormula = sum("Detailed Vendor Ledg. Entry"."Credit Amount" where("Ledger Entry Amount" = const(true),
- "Vendor Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Credit Amount';
- ToolTip = 'Specifies the total of the ledger entries that represent credits.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(60; "Debit Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- BlankZero = true;
- CalcFormula = sum("Detailed Vendor Ledg. Entry"."Debit Amount (LCY)" where("Ledger Entry Amount" = const(true),
- "Vendor Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Debit Amount (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(61; "Credit Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- BlankZero = true;
- CalcFormula = sum("Detailed Vendor Ledg. Entry"."Credit Amount (LCY)" where("Ledger Entry Amount" = const(true),
- "Vendor Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Credit Amount (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(62; "Document Date"; Date)
- {
- Caption = 'Document Date';
- ToolTip = 'Specifies the vendor entry''s document date.';
- }
- field(63; "External Document No."; Code[35])
- {
- Caption = 'External Document No.';
- ToolTip = 'Specifies a document number that refers to the customer''s or vendor''s numbering system.';
- }
- field(64; "No. Series"; Code[20])
- {
- Caption = 'No. Series';
- TableRelation = "No. Series";
- }
- field(65; "Closed by Currency Code"; Code[10])
- {
- Caption = 'Closed by Currency Code';
- ToolTip = 'Specifies the currency code of the entry that was applied to (and closed) this vendor ledger entry.';
- TableRelation = Currency;
- }
- field(66; "Closed by Currency Amount"; Decimal)
- {
- AccessByPermission = TableData Currency = R;
- AutoFormatExpression = "Closed by Currency Code";
- AutoFormatType = 1;
- Caption = 'Closed by Currency Amount';
- ToolTip = 'Specifies the amount that was finally applied to (and closed) this vendor ledger entry.';
- }
- field(73; "Adjusted Currency Factor"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Adjusted Currency Factor';
- DecimalPlaces = 0 : 15;
- }
- field(74; "Original Currency Factor"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Original Currency Factor';
- DecimalPlaces = 0 : 15;
- }
- field(75; "Original Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Vendor Ledg. Entry".Amount where("Vendor Ledger Entry No." = field("Entry No."),
- "Entry Type" = filter("Initial Entry"),
- "Posting Date" = field("Date Filter")));
- Caption = 'Original Amount';
- ToolTip = 'Specifies the amount of the original entry.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(76; "Date Filter"; Date)
- {
- Caption = 'Date Filter';
- FieldClass = FlowFilter;
- }
- field(77; "Remaining Pmt. Disc. Possible"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Remaining Pmt. Disc. Possible';
- ToolTip = 'Specifies the remaining payment discount which can be received if the payment is made before the payment discount date.';
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- CalcFields(Amount, "Original Amount");
-
- if "Remaining Pmt. Disc. Possible" * Amount < 0 then
- FieldError("Remaining Pmt. Disc. Possible", StrSubstNo(MustHaveSameSignErr, FieldCaption(Amount)));
-
- if Abs("Remaining Pmt. Disc. Possible") > Abs("Original Amount") then
- FieldError("Remaining Pmt. Disc. Possible", StrSubstNo(MustNotBeLargerErr, FieldCaption("Original Amount")));
- end;
- }
- field(78; "Pmt. Disc. Tolerance Date"; Date)
- {
- Caption = 'Pmt. Disc. Tolerance Date';
- ToolTip = 'Specifies the latest date the amount in the entry must be paid in order for payment discount tolerance to be granted.';
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- end;
- }
- field(79; "Max. Payment Tolerance"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Max. Payment Tolerance';
- ToolTip = 'Specifies the maximum tolerated amount the entry can differ from the amount on the invoice or credit memo.';
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- CalcFields(Amount, "Remaining Amount");
- OnValidateMaxPaymentToleranceBeforeError(Rec);
-
- if "Max. Payment Tolerance" * Amount < 0 then
- FieldError("Max. Payment Tolerance", StrSubstNo(MustHaveSameSignErr, FieldCaption(Amount)));
-
- if Abs("Max. Payment Tolerance") > Abs("Remaining Amount") then
- FieldError("Max. Payment Tolerance", StrSubstNo(MustNotBeLargerErr, FieldCaption("Remaining Amount")));
- end;
- }
- field(81; "Accepted Payment Tolerance"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Accepted Payment Tolerance';
- }
- field(82; "Accepted Pmt. Disc. Tolerance"; Boolean)
- {
- Caption = 'Accepted Pmt. Disc. Tolerance';
- }
- field(83; "Pmt. Tolerance (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Pmt. Tolerance (LCY)';
- }
- field(84; "Amount to Apply"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Amount to Apply';
- ToolTip = 'Specifies the amount to apply.';
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- CalcFields("Remaining Amount");
-
- if AreOppositeSign("Amount to Apply", "Remaining Amount") then
- FieldError("Amount to Apply", StrSubstNo(MustHaveSameSignErr, FieldCaption("Remaining Amount")));
-
- if Abs("Amount to Apply") > Abs("Remaining Amount") then
- FieldError("Amount to Apply", StrSubstNo(MustNotBeLargerErr, FieldCaption("Remaining Amount")));
- end;
- }
- field(85; "IC Partner Code"; Code[20])
- {
- Caption = 'IC Partner Code';
- ToolTip = 'Specifies the code of the intercompany partner that the transaction is related to if the entry was created from an intercompany transaction.';
- TableRelation = "IC Partner";
- }
- field(86; "Applying Entry"; Boolean)
- {
- Caption = 'Applying Entry';
- }
- field(87; Reversed; Boolean)
- {
- Caption = 'Reversed';
- ToolTip = 'Specifies if the entry has been part of a reverse transaction.';
- }
- field(88; "Reversed by Entry No."; Integer)
- {
- BlankZero = true;
- Caption = 'Reversed by Entry No.';
- ToolTip = 'Specifies the number of the correcting entry that replaced the original entry in the reverse transaction.';
- TableRelation = "Vendor Ledger Entry";
- }
- field(89; "Reversed Entry No."; Integer)
- {
- BlankZero = true;
- Caption = 'Reversed Entry No.';
- ToolTip = 'Specifies the number of the original entry that was undone by the reverse transaction.';
- TableRelation = "Vendor Ledger Entry";
- }
- field(90; Prepayment; Boolean)
- {
- Caption = 'Prepayment';
- }
- field(95; "G/L Register No."; Integer)
- {
- Caption = 'G/L Register No.';
- Editable = false;
- TableRelation = "G/L Register";
- ToolTip = 'Specifies the G/L register number that groups related G/L entries from the same posting.';
- }
- field(170; "Creditor No."; Code[20])
- {
- Caption = 'Creditor No.';
- ToolTip = 'Specifies the vendor who sent the purchase invoice.';
- }
- field(171; "Payment Reference"; Code[50])
- {
- Caption = 'Payment Reference';
- ToolTip = 'Specifies the payment of the purchase invoice.';
- }
- field(172; "Payment Method Code"; Code[10])
- {
- Caption = 'Payment Method Code';
- ToolTip = 'Specifies how to make payment, such as with bank transfer, cash, or check.';
- TableRelation = "Payment Method";
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- end;
- }
- field(173; "Applies-to Ext. Doc. No."; Code[35])
- {
- Caption = 'Applies-to Ext. Doc. No.';
- }
- field(175; "Invoice Received Date"; Date)
- {
- ToolTip = 'Specifies the date when the vendor''s invoice was received.';
-
- }
- field(288; "Recipient Bank Account"; Code[20])
- {
- Caption = 'Recipient Bank Account';
- ToolTip = 'Specifies the bank account to transfer the amount to.';
- TableRelation = "Vendor Bank Account".Code where("Vendor No." = field("Vendor No."));
- }
- field(289; "Message to Recipient"; Text[140])
- {
- Caption = 'Message to Recipient';
- ToolTip = 'Specifies the message exported to the payment file when you use the Export Payments to File function in the Payment Journal window.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateMessagetoRecipient(Rec, IsHandled);
- if IsHandled then
- exit;
-
- TestField(Open, true);
- end;
- }
- field(290; "Exported to Payment File"; Boolean)
- {
- Caption = 'Exported to Payment File';
- ToolTip = 'Specifies that the entry was created as a result of exporting a payment journal line.';
- Editable = false;
- }
- field(480; "Dimension Set ID"; Integer)
- {
- Caption = 'Dimension Set ID';
- ToolTip = 'Specifies a reference to a combination of dimension values. The actual values are stored in the Dimension Set Entry table.';
- Editable = false;
- TableRelation = "Dimension Set Entry";
-
- trigger OnLookup()
- begin
- Rec.ShowDimensions();
- end;
- }
- field(481; "Shortcut Dimension 3 Code"; Code[20])
- {
- CaptionClass = '1,2,3';
- Caption = 'Shortcut Dimension 3 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 3, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(3)));
- }
- field(482; "Shortcut Dimension 4 Code"; Code[20])
- {
- CaptionClass = '1,2,4';
- Caption = 'Shortcut Dimension 4 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 4, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(4)));
- }
- field(483; "Shortcut Dimension 5 Code"; Code[20])
- {
- CaptionClass = '1,2,5';
- Caption = 'Shortcut Dimension 5 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 5, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(5)));
- }
- field(484; "Shortcut Dimension 6 Code"; Code[20])
- {
- CaptionClass = '1,2,6';
- Caption = 'Shortcut Dimension 6 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 6, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(6)));
- }
- field(485; "Shortcut Dimension 7 Code"; Code[20])
- {
- CaptionClass = '1,2,7';
- Caption = 'Shortcut Dimension 7 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 7, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(7)));
- }
- field(486; "Shortcut Dimension 8 Code"; Code[20])
- {
- CaptionClass = '1,2,8';
- Caption = 'Shortcut Dimension 8 Code';
- ToolTip = 'Specifies the code for Shortcut Dimension 8, which is one of dimension codes that you set up in the General Ledger Setup window.';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(8)));
- }
- field(1000; "Remit-to Code"; Code[20])
- {
- Caption = 'Remit-to Code';
- ToolTip = 'Specifies the address for the remit-to code.';
- TableRelation = "Remit Address".Code where("Vendor No." = field("Vendor No."));
- }
- field(1340; "Dispute Status"; Code[10])
- {
- Caption = 'Dispute Status';
- TableRelation = "Dispute Status";
- DataClassification = CustomerContent;
- ToolTip = 'Specifies if there is an ongoing dispute for this document.';
- }
- field(11000000; "Transaction Mode Code"; Code[20])
- {
- Caption = 'Transaction Mode Code';
- TableRelation = "Transaction Mode".Code where("Account Type" = const(Vendor));
-
- trigger OnValidate()
- var
- begin
- end;
- }
- field(11000002; "Payments in Process"; Decimal)
- {
- AutoFormatExpression = "Currency Code";
- AutoFormatType = 1;
- BlankZero = true;
- CalcFormula = sum("Detail Line"."Amount (Entry)" where("Serial No. (Entry)" = field("Entry No."),
- Status = const("In process"),
- "Account Type" = const(Vendor),
- "Connect Batches" = field("Connect Batches Filter"),
- "Connect Lines" = field("Connect Lines Filter"),
- "Our Bank" = field("Our Bank Filter")));
- Caption = 'Payments in Process';
- Editable = false;
- FieldClass = FlowField;
- }
- field(11000003; "Connect Batches Filter"; Code[20])
- {
- Caption = 'Connect Batches Filter';
- FieldClass = FlowFilter;
- }
- field(11000004; "Connect Lines Filter"; Integer)
- {
- Caption = 'Connect Lines Filter';
- FieldClass = FlowFilter;
- }
- field(11000005; "Our Bank Filter"; Code[20])
- {
- Caption = 'Our Bank Filter';
- FieldClass = FlowFilter;
- }
- }
-
- keys
- {
- key(Key1; "Entry No.")
- {
- Clustered = true;
- }
- key(Key2; "Vendor No.", "Currency Code")
- {
- SumIndexFields = "Purchase (LCY)", "Inv. Discount (LCY)";
- }
- key(Key3; "Vendor No.", "Currency Code", "Posting Date")
- {
- IncludedFields = "Purchase (LCY)", "Inv. Discount (LCY)";
- }
- key(Key4; "Document No.")
- {
- }
- key(Key5; "External Document No.")
- {
- }
- key(Key6; "Vendor No.", Open, Positive, "Due Date", "Currency Code")
- {
- }
- key(Key7; Open, "Due Date")
- {
- }
- key(Key9; "Closed by Entry No.")
- {
- }
- key(Key10; "Transaction No.")
- {
- }
- key(Key11; "Vendor No.", "Global Dimension 1 Code", "Global Dimension 2 Code", "Posting Date", "Currency Code")
- {
- IncludedFields = "Purchase (LCY)", "Inv. Discount (LCY)";
- }
- key(Key15; "Vendor No.", "Applies-to ID", Open, Positive, "Due Date")
- {
- }
- key(Key16; Open, "On Hold", "Transaction Mode Code")
- {
- }
- key(Key17; "Vendor Posting Group")
- {
- }
- key(Key18; "Pmt. Discount Date")
- {
- }
- key(Key19; "Document Type", "Due Date", Open)
- {
- }
- key(Key25; "Vendor No.", "Posting Date", "Applies-to ID")
- {
- IncludedFields = "Currency Code", "Amount to Apply", Open;
- }
- key(Key26; "Applies-to ID")
- {
- IncludedFields = "Accepted Payment Tolerance";
- }
- }
-
- fieldgroups
- {
- fieldgroup(DropDown; "Entry No.", Description, "Vendor No.", "Posting Date", "Document Type", "Document No.")
- {
- }
- fieldgroup(Brick; "Document No.", Description, "Remaining Amt. (LCY)", "Due Date")
- {
- }
- }
-
- var
-#pragma warning disable AA0470
- MustHaveSameSignErr: Label 'must have the same sign as %1';
- MustNotBeLargerErr: Label 'must not be larger than %1';
-#pragma warning restore AA0470
- NetBalanceOnHoldErr: Label 'General journal line number %3 on template name %1 batch name %2 is applied. Do you want to change On Hold value anyway?', Comment = '%1 - template name, %2 - batch name, %3 - line number';
-
- [InherentPermissions(PermissionObjectType::TableData, Database::"Vendor Ledger Entry", 'r')]
- procedure GetLastEntryNo(): Integer;
- var
- FindRecordManagement: Codeunit "Find Record Management";
- begin
- exit(FindRecordManagement.GetLastEntryIntFieldValue(Rec, FieldNo("Entry No.")))
- end;
-
- procedure ShowDoc() Result: Boolean
- var
- PurchInvHeader: Record "Purch. Inv. Header";
- PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeShowDoc(Rec, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- case "Document Type" of
- "Document Type"::Invoice:
- if PurchInvHeader.Get("Document No.") then begin
- PAGE.Run(PAGE::"Posted Purchase Invoice", PurchInvHeader);
- exit(true);
- end;
- "Document Type"::"Credit Memo":
- if PurchCrMemoHdr.Get("Document No.") then begin
- PAGE.Run(PAGE::"Posted Purchase Credit Memo", PurchCrMemoHdr);
- exit(true);
- end
- end;
-
- OnAfterShowDoc(Rec);
- end;
-
- procedure ShowPostedDocAttachment()
- var
- PurchInvHeader: Record "Purch. Inv. Header";
- PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.";
- begin
- case "Document Type" of
- "Document Type"::Invoice:
- if PurchInvHeader.Get("Document No.") then
- OpenDocumentAttachmentDetails(PurchInvHeader);
- "Document Type"::"Credit Memo":
- if PurchCrMemoHdr.Get("Document No.") then
- OpenDocumentAttachmentDetails(PurchCrMemoHdr);
- end;
-
- OnAfterShowPostedDocAttachment(Rec);
- end;
-
- local procedure OpenDocumentAttachmentDetails("Record": Variant)
- var
- DocumentAttachmentDetails: Page "Document Attachment Details";
- RecRef: RecordRef;
- begin
- RecRef.GetTable(Record);
- DocumentAttachmentDetails.OpenForRecRef(RecRef);
- DocumentAttachmentDetails.RunModal();
- end;
-
- procedure HasPostedDocAttachment(): Boolean
- var
- [SecurityFiltering(SecurityFilter::Filtered)]
- PurchInvHeader: Record "Purch. Inv. Header";
- [SecurityFiltering(SecurityFilter::Filtered)]
- PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.";
- DocumentAttachment: Record "Document Attachment";
- HasPostedDocumentAttachment: Boolean;
- begin
- case "Document Type" of
- "Document Type"::Invoice:
- if PurchInvHeader.Get("Document No.") then
- exit(DocumentAttachment.HasPostedDocumentAttachment(PurchInvHeader));
- "Document Type"::"Credit Memo":
- if PurchCrMemoHdr.Get("Document No.") then
- exit(DocumentAttachment.HasPostedDocumentAttachment(PurchCrMemoHdr));
- end;
-
- OnAfterHasPostedDocAttachment(Rec, HasPostedDocumentAttachment);
- exit(HasPostedDocumentAttachment);
- end;
-
- procedure DrillDownOnEntries(var DtldVendLedgEntry: Record "Detailed Vendor Ledg. Entry")
- var
- VendLedgEntry: Record "Vendor Ledger Entry";
- DrillDownPageID: Integer;
- begin
- VendLedgEntry.Reset();
- DtldVendLedgEntry.CopyFilter("Vendor No.", VendLedgEntry."Vendor No.");
- DtldVendLedgEntry.CopyFilter("Currency Code", VendLedgEntry."Currency Code");
- DtldVendLedgEntry.CopyFilter("Initial Entry Global Dim. 1", VendLedgEntry."Global Dimension 1 Code");
- DtldVendLedgEntry.CopyFilter("Initial Entry Global Dim. 2", VendLedgEntry."Global Dimension 2 Code");
- DtldVendLedgEntry.CopyFilter("Initial Entry Due Date", VendLedgEntry."Due Date");
- VendLedgEntry.SetCurrentKey("Vendor No.", "Posting Date");
- VendLedgEntry.SetRange(Open, true);
- OnBeforeDrillDownEntries(VendLedgEntry, DtldVendLedgEntry, DrillDownPageID);
- PAGE.Run(DrillDownPageID, VendLedgEntry);
- end;
-
- procedure DrillDownOnOverdueEntries(var DtldVendLedgEntry: Record "Detailed Vendor Ledg. Entry")
- var
- VendLedgEntry: Record "Vendor Ledger Entry";
- DrillDownPageID: Integer;
- begin
- VendLedgEntry.Reset();
- DtldVendLedgEntry.CopyFilter("Vendor No.", VendLedgEntry."Vendor No.");
- DtldVendLedgEntry.CopyFilter("Currency Code", VendLedgEntry."Currency Code");
- DtldVendLedgEntry.CopyFilter("Initial Entry Global Dim. 1", VendLedgEntry."Global Dimension 1 Code");
- DtldVendLedgEntry.CopyFilter("Initial Entry Global Dim. 2", VendLedgEntry."Global Dimension 2 Code");
- VendLedgEntry.SetCurrentKey("Vendor No.", "Posting Date");
- VendLedgEntry.SetFilter("Date Filter", '..%1', WorkDate());
- VendLedgEntry.SetFilter("Due Date", '<%1', WorkDate());
- VendLedgEntry.SetFilter("Remaining Amount", '<>%1', 0);
- OnBeforeDrillDownOnOverdueEntries(VendLedgEntry, DtldVendLedgEntry, DrillDownPageID);
- PAGE.Run(DrillDownPageID, VendLedgEntry);
- end;
-
- procedure GetOriginalCurrencyFactor(): Decimal
- begin
- if "Original Currency Factor" = 0 then
- exit(1);
- exit("Original Currency Factor");
- end;
-
- procedure GetAdjustedCurrencyFactor(): Decimal
- begin
- if "Adjusted Currency Factor" = 0 then
- exit(1);
- exit("Adjusted Currency Factor");
- end;
-
- procedure ShowDimensions()
- var
- DimMgt: Codeunit DimensionManagement;
- begin
- DimMgt.ShowDimensionSet("Dimension Set ID", StrSubstNo('%1 %2', TableCaption(), "Entry No."));
- end;
-
- procedure SetStyle() Result: Text
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetStyle(Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if Open then begin
- if WorkDate() > "Due Date" then
- exit('Unfavorable')
- end else
- if "Closed at Date" > "Due Date" then
- exit('Attention');
- exit('');
- end;
-
- procedure CopyFromGenJnlLine(GenJnlLine: Record "Gen. Journal Line")
- begin
- "Vendor No." := GenJnlLine."Account No.";
- "Posting Date" := GenJnlLine."Posting Date";
- "Document Date" := GenJnlLine."Document Date";
- "Invoice Received Date" := GenJnlLine."Invoice Received Date";
- "Document Type" := GenJnlLine."Document Type";
- "Document No." := GenJnlLine."Document No.";
- "External Document No." := GenJnlLine."External Document No.";
- Description := GenJnlLine.Description;
- "Currency Code" := GenJnlLine."Currency Code";
- "Purchase (LCY)" := GenJnlLine."Sales/Purch. (LCY)";
- "Inv. Discount (LCY)" := GenJnlLine."Inv. Discount (LCY)";
- "Buy-from Vendor No." := GenJnlLine."Sell-to/Buy-from No.";
- "Vendor Posting Group" := GenJnlLine."Posting Group";
- "Global Dimension 1 Code" := GenJnlLine."Shortcut Dimension 1 Code";
- "Global Dimension 2 Code" := GenJnlLine."Shortcut Dimension 2 Code";
- "Dimension Set ID" := GenJnlLine."Dimension Set ID";
- "Purchaser Code" := GenJnlLine."Salespers./Purch. Code";
- "Source Code" := GenJnlLine."Source Code";
- "On Hold" := GenJnlLine."On Hold";
- "Applies-to Doc. Type" := GenJnlLine."Applies-to Doc. Type";
- "Applies-to Doc. No." := GenJnlLine."Applies-to Doc. No.";
- "Due Date" := GenJnlLine."Due Date";
- "Pmt. Discount Date" := GenJnlLine."Pmt. Discount Date";
- "Applies-to ID" := GenJnlLine."Applies-to ID";
- "Journal Templ. Name" := GenJnlLine."Journal Template Name";
- "Journal Batch Name" := GenJnlLine."Journal Batch Name";
- "Reason Code" := GenJnlLine."Reason Code";
- "User ID" := CopyStr(UserId(), 1, MaxStrLen("User ID"));
- "Bal. Account Type" := GenJnlLine."Bal. Account Type";
- "Bal. Account No." := GenJnlLine."Bal. Account No.";
- "No. Series" := GenJnlLine."Posting No. Series";
- "IC Partner Code" := GenJnlLine."IC Partner Code";
- Prepayment := GenJnlLine.Prepayment;
- "Recipient Bank Account" := GenJnlLine."Recipient Bank Account";
- "Message to Recipient" := GenJnlLine."Message to Recipient";
- "Applies-to Ext. Doc. No." := GenJnlLine."Applies-to Ext. Doc. No.";
- "Creditor No." := GenJnlLine."Creditor No.";
- "Payment Reference" := GenJnlLine."Payment Reference";
- "Payment Method Code" := GenJnlLine."Payment Method Code";
- "Exported to Payment File" := GenJnlLine."Exported to Payment File";
- "Transaction Mode Code" := GenJnlLine."Transaction Mode Code";
- if (GenJnlLine."Remit-to Code" <> '') then
- "Remit-to Code" := GenJnlLine."Remit-to Code";
-
- OnAfterCopyVendLedgerEntryFromGenJnlLine(Rec, GenJnlLine);
- end;
-
- procedure CopyFromCVLedgEntryBuffer(var CVLedgerEntryBuffer: Record "CV Ledger Entry Buffer")
- begin
- "Entry No." := CVLedgerEntryBuffer."Entry No.";
- "Vendor No." := CVLedgerEntryBuffer."CV No.";
- "Posting Date" := CVLedgerEntryBuffer."Posting Date";
- "Document Type" := CVLedgerEntryBuffer."Document Type";
- "Document No." := CVLedgerEntryBuffer."Document No.";
- Description := CVLedgerEntryBuffer.Description;
- "Currency Code" := CVLedgerEntryBuffer."Currency Code";
- Amount := CVLedgerEntryBuffer.Amount;
- "Remaining Amount" := CVLedgerEntryBuffer."Remaining Amount";
- "Original Amount" := CVLedgerEntryBuffer."Original Amount";
- "Original Amt. (LCY)" := CVLedgerEntryBuffer."Original Amt. (LCY)";
- "Remaining Amt. (LCY)" := CVLedgerEntryBuffer."Remaining Amt. (LCY)";
- "Amount (LCY)" := CVLedgerEntryBuffer."Amount (LCY)";
- "Purchase (LCY)" := CVLedgerEntryBuffer."Sales/Purchase (LCY)";
- "Inv. Discount (LCY)" := CVLedgerEntryBuffer."Inv. Discount (LCY)";
- "Buy-from Vendor No." := CVLedgerEntryBuffer."Bill-to/Pay-to CV No.";
- "Vendor Posting Group" := CVLedgerEntryBuffer."CV Posting Group";
- "Global Dimension 1 Code" := CVLedgerEntryBuffer."Global Dimension 1 Code";
- "Global Dimension 2 Code" := CVLedgerEntryBuffer."Global Dimension 2 Code";
- "Dimension Set ID" := CVLedgerEntryBuffer."Dimension Set ID";
- "Purchaser Code" := CVLedgerEntryBuffer."Salesperson Code";
- "User ID" := CVLedgerEntryBuffer."User ID";
- "Source Code" := CVLedgerEntryBuffer."Source Code";
- "On Hold" := CVLedgerEntryBuffer."On Hold";
- "Applies-to Doc. Type" := CVLedgerEntryBuffer."Applies-to Doc. Type";
- "Applies-to Doc. No." := CVLedgerEntryBuffer."Applies-to Doc. No.";
- Open := CVLedgerEntryBuffer.Open;
- "Due Date" := CVLedgerEntryBuffer."Due Date";
- "Pmt. Discount Date" := CVLedgerEntryBuffer."Pmt. Discount Date";
- "Original Pmt. Disc. Possible" := CVLedgerEntryBuffer."Original Pmt. Disc. Possible";
- "Orig. Pmt. Disc. Possible(LCY)" := CVLedgerEntryBuffer."Orig. Pmt. Disc. Possible(LCY)";
- "Remaining Pmt. Disc. Possible" := CVLedgerEntryBuffer."Remaining Pmt. Disc. Possible";
- "Pmt. Disc. Rcd.(LCY)" := CVLedgerEntryBuffer."Pmt. Disc. Given (LCY)";
- Positive := CVLedgerEntryBuffer.Positive;
- "Closed by Entry No." := CVLedgerEntryBuffer."Closed by Entry No.";
- "Closed at Date" := CVLedgerEntryBuffer."Closed at Date";
- "Closed by Amount" := CVLedgerEntryBuffer."Closed by Amount";
- "Applies-to ID" := CVLedgerEntryBuffer."Applies-to ID";
- "Journal Templ. Name" := CVLedgerEntryBuffer."Journal Templ. Name";
- "Journal Batch Name" := CVLedgerEntryBuffer."Journal Batch Name";
- "Reason Code" := CVLedgerEntryBuffer."Reason Code";
- "Bal. Account Type" := CVLedgerEntryBuffer."Bal. Account Type";
- "Bal. Account No." := CVLedgerEntryBuffer."Bal. Account No.";
- "Transaction No." := CVLedgerEntryBuffer."Transaction No.";
- "Closed by Amount (LCY)" := CVLedgerEntryBuffer."Closed by Amount (LCY)";
- "Debit Amount" := CVLedgerEntryBuffer."Debit Amount";
- "Credit Amount" := CVLedgerEntryBuffer."Credit Amount";
- "Debit Amount (LCY)" := CVLedgerEntryBuffer."Debit Amount (LCY)";
- "Credit Amount (LCY)" := CVLedgerEntryBuffer."Credit Amount (LCY)";
- "Document Date" := CVLedgerEntryBuffer."Document Date";
- "External Document No." := CVLedgerEntryBuffer."External Document No.";
- "No. Series" := CVLedgerEntryBuffer."No. Series";
- "Closed by Currency Code" := CVLedgerEntryBuffer."Closed by Currency Code";
- "Closed by Currency Amount" := CVLedgerEntryBuffer."Closed by Currency Amount";
- "Adjusted Currency Factor" := CVLedgerEntryBuffer."Adjusted Currency Factor";
- "Original Currency Factor" := CVLedgerEntryBuffer."Original Currency Factor";
- "Pmt. Disc. Tolerance Date" := CVLedgerEntryBuffer."Pmt. Disc. Tolerance Date";
- "Max. Payment Tolerance" := CVLedgerEntryBuffer."Max. Payment Tolerance";
- "Accepted Payment Tolerance" := CVLedgerEntryBuffer."Accepted Payment Tolerance";
- "Accepted Pmt. Disc. Tolerance" := CVLedgerEntryBuffer."Accepted Pmt. Disc. Tolerance";
- "Pmt. Tolerance (LCY)" := CVLedgerEntryBuffer."Pmt. Tolerance (LCY)";
- "Amount to Apply" := CVLedgerEntryBuffer."Amount to Apply";
- Prepayment := CVLedgerEntryBuffer.Prepayment;
-
- OnAfterCopyVendLedgerEntryFromCVLedgEntryBuffer(Rec, CVLedgerEntryBuffer);
- end;
-
- procedure RecalculateAmounts(FromCurrencyCode: Code[10]; ToCurrencyCode: Code[10]; PostingDate: Date)
- var
- CurrExchRate: Record "Currency Exchange Rate";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeRecalculateAmounts(Rec, FromCurrencyCode, ToCurrencyCode, PostingDate, IsHandled);
- if not IsHandled then begin
- if ToCurrencyCode = FromCurrencyCode then
- exit;
-
- "Remaining Amount" :=
- CurrExchRate.ExchangeAmount("Remaining Amount", FromCurrencyCode, ToCurrencyCode, PostingDate);
- "Remaining Pmt. Disc. Possible" :=
- CurrExchRate.ExchangeAmount("Remaining Pmt. Disc. Possible", FromCurrencyCode, ToCurrencyCode, PostingDate);
- "Accepted Payment Tolerance" :=
- CurrExchRate.ExchangeAmount("Accepted Payment Tolerance", FromCurrencyCode, ToCurrencyCode, PostingDate);
- "Amount to Apply" :=
- CurrExchRate.ExchangeAmount("Amount to Apply", FromCurrencyCode, ToCurrencyCode, PostingDate);
- end;
- OnAfterRecalculateAmounts(Rec, FromCurrencyCode, ToCurrencyCode, PostingDate);
- end;
-
- procedure UpdateAmountsForApplication(ApplnDate: Date; ApplnCurrencyCode: Code[10]; RoundAmounts: Boolean; UpdateMaxPaymentTolerance: Boolean)
- var
- CurrencyExchangeRate: Record "Currency Exchange Rate";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateAmountsForApplication(Rec, ApplnDate, ApplnCurrencyCode, RoundAmounts, UpdateMaxPaymentTolerance, IsHandled);
- if not IsHandled then begin
- if "Currency Code" = ApplnCurrencyCode then
- exit;
- if RoundAmounts then begin
- "Remaining Amount" :=
- CurrencyExchangeRate.ExchangeAmount(
- "Remaining Amount", "Currency Code", ApplnCurrencyCode, ApplnDate);
- "Remaining Pmt. Disc. Possible" :=
- CurrencyExchangeRate.ExchangeAmount(
- "Remaining Pmt. Disc. Possible", "Currency Code", ApplnCurrencyCode, ApplnDate);
- if UpdateMaxPaymentTolerance then
- "Max. Payment Tolerance" :=
- CurrencyExchangeRate.ExchangeAmount(
- "Max. Payment Tolerance", "Currency Code", ApplnCurrencyCode, ApplnDate);
- "Amount to Apply" :=
- CurrencyExchangeRate.ExchangeAmount(
- "Amount to Apply", "Currency Code", ApplnCurrencyCode, ApplnDate);
- end else begin
- "Remaining Amount" :=
- CurrencyExchangeRate.ExchangeAmtFCYToFCY(
- ApplnDate, "Currency Code", ApplnCurrencyCode, "Remaining Amount");
- "Remaining Pmt. Disc. Possible" :=
- CurrencyExchangeRate.ExchangeAmtFCYToFCY(
- ApplnDate, "Currency Code", ApplnCurrencyCode, "Remaining Pmt. Disc. Possible");
- if UpdateMaxPaymentTolerance then
- "Max. Payment Tolerance" :=
- CurrencyExchangeRate.ExchangeAmtFCYToFCY(
- ApplnDate, "Currency Code", ApplnCurrencyCode, "Max. Payment Tolerance");
- "Amount to Apply" :=
- CurrencyExchangeRate.ExchangeAmtFCYToFCY(
- ApplnDate, "Currency Code", ApplnCurrencyCode, "Amount to Apply");
- end;
- end;
- OnAfterUpdateAmountsForApplication(Rec, ApplnDate, ApplnCurrencyCode, RoundAmounts, UpdateMaxPaymentTolerance);
- end;
-
- procedure GetRemainingPmtDiscPossible(ReferenceDate: Date) RemainingPmtDiscPossible: Decimal
- begin
- RemainingPmtDiscPossible := "Remaining Pmt. Disc. Possible";
-
- OnAfterGetRemainingPmtDiscPossible(Rec, ReferenceDate, RemainingPmtDiscPossible);
- end;
-
- local procedure AreOppositeSign(Amount1: Decimal; Amount2: Decimal): Boolean
- var
- Math: Codeunit "Math";
- begin
- if (Amount1 = 0) or (Amount2 = 0) then
- exit(false);
-
- exit(Math.Sign(Amount1) <> Math.Sign(Amount2));
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyVendLedgerEntryFromGenJnlLine(var VendorLedgerEntry: Record "Vendor Ledger Entry"; GenJournalLine: Record "Gen. Journal Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyVendLedgerEntryFromCVLedgEntryBuffer(var VendorLedgerEntry: Record "Vendor Ledger Entry"; CVLedgerEntryBuffer: Record "CV Ledger Entry Buffer")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterRecalculateAmounts(var VendorLedgerEntry: Record "Vendor Ledger Entry"; FromCurrencyCode: Code[10]; ToCurrencyCode: Code[10]; PostingDate: Date)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateMaxPaymentToleranceBeforeError(var VendorLedgerEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterShowDoc(var VendorLedgerEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterShowPostedDocAttachment(var VendorLedgerEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterHasPostedDocAttachment(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var HasPostedDocumentAttachment: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeDrillDownEntries(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var DetailedVendorLedgEntry: Record "Detailed Vendor Ledg. Entry"; var DrillDownPageID: Integer)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeDrillDownOnOverdueEntries(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var DetailedVendorLedgEntry: Record "Detailed Vendor Ledg. Entry"; var DrillDownPageID: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateMessagetoRecipient(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowDoc(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeSetStyle(var Result: Text; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateAmountsForApplication(var VendorLedgerEntry: Record "Vendor Ledger Entry"; ApplnDate: Date; ApplnCurrencyCode: Code[10]; RoundAmounts: Boolean; UpdateMaxPaymentTolerance: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetRemainingPmtDiscPossible(VendorLedgerEntry: Record "Vendor Ledger Entry"; ReferenceDate: Date; var RemainingPmtDiscPossible: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeRecalculateAmounts(var VendorLedgerEntry: Record "Vendor Ledger Entry"; FromCurrencyCode: Code[10]; ToCurrencyCode: Code[10]; PostingDate: Date; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateAmountsForApplication(var VendorLedgerEntry: Record "Vendor Ledger Entry"; ApplnDate: Date; ApplnCurrencyCode: Code[10]; RoundAmounts: Boolean; UpdateMaxPaymentTolerance: Boolean; var IsHandled: Boolean)
- begin
- end;
-}
-
diff --git a/src/Layers/NL/BaseApp/Purchases/Posting/PurchasePostPrepayments.Codeunit.al b/src/Layers/NL/BaseApp/Purchases/Posting/PurchasePostPrepayments.Codeunit.al
deleted file mode 100644
index 9488cbedde..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/Posting/PurchasePostPrepayments.Codeunit.al
+++ /dev/null
@@ -1,2036 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.Posting;
-
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Ledger;
-using Microsoft.Finance.GeneralLedger.Posting;
-using Microsoft.Finance.GeneralLedger.Preview;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.Finance.VAT.Calculation;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.ExtendedText;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Foundation.PaymentTerms;
-using Microsoft.Inventory.Item;
-using Microsoft.Inventory.Location;
-using Microsoft.Projects.Project.Job;
-using Microsoft.Purchases.Comment;
-using Microsoft.Purchases.Document;
-using Microsoft.Purchases.History;
-using Microsoft.Purchases.Payables;
-using Microsoft.Purchases.Setup;
-using Microsoft.Purchases.Vendor;
-using Microsoft.Utilities;
-using System.Telemetry;
-using System.Utilities;
-
-codeunit 444 "Purchase-Post Prepayments"
-{
- Permissions = TableData "Purchase Line" = rimd,
- TableData "G/L Register" = rimd,
- TableData "Vendor Posting Group" = rimd,
- TableData "Inventory Posting Group" = rimd,
- TableData "Purch. Inv. Header" = rimd,
- TableData "Purch. Inv. Line" = rimd,
- TableData "Purch. Cr. Memo Hdr." = rimd,
- TableData "Purch. Cr. Memo Line" = rimd;
- TableNo = "Purchase Header";
-
- trigger OnRun()
- var
- SequenceNoMgt: Codeunit "Sequence No. Mgt.";
- begin
- SequenceNoMgt.SetPreviewMode(PreviewMode);
- Execute(Rec);
- end;
-
- var
- GLSetup: Record "General Ledger Setup";
- PurchSetup: Record "Purchases & Payables Setup";
- GenPostingSetup: Record "General Posting Setup";
- TempGlobalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer" temporary;
- TempPurchaseLine: Record "Purchase Line" temporary;
- GenJournalTemplate: Record "Gen. Journal Template";
- ErrorMessageMgt: Codeunit "Error Message Management";
- FeatureTelemetry: Codeunit "Feature Telemetry";
- DocumentErrorsMgt: Codeunit "Document Errors Mgt.";
- GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line";
- SuppressCommit: Boolean;
- PrepmtDocumentType: Option ,,Invoice,"Credit Memo";
- PreviewMode: Boolean;
-
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text002: Label 'Posting Prepayment Lines #2######\';
- Text003: Label '%1 %2 -> Invoice %3';
- Text004: Label 'Posting purchases and VAT #3######\';
- Text005: Label 'Posting to vendors #4######\';
- Text006: Label 'Posting to bal. account #5######';
- Text011: Label '%1 %2 -> Credit Memo %3';
- Text012: Label 'Prepayment %1, %2 %3.';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- PostingDateNotAllowedErr: Label '%1 is not within your range of allowed posting dates.', Comment = '%1 - Posting Date field caption';
- SpecifyInvNoSerieTok: Label 'Specify the code for the number series that will be used to assign numbers to posted purchase prepayment invoices.';
- SpecifyCrNoSerieTok: Label 'Specify the code for the number series that will be used to assign numbers to posted purchase prepayment invoices.';
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text013: Label 'It is not possible to assign a prepayment amount of %1 to the purchase lines.';
-#pragma warning restore AA0470
- Text014: Label 'VAT Amount';
-#pragma warning disable AA0470
- Text015: Label '%1% VAT';
- Text016: Label 'The new prepayment amount must be between %1 and %2.';
- Text017: Label 'At least one line must have %1 > 0 to distribute prepayment amount.';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- PrepaymentPurchaseTok: Label 'Prepayment Purchase', Locked = true;
-#pragma warning disable AA0074
- text019: Label 'Invoice,Credit Memo';
-#pragma warning restore AA0074
-
- procedure SetDocumentType(DocumentType: Option ,,Invoice,"Credit Memo")
- begin
- PrepmtDocumentType := DocumentType;
- end;
-
- local procedure Execute(var PurchHeader: Record "Purchase Header")
- begin
- case PrepmtDocumentType of
- PrepmtDocumentType::Invoice:
- Invoice(PurchHeader);
- PrepmtDocumentType::"Credit Memo":
- CreditMemo(PurchHeader);
- end;
- end;
-
- procedure Invoice(var PurchHeader: Record "Purchase Header")
- var
- Handled: Boolean;
- begin
- OnBeforeInvoice(PurchHeader, Handled);
- if not Handled then
- Code(PurchHeader, 0);
- end;
-
- procedure CreditMemo(var PurchHeader: Record "Purchase Header")
- var
- Handled: Boolean;
- begin
- OnBeforeCreditMemo(PurchHeader, Handled);
- if not Handled then
- Code(PurchHeader, 1);
- end;
-
- local procedure "Code"(var PurchHeader2: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo")
- var
- SourceCodeSetup: Record "Source Code Setup";
- PurchHeader: Record "Purchase Header";
- PurchLine: Record "Purchase Line";
- PurchInvHeader: Record "Purch. Inv. Header";
- PurchCrMemoHeader: Record "Purch. Cr. Memo Hdr.";
- TempPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary;
- TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer";
- TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer";
- GenJnlLine: Record "Gen. Journal Line";
- TempVATAmountLine: Record "VAT Amount Line" temporary;
- TempVATAmountLineDeduct: Record "VAT Amount Line" temporary;
- VendLedgEntry: Record "Vendor Ledger Entry";
- TempPurchaseLine2: Record "Purchase Line" temporary;
- GenJnlPostPreview: Codeunit "Gen. Jnl.-Post Preview";
- Window: Dialog;
- GenJnlLineDocNo: Code[20];
- GenJnlLineExtDocNo: Code[35];
- SrcCode: Code[10];
- PostingNoSeriesCode: Code[20];
- ModifyHeader: Boolean;
- CalcPmtDiscOnCrMemos: Boolean;
- PostingDescription: Text[100];
- GenJnlLineDocType: Enum "Gen. Journal Document Type";
- LineCount: Integer;
- PostedDocTabNo: Integer;
- LineNo: Integer;
- begin
- OnBeforePostPrepayments(PurchHeader2, DocumentType, SuppressCommit);
-
- PurchHeader := PurchHeader2;
- GLSetup.GetRecordOnce();
- PurchSetup.Get();
-
- FeatureTelemetry.LogUptake('0000KQD', PrepaymentPurchaseTok, Enum::"Feature Uptake Status"::Used);
- FeatureTelemetry.LogUsage('0000KQE', PrepaymentPurchaseTok, PrepaymentPurchaseTok);
- CheckPrepmtDoc(PurchHeader, DocumentType);
-
- UpdateDocNos(PurchHeader, DocumentType, GenJnlLineDocNo, PostingNoSeriesCode, ModifyHeader);
-
- if not PreviewMode and ModifyHeader then begin
- PurchHeader.Modify();
- if not SuppressCommit then
- Commit();
- end;
-
- OnCodeOnBeforeWindowOpen(PurchHeader, DocumentType);
-
- Window.Open(
- '#1#################################\\' +
- Text002 +
- Text004 +
- Text005 +
- Text006);
- Window.Update(1, StrSubstNo('%1 %2', SelectStr(1 + DocumentType, text019), PurchHeader."No."));
-
- SourceCodeSetup.Get();
- SrcCode := SourceCodeSetup.Purchases;
- if PurchHeader."Prepmt. Posting Description" <> '' then
- PostingDescription := PurchHeader."Prepmt. Posting Description"
- else
- PostingDescription :=
- CopyStr(
- StrSubstNo(Text012, SelectStr(1 + DocumentType, text019), PurchHeader."Document Type", PurchHeader."No."),
- 1, MaxStrLen(PurchHeader."Posting Description"));
- // Create posted header
- case DocumentType of
- DocumentType::Invoice:
- begin
- if PurchSetup."Ext. Doc. No. Mandatory" then
- PurchHeader.TestField("Vendor Invoice No.");
- InsertPurchInvHeader(PurchInvHeader, PurchHeader, PostingDescription, GenJnlLineDocNo, SrcCode, PostingNoSeriesCode);
- GenJnlLineDocType := GenJnlLine."Document Type"::Invoice;
- PostedDocTabNo := Database::"Purch. Inv. Header";
- GenJnlLineExtDocNo := PurchInvHeader."Vendor Invoice No.";
- Window.Update(1, StrSubstNo(Text003, PurchHeader."Document Type", PurchHeader."No.", PurchInvHeader."No."));
- end;
- DocumentType::"Credit Memo":
- begin
- if PurchSetup."Ext. Doc. No. Mandatory" then
- PurchHeader.TestField("Vendor Cr. Memo No.");
- CalcPmtDiscOnCrMemos := GetCalcPmtDiscOnCrMemos(PurchHeader."Prepmt. Payment Terms Code");
- InsertPurchCrMemoHeader(
- PurchCrMemoHeader, PurchHeader, PostingDescription, GenJnlLineDocNo, SrcCode, PostingNoSeriesCode,
- CalcPmtDiscOnCrMemos);
- GenJnlLineDocType := GenJnlLine."Document Type"::"Credit Memo";
- PostedDocTabNo := Database::"Purch. Cr. Memo Hdr.";
- GenJnlLineExtDocNo := PurchCrMemoHeader."Vendor Cr. Memo No.";
- Window.Update(1, StrSubstNo(Text011, PurchHeader."Document Type", PurchHeader."No.", PurchCrMemoHeader."No."));
- end;
- end;
- // Reverse old lines
- if DocumentType = DocumentType::Invoice then begin
- GetPurchLinesToDeduct(PurchHeader, TempPurchaseLine2);
- if not TempPurchaseLine2.IsEmpty() then
- CalcVATAmountLines(PurchHeader, TempPurchaseLine2, TempVATAmountLineDeduct, DocumentType::"Credit Memo");
- end;
- // Create Lines
- TempPrepmtInvLineBuffer.DeleteAll();
- CalcVATAmountLines(PurchHeader, PurchLine, TempVATAmountLine, DocumentType);
- TempVATAmountLine.DeductVATAmountLine(TempVATAmountLineDeduct);
- UpdateVATOnLines(PurchHeader, PurchLine, TempVATAmountLine, DocumentType);
- BuildInvLineBuffer(PurchHeader, PurchLine, DocumentType, TempPrepmtInvLineBuffer, true);
-
- CreateLinesFromBuffer(PurchHeader, PurchInvHeader, PurchCrMemoHeader, TempPrepmtInvLineBuffer, Window,
- PostedDocTabNo, GenJnlLineDocNo, DocumentType, LineNo);
-
- if PurchHeader."Compress Prepayment" then
- case DocumentType of
- DocumentType::Invoice:
- CopyLineCommentLinesCompressedPrepayment(PurchHeader."No.", Database::"Purch. Inv. Header", PurchInvHeader."No.");
- DocumentType::"Credit Memo":
- CopyLineCommentLinesCompressedPrepayment(PurchHeader."No.", Database::"Purch. Cr. Memo Hdr.", PurchCrMemoHeader."No.");
- end;
-
- OnAfterCreateLinesOnBeforeGLPosting(PurchHeader, PurchInvHeader, PurchCrMemoHeader, TempPrepmtInvLineBuffer, DocumentType, LineNo);
- // G/L Posting
- LineCount := 0;
- if not PurchHeader."Compress Prepayment" then
- TempPrepmtInvLineBuffer.CompressBuffer();
- TempPrepmtInvLineBuffer.SetRange(Adjustment, false);
- TempPrepmtInvLineBuffer.FindSet(true);
- repeat
- if DocumentType = DocumentType::"Credit Memo" then
- TempPrepmtInvLineBuffer.ReverseAmounts();
- RoundAmounts(PurchHeader, TempPrepmtInvLineBuffer, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY);
- if PurchHeader."Currency Code" = '' then begin
- AdjustInvLineBuffers(PurchHeader, TempPrepmtInvLineBuffer, TotalPrepmtInvLineBuffer, DocumentType);
- TotalPrepmtInvLineBufferLCY := TotalPrepmtInvLineBuffer;
- end else
- AdjustInvLineBuffers(PurchHeader, TempPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY, DocumentType);
- TempPrepmtInvLineBuffer.Modify();
- until TempPrepmtInvLineBuffer.Next() = 0;
-
- TempPrepmtInvLineBuffer.Reset();
- TempPrepmtInvLineBuffer.SetCurrentKey(Adjustment);
- TempPrepmtInvLineBuffer.Find('+');
- repeat
- LineCount := LineCount + 1;
- Window.Update(3, LineCount);
-
- if TempPrepmtInvLineBuffer."VAT Calculation Type" =
- TempPrepmtInvLineBuffer."VAT Calculation Type"::"Reverse Charge VAT"
- then
- TempPrepmtInvLineBuffer.UpdateVATAmounts();
-
- PostPrepmtInvLineBuffer(
- PurchHeader, TempPrepmtInvLineBuffer, DocumentType, PostingDescription,
- GenJnlLineDocType, GenJnlLineDocNo, GenJnlLineExtDocNo, SrcCode, PostingNoSeriesCode);
- until TempPrepmtInvLineBuffer.Next(-1) = 0;
- // Post vendor entry
- Window.Update(4, 1);
- OnCodeOnBeforePostVendorEntry(PurchHeader, TempPrepmtInvLineBuffer);
- PostVendorEntry(
- PurchHeader, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY, DocumentType, PostingDescription,
- GenJnlLineDocType, GenJnlLineDocNo, GenJnlLineExtDocNo, SrcCode, PostingNoSeriesCode, CalcPmtDiscOnCrMemos);
-
- UpdatePostedPurchaseDocument(DocumentType, GenJnlLineDocNo);
-
- PurchaseAssertPrepmtAmountNotMoreThanDocAmount(VendLedgEntry, PurchHeader, PurchLine);
- // Balancing account
- if PurchHeader."Bal. Account No." <> '' then begin
- Window.Update(5, 1);
- OnCodeOnBeforePostBalancingEntry(PurchHeader, TempPrepmtInvLineBuffer);
- PostBalancingEntry(
- PurchHeader, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY, VendLedgEntry, DocumentType,
- GenJnlLineDocType, GenJnlLineDocNo, GenJnlLineExtDocNo, SrcCode, PostingNoSeriesCode);
- end;
- // Update lines & header
- UpdatePurchaseDocument(PurchHeader, PurchLine, DocumentType, GenJnlLineDocNo);
- SetStatusPendingPrepayment(PurchHeader);
- PurchHeader.Modify();
-
- OnCodeOnAfterUpdateHeaderAndLines(PurchHeader, PurchInvHeader, PurchCrMemoHeader, GenJnlPostLine, DocumentType, PreviewMode);
-
- PurchHeader2 := PurchHeader;
-
- if PreviewMode then begin
- Window.Close();
- GenJnlPostPreview.ThrowError();
- end;
-
- OnAfterPostPrepayments(PurchHeader2, DocumentType, SuppressCommit, PurchInvHeader, PurchCrMemoHeader);
- end;
-
- local procedure PurchaseAssertPrepmtAmountNotMoreThanDocAmount(var VendLedgEntry: Record "Vendor Ledger Entry"; PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line")
- var
- PrepaymentMgt: Codeunit "Prepayment Mgt.";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforePurchaseAssertPrepmtAmountNotMoreThanDocAmount(VendLedgEntry, PurchHeader, PurchLine, IsHandled);
- if IsHandled then
- exit;
- VendLedgEntry.FindLast();
- VendLedgEntry.CalcFields(Amount);
- if PurchHeader."Document Type" = PurchHeader."Document Type"::Order then begin
- PurchLine.CalcSums("Amount Including VAT");
- PrepaymentMgt.AssertPrepmtAmountNotMoreThanDocAmount(
- PurchLine."Amount Including VAT", VendLedgEntry.Amount, PurchHeader."Currency Code", PurchSetup."Invoice Rounding");
- end;
- end;
-
- local procedure CreateLinesFromBuffer(var PurchHeader: Record "Purchase Header"; PurchInvHeader: Record "Purch. Inv. Header"; PurchCrMemoHeader: Record "Purch. Cr. Memo Hdr."; var TempPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary; var Window: Dialog; var PostedDocTabNo: Integer; GenJnlLineDocNo: Code[20]; DocumentType: Option Invoice,"Credit Memo"; var LineNo: Integer)
- var
- LineCount: Integer;
- PrevLineNo: Integer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateLinesFromBuffer(PurchHeader, TempPrepmtInvLineBuffer, LineCount, Window, PurchInvHeader, PurchCrMemoHeader, PostedDocTabNo, IsHandled, DocumentType, LineNo);
- if IsHandled then
- exit;
-
- PrevLineNo := 0;
- TempPrepmtInvLineBuffer.Find('-');
- repeat
- LineCount := LineCount + 1;
- Window.Update(2, LineCount);
- LineNo := PrevLineNo + 10000;
- case DocumentType of
- DocumentType::Invoice:
- begin
- InsertPurchInvLine(PurchInvHeader, LineNo, TempPrepmtInvLineBuffer, PurchHeader);
- PostedDocTabNo := Database::"Purch. Inv. Line";
- end;
- DocumentType::"Credit Memo":
- begin
- InsertPurchCrMemoLine(PurchCrMemoHeader, LineNo, TempPrepmtInvLineBuffer, PurchHeader);
- PostedDocTabNo := Database::"Purch. Cr. Memo Line";
- end;
- end;
- PrevLineNo := LineNo;
- InsertExtendedText(
- PostedDocTabNo, GenJnlLineDocNo, TempPrepmtInvLineBuffer."G/L Account No.", PurchHeader."Document Date", PurchHeader."Language Code", PrevLineNo);
- until TempPrepmtInvLineBuffer.Next() = 0;
- end;
-
- local procedure SetStatusPendingPrepayment(var PurchHeader: Record "Purchase Header")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetStatusPendingPrepayment(PurchHeader, IsHandled);
- if IsHandled then
- exit;
-
- if PurchHeader.TestStatusIsNotPendingPrepayment() then
- PurchHeader.Status := PurchHeader.Status::"Pending Prepayment";
- end;
-
- procedure CheckPrepmtDoc(PurchHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo")
- var
- Vend: Record Vendor;
- GenJnlCheckLine: Codeunit "Gen. Jnl.-Check Line";
- CheckDimensions: Codeunit "Check Dimensions";
- ErrorContextElement: Codeunit "Error Context Element";
- ForwardLinkMgt: Codeunit "Forward Link Mgt.";
- SetupRecID: RecordId;
- begin
- OnBeforeCheckPrepmtDoc(PurchHeader, DocumentType);
- PurchHeader.TestField("Document Type", PurchHeader."Document Type"::Order);
- PurchHeader.TestField("Buy-from Vendor No.");
- PurchHeader.TestField("Pay-to Vendor No.");
- PurchHeader.TestField("Posting Date");
- PurchHeader.TestField("Document Date");
- GLSetup.GetRecordOnce();
- if GLSetup."Journal Templ. Name Mandatory" then
- PurchHeader.TestField("Journal Templ. Name");
-
- ErrorMessageMgt.PushContext(ErrorContextElement, PurchHeader.RecordId, 0, '');
- if GenJnlCheckLine.DateNotAllowed(PurchHeader."Posting Date", PurchHeader."Journal Templ. Name") then
- ErrorMessageMgt.LogContextFieldError(
- PurchHeader.FieldNo("Posting Date"), StrSubstNo(PostingDateNotAllowedErr, PurchHeader.FieldCaption("Posting Date")),
- SetupRecID, ErrorMessageMgt.GetFieldNo(SetupRecID.TableNo, ''),
- ForwardLinkMgt.GetHelpCodeForAllowedPostingDate());
-
- if not CheckOpenPrepaymentLines(PurchHeader, DocumentType) then
- Error(DocumentErrorsMgt.GetNothingToPostErrorMsg());
- CheckDimensions.CheckPurchPrepmtDim(PurchHeader);
-
- PurchHeader.CheckPurchasePostRestrictions();
- Vend.Get(PurchHeader."Buy-from Vendor No.");
- Vend.CheckBlockedVendOnDocs(Vend, true);
- if PurchHeader."Pay-to Vendor No." <> PurchHeader."Buy-from Vendor No." then begin
- Vend.Get(PurchHeader."Pay-to Vendor No.");
- Vend.CheckBlockedVendOnDocs(Vend, true);
- end;
- OnAfterCheckPrepmtDoc(PurchHeader, DocumentType, ErrorMessageMgt);
- ErrorMessageMgt.Finish(PurchHeader.RecordId);
- end;
-
- local procedure UpdateDocNos(var PurchHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo"; var DocNo: Code[20]; var NoSeriesCode: Code[20]; var ModifyHeader: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateDocNos(PurchHeader, DocumentType, DocNo, NoSeriesCode, ModifyHeader, PreviewMode, IsHandled);
- if IsHandled then
- exit;
-
- case DocumentType of
- DocumentType::Invoice:
- begin
- PurchHeader.TestField("Prepayment Due Date");
- PurchHeader.TestField("Prepmt. Cr. Memo No.", '');
- if PurchHeader."Prepayment No." = '' then
- if not PreviewMode then
- UpdateInvoiceDocNos(PurchHeader, ModifyHeader)
- else
- PurchHeader."Prepayment No." := '***';
- DocNo := PurchHeader."Prepayment No.";
- NoSeriesCode := PurchHeader."Prepayment No. Series";
- end;
- DocumentType::"Credit Memo":
- begin
- PurchHeader.TestField("Prepayment No.", '');
- if PurchHeader."Prepmt. Cr. Memo No." = '' then
- if not PreviewMode then
- UpdateCrMemoDocNos(PurchHeader, ModifyHeader)
- else
- PurchHeader."Prepmt. Cr. Memo No." := '***';
- DocNo := PurchHeader."Prepmt. Cr. Memo No.";
- NoSeriesCode := PurchHeader."Prepmt. Cr. Memo No. Series";
- end;
- end;
-
- if GLSetup."Journal Templ. Name Mandatory" then
- GenJournalTemplate.Get(PurchHeader."Journal Templ. Name");
- end;
-
- local procedure UpdateInvoiceDocNos(var PurchHeader: Record "Purchase Header"; var ModifyHeader: Boolean)
- var
- PurchasesPayablesSetup: Record "Purchases & Payables Setup";
- ErrorContextElement: Codeunit "Error Context Element";
- NoSeries: Codeunit "No. Series";
- begin
- if GLSetup."Journal Templ. Name Mandatory" then begin
- PurchasesPayablesSetup.Get();
- PurchasesPayablesSetup.TestField("P. Prep. Inv. Template Name");
- GenJournalTemplate.Get(PurchasesPayablesSetup."P. Prep. Inv. Template Name");
- GenJournalTemplate.TestField("Posting No. Series");
- PurchHeader."Prepayment No." := NoSeries.GetNextNo(GenJournalTemplate."Posting No. Series", PurchHeader."Posting Date");
- ModifyHeader := true;
- end else begin
- if PurchHeader."Prepayment No. Series" = '' then begin
- PurchasesPayablesSetup.Get();
- ErrorMessageMgt.PushContext(ErrorContextElement, PurchasesPayablesSetup.RecordId, 0, '');
- if PurchasesPayablesSetup."Posted Prepmt. Inv. Nos." = '' then
- ErrorMessageMgt.LogContextFieldError(
- PurchasesPayablesSetup.FieldNo("Posted Prepmt. Inv. Nos."), SpecifyInvNoSerieTok,
- PurchasesPayablesSetup.RecordId, PurchasesPayablesSetup.FieldNo("Posted Prepmt. Inv. Nos."), '');
- ErrorMessageMgt.Finish(PurchasesPayablesSetup.RecordId);
- PurchHeader."Prepayment No. Series" := PurchasesPayablesSetup."Posted Prepmt. Inv. Nos.";
- ModifyHeader := true;
- end;
- PurchHeader.TestField("Prepayment No. Series");
- PurchHeader."Prepayment No." := NoSeries.GetNextNo(PurchHeader."Prepayment No. Series", PurchHeader."Posting Date");
- ModifyHeader := true;
- end
- end;
-
- local procedure UpdateCrMemoDocNos(var PurchHeader: Record "Purchase Header"; var ModifyHeader: Boolean)
- var
- PurchasesPayablesSetup: Record "Purchases & Payables Setup";
- ErrorContextElement: Codeunit "Error Context Element";
- NoSeries: Codeunit "No. Series";
- begin
- OnBeforeUpdateCrMemoDocNos(PurchHeader);
- if GLSetup."Journal Templ. Name Mandatory" then begin
- PurchasesPayablesSetup.Get();
- PurchasesPayablesSetup.TestField("P. Prep. Cr.Memo Template Name");
- GenJournalTemplate.Get(PurchasesPayablesSetup."P. Prep. Cr.Memo Template Name");
- GenJournalTemplate.TestField("Posting No. Series");
- PurchHeader."Prepmt. Cr. Memo No." :=
- NoSeries.GetNextNo(GenJournalTemplate."Posting No. Series", PurchHeader."Posting Date");
- ModifyHeader := true;
- end else begin
- if PurchHeader."Prepmt. Cr. Memo No. Series" = '' then begin
- PurchasesPayablesSetup.Get();
- ErrorMessageMgt.PushContext(ErrorContextElement, PurchasesPayablesSetup.RecordId, 0, '');
- if PurchasesPayablesSetup."Posted Prepmt. Cr. Memo Nos." = '' then
- ErrorMessageMgt.LogContextFieldError(
- PurchasesPayablesSetup.FieldNo("Posted Prepmt. Cr. Memo Nos."), SpecifyCrNoSerieTok,
- PurchasesPayablesSetup.RecordId, PurchasesPayablesSetup.FieldNo("Posted Prepmt. Cr. Memo Nos."), '');
- ErrorMessageMgt.Finish(PurchasesPayablesSetup.RecordId);
- PurchHeader."Prepmt. Cr. Memo No. Series" := PurchasesPayablesSetup."Posted Prepmt. Cr. Memo Nos.";
- ModifyHeader := true;
- end;
- PurchHeader.TestField("Prepmt. Cr. Memo No. Series");
- PurchHeader."Prepmt. Cr. Memo No." :=
- NoSeries.GetNextNo(PurchHeader."Prepmt. Cr. Memo No. Series", PurchHeader."Posting Date");
- ModifyHeader := true;
- end;
- OnAfterUpdateCrMemoDocNos(PurchHeader);
- end;
-
- procedure CheckOpenPrepaymentLines(PurchHeader: Record "Purchase Header"; DocumentType: Option) Found: Boolean
- var
- PurchLine: Record "Purchase Line";
- begin
- OnBeforeCheckOpenPrepaymentLines(PurchHeader, DocumentType);
-
- ApplyFilter(PurchHeader, DocumentType, PurchLine);
- if PurchLine.Find('-') then
- repeat
- if not Found then
- Found := PrepmtAmount(PurchLine, DocumentType) <> 0;
- if PurchLine."Prepmt. Amt. Inv." = 0 then begin
- PurchLine.UpdatePrepmtSetupFields();
- PurchLine.Modify();
- end;
- until PurchLine.Next() = 0;
-
- OnAfterCheckOpenPrepaymentLines(PurchHeader, DocumentType, Found);
- exit(Found);
- end;
-
- local procedure RoundAmounts(PurchHeader: Record "Purchase Header"; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBufLCY: Record "Prepayment Inv. Line Buffer")
- var
- VAT: Boolean;
- begin
- TotalPrepmtInvLineBuf.IncrAmounts(PrepmtInvLineBuf);
-
- if PurchHeader."Currency Code" <> '' then begin
- VAT := PrepmtInvLineBuf.Amount <> PrepmtInvLineBuf."Amount Incl. VAT";
- PrepmtInvLineBuf."Amount Incl. VAT" :=
- AmountToLCY(PurchHeader, TotalPrepmtInvLineBuf."Amount Incl. VAT", TotalPrepmtInvLineBufLCY."Amount Incl. VAT");
- if VAT then
- PrepmtInvLineBuf.Amount := AmountToLCY(PurchHeader, TotalPrepmtInvLineBuf.Amount, TotalPrepmtInvLineBufLCY.Amount)
- else
- PrepmtInvLineBuf.Amount := PrepmtInvLineBuf."Amount Incl. VAT";
- PrepmtInvLineBuf."VAT Amount" := PrepmtInvLineBuf."Amount Incl. VAT" - PrepmtInvLineBuf.Amount;
- if PrepmtInvLineBuf."VAT Base Amount" <> 0 then
- PrepmtInvLineBuf."VAT Base Amount" := PrepmtInvLineBuf.Amount;
- PrepmtInvLineBuf."Orig. Pmt. Disc. Possible" :=
- AmountToLCY(
- PurchHeader, TotalPrepmtInvLineBuf."Orig. Pmt. Disc. Possible", TotalPrepmtInvLineBufLCY."Orig. Pmt. Disc. Possible");
- end;
-
- OnRoundAmountsOnBeforeIncrAmoutns(PurchHeader, PrepmtInvLineBuf, TotalPrepmtInvLineBuf, TotalPrepmtInvLineBufLCY);
- TotalPrepmtInvLineBufLCY.IncrAmounts(PrepmtInvLineBuf);
-
- OnAfterRoundAmounts(PurchHeader, PrepmtInvLineBuf, TotalPrepmtInvLineBuf, TotalPrepmtInvLineBufLCY);
- end;
-
- local procedure AmountToLCY(PurchHeader: Record "Purchase Header"; TotalAmt: Decimal; PrevTotalAmt: Decimal): Decimal
- var
- CurrExchRate: Record "Currency Exchange Rate";
- begin
- CurrExchRate.Init();
- exit(
- Round(
- CurrExchRate.ExchangeAmtFCYToLCY(PurchHeader."Posting Date", PurchHeader."Currency Code", TotalAmt, PurchHeader."Currency Factor")) -
- PrevTotalAmt);
- end;
-
- local procedure AdjustInvLineBuffers(PurchHeader: Record "Purchase Header"; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; DocumentType: Option Invoice,"Credit Memo")
- var
- VATAdjustment: array[2] of Decimal;
- VAT: Option ,Base,Amount;
- begin
- CalcPrepmtAmtInvLCYInLines(PurchHeader, PrepmtInvLineBuf, DocumentType, VATAdjustment);
- if Abs(VATAdjustment[VAT::Base]) > GLSetup."Amount Rounding Precision" then
- InsertCorrInvLineBuffer(PrepmtInvLineBuf, PurchHeader, VATAdjustment[VAT::Base])
- else
- if (VATAdjustment[VAT::Base] <> 0) or (VATAdjustment[VAT::Amount] <> 0) then begin
- PrepmtInvLineBuf.AdjustVATBase(VATAdjustment);
- TotalPrepmtInvLineBuf.AdjustVATBase(VATAdjustment);
- end;
- end;
-
- local procedure CalcPrepmtAmtInvLCYInLines(PurchHeader: Record "Purchase Header"; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; DocumentType: Option Invoice,"Credit Memo"; var VATAdjustment: array[2] of Decimal)
- var
- PurchLine: Record "Purchase Line";
- PrepmtInvBufAmount: array[2] of Decimal;
- TotalAmount: array[2] of Decimal;
- LineAmount: array[2] of Decimal;
- Ratio: array[2] of Decimal;
- PrepmtAmtReminder: array[2] of Decimal;
- PrepmtAmountRnded: array[2] of Decimal;
- VAT: Option ,Base,Amount;
- begin
- PrepmtInvLineBuf.AmountsToArray(PrepmtInvBufAmount);
- if DocumentType = DocumentType::"Credit Memo" then
- ReverseDecArray(PrepmtInvBufAmount);
-
- TempGlobalPrepmtInvLineBuf.SetFilterOnPKey(PrepmtInvLineBuf);
- TempGlobalPrepmtInvLineBuf.CalcSums(Amount, "Amount Incl. VAT");
- TempGlobalPrepmtInvLineBuf.AmountsToArray(TotalAmount);
- for VAT := VAT::Base to VAT::Amount do
- if TotalAmount[VAT] = 0 then
- Ratio[VAT] := 0
- else
- Ratio[VAT] := PrepmtInvBufAmount[VAT] / TotalAmount[VAT];
- if TempGlobalPrepmtInvLineBuf.FindSet() then
- repeat
- TempGlobalPrepmtInvLineBuf.AmountsToArray(LineAmount);
- PrepmtAmountRnded[VAT::Base] :=
- CalcRoundedAmount(LineAmount[VAT::Base], Ratio[VAT::Base], PrepmtAmtReminder[VAT::Base]);
- PrepmtAmountRnded[VAT::Amount] :=
- CalcRoundedAmount(LineAmount[VAT::Amount], Ratio[VAT::Amount], PrepmtAmtReminder[VAT::Amount]);
-
- PurchLine.Get(PurchHeader."Document Type", PurchHeader."No.", TempGlobalPrepmtInvLineBuf."Line No.");
- if DocumentType = DocumentType::"Credit Memo" then begin
- VATAdjustment[VAT::Base] += PurchLine."Prepmt. Amount Inv. (LCY)" - PrepmtAmountRnded[VAT::Base];
- PurchLine."Prepmt. Amount Inv. (LCY)" := 0;
- VATAdjustment[VAT::Amount] += PurchLine."Prepmt. VAT Amount Inv. (LCY)" - PrepmtAmountRnded[VAT::Amount];
- PurchLine."Prepmt. VAT Amount Inv. (LCY)" := 0;
- end else begin
- PurchLine."Prepmt. Amount Inv. (LCY)" += PrepmtAmountRnded[VAT::Base];
- PurchLine."Prepmt. VAT Amount Inv. (LCY)" += PrepmtAmountRnded[VAT::Amount];
- end;
- PurchLine.Modify();
- until TempGlobalPrepmtInvLineBuf.Next() = 0;
- TempGlobalPrepmtInvLineBuf.DeleteAll();
- ReverseDecArray(VATAdjustment);
- end;
-
- local procedure CalcRoundedAmount(LineAmount: Decimal; Ratio: Decimal; var Reminder: Decimal) RoundedAmount: Decimal
- var
- Amount: Decimal;
- begin
- Amount := Reminder + LineAmount * Ratio;
- RoundedAmount := Round(Amount);
- Reminder := Amount - RoundedAmount;
- end;
-
- local procedure ReverseDecArray(var DecArray: array[2] of Decimal)
- var
- Idx: Integer;
- begin
- for Idx := 1 to ArrayLen(DecArray) do
- DecArray[Idx] := -DecArray[Idx];
- end;
-
- local procedure InsertCorrInvLineBuffer(var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; PurchHeader: Record "Purchase Header"; VATBaseAdjustment: Decimal)
- var
- NewPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer";
- SavedPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer";
- AdjmtAmountACY: Decimal;
- begin
- SavedPrepmtInvLineBuf := PrepmtInvLineBuf;
-
- if PurchHeader."Currency Code" = '' then
- AdjmtAmountACY := VATBaseAdjustment
- else
- AdjmtAmountACY := 0;
-
- NewPrepmtInvLineBuf.FillAdjInvLineBuffer(
- PrepmtInvLineBuf,
- GetPrepmtAccNo(PrepmtInvLineBuf."Gen. Bus. Posting Group", PrepmtInvLineBuf."Gen. Prod. Posting Group"),
- VATBaseAdjustment, AdjmtAmountACY);
- PrepmtInvLineBuf.InsertInvLineBuffer(NewPrepmtInvLineBuf);
-
- NewPrepmtInvLineBuf.FillAdjInvLineBuffer(
- PrepmtInvLineBuf,
- GetCorrBalAccNo(PurchHeader, VATBaseAdjustment > 0),
- -VATBaseAdjustment, -AdjmtAmountACY);
- PrepmtInvLineBuf.InsertInvLineBuffer(NewPrepmtInvLineBuf);
-
- PrepmtInvLineBuf := SavedPrepmtInvLineBuf;
- end;
-
- local procedure GetPrepmtAccNo(GenBusPostingGroup: Code[20]; GenProdPostingGroup: Code[20]) PrepmtAccNo: Code[20]
- begin
- if (GenBusPostingGroup <> GenPostingSetup."Gen. Bus. Posting Group") or
- (GenProdPostingGroup <> GenPostingSetup."Gen. Prod. Posting Group")
- then
- GenPostingSetup.Get(GenBusPostingGroup, GenProdPostingGroup);
- PrepmtAccNo := GenPostingSetup.GetPurchPrepmtAccount();
- OnAfterGetPrepmtAccNo(GenPostingSetup, PrepmtAccNo);
- exit(PrepmtAccNo);
- end;
-
- procedure GetCorrBalAccNo(PurchHeader: Record "Purchase Header"; PositiveAmount: Boolean): Code[20]
- var
- BalAccNo: Code[20];
- begin
- if PurchHeader."Currency Code" = '' then
- BalAccNo := GetInvRoundingAccNo(PurchHeader."Vendor Posting Group")
- else
- BalAccNo := GetGainLossGLAcc(PurchHeader."Currency Code", PositiveAmount);
- exit(BalAccNo);
- end;
-
- procedure GetInvRoundingAccNo(VendorPostingGroup: Code[20]): Code[20]
- var
- VendPostingGr: Record "Vendor Posting Group";
- GLAcc: Record "G/L Account";
- begin
- VendPostingGr.Get(VendorPostingGroup);
- GLAcc.Get(VendPostingGr.GetInvRoundingAccount());
- exit(VendPostingGr."Invoice Rounding Account");
- end;
-
- local procedure GetGainLossGLAcc(CurrencyCode: Code[10]; PositiveAmount: Boolean): Code[20]
- var
- Currency: Record Currency;
- begin
- Currency.Get(CurrencyCode);
- if PositiveAmount then
- exit(Currency.GetRealizedGainsAccount());
- exit(Currency.GetRealizedLossesAccount());
- end;
-
- local procedure GetCurrencyAmountRoundingPrecision(CurrencyCode: Code[10]): Decimal
- var
- Currency: Record Currency;
- begin
- Currency.Initialize(CurrencyCode);
- Currency.TestField("Amount Rounding Precision");
- exit(Currency."Amount Rounding Precision");
- end;
-
- procedure UpdateVATOnLines(PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line"; DocumentType: Option Invoice,"Credit Memo",Statistic)
- var
- TempVATAmountLineRemainder: Record "VAT Amount Line" temporary;
- Currency: Record Currency;
- PrepmtAmt: Decimal;
- NewAmount: Decimal;
- NewAmountIncludingVAT: Decimal;
- NewVATBaseAmount: Decimal;
- NewPmtDiscAmount: Decimal;
- VATAmount: Decimal;
- VATDifference: Decimal;
- PrepmtAmtToInvTotal: Decimal;
- RemainderExists: Boolean;
- begin
- Currency.Initialize(PurchHeader."Currency Code");
-
- ApplyFilter(PurchHeader, DocumentType, PurchLine);
- PurchLine.LockTable();
- PurchLine.CalcSums("Prepmt. Line Amount", "Prepmt. Amt. Inv.");
- PrepmtAmtToInvTotal := PurchLine."Prepmt. Line Amount" - PurchLine."Prepmt. Amt. Inv.";
- if PurchLine.Find('-') then
- repeat
- PrepmtAmt := PrepmtAmount(PurchLine, DocumentType);
- if PrepmtAmt <> 0 then begin
- FindVATAmountLine(PurchLine, VATAmountLine, PrepmtAmt);
- OnUpdateVATOnLinesOnAfterVATAmountLineGet(VATAmountLine);
- if VATAmountLine.Modified then begin
- RemainderExists :=
- FindVATAmountLine(PurchLine, TempVATAmountLineRemainder, PrepmtAmt);
- OnUpdateVATOnLinesOnAfterGetRemainder(TempVATAmountLineRemainder, RemainderExists);
- if not RemainderExists then begin
- TempVATAmountLineRemainder := VATAmountLine;
- TempVATAmountLineRemainder.Init();
- TempVATAmountLineRemainder.Insert();
- end;
-
- if PurchHeader."Prices Including VAT" then begin
- if PrepmtAmt = 0 then begin
- VATAmount := 0;
- NewAmountIncludingVAT := 0;
- end else begin
- VATAmount :=
- TempVATAmountLineRemainder."VAT Amount" +
- VATAmountLine."VAT Amount" * PrepmtAmt / VATAmountLine."Line Amount";
- NewAmountIncludingVAT :=
- TempVATAmountLineRemainder."Amount Including VAT" +
- VATAmountLine."Amount Including VAT" * PrepmtAmt / VATAmountLine."Line Amount";
- end;
- NewAmount :=
- Round(NewAmountIncludingVAT, Currency."Amount Rounding Precision") -
- Round(VATAmount, Currency."Amount Rounding Precision");
- NewVATBaseAmount :=
- Round(
- NewAmount * (1 - PurchHeader."VAT Base Discount %" / 100),
- Currency."Amount Rounding Precision");
- end else begin
- if PurchLine."VAT Calculation Type" = PurchLine."VAT Calculation Type"::"Full VAT" then begin
- VATAmount := PrepmtAmt;
- NewAmount := 0;
- NewVATBaseAmount := 0;
- end else begin
- NewAmount := PrepmtAmt;
- NewVATBaseAmount :=
- Round(
- NewAmount * (1 - PurchHeader."VAT Base Discount %" / 100),
- Currency."Amount Rounding Precision");
- if VATAmountLine."VAT Base" = 0 then
- VATAmount := 0
- else
- VATAmount :=
- TempVATAmountLineRemainder."VAT Amount" +
- VATAmountLine."VAT Amount" * NewAmount / VATAmountLine."VAT Base";
- end;
- NewAmountIncludingVAT := NewAmount + Round(VATAmount, Currency."Amount Rounding Precision");
- end;
-
- PurchLine."Prepayment Amount" := NewAmount;
- PurchLine."Prepmt. Amt. Incl. VAT" :=
- Round(NewAmountIncludingVAT, Currency."Amount Rounding Precision");
- PurchLine."Prepmt. VAT Base Amt." := NewVATBaseAmount;
-
- if (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount") = 0 then
- VATDifference := 0
- else begin
- if PrepmtAmtToInvTotal = 0 then
- VATDifference :=
- VATAmountLine."VAT Difference" * (PurchLine."Prepmt. Line Amount" - PurchLine."Prepmt. Amt. Inv.") /
- (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount")
- else
- VATDifference :=
- VATAmountLine."VAT Difference" * (PurchLine."Prepmt. Line Amount" - PurchLine."Prepmt. Amt. Inv.") /
- PrepmtAmtToInvTotal;
- NewPmtDiscAmount :=
- TempVATAmountLineRemainder."Pmt. Discount Amount" +
- NewAmount * PurchHeader."Payment Discount %" / 100;
- end;
- PurchLine."Prepayment VAT Difference" := Round(VATDifference, Currency."Amount Rounding Precision");
- PurchLine."Prepmt. Pmt. Discount Amount" := Round(NewPmtDiscAmount, Currency."Amount Rounding Precision");
-
- OnUpdateVATOnLinesOnBeforePurchLineModify(PurchHeader, PurchLine, TempVATAmountLineRemainder, NewAmount, NewAmountIncludingVAT, NewVATBaseAmount);
- PurchLine.Modify();
-
- TempVATAmountLineRemainder."Amount Including VAT" :=
- NewAmountIncludingVAT - Round(NewAmountIncludingVAT, Currency."Amount Rounding Precision");
- TempVATAmountLineRemainder."VAT Amount" := VATAmount - NewAmountIncludingVAT + NewAmount;
- TempVATAmountLineRemainder."VAT Difference" := VATDifference - PurchLine."Prepayment VAT Difference";
- TempVATAmountLineRemainder."Pmt. Discount Amount" := NewPmtDiscAmount - Round(NewPmtDiscAmount);
- TempVATAmountLineRemainder.Modify();
- end;
- end;
- until PurchLine.Next() = 0;
- VATAmountLine.Reset();
-
- OnAfterUpdateVATOnLines(PurchHeader, PurchLine, VATAmountLine, DocumentType);
- end;
-
- procedure CalcVATAmountLines(var PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line"; DocumentType: Option Invoice,"Credit Memo",Statistic)
- var
- Currency: Record Currency;
- NewAmount: Decimal;
- NewPrepmtVATDiffAmt: Decimal;
- begin
- Currency.Initialize(PurchHeader."Currency Code");
-
- VATAmountLine.DeleteAll();
-
- ApplyFilter(PurchHeader, DocumentType, PurchLine);
- if PurchLine.Find('-') then
- repeat
- NewAmount := PrepmtAmount(PurchLine, DocumentType);
- if NewAmount <> 0 then begin
- if DocumentType = DocumentType::Invoice then
- NewAmount := PurchLine."Prepmt. Line Amount";
- if PurchLine."Prepmt. VAT Calc. Type" in
- [PurchLine."VAT Calculation Type"::"Reverse Charge VAT", PurchLine."VAT Calculation Type"::"Sales Tax"]
- then
- PurchLine."VAT %" := 0;
-
- if not FindVATAmountLine(PurchLine, VATAmountLine, NewAmount) then
- InsertVATAmountLine(PurchLine, VATAmountLine, NewAmount);
-
- VATAmountLine."Line Amount" := VATAmountLine."Line Amount" + NewAmount;
- NewPrepmtVATDiffAmt := PrepmtVATDiffAmount(PurchLine, DocumentType);
- if DocumentType = DocumentType::Invoice then
- NewPrepmtVATDiffAmt := PurchLine."Prepayment VAT Difference" + PurchLine."Prepmt VAT Diff. to Deduct" +
- PurchLine."Prepmt VAT Diff. Deducted";
- VATAmountLine."VAT Difference" := VATAmountLine."VAT Difference" + NewPrepmtVATDiffAmt;
- VATAmountLine.Modify();
- end;
- until PurchLine.Next() = 0;
- VATAmountLine.Reset();
-
- VATAmountLine.UpdateLines(
- NewAmount, Currency, PurchHeader."Currency Factor", PurchHeader."Prices Including VAT",
- PurchHeader."VAT Base Discount %", PurchHeader."Tax Area Code", PurchHeader."Tax Liable", PurchHeader."Posting Date");
-
- OnAfterCalcVATAmountLines(PurchHeader, PurchLine, VATAmountLine, DocumentType);
- end;
-
- local procedure FindVATAmountLine(var PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line" temporary; LineAmount: Decimal): Boolean
- begin
- VATAmountLine.Reset();
- VATAmountLine.SetRange("VAT Identifier", PurchaseLine."Prepayment VAT Identifier");
- VATAmountLine.SetRange("VAT Calculation Type", PurchaseLine."Prepmt. VAT Calc. Type");
- VATAmountLine.SetRange("Tax Group Code", PurchaseLine."Prepayment Tax Group Code");
- VATAmountLine.SetRange("Use Tax", false);
- VATAmountLine.SetRange(Positive, LineAmount >= 0);
- OnFindVATAmountLineOnAfterSetFilters(PurchaseLine, VATAmountLine);
- exit(VATAmountLine.FindFirst());
- end;
-
- local procedure InsertVATAmountLine(var PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line"; LineAmount: Decimal)
- begin
- VATAmountLine.Init();
- VATAmountLine."VAT Identifier" := PurchaseLine."Prepayment VAT Identifier";
- VATAmountLine."VAT Calculation Type" := PurchaseLine."Prepmt. VAT Calc. Type";
- VATAmountLine."Tax Group Code" := PurchaseLine."Prepayment Tax Group Code";
- VATAmountLine."VAT %" := PurchaseLine."Prepayment VAT %";
- VATAmountLine.Positive := LineAmount >= 0;
- VATAmountLine.Modified := true;
- VATAmountLine."Includes Prepayment" := true;
- OnInsertVATAmountOnBeforeInsert(PurchaseLine, VATAmountLine);
- VATAmountLine.Insert();
- end;
-
- procedure SumPrepmt(PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line"; var TotalAmount: Decimal; var TotalVATAmount: Decimal; var VATAmountText: Text[30])
- var
- TempPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer" temporary;
- TotalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer";
- TotalPrepmtInvLineBufLCY: Record "Prepayment Inv. Line Buffer";
- DifVATPct: Boolean;
- PrevVATPct: Decimal;
- begin
- CalcVATAmountLines(PurchHeader, PurchLine, VATAmountLine, 2);
- UpdateVATOnLines(PurchHeader, PurchLine, VATAmountLine, 2);
- BuildInvLineBuffer(PurchHeader, PurchLine, 2, TempPrepmtInvLineBuf, false);
- if TempPrepmtInvLineBuf.Find('-') then begin
- PrevVATPct := TempPrepmtInvLineBuf.GetVATPct();
- repeat
- RoundAmounts(PurchHeader, TempPrepmtInvLineBuf, TotalPrepmtInvLineBuf, TotalPrepmtInvLineBufLCY);
- if TempPrepmtInvLineBuf.GetVATPct() <> PrevVATPct then
- DifVATPct := true;
- until TempPrepmtInvLineBuf.Next() = 0;
- end;
- TotalAmount := TotalPrepmtInvLineBuf.Amount;
- TotalVATAmount := TotalPrepmtInvLineBuf."VAT Amount";
- if DifVATPct or (TempPrepmtInvLineBuf."VAT %" = 0) then
- VATAmountText := Text014
- else
- VATAmountText := StrSubstNo(Text015, PrevVATPct);
- end;
-
- procedure GetPurchLines(PurchHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo",Statistic; var ToPurchLine: Record "Purchase Line")
- var
- FromPurchLine: Record "Purchase Line";
- InvRoundingPurchLine: Record "Purchase Line";
- TempVATAmountLine: Record "VAT Amount Line" temporary;
- TotalAmt: Decimal;
- NextLineNo: Integer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetPurchLines(PurchHeader, DocumentType, ToPurchLine, IsHandled);
- if IsHandled then
- exit;
-
- ApplyFilter(PurchHeader, DocumentType, FromPurchLine);
- if FromPurchLine.Find('-') then begin
- repeat
- ToPurchLine := FromPurchLine;
- ToPurchLine.Insert();
- until FromPurchLine.Next() = 0;
-
- PurchSetup.Get();
- if PurchSetup."Invoice Rounding" then begin
- CalcVATAmountLines(PurchHeader, ToPurchLine, TempVATAmountLine, 2);
- UpdateVATOnLines(PurchHeader, ToPurchLine, TempVATAmountLine, 2);
- ToPurchLine.CalcSums("Prepmt. Amt. Incl. VAT");
- TotalAmt := ToPurchLine."Prepmt. Amt. Incl. VAT";
- ToPurchLine.FindLast();
- if InitInvoiceRoundingLine(PurchHeader, TotalAmt, InvRoundingPurchLine) then begin
- NextLineNo := ToPurchLine."Line No." + 1;
- ToPurchLine := InvRoundingPurchLine;
- ToPurchLine."Line No." := NextLineNo;
-
- if DocumentType <> DocumentType::"Credit Memo" then
- ToPurchLine."Prepmt. Line Amount" := ToPurchLine."Line Amount"
- else
- ToPurchLine."Prepmt. Amt. Inv." := ToPurchLine."Line Amount";
- ToPurchLine."Prepmt. VAT Calc. Type" := ToPurchLine."VAT Calculation Type";
- ToPurchLine."Prepayment VAT Identifier" := ToPurchLine."VAT Identifier";
- ToPurchLine."Prepayment Tax Group Code" := ToPurchLine."Tax Group Code";
- ToPurchLine."Prepayment VAT Identifier" := ToPurchLine."VAT Identifier";
- ToPurchLine."Prepayment Tax Group Code" := ToPurchLine."Tax Group Code";
- ToPurchLine."Prepayment VAT %" := ToPurchLine."VAT %";
- ToPurchLine.Insert();
- end;
- end;
- end;
- end;
-
- local procedure BuildInvLineBuffer(PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; DocumentType: Option; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; UpdateLines: Boolean)
- var
- PrepmtInvLineBuf2: Record "Prepayment Inv. Line Buffer";
- TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer";
- TotalPrepmtInvLineBufferDummy: Record "Prepayment Inv. Line Buffer";
- begin
- TempGlobalPrepmtInvLineBuf.Reset();
- TempGlobalPrepmtInvLineBuf.DeleteAll();
- TempPurchaseLine.Reset();
- TempPurchaseLine.DeleteAll();
- PurchSetup.Get();
- ApplyFilter(PurchHeader, DocumentType, PurchLine);
- if PurchLine.Find('-') then
- repeat
- if PrepmtAmount(PurchLine, DocumentType) <> 0 then begin
- FillInvLineBuffer(PurchHeader, PurchLine, PrepmtInvLineBuf2);
- if UpdateLines then
- TempGlobalPrepmtInvLineBuf.CopyWithLineNo(PrepmtInvLineBuf2, PurchLine."Line No.");
- PrepmtInvLineBuf.InsertInvLineBuffer(PrepmtInvLineBuf2);
- if PurchSetup."Invoice Rounding" then
- RoundAmounts(
- PurchHeader, PrepmtInvLineBuf2, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferDummy);
- TempPurchaseLine := PurchLine;
- TempPurchaseLine.Insert();
- end
- else
- OnBuildInvLineBufferOnPrepmtAmountZero(PurchHeader, PurchLine, PrepmtInvLineBuf2, PrepmtInvLineBuf, TempPurchaseLine);
- until PurchLine.Next() = 0;
- if PurchSetup."Invoice Rounding" then
- if InsertInvoiceRounding(
- PurchHeader, PrepmtInvLineBuf2, TotalPrepmtInvLineBuffer, PurchLine."Line No.")
- then
- PrepmtInvLineBuf.InsertInvLineBuffer(PrepmtInvLineBuf2);
- ErrorMessageMgt.FinishTopContext();
- end;
-
- procedure BuildInvLineBuffer(PurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; DocumentType: Option Invoice,"Credit Memo",Statistic; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer")
- begin
- BuildInvLineBuffer(PurchHeader, PurchLine, DocumentType, PrepmtInvLineBuf, false);
- end;
-
- procedure FillInvLineBuffer(PurchHeader: Record "Purchase Header"; PurchLine: Record "Purchase Line"; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer")
- begin
- PrepmtInvLineBuf.Init();
- OnFillInvLineBufferOnAfterInit(PrepmtInvLineBuf, PurchHeader, PurchLine);
-
- PrepmtInvLineBuf."G/L Account No." := GetPrepmtAccNo(PurchLine."Gen. Bus. Posting Group", PurchLine."Gen. Prod. Posting Group");
-
- if not PurchHeader."Compress Prepayment" then begin
- PrepmtInvLineBuf."Line No." := PurchLine."Line No.";
- PrepmtInvLineBuf.Description := PurchLine.Description;
- end;
-
- PrepmtInvLineBuf.CopyFromPurchLine(PurchLine);
- PrepmtInvLineBuf.FillFromGLAcc(PurchHeader."Compress Prepayment");
-
- PrepmtInvLineBuf.SetAmounts(
- PurchLine."Prepayment Amount", PurchLine."Prepmt. Amt. Incl. VAT", PurchLine."Prepayment Amount",
- PurchLine."Prepayment Amount", PurchLine."Prepayment Amount", PurchLine."Prepayment VAT Difference");
-
- PrepmtInvLineBuf."VAT Amount" := PurchLine."Prepmt. Amt. Incl. VAT" - PurchLine."Prepayment Amount";
- PrepmtInvLineBuf."VAT Amount (ACY)" := PurchLine."Prepmt. Amt. Incl. VAT" - PurchLine."Prepayment Amount";
- PrepmtInvLineBuf."VAT Base Before Pmt. Disc." := PurchLine."Prepayment Amount";
- PrepmtInvLineBuf."Orig. Pmt. Disc. Possible" := PurchLine."Prepmt. Pmt. Discount Amount";
- PrepmtInvLineBuf."Location Code" := PurchLine."Location Code";
-
- OnAfterFillInvLineBuffer(PrepmtInvLineBuf, PurchLine, SuppressCommit, PurchHeader);
- end;
-
- local procedure InsertInvoiceRounding(PurchHeader: Record "Purchase Header"; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; PrevLineNo: Integer): Boolean
- var
- PurchLine: Record "Purchase Line";
- begin
- if InitInvoiceRoundingLine(PurchHeader, TotalPrepmtInvLineBuf."Amount Incl. VAT", PurchLine) then begin
- CreateDimensions(PurchLine);
- PrepmtInvLineBuf.Init();
- PrepmtInvLineBuf."Line No." := PrevLineNo + 10000;
- PrepmtInvLineBuf."Invoice Rounding" := true;
- PrepmtInvLineBuf."G/L Account No." := PurchLine."No.";
- PrepmtInvLineBuf.Description := PurchLine.Description;
-
- PrepmtInvLineBuf.CopyFromPurchLine(PurchLine);
-
- PrepmtInvLineBuf.SetAmounts(
- PurchLine."Line Amount", PurchLine."Amount Including VAT", PurchLine."Line Amount",
- PurchLine."Prepayment Amount", PurchLine."Line Amount", 0);
-
- PrepmtInvLineBuf."VAT Amount" := PurchLine."Amount Including VAT" - PurchLine."Line Amount";
- PrepmtInvLineBuf."VAT Amount (ACY)" := PurchLine."Amount Including VAT" - PurchLine."Line Amount";
- exit(true);
- end;
-
- OnAfterInsertInvoiceRounding(PurchHeader, PrepmtInvLineBuf, TotalPrepmtInvLineBuf, PrevLineNo);
- end;
-
- local procedure InitInvoiceRoundingLine(PurchHeader: Record "Purchase Header"; TotalAmount: Decimal; var PurchLine: Record "Purchase Line"): Boolean
- var
- Currency: Record Currency;
- InvoiceRoundingAmount: Decimal;
- begin
- Currency.Initialize(PurchHeader."Currency Code");
- Currency.TestField("Invoice Rounding Precision");
- InvoiceRoundingAmount :=
- -Round(
- TotalAmount -
- Round(
- TotalAmount,
- Currency."Invoice Rounding Precision",
- Currency.InvoiceRoundingDirection()),
- Currency."Amount Rounding Precision");
-
- if InvoiceRoundingAmount = 0 then
- exit(false);
-
- PurchLine."Document Type" := PurchHeader."Document Type";
- PurchLine."Document No." := PurchHeader."No.";
- PurchLine."System-Created Entry" := true;
- PurchLine.Type := PurchLine.Type::"G/L Account";
- PurchLine.Validate("No.", GetInvRoundingAccNo(PurchHeader."Vendor Posting Group"));
- PurchLine.Validate(Quantity, 1);
- if PurchHeader."Prices Including VAT" then
- PurchLine.Validate("Direct Unit Cost", InvoiceRoundingAmount)
- else
- PurchLine.Validate(
- "Direct Unit Cost",
- Round(
- InvoiceRoundingAmount /
- (1 + (1 - PurchHeader."VAT Base Discount %" / 100) * PurchLine."VAT %" / 100),
- Currency."Amount Rounding Precision"));
- PurchLine."Prepayment Amount" := PurchLine."Direct Unit Cost";
- PurchLine.Validate("Amount Including VAT", InvoiceRoundingAmount);
- exit(true);
- end;
-
- local procedure ApplyFilter(PurchHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo",Statistic; var PurchLine: Record "Purchase Line")
- begin
- PurchLine.Reset();
- PurchLine.SetRange("Document Type", PurchHeader."Document Type");
- PurchLine.SetRange("Document No.", PurchHeader."No.");
- PurchLine.SetFilter(Type, '<>%1', PurchLine.Type::" ");
- if DocumentType in [DocumentType::Invoice, DocumentType::Statistic] then
- PurchLine.SetFilter("Prepmt. Line Amount", '<>0')
- else
- PurchLine.SetFilter("Prepmt. Amt. Inv.", '<>0');
-
- OnAfterApplyFilter(PurchLine, PurchHeader, DocumentType);
- end;
-
- procedure PrepmtAmount(PurchLine: Record "Purchase Line"; DocumentType: Option Invoice,"Credit Memo",Statistic): Decimal
- begin
- case DocumentType of
- DocumentType::Statistic:
- exit(PurchLine."Prepmt. Line Amount");
- DocumentType::Invoice:
- exit(PurchLine."Prepmt. Line Amount" - PurchLine."Prepmt. Amt. Inv.");
- else
- exit(PurchLine."Prepmt. Amt. Inv." - PurchLine."Prepmt Amt Deducted");
- end;
- end;
-
- local procedure CopyHeaderCommentLines(FromNumber: Code[20]; ToDocType: Integer; ToNumber: Code[20])
- var
- PurchCommentLine: Record "Purch. Comment Line";
- begin
- if not PurchSetup."Copy Comments Order to Invoice" then
- exit;
-
- case ToDocType of
- Database::"Purch. Inv. Header":
- PurchCommentLine.CopyHeaderComments(
- PurchCommentLine."Document Type"::Order.AsInteger(), PurchCommentLine."Document Type"::"Posted Invoice".AsInteger(), FromNumber, ToNumber);
- Database::"Purch. Cr. Memo Hdr.":
- PurchCommentLine.CopyHeaderComments(
- PurchCommentLine."Document Type"::Order.AsInteger(), PurchCommentLine."Document Type"::"Posted Credit Memo".AsInteger(), FromNumber, ToNumber);
- end;
- end;
-
- local procedure CopyLineCommentLines(FromNumber: Code[20]; ToDocType: Integer; ToNumber: Code[20]; FromLineNo: Integer; ToLineNo: Integer)
- var
- PurchCommentLine: Record "Purch. Comment Line";
- begin
- if not PurchSetup."Copy Comments Order to Invoice" then
- exit;
-
- case ToDocType of
- Database::"Purch. Inv. Header":
- PurchCommentLine.CopyLineComments(
- PurchCommentLine."Document Type"::Order.AsInteger(), PurchCommentLine."Document Type"::"Posted Invoice".AsInteger(), FromNumber, ToNumber, FromLineNo, ToLineNo);
- Database::"Purch. Cr. Memo Hdr.":
- PurchCommentLine.CopyLineComments(
- PurchCommentLine."Document Type"::Order.AsInteger(), PurchCommentLine."Document Type"::"Posted Credit Memo".AsInteger(), FromNumber, ToNumber, FromLineNo, ToLineNo);
- end;
- end;
-
- local procedure CopyLineCommentLinesCompressedPrepayment(FromNumber: Code[20]; ToDocType: Integer; ToNumber: Code[20])
- var
- PurchCommentLine: Record "Purch. Comment Line";
- begin
- if not PurchSetup."Copy Comments Order to Invoice" then
- exit;
-
- case ToDocType of
- Database::"Purch. Inv. Header":
- PurchCommentLine.CopyLineCommentsFromPurchaseLines(
- PurchCommentLine."Document Type"::Order.AsInteger(), PurchCommentLine."Document Type"::"Posted Invoice".AsInteger(), FromNumber, ToNumber, TempPurchaseLine);
- Database::"Purch. Cr. Memo Hdr.":
- PurchCommentLine.CopyLineCommentsFromPurchaseLines(
- PurchCommentLine."Document Type"::Order.AsInteger(), PurchCommentLine."Document Type"::"Posted Credit Memo".AsInteger(), FromNumber, ToNumber, TempPurchaseLine);
- end;
- end;
-
- local procedure InsertExtendedText(TabNo: Integer; DocNo: Code[20]; GLAccNo: Code[20]; DocDate: Date; LanguageCode: Code[10]; var PrevLineNo: Integer)
- var
- TempExtTextLine: Record "Extended Text Line" temporary;
- PurchInvLine: Record "Purch. Inv. Line";
- PurchCrMemoLine: Record "Purch. Cr. Memo Line";
- TransferExtText: Codeunit "Transfer Extended Text";
- NextLineNo: Integer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInsertExtendedText(TabNo, DocNo, GLAccNo, DocDate, LanguageCode, PrevLineNo, IsHandled);
- if IsHandled then
- exit;
-
- TransferExtText.PrepmtGetAnyExtText(GLAccNo, TabNo, DocDate, LanguageCode, TempExtTextLine);
- if TempExtTextLine.Find('-') then begin
- NextLineNo := PrevLineNo + 10000;
- repeat
- case TabNo of
- Database::"Purch. Inv. Line":
- begin
- PurchInvLine.Init();
- PurchInvLine."Document No." := DocNo;
- PurchInvLine."Line No." := NextLineNo;
- PurchInvLine.Description := TempExtTextLine.Text;
- PurchInvLine.Insert();
- end;
- Database::"Purch. Cr. Memo Line":
- begin
- PurchCrMemoLine.Init();
- PurchCrMemoLine."Document No." := DocNo;
- PurchCrMemoLine."Line No." := NextLineNo;
- PurchCrMemoLine.Description := TempExtTextLine.Text;
- PurchCrMemoLine.Insert();
- end;
- end;
- PrevLineNo := NextLineNo;
- NextLineNo := NextLineNo + 10000;
- until TempExtTextLine.Next() = 0;
- end;
- end;
-
- local procedure PostPrepmtInvLineBuffer(PurchHeader: Record "Purchase Header"; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; DocumentType: Option Invoice,"Credit Memo"; PostingDescription: Text[100]; DocType: Enum "Gen. Journal Document Type"; DocNo: Code[20]; ExtDocNo: Text[35]; SrcCode: Code[10]; PostingNoSeriesCode: Code[20])
- var
- GenJnlLine: Record "Gen. Journal Line";
- begin
- GenJnlLine.InitNewLine(
- PurchHeader."Posting Date", PurchHeader."Document Date", PurchHeader."VAT Reporting Date", PostingDescription,
- PrepmtInvLineBuffer."Global Dimension 1 Code", PrepmtInvLineBuffer."Global Dimension 2 Code",
- PrepmtInvLineBuffer."Dimension Set ID", PurchHeader."Reason Code");
-
- GenJnlLine.CopyDocumentFields(DocType, DocNo, ExtDocNo, SrcCode, PostingNoSeriesCode);
- GenJnlLine.CopyFromPurchHeaderPrepmt(PurchHeader);
- GenJnlLine.CopyFromPrepmtInvoiceBuffer(PrepmtInvLineBuffer);
-
- GenJnlLine.Correction := (DocumentType = DocumentType::"Credit Memo") and GLSetup."Mark Cr. Memos as Corrections";
- if not PrepmtInvLineBuffer.Adjustment then
- GenJnlLine."Gen. Posting Type" := GenJnlLine."Gen. Posting Type"::Purchase;
-
- if GLSetup."Journal Templ. Name Mandatory" then
- GenJnlLine."Journal Template Name" := GenJournalTemplate.Name;
-
- OnBeforePostPrepmtInvLineBuffer(GenJnlLine, PrepmtInvLineBuffer, SuppressCommit);
- RunGenJnlPostLine(GenJnlLine);
- OnAfterPostPrepmtInvLineBuffer(GenJnlLine, PrepmtInvLineBuffer, SuppressCommit, GenJnlPostLine);
- end;
-
- local procedure PostVendorEntry(PurchHeader: Record "Purchase Header"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; DocumentType: Option Invoice,"Credit Memo"; PostingDescription: Text[100]; DocType: Enum "Gen. Journal Document Type"; DocNo: Code[20]; ExtDocNo: Text[35]; SrcCode: Code[10]; PostingNoSeriesCode: Code[20]; CalcPmtDisc: Boolean)
- var
- GenJnlLine: Record "Gen. Journal Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforePostVendorEntryProcedure(PurchHeader, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY, DocumentType, PostingDescription, DocType, DocNo, ExtDocNo, SrcCode, PostingNoSeriesCode, CalcPmtDisc, GenJnlPostLine, IsHandled);
- if IsHandled then
- exit;
-
- GenJnlLine.InitNewLine(
- PurchHeader."Posting Date", PurchHeader."Document Date", PurchHeader."VAT Reporting Date", PostingDescription,
- PurchHeader."Shortcut Dimension 1 Code", PurchHeader."Shortcut Dimension 2 Code",
- PurchHeader."Dimension Set ID", PurchHeader."Reason Code");
- OnPostVendorEntryOnAfterInitNewLine(GenJnlLine, PurchHeader);
-
- GenJnlLine.CopyDocumentFields(DocType, DocNo, ExtDocNo, SrcCode, PostingNoSeriesCode);
-
- GenJnlLine.CopyFromPurchHeaderPrepmtPost(PurchHeader, (DocumentType = DocumentType::Invoice) or CalcPmtDisc);
- GenJnlLine."Transaction Mode Code" := PurchHeader."Transaction Mode Code";
- GenJnlLine."Recipient Bank Account" := PurchHeader."Bank Account Code";
-
- GenJnlLine.Amount := -TotalPrepmtInvLineBuffer."Amount Incl. VAT";
- GenJnlLine."Source Currency Amount" := -TotalPrepmtInvLineBuffer."Amount Incl. VAT";
- GenJnlLine."Amount (LCY)" := -TotalPrepmtInvLineBufferLCY."Amount Incl. VAT";
- GenJnlLine."Sales/Purch. (LCY)" := -TotalPrepmtInvLineBufferLCY.Amount;
- GenJnlLine."Profit (LCY)" := -TotalPrepmtInvLineBufferLCY.Amount;
-
- GenJnlLine.Correction := (DocumentType = DocumentType::"Credit Memo") and GLSetup."Mark Cr. Memos as Corrections";
-
- GenJnlLine."Orig. Pmt. Disc. Possible" := -TotalPrepmtInvLineBuffer."Orig. Pmt. Disc. Possible";
- GenJnlLine."Orig. Pmt. Disc. Possible(LCY)" := -TotalPrepmtInvLineBufferLCY."Orig. Pmt. Disc. Possible";
-
- if GLSetup."Journal Templ. Name Mandatory" then
- GenJnlLine."Journal Template Name" := GenJournalTemplate.Name;
-
- OnBeforePostVendorEntry(GenJnlLine, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY, SuppressCommit, PurchHeader, DocumentType);
- GenJnlPostLine.RunWithCheck(GenJnlLine);
- OnAfterPostVendorEntry(GenJnlLine, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY, SuppressCommit);
- end;
-
- local procedure PostBalancingEntry(PurchHeader: Record "Purchase Header"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; var VendLedgEntry: Record "Vendor Ledger Entry"; DocumentType: Option Invoice,"Credit Memo"; DocType: Enum "Gen. Journal Document Type"; DocNo: Code[20]; ExtDocNo: Text[35]; SrcCode: Code[10]; PostingNoSeriesCode: Code[20])
- var
- GenJnlLine: Record "Gen. Journal Line";
- begin
- GenJnlLine.InitNewLine(
- PurchHeader."Posting Date", PurchHeader."Document Date", PurchHeader."VAT Reporting Date", PurchHeader."Posting Description",
- PurchHeader."Shortcut Dimension 1 Code", PurchHeader."Shortcut Dimension 2 Code",
- PurchHeader."Dimension Set ID", PurchHeader."Reason Code");
-
- if DocType = GenJnlLine."Document Type"::"Credit Memo" then
- GenJnlLine.CopyDocumentFields(GenJnlLine."Document Type"::Refund, DocNo, ExtDocNo, SrcCode, PostingNoSeriesCode)
- else
- GenJnlLine.CopyDocumentFields(GenJnlLine."Document Type"::Payment, DocNo, ExtDocNo, SrcCode, PostingNoSeriesCode);
-
- GenJnlLine.CopyFromPurchHeaderPrepmtPost(PurchHeader, false);
- if PurchHeader."Bal. Account Type" = PurchHeader."Bal. Account Type"::"Bank Account" then
- GenJnlLine."Bal. Account Type" := GenJnlLine."Bal. Account Type"::"Bank Account";
- GenJnlLine."Bal. Account No." := PurchHeader."Bal. Account No.";
-
- GenJnlLine.Amount := TotalPrepmtInvLineBuffer."Amount Incl. VAT" + VendLedgEntry."Remaining Pmt. Disc. Possible";
- GenJnlLine."Source Currency Amount" := GenJnlLine.Amount;
- if VendLedgEntry.Amount = 0 then
- GenJnlLine."Amount (LCY)" := TotalPrepmtInvLineBufferLCY."Amount Incl. VAT"
- else
- GenJnlLine."Amount (LCY)" :=
- TotalPrepmtInvLineBufferLCY."Amount Incl. VAT" +
- Round(VendLedgEntry."Remaining Pmt. Disc. Possible" / VendLedgEntry."Adjusted Currency Factor");
-
- GenJnlLine.Correction := (DocumentType = DocumentType::"Credit Memo") and GLSetup."Mark Cr. Memos as Corrections";
-
- GenJnlLine."Applies-to Doc. Type" := DocType;
- GenJnlLine."Applies-to Doc. No." := DocNo;
-
- GenJnlLine."Orig. Pmt. Disc. Possible" := TotalPrepmtInvLineBuffer."Orig. Pmt. Disc. Possible";
- GenJnlLine."Orig. Pmt. Disc. Possible(LCY)" := TotalPrepmtInvLineBufferLCY."Orig. Pmt. Disc. Possible";
-
- if GLSetup."Journal Templ. Name Mandatory" then
- GenJnlLine."Journal Template Name" := GenJournalTemplate.Name;
-
- OnBeforePostBalancingEntry(GenJnlLine, VendLedgEntry, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY, SuppressCommit);
- GenJnlPostLine.RunWithCheck(GenJnlLine);
- OnAfterPostBalancingEntry(GenJnlLine, VendLedgEntry, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY, SuppressCommit);
- end;
-
- local procedure RunGenJnlPostLine(var GenJnlLine: Record "Gen. Journal Line")
- begin
- OnBeforeRunGenJnlPostLine(GenJnlLine);
- GenJnlPostLine.RunWithCheck(GenJnlLine);
- end;
-
- procedure UpdatePrepmtAmountOnPurchLines(PurchHeader: Record "Purchase Header"; NewTotalPrepmtAmount: Decimal)
- var
- Currency: Record Currency;
- PurchLine: Record "Purchase Line";
- TotalLineAmount: Decimal;
- TotalPrepmtAmount: Decimal;
- TotalPrepmtAmtInv: Decimal;
- LastLineNo: Integer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdatePrepmtAmountOnPurchLines(PurchHeader, NewTotalPrepmtAmount, IsHandled);
- if IsHandled then
- exit;
-
- Currency.Initialize(PurchHeader."Currency Code");
-
- PurchLine.SetRange("Document Type", PurchHeader."Document Type");
- PurchLine.SetRange("Document No.", PurchHeader."No.");
- PurchLine.SetFilter(Type, '<>%1', PurchLine.Type::" ");
- PurchLine.SetFilter("Line Amount", '<>0');
- PurchLine.SetFilter("Prepayment %", '<>0');
- PurchLine.LockTable();
- if PurchLine.Find('-') then
- repeat
- TotalLineAmount := TotalLineAmount + PurchLine."Line Amount";
- TotalPrepmtAmtInv := TotalPrepmtAmtInv + PurchLine."Prepmt. Amt. Inv.";
- LastLineNo := PurchLine."Line No.";
- until PurchLine.Next() = 0
- else
- Error(Text017, PurchLine.FieldCaption("Prepayment %"));
- if TotalLineAmount = 0 then
- Error(Text013, NewTotalPrepmtAmount);
- if not (NewTotalPrepmtAmount in [TotalPrepmtAmtInv .. TotalLineAmount]) then
- Error(Text016, TotalPrepmtAmtInv, TotalLineAmount);
- TotalPrepmtAmount := 0;
- if PurchLine.Find('-') then
- repeat
- if PurchLine."Line No." <> LastLineNo then
- PurchLine.Validate(
- "Prepmt. Line Amount",
- Round(
- NewTotalPrepmtAmount * PurchLine."Line Amount" / TotalLineAmount,
- Currency."Amount Rounding Precision"))
- else
- PurchLine.Validate("Prepmt. Line Amount", NewTotalPrepmtAmount - TotalPrepmtAmount);
- TotalPrepmtAmount := TotalPrepmtAmount + PurchLine."Prepmt. Line Amount";
- PurchLine.Modify();
- until PurchLine.Next() = 0;
- end;
-
- local procedure CreateDimensions(var PurchLine: Record "Purchase Line")
- var
- SourceCodeSetup: Record "Source Code Setup";
- DimMgt: Codeunit DimensionManagement;
- DefaultDimSource: List of [Dictionary of [Integer, Code[20]]];
- begin
- SourceCodeSetup.Get();
- DimMgt.AddDimSource(DefaultDimSource, Database::"G/L Account", PurchLine."No.");
- DimMgt.AddDimSource(DefaultDimSource, Database::Job, PurchLine."Job No.");
- DimMgt.AddDimSource(DefaultDimSource, Database::"Responsibility Center", PurchLine."Responsibility Center");
- OnCreateDimensionsOnAfterAddDimSources(PurchLine, DefaultDimSource);
-
- PurchLine."Shortcut Dimension 1 Code" := '';
- PurchLine."Shortcut Dimension 2 Code" := '';
- PurchLine."Dimension Set ID" :=
- DimMgt.GetRecDefaultDimID(
- PurchLine, 0, DefaultDimSource, SourceCodeSetup.Purchases,
- PurchLine."Shortcut Dimension 1 Code", PurchLine."Shortcut Dimension 2 Code", PurchLine."Dimension Set ID", Database::Vendor);
-
- OnAfterCreateDimensionsProcedure(PurchLine, DefaultDimSource);
- end;
-
- procedure GetPurchLinesToDeduct(PurchHeader: Record "Purchase Header"; var PurchLines: Record "Purchase Line")
- var
- PurchLine: Record "Purchase Line";
- begin
- ApplyFilter(PurchHeader, 1, PurchLine);
- if PurchLine.FindSet() then
- repeat
- if (PrepmtAmount(PurchLine, 0) <> 0) and (PrepmtAmount(PurchLine, 1) <> 0) then
- if not PurchLines.Get(PurchLine.RecordId) then begin
- PurchLines := PurchLine;
- PurchLines.Insert();
- end;
- until PurchLine.Next() = 0;
- end;
-
- local procedure PrepmtVATDiffAmount(PurchLine: Record "Purchase Line"; DocumentType: Option Invoice,"Credit Memo",Statistic): Decimal
- begin
- case DocumentType of
- DocumentType::Statistic:
- exit(PurchLine."Prepayment VAT Difference");
- DocumentType::Invoice:
- exit(PurchLine."Prepayment VAT Difference");
- else
- exit(PurchLine."Prepmt VAT Diff. to Deduct");
- end;
- end;
-
- local procedure UpdatePurchaseDocument(var PurchaseHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line"; DocumentType: Option Invoice,"Credit Memo"; GenJnlLineDocNo: Code[20])
- begin
- PurchLine.Reset();
- PurchLine.SetRange("Document Type", PurchaseHeader."Document Type");
- PurchLine.SetRange("Document No.", PurchaseHeader."No.");
- if DocumentType = DocumentType::Invoice then begin
- PurchaseHeader."Last Prepayment No." := GenJnlLineDocNo;
- PurchaseHeader."Prepayment No." := '';
- PurchLine.SetFilter("Prepmt. Line Amount", '<>0');
- if PurchLine.FindSet(true) then
- repeat
- if PurchLine."Prepmt. Line Amount" <> PurchLine."Prepmt. Amt. Inv." then begin
- PurchLine."Prepmt. Amt. Inv." := PurchLine."Prepmt. Line Amount";
- PurchLine."Prepmt. Amount Inv. Incl. VAT" := PurchLine."Prepmt. Amt. Incl. VAT";
- PurchLine.CalcPrepaymentToDeduct();
- PurchLine."Prepmt VAT Diff. to Deduct" :=
- PurchLine."Prepmt VAT Diff. to Deduct" + PurchLine."Prepayment VAT Difference";
- PurchLine."Prepayment VAT Difference" := 0;
- OnUpdatePurchaseDocumentOnBeforeModifyInvoicePurchLine(PurchLine);
- PurchLine.Modify();
- end;
- until PurchLine.Next() = 0;
- end else begin
- PurchaseHeader."Last Prepmt. Cr. Memo No." := GenJnlLineDocNo;
- PurchaseHeader."Prepmt. Cr. Memo No." := '';
- PurchLine.SetFilter("Prepmt. Amt. Inv.", '<>0');
- if PurchLine.FindSet(true) then
- repeat
- PurchLine."Prepmt. Amt. Inv." := PurchLine."Prepmt Amt Deducted";
- if PurchaseHeader."Prices Including VAT" then
- PurchLine."Prepmt. Amount Inv. Incl. VAT" := PurchLine."Prepmt. Amt. Inv."
- else
- PurchLine."Prepmt. Amount Inv. Incl. VAT" :=
- Round(
- PurchLine."Prepmt. Amt. Inv." * (100 + PurchLine."Prepayment VAT %") / 100,
- GetCurrencyAmountRoundingPrecision(PurchLine."Currency Code"));
- PurchLine."Prepmt. Amt. Incl. VAT" := PurchLine."Prepmt. Amount Inv. Incl. VAT";
- PurchLine."Prepayment Amount" := PurchLine."Prepmt. Amt. Inv.";
- PurchLine."Prepmt Amt to Deduct" := 0;
- PurchLine."Prepmt VAT Diff. to Deduct" := 0;
- PurchLine."Prepayment VAT Difference" := 0;
- OnUpdatePurchaseDocumentOnBeforeModifyCrMemoPurchLine(PurchLine);
- PurchLine.Modify();
- until PurchLine.Next() = 0;
- end;
- end;
-
- local procedure UpdatePostedPurchaseDocument(DocumentType: Option Invoice,"Credit Memo"; DocumentNo: Code[20])
- var
- VendorLedgerEntry: Record "Vendor Ledger Entry";
- PurchInvHeader: Record "Purch. Inv. Header";
- PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdatePostedPurchaseDocument(VendorLedgerEntry, PurchInvHeader, PurchCrMemoHdr, DocumentType, IsHandled, DocumentNo);
- if IsHandled then
- exit;
-
- case DocumentType of
- DocumentType::Invoice:
- begin
- VendorLedgerEntry.SetRange("Document Type", VendorLedgerEntry."Document Type"::Invoice);
- VendorLedgerEntry.SetRange("Document No.", DocumentNo);
- VendorLedgerEntry.FindFirst();
- PurchInvHeader.Get(DocumentNo);
- PurchInvHeader."Vendor Ledger Entry No." := VendorLedgerEntry."Entry No.";
- PurchInvHeader.Modify();
- end;
- DocumentType::"Credit Memo":
- begin
- VendorLedgerEntry.SetRange("Document Type", VendorLedgerEntry."Document Type"::"Credit Memo");
- VendorLedgerEntry.SetRange("Document No.", DocumentNo);
- VendorLedgerEntry.FindFirst();
- PurchCrMemoHdr.Get(DocumentNo);
- PurchCrMemoHdr."Vendor Ledger Entry No." := VendorLedgerEntry."Entry No.";
- PurchCrMemoHdr.Modify();
- end;
- end;
-
- OnAfterUpdatePostedPurchDocument(DocumentType, DocumentNo, SuppressCommit);
- end;
-
- local procedure InsertPurchInvHeader(var PurchInvHeader: Record "Purch. Inv. Header"; PurchHeader: Record "Purchase Header"; PostingDescription: Text[100]; GenJnlLineDocNo: Code[20]; SrcCode: Code[10]; PostingNoSeriesCode: Code[20])
- begin
- PurchInvHeader.Init();
- PurchInvHeader.TransferFields(PurchHeader);
- PurchInvHeader."Posting Description" := PostingDescription;
- PurchInvHeader."Payment Terms Code" := PurchHeader."Prepmt. Payment Terms Code";
- PurchInvHeader."Due Date" := PurchHeader."Prepayment Due Date";
- PurchInvHeader."Pmt. Discount Date" := PurchHeader."Prepmt. Pmt. Discount Date";
- PurchInvHeader."Payment Discount %" := PurchHeader."Prepmt. Payment Discount %";
- PurchInvHeader."No." := GenJnlLineDocNo;
- PurchInvHeader."Order No." := PurchHeader."No.";
- PurchInvHeader."Pre-Assigned No. Series" := '';
- PurchInvHeader."Source Code" := SrcCode;
- PurchInvHeader."User ID" := CopyStr(UserId(), 1, MaxStrLen(PurchInvHeader."User ID"));
- PurchInvHeader."No. Printed" := 0;
- PurchInvHeader."Prepayment Invoice" := true;
- PurchInvHeader."Prepayment Order No." := PurchHeader."No.";
- PurchInvHeader."No. Series" := PostingNoSeriesCode;
- OnBeforePurchInvHeaderInsert(PurchInvHeader, PurchHeader, SuppressCommit);
- PurchInvHeader.Insert();
- CopyHeaderCommentLines(PurchHeader."No.", Database::"Purch. Inv. Header", GenJnlLineDocNo);
- OnAfterPurchInvHeaderInsert(PurchInvHeader, PurchHeader, SuppressCommit);
- end;
-
- local procedure InsertPurchCrMemoHeader(var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; PurchHeader: Record "Purchase Header"; PostingDescription: Text[100]; GenJnlLineDocNo: Code[20]; SrcCode: Code[10]; PostingNoSeriesCode: Code[20]; CalcPmtDiscOnCrMemos: Boolean)
- begin
- PurchCrMemoHdr.Init();
- PurchCrMemoHdr.TransferFields(PurchHeader);
- PurchCrMemoHdr."Payment Terms Code" := PurchHeader."Prepmt. Payment Terms Code";
- PurchCrMemoHdr."Pmt. Discount Date" := PurchHeader."Prepmt. Pmt. Discount Date";
- PurchCrMemoHdr."Payment Discount %" := PurchHeader."Prepmt. Payment Discount %";
- if (PurchHeader."Prepmt. Payment Terms Code" <> '') and not CalcPmtDiscOnCrMemos then begin
- PurchCrMemoHdr."Payment Discount %" := 0;
- PurchCrMemoHdr."Pmt. Discount Date" := 0D;
- end;
- PurchCrMemoHdr."Posting Description" := PostingDescription;
- PurchCrMemoHdr."Due Date" := PurchHeader."Prepayment Due Date";
- PurchCrMemoHdr."No." := GenJnlLineDocNo;
- PurchCrMemoHdr."Pre-Assigned No. Series" := '';
- PurchCrMemoHdr."Source Code" := SrcCode;
- PurchCrMemoHdr."User ID" := CopyStr(UserId(), 1, MaxStrLen(PurchCrMemoHdr."User ID"));
- PurchCrMemoHdr."No. Printed" := 0;
- PurchCrMemoHdr."Prepayment Credit Memo" := true;
- PurchCrMemoHdr."Prepayment Order No." := PurchHeader."No.";
- PurchCrMemoHdr.Correction := GLSetup."Mark Cr. Memos as Corrections";
- PurchCrMemoHdr."No. Series" := PostingNoSeriesCode;
- OnBeforePurchCrMemoHeaderInsert(PurchCrMemoHdr, PurchHeader, SuppressCommit);
- PurchCrMemoHdr.Insert();
- CopyHeaderCommentLines(PurchHeader."No.", Database::"Purch. Cr. Memo Hdr.", GenJnlLineDocNo);
- OnAfterPurchCrMemoHeaderInsert(PurchCrMemoHdr, PurchHeader, SuppressCommit);
- end;
-
- local procedure GetCalcPmtDiscOnCrMemos(PrepmtPmtTermsCode: Code[10]): Boolean
- var
- PaymentTerms: Record "Payment Terms";
- begin
- if PrepmtPmtTermsCode = '' then
- exit(false);
- PaymentTerms.Get(PrepmtPmtTermsCode);
- exit(PaymentTerms."Calc. Pmt. Disc. on Cr. Memos");
- end;
-
- local procedure InsertPurchInvLine(PurchInvHeader: Record "Purch. Inv. Header"; LineNo: Integer; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; PurchaseHeader: Record "Purchase Header")
- var
- PurchInvLine: Record "Purch. Inv. Line";
- begin
- PurchInvLine.Init();
- PurchInvLine."Document No." := PurchInvHeader."No.";
- PurchInvLine."Order No." := PurchInvHeader."Order No.";
- PurchInvLine."Line No." := LineNo;
- PurchInvLine."Buy-from Vendor No." := PurchInvHeader."Buy-from Vendor No.";
- PurchInvLine."Pay-to Vendor No." := PurchInvHeader."Pay-to Vendor No.";
- PurchInvLine.Type := PurchInvLine.Type::"G/L Account";
- PurchInvLine."No." := PrepmtInvLineBuffer."G/L Account No.";
- PurchInvLine."Posting Date" := PurchInvHeader."Posting Date";
- PurchInvLine."Shortcut Dimension 1 Code" := PrepmtInvLineBuffer."Global Dimension 1 Code";
- PurchInvLine."Shortcut Dimension 2 Code" := PrepmtInvLineBuffer."Global Dimension 2 Code";
- PurchInvLine."Dimension Set ID" := PrepmtInvLineBuffer."Dimension Set ID";
- PurchInvLine.Description := PrepmtInvLineBuffer.Description;
- PurchInvLine.Quantity := 1;
- if PurchInvHeader."Prices Including VAT" then begin
- PurchInvLine."Direct Unit Cost" := PrepmtInvLineBuffer."Amount Incl. VAT";
- PurchInvLine."Line Amount" := PrepmtInvLineBuffer."Amount Incl. VAT";
- end else begin
- PurchInvLine."Direct Unit Cost" := PrepmtInvLineBuffer.Amount;
- PurchInvLine."Line Amount" := PrepmtInvLineBuffer.Amount;
- end;
- PurchInvLine."Gen. Bus. Posting Group" := PrepmtInvLineBuffer."Gen. Bus. Posting Group";
- PurchInvLine."Gen. Prod. Posting Group" := PrepmtInvLineBuffer."Gen. Prod. Posting Group";
- PurchInvLine."VAT Bus. Posting Group" := PrepmtInvLineBuffer."VAT Bus. Posting Group";
- PurchInvLine."VAT Prod. Posting Group" := PrepmtInvLineBuffer."VAT Prod. Posting Group";
- PurchInvLine."VAT %" := PrepmtInvLineBuffer."VAT %";
- PurchInvLine.Amount := PrepmtInvLineBuffer.Amount;
- PurchInvLine."VAT Difference" := PrepmtInvLineBuffer."VAT Difference";
- PurchInvLine."Amount Including VAT" := PrepmtInvLineBuffer."Amount Incl. VAT";
- PurchInvLine."VAT Calculation Type" := PrepmtInvLineBuffer."VAT Calculation Type";
- PurchInvLine."VAT Base Amount" := PrepmtInvLineBuffer."VAT Base Amount";
- PurchInvLine."VAT Identifier" := PrepmtInvLineBuffer."VAT Identifier";
- PurchInvLine."Job No." := PrepmtInvLineBuffer."Job No.";
- PurchInvLine."Job Task No." := PrepmtInvLineBuffer."Job Task No.";
- PurchInvLine."Pmt. Discount Amount" := PrepmtInvLineBuffer."Orig. Pmt. Disc. Possible";
- PurchInvLine."Location Code" := PrepmtInvLineBuffer."Location Code";
- OnBeforePurchInvLineInsert(PurchInvLine, PurchInvHeader, PrepmtInvLineBuffer, SuppressCommit);
- PurchInvLine.Insert();
- if not PurchaseHeader."Compress Prepayment" then
- CopyLineCommentLines(
- PurchaseHeader."No.", Database::"Purch. Inv. Header", PurchInvHeader."No.", PrepmtInvLineBuffer."Line No.", LineNo);
- OnAfterPurchInvLineInsert(PurchInvLine, PurchInvHeader, PrepmtInvLineBuffer, SuppressCommit);
- end;
-
- local procedure InsertPurchCrMemoLine(PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; LineNo: Integer; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; PurchaseHeader: Record "Purchase Header")
- var
- PurchCrMemoLine: Record "Purch. Cr. Memo Line";
- begin
- PurchCrMemoLine.Init();
- PurchCrMemoLine."Document No." := PurchCrMemoHdr."No.";
- PurchCrMemoLine."Line No." := LineNo;
- PurchCrMemoLine."Buy-from Vendor No." := PurchCrMemoHdr."Buy-from Vendor No.";
- PurchCrMemoLine."Pay-to Vendor No." := PurchCrMemoHdr."Pay-to Vendor No.";
- PurchCrMemoLine.Type := PurchCrMemoLine.Type::"G/L Account";
- PurchCrMemoLine."No." := PrepmtInvLineBuffer."G/L Account No.";
- PurchCrMemoLine."Posting Date" := PurchCrMemoHdr."Posting Date";
- PurchCrMemoLine."Shortcut Dimension 1 Code" := PrepmtInvLineBuffer."Global Dimension 1 Code";
- PurchCrMemoLine."Shortcut Dimension 2 Code" := PrepmtInvLineBuffer."Global Dimension 2 Code";
- PurchCrMemoLine."Dimension Set ID" := PrepmtInvLineBuffer."Dimension Set ID";
- PurchCrMemoLine.Description := PrepmtInvLineBuffer.Description;
- PurchCrMemoLine.Quantity := 1;
- if PurchCrMemoHdr."Prices Including VAT" then begin
- PurchCrMemoLine."Direct Unit Cost" := PrepmtInvLineBuffer."Amount Incl. VAT";
- PurchCrMemoLine."Line Amount" := PrepmtInvLineBuffer."Amount Incl. VAT";
- end else begin
- PurchCrMemoLine."Direct Unit Cost" := PrepmtInvLineBuffer.Amount;
- PurchCrMemoLine."Line Amount" := PrepmtInvLineBuffer.Amount;
- end;
- PurchCrMemoLine."Gen. Bus. Posting Group" := PrepmtInvLineBuffer."Gen. Bus. Posting Group";
- PurchCrMemoLine."Gen. Prod. Posting Group" := PrepmtInvLineBuffer."Gen. Prod. Posting Group";
- PurchCrMemoLine."VAT Bus. Posting Group" := PrepmtInvLineBuffer."VAT Bus. Posting Group";
- PurchCrMemoLine."VAT Prod. Posting Group" := PrepmtInvLineBuffer."VAT Prod. Posting Group";
- PurchCrMemoLine."VAT %" := PrepmtInvLineBuffer."VAT %";
- PurchCrMemoLine.Amount := PrepmtInvLineBuffer.Amount;
- PurchCrMemoLine."VAT Difference" := PrepmtInvLineBuffer."VAT Difference";
- PurchCrMemoLine."Amount Including VAT" := PrepmtInvLineBuffer."Amount Incl. VAT";
- PurchCrMemoLine."VAT Calculation Type" := PrepmtInvLineBuffer."VAT Calculation Type";
- PurchCrMemoLine."VAT Base Amount" := PrepmtInvLineBuffer."VAT Base Amount";
- PurchCrMemoLine."VAT Identifier" := PrepmtInvLineBuffer."VAT Identifier";
- PurchCrMemoLine."Job No." := PrepmtInvLineBuffer."Job No.";
- PurchCrMemoLine."Job Task No." := PrepmtInvLineBuffer."Job Task No.";
- PurchCrMemoLine."Pmt. Discount Amount" := PrepmtInvLineBuffer."Orig. Pmt. Disc. Possible";
- OnBeforePurchCrMemoLineInsert(PurchCrMemoLine, PurchCrMemoHdr, PrepmtInvLineBuffer, SuppressCommit);
- PurchCrMemoLine.Insert();
- if not PurchaseHeader."Compress Prepayment" then
- CopyLineCommentLines(
- PurchaseHeader."No.", Database::"Purch. Cr. Memo Hdr.", PurchCrMemoHdr."No.", PrepmtInvLineBuffer."Line No.", LineNo);
- OnAfterPurchCrMemoLineInsert(PurchCrMemoLine, PurchCrMemoHdr, PrepmtInvLineBuffer, SuppressCommit);
- end;
-
- procedure GetPreviewMode(): Boolean
- begin
- exit(PreviewMode);
- end;
-
- procedure GetSuppressCommit(): Boolean
- begin
- exit(SuppressCommit);
- end;
-
- procedure SetSuppressCommit(NewSuppressCommit: Boolean)
- begin
- SuppressCommit := NewSuppressCommit;
- end;
-
- procedure SetPreviewMode(NewPreviewMode: Boolean)
- begin
- PreviewMode := NewPreviewMode;
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCreateDimensionsProcedure(var PurchaseLine: Record "Purchase Line"; DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterApplyFilter(var PurchaseLine: Record "Purchase Line"; PurchaseHeader: Record "Purchase Header"; DocumentType: Option)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCalcVATAmountLines(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line"; DocumentType: Option Invoice,"Credit Memo",Statistic)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckPrepmtDoc(PurchHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo"; var ErrorMessageMgt: Codeunit "Error Message Management")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCreateLinesOnBeforeGLPosting(var PurchaseHeader: Record "Purchase Header"; PurchInvHeader: Record "Purch. Inv. Header"; PurchCrMemoHeader: Record "Purch. Cr. Memo Hdr."; var TempPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary; DocumentType: Option; var LastLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterFillInvLineBuffer(var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; PurchLine: Record "Purchase Line"; CommitIsSuppressed: Boolean; PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInsertInvoiceRounding(PurchaseHeader: Record "Purchase Header"; var PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var PrevLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterPostPrepayments(var PurchHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo"; CommitIsSuppressed: Boolean; var PurchInvHeader: Record "Purch. Inv. Header"; var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterPostBalancingEntry(var GenJnlLine: Record "Gen. Journal Line"; VendLedgEntry: Record "Vendor Ledger Entry"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterPostVendorEntry(var GenJnlLine: Record "Gen. Journal Line"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterPostPrepmtInvLineBuffer(var GenJnlLine: Record "Gen. Journal Line"; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSuppressed: Boolean; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterPurchInvHeaderInsert(var PurchInvHeader: Record "Purch. Inv. Header"; PurchHeader: Record "Purchase Header"; CommitIsSupressed: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterPurchInvLineInsert(var PurchInvLine: Record "Purch. Inv. Line"; PurchInvHeader: Record "Purch. Inv. Header"; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterPurchCrMemoHeaderInsert(var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; PurchHeader: Record "Purchase Header"; CommitIsSupressed: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterPurchCrMemoLineInsert(var PurchCrMemoLine: Record "Purch. Cr. Memo Line"; PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterRoundAmounts(PurchaseHeader: Record "Purchase Header"; var PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBufLCY: Record "Prepayment Inv. Line Buffer")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdatePostedPurchDocument(DocumentType: Option Invoice,"Credit Memo"; DocumentNo: Code[20]; CommitIsSuppressed: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateVATOnLines(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; VATAmountLine: Record "VAT Amount Line"; DocumentType: Option Invoice,"Credit Memo",Statistic)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckPrepmtDoc(PurchHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeInvoice(var PurchaseHeader: Record "Purchase Header"; var Handled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeCreditMemo(var PurchaseHeader: Record "Purchase Header"; var Handled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateLinesFromBuffer(var PurchHeader: Record "Purchase Header"; var TempGlobalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer" temporary; var LineCount: Integer; var Window: Dialog; var PurchInvHeader: Record "Purch. Inv. Header"; var PurchCrMemoHeader: Record "Purch. Cr. Memo Hdr."; var PostedDocTabNo: Integer; var IsHandled: Boolean; DocumentType: Option; var LastLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePostPrepayments(var PurchHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo"; CommitIsSuppressed: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePostVendorEntryProcedure(var PurchHeader: Record "Purchase Header"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; DocumentType: Option Invoice,"Credit Memo"; PostingDescription: Text[100]; DocType: Enum "Gen. Journal Document Type"; DocNo: Code[20]; ExtDocNo: Text[35]; SrcCode: Code[10]; PostingNoSeriesCode: Code[20]; CalcPmtDisc: Boolean; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePurchaseAssertPrepmtAmountNotMoreThanDocAmount(var VendLedgEntry: Record "Vendor Ledger Entry"; PurchHeader: Record "Purchase Header"; PurchLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePurchInvHeaderInsert(var PurchInvHeader: Record "Purch. Inv. Header"; PurchHeader: Record "Purchase Header"; CommitIsSupressed: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePurchInvLineInsert(var PurchInvLine: Record "Purch. Inv. Line"; PurchInvHeader: Record "Purch. Inv. Header"; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePurchCrMemoHeaderInsert(var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; PurchHeader: Record "Purchase Header"; CommitIsSupressed: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePurchCrMemoLineInsert(var PurchCrMemoLine: Record "Purch. Cr. Memo Line"; PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePostBalancingEntry(var GenJnlLine: Record "Gen. Journal Line"; VendLedgEntry: Record "Vendor Ledger Entry"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePostVendorEntry(var GenJnlLine: Record "Gen. Journal Line"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean; PurchaseHeader: Record "Purchase Header"; DocumentType: Option)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePostPrepmtInvLineBuffer(var GenJnlLine: Record "Gen. Journal Line"; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSupressed: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeRunGenJnlPostLine(var GenJnlLine: Record "Gen. Journal Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetStatusPendingPrepayment(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateDocNos(var PurchaseHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo"; var DocNo: Code[20]; var NoSeriesCode: Code[20]; var ModifyHeader: Boolean; var PreviewMode: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdatePostedPurchaseDocument(var VendorLedgerEntry: Record "Vendor Ledger Entry"; var PurchInvHeader: Record "Purch. Inv. Header"; var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; DocumentType: Option Invoice,"Credit Memo"; var IsHandled: Boolean; DocumentNo: Code[20])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCodeOnBeforePostBalancingEntry(var PurchaseHeader: Record "Purchase Header"; var TempPrepaymentInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCodeOnBeforePostVendorEntry(var PurchaseHeader: Record "Purchase Header"; var TempPrepaymentInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnPostVendorEntryOnAfterInitNewLine(var GenJnlLine: Record "Gen. Journal Line"; PurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRoundAmountsOnBeforeIncrAmoutns(PurchaseHeader: Record "Purchase Header"; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBufLCY: Record "Prepayment Inv. Line Buffer")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdatePurchaseDocumentOnBeforeModifyCrMemoPurchLine(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdatePurchaseDocumentOnBeforeModifyInvoicePurchLine(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnAfterGetRemainder(var VATAmountLineRemainder: Record "VAT Amount Line"; var RemainderExists: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnAfterVATAmountLineGet(var VATAmountLine: Record "VAT Amount Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnBeforePurchLineModify(PurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line"; var TempVATAmountLineRemainder: Record "VAT Amount Line"; NewAmount: Decimal; NewAmountIncludingVAT: Decimal; NewVATBaseAmount: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCodeOnBeforeWindowOpen(var PurchaseHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnFillInvLineBufferOnAfterInit(var PrepaymentInvLineBuffer: Record "Prepayment Inv. Line Buffer"; PurchaseHeader: Record "Purchase Header"; PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCodeOnAfterUpdateHeaderAndLines(var PurchaseHeader: Record "Purchase Header"; var PurchInvHeader: Record "Purch. Inv. Header"; var PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line";DocumentType: Option Invoice,"Credit Memo"; PreviewMode: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdatePrepmtAmountOnPurchLines(PurchaseHeader: Record "Purchase Header"; NewTotalPrepmtAmount: Decimal; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateCrMemoDocNos(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateCrMemoDocNos(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInsertExtendedText(TabNo: Integer; DocNo: Code[20]; GLAccNo: Code[20]; DocDate: Date; LanguageCode: Code[10]; var PrevLineNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetPurchLines(PurchaseHeader: Record "Purchase Header"; DocumentType: Option Invoice,"Credit Memo",Statistic; var ToPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckOpenPrepaymentLines(var PurchaseHeader: Record "Purchase Header"; DocumentType: Option)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckOpenPrepaymentLines(var PurchaseHeader: Record "Purchase Header"; DocumentType: Option; var Found: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInsertVATAmountOnBeforeInsert(var PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnFindVATAmountLineOnAfterSetFilters(var PurchaseLine: Record "Purchase Line"; var VATAmountLine: Record "VAT Amount Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBuildInvLineBufferOnPrepmtAmountZero(PurchaseHeader: Record "Purchase Header"; PurchaseLine: Record "Purchase Line"; var PrepaymentInvLineBuffer2: Record "Prepayment Inv. Line Buffer"; var PrepaymentInvLineBuffer: Record "Prepayment Inv. Line Buffer"; var TempPurchaseLineSource: Record "Purchase Line" temporary);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCreateDimensionsOnAfterAddDimSources(var PurchaseLine: Record "Purchase Line"; DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetPrepmtAccNo(GenPostingSetup: Record "General Posting Setup"; var PrepmtAccNo: Code[20])
- begin
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Purchases/RoleCenters/PurchasingManagerRoleCenter.Page.al b/src/Layers/NL/BaseApp/Purchases/RoleCenters/PurchasingManagerRoleCenter.Page.al
deleted file mode 100644
index 98166c45c9..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/RoleCenters/PurchasingManagerRoleCenter.Page.al
+++ /dev/null
@@ -1,833 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.RoleCenters;
-
-using Microsoft.Assembly.Document;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Team;
-using Microsoft.Finance.Deferral;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Ledger;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.Navigate;
-using Microsoft.Foundation.Shipping;
-using Microsoft.Foundation.UOM;
-using Microsoft.Inventory.Analysis;
-using Microsoft.Inventory.Costing;
-using Microsoft.Inventory.Item;
-using Microsoft.Inventory.Item.Catalog;
-using Microsoft.Inventory.Journal;
-using Microsoft.Inventory.Ledger;
-using Microsoft.Inventory.Location;
-using Microsoft.Inventory.Reports;
-using Microsoft.Inventory.Requisition;
-using Microsoft.Inventory.Setup;
-using Microsoft.Inventory.Tracking;
-using Microsoft.Inventory.Transfer;
-using Microsoft.Projects.Project.Job;
-using Microsoft.Purchases.Analysis;
-using Microsoft.Purchases.Archive;
-using Microsoft.Purchases.Document;
-using Microsoft.Purchases.History;
-using Microsoft.Purchases.Payables;
-using Microsoft.Purchases.Reports;
-using Microsoft.Purchases.Setup;
-using Microsoft.Purchases.Vendor;
-using Microsoft.Sales.Document;
-using Microsoft.Utilities;
-
-page 8905 "Purchasing Manager Role Center"
-{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
- Caption = 'Purchasing Manager Role Center';
- PageType = RoleCenter;
- actions
- {
- area(Sections)
- {
- group("Group")
- {
- Caption = 'Purchasing';
- action("Vendors")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendors';
- RunObject = page "Vendor List";
- }
- action("Contacts")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contacts';
- RunObject = page "Contact List";
- }
- action("Quotes")
- {
- ApplicationArea = Suite;
- Caption = 'Purchase Quotes';
- RunObject = page "Purchase Quotes";
- }
- action("Orders")
- {
- ApplicationArea = Suite;
- Caption = 'Purchase Orders';
- RunObject = page "Purchase Order List";
- }
- action("Blanket Orders")
- {
- ApplicationArea = Suite;
- Caption = 'Blanket Purchase Orders';
- RunObject = page "Blanket Purchase Orders";
- }
- action("Return Orders")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Purchase Return Orders';
- RunObject = page "Purchase Return Order List";
- }
- action("Transfer Orders")
- {
- ApplicationArea = Location;
- Caption = 'Transfer Orders';
- RunObject = page "Transfer Orders";
- }
- action("Invoices")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Invoices';
- RunObject = page "Purchase Invoices";
- }
- action("Credit Memos")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Credit Memos';
- RunObject = page "Purchase Credit Memos";
- }
- action("CMR - Return Shipment")
- {
- ApplicationArea = Suite;
- Caption = 'CMR - Return Shipment';
- RunObject = report "CMR - Return Shipment";
- }
- action("Certificates of Supply")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Certificates of Supply';
- RunObject = page "Certificates of Supply";
- }
- action("Purchase Journals")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Journals';
- RunObject = page "Purchase Journal";
- }
- group("Group1")
- {
- Caption = 'Budgets & Analysis';
- action("Purchase Budgets")
- {
- ApplicationArea = PurchaseBudget;
- Caption = 'Purchase Budgets';
- RunObject = page "Budget Names Purchase";
- }
- action("Purchase Analysis Reports")
- {
- ApplicationArea = PurchaseAnalysis;
- Caption = 'Purchase Analysis Reports';
- RunObject = page "Analysis Report Purchase";
- }
- action("Analysis by Dimensions")
- {
- ApplicationArea = Dimensions, PurchaseAnalysis;
- Caption = 'Purchase Analysis by Dimensions';
- RunObject = page "Analysis View List Purchase";
- }
- action("Purch. Order Perf. Analysis")
- {
- ApplicationArea = Suite;
- Caption = 'Analyze Purchase Orders';
- Image = Purchase;
- RunObject = query "Purch. Order Perf. Analysis";
- ToolTip = 'Analyze (group, summarize, pivot) your Purchase Order performance against vendors and goods/services bought, including outstanding vs. posted quantities and amounts.';
- }
- action("Item Dimensions - Detail")
- {
- ApplicationArea = Dimensions;
- Caption = 'Item Dimensions - Detail';
- RunObject = report "Item Dimensions - Detail";
- }
- action("Item Dimensions - Total")
- {
- ApplicationArea = Dimensions;
- Caption = 'Item Dimensions - Total';
- RunObject = report "Item Dimensions - Total";
- }
- }
- group("Group2")
- {
- Caption = 'Registers/Entries';
- action("Purchase Quote Archives")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Quote Archives';
- RunObject = page "Purchase Quote Archives";
- }
- action("Purchase Order Archives")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Order Archives';
- RunObject = page "Purchase Order Archives";
- }
- action("Posted Purchase Invoices")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posted Purchase Invoices';
- RunObject = page "Posted Purchase Invoices";
- }
- action("Posted Return Shipments")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Posted Purchase Return Shipments';
- RunObject = page "Posted Return Shipments";
- }
- action("Posted Credit Memos")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posted Purchase Credit Memos';
- RunObject = page "Posted Purchase Credit Memos";
- }
- action("Posted Purchase Receipts")
- {
- ApplicationArea = Suite;
- Caption = 'Posted Purchase Receipts';
- RunObject = page "Posted Purchase Receipts";
- }
- action("G/L Registers")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'G/L Registers';
- RunObject = page "G/L Registers";
- }
- action("Item Tracing")
- {
- ApplicationArea = ItemTracking;
- Caption = 'Item Tracing';
- RunObject = page "Item Tracing";
- }
- action("Purchase Return Order Archives")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Return Order Archives';
- RunObject = page "Purchase Return List Archive";
- }
- action("Vendor Ledger Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor Ledger Entries';
- RunObject = page "Vendor Ledger Entries";
- }
- action("Detailed Cust. Ledg. Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Detailed Vendor Ledger Entries';
- RunObject = page "Detailed Vendor Ledg. Entries";
- }
- action("Value Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Value Entries';
- RunObject = page "Value Entries";
- }
- action("Navi&gate")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Find entries...';
- Image = Navigate;
- RunObject = Page Navigate;
- ShortCutKey = 'Ctrl+Alt+Q';
- ToolTip = 'Find entries and documents that exist for the document number and posting date on the selected document. (Formerly this action was named Navigate.)';
- }
- }
- group("Group3")
- {
- Caption = 'Reports';
- action("Inventory Purchase Orders")
- {
- ApplicationArea = Suite;
- Caption = 'Inventory Purchase Orders';
- RunObject = report "Inventory Purchase Orders";
- }
- action("Inventory - Transaction Detail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory Transaction Detail';
- RunObject = report "Inventory - Transaction Detail";
- }
- action("Inventory - Reorders")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory Reorders';
- RunObject = report "Inventory - Reorders";
- }
- action("Item/Vendor Catalog")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item/Vendor Catalog';
- RunObject = report "Item/Vendor Catalog";
- }
- action("Vendor/Item Purchases")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor/Item Purchases';
- RunObject = report "Vendor/Item Purchases";
- }
- action("Inventory Cost and Price List")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory Cost and Price List';
- RunObject = report "Inventory Cost and Price List";
- }
- action("Inventory - List")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory - List';
- RunObject = report "Inventory - List";
- }
- action("Inventory Availability")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory Availability';
- RunObject = report "Inventory Availability";
- }
- action("Item Charges - Specification")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Charges - Specification';
- RunObject = report "Item Charges - Specification";
- }
- action("Inventory - Vendor Purchases")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory - Vendor Purchases';
- RunObject = report "Inventory - Vendor Purchases";
- }
- action("Item Substitutions")
- {
- ApplicationArea = Suite;
- Caption = 'Item Substitutions';
- RunObject = report "Item Substitutions";
- }
- // action("Order")
- // {
- // ApplicationArea = Suite;
- // Caption = 'Order';
- // RunObject = codeunit 8815;
- // }
- action("Purchasing Deferral Summary")
- {
- ApplicationArea = Suite;
- Caption = 'Purchasing Deferral Summary';
- RunObject = report "Deferral Summary - Purchasing";
- }
- }
- }
- group("Group4")
- {
- Caption = 'Planning';
- action("Items")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Items';
- RunObject = page "Item List";
- }
- action("Vendors1")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendors';
- RunObject = page "Vendor List";
- }
- action("Orders1")
- {
- ApplicationArea = Suite;
- Caption = 'Purchase Orders';
- RunObject = page "Purchase Order List";
- }
- action("Orders2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Orders';
- RunObject = page "Sales Order List";
- }
- action("Blanket Orders1")
- {
- ApplicationArea = Suite;
- Caption = 'Blanket Sales Orders';
- RunObject = page "Blanket Sales Orders";
- }
- action("Assembly Orders")
- {
- ApplicationArea = Assembly;
- Caption = 'Assembly Orders';
- RunObject = page "Assembly Orders";
- }
- action("Jobs")
- {
- ApplicationArea = Jobs;
- Caption = 'Projects';
- RunObject = page "Job List";
- }
- action("Transfer Orders1")
- {
- ApplicationArea = Location;
- Caption = 'Transfer Orders';
- RunObject = page "Transfer Orders";
- }
- action("Requisition Worksheets")
- {
- ApplicationArea = Planning;
- Caption = 'Requisition Worksheets';
- RunObject = page "Req. Worksheet";
- }
- action("Recurring Req. Worksheet")
- {
- ApplicationArea = Planning;
- Caption = 'Recurring Requisition Worksheets';
- RunObject = page "Recurring Req. Worksheet";
- }
- action("Order Planning")
- {
- ApplicationArea = Planning;
- Caption = 'Order Planning';
- RunObject = page "Order Planning";
- }
- group("Group5")
- {
- Caption = 'Reports';
- action("Purchase Reservation Avail.")
- {
- ApplicationArea = Reservation;
- Caption = 'Purchase Reservation Avail.';
- RunObject = report "Purchase Reservation Avail.";
- }
- action("Nonstock Item Sales")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Nonstock Item Sales';
- RunObject = report "Catalog Item Sales";
- }
- action("Item/Vendor Catalog1")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item/Vendor Catalog';
- RunObject = report "Item/Vendor Catalog";
- }
- action("Purchase Statistics")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Statistics';
- RunObject = report "Purchase Statistics";
- }
- action("Item Substitutions1")
- {
- ApplicationArea = Suite;
- Caption = 'Item Substitutions';
- RunObject = report "Item Substitutions";
- }
- group("Group6")
- {
- Caption = 'Vendor';
- action("Vendor - Balance to Date")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor - Balance to Date';
- RunObject = report "Vendor - Balance to Date";
- }
- action("Vendor/Item Purchases1")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor/Item Purchases';
- RunObject = report "Vendor/Item Purchases";
- }
- action("Vendor - Purchase List")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor - Purchase List';
- RunObject = report "Vendor - Purchase List";
- }
- action("Vendor - Trial Balance")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor - Trial Balance';
- RunObject = report "Vendor - Trial Balance";
- }
- action("Vendor - Detail Trial Balance")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor - Detail Trial Balance';
- RunObject = report "Vendor - Detail Trial Balance";
- }
-#if not CLEAN28
- action("Vendor - Top 10 List")
- {
- ApplicationArea = Suite;
- Caption = 'Vendor - Top 10 List (Obsolete)';
- RunObject = report "Vendor - Top 10 List";
- ObsoleteState = Pending;
- ObsoleteReason = 'This report has been replaced by the report Vendor - Top List (Excel). This report will be removed in a future release.';
- ObsoleteTag = '28.0';
- }
- action("Vendor - List")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor - List (Obsolete)';
- RunObject = report "Vendor - List";
- ObsoleteState = Pending;
- ObsoleteReason = 'This report is obsolete and will be removed in a future release. See the documentation for alternative options.';
- ObsoleteTag = '28.0';
- }
- action("Vendor - Summary Aging")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor - Summary Aging (Obsolete)';
- RunObject = report "Vendor - Summary Aging";
- ObsoleteState = Pending;
- ObsoleteReason = 'This report is obsolete and will be removed in a future release. See the documentation for alternative options.';
- ObsoleteTag = '28.0';
- }
-#endif
- action("Vendor Item Catalog")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor Item Catalog';
- RunObject = report "Vendor Item Catalog";
- }
- }
- group("Group7")
- {
- Caption = 'Inventory';
- action("Inventory - Cost Variance")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory - Cost Variance';
- RunObject = report "Inventory - Cost Variance";
- }
- action("Inventory - Vendor Purchases1")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory - Vendor Purchases';
- RunObject = report "Inventory - Vendor Purchases";
- }
-#if not CLEAN28
- action("Inventory - Availability Plan")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory - Availability Plan (Obsolete)';
- RunObject = report "Inventory - Availability Plan";
- ObsoleteState = Pending;
- ObsoleteReason = 'This report has been replaced by the report Inventory - Availability Plan (Excel). This report will be removed in a future release.';
- ObsoleteTag = '28.0';
- }
-#endif
- action("Inventory - Availability Plan Excel")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory - Availability Plan (Excel)';
- RunObject = report "Inv. Availability Plan";
- ToolTip = 'View a list of the quantity of each item in customer, purchase, and transfer orders and the quantity available in inventory. The list is divided into columns that cover six periods with starting and ending dates as well as the periods before and after those periods. The list is useful when you are planning your inventory purchases.';
- }
- action("Inventory Purchase Orders1")
- {
- ApplicationArea = Suite;
- Caption = 'Inventory Purchase Orders';
- RunObject = report "Inventory Purchase Orders";
- }
- action("Inventory - List1")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory - List';
- RunObject = report "Inventory - List";
- }
- action("Inventory - Inbound Transfer")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory - Inbound Transfer';
- RunObject = report "Inventory - Inbound Transfer";
- }
- action("Inventory Cost and Price List1")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory Cost and Price List';
- RunObject = report "Inventory Cost and Price List";
- }
- }
- }
- }
- group("Group8")
- {
- Caption = 'Inventory & Costing';
- action("Items1")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Items';
- RunObject = page "Item List";
- }
- action("Nonstock Items")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Nonstock Items';
- RunObject = page "Catalog Item List";
- }
- action("Stock keeping Units")
- {
- ApplicationArea = Warehouse;
- Caption = 'Stockkeeping Units';
- RunObject = page "Stockkeeping Unit List";
- }
- action("Adjust Cost - Item Entries...")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Adjust Cost Item Entries';
- RunObject = report "Adjust Cost - Item Entries";
- }
- action("Standard Costs Worksheet")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Standard Costs Worksheet';
- RunObject = page Microsoft.Manufacturing.StandardCost."Standard Cost Worksheet";
- }
- action("Adjust Item Costs/Prices")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Adjust Item Costs/Prices';
- RunObject = report "Adjust Item Costs/Prices";
- }
- group("Group9")
- {
- Caption = 'Journals';
- action("Item Journal")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Journals';
- RunObject = page "Item Journal";
- }
- action("Item Reclass. Journals")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Reclassification Journals';
- RunObject = page "Item Reclass. Journal";
- }
- action("Recurring Item Journals")
- {
- ApplicationArea = Suite;
- Caption = 'Recurring Item Journals';
- RunObject = page "Recurring Item Jnl.";
- }
- }
- group("Group10")
- {
- Caption = 'Reports';
- action("Inventory - List2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory - List';
- RunObject = report "Inventory - List";
- }
-#if not CLEAN28
- action("Item Age Composition - Qty.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Age Composition - Qty. (Obsolete)';
- RunObject = report "Item Age Composition - Qty.";
- ObsoleteState = Pending;
- ObsoleteReason = 'This report has been deprecated and will be removed in a future release.';
- ObsoleteTag = '28.0';
- }
-#endif
- action("Inventory - Cost Variance1")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory - Cost Variance';
- RunObject = report "Inventory - Cost Variance";
- }
- action("Item Charges - Specification1")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Charges - Specification';
- RunObject = report "Item Charges - Specification";
- }
- action("Inventory - Inbound Transfer1")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory - Inbound Transfer';
- RunObject = report "Inventory - Inbound Transfer";
- }
- action("Invt. Valuation - Cost Spec.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Invt. Valuation - Cost Spec.';
- RunObject = report "Invt. Valuation - Cost Spec.";
- }
- action("Item Age Composition - Value")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Age Composition - Value';
- RunObject = report "Item Age Composition - Value";
- }
- action("Inventory Availability1")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory Availability';
- RunObject = report "Inventory Availability";
- }
- action("Item Register - Quantity")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Register - Quantity';
- RunObject = report "Item Register - Quantity";
- }
- action("Item Register - Value")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Register - Value';
- RunObject = report "Item Register - Value";
- }
- action("Item Expiration - Quantity")
- {
- ApplicationArea = ItemTracking;
- Caption = 'Item Expiration - Quantity';
- RunObject = report "Item Expiration - Quantity";
- }
- }
- }
- group("Group11")
- {
- Caption = 'Setup';
- action("Purchases & Payables Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchases & Payables Setup';
- RunObject = page "Purchases & Payables Setup";
- }
- action("Standard Purchase Codes")
- {
- ApplicationArea = Suite;
- Caption = 'Standard Purchase Codes';
- RunObject = page "Standard Purchase Codes";
- }
- action("Purchasing Codes")
- {
- ApplicationArea = Suite;
- Caption = 'Purchasing Codes';
- RunObject = page "Purchasing Codes";
- }
- action("Shipment Methods")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Shipment Methods';
- RunObject = page "Shipment Methods";
- }
- action("Return Reasons")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Return Reasons';
- RunObject = page "Return Reasons";
- }
- action("Report Selection Purchase")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Report Selections Purchase';
- RunObject = page "Report Selection - Purchase";
- }
- action("Req. Worksheet")
- {
- ApplicationArea = Planning;
- Caption = 'Requisition Worksheet Templates';
- RunObject = page "Req. Worksheet Templates";
- }
- action("Units of Measure")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Units of Measure';
- RunObject = page "Units of Measure";
- }
- action("Manufacturers")
- {
- ApplicationArea = Manufacturing;
- Caption = 'Manufacturers';
- RunObject = page "Manufacturers";
- }
- action("Nonstock Item Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Nonstock Item Setup';
- RunObject = page "Catalog Item Setup";
- }
- action("Item Journal Templates")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Journal Templates';
- RunObject = page "Item Journal Templates";
- }
- action("Salespeople")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Salespeople/Purchasers';
- RunObject = page "Salespersons/Purchasers";
- }
- action("Item Disc. Groups")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Discount Groups';
- RunObject = page "Item Disc. Groups";
- }
- action("Item Tracking Codes")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Tracking Codes';
- RunObject = page "Item Tracking Codes";
- }
- action("Inventory Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory Setup';
- RunObject = page "Inventory Setup";
- }
- action("Requisition Worksheets1")
- {
- ApplicationArea = Planning;
- Caption = 'Requisition Worksheets';
- RunObject = page "Req. Worksheet";
- }
- group("Group12")
- {
- Caption = 'Purchase Analysis';
- action("Analysis Types")
- {
- ApplicationArea = SalesAnalysis, PurchaseAnalysis, InventoryAnalysis;
- Caption = 'Analysis Types';
- RunObject = page "Analysis Types";
- }
- action("Analysis by Dimensions1")
- {
- ApplicationArea = Dimensions, PurchaseAnalysis;
- Caption = 'Purchase Analysis by Dimensions';
- RunObject = page "Analysis View List Purchase";
- }
- action("Analysis Column Templates")
- {
- ApplicationArea = PurchaseAnalysis;
- Caption = 'Purch. Analysis Column Templates';
- RunObject = report "Run Purch. Analysis Col. Temp.";
- }
- action("Analysis Line Templates")
- {
- ApplicationArea = PurchaseAnalysis;
- Caption = 'Purch. Analysis Line Templates';
- RunObject = report "Run Purch. Analysis Line Temp.";
- }
- }
- }
- }
- }
-}
diff --git a/src/Layers/NL/BaseApp/Purchases/Vendor/Vendor.Table.al b/src/Layers/NL/BaseApp/Purchases/Vendor/Vendor.Table.al
deleted file mode 100644
index 78e096699a..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/Vendor/Vendor.Table.al
+++ /dev/null
@@ -1,3150 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.Vendor;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.Payment;
-using Microsoft.CRM.BusinessRelation;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Outlook;
-using Microsoft.CRM.Setup;
-using Microsoft.CRM.Team;
-using Microsoft.EServices.EDocument;
-using Microsoft.EServices.OnlineMap;
-using Microsoft.Finance.Analysis;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.Finance.SalesTax;
-using Microsoft.Finance.VAT.Registration;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Calendar;
-using Microsoft.Foundation.Comment;
-using Microsoft.Foundation.Enums;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Foundation.PaymentTerms;
-using Microsoft.Foundation.Period;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Foundation.Shipping;
-using Microsoft.Integration.Dataverse;
-using Microsoft.Integration.Graph;
-using Microsoft.Intercompany.Partner;
-using Microsoft.Inventory;
-using Microsoft.Inventory.Intrastat;
-using Microsoft.Inventory.Item.Catalog;
-using Microsoft.Inventory.Location;
-using Microsoft.Pricing.Calculation;
-using Microsoft.Pricing.PriceList;
-using Microsoft.Pricing.Source;
-using Microsoft.Purchases.Archive;
-using Microsoft.Purchases.Document;
-using Microsoft.Purchases.History;
-using Microsoft.Purchases.Payables;
-using Microsoft.Purchases.Pricing;
-using Microsoft.Purchases.Setup;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.FinanceCharge;
-using Microsoft.Utilities;
-using System;
-using System.Automation;
-using System.Email;
-using System.Globalization;
-using System.Reflection;
-using System.Security.User;
-using System.Utilities;
-
-table 23 Vendor
-{
- Caption = 'Vendor';
- DataCaptionFields = "No.", Name;
- DrillDownPageID = "Vendor List";
- LookupPageID = "Vendor Lookup";
- Permissions = TableData "Vendor Ledger Entry" = r,
- TableData "Price List Header" = rd,
- TableData "Price List Line" = rd,
- TableData "Purchase Price" = rd,
- TableData "Purchase Line Discount" = rd,
- TableData "Purchase Price Access" = rd,
- TableData "Purchase Discount Access" = rd,
- tabledata Language = r,
- tabledata "Language Selection" = r;
- DataClassification = CustomerContent;
-
- fields
- {
- field(1; "No."; Code[20])
- {
- Caption = 'No.';
- ToolTip = 'Specifies the number of the vendor. The field is either filled automatically from a defined number series, or you enter the number manually because you have enabled manual number entry in the number-series setup.';
- OptimizeForTextSearch = true;
-
- trigger OnValidate()
- begin
- if "No." <> xRec."No." then begin
- PurchSetup.Get();
- NoSeries.TestManual(PurchSetup."Vendor Nos.");
- "No. Series" := '';
- end;
- if "Invoice Disc. Code" = '' then
- "Invoice Disc. Code" := "No.";
- OnAfterValidateNo(Rec, xRec);
- end;
- }
- field(2; Name; Text[100])
- {
- Caption = 'Name';
- ToolTip = 'Specifies the vendor''s name. You can enter a maximum of 30 characters, both numbers and letters.';
- OptimizeForTextSearch = true;
-
- trigger OnValidate()
- begin
- if ("Search Name" = UpperCase(xRec.Name)) or ("Search Name" = '') then
- "Search Name" := Name;
- UpdateVendorBankAccounts(FieldCaption(Name));
-
- UpdateMyVendor(FieldNo(Name));
- end;
- }
- field(3; "Search Name"; Code[100])
- {
- Caption = 'Search Name';
- ToolTip = 'Specifies an alternate name that you can use to search for the record in question when you cannot remember the value in the Name field.';
- OptimizeForTextSearch = true;
- }
- field(4; "Name 2"; Text[50])
- {
- Caption = 'Name 2';
- ToolTip = 'Specifies an additional part of the name.';
- OptimizeForTextSearch = true;
- }
- field(5; Address; Text[100])
- {
- Caption = 'Address';
- ToolTip = 'Specifies the vendor street address.';
- OptimizeForTextSearch = true;
-
- trigger OnValidate()
- begin
- UpdateVendorBankAccounts(FieldCaption(Address));
- end;
- }
- field(6; "Address 2"; Text[50])
- {
- Caption = 'Address 2';
- ToolTip = 'Specifies additional address information.';
- OptimizeForTextSearch = true;
- }
- field(7; City; Text[30])
- {
- Caption = 'City';
- ToolTip = 'Specifies the vendor''s city.';
- OptimizeForTextSearch = true;
- TableRelation = if ("Country/Region Code" = const('')) "Post Code".City
- else
- if ("Country/Region Code" = filter(<> '')) "Post Code".City where("Country/Region Code" = field("Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnLookup()
- begin
- OnBeforeLookupCity(Rec, PostCode);
-
- PostCode.LookupPostCode(City, "Post Code", County, "Country/Region Code");
-
- OnAfterLookupCity(Rec, PostCode);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateCity(Rec, PostCode, CurrFieldNo, IsHandled);
- if not IsHandled then
- PostCode.ValidateCity(City, "Post Code", County, "Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- UpdateVendorBankAccounts(FieldCaption(City));
-
- OnAfterValidateCity(Rec, xRec);
- end;
- }
- field(8; Contact; Text[100])
- {
- Caption = 'Contact';
- ToolTip = 'Specifies the name of the person you regularly contact when you do business with this vendor.';
- OptimizeForTextSearch = true;
-
- trigger OnLookup()
- var
- ContactBusinessRelation: Record "Contact Business Relation";
- Cont: Record Contact;
- TempVend: Record Vendor temporary;
- begin
- if ContactBusinessRelation.FindByRelation(ContactBusinessRelation."Link to Table"::Vendor, "No.") then
- Cont.SetRange("Company No.", ContactBusinessRelation."Contact No.")
- else
- Cont.SetRange("Company No.", '');
-
- if "Primary Contact No." <> '' then
- if Cont.Get("Primary Contact No.") then;
- if PAGE.RunModal(0, Cont) = ACTION::LookupOK then begin
- TempVend.Copy(Rec);
- Find();
- TransferFields(TempVend, false);
- Validate("Primary Contact No.", Cont."No.");
- end;
- end;
-
- trigger OnValidate()
- begin
- if MarketingSetup.Get() then
- if MarketingSetup."Bus. Rel. Code for Vendors" <> '' then begin
- if (xRec.Contact = '') and (xRec."Primary Contact No." = '') and (Contact <> '') then begin
- Modify();
- UpdateContFromVend.OnModify(Rec);
- UpdateContFromVend.InsertNewContactPerson(Rec, false);
- Modify(true);
- end;
- exit;
- end;
- end;
- }
- field(9; "Phone No."; Text[30])
- {
- Caption = 'Phone No.';
- ToolTip = 'Specifies the vendor''s telephone number.';
- OptimizeForTextSearch = true;
- ExtendedDatatype = PhoneNo;
-
- trigger OnValidate()
- var
- Char: DotNet Char;
- i: Integer;
- begin
- for i := 1 to StrLen("Phone No.") do
- if Char.IsLetter("Phone No."[i]) then
- FieldError("Phone No.", PhoneNoCannotContainLettersErr);
-
- UpdateMyVendor(FieldNo("Phone No."));
- end;
- }
- field(10; "Telex No."; Text[20])
- {
- Caption = 'Telex No.';
- OptimizeForTextSearch = true;
- }
- field(14; "Our Account No."; Text[20])
- {
- Caption = 'Our Account No.';
- MaskType = Concealed;
- ToolTip = 'Specifies your account number with the vendor, if you have one.';
- OptimizeForTextSearch = true;
- }
- field(15; "Territory Code"; Code[10])
- {
- Caption = 'Territory Code';
- TableRelation = Territory;
- }
- field(16; "Global Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,1,1';
- Caption = 'Global Dimension 1 Code';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1),
- Blocked = const(false));
-
- trigger OnValidate()
- begin
- Rec.ValidateShortcutDimCode(1, "Global Dimension 1 Code");
- end;
- }
- field(17; "Global Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,1,2';
- Caption = 'Global Dimension 2 Code';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2),
- Blocked = const(false));
-
- trigger OnValidate()
- begin
- Rec.ValidateShortcutDimCode(2, "Global Dimension 2 Code");
- end;
- }
- field(19; "Budgeted Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Budgeted Amount';
- }
- field(21; "Vendor Posting Group"; Code[20])
- {
- Caption = 'Vendor Posting Group';
- ToolTip = 'Specifies the vendor''s market type to link business transactions made for the vendor with the appropriate account in the general ledger.';
- TableRelation = "Vendor Posting Group";
- }
- field(22; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- ToolTip = 'Specifies the currency code that is inserted by default when you create purchase documents or journal lines for the vendor.';
- TableRelation = Currency;
-
- trigger OnValidate()
- begin
- UpdateCurrencyId();
- end;
- }
- field(24; "Language Code"; Code[10])
- {
- Caption = 'Language Code';
- ToolTip = 'Specifies the language that is used when translating specified text on documents to foreign business partner, such as an item description on an order confirmation.';
- TableRelation = Language;
-
- trigger OnValidate()
- begin
- UpdateFormatRegion();
- end;
- }
- field(25; "Registration Number"; Text[50])
- {
- Caption = 'Registration No.';
- ToolTip = 'Specifies the registration number of the vendor. You can enter a maximum of 20 characters, both numbers and letters.';
- OptimizeForTextSearch = true;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateRegistrationNumber(Rec, IsHandled);
- if IsHandled then
- exit;
- if StrLen("Registration Number") > 20 then
- FieldError("Registration Number", FieldLengthErr);
- end;
- }
- field(26; "Statistics Group"; Integer)
- {
- Caption = 'Statistics Group';
- ToolTip = 'Specifies the statistics group.';
- }
- field(27; "Payment Terms Code"; Code[10])
- {
- Caption = 'Payment Terms Code';
- ToolTip = 'Specifies a formula that calculates the payment due date, payment discount date, and payment discount amount.';
- TableRelation = "Payment Terms";
-
- trigger OnValidate()
- begin
- UpdatePaymentTermsId();
- end;
- }
- field(28; "Fin. Charge Terms Code"; Code[10])
- {
- Caption = 'Fin. Charge Terms Code';
- ToolTip = 'Specifies the code for the involved finance charges in case of late payment.';
- TableRelation = "Finance Charge Terms";
- }
- field(29; "Purchaser Code"; Code[20])
- {
- Caption = 'Purchaser Code';
- ToolTip = 'Specifies which purchaser is assigned to the vendor.';
- TableRelation = "Salesperson/Purchaser" where(Blocked = const(false));
-
- trigger OnValidate()
- begin
- ValidatePurchaserCode();
- end;
- }
- field(30; "Shipment Method Code"; Code[10])
- {
- Caption = 'Shipment Method Code';
- ToolTip = 'Specifies the delivery conditions of the related shipment, such as free on board (FOB).';
- TableRelation = "Shipment Method";
- }
- field(31; "Shipping Agent Code"; Code[10])
- {
- Caption = 'Shipping Agent Code';
- TableRelation = "Shipping Agent";
- }
- field(33; "Invoice Disc. Code"; Code[20])
- {
- Caption = 'Invoice Disc. Code';
- ToolTip = 'Specifies the vendor''s invoice discount code. When you set up a new vendor card, the number you have entered in the No. field is automatically inserted.';
- TableRelation = Vendor;
- ValidateTableRelation = false;
- }
- field(35; "Country/Region Code"; Code[10])
- {
- Caption = 'Country/Region Code';
- ToolTip = 'Specifies the country/region of the address.';
- TableRelation = "Country/Region";
-
- trigger OnValidate()
- begin
- UpdateVendorBankAccounts(FieldCaption("Country/Region Code"));
- PostCode.CheckClearPostCodeCityCounty(City, "Post Code", County, "Country/Region Code", xRec."Country/Region Code");
-
- if "Country/Region Code" <> xRec."Country/Region Code" then
- VATRegistrationValidation();
- end;
- }
- field(38; Comment; Boolean)
- {
- CalcFormula = exist("Comment Line" where("Table Name" = const(Vendor),
- "No." = field("No.")));
- Caption = 'Comment';
- Editable = false;
- FieldClass = FlowField;
- }
- field(39; Blocked; Enum "Vendor Blocked")
- {
- Caption = 'Blocked';
- ToolTip = 'Specifies whether transactions with this vendor are restricted. Use this field to control vendor activity, such as temporarily halting payments or fully blocking a vendor due to compliance or business decisions. The field can have one of the following values: (blank) - No restrictions, all transactions are allowed. All - All transactions with this vendor are blocked. You cannot create or post any documents or journals with the vendor. Payment - Only payment transactions are blocked. You can still create and post purchase documents, but you cannot make payments to the vendor.';
-
- trigger OnValidate()
- begin
- if (Blocked <> Blocked::All) and "Privacy Blocked" then
- if GuiAllowed then
- if Confirm(ConfirmBlockedPrivacyBlockedQst) then
- "Privacy Blocked" := false
- else
- Error('')
- else
- Error(CanNotChangeBlockedDueToPrivacyBlockedErr);
- end;
- }
- field(45; "Pay-to Vendor No."; Code[20])
- {
- Caption = 'Pay-to Vendor No.';
- ToolTip = 'Specifies the number of a different vendor whom you pay for products delivered by the vendor on the vendor card.';
- TableRelation = Vendor;
- OptimizeForTextSearch = true;
- }
- field(46; Priority; Integer)
- {
- Caption = 'Priority';
- ToolTip = 'Specifies the importance of the vendor when suggesting payments using the Suggest Vendor Payments function.';
- }
- field(47; "Payment Method Code"; Code[10])
- {
- Caption = 'Payment Method Code';
- ToolTip = 'Specifies how to make payment, such as with bank transfer, cash, or check.';
- TableRelation = "Payment Method";
-
- trigger OnValidate()
- begin
- UpdatePaymentMethodId();
- end;
- }
- field(48; "Format Region"; Text[80])
- {
- Caption = 'Format Region';
- ToolTip = 'Specifies the region format to be used on printouts for this vendor.';
- OptimizeForTextSearch = true;
- TableRelation = "Language Selection"."Language Tag";
- }
-#pragma warning disable AA0232
- field(52; "First Transaction Date"; Date)
- {
- Caption = 'Vendor Since';
- ToolTip = 'Specifies the date of the first transaction with the vendor.';
- FieldClass = FlowField;
- CalcFormula = min("Vendor Ledger Entry"."Posting Date" where("Vendor No." = field("No.")));
- }
-#pragma warning restore AA0232
- field(53; "Last Modified Date Time"; DateTime)
- {
- Caption = 'Last Modified Date Time';
- Editable = false;
- }
- field(54; "Last Date Modified"; Date)
- {
- Caption = 'Last Date Modified';
- ToolTip = 'Specifies when the vendor card was last modified.';
- Editable = false;
- }
- field(55; "Date Filter"; Date)
- {
- Caption = 'Date Filter';
- FieldClass = FlowFilter;
- }
- field(56; "Global Dimension 1 Filter"; Code[20])
- {
- CaptionClass = '1,3,1';
- Caption = 'Global Dimension 1 Filter';
- FieldClass = FlowFilter;
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1));
- }
- field(57; "Global Dimension 2 Filter"; Code[20])
- {
- CaptionClass = '1,3,2';
- Caption = 'Global Dimension 2 Filter';
- FieldClass = FlowFilter;
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2));
- }
- field(58; Balance; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = - sum("Detailed Vendor Ledg. Entry".Amount where("Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Balance';
- Editable = false;
- FieldClass = FlowField;
- }
- field(59; "Balance (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = - sum("Detailed Vendor Ledg. Entry"."Amount (LCY)" where("Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Balance (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(60; "Net Change"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = - sum("Detailed Vendor Ledg. Entry".Amount where("Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Net Change';
- Editable = false;
- FieldClass = FlowField;
- }
- field(61; "Net Change (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = - sum("Detailed Vendor Ledg. Entry"."Amount (LCY)" where("Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Net Change (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(62; "Purchases (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = - sum("Vendor Ledger Entry"."Purchase (LCY)" where("Vendor No." = field("No."),
- "Global Dimension 1 Code" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Code" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Purchases (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(64; "Inv. Discounts (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = - sum("Vendor Ledger Entry"."Inv. Discount (LCY)" where("Vendor No." = field("No."),
- "Global Dimension 1 Code" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Code" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Inv. Discounts (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(65; "Pmt. Discounts (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Vendor Ledg. Entry"."Amount (LCY)" where("Vendor No." = field("No."),
- "Entry Type" = filter("Payment Discount" .. "Payment Discount (VAT Adjustment)"),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Pmt. Discounts (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(66; "Balance Due"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = - sum("Detailed Vendor Ledg. Entry".Amount where("Vendor No." = field("No."),
- "Initial Entry Due Date" = field(upperlimit("Date Filter")),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Balance Due';
- Editable = false;
- FieldClass = FlowField;
- }
- field(67; "Balance Due (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = - sum("Detailed Vendor Ledg. Entry"."Amount (LCY)" where("Vendor No." = field("No."),
- "Initial Entry Due Date" = field(upperlimit("Date Filter")),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Balance Due (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(69; Payments; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Vendor Ledg. Entry".Amount where("Initial Document Type" = const(Payment),
- "Entry Type" = const("Initial Entry"),
- "Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Payments';
- Editable = false;
- FieldClass = FlowField;
- }
- field(70; "Invoice Amounts"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = - sum("Detailed Vendor Ledg. Entry".Amount where("Initial Document Type" = const(Invoice),
- "Entry Type" = const("Initial Entry"),
- "Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Invoice Amounts';
- Editable = false;
- FieldClass = FlowField;
- }
- field(71; "Cr. Memo Amounts"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Vendor Ledg. Entry".Amount where("Initial Document Type" = const("Credit Memo"),
- "Entry Type" = const("Initial Entry"),
- "Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Cr. Memo Amounts';
- Editable = false;
- FieldClass = FlowField;
- }
- field(72; "Finance Charge Memo Amounts"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = - sum("Detailed Vendor Ledg. Entry".Amount where("Initial Document Type" = const("Finance Charge Memo"),
- "Entry Type" = const("Initial Entry"),
- "Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Finance Charge Memo Amounts';
- Editable = false;
- FieldClass = FlowField;
- }
- field(74; "Payments (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Vendor Ledg. Entry"."Amount (LCY)" where("Initial Document Type" = const(Payment),
- "Entry Type" = const("Initial Entry"),
- "Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Payments (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(75; "Inv. Amounts (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = - sum("Detailed Vendor Ledg. Entry"."Amount (LCY)" where("Initial Document Type" = const(Invoice),
- "Entry Type" = const("Initial Entry"),
- "Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Inv. Amounts (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(76; "Cr. Memo Amounts (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Vendor Ledg. Entry"."Amount (LCY)" where("Initial Document Type" = const("Credit Memo"),
- "Entry Type" = const("Initial Entry"),
- "Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Cr. Memo Amounts (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(77; "Fin. Charge Memo Amounts (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = - sum("Detailed Vendor Ledg. Entry"."Amount (LCY)" where("Initial Document Type" = const("Finance Charge Memo"),
- "Entry Type" = const("Initial Entry"),
- "Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Fin. Charge Memo Amounts (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(78; "Outstanding Orders"; Decimal)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Purchase Line"."Outstanding Amount" where("Document Type" = const(Order),
- "Pay-to Vendor No." = field("No."),
- "Shortcut Dimension 1 Code" = field("Global Dimension 1 Filter"),
- "Shortcut Dimension 2 Code" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Outstanding Orders';
- Editable = false;
- FieldClass = FlowField;
- }
- field(79; "Amt. Rcd. Not Invoiced"; Decimal)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Purchase Line"."Amt. Rcd. Not Invoiced" where("Document Type" = const(Order),
- "Pay-to Vendor No." = field("No."),
- "Shortcut Dimension 1 Code" = field("Global Dimension 1 Filter"),
- "Shortcut Dimension 2 Code" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Amt. Rcd. Not Invoiced';
- Editable = false;
- FieldClass = FlowField;
- }
- field(80; "Application Method"; Enum "Application Method")
- {
- Caption = 'Application Method';
- ToolTip = 'Specifies how to apply payments to entries for this vendor.';
- }
- field(82; "Prices Including VAT"; Boolean)
- {
- Caption = 'Prices Including VAT';
- ToolTip = 'Specifies if the Unit Price and Line Amount fields on document lines should be shown with or without VAT.';
- }
- field(84; "Fax No."; Text[30])
- {
- Caption = 'Fax No.';
- ToolTip = 'Specifies the vendor''s fax number.';
- OptimizeForTextSearch = true;
- }
- field(85; "Telex Answer Back"; Text[20])
- {
- Caption = 'Telex Answer Back';
- OptimizeForTextSearch = true;
- }
- field(86; "VAT Registration No."; Text[20])
- {
- Caption = 'VAT Registration No.';
- ToolTip = 'Specifies the vendor''s VAT registration number.';
- OptimizeForTextSearch = true;
-
- trigger OnValidate()
- var
- VATRegistrationLog: Record "VAT Registration Log";
- VATRegNoFormat: Record "VAT Registration No. Format";
- VATRegNoSrvConfig: Record "VAT Reg. No. Srv Config";
- VATRegistrationLogMgt: Codeunit "VAT Registration Log Mgt.";
- ResultRecordRef: RecordRef;
- ApplicableCountryCode: Code[10];
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateVATRegistrationNo(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
- "VAT Registration No." := UpperCase("VAT Registration No.");
- if "VAT Registration No." = xRec."VAT Registration No." then
- exit;
- if not VATRegNoFormat.Test("VAT Registration No.", "Country/Region Code", "No.", DATABASE::Vendor) then
- exit;
- VATRegistrationLogMgt.LogVendor(Rec);
-
- if ("Country/Region Code" = '') and (VATRegNoFormat."Country/Region Code" = '') then
- exit;
- ApplicableCountryCode := "Country/Region Code";
- if ApplicableCountryCode = '' then
- ApplicableCountryCode := VATRegNoFormat."Country/Region Code";
- if VATRegNoSrvConfig.VATRegNoSrvIsEnabled() then begin
- VATRegistrationLogMgt.ValidateVATRegNoWithVIES(
- ResultRecordRef, Rec, "No.", VATRegistrationLog."Account Type"::Vendor.AsInteger(), ApplicableCountryCode);
- ResultRecordRef.SetTable(Rec);
- end;
- end;
- }
- field(88; "Gen. Bus. Posting Group"; Code[20])
- {
- Caption = 'Gen. Bus. Posting Group';
- ToolTip = 'Specifies the vendor''s trade type to link transactions made for this vendor with the appropriate general ledger account according to the general posting setup.';
- TableRelation = "Gen. Business Posting Group";
-
- trigger OnValidate()
- begin
- if xRec."Gen. Bus. Posting Group" <> "Gen. Bus. Posting Group" then
- if GenBusPostingGrp.ValidateVatBusPostingGroup(GenBusPostingGrp, "Gen. Bus. Posting Group") then
- Validate("VAT Bus. Posting Group", GenBusPostingGrp."Def. VAT Bus. Posting Group");
- end;
- }
- field(90; GLN; Code[13])
- {
- Caption = 'GLN';
- ToolTip = 'Specifies the vendor in connection with electronic document receiving.';
- Numeric = true;
-
- trigger OnValidate()
- var
- GLNCalculator: Codeunit "GLN Calculator";
- begin
- if GLN <> '' then
- GLNCalculator.AssertValidCheckDigit13(GLN);
- end;
- }
- field(91; "Post Code"; Code[20])
- {
- Caption = 'Post Code';
- ToolTip = 'Specifies the postal code.';
- TableRelation = if ("Country/Region Code" = const('')) "Post Code"
- else
- if ("Country/Region Code" = filter(<> '')) "Post Code" where("Country/Region Code" = field("Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnLookup()
- begin
- OnBeforeLookupPostCode(Rec, PostCode);
-
- PostCode.LookupPostCode(City, "Post Code", County, "Country/Region Code");
-
- OnAfterLookupPostCode(Rec, PostCode);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePostCode(Rec, PostCode, CurrFieldNo, IsHandled);
- if not IsHandled then
- PostCode.ValidatePostCode(City, "Post Code", County, "Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- UpdateVendorBankAccounts(FieldCaption("Post Code"));
-
- OnAfterValidatePostCode(Rec, xRec);
- end;
- }
- field(92; County; Text[30])
- {
- CaptionClass = '5,1,' + "Country/Region Code";
- Caption = 'County';
- ToolTip = 'Specifies the state, province or county as a part of the address.';
- OptimizeForTextSearch = true;
- }
- field(93; "EORI Number"; Text[40])
- {
- Caption = 'EORI Number';
- ToolTip = 'Specifies the Economic Operators Registration and Identification number that is used when you exchange information with the customs authorities due to trade into or out of the European Union.';
- OptimizeForTextSearch = true;
- }
- field(97; "Debit Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- BlankZero = true;
- CalcFormula = sum("Detailed Vendor Ledg. Entry"."Debit Amount" where("Vendor No." = field("No."),
- "Entry Type" = filter(<> Application),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Debit Amount';
- Editable = false;
- FieldClass = FlowField;
- }
- field(98; "Credit Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- BlankZero = true;
- CalcFormula = sum("Detailed Vendor Ledg. Entry"."Credit Amount" where("Vendor No." = field("No."),
- "Entry Type" = filter(<> Application),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Credit Amount';
- Editable = false;
- FieldClass = FlowField;
- }
- field(99; "Debit Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- BlankZero = true;
- CalcFormula = sum("Detailed Vendor Ledg. Entry"."Debit Amount (LCY)" where("Vendor No." = field("No."),
- "Entry Type" = filter(<> Application),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Debit Amount (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(100; "Credit Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- BlankZero = true;
- CalcFormula = sum("Detailed Vendor Ledg. Entry"."Credit Amount (LCY)" where("Vendor No." = field("No."),
- "Entry Type" = filter(<> Application),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Credit Amount (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(102; "E-Mail"; Text[80])
- {
- Caption = 'Email';
- ToolTip = 'Specifies the vendor''s email address.';
- OptimizeForTextSearch = true;
- ExtendedDatatype = EMail;
-
- trigger OnValidate()
- var
- MailManagement: Codeunit "Mail Management";
- begin
- if "E-Mail" = '' then
- exit;
- MailManagement.CheckValidEmailAddresses("E-Mail");
- end;
- }
-#if not CLEAN27
-#pragma warning disable AS0086
-#endif
- field(103; "Home Page"; Text[255])
-#if not CLEAN27
-#pragma warning restore AS0086
-#endif
- {
- Caption = 'Home Page';
- ToolTip = 'Specifies the vendor''s web site.';
- OptimizeForTextSearch = true;
- ExtendedDatatype = URL;
- }
- field(104; "Reminder Amounts"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = - sum("Detailed Vendor Ledg. Entry".Amount where("Initial Document Type" = const(Reminder),
- "Entry Type" = const("Initial Entry"),
- "Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Reminder Amounts';
- Editable = false;
- FieldClass = FlowField;
- }
- field(105; "Reminder Amounts (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = - sum("Detailed Vendor Ledg. Entry"."Amount (LCY)" where("Initial Document Type" = const(Reminder),
- "Entry Type" = const("Initial Entry"),
- "Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Reminder Amounts (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(107; "No. Series"; Code[20])
- {
- Caption = 'No. Series';
- Editable = false;
- TableRelation = "No. Series";
- }
- field(108; "Tax Area Code"; Code[20])
- {
- Caption = 'Tax Area Code';
- ToolTip = 'Specifies a tax area code for the company.';
- TableRelation = "Tax Area";
- }
- field(109; "Tax Liable"; Boolean)
- {
- Caption = 'Tax Liable';
- ToolTip = 'Specifies if the customer is liable for sales tax.';
- }
- field(110; "VAT Bus. Posting Group"; Code[20])
- {
- Caption = 'VAT Bus. Posting Group';
- ToolTip = 'Specifies the VAT specification of the involved customer or vendor to link transactions made for this record with the appropriate general ledger account according to the VAT posting setup.';
- TableRelation = "VAT Business Posting Group";
- }
- field(111; "Currency Filter"; Code[10])
- {
- Caption = 'Currency Filter';
- FieldClass = FlowFilter;
- TableRelation = Currency;
- }
- field(113; "Outstanding Orders (LCY)"; Decimal)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Purchase Line"."Outstanding Amount (LCY)" where("Document Type" = const(Order),
- "Pay-to Vendor No." = field("No."),
- "Shortcut Dimension 1 Code" = field("Global Dimension 1 Filter"),
- "Shortcut Dimension 2 Code" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Outstanding Orders (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(114; "Amt. Rcd. Not Invoiced (LCY)"; Decimal)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Purchase Line"."Amt. Rcd. Not Invoiced (LCY)" where("Document Type" = const(Order),
- "Pay-to Vendor No." = field("No."),
- "Shortcut Dimension 1 Code" = field("Global Dimension 1 Filter"),
- "Shortcut Dimension 2 Code" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Amt. Rcd. Not Invoiced (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(116; "Block Payment Tolerance"; Boolean)
- {
- Caption = 'Block Payment Tolerance';
- ToolTip = 'Specifies if the vendor allows payment tolerance.';
- }
- field(117; "Pmt. Disc. Tolerance (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Vendor Ledg. Entry"."Amount (LCY)" where("Vendor No." = field("No."),
- "Entry Type" = filter("Payment Discount Tolerance" | "Payment Discount Tolerance (VAT Adjustment)" | "Payment Discount Tolerance (VAT Excl.)"),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Pmt. Disc. Tolerance (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(118; "Pmt. Tolerance (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Vendor Ledg. Entry"."Amount (LCY)" where("Vendor No." = field("No."),
- "Entry Type" = filter("Payment Tolerance" | "Payment Tolerance (VAT Adjustment)" | "Payment Tolerance (VAT Excl.)"),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Pmt. Tolerance (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(119; "IC Partner Code"; Code[20])
- {
- Caption = 'IC Partner Code';
- ToolTip = 'Specifies the vendor''s intercompany partner code.';
- TableRelation = "IC Partner";
-
- trigger OnValidate()
- var
- VendLedgEntry: Record "Vendor Ledger Entry";
- AccountingPeriod: Record "Accounting Period";
- ICPartner: Record "IC Partner";
- ConfirmManagement: Codeunit "Confirm Management";
- begin
- if xRec."IC Partner Code" <> "IC Partner Code" then begin
- if not VendLedgEntry.SetCurrentKey("Vendor No.", Open) then
- VendLedgEntry.SetCurrentKey("Vendor No.");
- VendLedgEntry.SetRange("Vendor No.", "No.");
- VendLedgEntry.SetRange(Open, true);
- if VendLedgEntry.FindLast() then
- Error(Text010, FieldCaption("IC Partner Code"), TableCaption);
-
- VendLedgEntry.Reset();
- VendLedgEntry.SetCurrentKey("Vendor No.", "Posting Date");
- VendLedgEntry.SetRange("Vendor No.", "No.");
- AccountingPeriod.SetRange(Closed, false);
- if AccountingPeriod.FindFirst() then begin
- VendLedgEntry.SetFilter("Posting Date", '>=%1', AccountingPeriod."Starting Date");
- if VendLedgEntry.FindFirst() then
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text009, TableCaption), true) then
- "IC Partner Code" := xRec."IC Partner Code";
- end;
- end;
-
- if "IC Partner Code" <> '' then begin
- ICPartner.Get("IC Partner Code");
- if (ICPartner."Vendor No." <> '') and (ICPartner."Vendor No." <> "No.") then
- Error(Text008, FieldCaption("IC Partner Code"), "IC Partner Code", TableCaption(), ICPartner."Vendor No.");
- ICPartner."Vendor No." := "No.";
- ICPartner.Modify();
- end;
-
- if (xRec."IC Partner Code" <> "IC Partner Code") and ICPartner.Get(xRec."IC Partner Code") then begin
- ICPartner."Vendor No." := '';
- ICPartner.Modify();
- end;
- end;
- }
- field(120; Refunds; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = Rec."Currency Code";
- CalcFormula = - sum("Detailed Vendor Ledg. Entry".Amount where("Initial Document Type" = const(Refund),
- "Entry Type" = const("Initial Entry"),
- "Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Refunds';
- FieldClass = FlowField;
- }
- field(121; "Refunds (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = - sum("Detailed Vendor Ledg. Entry"."Amount (LCY)" where("Initial Document Type" = const(Refund),
- "Entry Type" = const("Initial Entry"),
- "Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Refunds (LCY)';
- FieldClass = FlowField;
- }
- field(122; "Other Amounts"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = Rec."Currency Code";
- CalcFormula = - sum("Detailed Vendor Ledg. Entry".Amount where("Initial Document Type" = const(" "),
- "Entry Type" = const("Initial Entry"),
- "Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Other Amounts';
- FieldClass = FlowField;
- }
- field(123; "Other Amounts (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = - sum("Detailed Vendor Ledg. Entry"."Amount (LCY)" where("Initial Document Type" = const(" "),
- "Entry Type" = const("Initial Entry"),
- "Vendor No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Other Amounts (LCY)';
- FieldClass = FlowField;
- }
- field(124; "Prepayment %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Prepayment %';
- ToolTip = 'Specifies a prepayment percentage that applies to all orders for this vendor, regardless of the items or services on the order lines.';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
- }
- field(125; "Outstanding Invoices"; Decimal)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Purchase Line"."Outstanding Amount" where("Document Type" = const(Invoice),
- "Pay-to Vendor No." = field("No."),
- "Shortcut Dimension 1 Code" = field("Global Dimension 1 Filter"),
- "Shortcut Dimension 2 Code" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Outstanding Invoices';
- Editable = false;
- FieldClass = FlowField;
- }
- field(126; "Outstanding Invoices (LCY)"; Decimal)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Purchase Line"."Outstanding Amount (LCY)" where("Document Type" = const(Invoice),
- "Pay-to Vendor No." = field("No."),
- "Shortcut Dimension 1 Code" = field("Global Dimension 1 Filter"),
- "Shortcut Dimension 2 Code" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Outstanding Invoices (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- field(130; "Pay-to No. Of Archived Doc."; Integer)
- {
- CalcFormula = count("Purchase Header Archive" where("Document Type" = const(Order),
- "Pay-to Vendor No." = field("No.")));
- Caption = 'Pay-to No. Of Archived Doc.';
- FieldClass = FlowField;
- }
- field(131; "Buy-from No. Of Archived Doc."; Integer)
- {
- CalcFormula = count("Purchase Header Archive" where("Document Type" = const(Order),
- "Buy-from Vendor No." = field("No.")));
- Caption = 'Buy-from No. Of Archived Doc.';
- FieldClass = FlowField;
- }
- field(132; "Partner Type"; Enum "Partner Type")
- {
- Caption = 'Partner Type';
- ToolTip = 'Specifies if the vendor is a person or a company.';
-
- trigger OnValidate()
- var
- AccountType: Option Customer,Vendor,Employee;
- TransactionMode: Record "Transaction Mode";
- begin
- if not TransactionMode.CheckTransactionModePartnerType(AccountType::Vendor, "Transaction Mode Code", "Partner Type") then
- if not Confirm(PartnerTypeMismatchMsg, false) then
- Error('')
- end;
- }
- field(133; "Intrastat Partner Type"; Enum "Partner Type")
- {
- Caption = 'Intrastat Partner Type';
- ToolTip = 'Specifies for Intrastat reporting if the vendor is a person or a company.';
- }
- field(134; "Exclude from Pmt. Practices"; Boolean)
- {
- Caption = 'Exclude from Payment Practices';
- ToolTip = 'Specifies that the vendor must be excluded from Payment Practices calculations.';
- }
- field(135; "Company Size Code"; Code[20])
- {
- Caption = 'Company Size Code';
- ToolTip = 'Specifies the size of the vendor''s company.';
- TableRelation = "Company Size";
- }
- field(140; Image; Media)
- {
- Caption = 'Image';
- ToolTip = 'Specifies the picture of the vendor, for example, a logo.';
- ExtendedDatatype = Person;
- }
- field(150; "Privacy Blocked"; Boolean)
- {
- Caption = 'Privacy Blocked';
- ToolTip = 'Specifies whether to limit access to data for the data subject during daily operations. This is useful, for example, when protecting data from changes while it is under privacy review.';
-
- trigger OnValidate()
- begin
- if "Privacy Blocked" then
- Blocked := Blocked::All
- else
- Blocked := Blocked::" ";
- end;
- }
- field(160; "Disable Search by Name"; Boolean)
- {
- Caption = 'Disable Search by Name';
- ToolTip = 'Specifies that you can change the vendor name on open purchase documents. The change applies only to the documents.';
- DataClassification = SystemMetadata;
- }
- field(170; "Creditor No."; Code[20])
- {
- Caption = 'Creditor No.';
- ToolTip = 'Specifies the number of the vendor.';
- }
- field(175; "Allow Multiple Posting Groups"; Boolean)
- {
- Caption = 'Allow Multiple Posting Groups';
- ToolTip = 'Specifies if multiple posting groups can be used for posting business transactions for this vendor.';
- DataClassification = SystemMetadata;
- }
- field(180; "Self-Billing Agreement"; Boolean)
- {
- Caption = 'Self-Billing Agreement';
- ToolTip = 'Specifies the value of the Self-Billing Agreement field.';
- }
- field(288; "Preferred Bank Account Code"; Code[20])
- {
- Caption = 'Preferred Bank Account Code';
- ToolTip = 'Specifies the vendor bank account that will be used by default on payment journal lines for export to a payment bank file.';
- TableRelation = "Vendor Bank Account".Code where("Vendor No." = field("No."));
- }
-#if not CLEANSCHEMA26
- field(720; "Coupled to CRM"; Boolean)
- {
- Caption = 'Coupled to Dataverse';
- Editable = false;
- ObsoleteReason = 'Replaced by flow field Coupled to Dataverse';
- ObsoleteState = Removed;
- ObsoleteTag = '26.0';
- }
-#endif
- field(721; "Coupled to Dataverse"; Boolean)
- {
- FieldClass = FlowField;
- Caption = 'Coupled to Dataverse';
- ToolTip = 'Specifies that the vendor is coupled to an account in Dataverse.';
- Editable = false;
- CalcFormula = exist("CRM Integration Record" where("Integration ID" = field(SystemId), "Table ID" = const(Database::Vendor)));
- }
- field(840; "Cash Flow Payment Terms Code"; Code[10])
- {
- Caption = 'Cash Flow Payment Terms Code';
- ToolTip = 'Specifies a payment term that will be used for calculating cash flow.';
- TableRelation = "Payment Terms";
- }
- field(5049; "Primary Contact No."; Code[20])
- {
- Caption = 'Primary Contact No.';
- ToolTip = 'Specifies the primary contact number for the vendor.';
- TableRelation = Contact;
-
- trigger OnLookup()
- var
- Cont: Record Contact;
- ContBusRel: Record "Contact Business Relation";
- TempVend: Record Vendor temporary;
- begin
- Cont.FilterGroup(2);
- ContBusRel.SetCurrentKey("Link to Table", "No.");
- ContBusRel.SetRange("Link to Table", ContBusRel."Link to Table"::Vendor);
- ContBusRel.SetRange("No.", "No.");
- if ContBusRel.FindFirst() then
- Cont.SetRange("Company No.", ContBusRel."Contact No.")
- else
- Cont.SetRange("No.", '');
-
- if "Primary Contact No." <> '' then
- if Cont.Get("Primary Contact No.") then;
- if PAGE.RunModal(0, Cont) = ACTION::LookupOK then begin
- TempVend.Copy(Rec);
- Find();
- TransferFields(TempVend, false);
- Validate("Primary Contact No.", Cont."No.");
- end;
- end;
-
- trigger OnValidate()
- var
- Cont: Record Contact;
- ContBusRel: Record "Contact Business Relation";
- begin
- Contact := '';
- if "Primary Contact No." <> '' then begin
- Cont.Get("Primary Contact No.");
-
- ContBusRel.FindOrRestoreContactBusinessRelation(Cont, Rec, ContBusRel."Link to Table"::Vendor);
-
- if Cont."Company No." <> ContBusRel."Contact No." then
- Error(Text004, Cont."No.", Cont.Name, "No.", Name);
-
- if Cont.Type = Cont.Type::Person then begin
- Contact := Cont.Name;
- exit;
- end;
-
- if Cont."Phone No." <> '' then begin
- "Phone No." := Cont."Phone No.";
- UpdateMyVendor(FieldNo("Phone No."));
- end;
- if Cont."E-Mail" <> '' then
- "E-Mail" := Cont."E-Mail";
- end;
- end;
- }
- field(5061; "Mobile Phone No."; Text[30])
- {
- Caption = 'Mobile Phone No.';
- ToolTip = 'Specifies the vendor''s mobile telephone number.';
- OptimizeForTextSearch = true;
- ExtendedDatatype = PhoneNo;
-
- trigger OnValidate()
- var
- Char: DotNet Char;
- i: Integer;
- begin
- for i := 1 to StrLen("Mobile Phone No.") do
- if Char.IsLetter("Mobile Phone No."[i]) then
- FieldError("Mobile Phone No.", PhoneNoCannotContainLettersErr);
- end;
- }
-
- field(5700; "Responsibility Center"; Code[10])
- {
- Caption = 'Responsibility Center';
- ToolTip = 'Specifies the code of the responsibility center, such as a distribution hub, that is associated with the involved user, company, customer, or vendor.';
- TableRelation = "Responsibility Center";
- }
- field(5701; "Location Code"; Code[10])
- {
- Caption = 'Location Code';
- ToolTip = 'Specifies the warehouse location where items from the vendor must be received by default.';
- TableRelation = Location where("Use As In-Transit" = const(false));
- }
- field(5790; "Lead Time Calculation"; DateFormula)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- Caption = 'Lead Time Calculation';
- ToolTip = 'Specifies a date formula for the amount of time it takes to replenish the item.';
-
- trigger OnValidate()
- begin
- LeadTimeMgt.CheckLeadTimeIsNotNegative("Lead Time Calculation");
- end;
- }
- field(7000; "Price Calculation Method"; Enum "Price Calculation Method")
- {
- Caption = 'Price Calculation Method';
- ToolTip = 'Specifies the default price calculation method.';
-
- trigger OnValidate()
- var
- PriceCalculationMgt: Codeunit "Price Calculation Mgt.";
- PriceType: Enum "Price Type";
- begin
- if "Price Calculation Method" <> "Price Calculation Method"::" " then
- PriceCalculationMgt.VerifyMethodImplemented("Price Calculation Method", PriceType::Purchase);
- end;
- }
- field(7177; "No. of Pstd. Receipts"; Integer)
- {
- CalcFormula = count("Purch. Rcpt. Header" where("Buy-from Vendor No." = field("No.")));
- Caption = 'No. of Pstd. Receipts';
- ToolTip = 'Specifies the number of posted purchase receipts that exist for the vendor.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7178; "No. of Pstd. Invoices"; Integer)
- {
- CalcFormula = count("Purch. Inv. Header" where("Buy-from Vendor No." = field("No.")));
- Caption = 'No. of Pstd. Invoices';
- ToolTip = 'Specifies the number of posted purchase invoices that exist for the vendor.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7179; "No. of Pstd. Return Shipments"; Integer)
- {
- CalcFormula = count("Return Shipment Header" where("Buy-from Vendor No." = field("No.")));
- Caption = 'No. of Pstd. Return Shipments';
- ToolTip = 'Specifies the number of posted return shipments that exist for the vendor.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7180; "No. of Pstd. Credit Memos"; Integer)
- {
- CalcFormula = count("Purch. Cr. Memo Hdr." where("Buy-from Vendor No." = field("No.")));
- Caption = 'No. of Pstd. Credit Memos';
- ToolTip = 'Specifies the number of posted purchase credit memos that exist for the vendor.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7181; "Pay-to No. of Orders"; Integer)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- CalcFormula = count("Purchase Header" where("Document Type" = const(Order),
- "Pay-to Vendor No." = field("No.")));
- Caption = 'Pay-to No. of Orders';
- ToolTip = 'Specifies the number of posted orders that exist for the customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7182; "Pay-to No. of Invoices"; Integer)
- {
- CalcFormula = count("Purchase Header" where("Document Type" = const(Invoice),
- "Pay-to Vendor No." = field("No.")));
- Caption = 'Pay-to No. of Invoices';
- ToolTip = 'Specifies the amount that relates to invoices.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7183; "Pay-to No. of Return Orders"; Integer)
- {
- AccessByPermission = TableData "Return Shipment Header" = R;
- CalcFormula = count("Purchase Header" where("Document Type" = const("Return Order"),
- "Pay-to Vendor No." = field("No.")));
- Caption = 'Pay-to No. of Return Orders';
- ToolTip = 'Specifies how many return orders have been registered for the customer when the customer acts as the pay-to customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7184; "Pay-to No. of Credit Memos"; Integer)
- {
- CalcFormula = count("Purchase Header" where("Document Type" = const("Credit Memo"),
- "Pay-to Vendor No." = field("No.")));
- Caption = 'Pay-to No. of Credit Memos';
- ToolTip = 'Specifies the amount that relates to credit memos.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7185; "Pay-to No. of Pstd. Receipts"; Integer)
- {
- CalcFormula = count("Purch. Rcpt. Header" where("Pay-to Vendor No." = field("No.")));
- Caption = 'Pay-to No. of Pstd. Receipts';
- ToolTip = 'Specifies the number of posted receipts that exist for the vendor.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7186; "Pay-to No. of Pstd. Invoices"; Integer)
- {
- CalcFormula = count("Purch. Inv. Header" where("Pay-to Vendor No." = field("No.")));
- Caption = 'Pay-to No. of Pstd. Invoices';
- ToolTip = 'Specifies the amount that relates to posted invoices.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7187; "Pay-to No. of Pstd. Return S."; Integer)
- {
- CalcFormula = count("Return Shipment Header" where("Pay-to Vendor No." = field("No.")));
- Caption = 'Pay-to No. of Pstd. Return S.';
- ToolTip = 'Specifies the number of posted return shipments that exist for the vendor.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7188; "Pay-to No. of Pstd. Cr. Memos"; Integer)
- {
- CalcFormula = count("Purch. Cr. Memo Hdr." where("Pay-to Vendor No." = field("No.")));
- Caption = 'Pay-to No. of Pstd. Cr. Memos';
- ToolTip = 'Specifies the amount that relates to credit memos.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7189; "No. of Quotes"; Integer)
- {
- CalcFormula = count("Purchase Header" where("Document Type" = const(Quote),
- "Buy-from Vendor No." = field("No.")));
- Caption = 'No. of Quotes';
- ToolTip = 'Specifies the number of purchase quotes that exist for the vendor.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7190; "No. of Blanket Orders"; Integer)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- CalcFormula = count("Purchase Header" where("Document Type" = const("Blanket Order"),
- "Buy-from Vendor No." = field("No.")));
- Caption = 'No. of Blanket Orders';
- ToolTip = 'Specifies the number of purchase blanket orders that exist for the vendor.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7191; "No. of Orders"; Integer)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- CalcFormula = count("Purchase Header" where("Document Type" = const(Order),
- "Buy-from Vendor No." = field("No.")));
- Caption = 'No. of Orders';
- ToolTip = 'Specifies the number of purchase orders that exist for the vendor.';
- FieldClass = FlowField;
- }
- field(7192; "No. of Invoices"; Integer)
- {
- CalcFormula = count("Purchase Header" where("Document Type" = const(Invoice),
- "Buy-from Vendor No." = field("No.")));
- Caption = 'No. of Invoices';
- ToolTip = 'Specifies the number of unposted purchase invoices that exist for the vendor.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7193; "No. of Return Orders"; Integer)
- {
- AccessByPermission = TableData "Return Shipment Header" = R;
- CalcFormula = count("Purchase Header" where("Document Type" = const("Return Order"),
- "Buy-from Vendor No." = field("No.")));
- Caption = 'No. of Return Orders';
- ToolTip = 'Specifies the number of purchase return orders that exist for the vendor.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7194; "No. of Credit Memos"; Integer)
- {
- CalcFormula = count("Purchase Header" where("Document Type" = const("Credit Memo"),
- "Buy-from Vendor No." = field("No.")));
- Caption = 'No. of Credit Memos';
- ToolTip = 'Specifies the number of unposted purchase credit memos that exist for the vendor.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7195; "No. of Order Addresses"; Integer)
- {
- CalcFormula = count("Order Address" where("Vendor No." = field("No.")));
- Caption = 'No. of Order Addresses';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7196; "Pay-to No. of Quotes"; Integer)
- {
- CalcFormula = count("Purchase Header" where("Document Type" = const(Quote),
- "Pay-to Vendor No." = field("No.")));
- Caption = 'Pay-to No. of Quotes';
- ToolTip = 'Specifies the number of quotes that exist for the vendor.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7197; "Pay-to No. of Blanket Orders"; Integer)
- {
- AccessByPermission = TableData "Purch. Rcpt. Header" = R;
- CalcFormula = count("Purchase Header" where("Document Type" = const("Blanket Order"),
- "Pay-to Vendor No." = field("No.")));
- Caption = 'Pay-to No. of Blanket Orders';
- ToolTip = 'Specifies the number of blanket orders.';
- FieldClass = FlowField;
- }
- field(7198; "No. of Incoming Documents"; Integer)
- {
- CalcFormula = count("Incoming Document" where("Vendor No." = field("No.")));
- Caption = 'No. of Incoming Documents';
- ToolTip = 'Specifies incoming documents, such as vendor invoices in PDF or as image files, that you can manually or automatically convert to document records, such as purchase invoices. The external files that represent incoming documents can be attached at any process stage, including to posted documents and to the resulting vendor, customer, and general ledger entries.';
- Editable = false;
- FieldClass = FlowField;
- }
- field(7600; "Base Calendar Code"; Code[10])
- {
- Caption = 'Base Calendar Code';
- ToolTip = 'Specifies a customizable calendar for delivery planning that holds the vendor''s working days and holidays.';
- TableRelation = "Base Calendar";
- }
- field(7601; "Document Sending Profile"; Code[20])
- {
- Caption = 'Document Sending Profile';
- ToolTip = 'Specifies the preferred method of sending documents to this vendor, so that you do not have to select a sending option every time that you post and send a document to the vendor. Documents to this vendor will be sent using the specified sending profile and will override the default document sending profile.';
- TableRelation = "Document Sending Profile".Code;
- }
- field(7602; "Validate EU Vat Reg. No."; Boolean)
- {
- Caption = 'Validate EU VAT Reg. No.';
- }
- field(7603; "Copy Buy-from Add. to Qte From"; Enum "Contact Type")
- {
- AccessByPermission = TableData Contact = R;
- Caption = 'Copy Buy-from Addr. to Qte From';
- ToolTip = 'Specifies which vendor address is inserted on purchase quotes that you create for the vendor.';
- }
- field(8001; "Currency Id"; Guid)
- {
- Caption = 'Currency Id';
- TableRelation = Currency.SystemId;
-
- trigger OnValidate()
- begin
- UpdateCurrencyCode();
- end;
- }
- field(8002; "Payment Terms Id"; Guid)
- {
- Caption = 'Payment Terms Id';
- TableRelation = "Payment Terms".SystemId;
-
- trigger OnValidate()
- begin
- UpdatePaymentTermsCode();
- end;
- }
- field(8003; "Payment Method Id"; Guid)
- {
- Caption = 'Payment Method Id';
- TableRelation = "Payment Method".SystemId;
-
- trigger OnValidate()
- begin
- UpdatePaymentMethodCode();
- end;
- }
- field(8510; "Over-Receipt Code"; Code[20])
- {
- Caption = 'Over-Receipt Code';
- ToolTip = 'Specifies the policy that will be used for the vendor if more items than ordered are received.';
- TableRelation = "Over-Receipt Code";
- }
- field(11000000; "Transaction Mode Code"; Code[20])
- {
- Caption = 'Transaction Mode Code';
- TableRelation = "Transaction Mode".Code where("Account Type" = const(Vendor));
-
- trigger OnValidate()
- var
- TrMode: Record "Transaction Mode";
- begin
- if "Transaction Mode Code" <> '' then begin
- TrMode.Get(TrMode."Account Type"::Vendor, "Transaction Mode Code");
- if TrMode."Payment Method Code" <> '' then
- "Payment Method Code" := TrMode."Payment Method Code";
- if TrMode."Payment Terms Code" <> '' then
- "Payment Terms Code" := TrMode."Payment Terms Code";
- end;
- end;
- }
- }
-
- keys
- {
- key(Key1; "No.")
- {
- Clustered = true;
- }
- key(Key2; "Search Name")
- {
- }
- key(Key3; "Vendor Posting Group")
- {
- }
- key(Key4; "Currency Code")
- {
- }
- key(Key5; Priority)
- {
- }
- key(Key6; "Country/Region Code")
- {
- }
- key(Key7; "Gen. Bus. Posting Group")
- {
- }
- key(Key8; "VAT Registration No.")
- {
- }
- key(Key9; Name)
- {
- }
- key(Key10; City)
- {
- }
- key(Key11; "Post Code")
- {
- }
- key(Key12; "Phone No.")
- {
- }
- key(Key13; Contact)
- {
- }
- key(Key14; Blocked)
- {
- }
- key(Key15; SystemModifiedAt)
- {
- }
- key(Key21; "IC Partner Code")
- {
- }
- }
-
- fieldgroups
- {
- fieldgroup(DropDown; "No.", Name, Address, City, "Post Code", "Phone No.", Contact, "E-Mail", "Pay-to Vendor No.", "Registration Number", "VAT Registration No.")
- {
- }
- fieldgroup(Brick; "No.", Name, "Balance (LCY)", Contact, "Balance Due (LCY)", Image)
- {
- }
- }
-
- trigger OnDelete()
- var
- ItemVendor: Record "Item Vendor";
- PurchPrepmtPct: Record "Purchase Prepayment %";
- CustomReportSelection: Record "Custom Report Selection";
- ItemReference: Record "Item Reference";
- MyVendor: Record "My Vendor";
- VATRegistrationLogMgt: Codeunit "VAT Registration Log Mgt.";
- begin
- ApprovalsMgmt.OnCancelVendorApprovalRequest(Rec);
-
- MoveEntries.MoveVendorEntries(Rec);
-
- CommentLine.SetRange("Table Name", CommentLine."Table Name"::Vendor);
- CommentLine.SetRange("No.", "No.");
- if not CommentLine.IsEmpty() then
- CommentLine.DeleteAll();
-
- VendBankAcc.SetRange("Vendor No.", "No.");
- if not VendBankAcc.IsEmpty() then
- VendBankAcc.DeleteAll();
-
- OrderAddr.SetRange("Vendor No.", "No.");
- if not OrderAddr.IsEmpty() then
- OrderAddr.DeleteAll();
-
- CheckOutstandingPurchaseDocuments();
-
- ItemReference.SetCurrentKey("Reference Type", "Reference Type No.");
- ItemReference.SetRange("Reference Type", ItemReference."Reference Type"::Vendor);
- ItemReference.SetRange("Reference Type No.", Rec."No.");
- ItemReference.DeleteAll();
-
- UpdateContFromVend.OnDelete(Rec);
-
- DimMgt.DeleteDefaultDim(DATABASE::Vendor, "No.");
-
- ItemVendor.SetRange("Vendor No.", "No.");
- if not ItemVendor.IsEmpty() then
- ItemVendor.DeleteAll(true);
-
- CustomReportSelection.SetRange("Source Type", DATABASE::Vendor);
- CustomReportSelection.SetRange("Source No.", "No.");
- if not CustomReportSelection.IsEmpty() then
- CustomReportSelection.DeleteAll();
-
- PurchPrepmtPct.SetCurrentKey("Vendor No.");
- PurchPrepmtPct.SetRange("Vendor No.", "No.");
- if not PurchPrepmtPct.IsEmpty() then
- PurchPrepmtPct.DeleteAll(true);
-
- VATRegistrationLogMgt.DeleteVendorLog(Rec);
- CalendarManagement.DeleteCustomizedBaseCalendarData(CustomizedCalendarChange."Source Type"::Vendor, "No.");
-
- MyVendor.SetRange("Vendor No.", "No.");
- MyVendor.DeleteAll();
- end;
-
- trigger OnInsert()
- var
- Vendor: Record Vendor;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeOnInsert(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "No." = '' then begin
- PurchSetup.Get();
- PurchSetup.TestField("Vendor Nos.");
- "No. Series" := PurchSetup."Vendor Nos.";
- if NoSeries.AreRelated("No. Series", xRec."No. Series") then
- "No. Series" := xRec."No. Series";
- "No." := NoSeries.GetNextNo("No. Series");
- Vendor.ReadIsolation(IsolationLevel::ReadUncommitted);
- Vendor.SetLoadFields("No.");
- while Vendor.Get("No.") do
- "No." := NoSeries.GetNextNo("No. Series");
- end;
-
- if "Invoice Disc. Code" = '' then
- "Invoice Disc. Code" := "No.";
-
- if (not (InsertFromContact or (InsertFromTemplate and (Contact <> '')))) or ForceUpdateContact then
- UpdateContFromVend.OnInsert(Rec);
-
- if "Purchaser Code" = '' then
- SetDefaultPurchaser();
-
- DimMgt.UpdateDefaultDim(
- DATABASE::Vendor, "No.",
- "Global Dimension 1 Code", "Global Dimension 2 Code");
-
- UpdateReferencedIds();
- SetLastModifiedDateTime();
-
- OnAfterOnInsert(Rec);
- end;
-
- trigger OnModify()
- var
- AccountType: Option Customer,Vendor,Employee;
- TransactionMode: Record "Transaction Mode";
- begin
- UpdateReferencedIds();
- SetLastModifiedDateTime();
-
- if IsContactUpdateNeeded() then begin
- if not TransactionMode.CheckTransactionModePartnerType(AccountType::Vendor, "Transaction Mode Code", "Partner Type") then
- Error(PartnerTypeMismatchErr);
- Modify();
- UpdateContFromVend.OnModify(Rec);
- if not Find() then begin
- Reset();
- if Find() then;
- end;
- end;
- end;
-
- trigger OnRename()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeOnRename(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- ApprovalsMgmt.OnRenameRecordInApprovalRequest(xRec.RecordId, RecordId);
- DimMgt.RenameDefaultDim(DATABASE::Vendor, xRec."No.", "No.");
- CommentLine.RenameCommentLine(CommentLine."Table Name"::Vendor, xRec."No.", "No.");
-
- SetLastModifiedDateTime();
- if xRec."Invoice Disc. Code" = xRec."No." then
- "Invoice Disc. Code" := "No.";
-
- CalendarManagement.RenameCustomizedBaseCalendarData(CustomizedCalendarChange."Source Type"::Vendor, "No.", xRec."No.");
- end;
-
- var
- PurchSetup: Record "Purchases & Payables Setup";
- CommentLine: Record "Comment Line";
- PostCode: Record "Post Code";
- VendBankAcc: Record "Vendor Bank Account";
- OrderAddr: Record "Order Address";
- GenBusPostingGrp: Record "Gen. Business Posting Group";
- MarketingSetup: Record "Marketing Setup";
- SalespersonPurchaser: Record "Salesperson/Purchaser";
- CustomizedCalendarChange: Record "Customized Calendar Change";
- NoSeries: Codeunit "No. Series";
- MoveEntries: Codeunit MoveEntries;
- UpdateContFromVend: Codeunit "VendCont-Update";
- DimMgt: Codeunit DimensionManagement;
- LeadTimeMgt: Codeunit "Lead-Time Management";
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- CalendarManagement: Codeunit "Calendar Management";
- InsertFromContact: Boolean;
- ForceUpdateContact: Boolean;
-
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text000: Label 'You cannot delete %1 %2 because there is at least one outstanding Purchase %3 for this vendor.';
- Text003: Label 'Do you wish to create a contact for %1 %2?';
- Text004: Label 'Contact %1 %2 is not related to vendor %3 %4.';
-#pragma warning restore AA0470
- Text005: Label 'post';
- Text006: Label 'create';
-#pragma warning disable AA0470
- Text007: Label 'You cannot %1 this type of document when Vendor %2 is blocked with type %3';
- Text008: Label 'The %1 %2 has been assigned to %3 %4.\The same %1 cannot be entered on more than one %3.';
- Text009: Label 'Reconciling IC transactions may be difficult if you change IC Partner Code because this %1 has ledger entries in a fiscal year that has not yet been closed.\ Do you still want to change the IC Partner Code?';
- Text010: Label 'You cannot change the contents of the %1 field because this %2 has one or more open ledger entries.';
- Text11000000: Label 'Do you want to update the bank accounts for this vendor to reflect the new value of %1?';
- PartnerTypeMismatchMsg: Label 'The Partner Type does not match the Partner Type defined in Transaction Mode. Do you still want to change the Partner Type?';
- PartnerTypeMismatchErr: Label 'The Partner Type does not match the Partner Type defined in Transaction Mode.';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- SelectVendorErr: Label 'You must select an existing vendor.';
- CreateNewVendTxt: Label 'Create a new vendor card for %1.', Comment = '%1 is the name to be used to create the customer. ';
- VendNotRegisteredTxt: Label 'This vendor is not registered. To continue, choose one of the following options:';
- SelectVendTxt: Label 'Select an existing vendor.';
- InsertFromTemplate: Boolean;
- PrivacyBlockedActionErr: Label 'You cannot %1 this type of document when Vendor %2 is blocked for privacy.', Comment = '%1 = action (create or post), %2 = vendor code.';
- PrivacyBlockedGenericTxt: Label 'Privacy Blocked must not be true for vendor %1.', Comment = '%1 = vendor code';
- ConfirmBlockedPrivacyBlockedQst: Label 'If you change the Blocked field, the Privacy Blocked field is changed to No. Do you want to continue?';
- CanNotChangeBlockedDueToPrivacyBlockedErr: Label 'The Blocked field cannot be changed because the user is blocked for privacy reasons.';
- PhoneNoCannotContainLettersErr: Label 'must not contain letters';
- FieldLengthErr: Label 'must not have the length more than 20 symbols';
-
- procedure AssistEdit(OldVend: Record Vendor): Boolean
- var
- Vend: Record Vendor;
- begin
- Vend := Rec;
- PurchSetup.Get();
- PurchSetup.TestField("Vendor Nos.");
- if NoSeries.LookupRelatedNoSeries(PurchSetup."Vendor Nos.", OldVend."No. Series", Vend."No. Series") then begin
- Vend."No." := NoSeries.GetNextNo(Vend."No. Series");
- Rec := Vend;
- OnAssistEditOnBeforeExit(Rec);
- exit(true);
- end;
- end;
-
- procedure ValidateShortcutDimCode(FieldNumber: Integer; var ShortcutDimCode: Code[20])
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShortcutDimCode(Rec, xRec, FieldNumber, ShortcutDimCode, IsHandled);
- if IsHandled then
- exit;
-
- DimMgt.ValidateDimValueCode(FieldNumber, ShortcutDimCode);
- if not IsTemporary then begin
- DimMgt.SaveDefaultDim(DATABASE::Vendor, "No.", FieldNumber, ShortcutDimCode);
- Modify();
- end;
-
- OnAfterValidateShortcutDimCode(Rec, xRec, FieldNumber, ShortcutDimCode);
- end;
-
- procedure ShowContact()
- var
- ContBusRel: Record "Contact Business Relation";
- Cont: Record Contact;
- OfficeContact: Record Contact;
- OfficeMgt: Codeunit "Office Management";
- ConfirmManagement: Codeunit "Confirm Management";
- ContactPageID: Integer;
- ShouldExit: Boolean;
- begin
- OnBeforeShowContact(Rec);
- if OfficeMgt.GetContact(OfficeContact, "No.") and (OfficeContact.Count = 1) then begin
- ContactPageID := PAGE::"Contact Card";
- OnShowContactOnBeforeOpenContactCard(OfficeContact, ContactPageID);
- PAGE.Run(ContactPageID, OfficeContact);
- end else begin
- ShouldExit := "No." = '';
- OnShowContactOnAfterCalcShouldExit(Rec, ContactPageID, ShouldExit);
- if ShouldExit then
- exit;
-
- ContBusRel.SetCurrentKey("Link to Table", "No.");
- ContBusRel.SetRange("Link to Table", ContBusRel."Link to Table"::Vendor);
- ContBusRel.SetRange("No.", "No.");
- if not ContBusRel.FindFirst() then begin
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text003, TableCaption(), "No."), true) then
- exit;
- UpdateContFromVend.InsertNewContact(Rec, false);
- ContBusRel.FindFirst();
- end;
- Commit();
-
- Cont.FilterGroup(2);
- Cont.SetRange("Company No.", ContBusRel."Contact No.");
- COntactPageID := PAGE::"Contact List";
- OnShowContactOnBeforeOpenContactList(Cont, ContactPageID);
- PAGE.Run(ContactPageID, Cont);
- end;
- end;
-
- procedure SetInsertFromContact(FromContact: Boolean)
- begin
- InsertFromContact := FromContact;
- end;
-
- procedure CheckBlockedVendOnDocs(Vend2: Record Vendor; Transaction: Boolean)
- var
- Source: Option Journal,Document;
- begin
- if IsOnBeforeCheckBlockedVendHandled(Vend2, Source::Document, Enum::"Gen. Journal Document Type"::" ", Transaction) then
- exit;
-
- if Vend2."Privacy Blocked" then
- VendPrivacyBlockedErrorMessage(Vend2, Transaction);
-
- if Vend2.Blocked = Vend2.Blocked::All then
- VendBlockedErrorMessage(Vend2, Transaction);
- end;
-
- procedure CheckBlockedVendOnJnls(Vend2: Record Vendor; DocType: Enum "Gen. Journal Document Type"; Transaction: Boolean)
- var
- Source: Option Journal,Document;
- begin
- if IsOnBeforeCheckBlockedVendHandled(Vend2, Source::Journal, DocType::" ", Transaction) then
- exit;
-
- if Vend2."Privacy Blocked" then
- Vend2.VendPrivacyBlockedErrorMessage(Vend2, Transaction);
-
- if (Vend2.Blocked = Vend2.Blocked::All) or
- (Vend2.Blocked = Vend2.Blocked::Payment) and (DocType = DocType::Payment)
- then
- Vend2.VendBlockedErrorMessage(Vend2, Transaction);
- end;
-
- local procedure CheckOutstandingPurchaseDocuments()
- var
- PurchOrderLine: Record "Purchase Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckOutstandingPurchaseDocuments(Rec, IsHandled);
- if IsHandled then
- exit;
-
- PurchOrderLine.SetCurrentKey("Document Type", "Pay-to Vendor No.");
- PurchOrderLine.SetRange("Pay-to Vendor No.", "No.");
- if PurchOrderLine.FindFirst() then
- Error(
- Text000,
- TableCaption, "No.",
- PurchOrderLine."Document Type");
-
- PurchOrderLine.SetRange("Pay-to Vendor No.");
- PurchOrderLine.SetRange("Buy-from Vendor No.", "No.");
- if not PurchOrderLine.IsEmpty() then
- Error(
- Text000,
- TableCaption, "No.");
- end;
-
- procedure CreateAndShowNewInvoice()
- var
- PurchaseHeader: Record "Purchase Header";
- begin
- PurchaseHeader."Document Type" := PurchaseHeader."Document Type"::Invoice;
- PurchaseHeader.SetRange("Buy-from Vendor No.", "No.");
- PurchaseHeader.Insert(true);
- Commit();
- PAGE.Run(PAGE::"Purchase Invoice", PurchaseHeader)
- end;
-
- procedure CreateAndShowNewCreditMemo()
- var
- PurchaseHeader: Record "Purchase Header";
- begin
- PurchaseHeader."Document Type" := PurchaseHeader."Document Type"::"Credit Memo";
- PurchaseHeader.SetRange("Buy-from Vendor No.", "No.");
- PurchaseHeader.Insert(true);
- Commit();
- PAGE.Run(PAGE::"Purchase Credit Memo", PurchaseHeader)
- end;
-
- procedure CreateAndShowNewPurchaseOrder()
- var
- PurchaseHeader: Record "Purchase Header";
- begin
- PurchaseHeader."Document Type" := PurchaseHeader."Document Type"::Order;
- PurchaseHeader.SetRange("Buy-from Vendor No.", "No.");
- PurchaseHeader.Insert(true);
- Commit();
- PAGE.Run(PAGE::"Purchase Order", PurchaseHeader);
- end;
-
- procedure VendBlockedErrorMessage(Vend2: Record Vendor; Transaction: Boolean)
- var
- "Action": Text[30];
- begin
- if Transaction then
- Action := Text005
- else
- Action := Text006;
- Error(
- ErrorInfo.Create(
- StrSubstNo(Text007, Action, Vend2."No.", Vend2.Blocked),
- true,
- Rec));
- end;
-
- procedure VendPrivacyBlockedErrorMessage(Vend2: Record Vendor; Transaction: Boolean)
- var
- "Action": Text[30];
- begin
- if Transaction then
- Action := Text005
- else
- Action := Text006;
-
- Error(
- ErrorInfo.Create(
- StrSubstNo(PrivacyBlockedActionErr, Action, Vend2."No."),
- true,
- Rec));
- end;
-
- procedure GetPrivacyBlockedGenericErrorText(Vend2: Record Vendor): Text[250]
- begin
- exit(StrSubstNo(PrivacyBlockedGenericTxt, Vend2."No."));
- end;
-
- procedure DisplayMap()
- var
- OnlineMapManagement: Codeunit "Online Map Management";
- begin
- OnlineMapManagement.MakeSelectionIfMapEnabled(Database::Vendor, GetPosition());
- end;
-
- procedure CalcOverDueBalance() OverDueBalance: Decimal
- var
- [SecurityFiltering(SecurityFilter::Filtered)]
- VendLedgEntryRemainAmtQuery: Query "Vend. Ledg. Entry Remain. Amt.";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCalcOverdueBalance(Rec, OverDueBalance, IsHandled);
- if IsHandled then
- exit(OverDueBalance);
-
- VendLedgEntryRemainAmtQuery.SetRange(Vendor_No, "No.");
- VendLedgEntryRemainAmtQuery.SetRange(IsOpen, true);
- VendLedgEntryRemainAmtQuery.SetFilter(Due_Date, '<%1', WorkDate());
- VendLedgEntryRemainAmtQuery.Open();
-
- if VendLedgEntryRemainAmtQuery.Read() then
- OverDueBalance := -VendLedgEntryRemainAmtQuery.Sum_Remaining_Amt_LCY;
- end;
-
- [Scope('OnPrem')]
- procedure UpdateVendorBankAccounts(UseFieldCaption: Text[250])
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateVendorBankAccounts(IsHandled, VendBankAcc);
- if not GuiAllowed or IsHandled then
- exit;
-
- VendBankAcc.SetRange("Vendor No.", "No.");
- if VendBankAcc.Find('-') then begin
- IsHandled := false;
- OnUpdateVendorBankAccountsOnBeforeConfirm(Rec, IsHandled);
- if not IsHandled then
- if not Confirm(StrSubstNo(Text11000000, UseFieldCaption)) then
- exit;
- repeat
- VendBankAcc."Account Holder Name" := Name;
- VendBankAcc."Account Holder Address" := Address;
- VendBankAcc."Account Holder Post Code" := "Post Code";
- VendBankAcc."Account Holder City" := City;
- VendBankAcc."Acc. Hold. Country/Region Code" := "Country/Region Code";
- VendBankAcc.Modify();
- until VendBankAcc.Next() = 0;
- Modify();
- end;
- end;
-
- procedure GetInvoicedPrepmtAmountLCY() InvoicedPrepmtAmountLCY: Decimal
- var
- PurchLine: Record "Purchase Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetInvoicedPrepmtAmountLCY(Rec, InvoicedPrepmtAmountLCY, IsHandled);
- if IsHandled then
- exit(InvoicedPrepmtAmountLCY);
-
- PurchLine.SetCurrentKey("Document Type", "Pay-to Vendor No.");
- PurchLine.SetRange("Document Type", PurchLine."Document Type"::Order);
- PurchLine.SetRange("Pay-to Vendor No.", "No.");
- PurchLine.CalcSums("Prepmt. Amount Inv. (LCY)", "Prepmt. VAT Amount Inv. (LCY)");
- exit(PurchLine."Prepmt. Amount Inv. (LCY)" + PurchLine."Prepmt. VAT Amount Inv. (LCY)");
- end;
-
- procedure GetPriceCalculationMethod() Method: Enum "Price Calculation Method";
- begin
- if "Price Calculation Method" <> Method::" " then
- Method := "Price Calculation Method"
- else begin
- PurchSetup.Get();
- Method := PurchSetup."Price Calculation Method";
- end;
- end;
-
- procedure GetTotalAmountLCY() TotalAmountLCY: Decimal
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetTotalAmountLCY(Rec, TotalAmountLCY, IsHandled);
- if IsHandled then
- exit(TotalAmountLCY);
-
- CalcFields(
- "Balance (LCY)", "Outstanding Orders (LCY)", "Amt. Rcd. Not Invoiced (LCY)", "Outstanding Invoices (LCY)");
-
- exit(
- "Balance (LCY)" + "Outstanding Orders (LCY)" +
- "Amt. Rcd. Not Invoiced (LCY)" + "Outstanding Invoices (LCY)" - GetInvoicedPrepmtAmountLCY());
- end;
-
- procedure HasAddress() Result: Boolean
- begin
- Result := (Address <> '') or
- ("Address 2" <> '') or
- (City <> '') or
- ("Country/Region Code" <> '') or
- (County <> '') or
- ("Post Code" <> '') or
- (Contact <> '');
- OnAfterHasAddress(Rec, Result);
- end;
-
- procedure GetBalanceAsCustomer(var LinkedCustomerNo: Code[20]) BalanceAsCustomer: Decimal;
- var
- Customer: Record Customer;
- begin
- BalanceAsCustomer := 0;
- LinkedCustomerNo := GetLinkedCustomer();
- if Customer.Get(LinkedCustomerNo) then begin
- OnGetBalanceAsCustomerOnBeforeCalcBalance(Customer);
- Customer.CalcFields("Balance (LCY)");
- BalanceAsCustomer := Customer."Balance (LCY)";
- end;
- end;
-
- procedure GetLinkedCustomer(): Code[20];
- var
- ContBusRel: Record "Contact Business Relation";
- begin
- exit(
- ContBusRel.GetLinkedTables(
- Enum::"Contact Business Relation Link To Table"::Vendor, "No.",
- Enum::"Contact Business Relation Link To Table"::Customer))
- end;
-
- procedure GetVendorNo(VendorText: Text[100]): Code[20]
- begin
- exit(GetVendorNoOpenCard(VendorText, true));
- end;
-
- procedure GetVendorNoOpenCard(VendorText: Text[100]; ShowVendorCard: Boolean): Code[20]
- var
- Vendor: Record Vendor;
- VendorNo: Code[20];
- NoFiltersApplied: Boolean;
- VendorWithoutQuote: Text;
- VendorFilterFromStart: Text;
- VendorFilterContains: Text;
- ShowCreateVendorOption, IsHandled : Boolean;
- begin
- ShowCreateVendorOption := true;
- IsHandled := false;
- OnBeforeGetVendorNoOpenCard(VendorText, ShowVendorCard, VendorNo, IsHandled, ShowCreateVendorOption);
- if IsHandled then
- exit(VendorNo);
-
- if VendorText = '' then
- exit('');
-
- if StrLen(VendorText) <= MaxStrLen(Vendor."No.") then
- if Vendor.Get(VendorText) then
- exit(Vendor."No.");
-
- Vendor.SetRange(Blocked, Vendor.Blocked::" ");
- Vendor.SetRange(Name, VendorText);
- OnGetVendorNoOpenCardOnBeforeVendorFindSet(Vendor);
- if Vendor.FindFirst() then
- exit(Vendor."No.");
-
- VendorWithoutQuote := ConvertStr(VendorText, '''', '?');
-
- Vendor.SetFilter(Name, '''@' + VendorWithoutQuote + '''');
- OnGetVendorNoOpenCardOnAfterSetVendorWithoutQuote(Vendor);
- if Vendor.FindFirst() then
- if Vendor.Count() = 1 then
- exit(Vendor."No.");
- Vendor.SetRange(Name);
-
- VendorFilterFromStart := '''@' + VendorWithoutQuote + '*''';
-
- Vendor.FilterGroup := -1;
- Vendor.SetFilter("No.", VendorFilterFromStart);
- Vendor.SetFilter(Name, VendorFilterFromStart);
- OnGetVendorNoOpenCardOnAfterVendorSetFilterFromStart(Vendor);
- if Vendor.FindFirst() then
- if Vendor.Count() = 1 then
- exit(Vendor."No.");
-
- VendorFilterContains := '''@*' + VendorWithoutQuote + '*''';
-
- Vendor.SetFilter("No.", VendorFilterContains);
- Vendor.SetFilter(Name, VendorFilterContains);
- Vendor.SetFilter(City, VendorFilterContains);
- Vendor.SetFilter(Contact, VendorFilterContains);
- Vendor.SetFilter("Phone No.", VendorFilterContains);
- Vendor.SetFilter("Post Code", VendorFilterContains);
- OnGetVendorNoOpenCardonAfterSetvendorFilters(Vendor, VendorFilterContains);
-
- if Vendor.Count() = 0 then
- MarkVendorsWithSimilarName(Vendor, VendorText);
-
- if Vendor.Count() = 1 then begin
- Vendor.FindFirst();
- exit(Vendor."No.");
- end;
-
- if not GuiAllowed() then
- Error(SelectVendorErr);
-
- OnGetVendorNoOpenCardOnAfterMarkCustomersWithSimilarName(Vendor);
-
- OnGetVendorNoOpenCardOnBeforeSelectVendor(Vendor);
- if Vendor.Count = 0 then begin
- if Vendor.WritePermission then
- if ShowCreateVendorOption then
- case StrMenu(StrSubstNo('%1,%2', StrSubstNo(CreateNewVendTxt, VendorText), SelectVendTxt), 1, VendNotRegisteredTxt) of
- 0:
- Error(SelectVendorErr);
- 1:
- exit(CreateNewVendor(CopyStr(VendorText, 1, MaxStrLen(Vendor.Name)), ShowVendorCard));
- end
- else
- exit('');
- Vendor.Reset();
- NoFiltersApplied := true;
- end;
-
- if ShowVendorCard then
- VendorNo := PickVendor(Vendor, NoFiltersApplied)
- else
- exit('');
-
- if VendorNo <> '' then
- exit(VendorNo);
-
- Error(SelectVendorErr);
- end;
-
- local procedure MarkVendorsWithSimilarName(var Vendor: Record Vendor; VendorText: Text)
- var
- TypeHelper: Codeunit "Type Helper";
- VendorCount: Integer;
- VendorTextLenght: Integer;
- Treshold: Integer;
- begin
- if VendorText = '' then
- exit;
- if StrLen(VendorText) > MaxStrLen(Vendor.Name) then
- exit;
- VendorTextLenght := StrLen(VendorText);
- Treshold := VendorTextLenght div 5;
- if Treshold = 0 then
- exit;
- Vendor.Reset();
- Vendor.Ascending(false); // most likely to search for newest Vendors
- OnMarkVendorsWithSimilarNameOnBeforeVendorFindSet(Vendor);
- if Vendor.FindSet() then
- repeat
- VendorCount += 1;
- if Abs(VendorTextLenght - StrLen(Vendor.Name)) <= Treshold then
- if TypeHelper.TextDistance(UpperCase(VendorText), UpperCase(Vendor.Name)) <= Treshold then
- Vendor.Mark(true);
- until Vendor.Mark() or (Vendor.Next() = 0) or (VendorCount > 1000);
- Vendor.MarkedOnly(true);
- end;
-
- local procedure CreateNewVendor(VendorName: Text[100]; ShowVendorCard: Boolean) Result: Code[20]
- var
- Vendor: Record Vendor;
- xRecVendor: Record Vendor;
- VendorTemplMgt: Codeunit "Vendor Templ. Mgt.";
- WorkflowEventHandling: Codeunit "Workflow Event Handling";
- VendorCard: Page "Vendor Card";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateNewVendor(VendorName, ShowVendorCard, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if not VendorTemplMgt.InsertVendorFromTemplate(Vendor) then
- Error(SelectVendorErr);
-
- Vendor.Name := VendorName;
- Vendor.Modify(true);
-
- WorkflowEventHandling.RunWorkflowOnVendorChanged(Vendor, xRecVendor, false);
-
- Commit();
- if not ShowVendorCard then
- exit(Vendor."No.");
- Vendor.SetRange("No.", Vendor."No.");
- VendorCard.SetTableView(Vendor);
- if not (VendorCard.RunModal() = ACTION::OK) then
- Error(SelectVendorErr);
-
- exit(Vendor."No.");
- end;
-
- local procedure PickVendor(var Vendor: Record Vendor; NoFiltersApplied: Boolean): Code[20]
- var
- VendorList: Page "Vendor List";
- begin
- if not NoFiltersApplied then
- MarkVendorsByFilters(Vendor);
-
- VendorList.SetTableView(Vendor);
- VendorList.SetRecord(Vendor);
- VendorList.LookupMode := true;
- if VendorList.RunModal() = ACTION::LookupOK then
- VendorList.GetRecord(Vendor)
- else
- Clear(Vendor);
-
- exit(Vendor."No.");
- end;
-
- procedure SelectVendor(var Vendor: Record Vendor): Boolean
- var
- VendorLookup: Page "Vendor Lookup";
- PreviousVendorCode: Code[20];
- Result: Boolean;
- begin
- VendorLookup.SetTableView(Vendor);
- VendorLookup.SetRecord(Vendor);
- VendorLookup.LookupMode := true;
- PreviousVendorCode := Vendor."No.";
-
- VendorLookup.RunModal();
- VendorLookup.GetRecord(Vendor);
- Result := Vendor."No." <> PreviousVendorCode;
-
- if not Result then
- Clear(Vendor);
-
- exit(Result);
- end;
-
-
- local procedure MarkVendorsByFilters(var Vendor: Record Vendor)
- begin
- if Vendor.FindSet() then
- repeat
- Vendor.Mark(true);
- until Vendor.Next() = 0;
- if Vendor.FindFirst() then;
- Vendor.MarkedOnly := true;
- end;
-
- procedure OpenVendorLedgerEntries(FilterOnDueEntries: Boolean)
- var
- DetailedVendorLedgEntry: Record "Detailed Vendor Ledg. Entry";
- VendorLedgerEntry: Record "Vendor Ledger Entry";
- IsHandled: Boolean;
- begin
- OnBeforeOpenVendorLedgerEntries(Rec, DetailedVendorLedgEntry);
- DetailedVendorLedgEntry.SetRange("Vendor No.", "No.");
- CopyFilter("Global Dimension 1 Filter", DetailedVendorLedgEntry."Initial Entry Global Dim. 1");
- CopyFilter("Global Dimension 2 Filter", DetailedVendorLedgEntry."Initial Entry Global Dim. 2");
- if FilterOnDueEntries and (GetFilter("Date Filter") <> '') then begin
- CopyFilter("Date Filter", DetailedVendorLedgEntry."Initial Entry Due Date");
- DetailedVendorLedgEntry.SetFilter("Posting Date", '<=%1', GetRangeMax("Date Filter"));
- end;
- CopyFilter("Currency Filter", DetailedVendorLedgEntry."Currency Code");
- IsHandled := false;
- OnOpenVendorLedgerEntriesOnBeforeDrillDownEntries(DetailedVendorLedgEntry, FilterOnDueEntries, IsHandled);
- if not IsHandled then
- VendorLedgerEntry.DrillDownOnEntries(DetailedVendorLedgEntry);
- end;
-
- local procedure IsContactUpdateNeeded(): Boolean
- var
- VendContUpdate: Codeunit "VendCont-Update";
- UpdateNeeded: Boolean;
- begin
- UpdateNeeded :=
- (Name <> xRec.Name) or
- ("Search Name" <> xRec."Search Name") or
- ("Name 2" <> xRec."Name 2") or
- (Address <> xRec.Address) or
- ("Address 2" <> xRec."Address 2") or
- (City <> xRec.City) or
- ("Phone No." <> xRec."Phone No.") or
- ("Mobile Phone No." <> xRec."Mobile Phone No.") or
- ("Telex No." <> xRec."Telex No.") or
- ("Territory Code" <> xRec."Territory Code") or
- ("Currency Code" <> xRec."Currency Code") or
- ("Language Code" <> xRec."Language Code") or
- ("Purchaser Code" <> xRec."Purchaser Code") or
- ("Country/Region Code" <> xRec."Country/Region Code") or
- ("Fax No." <> xRec."Fax No.") or
- ("Telex Answer Back" <> xRec."Telex Answer Back") or
- ("Registration Number" <> xRec."Registration Number") or
- ("VAT Registration No." <> xRec."VAT Registration No.") or
- ("Post Code" <> xRec."Post Code") or
- (County <> xRec.County) or
- ("E-Mail" <> xRec."E-Mail") or
- ("Home Page" <> xRec."Home Page");
-
- if not UpdateNeeded and not IsTemporary then
- UpdateNeeded := VendContUpdate.ContactNameIsBlank("No.");
-
- if ForceUpdateContact then
- UpdateNeeded := true;
-
- OnBeforeIsContactUpdateNeeded(Rec, xRec, UpdateNeeded, ForceUpdateContact);
- exit(UpdateNeeded);
- end;
-
- procedure GetInsertFromContact(): Boolean
- begin
- exit(InsertFromContact);
- end;
-
- procedure GetInsertFromTemplate(): Boolean
- begin
- exit(InsertFromTemplate);
- end;
-
- procedure SetInsertFromTemplate(FromTemplate: Boolean)
- begin
- InsertFromTemplate := FromTemplate;
- end;
-
- procedure SetAddress(VendorAddress: Text[100]; VendorAddress2: Text[50]; VendorPostCode: Code[20]; VendorCity: Text[30]; VendorCounty: Text[30]; VendorCountryCode: Code[10]; VendorContact: Text[100])
- begin
- Address := VendorAddress;
- "Address 2" := VendorAddress2;
- "Post Code" := VendorPostCode;
- City := VendorCity;
- County := VendorCounty;
- "Country/Region Code" := VendorCountryCode;
- UpdateContFromVend.OnModify(Rec);
- Contact := VendorContact;
- end;
-
- protected procedure SetDefaultPurchaser()
- var
- UserSetup: Record "User Setup";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetDefaultPurchaser(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if not UserSetup.Get(UserId) then
- exit;
-
- if UserSetup."Salespers./Purch. Code" <> '' then
- Validate("Purchaser Code", UserSetup."Salespers./Purch. Code");
- end;
-
- protected procedure SetLastModifiedDateTime()
- begin
- "Last Modified Date Time" := CurrentDateTime();
- "Last Date Modified" := Today();
-
- OnAfterSetLastModifiedDateTime(Rec);
- end;
-
- procedure ToPriceSource(var PriceSource: Record "Price Source")
- begin
- PriceSource.Init();
- PriceSource."Price Type" := PriceSource."Price Type"::Purchase;
- PriceSource.Validate("Source Type", PriceSource."Source Type"::Vendor);
- PriceSource.Validate("Source No.", "No.");
- end;
-
- procedure VATRegistrationValidation()
- var
- VATRegistrationLog: Record "VAT Registration Log";
- VATRegistrationNoFormat: Record "VAT Registration No. Format";
- VATRegNoSrvConfig: Record "VAT Reg. No. Srv Config";
- VATRegistrationLogMgt: Codeunit "VAT Registration Log Mgt.";
- ResultRecordRef: RecordRef;
- ApplicableCountryCode: Code[10];
- IsHandled: Boolean;
- LogNotVerified: Boolean;
- begin
- IsHandled := false;
- OnBeforeVATRegistrationValidation(Rec, IsHandled, CurrFieldNo);
- if IsHandled then
- exit;
-
- if not VATRegistrationNoFormat.Test("VAT Registration No.", "Country/Region Code", "No.", DATABASE::Vendor) then
- exit;
-
- LogNotVerified := true;
- if ("Country/Region Code" <> '') or (VATRegistrationNoFormat."Country/Region Code" <> '') then begin
- ApplicableCountryCode := "Country/Region Code";
- if ApplicableCountryCode = '' then
- ApplicableCountryCode := VATRegistrationNoFormat."Country/Region Code";
- if VATRegNoSrvConfig.VATRegNoSrvIsEnabled() then begin
- LogNotVerified := false;
- VATRegistrationLogMgt.ValidateVATRegNoWithVIES(
- ResultRecordRef, Rec, "No.", VATRegistrationLog."Account Type"::Vendor.AsInteger(), ApplicableCountryCode);
- ResultRecordRef.SetTable(Rec);
- end;
- end;
-
- if LogNotVerified then
- VATRegistrationLogMgt.LogVendor(Rec);
- end;
-
- procedure UpdateCurrencyId()
- var
- Currency: Record Currency;
- begin
- if "Currency Code" = '' then begin
- Clear("Currency Id");
- exit;
- end;
-
- Currency.SetLoadFields(SystemId);
- if not Currency.Get("Currency Code") then
- exit;
-
- "Currency Id" := Currency.SystemId;
- end;
-
- procedure UpdatePaymentTermsId()
- var
- PaymentTerms: Record "Payment Terms";
- begin
- if "Payment Terms Code" = '' then begin
- Clear("Payment Terms Id");
- exit;
- end;
-
- PaymentTerms.SetLoadFields(SystemId);
- if not PaymentTerms.Get("Payment Terms Code") then
- exit;
-
- "Payment Terms Id" := PaymentTerms.SystemId;
- end;
-
- procedure UpdatePaymentMethodId()
- var
- PaymentMethod: Record "Payment Method";
- begin
- if "Payment Method Code" = '' then begin
- Clear("Payment Method Id");
- exit;
- end;
-
- PaymentMethod.SetLoadFields(SystemId);
- if not PaymentMethod.Get("Payment Method Code") then
- exit;
-
- "Payment Method Id" := PaymentMethod.SystemId;
- end;
-
- procedure SetForceUpdateContact(NewForceUpdateContact: Boolean)
- begin
- ForceUpdateContact := NewForceUpdateContact;
- end;
-
- local procedure UpdateCurrencyCode()
- var
- Currency: Record Currency;
- begin
- Currency.SetLoadFields(Code);
- if not IsNullGuid("Currency Id") then
- Currency.GetBySystemId("Currency Id");
-
- Validate("Currency Code", Currency.Code);
- end;
-
- local procedure UpdatePaymentTermsCode()
- var
- PaymentTerms: Record "Payment Terms";
- begin
- PaymentTerms.SetLoadFields(Code);
- if not IsNullGuid("Payment Terms Id") then
- PaymentTerms.GetBySystemId("Payment Terms Id");
-
- Validate("Payment Terms Code", PaymentTerms.Code);
- end;
-
- procedure FindVendorByVATRegistrationNo(VATRegistrationNo: Text[20]): Code[20]
- var
- Vendor: Record Vendor;
- VATRegistrationNoFilterTxt: Label '*%1', Comment = '%1 - Filter value', Locked = true;
- begin
- Vendor.SetLoadFields("VAT Registration No.", "Country/Region Code");
- Vendor.SetFilter("VAT Registration No.", StrSubstNo(VATRegistrationNoFilterTxt, CopyStr(VATRegistrationNo, 1, MaxStrLen(VATRegistrationNo))));
- if Vendor.FindSet() then
- repeat
- if ExtractVatRegNo(Vendor."VAT Registration No.", Vendor."Country/Region Code") = ExtractVatRegNo(VATRegistrationNo, Vendor."Country/Region Code") then
- exit(Vendor."No.");
- until Vendor.Next() = 0;
- end;
-
- local procedure ExtractVatRegNo(VatRegNo: Text; CountryRegionCode: Text): Text
- var
- CompanyInformation: Record Microsoft.Foundation.Company."Company Information";
- begin
- if CountryRegionCode = '' then begin
- CompanyInformation.Get();
- CountryRegionCode := CompanyInformation."Country/Region Code";
- end;
- VatRegNo := UpperCase(VatRegNo);
- VatRegNo := DelChr(VatRegNo, '=', DelChr(VatRegNo, '=', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'));
- if StrPos(VatRegNo, UpperCase(CountryRegionCode)) = 1 then
- VatRegNo := DelStr(VatRegNo, 1, StrLen(CountryRegionCode));
- exit(VatRegNo);
- end;
-
-
- local procedure UpdatePaymentMethodCode()
- var
- PaymentMethod: Record "Payment Method";
- begin
- PaymentMethod.SetLoadFields(Code);
- if not IsNullGuid("Payment Method Id") then
- PaymentMethod.GetBySystemId("Payment Method Id");
-
- Validate("Payment Method Code", PaymentMethod.Code);
- end;
-
- procedure UpdateReferencedIds()
- var
- GraphMgtGeneralTools: Codeunit "Graph Mgt - General Tools";
- begin
- if IsTemporary then
- exit;
-
- if not GraphMgtGeneralTools.IsApiEnabled() then
- exit;
-
- UpdateCurrencyId();
- UpdatePaymentTermsId();
- UpdatePaymentMethodId();
- end;
-
- procedure GetReferencedIds(var TempField: Record "Field" temporary)
- var
- DataTypeManagement: Codeunit "Data Type Management";
- begin
- DataTypeManagement.InsertFieldToBuffer(TempField, DATABASE::Vendor, FieldNo("Currency Id"));
- DataTypeManagement.InsertFieldToBuffer(TempField, DATABASE::Vendor, FieldNo("Payment Terms Id"));
- DataTypeManagement.InsertFieldToBuffer(TempField, DATABASE::Vendor, FieldNo("Payment Method Id"));
- end;
-
- local procedure ValidatePurchaserCode()
- begin
- if "Purchaser Code" <> '' then
- if SalespersonPurchaser.Get("Purchaser Code") then
- if SalespersonPurchaser.VerifySalesPersonPurchaserPrivacyBlocked(SalespersonPurchaser) then
- Error(SalespersonPurchaser.GetPrivacyBlockedGenericText(SalespersonPurchaser, false))
- end;
-
- procedure CheckAllowMultiplePostingGroups()
- var
- IsHandled: Boolean;
- begin
- OnBeforeCheckAllowMultiplePostingGroups(IsHandled);
- if IsHandled then
- exit;
-
- PurchSetup.Get();
- if PurchSetup."Allow Multiple Posting Groups" then
- TestField("Allow Multiple Posting Groups");
- end;
-
- local procedure UpdateFormatRegion();
- var
- Language: Record Language;
- LanguageSelection: Record "Language Selection";
- begin
- if (Rec."Format Region" <> '') then
- exit;
- if not Language.Get("Language Code") then
- exit;
-
- LanguageSelection.SetRange("Language ID", Language."Windows Language ID");
- if LanguageSelection.FindFirst() then
- Rec.Validate("Format Region", LanguageSelection."Language Tag");
- end;
-
- [InherentPermissions(PermissionObjectType::TableData, Database::"My Vendor", 'rm')]
- local procedure UpdateMyVendor(CallingFieldNo: Integer)
- var
- MyVendor: Record "My Vendor";
- begin
- case CallingFieldNo of
- FieldNo(Name):
- begin
- MyVendor.SetRange("Vendor No.", "No.");
- if not MyVendor.IsEmpty() then
- MyVendor.ModifyAll(Name, Name);
- end;
- FieldNo("Phone No."):
- begin
- MyVendor.SetRange("Vendor No.", "No.");
- if not MyVendor.IsEmpty() then
- MyVendor.ModifyAll("Phone No.", "Phone No.");
- end;
- end;
- end;
-
- procedure FormatVATRegistrationNo(VATRegistrationNo: Text; CountryCode: Code[10]): Text
- var
- CountryRegion: Record "Country/Region";
- begin
- if VATRegistrationNo = '' then
- exit;
-
- VATRegistrationNo := DelChr(VATRegistrationNo);
-
- if CountryRegion.Get(CountryCode) and (CountryRegion."ISO Code" <> '') then
- if StrPos(VATRegistrationNo, CountryRegion."ISO Code") <> 1 then
- VATRegistrationNo := CountryRegion."ISO Code" + VATRegistrationNo;
-
- exit(VATRegistrationNo);
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterHasAddress(Vendor: Record Vendor; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateCity(var Vendor: Record Vendor; xVendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateNo(var Vendor: Record Vendor; xVendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidatePostCode(var Vendor: Record Vendor; xVendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateShortcutDimCode(var Vendor: Record Vendor; xVendor: Record Vendor; FieldNumber: Integer; var ShortcutDimCode: Code[20])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterLookupCity(var Vendor: Record Vendor; var PostCodeRec: Record "Post Code")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterLookupPostCode(var Vendor: Record Vendor; var PostCodeRec: Record "Post Code")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterOnInsert(var Vendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAssistEditOnBeforeExit(var Vendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeIsContactUpdateNeeded(Vendor: Record Vendor; xVendor: Record Vendor; var UpdateNeeded: Boolean; ForceUpdateContact: Boolean)
- begin
- end;
-
- local procedure IsOnBeforeCheckBlockedVendHandled(Vendor: Record Vendor; Source: Option Journal,Document; DocType: Enum "Gen. Journal Document Type"; Transaction: Boolean) IsHandled: Boolean
- begin
- OnBeforeCheckBlockedVend(Vendor, Source, DocType.AsInteger(), Transaction, IsHandled)
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckBlockedVend(Vendor: Record Vendor; Source: Option Journal,Document; DocType: Option; Transaction: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckOutstandingPurchaseDocuments(Vendor: Record Vendor; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateNewVendor(VendorName: Text[100]; ShowVendorCard: Boolean; var Result: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetVendorNoOpenCard(VendorText: Text; ShowVendorCard: Boolean; var VendorNo: Code[20]; var IsHandled: Boolean; var ShowCreateVendorOption: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCalcOverdueBalance(var Vendor: Record Vendor; var OverdueBalance: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetInvoicedPrepmtAmountLCY(var Vendor: Record Vendor; var InvoicedPrepmtAmountLCY: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetTotalAmountLCY(var Vendor: Record Vendor; var TotalAmountLCY: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetLastModifiedDateTime(var Vendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOnInsert(var Vendor: Record Vendor; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOnRename(var Vendor: Record Vendor; xVendor: Record Vendor; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOpenVendorLedgerEntries(var Vendor: Record Vendor; var DetailedVendorLedgEntry: Record "Detailed Vendor Ledg. Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupCity(var Vendor: Record Vendor; var PostCodeRec: Record "Post Code")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupPostCode(var Vendor: Record Vendor; var PostCodeRec: Record "Post Code")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetDefaultPurchaser(var Vendor: Record Vendor; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateCity(var Vendor: Record Vendor; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePostCode(var Vendor: Record Vendor; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateVATRegistrationNo(var Rec: Record "Vendor"; xRec: Record "Vendor"; CurrFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShortcutDimCode(var Vendor: Record Vendor; var xVendor: Record Vendor; FieldNumber: Integer; var ShortcutDimCode: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeVATRegistrationValidation(var Vendor: Record Vendor; var IsHandled: Boolean; CurrFieldNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnGetVendorNoOpenCardOnBeforeVendorFindSet(var Vendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnGetVendorNoOpenCardOnAfterVendorSetFilterFromStart(var Vendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnGetVendorNoOpenCardOnAfterSetVendorWithoutQuote(var Vendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnGetVendorNoOpenCardonAfterSetvendorFilters(var Vendor: Record Vendor; var VendorFilterContains: Text)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnMarkVendorsWithSimilarNameOnBeforeVendorFindSet(var Vendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowContact(var Vendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnShowContactOnAfterCalcShouldExit(var Vendor: Record Vendor; var ContactPageID: Integer; var ShouldExit: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnShowContactOnBeforeOpenContactCard(var Contact: Record Contact; var ContactPageID: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnShowContactOnBeforeOpenContactList(var Contact: Record Contact; var ContactPageID: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVendorBankAccountsOnBeforeConfirm(var Vendor: Record Vendor; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnGetBalanceAsCustomerOnBeforeCalcBalance(var Customer: Record Customer)
- begin
- end;
-
- [Scope('OnPrem')]
- procedure ValidatePricesIncludingVATOnAfterGetVATPostingSetup(var VATPostingSetup: Record "VAT Posting Setup")
- begin
- OnValidatePricesIncludingVATOnAfterGetVATPostingSetup(VATPostingSetup);
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidatePricesIncludingVATOnAfterGetVATPostingSetup(var VATPostingSetup: Record "VAT Posting Setup")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateRegistrationNumber(var Vendor: Record Vendor; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeUpdateVendorBankAccounts(var IsHandled: Boolean; var VendorBankAccount: Record "Vendor Bank Account")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckAllowMultiplePostingGroups(var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnGetVendorNoOpenCardOnAfterMarkCustomersWithSimilarName(var Vendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnGetVendorNoOpenCardOnBeforeSelectVendor(var Vendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnOpenVendorLedgerEntriesOnBeforeDrillDownEntries(var DetailedVendorLedgEntry: Record "Detailed Vendor Ledg. Entry"; FilterOnDueEntries: Boolean; var IsHandled: Boolean)
- begin
- end;
-
-}
diff --git a/src/Layers/NL/BaseApp/Purchases/Vendor/VendorBankAccount.Table.al b/src/Layers/NL/BaseApp/Purchases/Vendor/VendorBankAccount.Table.al
deleted file mode 100644
index dba2bd6f17..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/Vendor/VendorBankAccount.Table.al
+++ /dev/null
@@ -1,436 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.Vendor;
-
-using Microsoft.Bank.Setup;
-using Microsoft.Finance.Currency;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Company;
-using Microsoft.Purchases.Payables;
-using Microsoft.Utilities;
-using System.Automation;
-using System.Email;
-using System.Globalization;
-
-table 288 "Vendor Bank Account"
-{
- Caption = 'Vendor Bank Account';
- DataCaptionFields = "Vendor No.", "Code", Name;
- DrillDownPageID = "Vendor Bank Account List";
- LookupPageID = "Vendor Bank Account List";
- DataClassification = CustomerContent;
-
- fields
- {
- field(1; "Vendor No."; Code[20])
- {
- Caption = 'Vendor No.';
- NotBlank = true;
- TableRelation = Vendor;
- }
- field(2; "Code"; Code[20])
- {
- Caption = 'Code';
- ToolTip = 'Specifies a code to identify this vendor bank account.';
- NotBlank = true;
- }
- field(3; Name; Text[100])
- {
- Caption = 'Name';
- ToolTip = 'Specifies the name of the bank where the vendor has this bank account.';
-
- trigger OnLookup()
- begin
- OnBeforeLookupName(xRec);
- end;
- }
- field(5; "Name 2"; Text[50])
- {
- Caption = 'Name 2';
- }
- field(6; Address; Text[100])
- {
- Caption = 'Address';
- ToolTip = 'Specifies the address of the bank where the vendor has the bank account.';
- }
- field(7; "Address 2"; Text[50])
- {
- Caption = 'Address 2';
- ToolTip = 'Specifies additional address information.';
- }
- field(8; City; Text[30])
- {
- Caption = 'City';
- ToolTip = 'Specifies the city of the bank where the vendor has the bank account.';
- TableRelation = if ("Country/Region Code" = const('')) "Post Code".City
- else
- if ("Country/Region Code" = filter(<> '')) "Post Code".City where("Country/Region Code" = field("Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnLookup()
- begin
- PostCode.LookupPostCode(City, "Post Code", County, "Country/Region Code");
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateCity(Rec, PostCode, CurrFieldNo, IsHandled);
- if not IsHandled then
- PostCode.ValidateCity(City, "Post Code", County, "Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- end;
- }
- field(9; "Post Code"; Code[20])
- {
- Caption = 'Post Code';
- ToolTip = 'Specifies the postal code.';
- TableRelation = if ("Country/Region Code" = const('')) "Post Code"
- else
- if ("Country/Region Code" = filter(<> '')) "Post Code" where("Country/Region Code" = field("Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnLookup()
- begin
- PostCode.LookupPostCode(City, "Post Code", County, "Country/Region Code");
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePostCode(Rec, PostCode, CurrFieldNo, IsHandled);
- if not IsHandled then
- PostCode.ValidatePostCode(City, "Post Code", County, "Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- end;
- }
- field(10; Contact; Text[100])
- {
- Caption = 'Contact';
- ToolTip = 'Specifies the name of the bank employee regularly contacted in connection with this bank account.';
- }
- field(11; "Phone No."; Text[30])
- {
- Caption = 'Phone No.';
- ToolTip = 'Specifies the telephone number of the bank where the vendor has the bank account.';
- ExtendedDatatype = PhoneNo;
- }
- field(12; "Telex No."; Text[20])
- {
- Caption = 'Telex No.';
- }
- field(13; "Bank Branch No."; Text[20])
- {
- Caption = 'Bank Branch No.';
- ToolTip = 'Specifies the number of the bank branch.';
-
- trigger OnValidate()
- begin
- OnValidateBankAccount(Rec, 'Bank Branch No.');
- end;
- }
- field(14; "Bank Account No."; Text[30])
- {
- Caption = 'Bank Account No.';
- MaskType = Concealed;
- ToolTip = 'Specifies the number used by the bank for the bank account.';
-
- trigger OnValidate()
- var
- LocalFunctionalityMgt: Codeunit "Local Functionality Mgt.";
- begin
- if not LocalFunctionalityMgt.CheckBankAccNo("Bank Account No.", "Country/Region Code", "Bank Account No.") then
- Message(Text1000001, "Bank Account No.");
-
- OnValidateBankAccount(Rec, 'Bank Account No.');
- end;
- }
- field(15; "Transit No."; Text[20])
- {
- Caption = 'Transit No.';
- ToolTip = 'Specifies a bank identification number of your own choice.';
- }
- field(16; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- ToolTip = 'Specifies the relevant currency code for the bank account.';
- TableRelation = Currency;
- }
- field(17; "Country/Region Code"; Code[10])
- {
- Caption = 'Country/Region Code';
- ToolTip = 'Specifies the country/region of the address.';
- TableRelation = "Country/Region";
-
- trigger OnValidate()
- begin
- PostCode.CheckClearPostCodeCityCounty(City, "Post Code", County, "Country/Region Code", xRec."Country/Region Code");
- end;
- }
- field(18; County; Text[30])
- {
- CaptionClass = '5,1,' + "Country/Region Code";
- Caption = 'County';
- ToolTip = 'Specifies the state, province or county as a part of the address.';
- }
- field(19; "Fax No."; Text[30])
- {
- Caption = 'Fax No.';
- ToolTip = 'Specifies the fax number associated with the address.';
- }
- field(20; "Telex Answer Back"; Text[20])
- {
- Caption = 'Telex Answer Back';
- }
- field(21; "Language Code"; Code[10])
- {
- Caption = 'Language Code';
- ToolTip = 'Specifies the language that is used when translating specified text on documents to foreign business partner, such as an item description on an order confirmation.';
- TableRelation = Language;
- }
- field(22; "E-Mail"; Text[80])
- {
- Caption = 'Email';
- ToolTip = 'Specifies the email address associated with the bank account.';
- ExtendedDatatype = EMail;
-
- trigger OnValidate()
- var
- MailManagement: Codeunit "Mail Management";
- begin
- MailManagement.ValidateEmailAddressField("E-Mail");
- end;
- }
-#if not CLEAN27
-#pragma warning disable AS0086
-#endif
- field(23; "Home Page"; Text[255])
-#if not CLEAN27
-#pragma warning restore AS0086
-#endif
- {
- Caption = 'Home Page';
- ToolTip = 'Specifies the bank web site.';
- ExtendedDatatype = URL;
- }
- field(24; IBAN; Code[50])
- {
- Caption = 'IBAN';
- MaskType = Concealed;
- ToolTip = 'Specifies the bank account''s international bank account number.';
-
- trigger OnValidate()
- var
- CompanyInfo: Record "Company Information";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateIBAN(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- CompanyInfo.CheckIBAN(IBAN);
- end;
- }
- field(25; "SWIFT Code"; Code[20])
- {
- Caption = 'SWIFT Code';
- ToolTip = 'Specifies the SWIFT code (international bank identifier code) of the bank where the vendor has the account.';
- TableRelation = "SWIFT Code";
- ValidateTableRelation = false;
- }
- field(1211; "Bank Clearing Code"; Text[50])
- {
- Caption = 'Bank Clearing Code';
- ToolTip = 'Specifies the code for bank clearing that is required according to the format standard you selected in the Bank Clearing Standard field.';
- }
- field(1212; "Bank Clearing Standard"; Text[50])
- {
- Caption = 'Bank Clearing Standard';
- ToolTip = 'Specifies the format standard to be used in bank transfers if you use the Bank Clearing Code field to identify you as the sender.';
- TableRelation = "Bank Clearing Standard";
- }
- field(11000000; "Account Holder Name"; Text[100])
- {
- Caption = 'Account Holder Name';
- }
- field(11000001; "Account Holder Address"; Text[100])
- {
- Caption = 'Account Holder Address';
- }
- field(11000002; "Account Holder Post Code"; Code[20])
- {
- Caption = 'Account Holder Post Code';
- TableRelation = if ("Acc. Hold. Country/Region Code" = const('')) "Post Code"
- else
- if ("Acc. Hold. Country/Region Code" = filter(<> '')) "Post Code" where("Country/Region Code" = field("Acc. Hold. Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnValidate()
- begin
- PostCode.ValidatePostCode("Account Holder City", "Account Holder Post Code", County, "Acc. Hold. Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- end;
- }
- field(11000003; "Account Holder City"; Text[30])
- {
- Caption = 'Account Holder City';
- TableRelation = if ("Acc. Hold. Country/Region Code" = const('')) "Post Code".City
- else
- if ("Acc. Hold. Country/Region Code" = filter(<> '')) "Post Code".City where("Country/Region Code" = field("Acc. Hold. Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnValidate()
- begin
- PostCode.ValidateCity("Account Holder City", "Account Holder Post Code", County, "Acc. Hold. Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- end;
- }
- field(11000004; "Acc. Hold. Country/Region Code"; Code[10])
- {
- Caption = 'Acc. Hold. Country/Region Code';
- TableRelation = "Country/Region";
- }
- field(11000005; "National Bank Code"; Code[10])
- {
- Caption = 'National Bank Code';
- }
- field(11000007; "Abbrev. National Bank Code"; Code[3])
- {
- Caption = 'Abbrev. National Bank Code';
- }
- }
-
- keys
- {
- key(Key1; "Vendor No.", "Code")
- {
- Clustered = true;
- }
- }
-
- fieldgroups
- {
- fieldgroup(DropDown; "Code", Name)
- {
- }
- fieldgroup(Brick; "Code", Name, "Phone No.", Contact)
- {
- }
- }
-
- trigger OnDelete()
- var
- VendorLedgerEntry: Record "Vendor Ledger Entry";
- Vendor: Record Vendor;
- begin
- ApprovalsMgmt.OnCancelVendorBankAccountApprovalRequest(Rec);
-
- VendorLedgerEntry.SetRange("Vendor No.", "Vendor No.");
- VendorLedgerEntry.SetRange("Recipient Bank Account", Code);
- VendorLedgerEntry.SetRange(Open, true);
- OnDeleteOnAfterSetFilters(Rec, VendorLedgerEntry);
- if not VendorLedgerEntry.IsEmpty() then
- Error(BankAccDeleteErr);
- if Vendor.Get("Vendor No.") and (Vendor."Preferred Bank Account Code" = Code) then begin
- Vendor."Preferred Bank Account Code" := '';
- Vendor.Modify();
- end;
- end;
-
- trigger OnInsert()
- begin
- Vend.Get("Vendor No.");
- "Account Holder Name" := Vend.Name;
- "Account Holder Address" := Vend.Address;
- "Account Holder Post Code" := Vend."Post Code";
- "Account Holder City" := Vend.City;
- "Acc. Hold. Country/Region Code" := Vend."Country/Region Code";
- end;
-
- trigger OnRename()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeOnRename(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- ApprovalsMgmt.OnRenameRecordInApprovalRequest(xRec.RecordId, RecordId);
-
- end;
-
- var
- PostCode: Record "Post Code";
- Vend: Record Vendor;
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- Text1000001: Label 'Bank Account No. %1 may be incorrect.';
- BankAccIdentifierIsEmptyErr: Label 'You must specify either a Bank Account No. or an IBAN.';
- BankAccDeleteErr: Label 'You cannot delete this bank account because it is associated with one or more open ledger entries.';
-
- procedure GetBankAccountNoWithCheck() AccountNo: Text
- begin
- AccountNo := GetBankAccountNo();
- if AccountNo = '' then
- Error(BankAccIdentifierIsEmptyErr);
- end;
-
- procedure GetBankAccountNo(): Text
- var
- Handled: Boolean;
- ResultBankAccountNo: Text;
- begin
- OnGetBankAccount(Handled, Rec, ResultBankAccountNo);
-
- if Handled then exit(ResultBankAccountNo);
-
- if IBAN <> '' then
- exit(DelChr(IBAN, '=<>'));
-
- if "Bank Account No." <> '' then
- exit("Bank Account No.");
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOnRename(var VendorBankAccount: Record "Vendor Bank Account"; xVendorBankAccount: Record "Vendor Bank Account"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeLookupName(xVendorBankAccount: Record "Vendor Bank Account")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateBankAccount(var VendorBankAccount: Record "Vendor Bank Account"; FieldToValidate: Text)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateIBAN(var VendorBankAccount: Record "Vendor Bank Account"; var xVendorBankAccount: Record "Vendor Bank Account"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnGetBankAccount(var Handled: Boolean; VendorBankAccount: Record "Vendor Bank Account"; var ResultBankAccountNo: Text)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateCity(var VendorBankAccount: Record "Vendor Bank Account"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePostCode(var VendorBankAccount: Record "Vendor Bank Account"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnDeleteOnAfterSetFilters(var VendorBankAccount: Record "Vendor Bank Account"; var VendorLedgerEntry: Record "Vendor Ledger Entry")
- begin
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Purchases/Vendor/VendorBankAccountCard.Page.al b/src/Layers/NL/BaseApp/Purchases/Vendor/VendorBankAccountCard.Page.al
deleted file mode 100644
index 455445753f..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/Vendor/VendorBankAccountCard.Page.al
+++ /dev/null
@@ -1,354 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.Vendor;
-
-using Microsoft.Foundation.Address;
-using System.Automation;
-
-page 425 "Vendor Bank Account Card"
-{
- Caption = 'Vendor Bank Account Card';
- PageType = Card;
- SourceTable = "Vendor Bank Account";
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field("Code"; Rec.Code)
- {
- ApplicationArea = Basic, Suite;
- }
- field(Name; Rec.Name)
- {
- ApplicationArea = Basic, Suite;
- }
- field(Address; Rec.Address)
- {
- ApplicationArea = Basic, Suite;
- }
- field("Address 2"; Rec."Address 2")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Post Code"; Rec."Post Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field(City; Rec.City)
- {
- ApplicationArea = Basic, Suite;
- }
- field("Country/Region Code"; Rec."Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
-
- trigger OnValidate()
- begin
- IsCountyVisible := FormatAddress.UseCounty(Rec."Country/Region Code");
- end;
- }
- group(CountyGroup)
- {
- ShowCaption = false;
- Visible = IsCountyVisible;
- field(County; Rec.County)
- {
- ApplicationArea = Basic, Suite;
- }
- }
- field("Phone No."; Rec."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- }
- field(Contact; Rec.Contact)
- {
- ApplicationArea = Basic, Suite;
- }
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- }
- field("Bank Branch No."; Rec."Bank Branch No.")
- {
- ApplicationArea = Basic, Suite;
- MaskType = Concealed;
- }
- field("Bank Account No."; Rec."Bank Account No.")
- {
- ApplicationArea = Basic, Suite;
- MaskType = Concealed;
- }
- field("Transit No."; Rec."Transit No.")
- {
- ApplicationArea = Basic, Suite;
- MaskType = Concealed;
- }
- }
- group(Communication)
- {
- Caption = 'Communication';
- field("Fax No."; Rec."Fax No.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- ToolTip = 'Specifies the fax number of the bank where the vendor has the bank account.';
- }
- field("E-Mail"; Rec."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- ExtendedDatatype = EMail;
- }
- field("Home Page"; Rec."Home Page")
- {
- ApplicationArea = Basic, Suite;
- }
- }
- group(Transfer)
- {
- Caption = 'Transfer';
- field("SWIFT Code"; Rec."SWIFT Code")
- {
- ApplicationArea = Basic, Suite;
- MaskType = Concealed;
- }
- field(IBAN; Rec.IBAN)
- {
- ApplicationArea = Basic, Suite;
- MaskType = Concealed;
- }
- }
- group("Account Holder")
- {
- Caption = 'Account Holder';
- field("Account Holder Name"; Rec."Account Holder Name")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the bank account owner''s name.';
- }
- field("Account Holder Address"; Rec."Account Holder Address")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the bank account owner''s address.';
- }
- field("Account Holder Post Code"; Rec."Account Holder Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Account Holder Post Code/City';
- ToolTip = 'Specifies the bank account owner''s postal code.';
- }
- field("Account Holder City"; Rec."Account Holder City")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the bank account owner''s city.';
- }
- field("Acc. Hold. Country/Region Code"; Rec."Acc. Hold. Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the country/region of the bank account holder.';
- }
- field("Bank Clearing Standard"; Rec."Bank Clearing Standard")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Bank Clearing Code"; Rec."Bank Clearing Code")
- {
- ApplicationArea = Basic, Suite;
- }
- }
- }
- area(factboxes)
- {
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- Visible = false;
- }
- part(WorkflowStatus; "Workflow Status Factbox")
- {
- ApplicationArea = All;
- Editable = false;
- Enabled = false;
- ShowFilter = false;
- Visible = ShowWorkflowStatus;
- }
- }
- }
-
- actions
- {
- area(processing)
- {
- group(Approval)
- {
- Caption = 'Approval';
- action(Approve)
- {
- ApplicationArea = All;
- Caption = 'Approve';
- Image = Approve;
- ToolTip = 'Approve the requested changes.';
- Visible = OpenApprovalEntriesExistCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.ApproveRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Reject)
- {
- ApplicationArea = All;
- Caption = 'Reject';
- Image = Reject;
- ToolTip = 'Reject the approval request.';
- Visible = OpenApprovalEntriesExistCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.RejectRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Delegate)
- {
- ApplicationArea = All;
- Caption = 'Delegate';
- Image = Delegate;
- ToolTip = 'Delegate the approval to a substitute approver.';
- Visible = OpenApprovalEntriesExistCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.DelegateRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Comment)
- {
- ApplicationArea = All;
- Caption = 'Comments';
- Image = ViewComments;
- ToolTip = 'View or add comments for the record.';
- Visible = OpenApprovalEntriesExistCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.GetApprovalComment(Rec);
- end;
- }
- }
- group("Request Approval")
- {
- Caption = 'Request Approval';
- Image = SendApprovalRequest;
- action(SendApprovalRequest)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Send A&pproval Request';
- Enabled = not OpenApprovalEntriesExist and CanRequestApprovalForFlow;
- Image = SendApprovalRequest;
- ToolTip = 'Request approval to change the record.';
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- if ApprovalsMgmt.CheckVendorBankAccountApprovalsWorkflowEnabled(Rec) then
- ApprovalsMgmt.OnSendVendorBankAccountForApproval(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.";
- begin
- ApprovalsMgmt.OnCancelVendorBankAccountApprovalRequest(Rec);
- WorkflowWebhookManagement.FindAndCancel(Rec.RecordId);
- end;
- }
- }
- }
- area(Promoted)
- {
- group(Promoted_Approve)
- {
- Caption = 'Approve';
-
- actionref(Approve_Promoted; Approve)
- {
- }
- actionref(Reject_Promoted; Reject)
- {
- }
- actionref(Comment_Promoted; Comment)
- {
- }
- actionref(Delegate_Promoted; Delegate)
- {
- }
- }
- group(Promoted_RequestApproval)
- {
- Caption = 'Request Approval', Comment = 'Generated from the PromotedActionCategories property index 4.';
-
- actionref(SendApprovalRequest_Promoted; SendApprovalRequest)
- {
- }
- actionref(CancelApprovalRequest_Promoted; CancelApprovalRequest)
- {
- }
- }
- }
- }
-
- trigger OnAfterGetRecord()
- begin
- IsCountyVisible := FormatAddress.UseCounty(Rec."Country/Region Code");
- end;
-
- trigger OnAfterGetCurrRecord()
- begin
- OpenApprovalEntriesExistCurrUser := ApprovalsMgmt.HasOpenApprovalEntriesForCurrentUser(Rec.RecordId);
- OpenApprovalEntriesExist := ApprovalsMgmt.HasOpenApprovalEntries(Rec.RecordId);
- ShowWorkflowStatus := CurrPage.WorkflowStatus.PAGE.SetFilterOnWorkflowRecord(Rec.RecordId);
- CanCancelApprovalForRecord := ApprovalsMgmt.CanCancelApprovalForRecord(Rec.RecordId);
- WorkflowWebhookManagement.GetCanRequestAndCanCancel(Rec.RecordId, CanRequestApprovalForFlow, CanCancelApprovalForFlow);
-
- end;
-
- var
- FormatAddress: Codeunit "Format Address";
- WorkflowWebhookManagement: Codeunit "Workflow Webhook Management";
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- IsCountyVisible: Boolean;
- OpenApprovalEntriesExistCurrUser: Boolean;
- CanCancelApprovalForRecord: Boolean;
- OpenApprovalEntriesExist: Boolean;
- CanRequestApprovalForFlow: Boolean;
- CanCancelApprovalForFlow: Boolean;
- ShowWorkflowStatus: Boolean;
-}
-
diff --git a/src/Layers/NL/BaseApp/Purchases/Vendor/VendorCard.Page.al b/src/Layers/NL/BaseApp/Purchases/Vendor/VendorCard.Page.al
deleted file mode 100644
index 1ca16c705b..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/Vendor/VendorCard.Page.al
+++ /dev/null
@@ -1,2061 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.Vendor;
-
-using Microsoft.Bank.Reconciliation;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Duplicates;
-using Microsoft.CRM.Outlook;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.Finance.VAT.Registration;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Attachment;
-using Microsoft.Foundation.Calendar;
-using Microsoft.Foundation.Comment;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Integration.Dataverse;
-using Microsoft.Integration.SyncEngine;
-using Microsoft.Inventory.Item.Catalog;
-using Microsoft.Inventory.Tracking;
-using Microsoft.Pricing.Calculation;
-using Microsoft.Pricing.PriceList;
-using Microsoft.Pricing.Source;
-using Microsoft.Purchases.Document;
-using Microsoft.Purchases.Payables;
-using Microsoft.Purchases.Pricing;
-using Microsoft.Purchases.Remittance;
-using Microsoft.Purchases.Reports;
-using Microsoft.Purchases.Setup;
-using Microsoft.Sales.Receivables;
-using Microsoft.Utilities;
-using System.Automation;
-using System.Email;
-using System.Environment;
-using System.Integration.Word;
-using System.Privacy;
-using System.Utilities;
-
-page 26 "Vendor Card"
-{
- Caption = 'Vendor Card';
- PageType = Card;
- RefreshOnActivate = true;
- SourceTable = Vendor;
- AdditionalSearchTerms = 'Supplier Profile, Vendor Profile, Supplier Data, Vendor View, Provider Details';
-
- AboutTitle = 'About vendor details';
- AboutText = 'With the **Vendor Card** you manage information about a vendor. Including the agreed terms of business for your trade with this vendor, such as payment terms, prices and discounts.';
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field("No."; Rec."No.")
- {
- ApplicationArea = All;
- Importance = Standard;
- ToolTip = 'Specifies the number of the involved entry or record, according to the specified number series.';
- Visible = NoFieldVisible;
-
- trigger OnAssistEdit()
- begin
- if Rec.AssistEdit(xRec) then
- CurrPage.Update();
- end;
- }
- field(Name; Rec.Name)
- {
- ApplicationArea = All;
- Importance = Promoted;
- ShowMandatory = true;
-
- trigger OnValidate()
- begin
- CurrPage.Update(true);
- end;
- }
- field("Name 2"; Rec."Name 2")
- {
- ApplicationArea = All;
- Importance = Additional;
- Visible = false;
- }
- field(Blocked; Rec.Blocked)
- {
- ApplicationArea = Basic, Suite;
- }
- field("Privacy Blocked"; Rec."Privacy Blocked")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Last Date Modified"; Rec."Last Date Modified")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Balance (LCY)"; Rec."Balance (LCY)")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the total value of your completed purchases from the vendor in the current fiscal year. It is calculated from amounts including VAT on all completed purchase invoices and credit memos.';
-
- trigger OnDrillDown()
- begin
- Rec.OpenVendorLedgerEntries(false);
- end;
- }
- field(BalanceAsCustomer; BalanceAsCustomer)
- {
- AutoFormatType = 2;
- AutoFormatExpression = '';
- ApplicationArea = Basic, Suite;
- Caption = 'Balance (LCY) As Customer';
- Editable = false;
- Enabled = BalanceAsCustomerEnabled;
- ToolTip = 'Specifies the amount that this company owes you. This is relevant when your vendor is also your customer. Vendor and customer are linked together through their contact record. Using vendor''s contact record you can create linked customer or link contact with existing customer to enable calculation of Balance As Customer amount.';
-
- trigger OnDrillDown()
- var
- DetailedCustLedgEntry: Record "Detailed Cust. Ledg. Entry";
- CustLedgerEntry: Record "Cust. Ledger Entry";
- begin
- if LinkedCustomerNo = '' then
- exit;
- DetailedCustLedgEntry.SetRange("Customer No.", LinkedCustomerNo);
- Rec.CopyFilter("Global Dimension 1 Filter", DetailedCustLedgEntry."Initial Entry Global Dim. 1");
- Rec.CopyFilter("Global Dimension 2 Filter", DetailedCustLedgEntry."Initial Entry Global Dim. 2");
- Rec.CopyFilter("Currency Filter", DetailedCustLedgEntry."Currency Code");
- CustLedgerEntry.DrillDownOnEntries(DetailedCustLedgEntry);
- end;
- }
- field("Balance Due (LCY)"; Rec."Balance Due (LCY)")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the total value of your unpaid purchases from the vendor in the current fiscal year. It is calculated from amounts including VAT on all open purchase invoices and credit memos.';
-
- trigger OnDrillDown()
- begin
- Rec.OpenVendorLedgerEntries(true);
- end;
- }
- field("Document Sending Profile"; Rec."Document Sending Profile")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Search Name"; Rec."Search Name")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("IC Partner Code"; Rec."IC Partner Code")
- {
- ApplicationArea = Intercompany;
- Importance = Additional;
- ToolTip = 'Specifies the vendor''s IC partner code, if the vendor is one of your intercompany partners.';
- }
- field("Purchaser Code"; Rec."Purchaser Code")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- field("Responsibility Center"; Rec."Responsibility Center")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- field("Disable Search by Name"; Rec."Disable Search by Name")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Company Size Code"; Rec."Company Size Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Statistics Group"; Rec."Statistics Group")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- }
- group("Address & Contact")
- {
- Caption = 'Address & Contact';
- group(AddressDetails)
- {
- Caption = 'Address';
- field(Address; Rec.Address)
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the vendor''s address.';
- }
- field("Address 2"; Rec."Address 2")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Country/Region Code"; Rec."Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
-
- trigger OnValidate()
- begin
- IsCountyVisible := FormatAddress.UseCounty(Rec."Country/Region Code");
- end;
- }
- field(City; Rec.City)
- {
- ApplicationArea = Basic, Suite;
- }
- group(Control198)
- {
- ShowCaption = false;
- Visible = IsCountyVisible;
- field(County; Rec.County)
- {
- ApplicationArea = Basic, Suite;
- }
- }
- field("Post Code"; Rec."Post Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field(ShowMap; ShowMapLbl)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ShowCaption = false;
- Style = StrongAccent;
- StyleExpr = true;
- ToolTip = 'Specifies you can view the vendor''s address on your preferred map website.';
-
- trigger OnDrillDown()
- begin
- CurrPage.Update(true);
- Rec.DisplayMap();
- end;
- }
- }
- field("Phone No."; Rec."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- }
- field(MobilePhoneNo; Rec."Mobile Phone No.")
- {
- Caption = 'Mobile Phone No.';
- ApplicationArea = Basic, Suite;
- ExtendedDatatype = PhoneNo;
- }
- field("E-Mail"; Rec."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- ExtendedDatatype = EMail;
- Importance = Promoted;
- }
- field("Fax No."; Rec."Fax No.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Home Page"; Rec."Home Page")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Our Account No."; Rec."Our Account No.")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Language Code"; Rec."Language Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Format Region"; Rec."Format Region")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- group(Contact)
- {
- Caption = 'Contact';
- field("Primary Contact No."; Rec."Primary Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Primary Contact Code';
- }
- field(Control16; Rec.Contact)
- {
- ApplicationArea = Basic, Suite;
- Editable = ContactEditable;
- Importance = Promoted;
-
- trigger OnValidate()
- begin
- ContactOnAfterValidate();
- end;
- }
- }
- }
- group(Invoicing)
- {
- Caption = 'Invoicing';
- AboutTitle = 'Manage invoicing from the vendor';
- AboutText = 'Choose tax and other settings for the invoices you receive from this vendor. Assign posting groups to control how transactions with this vendor are grouped and posted, based on type of trade or market.';
-
- field("VAT Registration No."; Rec."VAT Registration No.")
- {
- ApplicationArea = VAT;
-
- trigger OnDrillDown()
- var
- VATRegistrationLogMgt: Codeunit "VAT Registration Log Mgt.";
- begin
- VATRegistrationLogMgt.AssistEditVendorVATReg(Rec);
- end;
- }
- field("EORI Number"; Rec."EORI Number")
- {
- ApplicationArea = Basic, Suite;
- }
- field(GLN; Rec.GLN)
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Copy Buy-from Add. to Qte From"; Rec."Copy Buy-from Add. to Qte From")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Tax Liable"; Rec."Tax Liable")
- {
- ApplicationArea = SalesTax;
- }
- field("Tax Area Code"; Rec."Tax Area Code")
- {
- ApplicationArea = SalesTax;
- }
- field("Pay-to Vendor No."; Rec."Pay-to Vendor No.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Invoice Disc. Code"; Rec."Invoice Disc. Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- NotBlank = true;
- }
- field("Prices Including VAT"; Rec."Prices Including VAT")
- {
- ApplicationArea = VAT;
- }
- field("Self-Billing Agreement"; Rec."Self-Billing Agreement")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Price Calculation Method"; Rec."Price Calculation Method")
- {
- Visible = ExtendedPriceEnabled;
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Registration Number"; Rec."Registration Number")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- group("Posting Details")
- {
- Caption = 'Posting Details';
- field("Gen. Bus. Posting Group"; Rec."Gen. Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- ShowMandatory = true;
- }
- field("VAT Bus. Posting Group"; Rec."VAT Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Vendor Posting Group"; Rec."Vendor Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- ShowMandatory = true;
- }
- field("Allow Multiple Posting Groups"; Rec."Allow Multiple Posting Groups")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- ToolTip = 'Specifies if multiple posting groups can be used for posting business transactions for this customer.';
- Visible = IsAllowMultiplePostingGroupsVisible;
- }
- }
- group("Foreign Trade")
- {
- Caption = 'Foreign Trade';
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- }
- }
- group(Payments)
- {
- Caption = 'Payments';
- AboutTitle = 'Manage payments to the vendor';
- AboutText = 'Choose the payments terms, payment method, priority, and other settings used when processing and suggesting payments to this vendor.';
-
- field("Prepayment %"; Rec."Prepayment %")
- {
- ApplicationArea = Prepayments;
- Importance = Additional;
- }
- field("Application Method"; Rec."Application Method")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Payment Terms Code"; Rec."Payment Terms Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Payment Method Code"; Rec."Payment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field(Priority; Rec.Priority)
- {
- ApplicationArea = Basic, Suite;
- }
- field("Block Payment Tolerance"; Rec."Block Payment Tolerance")
- {
- ApplicationArea = Basic, Suite;
-
- trigger OnValidate()
- var
- ConfirmManagement: Codeunit "Confirm Management";
- begin
- if Rec."Block Payment Tolerance" then begin
- if ConfirmManagement.GetResponseOrDefault(Text002, true) then
- PaymentToleranceMgt.DelTolVendLedgEntry(Rec);
- end else
- if ConfirmManagement.GetResponseOrDefault(Text001, true) then
- PaymentToleranceMgt.CalcTolVendLedgEntry(Rec);
- end;
- }
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the transaction mode commonly used in telebanking for this vendor.';
- }
- field("Preferred Bank Account Code"; Rec."Preferred Bank Account Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Partner Type"; Rec."Partner Type")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Intrastat Partner Type"; Rec."Intrastat Partner Type")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Cash Flow Payment Terms Code"; Rec."Cash Flow Payment Terms Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Creditor No."; Rec."Creditor No.")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Exclude from Pmt. Practices"; Rec."Exclude from Pmt. Practices")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- }
- group(Receiving)
- {
- Caption = 'Receiving';
- field("Location Code"; Rec."Location Code")
- {
- ApplicationArea = Location;
- Importance = Promoted;
- }
- field("Shipment Method Code"; Rec."Shipment Method Code")
- {
- ApplicationArea = Suite;
- Importance = Promoted;
- }
- field("Lead Time Calculation"; Rec."Lead Time Calculation")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Base Calendar Code"; Rec."Base Calendar Code")
- {
- ApplicationArea = Basic, Suite;
- DrillDown = false;
- }
- field("Customized Calendar"; format(CalendarMgmt.CustomizedChangesExist(Rec)))
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customized Calendar';
- Editable = false;
- ToolTip = 'Specifies if you have set up a customized calendar for the vendor.';
-
- trigger OnDrillDown()
- begin
- CurrPage.SaveRecord();
- Rec.TestField("Base Calendar Code");
- CalendarMgmt.ShowCustomizedCalendar(Rec);
- end;
- }
- field("Over-Receipt Code"; Rec."Over-Receipt Code")
- {
- ApplicationArea = All;
- Visible = OverReceiptAllowed;
- }
- }
- }
- area(factboxes)
- {
- part(Control82; "Vendor Picture")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("No.");
- Visible = not IsOfficeAddin;
- }
- part("Attached Documents List"; "Doc. Attachment List Factbox")
- {
- ApplicationArea = All;
- Caption = 'Documents';
- UpdatePropagation = Both;
- SubPageLink = "Table ID" = const(Database::Vendor),
- "No." = field("No.");
- }
- part(VendorStatisticsFactBox; "Vendor Statistics FactBox")
- {
- ApplicationArea = All;
- SubPageLink = "No." = field("No."),
- "Currency Filter" = field("Currency Filter"),
- "Date Filter" = field("Date Filter"),
- "Global Dimension 1 Filter" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Filter" = field("Global Dimension 2 Filter");
- }
- part(AgedAccPayableChart; "Aged Acc. Payable Chart")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("No.");
- Visible = IsOfficeAddin;
- }
- part(VendorHistBuyFromFactBox; "Vendor Hist. Buy-from FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("No."),
- "Currency Filter" = field("Currency Filter"),
- "Date Filter" = field("Date Filter"),
- "Global Dimension 1 Filter" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Filter" = field("Global Dimension 2 Filter");
- }
- part(VendorHistPayToFactBox; "Vendor Hist. Pay-to FactBox")
- {
- ApplicationArea = All;
- SubPageLink = "No." = field("No."),
- "Currency Filter" = field("Currency Filter"),
- "Date Filter" = field("Date Filter"),
- "Global Dimension 1 Filter" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Filter" = field("Global Dimension 2 Filter");
- Visible = false;
- }
- part(WorkflowStatus; "Workflow Status FactBox")
- {
- ApplicationArea = All;
- Editable = false;
- Enabled = false;
- ShowFilter = false;
- Visible = ShowWorkflowStatus;
- }
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("Ven&dor")
- {
- Caption = 'Ven&dor';
- Image = Vendor;
- action(Dimensions)
- {
- ApplicationArea = Dimensions;
- Caption = 'Dimensions';
- Image = Dimensions;
- RunObject = Page "Default Dimensions";
- RunPageLink = "Table ID" = const(23),
- "No." = field("No.");
- 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.';
- }
- action("Bank Accounts")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Bank Accounts';
- Image = BankAccount;
- RunObject = Page "Vendor Bank Account List";
- RunPageLink = "Vendor No." = field("No.");
- ToolTip = 'View or set up the vendor''s bank accounts. You can set up any number of bank accounts for each vendor.';
- }
- action(ContactBtn)
- {
- AccessByPermission = TableData Contact = R;
- ApplicationArea = Basic, Suite;
- Caption = 'C&ontact';
- Image = ContactPerson;
- ToolTip = 'View or edit detailed information about the contact person at the vendor.';
-
- trigger OnAction()
- begin
- Rec.ShowContact();
- end;
- }
- action(OrderAddresses)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Order &Addresses';
- Image = Addresses;
- RunObject = Page "Order Address List";
- RunPageLink = "Vendor No." = field("No.");
- ToolTip = 'View a list of alternate order addresses for the vendor.';
- }
- action(RemitAddresses)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Remit Addresses';
- Image = Addresses;
- RunObject = Page "Remit Address List";
- RunPageLink = "Vendor No." = field("No.");
- ToolTip = 'View a list of alternate remit addresses for the vendor.';
- }
- action("Co&mments")
- {
- ApplicationArea = Comments;
- Caption = 'Co&mments';
- Image = ViewComments;
- RunObject = Page "Comment Sheet";
- RunPageLink = "Table Name" = const(Vendor),
- "No." = field("No.");
- ToolTip = 'View or add comments for the record.';
- }
- action(ApprovalEntries)
- {
- 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()
- begin
- ApprovalsMgmt.OpenApprovalEntriesPage(Rec.RecordId);
- end;
- }
- action("Item References")
- {
- AccessByPermission = TableData "Item Reference" = R;
- ApplicationArea = Suite, ItemReferences;
- Caption = 'Item References';
- Image = Change;
- RunObject = Page "Item References";
- RunPageLink = "Reference Type" = const(Vendor),
- "Reference Type No." = field("No.");
- RunPageView = sorting("Reference Type", "Reference Type No.");
- ToolTip = 'Set up a customer''s or vendor''s own identification of the selected item. Item references to the customer''s item number means that the item number is automatically shown on sales documents instead of the number that you use.';
- }
- action(VendorReportSelections)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Document Layouts';
- Image = Quote;
- ToolTip = 'Set up a layout for different types of documents such as invoices, quotes, and credit memos.';
-
- trigger OnAction()
- var
- CustomReportSelection: Record "Custom Report Selection";
- begin
- CustomReportSelection.SetRange("Source Type", DATABASE::Vendor);
- CustomReportSelection.SetRange("Source No.", Rec."No.");
- PAGE.RunModal(PAGE::"Vendor Report Selections", CustomReportSelection);
- end;
- }
- action(Attachments)
- {
- 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("&Purchases")
- {
- Caption = '&Purchases';
- Image = Purchasing;
- action(Items)
- {
- ApplicationArea = Planning;
- Caption = 'Items';
- Image = Item;
- RunObject = Page "Vendor Item Catalog";
- RunPageLink = "Vendor No." = field("No.");
- RunPageView = sorting("Vendor No.", "Item No.");
- ToolTip = 'Open the list of items that you trade in.';
- }
- action("Invoice &Discounts")
- {
- ApplicationArea = Suite;
- Caption = 'Invoice &Discounts';
- Image = CalculateInvoiceDiscount;
- RunObject = Page "Vend. Invoice Discounts";
- RunPageLink = Code = field("Invoice Disc. Code");
- ToolTip = 'Set up different discounts that are applied to invoices for the vendor. An invoice discount is automatically granted to the vendor when the total on a sales invoice exceeds a certain amount.';
- }
- action(PriceLists)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Price Lists';
- Image = Price;
- Visible = ExtendedPriceEnabled;
- ToolTip = 'View or set up purchase price lists for products that you buy from the vendor. An product price is automatically granted on invoice lines when the specified criteria are met, such as vendor, quantity, or ending date.';
-
- trigger OnAction()
- var
- PriceUXManagement: Codeunit "Price UX Management";
- begin
- PriceUXManagement.ShowPriceLists(Rec, Enum::"Price Amount Type"::Any);
- end;
- }
- action(PriceLines)
- {
- AccessByPermission = TableData "Purchase Price Access" = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Prices';
- Image = Price;
- Scope = Repeater;
- Visible = ExtendedPriceEnabled;
- ToolTip = 'View or set up purchase price lines for products that you buy from the vendor. A product price is automatically granted on invoice lines when the specified criteria are met, such as vendor, quantity, or ending date.';
-
- trigger OnAction()
- var
- PriceSource: Record "Price Source";
- PriceUXManagement: Codeunit "Price UX Management";
- begin
- Rec.ToPriceSource(PriceSource);
- PriceUXManagement.ShowPriceListLines(PriceSource, Enum::"Price Amount Type"::Price);
- end;
- }
- action(DiscountLines)
- {
- AccessByPermission = TableData "Purchase Discount Access" = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Discounts';
- Image = LineDiscount;
- Scope = Repeater;
- Visible = ExtendedPriceEnabled;
- ToolTip = 'View or set up different discounts for products that you buy from the vendor. A product line discount is automatically granted on invoice lines when the specified criteria are met, such as vendor, quantity, or ending date.';
-
- trigger OnAction()
- var
- PriceSource: Record "Price Source";
- PriceUXManagement: Codeunit "Price UX Management";
- begin
- Rec.ToPriceSource(PriceSource);
- PriceUXManagement.ShowPriceListLines(PriceSource, Enum::"Price Amount Type"::Discount);
- end;
- }
- action(PriceListsDiscounts)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Price Lists (Discounts)';
- Image = LineDiscount;
- Visible = false;
- ToolTip = 'View or set up different discounts for products that you buy from the vendor. An product discount is automatically granted on invoice lines when the specified criteria are met, such as vendor, quantity, or ending date.';
-
- trigger OnAction()
- var
- PriceUXManagement: Codeunit "Price UX Management";
- AmountType: Enum "Price Amount Type";
- begin
- PriceUXManagement.ShowPriceLists(Rec, AmountType::Discount);
- end;
- }
- action(Prices)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Prices';
- Image = Price;
- Visible = not ExtendedPriceEnabled;
- RunObject = Page "Purchase Prices";
- RunPageLink = "Vendor No." = field("No.");
- RunPageView = sorting("Vendor No.");
- ToolTip = 'View or set up different prices for items that you buy from the vendor. An item price is automatically granted on invoice lines when the specified criteria are met, such as vendor, quantity, or ending date.';
- }
- action("Line Discounts")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Line Discounts';
- Image = LineDiscount;
- Visible = not ExtendedPriceEnabled;
- RunObject = Page "Purchase Line Discounts";
- RunPageLink = "Vendor No." = field("No.");
- RunPageView = sorting("Vendor No.");
- ToolTip = 'View or set up different discounts for items that you buy from the vendor. An item discount is automatically granted on invoice lines when the specified criteria are met, such as vendor, quantity, or ending date.';
- }
- action("Prepa&yment Percentages")
- {
- ApplicationArea = Prepayments;
- Caption = 'Prepa&yment Percentages';
- Image = PrepaymentPercentages;
- RunObject = Page "Purchase Prepmt. Percentages";
- RunPageLink = "Vendor No." = field("No.");
- RunPageView = sorting("Vendor No.");
- ToolTip = 'View or edit the percentages of the price that can be paid as a prepayment. ';
- }
- action("Recurring Purchase Lines")
- {
- ApplicationArea = Suite;
- Caption = 'Recurring Purchase Lines';
- Image = CodesList;
- RunObject = Page "Standard Vendor Purchase Codes";
- RunPageLink = "Vendor No." = field("No.");
- ToolTip = 'View or edit recurring purchase lines for the vendor.';
- }
- action("Mapping Text to Account")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mapping Text to Account';
- Image = MapAccounts;
- RunObject = Page "Text-to-Account Mapping Wksh.";
- RunPageLink = "Vendor No." = field("No.");
- ToolTip = 'Page mapping text to account';
- }
- }
- group(Documents)
- {
- Caption = 'Documents';
- Image = Administration;
- action(Quotes)
- {
- ApplicationArea = Suite;
- Caption = 'Quotes';
- Image = Quote;
- RunObject = Page "Purchase Quotes";
- RunPageLink = "Buy-from Vendor No." = field("No.");
- RunPageView = sorting("Document Type", "Buy-from Vendor No.");
- ToolTip = 'View a list of ongoing purchase quotes.';
- }
- action(Orders)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Orders';
- Image = Document;
- RunObject = Page "Purchase Order List";
- RunPageLink = "Buy-from Vendor No." = field("No.");
- RunPageView = sorting("Document Type", "Buy-from Vendor No.");
- ToolTip = 'View a list of ongoing purchase orders for the vendor.';
- }
- action("Return Orders")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Return Orders';
- Image = ReturnOrder;
- RunObject = Page "Purchase Return Order List";
- RunPageLink = "Buy-from Vendor No." = field("No.");
- RunPageView = sorting("Document Type", "Buy-from Vendor No.");
- ToolTip = 'Open the list of ongoing return orders.';
- }
- action("Blanket Orders")
- {
- ApplicationArea = Suite;
- Caption = 'Blanket Orders';
- Image = BlanketOrder;
- RunObject = Page "Blanket Purchase Orders";
- RunPageLink = "Buy-from Vendor No." = field("No.");
- RunPageView = sorting("Document Type", "Buy-from Vendor No.");
- ToolTip = 'Open the list of ongoing blanket orders.';
- }
- }
- group(History)
- {
- Caption = 'History';
- Image = History;
- action("Ledger E&ntries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Ledger E&ntries';
- Image = VendorLedger;
- RunObject = Page "Vendor Ledger Entries";
- RunPageLink = "Vendor No." = field("No.");
- RunPageView = sorting("Vendor No.")
- order(descending);
- ShortCutKey = 'Ctrl+F7';
- ToolTip = 'View the history of transactions that have been posted for the selected record.';
- }
- action(Statistics)
- {
- ApplicationArea = Suite;
- Caption = 'Statistics';
- Image = Statistics;
- RunObject = Page "Vendor Statistics";
- RunPageLink = "No." = field("No."),
- "Global Dimension 1 Filter" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Filter" = field("Global Dimension 2 Filter");
- ShortCutKey = 'F7';
- ToolTip = 'View statistical information, such as the value of posted entries, for the record.';
- }
- action(Purchases)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchases';
- Image = Purchase;
- RunObject = Page "Vendor Purchases";
- RunPageLink = "No." = field("No."),
- "Global Dimension 1 Filter" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Filter" = field("Global Dimension 2 Filter");
- ToolTip = 'Shows a summary of vendor ledger entries. You select the time interval in the View by field. The Period column on the left contains a series of dates that are determined by the time interval you have selected.';
- }
- action("Entry Statistics")
- {
- ApplicationArea = Suite;
- Caption = 'Entry Statistics';
- Image = EntryStatistics;
- RunObject = Page "Vendor Entry Statistics";
- RunPageLink = "No." = field("No."),
- "Date Filter" = field("Date Filter"),
- "Global Dimension 1 Filter" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Filter" = field("Global Dimension 2 Filter");
- ToolTip = 'View entry statistics for the record.';
- }
- action("Statistics by C&urrencies")
- {
- ApplicationArea = Suite;
- Caption = 'Statistics by C&urrencies';
- Image = Currencies;
- RunObject = Page "Vend. Stats. by Curr. Lines";
- RunPageLink = "Vendor Filter" = field("No."),
- "Global Dimension 1 Filter" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Filter" = field("Global Dimension 2 Filter"),
- "Date Filter" = field("Date Filter");
- ToolTip = 'View statistics for vendors that use multiple currencies.';
- }
- action("Item &Tracking Entries")
- {
- ApplicationArea = ItemTracking;
- Caption = 'Item &Tracking Entries';
- Image = ItemTrackingLedger;
- ToolTip = 'View serial, lot or package numbers that are assigned to items.';
-
- trigger OnAction()
- var
- ItemTrackingDocMgt: Codeunit "Item Tracking Doc. Management";
- begin
- ItemTrackingDocMgt.ShowItemTrackingForEntity(2, Rec."No.", '', '', '');
- end;
- }
- action("Sent Emails")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sent Emails';
- Image = ShowList;
- ToolTip = 'View a list of emails that you have sent to this vendor.';
-
- trigger OnAction()
- var
- Email: Codeunit Email;
- begin
- Email.OpenSentEmails(Database::Vendor, Rec.SystemId);
- end;
- }
- }
- group(ActionGroupCDS)
- {
- Caption = 'Dataverse';
- Image = Administration;
- Visible = CRMIntegrationEnabled or CDSIntegrationEnabled;
- Enabled = (BlockedFilterApplied and (Rec.Blocked = Rec.Blocked::" ")) or not BlockedFilterApplied;
- action(CDSGotoAccount)
- {
- ApplicationArea = Suite;
- Caption = 'Account';
- Image = CoupledCustomer;
- ToolTip = 'Open the coupled Dataverse account.';
-
- trigger OnAction()
- var
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- begin
- CRMIntegrationManagement.ShowCRMEntityFromRecordID(Rec.RecordId);
- end;
- }
- action(CDSSynchronizeNow)
- {
- AccessByPermission = TableData "CRM Integration Record" = IM;
- ApplicationArea = Suite;
- Caption = 'Synchronize';
- Image = Refresh;
- ToolTip = 'Send or get updated data to or from Dataverse.';
-
- trigger OnAction()
- var
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- begin
- CRMIntegrationManagement.UpdateOneNow(Rec.RecordId);
- end;
- }
- group(Coupling)
- {
- Caption = 'Coupling', Comment = 'Coupling is a noun';
- Image = LinkAccount;
- ToolTip = 'Create, change, or delete a coupling between the Business Central record and a Dataverse record.';
- action(ManageCDSCoupling)
- {
- AccessByPermission = TableData "CRM Integration Record" = IM;
- ApplicationArea = Suite;
- Caption = 'Set Up Coupling';
- Image = LinkAccount;
- ToolTip = 'Create or modify the coupling to a Dataverse account.';
-
- trigger OnAction()
- var
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- begin
- CRMIntegrationManagement.DefineCoupling(Rec.RecordId);
- end;
- }
- action(DeleteCDSCoupling)
- {
- AccessByPermission = TableData "CRM Integration Record" = D;
- ApplicationArea = Suite;
- Caption = 'Delete Coupling';
- Enabled = CRMIsCoupledToRecord;
- Image = UnLinkAccount;
- ToolTip = 'Delete the coupling to a Dataverse account.';
-
- trigger OnAction()
- var
- CRMCouplingManagement: Codeunit "CRM Coupling Management";
- begin
- CRMCouplingManagement.RemoveCoupling(Rec.RecordId);
- end;
- }
- }
- action(ShowLog)
- {
- ApplicationArea = Suite;
- Caption = 'Synchronization Log';
- Image = Log;
- ToolTip = 'View integration synchronization jobs for vendors.';
-
- trigger OnAction()
- var
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- begin
- CRMIntegrationManagement.ShowLog(Rec.RecordId);
- end;
- }
- }
- }
- area(creation)
- {
- action(NewBlanketPurchaseOrder)
- {
- ApplicationArea = Suite;
- Caption = 'Blanket Purchase Order';
- Image = BlanketOrder;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category6;
- RunObject = Page "Blanket Purchase Order";
- RunPageLink = "Buy-from Vendor No." = field("No.");
- RunPageMode = Create;
- ToolTip = 'Create a new blanket purchase order for the vendor.';
- }
- action(NewPurchaseQuote)
- {
- ApplicationArea = Suite;
- Caption = 'Purchase Quote';
- Image = Quote;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category6;
- RunObject = Page "Purchase Quote";
- RunPageLink = "Buy-from Vendor No." = field("No.");
- RunPageMode = Create;
- ToolTip = 'Create a new purchase quote for the vendor.';
- }
- action(NewPurchaseInvoice)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Invoice';
- Image = NewPurchaseInvoice;
- RunObject = Page "Purchase Invoice";
- RunPageLink = "Buy-from Vendor No." = field("No."), "Document Type" = const(Invoice);
- RunPageMode = Create;
- ToolTip = 'Create a new purchase invoice for items or services.';
- Visible = not IsOfficeAddin;
- }
- action(NewPurchaseOrder)
- {
- ApplicationArea = Suite;
- Caption = 'Purchase Order';
- Image = Document;
- RunObject = Page "Purchase Order";
- RunPageLink = "Buy-from Vendor No." = field("No.");
- RunPageMode = Create;
- ToolTip = 'Create a new purchase order.';
- Visible = not IsOfficeAddin;
- }
- action(NewPurchaseCrMemo)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Credit Memo';
- Image = CreditMemo;
- RunObject = Page "Purchase Credit Memo";
- RunPageLink = "Buy-from Vendor No." = field("No.");
- RunPageMode = Create;
- ToolTip = 'Create a new purchase credit memo to revert a posted purchase invoice.';
- Visible = not IsOfficeAddin;
- }
- action(NewPurchaseReturnOrder)
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Purchase Return Order';
- Image = ReturnOrder;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category6;
- RunObject = Page "Purchase Return Order";
- RunPageLink = "Buy-from Vendor No." = field("No.");
- RunPageMode = Create;
- ToolTip = 'Create a new purchase return order for the vendor.';
- }
- action(NewPurchaseInvoiceAddin)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Invoice';
- Image = NewPurchaseInvoice;
- ToolTip = 'Create a new purchase invoice for items or services.';
- Visible = IsOfficeAddin;
-
- trigger OnAction()
- begin
- Rec.CreateAndShowNewInvoice();
- end;
- }
- action(NewPurchaseOrderAddin)
- {
- ApplicationArea = Suite;
- Caption = 'Purchase Order';
- Image = Document;
- ToolTip = 'Create a new purchase order.';
- Visible = IsOfficeAddin;
-
- trigger OnAction()
- begin
- Rec.CreateAndShowNewPurchaseOrder();
- end;
- }
- action(NewPurchaseCrMemoAddin)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Credit Memo';
- Image = CreditMemo;
- ToolTip = 'Create a new purchase credit memo to revert a posted purchase invoice.';
- Visible = IsOfficeAddin;
-
- trigger OnAction()
- begin
- Rec.CreateAndShowNewCreditMemo();
- end;
- }
- }
- area(processing)
- {
- group(Approval)
- {
- Caption = 'Approval';
- action(Approve)
- {
- ApplicationArea = All;
- Caption = 'Approve';
- Image = Approve;
- ToolTip = 'Approve the requested changes.';
- Visible = OpenApprovalEntriesExistCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.ApproveRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Reject)
- {
- ApplicationArea = All;
- Caption = 'Reject';
- Image = Reject;
- ToolTip = 'Reject the approval request.';
- Visible = OpenApprovalEntriesExistCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.RejectRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Delegate)
- {
- ApplicationArea = All;
- Caption = 'Delegate';
- Image = Delegate;
- ToolTip = 'Delegate the approval to a substitute approver.';
- Visible = OpenApprovalEntriesExistCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.DelegateRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Comment)
- {
- ApplicationArea = All;
- Caption = 'Comments';
- Image = ViewComments;
- ToolTip = 'View or add comments for the record.';
- Visible = OpenApprovalEntriesExistCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.GetApprovalComment(Rec);
- end;
- }
- }
- group("Request Approval")
- {
- Caption = 'Request Approval';
- Image = SendApprovalRequest;
- action(SendApprovalRequest)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Send A&pproval Request';
- Enabled = not OpenApprovalEntriesExist and CanRequestApprovalForFlow;
- Image = SendApprovalRequest;
- ToolTip = 'Request approval to change the record.';
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- if ApprovalsMgmt.CheckVendorApprovalsWorkflowEnabled(Rec) then
- ApprovalsMgmt.OnSendVendorForApproval(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.";
- begin
- ApprovalsMgmt.OnCancelVendorApprovalRequest(Rec);
- WorkflowWebhookManagement.FindAndCancel(Rec.RecordId);
- end;
- }
- group(Flow)
- {
- Caption = 'Power Automate';
-
- customaction(CreateFlowFromTemplate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create approval flow';
- ToolTip = 'Create a new flow in Power Automate from a list of relevant flow templates.';
- Visible = IsSaaS and IsPowerAutomatePrivacyNoticeApproved;
- CustomActionType = FlowTemplateGallery;
- FlowTemplateCategoryName = 'd365bc_approval_vendor';
- }
- }
- }
- group("F&unctions")
- {
- Caption = 'F&unctions';
- Image = "Action";
- action(Templates)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Templates';
- Image = Template;
- //The property 'PromotedIsBig' can only be set if the property 'Promoted' is set to 'true'
- //PromotedIsBig = true;
- ToolTip = 'View or edit vendor templates.';
-
- trigger OnAction()
- var
- VendorTemplMgt: Codeunit "Vendor Templ. Mgt.";
- begin
- VendorTemplMgt.ShowTemplates();
- end;
- }
- action(ApplyTemplate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Apply Template';
- Image = ApplyTemplate;
- ToolTip = 'Apply a template to update the entity with your standard settings for a certain type of entity.';
-
- trigger OnAction()
- var
- VendorTemplMgt: Codeunit "Vendor Templ. Mgt.";
- begin
- VendorTemplMgt.UpdateVendorFromTemplate(Rec);
- end;
- }
- action(SaveAsTemplate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Save as Template';
- Image = Save;
- ToolTip = 'Save the vendor card as a template that can be reused to create new vendor cards. Vendor templates contain preset information to help you fill fields on vendor cards.';
-
- trigger OnAction()
- var
- VendorTemplMgt: Codeunit "Vendor Templ. Mgt.";
- begin
- VendorTemplMgt.SaveAsTemplate(Rec);
- end;
- }
- action(MergeDuplicate)
- {
- AccessByPermission = TableData "Merge Duplicates Buffer" = RIMD;
- ApplicationArea = Basic, Suite;
- Caption = 'Merge With';
- Ellipsis = true;
- Image = ItemSubstitution;
- ToolTip = 'Merge two vendor records into one. Before merging, review which field values you want to keep or override. The merge action cannot be undone.';
-
- trigger OnAction()
- var
- TempMergeDuplicatesBuffer: Record "Merge Duplicates Buffer" temporary;
- begin
- TempMergeDuplicatesBuffer.Show(DATABASE::Vendor, Rec."No.");
- end;
- }
- }
- action("Create Payments")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Payments';
- Ellipsis = true;
- Image = PaymentJournal;
- RunObject = Page "Payment Journal";
- ToolTip = 'View or edit the payment journal where you can register payments to vendors.';
- }
- action("Purchase Journal")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Journal';
- Image = Journals;
- RunObject = Page "Purchase Journal";
- ToolTip = 'Post any purchase transaction for the vendor. ';
- }
- action(PayVendor)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Pay Vendor';
- Image = SuggestVendorPayments;
- RunObject = Page "Vendor Ledger Entries";
- RunPageLink = "Vendor No." = field("No."),
- "Remaining Amount" = filter(< 0),
- "Applies-to ID" = filter(''),
- "Document Type" = filter(Invoice);
- ToolTip = 'Opens vendor ledger entries with invoices that have not been paid yet.';
- }
- action(WordTemplate)
- {
- ApplicationArea = All;
- Caption = 'Apply Word Template';
- ToolTIp = 'Apply a Word template on the vendor.';
- Image = Word;
-
- trigger OnAction()
- var
- Vendor: Record Vendor;
- WordTemplateSelectionWizard: Page "Word Template Selection Wizard";
- begin
- CurrPage.SetSelectionFilter(Vendor);
- WordTemplateSelectionWizard.SetData(Vendor);
- WordTemplateSelectionWizard.RunModal();
- end;
- }
- action(Email)
- {
- ApplicationArea = All;
- Caption = 'Send Email';
- Image = Email;
- ToolTip = 'Send an email to this vendor.';
-
- trigger OnAction()
- var
- TempEmailItem: Record "Email Item" temporary;
- EmailScenario: Enum "Email Scenario";
- begin
- TempEmailItem.AddSourceDocument(Database::Vendor, Rec.SystemId);
- TempEmailitem."Send to" := Rec."E-Mail";
- TempEmailItem.Send(false, EmailScenario::Default);
- end;
- }
- group("Incoming Documents")
- {
- Caption = 'Incoming Documents';
- Image = SendApprovalRequest;
- action(SendToIncomingDocuments)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Send to Incoming Documents';
- Ellipsis = true;
- Enabled = SendToIncomingDocEnabled;
- Image = SendElectronicDocument;
- ToolTip = 'Send to Incoming Documents';
- Visible = SendToIncomingDocumentVisible;
-
- trigger OnAction()
- begin
- OfficeMgt.InitiateSendToIncomingDocuments(Rec."No.");
- end;
- }
- action(SendToOCR)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Send To OCR';
- Ellipsis = true;
- Enabled = SendToOCREnabled;
- Image = SendElectronicDocument;
- ToolTip = 'Send To OCR';
- Visible = SendToOCRVisible;
-
- trigger OnAction()
- begin
- OfficeMgt.InitiateSendToOCR(Rec."No.");
- end;
- }
- action(SendIncomingDocApprovalRequest)
- {
- AccessByPermission = TableData "Approval Entry" = I;
- ApplicationArea = Basic, Suite;
- Caption = 'Send A&pproval Request';
- Image = SendApprovalRequest;
- ToolTip = 'Request approval to change the record.';
- Visible = SendIncomingDocApprovalRequestVisible;
-
- trigger OnAction()
- begin
- OfficeMgt.InitiateSendApprovalRequest(Rec."No.");
- end;
- }
- }
- }
- area(reporting)
- {
-#if not CLEAN28
- action("Vendor - Summary Aging")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor - Summary Aging (Obsolete)';
- Image = "Report";
- ToolTip = 'View a summary of the payables owed to each vendor, divided into three time periods.';
- ObsoleteState = Pending;
- ObsoleteReason = 'This report is obsolete and will be removed in a future release. See the documentation for alternative options.';
- ObsoleteTag = '28.0';
-
- trigger OnAction()
- begin
- RunReport(REPORT::"Vendor - Summary Aging");
- end;
- }
-#endif
- action("Vendor - Labels")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor - Labels';
- Image = "Report";
- ToolTip = 'View mailing labels with the vendors'' names and addresses.';
-
- trigger OnAction()
- begin
- RunReport(REPORT::"Vendor - Labels");
- end;
- }
- action("Vendor - Balance to Date")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor - Balance to Date';
- Image = "Report";
- ToolTip = 'View a detail balance for selected vendors.';
-
- trigger OnAction()
- begin
- RunReport(REPORT::"Vendor - Balance to Date");
- end;
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- actionref(ContactBtn_Promoted; ContactBtn)
- {
- }
- actionref(MergeDuplicate_Promoted; MergeDuplicate)
- {
- }
- actionref(ApplyTemplate_Promoted; ApplyTemplate)
- {
- }
- actionref(Email_Promoted; Email)
- {
- }
- actionref(PayVendor_Promoted; PayVendor)
- {
- }
- }
- group(Category_Category4)
- {
- Caption = 'Approve', Comment = 'Generated from the PromotedActionCategories property index 3.';
-
- actionref(Approve_Promoted; Approve)
- {
- }
- actionref(Reject_Promoted; Reject)
- {
- }
- actionref(Comment_Promoted; Comment)
- {
- }
- actionref(Delegate_Promoted; Delegate)
- {
- }
- }
- group(Category_Category5)
- {
- Caption = 'Request Approval', Comment = 'Generated from the PromotedActionCategories property index 4.';
-
- actionref(SendApprovalRequest_Promoted; SendApprovalRequest)
- {
- }
- actionref(CancelApprovalRequest_Promoted; CancelApprovalRequest)
- {
- }
- }
- group(Category_Category6)
- {
- Caption = 'New Document', Comment = 'Generated from the PromotedActionCategories property index 5.';
-
- actionref(NewPurchaseInvoiceAddin_Promoted; NewPurchaseInvoiceAddin)
- {
- }
- actionref(NewPurchaseInvoice_Promoted; NewPurchaseInvoice)
- {
- }
- actionref(NewPurchaseOrderAddin_Promoted; NewPurchaseOrderAddin)
- {
- }
- actionref(NewPurchaseOrder_Promoted; NewPurchaseOrder)
- {
- }
- actionref(NewPurchaseCrMemoAddin_Promoted; NewPurchaseCrMemoAddin)
- {
- }
- actionref(NewPurchaseCrMemo_Promoted; NewPurchaseCrMemo)
- {
- }
- }
- group(Category_Category8)
- {
- Caption = 'Incoming Documents', Comment = 'Generated from the PromotedActionCategories property index 7.';
-
- actionref(SendToIncomingDocuments_Promoted; SendToIncomingDocuments)
- {
- }
- actionref(SendToOCR_Promoted; SendToOCR)
- {
- }
- actionref(SendIncomingDocApprovalRequest_Promoted; SendIncomingDocApprovalRequest)
- {
- }
- }
- group(Category_Category9)
- {
- Caption = 'Vendor', Comment = 'Generated from the PromotedActionCategories property index 8.';
-
- actionref("Ledger E&ntries_Promoted"; "Ledger E&ntries")
- {
- }
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref(Statistics_Promoted; Statistics)
- {
- }
- actionref(Attachments_Promoted; Attachments)
- {
- }
- actionref(ApprovalEntries_Promoted; ApprovalEntries)
- {
- }
- actionref("Co&mments_Promoted"; "Co&mments")
- {
- }
- separator(Navigate_Separator)
- {
- }
-
- actionref(VendorReportSelections_Promoted; VendorReportSelections)
- {
- }
- actionref("Sent Emails_Promoted"; "Sent Emails")
- {
- }
- actionref("Bank Accounts_Promoted"; "Bank Accounts")
- {
- }
- actionref("Item References_Promoted"; "Item References")
- {
- }
- }
- group("Category_Prices & Discounts")
- {
- Caption = 'Prices & Discounts';
-
- actionref(PriceLists_Promoted; PriceLists)
- {
- }
- actionref(PriceLines_Promoted; PriceLines)
- {
- }
- actionref(DiscountLines_Promoted; DiscountLines)
- {
- }
- actionref(Prices_Promoted; Prices)
- {
- }
- actionref("Line Discounts_Promoted"; "Line Discounts")
- {
- }
- }
- group(Category_Category7)
- {
- Caption = 'Navigate', Comment = 'Generated from the PromotedActionCategories property index 6.';
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
-
- actionref("Vendor - Balance to Date_Promoted"; "Vendor - Balance to Date")
- {
- }
-#if not CLEAN28
- actionref("Vendor - Summary Aging_Promoted"; "Vendor - Summary Aging")
- {
- ObsoleteState = Pending;
- ObsoleteReason = 'This report is obsolete and will be removed in a future release. See the documentation for alternative options.';
- ObsoleteTag = '28.0';
- }
-#endif
- actionref(Purchases_Promoted; Purchases)
- {
- }
- }
- group(Category_Synchronize)
- {
- Caption = 'Synchronize';
- Visible = CRMIntegrationEnabled or CDSIntegrationEnabled;
-
- group(Category_Coupling)
- {
- Caption = 'Coupling';
- ShowAs = SplitButton;
-
- actionref(ManageCDSCoupling_Promoted; ManageCDSCoupling)
- {
- }
- actionref(DeleteCDSCoupling_Promoted; DeleteCDSCoupling)
- {
- }
- }
- actionref(CDSSynchronizeNow_Promoted; CDSSynchronizeNow)
- {
- }
- actionref(CDSGotoAccount_Promoted; CDSGotoAccount)
- {
- }
- actionref(ShowLog_Promoted; ShowLog)
- {
- }
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- var
- ClientTypeManagement: Codeunit "Client Type Management";
- begin
- if GuiAllowed() then
- OnAfterGetCurrRecordFunc()
- else
- if not (ClientTypeManagement.GetCurrentClientType() in [ClientType::ODataV4, ClientType::Api]) then
- StartBackgroundCalculations();
- end;
-
- local procedure OnAfterGetCurrRecordFunc()
- var
- CRMCouplingManagement: Codeunit "CRM Coupling Management";
- begin
- OnBeforeOnAfterGetCurrRecordFunc(Rec);
- if NewMode then
- CreateVendorFromTemplate()
- else
- StartBackgroundCalculations();
- ActivateFields();
- OpenApprovalEntriesExistCurrUser := ApprovalsMgmt.HasOpenApprovalEntriesForCurrentUser(Rec.RecordId);
- OpenApprovalEntriesExist := ApprovalsMgmt.HasOpenApprovalEntries(Rec.RecordId);
- ShowWorkflowStatus := CurrPage.WorkflowStatus.PAGE.SetFilterOnWorkflowRecord(Rec.RecordId);
- CanCancelApprovalForRecord := ApprovalsMgmt.CanCancelApprovalForRecord(Rec.RecordId);
- WorkflowWebhookManagement.GetCanRequestAndCanCancel(Rec.RecordId, CanRequestApprovalForFlow, CanCancelApprovalForFlow);
-
- if Rec."No." <> '' then
- CurrPage.AgedAccPayableChart.PAGE.UpdateChartForVendor(Rec."No.");
- if Rec.GetFilter("Date Filter") = '' then
- Rec.SetRange("Date Filter", 0D, WorkDate());
- CRMIsCoupledToRecord := CRMIntegrationEnabled or CDSIntegrationEnabled;
- if CRMIsCoupledToRecord then
- CRMIsCoupledToRecord := CRMCouplingManagement.IsRecordCoupledToCRM(Rec.RecordId);
- end;
-
- trigger OnInit()
- begin
- ContactEditable := true;
-
- IsPowerAutomatePrivacyNoticeApproved := PrivacyNotice.GetPrivacyNoticeApprovalState(FlowServiceManagement.GetPowerAutomatePrivacyNoticeId()) = "Privacy Notice Approval State"::Agreed;
- end;
-
- trigger OnNewRecord(BelowxRec: Boolean)
- var
- DocumentNoVisibility: Codeunit DocumentNoVisibility;
- begin
- if GuiAllowed then
- if Rec."No." = '' then
- if DocumentNoVisibility.VendorNoSeriesIsDefault() then
- NewMode := true;
- end;
-
- trigger OnOpenPage()
- begin
- if GuiAllowed() then
- OnOpenPageFunc();
- end;
-
- local procedure OnOpenPageFunc()
- var
- IntegrationTableMapping: Record "Integration Table Mapping";
- EnvironmentInfo: Codeunit "Environment Information";
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- PriceCalculationMgt: Codeunit "Price Calculation Mgt.";
- begin
- ActivateFields();
- IsOfficeAddin := OfficeMgt.IsAvailable();
- SetNoFieldVisible();
- IsSaaS := EnvironmentInfo.IsSaaS();
- CRMIntegrationEnabled := CRMIntegrationManagement.IsCRMIntegrationEnabled();
- CDSIntegrationEnabled := CRMIntegrationManagement.IsCDSIntegrationEnabled();
- if CRMIntegrationEnabled or CDSIntegrationEnabled then
- if IntegrationTableMapping.Get('VENDOR') then
- BlockedFilterApplied := IntegrationTableMapping.GetTableFilter().Contains('Field39=1(0)');
- ExtendedPriceEnabled := PriceCalculationMgt.IsExtendedPriceCalculationEnabled();
-
- PurchasesPayablesSetup.GetRecordOnce();
- IsAllowMultiplePostingGroupsVisible := PurchasesPayablesSetup."Allow Multiple Posting Groups";
-
- SetOverReceiptControlsVisibility();
- end;
-
- local procedure StartBackgroundCalculations()
- var
- VendorCardCalculations: Codeunit "Vendor Card Calculations";
- Args: Dictionary of [Text, Text];
- begin
- if BackgroundTaskId <> 0 then
- CurrPage.CancelBackgroundTask(BackgroundTaskId);
-
- LinkedCustomerNo := '';
- BalanceAsCustomer := 0;
- BalanceAsCustomerEnabled := false;
-
- Args.Add(VendorCardCalculations.GetVendorNoLabel(), Rec."No.");
- Args.Add(VendorCardCalculations.GetFiltersLabel(), Rec.GetView());
- Args.Add(VendorCardCalculations.GetWorkDateLabel(), Format(WorkDate()));
-
- CurrPage.EnqueueBackgroundTask(BackgroundTaskId, Codeunit::"Vendor Card Calculations", Args);
-
- Session.LogMessage('0000GC4', StrSubstNo(PageBckGrndTaskStartedTxt, Rec.SystemId), Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', VendorCardServiceCategoryTxt);
- end;
-
- trigger OnPageBackgroundTaskCompleted(TaskId: Integer; Results: Dictionary of [Text, Text])
- var
- VendorCardCalculations: Codeunit "Vendor Card Calculations";
- DictionaryValue: Text;
- begin
- if TaskId = BackgroundTaskId then begin
- if Results.Count() = 0 then
- exit;
-
- if TryGetDictionaryValueFromKey(Results, VendorCardCalculations.GetLinkedCustomerNoLabel(), DictionaryValue) then
- LinkedCustomerNo := CopyStr(DictionaryValue, 1, MaxStrLen(LinkedCustomerNo));
- BalanceAsCustomerEnabled := LinkedCustomerNo <> '';
- if BalanceAsCustomerEnabled then
- if TryGetDictionaryValueFromKey(Results, VendorCardCalculations.GetBalanceAsCustomerLabel(), DictionaryValue) then
- Evaluate(BalanceAsCustomer, DictionaryValue);
-
- Session.LogMessage('0000GC5', PageBckGrndTaskCompletedTxt, Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', VendorCardServiceCategoryTxt);
- end;
- end;
-
- var
- PurchasesPayablesSetup: Record "Purchases & Payables Setup";
- OfficeMgt: Codeunit "Office Management";
- CalendarMgmt: Codeunit "Calendar Management";
- PaymentToleranceMgt: Codeunit "Payment Tolerance Management";
- WorkflowWebhookManagement: Codeunit "Workflow Webhook Management";
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- FormatAddress: Codeunit "Format Address";
- PrivacyNotice: Codeunit "Privacy Notice";
- FlowServiceManagement: Codeunit "Flow Service Management";
-#pragma warning disable AA0074
- Text001: Label 'Do you want to allow payment tolerance for entries that are currently open?';
- Text002: Label 'Do you want to remove payment tolerance from entries that are currently open?';
-#pragma warning restore AA0074
- PageBckGrndTaskStartedTxt: Label 'Page Background Task to calculate vendor statistics for vendor %1 started.', Locked = true, Comment = '%1 = Customer No.';
- PageBckGrndTaskCompletedTxt: Label 'Page Background Task to calculate vendor statistics completed successfully.', Locked = true;
- VendorCardServiceCategoryTxt: Label 'Vendor Card', Locked = true;
- LinkedCustomerNo: Code[20];
- BalanceAsCustomer: Decimal;
- OpenApprovalEntriesExistCurrUser: Boolean;
- OpenApprovalEntriesExist: Boolean;
- ShowWorkflowStatus: Boolean;
- ShowMapLbl: Label 'Show on Map';
- CanCancelApprovalForRecord: Boolean;
- SendToOCREnabled: Boolean;
- SendToOCRVisible: Boolean;
- SendToIncomingDocEnabled: Boolean;
- SendIncomingDocApprovalRequestVisible: Boolean;
- IsPowerAutomatePrivacyNoticeApproved: Boolean;
- SendToIncomingDocumentVisible: Boolean;
- NoFieldVisible: Boolean;
- NewMode: Boolean;
- CanRequestApprovalForFlow: Boolean;
- CanCancelApprovalForFlow: Boolean;
- IsSaaS: Boolean;
- IsCountyVisible: Boolean;
- IsAllowMultiplePostingGroupsVisible: Boolean;
- CRMIntegrationEnabled: Boolean;
- CDSIntegrationEnabled: Boolean;
- CRMIsCoupledToRecord: Boolean;
- BlockedFilterApplied: Boolean;
- ExtendedPriceEnabled: Boolean;
- OverReceiptAllowed: Boolean;
- BalanceAsCustomerEnabled: Boolean;
- BackgroundTaskId: Integer;
-
- protected var
- ContactEditable: Boolean;
- IsOfficeAddin: Boolean;
-
- [TryFunction]
- local procedure TryGetDictionaryValueFromKey(var DictionaryToLookIn: Dictionary of [Text, Text]; KeyToSearchFor: Text; var ReturnValue: Text)
- begin
- ReturnValue := DictionaryToLookIn.Get(KeyToSearchFor);
- end;
-
- local procedure ActivateFields()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeActivateFields(IsCountyVisible, FormatAddress, IsHandled);
- if IsHandled then
- exit;
-
- ContactEditable := Rec."Primary Contact No." = '';
- IsCountyVisible := FormatAddress.UseCounty(Rec."Country/Region Code");
- if OfficeMgt.IsAvailable() then
- ActivateIncomingDocumentsFields();
- end;
-
- local procedure ContactOnAfterValidate()
- begin
- ActivateFields();
- end;
-
- procedure RunReport(ReportNumber: Integer)
- var
- Vendor: Record Vendor;
- begin
- Vendor.SetRange("No.", Rec."No.");
- REPORT.RunModal(ReportNumber, true, true, Vendor);
- end;
-
- local procedure ActivateIncomingDocumentsFields()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- if OfficeMgt.OCRAvailable() then begin
- SendToIncomingDocumentVisible := true;
- SendToIncomingDocEnabled := OfficeMgt.EmailHasAttachments();
- SendToOCREnabled := OfficeMgt.EmailHasAttachments();
- SendToOCRVisible := IncomingDocument.OCRIsEnabled() and not IsIncomingDocApprovalsWorkflowEnabled();
- SendIncomingDocApprovalRequestVisible := IsIncomingDocApprovalsWorkflowEnabled();
- end;
- end;
-
- local procedure IsIncomingDocApprovalsWorkflowEnabled(): Boolean
- var
- WorkflowEventHandling: Codeunit "Workflow Event Handling";
- WorkflowDefinition: Query "Workflow Definition";
- begin
- WorkflowDefinition.SetRange(Table_ID, DATABASE::"Incoming Document");
- WorkflowDefinition.SetRange(Entry_Point, true);
- WorkflowDefinition.SetRange(Enabled, true);
- WorkflowDefinition.SetRange(Type, WorkflowDefinition.Type::"Event");
- WorkflowDefinition.SetRange(Function_Name, WorkflowEventHandling.RunWorkflowOnSendIncomingDocForApprovalCode());
- WorkflowDefinition.Open();
- while WorkflowDefinition.Read() do
- exit(true);
-
- exit(false);
- end;
-
- local procedure CreateVendorFromTemplate()
- var
- Vendor: Record Vendor;
- VendorTemplMgt: Codeunit "Vendor Templ. Mgt.";
- begin
- OnBeforeCreateVendorFromTemplate(NewMode, Vendor);
-
- if not NewMode then
- exit;
- NewMode := false;
-
- if VendorTemplMgt.InsertVendorFromTemplate(Vendor) then begin
- VerifyVatRegNo(Vendor);
- Rec.Copy(Vendor);
- OnCreateVendorFromTemplateOnBeforeCurrPageUpdate(Rec);
- CurrPage.Update();
- end else
- if VendorTemplMgt.TemplatesAreNotEmpty() then
- if not VendorTemplMgt.IsOpenBlankCardConfirmed() then
- CurrPage.Close();
- end;
-
- local procedure SetNoFieldVisible()
- var
- DocumentNoVisibility: Codeunit DocumentNoVisibility;
- begin
- NoFieldVisible := DocumentNoVisibility.VendorNoIsVisible();
- end;
-
- local procedure SetOverReceiptControlsVisibility()
- var
- OverReceiptMgt: Codeunit "Over-Receipt Mgt.";
- begin
- OverReceiptAllowed := OverReceiptMgt.IsOverReceiptAllowed();
- end;
-
- local procedure VerifyVatRegNo(var Vendor: Record Vendor)
- var
- VATRegNoSrvConfig: Record "VAT Reg. No. Srv Config";
- EUVATRegistrationNoCheck: Page "EU VAT Registration No Check";
- VendorRecRef: RecordRef;
- begin
- if VATRegNoSrvConfig.VATRegNoSrvIsEnabled() then
- if Vendor."Validate EU Vat Reg. No." then begin
- EUVATRegistrationNoCheck.SetRecordRef(Vendor);
- Commit();
- EUVATRegistrationNoCheck.RunModal();
- EUVATRegistrationNoCheck.GetRecordRef(VendorRecRef);
- VendorRecRef.SetTable(Vendor);
- end;
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateVendorFromTemplate(var NewMode: Boolean; var Vendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeActivateFields(var IsCountyVisible: Boolean; var FormatAddress: Codeunit "Format Address"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCreateVendorFromTemplateOnBeforeCurrPageUpdate(var Vendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOnAfterGetCurrRecordFunc(var Vendor: Record Vendor)
- begin
- end;
-}
-
diff --git a/src/Layers/NL/BaseApp/Purchases/Vendor/VendorTempl.Table.al b/src/Layers/NL/BaseApp/Purchases/Vendor/VendorTempl.Table.al
deleted file mode 100644
index dc4b522f38..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/Vendor/VendorTempl.Table.al
+++ /dev/null
@@ -1,564 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.Vendor;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.Payment;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Team;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.Finance.SalesTax;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Calendar;
-using Microsoft.Foundation.Enums;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Foundation.PaymentTerms;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Foundation.Shipping;
-using Microsoft.Inventory.Intrastat;
-using Microsoft.Inventory.Location;
-using Microsoft.Pricing.Calculation;
-using Microsoft.Pricing.PriceList;
-using Microsoft.Purchases.Document;
-using Microsoft.Sales.FinanceCharge;
-using System.Globalization;
-
-table 1383 "Vendor Templ."
-{
- Caption = 'Vendor Template';
- LookupPageID = "Vendor Templ. List";
- DrillDownPageID = "Vendor Templ. List";
- DataClassification = CustomerContent;
-
- fields
- {
- field(1; Code; Code[20])
- {
- Caption = 'Code';
- ToolTip = 'Specifies the code of the template.';
- NotBlank = true;
- }
- field(2; Description; Text[100])
- {
- Caption = 'Description';
- ToolTip = 'Specifies the description of the template.';
- }
- field(5; Address; Text[100])
- {
- Caption = 'Address';
- ToolTip = 'Specifies the vendor''s address.';
- }
- field(6; "Address 2"; Text[50])
- {
- Caption = 'Address 2';
- ToolTip = 'Specifies additional address information.';
- }
- field(7; City; Text[30])
- {
- Caption = 'City';
- ToolTip = 'Specifies the vendor''s city.';
-
- trigger OnLookup()
- var
- PostCode: Record "Post Code";
- CityText: Text;
- CountyText: Text;
- begin
- PostCode.LookupPostCode(CityText, "Post Code", CountyText, "Country/Region Code");
- City := CopyStr(CityText, 1, MaxStrLen(City));
- County := CopyStr(CountyText, 1, MaxStrLen(County));
- end;
-
- trigger OnValidate()
- var
- PostCode: Record "Post Code";
- begin
- PostCode.ValidateCity(City, "Post Code", County, "Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- end;
- }
- field(9; "Phone No."; Text[30])
- {
- Caption = 'Phone No.';
- ToolTip = 'Specifies the vendor''s telephone number.';
- ExtendedDatatype = PhoneNo;
- }
- field(10; "Telex No."; Text[20])
- {
- Caption = 'Telex No.';
- }
- field(14; "Our Account No."; Text[20])
- {
- Caption = 'Our Account No.';
- MaskType = Concealed;
- ToolTip = 'Specifies your account number with the vendor, if you have one.';
- }
- field(15; "Territory Code"; Code[10])
- {
- Caption = 'Territory Code';
- TableRelation = Territory;
- }
- field(16; "Global Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,1,1';
- Caption = 'Global Dimension 1 Code';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1),
- Blocked = const(false));
-
- trigger OnValidate()
- begin
- ValidateShortcutDimCode(1, "Global Dimension 1 Code");
- end;
- }
- field(17; "Global Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,1,2';
- Caption = 'Global Dimension 2 Code';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2),
- Blocked = const(false));
-
- trigger OnValidate()
- begin
- ValidateShortcutDimCode(2, "Global Dimension 2 Code");
- end;
- }
- field(19; "Budgeted Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Budgeted Amount';
- }
- field(21; "Vendor Posting Group"; Code[20])
- {
- Caption = 'Vendor Posting Group';
- ToolTip = 'Specifies the vendor''s market type to link business transactions made for the vendor with the appropriate account in the general ledger.';
- TableRelation = "Vendor Posting Group";
- }
- field(22; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- ToolTip = 'Specifies the default currency on purchase documents or journal lines that you create for the vendor.';
- TableRelation = Currency;
- }
- field(24; "Language Code"; Code[10])
- {
- Caption = 'Language Code';
- ToolTip = 'Specifies the language that is used when translating specified text on documents to foreign business partner, such as an item description on an order confirmation.';
- TableRelation = Language;
- }
- field(26; "Statistics Group"; Integer)
- {
- Caption = 'Statistics Group';
- ToolTip = 'Specifies the statistics group.';
- }
- field(27; "Payment Terms Code"; Code[10])
- {
- Caption = 'Payment Terms Code';
- ToolTip = 'Specifies a formula that calculates the payment due date, payment discount date, and payment discount amount.';
- TableRelation = "Payment Terms";
- }
- field(28; "Fin. Charge Terms Code"; Code[10])
- {
- Caption = 'Fin. Charge Terms Code';
- ToolTip = 'Specifies how the vendor calculates finance charges.';
- TableRelation = "Finance Charge Terms";
- }
- field(29; "Purchaser Code"; Code[20])
- {
- Caption = 'Purchaser Code';
- ToolTip = 'Specifies which purchaser is assigned to the vendor.';
- TableRelation = "Salesperson/Purchaser" where(Blocked = const(false));
- }
- field(30; "Shipment Method Code"; Code[10])
- {
- Caption = 'Shipment Method Code';
- ToolTip = 'Specifies the delivery conditions of the related shipment, such as free on board (FOB).';
- TableRelation = "Shipment Method";
- }
- field(31; "Shipping Agent Code"; Code[10])
- {
- Caption = 'Shipping Agent Code';
- TableRelation = "Shipping Agent";
- }
- field(33; "Invoice Disc. Code"; Code[20])
- {
- Caption = 'Invoice Disc. Code';
- ToolTip = 'Specifies the vendor''s invoice discount code. When you set up a new vendor card, the number you have entered in the No. field is automatically inserted.';
- TableRelation = Vendor;
- }
- field(35; "Country/Region Code"; Code[10])
- {
- Caption = 'Country/Region Code';
- ToolTip = 'Specifies the country/region of the address.';
- TableRelation = "Country/Region";
-
- trigger OnValidate()
- var
- PostCode: Record "Post Code";
- CityText: Text;
- CountyText: Text;
- begin
- PostCode.CheckClearPostCodeCityCounty(CityText, "Post Code", CountyText, "Country/Region Code", xRec."Country/Region Code");
- City := CopyStr(CityText, 1, MaxStrLen(City));
- County := CopyStr(CountyText, 1, MaxStrLen(County));
- end;
- }
- field(39; Blocked; Enum "Vendor Blocked")
- {
- Caption = 'Blocked';
- ToolTip = 'Specifies whether transactions with this vendor are restricted. Use this field to control vendor activity, such as temporarily halting payments or fully blocking a vendor due to compliance or business decisions. The field can have one of the following values: (blank) - No restrictions, all transactions are allowed. All - All transactions with this vendor are blocked. You cannot create or post any documents or journals with the vendor. Payment - Only payment transactions are blocked. You can still create and post purchase documents, but you cannot make payments to the vendor.';
- }
- field(45; "Pay-to Vendor No."; Code[20])
- {
- Caption = 'Pay-to Vendor No.';
- ToolTip = 'Specifies the number of a different vendor whom you pay for products delivered by the vendor on the vendor card.';
- TableRelation = Vendor;
- }
- field(46; Priority; Integer)
- {
- Caption = 'Priority';
- ToolTip = 'Specifies the importance of the vendor when suggesting payments using the Suggest Vendor Payments function.';
- }
- field(47; "Payment Method Code"; Code[10])
- {
- Caption = 'Payment Method Code';
- ToolTip = 'Specifies how to make payments, such as with bank transfers or by cash or check.';
- TableRelation = "Payment Method";
- }
- field(48; "Format Region"; Text[80])
- {
- Caption = 'Format Region';
- ToolTip = 'Specifies the region format to be used on printouts for this vendor.';
- TableRelation = "Language Selection"."Language Tag";
- }
- field(80; "Application Method"; Enum "Application Method")
- {
- Caption = 'Application Method';
- ToolTip = 'Specifies how to apply payments to entries for this vendor.';
- }
- field(82; "Prices Including VAT"; Boolean)
- {
- Caption = 'Prices Including VAT';
- ToolTip = 'Specifies if the Unit Price and Line Amount fields on document lines should be shown with or without VAT.';
- }
- field(84; "Fax No."; Text[30])
- {
- Caption = 'Fax No.';
- ToolTip = 'Specifies the vendor''s fax number.';
- }
- field(85; "Telex Answer Back"; Text[20])
- {
- Caption = 'Telex Answer Back';
- }
- field(86; "VAT Registration No."; Text[20])
- {
- Caption = 'VAT Registration No.';
- ToolTip = 'Specifies the vendor''s VAT registration number.';
- }
- field(88; "Gen. Bus. Posting Group"; Code[20])
- {
- Caption = 'Gen. Bus. Posting Group';
- ToolTip = 'Specifies the vendor''s trade type to link transactions made for this vendor with the appropriate general ledger account according to the general posting setup.';
- TableRelation = "Gen. Business Posting Group";
- }
- field(90; GLN; Code[13])
- {
- Caption = 'GLN';
- ToolTip = 'Specifies the vendor in connection with electronic document receiving.';
- Numeric = true;
- }
- field(91; "Post Code"; Code[20])
- {
- Caption = 'Post Code';
- ToolTip = 'Specifies the postal code.';
-
- trigger OnLookup()
- var
- PostCode: Record "Post Code";
- CityText: Text;
- CountyText: Text;
- begin
- PostCode.LookupPostCode(CityText, "Post Code", CountyText, "Country/Region Code");
- City := CopyStr(CityText, 1, MaxStrLen(City));
- County := CopyStr(CountyText, 1, MaxStrLen(County));
- end;
-
- trigger OnValidate()
- var
- PostCode: Record "Post Code";
- begin
- PostCode.ValidatePostCode(City, "Post Code", County, "Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- end;
- }
- field(92; County; Text[30])
- {
- CaptionClass = '5,1,' + "Country/Region Code";
- Caption = 'County';
- ToolTip = 'Specifies the state, province or county as a part of the address.';
- }
- field(93; "EORI Number"; Text[40])
- {
- Caption = 'EORI Number';
- ToolTip = 'Specifies the Economic Operators Registration and Identification number that is used when you exchange information with the customs authorities due to trade into or out of the European Union.';
- }
- field(102; "E-Mail"; Text[80])
- {
- Caption = 'Email';
- ToolTip = 'Specifies the vendor''s email address.';
- ExtendedDatatype = EMail;
- }
-#if not CLEAN27
-#pragma warning disable AS0086
-#endif
- field(103; "Home Page"; Text[255])
-#if not CLEAN27
-#pragma warning restore AS0086
-#endif
- {
- Caption = 'Home Page';
- ToolTip = 'Specifies the vendor''s web site.';
- ExtendedDatatype = URL;
- }
- field(107; "No. Series"; Code[20])
- {
- Caption = 'No. Series';
- ToolTip = 'Specifies the number series that will be used to assign numbers to vendors.';
- TableRelation = "No. Series";
- }
- field(108; "Tax Area Code"; Code[20])
- {
- Caption = 'Tax Area Code';
- ToolTip = 'Specifies a tax area code for the company.';
- TableRelation = "Tax Area";
- }
- field(109; "Tax Liable"; Boolean)
- {
- Caption = 'Tax Liable';
- ToolTip = 'Specifies if the customer is liable for sales tax.';
- }
- field(110; "VAT Bus. Posting Group"; Code[20])
- {
- Caption = 'VAT Bus. Posting Group';
- ToolTip = 'Specifies the VAT specification of the involved customer or vendor to link transactions made for this record with the appropriate general ledger account according to the VAT posting setup.';
- TableRelation = "VAT Business Posting Group";
- }
- field(116; "Block Payment Tolerance"; Boolean)
- {
- Caption = 'Block Payment Tolerance';
- ToolTip = 'Specifies whether to allow a payment tolerance for the vendor.';
- }
- field(124; "Prepayment %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Prepayment %';
- ToolTip = 'Specifies a prepayment percentage that applies to all orders for this vendor, regardless of the items or services on the order lines.';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
- }
- field(150; "Privacy Blocked"; Boolean)
- {
- Caption = 'Privacy Blocked';
- ToolTip = 'Specifies whether to limit access to data for the data subject during daily operations. This is useful, for example, when protecting data from changes while it is under privacy review.';
-
- trigger OnValidate()
- begin
- if "Privacy Blocked" then
- Blocked := Blocked::All
- else
- Blocked := Blocked::" ";
- end;
- }
- field(160; "Disable Search by Name"; Boolean)
- {
- Caption = 'Disable Search by Name';
- ToolTip = 'Specifies that you can change vendor name in the document.';
- DataClassification = SystemMetadata;
- }
- field(170; "Creditor No."; Code[20])
- {
- Caption = 'Creditor No.';
- ToolTip = 'Specifies the number of the vendor.';
- }
- field(840; "Cash Flow Payment Terms Code"; Code[10])
- {
- Caption = 'Cash Flow Payment Terms Code';
- ToolTip = 'Specifies a payment term that will be used for calculating cash flow.';
- TableRelation = "Payment Terms";
- }
- field(132; "Partner Type"; Enum "Partner Type")
- {
- Caption = 'Partner Type';
- ToolTip = 'Specifies if the vendor is a person or a company.';
- }
- field(133; "Intrastat Partner Type"; Enum "Partner Type")
- {
- Caption = 'Intrastat Partner Type';
- ToolTip = 'Specifies for Intrastat reporting if the vendor is a person or a company.';
- }
- field(5050; "Contact Type"; Enum "Contact Type")
- {
- Caption = 'Contact Type';
- ToolTip = 'Specifies the type of contact that will be used to create a vendor with the template.';
- }
- field(5061; "Mobile Phone No."; Text[30])
- {
- Caption = 'Mobile Phone No.';
- ToolTip = 'Specifies the vendor''s mobile telephone number.';
- ExtendedDatatype = PhoneNo;
- }
-
- field(5700; "Responsibility Center"; Code[10])
- {
- Caption = 'Responsibility Center';
- ToolTip = 'Specifies the code of the responsibility center, such as a distribution hub, that is associated with the involved user, company, customer, or vendor.';
- TableRelation = "Responsibility Center";
- }
- field(5701; "Location Code"; Code[10])
- {
- Caption = 'Location Code';
- ToolTip = 'Specifies the warehouse location where items from the vendor must be received by default.';
- TableRelation = Location where("Use As In-Transit" = const(false));
- }
- field(7000; "Price Calculation Method"; Enum "Price Calculation Method")
- {
- Caption = 'Price Calculation Method';
- ToolTip = 'Specifies the default price calculation method.';
-
- trigger OnValidate()
- var
- PriceCalculationMgt: Codeunit "Price Calculation Mgt.";
- PriceType: Enum "Price Type";
- begin
- if "Price Calculation Method" <> "Price Calculation Method"::" " then
- PriceCalculationMgt.VerifyMethodImplemented("Price Calculation Method", PriceType::Purchase);
- end;
- }
- field(7600; "Base Calendar Code"; Code[10])
- {
- Caption = 'Base Calendar Code';
- ToolTip = 'Specifies a customizable calendar for delivery planning that holds the vendor''s working days and holidays.';
- TableRelation = "Base Calendar";
- }
- field(7601; "Document Sending Profile"; Code[20])
- {
- Caption = 'Document Sending Profile';
- ToolTip = 'Specifies the preferred method of sending documents to this vendor.';
- TableRelation = "Document Sending Profile".Code;
- }
- field(7602; "Validate EU Vat Reg. No."; Boolean)
- {
- Caption = 'Validate EU VAT Reg. No.';
- ToolTip = 'Specifies if the VAT registration number will be specified in the EU VAT Registration No. Check page so that it is validated against the VAT registration number validation service.';
- }
- field(7603; "Copy Buy-from Add. to Qte From"; Enum "Contact Type")
- {
- AccessByPermission = TableData Contact = R;
- Caption = 'Copy Buy-from Addr. to Qte From';
- ToolTip = 'Specifies which vendor address is inserted on purchase quotes that you create for the vendor.';
- }
- field(8510; "Over-Receipt Code"; Code[20])
- {
- Caption = 'Over-Receipt Code';
- ToolTip = 'Specifies the policy that will be used for the vendor if more items than ordered are received.';
- TableRelation = "Over-Receipt Code";
- }
- field(11000000; "Transaction Mode Code"; Code[20])
- {
- Caption = 'Transaction Mode Code';
- TableRelation = "Transaction Mode".Code where("Account Type" = const(Vendor));
- }
- }
-
- keys
- {
- key(Key1; Code)
- {
- Clustered = true;
- }
- }
-
- trigger OnDelete()
- var
- DefaultDimension: Record "Default Dimension";
- begin
- DefaultDimension.SetRange("Table ID", Database::"Vendor Templ.");
- DefaultDimension.SetRange("No.", Code);
- DefaultDimension.DeleteAll();
- end;
-
- trigger OnRename()
- var
- DimMgt: Codeunit DimensionManagement;
- begin
- DimMgt.RenameDefaultDim(Database::"Vendor Templ.", xRec.Code, Code);
- end;
-
- local procedure ValidateShortcutDimCode(FieldNumber: Integer; var ShortcutDimCode: Code[20])
- var
- DimMgt: Codeunit DimensionManagement;
- begin
- DimMgt.ValidateDimValueCode(FieldNumber, ShortcutDimCode);
- if not IsTemporary then begin
- DimMgt.SaveDefaultDim(Database::"Vendor Templ.", Code, FieldNumber, ShortcutDimCode);
- Modify();
- end;
- end;
-
- procedure CopyFromTemplate(SourceVendorTempl: Record "Vendor Templ.")
- begin
- CopyTemplate(SourceVendorTempl);
- CopyDimensions(SourceVendorTempl);
- OnAfterCopyFromTemplate(SourceVendorTempl, Rec);
- end;
-
- local procedure CopyTemplate(SourceVendorTempl: Record "Vendor Templ.")
- var
- SavedVendorTempl: Record "Vendor Templ.";
- begin
- SavedVendorTempl := Rec;
- TransferFields(SourceVendorTempl, false);
- Code := SavedVendorTempl.Code;
- Description := SavedVendorTempl.Description;
- OnCopyTemplateOnBeforeModify(SourceVendorTempl, SavedVendorTempl, Rec);
- Modify();
- end;
-
- local procedure CopyDimensions(SourceVendorTempl: Record "Vendor Templ.")
- var
- SourceDefaultDimension: Record "Default Dimension";
- DestDefaultDimension: Record "Default Dimension";
- begin
- DestDefaultDimension.SetRange("Table ID", Database::"Vendor Templ.");
- DestDefaultDimension.SetRange("No.", Code);
- DestDefaultDimension.DeleteAll(true);
-
- SourceDefaultDimension.SetRange("Table ID", Database::"Vendor Templ.");
- SourceDefaultDimension.SetRange("No.", SourceVendorTempl.Code);
- if SourceDefaultDimension.FindSet() then
- repeat
- DestDefaultDimension.Init();
- DestDefaultDimension.Validate("Table ID", Database::"Vendor Templ.");
- DestDefaultDimension.Validate("No.", Code);
- DestDefaultDimension.Validate("Dimension Code", SourceDefaultDimension."Dimension Code");
- DestDefaultDimension.Validate("Dimension Value Code", SourceDefaultDimension."Dimension Value Code");
- DestDefaultDimension.Validate("Value Posting", SourceDefaultDimension."Value Posting");
- if DestDefaultDimension.Insert(true) then;
- until SourceDefaultDimension.Next() = 0;
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyFromTemplate(SourceVendorTempl: Record "Vendor Templ."; var VendorTempl: Record "Vendor Templ.")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyTemplateOnBeforeModify(SourceVendorTempl: Record "Vendor Templ."; SavedVendorTempl: Record "Vendor Templ."; var VendorTempl: Record "Vendor Templ.")
- begin
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Purchases/Vendor/VendorTemplCard.Page.al b/src/Layers/NL/BaseApp/Purchases/Vendor/VendorTemplCard.Page.al
deleted file mode 100644
index 59c0dd0eaf..0000000000
--- a/src/Layers/NL/BaseApp/Purchases/Vendor/VendorTemplCard.Page.al
+++ /dev/null
@@ -1,407 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Purchases.Vendor;
-
-using Microsoft.Finance.Dimension;
-using Microsoft.Foundation.Address;
-
-page 1386 "Vendor Templ. Card"
-{
- Caption = 'Vendor Template';
- PageType = Card;
- SourceTable = "Vendor Templ.";
-
- layout
- {
- area(content)
- {
- group(Template)
- {
- Caption = 'General';
- field(Code; Rec.Code)
- {
- ApplicationArea = Basic, Suite;
- }
- field(Description; Rec.Description)
- {
- ApplicationArea = Basic, Suite;
- }
- field("Contact Type"; Rec."Contact Type")
- {
- ApplicationArea = Basic, Suite;
- }
- field(Blocked; Rec.Blocked)
- {
- ApplicationArea = Basic, Suite;
- }
- field("No. Series"; Rec."No. Series")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Purchaser Code"; Rec."Purchaser Code")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- Visible = false;
- }
- field("Privacy Blocked"; Rec."Privacy Blocked")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = false;
- }
- field("Disable Search by Name"; Rec."Disable Search by Name")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = false;
- }
- field("Responsibility Center"; Rec."Responsibility Center")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- Visible = false;
- }
- field("Statistics Group"; Rec."Statistics Group")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- }
- group(AddressAndContact)
- {
- Caption = 'Address & Contact';
- field(Address; Rec.Address)
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Address 2"; Rec."Address 2")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Country/Region Code"; Rec."Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
-
- trigger OnValidate()
- begin
- IsCountyVisible := FormatAddress.UseCounty(Rec."Country/Region Code");
- end;
- }
- field(City; Rec.City)
- {
- ApplicationArea = Basic, Suite;
- }
- field("Post Code"; Rec."Post Code")
- {
- ApplicationArea = Basic, Suite;
- }
- group(CountyGroup)
- {
- ShowCaption = false;
- Visible = IsCountyVisible;
- field(County; Rec.County)
- {
- ApplicationArea = Basic, Suite;
- }
- }
- field("Phone No."; Rec."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field(MobilePhoneNo; Rec."Mobile Phone No.")
- {
- Caption = 'Mobile Phone No.';
- ApplicationArea = Basic, Suite;
- ExtendedDatatype = PhoneNo;
- Visible = false;
- }
- field("E-Mail"; Rec."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- ExtendedDatatype = EMail;
- Importance = Promoted;
- Visible = false;
- }
- field("Fax No."; Rec."Fax No.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = false;
- }
- field("Home Page"; Rec."Home Page")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Our Account No."; Rec."Our Account No.")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- group(Contact)
- {
- Caption = 'Contact';
- field("Language Code"; Rec."Language Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Format Region"; Rec."Format Region")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Document Sending Profile"; Rec."Document Sending Profile")
- {
- ApplicationArea = Basic, Suite;
- }
- }
- }
- group(Invoicing)
- {
- Caption = 'Invoicing';
- field("VAT Registration No."; Rec."VAT Registration No.")
- {
- ApplicationArea = VAT;
- Visible = false;
- }
- field("EORI Number"; Rec."EORI Number")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field(GLN; Rec.GLN)
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = false;
- }
- field("Copy Buy-from Add. to Qte From"; Rec."Copy Buy-from Add. to Qte From")
- {
- Visible = false;
- ApplicationArea = Basic, Suite;
- }
- field("Tax Liable"; Rec."Tax Liable")
- {
- ApplicationArea = SalesTax;
- Visible = false;
- }
- field("Tax Area Code"; Rec."Tax Area Code")
- {
- ApplicationArea = SalesTax;
- Visible = false;
- }
- field("Validate EU Vat Reg. No."; Rec."Validate EU Vat Reg. No.")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Pay-to Vendor No."; Rec."Pay-to Vendor No.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Invoice Disc. Code"; Rec."Invoice Disc. Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Prices Including VAT"; Rec."Prices Including VAT")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Price Calculation Method"; Rec."Price Calculation Method")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- Visible = false;
- }
- group(PostingDetails)
- {
- Caption = 'Posting details';
- field("Gen. Bus. Posting Group"; Rec."Gen. Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- ShowMandatory = true;
- }
- field("VAT Bus. Posting Group"; Rec."VAT Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Vendor Posting Group"; Rec."Vendor Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- ShowMandatory = true;
- }
- }
- group(ForeignTrade)
- {
- Caption = 'Foreign Trade';
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- }
- }
- }
- group(Payments)
- {
- Caption = 'Payments';
- field("Prepayment %"; Rec."Prepayment %")
- {
- ApplicationArea = Prepayments;
- Importance = Additional;
- Visible = false;
- }
- field("Application Method"; Rec."Application Method")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Payment Terms Code"; Rec."Payment Terms Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- ShowMandatory = true;
- }
- field("Payment Method Code"; Rec."Payment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field(Priority; Rec.Priority)
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Fin. Charge Terms Code"; Rec."Fin. Charge Terms Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Block Payment Tolerance"; Rec."Block Payment Tolerance")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the transaction mode commonly used in telebanking for this vendor.';
- }
- field("Partner Type"; Rec."Partner Type")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Intrastat Partner Type"; Rec."Intrastat Partner Type")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Cash Flow Payment Terms Code"; Rec."Cash Flow Payment Terms Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Creditor No."; Rec."Creditor No.")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- }
- group(Receiving)
- {
- Caption = 'Receiving';
- field("Location Code"; Rec."Location Code")
- {
- ApplicationArea = Location;
- Importance = Promoted;
- }
- field("Shipment Method Code"; Rec."Shipment Method Code")
- {
- ApplicationArea = Suite;
- Importance = Promoted;
- }
- field("Base Calendar Code"; Rec."Base Calendar Code")
- {
- ApplicationArea = Basic, Suite;
- DrillDown = false;
- Visible = false;
- }
- field("Over-Receipt Code"; Rec."Over-Receipt Code")
- {
- ApplicationArea = All;
- Visible = false;
- }
- }
- }
- }
-
- actions
- {
- area(Navigation)
- {
- action(Dimensions)
- {
- ApplicationArea = Dimensions;
- Caption = 'Dimensions';
- Image = Dimensions;
- RunObject = Page "Default Dimensions";
- RunPageLink = "Table ID" = const(1383),
- "No." = field(Code);
- 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.';
- }
- action(CopyTemplate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Copy Template';
- Image = Copy;
- ToolTip = 'Copies all information to the current template from the selected one.';
-
- trigger OnAction()
- var
- VendorTempl: Record "Vendor Templ.";
- VendorTemplList: Page "Vendor Templ. List";
- begin
- Rec.TestField(Code);
- VendorTempl.SetFilter(Code, '<>%1', Rec.Code);
- VendorTemplList.LookupMode(true);
- VendorTemplList.SetTableView(VendorTempl);
- if VendorTemplList.RunModal() = Action::LookupOK then begin
- VendorTemplList.GetRecord(VendorTempl);
- Rec.CopyFromTemplate(VendorTempl);
- end;
- end;
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process';
-
- actionref(CopyTemplate_Promoted; CopyTemplate)
- {
- }
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- }
- }
- }
-
- trigger OnOpenPage()
- begin
- IsCountyVisible := FormatAddress.UseCounty(Rec."Country/Region Code");
- end;
-
- var
- FormatAddress: Codeunit "Format Address";
- IsCountyVisible: Boolean;
-}
-
-
diff --git a/src/Layers/NL/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al b/src/Layers/NL/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
index fb769039a3..5181d6b241 100644
--- a/src/Layers/NL/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
+++ b/src/Layers/NL/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
@@ -162,12 +162,6 @@ page 8900 "Administrator Main Role Center"
Caption = 'Electronic Document Formats';
RunObject = page "Electronic Document Format";
}
- action("Post Code Updates")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code Updates';
- RunObject = page "Post Code Updates";
- }
action("Assisted Setup")
{
ApplicationArea = Basic, Suite;
@@ -186,12 +180,6 @@ page 8900 "Administrator Main Role Center"
Caption = 'Customer/Vendor/Item Templates';
RunObject = page "Config Templates";
}
- // action("Setup and Help Resources")
- // {
- // ApplicationArea = Basic, Suite;
- // Caption = 'Setup and Help Resources';
- // RunObject = page 1822;
- // }
action("Transformation Rules")
{
ApplicationArea = Basic, Suite;
@@ -338,12 +326,6 @@ page 8900 "Administrator Main Role Center"
Caption = 'Code Coverage';
RunObject = page "Code Coverage";
}
- // action("Sessions")
- // {
- // ApplicationArea = All;
- // Caption = 'Sessions';
- // RunObject = codeunit 9500;
- // }
}
action("Feature Management")
{
@@ -585,12 +567,6 @@ page 8900 "Administrator Main Role Center"
Caption = 'User Setup';
RunObject = page "User Setup";
}
- // action("Change Password")
- // {
- // ApplicationArea = Basic, Suite;
- // Caption = 'Change Password';
- // RunObject = page 9809;
- // }
action("User Security Status")
{
ApplicationArea = Basic, Suite;
@@ -807,12 +783,6 @@ page 8900 "Administrator Main Role Center"
Caption = 'Web Services';
RunObject = page "Web Services";
}
- // action("Bank Data Conv. Service Setup")
- // {
- // ApplicationArea = Basic,Suite;
- // Caption = 'Bank Data Conv. Service Setup';
- // RunObject = page 1260;
- // }
action("Microsoft Dynamics 365 Connection Setup")
{
ApplicationArea = Suite;
diff --git a/src/Layers/NL/BaseApp/RoleCenters/AdministratorRoleCenter.Page.al b/src/Layers/NL/BaseApp/RoleCenters/AdministratorRoleCenter.Page.al
deleted file mode 100644
index 2537fc8328..0000000000
--- a/src/Layers/NL/BaseApp/RoleCenters/AdministratorRoleCenter.Page.al
+++ /dev/null
@@ -1,967 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.RoleCenters;
-
-using Microsoft.Bank.Ledger;
-using Microsoft.Bank.Payment;
-using Microsoft.Bank.Reconciliation;
-using Microsoft.Bank.Setup;
-using Microsoft.CashFlow.Setup;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Interaction;
-using Microsoft.CRM.Profiling;
-using Microsoft.CRM.Setup;
-using Microsoft.CRM.Task;
-using Microsoft.EServices.EDocument;
-using Microsoft.EServices.OnlineMap;
-using Microsoft.Finance.Analysis;
-using Microsoft.Finance.GeneralLedger.Budget;
-using Microsoft.Finance.GeneralLedger.Ledger;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.VAT.Ledger;
-using Microsoft.Finance.VAT.Registration;
-using Microsoft.Finance.VAT.Reporting;
-using Microsoft.FixedAssets.Insurance;
-using Microsoft.FixedAssets.Ledger;
-using Microsoft.FixedAssets.Maintenance;
-using Microsoft.FixedAssets.Setup;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.Calendar;
-using Microsoft.Foundation.Company;
-using Microsoft.Foundation.Navigate;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Foundation.Task;
-using Microsoft.HumanResources.Setup;
-using Microsoft.Integration.D365Sales;
-using Microsoft.Integration.Dataverse;
-using Microsoft.Inventory.Analysis;
-using Microsoft.Inventory.Availability;
-using Microsoft.Inventory.Intrastat;
-using Microsoft.Inventory.Item.Catalog;
-#if not CLEAN28
-using Microsoft.Inventory.Reports;
-#endif
-using Microsoft.Inventory.Setup;
-using Microsoft.Projects.Resources.Ledger;
-using Microsoft.Projects.Resources.Setup;
-using Microsoft.Purchases.Analysis;
-using Microsoft.Purchases.Document;
-using Microsoft.Purchases.Payables;
-using Microsoft.Purchases.Setup;
-using Microsoft.Sales.Analysis;
-using Microsoft.Sales.Receivables;
-using Microsoft.Sales.Reminder;
-using Microsoft.Sales.Setup;
-using Microsoft.Utilities;
-using Microsoft.Warehouse.ADCS;
-using Microsoft.Warehouse.Ledger;
-using Microsoft.Warehouse.Setup;
-using Microsoft.Warehouse.Structure;
-using System.Automation;
-using System.Diagnostics;
-using System.Email;
-using System.IO;
-using System.Privacy;
-using System.Security.User;
-using System.Threading;
-
-page 9018 "Administrator Role Center"
-{
- Caption = 'IT Manager';
- PageType = RoleCenter;
-
- layout
- {
- area(rolecenter)
- {
- part(Control1904484608; "IT Operations Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Emails"; "Email Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control58; "CRM Synch. Job Status Part")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control52; "Service Connections Part")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control36; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control32; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- systempart(Control1901377608; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
- }
- }
-
- actions
- {
- area(reporting)
- {
-#if not CLEAN28
- action("Check on Ne&gative Inventory")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Check on Ne&gative Inventory (Obsolete)';
- Image = "Report";
- RunObject = Report "Items with Negative Inventory";
- ObsoleteState = Pending;
- ObsoleteReason = 'This report has been replaced by a filtered view on the Item List page. This report will be removed in a future release.';
- ObsoleteTag = '28.0';
- ToolTip = 'View a list of items with negative inventory and open warehouse documents for a location.';
- }
-#endif
- }
- area(embedding)
- {
- ToolTip = 'Set up users and cross-product values, such as number series and post codes.';
- action("Job Queue Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Job Queue Entries';
- RunObject = Page "Job Queue Entries";
- ToolTip = 'View or edit the tasks that are set up to run business processes automatically at user-defined intervals.';
- }
- action("User Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'User Setup';
- Image = UserSetup;
- RunObject = Page "User Setup";
- ToolTip = 'Set up users and define their permissions.';
- }
- action("Cases - Dynamics 365 Customer Service")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Cases - Dynamics 365 Customer Service';
- RunObject = Page "CRM Case List";
- ToolTip = 'View a list of Microsoft Dynamics 365 Customer Service cases.';
- }
- action("No. Series")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'No. Series';
- RunObject = Page "No. Series";
- ToolTip = 'Set up the number series from which a new number is automatically assigned to new cards and documents, such as item cards and sales invoices.';
- }
- action("Approval User Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Approval User Setup';
- RunObject = Page "Approval User Setup";
- ToolTip = 'View or edit information about workflow users who are involved in approval processes, such as approval amount limits for specific types of requests and substitute approvers to whom approval requests are delegated when the original approver is absent.';
- }
- action("Approval User Overview")
- {
- ApplicationArea = All;
- Caption = 'Approval User Overview';
- Image = QualificationOverview;
- RunObject = Page "Approval User Overview";
- ToolTip = 'Displays an overview of which users are able to approve specific workflows.';
- }
- action("Workflow User Groups")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Workflow User Groups';
- Image = Users;
- RunObject = Page "Workflow User Groups";
- ToolTip = 'View or edit the list of users that take part in workflows and which workflow user groups they belong to.';
- }
- action(Action57)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Workflows';
- Image = ApprovalSetup;
- RunObject = Page Workflows;
- ToolTip = 'Set up or enable workflows that connect business-process tasks performed by different users. System tasks, such as automatic posting, can be included as steps in workflows, preceded or followed by user tasks. Requesting and granting approval to create new records are typical workflow steps.';
- }
- action("Data Templates List")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Data Templates List';
- RunObject = Page "Config. Template List";
- ToolTip = 'View or edit template that are being used for data migration.';
- }
- action("Base Calendar List")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Base Calendar List';
- RunObject = Page "Base Calendar List";
- ToolTip = 'View the list of calendars that exist for your company and your business partners to define the agreed working days.';
- }
- action("Post Codes")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Codes';
- RunObject = Page "Post Codes";
- ToolTip = 'Set up the post codes of cities where your business partners are located.';
- }
- action("Reason Codes")
- {
- ApplicationArea = Suite;
- Caption = 'Reason Codes';
- RunObject = Page "Reason Codes";
- ToolTip = 'View or set up codes that specify reasons why entries were created, such as Return, to specify why a purchase credit memo was posted.';
- }
- }
- area(sections)
- {
- group("Job Queue")
- {
- Caption = 'Job Queue';
- Image = ExecuteBatch;
- ToolTip = 'Specify how reports, batch jobs, and codeunits are run.';
- action(JobQueue_JobQueueEntries)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Job Queue Entries';
- RunObject = Page "Job Queue Entries";
- ToolTip = 'View or edit the tasks that are set up to run business processes automatically at user-defined intervals.';
- }
- action("Job Queue Category List")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Job Queue Category List';
- RunObject = Page "Job Queue Category List";
- ToolTip = 'View or edit the task categories that are set up to run business processes automatically at user-defined intervals.';
- }
- action("Job Queue Log Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Job Queue Log Entries';
- RunObject = Page "Job Queue Log Entries";
- ToolTip = 'View information for job queue entries that have run or have not run due to errors including job queue entries that have the status On Hold.';
- }
- action("Scheduled Tasks")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Scheduled Tasks';
- RunObject = Page "Scheduled Tasks";
- ToolTip = 'View information about which tasks are ready to run in the job queue. The page also shows information about the company that each task is set up to run in.';
- }
- }
- group(Workflow)
- {
- Caption = 'Workflow';
- ToolTip = 'Set up workflow and approval users, and create workflows that govern how the users interact in processes.';
- action(Workflows)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Workflows';
- Image = ApprovalSetup;
- RunObject = Page Workflows;
- ToolTip = 'Set up or enable workflows that connect business-process tasks performed by different users. System tasks, such as automatic posting, can be included as steps in workflows, preceded or followed by user tasks. Requesting and granting approval to create new records are typical workflow steps.';
- }
- action("Workflow Templates")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Workflow Templates';
- Image = Setup;
- RunObject = Page "Workflow Templates";
- ToolTip = 'View the list of workflow templates that exist in the standard version of Business Central for supported scenarios. The codes for workflow templates that are added by Microsoft are prefixed with MS-. You cannot modify a workflow template, but you use it to create a workflow.';
- }
- action(ApprovalUserSetup)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Approval User Setup';
- RunObject = Page "Approval User Setup";
- ToolTip = 'View or edit information about workflow users who are involved in approval processes, such as approval amount limits for specific types of requests and substitute approvers to whom approval requests are delegated when the original approver is absent.';
- }
- action(WorkflowUserGroups)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Workflow User Groups';
- Image = Users;
- RunObject = Page "Workflow User Groups";
- ToolTip = 'View or edit the list of users that take part in workflows and which workflow user groups they belong to.';
- }
- }
- group(Intrastat)
- {
- Caption = 'Intrastat';
- Image = Intrastat;
- ToolTip = 'Set up Intrastat reporting values, such as tariff numbers.';
- action("Tariff Numbers")
- {
- ApplicationArea = BasicEU;
- Caption = 'Tariff Numbers';
- RunObject = Page "Tariff Numbers";
- ToolTip = 'View or edit the list of tariff numbers for item that your company buys and sells in the EU. The numbers are used to report Intrastat. The tax and customs authorities publish tariff numbers, which are eight-digit item codes, for a large number of products.';
- }
- action("Transaction Types")
- {
- ApplicationArea = BasicEU;
- Caption = 'Transaction Types';
- RunObject = Page "Transaction Types";
- ToolTip = 'View information that all EU businesses must report for their trade with other EU countries/regions for Intrastat reporting.';
- }
- action("Transaction Specifications")
- {
- ApplicationArea = BasicEU;
- Caption = 'Transaction Specifications';
- RunObject = Page "Transaction Specifications";
- ToolTip = 'View additional information about Intrastat reporting.';
- }
- action("Transport Methods")
- {
- ApplicationArea = BasicEU;
- Caption = 'Transport Methods';
- RunObject = Page "Transport Methods";
- ToolTip = 'View information about how your items are transported between EU country/regions, for Intrastat reporting.';
- }
- action("Entry/Exit Points")
- {
- ApplicationArea = BasicEU;
- Caption = 'Entry/Exit Points';
- RunObject = Page "Entry/Exit Points";
- ToolTip = 'View or edit codes for the location to which items from abroad are shipped or from which you ship items abroad. The information is used when reporting to Intrastat.';
- }
- action(Areas)
- {
- ApplicationArea = BasicEU;
- Caption = 'Areas';
- RunObject = Page Areas;
- ToolTip = 'View or edit information about the areas that you have set up for your configuration. The information includes a count of how many tables fall within each category.';
- }
- }
- group("VAT Registration Numbers")
- {
- Caption = 'VAT Registration Numbers';
- Image = Bank;
- ToolTip = 'Set up and maintain VAT registration number formats.';
- action("VAT Registration No. Formats")
- {
- ApplicationArea = VAT;
- Caption = 'VAT Registration No. Formats';
- RunObject = Page "VAT Registration No. Formats";
- ToolTip = 'View the formats for VAT registration number in different countries/regions.';
- }
- }
- group("Analysis View")
- {
- Caption = 'Analysis View';
- Image = AnalysisView;
- ToolTip = 'Set up views for analysis of sales, purchases, and inventory.';
- action("Sales Analysis View List")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Analysis View List';
- RunObject = Page "Analysis View List Sales";
- ToolTip = 'View the list of views that you use to analyze the dynamics of your sales volumes. You can also use the report to analyze your customer''s performance.';
- }
- action("Purchase Analysis View List")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Analysis View List';
- RunObject = Page "Analysis View List Purchase";
- ToolTip = 'View the list of views that you use to analyze the dynamics of your purchase volumes. You can also use the report to analyze your vendors'' performance and purchase prices.';
- }
- action("Inventory Analysis View List")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory Analysis View List';
- RunObject = Page "Analysis View List Inventory";
- ToolTip = 'View or edit your predefined views of items at a specified location per their combination of dimensions.';
- }
- }
- group(Telebanking)
- {
- Caption = 'Telebanking';
- action("Transaction Modes")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Transaction Modes';
- RunObject = Page "Transaction Mode List";
- ToolTip = 'View or edit the transaction modes that are used for telebanking to manage how an order, invoice, or credit memo for a vendor or customer will be paid for or collected.';
- }
- action("Export Protocols")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Export Protocols';
- RunObject = Page "Export Protocols";
- ToolTip = 'Set up codes for each set of export protocols to be used when exporting a payment history for processing by the bank.';
- }
- action("Import Protocols")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Import Protocols';
- RunObject = Page "Import Protocols";
- ToolTip = 'Set up codes for each set of import protocols to be used when importing bank statements.';
- }
- action("Freely Transferable Maximums")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Freely Transferable Maximums';
- RunObject = Page "Freely Transferable Maximums";
- ToolTip = 'Set up freely transferable maximums that denote the maximum amount, for a specific currency, that can be transferred in one payment from one country to another without reason given.';
- }
- }
- group("Tax Declaration")
- {
- Caption = 'Tax Declaration';
- action("Elec. Tax Decl. VAT Categories")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Elec. Tax Decl. VAT Categories';
- RunObject = Page "Elec. Tax Decl. VAT Categ.";
- ToolTip = 'Set up all the possible combinations of categories and sub categories that represent a XML element in the electronic VAT declaration. A combination is defined by a code. By entering this code in the Elec. Tax Decl. Category Code field on a VAT statement line, you map the data of the VAT statement directly to a XML element.';
- }
- }
- group("Data Privacy")
- {
- Caption = 'Data Privacy';
- Image = HumanResources;
- ToolTip = 'Manage data privacy classifications, and respond to requests from data subjects.';
- action("Page Data Classifications")
- {
- ApplicationArea = All;
- Caption = 'Data Classifications';
- RunObject = Page "Data Classification Worksheet";
- ToolTip = 'View your current data classifications';
- }
- action(Classified)
- {
- ApplicationArea = All;
- Caption = 'Classified Fields';
- RunObject = Page "Data Classification Worksheet";
- RunPageView = where("Data Sensitivity" = filter(<> Unclassified));
- ToolTip = 'View only classified fields';
- }
- action(Unclassified)
- {
- ApplicationArea = All;
- Caption = 'Unclassified Fields';
- RunObject = Page "Data Classification Worksheet";
- RunPageView = where("Data Sensitivity" = const(Unclassified));
- ToolTip = 'View only unclassified fields';
- }
- action("Page Data Subjects")
- {
- ApplicationArea = All;
- Caption = 'Data Subjects';
- RunObject = Page "Data Subject";
- ToolTip = 'View your potential data subjects';
- }
- action("Page Change Log Entries")
- {
- ApplicationArea = All;
- Caption = 'Change Log Entries';
- RunObject = Page "Change Log Entries";
- ToolTip = 'View the log with all the changes in your system';
- }
- }
- }
- area(creation)
- {
- action("Purchase &Order")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase &Order';
- Image = Document;
- RunObject = Page "Purchase Order";
- RunPageMode = Create;
- ToolTip = 'Create a new purchase order.';
- }
- }
- area(processing)
- {
- separator(Tasks)
- {
- Caption = 'Tasks';
- IsHeader = true;
- }
- action("Com&pany Information")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Com&pany Information';
- Image = CompanyInformation;
- RunObject = Page "Company Information";
- ToolTip = 'Specify basic information about your company, which designates a complete set of accounting information and financial statements for a business entity. You enter information such as name, addresses, and shipping information. The information in the Company Information window is printed on documents, such as sales invoices.';
- }
- action("Migration O&verview")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Migration O&verview';
- Image = Migration;
- RunObject = Page "Config. Package Card";
- ToolTip = 'Show the data migration overview.';
- }
- action("Relocate &Attachments")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Relocate &Attachments';
- Image = ChangeTo;
- RunObject = Report "Relocate Attachments";
- ToolTip = 'Specify where to store attachments.';
- }
- action("Create Warehouse &Location")
- {
- ApplicationArea = Warehouse;
- Caption = 'Create Warehouse &Location';
- Image = NewWarehouse;
- RunObject = Report "Create Warehouse Location";
- }
- action("C&hange Log Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'C&hange Log Setup';
- Image = LogSetup;
- RunObject = Page "Change Log Setup";
- ToolTip = 'Define which contract changes are logged.';
- }
- separator(Action30)
- {
- }
- group("&Change Setup")
- {
- Caption = '&Change Setup';
- Image = Setup;
- action("Setup &Questionnaire")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Setup &Questionnaire';
- Image = QuestionaireSetup;
- RunObject = Page "Config. Questionnaire";
- ToolTip = 'Create a new questionnaires that the customer will fill in to structure and document the solution needs and setup data.';
- }
- action("&General Ledger Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = '&General Ledger Setup';
- Image = Setup;
- RunObject = Page "General Ledger Setup";
- ToolTip = 'Define your accounting policies, such as invoice rounding details, the currency code for your local currency, address formats, and whether you want to use an additional reporting currency.';
- }
- action("Elec. Tax Declaration Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Elec. Tax Declaration Setup';
- RunObject = Page "Elec. Tax Declaration Setup";
- ToolTip = 'Set up the information that will be used to generate an electronic VAT and ICP declaration, such as the Digipoort configuration. ';
- }
- action("Sales && Re&ceivables Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sales && Re&ceivables Setup';
- Image = Setup;
- RunObject = Page "Sales & Receivables Setup";
- ToolTip = 'Define your general policies for sales invoicing and returns, such as when to show credit and stockout warnings and how to post sales discounts. Set up your number series for creating customers and different sales documents.';
- }
- action("Purchase && &Payables Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase && &Payables Setup';
- Image = ReceivablesPayablesSetup;
- RunObject = Page "Purchases & Payables Setup";
- ToolTip = 'Define your general policies for purchase invoicing and returns, such as whether to require vendor invoice numbers and how to post purchase discounts. Set up your number series for creating vendors and different purchase documents.';
- }
- action("Fixed &Asset Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Fixed &Asset Setup';
- Image = Setup;
- RunObject = Page "Fixed Asset Setup";
- ToolTip = 'Configure your company''s policies for managing fixed assets.';
- }
- action("Mar&keting Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mar&keting Setup';
- Image = MarketingSetup;
- RunObject = Page "Marketing Setup";
- ToolTip = 'Configure your company''s policies for marketing.';
- }
- action("Or&der Promising Setup")
- {
- ApplicationArea = OrderPromising;
- Caption = 'Or&der Promising Setup';
- Image = OrderPromisingSetup;
- RunObject = Page "Order Promising Setup";
- ToolTip = 'Configure your company''s policies for calculating delivery dates.';
- }
- action("Catalog &Item Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Catalog &Item Setup';
- Image = NonStockItemSetup;
- RunObject = Page "Catalog Item Setup";
- ToolTip = 'Configure your company''s policies for items that you sell but do keep on inventory.';
- }
- action("Interaction &Template Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Interaction &Template Setup';
- Image = InteractionTemplateSetup;
- RunObject = Page "Interaction Template Setup";
- ToolTip = 'Configure how you use templates to create interactions.';
- }
- action("Inve&ntory Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inve&ntory Setup';
- Image = InventorySetup;
- RunObject = Page "Inventory Setup";
- ToolTip = 'Define your general inventory policies, such as whether to allow negative inventory and how to post and adjust item costs. Set up your number series for creating new inventory items or services.';
- }
- action("&Warehouse Setup")
- {
- ApplicationArea = Warehouse;
- Caption = '&Warehouse Setup';
- Image = WarehouseSetup;
- RunObject = Page "Warehouse Setup";
- ToolTip = 'Configure your company''s warehouse policies, such as whether to require picking and putting away at locations by default.';
- }
- action("Mini&forms")
- {
- ApplicationArea = Warehouse;
- Caption = 'Mini&forms';
- Image = MiniForm;
- RunObject = Page Miniforms;
- ToolTip = 'View or edit special pages for users of hand-held devices. ';
- }
- action("Res&ources Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Res&ources Setup';
- Image = ResourceSetup;
- RunObject = Page "Resources Setup";
- ToolTip = 'Configure your company''s policies for resource planning, such as which time sheets to use.';
- }
- action("&Human Resource Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = '&Human Resource Setup';
- Image = HRSetup;
- RunObject = Page "Human Resources Setup";
- ToolTip = 'Define your policies for human resource management, such as number series for employees and units of measure.';
- }
- action(Action77)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'C&hange Log Setup';
- Image = LogSetup;
- RunObject = Page "Change Log Setup";
- ToolTip = 'Define which contract changes are logged.';
- }
- action("&MapPoint Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = '&MapPoint Setup';
- Image = MapSetup;
- RunObject = Page "Online Map Setup";
- ToolTip = 'Configure an online map service to show addresses on a map.';
- }
- action("Email Account Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email Account Setup';
- Image = MailSetup;
- RunObject = Page "Email Accounts";
- ToolTip = 'Set up email accounts used in the product.';
- }
- action("Profile Quest&ionnaire Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Profile Quest&ionnaire Setup';
- Image = QuestionaireSetup;
- RunObject = Page "Profile Questionnaire Setup";
- ToolTip = 'Set up profile questionnaires that you want to use when entering information about your contacts'' profiles. Within each questionnaire, you can set up the different questions you intend to ask your contacts. You can also run the questionnaire to answer some of the questions based on contact, customer, or vendor data automatically.';
- }
- }
- group("&Report Selection")
- {
- Caption = '&Report Selection';
- Image = SelectReport;
- action("Report Selection - &Bank Account")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Report Selection - &Bank Account';
- Image = SelectReport;
- RunObject = Page "Report Selection - Bank Acc.";
- ToolTip = 'View or edit the list of reports that can be printed when you work with bank accounts.';
- }
- action("Report Selection - &Reminder && Finance Charge")
- {
- ApplicationArea = Suite;
- Caption = 'Report Selection - &Reminder && Finance Charge';
- Image = SelectReport;
- RunObject = Page "Report Selection - Reminder";
- ToolTip = 'View or edit the list of reports that can be printed when you work with reminders and finance charges.';
- }
- action("Report Selection - &Sales")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Report Selection - &Sales';
- Image = SelectReport;
- RunObject = Page "Report Selection - Sales";
- ToolTip = 'View or edit the list of reports that can be printed when you work with sales.';
- }
- action("Report Selection - &Purchase")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Report Selection - &Purchase';
- Image = SelectReport;
- RunObject = Page "Report Selection - Purchase";
- ToolTip = 'View or edit the list of reports that can be printed when you work with purchasing.';
- }
- action("Report Selection - &Inventory")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Report Selection - &Inventory';
- Image = SelectReport;
- RunObject = Page "Report Selection - Inventory";
- ToolTip = 'View or edit the list of reports that can be printed when you work with inventory.';
- }
- action("Report Selection - &Warehouse")
- {
- ApplicationArea = Warehouse;
- Caption = 'Report Selection - &Warehouse';
- Image = SelectReport;
- RunObject = Page "Report Selection - Warehouse";
- ToolTip = 'View or edit the list of reports that can be printed when you work with warehouse.';
- }
- action("Report Selection - Cash Flow")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Report Selection - Cash Flow';
- Image = SelectReport;
- RunObject = Page "Report Selection - Cash Flow";
- ToolTip = 'View or edit the list of reports that can be printed when you work with cash flow.';
- }
- }
- group("&Date Compression")
- {
- Caption = '&Date Compression';
- Image = Compress;
- action("Date Compress &G/L Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Date Compress &G/L Entries';
- Image = GeneralLedger;
- RunObject = Report "Date Compress General Ledger";
- ToolTip = 'Save database space by combining related entries in one new entry. You can compress entries from closed fiscal years only.';
- }
- action("Date Compress &VAT Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Date Compress &VAT Entries';
- Image = VATStatement;
- RunObject = Report "Date Compress VAT Entries";
- ToolTip = 'Save database space by combining related entries in one new entry. You can compress entries from closed fiscal years only.';
- }
- action("Date Compress Bank &Account Ledger Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Date Compress Bank &Account Ledger Entries';
- Image = BankAccount;
- RunObject = Report "Date Compress Bank Acc. Ledger";
- ToolTip = 'Save database space by combining related entries in one new entry. You can compress entries from closed fiscal years only.';
- }
- action("Date Compress G/L &Budget Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Date Compress G/L &Budget Entries';
- Image = LedgerBudget;
- RunObject = Report "Date Compr. G/L Budget Entries";
- ToolTip = 'Save database space by combining related entries in one new entry. You can compress entries from closed fiscal years only.';
- }
- action("Date Compress &Customer Ledger Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Date Compress &Customer Ledger Entries';
- Image = Customer;
- RunObject = Report "Date Compress Customer Ledger";
- }
- action("Date Compress V&endor Ledger Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Date Compress V&endor Ledger Entries';
- Image = Vendor;
- RunObject = Report "Date Compress Vendor Ledger";
- ToolTip = 'Save database space by combining related entries in one new entry. You can compress entries from closed fiscal years only.';
- }
- action("Date Compress &Resource Ledger Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Date Compress &Resource Ledger Entries';
- Image = Resource;
- RunObject = Report "Date Compress Resource Ledger";
- ToolTip = 'Save database space by combining related entries in one new entry. You can compress entries from closed fiscal years only.';
- }
- action("Date Compress &FA Ledger Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Date Compress &FA Ledger Entries';
- Image = FixedAssets;
- RunObject = Report "Date Compress FA Ledger";
- ToolTip = 'Save database space by combining related entries in one new entry. You can compress entries from closed fiscal years only.';
- }
- action("Date Compress &Maintenance Ledger Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Date Compress &Maintenance Ledger Entries';
- Image = Tools;
- RunObject = Report "Date Compress Maint. Ledger";
- ToolTip = 'Save database space by combining related entries in one new entry. You can compress entries from closed fiscal years only.';
- }
- action("Date Compress &Insurance Ledger Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Date Compress &Insurance Ledger Entries';
- Image = Insurance;
- RunObject = Report "Date Compress Insurance Ledger";
- ToolTip = 'Save database space by combining related entries in one new entry. You can compress entries from closed fiscal years only.';
- }
- action("Date Compress &Warehouse Entries")
- {
- ApplicationArea = Warehouse;
- Caption = 'Date Compress &Warehouse Entries';
- Image = Bin;
- RunObject = Report "Date Compress Whse. Entries";
- }
- }
- separator(Action264)
- {
- }
- group("Con&tacts")
- {
- Caption = 'Con&tacts';
- Image = CustomerContact;
- action("Create Contacts from &Customer")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Contacts from &Customer';
- Image = CustomerContact;
- RunObject = Report "Create Conts. from Customers";
- ToolTip = 'Create a contact card from information about the customer''s contact person.';
- }
- action("Create Contacts from &Vendor")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Contacts from &Vendor';
- Image = VendorContact;
- RunObject = Report "Create Conts. from Vendors";
- ToolTip = 'Create a contact card from information about the vendor''s contact person.';
- }
- action("Create Contacts from &Bank Account")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Contacts from &Bank Account';
- Image = BankContact;
- RunObject = Report "Create Conts. from Bank Accs.";
- ToolTip = 'Create a contact card from information about the bank account''s contact person.';
- }
- action("Task &Activities")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Task &Activities';
- Image = TaskList;
- RunObject = Page Activity;
- }
- }
- group("&Sales Analysis")
- {
- Caption = '&Sales Analysis';
- Image = Segment;
- action(SalesAnalysisLineTmpl)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Analysis &Line Templates';
- Image = SetupLines;
- RunObject = Page "Analysis Line Templates";
- RunPageView = sorting("Analysis Area", Name)
- where("Analysis Area" = const(Sales));
- ToolTip = 'Define the layout of your views to analyze the dynamics of your sales volumes.';
- }
- action(SalesAnalysisColumnTmpl)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Analysis &Column Templates';
- Image = SetupColumns;
- RunObject = Page "Analysis Column Templates";
- RunPageView = sorting("Analysis Area", Name)
- where("Analysis Area" = const(Sales));
- ToolTip = 'Define the layout of your views to analyze the dynamics of your sales volumes.';
- }
- action(Action121)
- {
- ApplicationArea = Advanced;
- Caption = 'Sales Analysis View List';
- RunObject = Page "Analysis View List";
- ToolTip = 'View the list of views that you use to analyze the dynamics of your sales volumes. You can also use the report to analyze your customers'' performance and sales prices.';
- }
- }
- group("P&urchase Analysis")
- {
- Caption = 'P&urchase Analysis';
- Image = Purchasing;
- action(PurchaseAnalysisLineTmpl)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase &Analysis Line Templates';
- Image = SetupLines;
- RunObject = Page "Analysis Line Templates";
- RunPageView = sorting("Analysis Area", Name)
- where("Analysis Area" = const(Purchase));
- ToolTip = 'Define the layout of your views to analyze the dynamics of your purchase volumes.';
- }
- action(PurchaseAnalysisColumnTmpl)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Analysis &Column Templates';
- Image = SetupColumns;
- RunObject = Page "Analysis Column Templates";
- RunPageView = sorting("Analysis Area", Name)
- where("Analysis Area" = const(Purchase));
- ToolTip = 'Define the layout of your views to analyze the dynamics of your purchase volumes.';
- }
- action(Action125)
- {
- ApplicationArea = Advanced;
- Caption = 'Purchase Analysis View List';
- RunObject = Page "Analysis View List";
- ToolTip = 'View the list of views that you use to analyze the dynamics of your purchase volumes. You can also use the report to analyze your vendors'' performance and purchase prices.';
- }
- }
- separator(History)
- {
- Caption = 'History';
- IsHeader = true;
- }
- action("Navi&gate")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Find entries...';
- Image = Navigate;
- RunObject = Page Navigate;
- ShortCutKey = 'Ctrl+Alt+Q';
- ToolTip = 'Find entries and documents that exist for the document number and posting date on the selected document. (Formerly this action was named Navigate.)';
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/RoleCenters/SmallBusinessOwnerRC.Page.al b/src/Layers/NL/BaseApp/RoleCenters/SmallBusinessOwnerRC.Page.al
deleted file mode 100644
index c00921f123..0000000000
--- a/src/Layers/NL/BaseApp/RoleCenters/SmallBusinessOwnerRC.Page.al
+++ /dev/null
@@ -1,1110 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.RoleCenters;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.Deposit;
-using Microsoft.Bank.Journal;
-using Microsoft.Bank.Payment;
-using Microsoft.Bank.Reconciliation;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Task;
-using Microsoft.CRM.Team;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Reports;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.RoleCenters;
-using Microsoft.Finance.VAT.Registration;
-using Microsoft.Finance.VAT.Reporting;
-using Microsoft.FixedAssets.FixedAsset;
-using Microsoft.FixedAssets.Journal;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.Calendar;
-using Microsoft.Foundation.Navigate;
-using Microsoft.Foundation.Period;
-using Microsoft.Foundation.Task;
-using Microsoft.HumanResources.Employee;
-using Microsoft.Integration.D365Sales;
-using Microsoft.Inventory.BOM;
-using Microsoft.Inventory.Costing;
-using Microsoft.Inventory.Item;
-using Microsoft.Inventory.Journal;
-using Microsoft.Inventory.Reports;
-using Microsoft.Inventory.Requisition;
-using Microsoft.Projects.Resources.Journal;
-using Microsoft.Projects.Resources.Ledger;
-using Microsoft.Projects.Resources.Resource;
-using Microsoft.Purchases.Document;
-using Microsoft.Purchases.History;
-#if not CLEAN28
-using Microsoft.Purchases.Reports;
-#endif
-using Microsoft.Purchases.Vendor;
-using Microsoft.Sales.Analysis;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.Document;
-using Microsoft.Sales.FinanceCharge;
-using Microsoft.Sales.History;
-using Microsoft.Sales.Pricing;
-using Microsoft.Sales.Reminder;
-using Microsoft.Sales.Reports;
-using Microsoft.Sales.RoleCenters;
-using Microsoft.Sales.Setup;
-using System.IO;
-using System.Security.User;
-using System.Threading;
-
-page 9020 "Small Business Owner RC"
-{
- Caption = 'President - Small Business';
- PageType = RoleCenter;
-
- layout
- {
- area(rolecenter)
- {
- group(Control1900724808)
- {
- ShowCaption = false;
- part(Control78; "Small Business Owner Act.")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- }
- group(Control1900724708)
- {
- ShowCaption = false;
- part(Control69; "Finance Performance")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control70; "Sales Performance")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control2; "Trailing Sales Orders Chart")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control12; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1907692008; "My Customers")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control1902476008; "My Vendors")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control99; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control1905989608; "My Items")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- systempart(Control67; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
- }
- }
- }
-
- actions
- {
- area(reporting)
- {
- action("S&tatement")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'S&tatement';
- Image = "Report";
- RunObject = Report "Customer Statement";
- }
- separator(Action61)
- {
- }
- action("Customer - Order Su&mmary")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer - Order Su&mmary';
- Image = "Report";
- RunObject = Report "Customer - Order Summary";
- ToolTip = 'View the order detail (the quantity not yet shipped) for each customer in three periods of 30 days each, starting from a selected date. There are also columns with orders to be shipped before and after the three periods and a column with the total order detail for each customer. The report can be used to analyze a company''s expected sales volume.';
- }
-#if not CLEAN28
- action("Customer - T&op 10 List")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer - T&op 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
- action("Customer/&Item Sales")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer/&Item Sales';
- Image = "Report";
- RunObject = Report "Customer/Item Sales";
- ToolTip = 'View a list of item sales for each customer during a selected time period. The report contains information on quantity, sales amount, profit, and possible discounts. It can be used, for example, to analyze a company''s customer groups.';
- }
- separator(Action75)
- {
- }
- action("Salesperson - Sales &Statistics")
- {
- ApplicationArea = Suite;
- Caption = 'Salesperson - Sales &Statistics';
- Image = "Report";
- RunObject = Report "Salesperson - Sales Statistics";
- ToolTip = 'View amounts for sales, profit, invoice discount, and payment discount, as well as profit percentage, for each salesperson for a selected period. The report also shows the adjusted profit and adjusted profit percentage, which reflect any changes to the original costs of the items in the sales.';
- }
- action("Price &List")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Price &List';
- Image = "Report";
- RunPageView = where("Object Type" = const(Report), "Object ID" = const(715)); // "Price List";
- RunObject = Page "Role Center Page Dispatcher";
- ToolTip = 'View a list of your items and their prices, for example, to send to customers. You can create the list for specific customers, campaigns, currencies, or other criteria.';
- }
- separator(Action93)
- {
- }
- action("Inventory - Sales &Back Orders")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory - Sales &Back Orders';
- Image = "Report";
- RunObject = Report "Inventory - Sales Back Orders";
- ToolTip = 'View a list with the order lines whose shipment date has been exceeded. The following information is shown for the individual orders for each item: number, customer name, customer''s telephone number, shipment date, order quantity and quantity on back order. The report also shows whether there are other items for the customer on back order.';
- }
- separator(Action129)
- {
- }
-#if not CLEAN28
- action("&G/L Trial Balance")
- {
- ApplicationArea = Basic, Suite;
- Caption = '&G/L Trial Balance (Obsolete)';
- Image = "Report";
- RunObject = Report "Trial Balance";
- ToolTip = 'View, print, or send a report that shows the balances for the general ledger accounts, including the debits and credits. You can use this report to ensure accurate accounting practices.';
- ObsoleteState = Pending;
- ObsoleteReason = 'This report has been replaced by the report Trial Balance (Excel). This report will be removed in a future release.';
- ObsoleteTag = '28.0';
- }
-#endif
- action("Trial Balance by &Period")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Trial Balance by &Period';
- Image = "Report";
- RunObject = Report "Trial Balance by Period";
- ToolTip = 'Show the opening balance by general ledger account, the movements in the selected period of month, quarter, or year, and the resulting closing balance.';
- }
- action("Closing T&rial Balance")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Closing T&rial Balance';
- Image = "Report";
- RunObject = Report "Closing Trial Balance";
- ToolTip = 'View this year''s and last year''s figures as an ordinary trial balance. For income statement accounts, the balances are shown without closing entries. Closing entries are listed on a fictitious date that falls between the last day of one fiscal year and the first day of the next one. The closing of the income statement accounts is posted at the end of a fiscal year. The report can be used in connection with closing a fiscal year.';
- }
- separator(Action49)
- {
- }
-#if not CLEAN28
- action("Aged Ac&counts Receivable")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Aged Ac&counts Receivable (Obsolete)';
- Image = "Report";
- RunObject = Report "Aged Accounts Receivable";
- ToolTip = 'View an overview of when your receivables from customers 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';
- }
- action("Aged Accounts Pa&yable")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Aged Accounts Pa&yable (Obsolete)';
- Image = "Report";
- RunObject = Report "Aged Accounts Payable";
- ToolTip = 'View an overview of when your payables to vendors 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 Payable (Excel). This report will be removed in a future release.';
- ObsoleteTag = '28.0';
- }
-#endif
- action("Reconcile Cust. and &Vend. Accs")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Reconcile Cust. and &Vend. Accs';
- Image = "Report";
- RunObject = Report "Reconcile Cust. and Vend. Accs";
- ToolTip = 'View if a certain general ledger account reconciles the balance on a certain date for the corresponding posting group. The report shows the accounts that are included in the reconciliation with the general ledger balance and the customer or the vendor ledger balance for each account and shows any differences between the general ledger balance and the customer or vendor ledger balance.';
- }
- separator(Action53)
- {
- }
- action("VAT Registration No. Chec&k")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'VAT Registration No. Chec&k';
- Image = "Report";
- RunObject = Report "VAT Registration No. Check";
- ToolTip = 'Use an EU VAT number validation service to validated the VAT number of a business partner.';
- }
- action("VAT E&xceptions")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'VAT E&xceptions';
- Image = "Report";
- RunObject = Report "VAT Exceptions";
- ToolTip = 'View the VAT entries that were posted and placed in a general ledger register in connection with a VAT difference. The report is used to document adjustments made to VAT amounts that were calculated for use in internal or external auditing.';
- }
- action("V&AT Statement")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'V&AT Statement';
- Image = "Report";
- RunObject = Report "VAT Statement";
- ToolTip = 'View a statement of posted VAT and calculate the duty liable to the customs authorities for the selected period.';
- }
- action("G/L - VAT Reconciliation")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'G/L - VAT Reconciliation';
- Image = "Report";
- RunObject = Report "G/L - VAT Reconciliation";
- ToolTip = 'Verify that the VAT amounts on the VAT statements match the amounts from the G/L entries.';
- }
- action("VAT-VIES Declaration Tax A&uth")
- {
- ApplicationArea = BasicEU;
- Caption = 'VAT-VIES Declaration Tax A&uth';
- Image = "Report";
- RunObject = Report "VAT- VIES Declaration Tax Auth";
- ToolTip = 'View information to the customs and tax authorities for sales to other EU countries/regions. If the information must be printed to a file, you can use the VAT- VIES Declaration Disk report.';
- }
- action("VAT - VIES Declaration &Disk")
- {
- ApplicationArea = BasicEU;
- Caption = 'VAT - VIES Declaration &Disk';
- Image = "Report";
- RunObject = Report "VAT- VIES Declaration Disk";
- ToolTip = 'Report your sales to other EU countries or regions to the customs and tax authorities. If the information must be printed out on a printer, you can use the VAT- VIES Declaration Tax Auth report. The information is shown in the same format as in the declaration list from the customs and tax authorities.';
- }
- action("EC Sal&es List")
- {
- ApplicationArea = BasicEU;
- Caption = 'EC Sal&es List';
- Image = "Report";
- RunObject = Report "EC Sales List";
- ToolTip = 'Calculate VAT amounts from sales, and submit the amounts to a tax authority.';
- }
- }
- area(embedding)
- {
- action("Sales Quotes")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Quotes';
- Image = Quote;
- RunObject = Page "Sales Quotes";
- ToolTip = 'Make offers to customers to sell certain products on certain delivery and payment terms. While you negotiate with a customer, you can change and resend the sales quote as much as needed. When the customer accepts the offer, you convert the sales quote to a sales invoice or a sales order in which you process the sale.';
- }
- action("Sales Orders")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Orders';
- Image = "Order";
- RunObject = Page "Sales Order List";
- ToolTip = 'Record your agreements with customers to sell certain products on certain delivery and payment terms. Sales orders, unlike sales invoices, allow you to ship partially, deliver directly from your vendor to your customer, initiate warehouse handling, and print various customer-facing documents. Sales invoicing is integrated in the sales order process.';
- }
- action("Sales Orders - Microsoft Dynamics 365 Sales")
- {
- ApplicationArea = Suite;
- Caption = 'Sales Orders - Microsoft Dynamics 365 Sales';
- RunObject = Page "CRM Sales Order List";
- ToolTip = 'View sales orders in Dynamics 365 Sales that are coupled with sales orders in Business Central.';
- }
- action(Customers)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customers';
- Image = Customer;
- RunObject = Page "Customer List";
- ToolTip = 'View or edit detailed information for the customers that you trade with. From each customer card, you can open related information, such as sales statistics and ongoing orders, and you can define special prices and line discounts that you grant if certain conditions are met.';
- }
- action(CustomersBalance)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Balance';
- Image = Balance;
- RunObject = Page "Customer List";
- RunPageView = where("Balance (LCY)" = filter(<> 0));
- ToolTip = 'View a summary of the bank account balance in different periods.';
- }
- action("Purchase Orders")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Orders';
- RunObject = Page "Purchase Order List";
- ToolTip = 'Create purchase orders to mirror sales documents that vendors send to you. This enables you to record the cost of purchases and to track accounts payable. Posting purchase orders dynamically updates inventory levels so that you can minimize inventory costs and provide better customer service. Purchase orders allow partial receipts, unlike with purchase invoices, and enable drop shipment directly from your vendor to your customer. Purchase orders can be created automatically from PDF or image files from your vendors by using the Incoming Documents feature.';
- }
- action(Vendors)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendors';
- Image = Vendor;
- RunObject = Page "Vendor List";
- ToolTip = 'View or edit detailed information for the vendors that you trade with. From each vendor card, you can open related information, such as purchase statistics and ongoing orders, and you can define special prices and line discounts that the vendor grants you if certain conditions are met.';
- }
- action(VendorsBalance)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Balance';
- Image = Balance;
- RunObject = Page "Vendor List";
- RunPageView = where("Balance (LCY)" = filter(<> 0));
- ToolTip = 'View a summary of the bank account balance in different periods.';
- }
- action(Items)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Items';
- Image = Item;
- RunObject = Page "Item List";
- ToolTip = 'View or edit detailed information for the products that you trade in. The item card can be of type Inventory or Service to specify if the item is a physical unit or a labor time unit. Here you also define if items in inventory or on incoming orders are automatically reserved for outbound documents and whether order tracking links are created between demand and supply to reflect planning actions.';
- }
- action(Telebanking)
- {
- ApplicationArea = Advanced;
- Caption = 'Telebanking';
- RunObject = Page "Telebank - Bank Overview";
- ToolTip = 'Prepare to exchange your payments to vendors and collections from customers with your bank electronically. This includes the export of payment and collection data that need to be forwarded to the bank as well as the import of bank statements sent to you by the bank.';
- }
- action("Telebank - Bank Overview")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Telebank - Bank Overview';
- RunObject = Page "Telebank - Bank Overview";
- ToolTip = 'View a list of bank accounts that are set up for electronic bank file transfers using the Telebanking functionality.';
- }
- }
- area(sections)
- {
- group(Journals)
- {
- Caption = 'Journals';
- Image = Journals;
- action(ItemJournals)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Journals';
- RunObject = Page "Item Journal Batches";
- RunPageView = where("Template Type" = const(Item),
- Recurring = const(false));
- ToolTip = 'Open a list of journals where you can adjust the physical quantity of items on inventory.';
- }
- action(PhysicalInventoryJournals)
- {
- ApplicationArea = Warehouse;
- Caption = 'Physical Inventory Journals';
- RunObject = Page "Item Journal Batches";
- RunPageView = where("Template Type" = const("Phys. Inventory"),
- Recurring = const(false));
- ToolTip = 'Prepare to count the actual items in inventory to check if the quantity registered in the system is the same as the physical quantity. If there are differences, post them to the item ledger with the physical inventory journal before you do the inventory valuation.';
- }
- action(RevaluationJournals)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Revaluation Journals';
- RunObject = Page "Item Journal Batches";
- RunPageView = where("Template Type" = const(Revaluation),
- Recurring = const(false));
- ToolTip = 'Change the inventory value of items, for example after doing a physical inventory.';
- }
- action("Resource Journals")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Resource Journals';
- RunObject = Page "Resource Jnl. Batches";
- RunPageView = where(Recurring = const(false));
- ToolTip = 'View all resource journals.';
- }
- action("FA Journals")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'FA Journals';
- RunObject = Page "FA Journal Batches";
- RunPageView = where(Recurring = const(false));
- ToolTip = 'Post entries to a depreciation book without integration to the general ledger.';
- }
- action(CashReceiptJournals)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Cash Receipt Journals';
- Image = Journals;
- RunObject = Page "General Journal Batches";
- RunPageView = where("Template Type" = const("Cash Receipts"),
- Recurring = const(false));
- ToolTip = 'Register received payments by manually applying them to the related customer, vendor, or bank ledger entries. Then, post the payments to G/L accounts and thereby close the related ledger entries.';
- }
- action(PaymentJournals)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Payment Journals';
- Image = Journals;
- RunObject = Page "General Journal Batches";
- RunPageView = where("Template Type" = const(Payments),
- Recurring = const(false));
- ToolTip = 'Register payments to vendors. A payment journal is a type of general journal that is used to post outgoing payment transactions to G/L, bank, customer, vendor, employee, and fixed assets accounts. The Suggest Vendor Payments functions automatically fills the journal with payments that are due. When payments are posted, you can export the payments to a bank file for upload to your bank if your system is set up for electronic banking. You can also issue computer checks from the payment journal.';
- }
- action(GeneralJournals)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'General Journals';
- Image = Journal;
- RunObject = Page "General Journal Batches";
- RunPageView = where("Template Type" = const(General),
- Recurring = const(false));
- ToolTip = 'Post financial transactions directly to general ledger accounts and other accounts, such as bank, customer, vendor, and employee accounts. Posting with a general journal always creates entries on general ledger accounts. This is true even when, for example, you post a journal line to a customer account, because an entry is posted to a general ledger receivables account through a posting group.';
- }
- action("Bank/Giro Journals")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Bank/Giro Journals';
- RunObject = Page "Bank/Giro Journal List";
- ToolTip = 'Reconcile a bank account by comparing incoming and outgoing bank transactions to a physical bank statement or by importing an electronic bank statement file, and apply the related payments to open customer or vendor documents.';
- }
- action("Cash Journals")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Cash Journals';
- RunObject = Page "Cash Journal List";
- ToolTip = 'Post transactions to the cash account in the general ledger.';
- }
- action(RecurringJournals)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Recurring Journals';
- RunObject = Page "General Journal Batches";
- RunPageView = where("Template Type" = const(General),
- Recurring = const(true));
- ToolTip = 'View all recurring journals';
- }
- }
- group(Worksheets)
- {
- Caption = 'Worksheets';
- Image = Worksheets;
- action("Requisition Worksheets")
- {
- ApplicationArea = Planning;
- Caption = 'Requisition Worksheets';
- RunObject = Page "Req. Wksh. Names";
- RunPageView = where("Template Type" = const("Req."),
- Recurring = const(false));
- ToolTip = 'Calculate a supply plan to fulfill item demand with purchases or transfers.';
- }
- }
- group("Posted Documents")
- {
- Caption = 'Posted Documents';
- Image = FiledPosted;
- action("Posted Sales Shipments")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posted Sales Shipments';
- Image = PostedShipment;
- RunObject = Page "Posted Sales Shipments";
- ToolTip = 'Open the list of posted sales shipments.';
- }
- action("Posted Sales Invoices")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posted Sales Invoices';
- Image = PostedOrder;
- RunObject = Page "Posted Sales Invoices";
- ToolTip = 'Open the list of posted sales invoices.';
- }
- action("Posted Sales Credit Memos")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posted Sales Credit Memos';
- Image = PostedOrder;
- RunObject = Page "Posted Sales Credit Memos";
- ToolTip = 'Open the list of posted sales credit memos.';
- }
- action("Posted Purchase Receipts")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posted Purchase Receipts';
- RunObject = Page "Posted Purchase Receipts";
- ToolTip = 'Open the list of posted purchase receipts.';
- }
- action("Posted Purchase Invoices")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posted Purchase Invoices';
- RunObject = Page "Posted Purchase Invoices";
- ToolTip = 'Open the list of posted purchase invoices.';
- }
- action("Posted Purchase Credit Memos")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posted Purchase Credit Memos';
- RunObject = Page "Posted Purchase Credit Memos";
- ToolTip = 'Open the list of posted purchase credit memos.';
- }
- action("Issued Reminders")
- {
- ApplicationArea = Suite;
- Caption = 'Issued Reminders';
- Image = OrderReminder;
- RunObject = Page "Issued Reminder List";
- ToolTip = 'View the list of issued reminders.';
- }
- action("Issued Fin. Charge Memos")
- {
- ApplicationArea = Suite;
- Caption = 'Issued Fin. Charge Memos';
- Image = PostedMemo;
- RunObject = Page "Issued Fin. Charge Memo List";
- ToolTip = 'View the list of issued finance charge memos.';
- }
- action("Posted Bank Deposits")
- {
- Caption = 'Posted Bank Deposits';
- Image = PostedDeposit;
- RunObject = codeunit "Open P. Bank Deposits L. Page";
- ToolTip = 'View the posted bank deposit header, bank deposit header lines, bank deposit comments, and bank deposit dimensions.';
- }
- }
- group(Finance)
- {
- Caption = 'Finance';
- Image = Bank;
- action("VAT Statements")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'VAT Statements';
- RunObject = Page "VAT Statement Names";
- ToolTip = 'View a statement of posted VAT amounts, calculate your VAT settlement amount for a certain period, such as a quarter, and prepare to send the settlement to the tax authorities.';
- }
- action("Chart of Accounts")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Chart of Accounts';
- RunObject = Page "Chart of Accounts";
- ToolTip = 'View the chart of accounts.';
- }
- action("Bank Accounts")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Bank Accounts';
- Image = BankAccount;
- RunObject = Page "Bank Account List";
- ToolTip = 'View or set up detailed information about your bank account, such as which currency to use, the format of bank files that you import and export as electronic payments, and the numbering of checks.';
- }
- action(Currencies)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Currencies';
- Image = Currency;
- RunObject = Page Currencies;
- ToolTip = 'View the different currencies that you trade in or update the exchange rates by getting the latest rates from an external service provider.';
- }
- action("Accounting Periods")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Accounting Periods';
- Image = AccountingPeriods;
- RunObject = Page "Accounting Periods";
- ToolTip = 'Set up the number of accounting periods, such as 12 monthly periods, within the fiscal year and specify which period is the start of the new fiscal year.';
- }
- action(Dimensions)
- {
- ApplicationArea = Dimensions;
- Caption = 'Dimensions';
- Image = Dimensions;
- RunObject = Page Dimensions;
- 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.';
- }
- action("Bank Account Posting Groups")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Bank Account Posting Groups';
- RunObject = Page "Bank Account Posting Groups";
- ToolTip = 'Set up posting groups, so that payments in and out of each bank account are posted to the specified general ledger account.';
- }
- }
- group("Cash Management")
- {
- Caption = 'Cash Management';
- action("Deposits to Post")
- {
- Caption = 'Bank Deposits to Post';
- RunObject = codeunit "Open Deposits Page";
- ToolTip = 'View the list of bank deposits that are ready to post.';
- }
- }
- group(Marketing)
- {
- Caption = 'Marketing';
- Image = Marketing;
- action(Contacts)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contacts';
- Image = CustomerContact;
- RunObject = Page "Contact List";
- ToolTip = 'View a list of all your contacts.';
- }
- action(Tasks)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Tasks';
- Image = TaskList;
- RunObject = Page "Task List";
- ToolTip = 'View the list of marketing tasks that exist.';
- }
- }
- group(Sales)
- {
- Caption = 'Sales';
- Image = Sales;
- action("Assembly BOM")
- {
- ApplicationArea = Assembly;
- Caption = 'Assembly BOM';
- Image = AssemblyBOM;
- RunObject = Page "Assembly BOM";
- ToolTip = 'View or edit the bill of material that specifies which items and resources are required to assemble the assembly item.';
- }
- action("Sales Credit Memos")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Credit Memos';
- RunObject = Page "Sales Credit Memos";
- ToolTip = 'Revert the financial transactions involved when your customers want to cancel a purchase or return incorrect or damaged items that you sent to them and received payment for. To include the correct information, you can create the sales credit memo from the related posted sales invoice or you can create a new sales credit memo with copied invoice information. If you need more control of the sales return process, such as warehouse documents for the physical handling, use sales return orders, in which sales credit memos are integrated. Note: If an erroneous sale has not been paid yet, you can simply cancel the posted sales invoice to automatically revert the financial transaction.';
- }
- action("Standard Sales Codes")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Standard Sales Codes';
- RunObject = Page "Standard Sales Codes";
- ToolTip = 'View or edit purchase lines that you have set up for recurring sales, such as a monthly replenishment order.';
- }
- action("Salespeople/Purchasers")
- {
- ApplicationArea = Suite;
- Caption = 'Salespeople/Purchasers';
- RunObject = Page "Salespersons/Purchasers";
- ToolTip = 'View a list of salespeople and purchasers.';
- }
- action("Customer Invoice Discount")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer Invoice Discount';
- RunObject = Page "Cust. Invoice Discounts";
- ToolTip = 'View or edit conditions for invoice discounts and service charges for different customers.';
- }
- }
- group(Purchasing)
- {
- Caption = 'Purchasing';
- Image = Purchasing;
- action("Standard Purchase Codes")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Standard Purchase Codes';
- RunObject = Page "Standard Purchase Codes";
- ToolTip = 'View or edit purchase lines that you have set up for recurring purchases, such as a monthly replenishment order.';
- }
- action("Vendor Invoice Discounts")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor Invoice Discounts';
- RunObject = Page "Vend. Invoice Discounts";
- ToolTip = 'View or edit conditions for when your vendors grant you invoice discounts. Each line contains a set of conditions for an invoice discount. You can set up as many lines as necessary if you receive different discount percentages for different invoice amounts and for different currencies.';
- }
- action("Item Discount Groups")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Discount Groups';
- RunObject = Page "Item Disc. Groups";
- ToolTip = 'Set up discount group codes that you can use as criteria when you define special discounts on a customer, vendor, or item card.';
- }
- }
- group(Resources)
- {
- Caption = 'Resources';
- Image = ResourcePlanning;
- action(Action126)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Resources';
- RunObject = Page "Resource List";
- ToolTip = 'Manage your resources'' job activities by setting up their costs and prices. The job-related prices, discounts, and cost factor rules are set up on the respective job card. You can specify the costs and prices for individual resources, resource groups, or all available resources of the company. When resources are used or sold in a job, the specified prices and costs are recorded for the project.';
- }
- action("Resource Groups")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Resource Groups';
- RunObject = Page "Resource Groups";
- ToolTip = 'View all resource groups.';
- }
- action("Resource Price Changes")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Resource Price Changes';
- Image = ResourcePrice;
- RunPageView = where("Object Type" = const(Page), "Object ID" = const(493)); // "Resource Price Changes";
- RunObject = Page "Role Center Page Dispatcher";
- ToolTip = 'Edit or update alternate resource prices, by running either the Suggest Res. Price Chg. (Res.) batch job or the Suggest Res. Price Chg. (Price) batch job.';
- }
- action("Resource Registers")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Resource Registers';
- Image = ResourceRegisters;
- RunObject = Page "Resource Registers";
- ToolTip = 'View a list of all the resource registers. Every time a resource entry is posted, a register is created. Every register shows the first and last entry numbers of its entries. You can use the information in a resource register to document when entries were posted.';
- }
- }
- group("Human Resources")
- {
- Caption = 'Human Resources';
- Image = HumanResources;
- action(Employees)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Employees';
- Image = Employee;
- RunObject = Page "Employee List";
- ToolTip = 'Manage employees'' details and related information, such as qualifications and pictures, or register and analyze employee absence. Keeping up-to-date records about your employees simplifies personnel tasks. For example, if an employee''s address changes, you register this on the employee card.';
- }
- }
- group("Fixed Assets")
- {
- Caption = 'Fixed Assets';
- Image = FixedAssets;
- action(Action17)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Fixed Assets';
- RunObject = Page "Fixed Asset List";
- ToolTip = 'Manage periodic depreciation of your machinery or machines, keep track of your maintenance costs, manage insurance policies related to fixed assets, and monitor fixed asset statistics.';
- }
- }
- group(Administration)
- {
- Caption = 'Administration';
- Image = Administration;
- action("User Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'User Setup';
- Image = UserSetup;
- RunObject = Page "User Setup";
- ToolTip = 'Set up users and define their permissions..';
- }
- action("Data Templates List")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Data Templates List';
- RunObject = Page "Config. Template List";
- ToolTip = 'View or edit template that are being used for data migration.';
- }
- action("Base Calendar List")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Base Calendar List';
- RunObject = Page "Base Calendar List";
- ToolTip = 'View the list of calendars that exist for your company and your business partners to define the agreed working days.';
- }
- action("Post Codes")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Codes';
- RunObject = Page "Post Codes";
- ToolTip = 'Set up the post codes of cities where your business partners are located.';
- }
- action("Reason Codes")
- {
- ApplicationArea = Suite;
- Caption = 'Reason Codes';
- RunObject = Page "Reason Codes";
- ToolTip = 'View or set up codes that specify reasons why entries were created, such as Return, to specify why a purchase credit memo was posted.';
- }
- }
- }
- area(creation)
- {
- action("C&ustomer")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'C&ustomer';
- Image = Customer;
- RunObject = Page "Customer Card";
- RunPageMode = Create;
- ToolTip = 'Create a new customer card.';
- }
- action("Sales &Order")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sales &Order';
- Image = Document;
- RunObject = Page "Sales Order";
- RunPageMode = Create;
- ToolTip = 'Create a new sales order for items or services.';
- }
- action("Sales Credit &Memo")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Credit &Memo';
- Image = CreditMemo;
- RunObject = Page "Sales Credit Memo";
- RunPageMode = Create;
- ToolTip = 'Create a new sales credit memo to revert a posted sales invoice.';
- }
- action("&Sales Reminder")
- {
- ApplicationArea = Basic, Suite;
- Caption = '&Sales Reminder';
- Image = Reminder;
- RunObject = Page Reminder;
- RunPageMode = Create;
- ToolTip = 'Create a reminder to remind a customer of overdue payment.';
- }
- action(Deposit)
- {
- Caption = 'Bank Deposit';
- Image = DepositSlip;
- RunObject = codeunit "Open Deposit Page";
- ToolTip = 'Create a new bank deposit. ';
- }
- separator(Action5)
- {
- }
- action("&Vendor")
- {
- ApplicationArea = Basic, Suite;
- Caption = '&Vendor';
- Image = Vendor;
- RunObject = Page "Vendor Card";
- RunPageMode = Create;
- ToolTip = 'Set up a new vendor from whom you buy goods or services. ';
- }
- action("&Purchase Order")
- {
- ApplicationArea = Basic, Suite;
- Caption = '&Purchase Order';
- Image = Document;
- RunObject = Page "Purchase Order";
- RunPageMode = Create;
- ToolTip = 'Purchase goods or services from a vendor.';
- }
- }
- area(processing)
- {
- separator(Action13)
- {
- Caption = 'Tasks';
- IsHeader = true;
- }
- action("Cash Receipt &Journal")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Cash Receipt &Journal';
- Image = CashReceiptJournal;
- RunObject = Page "Cash Receipt Journal";
- ToolTip = 'Open the cash receipt journal to post incoming payments.';
- }
- action("Vendor Pa&yment Journal")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor Pa&yment Journal';
- Image = VendorPaymentJournal;
- RunObject = Page "Payment Journal";
- ToolTip = 'Pay your vendors by filling the payment journal automatically according to payments due, and potentially export all payment to your bank for automatic processing.';
- }
- action("Sales Price &Worksheet")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Price &Worksheet';
- Image = PriceWorksheet;
- RunPageView = where("Object Type" = const(Page), "Object ID" = const(7023)); // "Sales Price Worksheet";
- RunObject = Page "Role Center Page Dispatcher";
- ToolTip = 'Manage sales prices for individual customers, for a group of customers, for all customers, or for a campaign.';
- }
- action("Sales P&rices")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sales P&rices';
- Image = SalesPrices;
- RunPageView = where("Object Type" = const(Page), "Object ID" = const(7002)); // "Sales Prices";
- RunObject = Page "Role Center Page Dispatcher";
- ToolTip = 'View or edit special sales prices that you grant when certain conditions are met, such as customer, quantity, or ending date. The price agreements can be for individual customers, for a group of customers, for all customers or for a campaign.';
- }
- action("Sales &Line Discounts")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sales &Line Discounts';
- Image = SalesLineDisc;
- RunPageView = where("Object Type" = const(Page), "Object ID" = const(7004)); // "Sales Line Discounts";
- RunObject = Page "Role Center Page Dispatcher";
- ToolTip = 'View the sales line discounts that are available. These discount agreements can be for individual customers, for a group of customers, for all customers or for a campaign.';
- }
- separator(Action19)
- {
- }
- action("&Bank Account Reconciliation")
- {
- ApplicationArea = Basic, Suite;
- Caption = '&Bank Account Reconciliation';
- Image = BankAccountRec;
- RunObject = Page "Bank Acc. Reconciliation";
- ToolTip = 'Reconcile entries in your bank account ledger entries with the actual transactions in your bank account, according to the latest bank statement. ';
- }
- action("Import Bank Statement")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Import Bank Statement';
- RunObject = Codeunit "Import Protocol Management";
- ToolTip = 'Prepare to reconcile the bank account by importing an electronic bank statement with the actual bank transactions.';
- }
- action("Payment Registration")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Payment Registration';
- Image = Payment;
- RunObject = Codeunit "Payment Registration Mgt.";
- ToolTip = 'Apply customer payments observed on your bank account to non-posted sales documents to record that payment is made.';
- }
- action("Adjust E&xchange Rates")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Adjust E&xchange Rates';
- Ellipsis = true;
- Image = AdjustExchangeRates;
- RunObject = Codeunit "Exch. Rate Adjmt. Run Handler";
- ToolTip = 'Adjust general ledger, customer, vendor, and bank account entries to reflect a more updated balance if the exchange rate has changed since the entries were posted.';
- }
- action("Adjust &Item Costs/Prices")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Adjust &Item Costs/Prices';
- Image = AdjustItemCost;
- RunObject = Report "Adjust Item Costs/Prices";
- }
- action("Adjust &Cost - Item Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Adjust &Cost - Item Entries';
- Image = AdjustEntries;
- RunObject = Report "Adjust Cost - Item Entries";
- }
- action("Post Inve&ntory Cost to G/L")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Inve&ntory Cost to G/L';
- Ellipsis = true;
- Image = PostInventoryToGL;
- RunObject = Report "Post Inventory Cost to G/L";
- }
- action("Calc. and Post VAT Settlem&ent")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Calc. and Post VAT Settlem&ent';
- Ellipsis = true;
- Image = SettleOpenTransactions;
- RunObject = Report "Calc. and Post VAT Settlement";
- ToolTip = 'Close open VAT entries and transfers purchase and sales VAT amounts to the VAT settlement account. For every VAT posting group, the batch job finds all the VAT entries in the VAT Entry table that are included in the filters in the definition window.';
- }
- action("Elec. Tax Declarations")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Elec. Tax Declarations';
- RunObject = Page "Elec. Tax Declaration List";
- ToolTip = 'View the list of VAT and ICP declarations that you send to the tax authorities.';
- }
- action("Elec. Tax Decl. Response Msgs.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Elec. Tax Decl. Response Msgs.';
- RunObject = Page "Elec. Tax Decl. Response Msgs.";
- ToolTip = 'View all the response messages received from the tax authorities. The status of the response message indicates if the message is processed or not.';
- }
- separator(Action31)
- {
- Caption = 'Administration';
- IsHeader = true;
- }
- action("General Le&dger Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'General Le&dger Setup';
- Image = Setup;
- RunObject = Page "General Ledger Setup";
- ToolTip = 'Define your general accounting policies, such as the allowed posting period and how payments are processed. Set up your default dimensions for financial analysis.';
- }
- action("S&ales && Receivables Setup")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'S&ales && Receivables Setup';
- Image = Setup;
- RunObject = Page "Sales & Receivables Setup";
- ToolTip = 'Define your general policies for sales invoicing and returns, such as when to show credit and stockout warnings and how to post sales discounts. Set up your number series for creating customers and different sales documents.';
- }
- separator(History)
- {
- Caption = 'History';
- IsHeader = true;
- }
- action("Navi&gate")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Find entries...';
- Image = Navigate;
- RunObject = Page Navigate;
- ShortCutKey = 'Ctrl+Alt+Q';
- ToolTip = 'Find entries and documents that exist for the document number and posting date on the selected document. (Formerly this action was named Navigate.)';
- }
- }
- }
-}
diff --git a/src/Layers/NL/BaseApp/Sales/Customer/Customer.Table.al b/src/Layers/NL/BaseApp/Sales/Customer/Customer.Table.al
deleted file mode 100644
index 4618dc1c87..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Customer/Customer.Table.al
+++ /dev/null
@@ -1,5162 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.Customer;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.DirectDebit;
-using Microsoft.Bank.Payment;
-using Microsoft.CRM.BusinessRelation;
-using Microsoft.CRM.Campaign;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Outlook;
-using Microsoft.CRM.Setup;
-using Microsoft.CRM.Team;
-using Microsoft.EServices.OnlineMap;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.Finance.SalesTax;
-using Microsoft.Finance.VAT.Registration;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Calendar;
-using Microsoft.Foundation.Comment;
-using Microsoft.Foundation.Enums;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Foundation.PaymentTerms;
-using Microsoft.Foundation.Period;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Foundation.Shipping;
-using Microsoft.Integration.Dataverse;
-using Microsoft.Integration.Graph;
-using Microsoft.Intercompany.Partner;
-using Microsoft.Inventory.Intrastat;
-using Microsoft.Inventory.Item.Catalog;
-using Microsoft.Inventory.Location;
-using Microsoft.Inventory.Tracking;
-using Microsoft.Pricing.Calculation;
-using Microsoft.Pricing.PriceList;
-using Microsoft.Pricing.Source;
-using Microsoft.Projects.Project.Job;
-using Microsoft.Purchases.Vendor;
-using Microsoft.Sales.Archive;
-using Microsoft.Sales.Document;
-using Microsoft.Sales.FinanceCharge;
-using Microsoft.Sales.History;
-using Microsoft.Sales.Pricing;
-using Microsoft.Sales.Receivables;
-using Microsoft.Sales.Reminder;
-using Microsoft.Sales.Setup;
-using Microsoft.Utilities;
-using System;
-using System.Automation;
-using System.Email;
-using System.Globalization;
-using System.IO;
-using System.Reflection;
-using System.Security.User;
-using System.Utilities;
-
-///
-/// Stores customer master data including contact information, financial settings, and sales preferences.
-///
-table 18 Customer
-{
- Caption = 'Customer';
- DataCaptionFields = "No.", Name;
- DrillDownPageID = "Customer List";
- LookupPageID = "Customer Lookup";
- Permissions = TableData "Cust. Ledger Entry" = r,
- TableData Job = r,
- tabledata "VAT Business Posting Group" = R,
- TableData "VAT Registration Log" = rd,
- tabledata "Payment Terms" = R,
- TableData "Price List Header" = rd,
- TableData "Price List Line" = rd,
- TableData "Sales Price" = rd,
- TableData "Sales Line Discount" = rd,
- TableData "Sales Price Access" = rd,
- TableData "Sales Discount Access" = rd,
- tabledata "Customer Templ." = rm,
- tabledata "General Ledger Setup" = r,
- tabledata "Sales & Receivables Setup" = r,
- tabledata "Marketing Setup" = r,
- tabledata Language = r,
- tabledata "Language Selection" = r;
- DataClassification = CustomerContent;
-
- fields
- {
- ///
- /// Specifies the unique identifier for the customer record.
- ///
- field(1; "No."; Code[20])
- {
- Caption = 'No.';
- OptimizeForTextSearch = true;
- ToolTip = 'Specifies the number of the customer. The field is either filled automatically from a defined number series, or you enter the number manually because you have enabled manual number entry in the number-series setup.';
-
- trigger OnValidate()
- begin
- TestNoSeries();
- if "Invoice Disc. Code" = '' then
- "Invoice Disc. Code" := "No.";
- end;
- }
- ///
- /// Specifies the customer's name as it appears on sales documents and reports.
- ///
- field(2; Name; Text[100])
- {
- Caption = 'Name';
- OptimizeForTextSearch = true;
- ToolTip = 'Specifies the customer''s name that appears on all related documents. For companies, specify the company''s name here, and then add the relevant people as contacts that you link to this customer.';
-
- trigger OnValidate()
- begin
- if ("Search Name" = UpperCase(xRec.Name)) or ("Search Name" = '') then
- "Search Name" := Name;
-
- UpdateCustomerBankAccounts(FieldCaption(Name));
-
- UpdateMyCustomer(FieldNo(Name));
- end;
- }
- ///
- /// Specifies an alternate name used for searching and filtering customers.
- ///
- field(3; "Search Name"; Code[100])
- {
- Caption = 'Search Name';
- OptimizeForTextSearch = true;
- ToolTip = 'Specifies an alternate name that you can use to search for a customer.';
- }
- ///
- /// Specifies additional name information for the customer.
- ///
- field(4; "Name 2"; Text[50])
- {
- Caption = 'Name 2';
- OptimizeForTextSearch = true;
- ToolTip = 'Specifies an additional part of the name.';
- }
- ///
- /// Specifies the customer's street address for correspondence and shipping.
- ///
- field(5; Address; Text[100])
- {
- Caption = 'Address';
- OptimizeForTextSearch = true;
- ToolTip = 'Specifies the customer''s address. This address will appear on all sales documents for the customer.';
-
- trigger OnValidate()
- begin
- UpdateCustomerBankAccounts(FieldCaption(Address));
- end;
- }
- ///
- /// Specifies additional address details such as suite or building information.
- ///
- field(6; "Address 2"; Text[50])
- {
- Caption = 'Address 2';
- OptimizeForTextSearch = true;
- ToolTip = 'Specifies additional address information.';
- }
- ///
- /// Specifies the city where the customer is located.
- ///
- field(7; City; Text[30])
- {
- Caption = 'City';
- OptimizeForTextSearch = true;
- TableRelation = if ("Country/Region Code" = const('')) "Post Code".City
- else
- if ("Country/Region Code" = filter(<> '')) "Post Code".City where("Country/Region Code" = field("Country/Region Code"));
- ValidateTableRelation = false;
- ToolTip = 'Specifies the customer''s city.';
-
- trigger OnLookup()
- begin
- OnBeforeLookupCity(Rec, PostCode);
-
- PostCode.LookupPostCode(City, "Post Code", County, "Country/Region Code");
-
- OnAfterLookupCity(Rec, PostCode);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateCity(Rec, PostCode, CurrFieldNo, IsHandled);
- if not IsHandled then
- PostCode.ValidateCity(City, "Post Code", County, "Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- UpdateCustomerBankAccounts(FieldCaption(City));
-
- AltCustVATRegFacade.CheckCustomerConsistency(Rec);
-
- OnAfterValidateCity(Rec, xRec);
- end;
- }
- ///
- /// Specifies the name of the primary contact person for this customer.
- ///
- field(8; Contact; Text[100])
- {
- Caption = 'Contact';
- OptimizeForTextSearch = true;
- ToolTip = 'Specifies the name of the person you regularly contact when you do business with this customer.';
-
- trigger OnLookup()
- begin
- LookupContactList();
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateContact(IsHandled, Rec);
- if IsHandled then
- exit;
-
- if RMSetup.Get() then
- if RMSetup."Bus. Rel. Code for Customers" <> '' then
- if (xRec.Contact = '') and (xRec."Primary Contact No." = '') and (Contact <> '') then begin
- Modify();
- UpdateContFromCust.OnModify(Rec);
- UpdateContFromCust.InsertNewContactPerson(Rec, false);
- Modify(true);
- end
- end;
- }
- ///
- /// Specifies the customer's primary telephone number.
- ///
- field(9; "Phone No."; Text[30])
- {
- Caption = 'Phone No.';
- OptimizeForTextSearch = true;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the customer''s telephone number.';
-
- trigger OnValidate()
- var
- Char: DotNet Char;
- i: Integer;
- begin
- for i := 1 to StrLen("Phone No.") do
- if Char.IsLetter("Phone No."[i]) then
- FieldError("Phone No.", PhoneNoCannotContainLettersErr);
-
- if (Rec."Phone No." <> xRec."Phone No.") then
- SetForceUpdateContact(true);
-
- UpdateMyCustomer(FieldNo("Phone No."));
- end;
- }
- ///
- /// Specifies the customer's telex number for legacy communication.
- ///
- field(10; "Telex No."; Text[20])
- {
- Caption = 'Telex No.';
- OptimizeForTextSearch = true;
- }
- ///
- /// Specifies the preferred method for sending sales documents to this customer.
- ///
- field(11; "Document Sending Profile"; Code[20])
- {
- Caption = 'Document Sending Profile';
- TableRelation = "Document Sending Profile".Code;
- ToolTip = 'Specifies the preferred method of sending documents to this customer, so that you do not have to select a sending option every time that you post and send a document to the customer. Sales documents to this customer will be sent using the specified sending profile and will override the default document sending profile.';
- }
- ///
- /// Specifies the default ship-to address code for deliveries to this customer.
- ///
- field(12; "Ship-to Code"; Code[10])
- {
- Caption = 'Ship-to Code';
- TableRelation = "Ship-to Address".Code where("Customer No." = field("No."));
- ToolTip = 'Specifies the code for another shipment address than the customer''s own address, which is entered by default.';
- }
- ///
- /// Specifies this company's account number as known by the customer.
- ///
- field(14; "Our Account No."; Text[20])
- {
- Caption = 'Our Account No.';
- MaskType = Concealed;
- OptimizeForTextSearch = true;
- }
- ///
- /// Specifies the sales territory code assigned to this customer.
- ///
- field(15; "Territory Code"; Code[10])
- {
- Caption = 'Territory Code';
- TableRelation = Territory;
- }
- ///
- /// Specifies the first global dimension code assigned to this customer for analysis.
- ///
- field(16; "Global Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,1,1';
- Caption = 'Global Dimension 1 Code';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1),
- Blocked = const(false));
-
- trigger OnValidate()
- begin
- Rec.ValidateShortcutDimCode(1, "Global Dimension 1 Code");
- end;
- }
- ///
- /// Specifies the second global dimension code assigned to this customer for analysis.
- ///
- field(17; "Global Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,1,2';
- Caption = 'Global Dimension 2 Code';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2),
- Blocked = const(false));
-
- trigger OnValidate()
- begin
- Rec.ValidateShortcutDimCode(2, "Global Dimension 2 Code");
- end;
- }
- ///
- /// Specifies the retail chain or franchise this customer belongs to.
- ///
- field(18; "Chain Name"; Code[10])
- {
- Caption = 'Chain Name';
- }
- ///
- /// Specifies the budgeted sales amount for this customer.
- ///
- field(19; "Budgeted Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Budgeted Amount';
- }
- ///
- /// Specifies the maximum credit amount in local currency extended to this customer.
- ///
- field(20; "Credit Limit (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Credit Limit (LCY)';
- Tooltip = 'Specifies the maximum amount of credit that you extend to the customer for their purchases before you issue warnings. The value 0 represents unlimited credit.';
- }
- ///
- /// Specifies the posting group that determines G/L accounts for customer transactions.
- ///
- field(21; "Customer Posting Group"; Code[20])
- {
- Caption = 'Customer Posting Group';
- TableRelation = "Customer Posting Group";
- ToolTip = 'Specifies the customer''s market type to link business transactions to.';
- }
- ///
- /// Specifies the default currency code for transactions with this customer.
- ///
- field(22; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- TableRelation = Currency;
- ToolTip = 'Specifies the default currency for the customer.';
-
- trigger OnValidate()
- begin
- UpdateCurrencyId();
- end;
- }
- ///
- /// Specifies the price group used to determine special sales prices for this customer.
- ///
- field(23; "Customer Price Group"; Code[10])
- {
- Caption = 'Customer Price Group';
- TableRelation = "Customer Price Group";
- ToolTip = 'Specifies the customer price group code, which you can use to set up special sales prices in the Sales Prices window.';
- }
- ///
- /// Specifies the language code used for documents sent to this customer.
- ///
- field(24; "Language Code"; Code[10])
- {
- Caption = 'Language Code';
- TableRelation = Language;
- ToolTip = 'Specifies the language that is used when translating specified text on documents to foreign business partner, such as an item description on an order confirmation.';
-
- trigger OnValidate()
- begin
- UpdateFormatRegion();
- end;
- }
- ///
- /// Specifies the customer's official registration number.
- ///
- field(25; "Registration Number"; Text[50])
- {
- Caption = 'Registration No.';
- OptimizeForTextSearch = true;
- ToolTip = 'Specifies the registration number of the customer. You can enter a maximum of 20 characters, both numbers and letters.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateRegistrationNumber(Rec, IsHandled);
- if IsHandled then
- exit;
- if StrLen("Registration Number") > 20 then
- FieldError("Registration Number", FieldLengthErr);
- end;
- }
- ///
- /// Specifies a statistics group code for categorizing the customer in reports.
- ///
- field(26; "Statistics Group"; Integer)
- {
- Caption = 'Statistics Group';
- ToolTip = 'Specifies the statistics group.';
- }
- ///
- /// Specifies the default payment terms for invoices to this customer.
- ///
- field(27; "Payment Terms Code"; Code[10])
- {
- Caption = 'Payment Terms Code';
- TableRelation = "Payment Terms";
- ToolTip = 'Specifies a code that indicates the payment terms that you require of the customer.';
-
- trigger OnValidate()
- begin
- UpdatePaymentTermsId();
- end;
- }
- ///
- /// Specifies the finance charge terms applied to overdue invoices for this customer.
- ///
- field(28; "Fin. Charge Terms Code"; Code[10])
- {
- Caption = 'Fin. Charge Terms Code';
- TableRelation = "Finance Charge Terms";
- ToolTip = 'Specifies the code for the involved finance charges in case of late payment.';
- }
- ///
- /// Specifies the salesperson responsible for this customer account.
- ///
- field(29; "Salesperson Code"; Code[20])
- {
- Caption = 'Salesperson Code';
- TableRelation = "Salesperson/Purchaser" where(Blocked = const(false));
- ToolTip = 'Specifies a code for the salesperson who normally handles this customer''s account.';
-
- trigger OnValidate()
- begin
- ValidateSalesPersonCode();
- end;
- }
- ///
- /// Specifies the default shipment method for deliveries to this customer.
- ///
- field(30; "Shipment Method Code"; Code[10])
- {
- Caption = 'Shipment Method Code';
- TableRelation = "Shipment Method";
- ToolTip = 'Specifies which shipment method to use when you ship items to the customer.';
-
- trigger OnValidate()
- begin
- UpdateShipmentMethodId();
- end;
- }
- ///
- /// Specifies the default shipping agent for deliveries to this customer.
- ///
- field(31; "Shipping Agent Code"; Code[10])
- {
- AccessByPermission = TableData "Shipping Agent Services" = R;
- Caption = 'Shipping Agent Code';
- TableRelation = "Shipping Agent";
- ToolTip = 'Specifies which shipping company is used when you ship items to the customer.';
-
- trigger OnValidate()
- begin
- if "Shipping Agent Code" <> xRec."Shipping Agent Code" then
- Validate("Shipping Agent Service Code", '');
- end;
- }
- ///
- /// Specifies the place of export for customs documentation purposes.
- ///
- field(32; "Place of Export"; Code[20])
- {
- Caption = 'Place of Export';
- }
- ///
- /// Specifies the code used to calculate invoice discounts for this customer.
- ///
- field(33; "Invoice Disc. Code"; Code[20])
- {
- Caption = 'Invoice Disc. Code';
- TableRelation = Customer;
- ValidateTableRelation = false;
- ToolTip = 'Specifies a code for the invoice discount terms that you have defined for the customer.';
- }
- ///
- /// Specifies the discount group used to determine line discounts for this customer.
- ///
- field(34; "Customer Disc. Group"; Code[20])
- {
- Caption = 'Customer Disc. Group';
- TableRelation = "Customer Discount Group";
- ToolTip = 'Specifies the customer discount group code, which you can use as a criterion to set up special discounts in the Sales Line Discounts window.';
- }
- ///
- /// Specifies the country or region code for the customer's address.
- ///
- field(35; "Country/Region Code"; Code[10])
- {
- Caption = 'Country/Region Code';
- TableRelation = "Country/Region";
- ToolTip = 'Specifies the country/region of the address.';
-
- trigger OnValidate()
- begin
- UpdateCustomerBankAccounts(FieldCaption("Country/Region Code"));
- PostCode.CheckClearPostCodeCityCounty(City, "Post Code", County, "Country/Region Code", xRec."Country/Region Code");
-
- if "Country/Region Code" <> xRec."Country/Region Code" then
- VATRegistrationValidation();
- AltCustVATRegFacade.CheckCustomerConsistency(Rec);
- end;
- }
- ///
- /// Specifies the method used for collecting payments from this customer.
- ///
- field(36; "Collection Method"; Code[20])
- {
- Caption = 'Collection Method';
- }
- ///
- /// Contains the total amount from customer ledger entries within the date filter.
- ///
- field(37; Amount; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Amount';
- }
- ///
- /// Indicates whether comments exist for this customer record.
- ///
- field(38; Comment; Boolean)
- {
- CalcFormula = exist("Comment Line" where("Table Name" = const(Customer),
- "No." = field("No.")));
- Caption = 'Comment';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies whether the customer is blocked for transactions.
- ///
- field(39; Blocked; Enum "Customer Blocked")
- {
- Caption = 'Blocked';
- ToolTip = 'Specifies which transactions with the customer that cannot be processed, for example, because the customer is insolvent.';
-
- trigger OnValidate()
- begin
- if (Blocked <> Blocked::All) and "Privacy Blocked" then
- if GuiAllowed then
- if Confirm(ConfirmBlockedPrivacyBlockedQst) then
- "Privacy Blocked" := false
- else
- Error('')
- else
- Error(CanNotChangeBlockedDueToPrivacyBlockedErr);
- end;
- }
-#if not CLEANSCHEMA30
- field(40; "Invoice Copies"; Integer)
- {
- Caption = 'Invoice Copies';
- ObsoleteReason = 'This field is not used consequently and hence does not work as expected. It should be retired.';
-#if not CLEAN27
- ObsoleteState = Pending;
- ObsoleteTag = '27.0';
-#else
- ObsoleteState = Removed;
- ObsoleteTag = '30.0';
-#endif
- }
-#endif
- ///
- /// Specifies the number of the last printed customer statement.
- ///
- field(41; "Last Statement No."; Integer)
- {
- Caption = 'Last Statement No.';
- ToolTip = 'Specifies the number of the last statement that was printed for this customer.';
- }
- ///
- /// Indicates whether to include this customer when printing statements.
- ///
- field(42; "Print Statements"; Boolean)
- {
- Caption = 'Print Statements';
- ToolTip = 'Specifies whether to include this customer when you print the Statement report.';
- }
- ///
- /// Specifies a different customer to receive invoices for sales to this customer.
- ///
- field(45; "Bill-to Customer No."; Code[20])
- {
- Caption = 'Bill-to Customer No.';
- TableRelation = Customer;
- ToolTip = 'Specifies a different customer who will be invoiced for products that you sell to the customer in the Name field on the customer card.';
- OptimizeForTextSearch = true;
- }
- ///
- /// Specifies the priority level assigned to this customer for order processing.
- ///
- field(46; Priority; Integer)
- {
- Caption = 'Priority';
- ToolTip = 'Specifies a number that corresponds to the priority you give the customer. The higher the number, the higher the priority.';
- }
- ///
- /// Specifies the default payment method for this customer.
- ///
- field(47; "Payment Method Code"; Code[10])
- {
- Caption = 'Payment Method Code';
- TableRelation = "Payment Method";
- ToolTip = 'Specifies how the customer usually submits payment, such as bank transfer or check.';
-
- trigger OnValidate()
- begin
- UpdatePaymentMethodId();
-
- if "Payment Method Code" = '' then
- exit;
-
- UpdateDirectDebitPmtTermsCode();
- end;
- }
- ///
- /// Specifies the regional format used for dates and numbers on documents for this customer.
- ///
- field(48; "Format Region"; Text[80])
- {
- Caption = 'Format Region';
- OptimizeForTextSearch = true;
- TableRelation = "Language Selection"."Language Tag";
- ToolTip = 'Specifies the Format Region to be used on printouts for this customer.';
- }
-#pragma warning disable AA0232
- ///
- /// Contains the date of the first transaction with this customer.
- ///
- field(52; "First Transaction Date"; Date)
- {
- Caption = 'Customer Since';
- ToolTip = 'Specifies the date of the first transaction with the customer.';
- FieldClass = FlowField;
- CalcFormula = min("Cust. Ledger Entry"."Posting Date" where("Customer No." = field("No.")));
- }
-#pragma warning restore AA0232
- ///
- /// Indicates the date and time when this customer record was last modified.
- ///
- field(53; "Last Modified Date Time"; DateTime)
- {
- Caption = 'Last Modified Date Time';
- Editable = false;
- }
- ///
- /// Indicates the date when this customer record was last modified.
- ///
- field(54; "Last Date Modified"; Date)
- {
- Caption = 'Last Date Modified';
- Editable = false;
- ToolTip = 'Specifies when the customer card was last modified.';
- }
- ///
- /// Specifies a date range filter for calculating FlowFields.
- ///
- field(55; "Date Filter"; Date)
- {
- Caption = 'Date Filter';
- FieldClass = FlowFilter;
- }
- ///
- /// Specifies a filter for the first global dimension in FlowField calculations.
- ///
- field(56; "Global Dimension 1 Filter"; Code[20])
- {
- CaptionClass = '1,3,1';
- Caption = 'Global Dimension 1 Filter';
- FieldClass = FlowFilter;
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1));
- }
- ///
- /// Specifies a filter for the second global dimension in FlowField calculations.
- ///
- field(57; "Global Dimension 2 Filter"; Code[20])
- {
- CaptionClass = '1,3,2';
- Caption = 'Global Dimension 2 Filter';
- FieldClass = FlowFilter;
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2));
- }
- ///
- /// Contains the customer's current outstanding balance in the customer's currency.
- ///
- field(58; Balance; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Cust. Ledg. Entry".Amount where("Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Balance';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the customer's current outstanding balance in local currency.
- ///
- field(59; "Balance (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Balance (LCY)';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies the total amount the customer owes you, or you owe them, based on all sales and credits for the customer. A positive amount means they owe you, and a negative amount means you owe them. The amount isn''t necessarily due today though. The customer''s payment terms determine due dates. Select the amount to explore the ledger entries behind it.';
- }
- ///
- /// Contains the net change in the customer's balance within the date filter period.
- ///
- field(60; "Net Change"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Cust. Ledg. Entry".Amount where("Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Net Change';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the net change in the customer's balance in local currency within the date filter period.
- ///
- field(61; "Net Change (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Net Change (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total sales amount in local currency for this customer within the date filter.
- ///
- field(62; "Sales (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Cust. Ledger Entry"."Sales (LCY)" where("Customer No." = field("No."),
- "Global Dimension 1 Code" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Code" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Sales (LCY)';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies the total net amount of sales to the customer in LCY.';
- }
- ///
- /// Contains the total profit in local currency from sales to this customer.
- ///
- field(63; "Profit (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Cust. Ledger Entry"."Profit (LCY)" where("Customer No." = field("No."),
- "Global Dimension 1 Code" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Code" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Profit (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total invoice discounts in local currency given to this customer.
- ///
- field(64; "Inv. Discounts (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Cust. Ledger Entry"."Inv. Discount (LCY)" where("Customer No." = field("No."),
- "Global Dimension 1 Code" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Code" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Inv. Discounts (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total payment discounts in local currency taken by this customer.
- ///
- field(65; "Pmt. Discounts (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = - sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Customer No." = field("No."),
- "Entry Type" = filter("Payment Discount" .. "Payment Discount (VAT Adjustment)"),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Pmt. Discounts (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the overdue balance in the customer's currency that is past due date.
- ///
- field(66; "Balance Due"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Cust. Ledg. Entry".Amount where("Customer No." = field("No."),
- "Initial Entry Due Date" = field(upperlimit("Date Filter")),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Balance Due';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the overdue balance in local currency that the customer has not yet paid.
- ///
- field(67; "Balance Due (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Customer No." = field("No."),
- "Initial Entry Due Date" = field(upperlimit("Date Filter")),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Overdue Balance (LCY)';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies the total amount that''s due from the customer as of today. Consider using reminders to minimize late payments and optimize cashflow.';
- }
- ///
- /// Contains the total payments received from this customer within the date filter.
- ///
- field(69; Payments; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = - sum("Detailed Cust. Ledg. Entry".Amount where("Initial Document Type" = const(Payment),
- "Entry Type" = const("Initial Entry"),
- "Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Payments';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total invoice amounts for this customer within the date filter.
- ///
- field(70; "Invoice Amounts"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Cust. Ledg. Entry".Amount where("Initial Document Type" = const(Invoice),
- "Entry Type" = const("Initial Entry"),
- "Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Invoice Amounts';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total credit memo amount issued to this customer within the date filter.
- ///
- field(71; "Cr. Memo Amounts"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = - sum("Detailed Cust. Ledg. Entry".Amount where("Initial Document Type" = const("Credit Memo"),
- "Entry Type" = const("Initial Entry"),
- "Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Cr. Memo Amounts';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total finance charge memo amount for this customer within the date filter.
- ///
- field(72; "Finance Charge Memo Amounts"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Cust. Ledg. Entry".Amount where("Initial Document Type" = const("Finance Charge Memo"),
- "Entry Type" = const("Initial Entry"),
- "Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Finance Charge Memo Amounts';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total payments in local currency received from this customer.
- ///
- field(74; "Payments (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = - sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Initial Document Type" = const(Payment),
- "Entry Type" = const("Initial Entry"),
- "Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Payments (LCY)';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies the sum of payments received from the customer.';
- }
- ///
- /// Contains the total invoice amounts in local currency for this customer.
- ///
- field(75; "Inv. Amounts (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Initial Document Type" = const(Invoice),
- "Entry Type" = const("Initial Entry"),
- "Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Inv. Amounts (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total credit memo amount in local currency issued to this customer.
- ///
- field(76; "Cr. Memo Amounts (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = - sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Initial Document Type" = const("Credit Memo"),
- "Entry Type" = const("Initial Entry"),
- "Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Cr. Memo Amounts (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total finance charge memo amount in local currency for this customer.
- ///
- field(77; "Fin. Charge Memo Amounts (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Initial Document Type" = const("Finance Charge Memo"),
- "Entry Type" = const("Initial Entry"),
- "Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Fin. Charge Memo Amounts (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total value of outstanding sales orders for this customer.
- ///
- field(78; "Outstanding Orders"; Decimal)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Sales Line"."Outstanding Amount" where("Document Type" = const(Order),
- "Bill-to Customer No." = field("No."),
- "Shortcut Dimension 1 Code" = field("Global Dimension 1 Filter"),
- "Shortcut Dimension 2 Code" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Outstanding Orders';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total value of shipped but not yet invoiced items for this customer.
- ///
- field(79; "Shipped Not Invoiced"; Decimal)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Sales Line"."Shipped Not Invoiced" where("Document Type" = const(Order),
- "Bill-to Customer No." = field("No."),
- "Shortcut Dimension 1 Code" = field("Global Dimension 1 Filter"),
- "Shortcut Dimension 2 Code" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Shipped Not Invoiced';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the method used to apply payments to customer ledger entries.
- ///
- field(80; "Application Method"; Enum "Application Method")
- {
- Caption = 'Application Method';
- ToolTip = 'Specifies how to apply payments to entries for this customer.';
- }
- ///
- /// Indicates whether prices on sales documents include VAT for this customer.
- ///
- field(82; "Prices Including VAT"; Boolean)
- {
- Caption = 'Prices Including VAT';
- ToolTip = 'Specifies if the Unit Price and Line Amount fields on document lines should be shown with or without VAT.';
- }
- ///
- /// Specifies the default warehouse location for shipments to this customer.
- ///
- field(83; "Location Code"; Code[10])
- {
- Caption = 'Location Code';
- TableRelation = Location where("Use As In-Transit" = const(false));
- ToolTip = 'Specifies from which location sales to this customer will be processed by default.';
- }
- ///
- /// Specifies the customer's fax number for document transmission.
- ///
- field(84; "Fax No."; Text[30])
- {
- Caption = 'Fax No.';
- OptimizeForTextSearch = true;
- ToolTip = 'Specifies the customer''s fax number.';
- }
- ///
- /// Specifies the customer's telex answer back code for legacy communication.
- ///
- field(85; "Telex Answer Back"; Text[20])
- {
- Caption = 'Telex Answer Back';
- OptimizeForTextSearch = true;
- }
- ///
- /// Specifies the customer's VAT registration number for tax reporting.
- ///
- field(86; "VAT Registration No."; Text[20])
- {
- Caption = 'VAT Registration No.';
- OptimizeForTextSearch = true;
- ToolTip = 'Specifies the customer''s VAT registration number for customers in EU countries/regions.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateVATRegistrationNo(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- "VAT Registration No." := UpperCase("VAT Registration No.");
- if "VAT Registration No." <> xRec."VAT Registration No." then
- VATRegistrationValidation();
- end;
- }
- ///
- /// Indicates whether multiple shipments can be combined on a single invoice for this customer.
- ///
- field(87; "Combine Shipments"; Boolean)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Combine Sales Shipments';
- ToolTip = 'Specifies if several orders delivered to the customer can appear on the same sales invoice.';
- }
- ///
- /// Specifies the general business posting group for determining G/L accounts.
- ///
- field(88; "Gen. Bus. Posting Group"; Code[20])
- {
- Caption = 'Gen. Bus. Posting Group';
- TableRelation = "Gen. Business Posting Group";
- ToolTip = 'Specifies the customer''s trade type to link transactions made for this customer with the appropriate general ledger account according to the general posting setup.';
-
- trigger OnValidate()
- begin
- if xRec."Gen. Bus. Posting Group" <> "Gen. Bus. Posting Group" then
- if GenBusPostingGrp.ValidateVatBusPostingGroup(GenBusPostingGrp, "Gen. Bus. Posting Group") then
- Validate("VAT Bus. Posting Group", GenBusPostingGrp."Def. VAT Bus. Posting Group");
- end;
- }
- ///
- /// Specifies the customer's Global Location Number for electronic document exchange.
- ///
- field(90; GLN; Code[13])
- {
- Caption = 'GLN';
- Numeric = true;
- ToolTip = 'Specifies the customer in connection with electronic document sending.';
-
- trigger OnValidate()
- var
- GLNCalculator: Codeunit "GLN Calculator";
- begin
- if GLN <> '' then
- GLNCalculator.AssertValidCheckDigit13(GLN);
- end;
- }
- ///
- /// Specifies the postal code for the customer's address.
- ///
- field(91; "Post Code"; Code[20])
- {
- Caption = 'Post Code';
- TableRelation = if ("Country/Region Code" = const('')) "Post Code"
- else
- if ("Country/Region Code" = filter(<> '')) "Post Code" where("Country/Region Code" = field("Country/Region Code"));
- ValidateTableRelation = false;
- ToolTip = 'Specifies the post code.';
-
- trigger OnLookup()
- begin
- OnBeforeLookupPostCode(Rec, PostCode);
-
- PostCode.LookupPostCode(City, "Post Code", County, "Country/Region Code");
-
- OnAfterLookupPostCode(Rec, xRec, PostCode);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePostCode(Rec, PostCode, CurrFieldNo, IsHandled);
- if not IsHandled then
- PostCode.ValidatePostCode(City, "Post Code", County, "Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
-
- UpdateCustomerBankAccounts(FieldCaption("Post Code"));
-
- AltCustVATRegFacade.CheckCustomerConsistency(Rec);
-
- OnAfterValidatePostCode(Rec, xRec);
- end;
- }
- ///
- /// Specifies the state, province, or county for the customer's address.
- ///
- field(92; County; Text[30])
- {
- CaptionClass = '5,1,' + "Country/Region Code";
- Caption = 'County';
- OptimizeForTextSearch = true;
- ToolTip = 'Specifies the state, province or county as a part of the address.';
- }
- ///
- /// Specifies the customer's Economic Operators Registration and Identification number for customs.
- ///
- field(93; "EORI Number"; Text[40])
- {
- Caption = 'EORI Number';
- OptimizeForTextSearch = true;
- ToolTip = 'Specifies the Economic Operators Registration and Identification number that is used when you exchange information with the customs authorities due to trade into or out of the European Union.';
- }
- ///
- /// Indicates whether the GLN is used as party identification in electronic documents.
- ///
- field(95; "Use GLN in Electronic Document"; Boolean)
- {
- Caption = 'Use GLN in Electronic Documents';
- ToolTip = 'Specifies whether the GLN is used in electronic documents as a party identification number.';
- }
- ///
- /// Contains the total debit amount from customer ledger entries within the date filter.
- ///
- field(97; "Debit Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- BlankZero = true;
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Debit Amount" where("Customer No." = field("No."),
- "Entry Type" = filter(<> Application),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Debit Amount';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total credit amount from customer ledger entries within the date filter.
- ///
- field(98; "Credit Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- BlankZero = true;
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Credit Amount" where("Customer No." = field("No."),
- "Entry Type" = filter(<> Application),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Credit Amount';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total debit amount in local currency from customer ledger entries.
- ///
- field(99; "Debit Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- BlankZero = true;
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Debit Amount (LCY)" where("Customer No." = field("No."),
- "Entry Type" = filter(<> Application),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Debit Amount (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total credit amount in local currency from customer ledger entries.
- ///
- field(100; "Credit Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- BlankZero = true;
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Credit Amount (LCY)" where("Customer No." = field("No."),
- "Entry Type" = filter(<> Application),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Credit Amount (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the customer's email address for electronic communication.
- ///
- field(102; "E-Mail"; Text[80])
- {
- Caption = 'Email';
- OptimizeForTextSearch = true;
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the customer''s email address.';
-
- trigger OnValidate()
- begin
- ValidateEmail();
- end;
- }
- ///
- /// Specifies the customer's website URL.
- ///
-#if not CLEAN27
-#pragma warning disable AS0086
-#endif
- field(103; "Home Page"; Text[255])
-#if not CLEAN27
-#pragma warning restore AS0086
-#endif
- {
- Caption = 'Home Page';
- OptimizeForTextSearch = true;
- ExtendedDatatype = URL;
- ToolTip = 'Specifies the customer''s home page address.';
- }
- ///
- /// Specifies the terms used to generate payment reminders for this customer.
- ///
- field(104; "Reminder Terms Code"; Code[10])
- {
- Caption = 'Reminder Terms Code';
- TableRelation = "Reminder Terms";
- ToolTip = 'Specifies how reminders about late payments are handled for this customer.';
-
- }
- ///
- /// Contains the total amount of reminders issued to this customer.
- ///
- field(105; "Reminder Amounts"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Cust. Ledg. Entry".Amount where("Initial Document Type" = const(Reminder),
- "Entry Type" = const("Initial Entry"),
- "Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Reminder Amounts';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total reminder amounts in local currency issued to this customer.
- ///
- field(106; "Reminder Amounts (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Initial Document Type" = const(Reminder),
- "Entry Type" = const("Initial Entry"),
- "Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Reminder Amounts (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the number series used to assign the customer number.
- ///
- field(107; "No. Series"; Code[20])
- {
- Caption = 'No. Series';
- Editable = false;
- TableRelation = "No. Series";
- }
- ///
- /// Specifies the tax area code for calculating sales tax for this customer.
- ///
- field(108; "Tax Area Code"; Code[20])
- {
- Caption = 'Tax Area Code';
- TableRelation = "Tax Area";
- ToolTip = 'Specifies the tax area that is used to calculate and post sales tax.';
-
- trigger OnValidate()
- begin
- UpdateTaxAreaId();
- end;
- }
- ///
- /// Indicates whether sales to this customer are subject to sales tax.
- ///
- field(109; "Tax Liable"; Boolean)
- {
- Caption = 'Tax Liable';
- ToolTip = 'Specifies if the customer or vendor is liable for sales tax.';
- }
- ///
- /// Specifies the VAT business posting group for determining VAT rates.
- ///
- field(110; "VAT Bus. Posting Group"; Code[20])
- {
- Caption = 'VAT Bus. Posting Group';
- TableRelation = "VAT Business Posting Group";
- ToolTip = 'Specifies the customer''s VAT specification to link transactions made for this customer to.';
-
- trigger OnValidate()
- begin
- UpdateTaxAreaId();
- end;
- }
- ///
- /// Specifies a currency filter for calculating FlowFields.
- ///
- field(111; "Currency Filter"; Code[10])
- {
- Caption = 'Currency Filter';
- FieldClass = FlowFilter;
- TableRelation = Currency;
- }
- ///
- /// Contains the total outstanding sales orders in local currency for this customer.
- ///
- field(113; "Outstanding Orders (LCY)"; Decimal)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Sales Line"."Outstanding Amount (LCY)" where("Document Type" = const(Order),
- "Bill-to Customer No." = field("No."),
- "Shortcut Dimension 1 Code" = field("Global Dimension 1 Filter"),
- "Shortcut Dimension 2 Code" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Outstanding Orders (LCY)';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies your expected sales income from the customer in LCY based on ongoing sales orders.';
- }
- ///
- /// Contains the total shipped but not invoiced amount in local currency for this customer.
- ///
- field(114; "Shipped Not Invoiced (LCY)"; Decimal)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Sales Line"."Shipped Not Invoiced (LCY)" where("Document Type" = const(Order),
- "Bill-to Customer No." = field("No."),
- "Shortcut Dimension 1 Code" = field("Global Dimension 1 Filter"),
- "Shortcut Dimension 2 Code" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Shipped Not Invoiced (LCY)';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies your expected sales income from the customer in LCY based on ongoing sales orders where items have been shipped.';
- }
- ///
- /// Specifies the default inventory reservation method for sales to this customer.
- ///
- field(115; Reserve; Enum "Reserve Method")
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Reserve';
- InitValue = Optional;
- ToolTip = 'Specifies whether items will never, automatically (Always), or optionally be reserved for this customer. Optional means that you must manually reserve items for this customer.';
- }
- ///
- /// Indicates whether payment tolerance is blocked for this customer.
- ///
- field(116; "Block Payment Tolerance"; Boolean)
- {
- Caption = 'Block Payment Tolerance';
- ToolTip = 'Specifies that the customer is not allowed a payment tolerance.';
-
- trigger OnValidate()
- begin
- UpdatePaymentTolerance((CurrFieldNo <> 0) and GuiAllowed);
- end;
- }
- ///
- /// Contains the total payment discount tolerance amounts in local currency for this customer.
- ///
- field(117; "Pmt. Disc. Tolerance (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = - sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Customer No." = field("No."),
- "Entry Type" = filter("Payment Discount Tolerance" | "Payment Discount Tolerance (VAT Adjustment)" | "Payment Discount Tolerance (VAT Excl.)"),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Pmt. Disc. Tolerance (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total payment tolerance amounts in local currency for this customer.
- ///
- field(118; "Pmt. Tolerance (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = - sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Customer No." = field("No."),
- "Entry Type" = filter("Payment Tolerance" | "Payment Tolerance (VAT Adjustment)" | "Payment Tolerance (VAT Excl.)"),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Pmt. Tolerance (LCY)';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the intercompany partner code for transactions between related companies.
- ///
- field(119; "IC Partner Code"; Code[20])
- {
- Caption = 'IC Partner Code';
- TableRelation = "IC Partner";
- ToolTip = 'Specifies the customer''s intercompany partner code.';
-
- trigger OnValidate()
- var
- CustLedgEntry: Record "Cust. Ledger Entry";
- AccountingPeriod: Record "Accounting Period";
- ICPartner: Record "IC Partner";
- ConfirmManagement: Codeunit "Confirm Management";
- begin
- if xRec."IC Partner Code" <> "IC Partner Code" then begin
- if not CustLedgEntry.SetCurrentKey("Customer No.", Open) then
- CustLedgEntry.SetCurrentKey("Customer No.");
- CustLedgEntry.SetRange("Customer No.", "No.");
- CustLedgEntry.SetRange(Open, true);
- if CustLedgEntry.FindLast() then
- Error(Text012, FieldCaption("IC Partner Code"), TableCaption);
-
- CustLedgEntry.Reset();
- CustLedgEntry.SetCurrentKey("Customer No.", "Posting Date");
- CustLedgEntry.SetRange("Customer No.", "No.");
- AccountingPeriod.SetRange(Closed, false);
- if AccountingPeriod.FindFirst() then begin
- CustLedgEntry.SetFilter("Posting Date", '>=%1', AccountingPeriod."Starting Date");
- if CustLedgEntry.FindFirst() then
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text011, TableCaption), true) then
- "IC Partner Code" := xRec."IC Partner Code";
- end;
- end;
-
- if "IC Partner Code" <> '' then begin
- ICPartner.Get("IC Partner Code");
- if (ICPartner."Customer No." <> '') and (ICPartner."Customer No." <> "No.") then
- Error(Text010, FieldCaption("IC Partner Code"), "IC Partner Code", TableCaption(), ICPartner."Customer No.");
- ICPartner."Customer No." := "No.";
- ICPartner.Modify();
- end;
-
- if (xRec."IC Partner Code" <> "IC Partner Code") and ICPartner.Get(xRec."IC Partner Code") then begin
- ICPartner."Customer No." := '';
- ICPartner.Modify();
- end;
- end;
- }
- ///
- /// Contains the total refund amounts for this customer within the date filter.
- ///
- field(120; Refunds; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = Rec."Currency Code";
- CalcFormula = sum("Detailed Cust. Ledg. Entry".Amount where("Initial Document Type" = const(Refund),
- "Entry Type" = const("Initial Entry"),
- "Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Refunds';
- FieldClass = FlowField;
- }
- ///
- /// Contains the total refund amounts in local currency for this customer.
- ///
- field(121; "Refunds (LCY)"; Decimal)
- {
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Initial Document Type" = const(Refund),
- "Entry Type" = const("Initial Entry"),
- "Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Refunds (LCY)';
- FieldClass = FlowField;
- ToolTip = 'Specifies the sum of refunds received from the customer.';
- AutoFormatType = 1;
- AutoFormatExpression = '';
- }
- ///
- /// Contains other miscellaneous amounts for this customer within the date filter.
- ///
- field(122; "Other Amounts"; Decimal)
- {
- CalcFormula = sum("Detailed Cust. Ledg. Entry".Amount where("Initial Document Type" = const(" "),
- "Entry Type" = const("Initial Entry"),
- "Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Other Amounts';
- FieldClass = FlowField;
- AutoFormatType = 0;
- }
- ///
- /// Contains other miscellaneous amounts in local currency for this customer.
- ///
- field(123; "Other Amounts (LCY)"; Decimal)
- {
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Initial Document Type" = const(" "),
- "Entry Type" = const("Initial Entry"),
- "Customer No." = field("No."),
- "Initial Entry Global Dim. 1" = field("Global Dimension 1 Filter"),
- "Initial Entry Global Dim. 2" = field("Global Dimension 2 Filter"),
- "Posting Date" = field("Date Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Other Amounts (LCY)';
- FieldClass = FlowField;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- }
- ///
- /// Specifies the default prepayment percentage required for sales orders.
- ///
- field(124; "Prepayment %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Prepayment %';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
- ToolTip = 'Specifies a prepayment percentage that applies to all orders for this customer, regardless of the items or services on the order lines.';
- }
- ///
- /// Contains the total outstanding invoices in local currency for this customer.
- ///
- field(125; "Outstanding Invoices (LCY)"; Decimal)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Sales Line"."Outstanding Amount (LCY)" where("Document Type" = const(Invoice),
- "Bill-to Customer No." = field("No."),
- "Shortcut Dimension 1 Code" = field("Global Dimension 1 Filter"),
- "Shortcut Dimension 2 Code" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Outstanding Invoices (LCY)';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies your expected sales income from the customer in LCY based on unpaid sales invoices.';
- }
- ///
- /// Contains the total outstanding invoices for this customer.
- ///
- field(126; "Outstanding Invoices"; Decimal)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Sales Line"."Outstanding Amount" where("Document Type" = const(Invoice),
- "Bill-to Customer No." = field("No."),
- "Shortcut Dimension 1 Code" = field("Global Dimension 1 Filter"),
- "Shortcut Dimension 2 Code" = field("Global Dimension 2 Filter"),
- "Currency Code" = field("Currency Filter")));
- Caption = 'Outstanding Invoices';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of archived documents where this customer is the bill-to customer.
- ///
- field(130; "Bill-to No. Of Archived Doc."; Integer)
- {
- CalcFormula = count("Sales Header Archive" where("Document Type" = const(Order),
- "Bill-to Customer No." = field("No.")));
- Caption = 'Bill-to No. Of Sales Archived Doc.';
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of archived documents where this customer is the sell-to customer.
- ///
- field(131; "Sell-to No. Of Archived Doc."; Integer)
- {
- CalcFormula = count("Sales Header Archive" where("Document Type" = const(Order),
- "Sell-to Customer No." = field("No.")));
- Caption = 'Sell-to No. Of Sales Archived Doc.';
- FieldClass = FlowField;
- }
- ///
- /// Specifies whether the customer is a person or company for direct debit collections.
- ///
- field(132; "Partner Type"; Enum "Partner Type")
- {
- Caption = 'Partner Type';
- ToolTip = 'Specifies for direct debit collections if the customer that the payment is collected from is a person or a company.';
-
- trigger OnValidate()
- var
- AccountType: Option Customer,Vendor,Employee;
- TransactionMode: Record "Transaction Mode";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePartnerType(IsHandled);
- if IsHandled then
- exit;
-
- if not TransactionMode.CheckTransactionModePartnerType(AccountType::Customer, "Transaction Mode Code", "Partner Type") then
- if not Confirm(PartnerTypeMismatchMsg, false) then
- Error('')
- end;
- }
- ///
- /// Specifies whether the customer is a person or company for Intrastat reporting.
- ///
- field(133; "Intrastat Partner Type"; Enum "Partner Type")
- {
- Caption = 'Intrastat Partner Type';
- ToolTip = 'Specifies for Intrastat reporting if the customer is a person or a company.';
- }
- ///
- /// Indicates whether to exclude this customer from payment practices calculations.
- ///
- field(134; "Exclude from Pmt. Practices"; Boolean)
- {
- Caption = 'Exclude from Payment Practices';
- ToolTip = 'Specifies that the customer must be excluded from Payment Practices calculations.';
- }
- ///
- /// Stores an image such as a logo for the customer.
- ///
- field(140; Image; Media)
- {
- Caption = 'Image';
- ExtendedDatatype = Person;
- ToolTip = 'Specifies the picture of the customer, for example, a logo.';
- }
- ///
- /// Indicates whether access to this customer's data is blocked for privacy protection.
- ///
- field(150; "Privacy Blocked"; Boolean)
- {
- Caption = 'Privacy Blocked';
- ToolTip = 'Specifies whether to limit access to data for the data subject during daily operations. This is useful, for example, when protecting data from changes while it is under privacy review.';
-
- trigger OnValidate()
- begin
- if "Privacy Blocked" then
- Blocked := Blocked::All
- else
- Blocked := Blocked::" ";
- end;
- }
- ///
- /// Indicates whether searching by name is disabled, allowing name changes on open documents.
- ///
- field(160; "Disable Search by Name"; Boolean)
- {
- Caption = 'Disable Search by Name';
- DataClassification = SystemMetadata;
- ToolTip = 'Specifies that you can change the customer name on open sales documents. The change applies only to the documents.';
- }
- ///
- /// Indicates whether multiple posting groups can be used for this customer.
- ///
- field(175; "Allow Multiple Posting Groups"; Boolean)
- {
- Caption = 'Allow Multiple Posting Groups';
- DataClassification = SystemMetadata;
- ToolTip = 'Specifies if multiple posting groups can be used for posting business transactions for this customer.';
- }
- ///
- /// Specifies the customer's preferred bank account for refunds and direct debit collections.
- ///
- field(288; "Preferred Bank Account Code"; Code[20])
- {
- Caption = 'Preferred Bank Account Code';
- TableRelation = "Customer Bank Account".Code where("Customer No." = field("No."));
- ToolTip = 'Specifies the customer''s bank account that will be used by default when you process refunds to the customer and direct debit collections.';
- }
-#if not CLEANSCHEMA26
- ///
- /// Indicates whether this customer is coupled to a Dataverse account. Obsolete field.
- ///
- field(720; "Coupled to CRM"; Boolean)
- {
- Caption = 'Coupled to Dataverse';
- Editable = false;
- ObsoleteReason = 'Replaced by flow field Coupled to Dataverse';
- ObsoleteState = Removed;
- ObsoleteTag = '26.0';
- }
-#endif
- ///
- /// Indicates whether this customer is coupled to a Dataverse account for data synchronization.
- ///
- field(721; "Coupled to Dataverse"; Boolean)
- {
- FieldClass = FlowField;
- Caption = 'Coupled to Dataverse';
- Editable = false;
- CalcFormula = exist("CRM Integration Record" where("Integration ID" = field(SystemId), "Table ID" = const(Database::Customer)));
- ToolTip = 'Specifies that the customer is coupled to an account in Dataverse.';
- }
- ///
- /// Specifies alternative payment terms used for cash flow forecasting.
- ///
- field(840; "Cash Flow Payment Terms Code"; Code[10])
- {
- Caption = 'Cash Flow Payment Terms Code';
- TableRelation = "Payment Terms";
- ToolTip = 'Specifies a payment term that will be used to calculate cash flow for the customer.';
- }
- ///
- /// Specifies the primary contact person linked to this customer.
- ///
- field(5049; "Primary Contact No."; Code[20])
- {
- Caption = 'Primary Contact No.';
- TableRelation = Contact;
- ToolTip = 'Specifies the contact number for the customer.';
-
- trigger OnLookup()
- begin
- LookupContactList();
- end;
-
- trigger OnValidate()
- var
- Cont: Record Contact;
- begin
- Contact := '';
- if "Primary Contact No." <> '' then begin
- Cont.Get("Primary Contact No.");
-
- if Rec."Contact Type" = Rec."Contact Type"::Company then
- CheckCustomerContactRelation(Cont);
-
- if Cont.Type = Cont.Type::Person then begin
- Contact := Cont.Name;
- exit;
- end;
-
- if Cont.Image.HasValue() then
- CopyContactPicture(Cont);
-
- if Cont."Phone No." <> '' then begin
- "Phone No." := Cont."Phone No.";
- UpdateMyCustomer(FieldNo("Phone No."));
- end;
- if Cont."E-Mail" <> '' then
- "E-Mail" := Cont."E-Mail";
- if Cont."Mobile Phone No." <> '' then
- "Mobile Phone No." := Cont."Mobile Phone No.";
-
- end else
- if Image.HasValue() then
- Clear(Image);
- end;
- }
- ///
- /// Specifies whether the customer contact is a person or a company.
- ///
- field(5050; "Contact Type"; Enum "Contact Type")
- {
- Caption = 'Contact Type';
- }
- ///
- /// Specifies the customer's mobile phone number.
- ///
- field(5061; "Mobile Phone No."; Text[30])
- {
- Caption = 'Mobile Phone No.';
- OptimizeForTextSearch = true;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the customer''s mobile telephone number.';
-
- trigger OnValidate()
- var
- Char: DotNet Char;
- i: Integer;
- begin
- for i := 1 to StrLen("Mobile Phone No.") do
- if Char.IsLetter("Mobile Phone No."[i]) then
- FieldError("Mobile Phone No.", PhoneNoCannotContainLettersErr);
- end;
- }
- ///
- /// Specifies the responsibility center that manages this customer account.
- ///
- field(5700; "Responsibility Center"; Code[10])
- {
- Caption = 'Responsibility Center';
- TableRelation = "Responsibility Center";
- ToolTip = 'Specifies the code for the responsibility center that will administer this customer by default.';
- }
- ///
- /// Specifies whether the customer requires complete or allows partial shipment of orders.
- ///
- field(5750; "Shipping Advice"; Enum "Sales Header Shipping Advice")
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Shipping Advice';
- ToolTip = 'Specifies if the customer accepts partial shipment of orders.';
- }
- ///
- /// Specifies the default shipping time from warehouse to customer delivery.
- ///
- field(5790; "Shipping Time"; DateFormula)
- {
- AccessByPermission = TableData "Shipping Agent Services" = R;
- Caption = 'Shipping Time';
- ToolTip = 'Specifies how long it takes from when the items are shipped from the warehouse to when they are delivered.';
- }
- ///
- /// Specifies the default shipping agent service level for deliveries to this customer.
- ///
- field(5792; "Shipping Agent Service Code"; Code[10])
- {
- Caption = 'Shipping Agent Service Code';
- TableRelation = "Shipping Agent Services".Code where("Shipping Agent Code" = field("Shipping Agent Code"));
- ToolTip = 'Specifies the code for the shipping agent service to use for this customer.';
-
- trigger OnValidate()
- begin
- if ("Shipping Agent Code" <> '') and
- ("Shipping Agent Service Code" <> '')
- then
- if ShippingAgentService.Get("Shipping Agent Code", "Shipping Agent Service Code") then
- "Shipping Time" := ShippingAgentService."Shipping Time"
- else
- Evaluate("Shipping Time", '<>');
- end;
- }
- ///
- /// Specifies the method used to calculate sales prices for this customer.
- ///
- field(7000; "Price Calculation Method"; Enum "Price Calculation Method")
- {
- Caption = 'Price Calculation Method';
- ToolTip = 'Specifies the default price calculation method.';
-
- trigger OnValidate()
- var
- PriceCalculationMgt: Codeunit "Price Calculation Mgt.";
- PriceType: Enum "Price Type";
- begin
- if "Price Calculation Method" <> "Price Calculation Method"::" " then
- PriceCalculationMgt.VerifyMethodImplemented("Price Calculation Method", PriceType::Sale);
- end;
- }
- ///
- /// Indicates whether line discounts can be applied to sales for this customer.
- ///
- field(7001; "Allow Line Disc."; Boolean)
- {
- Caption = 'Allow Line Disc.';
- InitValue = true;
- ToolTip = 'Specifies if a sales line discount is calculated when a special sales price is offered according to setup in the Sales Prices window.';
- }
- ///
- /// Contains the count of open sales quotes for this customer.
- ///
- field(7171; "No. of Quotes"; Integer)
- {
- CalcFormula = count("Sales Header" where("Document Type" = const(Quote),
- "Sell-to Customer No." = field("No.")));
- Caption = 'No. of Quotes';
- ToolTip = 'Specifies the number of sales quotes that have been registered for the customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of open blanket orders for this customer.
- ///
- field(7172; "No. of Blanket Orders"; Integer)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- CalcFormula = count("Sales Header" where("Document Type" = const("Blanket Order"),
- "Sell-to Customer No." = field("No.")));
- Caption = 'No. of Blanket Orders';
- ToolTip = 'Specifies the number of sales blanket orders that have been registered for the customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of open sales orders for this customer.
- ///
- field(7173; "No. of Orders"; Integer)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- CalcFormula = count("Sales Header" where("Document Type" = const(Order),
- "Sell-to Customer No." = field("No.")));
- Caption = 'No. of Orders';
- ToolTip = 'Specifies the number of sales orders that have been registered for the customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of open sales invoices for this customer.
- ///
- field(7174; "No. of Invoices"; Integer)
- {
- CalcFormula = count("Sales Header" where("Document Type" = const(Invoice),
- "Sell-to Customer No." = field("No.")));
- Caption = 'No. of Invoices';
- ToolTip = 'Specifies the number of unposted sales invoices that have been registered for the customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of open sales return orders for this customer.
- ///
- field(7175; "No. of Return Orders"; Integer)
- {
- AccessByPermission = TableData "Return Receipt Header" = R;
- CalcFormula = count("Sales Header" where("Document Type" = const("Return Order"),
- "Sell-to Customer No." = field("No.")));
- Caption = 'No. of Return Orders';
- ToolTip = 'Specifies the number of sales return orders that have been registered for the customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of open sales credit memos for this customer.
- ///
- field(7176; "No. of Credit Memos"; Integer)
- {
- CalcFormula = count("Sales Header" where("Document Type" = const("Credit Memo"),
- "Sell-to Customer No." = field("No.")));
- Caption = 'No. of Credit Memos';
- ToolTip = 'Specifies the number of unposted sales credit memos that have been registered for the customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of posted sales shipments for this customer.
- ///
- field(7177; "No. of Pstd. Shipments"; Integer)
- {
- CalcFormula = count("Sales Shipment Header" where("Sell-to Customer No." = field("No.")));
- Caption = 'No. of Pstd. Shipments';
- ToolTip = 'Specifies the number of posted sales shipments that have been registered for the customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of posted sales invoices for this customer.
- ///
- field(7178; "No. of Pstd. Invoices"; Integer)
- {
- CalcFormula = count("Sales Invoice Header" where("Sell-to Customer No." = field("No.")));
- Caption = 'No. of Pstd. Invoices';
- ToolTip = 'Specifies the number of posted sales invoices that have been registered for the customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of posted return receipts for this customer.
- ///
- field(7179; "No. of Pstd. Return Receipts"; Integer)
- {
- CalcFormula = count("Return Receipt Header" where("Sell-to Customer No." = field("No.")));
- Caption = 'No. of Pstd. Return Receipts';
- ToolTip = 'Specifies the number of posted sales return receipts that have been registered for the customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of posted sales credit memos for this customer.
- ///
- field(7180; "No. of Pstd. Credit Memos"; Integer)
- {
- CalcFormula = count("Sales Cr.Memo Header" where("Sell-to Customer No." = field("No.")));
- Caption = 'No. of Pstd. Credit Memos';
- ToolTip = 'Specifies the number of posted sales credit memos that have been registered for the customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of ship-to addresses defined for this customer.
- ///
- field(7181; "No. of Ship-to Addresses"; Integer)
- {
- CalcFormula = count("Ship-to Address" where("Customer No." = field("No.")));
- Caption = 'No. of Ship-to Addresses';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of quotes where this customer is the bill-to customer.
- ///
- field(7182; "Bill-To No. of Quotes"; Integer)
- {
- CalcFormula = count("Sales Header" where("Document Type" = const(Quote),
- "Bill-to Customer No." = field("No.")));
- Caption = 'Bill-To No. of Quotes';
- ToolTip = 'Specifies how many quotes have been registered for the customer when the customer acts as the bill-to customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of blanket orders where this customer is the bill-to customer.
- ///
- field(7183; "Bill-To No. of Blanket Orders"; Integer)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- CalcFormula = count("Sales Header" where("Document Type" = const("Blanket Order"),
- "Bill-to Customer No." = field("No.")));
- Caption = 'Bill-To No. of Blanket Orders';
- ToolTip = 'Specifies how many blanket orders have been registered for the customer when the customer acts as the bill-to customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of orders where this customer is the bill-to customer.
- ///
- field(7184; "Bill-To No. of Orders"; Integer)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- CalcFormula = count("Sales Header" where("Document Type" = const(Order),
- "Bill-to Customer No." = field("No.")));
- Caption = 'Bill-To No. of Orders';
- ToolTip = 'Specifies how many sales orders have been registered for the customer when the customer acts as the bill-to customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of invoices where this customer is the bill-to customer.
- ///
- field(7185; "Bill-To No. of Invoices"; Integer)
- {
- CalcFormula = count("Sales Header" where("Document Type" = const(Invoice),
- "Bill-to Customer No." = field("No.")));
- Caption = 'Bill-To No. of Invoices';
- ToolTip = 'Specifies how many invoices have been registered for the customer when the customer acts as the bill-to customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of return orders where this customer is the bill-to customer.
- ///
- field(7186; "Bill-To No. of Return Orders"; Integer)
- {
- AccessByPermission = TableData "Return Receipt Header" = R;
- CalcFormula = count("Sales Header" where("Document Type" = const("Return Order"),
- "Bill-to Customer No." = field("No.")));
- Caption = 'Bill-To No. of Return Orders';
- ToolTip = 'Specifies how many return orders have been registered for the customer when the customer acts as the bill-to customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of credit memos where this customer is the bill-to customer.
- ///
- field(7187; "Bill-To No. of Credit Memos"; Integer)
- {
- CalcFormula = count("Sales Header" where("Document Type" = const("Credit Memo"),
- "Bill-to Customer No." = field("No.")));
- Caption = 'Bill-To No. of Credit Memos';
- ToolTip = 'Specifies how many credit memos have been registered for the customer when the customer acts as the bill-to customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of posted shipments where this customer is the bill-to customer.
- ///
- field(7188; "Bill-To No. of Pstd. Shipments"; Integer)
- {
- CalcFormula = count("Sales Shipment Header" where("Bill-to Customer No." = field("No.")));
- Caption = 'Bill-To No. of Pstd. Shipments';
- ToolTip = 'Specifies how many posted shipments have been registered for the customer when the customer acts as the bill-to customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of posted invoices where this customer is the bill-to customer.
- ///
- field(7189; "Bill-To No. of Pstd. Invoices"; Integer)
- {
- CalcFormula = count("Sales Invoice Header" where("Bill-to Customer No." = field("No.")));
- Caption = 'Bill-To No. of Pstd. Invoices';
- ToolTip = 'Specifies how many posted invoices have been registered for the customer when the customer acts as the bill-to customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of posted return receipts where this customer is the bill-to customer.
- ///
- field(7190; "Bill-To No. of Pstd. Return R."; Integer)
- {
- CalcFormula = count("Return Receipt Header" where("Bill-to Customer No." = field("No.")));
- Caption = 'Bill-To No. of Pstd. Return R.';
- ToolTip = 'Specifies how many posted return receipts have been registered for the customer when the customer acts as the bill-to customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the count of posted credit memos where this customer is the bill-to customer.
- ///
- field(7191; "Bill-To No. of Pstd. Cr. Memos"; Integer)
- {
- CalcFormula = count("Sales Cr.Memo Header" where("Bill-to Customer No." = field("No.")));
- Caption = 'Bill-To No. of Pstd. Cr. Memos';
- ToolTip = 'Specifies how many posted credit memos have been registered for the customer when the customer acts as the bill-to customer.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the base calendar used for calculating working days and delivery dates.
- ///
- field(7600; "Base Calendar Code"; Code[10])
- {
- Caption = 'Base Calendar Code';
- TableRelation = "Base Calendar";
- ToolTip = 'Specifies a customizable calendar for shipment planning that holds the customer''s working days and holidays.';
- }
- ///
- /// Specifies whether to copy the sell-to address from the company or person contact on quotes.
- ///
- field(7601; "Copy Sell-to Addr. to Qte From"; Enum "Contact Type")
- {
- AccessByPermission = TableData Contact = R;
- Caption = 'Copy Sell-to Addr. to Qte From';
- ToolTip = 'Specifies which customer address is inserted on sales quotes that you create for the customer.';
- }
- ///
- /// Indicates whether to validate the EU VAT registration number for this customer.
- ///
- field(7602; "Validate EU Vat Reg. No."; Boolean)
- {
- Caption = 'Validate EU VAT Reg. No.';
- }
- ///
- /// Specifies the GUID of the currency for API integration.
- ///
- field(8001; "Currency Id"; Guid)
- {
- Caption = 'Currency Id';
- TableRelation = Currency.SystemId;
-
- trigger OnValidate()
- begin
- UpdateCurrencyCode();
- end;
- }
- ///
- /// Specifies the GUID of the payment terms for API integration.
- ///
- field(8002; "Payment Terms Id"; Guid)
- {
- Caption = 'Payment Terms Id';
- TableRelation = "Payment Terms".SystemId;
-
- trigger OnValidate()
- begin
- UpdatePaymentTermsCode();
- end;
- }
- ///
- /// Specifies the GUID of the shipment method for API integration.
- ///
- field(8003; "Shipment Method Id"; Guid)
- {
- Caption = 'Shipment Method Id';
- TableRelation = "Shipment Method".SystemId;
-
- trigger OnValidate()
- begin
- UpdateShipmentMethodCode();
- end;
- }
- ///
- /// Specifies the GUID of the payment method for API integration.
- ///
- field(8004; "Payment Method Id"; Guid)
- {
- Caption = 'Payment Method Id';
- TableRelation = "Payment Method".SystemId;
-
- trigger OnValidate()
- begin
- UpdatePaymentMethodCode();
- end;
- }
- ///
- /// Specifies the GUID of the tax area for API integration.
- ///
- field(9003; "Tax Area ID"; Guid)
- {
- Caption = 'Tax Area ID';
-
- trigger OnValidate()
- begin
- UpdateTaxAreaCode();
- end;
- }
- ///
- /// Specifies the GUID of the contact for API integration.
- ///
- field(9005; "Contact ID"; Guid)
- {
- Caption = 'Contact ID';
- }
- ///
- /// Specifies the Microsoft Graph identifier for the contact.
- ///
- field(9006; "Contact Graph Id"; Text[250])
- {
- Caption = 'Contact Graph Id';
- OptimizeForTextSearch = true;
- }
- field(11000000; "Transaction Mode Code"; Code[20])
- {
- Caption = 'Transaction Mode Code';
- TableRelation = "Transaction Mode".Code where("Account Type" = const(Customer));
-
- trigger OnValidate()
- var
- TrMode: Record "Transaction Mode";
- begin
- if "Transaction Mode Code" <> '' then begin
- TrMode.Get(TrMode."Account Type"::Customer, "Transaction Mode Code");
- if TrMode."Payment Method Code" <> '' then
- "Payment Method Code" := TrMode."Payment Method Code";
- if TrMode."Payment Terms Code" <> '' then
- "Payment Terms Code" := TrMode."Payment Terms Code";
- end;
- end;
- }
- }
-
- keys
- {
- key(Key1; "No.")
- {
- Clustered = true;
- }
- key(Key2; "Search Name")
- {
- }
- key(Key3; "Customer Posting Group")
- {
- }
- key(Key4; "Currency Code")
- {
- }
- key(Key5; "Country/Region Code")
- {
- }
- key(Key6; "Gen. Bus. Posting Group")
- {
- }
- key(Key7; Name, Address, City)
- {
- }
- key(Key8; "VAT Registration No.")
- {
- }
- key(Key9; Name)
- {
- }
- key(Key10; City)
- {
- }
- key(Key11; "Post Code")
- {
- }
- key(Key12; "Phone No.")
- {
- }
- key(Key13; Contact)
- {
- }
- key(Key14; Blocked)
- {
- }
- key(Key15; "Primary Contact No.")
- {
- }
- key(Key16; "Salesperson Code")
- {
- }
- key(Key17; SystemModifiedAt)
- {
- }
- key(Key20; "Partner Type", "Country/Region Code")
- {
- }
- key(Key22; "IC Partner Code")
- {
- }
- }
-
- fieldgroups
- {
- fieldgroup(DropDown; "No.", Name, Address, City, "Post Code", "Phone No.", Contact, "E-Mail", "Bill-to Customer No.", "Registration Number", "VAT Registration No.")
- {
- }
- fieldgroup(Brick; "No.", Name, "Balance (LCY)", Contact, "Balance Due (LCY)", Image)
- {
- }
- }
-
- trigger OnDelete()
- var
- Job: Record Job;
- VATRegistrationLogMgt: Codeunit "VAT Registration Log Mgt.";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeOnDelete(Rec, IsHandled);
- if IsHandled then
- exit;
-
- ApprovalsMgmt.OnCancelCustomerApprovalRequest(Rec);
-
- Job.SetRange("Bill-to Customer No.", "No.");
- if not Job.IsEmpty() then
- Error(Text015, TableCaption(), "No.", Job.TableCaption());
-
- MoveEntries.MoveCustEntries(Rec);
-
- DeleteRelatedData();
-
- UpdateContFromCust.OnDelete(Rec);
-
- VATRegistrationLogMgt.DeleteCustomerLog(Rec);
-
- DimMgt.DeleteDefaultDim(DATABASE::Customer, "No.");
- DeleteDimValuePerAccount();
-
- CalendarManagement.DeleteCustomizedBaseCalendarData(CustomizedCalendarChange."Source Type"::Customer, "No.");
- end;
-
- trigger OnInsert()
- var
- Customer: Record Customer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInsert(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "No." = '' then begin
- SalesSetup.Get();
- SalesSetup.TestField("Customer Nos.");
- "No. Series" := SalesSetup."Customer Nos.";
- if NoSeries.AreRelated("No. Series", xRec."No. Series") then
- "No. Series" := xRec."No. Series";
- "No." := NoSeries.GetNextNo("No. Series");
- Customer.ReadIsolation(IsolationLevel::ReadUncommitted);
- Customer.SetLoadFields("No.");
- while Customer.Get("No.") do
- "No." := NoSeries.GetNextNo("No. Series");
- end;
-
- if "Invoice Disc. Code" = '' then
- "Invoice Disc. Code" := "No.";
-
- if (not (InsertFromContact or (InsertFromTemplate and (Contact <> '')) or IsTemporary)) or ForceUpdateContact then
- UpdateContFromCust.OnInsert(Rec);
-
- if "Salesperson Code" = '' then
- SetDefaultSalesperson();
-
- DimMgt.UpdateDefaultDim(
- DATABASE::Customer, "No.",
- "Global Dimension 1 Code", "Global Dimension 2 Code");
-
- UpdateReferencedIds();
- SetLastModifiedDateTime();
-
- OnAfterOnInsert(Rec, xRec);
- end;
-
- trigger OnModify()
- var
- AccountType: Option Customer,Vendor,Employee;
- TransactionMode: Record "Transaction Mode";
- begin
- UpdateReferencedIds();
- SetLastModifiedDateTime();
- if IsContactUpdateNeeded() then begin
- if not TransactionMode.CheckTransactionModePartnerType(AccountType::Customer, "Transaction Mode Code", "Partner Type") then
- Error(PartnerTypeMismatchErr);
- Modify();
- UpdateContFromCust.OnModify(Rec);
- if not Find() then begin
- Reset();
- if Find() then;
- end;
- end;
- end;
-
- trigger OnRename()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeOnRename(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- ApprovalsMgmt.OnRenameRecordInApprovalRequest(xRec.RecordId, RecordId);
- DimMgt.RenameDefaultDim(DATABASE::Customer, xRec."No.", "No.");
- CommentLine.RenameCommentLine(CommentLine."Table Name"::Customer, xRec."No.", "No.");
-
- SetLastModifiedDateTime();
- if xRec."Invoice Disc. Code" = xRec."No." then
- "Invoice Disc. Code" := "No.";
- UpdateCustomerTemplateInvoiceDiscCodes();
-
- CalendarManagement.RenameCustomizedBaseCalendarData(CustomizedCalendarChange."Source Type"::Customer, "No.", xRec."No.");
- end;
-
- var
- SalesSetup: Record "Sales & Receivables Setup";
- CommentLine: Record "Comment Line";
- SalesOrderLine: Record "Sales Line";
- CustBankAcc: Record "Customer Bank Account";
- ShipToAddr: Record "Ship-to Address";
- PostCode: Record "Post Code";
- GenBusPostingGrp: Record "Gen. Business Posting Group";
- ShippingAgentService: Record "Shipping Agent Services";
- RMSetup: Record "Marketing Setup";
- SalesPrepmtPct: Record "Sales Prepayment %";
- SalespersonPurchaser: Record "Salesperson/Purchaser";
- CustomizedCalendarChange: Record "Customized Calendar Change";
- PaymentToleranceMgt: Codeunit "Payment Tolerance Management";
- NoSeries: Codeunit "No. Series";
- MoveEntries: Codeunit MoveEntries;
- UpdateContFromCust: Codeunit "CustCont-Update";
- DimMgt: Codeunit DimensionManagement;
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- CalendarManagement: Codeunit "Calendar Management";
- AltCustVATRegFacade: Codeunit "Alt. Cust. VAT. Reg. Facade";
- InsertFromContact: Boolean;
- InsertFromTemplate: Boolean;
- LookupRequested: Boolean;
- ForceUpdateContact: Boolean;
-
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text000: Label 'You cannot delete %1 %2 because there is at least one outstanding Sales %3 for this customer.';
- Text002: Label 'Do you wish to create a contact for %1 %2?';
- Text003: Label 'Contact %1 %2 is not related to customer %3 %4.';
-#pragma warning restore AA0470
- Text004: Label 'post';
- Text005: Label 'create';
-#pragma warning disable AA0470
- Text006: Label 'You cannot %1 this type of document when Customer %2 is blocked with type %3';
- Text010: Label 'The %1 %2 has been assigned to %3 %4.\The same %1 cannot be entered on more than one %3. Enter another code.';
- Text011: Label 'Reconciling IC transactions may be difficult if you change IC Partner Code because this %1 has ledger entries in a fiscal year that has not yet been closed.\ Do you still want to change the IC Partner Code?';
- Text012: Label 'You cannot change the contents of the %1 field because this %2 has one or more open ledger entries.';
- Text015: Label 'You cannot delete %1 %2 because there is at least one %3 associated to this customer.';
- Text11000000: Label 'Do you want to update the bank accounts for this customer to reflect the new value of %1?';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- AllowPaymentToleranceQst: Label 'Do you want to allow payment tolerance for entries that are currently open?';
- RemovePaymentRoleranceQst: Label 'Do you want to remove payment tolerance from entries that are currently open?';
- PartnerTypeMismatchMsg: Label 'The Partner Type does not match the Partner Type defined in Transaction Mode. Do you still want to change the Partner Type?';
- PartnerTypeMismatchErr: Label 'The Partner Type does not match the Partner Type defined in Transaction Mode.';
- CreateNewCustTxt: Label 'Create a new customer card for %1', Comment = '%1 is the name to be used to create the customer. ';
- SelectCustErr: Label 'You must select an existing customer.';
- CustNotRegisteredTxt: Label 'This customer is not registered. To continue, choose one of the following options:';
- SelectCustTxt: Label 'Select an existing customer';
- OverrideImageQst: Label 'Override Image?';
- PrivacyBlockedActionErr: Label 'You cannot %1 this type of document when Customer %2 is blocked for privacy.', Comment = '%1 = action (create or post), %2 = customer code.';
- PrivacyBlockedGenericTxt: Label 'Privacy Blocked must not be true for customer %1.', Comment = '%1 = customer code';
- ConfirmBlockedPrivacyBlockedQst: Label 'If you change the Blocked field, the Privacy Blocked field is changed to No. Do you want to continue?';
- CanNotChangeBlockedDueToPrivacyBlockedErr: Label 'The Blocked field cannot be changed because the user is blocked for privacy reasons.';
- PhoneNoCannotContainLettersErr: Label 'must not contain letters';
- FieldLengthErr: Label 'must not have the length more than 20 symbols';
-
- ///
- /// Assists the user in selecting or generating a new customer number from the configured number series.
- ///
- /// The customer record containing the current number series to look up related series.
- /// True if a new customer number was selected; otherwise, false.
- procedure AssistEdit(OldCust: Record Customer): Boolean
- var
- Cust: Record Customer;
- begin
- Cust := Rec;
- SalesSetup.Get();
- SalesSetup.TestField("Customer Nos.");
- if NoSeries.LookupRelatedNoSeries(SalesSetup."Customer Nos.", OldCust."No. Series", Cust."No. Series") then begin
- Cust."No." := NoSeries.GetNextNo(Cust."No. Series");
- Rec := Cust;
- OnAssistEditOnBeforeExit(Cust);
- exit(true);
- end;
- end;
-
- local procedure DeleteRelatedData()
- var
- CampaignTargetGr: Record "Campaign Target Group";
- ContactBusRel: Record "Contact Business Relation";
- CustomReportSelection: Record "Custom Report Selection";
- ItemReference: Record "Item Reference";
- MyCustomer: Record "My Customer";
- StdCustSalesCode: Record "Standard Customer Sales Code";
- CampaignTargetGrMgmt: Codeunit "Campaign Target Group Mgt";
- begin
- CommentLine.SetRange("Table Name", CommentLine."Table Name"::Customer);
- CommentLine.SetRange("No.", "No.");
- CommentLine.DeleteAll();
-
- CustBankAcc.SetRange("Customer No.", "No.");
- CustBankAcc.DeleteAll();
-
- ShipToAddr.SetRange("Customer No.", "No.");
- ShipToAddr.DeleteAll();
-
- SalesPrepmtPct.SetCurrentKey("Sales Type", "Sales Code");
- SalesPrepmtPct.SetRange("Sales Type", SalesPrepmtPct."Sales Type"::Customer);
- SalesPrepmtPct.SetRange("Sales Code", "No.");
- SalesPrepmtPct.DeleteAll();
-
- StdCustSalesCode.SetRange("Customer No.", "No.");
- StdCustSalesCode.DeleteAll(true);
-
- CheckIfSalesOrderLinesExist();
-
- CampaignTargetGr.SetRange("No.", "No.");
- CampaignTargetGr.SetRange(Type, CampaignTargetGr.Type::Customer);
- if CampaignTargetGr.Find('-') then begin
- ContactBusRel.SetRange("Link to Table", ContactBusRel."Link to Table"::Customer);
- ContactBusRel.SetRange("No.", "No.");
- ContactBusRel.FindFirst();
- repeat
- CampaignTargetGrMgmt.ConverttoContact(Rec, ContactBusRel."Contact No.");
- until CampaignTargetGr.Next() = 0;
- end;
-
- ItemReference.SetCurrentKey("Reference Type", "Reference Type No.");
- ItemReference.SetRange("Reference Type", ItemReference."Reference Type"::Customer);
- ItemReference.SetRange("Reference Type No.", Rec."No.");
- ItemReference.DeleteAll();
-
- CustomReportSelection.SetRange("Source Type", DATABASE::Customer);
- CustomReportSelection.SetRange("Source No.", "No.");
- CustomReportSelection.DeleteAll();
-
- MyCustomer.SetRange("Customer No.", "No.");
- MyCustomer.DeleteAll();
-
- OnAfterDeleteRelatedData(Rec);
- end;
-
- ///
- /// Validates and saves the specified shortcut dimension code for the customer.
- ///
- /// The dimension field number (1 or 2 for global dimensions).
- /// The dimension value code to validate and assign.
- procedure ValidateShortcutDimCode(FieldNumber: Integer; var ShortcutDimCode: Code[20])
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShortcutDimCode(Rec, xRec, FieldNumber, ShortcutDimCode, IsHandled);
- if IsHandled then
- exit;
-
- DimMgt.ValidateDimValueCode(FieldNumber, ShortcutDimCode);
- if not IsTemporary then begin
- DimMgt.SaveDefaultDim(DATABASE::Customer, "No.", FieldNumber, ShortcutDimCode);
- Modify();
- end;
-
- OnAfterValidateShortcutDimCode(Rec, xRec, FieldNumber, ShortcutDimCode);
- end;
-
- ///
- /// Opens the contact card or contact list for the customer's associated contact.
- ///
- procedure ShowContact()
- var
- ContBusRel: Record "Contact Business Relation";
- Cont: Record Contact;
- OfficeContact: Record Contact;
- OfficeMgt: Codeunit "Office Management";
- ConfirmManagement: Codeunit "Confirm Management";
- ContactPageID: Integer;
- begin
- OnBeforeShowContact(Rec, ContBusRel);
- if OfficeMgt.GetContact(OfficeContact, "No.") and (OfficeContact.Count = 1) then begin
- ContactPageID := PAGE::"Contact Card";
- OnShowContactOnBeforeOpenContactCard(OfficeContact, ContactPageID);
- PAGE.Run(ContactPageID, OfficeContact);
- end else begin
- if "No." = '' then
- exit;
-
- ContBusRel.SetCurrentKey("Link to Table", "No.");
- ContBusRel.SetRange("Link to Table", ContBusRel."Link to Table"::Customer);
- ContBusRel.SetRange("No.", "No.");
- if not ContBusRel.FindFirst() then begin
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text002, TableCaption(), "No."), true) then
- exit;
- UpdateContFromCust.InsertNewContact(Rec, false);
- ContBusRel.FindFirst();
- end;
- Commit();
-
- Cont.FilterGroup(2);
- Cont.SetRange("Company No.", ContBusRel."Contact No.");
- if Cont.IsEmpty() then begin
- Cont.SetRange("Company No.");
- Cont.SetRange("No.", ContBusRel."Contact No.");
- end;
- ContactPageID := PAGE::"Contact List";
- OnShowContactOnBeforeOpenContactList(Cont, ContactPageID);
- PAGE.Run(ContactPageID, Cont);
- end;
- end;
-
- ///
- /// Opens a lookup page for selecting a contact associated with the customer.
- ///
- procedure LookupContactList()
- var
- ContactBusinessRelation: Record "Contact Business Relation";
- ContactForLookup: Record Contact;
- TempCustomer: Record Customer temporary;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupContactList(Rec, IsHandled, CurrFieldNo);
- if IsHandled then
- exit;
-
- ContactForLookup.FilterGroup(2);
- if ContactBusinessRelation.FindByRelation(ContactBusinessRelation."Link to Table"::Customer, "No.") then begin
- if ContactForLookup.Get(ContactBusinessRelation."Contact No.") and (ContactForLookup.Type = ContactForLookup.Type::Person) then begin
- ContactForLookup.SetRange(Type, ContactForLookup.Type::Person);
- ContactForLookup.SetRange("No.", ContactBusinessRelation."Contact No.");
- end else
- ContactForLookup.SetRange("Company No.", ContactBusinessRelation."Contact No.")
- end else
- ContactForLookup.SetRange("Company No.", '');
-
- if "Primary Contact No." <> '' then
- if ContactForLookup.Get("Primary Contact No.") then;
- if Page.RunModal(0, ContactForLookup) = Action::LookupOK then begin
- TempCustomer.Copy(Rec);
- Find();
- TransferFields(TempCustomer, false);
- Validate("Primary Contact No.", ContactForLookup."No.");
- end;
- end;
-
- ///
- /// Sets whether the customer is being inserted from a contact record.
- ///
- /// True if the customer is being created from a contact; otherwise, false.
- procedure SetInsertFromContact(FromContact: Boolean)
- begin
- InsertFromContact := FromContact;
- end;
-
- ///
- /// Checks if the customer is blocked for the specified document type and raises an error if blocked.
- ///
- /// The customer record to check for blocked status.
- /// The type of sales document being processed.
- /// Indicates whether the operation involves a shipment.
- /// Indicates whether this is a posting transaction.
- procedure CheckBlockedCustOnDocs(Cust2: Record Customer; DocType: Enum "Sales Document Type"; Shipment: Boolean; Transaction: Boolean)
- var
- Source: Option Journal,Document;
- begin
- if IsOnBeforeCheckBlockedCustHandled(Cust2, Source::Document, DocType, Shipment, Transaction) then
- exit;
-
- if Cust2."Privacy Blocked" then
- Cust2.CustPrivacyBlockedErrorMessage(Cust2, Transaction);
-
- if ((Cust2.Blocked = Cust2.Blocked::All) or
- ((Cust2.Blocked = Cust2.Blocked::Invoice) and
- (DocType in [DocType::Quote, DocType::Order, DocType::Invoice, DocType::"Blanket Order"])) or
- ((Cust2.Blocked = Cust2.Blocked::Ship) and (DocType in [DocType::Quote, DocType::Order, DocType::"Blanket Order"]) and
- (not Transaction)) or
- ((Cust2.Blocked = Cust2.Blocked::Ship) and (DocType in [DocType::Quote, DocType::Order, DocType::Invoice, DocType::"Blanket Order"]) and
- Shipment and Transaction))
- then
- Cust2.CustBlockedErrorMessage(Cust2, Transaction);
- end;
-
- ///
- /// Checks if the customer is blocked for the specified journal document type and raises an error if blocked.
- ///
- /// The customer record to check for blocked status.
- /// The type of general journal document being processed.
- /// Indicates whether this is a posting transaction.
- procedure CheckBlockedCustOnJnls(Cust2: Record Customer; DocType: Enum "Gen. Journal Document Type"; Transaction: Boolean)
- var
- Source: Option Journal,Document;
- begin
- if IsOnBeforeCheckBlockedCustHandled(Cust2, Source::Journal, DocType, false, Transaction) then
- exit;
-
- if Cust2."Privacy Blocked" then
- Cust2.CustPrivacyBlockedErrorMessage(Cust2, Transaction);
-
- if (Cust2.Blocked = Cust2.Blocked::All) or
- ((Cust2.Blocked = Cust2.Blocked::Invoice) and (DocType in [DocType::Invoice, DocType::" "]))
- then
- Cust2.CustBlockedErrorMessage(Cust2, Transaction)
- end;
-
- ///
- /// Checks if the customer is blocked for the specified general journal line and raises an error if blocked.
- ///
- /// The customer record to check for blocked status.
- /// The general journal line being validated.
- /// Indicates whether this is a posting transaction.
- procedure CheckBlockedCustOnJnls(Cust2: Record Customer; var GenJnlLine: Record "Gen. Journal Line"; Transaction: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckBlockedCustOnJnls(Cust2, GenJnlLine, Transaction, IsHandled);
- if IsHandled then
- exit;
-
- CheckBlockedCustOnJnls(Cust2, GenJnlLine."Document Type", Transaction);
- end;
-
- ///
- /// Raises an error message indicating that the customer is blocked.
- ///
- /// The blocked customer record.
- /// Indicates whether this is a posting transaction to determine the error message.
- procedure CustBlockedErrorMessage(Cust2: Record Customer; Transaction: Boolean)
- var
- "Action": Text[30];
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCustBlockedErrorMessage(Cust2, Transaction, IsHandled);
- if IsHandled then
- exit;
-
- if Transaction then
- Action := Text004
- else
- Action := Text005;
- Error(
- ErrorInfo.Create(
- StrSubstNo(
- Text006, Action, Cust2."No.", Cust2.Blocked),
- true,
- Cust2,
- Cust2.FieldNo(Blocked)));
- end;
-
- ///
- /// Raises an error message indicating that the customer is blocked for privacy reasons.
- ///
- /// The privacy-blocked customer record.
- /// Indicates whether this is a posting transaction to determine the error message.
- procedure CustPrivacyBlockedErrorMessage(Cust2: Record Customer; Transaction: Boolean)
- var
- "Action": Text[30];
- begin
- if Transaction then
- Action := Text004
- else
- Action := Text005;
-
- Error(
- ErrorInfo.Create(
- StrSubstNo(
- PrivacyBlockedActionErr, Action, Cust2."No."),
- true,
- Cust2));
- end;
-
- ///
- /// Gets a generic error text for a privacy-blocked customer.
- ///
- /// The privacy-blocked customer record.
- /// The error text indicating the customer is blocked for privacy.
- procedure GetPrivacyBlockedGenericErrorText(Cust2: Record Customer): Text[250]
- begin
- exit(StrSubstNo(PrivacyBlockedGenericTxt, Cust2."No."));
- end;
-
- ///
- /// Displays the customer's address on an online map service.
- ///
- procedure DisplayMap()
- var
- OnlineMapManagement: Codeunit "Online Map Management";
- begin
- OnlineMapManagement.MakeSelectionIfMapEnabled(Database::Customer, GetPosition());
- end;
-
- ///
- /// Gets the price calculation method for the customer, considering customer price group and sales setup defaults.
- ///
- /// The applicable price calculation method.
- procedure GetPriceCalculationMethod() Method: Enum "Price Calculation Method";
- begin
- if "Price Calculation Method" <> Method::" " then
- Method := "Price Calculation Method"
- else begin
- Method := GetCustomerPriceGroupPriceCalcMethod();
- if Method = Method::" " then begin
- SalesSetup.Get();
- Method := SalesSetup."Price Calculation Method";
- end;
- end;
- end;
-
- ///
- /// Gets the primary contact for the specified customer.
- ///
- /// The customer number to find the primary contact for.
- /// Returns the primary contact record if found.
- procedure GetPrimaryContact(CustomerNo: Code[20]; var PrimaryContact: Record Contact)
- var
- Customer: Record Customer;
- begin
- Clear(PrimaryContact);
- if Customer.Get(CustomerNo) then
- if not PrimaryContact.Get(Customer."Primary Contact No.") then
- GetContact(CustomerNo, PrimaryContact);
- end;
-
- local procedure GetContact(CustomerNo: Code[20]; var PrimaryContact: Record Contact)
- var
- ContactBusinessRelation: Record "Contact Business Relation";
- begin
- ContactBusinessRelation.SetCurrentKey("Link to Table", "No.");
- ContactBusinessRelation.SetRange("Link to Table", ContactBusinessRelation."Link to Table"::Customer);
- ContactBusinessRelation.SetRange("No.", CustomerNo);
- if ContactBusinessRelation.FindSet() then
- repeat
- if PrimaryContact.Get(ContactBusinessRelation."Contact No.") then
- exit;
- until ContactBusinessRelation.Next() = 0;
- end;
-
- local procedure GetCustomerPriceGroupPriceCalcMethod(): Enum "Price Calculation Method";
- var
- CustomerPriceGroup: Record "Customer Price Group";
- begin
- if "Customer Price Group" <> '' then
- if CustomerPriceGroup.Get("Customer Price Group") then
- exit(CustomerPriceGroup."Price Calculation Method");
- end;
-
- ///
- /// Calculates the total amount in local currency including balance, outstanding orders, shipped not invoiced, and outstanding invoices.
- ///
- /// The total amount in local currency.
- procedure GetTotalAmountLCY() TotalAmountLCY: Decimal
- var
- xSecurityFilter: SecurityFilter;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetTotalAmountLCY(Rec, TotalAmountLCY, IsHandled);
- if IsHandled then
- exit(TotalAmountLCY);
-
- xSecurityFilter := SecurityFiltering;
- SecurityFiltering(SecurityFiltering::Ignored);
- CalcFields("Balance (LCY)", "Outstanding Orders (LCY)", "Shipped Not Invoiced (LCY)", "Outstanding Invoices (LCY)");
- OnGetTotalAmountLCYOnAfterCalcFields(Rec);
- if SecurityFiltering <> xSecurityFilter then
- SecurityFiltering(xSecurityFilter);
-
- exit(GetTotalAmountLCYCommon());
- end;
-
- ///
- /// Calculates the total amount in local currency for UI display purposes using auto-calculated fields.
- ///
- /// The total amount in local currency.
- procedure GetTotalAmountLCYUI(): Decimal
- begin
- OnBeforeGetTotalAmountLCYUI(Rec);
-
- SetAutoCalcFields("Balance (LCY)", "Outstanding Orders (LCY)", "Shipped Not Invoiced (LCY)", "Outstanding Invoices (LCY)");
- OnGetTotalAmountLCYUIOnAfterSetAutoCalcFields(Rec);
-
- exit(GetTotalAmountLCYCommon());
- end;
-
- local procedure GetTotalAmountLCYCommon(): Decimal
- var
- [SecurityFiltering(SecurityFilter::Filtered)]
- SalesLine: Record "Sales Line";
- SalesInvoiceOutstandingAmountLCYForInvoicingShippedOrders: Decimal;
- InvoicedPrepmtAmountLCY: Decimal;
- RetRcdNotInvAmountLCY: Decimal;
- AdditionalAmountLCY: Decimal;
- IsHandled: Boolean;
- TotalAmountLCY: Decimal;
- begin
- IsHandled := false;
- OnBeforeGetTotalAmountLCYCommon(Rec, AdditionalAmountLCY, IsHandled);
- if IsHandled then
- exit(AdditionalAmountLCY);
-
- // Sum up "Outstanding Amount (LCY)" of sales invoices for invoicing shipped orders. This amount is already included in "Shipped Not Invoiced (LCY)", and should be subtracted from outstanding invoices.
- SalesInvoiceOutstandingAmountLCYForInvoicingShippedOrders := SalesLine.OutstandingInvoiceAmountFromShipment("No.");
-
- InvoicedPrepmtAmountLCY := GetInvoicedPrepmtAmountLCY();
- RetRcdNotInvAmountLCY := GetReturnRcdNotInvAmountLCY();
-
- TotalAmountLCY :=
- "Balance (LCY)"
- + "Outstanding Orders (LCY)"
- + "Shipped Not Invoiced (LCY)"
- + "Outstanding Invoices (LCY)" - SalesInvoiceOutstandingAmountLCYForInvoicingShippedOrders
- - InvoicedPrepmtAmountLCY
- - RetRcdNotInvAmountLCY
- + AdditionalAmountLCY;
-
- OnAfterGetTotalAmountLCYCommon(Rec, TotalAmountLCY);
- exit(TotalAmountLCY);
- end;
-
- ///
- /// Gets the total sales in local currency for the current fiscal year.
- ///
- /// The total sales amount in local currency for the fiscal year.
- procedure GetSalesLCY() SalesLCY: Decimal
- var
- CustomerSalesYTD: Record Customer;
- DateFilterCalc: Codeunit "DateFilter-Calc";
- CustDateFilter: Text[30];
- CustDateName: Text[30];
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetSalesLCY(Rec, CustomerSalesYTD, SalesLCY, IsHandled);
- if IsHandled then
- exit(SalesLCY);
-
- DateFilterCalc.CreateFiscalYearFilter(CustDateFilter, CustDateName, WorkDate(), 0);
- CustomerSalesYTD := Rec;
- CustomerSalesYTD."SecurityFiltering"("SecurityFiltering");
- CustomerSalesYTD.SetFilter("Date Filter", CustDateFilter);
- CustomerSalesYTD.CalcFields("Sales (LCY)");
- exit(CustomerSalesYTD."Sales (LCY)");
- end;
-
- ///
- /// Gets the document type filter for the top customer headline query.
- ///
- /// The document type filter text.
- procedure GetTopCustomerHeadlineQueryDocumentTypeFilter() DocumentTypeFilter: Text
- begin
- DocumentTypeFilter := '';
-
- OnAfterGetTopCustomerHeadlineQueryDocumentTypeFilter(DocumentTypeFilter);
- end;
-
- ///
- /// Calculates the available credit for the customer based on their credit limit and total outstanding amount.
- ///
- /// The available credit amount in local currency.
- procedure CalcAvailableCredit(): Decimal
- begin
- exit(CalcAvailableCreditCommon(false));
- end;
-
- ///
- /// Calculates the available credit for UI display using auto-calculated fields.
- ///
- /// The available credit amount in local currency.
- procedure CalcAvailableCreditUI(): Decimal
- begin
- exit(CalcAvailableCreditCommon(true));
- end;
-
- local procedure CalcAvailableCreditCommon(CalledFromUI: Boolean) Result: Decimal
- var
- CreditLimitLCY: Decimal;
- IsHandled: Boolean;
- begin
- CreditLimitLCY := "Credit Limit (LCY)";
- IsHandled := false;
- OnBeforeCalcAvailableCreditCommon(Rec, CalledFromUI, CreditLimitLCY, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if CreditLimitLCY = 0 then
- exit(0);
- if CalledFromUI then
- exit(CreditLimitLCY - GetTotalAmountLCYUI());
- exit(CreditLimitLCY - GetTotalAmountLCY());
- end;
-
- ///
- /// Calculates the total overdue balance in local currency for the customer.
- ///
- /// The overdue balance amount in local currency.
- procedure CalcOverdueBalance() OverDueBalance: Decimal
- var
- [SecurityFiltering(SecurityFilter::Filtered)]
- CustLedgEntryRemainAmtQuery: Query "Cust. Ledg. Entry Remain. Amt.";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCalcOverdueBalance(Rec, OverDueBalance, IsHandled);
- if IsHandled then
- exit(OverDueBalance);
-
- CustLedgEntryRemainAmtQuery.SetRange(Customer_No, "No.");
- CustLedgEntryRemainAmtQuery.SetFilter(Due_Date, '<%1', Today);
- CustLedgEntryRemainAmtQuery.SetFilter(Date_Filter, '..%1', Today);
- CustLedgEntryRemainAmtQuery.Open();
-
- if CustLedgEntryRemainAmtQuery.Read() then
- OverDueBalance := CustLedgEntryRemainAmtQuery.Sum_Remaining_Amt_LCY;
- end;
-
- local procedure UpdateCustomerBankAccounts(UseFieldCaption: Text[250])
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateCustomerBankAccounts(Rec, IsHandled);
- if (not GuiAllowed) or IsHandled then
- exit;
- CustBankAcc.SetRange("Customer No.", "No.");
- if CustBankAcc.Find('-') then begin
- if not Confirm(StrSubstNo(Text11000000, UseFieldCaption)) then
- exit;
- repeat
- CustBankAcc."Account Holder Name" := Name;
- CustBankAcc."Account Holder Address" := Address;
- CustBankAcc."Account Holder Post Code" := "Post Code";
- CustBankAcc."Account Holder City" := City;
- CustBankAcc."Acc. Hold. Country/Region Code" := "Country/Region Code";
- CustBankAcc.Modify();
- until CustBankAcc.Next() = 0;
- Modify();
- end;
- end;
-
- ///
- /// Gets the legal entity type as text from the Partner Type field.
- ///
- /// The partner type as formatted text.
- procedure GetLegalEntityType(): Text
- begin
- exit(Format("Partner Type"));
- end;
-
- ///
- /// Gets the label for the legal entity type field.
- ///
- /// The field caption for Partner Type.
- procedure GetLegalEntityTypeLbl(): Text
- begin
- exit(FieldCaption("Partner Type"));
- end;
-
- ///
- /// Determines the display style for the customer based on available credit.
- ///
- /// Unfavorable if credit is exceeded; otherwise, empty string.
- procedure SetStyle(): Text
- begin
- if CalcAvailableCredit() < 0 then
- exit('Unfavorable');
- exit('');
- end;
-
- ///
- /// Checks if the customer has a valid SEPA direct debit mandate for the specified date.
- ///
- /// The date to check for a valid mandate.
- /// True if a valid direct debit mandate exists; otherwise, false.
- procedure HasValidDDMandate(Date: Date): Boolean
- var
- SEPADirectDebitMandate: Record "SEPA Direct Debit Mandate";
- begin
- exit(SEPADirectDebitMandate.GetDefaultMandate("No.", Date) <> '');
- end;
-
- ///
- /// Gets the total return received not invoiced amount in local currency for the customer.
- ///
- /// The return received not invoiced amount in local currency.
- procedure GetReturnRcdNotInvAmountLCY(): Decimal
- var
- [SecurityFiltering(SecurityFilter::Ignored)]
- SalesLine: Record "Sales Line";
- begin
- SalesLine.ReadIsolation := IsolationLevel::ReadUncommitted;
- SalesLine.SetCurrentKey("Document Type", "Bill-to Customer No.");
- SalesLine.SetRange("Document Type", SalesLine."Document Type"::"Return Order");
- SalesLine.SetRange("Bill-to Customer No.", "No.");
- SalesLine.CalcSums("Return Rcd. Not Invd. (LCY)");
- exit(SalesLine."Return Rcd. Not Invd. (LCY)");
- end;
-
- ///
- /// Gets the total invoiced prepayment amount in local currency for the customer.
- ///
- /// The invoiced prepayment amount in local currency.
- procedure GetInvoicedPrepmtAmountLCY() InvoicedPrepmtAmountLCY: Decimal
- var
- [SecurityFiltering(SecurityFilter::Ignored)]
- SalesLine: Record "Sales Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetInvoicedPrepmtAmountLCY(Rec, InvoicedPrepmtAmountLCY, IsHandled);
- if IsHandled then
- exit(InvoicedPrepmtAmountLCY);
-
- SalesLine.ReadIsolation := IsolationLevel::ReadUncommitted;
- SalesLine.SetCurrentKey("Document Type", "Bill-to Customer No.");
- SalesLine.SetRange("Document Type", SalesLine."Document Type"::Order);
- SalesLine.SetRange("Bill-to Customer No.", "No.");
- SalesLine.CalcSums("Prepmt. Amount Inv. (LCY)", "Prepmt. VAT Amount Inv. (LCY)");
- exit(SalesLine."Prepmt. Amount Inv. (LCY)" + SalesLine."Prepmt. VAT Amount Inv. (LCY)");
- end;
-
- ///
- /// Calculates the percentage of the credit limit that has been used.
- ///
- /// The credit limit usage percentage multiplied by 100 (0-10000).
- procedure CalcCreditLimitLCYExpendedPct(): Decimal
- begin
- if "Credit Limit (LCY)" = 0 then
- exit(0);
-
- if "Balance (LCY)" / "Credit Limit (LCY)" < 0 then
- exit(0);
-
- if "Balance (LCY)" / "Credit Limit (LCY)" > 1 then
- exit(10000);
-
- exit(Round("Balance (LCY)" / "Credit Limit (LCY)" * 10000, 1));
- end;
-
- ///
- /// Creates a new sales invoice for the customer and opens the Sales Invoice page.
- ///
- procedure CreateAndShowNewInvoice()
- var
- SalesHeader: Record "Sales Header";
- begin
- SalesHeader."Document Type" := SalesHeader."Document Type"::Invoice;
- SalesHeader.SetRange("Sell-to Customer No.", "No.");
- SalesHeader.SetDefaultPaymentServices();
- SalesHeader.Insert(true);
- Commit();
- PAGE.Run(PAGE::"Sales Invoice", SalesHeader)
- end;
-
- ///
- /// Creates a new sales order for the customer and opens the Sales Order page.
- ///
- procedure CreateAndShowNewOrder()
- var
- SalesHeader: Record "Sales Header";
- begin
- SalesHeader."Document Type" := SalesHeader."Document Type"::Order;
- SalesHeader.SetRange("Sell-to Customer No.", "No.");
- SalesHeader.SetDefaultPaymentServices();
- SalesHeader.Insert(true);
- Commit();
- PAGE.Run(PAGE::"Sales Order", SalesHeader)
- end;
-
- ///
- /// Creates a new sales credit memo for the customer and opens the Sales Credit Memo page.
- ///
- procedure CreateAndShowNewCreditMemo()
- var
- SalesHeader: Record "Sales Header";
- begin
- SalesHeader."Document Type" := SalesHeader."Document Type"::"Credit Memo";
- SalesHeader.SetRange("Sell-to Customer No.", "No.");
- SalesHeader.Insert(true);
- Commit();
- PAGE.Run(PAGE::"Sales Credit Memo", SalesHeader)
- end;
-
- ///
- /// Creates a new sales quote for the customer and opens the Sales Quote page.
- ///
- procedure CreateAndShowNewQuote()
- var
- SalesHeader: Record "Sales Header";
- begin
- SalesHeader."Document Type" := SalesHeader."Document Type"::Quote;
- SalesHeader.SetRange("Sell-to Customer No.", "No.");
- SalesHeader.Insert(true);
- Commit();
- PAGE.Run(PAGE::"Sales Quote", SalesHeader)
- end;
-
- local procedure UpdatePaymentTolerance(UseDialog: Boolean)
- begin
- if "Block Payment Tolerance" then begin
- if UseDialog then
- if not Confirm(RemovePaymentRoleranceQst, false) then
- exit;
- PaymentToleranceMgt.DelTolCustLedgEntry(Rec);
- end else begin
- if UseDialog then
- if not Confirm(AllowPaymentToleranceQst, false) then
- exit;
- PaymentToleranceMgt.CalcTolCustLedgEntry(Rec);
- end;
- end;
-
- ///
- /// Gets the bill-to customer number, returning the current customer number if no bill-to is specified.
- ///
- /// The bill-to customer number or the customer number if not specified.
- procedure GetBillToCustomerNo(): Code[20]
- begin
- if "Bill-to Customer No." <> '' then
- exit("Bill-to Customer No.");
- exit("No.");
- end;
-
- ///
- /// Checks if the customer has address fields populated, excluding the country/region code.
- ///
- /// True if any address field (except country/region) has a value; otherwise, false.
- procedure HasAddressIgnoreCountryCode() Result: Boolean
- begin
- Result := (Address <> '') or
- ("Address 2" <> '') or
- (City <> '') or
- (County <> '') or
- ("Post Code" <> '') or
- (Contact <> '');
- OnAfterHasAddressIgnoreCountryCode(Rec, Result);
- end;
-
- ///
- /// Checks if the customer has any address fields populated, including country/region code.
- ///
- /// True if any address field has a value; otherwise, false.
- procedure HasAddress(): Boolean
- begin
- exit(HasAddressIgnoreCountryCode() or ("Country/Region Code" <> ''));
- end;
-
- ///
- /// Compares the customer's address with another customer's address.
- ///
- /// The customer record to compare addresses with.
- /// True if any address field differs; otherwise, false.
- procedure HasDifferentAddress(OtherCustomer: Record Customer) Result: Boolean
- begin
- Result := (Address <> OtherCustomer.Address) or
- ("Address 2" <> OtherCustomer."Address 2") or
- (City <> OtherCustomer.City) or
- (County <> OtherCustomer.County) or
- ("Post Code" <> OtherCustomer."Post Code") or
- ("Country/Region Code" <> OtherCustomer."Country/Region Code");
- OnAfterHasDifferentAddress(Rec, OtherCustomer, Result)
- end;
-
- ///
- /// Gets the balance in local currency from the linked vendor account.
- ///
- /// Returns the linked vendor number.
- /// The vendor balance in local currency.
- procedure GetBalanceAsVendor(var LinkedVendorNo: Code[20]) BalanceAsVendor: Decimal;
- var
- Vendor: Record Vendor;
- begin
- BalanceAsVendor := 0;
- LinkedVendorNo := GetLinkedVendor();
- if Vendor.Get(LinkedVendorNo) then begin
- OnGetBalanceAsVendorOnBeforeCalcBalance(Vendor);
- Vendor.CalcFields("Balance (LCY)");
- BalanceAsVendor := Vendor."Balance (LCY)";
- end;
- end;
-
- ///
- /// Gets the vendor number linked to this customer through the contact business relation.
- ///
- /// The linked vendor number or empty if no link exists.
- procedure GetLinkedVendor(): Code[20];
- var
- ContBusRel: Record "Contact Business Relation";
- begin
- exit(
- ContBusRel.GetLinkedTables(
- Enum::"Contact Business Relation Link To Table"::Customer, "No.",
- Enum::"Contact Business Relation Link To Table"::Vendor))
- end;
-
- ///
- /// Finds a customer number by text, showing card options if no exact match is found.
- ///
- /// The text to search for (customer number or name).
- /// The found or selected customer number.
- procedure GetCustNo(CustomerText: Text): Text
- begin
- exit(GetCustNoOpenCard(CustomerText, true, true));
- end;
-
- ///
- /// Finds a customer number by text with options for displaying customer card and creation options.
- ///
- /// The text to search for (customer number or name).
- /// Indicates whether to show the customer card if a selection is needed.
- /// Indicates whether to show the option to create a new customer.
- /// The found, selected, or created customer number.
- procedure GetCustNoOpenCard(CustomerText: Text; ShowCustomerCard: Boolean; ShowCreateCustomerOption: Boolean): Code[20]
- var
- Customer: Record Customer;
- CustomerNo: Code[20];
- NoFiltersApplied: Boolean;
- CustomerWithoutQuote: Text;
- CustomerFilterFromStart: Text;
- CustomerFilterContains: Text;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetCustNoOpenCard(CustomerText, ShowCustomerCard, ShowCreateCustomerOption, CustomerNo, IsHandled);
- if IsHandled then
- exit(CustomerNo);
-
- if CustomerText = '' then
- exit('');
-
- if StrLen(CustomerText) <= MaxStrLen(Customer."No.") then
- if Customer.Get(CopyStr(CustomerText, 1, MaxStrLen(Customer."No."))) then
- exit(Customer."No.");
-
- OnGetCustNoOpenCardOnBeforeFilterCustomer(Customer);
- Customer.SetRange(Blocked, Customer.Blocked::" ");
- Customer.SetRange(Name, CustomerText);
- IsHandled := false;
- OnGetCustNoOpenCardOnBeforeCustomerFindFirst(Customer, IsHandled);
- if not IsHandled then
- if Customer.FindFirst() then
- exit(Customer."No.");
-
- Customer.SetCurrentKey(Name);
-
- CustomerWithoutQuote := ConvertStr(CustomerText, '''', '?');
- Customer.SetFilter(Name, '''@' + CustomerWithoutQuote + '''');
- OnGetCustNoOpenCardOnBeforeCustomerFindSet(Customer);
- if Customer.FindFirst() then
- exit(Customer."No.");
- Customer.SetRange(Name);
-
- CustomerFilterFromStart := '''@' + CustomerWithoutQuote + '*''';
-
- Customer.FilterGroup := -1;
- Customer.SetFilter("No.", CustomerFilterFromStart);
-
- Customer.SetFilter(Name, CustomerFilterFromStart);
- OnGetCustNoOpenCardOnAfterOnAfterCustomerFilterFromStart(Customer);
-
- if Customer.FindFirst() then
- if Customer.Count() = 1 then
- exit(Customer."No.");
-
- CustomerFilterContains := '''@*' + CustomerWithoutQuote + '*''';
-
- Customer.SetFilter("No.", CustomerFilterContains);
- Customer.SetFilter(Name, CustomerFilterContains);
- Customer.SetFilter(City, CustomerFilterContains);
- Customer.SetFilter(Contact, CustomerFilterContains);
- Customer.SetFilter("Phone No.", CustomerFilterContains);
- Customer.SetFilter("Post Code", CustomerFilterContains);
- OnGetCustNoOpenCardOnAfterSetCustomerFilters(Customer, CustomerFilterContains);
-
- if Customer.Count() = 0 then
- MarkCustomersWithSimilarName(Customer, CustomerText);
-
- if Customer.Count() = 1 then begin
- Customer.FindFirst();
- exit(Customer."No.");
- end;
-
- if not GuiAllowed() then
- Error(SelectCustErr);
-
- OnGetCustNoOpenCardOnAfterMarkCustomersWithSimilarName(Customer);
-
- if Customer.Count = 0 then begin
- if Customer.WritePermission then
- if ShowCreateCustomerOption then
- case StrMenu(
- StrSubstNo(
- '%1,%2', StrSubstNo(CreateNewCustTxt, ConvertStr(CustomerText, ',', '.')), SelectCustTxt), 1, CustNotRegisteredTxt) of
- 0:
- Error(SelectCustErr);
- 1:
- exit(CreateNewCustomer(CopyStr(CustomerText, 1, MaxStrLen(Customer.Name)), ShowCustomerCard));
- end
- else
- exit('');
- Customer.Reset();
- NoFiltersApplied := true;
- end;
-
- if ShowCustomerCard then
- CustomerNo := PickCustomer(Customer, NoFiltersApplied)
- else begin
- LookupRequested := true;
- exit('');
- end;
-
- if CustomerNo <> '' then
- exit(CustomerNo);
-
- Error(SelectCustErr);
- end;
-
- local procedure MarkCustomersWithSimilarName(var Customer: Record Customer; CustomerText: Text)
- var
- TypeHelper: Codeunit "Type Helper";
- CustomerCount: Integer;
- CustomerTextLength: Integer;
- Treshold: Integer;
- begin
- if CustomerText = '' then
- exit;
- if StrLen(CustomerText) > MaxStrLen(Customer.Name) then
- exit;
- CustomerTextLength := StrLen(CustomerText);
- Treshold := CustomerTextLength div 5;
- if Treshold = 0 then
- exit;
-
- Customer.Reset();
- Customer.Ascending(false); // most likely to search for newest customers
- OnMarkCustomersWithSimilarNameOnBeforeCustomerFindSet(Customer);
- if Customer.FindSet() then
- repeat
- CustomerCount += 1;
- if Abs(CustomerTextLength - StrLen(Customer.Name)) <= Treshold then
- if TypeHelper.TextDistance(UpperCase(CustomerText), UpperCase(Customer.Name)) <= Treshold then
- Customer.Mark(true);
- until Customer.Mark() or (Customer.Next() = 0) or (CustomerCount > 1000);
- Customer.MarkedOnly(true);
- end;
-
- ///
- /// Creates a new customer with the specified name, optionally from a template, and displays the customer card.
- ///
- /// The name for the new customer.
- /// Indicates whether to open the customer card after creation.
- /// The new customer number.
- procedure CreateNewCustomer(CustomerName: Text[100]; ShowCustomerCard: Boolean) NewCustomerCode: Code[20]
- var
- Customer: Record Customer;
- xRecCustomer: Record Customer;
- CustomerTemplMgt: Codeunit "Customer Templ. Mgt.";
- WorkflowEventHandling: Codeunit "Workflow Event Handling";
- CustomerCard: Page "Customer Card";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateNewCustomer(CustomerName, ShowCustomerCard, NewCustomerCode, IsHandled);
- if IsHandled then
- exit(NewCustomerCode);
-
- Customer.Name := CustomerName;
- if not CustomerTemplMgt.InsertCustomerFromTemplate(Customer) then
- Customer.Insert(true)
- else
- if CustomerName <> Customer.Name then begin
- Customer.Name := CustomerName;
- Customer.Modify(true);
- end;
-
- WorkflowEventHandling.RunWorkflowOnCustomerChanged(Customer, xRecCustomer, false);
-
- Commit();
- if not ShowCustomerCard then
- exit(Customer."No.");
- Customer.SetRange("No.", Customer."No.");
- CustomerCard.SetTableView(Customer);
- if not (CustomerCard.RunModal() = ACTION::OK) then
- Error(SelectCustErr);
-
- exit(Customer."No.");
- end;
-
- local procedure PickCustomer(var Customer: Record Customer; NoFiltersApplied: Boolean): Code[20]
- var
- CustomerList: Page "Customer List";
- begin
- if not NoFiltersApplied then
- MarkCustomersByFilters(Customer);
-
- CustomerList.SetTableView(Customer);
- CustomerList.SetRecord(Customer);
- CustomerList.LookupMode := true;
- if CustomerList.RunModal() = ACTION::LookupOK then
- CustomerList.GetRecord(Customer)
- else
- Clear(Customer);
-
- exit(Customer."No.");
- end;
-
- ///
- /// Opens a customer lookup page for the user to select a customer.
- ///
- /// The selected customer record, or empty if cancelled.
- /// True if a customer was selected; otherwise, false.
- procedure SelectCustomer(var Customer: Record Customer): Boolean
- var
- CustomerLookup: Page "Customer Lookup";
- Result: Boolean;
- begin
- CustomerLookup.SetTableView(Customer);
- CustomerLookup.SetRecord(Customer);
- CustomerLookup.LookupMode := true;
- Result := CustomerLookup.RunModal() = ACTION::LookupOK;
- if Result then
- CustomerLookup.GetRecord(Customer)
- else
- Clear(Customer);
-
- exit(Result);
- end;
-
-
- local procedure MarkCustomersByFilters(var Customer: Record Customer)
- begin
- if Customer.FindSet() then
- repeat
- Customer.Mark(true);
- until Customer.Next() = 0;
- if Customer.FindFirst() then;
- Customer.MarkedOnly := true;
- end;
-
- ///
- /// Initializes a price source record for this customer.
- ///
- /// Returns the initialized price source for sales pricing.
- procedure ToPriceSource(var PriceSource: Record "Price Source")
- begin
- PriceSource.Init();
- PriceSource."Price Type" := PriceSource."Price Type"::Sale;
- PriceSource.Validate("Source Type", PriceSource."Source Type"::Customer);
- PriceSource.Validate("Source No.", "No.");
- end;
-
- local procedure TestNoSeries()
- var
- Customer: Record Customer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeTestNoSeries(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if "No." <> xRec."No." then
- if not Customer.Get(Rec."No.") then begin
- SalesSetup.Get();
- NoSeries.TestManual(SalesSetup."Customer Nos.");
- "No. Series" := '';
- end;
- end;
-
- ///
- /// Opens the customer ledger entries page with optional filtering on due entries.
- ///
- /// Indicates whether to filter on due entries only.
- procedure OpenCustomerLedgerEntries(FilterOnDueEntries: Boolean)
- var
- DetailedCustLedgEntry: Record "Detailed Cust. Ledg. Entry";
- CustLedgerEntry: Record "Cust. Ledger Entry";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeOpenCustomerLedgerEntries(Rec, DetailedCustLedgEntry, FilterOnDueEntries, IsHandled);
- if IsHandled then
- exit;
-
- DetailedCustLedgEntry.SetRange("Customer No.", "No.");
- CopyFilter("Global Dimension 1 Filter", DetailedCustLedgEntry."Initial Entry Global Dim. 1");
- CopyFilter("Global Dimension 2 Filter", DetailedCustLedgEntry."Initial Entry Global Dim. 2");
- if FilterOnDueEntries and (GetFilter("Date Filter") <> '') then begin
- CopyFilter("Date Filter", DetailedCustLedgEntry."Initial Entry Due Date");
- DetailedCustLedgEntry.SetFilter("Posting Date", '<=%1', GetRangeMax("Date Filter"));
- end;
- CopyFilter("Currency Filter", DetailedCustLedgEntry."Currency Code");
- CustLedgerEntry.DrillDownOnEntries(DetailedCustLedgEntry);
- end;
-
- ///
- /// Sets whether the customer is being inserted from a template.
- ///
- /// True if the customer is being created from a template; otherwise, false.
- procedure SetInsertFromTemplate(FromTemplate: Boolean)
- begin
- InsertFromTemplate := FromTemplate;
- end;
-
- ///
- /// Checks if a lookup was requested during the last customer number search operation.
- ///
- /// True if a lookup was requested; otherwise, false.
- procedure IsLookupRequested() Result: Boolean
- begin
- Result := LookupRequested;
- LookupRequested := false;
- end;
-
- ///
- /// Checks if the associated contact record needs to be updated based on changed customer fields.
- ///
- /// True if contact update is needed; otherwise, false.
- procedure IsContactUpdateNeeded(): Boolean
- var
- CustContUpdate: Codeunit "CustCont-Update";
- UpdateNeeded: Boolean;
- begin
- UpdateNeeded :=
- (Name <> xRec.Name) or
- ("Search Name" <> xRec."Search Name") or
- ("Name 2" <> xRec."Name 2") or
- (Address <> xRec.Address) or
- ("Address 2" <> xRec."Address 2") or
- (City <> xRec.City) or
- ("Phone No." <> xRec."Phone No.") or
- ("Mobile Phone No." <> xRec."Mobile Phone No.") or
- ("Telex No." <> xRec."Telex No.") or
- ("Territory Code" <> xRec."Territory Code") or
- ("Currency Code" <> xRec."Currency Code") or
- ("Language Code" <> xRec."Language Code") or
- ("Salesperson Code" <> xRec."Salesperson Code") or
- ("Country/Region Code" <> xRec."Country/Region Code") or
- ("Fax No." <> xRec."Fax No.") or
- ("Telex Answer Back" <> xRec."Telex Answer Back") or
- ("Registration Number" <> xRec."Registration Number") or
- ("VAT Registration No." <> xRec."VAT Registration No.") or
- ("Post Code" <> xRec."Post Code") or
- (County <> xRec.County) or
- ("E-Mail" <> xRec."E-Mail") or
- ("Home Page" <> xRec."Home Page") or
- (Contact <> xRec.Contact);
-
- if not UpdateNeeded and not IsTemporary then
- UpdateNeeded := CustContUpdate.ContactNameIsBlank("No.");
-
- if ForceUpdateContact then
- UpdateNeeded := true;
-
- OnBeforeIsContactUpdateNeeded(Rec, xRec, UpdateNeeded, ForceUpdateContact);
- exit(UpdateNeeded);
- end;
-
- ///
- /// Checks if the customer is blocked or privacy-blocked.
- ///
- /// True if the customer is blocked or privacy-blocked; otherwise, false.
- procedure IsBlocked(): Boolean
- begin
- if Blocked <> Blocked::" " then
- exit(true);
-
- if "Privacy Blocked" then
- exit(true);
-
- exit(false);
- end;
-
- ///
- /// Checks if the customer has any open sales documents or posted ledger entries.
- ///
- /// True if open or posted documents exist; otherwise, false.
- procedure HasAnyOpenOrPostedDocuments(): Boolean
- var
- SalesHeader: Record "Sales Header";
- SalesLine: Record "Sales Line";
- CustLedgerEntry: Record "Cust. Ledger Entry";
- HasAnyDocs: Boolean;
- begin
- SalesHeader.SetRange("Sell-to Customer No.", "No.");
- if SalesHeader.FindFirst() then
- exit(true);
-
- SalesLine.SetCurrentKey("Document Type", "Bill-to Customer No.");
- SalesLine.SetRange("Bill-to Customer No.", "No.");
- if SalesLine.FindFirst() then
- exit(true);
-
- SalesLine.SetRange("Bill-to Customer No.");
- SalesLine.SetRange("Sell-to Customer No.", "No.");
- if SalesLine.FindFirst() then
- exit(true);
-
- CustLedgerEntry.SetRange("Customer No.", "No.");
- if not CustLedgerEntry.IsEmpty() then
- exit(true);
-
- HasAnyDocs := false;
- OnAfterHasAnyOpenOrPostedDocuments(Rec, HasAnyDocs);
- exit(HasAnyDocs);
- end;
-
- ///
- /// Copies field values from the specified customer template to this customer record.
- ///
- /// The customer template to copy values from.
- procedure CopyFromNewCustomerTemplate(CustomerTemplate: Record "Customer Templ.")
- begin
- "Territory Code" := CustomerTemplate."Territory Code";
- "Global Dimension 1 Code" := CustomerTemplate."Global Dimension 1 Code";
- "Global Dimension 2 Code" := CustomerTemplate."Global Dimension 2 Code";
- "Customer Posting Group" := CustomerTemplate."Customer Posting Group";
- "Currency Code" := CustomerTemplate."Currency Code";
- "Invoice Disc. Code" := CustomerTemplate."Invoice Disc. Code";
- "Customer Price Group" := CustomerTemplate."Customer Price Group";
- "Customer Disc. Group" := CustomerTemplate."Customer Disc. Group";
- "Country/Region Code" := CustomerTemplate."Country/Region Code";
- "Allow Line Disc." := CustomerTemplate."Allow Line Disc.";
- "Gen. Bus. Posting Group" := CustomerTemplate."Gen. Bus. Posting Group";
- "VAT Bus. Posting Group" := CustomerTemplate."VAT Bus. Posting Group";
- Validate("Payment Terms Code", CustomerTemplate."Payment Terms Code");
- Validate("Payment Method Code", CustomerTemplate."Payment Method Code");
- "Prices Including VAT" := CustomerTemplate."Prices Including VAT";
- "Shipment Method Code" := CustomerTemplate."Shipment Method Code";
-
- OnAfterCopyFromNewCustomerTemplate(Rec, CustomerTemplate);
- end;
-
- local procedure CopyContactPicture(var Cont: Record Contact)
- var
- TempNameValueBuffer: Record "Name/Value Buffer" temporary;
- FileManagement: Codeunit "File Management";
- ConfirmManagement: Codeunit "Confirm Management";
- ExportPath: Text;
- begin
- if Image.HasValue() then
- if not ConfirmManagement.GetResponseOrDefault(OverrideImageQst, true) then
- exit;
-
- ExportPath := TemporaryPath + Cont."No." + Format(Cont.Image.MediaId);
- Cont.Image.ExportFile(ExportPath);
- FileManagement.GetServerDirectoryFilesList(TempNameValueBuffer, TemporaryPath);
- TempNameValueBuffer.SetFilter(Name, StrSubstNo('%1*', ExportPath));
- TempNameValueBuffer.FindFirst();
-
- Clear(Image);
- Image.ImportFile(TempNameValueBuffer.Name, '');
- Modify();
- if FileManagement.DeleteServerFile(TempNameValueBuffer.Name) then;
- end;
-
- ///
- /// Gets whether the customer is being inserted from a contact record.
- ///
- /// True if the customer is being created from a contact; otherwise, false.
- procedure GetInsertFromContact(): Boolean
- begin
- exit(InsertFromContact);
- end;
-
- ///
- /// Gets whether the customer is being inserted from a template.
- ///
- /// True if the customer is being created from a template; otherwise, false.
- procedure GetInsertFromTemplate(): Boolean
- begin
- exit(InsertFromTemplate);
- end;
-
- protected procedure SetDefaultSalesperson()
- var
- UserSetup: Record "User Setup";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetDefaultSalesperson(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if not UserSetup.Get(UserId) then
- exit;
-
- if UserSetup."Salespers./Purch. Code" <> '' then
- Validate("Salesperson Code", UserSetup."Salespers./Purch. Code");
- end;
-
- protected procedure SetLastModifiedDateTime()
- begin
- "Last Modified Date Time" := CurrentDateTime();
- "Last Date Modified" := Today();
- OnAfterSetLastModifiedDateTime(Rec);
- end;
-
- ///
- /// Validates the VAT registration number format and optionally verifies it against the VIES service.
- ///
- procedure VATRegistrationValidation()
- var
- VATRegistrationNoFormat: Record "VAT Registration No. Format";
- VATRegistrationLog: Record "VAT Registration Log";
- VATRegNoSrvConfig: Record "VAT Reg. No. Srv Config";
- VATRegistrationLogMgt: Codeunit "VAT Registration Log Mgt.";
- ResultRecordRef: RecordRef;
- ApplicableCountryCode: Code[10];
- IsHandled: Boolean;
- LogNotVerified: Boolean;
- begin
- IsHandled := false;
- OnBeforeVATRegistrationValidation(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if not VATRegistrationNoFormat.Test("VAT Registration No.", "Country/Region Code", "No.", DATABASE::Customer) then
- exit;
-
- LogNotVerified := true;
- if ("Country/Region Code" <> '') or (VATRegistrationNoFormat."Country/Region Code" <> '') then begin
- ApplicableCountryCode := "Country/Region Code";
- if ApplicableCountryCode = '' then
- ApplicableCountryCode := VATRegistrationNoFormat."Country/Region Code";
- if VATRegNoSrvConfig.VATRegNoSrvIsEnabled() then begin
- LogNotVerified := false;
- VATRegistrationLogMgt.ValidateVATRegNoWithVIES(
- ResultRecordRef, Rec, "No.", VATRegistrationLog."Account Type"::Customer.AsInteger(), ApplicableCountryCode);
- ResultRecordRef.SetTable(Rec);
- end;
- end;
-
- if LogNotVerified then
- VATRegistrationLogMgt.LogCustomer(Rec);
- end;
-
- local procedure ValidateEmail()
- var
- MailManagement: Codeunit "Mail Management";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateEmail(Rec, IsHandled, xRec);
- if IsHandled then
- exit;
-
- if "E-Mail" = '' then
- exit;
- MailManagement.CheckValidEmailAddresses("E-Mail");
- end;
-
- ///
- /// Sets the customer's address fields and updates the associated contact.
- ///
- /// The primary address line.
- /// The secondary address line.
- /// The postal code.
- /// The city.
- /// The state, province, or county.
- /// The country/region code.
- /// The contact name.
- procedure SetAddress(CustomerAddress: Text[100]; CustomerAddress2: Text[50]; CustomerPostCode: Code[20]; CustomerCity: Text[30]; CustomerCounty: Text[30]; CustomerCountryCode: Code[10]; CustomerContact: Text[100])
- begin
- Address := CustomerAddress;
- "Address 2" := CustomerAddress2;
- "Post Code" := CustomerPostCode;
- City := CustomerCity;
- County := CustomerCounty;
- "Country/Region Code" := CustomerCountryCode;
- UpdateContFromCust.OnModify(Rec);
- Contact := CustomerContact;
- end;
-
- ///
- /// Finds a customer by email address, searching both the customer and contact records.
- ///
- /// Returns the found customer record.
- /// The email address to search for.
- /// True if a customer was found; otherwise, false.
- procedure FindByEmail(var Customer: Record Customer; Email: Text): Boolean
- var
- LocalContact: Record Contact;
- ContactBusinessRelation: Record "Contact Business Relation";
- MarketingSetup: Record "Marketing Setup";
- begin
- Customer.SetRange("E-Mail", Email);
- if Customer.FindFirst() then
- exit(true);
-
- Customer.SetRange("E-Mail");
- LocalContact.SetRange("E-Mail", Email);
- if LocalContact.FindSet() then begin
- MarketingSetup.Get();
- repeat
- if ContactBusinessRelation.Get(LocalContact."No.", MarketingSetup."Bus. Rel. Code for Customers") then begin
- Customer.Get(ContactBusinessRelation."No.");
- exit(true);
- end;
- until LocalContact.Next() = 0
- end;
- end;
-
- ///
- /// Updates all API-related reference IDs for currency, payment terms, shipment method, payment method, and tax area.
- ///
- procedure UpdateReferencedIds()
- var
- GraphMgtGeneralTools: Codeunit "Graph Mgt - General Tools";
- begin
- if IsTemporary then
- exit;
-
- if not GraphMgtGeneralTools.IsApiEnabled() then
- exit;
-
- UpdateCurrencyId();
- UpdatePaymentTermsId();
- UpdateShipmentMethodId();
- UpdatePaymentMethodId();
- UpdateTaxAreaId();
- end;
-
- ///
- /// Gets the list of fields that contain referenced IDs for API integration.
- ///
- /// Returns the list of reference ID fields.
- procedure GetReferencedIds(var TempField: Record "Field" temporary)
- var
- DataTypeManagement: Codeunit "Data Type Management";
- begin
- DataTypeManagement.InsertFieldToBuffer(TempField, DATABASE::Customer, FieldNo("Currency Id"));
- DataTypeManagement.InsertFieldToBuffer(TempField, DATABASE::Customer, FieldNo("Payment Terms Id"));
- DataTypeManagement.InsertFieldToBuffer(TempField, DATABASE::Customer, FieldNo("Payment Method Id"));
- DataTypeManagement.InsertFieldToBuffer(TempField, DATABASE::Customer, FieldNo("Shipment Method Id"));
- DataTypeManagement.InsertFieldToBuffer(TempField, DATABASE::Customer, FieldNo("Tax Area ID"));
- end;
-
- ///
- /// Sets whether to force an update of the associated contact record regardless of field changes.
- ///
- /// True to force contact update; otherwise, false.
- procedure SetForceUpdateContact(NewForceUpdateContact: Boolean)
- begin
- ForceUpdateContact := NewForceUpdateContact;
- end;
-
- local procedure UpdateCurrencyCode()
- var
- Currency: Record Currency;
- begin
- Currency.SetLoadFields(Code);
- if not IsNullGuid("Currency Id") then begin
- Currency.GetBySystemId("Currency Id");
- Validate("Currency Code", Currency.Code);
- end;
- end;
-
- local procedure UpdatePaymentTermsCode()
- var
- PaymentTerms: Record "Payment Terms";
- begin
- PaymentTerms.SetLoadFields(Code);
- if not IsNullGuid("Payment Terms Id") then
- PaymentTerms.GetBySystemId("Payment Terms Id");
-
- Validate("Payment Terms Code", PaymentTerms.Code);
- end;
-
- local procedure UpdateShipmentMethodCode()
- var
- ShipmentMethod: Record "Shipment Method";
- begin
- ShipmentMethod.SetLoadFields(Code);
- if not IsNullGuid("Shipment Method Id") then
- ShipmentMethod.GetBySystemId("Shipment Method Id");
-
- Validate("Shipment Method Code", ShipmentMethod.Code);
- end;
-
- local procedure UpdatePaymentMethodCode()
- var
- PaymentMethod: Record "Payment Method";
- begin
- PaymentMethod.SetLoadFields(Code);
- if not IsNullGuid("Payment Method Id") then
- PaymentMethod.GetBySystemId("Payment Method Id");
-
- Validate("Payment Method Code", PaymentMethod.Code);
- end;
-
- ///
- /// Updates the Currency Id field based on the current Currency Code.
- ///
- procedure UpdateCurrencyId()
- var
- Currency: Record Currency;
- begin
- if "Currency Code" = '' then begin
- Clear("Currency Id");
- exit;
- end;
-
- Currency.SetLoadFields(SystemId);
- if not Currency.Get("Currency Code") then
- exit;
-
- "Currency Id" := Currency.SystemId;
- end;
-
- ///
- /// Updates the Payment Terms Id field based on the current Payment Terms Code.
- ///
- procedure UpdatePaymentTermsId()
- var
- PaymentTerms: Record "Payment Terms";
- begin
- if "Payment Terms Code" = '' then begin
- Clear("Payment Terms Id");
- exit;
- end;
-
- PaymentTerms.SetLoadFields(SystemId);
- if not PaymentTerms.Get("Payment Terms Code") then
- exit;
-
- "Payment Terms Id" := PaymentTerms.SystemId;
- end;
-
- ///
- /// Updates the Shipment Method Id field based on the current Shipment Method Code.
- ///
- procedure UpdateShipmentMethodId()
- var
- ShipmentMethod: Record "Shipment Method";
- begin
- if "Shipment Method Code" = '' then begin
- Clear("Shipment Method Id");
- exit;
- end;
-
- ShipmentMethod.SetLoadFields(SystemId);
- if not ShipmentMethod.Get("Shipment Method Code") then
- exit;
-
- "Shipment Method Id" := ShipmentMethod.SystemId;
- end;
-
- ///
- /// Updates the Payment Method Id field based on the current Payment Method Code.
- ///
- procedure UpdatePaymentMethodId()
- var
- PaymentMethod: Record "Payment Method";
- begin
- if "Payment Method Code" = '' then begin
- Clear("Payment Method Id");
- exit;
- end;
-
- PaymentMethod.SetLoadFields(SystemId);
- if not PaymentMethod.Get("Payment Method Code") then
- exit;
-
- "Payment Method Id" := PaymentMethod.SystemId;
- end;
-
- local procedure UpdateDirectDebitPmtTermsCode()
- var
- PaymentMethod: Record "Payment Method";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateDirectDebitPmtTermsCode(Rec, IsHandled);
- if IsHandled then
- exit;
-
- PaymentMethod.SetLoadFields("Direct Debit", "Direct Debit Pmt. Terms Code");
- PaymentMethod.Get("Payment Method Code");
- if PaymentMethod."Direct Debit" and ("Payment Terms Code" = '') then
- Validate("Payment Terms Code", PaymentMethod."Direct Debit Pmt. Terms Code");
-
- end;
-
- ///
- /// Updates the Tax Area ID based on the VAT Business Posting Group or Tax Area Code depending on tax type.
- ///
- procedure UpdateTaxAreaId()
- var
- VATBusinessPostingGroup: Record "VAT Business Posting Group";
- TaxArea: Record "Tax Area";
- GeneralLedgerSetup: Record "General Ledger Setup";
- begin
- if GeneralLedgerSetup.UseVat() then begin
- if "VAT Bus. Posting Group" = '' then begin
- Clear("Tax Area ID");
- exit;
- end;
-
- VATBusinessPostingGroup.SetLoadFields(SystemId);
- if not VATBusinessPostingGroup.Get("VAT Bus. Posting Group") then
- exit;
-
- "Tax Area ID" := VATBusinessPostingGroup.SystemId;
- end else begin
- if "Tax Area Code" = '' then begin
- Clear("Tax Area ID");
- exit;
- end;
-
- TaxArea.SetLoadFields(SystemId);
- if not TaxArea.Get("Tax Area Code") then
- exit;
-
- "Tax Area ID" := TaxArea.SystemId;
- end;
- end;
-
- local procedure UpdateTaxAreaCode()
- var
- TaxArea: Record "Tax Area";
- VATBusinessPostingGroup: Record "VAT Business Posting Group";
- GeneralLedgerSetup: Record "General Ledger Setup";
- begin
- if IsNullGuid("Tax Area ID") then
- exit;
-
- if GeneralLedgerSetup.UseVat() then begin
- VATBusinessPostingGroup.SetLoadFields(Code);
- VATBusinessPostingGroup.GetBySystemId("Tax Area ID");
- "VAT Bus. Posting Group" := VATBusinessPostingGroup.Code;
- end else begin
- TaxArea.SetLoadFields(Code);
- TaxArea.GetBySystemId("Tax Area ID");
- "Tax Area Code" := TaxArea.Code;
- end;
- end;
-
- local procedure ValidateSalesPersonCode()
- begin
- if "Salesperson Code" <> '' then
- if SalespersonPurchaser.Get("Salesperson Code") then
- if SalespersonPurchaser.VerifySalesPersonPurchaserPrivacyBlocked(SalespersonPurchaser) then
- Error(SalespersonPurchaser.GetPrivacyBlockedGenericText(SalespersonPurchaser, true))
- end;
-
- local procedure CheckCustomerContactRelation(Cont: Record Contact)
- var
- ContBusRel: Record "Contact Business Relation";
- IsHandled: Boolean;
- begin
- ContBusRel.FindOrRestoreContactBusinessRelation(Cont, Rec, ContBusRel."Link to Table"::Customer);
-
- IsHandled := false;
- OnBeforeCheckCustomerContactRelation(Cont, ContBusRel, IsHandled);
- if not IsHandled then
- if Cont."Company No." <> ContBusRel."Contact No." then
- Error(Text003, Cont."No.", Cont.Name, "No.", Name);
- end;
-
- local procedure CheckIfSalesOrderLinesExist()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckIfOrderSalesLinesExist(Rec, IsHandled);
- if IsHandled then
- exit;
-
- SalesOrderLine.SetCurrentKey("Document Type", "Bill-to Customer No.");
- SalesOrderLine.SetRange("Bill-to Customer No.", "No.");
- if SalesOrderLine.FindFirst() then
- Error(Text000, TableCaption, "No.", SalesOrderLine."Document Type");
-
- SalesOrderLine.SetRange("Bill-to Customer No.");
- SalesOrderLine.SetRange("Sell-to Customer No.", "No.");
- if SalesOrderLine.FindFirst() then
- Error(Text000, TableCaption, "No.", SalesOrderLine."Document Type");
- end;
-
- local procedure UpdateCustomerTemplateInvoiceDiscCodes()
- var
- CustomerTempl: Record "Customer Templ.";
- begin
- CustomerTempl.SetRange("Invoice Disc. Code", xRec."No.");
- CustomerTempl.ModifyAll("Invoice Disc. Code", "No.");
- end;
-
- ///
- /// Checks if multiple posting groups are allowed and validates that the customer has the required setting enabled.
- ///
- procedure CheckAllowMultiplePostingGroups()
- var
- IsHandled: Boolean;
- begin
- OnBeforeCheckAllowMultiplePostingGroups(IsHandled);
- if IsHandled then
- exit;
-
- SalesSetup.Get();
- if SalesSetup."Allow Multiple Posting Groups" then
- TestField("Allow Multiple Posting Groups");
- end;
-
- local procedure UpdateFormatRegion();
- var
- Language: Record Language;
- LanguageSelection: Record "Language Selection";
- begin
- if (Rec."Format Region" <> '') then
- exit;
- if not Language.Get("Language Code") then
- exit;
-
- LanguageSelection.SetRange("Language ID", Language."Windows Language ID");
- if LanguageSelection.FindFirst() then
- Rec.Validate("Format Region", LanguageSelection."Language Tag");
- end;
-
- ///
- /// Gets the customer's VAT registration number.
- ///
- /// The VAT registration number.
- procedure GetVATRegistrationNo() VATRegNo: Text[20]
- begin
- VATRegNo := "VAT Registration No.";
-
- OnAfterGetVATRegistrationNo(Rec, VATRegNo);
- end;
-
-#if not CLEAN28
- ///
- /// Gets the outstanding amount in LCY for shipped sales invoice lines.
- ///
- /// The outstanding amount in LCY for shipped invoices.
- [Obsolete('It is no longer used in GetTotalAmountLCYCommon procedure.', '28.0')]
- procedure GetShippedOutstandingInvoicesAmountLCY(): Decimal
- var
- SalesLine: Record "Sales Line";
- begin
- SalesLine.SetRange("Bill-to Customer No.", "No.");
- SalesLine.SetRange("Document Type", SalesLine."Document Type"::Invoice);
- SalesLine.SetFilter("Shipment No.", '<>%1', '');
- SalesLine.SetFilter("Shipment Line No.", '<>%1', 0);
- SalesLine.CalcSums("Outstanding Amount (LCY)");
- exit(SalesLine."Outstanding Amount (LCY)");
- end;
-
- ///
- /// Gets the shipped but not invoiced amount in LCY from sales orders.
- ///
- /// The shipped but not invoiced amount in LCY.
- [Obsolete('It is no longer used in GetTotalAmountLCYCommon procedure.', '28.0')]
- procedure GetShippedFromOrderLCYAmountLCY(): Decimal
- var
- SalesShippedNotInvoicedLCY: Query "Sales Shipped Not Invoiced LCY";
- ShippedFromOrderLCY: Decimal;
- SalesOrderNo: Code[20];
- begin
- SalesOrderNo := '';
- ShippedFromOrderLCY := 0;
- SalesShippedNotInvoicedLCY.SetRange(BillToCustomerNo, "No.");
- SalesShippedNotInvoicedLCY.SetFilter(OrderNo, '<>%1', '');
- SalesShippedNotInvoicedLCY.SetFilter(OrderLineNo, '<>%1', 0);
- if SalesShippedNotInvoicedLCY.Open() then
- while SalesShippedNotInvoicedLCY.Read() do begin
- if SalesShippedNotInvoicedLCY.OrderNo <> SalesOrderNo then
- ShippedFromOrderLCY += SalesShippedNotInvoicedLCY.ShippedNotInvoicedLCY;
-
- SalesOrderNo := SalesShippedNotInvoicedLCY.OrderNo;
- end;
- exit(ShippedFromOrderLCY);
- end;
-#endif
-
- ///
- /// Gets the default location code based on ship-to address, customer location, and user setup.
- ///
- /// The resolved location code.
- procedure GetDefaultLocation() ReturnLocationCode: Code[10]
- var
- ShipToAddress: Record "Ship-to Address";
- UserSetupMgt: Codeunit "User Setup Management";
- LocationCode: Code[10];
- begin
- LocationCode := Rec."Location Code";
- if Rec."Ship-to Code" <> '' then begin
- ShipToAddress.SetLoadFields("Location Code");
- if ShipToAddress.Get(Rec."No.", Rec."Ship-to Code") then
- if ShipToAddress."Location Code" <> '' then
- LocationCode := ShipToAddress."Location Code";
- end;
- ReturnLocationCode := UserSetupMgt.GetLocation(0, LocationCode, Rec."Responsibility Center");
- end;
-
- [InherentPermissions(PermissionObjectType::TableData, Database::"My Customer", 'rm')]
- local procedure UpdateMyCustomer(CallingFieldNo: Integer)
- var
- MyCustomer: Record "My Customer";
- begin
- case CallingFieldNo of
- FieldNo(Name):
- begin
- MyCustomer.SetRange("Customer No.", "No.");
- if not MyCustomer.IsEmpty() then
- MyCustomer.ModifyAll(Name, Name);
- end;
- FieldNo("Phone No."):
- begin
- MyCustomer.SetRange("Customer No.", "No.");
- if not MyCustomer.IsEmpty() then
- MyCustomer.ModifyAll("Phone No.", "Phone No.");
- end;
- end;
- end;
-
- procedure FormatVATRegistrationNo(VATRegistrationNo: Text; CountryCode: Code[10]): Text
- var
- CountryRegion: Record "Country/Region";
- begin
- if VATRegistrationNo = '' then
- exit;
-
- VATRegistrationNo := DelChr(VATRegistrationNo);
-
- if CountryRegion.Get(CountryCode) and (CountryRegion."ISO Code" <> '') then
- if StrPos(VATRegistrationNo, CountryRegion."ISO Code") <> 1 then
- VATRegistrationNo := CountryRegion."ISO Code" + VATRegistrationNo;
-
- exit(VATRegistrationNo);
- end;
-
- local procedure DeleteDimValuePerAccount()
- var
- DimValuePerAccount: Record "Dim. Value per Account";
- begin
- DimValuePerAccount.SetRange("Table ID", Database::Customer);
- DimValuePerAccount.SetRange("No.", "No.");
- if not DimValuePerAccount.IsEmpty() then
- DimValuePerAccount.DeleteAll(true);
- end;
-
- ///
- /// Raised before determining if the associated contact needs to be updated.
- ///
- /// The current customer record.
- /// The previous customer record before changes.
- /// Set to true to indicate contact update is needed.
- /// Indicates if contact update is being forced.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeIsContactUpdateNeeded(Customer: Record Customer; xCustomer: Record Customer; var UpdateNeeded: Boolean; ForceUpdateContact: Boolean)
- begin
- end;
-
- ///
- /// Raised after copying field values from a customer template to the customer record.
- ///
- /// The customer record that received template values.
- /// The customer template that provided the values.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyFromNewCustomerTemplate(var Customer: Record Customer; CustomerTemplate: Record "Customer Templ.")
- begin
- end;
-
- ///
- /// Raised after deleting all related data for the customer.
- ///
- /// The customer record being deleted.
- [IntegrationEvent(false, false)]
- local procedure OnAfterDeleteRelatedData(Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised after getting the document type filter for the top customer headline query.
- ///
- /// The document type filter text to modify.
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetTopCustomerHeadlineQueryDocumentTypeFilter(var DocumentTypeFilter: Text)
- begin
- end;
-
- ///
- /// Raised after checking if the customer has any open or posted documents.
- ///
- /// The customer record being checked.
- /// Set to true if additional document types exist.
- [IntegrationEvent(false, false)]
- local procedure OnAfterHasAnyOpenOrPostedDocuments(var Customer: Record Customer; var HasAnyDocs: Boolean)
- begin
- end;
-
- ///
- /// Raised after checking if the customer has address fields populated (excluding country/region).
- ///
- /// The customer record being checked.
- /// Set to true to indicate address exists.
- [IntegrationEvent(false, false)]
- local procedure OnAfterHasAddressIgnoreCountryCode(Customer: Record Customer; var Result: Boolean)
- begin
- end;
-
- ///
- /// Raised after comparing the customer's address with another customer.
- ///
- /// The customer record being compared.
- /// The other customer record to compare against.
- /// Set to true if addresses differ.
- [IntegrationEvent(false, false)]
- local procedure OnAfterHasDifferentAddress(Customer: Record Customer; OtherCustomer: Record Customer; var Result: Boolean)
- begin
- end;
-
- ///
- /// Raised after looking up the city from the post code table.
- ///
- /// The customer record.
- /// The post code record used in the lookup.
- [IntegrationEvent(false, false)]
- local procedure OnAfterLookupCity(var Customer: Record Customer; var PostCodeRec: Record "Post Code")
- begin
- end;
-
- ///
- /// Raised after looking up the post code.
- ///
- /// The customer record.
- /// The previous customer record before changes.
- /// The post code record used in the lookup.
- [IntegrationEvent(false, false)]
- local procedure OnAfterLookupPostCode(var Customer: Record Customer; xCustomer: Record Customer; var PostCodeRec: Record "Post Code")
- begin
- end;
-
- ///
- /// Raised after inserting a new customer record.
- ///
- /// The customer record that was inserted.
- /// The customer record before insertion.
- [IntegrationEvent(false, false)]
- local procedure OnAfterOnInsert(var Customer: Record Customer; xCustomer: Record Customer)
- begin
- end;
-
- ///
- /// Raised after setting the last modified date and time on the customer record.
- ///
- /// The customer record with updated timestamp.
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetLastModifiedDateTime(var Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised after validating the city field on the customer record.
- ///
- /// The customer record after city validation.
- /// The customer record before city validation.
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateCity(var Customer: Record Customer; xCustomer: Record Customer)
- begin
- end;
-
- ///
- /// Raised after validating the post code field on the customer record.
- ///
- /// The customer record after post code validation.
- /// The customer record before post code validation.
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidatePostCode(var Customer: Record Customer; xCustomer: Record Customer)
- begin
- end;
-
- ///
- /// Raised after validating and saving a shortcut dimension code.
- ///
- /// The customer record after dimension validation.
- /// The customer record before dimension validation.
- /// The dimension field number that was validated.
- /// The dimension value code that was assigned.
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateShortcutDimCode(var Customer: Record Customer; var xCustomer: Record Customer; FieldNumber: Integer; var ShortcutDimCode: Code[20])
- begin
- end;
-
- ///
- /// Raised before exiting the AssistEdit procedure after selecting a number series.
- ///
- /// The customer record with the new number series assigned.
- [IntegrationEvent(false, false)]
- local procedure OnAssistEditOnBeforeExit(var Customer: Record Customer)
- begin
- end;
-
- local procedure IsOnBeforeCheckBlockedCustHandled(Customer: Record Customer; Source: Option Journal,Document; DocType: Enum "Gen. Journal Document Type"; Shipment: Boolean; Transaction: Boolean) IsHandled: Boolean
- begin
- OnBeforeCheckBlockedCust(Customer, Source, DocType.AsInteger(), Shipment, Transaction, IsHandled)
- end;
-
- ///
- /// Raised before checking if a customer is blocked for documents or journals.
- ///
- /// The customer record to check.
- /// The source type (Journal or Document).
- /// The document type being checked.
- /// Indicates if this is a shipment operation.
- /// Indicates if this is a posting transaction.
- /// Set to true to skip the default blocked check.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckBlockedCust(Customer: Record Customer; Source: Option Journal,Document; DocType: Option; Shipment: Boolean; Transaction: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking if a customer is blocked for journal lines.
- ///
- /// The customer record to check.
- /// The general journal line being validated.
- /// Indicates if this is a posting transaction.
- /// Set to true to skip the default blocked check.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckBlockedCustOnJnls(Customer: Record Customer; var GenJnlLine: Record "Gen. Journal Line"; Transaction: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking if sales order lines exist for the customer.
- ///
- /// The customer record to check.
- /// Set to true to skip the default check.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckIfOrderSalesLinesExist(var Customer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before creating a new customer record.
- ///
- /// The name for the new customer.
- /// Indicates whether to show the customer card.
- /// Set to the new customer code to override creation.
- /// Set to true to skip the default creation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateNewCustomer(CustomerName: Text[100]; ShowCustomerCard: Boolean; var NewCustomerCode: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting the customer number with card display options.
- ///
- /// The text to search for.
- /// Indicates whether to show the customer card.
- /// Indicates whether to show the create customer option.
- /// Set to the customer number to override the lookup.
- /// Set to true to skip the default lookup logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetCustNoOpenCard(CustomerText: Text; ShowCustomerCard: Boolean; var ShowCreateCustomerOption: Boolean; var CustomerNo: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before calculating the overdue balance.
- ///
- /// The customer record.
- /// Set to the overdue balance to override the calculation.
- /// Set to true to skip the default calculation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCalcOverdueBalance(var Customer: Record Customer; var OverdueBalance: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting the invoiced prepayment amount in local currency.
- ///
- /// The customer record.
- /// Set to the amount to override the calculation.
- /// Set to true to skip the default calculation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetInvoicedPrepmtAmountLCY(var Customer: Record Customer; var InvoicedPrepmtAmountLCY: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting the total amount in local currency.
- ///
- /// The customer record.
- /// Set to the total amount to override the calculation.
- /// Set to true to skip the default calculation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetTotalAmountLCY(var Customer: Record Customer; var TotalAmountLCY: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting the total amount in local currency for UI display.
- ///
- /// The customer record.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetTotalAmountLCYUI(var Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised before getting the common total amount in local currency calculation.
- ///
- /// The customer record.
- /// Set to include additional amounts in the calculation.
- /// Set to true to skip the default calculation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetTotalAmountLCYCommon(var Customer: Record Customer; var AdditionalAmountLCY: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting the sales in local currency for the fiscal year.
- ///
- /// The customer record.
- /// The customer record for year-to-date sales calculation.
- /// Set to the sales amount to override the calculation.
- /// Set to true to skip the default calculation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetSalesLCY(var Customer: Record Customer; var CustomerSalesYTD: Record Customer; var SalesLCY: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before inserting a new customer record.
- ///
- /// The customer record to be inserted.
- /// Set to true to skip the default insert logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInsert(var Customer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before looking up the city from the post code table.
- ///
- /// The customer record.
- /// The post code record for the lookup.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupCity(var Customer: Record Customer; var PostCodeRec: Record "Post Code")
- begin
- end;
-
- ///
- /// Raised before looking up the contact list for the customer.
- ///
- /// The customer record.
- /// Set to true to skip the default lookup.
- /// The field number that triggered the lookup.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupContactList(var Customer: Record Customer; var IsHandled: Boolean; FieldNumber: Integer)
- begin
- end;
-
- ///
- /// Raised before looking up the post code.
- ///
- /// The customer record.
- /// The post code record for the lookup.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupPostCode(var Customer: Record Customer; var PostCodeRec: Record "Post Code")
- begin
- end;
-
- ///
- /// Raised before opening customer ledger entries.
- ///
- /// The customer record.
- /// The detailed customer ledger entry record for filtering.
- /// Indicates whether to filter on due entries.
- /// Set to true to skip the default open logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOpenCustomerLedgerEntries(var Customer: Record Customer; var DetailedCustLedgEntry: Record "Detailed Cust. Ledg. Entry"; FilterOnDueEntries: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before deleting a customer record.
- ///
- /// The customer record to be deleted.
- /// Set to true to skip the default delete logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOnDelete(var Customer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before renaming a customer record.
- ///
- /// The customer record being renamed.
- /// The customer record before renaming.
- /// Set to true to skip the default rename logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOnRename(var Customer: Record Customer; xCustomer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before setting the default salesperson for a new customer.
- ///
- /// The customer record.
- /// Set to true to skip the default salesperson assignment.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetDefaultSalesperson(var Customer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before testing the number series configuration.
- ///
- /// The customer record.
- /// The previous customer record.
- /// Set to true to skip the default number series test.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTestNoSeries(var Customer: Record Customer; xCustomer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating the payment terms code for direct debit.
- ///
- /// The customer record.
- /// Set to true to skip the default update.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateDirectDebitPmtTermsCode(var Customer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the city field.
- ///
- /// The customer record.
- /// The post code record for validation.
- /// The current field number being validated.
- /// Set to true to skip the default validation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateCustomerBankAccounts(var Customer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateCity(var Customer: Record Customer; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the VAT registration number.
- ///
- /// The customer record.
- /// The previous customer record.
- /// The field number being validated.
- /// Set to true to skip the default validation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateVATRegistrationNo(var Customer: Record "Customer"; xCustomer: Record "Customer"; FieldNumber: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the post code field.
- ///
- /// The customer record.
- /// The post code record for validation.
- /// The current field number being validated.
- /// Set to true to skip the default validation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePostCode(var Customer: Record Customer; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating a shortcut dimension code.
- ///
- /// The customer record.
- /// The previous customer record.
- /// The dimension field number.
- /// The dimension value code to validate.
- /// Set to true to skip the default validation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShortcutDimCode(var Customer: Record Customer; var xCustomer: Record Customer; FieldNumber: Integer; var ShortcutDimCode: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the VAT registration number format and VIES service.
- ///
- /// The customer record.
- /// Set to true to skip the default VAT validation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeVATRegistrationValidation(var Customer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before the customer find set operation in GetCustNoOpenCard.
- ///
- /// The customer record to be searched.
- [IntegrationEvent(false, false)]
- local procedure OnGetCustNoOpenCardOnBeforeCustomerFindSet(var Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised before filtering the customer in GetCustNoOpenCard.
- ///
- /// The customer record to be filtered.
- [IntegrationEvent(false, false)]
- local procedure OnGetCustNoOpenCardOnBeforeFilterCustomer(var Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised after setting customer filters in GetCustNoOpenCard.
- ///
- /// The customer record with filters applied.
- /// The filter text containing the search criteria.
- [IntegrationEvent(false, false)]
- local procedure OnGetCustNoOpenCardOnAfterSetCustomerFilters(var Customer: Record Customer; var CustomerFilterContains: Text);
- begin
- end;
-
- ///
- /// Raised before searching for customers with similar names.
- ///
- /// The customer record to be searched.
- [IntegrationEvent(false, false)]
- local procedure OnMarkCustomersWithSimilarNameOnBeforeCustomerFindSet(var Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised before checking the customer-contact business relation.
- ///
- /// The contact record.
- /// The contact business relation record.
- /// Set to true to skip the default check.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckCustomerContactRelation(Cont: Record Contact; ContBusRel: Record "Contact Business Relation"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the Contact field.
- ///
- /// Set to true to skip the default validation.
- /// The customer record.
- [IntegrationEvent(true, false)]
- local procedure OnBeforeValidateContact(var IsHandled: Boolean; var Customer: Record Customer)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeValidatePartnerType(var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the email address field.
- ///
- /// The customer record.
- /// Set to true to skip the default validation.
- /// The previous customer record.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateEmail(var Customer: Record Customer; var IsHandled: Boolean; xCustomer: Record Customer)
- begin
- end;
-
- ///
- /// Raised before executing the ShowContact procedure.
- ///
- /// The customer record.
- /// The contact business relation record.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowContact(var Customer: Record Customer; var ContactBusinessRelation: Record "Contact Business Relation")
- begin
- end;
-
- ///
- /// Raised before opening the contact card from ShowContact.
- ///
- /// The contact record to display.
- /// The page ID to use for displaying the contact.
- [IntegrationEvent(false, false)]
- local procedure OnShowContactOnBeforeOpenContactCard(var Contact: Record Contact; var ContactPageID: Integer)
- begin
- end;
-
- ///
- /// Raised before opening the contact list from ShowContact.
- ///
- /// The contact record for the list.
- /// The page ID to use for displaying the contact list.
- [IntegrationEvent(false, false)]
- local procedure OnShowContactOnBeforeOpenContactList(var Contact: Record Contact; var ContactPageID: Integer)
- begin
- end;
-
- ///
- /// Raised after applying the initial customer filter from start in GetCustNoOpenCard.
- ///
- /// The customer record with the initial filter applied.
- [IntegrationEvent(false, false)]
- local procedure OnGetCustNoOpenCardOnAfterOnAfterCustomerFilterFromStart(var Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised before the Customer.FindFirst() operation after setting the name filter in GetCustNoOpenCard.
- ///
- /// The customer record with applied filters.
- /// Set to true to skip the FindFirst check and continue with alternative search logic.
- [IntegrationEvent(false, false)]
- local procedure OnGetCustNoOpenCardOnBeforeCustomerFindFirst(var Customer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before displaying the customer blocked error message.
- ///
- /// The blocked customer record.
- /// Indicates if this is a posting transaction.
- /// Set to true to skip the default error message.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCustBlockedErrorMessage(Cust2: Record Customer; Transaction: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before calculating available credit.
- ///
- /// The customer record.
- /// Indicates if called from UI context.
- /// The credit limit in local currency to use.
- /// Set to the result to override the calculation.
- /// Set to true to skip the default calculation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCalcAvailableCreditCommon(var Rec: Record Customer; CalledFromUI: Boolean; var CreditLimitLCY: Decimal; var Result: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before calculating the balance from the linked vendor.
- ///
- /// The linked vendor record.
- [IntegrationEvent(false, false)]
- local procedure OnGetBalanceAsVendorOnBeforeCalcBalance(var Vendor: Record Vendor)
- begin
- end;
-
- ///
- /// Raised before validating the registration number.
- ///
- /// The customer record.
- /// Set to true to skip the default validation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateRegistrationNumber(var Customer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking if multiple posting groups are allowed.
- ///
- /// Set to true to skip the default check.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckAllowMultiplePostingGroups(var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after marking customers with similar names in GetCustNoOpenCard.
- ///
- /// The customer record with marked similar names.
- [IntegrationEvent(false, false)]
- local procedure OnGetCustNoOpenCardOnAfterMarkCustomersWithSimilarName(var Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised after calculating fields in GetTotalAmountLCY.
- ///
- /// The customer record with calculated fields.
- [IntegrationEvent(false, false)]
- local procedure OnGetTotalAmountLCYOnAfterCalcFields(var Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised after setting auto-calculated fields in GetTotalAmountLCYUI.
- ///
- /// The customer record with auto-calculated fields set.
- [IntegrationEvent(false, false)]
- local procedure OnGetTotalAmountLCYUIOnAfterSetAutoCalcFields(var Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised after calculating the common total amount in local currency.
- ///
- /// The customer record.
- /// The calculated total amount that can be modified.
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetTotalAmountLCYCommon(var Customer: Record Customer; var TotalAmountLCY: Decimal)
- begin
- end;
-
- ///
- /// Raised after getting the VAT registration number.
- ///
- /// The customer record.
- /// The VAT registration number that can be modified.
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetVATRegistrationNo(var Customer: Record Customer; var VATRegNo: Text[20]);
- begin
- end;
-
-}
diff --git a/src/Layers/NL/BaseApp/Sales/Customer/CustomerBankAccount.Table.al b/src/Layers/NL/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
index cbbd0146f6..0c17b0dda6 100644
--- a/src/Layers/NL/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
+++ b/src/Layers/NL/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
@@ -4,14 +4,12 @@
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Sales.Customer;
-using Microsoft.Bank.DirectDebit;
using Microsoft.Bank.Payment;
using Microsoft.Bank.Setup;
using Microsoft.Finance.Currency;
using Microsoft.Foundation.Address;
using Microsoft.Foundation.Company;
using Microsoft.Sales.Receivables;
-using Microsoft.Utilities;
using System.Email;
using System.Globalization;
@@ -178,13 +176,7 @@ table 287 "Customer Bank Account"
ToolTip = 'Specifies the number used by the bank for the bank account.';
trigger OnValidate()
- var
- LocalFunctionalityMgt: Codeunit "Local Functionality Mgt.";
begin
- if not LocalFunctionalityMgt.CheckBankAccNo("Bank Account No.", "Country/Region Code", "Bank Account No.") then
- Message(Text1000001, "Bank Account No.");
-
- UpdateBankAccountNo();
OnValidateBankAccount(Rec, 'Bank Account No.');
end;
}
@@ -338,64 +330,6 @@ table 287 "Customer Bank Account"
TableRelation = "Bank Clearing Standard";
ToolTip = 'Specifies the format standard to be used in bank transfers if you use the Bank Clearing Code field to identify you as the sender.';
}
- field(11000000; "Account Holder Name"; Text[100])
- {
- Caption = 'Account Holder Name';
- }
- field(11000001; "Account Holder Address"; Text[100])
- {
- Caption = 'Account Holder Address';
- }
- field(11000002; "Account Holder Post Code"; Code[20])
- {
- Caption = 'Account Holder Post Code';
- TableRelation = if ("Acc. Hold. Country/Region Code" = const('')) "Post Code"
- else
- if ("Acc. Hold. Country/Region Code" = filter(<> '')) "Post Code" where("Country/Region Code" = field("Acc. Hold. Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnValidate()
- begin
- PostCode.ValidatePostCode("Account Holder City", "Account Holder Post Code", County, "Acc. Hold. Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- end;
- }
- field(11000003; "Account Holder City"; Text[30])
- {
- Caption = 'Account Holder City';
- TableRelation = if ("Acc. Hold. Country/Region Code" = const('')) "Post Code".City
- else
- if ("Acc. Hold. Country/Region Code" = filter(<> '')) "Post Code".City where("Country/Region Code" = field("Acc. Hold. Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnValidate()
- begin
- PostCode.ValidateCity("Account Holder City", "Account Holder Post Code", County, "Acc. Hold. Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- end;
- }
- field(11000004; "Acc. Hold. Country/Region Code"; Code[10])
- {
- Caption = 'Acc. Hold. Country/Region Code';
- TableRelation = "Country/Region";
- }
- field(11000005; "National Bank Code"; Code[10])
- {
- Caption = 'National Bank Code';
- }
- field(11000007; "Abbrev. National Bank Code"; Code[3])
- {
- Caption = 'Abbrev. National Bank Code';
- }
- field(11000008; "Direct Debit Mandate ID"; Code[35])
- {
- Caption = 'Direct Debit Mandate ID';
- TableRelation = "SEPA Direct Debit Mandate" where("Customer No." = field("Customer No."),
- "Customer Bank Account Code" = field(Code));
-
- trigger OnValidate()
- begin
- UpdateMandateID();
- end;
- }
}
keys
@@ -428,35 +362,15 @@ table 287 "Customer Bank Account"
UpdateCustPreferredBankAccountCode();
end;
- trigger OnInsert()
- begin
- Cust.Get("Customer No.");
- "Account Holder Name" := Cust.Name;
- "Account Holder Address" := Cust.Address;
- "Account Holder Post Code" := Cust."Post Code";
- "Account Holder City" := Cust.City;
- "Acc. Hold. Country/Region Code" := Cust."Country/Region Code";
- end;
-
trigger OnRename()
begin
end;
var
PostCode: Record "Post Code";
- Cust: Record Customer;
- Text1000001: Label 'Bank Account No. %1 may be incorrect.';
BankAccIdentifierIsEmptyErr: Label 'You must specify either a Bank Account No. or an IBAN.';
BankAccDeleteErr: Label 'You cannot delete this bank account because it is associated with one or more open ledger entries.';
- local procedure UpdateMandateID()
- var
- ProposalLine: Record "Proposal Line";
- begin
- if FindProposalLines(ProposalLine) then
- ProposalLine.ModifyAll("Direct Debit Mandate ID", "Direct Debit Mandate ID")
- end;
-
local procedure UpdateIBAN()
var
ProposalLine: Record "Proposal Line";
@@ -473,14 +387,6 @@ table 287 "Customer Bank Account"
ProposalLine.ModifyAll("SWIFT Code", "SWIFT Code")
end;
- local procedure UpdateBankAccountNo()
- var
- ProposalLine: Record "Proposal Line";
- begin
- if FindProposalLines(ProposalLine) then
- ProposalLine.ModifyAll("Bank Account No.", "Bank Account No.")
- end;
-
local procedure FindProposalLines(var ProposalLine: Record "Proposal Line"): Boolean
begin
ProposalLine.SetRange("Account Type", ProposalLine."Account Type"::Customer);
diff --git a/src/Layers/NL/BaseApp/Sales/Customer/CustomerBankAccountCard.Page.al b/src/Layers/NL/BaseApp/Sales/Customer/CustomerBankAccountCard.Page.al
deleted file mode 100644
index a5208063fc..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Customer/CustomerBankAccountCard.Page.al
+++ /dev/null
@@ -1,224 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.Customer;
-
-using Microsoft.Bank.DirectDebit;
-using Microsoft.Foundation.Address;
-
-///
-/// Displays and edits customer bank account details including transfer information and direct debit mandates.
-///
-page 423 "Customer Bank Account Card"
-{
- Caption = 'Customer Bank Account Card';
- PageType = Card;
- SourceTable = "Customer Bank Account";
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field("Code"; Rec.Code)
- {
- ApplicationArea = Basic, Suite;
- }
- field(Name; Rec.Name)
- {
- ApplicationArea = Basic, Suite;
- }
- field(Address; Rec.Address)
- {
- ApplicationArea = Basic, Suite;
- }
- field("Address 2"; Rec."Address 2")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Post Code"; Rec."Post Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field(City; Rec.City)
- {
- ApplicationArea = Basic, Suite;
- }
- field("Country/Region Code"; Rec."Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- trigger OnValidate()
- begin
- IsCountyVisible := FormatAddress.UseCounty(Rec."Country/Region Code");
- end;
- }
- group(CountyGroup)
- {
- ShowCaption = false;
- Visible = IsCountyVisible;
- field(County; Rec.County)
- {
- ApplicationArea = Basic, Suite;
- }
- }
- field("Phone No."; Rec."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- }
- field(Contact; Rec.Contact)
- {
- ApplicationArea = Basic, Suite;
- }
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- }
- field("Bank Branch No."; Rec."Bank Branch No.")
- {
- ApplicationArea = Basic, Suite;
- MaskType = Concealed;
- }
- field("Bank Account No."; Rec."Bank Account No.")
- {
- ApplicationArea = Basic, Suite;
- MaskType = Concealed;
- }
- field("Transit No."; Rec."Transit No.")
- {
- ApplicationArea = Basic, Suite;
- MaskType = Concealed;
- }
- }
- group(Communication)
- {
- Caption = 'Communication';
- field("Fax No."; Rec."Fax No.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("E-Mail"; Rec."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- ExtendedDatatype = EMail;
- }
- field("Home Page"; Rec."Home Page")
- {
- ApplicationArea = Basic, Suite;
- }
- }
- group(Transfer)
- {
- Caption = 'Transfer';
- field("SWIFT Code"; Rec."SWIFT Code")
- {
- ApplicationArea = Basic, Suite;
- MaskType = Concealed;
- }
- field(IBAN; Rec.IBAN)
- {
- ApplicationArea = Basic, Suite;
- MaskType = Concealed;
- }
- field("Direct Debit Mandate ID"; Rec."Direct Debit Mandate ID")
- {
- ApplicationArea = Basic, Suite;
- LookupPageID = "SEPA Direct Debit Mandates";
- ToolTip = 'Specifies the direct debit mandate of the customer that this bank account is for.';
- }
- }
- group("Account Holder")
- {
- Caption = 'Account Holder';
- field("Account Holder Name"; Rec."Account Holder Name")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the bank account owner''s name.';
- }
- field("Account Holder Address"; Rec."Account Holder Address")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the bank account owner''s address.';
- }
- field("Account Holder Post Code"; Rec."Account Holder Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Account Holder Post Code/City';
- ToolTip = 'Specifies the bank account owner''s postal code.';
- }
- field("Account Holder City"; Rec."Account Holder City")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the bank account owner''s city.';
- }
- field("Acc. Hold. Country/Region Code"; Rec."Acc. Hold. Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the country/region of the bank account holder.';
- }
- field("Bank Clearing Standard"; Rec."Bank Clearing Standard")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Bank Clearing Code"; Rec."Bank Clearing Code")
- {
- ApplicationArea = Basic, Suite;
- }
- }
- }
- area(factboxes)
- {
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- Visible = false;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- action("Direct Debit Mandates")
- {
- ApplicationArea = Suite;
- Caption = 'Direct Debit Mandates';
- Image = MakeAgreement;
- RunObject = Page "SEPA Direct Debit Mandates";
- RunPageLink = "Customer No." = field("Customer No."),
- "Customer Bank Account Code" = field(Code);
- ToolTip = 'View or edit direct-debit mandates that you set up to reflect agreements with customers to collect invoice payments from their bank account.';
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process';
-
- actionref("Direct Debit Mandates_Promoted"; "Direct Debit Mandates")
- {
- }
- }
- }
- }
-
- trigger OnAfterGetRecord()
- begin
- IsCountyVisible := FormatAddress.UseCounty(Rec."Country/Region Code");
- end;
-
- var
- FormatAddress: Codeunit "Format Address";
- IsCountyVisible: Boolean;
-}
-
diff --git a/src/Layers/NL/BaseApp/Sales/Customer/CustomerBankAccountList.Page.al b/src/Layers/NL/BaseApp/Sales/Customer/CustomerBankAccountList.Page.al
deleted file mode 100644
index 16f52e35cf..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Customer/CustomerBankAccountList.Page.al
+++ /dev/null
@@ -1,137 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.Customer;
-
-using Microsoft.Bank.DirectDebit;
-
-///
-/// Lists bank accounts associated with a customer for payment processing.
-///
-page 424 "Customer Bank Account List"
-{
- Caption = 'Customer Bank Account List';
- CardPageID = "Customer Bank Account Card";
- DataCaptionFields = "Customer No.";
- Editable = false;
- PageType = List;
- SourceTable = "Customer Bank Account";
-
- layout
- {
- area(content)
- {
- repeater(Control1)
- {
- ShowCaption = false;
- field("Code"; Rec.Code)
- {
- ApplicationArea = Basic, Suite;
- }
- field(Name; Rec.Name)
- {
- ApplicationArea = Basic, Suite;
- }
- field("Post Code"; Rec."Post Code")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Country/Region Code"; Rec."Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Phone No."; Rec."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Fax No."; Rec."Fax No.")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field(Contact; Rec.Contact)
- {
- ApplicationArea = Basic, Suite;
- }
- field("Bank Account No."; Rec."Bank Account No.")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("SWIFT Code"; Rec."SWIFT Code")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field(IBAN; Rec.IBAN)
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Direct Debit Mandate ID"; Rec."Direct Debit Mandate ID")
- {
- ApplicationArea = Basic, Suite;
- LookupPageID = "SEPA Direct Debit Mandates";
- ToolTip = 'Specifies the direct debit mandate of the customer that this bank account is for.';
- Visible = false;
- }
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- Visible = false;
- }
- field("Language Code"; Rec."Language Code")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- }
- }
- area(factboxes)
- {
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- Visible = false;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- action("Direct Debit Mandates")
- {
- ApplicationArea = Suite;
- Caption = 'Direct Debit Mandates';
- Image = MakeAgreement;
- RunObject = Page "SEPA Direct Debit Mandates";
- RunPageLink = "Customer No." = field("Customer No."),
- "Customer Bank Account Code" = field(Code);
- Scope = Repeater;
- ToolTip = 'View or edit direct-debit mandates that you set up to reflect agreements with customers to collect invoice payments from their bank account.';
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process';
-
- actionref("Direct Debit Mandates_Promoted"; "Direct Debit Mandates")
- {
- }
- }
- }
- }
-}
-
diff --git a/src/Layers/NL/BaseApp/Sales/Customer/CustomerCard.Page.al b/src/Layers/NL/BaseApp/Sales/Customer/CustomerCard.Page.al
deleted file mode 100644
index 228ccd9a9c..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Customer/CustomerCard.Page.al
+++ /dev/null
@@ -1,2976 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.Customer;
-
-using Microsoft.Bank.DirectDebit;
-using Microsoft.Bank.Payment;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Duplicates;
-using Microsoft.CRM.Outlook;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.VAT.Registration;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Attachment;
-using Microsoft.Foundation.Calendar;
-using Microsoft.Foundation.Comment;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Integration.D365Sales;
-using Microsoft.Integration.Dataverse;
-using Microsoft.Integration.SyncEngine;
-using Microsoft.Inventory.Item.Catalog;
-using Microsoft.Inventory.Tracking;
-using Microsoft.Pricing.Calculation;
-using Microsoft.Pricing.PriceList;
-using Microsoft.Pricing.Source;
-using Microsoft.Projects.Project.Job;
-using Microsoft.Sales.Analysis;
-using Microsoft.Sales.Document;
-using Microsoft.Sales.FinanceCharge;
-using Microsoft.Sales.Pricing;
-using Microsoft.Sales.Receivables;
-using Microsoft.Sales.Reminder;
-using Microsoft.Sales.Reports;
-using Microsoft.Sales.Setup;
-using Microsoft.Utilities;
-using System.Automation;
-using System.Email;
-using System.Environment;
-using System.Environment.Configuration;
-using System.Integration.Word;
-using System.Privacy;
-
-///
-/// Provides detailed view and management of an individual customer's master data.
-///
-page 21 "Customer Card"
-{
- Caption = 'Customer Card';
- PageType = Card;
- RefreshOnActivate = true;
- SourceTable = Customer;
- AdditionalSearchTerms = 'Customer Profile, Client Details, Buyer Information, Customer Data, Customer View, Client Profile, Customer Detail, Client Info';
-
- AboutTitle = 'About customer details';
- AboutText = 'With the **Customer Card** you manage information about a customer and specify the terms of business, such as payment terms, prices and discounts. From here you can also drill down on past and ongoing sales activity.';
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field("No."; Rec."No.")
- {
- ApplicationArea = All;
- Importance = Standard;
- Visible = NoFieldVisible;
-
- trigger OnAssistEdit()
- begin
- if Rec.AssistEdit(xRec) then
- CurrPage.Update();
- end;
- }
- field(Name; Rec.Name)
- {
- ApplicationArea = All;
- Importance = Promoted;
- ShowMandatory = true;
- trigger OnValidate()
- begin
- CurrPage.Update(true);
- end;
- }
- field("Name 2"; Rec."Name 2")
- {
- ApplicationArea = All;
- Importance = Additional;
- Visible = false;
- }
- field("Search Name"; Rec."Search Name")
- {
- ApplicationArea = All;
- Importance = Additional;
- Visible = false;
- }
- field("IC Partner Code"; Rec."IC Partner Code")
- {
- ApplicationArea = Intercompany;
- Importance = Additional;
- }
- field("Balance (LCY)"; Rec."Balance (LCY)")
- {
- ApplicationArea = Basic, Suite;
- trigger OnDrillDown()
- begin
- Rec.OpenCustomerLedgerEntries(false);
- end;
- }
- field(BalanceAsVendor; BalanceAsVendor)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Balance (LCY) As Vendor';
- Editable = false;
- Enabled = BalanceAsVendorEnabled;
- ToolTip = 'Specifies the amount that you owe to this company. This is relevant when your customer is also your vendor. Customer and vendor are linked together through their contact record. Using customer''s contact record you can create linked vendor or link contact with existing vendor to enable calculation of Balance As Vendor amount.';
-
- trigger OnDrillDown()
- var
- DtldVendLedgEntry: Record 380;
- VendLedgEntry: Record 25;
- begin
- if LinkedVendorNo = '' then
- exit;
- DtldVendLedgEntry.SetRange("Vendor No.", LinkedVendorNo);
- Rec.CopyFilter("Global Dimension 1 Filter", DtldVendLedgEntry."Initial Entry Global Dim. 1");
- Rec.CopyFilter("Global Dimension 2 Filter", DtldVendLedgEntry."Initial Entry Global Dim. 2");
- Rec.CopyFilter("Currency Filter", DtldVendLedgEntry."Currency Code");
- VendLedgEntry.DrillDownOnEntries(DtldVendLedgEntry);
- end;
- }
- field("Balance Due (LCY)"; Rec."Balance Due (LCY)")
- {
- ApplicationArea = Basic, Suite;
- trigger OnDrillDown()
- begin
- Rec.OpenCustomerLedgerEntries(true);
- end;
- }
- field("Credit Limit (LCY)"; Rec."Credit Limit (LCY)")
- {
- ApplicationArea = Basic, Suite;
- StyleExpr = StyleTxt;
- trigger OnValidate()
- begin
- SetCreditLimitStyle();
- end;
- }
- field(Blocked; Rec.Blocked)
- {
- ApplicationArea = Basic, Suite;
- }
- field("Privacy Blocked"; Rec."Privacy Blocked")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Salesperson Code"; Rec."Salesperson Code")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- field("Responsibility Center"; Rec."Responsibility Center")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- field("Document Sending Profile"; Rec."Document Sending Profile")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field(TotalSales2; CustSalesLCY)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Total Sales - Fiscal Year';
- Style = Strong;
- StyleExpr = true;
- Editable = false;
- ToolTip = 'Specifies your total sales turnover with the customer in the current fiscal year. It is calculated from amounts excluding VAT on all completed and open invoices and credit memos.';
-
- trigger OnDrillDown()
- begin
- OpenCurrFiscalYearCustLedgerEntries();
- end;
- }
- field("CustSalesLCY - CustProfit - AdjmtCostLCY"; CustSalesLCY - CustProfit - AdjmtCostLCY)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Costs (LCY)';
- ToolTip = 'Specifies how much cost you have incurred from the customer in the current fiscal year.';
- }
- field(AdjCustProfit; AdjCustProfit)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Profit (LCY)';
- Editable = false;
- Importance = Additional;
- ToolTip = 'Specifies how much profit you have made from the customer in the current fiscal year.';
- }
- field(AdjProfitPct; AdjProfitPct)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 0;
- Caption = 'Profit %';
- DecimalPlaces = 1 : 1;
- Editable = false;
- Importance = Additional;
- ToolTip = 'Specifies how much profit you have made from the customer in the current fiscal year, expressed as a percentage of the customer''s total sales.';
- }
- field("Last Date Modified"; Rec."Last Date Modified")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Disable Search by Name"; Rec."Disable Search by Name")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field(Priority; Rec.Priority)
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = false;
- }
- field("Statistics Group"; Rec."Statistics Group")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- }
- group("Address & Contact")
- {
- Caption = 'Address & Contact';
- group(AddressDetails)
- {
- Caption = 'Address';
- field(Address; Rec.Address)
- {
- ApplicationArea = Basic, Suite;
- }
- field("Address 2"; Rec."Address 2")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Country/Region Code"; Rec."Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- trigger OnValidate()
- begin
- IsCountyVisible := FormatAddress.UseCounty(Rec."Country/Region Code");
- end;
- }
- field(City; Rec.City)
- {
- ApplicationArea = Basic, Suite;
- }
- group(Control10)
- {
- ShowCaption = false;
- Visible = IsCountyVisible;
- field(County; Rec.County)
- {
- ApplicationArea = Basic, Suite;
- }
- }
- field("Post Code"; Rec."Post Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field(ShowMap; ShowMapLbl)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ShowCaption = false;
- Style = StrongAccent;
- StyleExpr = true;
- ToolTip = 'Specifies the customer''s address on your preferred map website.';
-
- trigger OnDrillDown()
- begin
- CurrPage.Update(true);
- Rec.DisplayMap();
- end;
- }
- }
- field("Phone No."; Rec."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- }
- field(MobilePhoneNo; Rec."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- ExtendedDatatype = PhoneNo;
- }
- field("E-Mail"; Rec."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- ExtendedDatatype = EMail;
- Importance = Promoted;
- }
- field("Fax No."; Rec."Fax No.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Home Page"; Rec."Home Page")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Language Code"; Rec."Language Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Format Region"; Rec."Format Region")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- group(ContactDetails)
- {
- Caption = 'Contact';
- field("Primary Contact No."; Rec."Primary Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact Code';
- Importance = Additional;
- }
- field(ContactName; Rec.Contact)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact Name';
- Editable = ContactEditable;
- Importance = Promoted;
- trigger OnValidate()
- begin
- ActivateFields();
- end;
- }
- }
- }
- group(Invoicing)
- {
- Caption = 'Invoicing';
- AboutTitle = 'Manage the customer''s invoicing';
- AboutText = 'Specify tax settings and choose how invoicing takes place for the customer. Assign posting groups to control how the customer''s transactions are grouped and posted, based on type of trade or market.';
-
- field("Bill-to Customer No."; Rec."Bill-to Customer No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Bill-to Customer';
- Importance = Additional;
- }
- field("VAT Registration No."; Rec."VAT Registration No.")
- {
- ApplicationArea = VAT;
- trigger OnDrillDown()
- var
- VATRegistrationLogMgt: Codeunit "VAT Registration Log Mgt.";
- begin
- VATRegistrationLogMgt.AssistEditCustomerVATReg(Rec);
- end;
- }
- field("EORI Number"; Rec."EORI Number")
- {
- ApplicationArea = Basic, Suite;
- }
- field(GLN; Rec.GLN)
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Use GLN in Electronic Document"; Rec."Use GLN in Electronic Document")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Copy Sell-to Addr. to Qte From"; Rec."Copy Sell-to Addr. to Qte From")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Tax Liable"; Rec."Tax Liable")
- {
- ApplicationArea = SalesTax;
- }
- field("Tax Area Code"; Rec."Tax Area Code")
- {
- ApplicationArea = SalesTax;
- }
- field("Registration Number"; Rec."Registration Number")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- group(PostingDetails)
- {
- Caption = 'Posting Details';
- field("Gen. Bus. Posting Group"; Rec."Gen. Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- ShowMandatory = true;
- }
- field("VAT Bus. Posting Group"; Rec."VAT Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Customer Posting Group"; Rec."Customer Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- ShowMandatory = true;
- }
- field("Allow Multiple Posting Groups"; Rec."Allow Multiple Posting Groups")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = IsAllowMultiplePostingGroupsVisible;
- }
- }
- group(PricesandDiscounts)
- {
- Caption = 'Prices and Discounts';
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- field("Price Calculation Method"; Rec."Price Calculation Method")
- {
- Visible = ExtendedPriceEnabled;
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Customer Price Group"; Rec."Customer Price Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Customer Disc. Group"; Rec."Customer Disc. Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Allow Line Disc."; Rec."Allow Line Disc.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Invoice Disc. Code"; Rec."Invoice Disc. Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- NotBlank = true;
- }
- field("Prices Including VAT"; Rec."Prices Including VAT")
- {
- ApplicationArea = VAT;
- Importance = Additional;
- }
- }
- }
- group(Payments)
- {
- Caption = 'Payments';
- AboutTitle = 'Manage the customer''s payment';
- AboutText = 'Specify the customer''s default payment terms and settings for how payments from the customer is processed.';
-
- field("Prepayment %"; Rec."Prepayment %")
- {
- ApplicationArea = Prepayments;
- Importance = Additional;
- }
- field("Application Method"; Rec."Application Method")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Partner Type"; Rec."Partner Type")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Intrastat Partner Type"; Rec."Intrastat Partner Type")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Payment Terms Code"; Rec."Payment Terms Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- ShowMandatory = true;
- }
- field("Payment Method Code"; Rec."Payment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Reminder Terms Code"; Rec."Reminder Terms Code")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- field("Fin. Charge Terms Code"; Rec."Fin. Charge Terms Code")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- field("Cash Flow Payment Terms Code"; Rec."Cash Flow Payment Terms Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Print Statements"; Rec."Print Statements")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Last Statement No."; Rec."Last Statement No.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Block Payment Tolerance"; Rec."Block Payment Tolerance")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the transaction mode commonly used in telebanking for this customer.';
- }
- field("Preferred Bank Account Code"; Rec."Preferred Bank Account Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Exclude from Pmt. Practices"; Rec."Exclude from Pmt. Practices")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- }
- group(Shipping)
- {
- Caption = 'Shipping';
- field("Ship-to Code"; Rec."Ship-to Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Location Code"; Rec."Location Code")
- {
- ApplicationArea = Location;
- Importance = Promoted;
- }
- field("Combine Shipments"; Rec."Combine Shipments")
- {
- ApplicationArea = Basic, Suite;
- }
- field(Reserve; Rec.Reserve)
- {
- ApplicationArea = Reservation;
- }
- field("Shipping Advice"; Rec."Shipping Advice")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- group("Shipment Method")
- {
- Caption = 'Shipment Method';
- field("Shipment Method Code"; Rec."Shipment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Code';
- Importance = Promoted;
- }
- field("Shipping Agent Code"; Rec."Shipping Agent Code")
- {
- ApplicationArea = Suite;
- Caption = 'Agent';
- Importance = Additional;
- }
- field("Shipping Agent Service Code"; Rec."Shipping Agent Service Code")
- {
- ApplicationArea = Suite;
- Caption = 'Agent Service';
- Importance = Additional;
- }
- }
- field("Shipping Time"; Rec."Shipping Time")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- field("Base Calendar Code"; Rec."Base Calendar Code")
- {
- ApplicationArea = Basic, Suite;
- DrillDown = false;
- }
- field("Customized Calendar"; Format(HasCustomBaseCalendar()))
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customized Calendar';
- Editable = false;
- ToolTip = 'Specifies that you have set up a customized version of a base calendar.';
-
- trigger OnDrillDown()
- begin
- CurrPage.SaveRecord();
- Rec.TestField("Base Calendar Code");
- CalendarMgmt.ShowCustomizedCalendar(Rec);
- end;
- }
- }
- group(Statistics)
- {
- Caption = 'Statistics';
- Editable = false;
- Visible = FoundationOnly;
- group(GeneralStats)
- {
- Caption = 'General';
- field(CustomerSince; Rec."First Transaction Date")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer Since';
- ToolTip = 'Specifies the date when the first transaction with the customer was recorded.';
- Importance = Additional;
- }
- field(DaysSinceLastSale; DaysSinceLastSale)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Days Since Last Sale';
- ToolTip = 'Specifies the number of days since you last had a sale to the customer.';
- Importance = Additional;
- }
- field(DistinctItemsSold; DistinctItemsSold)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Distinct Items Sold';
- ToolTip = 'Specifies the number of distinct items that you have sold to the customer in the current fiscal year.';
- Importance = Additional;
- }
- }
- group(Balance)
- {
- Caption = 'Balance';
- field("Balance (LCY)2"; Rec."Balance (LCY)")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Money Owed - Current';
- trigger OnDrillDown()
- begin
- Rec.OpenCustomerLedgerEntries(false);
- end;
- }
- field(ExpectedCustMoneyOwed; ExpectedMoneyOwed)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 1;
- AutoFormatExpression = Rec."Currency Code";
- Caption = 'Money Owed - Expected';
- Editable = false;
- Importance = Additional;
- ToolTip = 'Specifies the payment amount that the customer will owe when ongoing sales invoices and credit memos are completed. The value is calculated asynchronously so there might be a delay in updating this field.';
-
- trigger OnDrillDown()
- begin
- CustomerMgt.DrillDownMoneyOwedExpected(Rec."No.");
- end;
- }
- field(TotalMoneyOwed; TotalMoneyOwed)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 1;
- AutoFormatExpression = Rec."Currency Code";
- Caption = 'Money Owed - Total';
- Style = Strong;
- StyleExpr = true;
- ToolTip = 'Specifies the payment amount that the customer owes for completed sales plus sales that are still ongoing. The value is calculated asynchronously so there might be a delay in updating this field.';
- }
- field(CreditLimit; Rec."Credit Limit (LCY)")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Credit Limit';
- }
- field(CalcCreditLimitLCYExpendedPct; Rec.CalcCreditLimitLCYExpendedPct())
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 0;
- Caption = 'Usage Of Credit Limit';
- ExtendedDatatype = Ratio;
- Style = Attention;
- StyleExpr = BalanceExhausted;
- ToolTip = 'Specifies how much of the customer''s payment balance consists of credit.';
- }
- }
- group(Control108)
- {
- Caption = 'Payments';
- field("Balance Due"; OverdueBalance)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 1;
- AutoFormatExpression = Rec."Currency Code";
- CaptionClass = OverduePaymentsMsg;
- ToolTip = 'Specifies the sum of outstanding payments from the customer.';
-
- trigger OnDrillDown()
- var
- DtldCustLedgEntry: Record "Detailed Cust. Ledg. Entry";
- CustLedgEntry: Record "Cust. Ledger Entry";
- begin
- DtldCustLedgEntry.SetRange("Customer No.", Rec."No.");
- Rec.CopyFilter("Global Dimension 1 Filter", DtldCustLedgEntry."Initial Entry Global Dim. 1");
- Rec.CopyFilter("Global Dimension 2 Filter", DtldCustLedgEntry."Initial Entry Global Dim. 2");
- Rec.CopyFilter("Currency Filter", DtldCustLedgEntry."Currency Code");
- CustLedgEntry.DrillDownOnOverdueEntries(DtldCustLedgEntry);
- end;
- }
- field("Payments (LCY)"; CustPaymentsLCY)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CaptionClass = Format(StrSubstNo(PaymentsThisYearTxt, Format(CustomerMgt.GetCurrentYearFilter())));
- ToolTip = 'Specifies the sum of payments received from the customer in the current fiscal year. Current fiscal year is determined by the system date. The value shown here is calculated asynchronously so there might be a delay in updating this field.';
-
- trigger OnDrillDown()
- begin
- OpenCurrFiscalYearDetailedCustLedgerEntries();
- end;
- }
-#pragma warning disable AA0100
- field("CustomerMgt.AvgDaysToPay(""No."")"; AvgDaysToPay)
-#pragma warning restore AA0100
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 0;
- Caption = 'Average Collection Period (Days)';
- DecimalPlaces = 0 : 1;
- Importance = Additional;
- ToolTip = 'Specifies how long the customer typically takes to pay invoices in the current fiscal year. The value is calculated asynchronously so there might be a delay in updating this field.';
- }
- field(DaysPaidPastDueDate; DaysPastDueDate)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 0;
- Caption = 'Average Late Payments (Days)';
- DecimalPlaces = 0 : 1;
- Importance = Additional;
- Style = Attention;
- StyleExpr = AttentionToPaidDay;
- ToolTip = 'Specifies the average number of days the customer is late with payments. The value is calculated asynchronously so there might be a delay in updating this field.';
- }
- field(PaidLateCount; PaidLateCount)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Invoices Paid Late';
- ToolTip = 'Specifies the number of invoices that were paid late by the customer in the current fiscal year.';
- Importance = Additional;
- }
-
- field(PaidOnTimeCount; PaidOnTimeCount)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Invoices Paid On Time';
- ToolTip = 'Specifies the number of invoices that were paid on time by the customer in the current fiscal year.';
- Importance = Additional;
- }
-
- field(PercentPaidLate; PercentPaidLate)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 0;
- Caption = 'Percent Paid Late';
- ToolTip = 'Specifies the percentage of invoices that were paid late by the customer in the current fiscal year.';
- Importance = Additional;
- DecimalPlaces = 1 : 2;
- }
-
- field(OverdueCount; OverdueCount)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Overdue Payments Count';
- ToolTip = 'Specifies the number of overdue payments for the customer in the current fiscal year.';
- Importance = Additional;
- }
-
- field(LastPaymentDate; LastPaymentDate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Last Payment Receipt Date';
- ToolTip = 'Specifies the date of the last payment received from the customer.';
- Importance = Additional;
- }
-
- field(LastPaymentAmount; LastPaymentAmount)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Last Payment Amount';
- ToolTip = 'Specifies the amount of the last payment received from the customer.';
- Importance = Additional;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- }
- field(LastPaymentOnTime; LastPaymentOnTime)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Last Payment On Time';
- ToolTip = 'Specifies whether the last payment was applied before the due date.';
- Importance = Additional;
- }
- }
- group("Sales This Year")
- {
- Caption = 'Sales This Year';
- field(AmountOnPostedInvoices; AmountOnPostedInvoices)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CaptionClass = StrSubstNo(PostedInvoicesMsg, Format(NoPostedInvoices));
- ToolTip = 'Specifies your sales to the customer in the current fiscal year based on posted sales invoices. The figure in parenthesis Specifies the number of posted sales invoices.';
-
- trigger OnDrillDown()
- begin
- CustomerMgt.DrillDownOnPostedInvoices(Rec."No.")
- end;
- }
- field(AmountOnCrMemo; AmountOnPostedCrMemos)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CaptionClass = StrSubstNo(CreditMemosMsg, Format(NoPostedCrMemos));
- ToolTip = 'Specifies your expected refunds to the customer in the current fiscal year based on posted sales credit memos. The figure in parenthesis shows the number of posted sales credit memos.';
-
- trigger OnDrillDown()
- begin
- CustomerMgt.DrillDownOnPostedCrMemo(Rec."No.")
- end;
- }
- field(AmountOnOutstandingInvoices; AmountOnOutstandingInvoices)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CaptionClass = StrSubstNo(OutstandingInvoicesMsg, Format(NoOutstandingInvoices));
- ToolTip = 'Specifies your expected sales to the customer in the current fiscal year based on ongoing sales invoices. The figure in parenthesis shows the number of ongoing sales invoices.';
-
- trigger OnDrillDown()
- begin
- CustomerMgt.DrillDownOnUnpostedInvoices(Rec."No.")
- end;
- }
- field(AmountOnOutstandingCrMemos; AmountOnOutstandingCrMemos)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CaptionClass = StrSubstNo(OutstandingCrMemosMsg, Format(NoOutstandingCrMemos));
- ToolTip = 'Specifies your refunds to the customer in the current fiscal year based on ongoing sales credit memos. The figure in parenthesis shows the number of ongoing sales credit memos.';
-
- trigger OnDrillDown()
- begin
- CustomerMgt.DrillDownOnUnpostedCrMemos(Rec."No.")
- end;
- }
- field(Totals; Totals)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Total Sales';
- Style = Strong;
- StyleExpr = true;
- ToolTip = 'Specifies your total sales turnover with the customer in the current fiscal year. It is calculated from amounts excluding VAT on all completed and open invoices and credit memos.';
- }
- field(CustInvDiscAmountLCY; CustInvDiscAmountLCY)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Invoice Discounts';
- ToolTip = 'Specifies the total of all invoice discounts that you have granted to the customer in the current fiscal year.';
- }
- }
- group(Interactions)
- {
- Caption = 'Interactions';
- field(InteractionCount; InteractionCount)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Interactions';
- ToolTip = 'Specifies the number of interactions that you have had with the customer in the current fiscal year.';
- Importance = Additional;
- }
- field(LastInteractionDate; LastInteractionDate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Last Interaction Date';
- ToolTip = 'Specifies the date when you last had an interaction with the customer.';
- Importance = Additional;
- }
- field(LastInteractionType; LastInteractionType)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Last Interaction Type';
- ToolTip = 'Specifies the type of the last interaction that you had with the customer.';
- Importance = Additional;
- }
- field(MostFrequentInteractionType; MostFrequentInteractionType)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Most Frequent Interaction Type';
- ToolTip = 'Specifies the type of interaction that you have most frequently with the customer in the current fiscal year.';
- Importance = Additional;
- }
- }
- part(AgedAccReceivableChart; "Aged Acc. Receivable Chart")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("No.");
- }
- }
- }
- area(factboxes)
- {
- part(Control149; "Customer Picture")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("No.");
- Visible = not IsOfficeAddin;
- }
- part("Attached Documents List"; "Doc. Attachment List Factbox")
- {
- ApplicationArea = All;
- Caption = 'Documents';
- UpdatePropagation = Both;
- SubPageLink = "Table ID" = const(Database::Customer),
- "No." = field("No.");
- }
- part(Details; "Office Customer Details")
- {
- ApplicationArea = All;
- Caption = 'Details';
- SubPageLink = "No." = field("No.");
- Visible = IsOfficeAddin;
- }
- part(AgedAccReceivableChart2; "Aged Acc. Receivable Chart")
- {
- ApplicationArea = All;
- SubPageLink = "No." = field("No.");
- Visible = IsOfficeAddin;
- }
- part(Control39; "CRM Statistics FactBox")
- {
- ApplicationArea = All;
- SubPageLink = "No." = field("No.");
- Visible = CRMIsCoupledToRecord;
- }
- part(SalesHistSelltoFactBox; "Sales Hist. Sell-to FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("No."),
- "Currency Filter" = field("Currency Filter"),
- "Date Filter" = field("Date Filter"),
- "Global Dimension 1 Filter" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Filter" = field("Global Dimension 2 Filter");
- }
- part(SalesHistBilltoFactBox; "Sales Hist. Bill-to FactBox")
- {
- ApplicationArea = All;
- SubPageLink = "No." = field("No."),
- "Currency Filter" = field("Currency Filter"),
- "Date Filter" = field("Date Filter"),
- "Global Dimension 1 Filter" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Filter" = field("Global Dimension 2 Filter");
- Visible = false;
- }
- part(CustomerStatisticsFactBox; "Customer Statistics FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("No."),
- "Currency Filter" = field("Currency Filter"),
- "Date Filter" = field("Date Filter"),
- "Global Dimension 1 Filter" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Filter" = field("Global Dimension 2 Filter");
- }
- part(Control1905532107; "Dimensions FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "Table ID" = const(18),
- "No." = field("No.");
- }
- part(WorkflowStatus; "Workflow Status FactBox")
- {
- ApplicationArea = Suite;
- Editable = false;
- Enabled = false;
- ShowFilter = false;
- Visible = ShowWorkflowStatus;
- }
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("&Customer")
- {
- Caption = '&Customer';
- Image = Customer;
- action(Dimensions)
- {
- ApplicationArea = Dimensions;
- Caption = 'Dimensions';
- Image = Dimensions;
- RunObject = Page "Default Dimensions";
- RunPageLink = "Table ID" = const(18),
- "No." = field("No.");
- 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.';
- }
- action("Bank Accounts")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Bank Accounts';
- Image = BankAccount;
- RunObject = Page "Customer Bank Account List";
- RunPageLink = "Customer No." = field("No.");
- ToolTip = 'View or set up the customer''s bank accounts. You can set up any number of bank accounts for each customer.';
- }
- action("Direct Debit Mandates")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Direct Debit Mandates';
- Image = MakeAgreement;
- RunObject = Page "SEPA Direct Debit Mandates";
- RunPageLink = "Customer No." = field("No.");
- ToolTip = 'View the direct-debit mandates that reflect agreements with customers to collect invoice payments from their bank account.';
- }
- action(ShipToAddresses)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Ship-&to Addresses';
- Image = ShipAddress;
- RunObject = Page "Ship-to Address List";
- RunPageLink = "Customer No." = field("No.");
- ToolTip = 'View or edit alternate shipping addresses where the customer wants items delivered if different from the regular address.';
- }
- action(AlternativeVATRegistration)
- {
- ApplicationArea = VAT;
- Caption = 'Alternative VAT Registration';
- Image = VATPostingSetup;
- RunObject = Page "Alt. Cust. VAT Reg.";
- RunPageLink = "Customer No." = field("No.");
- ToolTip = 'View or set up an alternative VAT registration number for the customer.';
- }
- action(Contact)
- {
- AccessByPermission = TableData Contact = R;
- ApplicationArea = Basic, Suite;
- Caption = 'C&ontact';
- Image = ContactPerson;
- ToolTip = 'View or edit detailed information about the contact person at the customer.';
-
- trigger OnAction()
- begin
- Rec.ShowContact();
- end;
- }
- action("Item References")
- {
- AccessByPermission = TableData "Item Reference" = R;
- ApplicationArea = Suite, ItemReferences;
- Caption = 'Item References';
- Image = Change;
- RunObject = Page "Item References";
- RunPageLink = "Reference Type" = const(Customer),
- "Reference Type No." = field("No.");
- RunPageView = sorting("Reference Type", "Reference Type No.");
- ToolTip = 'Set up the customer''s own identification of items that you sell to the customer. Item references to the customer''s item number means that the item number is automatically shown on sales documents instead of the number that you use.';
- }
- action("Co&mments")
- {
- ApplicationArea = Comments;
- Caption = 'Co&mments';
- Image = ViewComments;
- RunObject = Page "Comment Sheet";
- RunPageLink = "Table Name" = const(Customer),
- "No." = field("No.");
- ToolTip = 'View or add comments for the record.';
- }
- action(ApprovalEntries)
- {
- 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()
- begin
- ApprovalsMgmt.OpenApprovalEntriesPage(Rec.RecordId);
- end;
- }
- action(Attachments)
- {
- 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;
- }
- action(CustomerReportSelections)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Document Layouts';
- Image = Quote;
- ToolTip = 'Set up a layout for different types of documents such as invoices, quotes, and credit memos.';
-
- trigger OnAction()
- var
- CustomReportSelection: Record "Custom Report Selection";
- begin
- CustomReportSelection.SetRange("Source Type", DATABASE::Customer);
- CustomReportSelection.SetRange("Source No.", Rec."No.");
- PAGE.RunModal(PAGE::"Customer Report Selections", CustomReportSelection);
- end;
- }
- }
- group(ActionGroupCRM)
- {
- Caption = 'Dataverse';
- Enabled = (BlockedFilterApplied and (Rec.Blocked = Rec.Blocked::" ")) or not BlockedFilterApplied;
- Visible = CRMIntegrationEnabled or CDSIntegrationEnabled;
- action(CRMGotoAccount)
- {
- ApplicationArea = Suite;
- Caption = 'Account';
- Image = CoupledCustomer;
- ToolTip = 'Open the coupled Dataverse account.';
- Visible = CRMIntegrationEnabled or CDSIntegrationEnabled;
-
- trigger OnAction()
- var
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- begin
- CRMIntegrationManagement.ShowCRMEntityFromRecordID(Rec.RecordId);
- end;
- }
- action(CRMSynchronizeNow)
- {
- AccessByPermission = TableData "CRM Integration Record" = IM;
- ApplicationArea = Suite;
- Caption = 'Synchronize';
- Image = Refresh;
- ToolTip = 'Send or get updated data to or from Dataverse.';
- Visible = CRMIntegrationEnabled or CDSIntegrationEnabled;
-
- trigger OnAction()
- var
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- begin
- CRMIntegrationManagement.UpdateOneNow(Rec.RecordId);
- end;
- }
- action(UpdateStatisticsInCRM)
- {
- ApplicationArea = Suite;
- Caption = 'Update Account Statistics';
- Enabled = CRMIsCoupledToRecord;
- Image = UpdateXML;
- ToolTip = 'Send customer statistics data to Dataverse to update the Account Statistics FactBox.';
- Visible = CRMIntegrationEnabled;
-
- trigger OnAction()
- var
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- begin
- CRMIntegrationManagement.CreateOrUpdateCRMAccountStatistics(Rec);
- end;
- }
- group(Coupling)
- {
- Caption = 'Coupling', Comment = 'Coupling is a noun';
- Image = LinkAccount;
- ToolTip = 'Create, change, or delete a coupling between the Business Central record and a Dataverse record.';
- action(ManageCRMCoupling)
- {
- AccessByPermission = TableData "CRM Integration Record" = IM;
- ApplicationArea = Suite;
- Caption = 'Set Up Coupling';
- Image = LinkAccount;
- ToolTip = 'Create or modify the coupling to a Dataverse account.';
- Visible = CRMIntegrationEnabled or CDSIntegrationEnabled;
-
- trigger OnAction()
- var
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- begin
- CRMIntegrationManagement.DefineCoupling(Rec.RecordId);
- end;
- }
- action(DeleteCRMCoupling)
- {
- AccessByPermission = TableData "CRM Integration Record" = D;
- ApplicationArea = Suite;
- Caption = 'Delete Coupling';
- Enabled = CRMIsCoupledToRecord;
- Image = UnLinkAccount;
- ToolTip = 'Delete the coupling to a Dataverse account.';
- Visible = CRMIntegrationEnabled or CDSIntegrationEnabled;
-
- trigger OnAction()
- var
- CRMCouplingManagement: Codeunit "CRM Coupling Management";
- begin
- CRMCouplingManagement.RemoveCoupling(Rec.RecordId);
- end;
- }
- }
- action(ShowLog)
- {
- ApplicationArea = Suite;
- Caption = 'Synchronization Log';
- Image = Log;
- ToolTip = 'View integration synchronization jobs for the customer table.';
- Visible = CRMIntegrationEnabled or CDSIntegrationEnabled;
-
- trigger OnAction()
- var
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- begin
- CRMIntegrationManagement.ShowLog(Rec.RecordId);
- end;
- }
- }
- group(History)
- {
- Caption = 'History';
- Image = History;
- action("Ledger E&ntries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Ledger E&ntries';
- Image = CustomerLedger;
- RunObject = Page "Customer Ledger Entries";
- RunPageLink = "Customer No." = field("No.");
- RunPageView = sorting("Customer No.")
- order(descending);
- ShortCutKey = 'Ctrl+F7';
- ToolTip = 'View the history of transactions that have been posted for the selected record.';
- }
- action(Action76)
- {
- ApplicationArea = Suite;
- Caption = 'Statistics';
- Image = Statistics;
- RunObject = Page "Customer Statistics";
- RunPageLink = "No." = field("No."),
- "Date Filter" = field("Date Filter"),
- "Global Dimension 1 Filter" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Filter" = field("Global Dimension 2 Filter");
- ShortCutKey = 'F7';
- ToolTip = 'View statistical information, such as the value of posted entries, for the record.';
- }
- action(SalesPerPeriod)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Per Period';
- Image = Sales;
- RunObject = Page "Sales Stats. Per Period";
- RunPageLink = "Customer No. Filter" = field("No.");
- ToolTip = 'View sales information for the customer by period.';
- }
- action("S&ales")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'S&ales';
- Image = Sales;
- RunObject = Page "Customer Sales";
- RunPageLink = "No." = field("No."),
- "Global Dimension 1 Filter" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Filter" = field("Global Dimension 2 Filter");
- ToolTip = 'View a summary of customer ledger entries. You select the time interval in the View by field. The Period column on the left contains a series of dates that are determined by the time interval you have selected.';
- }
- action("Entry Statistics")
- {
- ApplicationArea = Suite;
- Caption = 'Entry Statistics';
- Image = EntryStatistics;
- RunObject = Page "Customer Entry Statistics";
- RunPageLink = "No." = field("No."),
- "Date Filter" = field("Date Filter"),
- "Global Dimension 1 Filter" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Filter" = field("Global Dimension 2 Filter");
- ToolTip = 'View entry statistics for the record.';
- }
- action("Statistics by C&urrencies")
- {
- ApplicationArea = Suite;
- Caption = 'Statistics by C&urrencies';
- Image = Currencies;
- RunObject = Page "Cust. Stats. by Curr. Lines";
- RunPageLink = "Customer Filter" = field("No."),
- "Global Dimension 1 Filter" = field("Global Dimension 1 Filter"),
- "Global Dimension 2 Filter" = field("Global Dimension 2 Filter"),
- "Date Filter" = field("Date Filter");
- ToolTip = 'View statistics for customers that use multiple currencies.';
- }
- action("Item &Tracking Entries")
- {
- ApplicationArea = ItemTracking;
- Caption = 'Item &Tracking Entries';
- Image = ItemTrackingLedger;
- ToolTip = 'View serial, lot or package numbers that are assigned to items.';
-
- trigger OnAction()
- var
- ItemTrackingDocMgt: Codeunit "Item Tracking Doc. Management";
- begin
- ItemTrackingDocMgt.ShowItemTrackingForEntity(1, Rec."No.", '', '', '');
- end;
- }
- action("Sent Emails")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sent Emails';
- Image = ShowList;
- ToolTip = 'View a list of emails that you have sent to this customer.';
-
- trigger OnAction()
- var
- Email: Codeunit Email;
- begin
- Email.OpenSentEmails(Database::Customer, Rec.SystemId);
- end;
- }
- separator(Action140)
- {
- }
- }
- group("Prices and Discounts")
- {
- Caption = 'Prices & Discounts';
- action("Invoice &Discounts")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Invoice &Discounts';
- Image = CalculateInvoiceDiscount;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category7;
- RunObject = Page "Cust. Invoice Discounts";
- RunPageLink = Code = field("Invoice Disc. Code");
- ToolTip = 'Set up different discounts that are applied to invoices for the customer. An invoice discount is automatically granted to the customer when the total on a sales invoice exceeds a certain amount.';
- }
- action(PriceLists)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Price Lists';
- Image = Price;
- Visible = ExtendedPriceEnabled;
- ToolTip = 'View or set up sales price lists for products that you sell to the customer. A product price is automatically granted on invoice lines when the specified criteria are met, such as customer, quantity, or ending date.';
-
- trigger OnAction()
- var
- PriceUXManagement: Codeunit "Price UX Management";
- begin
- PriceUXManagement.ShowPriceLists(Rec, Enum::"Price Amount Type"::Any);
- end;
- }
- action(PriceLines)
- {
- AccessByPermission = TableData "Sales Price Access" = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Prices';
- Image = Price;
- Scope = Repeater;
- Visible = ExtendedPriceEnabled;
- ToolTip = 'View or set up sales price lines for products that you sell to the customer. A product price is automatically granted on invoice lines when the specified criteria are met, such as customer, quantity, or ending date.';
-
- trigger OnAction()
- var
- PriceSource: Record "Price Source";
- PriceUXManagement: Codeunit "Price UX Management";
- begin
- Rec.ToPriceSource(PriceSource);
- PriceUXManagement.ShowPriceListLines(PriceSource, Enum::"Price Amount Type"::Price);
- end;
- }
- action(DiscountLines)
- {
- AccessByPermission = TableData "Sales Discount Access" = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Discounts';
- Image = LineDiscount;
- Scope = Repeater;
- Visible = ExtendedPriceEnabled;
- ToolTip = 'View or set up different discounts for products that you sell to the customer. A product line discount is automatically granted on invoice lines when the specified criteria are met, such as customer, quantity, or ending date.';
-
- trigger OnAction()
- var
- PriceSource: Record "Price Source";
- PriceUXManagement: Codeunit "Price UX Management";
- begin
- Rec.ToPriceSource(PriceSource);
- PriceUXManagement.ShowPriceListLines(PriceSource, Enum::"Price Amount Type"::Discount);
- end;
- }
- action(PriceListsDiscounts)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Price Lists (Discounts)';
- Image = LineDiscount;
- Visible = false;
- ToolTip = 'View or set up different discounts for products that you sell to the customer. A product line discount is automatically granted on invoice lines when the specified criteria are met, such as customer, quantity, or ending date.';
-
- trigger OnAction()
- var
- PriceUXManagement: Codeunit "Price UX Management";
- AmountType: Enum "Price Amount Type";
- begin
- PriceUXManagement.ShowPriceLists(Rec, AmountType::Discount);
- end;
- }
- action(Prices)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Prices';
- Image = Price;
- Visible = not ExtendedPriceEnabled;
- ToolTip = 'View or set up different prices for items that you sell to the customer. An item price is automatically granted on invoice lines when the specified criteria are met, such as customer, quantity, or ending date.';
-
- trigger OnAction()
- var
- SalesPrice: Record "Sales Price";
- begin
- SalesPrice.SetCurrentKey("Sales Type", "Sales Code");
- SalesPrice.SetRange("Sales Type", SalesPrice."Sales Type"::Customer);
- SalesPrice.SetRange("Sales Code", Rec."No.");
- Page.Run(Page::"Sales Prices", SalesPrice);
- end;
- }
- action("Line Discounts")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Line Discounts';
- Image = LineDiscount;
- Visible = not ExtendedPriceEnabled;
- ToolTip = 'View or set up different discounts for items that you sell to the customer. An item discount is automatically granted on invoice lines when the specified criteria are met, such as customer, quantity, or ending date.';
-
- trigger OnAction()
- var
- SalesLineDiscount: Record "Sales Line Discount";
- begin
- SalesLineDiscount.SetCurrentKey("Sales Type", "Sales Code");
- SalesLineDiscount.SetRange("Sales Type", SalesLineDiscount."Sales Type"::Customer);
- SalesLineDiscount.SetRange("Sales Code", Rec."No.");
- Page.Run(Page::"Sales Line Discounts", SalesLineDiscount);
- end;
- }
- action("Prices and Discounts Overview")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Prices & Discounts Overview';
- Image = PriceWorksheet;
- Visible = not ExtendedPriceEnabled;
- ToolTip = 'View all the sales prices and line discounts that you grant for this customer when certain criteria are met, such as quantity, or ending date.';
-
- trigger OnAction()
- var
- SalesPriceAndLineDiscounts: Page "Sales Price and Line Discounts";
- begin
- SalesPriceAndLineDiscounts.InitPage(false);
- SalesPriceAndLineDiscounts.LoadCustomer(Rec);
- SalesPriceAndLineDiscounts.RunModal();
- end;
- }
- }
- group(Action82)
- {
- Caption = 'S&ales';
- Image = Sales;
- action("Prepa&yment Percentages")
- {
- ApplicationArea = Prepayments;
- Caption = 'Prepa&yment Percentages';
- Image = PrepaymentPercentages;
- RunObject = Page "Sales Prepayment Percentages";
- RunPageLink = "Sales Type" = const(Customer),
- "Sales Code" = field("No.");
- RunPageView = sorting("Sales Type", "Sales Code");
- ToolTip = 'View or edit the percentages of the price that can be paid as a prepayment. ';
- }
- action("Recurring Sales Lines")
- {
- ApplicationArea = Suite;
- Caption = 'Recurring Sales Lines';
- Ellipsis = true;
- Image = CustomerCode;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category5;
- //The property 'PromotedIsBig' can only be set if the property 'Promoted' is set to 'true'
- //PromotedIsBig = true;
- RunObject = Page "Standard Customer Sales Codes";
- RunPageLink = "Customer No." = field("No.");
- ToolTip = 'Set up recurring sales lines for the customer, such as a monthly replenishment order, that can quickly be inserted on a sales document for the customer.';
- }
- }
- group(Documents)
- {
- Caption = 'Documents';
- Image = Documents;
- action(Quotes)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Quotes';
- Image = Quote;
- RunObject = Page "Sales Quotes";
- RunPageLink = "Sell-to Customer No." = field("No.");
- RunPageView = sorting("Document Type", "Sell-to Customer No.");
- ToolTip = 'View a list of ongoing sales quotes for the customer.';
- }
- action(Invoices)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Invoices';
- Image = Invoice;
- RunObject = Page "Sales Invoice List";
- RunPageLink = "Sell-to Customer No." = field("No.");
- RunPageView = sorting("Document Type", "Sell-to Customer No.");
- ToolTip = 'View a list of ongoing sales invoices for the customer.';
- }
- action(Orders)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Orders';
- Image = Document;
- RunObject = Page "Sales Order List";
- RunPageLink = "Sell-to Customer No." = field("No.");
- RunPageView = sorting("Document Type", "Sell-to Customer No.");
- ToolTip = 'View a list of ongoing sales orders for the customer.';
- }
- action("Return Orders")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Return Orders';
- Image = ReturnOrder;
- RunObject = Page "Sales Return Order List";
- RunPageLink = "Sell-to Customer No." = field("No.");
- RunPageView = sorting("Document Type", "Sell-to Customer No.");
- ToolTip = 'Open the list of ongoing return orders.';
- }
- group("Issued Documents")
- {
- Caption = 'Issued Documents';
- Image = Documents;
- action("Issued &Reminders")
- {
- ApplicationArea = Suite;
- Caption = 'Issued &Reminders';
- Image = OrderReminder;
- RunObject = Page "Issued Reminder List";
- RunPageLink = "Customer No." = field("No.");
- RunPageView = sorting("Customer No.", "Posting Date");
- ToolTip = 'View the reminders that you have sent to the customer.';
- }
- action("Issued &Finance Charge Memos")
- {
- ApplicationArea = Suite;
- Caption = 'Issued &Finance Charge Memos';
- Image = FinChargeMemo;
- RunObject = Page "Issued Fin. Charge Memo List";
- RunPageLink = "Customer No." = field("No.");
- RunPageView = sorting("Customer No.", "Posting Date");
- ToolTip = 'View the finance charge memos that you have sent to the customer.';
- }
- }
- action("Blanket Orders")
- {
- ApplicationArea = Suite;
- Caption = 'Blanket Orders';
- Image = BlanketOrder;
- RunObject = Page "Blanket Sales Orders";
- RunPageLink = "Sell-to Customer No." = field("No.");
- RunPageView = sorting("Document Type", "Sell-to Customer No.");
- ToolTip = 'Open the list of ongoing blanket orders.';
- }
- action("&Jobs")
- {
- ApplicationArea = Jobs;
- Caption = '&Projects';
- Image = Job;
- RunObject = Page "Job List";
- RunPageLink = "Bill-to Customer No." = field("No.");
- RunPageView = sorting("Bill-to Customer No.");
- ToolTip = 'Open the list of ongoing projects.';
- }
- }
- }
- area(creation)
- {
- action(NewBlanketSalesOrder)
- {
- AccessByPermission = TableData "Sales Header" = RIM;
- ApplicationArea = Suite;
- Caption = 'Blanket Sales Order';
- Image = BlanketOrder;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category4;
- RunObject = Page "Blanket Sales Order";
- RunPageLink = "Sell-to Customer No." = field("No.");
- RunPageMode = Create;
- ToolTip = 'Create a blanket sales order for the customer.';
- }
- action(NewSalesQuote)
- {
- AccessByPermission = TableData "Sales Header" = RIM;
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Quote';
- Image = NewSalesQuote;
- RunObject = Page "Sales Quote";
- RunPageLink = "Sell-to Customer No." = field("No.");
- RunPageMode = Create;
- ToolTip = 'Offer items or services to a customer.';
- Visible = not IsOfficeAddin;
- }
- action(NewSalesInvoice)
- {
- AccessByPermission = TableData "Sales Header" = RIM;
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Invoice';
- Image = NewSalesInvoice;
- RunObject = Page "Sales Invoice";
- RunPageLink = "Sell-to Customer No." = field("No.");
- RunPageMode = Create;
- ToolTip = 'Create a sales invoice for the customer.';
- Visible = not IsOfficeAddin;
- }
- action(NewSalesOrder)
- {
- AccessByPermission = TableData "Sales Header" = RIM;
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Order';
- Image = Document;
- RunObject = Page "Sales Order";
- RunPageLink = "Sell-to Customer No." = field("No.");
- RunPageMode = Create;
- ToolTip = 'Create a sales order for the customer.';
- Visible = not IsOfficeAddin;
- }
- action(NewSalesCreditMemo)
- {
- AccessByPermission = TableData "Sales Header" = RIM;
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Credit Memo';
- Image = CreditMemo;
- RunObject = Page "Sales Credit Memo";
- RunPageLink = "Sell-to Customer No." = field("No.");
- RunPageMode = Create;
- ToolTip = 'Create a new sales credit memo to revert a posted sales invoice.';
- Visible = not IsOfficeAddin;
- }
- action(NewSalesQuoteAddin)
- {
- AccessByPermission = TableData "Sales Header" = RIM;
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Quote';
- Image = NewSalesQuote;
- ToolTip = 'Offer items or services to a customer.';
- Visible = IsOfficeAddin;
-
- trigger OnAction()
- begin
- Rec.CreateAndShowNewQuote();
- end;
- }
- action(NewSalesInvoiceAddin)
- {
- AccessByPermission = TableData "Sales Header" = RIM;
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Invoice';
- Image = NewSalesInvoice;
- ToolTip = 'Create a sales invoice for the customer.';
- Visible = IsOfficeAddin;
-
- trigger OnAction()
- begin
- Rec.CreateAndShowNewInvoice();
- end;
- }
- action(NewSalesOrderAddin)
- {
- AccessByPermission = TableData "Sales Header" = RIM;
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Order';
- Image = Document;
- ToolTip = 'Create a sales order for the customer.';
- Visible = IsOfficeAddin;
-
- trigger OnAction()
- begin
- Rec.CreateAndShowNewOrder();
- end;
- }
- action(NewSalesCreditMemoAddin)
- {
- AccessByPermission = TableData "Sales Header" = RIM;
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Credit Memo';
- Image = CreditMemo;
- ToolTip = 'Create a new sales credit memo to revert a posted sales invoice.';
- Visible = IsOfficeAddin;
-
- trigger OnAction()
- begin
- Rec.CreateAndShowNewCreditMemo();
- end;
- }
- action(NewSalesReturnOrder)
- {
- AccessByPermission = TableData "Sales Header" = RIM;
- ApplicationArea = SalesReturnOrder;
- Caption = 'Sales Return Order';
- Image = ReturnOrder;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category4;
- RunObject = Page "Sales Return Order";
- RunPageLink = "Sell-to Customer No." = field("No.");
- RunPageMode = Create;
- ToolTip = 'Create a new sales return order for items or services.';
- }
- action(NewReminder)
- {
- AccessByPermission = TableData "Reminder Header" = RIM;
- ApplicationArea = Suite;
- Caption = 'Reminder';
- Image = Reminder;
- RunObject = Page Reminder;
- RunPageLink = "Customer No." = field("No.");
- RunPageMode = Create;
- ToolTip = 'Create a new reminder for the customer.';
- }
- action(NewFinanceChargeMemo)
- {
- AccessByPermission = TableData "Finance Charge Memo Header" = RIM;
- ApplicationArea = Suite;
- Caption = 'Finance Charge Memo';
- Image = FinChargeMemo;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category4;
- RunObject = Page "Finance Charge Memo";
- RunPageLink = "Customer No." = field("No.");
- RunPageMode = Create;
- ToolTip = 'Create a new finance charge memo.';
- }
- }
- area(processing)
- {
- group(Approval)
- {
- Caption = 'Approval';
- Visible = OpenApprovalEntriesExistCurrUser;
- action(Approve)
- {
- ApplicationArea = All;
- Caption = 'Approve';
- Image = Approve;
- ToolTip = 'Approve the requested changes.';
- Visible = OpenApprovalEntriesExistCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.ApproveRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Reject)
- {
- ApplicationArea = All;
- Caption = 'Reject';
- Image = Reject;
- ToolTip = 'Reject the approval request.';
- Visible = OpenApprovalEntriesExistCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.RejectRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Delegate)
- {
- ApplicationArea = All;
- Caption = 'Delegate';
- Image = Delegate;
- ToolTip = 'Delegate the approval to a substitute approver.';
- Visible = OpenApprovalEntriesExistCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.DelegateRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Comment)
- {
- ApplicationArea = All;
- Caption = 'Comments';
- Image = ViewComments;
- ToolTip = 'View or add comments for the record.';
- Visible = OpenApprovalEntriesExistCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.GetApprovalComment(Rec);
- end;
- }
- }
- group("Request Approval")
- {
- Caption = 'Request Approval';
- Image = SendApprovalRequest;
- action(SendApprovalRequest)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Send A&pproval Request';
- Enabled = (not OpenApprovalEntriesExist) and EnabledApprovalWorkflowsExist and CanRequestApprovalForFlow;
- Image = SendApprovalRequest;
- ToolTip = 'Request approval to change the record.';
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- if ApprovalsMgmt.CheckCustomerApprovalsWorkflowEnabled(Rec) then
- ApprovalsMgmt.OnSendCustomerForApproval(Rec);
- SetWorkFlowEnabled();
- 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.OnCancelCustomerApprovalRequest(Rec);
- WorkflowWebhookManagement.FindAndCancel(Rec.RecordId);
- end;
- }
- group(Flow)
- {
- Caption = 'Power Automate';
-
- customaction(CreateFlowFromTemplate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create approval flow';
- ToolTip = 'Create a new flow in Power Automate from a list of relevant flow templates.';
- Visible = IsSaaS and IsPowerAutomatePrivacyNoticeApproved;
- CustomActionType = FlowTemplateGallery;
- FlowTemplateCategoryName = 'd365bc_approval_customer';
- }
- }
- }
- group(Workflow)
- {
- Caption = 'Workflow';
- action(CreateApprovalWorkflow)
- {
- ApplicationArea = Suite;
- Caption = 'Create Approval Workflow';
- Enabled = not EnabledApprovalWorkflowsExist;
- Image = CreateWorkflow;
- ToolTip = 'Set up an approval workflow for creating or changing customers, by going through a few pages that will guide you.';
-
- trigger OnAction()
- begin
- PAGE.RunModal(PAGE::"Cust. Approval WF Setup Wizard");
- SetWorkFlowEnabled();
- end;
- }
- action(ManageApprovalWorkflows)
- {
- ApplicationArea = Suite;
- Caption = 'Manage Approval Workflows';
- Enabled = EnabledApprovalWorkflowsExist;
- Image = WorkflowSetup;
- ToolTip = 'View or edit existing approval workflows for creating or changing customers.';
-
- trigger OnAction()
- var
- WorkflowManagement: Codeunit "Workflow Management";
- begin
- WorkflowManagement.NavigateToWorkflows(DATABASE::Customer, WorkFlowEventFilter);
- SetWorkFlowEnabled();
- end;
- }
- }
- group("F&unctions")
- {
- Caption = 'F&unctions';
- Image = "Action";
- action(Templates)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Templates';
- Image = Template;
- //The property 'PromotedIsBig' can only be set if the property 'Promoted' is set to 'true'
- //PromotedIsBig = true;
- ToolTip = 'View or edit customer templates.';
-
- trigger OnAction()
- var
- CustomerTemplMgt: Codeunit "Customer Templ. Mgt.";
- begin
- CustomerTemplMgt.ShowTemplates();
- end;
- }
- action(ApplyTemplate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Apply Template';
- Image = ApplyTemplate;
- ToolTip = 'Apply a template to update the entity with your standard settings for a certain type of entity.';
-
- trigger OnAction()
- var
- CustomerTemplMgt: Codeunit "Customer Templ. Mgt.";
- begin
- CustomerTemplMgt.UpdateCustomerFromTemplate(Rec);
- end;
- }
- action(SaveAsTemplate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Save as Template';
- Image = Save;
- ToolTip = 'Save the customer card as a template that can be reused to create new customer cards. Customer templates contain preset information to help you fill fields on customer cards.';
-
- trigger OnAction()
- var
- CustomerTemplMgt: Codeunit "Customer Templ. Mgt.";
- begin
- CustomerTemplMgt.SaveAsTemplate(Rec);
- end;
- }
- action(MergeDuplicate)
- {
- AccessByPermission = TableData "Merge Duplicates Buffer" = RIMD;
- ApplicationArea = Basic, Suite;
- Caption = 'Merge With';
- Ellipsis = true;
- Image = ItemSubstitution;
- ToolTip = 'Merge two customer records into one. Before merging, review which field values you want to keep or override. The merge action cannot be undone.';
-
- trigger OnAction()
- var
- TempMergeDuplicatesBuffer: Record "Merge Duplicates Buffer" temporary;
- begin
- TempMergeDuplicatesBuffer.Show(DATABASE::Customer, Rec."No.");
- end;
- }
- }
- action("Post Cash Receipts")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Cash Receipts';
- Ellipsis = true;
- Image = CashReceiptJournal;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Process;
- RunObject = Page "Cash Receipt Journal";
- ToolTip = 'Create a cash receipt journal line for the customer, for example, to post a payment receipt.';
- }
- action("Sales Journal")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Journal';
- Image = Journals;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Process;
- RunObject = Page "Sales Journal";
- ToolTip = 'Post any sales transaction for the customer.';
- }
- action(PaymentRegistration)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Register Customer Payments';
- Image = Payment;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Process;
- RunObject = Page "Payment Registration";
- RunPageLink = "Source No." = field("No.");
- ToolTip = 'Process your customer payments by matching amounts received on your bank account with the related unpaid sales invoices, and then post the payments.';
- }
- action(WordTemplate)
- {
- ApplicationArea = All;
- Caption = 'Apply Word Template';
- ToolTip = 'Apply a Word template on the selected records.';
- Image = Word;
-
- trigger OnAction()
- var
- Customer: Record Customer;
- WordTemplateSelectionWizard: Page "Word Template Selection Wizard";
- begin
- CurrPage.SetSelectionFilter(Customer);
- WordTemplateSelectionWizard.SetData(Customer);
- WordTemplateSelectionWizard.RunModal();
- end;
- }
- action(Email)
- {
- ApplicationArea = All;
- Caption = 'Send Email';
- Image = Email;
- ToolTip = 'Send an email to this customer.';
-
- trigger OnAction()
- var
- TempEmailItem: Record "Email Item" temporary;
- EmailScenario: Enum "Email Scenario";
- begin
- TempEmailItem.AddSourceDocument(Database::Customer, Rec.SystemId);
- TempEmailitem."Send to" := Rec."E-Mail";
- TempEmailItem.Send(false, EmailScenario::Default);
- end;
- }
- }
- area(reporting)
- {
- action("Report Customer Detailed Aging")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer Detailed Aging';
- Image = "Report";
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = "Report";
- ToolTip = 'View a detailed list of each customer''s total payments due, divided into three time periods. The report can be used to decide when to issue reminders, to evaluate a customer''s creditworthiness, or to prepare liquidity analyses.';
-
- trigger OnAction()
- begin
- RunReport(REPORT::"Customer Detailed Aging", Rec."No.");
- end;
- }
- action("Report Customer - Labels")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer - Labels';
- Image = "Report";
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category9;
- ToolTip = 'View mailing labels with the customers'' names and addresses.';
-
- trigger OnAction()
- begin
- RunReport(REPORT::"Customer - Labels", Rec."No.");
- end;
- }
- action("Report Customer - Balance to Date")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer - Balance to Date';
- Image = "Report";
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category9;
- ToolTip = 'View a list with customers'' payment history up until a certain date. You can use the report to extract your total sales income at the close of an accounting period or fiscal year.';
-
- trigger OnAction()
- begin
- RunReport(REPORT::"Customer - Balance to Date", Rec."No.");
- end;
- }
- action("Report Statement")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Statement';
- Image = "Report";
- ToolTip = 'View a list of a customer''s transactions for a selected period, for example, to send to the customer at the close of an accounting period. You can choose to have all overdue balances displayed regardless of the period specified, or you can choose to include an aging band.';
-
- trigger OnAction()
- var
- Customer: Record Customer;
- CustomReportSelection: Record "Custom Report Selection";
- ReportSelections: Record "Report Selections";
- CustomLayoutReporting: Codeunit "Custom Layout Reporting";
- RecRef: RecordRef;
- begin
- RecRef.Open(Database::Customer);
- CustomLayoutReporting.SetOutputFileBaseName(StatementFileNameTxt);
- CustomReportSelection.SetRange(Usage, Enum::"Report Selection Usage"::"C.Statement");
- CustomReportSelection.SetRange("Source Type", Database::Customer);
- CustomReportSelection.SetRange("Source No.", Rec."No.");
- if CustomReportSelection.FindFirst() then
- CustomLayoutReporting.SetTableFilterForReportID(CustomReportSelection."Report ID", Rec."No.")
- else begin
- ReportSelections.SetRange(Usage, Enum::"Report Selection Usage"::"C.Statement");
- if ReportSelections.FindFirst() then
- CustomLayoutReporting.SetTableFilterForReportID(ReportSelections."Report ID", Rec."No.")
- else
- CustomLayoutReporting.SetTableFilterForReportID(Report::"Standard Statement", Rec."No.");
- end;
- CustomLayoutReporting.ProcessReportData(
- Enum::"Report Selection Usage"::"C.Statement", RecRef, Customer.FieldName("No."),
- Database::Customer, Customer.FieldName("No."), true);
- end;
- }
- action(BackgroundStatement)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Scheduled Statements';
- Image = "Report";
- ToolTip = 'Schedule Customer Statements in the Job Queue.';
-
- trigger OnAction()
- var
- CustomerLayoutStatement: Codeunit "Customer Layout - Statement";
- begin
- CustomerLayoutStatement.EnqueueReport();
- end;
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- actionref(Contact_Promoted; Contact)
- {
- }
- actionref(ApplyTemplate_Promoted; ApplyTemplate)
- {
- }
- actionref(MergeDuplicate_Promoted; MergeDuplicate)
- {
- }
- actionref(Email_Promoted; Email)
- {
- }
- }
- group(Category_Category5)
- {
- Caption = 'Approve', Comment = 'Generated from the PromotedActionCategories property index 4.';
-
- actionref(Approve_Promoted; Approve)
- {
- }
- actionref(Reject_Promoted; Reject)
- {
- }
- actionref(Comment_Promoted; Comment)
- {
- }
- actionref(Delegate_Promoted; Delegate)
- {
- }
- }
- group(Category_Category6)
- {
- Caption = 'Request Approval', Comment = 'Generated from the PromotedActionCategories property index 5.';
-
- actionref(SendApprovalRequest_Promoted; SendApprovalRequest)
- {
- }
- actionref(CancelApprovalRequest_Promoted; CancelApprovalRequest)
- {
- }
- }
- group(Category_Category4)
- {
- Caption = 'New Document', Comment = 'Generated from the PromotedActionCategories property index 3.';
-
- actionref(NewSalesQuoteAddin_Promoted; NewSalesQuoteAddin)
- {
- }
- actionref(NewSalesQuote_Promoted; NewSalesQuote)
- {
- }
- actionref(NewSalesOrderAddin_Promoted; NewSalesOrderAddin)
- {
- }
- actionref(NewSalesOrder_Promoted; NewSalesOrder)
- {
- }
- actionref(NewSalesInvoiceAddin_Promoted; NewSalesInvoiceAddin)
- {
- }
- actionref(NewSalesInvoice_Promoted; NewSalesInvoice)
- {
- }
- actionref(NewSalesCreditMemoAddin_Promoted; NewSalesCreditMemoAddin)
- {
- }
- actionref(NewSalesCreditMemo_Promoted; NewSalesCreditMemo)
- {
- }
- actionref(NewReminder_Promoted; NewReminder)
- {
- }
- }
- group(Category_Category7)
- {
- Caption = 'Prices & Discounts', Comment = 'Generated from the PromotedActionCategories property index 6.';
- actionref(Prices_Promoted; Prices)
- {
- }
- actionref("Line Discounts_Promoted"; "Line Discounts")
- {
- }
- actionref(PriceLists_Promoted; PriceLists)
- {
- }
- actionref("Prices and Discounts Overview_Promoted"; "Prices and Discounts Overview")
- {
- }
- actionref(PriceLines_Promoted; PriceLines)
- {
- }
- actionref(DiscountLines_Promoted; DiscountLines)
- {
- }
- }
- group(Category_Category9)
- {
- Caption = 'Customer', Comment = 'Generated from the PromotedActionCategories property index 8.';
-
- actionref("Ledger E&ntries_Promoted"; "Ledger E&ntries")
- {
- }
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref(Action76_Promoted; Action76)
- {
- }
- actionref(Attachments_Promoted; Attachments)
- {
- }
- actionref(ApprovalEntries_Promoted; ApprovalEntries)
- {
- }
- actionref("Co&mments_Promoted"; "Co&mments")
- {
- }
-
- separator(Navigate_Separator)
- {
- }
-
- actionref(CustomerReportSelections_Promoted; CustomerReportSelections)
- {
- }
- actionref("Bank Accounts_Promoted"; "Bank Accounts")
- {
- }
- actionref(ShipToAddresses_Promoted; ShipToAddresses)
- {
- }
- actionref(AlternativeVATRegistration_Promoted; AlternativeVATRegistration)
- {
- }
- actionref("Direct Debit Mandates_Promoted"; "Direct Debit Mandates")
- {
- }
- actionref("Item References_Promoted"; "Item References")
- {
- }
- }
- 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.';
-
- actionref("Report Statement_Promoted"; "Report Statement")
- {
- }
- actionref("Report Customer - Balance to Date_Promoted"; "Report Customer - Balance to Date")
- {
- }
- actionref("Report Customer Detailed Aging_Promoted"; "Report Customer Detailed Aging")
- {
- }
- actionref(BackgroundStatement_Promoted; BackgroundStatement)
- {
- }
- actionref("S&ales_Promoted"; "S&ales")
- {
- }
- }
- group(Category_Synchronize)
- {
- Caption = 'Synchronize';
- Visible = CRMIntegrationEnabled or CDSIntegrationEnabled;
-
- group(Category_Coupling)
- {
- Caption = 'Coupling';
- ShowAs = SplitButton;
-
- actionref(ManageCRMCoupling_Promoted; ManageCRMCoupling)
- {
- }
- actionref(DeleteCRMCoupling_Promoted; DeleteCRMCoupling)
- {
- }
- }
- actionref(CRMSynchronizeNow_Promoted; CRMSynchronizeNow)
- {
- }
- actionref(CRMGotoAccount_Promoted; CRMGotoAccount)
- {
- }
- actionref(UpdateStatisticsInCRM_Promoted; UpdateStatisticsInCRM)
- {
- }
- actionref(ShowLog_Promoted; ShowLog)
- {
- }
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- var
- ClientTypeManagement: Codeunit "Client Type Management";
- begin
- if GuiAllowed() then
- OnAfterGetCurrRecordFunc()
- else
- if ClientTypeManagement.GetCurrentClientType() in [ClientType::ODataV4, ClientType::Api] then
- OnAfterGetCurrRecordFuncOData()
- else
- StartBackgroundCalculations();
- end;
-
- local procedure OnAfterGetCurrRecordFunc()
- var
- WorkflowStepInstance: Record "Workflow Step Instance";
- CRMCouplingManagement: Codeunit "CRM Coupling Management";
- WorkflowWebhookManagement: Codeunit "Workflow Webhook Management";
- begin
- if NewMode then
- CreateCustomerFromTemplate()
- else
- StartBackgroundCalculations();
- ActivateFields();
- SetCreditLimitStyle();
-
- if CRMIntegrationEnabled or CDSIntegrationEnabled then begin
- CRMIsCoupledToRecord := CRMCouplingManagement.IsRecordCoupledToCRM(Rec.RecordId);
- if Rec."No." <> xRec."No." then
- CRMIntegrationManagement.SendResultNotification(Rec);
- end;
- WorkflowWebhookManagement.GetCanRequestAndCanCancel(Rec.RecordId, CanRequestApprovalForFlow, CanCancelApprovalForFlow);
- OpenApprovalEntriesExistCurrUser := false;
- if AnyWorkflowExists then begin
- CanCancelApprovalForRecord := ApprovalsMgmt.CanCancelApprovalForRecord(Rec.RecordId);
- WorkflowStepInstance.SetRange("Record ID", Rec.RecordId);
- ShowWorkflowStatus := not WorkflowStepInstance.IsEmpty();
- if ShowWorkflowStatus then
- CurrPage.WorkflowStatus.PAGE.SetFilterOnWorkflowRecord(Rec.RecordId);
- OpenApprovalEntriesExist := ApprovalsMgmt.HasOpenApprovalEntries(Rec.RecordId);
- if OpenApprovalEntriesExist then
- OpenApprovalEntriesExistCurrUser := ApprovalsMgmt.HasOpenApprovalEntriesForCurrentUser(Rec.RecordId);
- end;
- end;
-
- trigger OnInit()
- var
- ApplicationAreaMgmtFacade: Codeunit "Application Area Mgmt. Facade";
- begin
- PrevCountryCode := '*';
- FoundationOnly := ApplicationAreaMgmtFacade.IsFoundationEnabled();
-
- ContactEditable := true;
-
- OpenApprovalEntriesExistCurrUser := true;
-
- CaptionTxt := CurrPage.Caption;
- SetCaption(CaptionTxt);
- CurrPage.Caption(CaptionTxt);
-
- IsPowerAutomatePrivacyNoticeApproved := PrivacyNotice.GetPrivacyNoticeApprovalState(FlowServiceManagement.GetPowerAutomatePrivacyNoticeId()) = "Privacy Notice Approval State"::Agreed;
- end;
-
- trigger OnNewRecord(BelowxRec: Boolean)
- var
- DocumentNoVisibility: Codeunit DocumentNoVisibility;
- begin
- if GuiAllowed then
- if Rec."No." = '' then
- if DocumentNoVisibility.CustomerNoSeriesIsDefault() then
- NewMode := true;
- end;
-
- trigger OnOpenPage()
- begin
- OnBeforeOnOpenPage(Rec);
-
- if Rec.GetFilter("Date Filter") = '' then
- Rec.SetRange("Date Filter", 0D, WorkDate());
- if GuiAllowed() then
- OnOpenPageFunc()
- else
- OnOpenBackground();
- OnAfterOnOpenPage(Rec, xRec);
- end;
-
- local procedure OnOpenPageFunc()
- var
- IntegrationTableMapping: Record "Integration Table Mapping";
- EnvironmentInfo: Codeunit "Environment Information";
- PriceCalculationMgt: Codeunit "Price Calculation Mgt.";
- WorkflowEventHandling: Codeunit "Workflow Event Handling";
- OfficeManagement: Codeunit "Office Management";
- DocumentNoVisibility: Codeunit DocumentNoVisibility;
- begin
- CRMIntegrationEnabled := CRMIntegrationManagement.IsCRMIntegrationEnabled();
- CDSIntegrationEnabled := CRMIntegrationManagement.IsCDSIntegrationEnabled();
- if CRMIntegrationEnabled or CDSIntegrationEnabled then
- if IntegrationTableMapping.Get('CUSTOMER') then
- BlockedFilterApplied := IntegrationTableMapping.GetTableFilter().Contains('Field39=1(0)');
- ExtendedPriceEnabled := PriceCalculationMgt.IsExtendedPriceCalculationEnabled();
-
- OnBeforeGetSalesPricesAndSalesLineDisc(LoadOnDemand);
-
- NoFieldVisible := DocumentNoVisibility.CustomerNoIsVisible();
-
- SalesReceivablesSetup.GetRecordOnce();
- IsAllowMultiplePostingGroupsVisible := SalesReceivablesSetup."Allow Multiple Posting Groups";
-
- IsSaaS := EnvironmentInfo.IsSaaS();
- IsOfficeAddin := OfficeManagement.IsAvailable();
- WorkFlowEventFilter :=
- WorkflowEventHandling.RunWorkflowOnSendCustomerForApprovalCode() + '|' +
- WorkflowEventHandling.RunWorkflowOnCustomerChangedCode();
-
- SetWorkFlowEnabled();
- end;
-
- local procedure OnOpenBackground()
- begin
- Rec.SetAutoCalcFields("Sales (LCY)", "Profit (LCY)", "Inv. Discounts (LCY)", "Payments (LCY)");
- end;
-
- local procedure StartBackgroundCalculations()
- var
- CustomerCardCalculations: Codeunit "Customer Card Calculations";
- Args: Dictionary of [Text, Text];
- IsHandled: Boolean;
- begin
- OnBeforeStartBackgroundCalculations(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if Rec."No." = PrevCustNo then
- exit;
- PrevCustNo := Rec."No.";
- if (BackgroundTaskId <> 0) then
- CurrPage.CancelBackgroundTask(BackgroundTaskId);
-
- DaysPastDueDate := 0;
- ExpectedMoneyOwed := 0;
- AvgDaysToPay := 0;
- TotalMoneyOwed := 0;
- AttentionToPaidDay := false;
- AmountOnPostedInvoices := 0;
- AmountOnPostedCrMemos := 0;
- AmountOnOutstandingInvoices := 0;
- AmountOnOutstandingCrMemos := 0;
- Totals := 0;
- AdjmtCostLCY := 0;
- AdjCustProfit := 0;
- AdjProfitPct := 0;
- CustInvDiscAmountLCY := 0;
- CustPaymentsLCY := 0;
- CustSalesLCY := 0;
- CustProfit := 0;
- NoPostedInvoices := 0;
- NoPostedCrMemos := 0;
- NoOutstandingInvoices := 0;
- NoOutstandingCrMemos := 0;
- OverdueBalance := 0;
- LinkedVendorNo := '';
- BalanceAsVendor := 0;
- BalanceAsVendorEnabled := false;
- PaidLateCount := 0;
- PaidOnTimeCount := 0;
- PercentPaidLate := 0;
- OverdueCount := 0;
- LastPaymentDate := 0D;
- LastPaymentAmount := 0;
- InteractionCount := 0;
- LastInteractionDate := 0D;
- LastInteractionType := '';
- MostFrequentInteractionType := '';
- DaysSinceLastSale := 0;
- DistinctItemsSold := 0;
- LastPaymentOnTime := true;
-
- Args.Add(CustomerCardCalculations.GetCustomerNoLabel(), Rec."No.");
- Args.Add(CustomerCardCalculations.GetFiltersLabel(), Rec.GetView());
- Args.Add(CustomerCardCalculations.GetWorkDateLabel(), Format(WorkDate()));
-
- CurrPage.EnqueueBackgroundTask(BackgroundTaskId, Codeunit::"Customer Card Calculations", Args);
-
- Session.LogMessage('0000D4Q', StrSubstNo(PageBckGrndTaskStartedTxt, Rec.SystemId), Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', CustomerCardServiceCategoryTxt);
- end;
-
- trigger OnPageBackgroundTaskCompleted(TaskId: Integer; Results: Dictionary of [Text, Text])
- var
- CustomerCardCalculations: Codeunit "Customer Card Calculations";
- DictionaryValue: Text;
- begin
- if (TaskId = BackgroundTaskId) then begin
- if Results.Count() = 0 then
- exit;
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetAvgDaysPastDueDateLabel(), DictionaryValue) then
- Evaluate(DaysPastDueDate, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetExpectedMoneyOwedLabel(), DictionaryValue) then
- Evaluate(ExpectedMoneyOwed, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetAvgDaysToPayLabel(), DictionaryValue) then
- Evaluate(AvgDaysToPay, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetPaidLateCountLabel(), DictionaryValue) then
- Evaluate(PaidLateCount, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetPaidOnTimeCountLabel(), DictionaryValue) then
- Evaluate(PaidOnTimeCount, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetPercentPaidLateLabel(), DictionaryValue) then
- Evaluate(PercentPaidLate, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetOverdueCountLabel(), DictionaryValue) then
- Evaluate(OverdueCount, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetLastPaymentDateLabel(), DictionaryValue) then
- Evaluate(LastPaymentDate, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetLastPaymentAmountLabel(), DictionaryValue) then
- Evaluate(LastPaymentAmount, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetLastPaymentOnTimeLabel(), DictionaryValue) then
- Evaluate(LastPaymentOnTime, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetDaysSinceLastSaleLabel(), DictionaryValue) then
- Evaluate(DaysSinceLastSale, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetDistinctItemsSoldLabel(), DictionaryValue) then
- Evaluate(DistinctItemsSold, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetInteractionCountLabel(), DictionaryValue) then
- Evaluate(InteractionCount, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetLastInteractionDateLabel(), DictionaryValue) then
- Evaluate(LastInteractionDate, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetLastInteractionTypeLabel(), DictionaryValue) then
- Evaluate(LastInteractionType, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetMostFrequentInteractionTypeLabel(), DictionaryValue) then
- Evaluate(MostFrequentInteractionType, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetAmountOnPostedInvoicesLabel(), DictionaryValue) then
- Evaluate(AmountOnPostedInvoices, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetAmountOnPostedCrMemosLabel(), DictionaryValue) then
- Evaluate(AmountOnPostedCrMemos, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetAmountOnOutstandingInvoicesLabel(), DictionaryValue) then
- Evaluate(AmountOnOutstandingInvoices, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetAmountOnOutstandingCrMemosLabel(), DictionaryValue) then
- Evaluate(AmountOnOutstandingCrMemos, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetTotalsLabel(), DictionaryValue) then
- Evaluate(Totals, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetAdjmtCostLCYLabel(), DictionaryValue) then
- Evaluate(AdjmtCostLCY, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetAdjCustProfitLabel(), DictionaryValue) then
- Evaluate(AdjCustProfit, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetAdjProfitPctLabel(), DictionaryValue) then
- Evaluate(AdjProfitPct, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetCustInvDiscAmountLCYLabel(), DictionaryValue) then
- Evaluate(CustInvDiscAmountLCY, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetCustPaymentsLCYLabel(), DictionaryValue) then
- Evaluate(CustPaymentsLCY, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetCustSalesLCYLabel(), DictionaryValue) then
- Evaluate(CustSalesLCY, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetCustProfitLabel(), DictionaryValue) then
- Evaluate(CustProfit, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetNoPostedInvoicesLabel(), DictionaryValue) then
- Evaluate(NoPostedInvoices, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetNoPostedCrMemosLabel(), DictionaryValue) then
- Evaluate(NoPostedCrMemos, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetNoOutstandingInvoicesLabel(), DictionaryValue) then
- Evaluate(NoOutstandingInvoices, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetNoOutstandingCrMemosLabel(), DictionaryValue) then
- Evaluate(NoOutstandingCrMemos, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetOverdueBalanceLabel(), DictionaryValue) then
- Evaluate(OverdueBalance, DictionaryValue);
-
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetLinkedVendorNoLabel(), DictionaryValue) then
- LinkedVendorNo := CopyStr(DictionaryValue, 1, MaxStrLen(LinkedVendorNo));
- BalanceAsVendorEnabled := LinkedVendorNo <> '';
- if BalanceAsVendorEnabled then
- if TryGetDictionaryValueFromKey(Results, CustomerCardCalculations.GetBalanceAsVendorLabel(), DictionaryValue) then
- Evaluate(BalanceAsVendor, DictionaryValue);
-
- AttentionToPaidDay := DaysPastDueDate > 0;
- TotalMoneyOwed := Rec."Balance (LCY)" + ExpectedMoneyOwed;
-
- Session.LogMessage('0000D4R', PageBckGrndTaskCompletedTxt, Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', CustomerCardServiceCategoryTxt);
- end;
- end;
-
- var
- SalesReceivablesSetup: Record "Sales & Receivables Setup";
- CalendarMgmt: Codeunit "Calendar Management";
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- CustomerMgt: Codeunit "Customer Mgt.";
- FormatAddress: Codeunit "Format Address";
- PrivacyNotice: Codeunit "Privacy Notice";
- FlowServiceManagement: Codeunit "Flow Service Management";
- LinkedVendorNo: Code[20];
- BalanceAsVendor: Decimal;
- StyleTxt: Text;
- CRMIntegrationEnabled: Boolean;
- CDSIntegrationEnabled: Boolean;
- BlockedFilterApplied: Boolean;
- ExtendedPriceEnabled: Boolean;
- CRMIsCoupledToRecord: Boolean;
- OpenApprovalEntriesExistCurrUser: Boolean;
- IsPowerAutomatePrivacyNoticeApproved: Boolean;
- OpenApprovalEntriesExist: Boolean;
- ShowWorkflowStatus: Boolean;
- NoFieldVisible: Boolean;
- BalanceExhausted: Boolean;
- Totals: Decimal;
- AmountOnPostedInvoices: Decimal;
- AmountOnPostedCrMemos: Decimal;
- AmountOnOutstandingInvoices: Decimal;
- AmountOnOutstandingCrMemos: Decimal;
- AdjmtCostLCY: Decimal;
- AdjCustProfit: Decimal;
- CustProfit: Decimal;
- AdjProfitPct: Decimal;
- CustInvDiscAmountLCY: Decimal;
- CustPaymentsLCY: Decimal;
- CustSalesLCY: Decimal;
- OverdueBalance: Decimal;
- OverduePaymentsMsg: Label 'Overdue Payments';
- PaidLateCount: Integer;
- PaidOnTimeCount: Integer;
- PercentPaidLate: Decimal;
- OverdueCount: Integer;
- LastPaymentDate: Date;
- LastPaymentAmount: Decimal;
- LastPaymentOnTime: Boolean;
- InteractionCount: Integer;
- LastInteractionDate: Date;
- LastInteractionType: Text[100];
- MostFrequentInteractionType: Text[100];
- DaysSinceLastSale: Integer;
- DistinctItemsSold: Integer;
-#pragma warning disable AA0470
- PostedInvoicesMsg: Label 'Posted Invoices (%1)', Comment = 'Invoices (5)';
- CreditMemosMsg: Label 'Posted Credit Memos (%1)', Comment = 'Credit Memos (3)';
- OutstandingInvoicesMsg: Label 'Ongoing Invoices (%1)', Comment = 'Ongoing Invoices (4)';
- OutstandingCrMemosMsg: Label 'Ongoing Credit Memos (%1)', Comment = 'Ongoing Credit Memos (4)';
-#pragma warning restore AA0470
- ShowMapLbl: Label 'Show on Map';
- CustomerCardServiceCategoryTxt: Label 'Customer Card', Locked = true;
- PageBckGrndTaskStartedTxt: Label 'Page Background Task to calculate customer statistics for customer %1 started.', Locked = true, Comment = '%1 = Customer No.';
- PageBckGrndTaskCompletedTxt: Label 'Page Background Task to calculate customer statistics completed successfully.', Locked = true;
- ExpectedMoneyOwed: Decimal;
- TotalMoneyOwed: Decimal;
- AvgDaysToPay: Decimal;
- FoundationOnly: Boolean;
- CanCancelApprovalForRecord: Boolean;
- EnabledApprovalWorkflowsExist: Boolean;
- AnyWorkflowExists: Boolean;
- NewMode: Boolean;
- WorkFlowEventFilter: Text;
- CaptionTxt: Text;
- CanRequestApprovalForFlow: Boolean;
- CanCancelApprovalForFlow: Boolean;
- IsSaaS: Boolean;
- IsCountyVisible: Boolean;
- IsAllowMultiplePostingGroupsVisible: Boolean;
- StatementFileNameTxt: Label 'Statement', Comment = 'Shortened form of ''Customer Statement''';
- LoadOnDemand: Boolean;
- PrevCustNo: Code[20];
- PrevCountryCode: Code[10];
- BackgroundTaskId: Integer;
- BalanceAsVendorEnabled: Boolean;
- PaymentsThisYearTxt: Label 'Payments This Year as of %1', Comment = '%1 = Current Fiscal Year Filter';
-
- protected var
- ContactEditable: Boolean;
- IsOfficeAddin: Boolean;
- NoPostedInvoices: Integer;
- NoPostedCrMemos: Integer;
- NoOutstandingInvoices: Integer;
- NoOutstandingCrMemos: Integer;
- AttentionToPaidDay: Boolean;
- DaysPastDueDate: Decimal;
-
- [TryFunction]
- local procedure TryGetDictionaryValueFromKey(var DictionaryToLookIn: Dictionary of [Text, Text]; KeyToSearchFor: Text; var ReturnValue: Text)
- begin
- ReturnValue := DictionaryToLookIn.Get(KeyToSearchFor);
- end;
-
- local procedure SetWorkFlowEnabled()
- var
- WorkflowManagement: Codeunit "Workflow Management";
- begin
- AnyWorkflowExists := WorkflowManagement.AnyWorkflowExists();
- EnabledApprovalWorkflowsExist := WorkflowManagement.EnabledWorkflowExist(DATABASE::Customer, WorkFlowEventFilter);
- end;
-
- protected procedure ActivateFields()
- begin
- ContactEditable := Rec."Primary Contact No." = '';
- if Rec."Country/Region Code" <> PrevCountryCode then
- IsCountyVisible := FormatAddress.UseCounty(Rec."Country/Region Code");
- PrevCountryCode := Rec."Country/Region Code";
- OnAfterActivateFields(Rec);
- end;
-
- local procedure SetCreditLimitStyle()
- begin
- StyleTxt := '';
- BalanceExhausted := false;
- if Rec."Credit Limit (LCY)" > 0 then
- BalanceExhausted := Rec."Balance (LCY)" >= Rec."Credit Limit (LCY)";
- if BalanceExhausted then
- StyleTxt := 'Unfavorable';
- end;
-
- local procedure HasCustomBaseCalendar(): Boolean
- begin
- if Rec."Base Calendar Code" = '' then
- exit(false)
- else
- exit(CalendarMgmt.CustomizedChangesExist(Rec));
- end;
-
- ///
- /// Runs the specified report filtered to a single customer.
- ///
- /// The ID of the report to run.
- /// The customer number to filter the report.
- procedure RunReport(ReportNumber: Integer; CustomerNumber: Code[20])
- var
- Customer: Record Customer;
- begin
- Customer.SetRange("No.", CustomerNumber);
- REPORT.RunModal(ReportNumber, true, true, Customer);
- end;
-
- local procedure CreateCustomerFromTemplate()
- var
- Customer: Record Customer;
- CustomerTemplMgt: Codeunit "Customer Templ. Mgt.";
- begin
- OnBeforeCreateCustomerFromTemplate(NewMode, Customer);
-
- if not NewMode then
- exit;
- NewMode := false;
-
- if CustomerTemplMgt.InsertCustomerFromTemplate(Customer) then begin
- VerifyVatRegNo(Customer);
- Rec.Copy(Customer);
- OnCreateCustomerFromTemplateOnBeforeCurrPageUpdate(Rec);
- CurrPage.Update();
- end else
- if CustomerTemplMgt.TemplatesAreNotEmpty() then
- if not CustomerTemplMgt.IsOpenBlankCardConfirmed() then
- CurrPage.Close();
- end;
-
- local procedure VerifyVatRegNo(var Customer: Record Customer)
- var
- VATRegNoSrvConfig: Record "VAT Reg. No. Srv Config";
- EUVATRegistrationNoCheck: Page "EU VAT Registration No Check";
- CustomerRecRef: RecordRef;
- begin
- if VATRegNoSrvConfig.VATRegNoSrvIsEnabled() then
- if Customer."Validate EU Vat Reg. No." then begin
- EUVATRegistrationNoCheck.SetRecordRef(Customer);
- Commit();
- EUVATRegistrationNoCheck.RunModal();
- EUVATRegistrationNoCheck.GetRecordRef(CustomerRecRef);
- CustomerRecRef.SetTable(Customer);
- end;
- end;
-
- local procedure OpenCurrFiscalYearCustLedgerEntries()
- var
- CustLedgerEntries: Record "Cust. Ledger Entry";
- begin
- CustLedgerEntries.SetCurrentKey("Customer No.", "Posting Date", "Currency Code");
- CustLedgerEntries.SetRange("Customer No.", Rec."No.");
- CustLedgerEntries.SetFilter("Posting Date", CustomerMgt.GetCurrentYearFilter());
- Page.Run(0, CustLedgerEntries);
- end;
-
- local procedure OpenCurrFiscalYearDetailedCustLedgerEntries()
- var
- DetailedCustLedgEntry: Record "Detailed Cust. Ledg. Entry";
- begin
- DetailedCustLedgEntry.SetCurrentKey("Customer No.", "Posting Date", "Currency Code");
- DetailedCustLedgEntry.SetRange("Customer No.", Rec."No.");
- DetailedCustLedgEntry.SetRange("Initial Document Type", DetailedCustLedgEntry."Initial Document Type"::Payment);
- DetailedCustLedgEntry.SetRange("Entry Type", DetailedCustLedgEntry."Entry Type"::"Initial Entry");
- DetailedCustLedgEntry.SetFilter("Posting Date", CustomerMgt.GetCurrentYearFilter());
- Page.Run(0, DetailedCustLedgEntry);
- end;
-
- local procedure OnAfterGetCurrRecordFuncOData()
- begin
- CustomerMgt.CalculateStatistic(Rec, AdjmtCostLCY, AdjCustProfit, AdjProfitPct, CustInvDiscAmountLCY, CustPaymentsLCY, CustSalesLCY, CustProfit);
- end;
-
- ///
- /// Raised after activating the fields on the customer card.
- ///
- /// The customer record.
- [IntegrationEvent(true, false)]
- local procedure OnAfterActivateFields(var Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised after opening the customer card page.
- ///
- /// The current customer record.
- /// The previous customer record.
- [IntegrationEvent(true, false)]
- local procedure OnAfterOnOpenPage(var Customer: Record Customer; xCustomer: Record Customer)
- begin
- end;
-
- ///
- /// Raised to allow customization of the page caption.
- ///
- /// The caption text to modify.
- [IntegrationEvent(false, false)]
- [Scope('OnPrem')]
- procedure SetCaption(var InText: Text)
- begin
- end;
-
- ///
- /// Raised before creating a customer from a template.
- ///
- /// Indicates whether the page is in new mode.
- /// The customer record to be created.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateCustomerFromTemplate(var NewMode: Boolean; var Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised before loading sales prices and line discounts.
- ///
- /// Set to control whether prices load on demand.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetSalesPricesAndSalesLineDisc(var LoadOnDemand: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating the current page after creating a customer from template.
- ///
- /// The newly created customer record.
- [IntegrationEvent(false, false)]
- local procedure OnCreateCustomerFromTemplateOnBeforeCurrPageUpdate(var Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised before opening the customer card page.
- ///
- /// The customer record.
- [IntegrationEvent(true, false)]
- local procedure OnBeforeOnOpenPage(var Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised before starting background calculations on the customer card.
- ///
- /// The customer record.
- /// Set to true to skip background calculations.
- [IntegrationEvent(true, false)]
- local procedure OnBeforeStartBackgroundCalculations(var Customer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Sales/Customer/CustomerTempl.Table.al b/src/Layers/NL/BaseApp/Sales/Customer/CustomerTempl.Table.al
deleted file mode 100644
index b9a2edbeca..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Customer/CustomerTempl.Table.al
+++ /dev/null
@@ -1,903 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.Customer;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.Payment;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Team;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.Finance.SalesTax;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Calendar;
-using Microsoft.Foundation.Enums;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Foundation.PaymentTerms;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Foundation.Shipping;
-using Microsoft.Intercompany.Partner;
-using Microsoft.Inventory.Intrastat;
-using Microsoft.Inventory.Location;
-using Microsoft.Inventory.Tracking;
-using Microsoft.Pricing.Calculation;
-using Microsoft.Pricing.PriceList;
-using Microsoft.Sales.FinanceCharge;
-using Microsoft.Sales.History;
-using Microsoft.Sales.Pricing;
-using Microsoft.Sales.Reminder;
-using System.Globalization;
-
-///
-/// Stores customer template definitions with predefined field values for creating new customers.
-///
-table 1381 "Customer Templ."
-{
- Caption = 'Customer Template';
- LookupPageID = "Customer Templ. List";
- DrillDownPageID = "Customer Templ. List";
- DataClassification = CustomerContent;
-
- fields
- {
- ///
- /// Specifies the unique identifier code for this customer template.
- ///
- field(1; Code; Code[20])
- {
- Caption = 'Code';
- NotBlank = true;
- ToolTip = 'Specifies the code of the template.';
- }
- ///
- /// Specifies a description to help identify the purpose of this customer template.
- ///
- field(2; Description; Text[100])
- {
- Caption = 'Description';
- ToolTip = 'Specifies the description of the template.';
- }
- ///
- /// Specifies the default address for customers created from this template.
- ///
- field(5; Address; Text[100])
- {
- Caption = 'Address';
- ToolTip = 'Specifies the customer''s address. This address will appear on all sales documents for the customer.';
- }
- ///
- /// Specifies additional default address information for customers created from this template.
- ///
- field(6; "Address 2"; Text[50])
- {
- Caption = 'Address 2';
- ToolTip = 'Specifies additional address information.';
- }
- ///
- /// Specifies the default city for customers created from this template.
- ///
- field(7; City; Text[30])
- {
- Caption = 'City';
- ToolTip = 'Specifies the customer''s city.';
-
- trigger OnLookup()
- var
- PostCode: Record "Post Code";
- CityText: Text;
- CountyText: Text;
- begin
- PostCode.LookupPostCode(CityText, "Post Code", CountyText, "Country/Region Code");
- City := CopyStr(CityText, 1, MaxStrLen(City));
- County := CopyStr(CountyText, 1, MaxStrLen(County));
- end;
-
- trigger OnValidate()
- var
- PostCode: Record "Post Code";
- begin
- PostCode.ValidateCity(City, "Post Code", County, "Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- end;
- }
- ///
- /// Specifies the default phone number for customers created from this template.
- ///
- field(9; "Phone No."; Text[30])
- {
- Caption = 'Phone No.';
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the customer''s telephone number.';
- }
- ///
- /// Specifies the default telex number for customers created from this template.
- ///
- field(10; "Telex No."; Text[20])
- {
- Caption = 'Telex No.';
- }
- ///
- /// Specifies the default document sending profile for customers created from this template.
- ///
- field(11; "Document Sending Profile"; Code[20])
- {
- Caption = 'Document Sending Profile';
- TableRelation = "Document Sending Profile".Code;
- ToolTip = 'Specifies the preferred method of sending documents to this customer.';
- }
- ///
- /// Specifies your account number at the customer's organization.
- ///
- field(14; "Our Account No."; Text[20])
- {
- Caption = 'Our Account No.';
- MaskType = Concealed;
- }
- ///
- /// Specifies the default territory code for customers created from this template.
- ///
- field(15; "Territory Code"; Code[10])
- {
- Caption = 'Territory Code';
- TableRelation = Territory;
- }
- ///
- /// Specifies the default global dimension 1 value for customers created from this template.
- ///
- field(16; "Global Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,1,1';
- Caption = 'Global Dimension 1 Code';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1),
- Blocked = const(false));
-
- trigger OnValidate()
- begin
- ValidateShortcutDimCode(1, "Global Dimension 1 Code");
- end;
- }
- ///
- /// Specifies the default global dimension 2 value for customers created from this template.
- ///
- field(17; "Global Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,1,2';
- Caption = 'Global Dimension 2 Code';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2),
- Blocked = const(false));
-
- trigger OnValidate()
- begin
- ValidateShortcutDimCode(2, "Global Dimension 2 Code");
- end;
- }
- ///
- /// Specifies the default chain or franchise name for customers created from this template.
- ///
- field(18; "Chain Name"; Code[10])
- {
- Caption = 'Chain Name';
- }
- ///
- /// Specifies the default budgeted amount for customers created from this template.
- ///
- field(19; "Budgeted Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Budgeted Amount';
- }
- ///
- /// Specifies the default credit limit in local currency for customers created from this template.
- ///
- field(20; "Credit Limit (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Credit Limit (LCY)';
- ToolTip = 'Specifies the maximum amount of credit that you extend to the customer for their purchases before you issue warnings. The value 0 represents unlimited credit.';
- }
- ///
- /// Specifies the default customer posting group for customers created from this template.
- ///
- field(21; "Customer Posting Group"; Code[20])
- {
- Caption = 'Customer Posting Group';
- TableRelation = "Customer Posting Group";
- ToolTip = 'Specifies the customer''s market type to link business transactions to.';
- }
- ///
- /// Specifies the default currency for customers created from this template.
- ///
- field(22; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- TableRelation = Currency;
- ToolTip = 'Specifies the default currency for the customer.';
- }
- ///
- /// Specifies the default customer price group for customers created from this template.
- ///
- field(23; "Customer Price Group"; Code[10])
- {
- Caption = 'Customer Price Group';
- TableRelation = "Customer Price Group";
- ToolTip = 'Specifies the customer price group code, which you can use to set up special sales prices in the Sales Prices page.';
- }
- ///
- /// Specifies the default language code for customers created from this template.
- ///
- field(24; "Language Code"; Code[10])
- {
- Caption = 'Language Code';
- TableRelation = Language;
- ToolTip = 'Specifies the language to be used on printouts for this customer.';
- }
- ///
- /// Specifies the default statistics group for customers created from this template.
- ///
- field(26; "Statistics Group"; Integer)
- {
- Caption = 'Statistics Group';
- ToolTip = 'Specifies the statistics group.';
- }
- ///
- /// Specifies the default payment terms for customers created from this template.
- ///
- field(27; "Payment Terms Code"; Code[10])
- {
- Caption = 'Payment Terms Code';
- TableRelation = "Payment Terms";
- ToolTip = 'Specifies a code that indicates the payment terms that you require of the customer.';
- }
- ///
- /// Specifies the default finance charge terms for customers created from this template.
- ///
- field(28; "Fin. Charge Terms Code"; Code[10])
- {
- Caption = 'Fin. Charge Terms Code';
- TableRelation = "Finance Charge Terms";
- ToolTip = 'Specifies whether to calculate finance charges for the customer.';
- }
- ///
- /// Specifies the default salesperson for customers created from this template.
- ///
- field(29; "Salesperson Code"; Code[20])
- {
- Caption = 'Salesperson Code';
- TableRelation = "Salesperson/Purchaser" where(Blocked = const(false));
- ToolTip = 'Specifies a code for the salesperson who normally handles this customer''s account.';
- }
- ///
- /// Specifies the default shipment method for customers created from this template.
- ///
- field(30; "Shipment Method Code"; Code[10])
- {
- Caption = 'Shipment Method Code';
- TableRelation = "Shipment Method";
- ToolTip = 'Specifies which shipment method to use when you ship items to the customer.';
- }
- ///
- /// Specifies the default shipping agent for customers created from this template.
- ///
- field(31; "Shipping Agent Code"; Code[10])
- {
- AccessByPermission = TableData "Shipping Agent Services" = R;
- Caption = 'Shipping Agent Code';
- TableRelation = "Shipping Agent";
- ToolTip = 'Specifies which shipping company is used when you ship items to the customer.';
- }
- ///
- /// Specifies the default place of export for customers created from this template.
- ///
- field(32; "Place of Export"; Code[20])
- {
- Caption = 'Place of Export';
- }
- ///
- /// Specifies the default invoice discount code for customers created from this template.
- ///
- field(33; "Invoice Disc. Code"; Code[20])
- {
- Caption = 'Invoice Disc. Code';
- TableRelation = Customer;
- ValidateTableRelation = false;
- ToolTip = 'Specifies a code for the invoice discount terms that you have defined for the customer.';
- }
- ///
- /// Specifies the default customer discount group for customers created from this template.
- ///
- field(34; "Customer Disc. Group"; Code[20])
- {
- Caption = 'Customer Disc. Group';
- TableRelation = "Customer Discount Group";
- ToolTip = 'Specifies the customer discount group code, which you can use as a criterion to set up special discounts in the Sales Line Discounts page.';
- }
- ///
- /// Specifies the default country or region for customers created from this template.
- ///
- field(35; "Country/Region Code"; Code[10])
- {
- Caption = 'Country/Region Code';
- TableRelation = "Country/Region";
- ToolTip = 'Specifies the country/region of the address.';
-
- trigger OnValidate()
- var
- PostCode: Record "Post Code";
- CityText: Text;
- CountyText: Text;
- begin
- PostCode.CheckClearPostCodeCityCounty(CityText, "Post Code", CountyText, "Country/Region Code", xRec."Country/Region Code");
- City := CopyStr(CityText, 1, MaxStrLen(City));
- County := CopyStr(CountyText, 1, MaxStrLen(County));
- end;
- }
- ///
- /// Specifies the default collection method for customers created from this template.
- ///
- field(36; "Collection Method"; Code[20])
- {
- Caption = 'Collection Method';
- }
- ///
- /// Specifies a default amount for customers created from this template.
- ///
- field(37; Amount; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Amount';
- }
- ///
- /// Specifies the default blocked status for customers created from this template.
- ///
- field(39; Blocked; Enum "Customer Blocked")
- {
- Caption = 'Blocked';
- ToolTip = 'Specifies which transactions with the customer that cannot be processed, for example, because the customer is insolvent.';
- }
- ///
- /// Indicates whether to include customers created from this template in printed statements.
- ///
- field(42; "Print Statements"; Boolean)
- {
- Caption = 'Print Statements';
- ToolTip = 'Specifies whether to include this customer when you print the Statement report.';
- }
- ///
- /// Specifies the default bill-to customer for customers created from this template.
- ///
- field(45; "Bill-to Customer No."; Code[20])
- {
- Caption = 'Bill-to Customer No.';
- TableRelation = Customer;
- ToolTip = 'Specifies a different customer who will be invoiced for products that you sell to the customer in the Name field on the customer card.';
- }
- ///
- /// Specifies the default payment method for customers created from this template.
- ///
- field(47; "Payment Method Code"; Code[10])
- {
- Caption = 'Payment Method Code';
- TableRelation = "Payment Method";
- ToolTip = 'Specifies how the customer usually submits payment, such as bank transfer or check.';
- }
- ///
- /// Specifies the default regional format for customers created from this template.
- ///
- field(48; "Format Region"; Text[80])
- {
- Caption = 'Format Region';
- TableRelation = "Language Selection"."Language Tag";
- ToolTip = 'Specifies the region format to be used on printouts for this customer.';
- }
- ///
- /// Specifies the default application method for customers created from this template.
- ///
- field(80; "Application Method"; Enum "Application Method")
- {
- Caption = 'Application Method';
- ToolTip = 'Specifies how to apply payments to entries for this customer.';
- }
- ///
- /// Indicates whether prices include VAT for customers created from this template.
- ///
- field(82; "Prices Including VAT"; Boolean)
- {
- Caption = 'Prices Including VAT';
- ToolTip = 'Specifies whether to show VAT in the Unit Price and Line Amount fields on document lines.';
- }
- ///
- /// Specifies the default inventory location for customers created from this template.
- ///
- field(83; "Location Code"; Code[10])
- {
- Caption = 'Location Code';
- TableRelation = Location where("Use As In-Transit" = const(false));
- ToolTip = 'Specifies from which location sales to this customer will be processed by default.';
- }
- ///
- /// Specifies the default fax number for customers created from this template.
- ///
- field(84; "Fax No."; Text[30])
- {
- Caption = 'Fax No.';
- ToolTip = 'Specifies the customer''s fax number.';
- }
- ///
- /// Specifies the default telex answer back code for customers created from this template.
- ///
- field(85; "Telex Answer Back"; Text[20])
- {
- Caption = 'Telex Answer Back';
- }
- ///
- /// Specifies the default VAT registration number for customers created from this template.
- ///
- field(86; "VAT Registration No."; Text[20])
- {
- Caption = 'VAT Registration No.';
- ToolTip = 'Specifies the customer''s VAT registration number for customers in EU countries/regions.';
- }
- ///
- /// Indicates whether to combine shipments by default for customers created from this template.
- ///
- field(87; "Combine Shipments"; Boolean)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Combine Sales Shipments';
- ToolTip = 'Specifies if several orders delivered to the customer can appear on the same sales invoice.';
- }
- ///
- /// Specifies the default general business posting group for customers created from this template.
- ///
- field(88; "Gen. Bus. Posting Group"; Code[20])
- {
- Caption = 'Gen. Bus. Posting Group';
- TableRelation = "Gen. Business Posting Group";
- ToolTip = 'Specifies the customer''s trade type to link transactions made for this customer with the appropriate general ledger account according to the general posting setup.';
- }
- ///
- /// Specifies the default Global Location Number for customers created from this template.
- ///
- field(90; GLN; Code[13])
- {
- Caption = 'GLN';
- Numeric = true;
- ToolTip = 'Specifies the customer in connection with electronic document sending.';
- }
- ///
- /// Specifies the default postal code for customers created from this template.
- ///
- field(91; "Post Code"; Code[20])
- {
- Caption = 'Post Code';
- ToolTip = 'Specifies the postal code.';
-
- trigger OnLookup()
- var
- PostCode: Record "Post Code";
- CityText: Text;
- CountyText: Text;
- begin
- PostCode.LookupPostCode(CityText, "Post Code", CountyText, "Country/Region Code");
- City := CopyStr(CityText, 1, MaxStrLen(City));
- County := CopyStr(CountyText, 1, MaxStrLen(County));
- end;
-
- trigger OnValidate()
- var
- PostCode: Record "Post Code";
- begin
- PostCode.ValidatePostCode(City, "Post Code", County, "Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- end;
- }
- ///
- /// Specifies the default state, province, or county for customers created from this template.
- ///
- field(92; County; Text[30])
- {
- CaptionClass = '5,1,' + "Country/Region Code";
- Caption = 'County';
- ToolTip = 'Specifies the state, province or county as a part of the address.';
- }
- ///
- /// Specifies the default EORI number for customs purposes for customers created from this template.
- ///
- field(93; "EORI Number"; Text[40])
- {
- Caption = 'EORI Number';
- ToolTip = 'Specifies the Economic Operators Registration and Identification number that is used when you exchange information with the customs authorities due to trade into or out of the European Union.';
- }
- ///
- /// Indicates whether to use the GLN in electronic documents for customers created from this template.
- ///
- field(95; "Use GLN in Electronic Document"; Boolean)
- {
- Caption = 'Use GLN in Electronic Documents';
- ToolTip = 'Specifies whether the GLN is used in electronic documents as a party identification number.';
- }
- ///
- /// Specifies the default email address for customers created from this template.
- ///
- field(102; "E-Mail"; Text[80])
- {
- Caption = 'Email';
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the customer''s email address.';
- }
- ///
- /// Specifies the default website URL for customers created from this template.
- ///
-#if not CLEAN27
-#pragma warning disable AS0086
-#endif
- field(103; "Home Page"; Text[255])
-#if not CLEAN27
-#pragma warning restore AS0086
-#endif
- {
- Caption = 'Home Page';
- ExtendedDatatype = URL;
- ToolTip = 'Specifies the customer''s home page address.';
- }
- ///
- /// Specifies the default reminder terms for customers created from this template.
- ///
- field(104; "Reminder Terms Code"; Code[10])
- {
- Caption = 'Reminder Terms Code';
- TableRelation = "Reminder Terms";
- ToolTip = 'Specifies how reminders about late payments are handled for this customer.';
- }
- ///
- /// Specifies the number series used for assigning customer numbers when using this template.
- ///
- field(107; "No. Series"; Code[20])
- {
- Caption = 'No. Series';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the number series that will be used to assign numbers to customers.';
- }
- ///
- /// Specifies the default tax area for customers created from this template.
- ///
- field(108; "Tax Area Code"; Code[20])
- {
- Caption = 'Tax Area Code';
- TableRelation = "Tax Area";
- ToolTip = 'Specifies the tax area that is used to calculate and post sales tax.';
- }
- ///
- /// Indicates whether customers created from this template are liable for sales tax.
- ///
- field(109; "Tax Liable"; Boolean)
- {
- Caption = 'Tax Liable';
- ToolTip = 'Specifies if the customer or vendor is liable for sales tax.';
- }
- ///
- /// Specifies the default VAT business posting group for customers created from this template.
- ///
- field(110; "VAT Bus. Posting Group"; Code[20])
- {
- Caption = 'VAT Bus. Posting Group';
- TableRelation = "VAT Business Posting Group";
- ToolTip = 'Specifies the customer''s VAT specification to link transactions made for this customer to.';
- }
- ///
- /// Specifies the default reservation method for customers created from this template.
- ///
- field(115; Reserve; Enum "Reserve Method")
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Reserve';
- InitValue = Optional;
- ToolTip = 'Specifies whether items will never, automatically (Always), or optionally be reserved for this customer.';
- }
- ///
- /// Indicates whether payment tolerance is blocked for customers created from this template.
- ///
- field(116; "Block Payment Tolerance"; Boolean)
- {
- Caption = 'Block Payment Tolerance';
- ToolTip = 'Specifies that the customer is not allowed a payment tolerance.';
- }
- ///
- /// Specifies the default intercompany partner for customers created from this template.
- ///
- field(119; "IC Partner Code"; Code[20])
- {
- Caption = 'IC Partner Code';
- TableRelation = "IC Partner";
- ToolTip = 'Specifies the customer''s intercompany partner code.';
- }
- ///
- /// Specifies the default prepayment percentage for customers created from this template.
- ///
- field(124; "Prepayment %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Prepayment %';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
- ToolTip = 'Specifies a prepayment percentage that applies to all orders for this customer, regardless of the items or services on the order lines.';
- }
- ///
- /// Specifies the default partner type for direct debit collections for customers created from this template.
- ///
- field(132; "Partner Type"; Enum "Partner Type")
- {
- Caption = 'Partner Type';
- ToolTip = 'Specifies for direct debit collections if the customer that the payment is collected from is a person or a company.';
- }
- ///
- /// Specifies the default partner type for Intrastat reporting for customers created from this template.
- ///
- field(133; "Intrastat Partner Type"; Enum "Partner Type")
- {
- Caption = 'Intrastat Partner Type';
- ToolTip = 'Specifies for Intrastat reporting if the customer is a person or a company.';
- }
- ///
- /// Indicates whether data access is blocked for privacy reasons for customers created from this template.
- ///
- field(150; "Privacy Blocked"; Boolean)
- {
- Caption = 'Privacy Blocked';
- ToolTip = 'Specifies whether to limit access to data for the data subject during daily operations. This is useful, for example, when protecting data from changes while it is under privacy review.';
-
- trigger OnValidate()
- begin
- if "Privacy Blocked" then
- Blocked := Blocked::All
- else
- Blocked := Blocked::" ";
- end;
- }
- ///
- /// Indicates whether search by name is disabled for customers created from this template.
- ///
- field(160; "Disable Search by Name"; Boolean)
- {
- Caption = 'Disable Search by Name';
- DataClassification = SystemMetadata;
- ToolTip = 'Specifies that you can change customer name in the document, because the name is not used in search.';
- }
- ///
- /// Indicates whether multiple posting groups are allowed for customers created from this template.
- ///
- field(175; "Allow Multiple Posting Groups"; Boolean)
- {
- Caption = 'Allow Multiple Posting Groups';
- DataClassification = SystemMetadata;
- ToolTip = 'Specifies if multiple posting groups can be used for posting business transactions for this customer.';
- }
- ///
- /// Specifies the default cash flow payment terms for customers created from this template.
- ///
- field(840; "Cash Flow Payment Terms Code"; Code[10])
- {
- Caption = 'Cash Flow Payment Terms Code';
- TableRelation = "Payment Terms";
- ToolTip = 'Specifies a payment term that will be used to calculate cash flow for the customer.';
- }
- ///
- /// Specifies the default contact type for customers created from this template.
- ///
- field(5050; "Contact Type"; Enum "Contact Type")
- {
- Caption = 'Contact Type';
- ToolTip = 'Specifies the type of contact that will be used to create a customer with the template.';
- }
- ///
- /// Specifies the default mobile phone number for customers created from this template.
- ///
- field(5061; "Mobile Phone No."; Text[30])
- {
- Caption = 'Mobile Phone No.';
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the customer''s mobile telephone number.';
- }
- ///
- /// Specifies the default responsibility center for customers created from this template.
- ///
- field(5700; "Responsibility Center"; Code[10])
- {
- Caption = 'Responsibility Center';
- TableRelation = "Responsibility Center";
- ToolTip = 'Specifies the code for the responsibility center that will administer this customer by default.';
- }
- ///
- /// Specifies the default shipping advice for customers created from this template.
- ///
- field(5750; "Shipping Advice"; Enum "Sales Header Shipping Advice")
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Shipping Advice';
- ToolTip = 'Specifies if the customer accepts partial shipment of orders.';
- }
- ///
- /// Specifies the default shipping time for customers created from this template.
- ///
- field(5790; "Shipping Time"; DateFormula)
- {
- AccessByPermission = TableData "Shipping Agent Services" = R;
- Caption = 'Shipping Time';
- ToolTip = 'Specifies how long it takes from when the items are shipped from the warehouse to when they are delivered.';
- }
- ///
- /// Specifies the default shipping agent service for customers created from this template.
- ///
- field(5792; "Shipping Agent Service Code"; Code[10])
- {
- Caption = 'Shipping Agent Service Code';
- TableRelation = "Shipping Agent Services".Code where("Shipping Agent Code" = field("Shipping Agent Code"));
- ToolTip = 'Specifies the code for the shipping agent service to use for this customer.';
- }
- ///
- /// Specifies the default price calculation method for customers created from this template.
- ///
- field(7000; "Price Calculation Method"; Enum "Price Calculation Method")
- {
- Caption = 'Price Calculation Method';
- ToolTip = 'Specifies the default price calculation method.';
- trigger OnValidate()
- var
- PriceCalculationMgt: Codeunit "Price Calculation Mgt.";
- PriceType: Enum "Price Type";
- begin
- if Rec."Price Calculation Method" <> Rec."Price Calculation Method"::" " then
- PriceCalculationMgt.VerifyMethodImplemented(Rec."Price Calculation Method", PriceType::Sale);
- end;
- }
- ///
- /// Indicates whether line discounts are allowed for customers created from this template.
- ///
- field(7001; "Allow Line Disc."; Boolean)
- {
- Caption = 'Allow Line Disc.';
- InitValue = true;
- ToolTip = 'Specifies whether to calculate a sales line discount when a special sales price is offered, according to setup in the Sales Prices page.';
- }
- ///
- /// Specifies the default base calendar for customers created from this template.
- ///
- field(7600; "Base Calendar Code"; Code[10])
- {
- Caption = 'Base Calendar Code';
- TableRelation = "Base Calendar";
- ToolTip = 'Specifies a customizable calendar for shipment planning that holds the customer''s working days and holidays.';
- }
- ///
- /// Specifies the default source for copying sell-to address on quotes for customers created from this template.
- ///
- field(7601; "Copy Sell-to Addr. to Qte From"; Enum "Contact Type")
- {
- AccessByPermission = TableData Contact = R;
- Caption = 'Copy Sell-to Addr. to Qte From';
- ToolTip = 'Specifies which customer address is inserted on sales quotes that you create for the customer.';
- }
- ///
- /// Indicates whether to validate EU VAT registration numbers for customers created from this template.
- ///
- field(7602; "Validate EU Vat Reg. No."; Boolean)
- {
- Caption = 'Validate EU VAT Reg. No.';
- ToolTip = 'Specifies if the VAT registration number will be specified in the EU VAT Registration No. Check page so that it is validated against the VAT registration number validation service.';
- }
- field(11000000; "Transaction Mode Code"; Code[20])
- {
- Caption = 'Transaction Mode Code';
- TableRelation = "Transaction Mode".Code where("Account Type" = const(Customer));
- }
- }
-
- keys
- {
- key(Key1; Code)
- {
- Clustered = true;
- }
- }
-
- trigger OnDelete()
- var
- DefaultDimension: Record "Default Dimension";
- begin
- DefaultDimension.SetRange("Table ID", Database::"Customer Templ.");
- DefaultDimension.SetRange("No.", Code);
- DefaultDimension.DeleteAll();
- end;
-
- trigger OnRename()
- var
- DimMgt: Codeunit DimensionManagement;
- begin
- DimMgt.RenameDefaultDim(Database::"Customer Templ.", xRec.Code, Code);
- end;
-
- local procedure ValidateShortcutDimCode(FieldNumber: Integer; var ShortcutDimCode: Code[20])
- var
- DimMgt: Codeunit DimensionManagement;
- begin
- DimMgt.ValidateDimValueCode(FieldNumber, ShortcutDimCode);
- if not IsTemporary then begin
- DimMgt.SaveDefaultDim(Database::"Customer Templ.", Code, FieldNumber, ShortcutDimCode);
- Modify();
- end;
- end;
-
- ///
- /// Copies all fields and dimensions from another customer template.
- ///
- /// The source template to copy from.
- procedure CopyFromTemplate(SourceCustomerTempl: Record "Customer Templ.")
- begin
- CopyTemplate(SourceCustomerTempl);
- CopyDimensions(SourceCustomerTempl);
- OnAfterCopyFromTemplate(SourceCustomerTempl, Rec);
- end;
-
- local procedure CopyTemplate(SourceCustomerTempl: Record "Customer Templ.")
- var
- SavedCustomerTempl: Record "Customer Templ.";
- begin
- SavedCustomerTempl := Rec;
- TransferFields(SourceCustomerTempl, false);
- Code := SavedCustomerTempl.Code;
- Description := SavedCustomerTempl.Description;
- OnCopyTemplateOnBeforeModify(SourceCustomerTempl, SavedCustomerTempl, Rec);
- Modify();
- end;
-
- local procedure CopyDimensions(SourceCustomerTempl: Record "Customer Templ.")
- var
- SourceDefaultDimension: Record "Default Dimension";
- DestDefaultDimension: Record "Default Dimension";
- begin
- DestDefaultDimension.SetRange("Table ID", Database::"Customer Templ.");
- DestDefaultDimension.SetRange("No.", Code);
- DestDefaultDimension.DeleteAll(true);
-
- SourceDefaultDimension.SetRange("Table ID", Database::"Customer Templ.");
- SourceDefaultDimension.SetRange("No.", SourceCustomerTempl.Code);
- if SourceDefaultDimension.FindSet() then
- repeat
- DestDefaultDimension.Init();
- DestDefaultDimension.Validate("Table ID", Database::"Customer Templ.");
- DestDefaultDimension.Validate("No.", Code);
- DestDefaultDimension.Validate("Dimension Code", SourceDefaultDimension."Dimension Code");
- DestDefaultDimension.Validate("Dimension Value Code", SourceDefaultDimension."Dimension Value Code");
- DestDefaultDimension.Validate("Value Posting", SourceDefaultDimension."Value Posting");
- if DestDefaultDimension.Insert(true) then;
- until SourceDefaultDimension.Next() = 0;
- end;
-
- ///
- /// Raises an event after copying field values from a source customer template.
- ///
- /// The source customer template record that values were copied from.
- /// The destination customer template record that was updated.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyFromTemplate(SourceCustomerTempl: Record "Customer Templ."; var CustomerTempl: Record "Customer Templ.")
- begin
- end;
-
- ///
- /// Raises an event before modifying the customer template during the copy operation.
- ///
- /// The source customer template record being copied from.
- /// The original customer template record before transfer.
- /// The customer template record being modified.
- [IntegrationEvent(false, false)]
- local procedure OnCopyTemplateOnBeforeModify(SourceCustomerTempl: Record "Customer Templ."; SavedCustomerTempl: Record "Customer Templ."; var CustomerTempl: Record "Customer Templ.")
- begin
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Sales/Customer/CustomerTemplCard.Page.al b/src/Layers/NL/BaseApp/Sales/Customer/CustomerTemplCard.Page.al
deleted file mode 100644
index 3fc40d8617..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Customer/CustomerTemplCard.Page.al
+++ /dev/null
@@ -1,488 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.Customer;
-
-using Microsoft.Finance.Dimension;
-using Microsoft.Foundation.Address;
-using Microsoft.Pricing.Calculation;
-using Microsoft.Sales.Setup;
-
-///
-/// Displays and edits a customer template with predefined field values for new customers.
-///
-page 1382 "Customer Templ. Card"
-{
- Caption = 'Customer Template';
- PageType = Card;
- SourceTable = "Customer Templ.";
-
- layout
- {
- area(Content)
- {
- group(General)
- {
- Caption = 'General';
- field(Code; Rec.Code)
- {
- ApplicationArea = Basic, Suite;
- }
- field(Description; Rec.Description)
- {
- ApplicationArea = Basic, Suite;
- }
- field("Contact Type"; Rec."Contact Type")
- {
- ApplicationArea = Basic, Suite;
- }
- field(Blocked; Rec.Blocked)
- {
- ApplicationArea = Basic, Suite;
- }
- field("No. Series"; Rec."No. Series")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Privacy Blocked"; Rec."Privacy Blocked")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = false;
- }
- field("Salesperson Code"; Rec."Salesperson Code")
- {
- ApplicationArea = Suite;
- Visible = false;
- }
- field("IC Partner Code"; Rec."IC Partner Code")
- {
- ApplicationArea = Intercompany;
- Importance = Additional;
- Visible = false;
- }
- field("Disable Search by Name"; Rec."Disable Search by Name")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = false;
- }
- field("Responsibility Center"; Rec."Responsibility Center")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- Visible = false;
- }
- field("Credit Limit (LCY)"; Rec."Credit Limit (LCY)")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Statistics Group"; Rec."Statistics Group")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- }
- group("Address & Contact")
- {
- Caption = 'Address & Contact';
- group(AddressDetails)
- {
- Caption = 'Address';
- field(Address; Rec.Address)
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Address 2"; Rec."Address 2")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Country/Region Code"; Rec."Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- trigger OnValidate()
- begin
- IsCountyVisible := FormatAddress.UseCounty(Rec."Country/Region Code");
- end;
- }
- field(City; Rec.City)
- {
- ApplicationArea = Basic, Suite;
- }
- group(CountyGroup)
- {
- ShowCaption = false;
- Visible = IsCountyVisible;
- field(County; Rec.County)
- {
- ApplicationArea = Basic, Suite;
- }
- }
- field("Post Code"; Rec."Post Code")
- {
- ApplicationArea = Basic, Suite;
- }
- }
- field("Phone No."; Rec."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field(MobilePhoneNo; Rec."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- ExtendedDatatype = PhoneNo;
- Visible = false;
- }
- field("E-Mail"; Rec."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- ExtendedDatatype = EMail;
- Visible = false;
- }
- field("Fax No."; Rec."Fax No.")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Home Page"; Rec."Home Page")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- group(ContactDetails)
- {
- Caption = 'Contact';
- field("Language Code"; Rec."Language Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Format Region"; Rec."Format Region")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Document Sending Profile"; Rec."Document Sending Profile")
- {
- ApplicationArea = Basic, Suite;
- }
- }
- }
- group(Invoicing)
- {
- Caption = 'Invoicing';
- field("Bill-to Customer No."; Rec."Bill-to Customer No.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Validate EU Vat Reg. No."; Rec."Validate EU Vat Reg. No.")
- {
- ApplicationArea = Basic, Suite;
- }
- field("VAT Registration No."; Rec."VAT Registration No.")
- {
- ApplicationArea = VAT;
- Visible = false;
- }
- field("EORI Number"; Rec."EORI Number")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field(GLN; Rec.GLN)
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Use GLN in Electronic Document"; Rec."Use GLN in Electronic Document")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Copy Sell-to Addr. to Qte From"; Rec."Copy Sell-to Addr. to Qte From")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Tax Liable"; Rec."Tax Liable")
- {
- ApplicationArea = SalesTax;
- Visible = false;
- }
- field("Tax Area Code"; Rec."Tax Area Code")
- {
- ApplicationArea = SalesTax;
- Visible = false;
- }
- group(PostingDetails)
- {
- Caption = 'Posting Details';
- field("Gen. Bus. Posting Group"; Rec."Gen. Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- ShowMandatory = true;
- }
- field("VAT Bus. Posting Group"; Rec."VAT Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Customer Posting Group"; Rec."Customer Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- ShowMandatory = true;
- }
- field("Allow Multiple Posting Groups"; Rec."Allow Multiple Posting Groups")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = IsAllowMultiplePostingGroupsVisible;
- }
- }
- group(PricesandDiscounts)
- {
- Caption = 'Prices and Discounts';
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- field("Price Calculation Method"; Rec."Price Calculation Method")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- Visible = ExtendedPriceEnabled;
- }
- field("Customer Price Group"; Rec."Customer Price Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Customer Disc. Group"; Rec."Customer Disc. Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Allow Line Disc."; Rec."Allow Line Disc.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Invoice Disc. Code"; Rec."Invoice Disc. Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Prices Including VAT"; Rec."Prices Including VAT")
- {
- ApplicationArea = VAT;
- Importance = Additional;
- }
- }
- }
- group(Payments)
- {
- Caption = 'Payments';
- field("Prepayment %"; Rec."Prepayment %")
- {
- ApplicationArea = Prepayments;
- Importance = Additional;
- Visible = false;
- }
- field("Application Method"; Rec."Application Method")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Partner Type"; Rec."Partner Type")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Intrastat Partner Type"; Rec."Intrastat Partner Type")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Payment Terms Code"; Rec."Payment Terms Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- ShowMandatory = true;
- }
- field("Payment Method Code"; Rec."Payment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Reminder Terms Code"; Rec."Reminder Terms Code")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- field("Fin. Charge Terms Code"; Rec."Fin. Charge Terms Code")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- field("Cash Flow Payment Terms Code"; Rec."Cash Flow Payment Terms Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = false;
- }
- field("Print Statements"; Rec."Print Statements")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Block Payment Tolerance"; Rec."Block Payment Tolerance")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the transaction mode commonly used in telebanking for this customer.';
- }
- }
- group(Shipping)
- {
- Caption = 'Shipping';
- field("Location Code"; Rec."Location Code")
- {
- ApplicationArea = Location;
- Importance = Promoted;
- }
- field("Combine Shipments"; Rec."Combine Shipments")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field(Reserve; Rec.Reserve)
- {
- ApplicationArea = Reservation;
- Visible = false;
- }
- field("Shipping Advice"; Rec."Shipping Advice")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- Visible = false;
- }
- group("Shipment Method")
- {
- Caption = 'Shipment Method';
- field("Shipment Method Code"; Rec."Shipment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Code';
- Importance = Promoted;
- }
- field("Shipping Agent Code"; Rec."Shipping Agent Code")
- {
- ApplicationArea = Suite;
- Caption = 'Agent';
- Visible = false;
- }
- field("Shipping Agent Service Code"; Rec."Shipping Agent Service Code")
- {
- ApplicationArea = Suite;
- Caption = 'Agent Service';
- Importance = Additional;
- Visible = false;
- }
- }
- field("Shipping Time"; Rec."Shipping Time")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- Visible = false;
- }
- field("Base Calendar Code"; Rec."Base Calendar Code")
- {
- ApplicationArea = Basic, Suite;
- DrillDown = false;
- Visible = false;
- }
- }
- }
- }
-
- actions
- {
- area(Navigation)
- {
- action(Dimensions)
- {
- ApplicationArea = Dimensions;
- Caption = 'Dimensions';
- Image = Dimensions;
- RunObject = Page "Default Dimensions";
- RunPageLink = "Table ID" = const(1381),
- "No." = field(Code);
- 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.';
- }
- action(CopyTemplate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Copy Template';
- Image = Copy;
- ToolTip = 'Copies all information to the current template from the selected one.';
-
- trigger OnAction()
- var
- CustomerTempl: Record "Customer Templ.";
- CustomerTemplList: Page "Select Customer Templ. List";
- begin
- Rec.TestField(Code);
- CustomerTempl.SetFilter(Code, '<>%1', Rec.Code);
- CustomerTemplList.LookupMode(true);
- CustomerTemplList.SetTableView(CustomerTempl);
- if CustomerTemplList.RunModal() = Action::LookupOK then begin
- CustomerTemplList.GetRecord(CustomerTempl);
- Rec.CopyFromTemplate(CustomerTempl);
- end;
- end;
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process';
-
- actionref(CopyTemplate_Promoted; CopyTemplate)
- {
- }
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- }
- }
- }
-
- trigger OnOpenPage()
- var
- PriceCalculationMgt: Codeunit "Price Calculation Mgt.";
- begin
- IsCountyVisible := FormatAddress.UseCounty(Rec."Country/Region Code");
- SalesReceivablesSetup.Get();
- IsAllowMultiplePostingGroupsVisible := SalesReceivablesSetup."Allow Multiple Posting Groups";
- ExtendedPriceEnabled := PriceCalculationMgt.IsExtendedPriceCalculationEnabled();
- end;
-
- var
- SalesReceivablesSetup: Record "Sales & Receivables Setup";
- FormatAddress: Codeunit "Format Address";
- ExtendedPriceEnabled: Boolean;
- IsAllowMultiplePostingGroupsVisible: Boolean;
- IsCountyVisible: Boolean;
-}
diff --git a/src/Layers/NL/BaseApp/Sales/Document/SalesCreditMemo.Page.al b/src/Layers/NL/BaseApp/Sales/Document/SalesCreditMemo.Page.al
deleted file mode 100644
index 38ad44ec7d..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Document/SalesCreditMemo.Page.al
+++ /dev/null
@@ -1,1840 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.CRM.Contact;
-using Microsoft.CRM.Outlook;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.VAT.Calculation;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Attachment;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Projects.Resources.Resource;
-using Microsoft.Sales.Comment;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.History;
-using Microsoft.Sales.Posting;
-using Microsoft.Sales.Pricing;
-using Microsoft.Sales.Setup;
-using Microsoft.Utilities;
-using System.Automation;
-using System.Environment;
-using System.Privacy;
-using System.Security.User;
-using System.Threading;
-
-///
-/// Displays and manages a single sales credit memo document for processing customer refunds.
-///
-page 44 "Sales Credit Memo"
-{
- Caption = 'Sales Credit Memo';
- PageType = Document;
- RefreshOnActivate = true;
- SourceTable = "Sales Header";
- SourceTableView = where("Document Type" = filter("Credit Memo"));
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field("No."; Rec."No.")
- {
- ApplicationArea = All;
- Importance = Standard;
- ToolTip = 'Specifies the number of the involved entry or record, according to the specified number series.';
- Visible = DocNoVisible;
-
- trigger OnAssistEdit()
- begin
- if Rec.AssistEdit(xRec) then
- CurrPage.Update();
- end;
- }
- field("Sell-to Customer No."; Rec."Sell-to Customer No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer No.';
- Importance = Additional;
- NotBlank = true;
- ToolTip = 'Specifies the number of the customer who will receive the products and be billed by default.';
-
- trigger OnValidate()
- begin
- Rec.SelltoCustomerNoOnAfterValidate(Rec, xRec);
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- CurrPage.Update();
- end;
- }
- field("Sell-to Customer Name"; Rec."Sell-to Customer Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer Name';
- Importance = Promoted;
- ShowMandatory = true;
- ToolTip = 'Specifies the name of the customer who will receive the products and be billed by default.';
-
- trigger OnAfterLookup(Selected: RecordRef)
- var
- Customer: Record Customer;
- begin
- Selected.SetTable(Customer);
- if Rec."Sell-to Customer No." <> Customer."No." then begin
- Rec.Validate("Sell-to Customer No.", Customer."No.");
- if Rec."Sell-to Customer No." <> Customer."No." then
- error('');
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- CurrPage.Update();
- end;
- end;
-
- trigger OnValidate()
- begin
- Rec.SelltoCustomerNoOnAfterValidate(Rec, xRec);
- CurrPage.Update();
- end;
- }
- field("Sell-to Customer Name 2"; Rec."Sell-to Customer Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer Name 2';
- QuickEntry = false;
- Visible = false;
- }
- field("Registration Number"; Rec."Registration Number")
- {
- ApplicationArea = VAT;
- Editable = false;
- Importance = Additional;
- Visible = false;
- }
- field("Posting Description"; Rec."Posting Description")
- {
- ApplicationArea = Suite;
- Visible = false;
- }
- group("Sell-to")
- {
- Caption = 'Sell-to';
- field("Sell-to Address"; Rec."Sell-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Importance = Additional;
- QuickEntry = false;
- }
- field("Sell-to Address 2"; Rec."Sell-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Importance = Additional;
- QuickEntry = false;
- }
- field("Sell-to City"; Rec."Sell-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Importance = Additional;
- QuickEntry = false;
- }
- group(Control36)
- {
- ShowCaption = false;
- Visible = IsSellToCountyVisible;
- field("Sell-to County"; Rec."Sell-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Sell-to Country/Region Code";
- Importance = Additional;
- QuickEntry = false;
- }
- }
- field("Sell-to Post Code"; Rec."Sell-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the postal code.';
- }
- field("Sell-to Country/Region Code"; Rec."Sell-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the country or region of the address.';
-
- trigger OnValidate()
- begin
- IsSellToCountyVisible := FormatAddress.UseCounty(Rec."Sell-to Country/Region Code");
- end;
- }
- field("Sell-to Contact No."; Rec."Sell-to Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact No.';
- Importance = Additional;
-
- trigger OnLookup(var Text: Text): Boolean
- begin
- if not Rec.SelltoContactLookup() then
- exit(false);
- Text := Rec."Sell-to Contact No.";
- CurrPage.Update();
- exit(true);
- end;
-
- trigger OnValidate()
- begin
- if Rec.GetFilter("Sell-to Contact No.") = xRec."Sell-to Contact No." then
- if Rec."Sell-to Contact No." <> xRec."Sell-to Contact No." then
- Rec.SetRange("Sell-to Contact No.");
- if Rec."Sell-to Contact No." <> xRec."Sell-to Contact No." then
- CurrPage.Update();
- end;
- }
- field(SellToPhoneNo; SellToContact."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the contact person that the sales document will be sent to.';
- }
- field(SellToMobilePhoneNo; SellToContact."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mobile Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the contact person that the sales document will be sent to.';
- }
- field(SellToEmail; SellToContact."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the email address of the contact person that the sales document will be sent to.';
- }
- }
- field("Sell-to Contact"; Rec."Sell-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = Rec."Sell-to Customer No." <> '';
- ToolTip = 'Specifies the name of the person to contact at the customer.';
- }
- field("Your Reference"; Rec."Your Reference")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- ToolTip = 'Specifies the customer''s reference. The contents will be printed on sales documents.';
- }
- field("Posting Date"; Rec."Posting Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
-
- trigger OnValidate()
- begin
- SaveInvoiceDiscountAmount();
- end;
- }
- field("VAT Reporting Date"; Rec."VAT Reporting Date")
- {
- ApplicationArea = VAT;
- Importance = Promoted;
- Editable = VATDateEnabled;
- Visible = VATDateEnabled;
- }
- field("Document Date"; Rec."Document Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Due Date"; Rec."Due Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- ToolTip = 'Specifies when the related sales invoice must be paid.';
- }
- field("Incoming Document Entry No."; Rec."Incoming Document Entry No.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = false;
- }
- field("External Document No."; Rec."External Document No.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- ShowMandatory = ExternalDocNoMandatory;
- }
- field("Salesperson Code"; Rec."Salesperson Code")
- {
- ApplicationArea = Suite;
- Importance = Additional;
-
- trigger OnValidate()
- begin
- SalespersonCodeOnAfterValidate();
- end;
- }
- field("Campaign No."; Rec."Campaign No.")
- {
- ApplicationArea = RelationshipMgmt;
- Importance = Additional;
- ToolTip = 'Specifies the number of the campaign that the document is linked to.';
- trigger OnValidate()
- begin
- if Rec."Campaign No." <> xRec."Campaign No." then
- CurrPage.Update();
- end;
- }
- field("Responsibility Center"; Rec."Responsibility Center")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Assigned User ID"; Rec."Assigned User ID")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Job Queue Status"; Rec."Job Queue Status")
- {
- ApplicationArea = All;
- Importance = Additional;
- ToolTip = 'Specifies the status of a job queue entry or task that handles the posting of sales credit memos.';
- Visible = JobQueueUsed;
-
- 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(Status; Rec.Status)
- {
- ApplicationArea = Suite;
- Importance = Promoted;
- StyleExpr = StatusStyleTxt;
- }
- field("Applies-to Doc. Type"; Rec."Applies-to Doc. Type")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Applies-to Doc. No."; Rec."Applies-to Doc. No.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Applies-to ID"; Rec."Applies-to ID")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- group("Work Description")
- {
- Caption = 'Work Description';
- field(WorkDescription; WorkDescription)
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- MultiLine = true;
- ShowCaption = false;
- ToolTip = 'Specifies the products or services being offered.';
-
- trigger OnValidate()
- begin
- Rec.SetWorkDescription(WorkDescription);
- end;
- }
- }
- field("Language Code"; Rec."Language Code")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Format Region"; Rec."Format Region")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- }
- part(SalesLines; "Sales Cr. Memo Subform")
- {
- ApplicationArea = Basic, Suite;
- Editable = IsSalesLinesEditable;
- Enabled = IsSalesLinesEditable;
- SubPageLink = "Document No." = field("No.");
- UpdatePropagation = Both;
- }
- group("Credit Memo Details")
- {
- Caption = 'Credit Memo Details';
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- Importance = Promoted;
-
- trigger OnAssistEdit()
- begin
- Clear(ChangeExchangeRate);
- if Rec."Posting Date" <> 0D then
- ChangeExchangeRate.SetParameter(Rec."Currency Code", Rec."Currency Factor", Rec."Posting Date")
- else
- ChangeExchangeRate.SetParameter(Rec."Currency Code", Rec."Currency Factor", WorkDate());
- if ChangeExchangeRate.RunModal() = ACTION::OK then begin
- Rec.Validate("Currency Factor", ChangeExchangeRate.GetParameter());
- SaveInvoiceDiscountAmount();
- end;
- Clear(ChangeExchangeRate);
- end;
-
- trigger OnValidate()
- begin
- CurrPage.Update();
- end;
- }
- field("Company Bank Account Code"; Rec."Company Bank Account Code")
- {
- ApplicationArea = Suite;
- Importance = Promoted;
- }
- field("Shipment Date"; Rec."Shipment Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Prices Including VAT"; Rec."Prices Including VAT")
- {
- ApplicationArea = VAT;
-
- trigger OnValidate()
- begin
- PricesIncludingVATOnAfterValid();
- end;
- }
- field("VAT Country/Region Code"; Rec."VAT Country/Region Code")
- {
- ApplicationArea = VAT;
- Importance = Additional;
- }
- field("VAT Registration No."; Rec."VAT Registration No.")
- {
- ApplicationArea = VAT;
- Importance = Additional;
- }
- field("Gen. Bus. Posting Group"; Rec."Gen. Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("VAT Bus. Posting Group"; Rec."VAT Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Customer Posting Group"; Rec."Customer Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Editable = IsPostingGroupEditable;
- Importance = Additional;
- ToolTip = 'Specifies the customer s market type to link business transactions to.';
- }
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the transaction mode used in telebanking.';
- }
- field("Bank Account Code"; Rec."Bank Account Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the customer''s bank account that is used for payments and collections through telebanking.';
- }
- field("Payment Terms Code"; Rec."Payment Terms Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Payment Method Code"; Rec."Payment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = IsPaymentMethodCodeVisible;
- }
- field("Reason Code"; Rec."Reason Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = false;
- }
- field("Shortcut Dimension 1 Code"; Rec."Shortcut Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
-
- trigger OnValidate()
- begin
- ShortcutDimension1CodeOnAfterV();
- end;
- }
- field("Shortcut Dimension 2 Code"; Rec."Shortcut Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
-
- trigger OnValidate()
- begin
- ShortcutDimension2CodeOnAfterV();
- end;
- }
- 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.';
- }
- field("Pmt. Discount Date"; Rec."Pmt. Discount Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Journal Templ. Name"; Rec."Journal Templ. Name")
- {
- ApplicationArea = BasicBE;
- Visible = IsJournalTemplNameVisible;
- }
- field("Location Code"; Rec."Location Code")
- {
- ApplicationArea = Location;
- Importance = Additional;
- ToolTip = 'Specifies the code for the location where the items are to be received. When you select the customer and the customer has a location assigned, the value is taken from the Customer card. If the customer has no location, but a Responsibility Center is populated, the location code is taken from the Responsibility Center. If neither is specified, the value is taken from Company Information. This field acts as the default location for new lines. You can update the location code for individual lines as needed.';
- }
- field("EU 3-Party Trade"; Rec."EU 3-Party Trade")
- {
- ApplicationArea = BasicEU;
- }
- field(Correction; Rec.Correction)
- {
- ApplicationArea = Basic, Suite;
- }
- }
- group(Billing)
- {
- Caption = 'Billing';
- group("Bill-to")
- {
- Caption = 'Bill-to';
- field("Bill-to Name"; Rec."Bill-to Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name';
- Importance = Promoted;
- ToolTip = 'Specifies the customer to whom you will send the sales invoice, when different from the customer that you are selling to.';
-
- trigger OnValidate()
- begin
- if Rec.GetFilter("Bill-to Customer No.") = xRec."Bill-to Customer No." then
- if Rec."Bill-to Customer No." <> xRec."Bill-to Customer No." then
- Rec.SetRange("Bill-to Customer No.");
-
- CurrPage.Update();
- end;
-
- trigger OnLookup(var Text: Text): Boolean
- var
- Customer: Record Customer;
- begin
- OnBeforeLookupBillToName(Customer, Rec);
- if Customer.SelectCustomer(Customer) then begin
- xRec := Rec;
- Rec."Bill-to Name" := Customer.Name;
- Rec.Validate("Bill-to Customer No.", Customer."No.");
- end;
-
- if Rec.GetFilter("Bill-to Customer No.") = xRec."Bill-to Customer No." then
- if Rec."Bill-to Customer No." <> xRec."Bill-to Customer No." then
- Rec.SetRange("Bill-to Customer No.");
-
- CurrPage.Update();
- end;
- }
- field("Bill-to Name 2"; Rec."Bill-to Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name 2';
- Importance = Additional;
- QuickEntry = false;
- Visible = false;
- }
- field("Bill-to Address"; Rec."Bill-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Importance = Additional;
- QuickEntry = false;
- }
- field("Bill-to Address 2"; Rec."Bill-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Importance = Additional;
- QuickEntry = false;
- }
- field("Bill-to City"; Rec."Bill-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Importance = Additional;
- QuickEntry = false;
- }
- group(Control55)
- {
- ShowCaption = false;
- Visible = IsBillToCountyVisible;
- field("Bill-to County"; Rec."Bill-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Bill-to Country/Region Code";
- Importance = Additional;
- QuickEntry = false;
- }
- }
- field("Bill-to Post Code"; Rec."Bill-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the postal code.';
- }
- field("Bill-to Country/Region Code"; Rec."Bill-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the country or region of the address.';
-
- trigger OnValidate()
- begin
- IsBillToCountyVisible := FormatAddress.UseCounty(Rec."Bill-to Country/Region Code");
- end;
- }
- field("Bill-to Contact No."; Rec."Bill-to Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact No';
- Importance = Additional;
- }
- field("Bill-to Contact"; Rec."Bill-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- ToolTip = 'Specifies the name of the person you should contact at the customer who you are sending the invoice to.';
- }
- field(BillToContactPhoneNo; BillToContact."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the person you should contact at the customer you are sending the invoice to.';
- }
- field(BillToContactMobilePhoneNo; BillToContact."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mobile Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the person you should contact at the customer you are sending the invoice to.';
- }
- field(BillToContactEmail; BillToContact."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the email address of the person you should contact at the customer you are sending the invoice to.';
- }
- }
- }
- group("Foreign Trade")
- {
- Caption = 'Foreign Trade';
- field("Transaction Specification"; Rec."Transaction Specification")
- {
- ApplicationArea = BasicEU;
- }
- field("Transaction Type"; Rec."Transaction Type")
- {
- ApplicationArea = BasicEU;
- }
- field("Transport Method"; Rec."Transport Method")
- {
- ApplicationArea = BasicEU;
- }
- field("Exit Point"; Rec."Exit Point")
- {
- ApplicationArea = BasicEU;
- }
- field("Area"; Rec.Area)
- {
- ApplicationArea = BasicEU;
- }
- field("Rcvd-from Country/Region Code"; Rec."Rcvd.-from Count./Region Code")
- {
- ApplicationArea = BasicEU, BasicCH, BasicNO;
- }
- }
- }
- area(factboxes)
- {
- part(SalesDocCheckFactbox; "Sales Doc. Check Factbox")
- {
- ApplicationArea = All;
- Caption = 'Document Check';
- Visible = SalesDocCheckFactboxVisible;
- SubPageLink = "No." = field("No."),
- "Document Type" = field("Document Type");
- }
- 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(Control19; "Pending Approval FactBox")
- {
- ApplicationArea = All;
- SubPageLink = "Table ID" = const(36),
- "Document Type" = field("Document Type"),
- "Document No." = field("No."),
- Status = const(Open);
- Visible = OpenApprovalEntriesExistForCurrUser;
- }
- part(Control1903720907; "Sales Hist. Sell-to FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("Sell-to Customer No."),
- "Date Filter" = field("Date Filter");
- Visible = false;
- }
- part(Control1907234507; "Sales Hist. Bill-to FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("Sell-to Customer No."),
- "Date Filter" = field("Date Filter");
- Visible = false;
- }
- 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("Sell-to Customer No."),
- "Date Filter" = field("Date Filter");
- }
- part(Control1906127307; "Sales Line FactBox")
- {
- ApplicationArea = Basic, Suite;
- Provider = SalesLines;
- SubPageLink = "Document Type" = field("Document Type"),
- "Document No." = field("Document No."),
- "Line No." = field("Line No.");
- Visible = false;
- }
- part(ApprovalFactBox; "Approval FactBox")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(IncomingDocAttachFactBox; "Incoming Doc. Attach. FactBox")
- {
- ApplicationArea = Basic, Suite;
- ShowFilter = false;
- Visible = false;
- }
- part(Control1907012907; "Resource Details FactBox")
- {
- ApplicationArea = Basic, Suite;
- Provider = SalesLines;
- SubPageLink = "No." = field("No.");
- Visible = false;
- }
- part(WorkflowStatus; "Workflow Status FactBox")
- {
- ApplicationArea = All;
- Editable = false;
- Enabled = false;
- ShowFilter = false;
- Visible = ShowWorkflowStatus;
- }
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("&Credit Memo")
- {
- Caption = '&Credit Memo';
- Image = CreditMemo;
- 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(CreditMemo_CustomerCard)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer';
- Enabled = IsCustomerOrContactNotEmpty;
- Image = EditLines;
- RunObject = Page "Customer Card";
- RunPageLink = "No." = field("Sell-to Customer No."),
- "Date Filter" = field("Date Filter");
- ShortCutKey = 'Shift+F7';
- ToolTip = 'View or edit detailed information about the customer on the sales document.';
- }
- action(CustomerStatistics)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer Statistics';
- Enabled = IsCustomerOrContactNotEmpty;
- 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(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(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;
- }
- }
- }
- area(processing)
- {
- group("Credit Memo")
- {
- Caption = '&Credit Memo';
- Image = CreditMemo;
- action(Customer)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer';
- Enabled = IsCustomerOrContactNotEmpty;
- Image = Customer;
- RunObject = Page "Customer Card";
- RunPageLink = "No." = field("Sell-to Customer No."),
- "Date Filter" = field("Date Filter");
- ShortCutKey = 'Shift+F7';
- ToolTip = 'View or edit detailed information about the customer.';
- }
- 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();
- CurrPage.SaveRecord();
- end;
- }
- }
- group(Approval)
- {
- Caption = 'Approval';
- action(Approve)
- {
- ApplicationArea = All;
- Caption = 'Approve';
- Image = Approve;
- ToolTip = 'Approve the requested changes.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.ApproveRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Reject)
- {
- ApplicationArea = All;
- Caption = 'Reject';
- Image = Reject;
- ToolTip = 'Reject the approval request.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.RejectRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Delegate)
- {
- ApplicationArea = All;
- Caption = 'Delegate';
- Image = Delegate;
- ToolTip = 'Delegate the approval to a substitute approver.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.DelegateRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Comment)
- {
- ApplicationArea = All;
- Caption = 'Comments';
- Image = ViewComments;
- ToolTip = 'View or add comments for the record.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.GetApprovalComment(Rec);
- end;
- }
- }
- group(Action7)
- {
- Caption = 'Release';
- Image = ReleaseDoc;
- action(Release)
- {
- ApplicationArea = Suite;
- Caption = 'Re&lease';
- Enabled = IsCustomerOrContactNotEmpty and (Rec.Status <> Rec.Status::Released);
- 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
- ReleaseSalesDoc: Codeunit "Release Sales Document";
- begin
- ReleaseSalesDoc.PerformManualRelease(Rec);
- CurrPage.SalesLines.PAGE.ClearTotalSalesHeader();
- end;
- }
- action(Reopen)
- {
- ApplicationArea = Suite;
- Caption = 'Re&open';
- Enabled = Rec.Status <> Rec.Status::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
- ReleaseSalesDoc: Codeunit "Release Sales Document";
- begin
- ReleaseSalesDoc.PerformManualReopen(Rec);
- CurrPage.SalesLines.PAGE.ClearTotalSalesHeader();
- end;
- }
- }
- group("F&unctions")
- {
- Caption = 'F&unctions';
- Image = "Action";
- action(GetPostedDocumentLinesToReverse)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Get Posted Doc&ument Lines to Reverse';
- Ellipsis = true;
- Image = ReverseLines;
- ToolTip = 'Copy one or more posted sales document lines in order to reverse the original order.';
-
- trigger OnAction()
- begin
- Rec.GetPstdDocLinesToReverse();
- CurrPage.SalesLines.Page.ForceTotalsCalculation();
- CurrPage.Update();
- end;
- }
- action(CalculateInvoiceDiscount)
- {
- AccessByPermission = TableData "Cust. Invoice Disc." = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Calculate &Invoice Discount';
- Enabled = IsCustomerOrContactNotEmpty;
- Image = CalculateInvoiceDiscount;
- ToolTip = 'Calculate the invoice discount that applies to the sales credit memo.';
-
- trigger OnAction()
- begin
- ApproveCalcInvDisc();
- SalesCalcDiscByType.ResetRecalculateInvoiceDisc(Rec);
- end;
- }
- action(ApplyEntries)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Apply Entries';
- Ellipsis = true;
- Enabled = Rec."No." <> '';
- Image = ApplyEntries;
- ShortCutKey = 'Shift+F11';
- ToolTip = 'Select one or more ledger entries that you want to apply this record to so that the related posted documents are closed as paid or refunded.';
-
- trigger OnAction()
- begin
- CODEUNIT.Run(CODEUNIT::"Sales Header Apply", Rec);
- end;
- }
- action(GetStdCustSalesCodes)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Get Recurring Sales Lines';
- Ellipsis = true;
- Enabled = IsCustomerOrContactNotEmpty;
- Image = CustomerCode;
- ToolTip = 'View a list of the standard sales lines that have been assigned to the customer to be used for recurring sales.';
-
- trigger OnAction()
- var
- StdCustSalesCode: Record "Standard Customer Sales Code";
- begin
- StdCustSalesCode.InsertSalesLines(Rec);
- end;
- }
- action(CopyDocument)
- {
- ApplicationArea = Suite;
- Caption = 'Copy Document';
- Ellipsis = true;
- Enabled = Rec."No." <> '';
- Image = CopyDocument;
- ToolTip = 'Copy document lines and header information from another sales document to this document. You can copy a posted sales invoice into a new sales invoice to quickly create a similar document.';
-
- trigger OnAction()
- begin
- Rec.CopyDocument();
- if Rec.Get(Rec."Document Type", Rec."No.") then;
- CurrPage.SalesLines.Page.ForceTotalsCalculation();
- CurrPage.Update();
- end;
- }
- action("Move Negative Lines")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Move Negative Lines';
- Ellipsis = true;
- Image = MoveNegativeLines;
- ToolTip = 'Prepare to create a replacement sales order in a sales return process.';
-
- trigger OnAction()
- begin
- Clear(MoveNegSalesLines);
- MoveNegSalesLines.SetSalesHeader(Rec);
- MoveNegSalesLines.RunModal();
- MoveNegSalesLines.ShowDocument();
- end;
- }
- group(IncomingDocument)
- {
- Caption = 'Incoming Document';
- Image = Documents;
- action(IncomingDocCard)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'View Incoming Document';
- Enabled = HasIncomingDocument;
- Image = ViewOrder;
- ToolTip = 'View any incoming document records and file attachments that exist for the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.ShowCardFromEntryNo(Rec."Incoming Document Entry No.");
- end;
- }
- action(SelectIncomingDoc)
- {
- AccessByPermission = TableData "Incoming Document" = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Select Incoming Document';
- Image = SelectLineToApply;
- ToolTip = 'Select an incoming document record and file attachment that you want to link to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- Rec.Validate("Incoming Document Entry No.", IncomingDocument.SelectIncomingDocument(Rec."Incoming Document Entry No.", Rec.RecordId));
- end;
- }
- action(IncomingDocAttachFile)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Incoming Document from File';
- Ellipsis = true;
- Enabled = not HasIncomingDocument;
- Image = Attach;
- ToolTip = 'Create an incoming document record by selecting a file to attach, and then link the incoming document record to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocumentAttachment: Record "Incoming Document Attachment";
- begin
- IncomingDocumentAttachment.NewAttachmentFromSalesDocument(Rec);
- end;
- }
- action(RemoveIncomingDoc)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Remove Incoming Document';
- Enabled = HasIncomingDocument;
- Image = RemoveLine;
- ToolTip = 'Remove any incoming document records and file attachments.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- if IncomingDocument.Get(Rec."Incoming Document Entry No.") then
- IncomingDocument.RemoveLinkToRelatedRecord();
- Rec."Incoming Document Entry No." := 0;
- Rec.Modify(true);
- end;
- }
- }
- }
- group("Request Approval")
- {
- Caption = 'Request Approval';
- Image = Approval;
- 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.";
- WorkflowWebhookMgt: Codeunit "Workflow Webhook Management";
- begin
- ApprovalsMgmt.OnCancelSalesApprovalRequest(Rec);
- WorkflowWebhookMgt.FindAndCancel(Rec.RecordId);
- end;
- }
- group(Flow)
- {
- Caption = 'Power Automate';
- Image = Flow;
-
- customaction(CreateFlowFromTemplate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create approval flow';
- ToolTip = 'Create a new flow in Power Automate from a list of relevant flow templates.';
- Visible = IsSaaS and IsPowerAutomatePrivacyNoticeApproved;
- CustomActionType = FlowTemplateGallery;
- FlowTemplateCategoryName = 'd365bc_approval_salesCreditMemo';
- }
- }
- }
- group("P&osting")
- {
- Caption = 'P&osting';
- Image = Post;
- action(Post)
- {
- ApplicationArea = Basic, Suite;
- 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
- PostDocument(CODEUNIT::"Sales-Post (Yes/No)");
- end;
- }
- action(TestReport)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Test Report';
- Ellipsis = true;
- Enabled = Rec."No." <> '';
- 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(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
- PostDocument(CODEUNIT::"Sales-Post and Send");
- end;
- }
- action("Remove From Job Queue")
- {
- ApplicationArea = All;
- Caption = 'Remove From Job Queue';
- Image = RemoveLine;
- ToolTip = 'Remove the scheduled processing of this record from the job queue.';
- Visible = JobQueueVisible;
-
- trigger OnAction()
- begin
- Rec.CancelBackgroundPosting();
- end;
- }
- action("Preview Posting")
- {
- 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(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- group(Category_Category6)
- {
- Caption = 'Posting', Comment = 'Generated from the PromotedActionCategories property index 5.';
- ShowAs = SplitButton;
-
- actionref(Post_Promoted; Post)
- {
- }
- actionref(PostAndSend_Promoted; PostAndSend)
- {
- }
- actionref("Preview Posting_Promoted"; "Preview Posting")
- {
- }
- }
- group(Category_Category5)
- {
- Caption = 'Release', Comment = 'Generated from the PromotedActionCategories property index 4.';
- ShowAs = SplitButton;
-
- actionref(Release_Promoted; Release)
- {
- }
- actionref(Reopen_Promoted; Reopen)
- {
- }
- }
- actionref(ApplyEntries_Promoted; ApplyEntries)
- {
- }
- }
- group(Category_Category7)
- {
- Caption = 'Prepare', Comment = 'Generated from the PromotedActionCategories property index 6.';
-
- actionref(CopyDocument_Promoted; CopyDocument)
- {
- }
- actionref(GetPostedDocumentLinesToReverse_Promoted; GetPostedDocumentLinesToReverse)
- {
- }
- group("Category_Incoming Document")
- {
- Caption = 'Incoming Document';
-
- actionref(IncomingDocAttachFile_Promoted; IncomingDocAttachFile)
- {
- }
- actionref(SelectIncomingDoc_Promoted; SelectIncomingDoc)
- {
- }
- actionref(IncomingDocCard_Promoted; IncomingDocCard)
- {
- }
- actionref(RemoveIncomingDoc_Promoted; RemoveIncomingDoc)
- {
- }
- }
- actionref(GetStdCustSalesCodes_Promoted; GetStdCustSalesCodes)
- {
- }
- actionref(CalculateInvoiceDiscount_Promoted; CalculateInvoiceDiscount)
- {
- }
- actionref("Move Negative Lines_Promoted"; "Move Negative Lines")
- {
- }
- }
- group(Category_Category4)
- {
- Caption = 'Approve', Comment = 'Generated from the PromotedActionCategories property index 3.';
-
- actionref(Approve_Promoted; Approve)
- {
- }
- actionref(Reject_Promoted; Reject)
- {
- }
- actionref(Comment_Promoted; Comment)
- {
- }
- actionref(Delegate_Promoted; Delegate)
- {
- }
- }
- group(Category_Category9)
- {
- Caption = 'Request Approval', Comment = 'Generated from the PromotedActionCategories property index 8.';
-
- actionref(SendApprovalRequest_Promoted; SendApprovalRequest)
- {
- }
- actionref(CancelApprovalRequest_Promoted; CancelApprovalRequest)
- {
- }
- }
- group(Category_Category8)
- {
- Caption = 'Credit Memo', Comment = 'Generated from the PromotedActionCategories property index 7.';
-
- actionref(SalesStatistics_Promoted; SalesStatistics)
- {
- }
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref(DocAttach_Promoted; DocAttach)
- {
- }
- actionref(Approvals_Promoted; Approvals)
- {
- }
- actionref("Co&mments_Promoted"; "Co&mments")
- {
- }
-
- separator(Navigate_Separator)
- {
- }
-
- actionref(CreditMemo_CustomerCard_Promoted; CreditMemo_CustomerCard)
- {
- }
- }
- group(Category_Category10)
- {
- Caption = 'Navigate', Comment = 'Generated from the PromotedActionCategories property index 9.';
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- begin
- SetControlAppearance();
- CurrPage.IncomingDocAttachFactBox.PAGE.LoadDataFromRecord(Rec);
- CurrPage.ApprovalFactBox.PAGE.UpdateApprovalEntriesFromSourceRecord(Rec.RecordId);
- ShowWorkflowStatus := CurrPage.WorkflowStatus.PAGE.SetFilterOnWorkflowRecord(Rec.RecordId);
- StatusStyleTxt := Rec.GetStatusStyleText();
- SetControlAppearance();
- end;
-
- trigger OnAfterGetRecord()
- begin
- WorkDescription := Rec.GetWorkDescription();
- SellToContact.GetOrClear(Rec."Sell-to Contact No.");
- BillToContact.GetOrClear(Rec."Bill-to Contact No.");
-
- OnAfterOnAfterGetRecord(Rec);
- end;
-
- trigger OnDeleteRecord(): Boolean
- begin
- CurrPage.SaveRecord();
- exit(Rec.ConfirmDeletion());
- end;
-
- trigger OnInit()
- begin
- JobQueueUsed := SalesSetup.JobQueueActive();
- SetExtDocNoMandatoryCondition();
- IsPowerAutomatePrivacyNoticeApproved := PrivacyNotice.GetPrivacyNoticeApprovalState(FlowServiceManagement.GetPowerAutomatePrivacyNoticeId()) = "Privacy Notice Approval State"::Agreed;
- end;
-
- trigger OnInsertRecord(BelowxRec: Boolean): Boolean
- begin
- if DocNoVisible then
- Rec.CheckCreditMaxBeforeInsert();
-
- if (Rec."Sell-to Customer No." = '') and (Rec.GetFilter("Sell-to Customer No.") <> '') then
- CurrPage.Update(false);
- end;
-
- trigger OnNewRecord(BelowxRec: Boolean)
- begin
- Rec."Responsibility Center" := UserMgt.GetSalesFilter();
- if (not DocNoVisible) and (Rec."No." = '') then
- Rec.SetSellToCustomerFromFilter();
- SetControlAppearance();
- end;
-
- trigger OnOpenPage()
- var
- EnvironmentInfo: Codeunit "Environment Information";
- VATReportingDateMgt: Codeunit "VAT Reporting Date Mgt";
- begin
- Rec.SetSecurityFilterOnRespCenter();
-
- Rec.SetRange("Date Filter", 0D, WorkDate());
-
- ActivateFields();
-
- IsSaaS := EnvironmentInfo.IsSaaS();
- SetDocNoVisible();
- SetControlAppearance();
- if (Rec."No." <> '') and (Rec."Sell-to Customer No." = '') then
- DocumentIsPosted := (not Rec.Get(Rec."Document Type", Rec."No."));
-
- CheckShowBackgrValidationNotification();
- VATDateEnabled := VATReportingDateMgt.IsVATDateEnabled();
- end;
-
- trigger OnQueryClosePage(CloseAction: Action): Boolean
- var
- Result: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeOnQueryClosePage(Rec, DocumentIsPosted, CloseAction, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if not DocumentIsPosted then
- exit(Rec.ConfirmCloseUnposted());
- end;
-
- var
- SellToContact: Record Contact;
- BillToContact: Record Contact;
- SalesSetup: Record "Sales & Receivables Setup";
- GLSetup: Record "General Ledger Setup";
- MoveNegSalesLines: Report "Move Negative Sales Lines";
- ReportPrint: Codeunit "Test Report-Print";
- UserMgt: Codeunit "User Setup Management";
- SalesCalcDiscByType: Codeunit "Sales - Calc Discount By Type";
- LinesInstructionMgt: Codeunit "Lines Instruction Mgt.";
- FormatAddress: Codeunit "Format Address";
- PrivacyNotice: Codeunit "Privacy Notice";
- FlowServiceManagement: Codeunit "Flow Service Management";
- ChangeExchangeRate: Page "Change Exchange Rate";
- WorkDescription: Text;
- StatusStyleTxt: Text;
- JobQueueVisible: Boolean;
- JobQueueUsed: Boolean;
- HasIncomingDocument: Boolean;
- DocNoVisible: Boolean;
- ExternalDocNoMandatory: Boolean;
- OpenApprovalEntriesExistForCurrUser: Boolean;
- IsPowerAutomatePrivacyNoticeApproved: Boolean;
- OpenApprovalEntriesExist: Boolean;
- ShowWorkflowStatus: Boolean;
- OpenPostedSalesCrMemoQst: Label 'The credit memo is posted as number %1 and moved to the Posted Sales Credit Memos window.\\Do you want to open the posted credit memo?', Comment = '%1 = posted document number';
- CanCancelApprovalForRecord: Boolean;
- IsCustomerOrContactNotEmpty: Boolean;
- CanRequestApprovalForFlow: Boolean;
- CanCancelApprovalForFlow: Boolean;
- IsSaaS: Boolean;
- IsBillToCountyVisible: Boolean;
- IsSellToCountyVisible: Boolean;
- SalesDocCheckFactboxVisible: Boolean;
- IsJournalTemplNameVisible: Boolean;
- IsPaymentMethodCodeVisible: Boolean;
- VATDateEnabled: Boolean;
-
- protected var
- DocumentIsPosted: Boolean;
- IsSalesLinesEditable: Boolean;
- IsPostingGroupEditable: Boolean;
-
- local procedure ActivateFields()
- begin
- IsBillToCountyVisible := FormatAddress.UseCounty(Rec."Bill-to Country/Region Code");
- IsSellToCountyVisible := FormatAddress.UseCounty(Rec."Sell-to Country/Region Code");
- GLSetup.Get();
- IsJournalTemplNameVisible := GLSetup."Journal Templ. Name Mandatory";
- IsPaymentMethodCodeVisible := not GLSetup."Hide Payment Method Code";
-
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- end;
-
- ///
- /// Calls the document posting procedure with the specified posting codeunit.
- ///
- /// The ID of the posting codeunit to execute.
- procedure CallPostDocument(PostingCodeunitID: Integer)
- begin
- PostDocument(PostingCodeunitID);
- end;
-
- local procedure PostDocument(PostingCodeunitID: Integer)
- var
- SalesHeader: Record "Sales Header";
- SalesCrMemoHeader: Record "Sales Cr.Memo Header";
- OfficeMgt: Codeunit "Office Management";
- InstructionMgt: Codeunit "Instruction Mgt.";
- PageManagement: Codeunit "Page Management";
- PreAssignedNo: Code[20];
- xLastPostingNo: Code[20];
- IsScheduledPosting: Boolean;
- IsHandled: Boolean;
- begin
- CheckSalesCheckAllLinesHaveQuantityAssigned();
- PreAssignedNo := Rec."No.";
- xLastPostingNo := Rec."Last Posting No.";
-
- Rec.SendToPosting(PostingCodeunitID);
-
- IsScheduledPosting := Rec."Job Queue Status" = Rec."Job Queue Status"::"Scheduled for Posting";
- DocumentIsPosted := (not SalesHeader.Get(Rec."Document Type", Rec."No.")) or IsScheduledPosting;
- OnPostOnAfterSetDocumentIsPosted(SalesHeader, IsScheduledPosting, DocumentIsPosted);
-
- if IsScheduledPosting then
- CurrPage.Close();
- CurrPage.Update(false);
-
- IsHandled := false;
- OnPostDocumentBeforeNavigateAfterPosting(Rec, PostingCodeunitID, DocumentIsPosted, IsHandled);
- if IsHandled then
- exit;
-
- if PostingCodeunitID <> CODEUNIT::"Sales-Post (Yes/No)" then
- exit;
-
- Rec.UpdateSalesOrderLineIfExist();
-
- if OfficeMgt.IsAvailable() then begin
- if (Rec."Last Posting No." <> '') and (Rec."Last Posting No." <> xLastPostingNo) then
- SalesCrMemoHeader.SetRange("No.", Rec."Last Posting No.")
- else
- SalesCrMemoHeader.SetRange("Pre-Assigned No.", PreAssignedNo);
- IsHandled := false;
- OnPostDocumentOnBeforeOpenPage(SalesCrMemoHeader, IsHandled);
- if not IsHandled then
- if SalesCrMemoHeader.FindFirst() then
- PageManagement.PageRun(SalesCrMemoHeader);
- end else
- if InstructionMgt.IsEnabled(InstructionMgt.ShowPostedConfirmationMessageCode()) then
- ShowPostedConfirmationMessage(PreAssignedNo, xLastPostingNo);
- end;
-
- local procedure ApproveCalcInvDisc()
- begin
- CurrPage.SalesLines.PAGE.ApproveCalcInvDisc();
- end;
-
- local procedure SaveInvoiceDiscountAmount()
- var
- DocumentTotals: Codeunit "Document Totals";
- begin
- CurrPage.SaveRecord();
- DocumentTotals.SalesRedistributeInvoiceDiscountAmountsOnDocument(Rec);
- CurrPage.Update(false);
- end;
-
- local procedure SalespersonCodeOnAfterValidate()
- begin
- CurrPage.SalesLines.PAGE.UpdateForm(true);
- end;
-
- local procedure ShortcutDimension1CodeOnAfterV()
- begin
- CurrPage.Update();
- end;
-
- local procedure ShortcutDimension2CodeOnAfterV()
- begin
- CurrPage.Update();
- end;
-
- local procedure PricesIncludingVATOnAfterValid()
- begin
- CurrPage.SalesLines.Page.ForceTotalsCalculation();
- CurrPage.Update();
- end;
-
- local procedure SetDocNoVisible()
- var
- DocumentNoVisibility: Codeunit DocumentNoVisibility;
- DocType: Option Quote,"Order",Invoice,"Credit Memo","Blanket Order","Return Order",Reminder,FinChMemo;
- begin
- DocNoVisible := DocumentNoVisibility.SalesDocumentNoIsVisible(DocType::"Credit Memo", Rec."No.");
- end;
-
- local procedure SetExtDocNoMandatoryCondition()
- begin
- SalesSetup.GetRecordOnce();
- ExternalDocNoMandatory := SalesSetup."Ext. Doc. No. Mandatory";
- end;
-
- ///
- /// Shows a preview of the posting result without actually posting the document.
- ///
- procedure ShowPreview()
- var
- SalesPostYesNo: Codeunit "Sales-Post (Yes/No)";
- begin
- SalesPostYesNo.Preview(Rec);
- end;
-
- local procedure SetControlAppearance()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- DocumentErrorsMgt: Codeunit "Document Errors Mgt.";
- WorkflowWebhookMgt: Codeunit "Workflow Webhook Management";
- begin
- JobQueueVisible := Rec."Job Queue Status" = Rec."Job Queue Status"::"Scheduled for Posting";
- HasIncomingDocument := Rec."Incoming Document Entry No." <> 0;
- SetExtDocNoMandatoryCondition();
- SetPostingGroupEditable();
-
- OpenApprovalEntriesExistForCurrUser := ApprovalsMgmt.HasOpenApprovalEntriesForCurrentUser(Rec.RecordId);
- OpenApprovalEntriesExist := ApprovalsMgmt.HasOpenApprovalEntries(Rec.RecordId);
- CanCancelApprovalForRecord := ApprovalsMgmt.CanCancelApprovalForRecord(Rec.RecordId);
- IsCustomerOrContactNotEmpty := (Rec."Sell-to Customer No." <> '') or (Rec."Sell-to Contact No." <> '');
- IsSalesLinesEditable := Rec.SalesLinesEditable();
-
- SalesDocCheckFactboxVisible := DocumentErrorsMgt.BackgroundValidationEnabled();
- WorkflowWebhookMgt.GetCanRequestAndCanCancel(Rec.RecordId, CanRequestApprovalForFlow, CanCancelApprovalForFlow);
-
- OnAfterSetControlAppearance(Rec);
- end;
-
- ///
- /// Runs a background check for document errors.
- ///
- procedure RunBackgroundCheck()
- begin
- CurrPage.SalesDocCheckFactbox.Page.CheckErrorsInBackground(Rec);
- end;
-
- local procedure CheckShowBackgrValidationNotification()
- var
- DocumentErrorsMgt: Codeunit "Document Errors Mgt.";
- begin
- if DocumentErrorsMgt.CheckShowEnableBackgrValidationNotification() then
- SetControlAppearance();
- end;
-
- local procedure CheckSalesCheckAllLinesHaveQuantityAssigned()
- begin
- LinesInstructionMgt.SalesCheckAllLinesHaveQuantityAssigned(Rec);
- end;
-
- local procedure ShowPostedConfirmationMessage(PreAssignedNo: Code[20]; xLastPostingNo: Code[20])
- var
- SalesCrMemoHeader: Record "Sales Cr.Memo Header";
- InstructionMgt: Codeunit "Instruction Mgt.";
- IsHandled: Boolean;
- begin
- if (Rec."Last Posting No." <> '') and (Rec."Last Posting No." <> xLastPostingNo) then
- SalesCrMemoHeader.SetRange("No.", Rec."Last Posting No.")
- else
- SalesCrMemoHeader.SetRange("Pre-Assigned No.", PreAssignedNo);
- if SalesCrMemoHeader.FindFirst() then
- if InstructionMgt.ShowConfirm(StrSubstNo(OpenPostedSalesCrMemoQst, SalesCrMemoHeader."No."),
- InstructionMgt.ShowPostedConfirmationMessageCode())
- then begin
- IsHandled := false;
- OnShowPostedConfirmationMessageOnBeforeShowPostedDocument(SalesCrMemoHeader, IsHandled);
- if not IsHandled then
- InstructionMgt.ShowPostedDocument(SalesCrMemoHeader, Page::"Sales Credit Memo");
- end;
- end;
-
- ///
- /// Sets whether the posting group field should be editable based on customer settings.
- ///
- procedure SetPostingGroupEditable()
- var
- BillToCustomer: Record Customer;
- begin
- if BillToCustomer.Get(Rec."Bill-to Customer No.") then
- IsPostingGroupEditable := BillToCustomer."Allow Multiple Posting Groups";
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnAfterOnAfterGetRecord(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnAfterSetControlAppearance(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnPostOnAfterSetDocumentIsPosted(SalesHeader: Record "Sales Header"; var IsScheduledPosting: Boolean; var DocumentIsPosted: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnPostDocumentBeforeNavigateAfterPosting(var SalesHeader: Record "Sales Header"; var PostingCodeunitID: Integer; DocumentIsPosted: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnShowPostedConfirmationMessageOnBeforeShowPostedDocument(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var IsHandled: boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnPostDocumentOnBeforeOpenPage(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var IsHandled: boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeOnQueryClosePage(var SalesHeader: Record "Sales Header"; DocumentIsPosted: Boolean; CloseAction: Action; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupBillToName(var Customer: Record Customer; SalesHeader: Record "Sales Header")
- begin
- end;
-}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Sales/Document/SalesHeader.Table.al b/src/Layers/NL/BaseApp/Sales/Document/SalesHeader.Table.al
deleted file mode 100644
index bca6498c70..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Document/SalesHeader.Table.al
+++ /dev/null
@@ -1,14041 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.Assembly.Document;
-using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.DirectDebit;
-using Microsoft.Bank.Payment;
-using Microsoft.Bank.Setup;
-using Microsoft.CRM.BusinessRelation;
-using Microsoft.CRM.Campaign;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Interaction;
-using Microsoft.CRM.Opportunity;
-using Microsoft.CRM.Outlook;
-using Microsoft.CRM.Task;
-using Microsoft.CRM.Team;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Deferral;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.Finance.SalesTax;
-using Microsoft.Finance.VAT.Registration;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.BatchProcessing;
-using Microsoft.Foundation.Company;
-using Microsoft.Foundation.ExtendedText;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Foundation.PaymentTerms;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Foundation.Shipping;
-using Microsoft.Integration.D365Sales;
-using Microsoft.Integration.Dataverse;
-using Microsoft.Integration.Graph;
-using Microsoft.Intercompany;
-using Microsoft.Intercompany.Partner;
-using Microsoft.Intercompany.Setup;
-using Microsoft.Inventory.Availability;
-using Microsoft.Inventory.Intrastat;
-using Microsoft.Inventory.Item;
-using Microsoft.Inventory.Ledger;
-using Microsoft.Inventory.Location;
-using Microsoft.Inventory.Requisition;
-using Microsoft.Inventory.Setup;
-using Microsoft.Inventory.Tracking;
-using Microsoft.Pricing.Calculation;
-using Microsoft.Projects.Project.Job;
-using Microsoft.Projects.Project.Journal;
-using Microsoft.Projects.Project.Posting;
-using Microsoft.Projects.Resources.Resource;
-using Microsoft.Sales.Archive;
-using Microsoft.Sales.Comment;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.History;
-using Microsoft.Sales.Posting;
-using Microsoft.Sales.Pricing;
-using Microsoft.Sales.Receivables;
-using Microsoft.Sales.Setup;
-using Microsoft.Utilities;
-using Microsoft.Warehouse.Activity;
-using Microsoft.Warehouse.Document;
-using Microsoft.Warehouse.Request;
-using System;
-using System.Automation;
-using System.Email;
-using System.Environment.Configuration;
-using System.Globalization;
-using System.Reflection;
-using System.Security.User;
-using System.Threading;
-using System.Utilities;
-
-///
-/// Stores document-level information for sales quotes, orders, invoices, credit memos, blanket orders, and return orders.
-///
-table 36 "Sales Header"
-{
- Caption = 'Sales Header';
- DataCaptionFields = "No.", "Sell-to Customer Name";
- LookupPageID = "Sales List";
- Permissions = tabledata "Assemble-to-Order Link" = rmid,
- tabledata "Assembly Header" = m;
- DataClassification = CustomerContent;
-
- fields
- {
- ///
- /// Specifies the type of sales document such as quote, order, invoice, or credit memo.
- ///
- field(1; "Document Type"; Enum "Sales Document Type")
- {
- Caption = 'Document Type';
- }
- ///
- /// Specifies the customer number to whom the goods or services are sold.
- ///
- field(2; "Sell-to Customer No."; Code[20])
- {
- Caption = 'Sell-to Customer No.';
- ToolTip = 'Specifies the number of the customer that you''re selling to. By default, the same customer is suggested as the ship-to customer. If needed, you can specify a different ship-to customer on the document.';
- TableRelation = Customer;
-
- trigger OnValidate()
- var
- LocationCode: Code[10];
- ShouldSkipConfirmSellToCustomerDialog: Boolean;
- IsHandled: Boolean;
- ConfirmedShouldBeFalse: Boolean;
- begin
- CheckCreditLimitIfLineNotInsertedYet();
- if "No." = '' then
- InitRecord();
- TestStatusOpen();
-
- IsHandled := false;
- OnValidateSellToCustomerNoOnAfterTestStatusOpen(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if ("Sell-to Customer No." <> xRec."Sell-to Customer No.") and
- (xRec."Sell-to Customer No." <> '')
- then begin
- if ("Opportunity No." <> '') and ("Document Type" in ["Document Type"::Quote, "Document Type"::Order]) then
- Error(
- Text062,
- FieldCaption("Sell-to Customer No."),
- FieldCaption("Opportunity No."),
- "Opportunity No.",
- "Document Type");
-
- ShouldSkipConfirmSellToCustomerDialog := GetHideValidationDialog() or not GuiAllowed();
- ConfirmedShouldBeFalse := false;
- OnValidateSellToCustomerNoOnAfterCalcShouldSkipConfirmSellToCustomerDialog(Rec, ShouldSkipConfirmSellToCustomerDialog, ConfirmedShouldBeFalse);
- if ShouldSkipConfirmSellToCustomerDialog then
- Confirmed := true and not ConfirmedShouldBeFalse
- else
- Confirmed := Confirm(ConfirmChangeQst, false, SellToCustomerTxt);
- if Confirmed then begin
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
- if "Sell-to Customer No." = '' then begin
- if SalesLine.FindFirst() then
- Error(
- Text005,
- FieldCaption("Sell-to Customer No."));
- Init();
- OnValidateSellToCustomerNoAfterInit(Rec, xRec);
- GetSalesSetup();
- "No. Series" := xRec."No. Series";
- InitRecord();
- InitNoSeries();
- exit;
- end;
-
- CheckShipmentInfo(SalesLine, false);
- CheckPrepmtInfo(SalesLine);
- CheckReturnInfo(SalesLine, false);
-
- SalesLine.Reset();
- AltCustVATRegFacade.Init(Rec, xRec);
- end else begin
- Rec := xRec;
- exit;
- end;
- end;
-
- if ("Document Type" = "Document Type"::Order) and
- (xRec."Sell-to Customer No." <> "Sell-to Customer No.")
- then begin
- SalesLine.SetRange("Document Type", SalesLine."Document Type"::Order);
- SalesLine.SetRange("Document No.", "No.");
- SalesLine.SetFilter("Purch. Order Line No.", '<>0');
- if not SalesLine.IsEmpty() then
- Error(
- Text006,
- FieldCaption("Sell-to Customer No."));
- SalesLine.Reset();
- end;
-
- OnValidateSellToCustomerNoOnBeforeGetCust(Rec, xRec);
- GetCust("Sell-to Customer No.");
- IsHandled := false;
- OnValidateSellToCustomerNoOnBeforeCheckBlockedCustOnDocs(Rec, Customer, IsHandled);
- if not IsHandled then
- Customer.CheckBlockedCustOnDocs(Customer, "Document Type", false, false);
- if (not ApplicationAreaMgmt.IsSalesTaxEnabled()) and (Customer."No." <> '') then
- Customer.TestField("Gen. Bus. Posting Group");
- OnAfterCheckSellToCust(Rec, xRec, Customer, CurrFieldNo);
-
- CopySellToCustomerAddressFieldsFromCustomer(Customer);
-
- if "Sell-to Customer No." = xRec."Sell-to Customer No." then
- if ShippedSalesLinesExist() or ReturnReceiptExist() then begin
- TestField("VAT Bus. Posting Group", xRec."VAT Bus. Posting Group");
- TestField("Gen. Bus. Posting Group", xRec."Gen. Bus. Posting Group");
- end;
-
- "Sell-to IC Partner Code" := Customer."IC Partner Code";
- "Send IC Document" := ("Sell-to IC Partner Code" <> '') and ("IC Direction" = "IC Direction"::Outgoing);
-
- UpdateShipToCodeFromCust();
- IsHandled := false;
- OnValidateSellToCustomerNoOnBeforeValidateLocationCode(Rec, Customer, IsHandled, xRec, LocationCode);
- if not IsHandled then
- LocationCode := "Location Code";
-
- SetBillToCustomerNo(Customer);
-
- Validate("Location Code", LocationCode);
- GetShippingTime(FieldNo("Sell-to Customer No."));
-
- SetRcvdFromCountry(Customer."Country/Region Code");
-
- if (xRec."Sell-to Customer No." <> "Sell-to Customer No.") or
- (xRec."Currency Code" <> "Currency Code") or
- (xRec."Gen. Bus. Posting Group" <> "Gen. Bus. Posting Group") or
- (xRec."VAT Bus. Posting Group" <> "VAT Bus. Posting Group")
- then
- RecreateSalesLines(SellToCustomerTxt);
-
- if not InsertMode and ("Sell-to Customer No." <> '') then
- StandardCodesMgtGlobal.CheckCreateSalesRecurringLines(Rec);
-
- OnValidateSellToCustomerNoOnBeforeUpdateSellToCont(Rec, xRec, Customer, SkipSellToContact);
- if not SkipSellToContact then
- UpdateSellToCont("Sell-to Customer No.");
-
- OnValidateSellToCustomerNoOnBeforeRecallModifyAddressNotification(Rec, xRec);
- if (xRec."Sell-to Customer No." <> '') and (xRec."Sell-to Customer No." <> "Sell-to Customer No.") then
- Rec.RecallModifyAddressNotification(GetModifyCustomerAddressNotificationId());
-
- if xRec."Sell-to Customer No." <> "Sell-to Customer No." then
- if not IsNullGuid(Rec.SystemId) then
- SalesCalcDiscountByType.ApplyDefaultInvoiceDiscount(0, Rec, true);
- end;
- }
- ///
- /// Specifies the unique document number that identifies the sales document.
- ///
- field(3; "No."; Code[20])
- {
- Caption = 'No.';
- ToolTip = 'Specifies a unique number that identifies the sales document. The number can be generated automatically from a number series, or you can number each of them manually.';
-
- trigger OnValidate()
- var
- NoSeries: Codeunit "No. Series";
- begin
- if "No." <> xRec."No." then begin
- GetSalesSetup();
- NoSeries.TestManual(GetNoSeriesCode());
- "No. Series" := '';
- end;
- end;
- }
- ///
- /// Specifies the customer number to whom the invoice is sent for payment.
- ///
- field(4; "Bill-to Customer No."; Code[20])
- {
- Caption = 'Bill-to Customer No.';
- ToolTip = 'Specifies the number of the customer that you send or sent the invoice or credit memo to.';
- NotBlank = true;
- TableRelation = Customer;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- IsHandledDoExist: Boolean;
- begin
- TestStatusOpen();
- BilltoCustomerNoChanged := xRec."Bill-to Customer No." <> "Bill-to Customer No.";
-
- IsHandled := false;
- OnValidateBillToCustomerNoOnAfterCheckBilltoCustomerNoChanged(Rec, xRec, CurrFieldNo, IsHandled, IsHandledDoExist);
- if IsHandledDoExist then
- exit;
-
- if BilltoCustomerNoChanged and not IsHandled then
- if xRec."Bill-to Customer No." = '' then begin
- SkipDocNoOccurrenceReset := true;
- InitRecord();
- end else
- if ConfirmBillToCustomerChange() then begin
- OnValidateBillToCustomerNoOnAfterConfirmed(Rec);
-
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
-
- CheckShipmentInfo(SalesLine, true);
- CheckPrepmtInfo(SalesLine);
- CheckReturnInfo(SalesLine, true);
-
- SalesLine.Reset();
- end else
- "Bill-to Customer No." := xRec."Bill-to Customer No.";
-
- GetCust("Bill-to Customer No.");
- IsHandled := false;
- OnValidateBillToCustomerNoOnBeforeCheckBlockedCustOnDocs(Rec, Customer, IsHandled);
- if not IsHandled then
- Customer.CheckBlockedCustOnDocs(Customer, "Document Type", false, false);
- if Customer."No." <> '' then
- Customer.TestField("Customer Posting Group");
- PostingSetupMgt.CheckCustPostingGroupReceivablesAccount("Customer Posting Group");
- CheckCreditLimit();
- OnAfterCheckBillToCust(Rec, xRec, Customer);
-
- SetBillToCustomerAddressFieldsFromCustomer(Customer);
- Validate("Currency Code");
-
- if not BilltoCustomerNoChanged then
- if ShippedSalesLinesExist() then begin
- TestField("Customer Disc. Group", xRec."Customer Disc. Group");
- TestField("Currency Code", xRec."Currency Code");
- end;
-
- CreateDimensionsFromValidateBillToCustomerNo();
-
- Validate("Payment Terms Code");
- Validate("Prepmt. Payment Terms Code");
- Validate("Payment Method Code");
- Validate("Transaction Mode Code");
- Validate("Prepayment %");
-
- if (xRec."Sell-to Customer No." = "Sell-to Customer No.") and
- (xRec."Bill-to Customer No." <> "Bill-to Customer No.")
- then begin
- RecreateSalesLines(BillToCustomerTxt);
- BilltoCustomerNoChanged := false;
- end;
- if not SkipBillToContact then
- UpdateBillToCont("Bill-to Customer No.");
-
- "Bill-to IC Partner Code" := Customer."IC Partner Code";
- "Send IC Document" := ("Bill-to IC Partner Code" <> '') and ("IC Direction" = "IC Direction"::Outgoing);
-
- OnValidateBillToCustomerNoOnBeforeRecallModifyAddressNotification(Rec, xRec);
- if (xRec."Bill-to Customer No." <> '') and (xRec."Bill-to Customer No." <> "Bill-to Customer No.") then
- Rec.RecallModifyAddressNotification(Rec.GetModifyBillToCustomerAddressNotificationId());
-
- if xRec."Bill-to Customer No." <> "Bill-to Customer No." then
- if not IsNullGuid(Rec.SystemId) then
- SalesCalcDiscountByType.ApplyDefaultInvoiceDiscount(0, Rec, true);
- end;
- }
- ///
- /// Specifies the name of the customer to whom the invoice is sent.
- ///
- field(5; "Bill-to Name"; Text[100])
- {
- Caption = 'Bill-to Name';
- ToolTip = 'Specifies the name of the customer that you send or sent the invoice or credit memo to.';
- TableRelation = Customer.Name;
- ValidateTableRelation = false;
-
- trigger OnValidate()
- var
- Customer: Record Customer;
- begin
- OnBeforeValidateBillToCustomerName(Rec, Customer);
- if Rec."Bill-to Name" <> xRec."Bill-to Name" then
- if ShouldSearchForCustomerByName("Bill-to Customer No.") then
- Validate("Bill-to Customer No.", Customer.GetCustNo("Bill-to Name"));
- end;
- }
- ///
- /// Specifies an additional part of the bill-to customer name.
- ///
- field(6; "Bill-to Name 2"; Text[50])
- {
- Caption = 'Bill-to Name 2';
- ToolTip = 'Specifies an additional part of the name of the customer that you send or sent the invoice or credit memo to.';
- }
- ///
- /// Specifies the street address of the customer to whom the invoice is sent.
- ///
- field(7; "Bill-to Address"; Text[100])
- {
- Caption = 'Bill-to Address';
- ToolTip = 'Specifies the address of the customer that you will send the invoice to.';
-
- trigger OnValidate()
- begin
- ModifyBillToCustomerAddress();
- end;
- }
- ///
- /// Specifies additional street address information for the bill-to customer.
- ///
- field(8; "Bill-to Address 2"; Text[50])
- {
- Caption = 'Bill-to Address 2';
- ToolTip = 'Specifies additional address information.';
-
- trigger OnValidate()
- begin
- ModifyBillToCustomerAddress();
- end;
- }
- ///
- /// Specifies the city of the customer to whom the invoice is sent.
- ///
- field(9; "Bill-to City"; Text[30])
- {
- Caption = 'Bill-to City';
- ToolTip = 'Specifies the city of the customer on the sales document.';
- TableRelation = if ("Bill-to Country/Region Code" = const('')) "Post Code".City
- else
- if ("Bill-to Country/Region Code" = filter(<> '')) "Post Code".City where("Country/Region Code" = field("Bill-to Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnLookup()
- begin
- OnBeforeLookupBillToCity(Rec, PostCode);
-
- PostCode.LookupPostCode("Bill-to City", "Bill-to Post Code", "Bill-to County", "Bill-to Country/Region Code");
-
- OnAfterLookupBillToCity(Rec, PostCode, xRec);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateBillToCity(Rec, PostCode, CurrFieldNo, IsHandled);
- if not IsHandled then
- PostCode.ValidateCity(
- "Bill-to City", "Bill-to Post Code", "Bill-to County", "Bill-to Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- ModifyBillToCustomerAddress();
- end;
- }
- ///
- /// Specifies the name of the contact person at the bill-to customer's address.
- ///
- field(10; "Bill-to Contact"; Text[100])
- {
- Caption = 'Bill-to Contact';
- ToolTip = 'Specifies the name of the contact person at the customer''s billing address.';
-
- trigger OnLookup()
- var
- Contact: Record Contact;
- begin
- Contact.FilterGroup(2);
- LookupContact("Bill-to Customer No.", "Bill-to Contact No.", Contact);
- if PAGE.RunModal(0, Contact) = ACTION::LookupOK then
- Validate("Bill-to Contact No.", Contact."No.");
- Contact.FilterGroup(0);
- end;
-
- trigger OnValidate()
- begin
- ModifyBillToCustomerAddress();
- end;
- }
- ///
- /// Specifies the customer's own reference number for tracking purposes.
- ///
- field(11; "Your Reference"; Text[35])
- {
- Caption = 'Your Reference';
- ToolTip = 'Specifies the customer''s reference. The content will be printed on sales documents.';
- }
- ///
- /// Specifies a code for an alternate shipping address different from the customer's default address.
- ///
- field(12; "Ship-to Code"; Code[10])
- {
- Caption = 'Ship-to Code';
- ToolTip = 'Specifies a code for an alternate shipment address if you want to ship to another address than the one that has been entered automatically. This field is also used in case of drop shipment.';
- TableRelation = "Ship-to Address".Code where("Customer No." = field("Sell-to Customer No."));
-
- trigger OnValidate()
- var
- ShipToAddr: Record "Ship-to Address";
- IsHandled: Boolean;
- CopyShipToAddress: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShipToCode(Rec, xRec, Customer, ShipToAddr, IsHandled);
- if IsHandled then
- exit;
-
- if ("Document Type" = "Document Type"::Order) and
- (xRec."Ship-to Code" <> "Ship-to Code")
- then begin
- SalesLine.SetRange("Document Type", SalesLine."Document Type"::Order);
- SalesLine.SetRange("Document No.", "No.");
- SalesLine.SetFilter("Purch. Order Line No.", '<>0');
- if not SalesLine.IsEmpty() then
- Error(
- Text006,
- FieldCaption("Ship-to Code"));
- SalesLine.Reset();
- end;
-
- CopyShipToAddress := not IsCreditDocType();
- OnValidateShipToCodeOnBeforeCopyShipToAddress(Rec, xRec, CopyShipToAddress);
- if CopyShipToAddress then
- if "Ship-to Code" <> '' then begin
- if xRec."Ship-to Code" <> '' then begin
- GetCust("Sell-to Customer No.");
- SetCustomerLocationCode(Customer);
- "Tax Area Code" := Customer."Tax Area Code";
- end;
- ShipToAddr.Get("Sell-to Customer No.", "Ship-to Code");
- SetShipToCustomerAddressFieldsFromShipToAddr(ShipToAddr);
- end else
- if "Sell-to Customer No." <> '' then begin
- GetCust("Sell-to Customer No.");
- CopyShipToCustomerAddressFieldsFromCust(Customer);
- AltCustVATRegFacade.CopyFromCustomer(Rec, xRec);
- end;
-
- UpdateShipToSalespersonCode(FieldNo("Ship-to Code"));
- GetShipmentMethodCode();
- GetShippingTime(FieldNo("Ship-to Code"));
-
- if (xRec."Sell-to Customer No." = "Sell-to Customer No.") and
- (xRec."Ship-to Code" <> "Ship-to Code")
- then
- if AltCustVATRegFacade.VATDataIsChangedOnShipToCodeValidation(Rec, xRec) or
- (xRec."Tax Area Code" <> "Tax Area Code")
- then
- RecreateSalesLines(FieldCaption("Ship-to Code"))
- else begin
- if xRec."Shipping Agent Code" <> "Shipping Agent Code" then
- MessageIfSalesLinesExist(FieldCaption("Shipping Agent Code"));
- if xRec."Shipping Agent Service Code" <> "Shipping Agent Service Code" then
- MessageIfSalesLinesExist(FieldCaption("Shipping Agent Service Code"));
- OnValidateShipToCodeOnBeforeValidateTaxLiable(Rec, xRec);
- if xRec."Tax Liable" <> "Tax Liable" then
- Validate("Tax Liable");
- end;
- end;
- }
- ///
- /// Specifies the name of the customer at the shipping address.
- ///
- field(13; "Ship-to Name"; Text[100])
- {
- Caption = 'Ship-to Name';
- ToolTip = 'Specifies the name of the customer at the address that the items are shipped to.';
- }
- ///
- /// Specifies an additional part of the ship-to customer name.
- ///
- field(14; "Ship-to Name 2"; Text[50])
- {
- Caption = 'Ship-to Name 2';
- ToolTip = 'Specifies an additional part of the name that products on the sales document will be shipped to.';
- }
- ///
- /// Specifies the street address where items are shipped to.
- ///
- field(15; "Ship-to Address"; Text[100])
- {
- Caption = 'Ship-to Address';
- ToolTip = 'Specifies the address that products on the sales document will be shipped to.';
- }
- ///
- /// Specifies additional street address information for the shipping address.
- ///
- field(16; "Ship-to Address 2"; Text[50])
- {
- Caption = 'Ship-to Address 2';
- ToolTip = 'Specifies additional address information.';
- }
- ///
- /// Specifies the city of the shipping address.
- ///
- field(17; "Ship-to City"; Text[30])
- {
- Caption = 'Ship-to City';
- ToolTip = 'Specifies the city of the customer on the sales document.';
- TableRelation = if ("Ship-to Country/Region Code" = const('')) "Post Code".City
- else
- if ("Ship-to Country/Region Code" = filter(<> '')) "Post Code".City where("Country/Region Code" = field("Ship-to Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnLookup()
- begin
- OnBeforeLookupShipToCity(Rec, PostCode);
-
- PostCode.LookupPostCode("Ship-to City", "Ship-to Post Code", "Ship-to County", "Ship-to Country/Region Code");
-
- OnAfterLookupShipToCity(Rec, PostCode, xRec);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShipToCity(Rec, PostCode, CurrFieldNo, IsHandled);
- if not IsHandled then
- PostCode.ValidateCity(
- "Ship-to City", "Ship-to Post Code", "Ship-to County", "Ship-to Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- end;
- }
- ///
- /// Specifies the name of the contact person at the shipping address.
- ///
- field(18; "Ship-to Contact"; Text[100])
- {
- Caption = 'Ship-to Contact';
- ToolTip = 'Specifies the name of the contact person at the address that the items are shipped to.';
- }
- ///
- /// Specifies the date when the order was created.
- ///
- field(19; "Order Date"; Date)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Order Date';
- ToolTip = 'Specifies the date when the order was created.';
-
- trigger OnValidate()
- begin
- if ("Document Type" in ["Document Type"::Quote, "Document Type"::Order]) and
- not ("Order Date" = xRec."Order Date")
- then
- PriceMessageIfSalesLinesExist(FieldCaption("Order Date"));
- end;
- }
- ///
- /// Specifies the date when the document is posted to the general ledger.
- ///
- field(20; "Posting Date"; Date)
- {
- Caption = 'Posting Date';
- ToolTip = 'Specifies the date when the posting of the sales document will be recorded.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- NeedUpdateCurrencyFactor: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePostingDate(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Posting Date");
- TestNoSeriesDate(
- "Posting No.", "Posting No. Series",
- FieldCaption("Posting No."), FieldCaption("Posting No. Series"));
- TestNoSeriesDate(
- "Prepayment No.", "Prepayment No. Series",
- FieldCaption("Prepayment No."), FieldCaption("Prepayment No. Series"));
- TestNoSeriesDate(
- "Prepmt. Cr. Memo No.", "Prepmt. Cr. Memo No. Series",
- FieldCaption("Prepmt. Cr. Memo No."), FieldCaption("Prepmt. Cr. Memo No. Series"));
-
- UpdateVATReportingDate(FieldNo("Posting Date"));
- UpdateDocumentDateFromLinkedPostingDate(true);
-
- if ("Document Type" in ["Document Type"::Invoice, "Document Type"::"Credit Memo"]) and
- not ("Posting Date" = xRec."Posting Date")
- then
- PriceMessageIfSalesLinesExist(FieldCaption("Posting Date"));
-
- OnValidatePostingDateOnBeforeResetInvoiceDiscountValue(Rec, xRec);
- ResetInvoiceDiscountValue();
-
- NeedUpdateCurrencyFactor := "Currency Code" <> '';
- OnValidatePostingDateOnBeforeCheckNeedUpdateCurrencyFactor(Rec, Confirmed, NeedUpdateCurrencyFactor, xRec);
- if NeedUpdateCurrencyFactor then begin
- UpdateCurrencyFactor();
- if ("Currency Factor" <> xRec."Currency Factor") and not GetCalledFromWhseDoc() then
- ConfirmCurrencyFactorUpdate();
- end;
- OnValidatePostingDateOnAfterCheckNeedUpdateCurrencyFactor(Rec, xRec, NeedUpdateCurrencyFactor);
-
- if "Posting Date" <> xRec."Posting Date" then
- if DeferralHeadersExist() then
- ConfirmUpdateDeferralDate();
- SynchronizeAsmHeader();
- end;
- }
- ///
- /// Specifies the date when items on the sales document should be shipped.
- ///
- field(21; "Shipment Date"; Date)
- {
- Caption = 'Shipment Date';
- ToolTip = 'Specifies when items on the document are shipped or were shipped. A shipment date is usually calculated from a requested delivery date plus lead time.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShipmentDate(Rec, CurrFieldNo, IsHandled);
- if not IsHandled then
- UpdateSalesLinesByFieldNo(FieldNo("Shipment Date"), CurrFieldNo <> 0);
- end;
- }
- ///
- /// Specifies the text that appears in ledger entries when the document is posted.
- ///
- field(22; "Posting Description"; Text[100])
- {
- Caption = 'Posting Description';
- ToolTip = 'Specifies additional posting information for the document. After you post the document, the description can add detail to vendor and customer ledger entries.';
- }
- ///
- /// Specifies the payment terms code that determines due date and payment discount calculations.
- ///
- field(23; "Payment Terms Code"; Code[10])
- {
- Caption = 'Payment Terms Code';
- ToolTip = 'Specifies a formula that calculates the payment due date, payment discount date, and payment discount amount.';
- TableRelation = "Payment Terms";
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePaymentTermsCode(Rec, xRec, CurrFieldNo, UpdateDocumentDate, IsHandled);
- if IsHandled then
- exit;
-
- if ("Payment Terms Code" <> '') and ("Document Date" <> 0D) then begin
- PaymentTerms.Get("Payment Terms Code");
- if IsCreditDocType() and not PaymentTerms."Calc. Pmt. Disc. on Cr. Memos" then begin
- IsHandled := false;
- OnValidatePaymentTermsCodeOnBeforeValidateDueDate(Rec, xRec, CurrFieldNo, IsHandled);
- if not IsHandled then
- Validate("Due Date", "Document Date");
- Validate("Pmt. Discount Date", 0D);
- Validate("Payment Discount %", 0);
- end else begin
- IsHandled := false;
- OnValidatePaymentTermsCodeOnBeforeCalcDueDate(Rec, xRec, FieldNo("Payment Terms Code"), CurrFieldNo, IsHandled);
- if not IsHandled then
- "Due Date" := CalcDate(PaymentTerms."Due Date Calculation", "Document Date");
- IsHandled := false;
- OnValidatePaymentTermsCodeOnBeforeCalcPmtDiscDate(Rec, xRec, FieldNo("Payment Terms Code"), CurrFieldNo, IsHandled);
- if not IsHandled then
- "Pmt. Discount Date" := CalcDate(PaymentTerms."Discount Date Calculation", "Document Date");
- if not UpdateDocumentDate and (xRec."Payment Terms Code" <> Rec."Payment Terms Code") then
- Validate("Payment Discount %", PaymentTerms."Discount %")
- end;
- end else begin
- IsHandled := false;
- OnValidatePaymentTermsCodeOnBeforeValidateDueDateWhenBlank(Rec, xRec, CurrFieldNo, IsHandled);
- if not IsHandled then
- Validate("Due Date", "Document Date");
- if not UpdateDocumentDate then begin
- Validate("Pmt. Discount Date", 0D);
- Validate("Payment Discount %", 0);
- end;
- OnValidatePaymentTermsCodeOnAfterValidatePaymentDiscountWhenBlank(Rec, xRec, CurrFieldNo);
- end;
- if xRec."Payment Terms Code" = "Prepmt. Payment Terms Code" then begin
- if xRec."Prepayment Due Date" = 0D then begin
- IsHandled := false;
- OnValidatePaymentTermsCodeOnBeforeCalculatePrepaymentDueDate(Rec, xRec, CurrFieldNo, IsHandled);
- if not IsHandled then begin
- TestField("Document Date");
- "Prepayment Due Date" := CalcDate(PaymentTerms."Due Date Calculation", "Document Date");
- end;
- end;
- Validate("Prepmt. Payment Terms Code", "Payment Terms Code");
- end;
- end;
- }
- ///
- /// Specifies the date when payment for the sales document is due.
- ///
- field(24; "Due Date"; Date)
- {
- Caption = 'Due Date';
- ToolTip = 'Specifies when the sales invoice must be paid.';
- }
- ///
- /// Specifies the discount percentage granted for early payment.
- ///
- field(25; "Payment Discount %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Payment Discount %';
- ToolTip = 'Specifies the payment discount percentage that is granted if the customer pays on or before the date entered in the Pmt. Discount Date field. The discount percentage is specified in the Payment Terms Code field.';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePaymentDiscount(Rec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- if not (CurrFieldNo in [0, FieldNo("Posting Date"), FieldNo("Document Date")]) then
- TestStatusOpen();
- GLSetup.Get();
- if "Payment Discount %" < GLSetup."VAT Tolerance %" then
- "VAT Base Discount %" := "Payment Discount %"
- else
- "VAT Base Discount %" := GLSetup."VAT Tolerance %";
- Validate("VAT Base Discount %");
- end;
- }
- ///
- /// Specifies the last date when payment discount is available.
- ///
- field(26; "Pmt. Discount Date"; Date)
- {
- Caption = 'Pmt. Discount Date';
- ToolTip = 'Specifies the date on which the amount in the entry must be paid for a payment discount to be granted.';
- }
- ///
- /// Specifies the delivery conditions such as FOB or CIF for the shipment.
- ///
- field(27; "Shipment Method Code"; Code[10])
- {
- Caption = 'Shipment Method Code';
- ToolTip = 'Specifies the delivery conditions of the related shipment, such as free on board (FOB).';
- TableRelation = "Shipment Method";
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShipmentMethodCode(Rec, IsHandled);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- end;
- }
- ///
- /// Specifies the default warehouse location from which items are shipped.
- ///
- field(28; "Location Code"; Code[10])
- {
- Caption = 'Location Code';
- ToolTip = 'Specifies the code for the location from where the items are shipped. When you select the customer and the customer has a location assigned, the value is taken from the Customer card. If the customer has no location, but a Responsibility Center is populated, the location code is taken from the Responsibility Center. If neither is specified, the value is taken from Company Information. This field acts as the default location for new lines. You can update the location code for individual lines as needed.';
- TableRelation = Location where("Use As In-Transit" = const(false));
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateLocationCode(Rec, IsHandled);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- if ("Location Code" <> xRec."Location Code") and
- (xRec."Sell-to Customer No." = "Sell-to Customer No.")
- then
- MessageIfSalesLinesExist(FieldCaption("Location Code"));
-
- UpdateShipToAddress();
- UpdateOutboundWhseHandlingTime();
- if "Location Code" <> xRec."Location Code" then
- CreateDimFromDefaultDim(Rec.FieldNo("Location Code"));
- end;
- }
- ///
- /// Specifies the code for the first global dimension used for analysis and reporting.
- ///
- field(29; "Shortcut Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,2,1';
- Caption = 'Shortcut Dimension 1 Code';
- 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.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1),
- Blocked = const(false));
-
- trigger OnValidate()
- begin
- Rec.ValidateShortcutDimCode(1, "Shortcut Dimension 1 Code");
- end;
- }
- ///
- /// Specifies the code for the second global dimension used for analysis and reporting.
- ///
- field(30; "Shortcut Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,2,2';
- Caption = 'Shortcut Dimension 2 Code';
- 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.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2),
- Blocked = const(false));
-
- trigger OnValidate()
- begin
- Rec.ValidateShortcutDimCode(2, "Shortcut Dimension 2 Code");
- end;
- }
- ///
- /// Specifies the customer posting group that determines which receivables account is used.
- ///
- field(31; "Customer Posting Group"; Code[20])
- {
- Caption = 'Customer Posting Group';
- ToolTip = 'Specifies the customer''s market type to link business transactions to.';
- TableRelation = "Customer Posting Group";
-
- trigger OnValidate()
- begin
- CheckCustomerPostingGroupChange();
- end;
- }
- ///
- /// Specifies the currency code for amounts on the sales document.
- ///
- field(32; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- ToolTip = 'Specifies the currency of amounts on the sales document.';
- TableRelation = Currency;
-
- trigger OnValidate()
- var
- StandardCodesMgt: Codeunit "Standard Codes Mgt.";
- begin
- if not (CurrFieldNo in [0, FieldNo("Posting Date")]) or ("Currency Code" <> xRec."Currency Code") then
- TestStatusOpen();
-
- ResetInvoiceDiscountValue();
-
- if (CurrFieldNo <> FieldNo("Currency Code")) and ("Currency Code" = xRec."Currency Code") then
- UpdateCurrencyFactor()
- else
- if "Currency Code" <> xRec."Currency Code" then
- UpdateCurrencyFactor()
- else
- if "Currency Code" <> '' then begin
- UpdateCurrencyFactor();
- if "Currency Factor" <> xRec."Currency Factor" then
- ConfirmCurrencyFactorUpdate();
- end;
-
- if ShouldCheckShowRecurringSalesLines(xRec, Rec) then
- StandardCodesMgt.CheckShowSalesRecurringLinesNotification(Rec);
-
- if "Currency Code" <> xRec."Currency Code" then
- if not IsNullGuid(Rec.SystemId) then
- SalesCalcDiscountByType.ApplyDefaultInvoiceDiscount(0, Rec, true);
-
- if Status = Status::Open then
- SetCompanyBankAccount();
- end;
- }
- ///
- /// Specifies the exchange rate factor used to convert amounts to the local currency.
- ///
- field(33; "Currency Factor"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Currency Factor';
- DecimalPlaces = 0 : 15;
- Editable = false;
- MinValue = 0;
-
- trigger OnValidate()
- begin
- ResetInvoiceDiscountValue();
-
- if "Currency Factor" <> xRec."Currency Factor" then
- UpdateSalesLinesByFieldNo(FieldNo("Currency Factor"), false);
- end;
- }
- ///
- /// Specifies the customer price group for determining sales prices.
- ///
- field(34; "Customer Price Group"; Code[10])
- {
- Caption = 'Customer Price Group';
- TableRelation = "Customer Price Group";
-
- trigger OnValidate()
- begin
- MessageIfSalesLinesExist(FieldCaption("Customer Price Group"));
- end;
- }
- ///
- /// Indicates whether the unit prices on the lines include VAT.
- ///
- field(35; "Prices Including VAT"; Boolean)
- {
- Caption = 'Prices Including VAT';
- ToolTip = 'Specifies if the Unit Price and Line Amount fields on document lines should be shown with or without VAT.';
-
- trigger OnValidate()
- var
- SalesLine: Record "Sales Line";
- Currency: Record Currency;
- RecalculatePrice: Boolean;
- VatFactor: Decimal;
- LineInvDiscAmt: Decimal;
- InvDiscRounding: Decimal;
- begin
- TestStatusOpen();
-
- if "Prices Including VAT" <> xRec."Prices Including VAT" then begin
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
- SalesLine.SetFilter("Job Contract Entry No.", '<>%1', 0);
- if SalesLine.Find('-') then begin
- SalesLine.TestField("Job No.", '');
- SalesLine.TestField("Job Contract Entry No.", 0);
- end;
-
- SalesLine.Reset();
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
- SalesLine.SetFilter("Unit Price", '<>%1', 0);
- SalesLine.SetFilter("VAT %", '<>%1', 0);
- OnValidatePricesIncludingVATOnBeforeSalesLineFindFirst(SalesLine);
- if SalesLine.FindFirst() then begin
- RecalculatePrice := ConfirmRecalculatePrice(SalesLine);
- OnAfterConfirmSalesPrice(Rec, SalesLine, RecalculatePrice);
- SalesLine.SetSalesHeader(Rec);
-
- InitializeRoundingPrecision(Currency);
-
- SalesLine.LockTable();
- LockTable();
- SalesLine.FindSet();
- repeat
- SalesLine.TestField("Quantity Invoiced", 0);
- SalesLine.TestField("Prepmt. Amt. Inv.", 0);
- if not RecalculatePrice then begin
- SalesLine."VAT Difference" := 0;
- SalesLine.UpdateAmounts();
- end else begin
- VatFactor := 1 + SalesLine."VAT %" / 100;
- if VatFactor = 0 then
- VatFactor := 1;
- if not "Prices Including VAT" then
- VatFactor := 1 / VatFactor;
- if SalesLine."VAT Calculation Type" = SalesLine."VAT Calculation Type"::"Full VAT" then
- VatFactor := 1;
- SalesLine."Unit Price" :=
- Round(SalesLine."Unit Price" * VatFactor, Currency."Unit-Amount Rounding Precision");
- SalesLine."Line Discount Amount" :=
- Round(
- SalesLine.Quantity * SalesLine."Unit Price" * SalesLine."Line Discount %" / 100,
- Currency."Amount Rounding Precision");
- LineInvDiscAmt := InvDiscRounding + SalesLine."Inv. Discount Amount" * VatFactor;
- SalesLine."Inv. Discount Amount" := Round(LineInvDiscAmt, Currency."Amount Rounding Precision");
- InvDiscRounding := LineInvDiscAmt - SalesLine."Inv. Discount Amount";
- if SalesLine."VAT Calculation Type" = SalesLine."VAT Calculation Type"::"Full VAT" then
- SalesLine."Line Amount" := SalesLine."Amount Including VAT"
- else
- if "Prices Including VAT" then
- SalesLine."Line Amount" := SalesLine."Amount Including VAT" + SalesLine."Inv. Discount Amount"
- else
- SalesLine."Line Amount" := SalesLine.Amount + SalesLine."Inv. Discount Amount";
- UpdatePrepmtAmounts(SalesLine);
- end;
- OnValidatePricesIncludingVATOnBeforeSalesLineModify(Rec, SalesLine, Currency, RecalculatePrice);
- SalesLine.Modify();
- until SalesLine.Next() = 0;
- end;
- OnAfterChangePricesIncludingVAT(Rec);
- end;
- end;
- }
- ///
- /// Specifies the code that determines invoice discount calculations for this customer.
- ///
- field(37; "Invoice Disc. Code"; Code[20])
- {
- AccessByPermission = TableData "Cust. Invoice Disc." = R;
- Caption = 'Invoice Disc. Code';
-
- trigger OnValidate()
- begin
- TestStatusOpen();
- MessageIfSalesLinesExist(FieldCaption("Invoice Disc. Code"));
- end;
- }
- ///
- /// Specifies the customer discount group for determining line discounts.
- ///
- field(40; "Customer Disc. Group"; Code[20])
- {
- Caption = 'Customer Disc. Group';
- TableRelation = "Customer Discount Group";
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateCustomerDiscGroup(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- MessageIfSalesLinesExist(FieldCaption("Customer Disc. Group"));
- end;
- }
- ///
- /// Specifies the language code used for printing documents for this customer.
- ///
- field(41; "Language Code"; Code[10])
- {
- Caption = 'Language Code';
- ToolTip = 'Specifies the language to be used on printouts for this document.';
- TableRelation = Language;
-
- trigger OnValidate()
- begin
- MessageIfSalesLinesExist(FieldCaption("Language Code"));
- end;
- }
- ///
- /// Specifies the regional format used for dates, numbers, and currencies on documents.
- ///
- field(42; "Format Region"; Text[80])
- {
- Caption = 'Format Region';
- ToolTip = 'Specifies the format to be used on printouts for this document.';
- TableRelation = "Language Selection"."Language Tag";
- }
- ///
- /// Specifies the salesperson responsible for this sales document.
- ///
- field(43; "Salesperson Code"; Code[20])
- {
- Caption = 'Salesperson Code';
- ToolTip = 'Specifies the name of the salesperson who is assigned to the customer.';
- TableRelation = "Salesperson/Purchaser" where(Blocked = const(false));
-
- trigger OnValidate()
- var
- ApprovalEntry: Record "Approval Entry";
- EnumAssignmentMgt: Codeunit "Enum Assignment Management";
- begin
- ValidateSalesPersonOnSalesHeader(Rec, false, false);
-
- ApprovalEntry.SetRange("Table ID", DATABASE::"Sales Header");
- ApprovalEntry.SetRange("Document Type", EnumAssignmentMgt.GetSalesApprovalDocumentType("Document Type"));
- ApprovalEntry.SetRange("Document No.", "No.");
- ApprovalEntry.SetFilter(Status, '%1|%2', ApprovalEntry.Status::Created, ApprovalEntry.Status::Open);
- if not ApprovalEntry.IsEmpty() then
- Error(Text053, FieldCaption("Salesperson Code"));
-
- CreateDimensionsFromValidateSalesPersonCode();
- end;
- }
- ///
- /// Specifies the order class for categorizing sales documents.
- ///
- field(45; "Order Class"; Code[10])
- {
- Caption = 'Order Class';
- }
- ///
- /// Indicates whether comments exist for this sales document.
- ///
- field(46; Comment; Boolean)
- {
- CalcFormula = exist("Sales Comment Line" where("Document Type" = field("Document Type"),
- "No." = field("No."),
- "Document Line No." = const(0)));
- Caption = 'Comment';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the number of times the document has been printed.
- ///
- field(47; "No. Printed"; Integer)
- {
- Caption = 'No. Printed';
- Editable = false;
- }
- ///
- /// Specifies a code indicating the document is on hold and should not be processed.
- ///
- field(51; "On Hold"; Code[3])
- {
- Caption = 'On Hold';
- }
- ///
- /// Specifies the type of document to apply this credit memo or payment to.
- ///
- field(52; "Applies-to Doc. Type"; Enum "Gen. Journal Document Type")
- {
- Caption = 'Applies-to Doc. Type';
- ToolTip = 'Specifies the type of the posted document that this document or journal line will be applied to when you post, for example to register payment.';
- }
- ///
- /// Specifies the document number to which this document applies for payment or credit.
- ///
- field(53; "Applies-to Doc. No."; Code[20])
- {
- Caption = 'Applies-to Doc. No.';
- ToolTip = 'Specifies the number of the posted document that this document or journal line will be applied to when you post, for example to register payment.';
-
- trigger OnLookup()
- var
- GenJnlLine: Record "Gen. Journal Line";
- GenJnlApply: Codeunit "Gen. Jnl.-Apply";
- ApplyCustEntries: Page "Apply Customer Entries";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupAppliesToDocNo(Rec, CustLedgEntry, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Bal. Account No.", '');
- CustLedgEntry.SetApplyToFilters("Bill-to Customer No.", "Applies-to Doc. Type".AsInteger(), "Applies-to Doc. No.", Amount);
- OnAfterSetApplyToFilters(CustLedgEntry, Rec);
-
- ApplyCustEntries.SetSales(Rec, CustLedgEntry, SalesHeader.FieldNo("Applies-to Doc. No."));
- ApplyCustEntries.SetTableView(CustLedgEntry);
- ApplyCustEntries.SetRecord(CustLedgEntry);
- ApplyCustEntries.LookupMode(true);
- if ApplyCustEntries.RunModal() = ACTION::LookupOK then begin
- ApplyCustEntries.GetCustLedgEntry(CustLedgEntry);
- GenJnlApply.CheckAgainstApplnCurrency(
- "Currency Code", CustLedgEntry."Currency Code", GenJnlLine."Account Type"::Customer, true);
- "Applies-to Doc. Type" := CustLedgEntry."Document Type";
- "Applies-to Doc. No." := CustLedgEntry."Document No.";
- OnAfterAppliesToDocNoOnLookup(Rec, CustLedgEntry);
- end;
- Clear(ApplyCustEntries);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateAppliesToDocNo(Rec, CustLedgEntry, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if "Applies-to Doc. No." <> '' then
- TestField("Bal. Account No.", '');
-
- if ("Applies-to Doc. No." <> xRec."Applies-to Doc. No.") and (xRec."Applies-to Doc. No." <> '') and
- ("Applies-to Doc. No." <> '')
- then begin
- CustLedgEntry.SetAmountToApply("Applies-to Doc. No.", "Bill-to Customer No.");
- CustLedgEntry.SetAmountToApply(xRec."Applies-to Doc. No.", "Bill-to Customer No.");
- end else
- if ("Applies-to Doc. No." <> xRec."Applies-to Doc. No.") and (xRec."Applies-to Doc. No." = '') then
- CustLedgEntry.SetAmountToApply("Applies-to Doc. No.", "Bill-to Customer No.")
- else
- if ("Applies-to Doc. No." <> xRec."Applies-to Doc. No.") and ("Applies-to Doc. No." = '') then
- CustLedgEntry.SetAmountToApply(xRec."Applies-to Doc. No.", "Bill-to Customer No.");
-
- OnAfterValidateAppliesToDocNo(Rec, xRec, CustLedgEntry);
- end;
- }
- ///
- /// Specifies the balancing account number for the sales document.
- ///
- field(55; "Bal. Account No."; Code[20])
- {
- Caption = 'Bal. Account No.';
- TableRelation = if ("Bal. Account Type" = const("G/L Account")) "G/L Account"
- else
- if ("Bal. Account Type" = const("Bank Account")) "Bank Account";
-
- trigger OnValidate()
- begin
- if "Bal. Account No." <> '' then
- case "Bal. Account Type" of
- "Bal. Account Type"::"G/L Account":
- begin
- GLAcc.Get("Bal. Account No.");
- GLAcc.CheckGLAcc();
- GLAcc.TestField("Direct Posting", true);
- end;
- "Bal. Account Type"::"Bank Account":
- begin
- BankAcc.Get("Bal. Account No.");
- BankAcc.TestField(Blocked, false);
- BankAcc.TestField("Currency Code", "Currency Code");
- end;
- end;
- end;
- }
- ///
- /// Indicates whether the invoice discount needs to be recalculated.
- ///
- field(56; "Recalculate Invoice Disc."; Boolean)
- {
- CalcFormula = exist("Sales Line" where("Document Type" = field("Document Type"),
- "Document No." = field("No."),
- "Recalculate Invoice Disc." = const(true)));
- Caption = 'Recalculate Invoice Disc.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Indicates whether a shipment should be created when posting.
- ///
- field(57; Ship; Boolean)
- {
- Caption = 'Ship';
- Editable = false;
- }
- ///
- /// Indicates whether an invoice should be created when posting.
- ///
- field(58; Invoice; Boolean)
- {
- Caption = 'Invoice';
- }
- ///
- /// Indicates whether posted documents should be printed after posting.
- ///
- field(59; "Print Posted Documents"; Boolean)
- {
- Caption = 'Print Posted Documents';
- }
- ///
- /// Contains the total amount of all lines on the sales document excluding VAT.
- ///
- field(60; Amount; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Sales Line".Amount where("Document Type" = field("Document Type"),
- "Document No." = field("No.")));
- Caption = 'Amount';
- ToolTip = 'Specifies the sum of amounts on all the lines in the document. This will include invoice discounts.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total amount of all lines on the sales document including VAT.
- ///
- field(61; "Amount Including VAT"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Sales Line"."Amount Including VAT" where("Document Type" = field("Document Type"),
- "Document No." = field("No.")));
- Caption = 'Amount Including VAT';
- ToolTip = 'Specifies the sum of amounts, including VAT, on all the lines in the document. This will include invoice discounts.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the number assigned to the next shipment document.
- ///
- field(62; "Shipping No."; Code[20])
- {
- Caption = 'Shipping No.';
- }
- ///
- /// Specifies the number assigned to the next posted invoice or credit memo.
- ///
- field(63; "Posting No."; Code[20])
- {
- Caption = 'Posting No.';
- }
- ///
- /// Specifies the number of the last posted shipment document.
- ///
- field(64; "Last Shipping No."; Code[20])
- {
- Caption = 'Last Shipping No.';
- Editable = false;
- TableRelation = "Sales Shipment Header";
- }
- ///
- /// Specifies the number of the last posted invoice or credit memo.
- ///
- field(65; "Last Posting No."; Code[20])
- {
- Caption = 'Last Posting No.';
- Editable = false;
- TableRelation = "Sales Invoice Header";
- }
- ///
- /// Specifies the number assigned to the next prepayment invoice.
- ///
- field(66; "Prepayment No."; Code[20])
- {
- Caption = 'Prepayment No.';
- }
- ///
- /// Specifies the number of the last posted prepayment invoice.
- ///
- field(67; "Last Prepayment No."; Code[20])
- {
- Caption = 'Last Prepayment No.';
- TableRelation = "Sales Invoice Header";
- }
- ///
- /// Specifies the number assigned to the next prepayment credit memo.
- ///
- field(68; "Prepmt. Cr. Memo No."; Code[20])
- {
- Caption = 'Prepmt. Cr. Memo No.';
- }
- ///
- /// Specifies the number of the last posted prepayment credit memo.
- ///
- field(69; "Last Prepmt. Cr. Memo No."; Code[20])
- {
- Caption = 'Last Prepmt. Cr. Memo No.';
- TableRelation = "Sales Cr.Memo Header";
- }
- ///
- /// Specifies the customer's VAT registration number for tax reporting purposes.
- ///
- field(70; "VAT Registration No."; Text[20])
- {
- Caption = 'VAT Registration No.';
- ToolTip = 'Specifies the customer''s VAT registration number for customers.';
-
- trigger OnValidate()
- var
- Customer: Record Customer;
- VATRegistrationLog: Record "VAT Registration Log";
- VATRegistrationNoFormat: Record "VAT Registration No. Format";
- VATRegNoSrvConfig: Record "VAT Reg. No. Srv Config";
- VATRegistrationLogMgt: Codeunit "VAT Registration Log Mgt.";
- ResultRecRef: RecordRef;
- ApplicableCountryCode: Code[10];
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateVATRegistrationNo(Rec, IsHandled);
- if IsHandled then
- exit;
-
- "VAT Registration No." := UpperCase("VAT Registration No.");
- if "VAT Registration No." = xRec."VAT Registration No." then
- exit;
-
- GLSetup.GetRecordOnce();
- case GLSetup."Bill-to/Sell-to VAT Calc." of
- GLSetup."Bill-to/Sell-to VAT Calc."::"Bill-to/Pay-to No.":
- if not Customer.Get("Bill-to Customer No.") then
- exit;
- GLSetup."Bill-to/Sell-to VAT Calc."::"Sell-to/Buy-from No.":
- if not Customer.Get("Sell-to Customer No.") then
- exit;
- end;
-
- if "VAT Registration No." = Customer."VAT Registration No." then
- exit;
-
- ApplicableCountryCode := Rec."VAT Country/Region Code";
- if ApplicableCountryCode = '' then
- ApplicableCountryCode := Customer."Country/Region Code";
- if not VATRegistrationNoFormat.Test("VAT Registration No.", ApplicableCountryCode, Customer."No.", DATABASE::Customer) then
- exit;
-
- ApplicableCountryCode := Customer."Country/Region Code";
- if ApplicableCountryCode = '' then
- ApplicableCountryCode := VATRegistrationNoFormat."Country/Region Code";
-
- if not VATRegNoSrvConfig.VATRegNoSrvIsEnabled() then begin
- if AltCustVATRegFacade.UpdateVATRegNoInCustFromSalesHeader(Rec, Customer) then begin
- Customer."VAT Registration No." := "VAT Registration No.";
- Customer.Modify(true);
- end;
- exit;
- end;
-
- VATRegistrationLogMgt.CheckVIESForVATNo(
- ResultRecRef, VATRegistrationLog, Customer, Customer."No.",
- ApplicableCountryCode, VATRegistrationLog."Account Type"::Customer.AsInteger());
-
- if VATRegistrationLog.Status = VATRegistrationLog.Status::Valid then begin
- Message(ValidVATNoMsg);
- if AltCustVATRegFacade.UpdateVATRegNoInCustFromSalesHeader(Rec, Customer) then begin
- Customer."VAT Registration No." := "VAT Registration No.";
- Customer.Modify(true);
- end;
- end else
- Message(InvalidVatRegNoMsg);
- end;
- }
- ///
- /// Indicates whether multiple shipments for this customer can be combined into one invoice.
- ///
- field(71; "Combine Shipments"; Boolean)
- {
- Caption = 'Combine Shipments';
- ToolTip = 'Specifies whether the order will be included when you use the Combine Shipments function.';
- }
- ///
- /// Specifies the company registration number of the customer.
- ///
- field(72; "Registration Number"; Text[50])
- {
- Caption = 'Registration No.';
- ToolTip = 'Specifies the customer''s registration number.';
- DataClassification = CustomerContent;
- }
- ///
- /// Specifies the reason code for this sales document.
- ///
- field(73; "Reason Code"; Code[10])
- {
- Caption = 'Reason Code';
- ToolTip = 'Specifies the reason code, a supplementary source code that enables you to trace the document.';
- TableRelation = "Reason Code";
- }
- ///
- /// Specifies the general business posting group for VAT and account determination.
- ///
- field(74; "Gen. Bus. Posting Group"; Code[20])
- {
- Caption = 'Gen. Bus. Posting Group';
- ToolTip = 'Specifies the general business posting group that the sales document is linked to. The general business posting group is used to link the sales document to the appropriate general ledger account.';
- TableRelation = "Gen. Business Posting Group";
-
- trigger OnValidate()
- begin
- TestStatusOpen();
- if xRec."Gen. Bus. Posting Group" <> "Gen. Bus. Posting Group" then begin
- if GenBusPostingGrp.ValidateVatBusPostingGroup(GenBusPostingGrp, "Gen. Bus. Posting Group") then begin
- "VAT Bus. Posting Group" := GenBusPostingGrp."Def. VAT Bus. Posting Group";
- OnAfterAssignDefaultVATBusPostingGroup(Rec, xRec, GenBusPostingGrp);
- end;
- RecreateSalesLines(FieldCaption("Gen. Bus. Posting Group"));
- end;
- end;
- }
- ///
- /// Indicates whether this is an EU triangular trade transaction.
- ///
- field(75; "EU 3-Party Trade"; Boolean)
- {
- Caption = 'EU 3-Party Trade';
- ToolTip = 'Specifies if the transaction is related to trade with a third party within the EU.';
- }
- ///
- /// Specifies the transaction type for Intrastat reporting.
- ///
- field(76; "Transaction Type"; Code[10])
- {
- Caption = 'Transaction Type';
- ToolTip = 'Specifies the type of transaction that the document represents, for the purpose of reporting to INTRASTAT.';
- TableRelation = "Transaction Type";
-
- trigger OnValidate()
- begin
- UpdateSalesLinesByFieldNo(FieldNo("Transaction Type"), false);
- end;
- }
- ///
- /// Specifies the transport method for Intrastat reporting.
- ///
- field(77; "Transport Method"; Code[10])
- {
- Caption = 'Transport Method';
- ToolTip = 'Specifies the transport method, for the purpose of reporting to INTRASTAT.';
- TableRelation = "Transport Method";
-
- trigger OnValidate()
- begin
- UpdateSalesLinesByFieldNo(FieldNo("Transport Method"), false);
- end;
- }
- ///
- /// Specifies the country/region code for VAT purposes.
- ///
- field(78; "VAT Country/Region Code"; Code[10])
- {
- Caption = 'VAT Country/Region Code';
- ToolTip = 'Specifies the country or region code for the VAT.';
- TableRelation = "Country/Region";
-
- trigger OnValidate()
- begin
- AltCustVATRegFacade.UpdateSetupOnVATCountryChangeInSalesHeader(Rec, xRec);
- end;
- }
- ///
- /// Specifies the name of the customer to whom goods or services are sold.
- ///
- field(79; "Sell-to Customer Name"; Text[100])
- {
- Caption = 'Sell-to Customer Name';
- ToolTip = 'Specifies the name of the customer that you''re selling to. By default, the same customer is suggested as the ship-to customer. If needed, you can specify a different ship-to customer on the document.';
- TableRelation = Customer.Name;
- ValidateTableRelation = false;
-
- trigger OnValidate()
- var
- Customer: Record Customer;
- LookupStateManager: Codeunit "Lookup State Manager";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateSellToCustomerName(Rec, Customer, IsHandled);
- if IsHandled then begin
- if LookupStateManager.IsRecordSaved() then
- LookupStateManager.ClearSavedRecord();
- exit;
- end;
-
- if LookupStateManager.IsRecordSaved() then begin
- Customer := LookupStateManager.GetSavedRecord();
- if Customer."No." <> '' then begin
- LookupStateManager.ClearSavedRecord();
- Validate("Sell-to Customer No.", Customer."No.");
- end
- end else
- if Rec."Sell-to Customer Name" <> xRec."Sell-to Customer Name" then
- if ShouldSearchForCustomerByName("Sell-to Customer No.") then
- Validate("Sell-to Customer No.", Customer.GetCustNo("Sell-to Customer Name"));
-
- GetShippingTime(FieldNo("Sell-to Customer Name"));
- end;
- }
- ///
- /// Specifies an additional part of the sell-to customer name.
- ///
- field(80; "Sell-to Customer Name 2"; Text[50])
- {
- Caption = 'Sell-to Customer Name 2';
- ToolTip = 'Specifies an additional part of the name of the customer who will receive the products and be billed by default.';
- }
- ///
- /// Specifies the street address of the sell-to customer.
- ///
- field(81; "Sell-to Address"; Text[100])
- {
- Caption = 'Sell-to Address';
- ToolTip = 'Specifies the address where the customer is located.';
-
- trigger OnValidate()
- begin
- UpdateShipToAddressFromSellToAddress(FieldNo("Ship-to Address"));
- ModifyCustomerAddress();
- end;
- }
- ///
- /// Specifies additional street address information for the sell-to customer.
- ///
- field(82; "Sell-to Address 2"; Text[50])
- {
- Caption = 'Sell-to Address 2';
- ToolTip = 'Specifies additional address information.';
-
- trigger OnValidate()
- begin
- UpdateShipToAddressFromSellToAddress(FieldNo("Ship-to Address 2"));
- ModifyCustomerAddress();
- end;
- }
- ///
- /// Specifies the city of the sell-to customer.
- ///
- field(83; "Sell-to City"; Text[30])
- {
- Caption = 'Sell-to City';
- ToolTip = 'Specifies the city of the customer on the sales document.';
- TableRelation = if ("Sell-to Country/Region Code" = const('')) "Post Code".City
- else
- if ("Sell-to Country/Region Code" = filter(<> '')) "Post Code".City where("Country/Region Code" = field("Sell-to Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnLookup()
- begin
- OnBeforeLookupSellToCity(Rec, PostCode);
-
- PostCode.LookupPostCode("Sell-to City", "Sell-to Post Code", "Sell-to County", "Sell-to Country/Region Code");
-
- OnAfterLookupSellToCity(Rec, PostCode, xRec);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateSellToCity(Rec, PostCode, CurrFieldNo, IsHandled);
- if not IsHandled then
- PostCode.ValidateCity(
- "Sell-to City", "Sell-to Post Code", "Sell-to County", "Sell-to Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- UpdateShipToAddressFromSellToAddress(FieldNo("Ship-to City"));
- ModifyCustomerAddress();
- end;
- }
- ///
- /// Specifies the name of the contact person at the sell-to customer's address.
- ///
- field(84; "Sell-to Contact"; Text[100])
- {
- Caption = 'Sell-to Contact';
- ToolTip = 'Specifies the name of the contact person at the customer''s main address.';
-
- trigger OnLookup()
- var
- Contact: Record Contact;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupSelltoContact(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if "Document Type" <> "Document Type"::Quote then
- if "Sell-to Customer No." = '' then
- exit;
-
- Contact.FilterGroup(2);
- LookupContact("Sell-to Customer No.", "Sell-to Contact No.", Contact);
- if PAGE.RunModal(0, Contact) = ACTION::LookupOK then
- Validate("Sell-to Contact No.", Contact."No.");
- Contact.FilterGroup(0);
- end;
-
- trigger OnValidate()
- begin
- if "Sell-to Contact" = '' then
- Validate("Sell-to Contact No.", '');
- ModifyCustomerAddress();
- end;
- }
- ///
- /// Specifies the postal code of the bill-to customer's address.
- ///
- field(85; "Bill-to Post Code"; Code[20])
- {
- Caption = 'Bill-to Post Code';
- ToolTip = 'Specifies the postal code of the customer''s billing address.';
- TableRelation = "Post Code";
- ValidateTableRelation = false;
-
- trigger OnLookup()
- begin
- OnBeforeLookupBillToPostCode(Rec, PostCode);
-
- PostCode.LookupPostCode("Bill-to City", "Bill-to Post Code", "Bill-to County", "Bill-to Country/Region Code");
-
- OnAfterLookupBillToPostCode(Rec, PostCode, xRec);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateBillToPostCode(Rec, PostCode, CurrFieldNo, IsHandled);
- if not IsHandled then
- PostCode.ValidatePostCode(
- "Bill-to City", "Bill-to Post Code", "Bill-to County", "Bill-to Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- ModifyBillToCustomerAddress();
- end;
- }
- ///
- /// Specifies the county or state of the bill-to customer's address.
- ///
- field(86; "Bill-to County"; Text[30])
- {
- CaptionClass = '5,3,' + "Bill-to Country/Region Code";
- Caption = 'Bill-to County';
- ToolTip = 'Specifies the state, province or county of the address.';
-
- trigger OnValidate()
- begin
- ModifyBillToCustomerAddress();
- end;
- }
- ///
- /// Specifies the country/region code of the bill-to customer's address.
- ///
- field(87; "Bill-to Country/Region Code"; Code[10])
- {
- Caption = 'Bill-to Country/Region Code';
- ToolTip = 'Specifies the country/region code of the customer''s billing address.';
- TableRelation = "Country/Region";
-
- trigger OnValidate()
- var
- FormatAddress: Codeunit "Format Address";
- begin
- if not FormatAddress.UseCounty(Rec."Bill-to Country/Region Code") then
- "Bill-to County" := '';
- ModifyBillToCustomerAddress();
- end;
- }
- ///
- /// Specifies the postal code of the sell-to customer's address.
- ///
- field(88; "Sell-to Post Code"; Code[20])
- {
- Caption = 'Sell-to Post Code';
- ToolTip = 'Specifies the postal code of the customer''s main address.';
- TableRelation = if ("Sell-to Country/Region Code" = const('')) "Post Code"
- else
- if ("Sell-to Country/Region Code" = filter(<> '')) "Post Code" where("Country/Region Code" = field("Sell-to Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnLookup()
- begin
- OnBeforeLookupSellToPostCode(Rec, PostCode);
-
- PostCode.LookupPostCode("Sell-to City", "Sell-to Post Code", "Sell-to County", "Sell-to Country/Region Code");
-
- OnAfterLookupSellToPostCode(Rec, PostCode, xRec);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- DoExit: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateSellToPostCode(Rec, PostCode, CurrFieldNo, IsHandled, DoExit);
- if DoExit then
- exit;
-
- if not IsHandled then
- PostCode.ValidatePostCode(
- "Sell-to City", "Sell-to Post Code", "Sell-to County", "Sell-to Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- UpdateShipToAddressFromSellToAddress(FieldNo("Ship-to Post Code"));
- ModifyCustomerAddress();
- end;
- }
- ///
- /// Specifies the county or state of the sell-to customer's address.
- ///
- field(89; "Sell-to County"; Text[30])
- {
- CaptionClass = '5,2,' + "Sell-to Country/Region Code";
- Caption = 'Sell-to County';
- ToolTip = 'Specifies the state, province or county of the address.';
-
- trigger OnValidate()
- begin
- UpdateShipToAddressFromSellToAddress(FieldNo("Ship-to County"));
- ModifyCustomerAddress();
- end;
- }
- ///
- /// Specifies the country/region code of the sell-to customer's address.
- ///
- field(90; "Sell-to Country/Region Code"; Code[10])
- {
- Caption = 'Sell-to Country/Region Code';
- ToolTip = 'Specifies the country/region code of the customer''s main address.';
- TableRelation = "Country/Region";
-
- trigger OnValidate()
- var
- FormatAddress: Codeunit "Format Address";
- begin
- if not FormatAddress.UseCounty(Rec."Sell-to Country/Region Code") then
- "Sell-to County" := '';
- UpdateShipToAddressFromSellToAddress(FieldNo("Ship-to Country/Region Code"));
- ModifyCustomerAddress();
- Validate("Ship-to Country/Region Code");
- end;
- }
- ///
- /// Specifies the postal code of the shipping address.
- ///
- field(91; "Ship-to Post Code"; Code[20])
- {
- Caption = 'Ship-to Post Code';
- ToolTip = 'Specifies the postal code of the address that the items are shipped to.';
- TableRelation = if ("Ship-to Country/Region Code" = const('')) "Post Code"
- else
- if ("Ship-to Country/Region Code" = filter(<> '')) "Post Code" where("Country/Region Code" = field("Ship-to Country/Region Code"));
- ValidateTableRelation = false;
-
- trigger OnLookup()
- begin
- OnBeforeLookupShipToPostCode(Rec, PostCode);
-
- PostCode.LookupPostCode("Ship-to City", "Ship-to Post Code", "Ship-to County", "Ship-to Country/Region Code");
-
- OnAfterLookupShipToPostCode(Rec, PostCode, xRec);
- end;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShipToPostCode(Rec, PostCode, CurrFieldNo, IsHandled);
- if not IsHandled then
- PostCode.ValidatePostCode(
- "Ship-to City", "Ship-to Post Code", "Ship-to County", "Ship-to Country/Region Code", (CurrFieldNo <> 0) and GuiAllowed);
- end;
- }
- ///
- /// Specifies the county or state of the shipping address.
- ///
- field(92; "Ship-to County"; Text[30])
- {
- CaptionClass = '5,4,' + "Ship-to Country/Region Code";
- Caption = 'Ship-to County';
- ToolTip = 'Specifies the state, province or county of the address.';
- }
- ///
- /// Specifies the country/region code of the shipping address.
- ///
- field(93; "Ship-to Country/Region Code"; Code[10])
- {
- Caption = 'Ship-to Country/Region Code';
- ToolTip = 'Specifies the country/region code of the address that the items are shipped to.';
- TableRelation = "Country/Region";
-
- trigger OnValidate()
- begin
- AltCustVATRegFacade.UpdateSetupOnShipToCountryChangeInSalesHeader(Rec, xRec);
- end;
- }
- ///
- /// Specifies the type of balancing account used with the sales document.
- ///
- field(94; "Bal. Account Type"; Enum "Payment Balance Account Type")
- {
- Caption = 'Bal. Account Type';
- }
- ///
- /// Specifies the point of exit for Intrastat reporting.
- ///
- field(97; "Exit Point"; Code[10])
- {
- Caption = 'Exit Point';
- ToolTip = 'Specifies the point of exit through which you ship the items out of your country/region, for reporting to Intrastat.';
- TableRelation = "Entry/Exit Point";
-
- trigger OnValidate()
- begin
- UpdateSalesLinesByFieldNo(FieldNo("Exit Point"), false);
- end;
- }
- ///
- /// Indicates whether this is a correction document that reverses a previous posting.
- ///
- field(98; Correction; Boolean)
- {
- Caption = 'Correction';
- ToolTip = 'Specifies the entry as a corrective entry. You can use the field if you need to post a corrective entry to a customer account. If you place a check mark in this field when posting a corrective entry, the system will post a negative debit instead of a credit or a negative credit instead of a debit. Correction flag does not affect how inventory reconciled with general ledger.';
- }
- ///
- /// Specifies the date when the document was created.
- ///
- field(99; "Document Date"; Date)
- {
- Caption = 'Document Date';
- ToolTip = 'Specifies the date when the related document was created.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateDocumentDate(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- UpdateVATReportingDate(FieldNo("Document Date"));
-
- if xRec."Document Date" <> "Document Date" then
- UpdateDocumentDate := true;
- Validate("Payment Terms Code");
- Validate("Prepmt. Payment Terms Code");
-
- if UpdateDocumentDate and ("Document Type" = "Document Type"::Quote) and ("Document Date" <> 0D) then
- CalcQuoteValidUntilDate();
- UpdateDocumentDate := false;
- end;
- }
- ///
- /// Specifies the customer's purchase order number or other external reference.
- ///
- field(100; "External Document No."; Code[35])
- {
- Caption = 'External Document No.';
- ToolTip = 'Specifies a document number that refers to the customer''s or vendor''s numbering system.';
-
- trigger OnValidate()
- var
- WhseSalesRelease: Codeunit "Whse.-Sales Release";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateExternalDocumentNo(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- if "External Document No." <> '' then
- if FindDocumentWithSameExternalDocNo() then
- ShowExternalDocAlreadyExistNotification()
- else
- RecallExternalDocAlreadyExistsNotification();
-
- if (xRec."External Document No." <> "External Document No.") and (Status = Status::Released) and
- ("Document Type" in ["Document Type"::Order, "Document Type"::"Return Order"])
- then
- WhseSalesRelease.UpdateExternalDocNoForReleasedOrder(Rec);
- end;
- }
- ///
- /// Specifies the area code for Intrastat reporting.
- ///
- field(101; "Area"; Code[10])
- {
- Caption = 'Area';
- ToolTip = 'Specifies the country or region of origin for the purpose of Intrastat reporting.';
- TableRelation = Area;
-
- trigger OnValidate()
- begin
- UpdateSalesLinesByFieldNo(FieldNo(Area), false);
- end;
- }
- ///
- /// Specifies additional transaction details for Intrastat reporting.
- ///
- field(102; "Transaction Specification"; Code[10])
- {
- Caption = 'Transaction Specification';
- ToolTip = 'Specifies a specification of the document''s transaction, for the purpose of reporting to INTRASTAT.';
- TableRelation = "Transaction Specification";
-
- trigger OnValidate()
- begin
- UpdateSalesLinesByFieldNo(FieldNo("Transaction Specification"), false);
- end;
- }
- ///
- /// Specifies the payment method code that determines how payment is received.
- ///
- field(104; "Payment Method Code"; Code[10])
- {
- Caption = 'Payment Method Code';
- ToolTip = 'Specifies how to make payment, such as with bank transfer, cash, or check.';
- TableRelation = "Payment Method";
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePaymentMethodCode(Rec, PaymentMethod, IsHandled);
- if IsHandled then
- exit;
-
- UpdateDirectDebitPmtTermsCode();
-
- "Bal. Account Type" := PaymentMethod."Bal. Account Type";
- "Bal. Account No." := PaymentMethod."Bal. Account No.";
- if "Bal. Account No." <> '' then begin
- TestField("Applies-to Doc. No.", '');
- TestField("Applies-to ID", '');
- Clear("Payment Service Set ID");
- end;
- end;
- }
- ///
- /// Specifies the shipping agent responsible for transporting the items.
- ///
- field(105; "Shipping Agent Code"; Code[10])
- {
- AccessByPermission = TableData "Shipping Agent Services" = R;
- Caption = 'Shipping Agent Code';
- ToolTip = 'Specifies the code for the shipping agent who is transporting the items.';
- TableRelation = "Shipping Agent";
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShippingAgentCode(Rec, IsHandled, xRec, CurrFieldNo);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- if xRec."Shipping Agent Code" = "Shipping Agent Code" then
- exit;
-
- "Shipping Agent Service Code" := '';
- GetShippingTime(FieldNo("Shipping Agent Code"));
-
- OnValidateShippingAgentCodeOnBeforeUpdateLines(Rec, CurrFieldNo, HideValidationDialog);
- UpdateSalesLinesByFieldNo(FieldNo("Shipping Agent Code"), CurrFieldNo <> 0);
- end;
- }
- ///
- /// Specifies the package tracking number from the shipping agent.
- ///
-#if not CLEAN27
-#pragma warning disable AS0086
-#endif
- field(106; "Package Tracking No."; Text[50])
-#if not CLEAN27
-#pragma warning restore AS0086
-#endif
- {
- Caption = 'Package Tracking No.';
- ToolTip = 'Specifies the shipping agent''s package number.';
- }
- ///
- /// Specifies the number series used to assign the document number.
- ///
- field(107; "No. Series"; Code[20])
- {
- Caption = 'No. Series';
- Editable = false;
- TableRelation = "No. Series";
- }
- ///
- /// Specifies the number series used for the posted document number.
- ///
- field(108; "Posting No. Series"; Code[20])
- {
- Caption = 'Posting No. Series';
- TableRelation = "No. Series";
-
- trigger OnLookup()
- var
- NoSeries: Codeunit "No. Series";
- begin
- SalesHeader := Rec;
- GetSalesSetup();
- SalesHeader.TestNoSeries();
- if NoSeries.LookupRelatedNoSeries(GetPostingNoSeriesCode(), SalesHeader."Posting No. Series") then
- SalesHeader.Validate("Posting No. Series");
- Rec := SalesHeader;
- end;
-
- trigger OnValidate()
- var
- NoSeries: Codeunit "No. Series";
- begin
- if "Posting No. Series" <> '' then begin
- GetSalesSetup();
- TestNoSeries();
- NoSeries.TestAreRelated(GetPostingNoSeriesCode(), "Posting No. Series");
- end;
- TestField("Posting No.", '');
- end;
- }
- ///
- /// Specifies the number series used for the posted shipment document number.
- ///
- field(109; "Shipping No. Series"; Code[20])
- {
- Caption = 'Shipping No. Series';
- TableRelation = "No. Series";
-
- trigger OnLookup()
- var
- NoSeries: Codeunit "No. Series";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupShippingNoSeries(Rec, IsHandled);
- if IsHandled then
- exit;
-
- SalesHeader := Rec;
- GetSalesSetup();
- SalesSetup.TestField("Posted Shipment Nos.");
- if NoSeries.LookupRelatedNoSeries(SalesSetup."Posted Shipment Nos.", SalesHeader."Shipping No. Series") then
- SalesHeader.Validate("Shipping No. Series");
- Rec := SalesHeader;
- end;
-
- trigger OnValidate()
- var
- NoSeries: Codeunit "No. Series";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShippingNoSeries(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "Shipping No. Series" <> '' then begin
- GetSalesSetup();
- SalesSetup.TestField("Posted Shipment Nos.");
- NoSeries.TestAreRelated(SalesSetup."Posted Shipment Nos.", "Shipping No. Series");
- end;
- TestField("Shipping No.", '');
- end;
- }
- ///
- /// Specifies the tax area code for sales tax calculation.
- ///
- field(114; "Tax Area Code"; Code[20])
- {
- Caption = 'Tax Area Code';
- ToolTip = 'Specifies the tax area that is used to calculate and post sales tax.';
- TableRelation = "Tax Area";
- ValidateTableRelation = false;
-
- trigger OnValidate()
- begin
- if "Tax Area Code" = xRec."Tax Area Code" then
- exit;
- TestStatusOpen();
- ValidateTaxAreaCode();
- MessageIfSalesLinesExist(FieldCaption("Tax Area Code"));
- end;
- }
- ///
- /// Indicates whether the customer is liable for sales tax.
- ///
- field(115; "Tax Liable"; Boolean)
- {
- Caption = 'Tax Liable';
- ToolTip = 'Specifies if the customer or vendor is liable for sales tax.';
-
- trigger OnValidate()
- begin
- if "Tax Liable" = xRec."Tax Liable" then
- exit;
- TestStatusOpen();
- MessageIfSalesLinesExist(FieldCaption("Tax Liable"));
- end;
- }
- ///
- /// Specifies the VAT business posting group for VAT calculation.
- ///
- field(116; "VAT Bus. Posting Group"; Code[20])
- {
- Caption = 'VAT Bus. Posting Group';
- ToolTip = 'Specifies the VAT specification of the involved customer or vendor to link transactions made for this record with the appropriate general ledger account according to the VAT posting setup.';
- TableRelation = "VAT Business Posting Group";
-
- trigger OnValidate()
- begin
- TestStatusOpen();
- if xRec."VAT Bus. Posting Group" <> "VAT Bus. Posting Group" then begin
- RecreateSalesLines(FieldCaption("VAT Bus. Posting Group"));
- if not IsNullGuid(Rec.SystemId) then
- SalesCalcDiscountByType.ApplyDefaultInvoiceDiscount(0, Rec, true);
- end;
- end;
- }
- ///
- /// Specifies the default reservation method for items on the sales document.
- ///
- field(117; Reserve; Enum "Reserve Method")
- {
- AccessByPermission = TableData Item = R;
- Caption = 'Reserve';
- InitValue = Optional;
- }
- ///
- /// Specifies the ID used to link this document to customer ledger entries for application.
- ///
- field(118; "Applies-to ID"; Code[50])
- {
- Caption = 'Applies-to ID';
- ToolTip = 'Specifies the ID of entries that will be applied to when you choose the Apply Entries action.';
-
- trigger OnValidate()
- var
- TempCustLedgEntry: Record "Cust. Ledger Entry" temporary;
- CustEntrySetApplID: Codeunit "Cust. Entry-SetAppl.ID";
- begin
- if "Applies-to ID" <> '' then
- TestField("Bal. Account No.", '');
- if ("Applies-to ID" <> xRec."Applies-to ID") and (xRec."Applies-to ID" <> '') then begin
- CustLedgEntry.SetCurrentKey("Customer No.", Open);
- CustLedgEntry.SetRange("Customer No.", "Bill-to Customer No.");
- CustLedgEntry.SetRange(Open, true);
- CustLedgEntry.SetRange("Applies-to ID", xRec."Applies-to ID");
- if CustLedgEntry.FindFirst() then
- CustEntrySetApplID.SetApplId(CustLedgEntry, TempCustLedgEntry, '');
- CustLedgEntry.Reset();
- end;
- end;
- }
- ///
- /// Specifies the discount percentage applied to the VAT base amount.
- ///
- field(119; "VAT Base Discount %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'VAT Base Discount %';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateVATBaseDiscountPct(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if not (CurrFieldNo in [0, FieldNo("Posting Date"), FieldNo("Document Date")]) then
- TestStatusOpen();
- GLSetup.Get();
- if "VAT Base Discount %" > GLSetup."VAT Tolerance %" then
- Error(
- Text007,
- FieldCaption("VAT Base Discount %"),
- GLSetup.FieldCaption("VAT Tolerance %"),
- GLSetup.TableCaption());
-
- if ("VAT Base Discount %" = xRec."VAT Base Discount %") and (CurrFieldNo <> 0) then
- exit;
-
- UpdateSalesLineAmounts();
- end;
- }
- ///
- /// Specifies the current processing status of the sales document.
- ///
- field(120; Status; Enum "Sales Document Status")
- {
- Caption = 'Status';
- ToolTip = 'Specifies whether the document is open, waiting to be approved, has been invoiced for prepayment, or has been released to the next stage of processing.';
- Editable = false;
- }
- ///
- /// Specifies how the invoice discount is calculated.
- ///
- field(121; "Invoice Discount Calculation"; Option)
- {
- Caption = 'Invoice Discount Calculation';
- Editable = false;
- OptionCaption = 'None,%,Amount';
- OptionMembers = "None","%",Amount;
- }
- ///
- /// Specifies the invoice discount value as a percentage or amount.
- ///
- field(122; "Invoice Discount Value"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Invoice Discount Value';
- Editable = false;
- }
- ///
- /// Indicates whether an intercompany document should be sent to the IC partner.
- ///
- field(123; "Send IC Document"; Boolean)
- {
- Caption = 'Send IC Document';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- if "Send IC Document" then begin
- if "Bill-to IC Partner Code" = '' then
- TestField("Sell-to IC Partner Code");
- IsHandled := false;
- OnValidateSendICDocumentOnBeforeCheckICDirection(Rec, IsHandled);
- if not IsHandled then
- TestField("IC Direction", "IC Direction"::Outgoing);
- end;
- end;
- }
- ///
- /// Specifies the intercompany processing status of the document.
- ///
- field(124; "IC Status"; Enum "Sales Document IC Status")
- {
- Caption = 'IC Status';
- }
- ///
- /// Specifies the intercompany partner code of the sell-to customer.
- ///
- field(125; "Sell-to IC Partner Code"; Code[20])
- {
- Caption = 'Sell-to IC Partner Code';
- Editable = false;
- TableRelation = "IC Partner";
- }
- ///
- /// Specifies the intercompany partner code of the bill-to customer.
- ///
- field(126; "Bill-to IC Partner Code"; Code[20])
- {
- Caption = 'Bill-to IC Partner Code';
- Editable = false;
- TableRelation = "IC Partner";
- }
- ///
- /// Specifies the document number from the intercompany partner.
- ///
- field(127; "IC Reference Document No."; Code[20])
- {
- Caption = 'IC Reference Document No.';
- Editable = false;
- }
- ///
- /// Specifies whether this is an outgoing or incoming intercompany document.
- ///
- field(129; "IC Direction"; Enum "IC Direction Type")
- {
- Caption = 'IC Direction';
-
- trigger OnValidate()
- begin
- if "IC Direction" = "IC Direction"::Incoming then
- "Send IC Document" := false;
- end;
- }
- ///
- /// Specifies the prepayment percentage required before delivery.
- ///
- field(130; "Prepayment %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Prepayment %';
- ToolTip = 'Specifies the prepayment percentage to use to calculate the prepayment for sales.';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
-
- trigger OnValidate()
- begin
- if "Prepayment %" > 100 then
- error(MaxAllowedValueIs100Err);
- if xRec."Prepayment %" <> "Prepayment %" then
- UpdateSalesLinesByFieldNo(FieldNo("Prepayment %"), CurrFieldNo <> 0);
- end;
- }
- ///
- /// Specifies the number series for prepayment invoices.
- ///
- field(131; "Prepayment No. Series"; Code[20])
- {
- Caption = 'Prepayment No. Series';
- TableRelation = "No. Series";
-
- trigger OnLookup()
- var
- NoSeries: Codeunit "No. Series";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupPrepmtNoSeries(Rec, IsHandled);
- if IsHandled then
- exit;
-
- SalesHeader := Rec;
- GetSalesSetup();
- SalesSetup.TestField("Posted Prepmt. Inv. Nos.");
- if NoSeries.LookupRelatedNoSeries(GetPostingPrepaymentNoSeriesCode(), SalesHeader."Prepayment No. Series") then
- SalesHeader.Validate("Prepayment No. Series");
- Rec := SalesHeader;
- end;
-
- trigger OnValidate()
- var
- NoSeries: Codeunit "No. Series";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePrepmtNoSeries(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "Prepayment No. Series" <> '' then begin
- GetSalesSetup();
- SalesSetup.TestField("Posted Prepmt. Inv. Nos.");
- NoSeries.TestAreRelated(GetPostingPrepaymentNoSeriesCode(), "Prepayment No. Series");
- end;
- TestField("Prepayment No.", '');
- end;
- }
- ///
- /// Indicates whether prepayment invoice lines should be combined.
- ///
- field(132; "Compress Prepayment"; Boolean)
- {
- Caption = 'Compress Prepayment';
- ToolTip = 'Specifies that prepayments on the sales order are combined if they have the same general ledger account for prepayments or the same dimensions.';
- InitValue = true;
- }
- ///
- /// Specifies the date when the prepayment is due.
- ///
- field(133; "Prepayment Due Date"; Date)
- {
- Caption = 'Prepayment Due Date';
- ToolTip = 'Specifies when the prepayment invoice for this sales order is due.';
- }
- ///
- /// Specifies the number series for prepayment credit memos.
- ///
- field(134; "Prepmt. Cr. Memo No. Series"; Code[20])
- {
- Caption = 'Prepmt. Cr. Memo No. Series';
- TableRelation = "No. Series";
-
- trigger OnLookup()
- var
- NoSeries: Codeunit "No. Series";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupPrepmtCrMemoNoSeries(Rec, IsHandled);
- if IsHandled then
- exit;
-
- SalesHeader := Rec;
- GetSalesSetup();
- SalesSetup.TestField("Posted Prepmt. Cr. Memo Nos.");
- if NoSeries.LookupRelatedNoSeries(GetPostingPrepaymentNoSeriesCode(), SalesHeader."Prepmt. Cr. Memo No. Series") then
- SalesHeader.Validate("Prepmt. Cr. Memo No. Series");
- Rec := SalesHeader;
- end;
-
- trigger OnValidate()
- var
- NoSeries: Codeunit "No. Series";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePrepmtCrMemoNoSeries(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "Prepmt. Cr. Memo No." <> '' then begin
- GetSalesSetup();
- SalesSetup.TestField("Posted Prepmt. Cr. Memo Nos.");
- NoSeries.TestAreRelated(GetPostingPrepaymentNoSeriesCode(), "Prepmt. Cr. Memo No. Series");
- end;
- TestField("Prepmt. Cr. Memo No.", '');
- end;
- }
- ///
- /// Specifies the description for prepayment postings.
- ///
- field(135; "Prepmt. Posting Description"; Text[100])
- {
- Caption = 'Prepmt. Posting Description';
- }
- ///
- /// Specifies the last date for prepayment payment discount.
- ///
- field(138; "Prepmt. Pmt. Discount Date"; Date)
- {
- Caption = 'Prepmt. Pmt. Discount Date';
- ToolTip = 'Specifies the last date the customer can pay the prepayment invoice and still receive a payment discount on the prepayment amount.';
- }
- ///
- /// Specifies the payment terms code for prepayment invoices.
- ///
- field(139; "Prepmt. Payment Terms Code"; Code[10])
- {
- Caption = 'Prepmt. Payment Terms Code';
- ToolTip = 'Specifies the code that represents the payment terms for prepayment invoices related to the sales document.';
- TableRelation = "Payment Terms";
-
- trigger OnValidate()
- var
- PaymentTerms: Record "Payment Terms";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePrepmtPaymentTermsCode(Rec, xRec, FieldNo("Prepmt. Payment Terms Code"), CurrFieldNo, UpdateDocumentDate, IsHandled);
- if IsHandled then
- exit;
-
- if ("Prepmt. Payment Terms Code" <> '') and ("Document Date" <> 0D) then begin
- PaymentTerms.Get("Prepmt. Payment Terms Code");
- if IsCreditDocType() and not PaymentTerms."Calc. Pmt. Disc. on Cr. Memos" then begin
- IsHandled := false;
- OnValidatePrepmtPaymentTermsCodeOnCaseIfOnBeforeValidatePrepaymentDueDate(Rec, xRec, CurrFieldNo, IsHandled);
- if not IsHandled then
- Validate("Prepayment Due Date", "Document Date");
- Validate("Prepmt. Pmt. Discount Date", 0D);
- Validate("Prepmt. Payment Discount %", 0);
- end else begin
- IsHandled := false;
- OnValidatePaymentTermsCodeOnBeforeCalcDueDate(Rec, xRec, FieldNo("Prepmt. Payment Terms Code"), CurrFieldNo, IsHandled);
- if not IsHandled then
- "Prepayment Due Date" := CalcDate(PaymentTerms."Due Date Calculation", "Document Date");
- IsHandled := false;
- OnValidatePaymentTermsCodeOnBeforeCalcPmtDiscDate(Rec, xRec, FieldNo("Prepmt. Payment Terms Code"), CurrFieldNo, IsHandled);
- if not IsHandled then
- "Prepmt. Pmt. Discount Date" := CalcDate(PaymentTerms."Discount Date Calculation", "Document Date");
- if not UpdateDocumentDate then
- Validate("Prepmt. Payment Discount %", PaymentTerms."Discount %")
- end;
- end else begin
- IsHandled := false;
- OnPrepmtPaymentTermsCodeOnCaseElseOnBeforeValidatePrepaymentDueDate(Rec, xRec, CurrFieldNo, IsHandled);
- if not IsHandled then
- Validate("Prepayment Due Date", "Document Date");
- if not UpdateDocumentDate then begin
- Validate("Prepmt. Pmt. Discount Date", 0D);
- Validate("Prepmt. Payment Discount %", 0);
- end;
- end;
- end;
- }
- ///
- /// Specifies the payment discount percentage for prepayment invoices.
- ///
- field(140; "Prepmt. Payment Discount %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Prepmt. Payment Discount %';
- ToolTip = 'Specifies the payment discount percent granted on the prepayment if the customer pays on or before the date entered in the Prepmt. Pmt. Discount Date field.';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
-
- trigger OnValidate()
- begin
- if not (CurrFieldNo in [0, FieldNo("Posting Date"), FieldNo("Document Date")]) then
- TestStatusOpen();
- GLSetup.Get();
- if "Payment Discount %" < GLSetup."VAT Tolerance %" then
- "VAT Base Discount %" := "Payment Discount %"
- else
- "VAT Base Discount %" := GLSetup."VAT Tolerance %";
- Validate("VAT Base Discount %");
- end;
- }
- ///
- /// Specifies the quote number from which the order was created.
- ///
- field(151; "Quote No."; Code[20])
- {
- Caption = 'Quote No.';
- ToolTip = 'Specifies the number of the sales quote that the sales order was created from. You can track the number to sales quote documents that you have printed, saved, or emailed.';
- Editable = false;
- }
- ///
- /// Specifies the date until which the sales quote is valid.
- ///
- field(152; "Quote Valid Until Date"; Date)
- {
- Caption = 'Quote Valid To Date';
- ToolTip = 'Specifies how long the quote is valid.';
- }
- ///
- /// Specifies when the quote was sent to the customer.
- ///
- field(153; "Quote Sent to Customer"; DateTime)
- {
- Caption = 'Quote Sent to Customer';
- Editable = false;
- }
- ///
- /// Indicates whether the customer has accepted the quote.
- ///
- field(154; "Quote Accepted"; Boolean)
- {
- Caption = 'Quote Accepted';
- ToolTip = 'Specifies that the quote was accepted by the customer.';
-
- trigger OnValidate()
- begin
- if "Quote Accepted" then begin
- "Quote Accepted Date" := WorkDate();
- OnAfterSalesQuoteAccepted(Rec);
- end else
- "Quote Accepted Date" := 0D;
- end;
- }
- ///
- /// Specifies the date when the customer accepted the quote.
- ///
- field(155; "Quote Accepted Date"; Date)
- {
- Caption = 'Quote Accepted Date';
- ToolTip = 'Specifies when the quote was accepted by the customer.';
- Editable = false;
- }
- ///
- /// Specifies the status of background posting via the job queue.
- ///
- field(160; "Job Queue Status"; Enum "Document Job Queue Status")
- {
- Caption = 'Job Queue Status';
- ToolTip = 'Specifies the status of a job queue entry or task that handles the posting of sales orders.';
- Editable = false;
-
- trigger OnLookup()
- 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;
- }
- ///
- /// Specifies the unique identifier of the job queue entry for background posting.
- ///
- field(161; "Job Queue Entry ID"; Guid)
- {
- Caption = 'Job Queue Entry ID';
- Editable = false;
- }
- ///
- /// Specifies the company bank account code for payment information on documents.
- ///
- field(163; "Company Bank Account Code"; Code[20])
- {
- Caption = 'Company Bank Account Code';
- ToolTip = 'Specifies the bank account to use for bank information when the document is printed.';
- TableRelation = "Bank Account" where("Currency Code" = field("Currency Code"));
-
- trigger OnValidate()
- begin
- if not (CurrFieldNo in [0, FieldNo("Posting Date")]) or ("Company Bank Account Code" <> xRec."Company Bank Account Code") then
- TestStatusOpen();
- end;
- }
- ///
- /// Specifies the entry number of the incoming document that created this sales document.
- ///
- field(165; "Incoming Document Entry No."; Integer)
- {
- Caption = 'Incoming Document Entry No.';
- ToolTip = 'Specifies the number of the incoming document that this sales document is created for.';
- TableRelation = "Incoming Document";
-
- trigger OnValidate()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- if "Incoming Document Entry No." = xRec."Incoming Document Entry No." then
- exit;
- if "Incoming Document Entry No." = 0 then
- IncomingDocument.RemoveReferenceToWorkingDocument(xRec."Incoming Document Entry No.")
- else
- IncomingDocument.SetSalesDoc(Rec);
- end;
- }
- ///
- /// Indicates whether an alternative VAT registration number is used.
- ///
- field(166; "Alt. VAT Registration No."; Boolean)
- {
- Caption = 'Alternative VAT Registration No.';
- Editable = false;
- }
- ///
- /// Indicates whether an alternative general business posting group is used.
- ///
- field(167; "Alt. Gen. Bus Posting Group"; Boolean)
- {
- Caption = 'Alternative Gen. Bus. Posting Group';
- Editable = false;
- }
- ///
- /// Indicates whether an alternative VAT business posting group is used.
- ///
- field(168; "Alt. VAT Bus Posting Group"; Boolean)
- {
- Caption = 'Alternative VAT Bus. Posting Group';
- Editable = false;
- }
- ///
- /// Indicates whether this is a test document.
- ///
- field(170; IsTest; Boolean)
- {
- Caption = 'IsTest';
- Editable = false;
- }
- ///
- /// Specifies the phone number of the sell-to customer.
- ///
- field(171; "Sell-to Phone No."; Text[30])
- {
- Caption = 'Sell-to Phone No.';
- ToolTip = 'Specifies the telephone number of the contact person that the sales document will be sent to.';
- ExtendedDatatype = PhoneNo;
-
- trigger OnValidate()
- var
- Char: DotNet Char;
- i: Integer;
- begin
- for i := 1 to StrLen("Sell-to Phone No.") do
- if Char.IsLetter("Sell-to Phone No."[i]) then
- Error(PhoneNoCannotContainLettersErr);
-
- UpdateShipToAddressFromSellToAddress(Rec.FieldNo("Ship-to Phone No."));
- end;
- }
- ///
- /// Specifies the email address of the sell-to customer.
- ///
- field(172; "Sell-to E-Mail"; Text[80])
- {
- Caption = 'Email';
- ToolTip = 'Specifies the email address of the contact person that the sales document will be sent to.';
- ExtendedDatatype = EMail;
-
- trigger OnValidate()
- var
- MailManagement: Codeunit "Mail Management";
- begin
- if "Sell-to E-Mail" = '' then
- exit;
- MailManagement.CheckValidEmailAddresses("Sell-to E-Mail");
- end;
- }
- ///
- /// Specifies the journal template name used for posting.
- ///
- field(178; "Journal Templ. Name"; Code[10])
- {
- Caption = 'Journal Template Name';
- ToolTip = 'Specifies the name of the journal template in which the sales header is to be posted.';
- TableRelation = "Gen. Journal Template" where(Type = filter(Sales));
-
- trigger OnValidate()
- begin
- SalesSetup.Get();
- TestNoSeries();
- Validate("Posting No. Series", GenJournalTemplate."Posting No. Series");
- end;
- }
- ///
- /// Specifies the date used for VAT reporting purposes.
- ///
- field(179; "VAT Reporting Date"; Date)
- {
- Caption = 'VAT Date';
- ToolTip = 'Specifies the date used to include entries on VAT reports in a VAT period. This is either the date that the document was created or posted, depending on your setting on the General Ledger Setup page.';
- Editable = false;
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- if "VAT Reporting Date" = 0D then begin
- IsHandled := false;
- OnValidateVATReportingDateOnBeforeInitVATDate(Rec, xRec, IsHandled);
- if not IsHandled then
- InitVATDate();
- end;
- end;
- }
- ///
- /// Specifies the country/region code from which the goods were received.
- ///
- field(181; "Rcvd.-from Count./Region Code"; Code[10])
- {
- Caption = 'Received-from Country/Region Code';
- ToolTip = 'Specifies the country or region from which the items are returned for the purpose of Intrastat reporting.';
- TableRelation = "Country/Region";
- }
- ///
- /// Contains the timestamp of when the last email was sent for this document.
- ///
- field(185; "Last Email Sent Time"; DateTime)
- {
- Caption = 'Last Email Sent Time';
- FieldClass = FlowField;
- CalcFormula = max("Email Related Record".SystemCreatedAt where("Table Id" = const(Database::"Sales Header"),
- "System Id" = field(SystemId)));
- }
- ///
- /// Contains the message ID of the last email sent for this document.
- ///
- field(186; "Last Email Sent Message Id"; Guid)
- {
- Caption = 'Last Email Sent Message Id';
- FieldClass = FlowField;
- CalcFormula = lookup("Email Related Record"."Email Message Id" where(SystemCreatedAt = field("Last Email Sent Time")));
- }
- ///
- /// Contains a description of the work to be performed for this sales document.
- ///
- field(200; "Work Description"; BLOB)
- {
- Caption = 'Work Description';
- }
- ///
- /// Specifies the phone number at the shipping address.
- ///
- field(210; "Ship-to Phone No."; Text[30])
- {
- Caption = 'Ship-to Phone No.';
- ToolTip = 'Specifies the telephone number of the company''s shipping address.';
- ExtendedDatatype = PhoneNo;
- }
- ///
- /// Contains the total amount shipped but not invoiced in local currency including VAT.
- ///
- field(300; "Amt. Ship. Not Inv. (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Sales Line"."Shipped Not Invoiced (LCY)" where("Document Type" = field("Document Type"),
- "Document No." = field("No.")));
- Caption = 'Amount Shipped Not Invoiced (LCY) Incl. VAT';
- ToolTip = 'Specifies the sum, in LCY, for items that have been shipped but not yet been invoiced. The amount is calculated as Amount Including VAT x Qty. Shipped Not Invoiced / Quantity.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total amount shipped but not invoiced in local currency excluding VAT.
- ///
- field(301; "Amt. Ship. Not Inv. (LCY) Base"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Sales Line"."Shipped Not Inv. (LCY) No VAT" where("Document Type" = field("Document Type"),
- "Document No." = field("No.")));
- Caption = 'Amount Shipped Not Invoiced (LCY)';
- ToolTip = 'Specifies the sum, in LCY, for items that have been shipped but not yet been invoiced. The amount is calculated as Amount Including VAT x Qty. Shipped Not Invoiced / Quantity.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the identifier for the combination of dimensions applied to the document.
- ///
- field(480; "Dimension Set ID"; Integer)
- {
- Caption = 'Dimension Set ID';
- Editable = false;
- TableRelation = "Dimension Set Entry";
-
- trigger OnLookup()
- begin
- Rec.ShowDocDim();
- end;
-
- trigger OnValidate()
- begin
- DimMgt.UpdateGlobalDimFromDimSetID("Dimension Set ID", "Shortcut Dimension 1 Code", "Shortcut Dimension 2 Code");
- end;
- }
- ///
- /// Specifies the payment service set identifier for online payment services.
- ///
- field(600; "Payment Service Set ID"; Integer)
- {
- Caption = 'Payment Service Set ID';
- }
-#if not CLEANSCHEMA26
- field(720; "Coupled to CRM"; Boolean)
- {
- Caption = 'Coupled to Dynamics 365 Sales';
- Editable = false;
- ObsoleteReason = 'Replaced by flow field Coupled to Dataverse';
- ObsoleteState = Removed;
- ObsoleteTag = '26.0';
- }
-#endif
- ///
- /// Indicates whether this document is coupled to Dynamics 365 Sales.
- ///
- field(721; "Coupled to Dataverse"; Boolean)
- {
- FieldClass = FlowField;
- Caption = 'Coupled to Dynamics 365 Sales';
- ToolTip = 'Specifies that the sales order is coupled to an order in Dynamics 365 Sales.';
- Editable = false;
- CalcFormula = exist("CRM Integration Record" where("Integration ID" = field(SystemId), "Table ID" = const(Database::"Sales Header")));
- }
- ///
- /// Specifies the direct debit mandate used for collecting payments.
- ///
- field(1200; "Direct Debit Mandate ID"; Code[35])
- {
- Caption = 'Direct Debit Mandate ID';
- ToolTip = 'Specifies the direct-debit mandate that the customer has signed to allow direct debit collection of payments.';
- TableRelation = "SEPA Direct Debit Mandate" where("Customer No." = field("Bill-to Customer No."),
- Closed = const(false),
- Blocked = const(false));
- }
- ///
- /// Contains the total invoice discount amount for the sales document.
- ///
- field(1305; "Invoice Discount Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Sales Line"."Inv. Discount Amount" where("Document No." = field("No."),
- "Document Type" = field("Document Type")));
- Caption = 'Invoice Discount Amount';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the number of archived versions of this document.
- ///
- field(5043; "No. of Archived Versions"; Integer)
- {
- CalcFormula = max("Sales Header Archive"."Version No." where("Document Type" = field("Document Type"),
- "No." = field("No."),
- "Doc. No. Occurrence" = field("Doc. No. Occurrence")));
- Caption = 'No. of Archived Versions';
- ToolTip = 'Specifies the number of archived versions for this document.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the occurrence number when the same document number is reused.
- ///
- field(5048; "Doc. No. Occurrence"; Integer)
- {
- Caption = 'Doc. No. Occurrence';
- }
- ///
- /// Specifies the marketing campaign number linked to this sales document.
- ///
- field(5050; "Campaign No."; Code[20])
- {
- Caption = 'Campaign No.';
- ToolTip = 'Specifies the campaign number the document is linked to.';
- TableRelation = Campaign;
-
- trigger OnValidate()
- begin
- UpdateSalesLinesByFieldNo(FieldNo("Campaign No."), CurrFieldNo <> 0);
- CreateDimFromDefaultDim(Rec.FieldNo("Campaign No."));
- end;
- }
- ///
- /// Specifies the contact number at the sell-to customer.
- ///
- field(5052; "Sell-to Contact No."; Code[20])
- {
- Caption = 'Sell-to Contact No.';
- ToolTip = 'Specifies the number of the contact person that the sales document will be sent to.';
- TableRelation = Contact;
-
- trigger OnLookup()
- begin
- SelltoContactLookup();
- end;
-
- trigger OnValidate()
- var
- Cont: Record Contact;
- Opportunity: Record Opportunity;
- IsHandled: Boolean;
- ShouldUpdateOpportunity: Boolean;
- begin
- TestStatusOpen();
-
- if "Sell-to Contact No." <> '' then
- if Cont.Get("Sell-to Contact No.") then
- Cont.CheckIfPrivacyBlockedGeneric();
-
- IsHandled := false;
- OnValidateSellToContactNoOnAfterContCheckIfPrivacyBlockedGeneric(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if ("Sell-to Contact No." <> xRec."Sell-to Contact No.") and
- (xRec."Sell-to Contact No." <> '')
- then begin
- if ("Sell-to Contact No." = '') and ("Opportunity No." <> '') then
- Error(Text049, FieldCaption("Sell-to Contact No."));
- IsHandled := false;
- OnBeforeConfirmSellToContactNoChange(Rec, xRec, CurrFieldNo, Confirmed, IsHandled);
- if not IsHandled then
- if GetHideValidationDialog() or not GuiAllowed then
- Confirmed := true
- else
- Confirmed := Confirm(ConfirmChangeQst, false, FieldCaption("Sell-to Contact No."));
- if Confirmed then begin
- if InitFromContact("Sell-to Contact No.", "Sell-to Customer No.", FieldCaption("Sell-to Contact No.")) then
- exit;
- ShouldUpdateOpportunity := "Opportunity No." <> '';
- OnValidateSelltoContactNoOnAfterCalcShouldUpdateOpportunity(Rec, ShouldUpdateOpportunity);
- if ShouldUpdateOpportunity then begin
- Opportunity.Get("Opportunity No.");
- if Opportunity."Contact No." <> "Sell-to Contact No." then begin
- Modify();
- Opportunity.Validate("Contact No.", "Sell-to Contact No.");
- Opportunity.Modify();
- end
- end;
- end else begin
- Rec := xRec;
- exit;
- end;
- end;
-
- if ("Sell-to Customer No." <> '') and ("Sell-to Contact No." <> '') and
- ("Document Type" <> "Document Type"::Quote)
- then
- CheckContactRelatedToCustomerCompany("Sell-to Contact No.", "Sell-to Customer No.");
-
- IsHandled := false;
- OnValidateSelltoContactNoOnBeforeValidateSalespersonCode(Rec, Cont, IsHandled);
- if not IsHandled then
- if "Sell-to Contact No." <> '' then
- if Cont.Get("Sell-to Contact No.") then
- if ("Salesperson Code" = '') and (Cont."Salesperson Code" <> '') then
- Validate("Salesperson Code", Cont."Salesperson Code");
-
- if ("Sell-to Contact No." <> xRec."Sell-to Contact No.") then
- UpdateSellToCust("Sell-to Contact No.");
- UpdateSellToCustTemplateCode();
- UpdateShipToContact();
- GetShippingTime(FieldNo("Sell-to Contact No."));
- end;
- }
- ///
- /// Specifies the contact number at the bill-to customer.
- ///
- field(5053; "Bill-to Contact No."; Code[20])
- {
- Caption = 'Bill-to Contact No.';
- ToolTip = 'Specifies the number of the contact the invoice will be sent to.';
- TableRelation = Contact;
-
- trigger OnLookup()
- var
- Cont: Record Contact;
- ContBusinessRelation: Record "Contact Business Relation";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupBillToContactNo(IsHandled, Rec, xRec);
- if IsHandled then
- exit;
-
- if "Bill-to Customer No." <> '' then
- if Cont.Get("Bill-to Contact No.") then
- Cont.SetRange("Company No.", Cont."Company No.")
- else
- if ContBusinessRelation.FindByRelation(ContBusinessRelation."Link to Table"::Customer, "Bill-to Customer No.") then
- Cont.SetRange("Company No.", ContBusinessRelation."Contact No.")
- else
- Cont.SetRange("No.", '');
-
- if "Bill-to Contact No." <> '' then
- if Cont.Get("Bill-to Contact No.") then;
- if PAGE.RunModal(0, Cont) = ACTION::LookupOK then begin
- xRec := Rec;
- Validate("Bill-to Contact No.", Cont."No.");
- end;
- end;
-
- trigger OnValidate()
- var
- Cont: Record Contact;
- IsHandled: Boolean;
- begin
- TestStatusOpen();
-
- if "Bill-to Contact No." <> '' then
- if Cont.Get("Bill-to Contact No.") then
- Cont.CheckIfPrivacyBlockedGeneric();
-
- if ("Bill-to Contact No." <> xRec."Bill-to Contact No.") and
- (xRec."Bill-to Contact No." <> '')
- then begin
- IsHandled := false;
- OnBeforeConfirmBillToContactNoChange(Rec, xRec, CurrFieldNo, Confirmed, IsHandled);
- if not IsHandled then
- if GetHideValidationDialog() or (not GuiAllowed) then
- Confirmed := true
- else
- Confirmed := Confirm(ConfirmChangeQst, false, FieldCaption("Bill-to Contact No."));
- if Confirmed then begin
- if InitFromContact("Bill-to Contact No.", "Bill-to Customer No.", FieldCaption("Bill-to Contact No.")) then
- exit;
- end else begin
- "Bill-to Contact No." := xRec."Bill-to Contact No.";
- exit;
- end;
- end;
-
- if ("Bill-to Customer No." <> '') and ("Bill-to Contact No." <> '') then
- CheckContactRelatedToCustomerCompany("Bill-to Contact No.", "Bill-to Customer No.");
-
- UpdateBillToCust("Bill-to Contact No.");
- end;
- }
- ///
- /// Specifies the sales opportunity linked to this document.
- ///
- field(5055; "Opportunity No."; Code[20])
- {
- Caption = 'Opportunity No.';
- ToolTip = 'Specifies the number of the opportunity that the sales quote is assigned to.';
- TableRelation = if ("Document Type" = filter(<> Order)) Opportunity."No." where("Contact No." = field("Sell-to Contact No."),
- Closed = const(false))
- else
- if ("Document Type" = const(Order)) Opportunity."No." where("Contact No." = field("Sell-to Contact No."),
- "Sales Document No." = field("No."),
- "Sales Document Type" = const(Order));
-
- trigger OnValidate()
- begin
- LinkSalesDocWithOpportunity(xRec."Opportunity No.");
- end;
- }
- ///
- /// Specifies the customer template used for quotes without a customer.
- ///
- field(5056; "Sell-to Customer Templ. Code"; Code[20])
- {
- Caption = 'Sell-to Customer Template Code';
- ToolTip = 'Specifies the code for the template to create a new customer';
- TableRelation = "Customer Templ.";
-
- trigger OnValidate()
- var
- SellToCustTemplate: Record "Customer Templ.";
- begin
- EnsureDocumentTypeIsQuote();
- TestStatusOpen();
-
- if not InsertMode and
- ("Sell-to Customer Templ. Code" <> xRec."Sell-to Customer Templ. Code") and
- (xRec."Sell-to Customer Templ. Code" <> '')
- then begin
- if GetHideValidationDialog() or not GuiAllowed() then
- Confirmed := true
- else
- Confirmed := Confirm(ConfirmChangeQst, false, FieldCaption("Sell-to Customer Templ. Code"));
- if Confirmed then begin
- if InitFromTemplate("Sell-to Customer Templ. Code", FieldCaption("Sell-to Customer Templ. Code")) then
- exit
- end else begin
- "Sell-to Customer Templ. Code" := xRec."Sell-to Customer Templ. Code";
- exit;
- end;
- end;
-
- if SellToCustTemplate.Get("Sell-to Customer Templ. Code") then
- CopyFromNewSellToCustTemplate(SellToCustTemplate);
-
- if not InsertMode and
- ((xRec."Sell-to Customer Templ. Code" <> "Sell-to Customer Templ. Code") or
- (xRec."Currency Code" <> "Currency Code"))
- then
- RecreateSalesLines(CopyStr(FieldCaption("Sell-to Customer Templ. Code"), 1, 100));
- end;
- }
- ///
- /// Specifies the bill-to customer template used for quotes without a customer.
- ///
- field(5057; "Bill-to Customer Templ. Code"; Code[20])
- {
- Caption = 'Bill-to Customer Template Code';
- TableRelation = "Customer Templ.";
-
- trigger OnValidate()
- var
- BillToCustTemplate: Record "Customer Templ.";
- begin
- TestField("Document Type", "Document Type"::Quote);
- TestStatusOpen();
-
- if not InsertMode and
- ("Bill-to Customer Templ. Code" <> xRec."Bill-to Customer Templ. Code") and
- (xRec."Bill-to Customer Templ. Code" <> '')
- then begin
- if GetHideValidationDialog() or not GuiAllowed then
- Confirmed := true
- else
- Confirmed := Confirm(ConfirmChangeQst, false, FieldCaption("Bill-to Customer Templ. Code"));
- if Confirmed then begin
- if InitFromTemplate("Bill-to Customer Templ. Code", FieldCaption("Bill-to Customer Templ. Code")) then
- exit
- end else begin
- "Bill-to Customer Templ. Code" := xRec."Bill-to Customer Templ. Code";
- exit;
- end;
- end;
-
- Rec.Validate("Ship-to Code", '');
- if BillToCustTemplate.Get("Bill-to Customer Templ. Code") then
- InitFromBillToCustTemplate(BillToCustTemplate);
-
- CreateDimFromDefaultDim(Rec.FieldNo("Bill-to Customer Templ. Code"));
-
- OnValidateBilltoCustomerTemplCodeOnBeforeRecreateSalesLines(Rec, CurrFieldNo);
-
- if not InsertMode and
- (xRec."Sell-to Customer Templ. Code" = "Sell-to Customer Templ. Code") and
- (xRec."Bill-to Customer Templ. Code" <> "Bill-to Customer Templ. Code")
- then
- RecreateSalesLines(CopyStr(FieldCaption("Bill-to Customer Templ. Code"), 1, 100));
- end;
- }
- ///
- /// Specifies the responsibility center associated with this sales document.
- ///
- field(5700; "Responsibility Center"; Code[10])
- {
- Caption = 'Responsibility Center';
- ToolTip = 'Specifies the code of the responsibility center, such as a distribution hub, that is associated with the involved user, company, customer, or vendor.';
- TableRelation = "Responsibility Center";
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- TestStatusOpen();
- IsHandled := false;
- OnBeforeResponsibilityCenterValidate(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
- if not UserSetupMgt.CheckRespCenter(0, "Responsibility Center") then
- Error(
- Text027,
- RespCenter.TableCaption(), UserSetupMgt.GetSalesFilter());
-
- UpdateLocationCode('');
- UpdateOutboundWhseHandlingTime();
- UpdateShipToAddress();
-
- CreateDimFromDefaultDim(Rec.FieldNo("Responsibility Center"));
-
- OnValidateResponsibilityCenterOnBeforeRecreateSalesLines(Rec, CurrFieldNo);
-
- if xRec."Responsibility Center" <> "Responsibility Center" then begin
- RecreateSalesLines(FieldCaption("Responsibility Center"));
- "Assigned User ID" := '';
- end;
- end;
- }
- ///
- /// Specifies whether the customer accepts partial shipment of orders.
- ///
- field(5750; "Shipping Advice"; Enum "Sales Header Shipping Advice")
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Shipping Advice';
- ToolTip = 'Specifies if the customer accepts partial shipment of orders.';
-
- trigger OnValidate()
- var
- SalesWarehouseMgt: Codeunit "Sales Warehouse Mgt.";
- begin
- TestStatusOpen();
- if InventoryPickConflict("Document Type", "No.", "Shipping Advice") then
- Error(Text066, FieldCaption("Shipping Advice"), Format("Shipping Advice"), TableCaption);
- if WhseShipmentConflict("Document Type", "No.", "Shipping Advice") then
- Error(Text070, FieldCaption("Shipping Advice"), Format("Shipping Advice"), TableCaption);
- SalesWarehouseMgt.SalesHeaderVerifyChange(Rec, xRec);
- end;
- }
- ///
- /// Indicates whether there are shipped quantities that have not yet been invoiced.
- ///
- field(5751; "Shipped Not Invoiced"; Boolean)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- CalcFormula = exist("Sales Line" where("Document Type" = field("Document Type"),
- "Document No." = field("No."),
- "Qty. Shipped Not Invoiced" = filter(<> 0)));
- Caption = 'Shipped Not Invoiced';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Indicates whether all items on the order have been completely shipped.
- ///
- field(5752; "Completely Shipped"; Boolean)
- {
- CalcFormula = min("Sales Line"."Completely Shipped" where("Document Type" = field("Document Type"),
- "Document No." = field("No."),
- Type = filter(<> " "),
- "Location Code" = field("Location Filter")));
- Caption = 'Completely Shipped';
- ToolTip = 'Specifies whether all the items on the order have been shipped or, in the case of inbound items, completely received.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains an internal reference used when posting from warehouse documents.
- ///
- field(5753; "Posting from Whse. Ref."; Integer)
- {
- AccessByPermission = TableData Location = R;
- Caption = 'Posting from Whse. Ref.';
- }
- ///
- /// Specifies the location filter for calculating flow fields.
- ///
- field(5754; "Location Filter"; Code[10])
- {
- Caption = 'Location Filter';
- FieldClass = FlowFilter;
- TableRelation = Location;
- }
- ///
- /// Indicates whether any items on the order have been shipped.
- ///
- field(5755; Shipped; Boolean)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- CalcFormula = exist("Sales Line" where("Document Type" = field("Document Type"),
- "Document No." = field("No."),
- "Qty. Shipped (Base)" = filter(<> 0)));
- Caption = 'Shipped';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the shipment date of the last posted shipment.
- ///
- field(5756; "Last Shipment Date"; Date)
- {
- CalcFormula = lookup("Sales Shipment Header"."Shipment Date" where("No." = field("Last Shipping No.")));
- Caption = 'Last Shipment Date';
- FieldClass = FlowField;
- }
- ///
- /// Specifies the date the customer requested for delivery.
- ///
- field(5790; "Requested Delivery Date"; Date)
- {
- Caption = 'Requested Delivery Date';
- ToolTip = 'Specifies the date that the customer has asked for the order to be delivered.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateRequestedDeliveryDate(Rec, IsHandled, xRec, CurrFieldNo);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- CheckPromisedDeliveryDate();
-
- if "Requested Delivery Date" <> xRec."Requested Delivery Date" then
- UpdateSalesLinesByFieldNo(FieldNo("Requested Delivery Date"), CurrFieldNo <> 0);
- end;
- }
- ///
- /// Specifies the date the company promised to deliver the order.
- ///
- field(5791; "Promised Delivery Date"; Date)
- {
- AccessByPermission = TableData "Order Promising Line" = R;
- Caption = 'Promised Delivery Date';
- ToolTip = 'Specifies the date that you have promised to deliver the order, as a result of the Order Promising function.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePromisedDeliveryDate(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- if "Promised Delivery Date" <> xRec."Promised Delivery Date" then
- UpdateSalesLinesByFieldNo(FieldNo("Promised Delivery Date"), CurrFieldNo <> 0);
- end;
- }
- ///
- /// Specifies the time required for shipping from the location to the customer.
- ///
- field(5792; "Shipping Time"; DateFormula)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Shipping Time';
- ToolTip = 'Specifies how long it takes from when the items are shipped from the warehouse to when they are delivered.';
-
- trigger OnValidate()
- begin
- TestStatusOpen();
- if "Shipping Time" <> xRec."Shipping Time" then
- UpdateSalesLinesByFieldNo(FieldNo("Shipping Time"), CurrFieldNo <> 0);
- end;
- }
- ///
- /// Specifies the time required for outbound warehouse handling before shipment.
- ///
- field(5793; "Outbound Whse. Handling Time"; DateFormula)
- {
- AccessByPermission = TableData "Warehouse Shipment Header" = R;
- Caption = 'Outbound Whse. Handling Time';
- ToolTip = 'Specifies a date formula for the time it takes to get items ready to ship from this location. The time element is used in the calculation of the delivery date as follows: Shipment Date + Outbound Warehouse Handling Time = Planned Shipment Date + Shipping Time = Planned Delivery Date.';
-
- trigger OnValidate()
- begin
- TestStatusOpen();
- if ("Outbound Whse. Handling Time" <> xRec."Outbound Whse. Handling Time") and
- (xRec."Sell-to Customer No." = "Sell-to Customer No.")
- then
- UpdateSalesLinesByFieldNo(FieldNo("Outbound Whse. Handling Time"), CurrFieldNo <> 0);
- end;
- }
- ///
- /// Specifies the shipping agent service code for delivery terms.
- ///
- field(5794; "Shipping Agent Service Code"; Code[10])
- {
- Caption = 'Shipping Agent Service Code';
- ToolTip = 'Specifies the code for the service, such as a one-day delivery, that is offered by the shipping agent.';
- TableRelation = "Shipping Agent Services".Code where("Shipping Agent Code" = field("Shipping Agent Code"));
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShippingAgentServiceCode(Rec, IsHandled);
- if IsHandled then
- exit;
-
- TestStatusOpen();
- if xRec."Shipping Agent Service Code" = "Shipping Agent Service Code" then
- exit;
-
- GetShippingTime(FieldNo("Shipping Agent Service Code"));
- UpdateSalesLinesByFieldNo(FieldNo("Shipping Agent Service Code"), CurrFieldNo <> 0);
- end;
- }
- ///
- /// Indicates whether there are lines with outstanding quantities past their shipment date.
- ///
- field(5795; "Late Order Shipping"; Boolean)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- CalcFormula = exist("Sales Line" where("Document Type" = field("Document Type"),
- "Sell-to Customer No." = field("Sell-to Customer No."),
- "Document No." = field("No."),
- "Shipment Date" = field("Date Filter"),
- "Outstanding Quantity" = filter(<> 0)));
- Caption = 'Late Order Shipping';
- ToolTip = 'Indicates a delay in the shipment of one or more lines, or that the shipment date is either the same as or earlier than the work date.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the date filter used for calculating flow fields.
- ///
- field(5796; "Date Filter"; Date)
- {
- Caption = 'Date Filter';
- FieldClass = FlowFilter;
- }
- field(5800; Receive; Boolean)
- {
- Caption = 'Receive';
- }
- field(5801; "Return Receipt No."; Code[20])
- {
- Caption = 'Return Receipt No.';
- }
- field(5802; "Return Receipt No. Series"; Code[20])
- {
- Caption = 'Return Receipt No. Series';
- TableRelation = "No. Series";
-
- trigger OnLookup()
- var
- NoSeries: Codeunit "No. Series";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupReturnReceiptNoSeries(Rec, IsHandled);
- if IsHandled then
- exit;
-
- SalesHeader := Rec;
- GetSalesSetup();
- SalesSetup.TestField("Posted Return Receipt Nos.");
- if NoSeries.LookupRelatedNoSeries(SalesSetup."Posted Return Receipt Nos.", SalesHeader."Return Receipt No. Series") then
- SalesHeader.Validate("Return Receipt No. Series");
- Rec := SalesHeader;
- end;
-
- trigger OnValidate()
- var
- NoSeries: Codeunit "No. Series";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateReturnReceiptNoSeries(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "Return Receipt No. Series" <> '' then begin
- GetSalesSetup();
- SalesSetup.TestField("Posted Return Receipt Nos.");
- NoSeries.TestAreRelated(SalesSetup."Posted Return Receipt Nos.", "Return Receipt No. Series");
- end;
- TestField("Return Receipt No.", '');
- end;
- }
- field(5803; "Last Return Receipt No."; Code[20])
- {
- Caption = 'Last Return Receipt No.';
- Editable = false;
- TableRelation = "Return Receipt Header";
- }
- field(7000; "Price Calculation Method"; Enum "Price Calculation Method")
- {
- Caption = 'Price Calculation Method';
- }
- field(7001; "Allow Line Disc."; Boolean)
- {
- Caption = 'Allow Line Disc.';
-
- trigger OnValidate()
- begin
- TestStatusOpen();
- MessageIfSalesLinesExist(FieldCaption("Allow Line Disc."));
- end;
- }
- field(7200; "Get Shipment Used"; Boolean)
- {
- Caption = 'Get Shipment Used';
- Editable = false;
- }
- field(9000; "Assigned User ID"; Code[50])
- {
- Caption = 'Assigned User ID';
- ToolTip = 'Specifies the ID of the user who is responsible for the document.';
- DataClassification = EndUserIdentifiableInformation;
- TableRelation = "User Setup";
-
- trigger OnValidate()
- begin
- if not UserSetupMgt.CheckRespCenter(0, "Responsibility Center", "Assigned User ID") then
- Error(
- Text061, "Assigned User ID",
- RespCenter.TableCaption(), UserSetupMgt.GetSalesFilter("Assigned User ID"));
- end;
- }
- field(11000000; "Transaction Mode Code"; Code[20])
- {
- Caption = 'Transaction Mode Code';
- TableRelation = "Transaction Mode".Code where("Account Type" = const(Customer));
-
- trigger OnValidate()
- var
- TrMode: Record "Transaction Mode";
- begin
- if "Transaction Mode Code" <> '' then begin
- TrMode.Get(TrMode."Account Type"::Customer, "Transaction Mode Code");
- if TrMode."Payment Method Code" <> '' then
- Validate("Payment Method Code", TrMode."Payment Method Code");
- if TrMode."Payment Terms Code" <> '' then
- Validate("Payment Terms Code", TrMode."Payment Terms Code");
- end;
- end;
- }
- field(11000001; "Bank Account Code"; Code[20])
- {
- Caption = 'Bank Account Code';
- TableRelation = "Customer Bank Account".Code where("Customer No." = field("Bill-to Customer No."));
- }
- }
-
- keys
- {
- key(Key1; "Document Type", "No.")
- {
- Clustered = true;
- }
- key(Key2; "No.", "Document Type")
- {
- }
- key(Key3; "Document Type", "Sell-to Customer No.")
- {
- }
- key(Key4; "Document Type", "Bill-to Customer No.")
- {
- }
- key(Key5; "Document Type", "Combine Shipments", "Sell-to Customer No.", "Bill-to Customer No.", "Currency Code", "EU 3-Party Trade", "Dimension Set ID", "Journal Templ. Name")
- {
- }
- key(Key6; "Sell-to Customer No.", "External Document No.")
- {
- }
- key(Key7; "Document Type", "Sell-to Contact No.")
- {
- }
- key(Key8; "Bill-to Contact No.")
- {
- }
- key(Key9; "Incoming Document Entry No.")
- {
- }
- key(Key10; "Document Date")
- {
- }
- key(Key11; "Shipment Date", Status, "Location Code", "Responsibility Center")
- {
- }
- key(Key12; "Salesperson Code")
- {
- }
- key(Key13; SystemModifiedAt)
- {
- }
- }
-
- fieldgroups
- {
- fieldgroup(DropDown; "No.", "Sell-to Customer Name", Amount, "Sell-to Contact", "Amount Including VAT")
- {
- }
- fieldgroup(Brick; "No.", "Sell-to Customer Name", Amount, "Sell-to Contact", "Amount Including VAT")
- {
- }
- }
-
- trigger OnDelete()
- var
- PostSalesDelete: Codeunit "PostSales-Delete";
- ArchiveManagement: Codeunit ArchiveManagement;
- CRMIntTableSubscriber: Codeunit "CRM Int. Table. Subscriber";
- ShowPostedDocsToPrint: Boolean;
- DisableAggregateTableUpdate: Codeunit "Disable Aggregate Table Update";
- begin
- if not UserSetupMgt.CheckRespCenter(0, "Responsibility Center") then
- Error(
- Text022,
- RespCenter.TableCaption(), UserSetupMgt.GetSalesFilter());
-
- OnDeleteOnBeforeArchiveSalesDocument(Rec, xRec);
- ArchiveManagement.AutoArchiveSalesDocument(Rec);
- PostSalesDelete.DeleteHeader(
- Rec, SalesShptHeader, SalesInvHeader, SalesCrMemoHeader, ReturnRcptHeader,
- SalesInvHeaderPrepmt, SalesCrMemoHeaderPrepmt);
- UpdateOpportunity();
- OnDeleteOnAfterPostSalesDeleteDeleteHeader(Rec);
-
- Validate("Applies-to ID", '');
- Rec.Validate("Incoming Document Entry No.", 0);
-
- DeleteRecordInApprovalRequest();
- SalesLine.Reset();
- SalesLine.LockTable();
-
- DeleteWarehouseRequest();
-
- SetupDisableAggregateTableUpdate(DisableAggregateTableUpdate);
- DeleteAllSalesLines();
- EnableAggregateTableUpdate(DisableAggregateTableUpdate);
-
- ShowPostedDocsToPrint := (SalesShptHeader."No." <> '') or
- (SalesInvHeader."No." <> '') or
- (SalesCrMemoHeader."No." <> '') or
- (ReturnRcptHeader."No." <> '') or
- (SalesInvHeaderPrepmt."No." <> '') or
- (SalesCrMemoHeaderPrepmt."No." <> '');
- OnBeforeShowPostedDocsToPrintCreatedMsg(ShowPostedDocsToPrint);
- if ShowPostedDocsToPrint then
- Message(PostedDocsToPrintCreatedMsg);
-
- CRMIntTableSubscriber.MarkArchivedSalesOrder(Rec);
- end;
-
- trigger OnInsert()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeOnInsert(Rec, IsHandled, InsertMode);
- if IsHandled then
- exit;
-
- InitInsert();
- InsertMode := true;
-
- Rec.SetSellToCustomerFromFilter();
-
- if GetFilterContNo() <> '' then
- Validate("Sell-to Contact No.", GetFilterContNo());
-
- if "Sell-to Customer No." <> '' then
- StandardCodesMgtGlobal.CheckCreateSalesRecurringLines(Rec);
-
- // Remove view filters so that the cards does not show filtered view notification
- SetView('');
-
- OnAfterOnInsert(Rec);
- end;
-
- trigger OnRename()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeRename(Rec, IsHandled, xRec);
- if IsHandled then
- exit;
-
- Error(Text003, TableCaption);
- end;
-
- var
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text003: Label 'You cannot rename a %1.';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- ConfirmChangeQst: Label 'Do you want to change %1?', Comment = '%1 = a Field Caption like Currency Code';
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text005: Label 'You cannot reset %1 because the document still has one or more lines.';
- Text006: Label 'You cannot change %1 because the order is associated with one or more purchase orders.';
- Text007: Label '%1 cannot be greater than %2 in the %3 table.';
- Text009: Label 'Deleting this document will cause a gap in the number series for shipments. An empty shipment %1 will be created to fill this gap in the number series.\\Do you want to continue?';
- Text012: Label 'Deleting this document will cause a gap in the number series for posted invoices. An empty posted invoice %1 will be created to fill this gap in the number series.\\Do you want to continue?';
- Text014: Label 'Deleting this document will cause a gap in the number series for posted credit memos. An empty posted credit memo %1 will be created to fill this gap in the number series.\\Do you want to continue?';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- RecreateSalesLinesMsg: Label 'If you change %1, the existing sales lines will be deleted and new sales lines based on the new information on the header will be created.\\Do you want to continue?', Comment = '%1: FieldCaption';
- ResetItemChargeAssignMsg: Label 'If you change %1, the existing sales lines will be deleted and new sales lines based on the new information on the header will be created.\The amount of the item charge assignment will be reset to 0.\\Do you want to continue?', Comment = '%1: FieldCaption';
-#pragma warning disable AA0470
- LinesNotUpdatedMsg: Label 'You have changed %1 on the sales header, but it has not been changed on the existing sales lines.', Comment = 'You have changed Order Date on the sales header, but it has not been changed on the existing sales lines.';
-#pragma warning restore AA0470
- LinesNotUpdatedDateMsg: Label 'You have changed the %1 on the sales header, which might affect the prices and discounts on the sales lines. You should review the lines and manually update prices and discounts if needed.', Comment = '%1: OrderDate';
-#pragma warning disable AA0074
- Text019: Label 'You must update the existing sales lines manually.';
-#pragma warning restore AA0074
- AffectExchangeRateMsg: Label 'The change may affect the exchange rate that is used for price calculation on the sales lines.';
-#pragma warning disable AA0074
- Text021: Label 'Do you want to update the exchange rate?';
-#pragma warning disable AA0470
- Text022: Label 'You cannot delete this document. Your identification is set up to process from %1 %2 only.';
- Text024: Label 'You have modified the %1 field. The recalculation of VAT may cause penny differences, so you must check the amounts afterward. Do you want to update the %2 field on the lines to reflect the new value of %1?';
- Text027: Label 'Your identification is set up to process from %1 %2 only.';
- Text028: Label 'You cannot change the %1 when the %2 has been filled in.';
- Text030: Label 'Deleting this document will cause a gap in the number series for return receipts. An empty return receipt %1 will be created to fill this gap in the number series.\\Do you want to continue?';
- Text031: Label 'You have modified %1.\\Do you want to update the lines?', Comment = 'You have modified Shipment Date.\\Do you want to update the lines?';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- MaxAllowedValueIs100Err: Label 'The values must be less than or equal 100.';
- DoYouWantToKeepExistingDimensionsQst: Label 'This will change the dimension specified on the document. Do you want to recalculate/update dimensions?';
- SalesAlreadyExistsTxt: Label 'Sales %1 %2 already exists for this customer.', Comment = '%1 = Document Type; %2 = External Document No.';
- ShowDocAlreadyExistNotificationNameTxt: Label 'Sales document with same external document number already exists.';
- ShowDocAlreadyExistNotificationDescriptionTxt: Label 'Warn if sales document with same external document number already exists.';
- GLSetup: Record "General Ledger Setup";
- GLAcc: Record "G/L Account";
- CustLedgEntry: Record "Cust. Ledger Entry";
- PaymentTerms: Record "Payment Terms";
- PaymentMethod: Record "Payment Method";
- CurrExchRate: Record "Currency Exchange Rate";
- PostCode: Record "Post Code";
- BankAcc: Record "Bank Account";
- SalesShptHeader: Record "Sales Shipment Header";
- SalesInvHeader: Record "Sales Invoice Header";
- SalesCrMemoHeader: Record "Sales Cr.Memo Header";
- ReturnRcptHeader: Record "Return Receipt Header";
- SalesInvHeaderPrepmt: Record "Sales Invoice Header";
- SalesCrMemoHeaderPrepmt: Record "Sales Cr.Memo Header";
- GenBusPostingGrp: Record "Gen. Business Posting Group";
- RespCenter: Record "Responsibility Center";
- InvtSetup: Record "Inventory Setup";
- Location: Record Location;
- WhseRequest: Record "Warehouse Request";
- GenJournalTemplate: Record "Gen. Journal Template";
- GlobalNoSeries: Record "No. Series";
- ReservEntry: Record "Reservation Entry";
- TempReservEntry: Record "Reservation Entry" temporary;
- CompanyInfo: Record "Company Information";
- Salesperson: Record "Salesperson/Purchaser";
- UserSetupMgt: Codeunit "User Setup Management";
- CustCheckCreditLimit: Codeunit "Cust-Check Cr. Limit";
- DimMgt: Codeunit DimensionManagement;
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- SalesLineReserve: Codeunit "Sales Line-Reserve";
- PostingSetupMgt: Codeunit PostingSetupManagement;
- ApplicationAreaMgmt: Codeunit "Application Area Mgmt.";
- StandardCodesMgtGlobal: Codeunit "Standard Codes Mgt.";
- SalesCalcDiscountByType: Codeunit "Sales - Calc Discount By Type";
- AltCustVATRegFacade: Codeunit "Alt. Cust. VAT. Reg. Facade";
- CurrencyDate: Date;
- Confirmed: Boolean;
-#pragma warning disable AA0074
- Text035: Label 'You cannot Release Quote or Make Order unless you specify a customer on the quote.\\Do you want to create customer(s) now?';
-#pragma warning disable AA0470
- Text037: Label 'Contact %1 %2 is not related to customer %3.';
- Text038: Label 'Contact %1 %2 is related to a different company than customer %3.';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
-#pragma warning disable AA0470
- ContactIsNotRelatedToAnyCostomerErr: Label 'Contact %1 %2 is not related to a customer.';
-#pragma warning restore AA0470
-#pragma warning disable AA0074
- Text040: Label 'A won opportunity is linked to this order.\It has to be changed to status Lost before the Order can be deleted.\Do you want to change the status for this opportunity now?';
- Text044: Label 'The status of the opportunity has not been changed. The program has aborted deleting the order.';
-#pragma warning disable AA0470
- Text045: Label 'You can not change the %1 field because %2 %3 has %4 = %5 and the %6 has already been assigned %7 %8.';
- Text048: Label 'Sales quote %1 has already been assigned to opportunity %2. Would you like to reassign this quote?';
- Text049: Label 'The %1 field cannot be blank because this quote is linked to an opportunity.';
- Text051: Label 'The sales %1 %2 already exists.';
- Text053: Label 'You must cancel the approval process if you wish to change the %1.';
- Text056: Label 'Deleting this document will cause a gap in the number series for prepayment invoices. An empty prepayment invoice %1 will be created to fill this gap in the number series.\\Do you want to continue?';
- Text057: Label 'Deleting this document will cause a gap in the number series for prepayment credit memos. An empty prepayment credit memo %1 will be created to fill this gap in the number series.\\Do you want to continue?';
- Text061: Label '%1 is set up to process from %2 %3 only.';
- Text062: Label 'You cannot change %1 because the corresponding %2 %3 has been assigned to this %4.';
-#pragma warning restore AA0470
- Text063: Label 'Reservations exist for this order. These reservations will be canceled if a date conflict is caused by this change.\\Do you want to continue?';
- Text064: Label 'You may have changed a dimension.\\Do you want to update the lines?';
-#pragma warning disable AA0470
- Text066: Label 'You cannot change %1 to %2 because an open inventory pick on the %3.';
- Text070: Label 'You cannot change %1 to %2 because an open warehouse shipment exists for the %3.';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- BilltoCustomerNoChanged: Boolean;
- SelectNoSeriesAllowed: Boolean;
-#pragma warning disable AA0470
- PrepaymentInvoicesNotPaidErr: Label 'You cannot post the document of type %1 with the number %2 before all related prepayment invoices are posted.', Comment = 'You cannot post the document of type Order with the number 1001 before all related prepayment invoices are posted.';
-#pragma warning restore AA0470
- StatisticsInsuffucientPermissionsErr: Label 'You don''t have permission to view statistics.';
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text072: Label 'There are unpaid prepayment invoices related to the document of type %1 with the number %2.';
- DifferentDatesQst: Label 'Posting Date %1 is different from Work Date %2.\\Do you want to continue?', Comment = '%1 - Posting Date, %2 - work date';
- DifferentDatesErr: Label 'Posting Date %1 is different from Work Date %2.\\Batch posting cannot be used.', Comment = '%1 - Posting Date, %2 - work date';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- DeferralLineQst: Label 'Do you want to update the deferral schedules for the lines?';
-#pragma warning disable AA0470
- SynchronizingMsg: Label 'Synchronizing ...\ from: Sales Header with %1\ to: Assembly Header with %2.';
-#pragma warning restore AA0470
- ShippingAdviceErr: Label 'This document cannot be shipped completely. Change the value in the Shipping Advice field to Partial.';
- PostedDocsToPrintCreatedMsg: Label 'One or more related posted documents have been generated during deletion to fill gaps in the posting number series. You can view or print the documents from the respective document archive.';
- DocumentNotPostedClosePageQst: Label 'The document has been saved but is not yet posted.\\Are you sure you want to exit?';
- SelectCustomerTemplateQst: Label 'Do you want to select the customer template?';
- ModifyCustomerAddressNotificationLbl: Label 'Update the address';
- DontShowAgainActionLbl: Label 'Don''t show again';
- ModifyCustomerAddressNotificationMsg: Label 'The address you entered for %1 is different from the customer''s existing address.', Comment = '%1=customer name';
- ValidVATNoMsg: Label 'The specified VAT registration number is valid.';
- InvalidVatRegNoMsg: Label 'The VAT registration number is not valid. Try entering the number again.';
- SellToCustomerTxt: Label 'Sell-to Customer';
- BillToCustomerTxt: Label 'Bill-to Customer';
- ModifySellToCustomerAddressNotificationNameTxt: Label 'Update Sell-to Customer Address';
- ModifySellToCustomerAddressNotificationDescriptionTxt: Label 'Warn if the sell-to address on sales documents is different from the customer''s existing address.';
- ModifyBillToCustomerAddressNotificationNameTxt: Label 'Update Bill-to Customer Address';
- ModifyBillToCustomerAddressNotificationDescriptionTxt: Label 'Warn if the bill-to address on sales documents is different from the customer''s existing address.';
- DuplicatedCaptionsNotAllowedErr: Label 'Field captions must not be duplicated when using this method. Use UpdateSalesLinesByFieldNo instead.';
- PhoneNoCannotContainLettersErr: Label 'You cannot enter letters in this field.';
- SplitMessageTxt: Label '%1\%2', Comment = 'Some message text 1.\Some message text 2.', Locked = true;
- ConfirmEmptyEmailQst: Label 'Contact %1 has no email address specified. The value in the Email field on the sales order, %2, will be deleted. Do you want to continue?', Comment = '%1 - Contact No., %2 - Email';
- FullSalesTypesTxt: Label 'Sales Quote,Sales Order,Sales Invoice,Sales Credit Memo,Sales Blanket Order,Sales Return Order';
- RecreateSalesLinesCancelErr: Label 'Change in the existing sales lines for the field %1 is cancelled by user.', Comment = '%1 - Field Name, Sample: You must delete the existing sales lines before you can change Currency Code.';
- SalesLinesCategoryLbl: Label 'Sales Lines', Locked = true;
- SalesHeaderIsTemporaryLbl: Label 'Sales Header must be not temporary.', Locked = true;
- SalesHeaderDoesNotExistLbl: Label 'Sales Header must exist.', Locked = true;
- SalesHeaderCannotModifyLbl: Label 'Cannot modify Sales Header.', Locked = true;
- WarnZeroQuantitySalesPostingTxt: Label 'Warn before posting Sales lines with 0 quantity';
- WarnZeroQuantitySalesPostingDescriptionTxt: Label 'Warn before posting lines on Sales documents where quantity is 0.';
- CalledFromWhseDoc: Boolean;
- DocumentNotOpenErr: Label 'The document''s status must be Open. To change the status, use the Reopen action.';
-
- protected var
- Customer: Record Customer;
- SalesSetup: Record "Sales & Receivables Setup";
- SalesHeader: Record "Sales Header";
- SalesLine: Record "Sales Line";
- HideCreditCheckDialogue: Boolean;
- HideValidationDialog: Boolean;
- InsertMode: Boolean;
- StatusCheckSuspended: Boolean;
- UpdateDocumentDate: Boolean;
- SkipSellToContact: Boolean;
- SkipBillToContact: Boolean;
- SkipTaxCalculation: Boolean;
- SkipDocNoOccurrenceReset: Boolean;
-
- ///
- /// Initializes a new sales header with a new document number from the number series.
- ///
- procedure InitInsert()
- var
- SalesHeader2: Record "Sales Header";
- NoSeries: Codeunit "No. Series";
- NoSeriesCode: Code[20];
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInitInsert(Rec, xRec, IsHandled);
- if not IsHandled then
- if "No." = '' then begin
- TestNoSeries();
- NoSeriesCode := GetNoSeriesCode();
- "No. Series" := NoSeriesCode;
- if NoSeries.AreRelated("No. Series", xRec."No. Series") then
- "No. Series" := xRec."No. Series";
- "No." := NoSeries.GetNextNo("No. Series", "Posting Date");
- SalesHeader2.ReadIsolation(IsolationLevel::ReadUncommitted);
- SalesHeader2.SetLoadFields("No.");
- while SalesHeader2.Get("Document Type", "No.") do
- "No." := NoSeries.GetNextNo("No. Series", "Posting Date");
- end;
-
- OnInitInsertOnBeforeInitRecord(Rec, xRec);
- InitRecord();
- end;
-
- ///
- /// Initializes a new sales header with default values.
- ///
- procedure InitRecord()
- var
- ShipToAddress: Record "Ship-to Address";
- ArchiveManagement: Codeunit ArchiveManagement;
- LocationCode: Code[10];
- IsHandled: Boolean;
- NewOrderDate: Date;
- begin
- GetSalesSetup();
- IsHandled := false;
- OnBeforeInitRecord(Rec, IsHandled, xRec);
- if not IsHandled then
- InitPostingNoSeries();
-
- InitShipmentDate();
-
- InitPostingDate();
-
- if SalesSetup."Default Posting Date" = SalesSetup."Default Posting Date"::"No Date" then
- "Posting Date" := 0D;
- NewOrderDate := WorkDate();
- OnInitRecordOnBeforeAssignOrderDate(Rec, NewOrderDate);
- "Order Date" := NewOrderDate;
- UpdateDocumentDateFromLinkedPostingDate(false);
- if Rec."Document Date" = 0D then
- "Document Date" := WorkDate();
- if "Document Type" = "Document Type"::Quote then
- CalcQuoteValidUntilDate();
-
- if "Sell-to Customer No." <> '' then
- GetCust("Sell-to Customer No.");
- LocationCode := Customer."Location Code";
- AltCustVATRegFacade.Init(Rec, xRec);
- if "Ship-to Code" <> '' then begin
- ShipToAddress.SetLoadFields("Location Code");
- if ShipToAddress.Get("Sell-to Customer No.", "Ship-to Code") then
- if ShipToAddress."Location Code" <> '' then
- LocationCode := ShipToAddress."Location Code";
- end;
- UpdateLocationCode(LocationCode);
-
- if IsCreditDocType() then begin
- GLSetup.Get();
- Correction := GLSetup."Mark Cr. Memos as Corrections";
- end;
-
- InitVATDate();
- InitPostingDescription();
-
- UpdateOutboundWhseHandlingTime();
-
- IsHandled := false;
- OnInitRecordOnBeforeAssignResponsibilityCenter(Rec, IsHandled);
- if not IsHandled then
- "Responsibility Center" := UserSetupMgt.GetRespCenter(0, "Responsibility Center");
-
- IsHandled := false;
- OnInitRecordOnBeforeGetNextArchiveDocOccurrenceNo(Rec, IsHandled);
- if (not IsHandled) and (not SkipDocNoOccurrenceReset) then
- "Doc. No. Occurrence" := ArchiveManagement.GetNextOccurrenceNo(DATABASE::"Sales Header", Rec."Document Type".AsInteger(), Rec."No.");
- SkipDocNoOccurrenceReset := false;
-
- OnAfterInitRecord(Rec);
- end;
-
- local procedure InitShipmentDate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnInitRecordOnBeforeAssignShipmentDate(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "Document Type" in ["Document Type"::Order, "Document Type"::Invoice, "Document Type"::Quote] then
- "Shipment Date" := WorkDate();
- end;
-
- local procedure InitVATDate()
- begin
- "VAT Reporting Date" := GLSetup.GetVATDate("Posting Date", "Document Date");
- end;
-
- local procedure InitPostingDate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnInitRecordOnBeforeAssignWorkDateToPostingDate(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if not ("Document Type" in ["Document Type"::"Blanket Order", "Document Type"::Quote]) and
- ("Posting Date" = 0D)
- then
- "Posting Date" := WorkDate();
- end;
-
- local procedure InitializeRoundingPrecision(var Currency: Record Currency)
- begin
- if "Currency Code" = '' then
- Currency.InitRoundingPrecision()
- else
- Currency.Get("Currency Code");
-
- OnAfterInitializeRoundingPrecision(Rec, Currency);
- end;
-
- local procedure InitNoSeries()
- begin
- if xRec."Shipping No." <> '' then begin
- "Shipping No. Series" := xRec."Shipping No. Series";
- "Shipping No." := xRec."Shipping No.";
- end;
- if xRec."Posting No." <> '' then begin
- "Posting No. Series" := xRec."Posting No. Series";
- "Posting No." := xRec."Posting No.";
- end;
- if xRec."Return Receipt No." <> '' then begin
- "Return Receipt No. Series" := xRec."Return Receipt No. Series";
- "Return Receipt No." := xRec."Return Receipt No.";
- end;
- if xRec."Prepayment No." <> '' then begin
- "Prepayment No. Series" := xRec."Prepayment No. Series";
- "Prepayment No." := xRec."Prepayment No.";
- end;
- if xRec."Prepmt. Cr. Memo No." <> '' then begin
- "Prepmt. Cr. Memo No. Series" := xRec."Prepmt. Cr. Memo No. Series";
- "Prepmt. Cr. Memo No." := xRec."Prepmt. Cr. Memo No.";
- end;
-
- OnAfterInitNoSeries(Rec, xRec);
- end;
-
- ///
- /// Initializes the posting description with formatted document type and number text for the sales header.
- ///
- procedure InitPostingDescription()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInitPostingDescription(Rec, IsHandled);
- if IsHandled then
- exit;
-
- "Posting Description" := Format("Document Type") + ' ' + "No.";
- end;
-
- ///
- /// Sets global StandardCodesMgtGlobal codeunit to a new instance.
- ///
- ///
- /// StandardCodesMgtGlobal codeunit is used to check whether sales recurring lines should be applied for sales document,
- /// if necessary, creates a sales line on insert sales header.
- ///
- /// The new codeunit instance to set.
- procedure SetStandardCodesMgt(var StandardCodesMgtNew: Codeunit "Standard Codes Mgt.")
- begin
- StandardCodesMgtGlobal := StandardCodesMgtNew;
- end;
-
- ///
- /// Opens a page to select related number series for the sales header and updates the document number with the selected number series.
- ///
- ///
- /// Sales header record before the change. The no series code from this record will be highlighted by default on the open page.
- ///
- /// True if the document number has changed, otherwise false.
- procedure AssistEdit(OldSalesHeader: Record "Sales Header") Result: Boolean
- var
- SalesHeader2: Record "Sales Header";
- NoSeries: Codeunit "No. Series";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeAssistEdit(Rec, OldSalesHeader, IsHandled, Result);
- if IsHandled then
- exit;
-
- SalesHeader.Copy(Rec);
- GetSalesSetup();
- SalesHeader.TestNoSeries();
- if NoSeries.LookupRelatedNoSeries(SalesHeader.GetNoSeriesCode(), OldSalesHeader."No. Series", SalesHeader."No. Series") then begin
- if (SalesHeader."Sell-to Customer No." = '') and (SalesHeader."Sell-to Contact No." = '') then begin
- HideCreditCheckDialogue := false;
- Rec.CheckCreditMaxBeforeInsert();
- HideCreditCheckDialogue := true;
- end;
- SalesHeader."No." := NoSeries.GetNextNo(SalesHeader."No. Series");
- if SalesHeader2.Get(SalesHeader."Document Type", SalesHeader."No.") then
- Error(Text051, LowerCase(Format(SalesHeader."Document Type")), SalesHeader."No.");
- Rec := SalesHeader;
- exit(true);
- end;
- end;
-
- ///
- /// Checks if the number series for different types of sales documents are filled in the sales setup.
- ///
- procedure TestNoSeries()
- var
- IsHandled: Boolean;
- begin
- GetSalesSetup();
- IsHandled := false;
- OnBeforeTestNoSeries(Rec, IsHandled);
- if not IsHandled then begin
- case "Document Type" of
- "Document Type"::Quote:
- SalesSetup.TestField("Quote Nos.");
- "Document Type"::Order:
- SalesSetup.TestField("Order Nos.");
- "Document Type"::Invoice:
- SalesSetup.TestField("Invoice Nos.");
- "Document Type"::"Return Order":
- SalesSetup.TestField("Return Order Nos.");
- "Document Type"::"Credit Memo":
- SalesSetup.TestField("Credit Memo Nos.");
- "Document Type"::"Blanket Order":
- SalesSetup.TestField("Blanket Order Nos.");
- end;
- GLSetup.GetRecordOnce();
- if not GLSetup."Journal Templ. Name Mandatory" then
- case "Document Type" of
- "Document Type"::Invoice:
- SalesSetup.TestField("Posted Invoice Nos.");
- "Document Type"::"Credit Memo":
- SalesSetup.TestField("Posted Credit Memo Nos.");
- end
- else begin
- SalesSetup.GetRecordOnce();
- if not IsCreditDocType() then begin
- SalesSetup.TestField("S. Invoice Template Name");
- if "Journal Templ. Name" = '' then
- GenJournalTemplate.Get(SalesSetup."S. Invoice Template Name")
- else
- GenJournalTemplate.Get("Journal Templ. Name");
- end else begin
- SalesSetup.TestField("S. Cr. Memo Template Name");
- if "Journal Templ. Name" = '' then
- GenJournalTemplate.Get(SalesSetup."S. Cr. Memo Template Name")
- else
- GenJournalTemplate.Get("Journal Templ. Name");
- end;
- GenJournalTemplate.TestField("Posting No. Series");
- GlobalNoSeries.Get(GenJournalTemplate."Posting No. Series");
- GlobalNoSeries.TestField("Default Nos.", true);
- end;
- end;
-
- OnAfterTestNoSeries(Rec, SalesSetup);
- end;
-
- ///
- /// Returns the number series code from the sales setup based on the document type of the sales header.
- ///
- /// Number series code.
- procedure GetNoSeriesCode(): Code[20]
- var
- NoSeries: Codeunit "No. Series";
- NoSeriesCode: Code[20];
- IsHandled: Boolean;
- begin
- GetSalesSetup();
- IsHandled := false;
- OnBeforeGetNoSeriesCode(Rec, SalesSetup, NoSeriesCode, IsHandled);
- if IsHandled then
- exit(NoSeriesCode);
-
- case "Document Type" of
- "Document Type"::Quote:
- NoSeriesCode := SalesSetup."Quote Nos.";
- "Document Type"::Order:
- NoSeriesCode := SalesSetup."Order Nos.";
- "Document Type"::Invoice:
- NoSeriesCode := SalesSetup."Invoice Nos.";
- "Document Type"::"Return Order":
- NoSeriesCode := SalesSetup."Return Order Nos.";
- "Document Type"::"Credit Memo":
- NoSeriesCode := SalesSetup."Credit Memo Nos.";
- "Document Type"::"Blanket Order":
- NoSeriesCode := SalesSetup."Blanket Order Nos.";
- end;
- OnAfterGetNoSeriesCode(Rec, SalesSetup, NoSeriesCode);
- if not SelectNoSeriesAllowed then
- exit(NoSeriesCode);
-
- if NoSeries.IsAutomatic(NoSeriesCode) then
- exit(NoSeriesCode);
-
- if NoSeries.HasRelatedSeries(NoSeriesCode) then
- if NoSeries.LookupRelatedNoSeries(NoSeriesCode, "No. Series") then
- exit("No. Series");
-
- exit(NoSeriesCode);
- end;
-
- local procedure GetPostingNoSeriesCode() PostingNos: Code[20]
- var
- IsHandled: Boolean;
- begin
- GetSalesSetup();
- IsHandled := false;
- OnBeforeGetPostingNoSeriesCode(Rec, SalesSetup, PostingNos, IsHandled);
- if IsHandled then
- exit;
-
- GLSetup.GetRecordOnce();
- if GLSetup."Journal Templ. Name Mandatory" then begin
- GenJournalTemplate.Get("Journal Templ. Name");
- PostingNos := GenJournalTemplate."Posting No. Series";
- end else
- if IsCreditDocType() then
- PostingNos := SalesSetup."Posted Credit Memo Nos."
- else
- PostingNos := SalesSetup."Posted Invoice Nos.";
-
- OnAfterGetPostingNoSeriesCode(Rec, PostingNos);
- end;
-
- local procedure GetPostingPrepaymentNoSeriesCode() PostingNos: Code[20]
- begin
- if IsCreditDocType() then
- PostingNos := SalesSetup."Posted Prepmt. Cr. Memo Nos."
- else
- PostingNos := SalesSetup."Posted Prepmt. Inv. Nos.";
-
- OnAfterGetPrepaymentPostingNoSeriesCode(Rec, PostingNos);
- end;
-
- ///
- /// Checks if the number series has to be assigned chronologically after various documents are already posted.
- ///
- /// Posted document number.
- /// Number series code to check.
- /// Posted document number field caption.
- /// Number series field caption.
- procedure TestNoSeriesDate(No: Code[20]; NoSeriesCode: Code[20]; NoCapt: Text[1024]; NoSeriesCapt: Text[1024])
- begin
- if (No <> '') and (NoSeriesCode <> '') then begin
- GlobalNoSeries.Get(NoSeriesCode);
- if GlobalNoSeries."Date Order" then
- Error(
- Text045,
- FieldCaption("Posting Date"), NoSeriesCapt, NoSeriesCode,
- GlobalNoSeries.FieldCaption("Date Order"), GlobalNoSeries."Date Order", "Document Type",
- NoCapt, No);
- end;
- end;
-
- ///
- /// Opens a confirmation dialog to confirm the deletion of the sales header.
- /// This check is to confirm with the user that gaps will happen in the posted documents if the document is deleted.
- ///
- /// True if sales header should be deleted, otherwise false.
- procedure ConfirmDeletion() Result: Boolean
- var
- SourceCode: Record "Source Code";
- SourceCodeSetup: Record "Source Code Setup";
- PostSalesDelete: Codeunit "PostSales-Delete";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeConfirmDeletion(Rec, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- SourceCodeSetup.Get();
- SourceCodeSetup.TestField("Deleted Document");
- SourceCode.Get(SourceCodeSetup."Deleted Document");
-
- PostSalesDelete.InitDeleteHeader(
- Rec, SalesShptHeader, SalesInvHeader, SalesCrMemoHeader, ReturnRcptHeader,
- SalesInvHeaderPrepmt, SalesCrMemoHeaderPrepmt, SourceCode.Code);
-
- exit(CheckNoAndShowConfirm(SourceCode));
- end;
-
- local procedure EnsureDocumentTypeIsQuote()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeEnsureDocumentTypeIsQuote(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- TestField("Document Type", "Document Type"::Quote);
- end;
-
- local procedure CheckNoAndShowConfirm(SourceCode: Record "Source Code") Result: Boolean
- var
- ConfirmManagement: Codeunit "Confirm Management";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckNoAndShowConfirm(Rec, SalesShptHeader, SalesInvHeader, SalesCrMemoHeader, ReturnRcptHeader, SalesInvHeaderPrepmt, SalesCrMemoHeaderPrepmt, SourceCode, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if SalesShptHeader."No." <> '' then
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text009, SalesShptHeader."No."), true) then
- exit;
- if SalesInvHeader."No." <> '' then
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text012, SalesInvHeader."No."), true) then
- exit;
- if SalesCrMemoHeader."No." <> '' then
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text014, SalesCrMemoHeader."No."), true) then
- exit;
- if ReturnRcptHeader."No." <> '' then
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text030, ReturnRcptHeader."No."), true) then
- exit;
- if "Prepayment No." <> '' then
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text056, SalesInvHeaderPrepmt."No."), true) then
- exit;
- if "Prepmt. Cr. Memo No." <> '' then
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text057, SalesCrMemoHeaderPrepmt."No."), true) then
- exit;
- exit(true);
- end;
-
- ///
- /// Updates the global Customer record. Record will not be retrieved if document type is quote and provided customer no is blank.
- ///
- /// Customer number to retrieve the record for.
- /// Retrieved customer record.
- procedure GetCust(CustNo: Code[20]): Record Customer
- begin
- OnBeforeGetCust(Rec, Customer, CustNo);
-
- if not (("Document Type" = "Document Type"::Quote) and (CustNo = '')) then begin
- if CustNo <> Customer."No." then
- Customer.Get(CustNo);
- end else
- Clear(Customer);
-
- exit(Customer);
- end;
-
- local procedure GetSalesSetup()
- begin
- SalesSetup.Get();
- OnAfterGetSalesSetup(Rec, SalesSetup, CurrFieldNo);
- end;
-
- ///
- /// Checks if any sales lines exists for sales header.
- ///
- /// True if sales lines exists, otherwise false.
- procedure SalesLinesExist(): Boolean
- var
- IsHandled: Boolean;
- Result: Boolean;
- begin
- IsHandled := false;
- OnBeforeSalesLinesExist(Rec, IsHandled, Result);
- if IsHandled then
- exit(Result);
-
- SalesLine.Reset();
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
- exit(not SalesLine.IsEmpty());
- end;
-
- local procedure ResetInvoiceDiscountValue()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeResetInvoiceDiscountValue(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "Invoice Discount Value" <> 0 then begin
- CalcFields("Invoice Discount Amount");
- if "Invoice Discount Amount" = 0 then
- "Invoice Discount Value" := 0;
- end;
- end;
-
- ///
- /// Recreates sales lines for a sales document when the provided field in the sales header is changed.
- ///
- ///
- /// Opens confirmation dialog to confirm the deletion of existing sales lines
- /// and then recreates the sales lines based on the new information in the sales header.
- /// It also handles item charge assignments and extended text lines.
- ///
- ///
- /// Name of the field that is changed.
- /// This name is used only in error messages and confirmation dialogs.
- ///
- procedure RecreateSalesLines(ChangedFieldName: Text[100])
- var
- TempSalesLine: Record "Sales Line" temporary;
- ItemChargeAssgntSales: Record "Item Charge Assignment (Sales)";
- TempItemChargeAssgntSales: Record "Item Charge Assignment (Sales)" temporary;
- TempInteger: Record "Integer" temporary;
- TempATOLink: Record "Assemble-to-Order Link" temporary;
- SalesCommentLine: Record "Sales Comment Line";
- TempSalesCommentLine: Record "Sales Comment Line" temporary;
- TempReqLine: Record "Requisition Line" temporary;
- ATOLink: Record "Assemble-to-Order Link";
- ExtendedTextAdded: Boolean;
- ConfirmText: Text;
- IsHandled: Boolean;
- begin
- if not SalesLinesExist() then
- exit;
-
- IsHandled := false;
- OnBeforeRecreateSalesLinesHandler(Rec, xRec, ChangedFieldName, IsHandled);
- if IsHandled then
- exit;
-
- IsHandled := false;
- OnRecreateSalesLinesOnBeforeConfirm(Rec, xRec, ChangedFieldName, HideValidationDialog, Confirmed, IsHandled);
- if not IsHandled then
- if GetHideValidationDialog() or not GuiAllowed() then
- Confirmed := true
- else begin
- if HasItemChargeAssignment() then
- ConfirmText := ResetItemChargeAssignMsg
- else
- ConfirmText := RecreateSalesLinesMsg;
- Confirmed := Confirm(ConfirmText, false, ChangedFieldName);
- end;
-
- if Confirmed then begin
- SalesLine.LockTable();
- ItemChargeAssgntSales.LockTable();
- ReservEntry.LockTable();
- Modify();
- OnBeforeRecreateSalesLines(Rec);
- SalesLine.Reset();
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
- OnRecreateSalesLinesOnAfterSetSalesLineFilters(SalesLine, Rec);
- if SalesLine.FindSet() then begin
- OnRecreateSalesLinesOnAfterFindSalesLine(Rec, SalesLine, ChangedFieldName);
- TempReservEntry.DeleteAll();
- RecreateReservEntryReqLine(TempSalesLine, TempATOLink, ATOLink, TempReqLine);
- StoreSalesCommentLineToTemp(TempSalesCommentLine);
- SalesCommentLine.DeleteComments("Document Type".AsInteger(), "No.");
- TransferItemChargeAssgntSalesToTemp(ItemChargeAssgntSales, TempItemChargeAssgntSales);
- IsHandled := false;
- OnRecreateSalesLinesOnBeforeSalesLineDeleteAll(Rec, SalesLine, CurrFieldNo, IsHandled);
- if not IsHandled then
- SalesLine.DeleteAll(true);
-
- SalesLine.Init();
- SalesLine."Line No." := 0;
- OnRecreateSalesLinesOnBeforeTempSalesLineFindSet(TempSalesLine, SalesLine);
- TempSalesLine.FindSet();
- ExtendedTextAdded := false;
- SalesLine.BlockDynamicTracking(true);
- repeat
- RecreateSalesLinesHandleSupplementTypes(TempSalesLine, ExtendedTextAdded, TempItemChargeAssgntSales, TempInteger);
- RestoreSalesCommentLine(TempSalesCommentLine, TempSalesLine."Line No.", SalesLine."Line No.");
- OnRecreateSalesLinesOnBeforeCopyReservEntryFromTemp(SalesLine, TempSalesLine, Rec, xRec, ChangedFieldName);
- SalesLineReserve.CopyReservEntryFromTemp(TempReservEntry, TempSalesLine, SalesLine."Line No.");
- RecreateReqLine(TempReqLine, TempSalesLine, SalesLine."Line No.", false);
- SynchronizeForReservations(SalesLine, TempSalesLine);
-
- if TempATOLink.AsmExistsForSalesLine(TempSalesLine) then begin
- ATOLink := TempATOLink;
- ATOLink."Document Line No." := SalesLine."Line No.";
- ATOLink.Insert();
- ATOLink.UpdateAsmFromSalesLineATOExist(SalesLine);
- TempATOLink.Delete();
- end;
- until TempSalesLine.Next() = 0;
-
- OnRecreateSalesLinesOnAfterProcessTempSalesLines(TempSalesLine, Rec, xRec, ChangedFieldName);
-
- RestoreSalesCommentLine(TempSalesCommentLine, 0, 0);
-
- CreateItemChargeAssgntSales(TempItemChargeAssgntSales, TempSalesLine, TempInteger);
-
- TempSalesLine.SetRange(Type);
- TempSalesLine.DeleteAll();
- OnAfterDeleteAllTempSalesLines(Rec);
- ClearItemAssgntSalesFilter(TempItemChargeAssgntSales);
- TempItemChargeAssgntSales.DeleteAll();
- end;
- end else
- Error(RecreateSalesLinesCancelErr, ChangedFieldName);
-
- SalesLine.BlockDynamicTracking(false);
-
- OnAfterRecreateSalesLines(Rec, ChangedFieldName);
- end;
-
- local procedure RecreateSalesLinesHandleSupplementTypes(var TempSalesLine: Record "Sales Line" temporary; var ExtendedTextAdded: Boolean; var TempItemChargeAssgntSales: Record "Item Charge Assignment (Sales)" temporary; var TempInteger: Record "Integer" temporary)
- var
- TransferExtendedText: Codeunit "Transfer Extended Text";
- IsHandled: Boolean;
- ShouldCreateSalsesLine: Boolean;
- begin
- IsHandled := false;
- OnBeforeRecreateSalesLinesHandleSupplementTypes(TempSalesLine, IsHandled);
- if IsHandled then
- exit;
-
- ShouldCreateSalsesLine := not TempSalesLine.IsExtendedText();
- OnRecreateSalesLinesHandleSupplementTypesOnAfterCalcShouldCreateSalsesLine(TempSalesLine, ShouldCreateSalsesLine, SalesLine);
- if ShouldCreateSalsesLine then begin
- CreateSalesLine(TempSalesLine);
- ExtendedTextAdded := false;
- OnAfterRecreateSalesLine(SalesLine, TempSalesLine, Rec);
-
- if SalesLine.Type = SalesLine.Type::Item then
- RecreateSalesLinesFillItemChargeAssignment(SalesLine, TempSalesLine, TempItemChargeAssgntSales);
-
- if SalesLine.Type = SalesLine.Type::"Charge (Item)" then begin
- TempInteger.Init();
- TempInteger.Number := SalesLine."Line No.";
- TempInteger.Insert();
- end;
-
- OnRecreateSalesLinesHandleSupplementTypesOnAfterCreateSalesLine(Rec, SalesLine, TempSalesLine);
- end else
- if not ExtendedTextAdded then begin
- TransferExtendedText.SalesCheckIfAnyExtText(SalesLine, true);
- TransferExtendedText.InsertSalesExtText(SalesLine);
- OnAfterTransferExtendedTextForSalesLineRecreation(SalesLine, TempSalesLine);
-
- SalesLine.FindLast();
- ExtendedTextAdded := true;
- end;
-
- OnAfterRecreateSalesLinesHandleSupplementTypes(Rec);
- end;
-
- ///
- /// Inserts existing sales comment lines into a temporary record.
- ///
- /// Return value: Inserted sales comment lines.
- procedure StoreSalesCommentLineToTemp(var TempSalesCommentLine: Record "Sales Comment Line" temporary)
- var
- SalesCommentLine: Record "Sales Comment Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeStoreSalesCommentLineToTemp(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- SalesCommentLine.SetRange("Document Type", "Document Type");
- SalesCommentLine.SetRange("No.", "No.");
- if SalesCommentLine.FindSet() then
- repeat
- TempSalesCommentLine := SalesCommentLine;
- TempSalesCommentLine.Insert();
- until SalesCommentLine.Next() = 0;
- end;
-
- ///
- /// Inserts sales comment lines for the sales line of the document.
- /// Lines are inserted from the provided temporary sales comment line record set.
- ///
- /// Temporary sales comment line record set to insert.
- /// Previous sales line number.
- /// New sales line number.
- procedure RestoreSalesCommentLine(var TempSalesCommentLine: Record "Sales Comment Line" temporary; OldDocumnetLineNo: Integer; NewDocumentLineNo: Integer)
- var
- SalesCommentLine: Record "Sales Comment Line";
- begin
- TempSalesCommentLine.SetRange("Document Type", "Document Type");
- TempSalesCommentLine.SetRange("No.", "No.");
- TempSalesCommentLine.SetRange("Document Line No.", OldDocumnetLineNo);
- if TempSalesCommentLine.FindSet() then
- repeat
- SalesCommentLine := TempSalesCommentLine;
- SalesCommentLine."Document Line No." := NewDocumentLineNo;
- SalesCommentLine.Insert();
- until TempSalesCommentLine.Next() = 0;
- end;
-
- local procedure RecreateSalesLinesFillItemChargeAssignment(SalesLine: Record "Sales Line"; TempSalesLine: Record "Sales Line" temporary; var TempItemChargeAssgntSales: Record "Item Charge Assignment (Sales)" temporary)
- begin
- ClearItemAssgntSalesFilter(TempItemChargeAssgntSales);
- TempItemChargeAssgntSales.SetRange("Applies-to Doc. Type", TempSalesLine."Document Type");
- TempItemChargeAssgntSales.SetRange("Applies-to Doc. No.", TempSalesLine."Document No.");
- TempItemChargeAssgntSales.SetRange("Applies-to Doc. Line No.", TempSalesLine."Line No.");
- if TempItemChargeAssgntSales.FindSet() then
- repeat
- if not TempItemChargeAssgntSales.Mark() then begin
- TempItemChargeAssgntSales."Applies-to Doc. Line No." := SalesLine."Line No.";
- TempItemChargeAssgntSales.Description := SalesLine.Description;
- TempItemChargeAssgntSales.Modify();
- TempItemChargeAssgntSales.Mark(true);
- end;
- until TempItemChargeAssgntSales.Next() = 0;
- end;
-
- ///
- /// Displays a message if sales lines exist for the sales header and the changed field was not updated on the lines.
- ///
- ///
- /// Message states that the user must update the existing sales lines manually.
- ///
- /// Changed sales header field caption.
- procedure MessageIfSalesLinesExist(ChangedFieldName: Text[100])
- var
- MessageText: Text;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeMessageIfSalesLinesExist(Rec, ChangedFieldName, IsHandled);
- if IsHandled then
- exit;
-
- if SalesLinesExist() and not GetHideValidationDialog() then begin
- MessageText := StrSubstNo(LinesNotUpdatedMsg, ChangedFieldName);
- MessageText := StrSubstNo(SplitMessageTxt, MessageText, Text019);
- Message(MessageText);
- end;
- end;
-
- ///
- /// Displays a message to the user if there are existing sales lines and a provided field in the sales header has been changed,
- /// which might affect the prices and discounts on the sales lines.
- ///
- /// Changed sales header field caption.
- procedure PriceMessageIfSalesLinesExist(ChangedFieldName: Text[100])
- var
- MessageText: Text;
- IsHandled: Boolean;
- begin
- OnBeforePriceMessageIfSalesLinesExist(Rec, ChangedFieldName, IsHandled);
- if IsHandled then
- exit;
-
- if SalesLinesExist() and not GetHideValidationDialog() then begin
- MessageText := StrSubstNo(LinesNotUpdatedDateMsg, ChangedFieldName);
- if "Currency Code" <> '' then
- MessageText := StrSubstNo(SplitMessageTxt, MessageText, AffectExchangeRateMsg);
- Message(MessageText);
- end;
- end;
-
- ///
- /// Updates currency factor on the sales header and recreates sales lines if the currency code has changed.
- ///
- procedure UpdateCurrencyFactor()
- var
- UpdateCurrencyExchangeRates: Codeunit "Update Currency Exchange Rates";
- Updated: Boolean;
- begin
- OnBeforeUpdateCurrencyFactor(Rec, Updated, CurrExchRate, xRec);
- if Updated then
- exit;
-
- if "Currency Code" <> '' then begin
- if Rec."Posting Date" <> 0D then
- CurrencyDate := "Posting Date"
- else
- CurrencyDate := WorkDate();
-
- if UpdateCurrencyExchangeRates.ExchangeRatesForCurrencyExist(CurrencyDate, "Currency Code") then begin
- "Currency Factor" := CurrExchRate.ExchangeRate(CurrencyDate, "Currency Code");
- if ("Currency Code" <> xRec."Currency Code") and (xRec."No." <> '') then
- RecreateSalesLines(FieldCaption("Currency Code"));
- end else
- UpdateCurrencyExchangeRates.ShowMissingExchangeRatesNotification("Currency Code");
- end else begin
- "Currency Factor" := 0;
- if "Currency Code" <> xRec."Currency Code" then
- RecreateSalesLines(FieldCaption("Currency Code"));
- end;
-
- OnAfterUpdateCurrencyFactor(Rec, GetHideValidationDialog());
- end;
-
- ///
- /// Updates currency factor on the sales header if confirmed by the user.
- ///
- procedure ConfirmCurrencyFactorUpdate()
- var
- IsHandled: Boolean;
- ForceConfirm: Boolean;
- begin
- IsHandled := false;
- ForceConfirm := false;
- OnBeforeConfirmUpdateCurrencyFactor(Rec, HideValidationDialog, xRec, IsHandled, ForceConfirm);
- if IsHandled then
- exit;
-
- if GetHideValidationDialog() or not GuiAllowed() or ForceConfirm then
- Confirmed := true
- else
- Confirmed := Confirm(Text021, false);
- if Confirmed then
- Validate("Currency Factor")
- else
- "Currency Factor" := xRec."Currency Factor";
-
- OnAfterConfirmCurrencyFactorUpdate(Rec, Confirmed);
- end;
-
- ///
- /// Sets the value of the global flag HideValidationDialog.
- ///
- ///
- /// Global flag HideValidationDialog is used to hide various confirmation/message/other dialogs.
- ///
- /// The new value to set.
- procedure SetHideValidationDialog(NewHideValidationDialog: Boolean)
- begin
- HideValidationDialog := NewHideValidationDialog;
- end;
-
- ///
- /// Returns the value of the global flag HideValidationDialog.
- ///
- ///
- /// Global flag HideValidationDialog is used to hide various confirmation/message/other dialogs.
- ///
- /// The value of the global flag HideValidationDialog.
- procedure GetHideValidationDialog(): Boolean
- begin
- exit(HideValidationDialog);
- end;
-
- ///
- /// Sets the value of the global flag HideCreditCheckDialogue.
- ///
- ///
- /// Global flag HideCreditCheckDialogue is used to hide exceeded credit limit notification in sales document.
- ///
- /// The new value to set.
- procedure SetHideCreditCheckDialogue(NewHideCreditCheckDialogue: Boolean)
- begin
- HideCreditCheckDialogue := NewHideCreditCheckDialogue;
- end;
-
- ///
- /// Returns the value of the global flag HideCreditCheckDialogue.
- ///
- ///
- /// Global flag HideCreditCheckDialogue is used to hide exceeded credit limit notification in sales document.
- ///
- /// The value of the global flag HideCreditCheckDialogue.
- procedure GetHideCreditCheckDialogue(): Boolean
- begin
- exit(HideCreditCheckDialogue);
- end;
-
- local procedure UpdateDirectDebitPmtTermsCode()
- var
- SEPADirectDebitMandate: Record "SEPA Direct Debit Mandate";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateDirectDebitPmtTermsCode(Rec, IsHandled, PaymentMethod);
- if IsHandled then
- exit;
-
- PaymentMethod.Init();
- if "Payment Method Code" <> '' then
- PaymentMethod.Get("Payment Method Code");
- if PaymentMethod."Direct Debit" then begin
- "Direct Debit Mandate ID" := SEPADirectDebitMandate.GetDefaultMandate("Bill-to Customer No.", "Due Date");
- if "Payment Terms Code" = '' then
- "Payment Terms Code" := PaymentMethod."Direct Debit Pmt. Terms Code";
- end else
- "Direct Debit Mandate ID" := '';
- end;
-
- ///
- /// Updates the location code with the specified location code. If it's empty, it takes location code from user setup management.
- ///
- /// New location code.
- procedure UpdateLocationCode(LocationCode: Code[10])
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateLocationCode(Rec, LocationCode, IsHandled);
- if not IsHandled then
- Validate("Location Code", UserSetupMgt.GetLocation(0, LocationCode, "Responsibility Center"));
- end;
-
- ///
- /// Updates sales lines to reflect changes in the sales header field.
- /// Optionally the confirmation is raised, for the user to confirm the update of lines.
- ///
- ///
- /// Field captions must not be duplicated in the sales header, otherwise an error will be raised.
- ///
- /// Changed sales header field caption.
- ///
- /// If true, a confirmation message is shown to update the lines, otherwise confirmation is not shown.
- ///
- procedure UpdateSalesLines(ChangedFieldName: Text[100]; AskQuestion: Boolean)
- var
- "Field": Record "Field";
- begin
- OnBeforeUpdateSalesLines(Rec, ChangedFieldName, AskQuestion);
-
- Field.SetRange(TableNo, DATABASE::"Sales Header");
- Field.SetRange("Field Caption", ChangedFieldName);
- Field.SetFilter(ObsoleteState, '<>%1', Field.ObsoleteState::Removed);
- Field.Find('-');
- if Field.Next() <> 0 then
- Error(DuplicatedCaptionsNotAllowedErr);
- UpdateSalesLinesByFieldNo(Field."No.", AskQuestion);
-
- OnAfterUpdateSalesLines(Rec);
- end;
-
- local procedure UpdateSalesLineAmounts()
- var
- SalesLine2: Record "Sales Line";
- IsHandled: Boolean;
- begin
- if Rec.IsTemporary() then begin
- Session.LogMessage('0000G92', SalesHeaderIsTemporaryLbl, Verbosity::Warning, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', SalesLinesCategoryLbl);
- exit;
- end;
-
- if IsNullGuid(Rec.SystemId) then begin
- Session.LogMessage('0000G93', SalesHeaderDoesNotExistLbl, Verbosity::Warning, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', SalesLinesCategoryLbl);
- exit;
- end;
-
- IsHandled := false;
- OnBeforeUpdateSalesLineAmounts(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- SalesLine2.Reset();
- SalesLine2.SetRange("Document Type", "Document Type");
- SalesLine2.SetRange("Document No.", "No.");
- SalesLine2.SetFilter(Type, '<>%1', SalesLine.Type::" ");
- SalesLine2.SetFilter(Quantity, '<>0');
- OnUpdateSalesLineAmountsOnAfterSalesLineSetFilters(Rec, SalesLine);
- SalesLine2.LockTable();
- LockTable();
- if SalesLine2.FindSet() then begin
- if not Rec.Modify() then begin
- Session.LogMessage('0000G94', SalesHeaderCannotModifyLbl, Verbosity::Warning, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', SalesLinesCategoryLbl);
- exit;
- end;
- OnUpdateSalesLineAmountsOnAfterSalesHeaderModify(Rec, SalesLine2);
- repeat
- if (SalesLine2."Quantity Invoiced" <> SalesLine2.Quantity) or
- ("Shipping Advice" = "Shipping Advice"::Complete) or
- (SalesLine2.Type <> SalesLine.Type::"Charge (Item)") or
- (CurrFieldNo <> 0)
- then begin
- SalesLine2.UpdateAmounts();
- SalesLine2.Modify();
- end;
- until SalesLine2.Next() = 0;
- end;
- end;
-
- ///
- /// Updates sales lines based on the provided field number.
- ///
- /// Changed field number.
- ///
- /// If true, confirmation message is shown to update the lines, otherwise confirmation is not shown.
- ///
- procedure UpdateSalesLinesByFieldNo(ChangedFieldNo: Integer; AskQuestion: Boolean)
- var
- "Field": Record "Field";
- JobTransferLine: Codeunit "Job Transfer Line";
- JobPostLine: Codeunit "Job Post-Line";
- Question: Text[250];
- IsHandled: Boolean;
- ShouldConfirmReservationDateConflict: Boolean;
- begin
- if Rec.IsTemporary() then begin
- Session.LogMessage('0000G95', SalesHeaderIsTemporaryLbl, Verbosity::Warning, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', SalesLinesCategoryLbl);
- exit;
- end;
-
- if IsNullGuid(Rec.SystemId) then begin
- Session.LogMessage('0000G96', SalesHeaderDoesNotExistLbl, Verbosity::Warning, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', SalesLinesCategoryLbl);
- exit;
- end;
-
- IsHandled := false;
- OnBeforeUpdateSalesLinesByFieldNo(Rec, ChangedFieldNo, AskQuestion, IsHandled, xRec, CurrFieldNo);
- if IsHandled then
- exit;
-
- if not SalesLinesExist() then
- exit;
-
- if not Field.Get(DATABASE::"Sales Header", ChangedFieldNo) then
- Field.Get(DATABASE::"Sales Line", ChangedFieldNo);
-
- if AskQuestion then begin
- Question := StrSubstNo(Text031, Field."Field Caption");
- if GuiAllowed and not GetHideValidationDialog() then
- if DIALOG.Confirm(Question, true) then begin
- ShouldConfirmReservationDateConflict := ChangedFieldNo in [
- FieldNo("Shipment Date"),
- FieldNo("Shipping Agent Code"),
- FieldNo("Shipping Agent Service Code"),
- FieldNo("Shipping Time"),
- FieldNo("Requested Delivery Date"),
- FieldNo("Promised Delivery Date"),
- FieldNo("Outbound Whse. Handling Time")
- ];
- OnUpdateSalesLinesByFieldNoOnAfterCalcShouldConfirmReservationDateConflict(Rec, ChangedFieldNo, ShouldConfirmReservationDateConflict);
- if ShouldConfirmReservationDateConflict then
- ConfirmReservationDateConflict();
- end else
- exit
- end;
-
- SalesLine.LockTable();
- if not Rec.Modify() then begin
- Session.LogMessage('0000G97', SalesHeaderCannotModifyLbl, Verbosity::Warning, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', SalesLinesCategoryLbl);
- exit;
- end;
-
- SalesLine.Reset();
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
- OnUpdateSalesLinesByFieldNoOnAfterSalesLineSetFilters(Rec, xRec, SalesLine, ChangedFieldNo);
- if SalesLine.FindSet() then
- repeat
- IsHandled := false;
- OnBeforeSalesLineByChangedFieldNo(Rec, SalesLine, ChangedFieldNo, IsHandled, xRec, CurrFieldNo);
- if not IsHandled then
- case ChangedFieldNo of
- FieldNo("Shipment Date"):
- if SalesLine."No." <> '' then
- SalesLine.Validate("Shipment Date", "Shipment Date");
- FieldNo("Currency Factor"):
- if SalesLine.Type <> SalesLine.Type::" " then begin
- if SalesLine."Line Discount %" <> 0 then
- SalesLine.Validate("Unit Price");
- SalesLine.Validate("Unit Cost (LCY)");
- if SalesLine."Job No." <> '' then
- JobTransferLine.FromSalesHeaderToPlanningLine(SalesLine, "Currency Factor");
- end;
- FieldNo("Transaction Type"):
- SalesLine.Validate("Transaction Type", "Transaction Type");
- FieldNo("Transport Method"):
- SalesLine.Validate("Transport Method", "Transport Method");
- FieldNo("Exit Point"):
- SalesLine.Validate("Exit Point", "Exit Point");
- FieldNo(Area):
- SalesLine.Validate(Area, Area);
- FieldNo("Transaction Specification"):
- SalesLine.Validate("Transaction Specification", "Transaction Specification");
- FieldNo("Shipping Agent Code"):
- SalesLine.Validate("Shipping Agent Code", "Shipping Agent Code");
- FieldNo("Shipping Agent Service Code"):
- if (SalesLine."No." <> '') and (SalesLine."Shipping Agent Code" <> '') then begin
- if SalesLine."Shipping Agent Code" <> "Shipping Agent Code" then
- SalesLine.Validate("Shipping Agent Code", "Shipping Agent Code");
- SalesLine.Validate("Shipping Agent Service Code", "Shipping Agent Service Code");
- end;
- FieldNo("Shipping Time"):
- if SalesLine."No." <> '' then
- SalesLine.Validate("Shipping Time", "Shipping Time");
- FieldNo("Prepayment %"):
- if SalesLine."No." <> '' then
- SalesLine.Validate("Prepayment %", "Prepayment %");
- FieldNo("Requested Delivery Date"):
- if SalesLine."No." <> '' then
- SalesLine.Validate("Requested Delivery Date", "Requested Delivery Date");
- FieldNo("Promised Delivery Date"):
- if SalesLine."No." <> '' then
- SalesLine.Validate("Promised Delivery Date", "Promised Delivery Date");
- FieldNo("Outbound Whse. Handling Time"):
- if SalesLine."No." <> '' then
- SalesLine.Validate("Outbound Whse. Handling Time", "Outbound Whse. Handling Time");
- SalesLine.FieldNo("Deferral Code"):
- if SalesLine."No." <> '' then
- SalesLine.Validate("Deferral Code");
- FieldNo("Campaign No."):
- if SalesLine."No." <> '' then begin
- if SalesLine."Job No." <> '' then
- JobPostLine.TestSalesLine(SalesLine);
- SalesLine.UpdateUnitPrice(0);
- end;
- else
- OnUpdateSalesLineByChangedFieldName(Rec, SalesLine, Field.FieldName, ChangedFieldNo, xRec);
- end;
- SalesLineReserve.AssignForPlanning(SalesLine);
- OnUpdateSalesLinesByFieldNoOnBeforeSalesLineModify(SalesLine, ChangedFieldNo, CurrFieldNo);
- SalesLine.Modify(true);
- until SalesLine.Next() = 0;
-
- OnAfterUpdateSalesLinesByFieldNo(Rec, xRec, ChangedFieldNo);
- end;
-
- ///
- /// Raises a confirmation informing the user that reservations may be canceled if the change in the field causes a date conflict.
- /// Confirmation is only raised if reservations exist. If not confirmed, the execution stops.
- ///
- procedure ConfirmReservationDateConflict()
- var
- ReservationEngineMgt: Codeunit "Reservation Engine Mgt.";
- begin
- if ReservationEngineMgt.ResvExistsForSalesHeader(Rec) then
- if not Confirm(Text063, false) then
- Error('');
- end;
-
- ///
- /// Creates and assigns dimensions for the sales header based on the provided default dimension sources.
- ///
- ///
- /// If sales lines exist and the dimension set has changed the dimensions are updated on the lines as well.
- ///
- /// The list of default dimension sources.
- procedure CreateDim(DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])
- var
- SourceCodeSetup: Record "Source Code Setup";
- OldDimSetID: Integer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateDim(Rec, IsHandled, DefaultDimSource);
- if IsHandled then
- exit;
-
- SourceCodeSetup.Get();
-
- "Shortcut Dimension 1 Code" := '';
- "Shortcut Dimension 2 Code" := '';
- OldDimSetID := "Dimension Set ID";
- "Dimension Set ID" :=
- DimMgt.GetRecDefaultDimID(
- Rec, CurrFieldNo, DefaultDimSource, SourceCodeSetup.Sales, "Shortcut Dimension 1 Code", "Shortcut Dimension 2 Code", 0, 0);
-
- OnCreateDimOnBeforeUpdateLines(Rec, xRec, CurrFieldNo, OldDimSetID, DefaultDimSource);
-
- if (OldDimSetID <> "Dimension Set ID") and (OldDimSetID <> 0) and GuiAllowed and not GetHideValidationDialog() then
- if CouldDimensionsBeKept() then
- if not ConfirmKeepExistingDimensions(OldDimSetID) then begin
- "Dimension Set ID" := OldDimSetID;
- DimMgt.UpdateGlobalDimFromDimSetID(Rec."Dimension Set ID", Rec."Shortcut Dimension 1 Code", Rec."Shortcut Dimension 2 Code");
- OnCreateDimOnKeepDimensionsOnAfterUpdateGlobalDim(Rec, xRec, CurrFieldNo, OldDimSetID);
- end;
-
- if (OldDimSetID <> "Dimension Set ID") and SalesLinesExist() then begin
- OnCreateDimOnBeforeModify(Rec, xRec, CurrFieldNo, OldDimSetID);
- Modify();
- UpdateAllLineDim("Dimension Set ID", OldDimSetID);
- end;
- end;
-
- local procedure ConfirmKeepExistingDimensions(OldDimSetID: Integer) Confirmed: Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeConfirmKeepExistingDimensions(Rec, xRec, CurrFieldNo, OldDimSetID, Confirmed, IsHandled);
- if IsHandled then
- exit(Confirmed);
-
- Confirmed := Confirm(DoYouWantToKeepExistingDimensionsQst);
- end;
-
- local procedure CouldDimensionsBeKept() Result: Boolean;
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCouldDimensionsBeKept(Rec, xRec, Result, IsHandled);
- if not IsHandled then begin
- if (xRec."Sell-to Customer No." <> '') and (xRec."Sell-to Customer No." <> Rec."Sell-to Customer No.") then
- exit(false);
- if (xRec."Bill-to Customer No." <> '') and (xRec."Bill-to Customer No." <> Rec."Bill-to Customer No.") then
- exit(false);
-
- if (xRec."Location Code" <> Rec."Location Code") and (xRec."Bill-to Customer No." <> '') then
- exit(true);
- if (xRec."Salesperson Code" <> '') and (xRec."Salesperson Code" <> Rec."Salesperson Code") then
- exit(true);
- if (xRec."Responsibility Center" <> '') and (xRec."Responsibility Center" <> Rec."Responsibility Center") then
- exit(true);
- end;
- OnAfterCouldDimensionsBeKept(Rec, xRec, Result);
- end;
-
- ///
- /// Verifies whether the provided shortcut dimension code and value are valid.
- /// If valid, assigns it to the sales document.
- ///
- ///
- /// If sales lines exist, the dimensions are updated on the lines as well.
- ///
- /// Number of the shortcut dimension.
- /// Value of the shortcut dimension.
- procedure ValidateShortcutDimCode(FieldNumber: Integer; var ShortcutDimCode: Code[20])
- var
- OldDimSetID: Integer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShortcutDimCode(Rec, xRec, FieldNumber, ShortcutDimCode, IsHandled);
- if IsHandled then
- exit;
-
- OldDimSetID := "Dimension Set ID";
- DimMgt.ValidateShortcutDimValues(FieldNumber, ShortcutDimCode, "Dimension Set ID");
- if "No." <> '' then
- Modify();
-
- if OldDimSetID <> "Dimension Set ID" then begin
- OnValidateShortcutDimCodeOnBeforeUpdateAllLineDim(Rec, xRec, FieldNumber);
- if not IsNullGuid(Rec.SystemId) then
- Modify();
- if SalesLinesExist() then
- UpdateAllLineDim("Dimension Set ID", OldDimSetID);
- end;
-
- OnAfterValidateShortcutDimCode(Rec, xRec, FieldNumber, ShortcutDimCode);
- end;
-
- ///
- /// Determines if sales lines that are already shipped exist.
- ///
- /// True if shipped sales lines exists, otherwise false.
- procedure ShippedSalesLinesExist(): Boolean
- begin
- SalesLine.Reset();
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
- SalesLine.SetFilter("Quantity Shipped", '<>0');
- exit(SalesLine.FindFirst());
- end;
-
- ///
- /// Determines if sales lines that are already returned exist.
- ///
- /// True if return receipt exists, otherwise false.
- procedure ReturnReceiptExist(): Boolean
- begin
- SalesLine.Reset();
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
- SalesLine.SetFilter("Return Qty. Received", '<>0');
- exit(SalesLine.FindFirst());
- end;
-
- ///
- /// Deletes all sales lines, reservation, and comment lines for the document.
- ///
- procedure DeleteAllSalesLines()
- var
- SalesCommentLine: Record "Sales Comment Line";
- begin
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
- SalesLine.SetRange(Type, SalesLine.Type::"Charge (Item)");
-
- DeleteSalesLines();
- SalesLine.SetRange(Type);
- DeleteSalesLines();
-
- SalesCommentLine.SetRange("Document Type", "Document Type");
- SalesCommentLine.SetRange("No.", "No.");
- SalesCommentLine.DeleteAll();
- end;
-
- local procedure DeleteSalesLines()
- var
- ReservMgt: Codeunit "Reservation Management";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeDeleteSalesLines(SalesLine, IsHandled, Rec);
- if not IsHandled then
- if SalesLine.FindSet() then begin
- ReservMgt.DeleteDocumentReservation(DATABASE::"Sales Line", "Document Type".AsInteger(), "No.", GetHideValidationDialog());
- repeat
- SalesLine.SuspendStatusCheck(true);
- OnDeleteSalesLinesOnBeforeDeleteLine(SalesLine);
- SalesLine.Delete(true);
- until SalesLine.Next() = 0;
- end;
- OnAfterDeleteSalesLines(SalesLine, Rec);
- end;
-
- local procedure DeleteRecordInApprovalRequest()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeDeleteRecordInApprovalRequest(Rec, IsHandled);
- if IsHandled then
- exit;
-
- ApprovalsMgmt.OnDeleteRecordInApprovalRequest(RecordId);
- end;
-
- local procedure ClearItemAssgntSalesFilter(var TempItemChargeAssgntSales: Record "Item Charge Assignment (Sales)" temporary)
- begin
- TempItemChargeAssgntSales.SetRange("Document Line No.");
- TempItemChargeAssgntSales.SetRange("Applies-to Doc. Type");
- TempItemChargeAssgntSales.SetRange("Applies-to Doc. No.");
- TempItemChargeAssgntSales.SetRange("Applies-to Doc. Line No.");
- end;
-
- ///
- /// Checks if sell-to and bill-to customer numbers are filled. If not, it creates customers based on the associated
- /// contact and customer template, and assigns the new customer number to the document.
- ///
- ///
- /// The transaction is committed after each customer record is created.
- /// Procedure are used in release sales quote or make order from quote processes.
- ///
- /// If set to true, a confirmation dialog to create a customer will be shown, otherwise not.
- /// True if sell-to and bill-to customer numbers are filled, otherwise false.
- procedure CheckCustomerCreated(Prompt: Boolean): Boolean
- var
- Cont: Record Contact;
- ConfirmManagement: Codeunit "Confirm Management";
- IsHandled, Result : Boolean;
- begin
- if ("Bill-to Customer No." <> '') and ("Sell-to Customer No." <> '') then
- exit(true);
-
- IsHandled := false;
- OnCheckCustomerCreatedOnBeforeConfirmProcess(Rec, Prompt, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if Prompt then
- if not ConfirmManagement.GetResponseOrDefault(Text035, true) then
- exit(false);
-
- OnCheckCustomerCreatedOnAfterConfirmProcess(Rec);
-
- if "Sell-to Customer No." = '' then begin
- TestField("Sell-to Contact No.");
- TestField("Sell-to Customer Templ. Code");
- GetContact(Cont, "Sell-to Contact No.");
- CreateCustomerFromSellToCustomerTemplate(Cont);
- Commit();
- Get("Document Type"::Quote, "No.");
- end;
-
- if "Bill-to Customer No." = '' then begin
- TestField("Bill-to Contact No.");
- TestField("Bill-to Customer Templ. Code");
- GetContact(Cont, "Bill-to Contact No.");
- CreateCustomerFromBillToCustomerTemplate(Cont);
- Commit();
- Get("Document Type"::Quote, "No.");
- end;
-
- exit(("Bill-to Customer No." <> '') and ("Sell-to Customer No." <> ''));
- end;
-
- local procedure CreateCustomerFromSellToCustomerTemplate(Cont: Record Contact)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateCustomerFromSellToCustomerTemplate(Rec, Cont, IsHandled);
- if IsHandled then
- exit;
-
- Cont.CreateCustomerFromTemplate("Sell-to Customer Templ. Code");
- end;
-
- local procedure CreateCustomerFromBillToCustomerTemplate(Cont: Record Contact)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateCustomerFromBillToCustomerTemplate(Rec, Cont, IsHandled);
- if IsHandled then
- exit;
-
- Cont.CreateCustomerFromTemplate("Bill-to Customer Templ. Code");
- end;
-
- local procedure CreateDimensionsFromValidateBillToCustomerNo()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateDimensionsFromValidateBillToCustomerNo(Rec, IsHandled);
- if IsHandled then
- exit;
-
- CreateDimFromDefaultDim(Rec.FieldNo("Bill-to Customer No."));
- end;
-
- local procedure CreateDimensionsFromValidateSalesPersonCode()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateDimensionsFromValidateSalesPersonCode(Rec, IsHandled);
- if IsHandled then
- exit;
-
- CreateDimFromDefaultDim(Rec.FieldNo("Salesperson Code"));
- end;
-
- local procedure CheckShipmentInfo(var SalesLine: Record "Sales Line"; BillTo: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckShipmentInfo(Rec, xRec, SalesLine, BillTo, IsHandled);
- if IsHandled then
- exit;
-
- if "Document Type" = "Document Type"::Order then
- SalesLine.SetFilter("Quantity Shipped", '<>0')
- else
- if "Document Type" = "Document Type"::Invoice then begin
- if not BillTo then
- SalesLine.SetRange("Sell-to Customer No.", xRec."Sell-to Customer No.");
- SalesLine.SetFilter("Shipment No.", '<>%1', '');
- end;
-
- if SalesLine.FindFirst() then
- if "Document Type" = "Document Type"::Order then
- TestQuantityShippedField(SalesLine)
- else
- SalesLine.TestField("Shipment No.", '');
- SalesLine.SetRange("Shipment No.");
- SalesLine.SetRange("Quantity Shipped");
- end;
-
- local procedure CheckPrepmtInfo(var SalesLine: Record "Sales Line")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckPrepmtInfo(Rec, xRec, SalesLine, IsHandled);
- if IsHandled then
- exit;
-
- if "Document Type" = "Document Type"::Order then begin
- SalesLine.SetFilter("Prepmt. Amt. Inv.", '<>0');
- if SalesLine.Find('-') then
- SalesLine.TestField("Prepmt. Amt. Inv.", 0);
- SalesLine.SetRange("Prepmt. Amt. Inv.");
- end;
- end;
-
- local procedure CheckReturnInfo(var SalesLine: Record "Sales Line"; BillTo: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckReturnInfo(Rec, IsHandled, xRec, BillTo);
- if IsHandled then
- exit;
-
- if "Document Type" = "Document Type"::"Return Order" then
- SalesLine.SetFilter("Return Qty. Received", '<>0')
- else
- if "Document Type" = "Document Type"::"Credit Memo" then begin
- if not BillTo then
- SalesLine.SetRange("Sell-to Customer No.", xRec."Sell-to Customer No.");
- SalesLine.SetFilter("Return Receipt No.", '<>%1', '');
- end;
-
- if SalesLine.FindFirst() then
- if "Document Type" = "Document Type"::"Return Order" then
- SalesLine.TestField("Return Qty. Received", 0)
- else
- SalesLine.TestField("Return Receipt No.", '');
- end;
-
- local procedure CopyFromNewSellToCustTemplate(SellToCustTemplate: Record "Customer Templ.")
- begin
- OnBeforeCopyFromNewSellToCustTemplate(Rec, xRec, SellToCustTemplate);
-
- if not ApplicationAreaMgmt.IsSalesTaxEnabled() then
- SellToCustTemplate.TestField("Gen. Bus. Posting Group");
- "Gen. Bus. Posting Group" := SellToCustTemplate."Gen. Bus. Posting Group";
- "VAT Bus. Posting Group" := SellToCustTemplate."VAT Bus. Posting Group";
- if "Bill-to Customer No." = '' then
- Validate("Bill-to Customer Templ. Code", "Sell-to Customer Templ. Code");
-
- OnAfterCopyFromNewSellToCustTemplate(Rec, SellToCustTemplate);
- end;
-
- ///
- /// Recreates requisition lines linked to a sales line, either shifting them to a temporary table or
- /// back based on the provided ToTemp flag, updating the order promising line ID in the process.
- ///
- ///
- /// Temporary requisition line table is defined as a local variable and the caller has no way to pass in / retrieve lines.
- /// Old requisition lines after recreation are deleted.
- ///
- /// Return value Temporary Requisition Line that contains the requisition lines that have been recreated.
- /// Sales line that is associated with the requisition lines that need to be recreated.
- /// New order promising line ID that should be assigned to the requisition lines when they are moved back from the temporary table to the main table.
- ///
- /// If true, the procedure moves the requisition lines to a temporary table,
- /// otherwise it moves the requisition lines back from the temporary table to the main table.
- ///
- procedure RecreateReqLine(var TempReqLine: Record "Requisition Line" temporary; OldSalesLine: Record "Sales Line"; NewSourceRefNo: Integer; ToTemp: Boolean)
- var
- ReqLine: Record "Requisition Line";
- begin
- if ("Document Type" = "Document Type"::Order) then
- if ToTemp then begin
- ReqLine.SetCurrentKey("Order Promising ID", "Order Promising Line ID", "Order Promising Line No.");
- ReqLine.SetRange("Order Promising ID", OldSalesLine."Document No.");
- ReqLine.SetRange("Order Promising Line ID", OldSalesLine."Line No.");
- if ReqLine.FindSet() then begin
- repeat
- TempReqLine := ReqLine;
- TempReqLine.Insert();
- until ReqLine.Next() = 0;
- ReqLine.DeleteAll();
- end;
- end else begin
- Clear(TempReqLine);
- TempReqLine.SetCurrentKey("Order Promising ID", "Order Promising Line ID", "Order Promising Line No.");
- TempReqLine.SetRange("Order Promising ID", OldSalesLine."Document No.");
- TempReqLine.SetRange("Order Promising Line ID", OldSalesLine."Line No.");
- if TempReqLine.FindSet() then begin
- repeat
- ReqLine := TempReqLine;
- ReqLine."Order Promising Line ID" := NewSourceRefNo;
- ReqLine.Insert();
- until TempReqLine.Next() = 0;
- TempReqLine.DeleteAll();
- end;
- end;
- end;
-
- ///
- /// Validates that the posting date matches the work date when posting date check is enabled in sales setup.
- ///
- /// Specifies whether the validation is called from batch posting. If true, an error is raised; otherwise, a confirmation dialog is shown.
- procedure TestPostingDate(BatchPost: Boolean)
- begin
- SalesSetup.Get();
- if not SalesSetup."Posting Date Check on Posting" then
- exit;
- if not GuiAllowed then
- exit;
- if "Posting Date" <> WorkDate() then begin
- if BatchPost then
- Error(DifferentDatesErr, "Posting Date", WorkDate());
- if not Confirm(DifferentDatesQst, false, "Posting Date", WorkDate()) then
- Error('');
- end;
- end;
-
- ///
- /// Updates the sell-to contact details of a sales header based on the provided customer number.
- ///
- ///
- /// If the contact linked to a specific business relation is found, sell-to contact information is updated from the contact.
- ///
- /// Customer number from which details are taken.
- procedure UpdateSellToCont(CustomerNo: Code[20])
- var
- ContBusRel: Record "Contact Business Relation";
- Cust: Record Customer;
- OfficeContact: Record Contact;
- OfficeMgt: Codeunit "Office Management";
- begin
- if OfficeMgt.GetContact(OfficeContact, CustomerNo) then begin
- HideValidationDialog := true;
- UpdateSellToCust(OfficeContact."No.");
- HideValidationDialog := false;
- end else
- if Cust.Get(CustomerNo) then begin
- if Cust."Primary Contact No." <> '' then
- "Sell-to Contact No." := Cust."Primary Contact No."
- else begin
- ContBusRel.Reset();
- ContBusRel.SetCurrentKey("Link to Table", "No.");
- ContBusRel.SetRange("Link to Table", ContBusRel."Link to Table"::Customer);
- ContBusRel.SetRange("No.", "Sell-to Customer No.");
- if ContBusRel.FindFirst() then
- "Sell-to Contact No." := ContBusRel."Contact No."
- else
- "Sell-to Contact No." := '';
- end;
- "Sell-to Contact" := Cust.Contact;
- end;
- if "Sell-to Contact No." <> '' then
- if OfficeContact.Get("Sell-to Contact No.") then begin
- OfficeContact.CheckIfPrivacyBlockedGeneric();
- if OfficeContact."E-Mail" <> '' then
- Validate("Sell-to E-Mail", OfficeContact."E-Mail");
- end;
-
- OnAfterUpdateSellToCont(Rec, Cust, OfficeContact, HideValidationDialog);
- end;
-
- ///
- /// Updates the bill-to contact details of a sales header based on the provided customer number.
- ///
- ///
- /// If the contact linked to a specific business relation is found, bill-to contact information is updated from the contact.
- ///
- /// Customer number from which details are taken.
- procedure UpdateBillToCont(CustomerNo: Code[20])
- var
- ContBusRel: Record "Contact Business Relation";
- Cust: Record Customer;
- Contact: Record Contact;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateBillToCont(Rec, CustomerNo, SkipBillToContact, IsHandled);
- if IsHandled then
- exit;
-
- if Cust.Get(CustomerNo) then begin
- if Cust."Primary Contact No." <> '' then
- "Bill-to Contact No." := Cust."Primary Contact No."
- else begin
- ContBusRel.Reset();
- ContBusRel.SetCurrentKey("Link to Table", "No.");
- ContBusRel.SetRange("Link to Table", ContBusRel."Link to Table"::Customer);
- ContBusRel.SetRange("No.", "Bill-to Customer No.");
- if ContBusRel.FindFirst() then
- "Bill-to Contact No." := ContBusRel."Contact No."
- else
- "Bill-to Contact No." := '';
- end;
- "Bill-to Contact" := Cust.Contact;
- end;
- if "Bill-to Contact No." <> '' then
- if Contact.Get("Bill-to Contact No.") then
- Contact.CheckIfPrivacyBlockedGeneric();
-
- OnAfterUpdateBillToCont(Rec, Cust, Contact);
- end;
-
- ///
- /// Updates the sell-to customer details of a sales header based on the provided contact number.
- ///
- ///
- /// If the contact linked to a specific business relation is found, sell-to customer information is updated from the contact.
- ///
- /// Contact number from which details are taken.
- procedure UpdateSellToCust(ContactNo: Code[20])
- var
- ContBusinessRelation: Record "Contact Business Relation";
- Customer: Record Customer;
- Cont: Record Contact;
- CustomerTempl: Record "Customer Templ.";
- SearchContact: Record Contact;
- ContactBusinessRelationFound: Boolean;
- IsHandled: Boolean;
- begin
- OnBeforeUpdateSellToCust(Rec, Cont, Customer, ContactNo);
-
- if not Cont.Get(ContactNo) then begin
- "Sell-to Contact" := '';
- exit;
- end;
- "Sell-to Contact No." := Cont."No.";
-
- IsHandled := false;
- OnUpdateSellToCustOnAfterSetSellToContactNo(Rec, Customer, Cont, IsHandled);
- if IsHandled then
- exit;
-
- if Cont.Type = Cont.Type::Person then
- ContactBusinessRelationFound := ContBusinessRelation.FindByContact(ContBusinessRelation."Link to Table"::Customer, Cont."No.");
- if not ContactBusinessRelationFound then begin
- IsHandled := false;
- OnUpdateSellToCustOnBeforeFindContactBusinessRelation(Cont, ContBusinessRelation, ContactBusinessRelationFound, IsHandled);
- if not IsHandled then
- ContactBusinessRelationFound :=
- ContBusinessRelation.FindByContact(ContBusinessRelation."Link to Table"::Customer, Cont."Company No.");
- end;
-
- OnUpdateSellToCustOnAfterFindContactBusinessRelation(Rec, Cont, ContBusinessRelation, ContactBusinessRelationFound);
-
- if ContactBusinessRelationFound then begin
- CheckCustomerContactRelation(Cont, "Sell-to Customer No.", ContBusinessRelation."No.");
-
- if "Sell-to Customer No." = '' then begin
- SkipSellToContact := true;
- Validate("Sell-to Customer No.", ContBusinessRelation."No.");
- SkipSellToContact := false;
- end;
-
- UpdateSellToEmail(Cont);
- Validate("Sell-to Phone No.", Cont."Phone No.");
- end else begin
- if "Document Type" = "Document Type"::Quote then begin
- if "Sell-to Customer No." <> '' then begin
- "Sell-to Customer No." := '';
- "Bill-to Customer No." := '';
- end;
- if not GetContactAsCompany(Cont, SearchContact) then
- SearchContact := Cont;
- "Sell-to Customer Name" := SearchContact."Company Name";
- "Sell-to Customer Name 2" := SearchContact."Name 2";
- "Sell-to Phone No." := SearchContact."Phone No.";
- "Sell-to E-Mail" := SearchContact."E-Mail";
- SetShipToAddress(
- SearchContact."Company Name", SearchContact."Name 2", SearchContact.Address, SearchContact."Address 2",
- SearchContact.City, SearchContact."Post Code", SearchContact.County, SearchContact."Country/Region Code");
- "Ship-to Phone No." := SearchContact."Phone No.";
- OnUpdateSellToCustOnAfterSetShipToAddress(Rec, SearchContact);
- if ("Sell-to Customer Templ. Code" = '') and (not CustomerTempl.IsEmpty) then
- Validate("Sell-to Customer Templ. Code", Cont.FindNewCustomerTemplate());
- OnUpdateSellToCustOnAfterSetFromSearchContact(Rec, SearchContact);
- end else begin
- IsHandled := false;
- OnUpdateSellToCustOnBeforeContactIsNotRelatedToAnyCostomerErr(Rec, Cont, ContBusinessRelation, IsHandled);
- if not IsHandled then
- Error(ContactIsNotRelatedToAnyCostomerErr, Cont."No.", Cont.Name);
- end;
-
- "Sell-to Contact" := Cont.Name;
- end;
-
- UpdateSellToCustContact(Customer, Cont);
-
- if "Document Type" = "Document Type"::Quote then begin
- if Customer.Get("Sell-to Customer No.") or Customer.Get(ContBusinessRelation."No.") then begin
- if Customer."Copy Sell-to Addr. to Qte From" = Customer."Copy Sell-to Addr. to Qte From"::Company then
- GetContactAsCompany(Cont, Cont);
- end else
- GetContactAsCompany(Cont, Cont);
- "Sell-to Address" := Cont.Address;
- "Sell-to Address 2" := Cont."Address 2";
- "Sell-to City" := Cont.City;
- "Sell-to Post Code" := Cont."Post Code";
- "Sell-to County" := Cont.County;
- "Sell-to Country/Region Code" := Cont."Country/Region Code";
- end;
- Clear(IsHandled);
- OnUpdateSellToCustOnBeforeValidateBillToContactNo(Rec, IsHandled);
- if not IsHandled then
- if ("Sell-to Customer No." = "Bill-to Customer No.") or
- ("Bill-to Customer No." = '')
- then
- Validate("Bill-to Contact No.", "Sell-to Contact No.");
-
- OnAfterUpdateSellToCust(Rec, Cont);
- end;
-
- local procedure UpdateSellToEmail(Contact: Record Contact)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateSellToEmail(Rec, Contact, IsHandled);
- if IsHandled then
- exit;
-
- if (Contact."E-Mail" = '') and ("Sell-to E-Mail" <> '') and GuiAllowed then begin
- if Confirm(ConfirmEmptyEmailQst, false, Contact."No.", "Sell-to E-Mail") then
- Validate("Sell-to E-Mail", Contact."E-Mail");
- end else
- Validate("Sell-to E-Mail", Contact."E-Mail");
- end;
-
- local procedure UpdateSellToCustContact(Customer: Record Customer; Cont: Record Contact)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateSellToCustContact(Rec, Cont, IsHandled);
- if IsHandled then
- exit;
-
- if (Cont.Type = Cont.Type::Company) and Customer.Get("Sell-to Customer No.") then
- "Sell-to Contact" := Customer.Contact
- else
- if Cont.Type = Cont.Type::Company then
- "Sell-to Contact" := ''
- else
- "Sell-to Contact" := Cont.Name;
- end;
-
- local procedure CheckCustomerContactRelation(Cont: Record Contact; CustomerNo: Code[20]; ContBusinessRelationNo: Code[20])
- var
- ContactBusinessRelationLinkType: Enum "Contact Business Relation Link To Table";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckCustomerContactRelation(Rec, Cont, IsHandled, CustomerNo, ContBusinessRelationNo);
- if IsHandled then
- exit;
-
- if (CustomerNo <> '') and (CustomerNo <> ContBusinessRelationNo) then
- if FindContactBusinessRelation(CustomerNo, Cont."Company No.", ContactBusinessRelationLinkType::Customer) then
- Error(Text037, Cont."No.", Cont.Name, CustomerNo);
- end;
-
- local procedure UpdateBillToCust(ContactNo: Code[20])
- var
- ContBusinessRelation: Record "Contact Business Relation";
- Cont: Record Contact;
- SearchContact: Record Contact;
- CustomerTempl: Record "Customer Templ.";
- ContactBusinessRelationFound: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateBillToCust(Rec, ContactNo, IsHandled);
- if IsHandled then
- exit;
-
- if not Cont.Get(ContactNo) then begin
- "Bill-to Contact" := '';
- exit;
- end;
- "Bill-to Contact No." := Cont."No.";
-
- UpdateBillToCustContact(Cont);
-
- if Cont.Type = Cont.Type::Person then
- ContactBusinessRelationFound := ContBusinessRelation.FindByContact(ContBusinessRelation."Link to Table"::Customer, Cont."No.");
- if not ContactBusinessRelationFound then begin
- IsHandled := false;
- OnUpdateBillToCustOnBeforeFindContactBusinessRelation(Cont, ContBusinessRelation, ContactBusinessRelationFound, IsHandled);
- if not IsHandled then
- ContactBusinessRelationFound :=
- ContBusinessRelation.FindByContact(ContBusinessRelation."Link to Table"::Customer, Cont."Company No.");
- end;
-
- OnUpdateBillToCustOnAfterFindContactBusinessRelation(Rec, Cont, ContBusinessRelation, ContactBusinessRelationFound);
-
- if ContactBusinessRelationFound then begin
- if "Bill-to Customer No." = '' then begin
- SkipBillToContact := true;
- Validate("Bill-to Customer No.", ContBusinessRelation."No.");
- SkipBillToContact := false;
- "Bill-to Customer Templ. Code" := '';
- end else
- CheckCustomerContactRelation(Cont, "Bill-to Customer No.", ContBusinessRelation."No.");
- end else
- if "Document Type" = "Document Type"::Quote then begin
- if not GetContactAsCompany(Cont, SearchContact) then
- SearchContact := Cont;
- "Bill-to Name" := SearchContact."Company Name";
- "Bill-to Name 2" := SearchContact."Name 2";
- "Bill-to Address" := SearchContact.Address;
- "Bill-to Address 2" := SearchContact."Address 2";
- "Bill-to City" := SearchContact.City;
- "Bill-to Post Code" := SearchContact."Post Code";
- "Bill-to County" := SearchContact.County;
- "Bill-to Country/Region Code" := SearchContact."Country/Region Code";
- "VAT Registration No." := SearchContact."VAT Registration No.";
- "Registration Number" := SearchContact."Registration Number";
- Validate("Currency Code", SearchContact."Currency Code");
- "Language Code" := SearchContact."Language Code";
- "Format Region" := SearchContact."Format Region";
-
- OnUpdateBillToCustOnAfterSalesQuote(Rec, SearchContact);
-
- if ("Bill-to Customer Templ. Code" = '') and (not CustomerTempl.IsEmpty) then
- Validate("Bill-to Customer Templ. Code", Cont.FindNewCustomerTemplate());
- end else begin
- IsHandled := false;
- OnUpdateBillToCustOnBeforeContactIsNotRelatedToAnyCostomerErr(Rec, Cont, ContBusinessRelation, IsHandled);
- if not IsHandled then
- Error(ContactIsNotRelatedToAnyCostomerErr, Cont."No.", Cont.Name);
- end;
-
- OnAfterUpdateBillToCust(Rec, Cont);
- end;
-
- local procedure UpdateBillToCustContact(Cont: Record Contact)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateBillToCustContact(Rec, Cont, IsHandled);
- if IsHandled then
- exit;
-
- if Customer.Get("Bill-to Customer No.") and (Cont.Type = Cont.Type::Company) then
- "Bill-to Contact" := Customer.Contact
- else
- if Cont.Type = Cont.Type::Company then
- "Bill-to Contact" := ''
- else
- "Bill-to Contact" := Cont.Name;
- end;
-
- local procedure UpdateSellToCustTemplateCode()
- begin
- if ("Document Type" = "Document Type"::Quote) and ("Sell-to Customer No." = '') and ("Sell-to Customer Templ. Code" = '') and
- (GetFilterContNo() = '')
- then
- Validate("Sell-to Customer Templ. Code", SelectSalesHeaderNewCustomerTemplate());
- end;
-
- local procedure GetShipmentMethodCode()
- var
- ShipToAddress: Record "Ship-to Address";
- IsHandled: Boolean;
- IsShipmentMethodCodeAssigned: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetShipmentMethodCode(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "Ship-to Code" <> '' then begin
- ShipToAddress.SetLoadFields("Shipment Method Code");
- ShipToAddress.Get("Sell-to Customer No.", "Ship-to Code");
- if ShipToAddress."Shipment Method Code" <> '' then begin
- Validate("Shipment Method Code", ShipToAddress."Shipment Method Code");
- IsShipmentMethodCodeAssigned := true;
- end;
- end;
-
- if (not IsShipmentMethodCodeAssigned) and ("Sell-to Customer No." <> '') then begin
- GetCust("Sell-to Customer No.");
- Validate("Shipment Method Code", Customer."Shipment Method Code");
- end;
- end;
-
- ///
- /// Updates the shipping time on the sales header.
- ///
- ///
- /// Checks if the procedure is called by a field other than the current field. If so, the procedure exits.
- /// If shipping agent is defined in sales header then shipping time is set from the shipping agent services, otherwise from sell-to customer.
- /// If the procedure was not called by the shipping agent code or shipping agent service code fields,
- /// it validates the current shipping time value.
- ///
- /// Field number of the field that called this procedure.
- procedure GetShippingTime(CalledByFieldNo: Integer)
- var
- ShippingAgentServices: Record "Shipping Agent Services";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetShippingTime(Rec, xRec, CalledByFieldNo, IsHandled, CurrFieldNo);
- if IsHandled then
- exit;
- if (CalledByFieldNo <> CurrFieldNo) and (CurrFieldNo <> 0) then
- exit;
-
- ShippingAgentServices.SetLoadFields("Shipping Time");
- if ShippingAgentServices.Get("Shipping Agent Code", "Shipping Agent Service Code") then
- "Shipping Time" := ShippingAgentServices."Shipping Time"
- else begin
- GetCust("Sell-to Customer No.");
- "Shipping Time" := Customer."Shipping Time"
- end;
- if not (CalledByFieldNo in [FieldNo("Shipping Agent Code"), FieldNo("Shipping Agent Service Code")]) then
- Validate("Shipping Time");
- end;
-
- local procedure GetContact(var Contact: Record Contact; ContactNo: Code[20])
- begin
- Contact.Get(ContactNo);
- if (Contact.Type = Contact.Type::Person) and (Contact."Company No." <> '') then
- Contact.Get(Contact."Company No.");
- end;
-
- ///
- /// Gets sell-to customer fax number.
- ///
- /// Customer fax number.
- procedure GetSellToCustomerFaxNo(): Text
- var
- Customer2: Record Customer;
- begin
- if Customer2.Get("Sell-to Customer No.") then
- exit(Customer2."Fax No.");
- end;
-
- ///
- /// Checks the bill to customer credit limit and if credit limit is exceeded, creates a notification.
- ///
- ///
- /// Notifiction will be created only if credit warnings is not disabled in sales setup.
- ///
- procedure CheckCreditMaxBeforeInsert()
- var
- SalesHeader2: Record "Sales Header";
- ContBusinessRelation: Record "Contact Business Relation";
- Cont: Record Contact;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckCreditMaxBeforeInsert(Rec, IsHandled, HideCreditCheckDialogue, GetFilterCustNo(), GetFilterContNo());
- if IsHandled then
- exit;
-
- if HideCreditCheckDialogue then
- exit;
-
- if (GetFilterCustNo() <> '') or ("Sell-to Customer No." <> '') then begin
- if "Sell-to Customer No." <> '' then
- Customer.Get("Sell-to Customer No.")
- else
- Customer.Get(GetFilterCustNo());
- if Customer."Bill-to Customer No." <> '' then
- SalesHeader2."Bill-to Customer No." := Customer."Bill-to Customer No."
- else
- SalesHeader2."Bill-to Customer No." := Customer."No.";
- OnCheckCreditMaxBeforeInsertOnCaseIfOnBeforeSalesHeaderCheckCase(SalesHeader2, Rec);
- CustCheckCreditLimit.SalesHeaderCheck(SalesHeader2);
- end else
- if GetFilterContNo() <> '' then begin
- Cont.Get(GetFilterContNo());
- if ContBusinessRelation.FindByContact(ContBusinessRelation."Link to Table"::Customer, Cont."Company No.") then begin
- Customer.Get(ContBusinessRelation."No.");
- if Customer."Bill-to Customer No." <> '' then
- SalesHeader2."Bill-to Customer No." := Customer."Bill-to Customer No."
- else
- SalesHeader2."Bill-to Customer No." := Customer."No.";
- CustCheckCreditLimit.SalesHeaderCheck(SalesHeader2);
- end;
- end;
-
- OnAfterCheckCreditMaxBeforeInsert(Rec);
- end;
-
- ///
- /// Creates inventory put-away, pick, or movement documents for a released sales document.
- ///
- procedure CreateInvtPutAwayPick()
- begin
- OnBeforeCreateInvtPutAwayPick(Rec);
-
- if "Document Type" = "Document Type"::Order then
- if not IsApprovedForPosting() then
- exit;
-
- OnCreateInvtPutAwayPickOnBeforeTestingStatus(Rec);
- TestField(Status, Status::Released);
-
- WhseRequest.Reset();
- WhseRequest.SetCurrentKey("Source Document", "Source No.");
- case "Document Type" of
- "Document Type"::Order:
- begin
- if "Shipping Advice" = "Shipping Advice"::Complete then
- CheckShippingAdvice();
- WhseRequest.SetRange("Source Document", WhseRequest."Source Document"::"Sales Order");
- end;
- "Document Type"::"Return Order":
- WhseRequest.SetRange("Source Document", WhseRequest."Source Document"::"Sales Return Order");
- end;
- WhseRequest.SetRange("Source No.", "No.");
- REPORT.RunModal(REPORT::"Create Invt Put-away/Pick/Mvmt", true, false, WhseRequest);
- end;
-
- ///
- /// Starts the create task wizard with information from the sales header.
- ///
- procedure CreateTask()
- var
- TempTask: Record "To-do" temporary;
- begin
- TestField("Sell-to Contact No.");
- TempTask.CreateTaskFromSalesHeader(Rec);
- end;
-
- ///
- /// Updates the ship-to address information if the sales header has a credit document type.
- ///
- procedure UpdateShipToAddress()
- var
- IsHandled: Boolean;
- begin
- OnBeforeUpdateShipToAddress(Rec, IsHandled, CurrFieldNo);
- if IsHandled then
- exit;
-
- if IsCreditDocType() then
- if "Location Code" <> '' then begin
- Location.Get("Location Code");
- SetShipToAddress(
- Location.Name, Location."Name 2", Location.Address, Location."Address 2", Location.City,
- Location."Post Code", Location.County, Location."Country/Region Code");
- "Ship-to Phone No." := Location."Phone No.";
- "Ship-to Contact" := Location.Contact;
- end else begin
- CompanyInfo.Get();
- "Ship-to Code" := '';
- SetShipToAddress(
- CompanyInfo."Ship-to Name", CompanyInfo."Ship-to Name 2", CompanyInfo."Ship-to Address", CompanyInfo."Ship-to Address 2",
- CompanyInfo."Ship-to City", CompanyInfo."Ship-to Post Code", CompanyInfo."Ship-to County",
- CompanyInfo."Ship-to Country/Region Code");
- "Ship-to Phone No." := CompanyInfo."Ship-to Phone No.";
- "Ship-to Contact" := CompanyInfo."Ship-to Contact";
- end;
-
- OnAfterUpdateShipToAddress(Rec, xRec, CurrFieldNo, Location, CompanyInfo);
- end;
-
- local procedure SetRcvdFromCountry(RcvdFromCountryRegionCode: Code[10])
- begin
- if not IsCreditDocType() then
- exit;
- Rec."Rcvd.-from Count./Region Code" := RcvdFromCountryRegionCode;
- end;
-
- local procedure UpdateShipToCodeFromCust()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateShipToCodeFromCust(Rec, Customer, IsHandled);
- if IsHandled then
- exit;
-
- Rec.Validate("Ship-to Code", Customer."Ship-to Code");
- end;
-
- ///
- /// Opens a page for editing dimensions for the sales header.
- /// If dimensions are changed, they're updated on the sales lines as well.
- ///
- procedure ShowDocDim()
- var
- OldDimSetID: Integer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeShowDocDim(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- OldDimSetID := "Dimension Set ID";
- "Dimension Set ID" :=
- DimMgt.EditDimensionSet(
- Rec, "Dimension Set ID", StrSubstNo('%1 %2', "Document Type", "No."),
- "Shortcut Dimension 1 Code", "Shortcut Dimension 2 Code");
- OnShowDocDimOnBeforeUpdateSalesLines(Rec, xRec);
- if OldDimSetID <> "Dimension Set ID" then begin
- OnShowDocDimOnBeforeSalesHeaderModify(Rec);
- Modify();
- if SalesLinesExist() then
- UpdateAllLineDim("Dimension Set ID", OldDimSetID);
- end;
- end;
-
- local procedure ConfirmUpdateAllLineDim(NewParentDimSetID: Integer; OldParentDimSetID: Integer) Confirmed: Boolean;
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeConfirmUpdateAllLineDim(Rec, xRec, NewParentDimSetID, OldParentDimSetID, Confirmed, IsHandled);
- if not IsHandled then
- Confirmed := Confirm(Text064);
- end;
-
- ///
- /// Updates the dimensions of sales lines in a sales document when the dimensions of the sales header are changed.
- ///
- /// New dimension set ID.
- /// Previous dimension set ID.
- procedure UpdateAllLineDim(NewParentDimSetID: Integer; OldParentDimSetID: Integer)
- var
- ATOLink: Record "Assemble-to-Order Link";
- xSalesLine: Record "Sales Line";
- NewDimSetID: Integer;
- ShippedReceivedItemLineDimChangeConfirmed: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateAllLineDim(Rec, NewParentDimSetID, OldParentDimSetID, IsHandled, xRec);
- if IsHandled then
- exit;
-
- if NewParentDimSetID = OldParentDimSetID then
- exit;
- if not GetHideValidationDialog() and GuiAllowed then
- if not ConfirmUpdateAllLineDim(NewParentDimSetID, OldParentDimSetID) then
- exit;
-
- SalesLine.Reset();
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
- SalesLine.LockTable();
- if SalesLine.Find('-') then
- repeat
- OnUpdateAllLineDimOnBeforeGetSalesLineNewDimsetID(SalesLine, NewParentDimSetID, OldParentDimSetID);
- NewDimSetID := DimMgt.GetDeltaDimSetID(SalesLine."Dimension Set ID", NewParentDimSetID, OldParentDimSetID);
- OnUpdateAllLineDimOnAfterGetSalesLineNewDimsetID(Rec, xRec, SalesLine, NewDimSetID, NewParentDimSetID, OldParentDimSetID);
- if SalesLine."Dimension Set ID" <> NewDimSetID then begin
- xSalesLine := SalesLine;
- SalesLine."Dimension Set ID" := NewDimSetID;
-
- if not GetHideValidationDialog() and GuiAllowed then
- VerifyShippedReceivedItemLineDimChange(ShippedReceivedItemLineDimChangeConfirmed);
-
- DimMgt.UpdateGlobalDimFromDimSetID(
- SalesLine."Dimension Set ID", SalesLine."Shortcut Dimension 1 Code", SalesLine."Shortcut Dimension 2 Code");
-
- OnUpdateAllLineDimOnBeforeSalesLineModify(SalesLine, xSalesLine);
- SalesLine.Modify();
- OnUpdateAllLineDimOnAfterSalesLineModify(SalesLine);
- ATOLink.UpdateAsmDimFromSalesLine(SalesLine, true);
- end;
- until SalesLine.Next() = 0;
- end;
-
- local procedure VerifyShippedReceivedItemLineDimChange(var ShippedReceivedItemLineDimChangeConfirmed: Boolean)
- begin
- if SalesLine.IsShippedReceivedItemDimChanged() then
- if not ShippedReceivedItemLineDimChangeConfirmed then
- ShippedReceivedItemLineDimChangeConfirmed := SalesLine.ConfirmShippedReceivedItemDimChange();
- end;
-
- ///
- /// Opens a page with adjustment value entries related to the sales header.
- ///
- ///
- /// General - filters all related value entries.
- /// Invoicing - filters only not invoiced value entries.
- ///
- procedure LookupAdjmtValueEntries(QtyType: Option General,Invoicing)
- var
- ItemLedgEntry: Record "Item Ledger Entry";
- SalesLine: Record "Sales Line";
- SalesShptLine: Record "Sales Shipment Line";
- ReturnRcptLine: Record "Return Receipt Line";
- TempValueEntry: Record "Value Entry" temporary;
- begin
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
- TempValueEntry.Reset();
- TempValueEntry.DeleteAll();
-
- case "Document Type" of
- "Document Type"::Order, "Document Type"::Invoice:
- if SalesLine.FindSet() then
- repeat
- if (SalesLine.Type = SalesLine.Type::Item) and (SalesLine.Quantity <> 0) then begin
- if SalesLine."Shipment No." <> '' then begin
- SalesShptLine.SetRange("Document No.", SalesLine."Shipment No.");
- SalesShptLine.SetRange("Line No.", SalesLine."Shipment Line No.");
- end else begin
- SalesShptLine.SetCurrentKey("Order No.", "Order Line No.");
- SalesShptLine.SetRange("Order No.", SalesLine."Document No.");
- SalesShptLine.SetRange("Order Line No.", SalesLine."Line No.");
- end;
- SalesShptLine.SetRange(Correction, false);
- if QtyType = QtyType::Invoicing then
- SalesShptLine.SetFilter("Qty. Shipped Not Invoiced", '<>0');
-
- if SalesShptLine.FindSet() then
- repeat
- SalesShptLine.FilterPstdDocLnItemLedgEntries(ItemLedgEntry);
- if ItemLedgEntry.FindSet() then
- repeat
- CreateTempAdjmtValueEntries(TempValueEntry, ItemLedgEntry."Entry No.");
- until ItemLedgEntry.Next() = 0;
- until SalesShptLine.Next() = 0;
- end;
- until SalesLine.Next() = 0;
- "Document Type"::"Return Order", "Document Type"::"Credit Memo":
- if SalesLine.FindSet() then
- repeat
- if (SalesLine.Type = SalesLine.Type::Item) and (SalesLine.Quantity <> 0) then begin
- if SalesLine."Return Receipt No." <> '' then begin
- ReturnRcptLine.SetRange("Document No.", SalesLine."Return Receipt No.");
- ReturnRcptLine.SetRange("Line No.", SalesLine."Return Receipt Line No.");
- end else begin
- ReturnRcptLine.SetCurrentKey("Return Order No.", "Return Order Line No.");
- ReturnRcptLine.SetRange("Return Order No.", SalesLine."Document No.");
- ReturnRcptLine.SetRange("Return Order Line No.", SalesLine."Line No.");
- end;
- ReturnRcptLine.SetRange(Correction, false);
- if QtyType = QtyType::Invoicing then
- ReturnRcptLine.SetFilter("Return Qty. Rcd. Not Invd.", '<>0');
-
- if ReturnRcptLine.FindSet() then
- repeat
- ReturnRcptLine.FilterPstdDocLnItemLedgEntries(ItemLedgEntry);
- if ItemLedgEntry.FindSet() then
- repeat
- CreateTempAdjmtValueEntries(TempValueEntry, ItemLedgEntry."Entry No.");
- until ItemLedgEntry.Next() = 0;
- until ReturnRcptLine.Next() = 0;
- end;
- until SalesLine.Next() = 0;
- else
- OnLookupAdjmtValueEntriesCaseDocumentTypeElse(Rec, SalesLine, QtyType);
- end;
- PAGE.RunModal(0, TempValueEntry);
- end;
-
- ///
- /// Returns the VAT registration number from a sales header.
- ///
- /// VAT registration number.
- procedure GetCustomerVATRegistrationNumber() ReturnValue: Text
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetCustomerVATRegistrationNumber(Rec, ReturnValue, IsHandled);
- if IsHandled then
- exit(ReturnValue);
-
- exit("VAT Registration No.");
- end;
-
- ///
- /// Returns the VAT registration number field caption from a sales header.
- ///
- /// Caption of the VAT registration number field in the sales header.
- procedure GetCustomerVATRegistrationNumberLbl() ReturnValue: Text
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetCustomerVATRegistrationNumberLbl(Rec, ReturnValue, IsHandled);
- if IsHandled then
- exit(ReturnValue);
-
- exit(FieldCaption("VAT Registration No."));
- end;
-
- ///
- /// Returns customer global location number. Currently defined to return an empty value.
- ///
- /// Empty text.
-
- ///
- /// Returns document status field style expression based on the status of the sales header.
- ///
- /// Status style expression.
- procedure GetStatusStyleText() StatusStyleText: Text
- begin
- if Status = Status::Open then
- StatusStyleText := 'Favorable'
- else
- StatusStyleText := 'Strong';
-
- OnAfterGetStatusStyleText(Rec, StatusStyleText);
- end;
-
- local procedure CreateTempAdjmtValueEntries(var TempValueEntry: Record "Value Entry" temporary; ItemLedgEntryNo: Integer)
- var
- ValueEntry: Record "Value Entry";
- begin
- ValueEntry.SetCurrentKey("Item Ledger Entry No.");
- ValueEntry.SetRange("Item Ledger Entry No.", ItemLedgEntryNo);
- if ValueEntry.FindSet() then
- repeat
- if ValueEntry.Adjustment then begin
- TempValueEntry := ValueEntry;
- if TempValueEntry.Insert() then;
- end;
- until ValueEntry.Next() = 0;
- end;
-
- ///
- /// Opens a page with posted document lines that can be reversed. After the user selects the lines,
- /// they are copied to the current document.
- ///
- procedure GetPstdDocLinesToReverse()
- var
- SalesPostedDocLines: Page "Posted Sales Document Lines";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetPstdDocLinesToReverse(Rec, IsHandled);
- if IsHandled then
- exit;
-
- GetCust("Sell-to Customer No.");
- SalesPostedDocLines.SetToSalesHeader(Rec);
- SalesPostedDocLines.SetRecord(Customer);
- SalesPostedDocLines.LookupMode := true;
- if SalesPostedDocLines.RunModal() = ACTION::LookupOK then
- SalesPostedDocLines.CopyLineToDoc();
-
- Clear(SalesPostedDocLines);
-
- OnAfterGetPstdDocLinesToReverse(Rec);
- end;
-
- ///
- /// Calculates invoice discount for a sales header if calculate invoice discount is enabled in the sales setup.
- ///
- procedure CalcInvDiscForHeader()
- var
- SalesInvDisc: Codeunit "Sales-Calc. Discount";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCalcInvDiscForHeader(Rec, IsHandled);
- if IsHandled then
- exit;
-
- GetSalesSetup();
- if SalesSetup."Calc. Inv. Discount" then
- SalesInvDisc.CalculateIncDiscForHeader(Rec);
- end;
-
- ///
- /// Filters the sales header for responsibility center set in the user setup or company information.
- /// The filter is set in filter group 2 and is hidden from the user.
- ///
- ///
- /// Responsibility filter is set from user setup sales responsibility control filter field if this field is filled,
- /// otherwise it is set from the company information responsibility center field.
- ///
- procedure SetSecurityFilterOnRespCenter()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetSecurityFilterOnRespCenter(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if UserSetupMgt.GetSalesFilter() <> '' then begin
- FilterGroup(2);
- SetRange("Responsibility Center", UserSetupMgt.GetSalesFilter());
- FilterGroup(0);
- end;
-
- Rec.SetRange("Date Filter", 0D, WorkDate());
- end;
-
- ///
- /// Updates reservations data if location or bin have changed on the sales line.
- ///
- ///
- /// Procedure is used on sales lines recreation process.
- ///
- /// Return value: Updated sales line record.
- /// The original sales line record before updates.
- procedure SynchronizeForReservations(var NewSalesLine: Record "Sales Line"; OldSalesLine: Record "Sales Line")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSynchronizeForReservations(Rec, NewSalesLine, OldSalesLine, IsHandled);
- if IsHandled then
- exit;
-
- NewSalesLine.CalcFields("Reserved Quantity");
- if NewSalesLine."Reserved Quantity" = 0 then
- exit;
- if NewSalesLine."Location Code" <> OldSalesLine."Location Code" then
- NewSalesLine.Validate("Location Code", OldSalesLine."Location Code");
- if NewSalesLine."Bin Code" <> OldSalesLine."Bin Code" then
- NewSalesLine.Validate("Bin Code", OldSalesLine."Bin Code");
- if NewSalesLine.Modify() then;
- end;
-
- ///
- /// Determines if there is a conflict between inventory pick and sales line for a given sales document.
- ///
- /// The type of the sales document.
- /// The number of the sales document.
- /// The shipping advice for the sales document.
- /// True if there is a conflict, otherwise false.
- procedure InventoryPickConflict(DocType: Enum "Sales Document Type"; DocNo: Code[20]; ShippingAdvice: Enum "Sales Header Shipping Advice"): Boolean
- var
- WarehouseActivityLine: Record "Warehouse Activity Line";
- SalesLine2: Record "Sales Line";
- begin
- if ShippingAdvice <> ShippingAdvice::Complete then
- exit(false);
- WarehouseActivityLine.SetCurrentKey("Source Type", "Source Subtype", "Source No.");
- WarehouseActivityLine.SetRange("Source Type", DATABASE::"Sales Line");
- WarehouseActivityLine.SetRange("Source Subtype", DocType);
- WarehouseActivityLine.SetRange("Source No.", DocNo);
- if WarehouseActivityLine.IsEmpty() then
- exit(false);
- SalesLine2.SetRange("Document Type", DocType);
- SalesLine2.SetRange("Document No.", DocNo);
- SalesLine2.SetRange(Type, SalesLine.Type::Item);
- if SalesLine2.IsEmpty() then
- exit(false);
- exit(true);
- end;
-
- ///
- /// Determines if there is a conflict between warehouse shipment and sales line for a given sales document.
- ///
- /// The type of the sales document.
- /// The number of the sales document.
- /// The shipping advice for the sales document.
- /// True if there is a conflict, otherwise false.
- procedure WhseShipmentConflict(DocType: Enum "Sales Document Type"; DocNo: Code[20]; ShippingAdvice: Enum "Sales Header Shipping Advice"): Boolean
- var
- WarehouseShipmentLine: Record "Warehouse Shipment Line";
- begin
- if ShippingAdvice <> ShippingAdvice::Complete then
- exit(false);
- WarehouseShipmentLine.SetCurrentKey("Source Type", "Source Subtype", "Source No.", "Source Line No.");
- WarehouseShipmentLine.SetRange("Source Type", DATABASE::"Sales Line");
- WarehouseShipmentLine.SetRange("Source Subtype", DocType);
- WarehouseShipmentLine.SetRange("Source No.", DocNo);
- if WarehouseShipmentLine.IsEmpty() then
- exit(false);
- exit(true);
- end;
-
- local procedure CheckCreditLimit()
- var
- SalesHeader2: Record "Sales Header";
- IsHandled: Boolean;
- begin
- SalesHeader2 := Rec;
-
- if GuiAllowed and
- (CurrFieldNo <> 0) and CheckCreditLimitCondition() and SalesHeader2.Find()
- then begin
- "Amount Including VAT" := 0;
- if "Document Type" = "Document Type"::Order then
- if BilltoCustomerNoChanged then begin
- SalesLine.SetRange("Document Type", SalesLine."Document Type"::Order);
- SalesLine.SetRange("Document No.", "No.");
- SalesLine.CalcSums("Outstanding Amount", "Shipped Not Invoiced");
- "Amount Including VAT" := SalesLine."Outstanding Amount" + SalesLine."Shipped Not Invoiced";
- end;
-
- IsHandled := false;
- OnBeforeCheckCreditLimit(Rec, IsHandled);
- if not IsHandled then
- CustCheckCreditLimit.SalesHeaderCheck(Rec);
-
- CalcFields("Amount Including VAT");
- OnCheckCreditLimitOnAfterCreditLimitCheck(Rec);
- end;
- end;
-
- local procedure CheckCreditLimitCondition(): Boolean
- var
- RunCheck: Boolean;
- begin
- RunCheck := ("Document Type".AsInteger() <= "Document Type"::Invoice.AsInteger()) or ("Document Type" = "Document Type"::"Blanket Order");
- OnAfterCheckCreditLimitCondition(Rec, RunCheck);
- exit(RunCheck);
- end;
-
- ///
- /// Checks if all lines of the document are in stock.
- /// If the quantity in stock is too low, a notification is shown.
- ///
- ///
- /// Notifications will be displayed if stock notifications are not disabled.
- ///
- procedure CheckItemAvailabilityInLines()
- var
- SalesLine: Record "Sales Line";
- ItemCheckAvail: Codeunit "Item-Check Avail.";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckItemAvailabilityInLines(Rec, SalesLine, IsHandled);
- if IsHandled then
- exit;
-
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
- SalesLine.SetRange(Type, SalesLine.Type::Item);
- SalesLine.SetFilter("No.", '<>%1', '');
- SalesLine.SetFilter("Outstanding Quantity", '<>%1', 0);
- OnCheckItemAvailabilityInLinesOnAfterSetFilters(SalesLine);
- if SalesLine.FindSet() then
- repeat
- if ItemCheckAvail.SalesLineCheck(SalesLine) then
- ItemCheckAvail.RaiseUpdateInterruptedError();
- until SalesLine.Next() = 0;
- end;
-
- ///
- /// Determines if the quantity to ship is zero for all sales document lines.
- ///
- /// True if the quantity to ship is zero for all lines, otherwise false.
- procedure QtyToShipIsZero() Result: Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeQtyToShipIsZero(Rec, SalesLine, Result, IsHandled);
- if IsHandled then
- exit;
-
- SalesLine.Reset();
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
- SalesLine.SetFilter("Qty. to Ship", '<>0');
- Result := SalesLine.IsEmpty();
- end;
-
- ///
- /// Checks if the sales document can be posted.
- /// It checks for status, approvals, payments and prepayments, and throws an error if conditions are not met.
- ///
- /// True if the sales header is approved for posting, otherwise false.
- procedure IsApprovedForPosting() Approved: Boolean
- var
- PrepaymentMgt: Codeunit "Prepayment Mgt.";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeIsApprovedForPosting(Rec, Approved, IsHandled);
- if IsHandled then
- exit(Approved);
-
- if ApprovalsMgmt.PrePostApprovalCheckSales(Rec) then begin
- if PrepaymentMgt.TestSalesPrepayment(Rec) then
- Error(PrepaymentInvoicesNotPaidErr, "Document Type", "No.");
- if "Document Type" = "Document Type"::Order then
- if PrepaymentMgt.TestSalesPayment(Rec) then
- Error(Text072, "Document Type", "No.");
- Approved := true;
- OnAfterIsApprovedForPosting(Rec, Approved);
- end;
- end;
-
- ///
- /// Determines if the sales document can be posted. It checks for status, approvals, payments, and prepayments.
- ///
- ///
- /// All the checks are executed in the try function, so no errors will be thrown if they appear.
- ///
- /// True if the sales header is approved for posting, otherwise false.
- procedure IsApprovedForPostingBatch() Approved: Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeIsApprovedForPostingBatch(Rec, Approved, IsHandled);
- if IsHandled then
- exit(Approved);
-
- Approved := ApprovedForPostingBatch();
- OnAfterIsApprovedForPostingBatch(Rec, Approved);
- end;
-
- [TryFunction]
- local procedure ApprovedForPostingBatch()
- var
- PrepaymentMgt: Codeunit "Prepayment Mgt.";
- begin
- if ApprovalsMgmt.PrePostApprovalCheckSales(Rec) then begin
- if PrepaymentMgt.TestSalesPrepayment(Rec) then
- Error(PrepaymentInvoicesNotPaidErr, "Document Type", "No.");
- if PrepaymentMgt.TestSalesPayment(Rec) then
- Error(Text072, "Document Type", "No.");
- end;
- end;
-
- ///
- /// Returns legal statement from sales setup. Currently defined to return an empty value.
- ///
- /// Empty text.
- procedure GetLegalStatement(): Text
- begin
- GetSalesSetup();
- exit(SalesSetup.GetLegalStatement());
- end;
-
- ///
- /// Posts a sales document by running the provided codeunit if the document is approved for posting.
- ///
- ///
- /// The transaction is committed before the posting codeunit is run.
- /// After the posting codeunit is executed any errors that occur during the posting operation are shown.
- ///
- /// Posting codeunit id that is executed.
- /// True if the document was successfully posted, otherwise false.
- procedure SendToPosting(PostingCodeunitID: Integer) IsSuccess: Boolean
- var
- ErrorContextElement: Codeunit "Error Context Element";
- ErrorMessageMgt: Codeunit "Error Message Management";
- ErrorMessageHandler: Codeunit "Error Message Handler";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSendToPosting(Rec, IsSuccess, IsHandled, PostingCodeunitID);
- if IsHandled then
- exit(IsSuccess);
-
- if not IsApprovedForPosting() then
- exit;
-
- Commit();
- ErrorMessageMgt.Activate(ErrorMessageHandler);
- ErrorMessageMgt.PushContext(ErrorContextElement, RecordId, 0, '');
- IsSuccess := CODEUNIT.Run(PostingCodeunitID, Rec);
-
- OnSendToPostingOnAfterPost(Rec, IsSuccess);
- if not IsSuccess then begin
- if Rec.Status <> Rec.Status::Released then
- DeleteWarehouseRequest();
- ErrorMessageHandler.ShowErrors();
- end;
- end;
-
- local procedure DeleteWarehouseRequest()
- begin
- WhseRequest.SetRange("Source Type", DATABASE::"Sales Line");
- WhseRequest.SetRange("Source Subtype", "Document Type");
- WhseRequest.SetRange("Source No.", "No.");
- if not WhseRequest.IsEmpty() then
- WhseRequest.DeleteAll(true);
- end;
-
- ///
- /// Cancels a background posting job for a sales document.
- ///
- procedure CancelBackgroundPosting()
- var
- SalesPostViaJobQueue: Codeunit "Sales Post via Job Queue";
- begin
- SalesPostViaJobQueue.CancelQueueEntry(Rec);
- end;
-
- ///
- /// Sends an email with the sales document attached.
- ///
- /// Determines whether to show the email dialog before sending the email.
- [Scope('Cloud')]
- procedure EmailRecords(ShowDialog: Boolean)
- var
- DocumentSendingProfile: Record "Document Sending Profile";
- DummyReportSelections: Record "Report Selections";
- begin
- case "Document Type" of
- "Document Type"::Quote:
- begin
- DocumentSendingProfile.TrySendToEMail(
- DummyReportSelections.Usage::"S.Quote".AsInteger(), Rec, FieldNo("No."),
- GetDocTypeTxt(), FieldNo("Bill-to Customer No."), ShowDialog);
- Find();
- "Quote Sent to Customer" := CurrentDateTime;
- Modify();
- end;
- "Document Type"::Invoice:
- DocumentSendingProfile.TrySendToEMail(
- DummyReportSelections.Usage::"S.Invoice Draft".AsInteger(), Rec, FieldNo("No."),
- GetDocTypeTxt(), FieldNo("Bill-to Customer No."), ShowDialog);
- end;
-
- OnAfterSendSalesHeader(Rec, ShowDialog);
- end;
-
- ///
- /// Retrieves the full document type name based on the sales header document type.
- ///
- /// Retrieved document type name.
- procedure GetDocTypeTxt() TypeText: Text[50]
- var
- ReportDistributionMgt: Codeunit "Report Distribution Management";
- begin
- TypeText := ReportDistributionMgt.GetFullDocumentTypeText(Rec);
-
- OnAfterGetDocTypeText(Rec, TypeText);
- end;
-
- ///
- /// Retrieves the full sales document type name based on the sales header document type.
- ///
- /// Retrieved document type name.
- procedure GetFullDocTypeTxt() FullDocTypeTxt: Text
- var
- IsHandled: Boolean;
- begin
- OnBeforeGetFullDocTypeTxt(Rec, FullDocTypeTxt, IsHandled);
-
- if IsHandled then
- exit;
-
- FullDocTypeTxt := SelectStr("Document Type".AsInteger() + 1, FullSalesTypesTxt);
- end;
-
- ///
- /// Updates the link between the sales document and an opportunity.
- ///
- /// The opportunity number before the update.
- procedure LinkSalesDocWithOpportunity(OldOpportunityNo: Code[20])
- var
- SalesHeader: Record "Sales Header";
- Opportunity: Record Opportunity;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLinkSalesDocWithOpportunity(Rec, OldOpportunityNo, IsHandled);
- if IsHandled then
- exit;
-
- if "Opportunity No." <> OldOpportunityNo then begin
- if "Opportunity No." <> '' then
- if Opportunity.Get("Opportunity No.") then begin
- Opportunity.TestField(Status, Opportunity.Status::"In Progress");
- if Opportunity."Sales Document No." <> '' then begin
- if CofirmClearOpportunityNo(Opportunity) then begin
- if SalesHeader.Get("Document Type"::Quote, Opportunity."Sales Document No.") then begin
- SalesHeader."Opportunity No." := '';
- OnLinkSalesDocWithOpportunityOnBeforeSalesHeaderModify(Rec, OldOpportunityNo, Opportunity);
- SalesHeader.Modify();
- end;
- UpdateOpportunityLink(Opportunity, Opportunity."Sales Document Type"::Quote, "No.");
- end else
- "Opportunity No." := OldOpportunityNo;
- end else
- UpdateOpportunityLink(Opportunity, Opportunity."Sales Document Type"::Quote, "No.");
- end;
- if (OldOpportunityNo <> '') and Opportunity.Get(OldOpportunityNo) then
- UpdateOpportunityLink(Opportunity, Opportunity."Sales Document Type"::" ", '');
- end;
- end;
-
- local procedure CofirmClearOpportunityNo(Opportunity: Record Opportunity) Confirmed: Boolean
- var
- ConfirmManagement: Codeunit "Confirm Management";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCofirmClearOpportunityNo(Opportunity, Confirmed, IsHandled);
- if IsHandled then
- exit(Confirmed);
-
- exit(ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text048, Opportunity."Sales Document No.", Opportunity."No."), true))
- end;
-
- local procedure UpdateOpportunityLink(Opportunity: Record Opportunity; SalesDocumentType: Enum "Opportunity Document Type"; SalesHeaderNo: Code[20])
- begin
- Opportunity."Sales Document Type" := SalesDocumentType;
- Opportunity."Sales Document No." := SalesHeaderNo;
- OnUpdateOpportunityLinkOnBeforeModify(Opportunity, Rec, SalesDocumentType.AsInteger(), SalesHeaderNo);
- Opportunity.Modify();
- end;
-
- ///
- /// Updates the posting date of related assembly headers with the sales header.
- ///
- ///
- /// During the update dialog window will be shown for the user.
- ///
- procedure SynchronizeAsmHeader()
- var
- AsmHeader: Record "Assembly Header";
- ATOLink: Record "Assemble-to-Order Link";
- Window: Dialog;
- begin
- ATOLink.SetCurrentKey(Type, "Document Type", "Document No.");
- ATOLink.SetRange(Type, ATOLink.Type::Sale);
- ATOLink.SetRange("Document Type", "Document Type");
- ATOLink.SetRange("Document No.", "No.");
- if ATOLink.FindSet() then
- repeat
- if AsmHeader.Get(ATOLink."Assembly Document Type", ATOLink."Assembly Document No.") then
- if "Posting Date" <> AsmHeader."Posting Date" then begin
- Window.Open(StrSubstNo(SynchronizingMsg, "No.", AsmHeader."No."));
- AsmHeader.Validate("Posting Date", "Posting Date");
- AsmHeader.Modify();
- Window.Close();
- end;
- until ATOLink.Next() = 0;
- end;
-
- ///
- /// Checks if the sales document can be shipped completely and throws an error if it cannot.
- ///
- procedure CheckShippingAdvice()
- var
- SalesLine2: Record "Sales Line";
- Item: Record Item;
- QtyToShipBaseTotal: Decimal;
- Result: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckShippingAdvice(Rec, IsHandled);
- if IsHandled then
- exit;
-
- SalesLine2.SetRange("Document Type", "Document Type");
- SalesLine2.SetRange("Document No.", "No.");
- SalesLine2.SetRange("Drop Shipment", false);
- SalesLine2.SetRange(Type, SalesLine.Type::Item);
- OnCheckShippingAdviceOnAfterSetLineFilters(SalesLine2, Rec);
- Result := true;
- if SalesLine2.FindSet() then
- repeat
- Item.Get(SalesLine2."No.");
- if SalesLine2.IsShipment() and (Item.Type = Item.Type::Inventory) then begin
- QtyToShipBaseTotal += SalesLine2."Qty. to Ship (Base)";
- if SalesLine2."Quantity (Base)" <>
- SalesLine2."Qty. to Ship (Base)" + SalesLine2."Qty. Shipped (Base)"
- then
- Result := false;
- end;
- until SalesLine2.Next() = 0;
- if QtyToShipBaseTotal = 0 then
- Result := true;
-
- OnAfterCheckShippingAdvice(Rec, Result);
- if not Result then
- Error(ErrorInfo.Create(ShippingAdviceErr, true, Rec));
- end;
-
- ///
- /// Retrieves the company contact associated with the provided contact.
- ///
- /// The contact record to get the associated company contact for.
- /// Return value: associated company contact.
- /// True if company contact was found, otherwise false.
- protected procedure GetContactAsCompany(Contact: Record Contact; var SearchContact: Record Contact): Boolean;
- var
- IsHandled: Boolean;
- begin
- OnBeforeGetContactAsCompany(Contact, SearchContact, IsHandled);
- if not IsHandled then
- if Contact."Company No." <> '' then
- exit(SearchContact.Get(Contact."Company No."));
- end;
-
- local procedure GetFilterCustNo(): Code[20]
- var
- MinValue: Code[20];
- MaxValue: Code[20];
- begin
- OnBeforeGetFilterCustNo(Rec);
- if GetFilter("Sell-to Customer No.") <> '' then
- if TryGetFilterCustNoRange(MinValue, MaxValue) then
- if MinValue = MaxValue then
- exit(MaxValue);
- end;
-
- [TryFunction]
- local procedure TryGetFilterCustNoRange(var MinValue: Code[20]; var MaxValue: Code[20])
- begin
- MinValue := GetRangeMin("Sell-to Customer No.");
- MaxValue := GetRangeMax("Sell-to Customer No.");
- end;
-
- local procedure GetFilterCustNoByApplyingFilter(): Code[20]
- var
- SalesHeader: Record "Sales Header";
- MinValue: Code[20];
- MaxValue: Code[20];
- begin
- if GetFilter("Sell-to Customer No.") <> '' then begin
- SalesHeader.CopyFilters(Rec);
- SalesHeader.SetCurrentKey("Sell-to Customer No.");
- if SalesHeader.FindFirst() then
- MinValue := SalesHeader."Sell-to Customer No.";
- if SalesHeader.FindLast() then
- MaxValue := SalesHeader."Sell-to Customer No.";
- if MinValue = MaxValue then
- exit(MaxValue);
- end;
- end;
-
- local procedure GetFilterContNo(): Code[20]
- begin
- if GetFilter("Sell-to Contact No.") <> '' then
- if GetRangeMin("Sell-to Contact No.") = GetRangeMax("Sell-to Contact No.") then
- exit(GetRangeMax("Sell-to Contact No."));
- end;
-
- local procedure CheckCreditLimitIfLineNotInsertedYet()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckCreditLimitIfLineNotInsertedYet(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "No." = '' then begin
- HideCreditCheckDialogue := false;
- Rec.CheckCreditMaxBeforeInsert();
- HideCreditCheckDialogue := true;
- end;
- end;
-
- ///
- /// Determines whether there are invoiced sales lines for the sales header.
- ///
- /// True if invoiced sales lines exists, otherwise false.
- procedure InvoicedLineExists(): Boolean
- var
- SalesLine: Record "Sales Line";
- begin
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
- SalesLine.SetFilter(Type, '<>%1', SalesLine.Type::" ");
- SalesLine.SetFilter("Quantity Invoiced", '<>%1', 0);
- exit(not SalesLine.IsEmpty);
- end;
-
- ///
- /// Updates dimensions on lines with prepayments.
- ///
- ///
- /// Dimensions are updated on temporary sales line table.
- /// Temporary sales line table is defined as a local variable and the caller has no way to retrieve lines.
- ///
- procedure CreateDimSetForPrepmtAccDefaultDim()
- var
- SalesLine: Record "Sales Line";
- TempSalesLine: Record "Sales Line" temporary;
- DefaultDimSource: List of [Dictionary of [Integer, Code[20]]];
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateDimSetForPrepmtAccDefaultDim(Rec, IsHandled);
- if IsHandled then
- exit;
-
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
- SalesLine.SetFilter("Prepmt. Amt. Inv.", '<>%1', 0);
- if SalesLine.FindSet() then
- repeat
- CollectParamsInBufferForCreateDimSet(TempSalesLine, SalesLine);
- until SalesLine.Next() = 0;
- TempSalesLine.Reset();
- TempSalesLine.MarkedOnly(false);
- if TempSalesLine.FindSet() then
- repeat
- InitSalesLineDefaultDimSource(DefaultDimSource, TempSalesLine);
- OnCreateDimSetForPrepmtAccDefaultDimOnBeforeTempSalesLineCreateDim(DefaultDimSource, TempSalesLine);
- TempSalesLine.CreateDim(DefaultDimSource);
- until TempSalesLine.Next() = 0;
- end;
-
- local procedure InitSalesLineDefaultDimSource(var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; SourceSalesLine: Record "Sales Line")
- begin
- Clear(DefaultDimSource);
- DimMgt.AddDimSource(DefaultDimSource, Database::"G/L Account", SourceSalesLine."No.");
- DimMgt.AddDimSource(DefaultDimSource, Database::Job, SourceSalesLine."Job No.");
- DimMgt.AddDimSource(DefaultDimSource, Database::"Responsibility Center", SourceSalesLine."Responsibility Center");
- end;
-
- local procedure CollectParamsInBufferForCreateDimSet(var TempSalesLine: Record "Sales Line" temporary; SalesLine: Record "Sales Line")
- var
- GenPostingSetup: Record "General Posting Setup";
- DefaultDimension: Record "Default Dimension";
- begin
- TempSalesLine.SetRange("Gen. Bus. Posting Group", SalesLine."Gen. Bus. Posting Group");
- TempSalesLine.SetRange("Gen. Prod. Posting Group", SalesLine."Gen. Prod. Posting Group");
- if not TempSalesLine.FindFirst() then begin
- GenPostingSetup.Get(SalesLine."Gen. Bus. Posting Group", SalesLine."Gen. Prod. Posting Group");
- DefaultDimension.SetRange("Table ID", DATABASE::"G/L Account");
- DefaultDimension.SetRange("No.", GenPostingSetup.GetSalesPrepmtAccount());
- OnCollectParamsInBufferForCreateDimSetOnBeforeInsertTempSalesLineInBuffer(GenPostingSetup, DefaultDimension);
- InsertTempSalesLineInBuffer(TempSalesLine, SalesLine, GenPostingSetup."Sales Prepayments Account", DefaultDimension.IsEmpty);
- end else
- if not TempSalesLine.Mark() then begin
- TempSalesLine.SetRange("Job No.", SalesLine."Job No.");
- TempSalesLine.SetRange("Responsibility Center", SalesLine."Responsibility Center");
- OnCollectParamsInBufferForCreateDimSetOnAfterSetTempSalesLineFilters(TempSalesLine, SalesLine);
- if TempSalesLine.IsEmpty() then
- InsertTempSalesLineInBuffer(TempSalesLine, SalesLine, TempSalesLine."No.", false);
- end;
- end;
-
- local procedure InsertTempSalesLineInBuffer(var TempSalesLine: Record "Sales Line" temporary; SalesLine: Record "Sales Line"; AccountNo: Code[20]; DefaultDimensionsNotExist: Boolean)
- begin
- TempSalesLine.Init();
- TempSalesLine."Document Type" := SalesLine."Document Type";
- TempSalesLine."Document No." := SalesLine."Document No.";
- TempSalesLine."Line No." := SalesLine."Line No.";
- TempSalesLine."No." := AccountNo;
- TempSalesLine."Job No." := SalesLine."Job No.";
- TempSalesLine."Responsibility Center" := SalesLine."Responsibility Center";
- TempSalesLine."Gen. Bus. Posting Group" := SalesLine."Gen. Bus. Posting Group";
- TempSalesLine."Gen. Prod. Posting Group" := SalesLine."Gen. Prod. Posting Group";
- TempSalesLine.Mark := DefaultDimensionsNotExist;
- OnInsertTempSalesLineInBufferOnBeforeTempSalesLineInsert(TempSalesLine, SalesLine);
- TempSalesLine.Insert();
- end;
-
- ///
- /// Runs checks and prepares data needed to open the document statistics page.
- ///
- ///
- /// It checks the user's permissions,
- /// calculates the invoice discount, creates a dimension set for order documents, and commits any changes made.
- ///
- procedure PrepareOpeningDocumentStatistics()
- var
- [SecurityFiltering(SecurityFilter::Ignored)]
- SalesHeader2: Record "Sales Header";
- [SecurityFiltering(SecurityFilter::Ignored)]
- SalesLine2: Record "Sales Line";
- begin
- if not SalesHeader2.WritePermission() or not SalesLine2.WritePermission() then
- Error(StatisticsInsuffucientPermissionsErr);
-
- CalcInvDiscForHeader();
-
- if IsOrderDocument() then
- CreateDimSetForPrepmtAccDefaultDim();
-
- OnAfterPrepareOpeningDocumentStatistics(Rec);
-
- Commit();
- end;
-
-
- local procedure IsOrderDocument(): Boolean
- begin
- exit("Document Type" in ["Document Type"::Order, "Document Type"::"Blanket Order", "Document Type"::"Return Order"])
- end;
-
- ///
- /// Determines the available credit limit for the customer associated with the sales header.
- ///
- /// Available credit limit.
- procedure CheckAvailableCreditLimit() ReturnValue: Decimal
- var
- Customer: Record Customer;
- AvailableCreditLimit: Decimal;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckAvailableCreditLimit(Rec, ReturnValue, IsHandled);
- if IsHandled then
- exit(ReturnValue);
-
- if ("Bill-to Customer No." = '') and ("Sell-to Customer No." = '') then
- exit(0);
-
- if not Customer.Get("Bill-to Customer No.") then
- Customer.Get("Sell-to Customer No.");
-
- AvailableCreditLimit := Customer.CalcAvailableCredit();
-
- if AvailableCreditLimit < 0 then
- CustomerCreditLimitExceeded()
- else
- CustomerCreditLimitNotExceeded();
-
- exit(AvailableCreditLimit);
- end;
-
- ///
- /// Sets the status of a sales document.
- ///
- /// New status to set.
- procedure SetStatus(NewStatus: Option)
- begin
- Status := Enum::"Sales Document Status".FromInteger(NewStatus);
- Modify();
- end;
-
- local procedure TestSalesLineFieldsBeforeRecreate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeTestSalesLineFieldsBeforeRecreate(Rec, IsHandled, SalesLine);
- if IsHandled then
- exit;
-
- SalesLine.TestField("Job No.", '');
- SalesLine.TestField("Job Contract Entry No.", 0);
- SalesLine.TestField("Quantity Invoiced", 0);
- SalesLine.TestField("Return Qty. Received", 0);
- SalesLine.TestField("Shipment No.", '');
- SalesLine.TestField("Return Receipt No.", '');
- SalesLine.TestField("Blanket Order No.", '');
- SalesLine.TestField("Prepmt. Amt. Inv.", 0);
- TestQuantityShippedField(SalesLine);
- end;
-
- local procedure RecreateReservEntryReqLine(var TempSalesLine: Record "Sales Line" temporary; var TempATOLink: Record "Assemble-to-Order Link" temporary; var ATOLink: Record "Assemble-to-Order Link"; var TempReqLine: Record "Requisition Line" temporary);
- var
- ShouldValidateLocationCode: Boolean;
- begin
- repeat
- TestSalesLineFieldsBeforeRecreate();
- ShouldValidateLocationCode := (SalesLine."Location Code" <> "Location Code") and not SalesLine.IsNonInventoriableItem();
- OnRecreateReservEntryReqLineOnAfterCalcShouldValidateLocationCode(Rec, xRec, SalesLine, ShouldValidateLocationCode);
- if ShouldValidateLocationCode then begin
- SalesLine.Validate("Location Code", "Location Code");
- if Rec."Document Type" in [Rec."Document Type"::Invoice, Rec."Document Type"::"Credit Memo"] then
- if SalesLine."Location Code" <> '' then
- SalesLine.CheckLocationOnWMS();
- end;
- TempSalesLine := SalesLine;
- if SalesLine.Nonstock then begin
- SalesLine.Nonstock := false;
- SalesLine.Modify();
- end;
-
- if ATOLink.AsmExistsForSalesLine(TempSalesLine) then begin
- TempATOLink := ATOLink;
- TempATOLink.Insert();
- ATOLink.Delete();
- end;
-
- if not IsServiceChargeLine(SalesLine) then
- TempSalesLine.Insert();
- OnAfterInsertTempSalesLine(SalesLine, TempSalesLine);
- SalesLineReserve.CopyReservEntryToTemp(TempReservEntry, SalesLine);
- RecreateReqLine(TempReqLine, SalesLine, 0, true);
- OnRecreateReservEntryReqLineOnAfterLoop(Rec, SalesLine);
- until SalesLine.Next() = 0;
- end;
-
- local procedure IsServiceChargeLine(SalesLine: Record "Sales Line"): Boolean
- begin
- if SalesLine."System-Created Entry" then
- if SalesLine.Type = SalesLine.Type::"G/L Account" then
- if SalesLine.IsServiceChargeLine() then
- exit(true);
- end;
-
- ///
- /// Transfers item charge assignments to the temporary record set and deletes them from the original record.
- ///
- /// Item charge assignment record set to transfer.
- /// Return value: Temporary item charge assignment record set to transfer to.
- procedure TransferItemChargeAssgntSalesToTemp(var ItemChargeAssgntSales: Record "Item Charge Assignment (Sales)"; var TempItemChargeAssgntSales: Record "Item Charge Assignment (Sales)" temporary)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeTransferItemChargeAssgntSalesToTemp(Rec, ItemChargeAssgntSales, TempItemChargeAssgntSales, IsHandled);
- if IsHandled then
- exit;
-
- ItemChargeAssgntSales.SetRange("Document Type", "Document Type");
- ItemChargeAssgntSales.SetRange("Document No.", "No.");
- if ItemChargeAssgntSales.FindSet() then begin
- repeat
- TempItemChargeAssgntSales.Init();
- TempItemChargeAssgntSales := ItemChargeAssgntSales;
- TempItemChargeAssgntSales.Insert();
- until ItemChargeAssgntSales.Next() = 0;
- ItemChargeAssgntSales.DeleteAll();
- end;
- end;
-
- local procedure CreateSalesLine(var TempSalesLine: Record "Sales Line" temporary)
- var
- IsHandled: Boolean;
- ShouldValidateQuantity: Boolean;
- begin
- OnBeforeCreateSalesLine(TempSalesLine, IsHandled, Rec, SalesLine);
- if IsHandled then
- exit;
-
- SalesLine.Init();
- SalesLine."Line No." := SalesLine."Line No." + 10000;
- SalesLine."Price Calculation Method" := "Price Calculation Method";
-
- OnCreateSalesLineOnBeforeAssignType(SalesLine, TempSalesLine, Rec);
- SalesLine.Validate(Type, TempSalesLine.Type);
- OnCreateSalesLineOnAfterAssignType(SalesLine, TempSalesLine);
- if TempSalesLine."No." = '' then begin
- SalesLine.Description := TempSalesLine.Description;
- SalesLine."Description 2" := TempSalesLine."Description 2";
- end else begin
- SalesLine.Validate("No.", TempSalesLine."No.");
- OnCreateSalesLineOnAfterValidateNo(SalesLine, TempSalesLine);
-
- if SalesLine.Type <> SalesLine.Type::" " then begin
- OnCreateSalesLineOnBeforeTransferFieldsFromTempSalesLine(SalesLine, TempSalesLine, Rec);
- SalesLine.Validate("Unit of Measure Code", TempSalesLine."Unit of Measure Code");
- SalesLine.Validate("Variant Code", TempSalesLine."Variant Code");
- ShouldValidateQuantity := TempSalesLine.Quantity <> 0;
- OnCreateSalesLineOnBeforeValidateQuantity(SalesLine, TempSalesLine, ShouldValidateQuantity);
- if ShouldValidateQuantity then begin
- SalesLine.Validate(Quantity, TempSalesLine.Quantity);
- SalesLine.Validate("Qty. to Assemble to Order", TempSalesLine."Qty. to Assemble to Order");
- end;
- SalesLine."Purchase Order No." := TempSalesLine."Purchase Order No.";
- SalesLine."Purch. Order Line No." := TempSalesLine."Purch. Order Line No.";
-
- IsHandled := false;
- OnCreateSalesLineOnBeforeSetDropShipment(SalesLine, TempSalesLine, IsHandled);
- if not IsHandled then
- SalesLine."Drop Shipment" := TempSalesLine."Drop Shipment";
- end;
-
- IsHandled := false;
- OnCreateSalesLineOnBeforeValidateShipmentDate(SalesLine, TempSalesLine, Rec, IsHandled);
- if not IsHandled then
- SalesLine.Validate("Shipment Date", TempSalesLine."Shipment Date");
- end;
- OnBeforeSalesLineInsert(SalesLine, TempSalesLine, Rec);
- SalesLine.Insert();
- OnAfterCreateSalesLine(SalesLine, TempSalesLine);
- end;
-
- local procedure CreateItemChargeAssgntSales(var TempItemChargeAssgntSales: Record "Item Charge Assignment (Sales)" temporary; var TempSalesLine: Record "Sales Line" temporary; var TempInteger: Record "Integer" temporary)
- var
- ItemChargeAssgntSales: Record "Item Charge Assignment (Sales)";
- begin
- ClearItemAssgntSalesFilter(TempItemChargeAssgntSales);
- TempSalesLine.SetRange(Type, SalesLine.Type::"Charge (Item)");
- if TempSalesLine.FindSet() then
- repeat
- TempItemChargeAssgntSales.SetRange("Document Line No.", TempSalesLine."Line No.");
- if TempItemChargeAssgntSales.FindSet() then begin
- repeat
- TempInteger.FindFirst();
- ItemChargeAssgntSales.Init();
- ItemChargeAssgntSales := TempItemChargeAssgntSales;
- ItemChargeAssgntSales."Document Line No." := TempInteger.Number;
- ItemChargeAssgntSales.Validate("Qty. to Assign", 0);
- ItemChargeAssgntSales.Insert();
- until TempItemChargeAssgntSales.Next() = 0;
- TempInteger.Delete();
- end;
- until TempSalesLine.Next() = 0;
-
- ClearItemAssgntSalesFilter(TempItemChargeAssgntSales);
- TempItemChargeAssgntSales.DeleteAll();
- end;
-
- local procedure UpdateOutboundWhseHandlingTime()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateOutboundWhseHandlingTime(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if "Location Code" <> '' then begin
- if Location.Get("Location Code") then
- "Outbound Whse. Handling Time" := Location."Outbound Whse. Handling Time";
- end else
- if InvtSetup.Get() then
- "Outbound Whse. Handling Time" := InvtSetup."Outbound Whse. Handling Time";
- end;
-
- ///
- /// Raised to allow subscribers to add custom restrictions to the sales document posting process.
- ///
- [IntegrationEvent(true, false)]
- procedure OnCheckSalesPostRestrictions()
- begin
- end;
-
- ///
- /// Triggers the OnCheckSalesPostRestrictions event that allows customized restrictions to be added to the sales document post process.
- ///
- procedure CheckSalesPostRestrictions()
- begin
- OnCheckSalesPostRestrictions();
- end;
-
- ///
- /// Raised when the calculated credit amount exceeds the customer's credit limit.
- ///
- /// Specifies the GUID of the credit limit notification.
- [IntegrationEvent(true, false)]
- procedure OnCustomerCreditLimitExceeded(NotificationId: Guid)
- begin
- end;
-
- ///
- /// Triggers the OnCustomerCreditLimitExceeded event that allows a custom solution to be
- /// added when the calculated credit limit exceeds the customer's credit limit.
- ///
- procedure CustomerCreditLimitExceeded()
- var
- NotificationId: Guid;
- begin
- OnCustomerCreditLimitExceeded(NotificationId);
- end;
-
- ///
- /// Triggers the OnCustomerCreditLimitExceeded event that allows a custom solution to be added
- /// when the calculated credit limit exceeds the customer's credit limit.
- ///
- ///
- /// Used on sales lines and sales header check procedures which creates exceeded credit limit notification if needed.
- ///
- /// GUID of the credit limit notification.
- procedure CustomerCreditLimitExceeded(NotificationId: Guid)
- begin
- OnCustomerCreditLimitExceeded(NotificationId);
- end;
-
- ///
- /// Raised when the calculated credit amount does not exceed the customer's credit limit.
- ///
- [IntegrationEvent(true, false)]
- procedure OnCustomerCreditLimitNotExceeded()
- begin
- end;
-
- ///
- /// Triggers the OnCustomerCreditLimitNotExceeded event that allows a custom solution to be added
- /// when the calculated credit limit not exceeds the customer's credit limit.
- ///
- procedure CustomerCreditLimitNotExceeded()
- begin
- OnCustomerCreditLimitNotExceeded();
- end;
-
- ///
- /// Raised to allow subscribers to add custom restrictions to the sales document release process.
- ///
- [IntegrationEvent(true, false)]
- local procedure OnCheckSalesReleaseRestrictions()
- begin
- end;
-
- ///
- /// Checks the sales document approvals if the status is open.
- ///
- procedure CheckSalesReleaseRestrictions()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- OnCheckSalesReleaseRestrictions();
- ApprovalsMgmt.PrePostApprovalCheckSales(Rec);
- end;
-
- ///
- /// Determines whether there are related deferrals.
- ///
- /// True if any related deferal header exists, otherwise false.
- procedure DeferralHeadersExist(): Boolean
- var
- DeferralHeader: Record "Deferral Header";
- begin
- DeferralHeader.SetRange("Deferral Doc. Type", Enum::"Deferral Document Type"::Sales);
- DeferralHeader.SetRange("Gen. Jnl. Template Name", '');
- DeferralHeader.SetRange("Gen. Jnl. Batch Name", '');
- DeferralHeader.SetRange("Document Type", "Document Type");
- DeferralHeader.SetRange("Document No.", "No.");
- OnDeferralHeadersExistOnAfterSetFilters(Rec, DeferralHeader);
- exit(not DeferralHeader.IsEmpty);
- end;
-
- ///
- /// Sets the sell-to customer number from the filter applied to the sell-to customer field if the filter is not blank.
- ///
- procedure SetSellToCustomerFromFilter()
- var
- SellToCustomerNo: Code[20];
- begin
- OnBeforeSetSellToCustomerFromFilter(Rec);
-
- SellToCustomerNo := GetSellToCustomerFromFilter();
-
- if SellToCustomerNo <> '' then
- Validate("Sell-to Customer No.", SellToCustomerNo);
-
- OnAfterSetSellToCustomerFromFilter(Rec);
- end;
-
- ///
- /// Retrieves the sell-to customer no. of a sales header based on a single-value filter applied to the sell-to customer no. field.
- ///
- ///
- /// Single-value filter is retrieved from the current filter group or filter group 2.
- ///
- /// Sell-to customer number.
- procedure GetSellToCustomerFromFilter() SellToCustomerNo: Code[20]
- begin
- SellToCustomerNo := GetFilterCustNo();
- if SellToCustomerNo = '' then begin
- FilterGroup(2);
- SellToCustomerNo := GetFilterCustNo();
- if SellToCustomerNo = '' then
- SellToCustomerNo := GetFilterCustNoByApplyingFilter();
- FilterGroup(0);
- end;
- end;
-
- ///
- /// Moves the filter on sell-to customer no. from the current filter group to filter group 2.
- ///
- procedure CopySellToCustomerFilter()
- var
- SellToCustomerFilter: Text;
- begin
- SellToCustomerFilter := GetFilter("Sell-to Customer No.");
- OnCopySellToCustomerFilterOnAfterGetSellToCustomerFilter(Rec, SellToCustomerFilter);
- if SellToCustomerFilter <> '' then begin
- FilterGroup(2);
- SetFilter("Sell-to Customer No.", SellToCustomerFilter);
- FilterGroup(0)
- end;
- end;
-
- local procedure ConfirmBillToCustomerChange() Confirmed: Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeConfirmBillToCustomerChange(Rec, xRec, CurrFieldNo, Confirmed, IsHandled);
- if IsHandled then
- exit(Confirmed);
-
- if GetHideValidationDialog() or not GuiAllowed then
- Confirmed := true
- else
- Confirmed := Confirm(ConfirmChangeQst, false, BillToCustomerTxt);
- end;
-
- local procedure ConfirmUpdateDeferralDate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeConfirmUpdateDeferralDate(Rec, xRec, CurrFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- if GetHideValidationDialog() or not GuiAllowed then
- Confirmed := true
- else
- Confirmed := Confirm(DeferralLineQst, false);
- if Confirmed then
- UpdateSalesLinesByFieldNo(SalesLine.FieldNo("Deferral Code"), false);
- end;
-
- ///
- /// Raises a confirmation to update the deferral schedules on the lines to reflect the changed dates.
- /// If user confirms the update, the sales lines are updated.
- ///
- ///
- /// If true, the sales header's posting date will be replaced with the specified PostingDateReq.
- /// Posting date to replace.
- ///
- /// Vat reporting date to replace.
- procedure BatchConfirmUpdateDeferralDate(var BatchConfirm: Option " ",Skip,Update; ReplacePostingDate: Boolean; PostingDateReq: Date; ReplaceVATDate: Boolean; VATDateReq: Date)
- begin
- if ((not ReplacePostingDate) and (not ReplaceVATDate)) or (BatchConfirm = BatchConfirm::Skip) then
- exit;
- if (PostingDateReq = "Posting Date") and (VATDateReq = "VAT Reporting Date") then
- exit;
- if not DeferralHeadersExist() then
- exit;
-
- if ReplacePostingDate then
- "Posting Date" := PostingDateReq;
- if ReplaceVATDate then
- "VAT Reporting Date" := VATDateReq;
-
- case BatchConfirm of
- BatchConfirm::" ":
- begin
- ConfirmUpdateDeferralDate();
- if Confirmed then
- BatchConfirm := BatchConfirm::Update
- else
- BatchConfirm := BatchConfirm::Skip;
- end;
- BatchConfirm::Update:
- UpdateSalesLinesByFieldNo(SalesLine.FieldNo("Deferral Code"), false);
- end;
- Commit();
- end;
-
- ///
- /// Updates the posting date, VAT reporting date, and document date on the sales header during batch posting.
- ///
- /// Specifies whether to replace the posting date.
- /// Specifies the new posting date to set.
- /// Specifies whether to replace the VAT reporting date.
- /// Specifies the new VAT reporting date to set.
- /// Specifies whether to replace the document date.
- procedure BatchConfirmUpdatePostingDate(ReplacePostingDate: Boolean; PostingDateReq: Date; ReplaceVATDate: Boolean; VATDateReq: Date; ReplaceDocDate: Boolean)
- begin
- if not ReplacePostingDate then
- exit;
- if (PostingDateReq = "Posting Date") then
- exit;
- if DeferralHeadersExist() then
- exit;
-
- "Posting Date" := PostingDateReq;
- if "Currency Code" <> '' then begin
- UpdateCurrencyFactor();
- UpdateSalesLinesByFieldNo(SalesHeader.FieldNo("Currency Factor"), false);
- end;
-
- if ReplaceVATDate then
- "VAT Reporting Date" := VATDateReq;
-
- if ReplacePostingDate and ReplaceDocDate and ("Document Date" <> PostingDateReq) then begin
- UpdateDocumentDate := true;
- Validate("Document Date", PostingDateReq);
- end;
-
- Commit();
- end;
-
-
- ///
- /// Retrieves the name of the payment service assigned to the document.
- ///
- procedure GetSelectedPaymentServicesText(): Text
- var
- PaymentServiceSetup: Record "Payment Service Setup";
- begin
- exit(PaymentServiceSetup.GetSelectedPaymentsText("Payment Service Set ID"));
- end;
-
- ///
- /// Updates the payment service on the document with the default payment service from the setup.
- ///
- procedure SetDefaultPaymentServices()
- var
- PaymentServiceSetup: Record "Payment Service Setup";
- SetID: Integer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetDefaultPaymentServices(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if not PaymentServiceSetup.CanChangePaymentService(Rec) then
- exit;
-
- if PaymentServiceSetup.GetDefaultPaymentServices(SetID) then
- Validate("Payment Service Set ID", SetID);
- end;
-
- ///
- /// Opens a page to either select an existing payment service or set up a new one if none exists.
- /// The payment service is then assigned to the document.
- ///
- procedure ChangePaymentServiceSetting()
- var
- PaymentServiceSetup: Record "Payment Service Setup";
- SetID: Integer;
- begin
- SetID := "Payment Service Set ID";
- if PaymentServiceSetup.SelectPaymentService(SetID) then begin
- Validate("Payment Service Set ID", SetID);
- Modify(true);
- end;
- end;
-
- ///
- /// Check if sales header is credit document type. Credit documents are return orders and credit memos.
- ///
- /// True if the sales header is a credit document, otherwise false.
- procedure IsCreditDocType() CreditDocType: Boolean
- begin
- CreditDocType := "Document Type" in ["Document Type"::"Return Order", "Document Type"::"Credit Memo"];
- OnBeforeIsCreditDocType(Rec, CreditDocType);
- end;
-
- ///
- /// Determines if sales header has sell-to information.
- ///
- /// True if sales header has sell-to information, otherwise false.
- procedure HasSellToAddress() Result: Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeHasSellToAddress(Rec, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- case true of
- "Sell-to Address" <> '':
- exit(true);
- "Sell-to Address 2" <> '':
- exit(true);
- "Sell-to City" <> '':
- exit(true);
- "Sell-to Country/Region Code" <> '':
- exit(true);
- "Sell-to County" <> '':
- exit(true);
- "Sell-to Post Code" <> '':
- exit(true);
- "Sell-to Contact" <> '':
- exit(true);
- end;
-
- exit(false);
- end;
-
- ///
- /// Determines if sales header has ship-to information.
- ///
- /// True if sales header has ship-to information, otherwise false.
- procedure HasShipToAddress() Result: Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeHasShipToAddress(Rec, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- case true of
- "Ship-to Address" <> '':
- exit(true);
- "Ship-to Address 2" <> '':
- exit(true);
- "Ship-to City" <> '':
- exit(true);
- "Ship-to Country/Region Code" <> '':
- exit(true);
- "Ship-to County" <> '':
- exit(true);
- "Ship-to Post Code" <> '':
- exit(true);
- "Ship-to Contact" <> '':
- exit(true);
- end;
-
- exit(false);
- end;
-
- ///
- /// Determines if sales header has bill-to information.
- ///
- /// True if sales header has bill-to information, otherwise false.
- procedure HasBillToAddress() Result: Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeHasBillToAddress(Rec, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- case true of
- "Bill-to Address" <> '':
- exit(true);
- "Bill-to Address 2" <> '':
- exit(true);
- "Bill-to City" <> '':
- exit(true);
- "Bill-to Country/Region Code" <> '':
- exit(true);
- "Bill-to County" <> '':
- exit(true);
- "Bill-to Post Code" <> '':
- exit(true);
- "Bill-to Contact" <> '':
- exit(true);
- end;
-
- exit(false);
- end;
-
- ///
- /// Determines if the sales header has any item charge assignments.
- ///
- /// True if item charge assignments exists, otherwise false.
- procedure HasItemChargeAssignment(): Boolean
- var
- ItemChargeAssgntSales: Record "Item Charge Assignment (Sales)";
- begin
- ItemChargeAssgntSales.SetRange("Document Type", "Document Type");
- ItemChargeAssgntSales.SetRange("Document No.", "No.");
- ItemChargeAssgntSales.SetFilter("Amount to Assign", '<>%1', 0);
- exit(not ItemChargeAssgntSales.IsEmpty);
- end;
-
- local procedure CopySellToCustomerAddressFieldsFromCustomer(var SellToCustomer: Record Customer)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCopySellToCustomerAddressFieldsFromCustomer(Rec, SellToCustomer, IsHandled);
- if not IsHandled then begin
- "Sell-to Customer Templ. Code" := '';
- "Sell-to Customer Name" := Customer.Name;
- "Sell-to Customer Name 2" := Customer."Name 2";
- "Sell-to Phone No." := Customer."Phone No.";
- "Sell-to E-Mail" := Customer."E-Mail";
- if SellToCustomerIsReplaced() or
- ShouldCopyAddressFromSellToCustomer(SellToCustomer) or
- (HasDifferentSellToAddress(SellToCustomer) and SellToCustomer.HasAddress())
- then begin
- "Sell-to Address" := SellToCustomer.Address;
- "Sell-to Address 2" := SellToCustomer."Address 2";
- "Sell-to City" := SellToCustomer.City;
- "Sell-to Post Code" := SellToCustomer."Post Code";
- "Sell-to County" := SellToCustomer.County;
- "Sell-to Country/Region Code" := SellToCustomer."Country/Region Code";
- OnCopySellToCustomerAddressFieldsFromCustomerOnAfterAssignSellToCustomerAddress(Rec, SellToCustomer);
- end;
- if not SkipSellToContact then
- "Sell-to Contact" := SellToCustomer.Contact;
- "Gen. Bus. Posting Group" := SellToCustomer."Gen. Bus. Posting Group";
- if "VAT Bus. Posting Group" = '' then
- "VAT Bus. Posting Group" := SellToCustomer."VAT Bus. Posting Group"
- else
- Validate("VAT Bus. Posting Group", SellToCustomer."VAT Bus. Posting Group");
- "Tax Area Code" := SellToCustomer."Tax Area Code";
- "Tax Liable" := SellToCustomer."Tax Liable";
- "Registration Number" := SellToCustomer."Registration Number";
- "VAT Country/Region Code" := SellToCustomer."Country/Region Code";
- "VAT Registration No." := SellToCustomer.GetVATRegistrationNo();
- "Shipping Advice" := SellToCustomer."Shipping Advice";
- "Salesperson Code" := SellToCustomer."Salesperson Code";
- IsHandled := false;
- OnCopySelltoCustomerAddressFieldsFromCustomerOnBeforeAssignRespCenter(Rec, SellToCustomer, IsHandled);
- if not IsHandled then begin
- "Responsibility Center" := UserSetupMgt.GetRespCenter(0, SellToCustomer."Responsibility Center");
- OnCopySelltoCustomerAddressFieldsFromCustomerOnAfterAssignRespCenter(Rec, SellToCustomer, CurrFieldNo);
- end;
- IsHandled := false;
- OnCopySellToCustomerAddressFieldsFromCustomerOnBeforeUpdateLocation(Rec, SellToCustomer, IsHandled);
- if not IsHandled then
- UpdateLocationCode(SellToCustomer."Location Code");
- end;
-
- OnAfterCopySellToCustomerAddressFieldsFromCustomer(Rec, SellToCustomer, CurrFieldNo, SkipBillToContact, SkipSellToContact);
- end;
-
- ///
- /// Updates sales header with data from provided sell-to customer record.
- ///
- /// Sell-to customer record to copy data from.
- procedure CopyShipToCustomerAddressFieldsFromCust(var SellToCustomer: Record Customer)
- var
- CustomerTempl: Record "Customer Templ.";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCopyShipToCustomerAddressFieldsFromCustomer(Rec, SellToCustomer, IsHandled);
- if IsHandled then
- exit;
-
- "Ship-to Name" := SellToCustomer.Name;
- "Ship-to Name 2" := SellToCustomer."Name 2";
- if SellToCustomerIsReplaced() or
- ShipToAddressEqualsOldSellToAddress() or
- (HasDifferentShipToAddress(SellToCustomer) and SellToCustomer.HasAddress())
- then begin
- "Ship-to Address" := SellToCustomer.Address;
- "Ship-to Address 2" := SellToCustomer."Address 2";
- "Ship-to City" := SellToCustomer.City;
- "Ship-to Post Code" := SellToCustomer."Post Code";
- "Ship-to County" := SellToCustomer.County;
- "Ship-to Phone No." := SellToCustomer."Phone No.";
- Validate("Ship-to Country/Region Code", SellToCustomer."Country/Region Code");
- OnCopyShipToCustomerAddressFieldsFromCustOnAfterAssignAddressFromSellToCustomer(Rec, SellToCustomer);
- end;
- "Ship-to Phone No." := SellToCustomer."Phone No.";
- "Ship-to Contact" := SellToCustomer.Contact;
- if not CustomerTempl.Get("Sell-to Customer Templ. Code") then begin
- Validate("Tax Area Code", SellToCustomer."Tax Area Code");
- Validate("Tax Liable", SellToCustomer."Tax Liable");
- end;
- SetCustomerLocationCode(SellToCustomer);
-
- IsHandled := false;
- OnCopyShipToCustomerAddressFieldsFromCustOnBeforeValidateShippingAgentFields(Rec, xRec, SellToCustomer, IsHandled);
- if not IsHandled then begin
- Validate("Shipping Agent Code", SellToCustomer."Shipping Agent Code");
- Validate("Shipping Agent Service Code", SellToCustomer."Shipping Agent Service Code");
- end;
-
- OnAfterCopyShipToCustomerAddressFieldsFromCustomer(Rec, SellToCustomer, xRec);
- end;
-
- local procedure SetCustomerLocationCode(SellToCustomer: Record Customer)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetCustomerLocationCode(Rec, IsHandled, SellToCustomer);
- if IsHandled then
- exit;
-
- if SellToCustomer."Location Code" <> '' then
- Validate("Location Code", SellToCustomer."Location Code");
- end;
-
- local procedure SetCompanyBankAccount()
- var
- BankAccount: Record "Bank Account";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetCompanyBankAccount(Rec, IsHandled);
- if not IsHandled then
- Validate("Company Bank Account Code", BankAccount.GetDefaultBankAccountNoForCurrency("Currency Code"));
- OnAfterSetCompanyBankAccount(Rec, xRec);
- end;
-
- ///
- /// Updates the document's shipping address from the provided ship-to address.
- ///
- /// Ship-to address to update the shipping address with.
- procedure SetShipToCustomerAddressFieldsFromShipToAddr(ShipToAddr: Record "Ship-to Address")
- var
- IsHandled: Boolean;
- ShouldCopyLocationCode: Boolean;
- ShouldCopySalespersonCode: Boolean;
- begin
- IsHandled := false;
- OnBeforeCopyShipToCustomerAddressFieldsFromShipToAddr(Rec, ShipToAddr, IsHandled);
- if IsHandled then
- exit;
-
- "Ship-to Name" := ShipToAddr.Name;
- "Ship-to Name 2" := ShipToAddr."Name 2";
- "Ship-to Address" := ShipToAddr.Address;
- "Ship-to Address 2" := ShipToAddr."Address 2";
- "Ship-to City" := ShipToAddr.City;
- "Ship-to Post Code" := ShipToAddr."Post Code";
- "Ship-to County" := ShipToAddr.County;
- Validate("Ship-to Country/Region Code", ShipToAddr."Country/Region Code");
- "Ship-to Phone No." := ShipToAddr."Phone No.";
- "Ship-to Contact" := ShipToAddr.Contact;
- ShouldCopyLocationCode := ShipToAddr."Location Code" <> '';
- ShouldCopySalespersonCode := (ShipToAddr."Salesperson Code" <> '') and (ShipToAddr."Salesperson Code" <> "Salesperson Code");
- OnSetShipToCustomerAddressFieldsFromShipToAddrOnAfterCalcShouldCopyLocationCode(Rec, xRec, ShipToAddr, ShouldCopyLocationCode, ShouldCopySalespersonCode);
- if ShouldCopyLocationCode then
- Validate("Location Code", ShipToAddr."Location Code");
- if ShouldCopySalespersonCode then
- Validate("Salesperson Code", ShipToAddr."Salesperson Code");
- IsHandled := false;
- OnSetShipToCustomerAddressFieldsFromShipToAddrOnBeforeValidateShippingAgentFields(Rec, xRec, ShipToAddr, IsHandled);
- if not IsHandled then begin
- Validate("Shipping Agent Code", ShipToAddr."Shipping Agent Code");
- Validate("Shipping Agent Service Code", ShipToAddr."Shipping Agent Service Code");
- end;
- if ShipToAddr."Tax Area Code" <> '' then
- Validate("Tax Area Code", ShipToAddr."Tax Area Code");
- Validate("Tax Liable", ShipToAddr."Tax Liable");
-
- OnAfterCopyShipToCustomerAddressFieldsFromShipToAddr(Rec, ShipToAddr, xRec);
- end;
-
- ///
- /// Updates the billing information on the document from the provided bill-to customer.
- ///
- /// Bill-to customer to update the billing infromation from.
- procedure SetBillToCustomerAddressFieldsFromCustomer(var BillToCustomer: Record Customer)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetBillToCustomerAddressFieldsFromCustomer(Rec, BillToCustomer, SkipBillToContact, IsHandled, xRec, GLSetup, CurrFieldNo);
- if IsHandled then
- exit;
-
- "Bill-to Customer Templ. Code" := '';
- "Bill-to Name" := BillToCustomer.Name;
- "Bill-to Name 2" := BillToCustomer."Name 2";
- if BillToCustomerIsReplaced() or
- ShouldCopyAddressFromBillToCustomer(BillToCustomer) or
- (HasDifferentBillToAddress(BillToCustomer) and BillToCustomer.HasAddress())
- then begin
- "Bill-to Address" := BillToCustomer.Address;
- "Bill-to Address 2" := BillToCustomer."Address 2";
- "Bill-to City" := BillToCustomer.City;
- "Bill-to Post Code" := BillToCustomer."Post Code";
- "Bill-to County" := BillToCustomer.County;
- "Bill-to Country/Region Code" := BillToCustomer."Country/Region Code";
- OnSetBillToCustomerAddressFieldsFromCustomerOnAfterAssignBillToCustomerAddress(Rec, BillToCustomer);
- end;
- if not SkipBillToContact then
- "Bill-to Contact" := BillToCustomer.Contact;
- "Payment Terms Code" := BillToCustomer."Payment Terms Code";
- "Prepmt. Payment Terms Code" := BillToCustomer."Payment Terms Code";
-
- if "Document Type" in ["Document Type"::"Credit Memo", "Document Type"::"Return Order"] then begin
- "Payment Method Code" := '';
- if PaymentTerms.Get("Payment Terms Code") then
- if PaymentTerms."Calc. Pmt. Disc. on Cr. Memos" then
- "Payment Method Code" := BillToCustomer."Payment Method Code"
- end else
- "Payment Method Code" := BillToCustomer."Payment Method Code";
-
- AltCustVATRegFacade.UpdateSetupOnBillToCustomerChangeInSalesHeader(Rec, xRec, BillToCustomer);
-
- "Customer Posting Group" := BillToCustomer."Customer Posting Group";
- "Currency Code" := BillToCustomer."Currency Code";
- "Customer Price Group" := BillToCustomer."Customer Price Group";
- "Prices Including VAT" := BillToCustomer."Prices Including VAT";
- "Price Calculation Method" := BillToCustomer.GetPriceCalculationMethod();
- "Allow Line Disc." := BillToCustomer."Allow Line Disc.";
- "Invoice Disc. Code" := BillToCustomer."Invoice Disc. Code";
- "Customer Disc. Group" := BillToCustomer."Customer Disc. Group";
- "Language Code" := BillToCustomer."Language Code";
- "Format Region" := BillToCustomer."Format Region";
- if (BilltoCustomer."No." <> "Sell-to Customer No.") or BillToCustomerIsReplaced() then
- UpdateShipToSalespersonCode(FieldNo("Bill-to Customer No."));
- "Combine Shipments" := BillToCustomer."Combine Shipments";
- Reserve := BillToCustomer.Reserve;
- if "Document Type" in ["Document Type"::Order, "Document Type"::Quote] then
- "Prepayment %" := BillToCustomer."Prepayment %";
- "Tax Area Code" := BillToCustomer."Tax Area Code";
- if ("Ship-to Code" = '') or ("Sell-to Customer No." <> BillToCustomer."No.") then
- "Tax Liable" := BillToCustomer."Tax Liable";
- "Transaction Mode Code" := BillToCustomer."Transaction Mode Code";
- "Bank Account Code" := BillToCustomer."Preferred Bank Account Code";
-
- OnAfterSetFieldsBilltoCustomer(Rec, BillToCustomer, xRec, SkipBillToContact, CurrFieldNo);
- end;
-
- ///
- /// Sets the shipping address details for a sales header.
- ///
- /// New ship-to name value.
- /// New ship-to name 2 value.
- /// New ship-to address value.
- /// New ship-to address 2 value.
- /// New ship-to city value.
- /// New ship-to post code value.
- /// New ship-to county value.
- /// New ship-to country/region code value.
- procedure SetShipToAddress(ShipToName: Text[100]; ShipToName2: Text[50]; ShipToAddress: Text[100]; ShipToAddress2: Text[50]; ShipToCity: Text[30]; ShipToPostCode: Code[20]; ShipToCounty: Text[30]; ShipToCountryRegionCode: Code[10])
- begin
- "Ship-to Name" := ShipToName;
- "Ship-to Name 2" := ShipToName2;
- "Ship-to Address" := ShipToAddress;
- "Ship-to Address 2" := ShipToAddress2;
- "Ship-to City" := ShipToCity;
- "Ship-to Post Code" := ShipToPostCode;
- "Ship-to County" := ShipToCounty;
- "Ship-to Country/Region Code" := ShipToCountryRegionCode;
-
- OnAfterSetShipToAddress(Rec);
- end;
-
- local procedure ShouldCopyAddressFromSellToCustomer(SellToCustomer: Record Customer): Boolean
- begin
- exit((not HasSellToAddress()) and SellToCustomer.HasAddress());
- end;
-
- local procedure ShouldCopyAddressFromBillToCustomer(BillToCustomer: Record Customer): Boolean
- var
- IsHandled: Boolean;
- Result: Boolean;
- begin
- IsHandled := false;
- OnBeforeShouldCopyAddressFromBillToCustomer(BillToCustomer, Rec, xRec, IsHandled, Result);
- if IsHandled then
- exit(Result);
-
- exit(((not HasBillToAddress()) and BillToCustomer.HasAddress()) or (xRec."Bill-to Contact" <> BillToCustomer.Contact));
- end;
-
- local procedure SellToCustomerIsReplaced(): Boolean
- begin
- exit((xRec."Sell-to Customer No." <> '') and (xRec."Sell-to Customer No." <> "Sell-to Customer No."));
- end;
-
- local procedure BillToCustomerIsReplaced(): Boolean
- var
- IsHandled: Boolean;
- Result: Boolean;
- begin
- IsHandled := false;
- OnBeforeBillToCustomerIsReplaced(Rec, xRec, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- exit((xRec."Bill-to Customer No." <> '') and (xRec."Bill-to Customer No." <> "Bill-to Customer No."));
- end;
-
- local procedure UpdateShipToAddressFromSellToAddress(FieldNumber: Integer)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateShipToAddressFromSellToAddress(Rec, FieldNumber, IsHandled);
- if IsHandled then
- exit;
-
- if ("Ship-to Code" = '') and ShipToAddressEqualsOldSellToAddress() then begin
- case FieldNumber of
- FieldNo("Ship-to Address"):
- "Ship-to Address" := "Sell-to Address";
- FieldNo("Ship-to Address 2"):
- "Ship-to Address 2" := "Sell-to Address 2";
- FieldNo("Ship-to City"), FieldNo("Ship-to Post Code"):
- begin
- "Ship-to City" := "Sell-to City";
- "Ship-to Post Code" := "Sell-to Post Code";
- "Ship-to County" := "Sell-to County";
- "Ship-to Country/Region Code" := "Sell-to Country/Region Code";
- end;
- FieldNo("Ship-to County"):
- "Ship-to County" := "Sell-to County";
- FieldNo("Ship-to Country/Region Code"):
- "Ship-to Country/Region Code" := "Sell-to Country/Region Code";
- FieldNo("Ship-to Phone No."):
- "Ship-to Phone No." := "Sell-to Phone No.";
- end;
- OnAfterUpdateShipToAddressFromSellToAddress(Rec, xRec, FieldNumber);
- end;
- end;
-
- local procedure ShipToAddressEqualsOldSellToAddress(): Boolean
- begin
- exit(IsShipToAddressEqualToSellToAddress(xRec, Rec));
- end;
-
- ///
- /// Determines if sell-to address matches the ship-to address.
- ///
- /// True if the address match, otherwise false.
- procedure ShipToAddressEqualsSellToAddress(): Boolean
- begin
- exit(IsShipToAddressEqualToSellToAddress(Rec, Rec));
- end;
-
- local procedure IsShipToAddressEqualToSellToAddress(SalesHeaderWithSellTo: Record "Sales Header"; SalesHeaderWithShipTo: Record "Sales Header"): Boolean
- var
- Result: Boolean;
- begin
- Result :=
- (SalesHeaderWithSellTo."Sell-to Address" = SalesHeaderWithShipTo."Ship-to Address") and
- (SalesHeaderWithSellTo."Sell-to Address 2" = SalesHeaderWithShipTo."Ship-to Address 2") and
- (SalesHeaderWithSellTo."Sell-to City" = SalesHeaderWithShipTo."Ship-to City") and
- (SalesHeaderWithSellTo."Sell-to County" = SalesHeaderWithShipTo."Ship-to County") and
- (SalesHeaderWithSellTo."Sell-to Post Code" = SalesHeaderWithShipTo."Ship-to Post Code") and
- (SalesHeaderWithSellTo."Sell-to Country/Region Code" = SalesHeaderWithShipTo."Ship-to Country/Region Code") and
- (SalesHeaderWithSellTo."Sell-to Phone No." = SalesHeaderWithShipTo."Ship-to Phone No.") and
- (SalesHeaderWithSellTo."Sell-to Contact" = SalesHeaderWithShipTo."Ship-to Contact");
-
- OnAfterIsShipToAddressEqualToSellToAddress(SalesHeaderWithSellTo, SalesHeaderWithShipTo, Result);
- exit(Result);
- end;
-
- ///
- /// Determines if sell-to address matches the bill-to address.
- ///
- /// True if addresses match, otherwise false.
- procedure BillToAddressEqualsSellToAddress(): Boolean
- begin
- exit(IsBillToAddressEqualToSellToAddress(Rec, Rec));
- end;
-
- local procedure IsBillToAddressEqualToSellToAddress(SalesHeaderWithSellTo: Record "Sales Header"; SalesHeaderWithBillTo: Record "Sales Header") Result: Boolean
- begin
- Result := (SalesHeaderWithSellTo."Sell-to Address" = SalesHeaderWithBillTo."Bill-to Address") and
- (SalesHeaderWithSellTo."Sell-to Address 2" = SalesHeaderWithBillTo."Bill-to Address 2") and
- (SalesHeaderWithSellTo."Sell-to City" = SalesHeaderWithBillTo."Bill-to City") and
- (SalesHeaderWithSellTo."Sell-to County" = SalesHeaderWithBillTo."Bill-to County") and
- (SalesHeaderWithSellTo."Sell-to Post Code" = SalesHeaderWithBillTo."Bill-to Post Code") and
- (SalesHeaderWithSellTo."Sell-to Country/Region Code" = SalesHeaderWithBillTo."Bill-to Country/Region Code") and
- (SalesHeaderWithSellTo."Sell-to Contact No." = SalesHeaderWithBillTo."Bill-to Contact No.") and
- (SalesHeaderWithSellTo."Sell-to Contact" = SalesHeaderWithBillTo."Bill-to Contact");
- OnAfterIsBillToAddressEqualToSellToAddress(SalesHeaderWithSellTo, SalesHeaderWithBillTo, Result);
- end;
-
- ///
- /// Copies the sell-to address to the ship-to address.
- ///
- procedure CopySellToAddressToShipToAddress()
- begin
- "Ship-to Address" := "Sell-to Address";
- "Ship-to Address 2" := "Sell-to Address 2";
- "Ship-to City" := "Sell-to City";
- "Ship-to Contact" := "Sell-to Contact";
- "Ship-to Country/Region Code" := "Sell-to Country/Region Code";
- "Ship-to County" := "Sell-to County";
- "Ship-to Post Code" := "Sell-to Post Code";
- "Ship-to Phone No." := "Sell-to Phone No.";
-
- OnAfterCopySellToAddressToShipToAddress(Rec);
- end;
-
- ///
- /// Copies the sell-to address to the bill-to address if bill-to and sell-to customer numbers are the same.
- ///
- procedure CopySellToAddressToBillToAddress()
- begin
- OnBeforeCopySellToAddressToBillToAddress(Rec);
- if "Bill-to Customer No." = "Sell-to Customer No." then begin
- "Bill-to Address" := "Sell-to Address";
- "Bill-to Address 2" := "Sell-to Address 2";
- "Bill-to Post Code" := "Sell-to Post Code";
- "Bill-to Country/Region Code" := "Sell-to Country/Region Code";
- "Bill-to City" := "Sell-to City";
- "Bill-to County" := "Sell-to County";
- OnAfterCopySellToAddressToBillToAddress(Rec);
- end;
- end;
-
- local procedure UpdateShipToContact()
- var
- ShipToAddress: Record "Ship-to Address";
- IsHandled: Boolean;
- begin
- if not (CurrFieldNo in [FieldNo("Sell-to Contact"), FieldNo("Sell-to Contact No.")]) then
- exit;
-
- if IsCreditDocType() then
- exit;
-
- if "Ship-to Code" <> '' then
- if ShipToAddress.Get("Sell-to Customer No.", "Ship-to Code") then
- if ShipToAddress.Contact <> '' then
- exit;
-
- IsHandled := false;
- OnUpdateShipToContactOnBeforeValidateShipToContact(Rec, xRec, CurrFieldNo, IsHandled);
- if not IsHandled then
- Validate("Ship-to Contact", "Sell-to Contact");
- end;
-
- ///
- /// Raises a dialog to confirm closing a page if unposted lines exist.
- ///
- /// True if page should be closed, otherwise false.
- procedure ConfirmCloseUnposted() Result: Boolean
- var
- InstructionMgt: Codeunit "Instruction Mgt.";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeConfirmCloseUnposted(Rec, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if SalesLinesExist() then begin
- IsHandled := false;
- OnConfirmCloseUnpostedOnSalesLinesExist(Rec, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if InstructionMgt.IsUnpostedEnabledForRecord(Rec) then
- exit(InstructionMgt.ShowConfirm(DocumentNotPostedClosePageQst, InstructionMgt.QueryPostOnCloseCode()));
- end;
- exit(true)
- end;
-
- local procedure UpdateOpportunity()
- var
- Opp: Record Opportunity;
- OpportunityEntry: Record "Opportunity Entry";
- ConfirmManagement: Codeunit "Confirm Management";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateOpportunity(IsHandled, Rec);
- if IsHandled then
- exit;
-
- if not ("Opportunity No." <> '') or not ("Document Type" in ["Document Type"::Quote, "Document Type"::Order]) then
- exit;
-
- if not Opp.Get("Opportunity No.") then
- exit;
-
- if "Document Type" = "Document Type"::Order then begin
- if not ConfirmManagement.GetResponseOrDefault(Text040, true) then
- Error(Text044);
-
- OpportunityEntry.SetRange("Opportunity No.", "Opportunity No.");
- OpportunityEntry.ModifyAll(Active, false);
-
- OpportunityEntry.Init();
- OpportunityEntry.Validate("Opportunity No.", Opp."No.");
-
- OpportunityEntry.LockTable();
- OpportunityEntry."Entry No." := OpportunityEntry.GetLastEntryNo() + 1;
- OpportunityEntry."Sales Cycle Code" := Opp."Sales Cycle Code";
- OpportunityEntry."Contact No." := Opp."Contact No.";
- OpportunityEntry."Contact Company No." := Opp."Contact Company No.";
- OpportunityEntry."Salesperson Code" := Opp."Salesperson Code";
- OpportunityEntry."Campaign No." := Opp."Campaign No.";
- OpportunityEntry."Action Taken" := OpportunityEntry."Action Taken"::Lost;
- OpportunityEntry.Active := true;
- OpportunityEntry."Completed %" := 100;
- OpportunityEntry."Estimated Value (LCY)" := GetOpportunityEntryEstimatedValue();
- OpportunityEntry."Estimated Close Date" := Opp."Date Closed";
- OpportunityEntry.Insert(true);
- end;
- Opp.Find();
- Opp."Sales Document Type" := Opp."Sales Document Type"::" ";
- Opp."Sales Document No." := '';
- OnUpdateOpportunityOnBeforeModify(Opp, Rec);
- Opp.Modify();
- "Opportunity No." := '';
- end;
-
- local procedure GetOpportunityEntryEstimatedValue(): Decimal
- var
- OpportunityEntry: Record "Opportunity Entry";
- begin
- OpportunityEntry.SetRange("Opportunity No.", "Opportunity No.");
- if OpportunityEntry.FindLast() then
- exit(OpportunityEntry."Estimated Value (LCY)");
- end;
-
- ///
- /// Initializes a sales header from the provided sales header.
- ///
- /// Sales header to copy information from.
- procedure InitFromSalesHeader(SourceSalesHeader: Record "Sales Header")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInitFromSalesHeader(Rec, SourceSalesHeader, IsHandled);
- if not IsHandled then begin
- "Document Date" := SourceSalesHeader."Document Date";
- "Shipment Date" := SourceSalesHeader."Shipment Date";
- "Shortcut Dimension 1 Code" := SourceSalesHeader."Shortcut Dimension 1 Code";
- "Shortcut Dimension 2 Code" := SourceSalesHeader."Shortcut Dimension 2 Code";
- "Dimension Set ID" := SourceSalesHeader."Dimension Set ID";
- "Location Code" := SourceSalesHeader."Location Code";
- SetShipToAddress(
- SourceSalesHeader."Ship-to Name", SourceSalesHeader."Ship-to Name 2", SourceSalesHeader."Ship-to Address",
- SourceSalesHeader."Ship-to Address 2", SourceSalesHeader."Ship-to City", SourceSalesHeader."Ship-to Post Code",
- SourceSalesHeader."Ship-to County", SourceSalesHeader."Ship-to Country/Region Code");
- "Ship-to Phone No." := SourceSalesHeader."Ship-to Phone No.";
- "Ship-to Contact" := SourceSalesHeader."Ship-to Contact";
- end;
-
- OnAfterInitFromSalesHeader(Rec, SourceSalesHeader);
- end;
-
- local procedure InitFromContact(ContactNo: Code[20]; CustomerNo: Code[20]; ContactCaption: Text): Boolean
- begin
- SalesLine.Reset();
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
- if (ContactNo = '') and (CustomerNo = '') then begin
- if not SalesLine.IsEmpty() then
- Error(Text005, ContactCaption);
- Init();
- GetSalesSetup();
- "No. Series" := xRec."No. Series";
- OnInitFromContactOnBeforeInitRecord(Rec, xRec);
- InitRecord();
- InitNoSeries();
- OnInitFromContactOnAfterInitNoSeries(Rec, xRec);
- exit(true);
- end;
- end;
-
- local procedure InitFromTemplate(TemplateCode: Code[20]; TemplateCaption: Text): Boolean
- begin
- SalesLine.Reset();
- SalesLine.SetRange("Document Type", "Document Type");
- SalesLine.SetRange("Document No.", "No.");
- if TemplateCode = '' then begin
- if not SalesLine.IsEmpty() then
- Error(Text005, TemplateCaption);
- Init();
- GetSalesSetup();
- "No. Series" := xRec."No. Series";
- OnInitFromTemplateOnBeforeInitRecord(Rec, xRec);
- InitRecord();
- InitNoSeries();
- OnInitFromTemplateOnAfterInitNoSeries(Rec, xRec);
- exit(true);
- end;
- end;
-
- local procedure InitFromBillToCustTemplate(BillToCustTemplate: Record "Customer Templ.")
- begin
- OnBeforeInitFromBillToCustTemplate(Rec, xRec, BillToCustTemplate);
-
- BillToCustTemplate.TestField("Customer Posting Group");
- "Customer Posting Group" := BillToCustTemplate."Customer Posting Group";
- "Invoice Disc. Code" := BillToCustTemplate."Invoice Disc. Code";
- "Customer Price Group" := BillToCustTemplate."Customer Price Group";
- "Customer Disc. Group" := BillToCustTemplate."Customer Disc. Group";
- "Allow Line Disc." := BillToCustTemplate."Allow Line Disc.";
- Validate("Payment Terms Code", BillToCustTemplate."Payment Terms Code");
- Validate("Payment Method Code", BillToCustTemplate."Payment Method Code");
- "Prices Including VAT" := BillToCustTemplate."Prices Including VAT";
- "Shipment Method Code" := BillToCustTemplate."Shipment Method Code";
-
- OnAfterInitFromBillToCustTemplate(Rec, BillToCustTemplate);
- end;
-
- local procedure ValidateTaxAreaCode()
- var
- TaxArea: Record "Tax Area";
- begin
- if "Tax Area Code" = '' then
- exit;
-
- TaxArea.Get("Tax Area Code");
- end;
-
- ///
- /// Updates current sales header work description with the provided description.
- ///
- /// New work description.
- procedure SetWorkDescription(NewWorkDescription: Text)
- var
- OutStream: OutStream;
- begin
- OnBeforeSetWorkDescription(Rec, NewWorkDescription);
- Clear("Work Description");
- "Work Description".CreateOutStream(OutStream, TEXTENCODING::UTF8);
- OutStream.WriteText(NewWorkDescription);
- Modify();
- end;
-
- ///
- /// Retrieves work description from the sales header.
- ///
- /// Work description.
- procedure GetWorkDescription() WorkDescription: Text
- var
- TypeHelper: Codeunit "Type Helper";
- InStream: InStream;
- begin
- CalcFields("Work Description");
- "Work Description".CreateInStream(InStream, TEXTENCODING::UTF8);
- exit(TypeHelper.TryReadAsTextWithSepAndFieldErrMsg(InStream, TypeHelper.LFSeparator(), FieldName("Work Description")));
- end;
-
- ///
- /// Filters the contact for the company number that is associated with either the customer or contact number.
- ///
- ///
- /// If no business relations exist within provided customer and contacts
- /// and document type is quote, then filters company contact based on provided contact number.
- ///
- /// The number of the customer to filter the contact for.
- /// The number of the contact to look up.
- /// Return value: Filtered contact record set.
- procedure LookupContact(CustomerNo: Code[20]; ContactNo: Code[20]; var Contact: Record Contact)
- var
- ContactBusinessRelation: Record "Contact Business Relation";
- FilterByContactCompany: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupContact(CustomerNo, ContactNo, Contact, IsHandled);
- if IsHandled then
- exit;
-
- if ContactBusinessRelation.FindByRelation(ContactBusinessRelation."Link to Table"::Customer, CustomerNo) then
- Contact.SetRange("Company No.", ContactBusinessRelation."Contact No.")
- else
- if "Document Type" = "Document Type"::Quote then
- FilterByContactCompany := true
- else
- Contact.SetRange("Company No.", '');
- if ContactNo <> '' then
- if Contact.Get(ContactNo) then
- if FilterByContactCompany then
- Contact.SetRange("Company No.", Contact."Company No.");
- end;
-
- ///
- /// Sets the global flag SelectNoSeriesAllowed to true.
- ///
- ///
- /// The global flag is used to determine if the lookup for the number series can been shown.
- ///
- procedure SetAllowSelectNoSeries()
- begin
- SelectNoSeriesAllowed := true;
- end;
-
- ///
- /// Sets the default salesperson code for the sales header.
- ///
- ///
- /// Retrieves default salesperson code from user setup. If retrieved salesperson code privacy is not blocked,
- /// sets it for the sales header.
- ///
- procedure SetDefaultSalesperson()
- var
- UserSetupSalespersonCode: Code[20];
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetDefaultSalesperson(Rec, IsHandled, InsertMode);
- if IsHandled then
- exit;
-
- UserSetupSalespersonCode := GetUserSetupSalespersonCode();
- if UserSetupSalespersonCode <> '' then
- if Salesperson.Get(UserSetupSalespersonCode) then
- if not Salesperson.VerifySalesPersonPurchaserPrivacyBlocked(Salesperson) then
- Validate("Salesperson Code", UserSetupSalespersonCode);
- end;
-
- ///
- /// Retrieves the salesperson code of the current user from the user setup.
- ///
- /// Salesperson code of the current user from the user setup.
- procedure GetUserSetupSalespersonCode(): Code[20]
- var
- UserSetup: Record "User Setup";
- begin
- if not UserSetup.Get(UserId) then
- exit;
-
- exit(UserSetup."Salespers./Purch. Code");
- end;
-
- ///
- /// Removes the filter on customer number if the customer number has changed.
- ///
- /// The current sales header record.
- /// Sales header record before the changes.
- procedure SelltoCustomerNoOnAfterValidate(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")
- begin
- if SalesHeader.GetFilter("Sell-to Customer No.") = xSalesHeader."Sell-to Customer No." then
- if SalesHeader."Sell-to Customer No." <> xSalesHeader."Sell-to Customer No." then
- SalesHeader.SetRange("Sell-to Customer No.");
-
- OnAfterSelltoCustomerNoOnAfterValidate(Rec, xRec);
- end;
-
- ///
- /// Releases the sales documents that are not yet released.
- ///
- /// Filtered sales headers to release.
- procedure PerformManualRelease(var SalesHeader: Record "Sales Header")
- var
- BatchProcessingMgt: Codeunit "Batch Processing Mgt.";
- NoOfSelected: Integer;
- NoOfSkipped: Integer;
- PrevFilterGroup: Integer;
- begin
- NoOfSelected := SalesHeader.Count;
- PrevFilterGroup := SalesHeader.FilterGroup();
- SalesHeader.FilterGroup(10);
- SalesHeader.SetFilter(Status, '<>%1', SalesHeader.Status::Released);
- NoOfSkipped := NoOfSelected - SalesHeader.Count;
- BatchProcessingMgt.BatchProcess(SalesHeader, Codeunit::"Sales Manual Release", Enum::"Error Handling Options"::"Show Error", NoOfSelected, NoOfSkipped);
- SalesHeader.SetRange(Status);
- SalesHeader.FilterGroup(PrevFilterGroup);
-
- end;
-
- ///
- /// Releases the sales document if it's not already released.
- ///
- ///
- /// The transaction is committed after release.
- ///
- procedure PerformManualRelease()
- var
- ReleaseSalesDoc: Codeunit "Release Sales Document";
- IsHandled: Boolean;
- begin
- OnBeforePerformManualRelease(Rec, IsHandled);
- if not IsHandled then
- if Rec.Status <> Rec.Status::Released then begin
- ReleaseSalesDoc.PerformManualRelease(Rec);
- Commit();
- end;
- end;
-
- ///
- /// Reopens sales documents that are not already open.
- ///
- /// Filtered sales headers to reopen.
- procedure PerformManualReopen(var SalesHeader: Record "Sales Header")
- var
- BatchProcessingMgt: Codeunit "Batch Processing Mgt.";
- NoOfSelected: Integer;
- NoOfSkipped: Integer;
- begin
- NoOfSelected := SalesHeader.Count;
- SalesHeader.SetFilter(Status, '<>%1', SalesHeader.Status::Open);
- NoOfSkipped := NoOfSelected - SalesHeader.Count;
- BatchProcessingMgt.BatchProcess(SalesHeader, Codeunit::"Sales Manual Reopen", Enum::"Error Handling Options"::"Show Error", NoOfSelected, NoOfSkipped);
- end;
-
- ///
- /// Opens a page for selecting a customer template to use for creating a new customer.
- ///
- ///
- /// If sell-to contact has no business relations a confirmation for template selection is raised.
- /// If the user confirms, it commits any changes
- /// and returns the code of the new customer template selected by the user.
- ///
- /// Customer template code.
- procedure SelectSalesHeaderNewCustomerTemplate(): Code[20]
- var
- Contact: Record Contact;
- ConfirmManagement: Codeunit "Confirm Management";
- begin
- Contact.Get("Sell-to Contact No.");
- if (Contact.Type = Contact.Type::Person) and (Contact."Company No." <> '') then
- Contact.Get(Contact."Company No.");
- if not Contact.ContactToCustBusinessRelationExist() then
- if ConfirmManagement.GetResponse(SelectCustomerTemplateQst, false) then begin
- Commit();
- exit(Contact.LookupNewCustomerTemplate());
- end;
- end;
-
- local procedure ModifyBillToCustomerAddress()
- var
- Customer: Record Customer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeModifyBillToCustomerAddress(Rec, IsHandled);
- if IsHandled then
- exit;
-
- GetSalesSetup();
- if SalesSetup."Ignore Updated Addresses" then
- exit;
-
- if IsCreditDocType() then
- exit;
-
- if ("Bill-to Customer No." = "Sell-to Customer No.") then
- exit;
-
- if not HasBillToAddress() then
- exit;
-
- if not Customer.Get("Bill-to Customer No.") then
- exit;
-
- if not HasDifferentBillToAddress(Customer) then
- exit;
-
- ShowModifyAddressNotification(GetModifyBillToCustomerAddressNotificationId(),
- ModifyCustomerAddressNotificationLbl, ModifyCustomerAddressNotificationMsg,
- 'CopyBillToCustomerAddressFieldsFromSalesDocument', "Bill-to Customer No.",
- "Bill-to Name", FieldName("Bill-to Customer No."));
- end;
-
- local procedure ModifyCustomerAddress()
- var
- Customer: Record Customer;
- begin
- OnBeforeModifyCustomerAddress(Rec, xRec);
-
- GetSalesSetup();
- if SalesSetup."Ignore Updated Addresses" then
- exit;
- if IsCreditDocType() then
- exit;
- if Customer.Get("Sell-to Customer No.") and HasSellToAddress() and HasDifferentSellToAddress(Customer) then
- ShowModifyAddressNotification(GetModifyCustomerAddressNotificationId(),
- ModifyCustomerAddressNotificationLbl, ModifyCustomerAddressNotificationMsg,
- 'CopySellToCustomerAddressFieldsFromSalesDocument', "Sell-to Customer No.",
- "Sell-to Customer Name", FieldName("Sell-to Customer No."));
- end;
-
- local procedure ShowModifyAddressNotification(NotificationID: Guid; NotificationLbl: Text; NotificationMsg: Text; NotificationFunctionTok: Text; CustomerNumber: Code[20]; CustomerName: Text[100]; CustomerNumberFieldName: Text)
- var
- MyNotifications: Record "My Notifications";
- NotificationLifecycleMgt: Codeunit "Notification Lifecycle Mgt.";
- PageMyNotifications: Page "My Notifications";
- ModifyCustomerAddressNotification: Notification;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeShowModifyAddressNotification(IsHandled, Rec, CustomerNumber);
- if IsHandled then
- exit;
-
- if not MyNotifications.Get(UserId, NotificationID) then
- PageMyNotifications.InitializeNotificationsWithDefaultState();
-
- if not MyNotifications.IsEnabled(NotificationID) then
- exit;
-
- ModifyCustomerAddressNotification.Id := NotificationID;
- ModifyCustomerAddressNotification.Message := StrSubstNo(NotificationMsg, CustomerName);
- ModifyCustomerAddressNotification.AddAction(NotificationLbl, CODEUNIT::"Document Notifications", NotificationFunctionTok);
- ModifyCustomerAddressNotification.AddAction(
- DontShowAgainActionLbl, CODEUNIT::"Document Notifications", 'HideNotificationForCurrentUser');
- ModifyCustomerAddressNotification.Scope := NOTIFICATIONSCOPE::LocalScope;
- ModifyCustomerAddressNotification.SetData(FieldName("Document Type"), Format("Document Type"));
- ModifyCustomerAddressNotification.SetData(FieldName("No."), "No.");
- ModifyCustomerAddressNotification.SetData(CustomerNumberFieldName, CustomerNumber);
- NotificationLifecycleMgt.SendNotification(ModifyCustomerAddressNotification, RecordId);
- end;
-
- ///
- /// Recalls a sent notification for the provided notification GUID.
- ///
- ///
- /// If it is a credit document or if notification isn't enabled, it won't recall the notification.
- ///
- /// GUID of the notification to recall.
- procedure RecallModifyAddressNotification(NotificationID: Guid)
- var
- MyNotifications: Record "My Notifications";
- ModifyCustomerAddressNotification: Notification;
- begin
- if IsCreditDocType() or (not MyNotifications.IsEnabled(NotificationID)) then
- exit;
-
- ModifyCustomerAddressNotification.Id := NotificationID;
- ModifyCustomerAddressNotification.Recall();
- end;
-
- ///
- /// Returns a GUID for a notification that warns if the sell-to address on sales documents is different
- /// from the customer's existing address.
- ///
- /// Notification GUID.
- procedure GetModifyCustomerAddressNotificationId(): Guid
- begin
- exit('509FD112-31EC-4CDC-AEBF-19B8FEBA526F');
- end;
-
- ///
- /// Returns a GUID for a notification that warns if the bill-to address on sales documents is different
- /// from the customer's existing address.
- ///
- /// Notification GUID.
- procedure GetModifyBillToCustomerAddressNotificationId(): Guid
- begin
- exit('2096CE78-6A74-48DB-BC9A-CD5C21504FC1');
- end;
-
- ///
- /// Returns a GUID for a notification that warns if the invoice discount amount for the sales line record has been reset.
- ///
- /// Notification GUID.
- procedure GetLineInvoiceDiscountResetNotificationId(): Guid
- begin
- exit('35AB3090-2E03-4849-BBF9-9664DE464605');
- end;
-
- ///
- /// Returns a GUID for a notification that warns before posting lines on sales documents where quantity is 0.
- ///
- /// Notification GUID.
- procedure GetWarnWhenZeroQuantitySalesLinePosting(): Guid
- begin
- exit('ce906407-2f7e-410a-8fb9-4fdc76954876');
- end;
-
- ///
- /// Inserts the default notification to warn that sell-to address on sales documents is different
- /// from the customer's existing address.
- ///
- ///
- /// Notification is enabled by default.
- ///
- procedure SetModifyCustomerAddressNotificationDefaultState()
- var
- MyNotifications: Record "My Notifications";
- begin
- MyNotifications.InsertDefault(GetModifyCustomerAddressNotificationId(),
- ModifySellToCustomerAddressNotificationNameTxt, ModifySellToCustomerAddressNotificationDescriptionTxt, true);
- end;
-
- ///
- /// Inserts the default notification to warn that bill-to address on sales documents is different
- /// from the customer's existing address.
- ///
- ///
- /// Notification is enabled by default.
- ///
- procedure SetModifyBillToCustomerAddressNotificationDefaultState()
- var
- MyNotifications: Record "My Notifications";
- begin
- MyNotifications.InsertDefault(GetModifyBillToCustomerAddressNotificationId(),
- ModifyBillToCustomerAddressNotificationNameTxt, ModifyBillToCustomerAddressNotificationDescriptionTxt, true);
- end;
-
- ///
- /// Sets the default state for the external document already exists notification in My Notifications.
- ///
- /// Specifies whether the notification is enabled by default.
- procedure SetShowExternalDocAlreadyExistNotificationDefaultState(DefaultState: Boolean)
- var
- MyNotifications: Record "My Notifications";
- begin
- MyNotifications.InsertDefault(GetShowExternalDocAlreadyExistNotificationId(),
- ShowDocAlreadyExistNotificationNameTxt, ShowDocAlreadyExistNotificationDescriptionTxt, DefaultState);
- end;
-
- ///
- /// Disables a specified notification for the current user.
- ///
- /// GUID of the notification that needs to be disabled.
- procedure DontNotifyCurrentUserAgain(NotificationID: Guid)
- var
- MyNotifications: Record "My Notifications";
- begin
- if not MyNotifications.Disable(NotificationID) then
- case NotificationID of
- GetModifyCustomerAddressNotificationId():
- MyNotifications.InsertDefault(NotificationID, ModifySellToCustomerAddressNotificationNameTxt,
- ModifySellToCustomerAddressNotificationDescriptionTxt, false);
- GetModifyBillToCustomerAddressNotificationId():
- MyNotifications.InsertDefault(NotificationID, ModifyBillToCustomerAddressNotificationNameTxt,
- ModifyBillToCustomerAddressNotificationDescriptionTxt, false);
- end;
- end;
-
- ///
- /// Determines if the sell-to address matches the provided customer's address.
- ///
- /// Customer to compare the sell-to address with.
- /// True if sell-to address is different from provided customer's address, otherwise false.
- procedure HasDifferentSellToAddress(Customer: Record Customer) Result: Boolean
- begin
- Result := ("Sell-to Address" <> Customer.Address) or
- ("Sell-to Address 2" <> Customer."Address 2") or
- ("Sell-to City" <> Customer.City) or
- ("Sell-to Country/Region Code" <> Customer."Country/Region Code") or
- ("Sell-to County" <> Customer.County) or
- ("Sell-to Post Code" <> Customer."Post Code") or
- ("Sell-to Contact" <> Customer.Contact);
-
- OnAfterHasDifferentSellToAddress(Rec, Customer, Result);
- end;
-
- ///
- /// Determines if the bill-to address matches the provided customer's address.
- ///
- /// Customer to compare the bill-to address with.
- /// True if bill-to address is different from provided customer's address, otherwise false.
- procedure HasDifferentBillToAddress(Customer: Record Customer) Result: Boolean
- begin
- Result := ("Bill-to Address" <> Customer.Address) or
- ("Bill-to Address 2" <> Customer."Address 2") or
- ("Bill-to City" <> Customer.City) or
- ("Bill-to Country/Region Code" <> Customer."Country/Region Code") or
- ("Bill-to County" <> Customer.County) or
- ("Bill-to Post Code" <> Customer."Post Code") or
- ("Bill-to Contact" <> Customer.Contact);
-
- OnAfterHasDifferentBillToAddress(Rec, Customer, Result);
- end;
-
- ///
- /// Determines if the ship-to address matches the provided customer's address.
- ///
- /// Customer to compare the ship-to address with.
- /// True if ship-to address is different from provided customer's address, otherwise false.
- procedure HasDifferentShipToAddress(Customer: Record Customer) Result: Boolean
- begin
- Result := ("Ship-to Address" <> Customer.Address) or
- ("Ship-to Address 2" <> Customer."Address 2") or
- ("Ship-to City" <> Customer.City) or
- ("Ship-to Country/Region Code" <> Customer."Country/Region Code") or
- ("Ship-to County" <> Customer.County) or
- ("Ship-to Post Code" <> Customer."Post Code") or
- ("Ship-to Phone No." <> Customer."Phone No.") or
- ("Ship-to Contact" <> Customer.Contact);
-
- OnAfterHasDifferentShipToAddress(Rec, Customer, Result);
- end;
-
- ///
- /// Opens the interaction log entries page where entries related to the sales document are displayed.
- ///
- procedure ShowInteractionLogEntries()
- var
- InteractionLogEntry: Record "Interaction Log Entry";
- begin
- OnBeforeShowInteractionLogEntries(InteractionLogEntry);
- if "Bill-to Contact No." <> '' then
- InteractionLogEntry.SetRange("Contact No.", "Bill-to Contact No.");
- case "Document Type" of
- "Document Type"::Order:
- InteractionLogEntry.SetRange("Document Type", InteractionLogEntry."Document Type"::"Sales Ord. Cnfrmn.");
- "Document Type"::Quote:
- InteractionLogEntry.SetRange("Document Type", InteractionLogEntry."Document Type"::"Sales Qte.");
- "Document Type"::Invoice:
- InteractionLogEntry.SetRange("Document Type", InteractionLogEntry."Document Type"::"Sales Draft Invoice");
- end;
-
- InteractionLogEntry.SetRange("Document No.", "No.");
- PAGE.Run(PAGE::"Interaction Log Entries", InteractionLogEntry);
- end;
-
- ///
- /// Retrieves the bill-to (customer or contact) number for a sales document.
- ///
- ///
- /// If sales document type is quote where the bill-to customer number is blank, but the bill-to contact number
- /// and bill-to customer template code are specified, it returns the bill-to contact number.
- /// For all other cases, it returns the bill-to customer number.
- ///
- /// Bill-to number.
- procedure GetBillToNo(): Code[20]
- begin
- if ("Document Type" = "Document Type"::Quote) and
- ("Bill-to Customer No." = '') and ("Bill-to Contact No." <> '') and
- ("Bill-to Customer Templ. Code" <> '')
- then
- exit("Bill-to Contact No.");
-
- exit("Bill-to Customer No.");
- end;
-
- ///
- /// Gets the currency symbol for sales document. If currency symbol is not specified returns the currency code.
- ///
- /// Currency symbol.
- procedure GetCurrencySymbol(): Text[10]
- var
- GeneralLedgerSetup: Record "General Ledger Setup";
- Currency: Record Currency;
- begin
- if GeneralLedgerSetup.Get() then
- if ("Currency Code" = '') or ("Currency Code" = GeneralLedgerSetup."LCY Code") then
- exit(GeneralLedgerSetup.GetCurrencySymbol());
-
- if Currency.Get("Currency Code") then
- exit(Currency.GetCurrencySymbol());
-
- exit("Currency Code");
- end;
-
- ///
- /// Updates the salesperson code from either the ship-to addresses or bill-to customer's salesperson.
- ///
- ///
- /// If neither are set, it uses the default salesperson from the user setup.
- /// If salesperson is blocked, it doesn't get assigned.
- ///
- procedure UpdateShipToSalespersonCode(FieldNo: Integer)
- var
- ShipToAddress: Record "Ship-to Address";
- SalespersonCode: Code[20];
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateShipToSalespersonCode(Rec, IsHandled);
- if IsHandled then
- exit;
-
- SalespersonCode := "Salesperson Code";
-
- // three-step logic - Bill-to, Ship-to, Default
- if FieldNo = FieldNo("Bill-to Customer No.") then
- if ("Bill-to Customer No." <> '') then begin
- GetCust("Bill-to Customer No.");
- if Customer."Salesperson Code" = '' then
- SalespersonCode := ''
- else
- SetSalespersonCode(Customer."Salesperson Code", SalespersonCode);
- end;
-
- // two-step logic - Ship-to, Default
- if FieldNo in [FieldNo("Bill-to Customer No."), FieldNo("Ship-to Code")] then
- if "Ship-to Code" <> '' then begin
- ShipToAddress.SetLoadFields("Salesperson Code");
- ShipToAddress.Get("Sell-to Customer No.", "Ship-to Code");
- if ShipToAddress."Salesperson Code" <> '' then
- SetSalespersonCode(ShipToAddress."Salesperson Code", SalespersonCode);
- end;
-
- // one-step logic - Default
- if SalespersonCode = '' then
- SetSalespersonCode('', SalespersonCode);
-
- if SalespersonCode <> "Salesperson Code" then
- Validate("Salesperson Code", SalespersonCode);
- end;
-
- ///
- /// Updates salesperson code. If the provided salesperson code privacy is not blocked, returns provided salesperson code,
- /// otherwise returns empty value to assign.
- ///
- ///
- /// If the provided salesperson code is empty, it uses the default one from the user setup.
- ///
- /// Salesperson code to set.
- /// Return value: Salesperson code to assign.
- procedure SetSalespersonCode(SalesPersonCodeToCheck: Code[20]; var SalesPersonCodeToAssign: Code[20])
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetSalespersonCode(Rec, SalesPersonCodeToCheck, SalesPersonCodeToAssign, IsHandled);
- if IsHandled then
- exit;
-
- if SalesPersonCodeToCheck = '' then
- SalesPersonCodeToCheck := GetUserSetupSalespersonCode();
- if Salesperson.Get(SalesPersonCodeToCheck) then begin
- if Salesperson.VerifySalesPersonPurchaserPrivacyBlocked(Salesperson) then
- SalesPersonCodeToAssign := ''
- else
- SalesPersonCodeToAssign := SalesPersonCodeToCheck;
- end else
- SalesPersonCodeToAssign := '';
- end;
-
- ///
- /// Checks if the document can be created/posted depending on the privacy blocked of the salesperson.
- ///
- /// Sales header on which salesperson code has been changed.
- /// Determines if the check is completed during a write transaction.
- /// Determines if the check is completed during the posting.
- procedure ValidateSalesPersonOnSalesHeader(SalesHeader2: Record "Sales Header"; IsTransaction: Boolean; IsPostAction: Boolean)
- begin
- if SalesHeader2."Salesperson Code" <> '' then
- if Salesperson.Get(SalesHeader2."Salesperson Code") then
- if Salesperson.VerifySalesPersonPurchaserPrivacyBlocked(Salesperson) then begin
- if IsTransaction then
- Error(
- ErrorInfo.Create(
- Salesperson.GetPrivacyBlockedTransactionText(Salesperson, IsPostAction, true),
- true,
- Salesperson));
- if not IsTransaction then
- Error(
- ErrorInfo.Create(
- Salesperson.GetPrivacyBlockedGenericText(Salesperson, true),
- true,
- Salesperson));
- end;
- end;
-
- ///
- /// Determines whether a search for a customer should be performed by name for the provided customer number.
- ///
- /// Customer number to check.
- /// True if customer should be searched by name, otherwise false.
- procedure ShouldSearchForCustomerByName(CustomerNo: Code[20]) Result: Boolean
- var
- Customer2: Record Customer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeShouldSearchForCustomerByName(CustomerNo, Result, IsHandled, CurrFieldNo, Rec, xRec);
- if IsHandled then
- exit(Result);
-
- if CustomerNo = '' then
- exit(true);
-
- if not Customer2.Get(CustomerNo) then
- exit(true);
-
- GetSalesSetup();
- if SalesSetup."Disable Search by Name" then
- exit(false);
-
- exit(not Customer2."Disable Search by Name");
- end;
-
- local procedure CalcQuoteValidUntilDate()
- var
- BlankDateFormula: DateFormula;
- QuoteValidityCalculation: DateFormula;
- begin
- GetSalesSetup();
- QuoteValidityCalculation := SalesSetup."Quote Validity Calculation";
- OnCalcQuoteValidUntilDateOnBeforeAssign(Rec, xRec, QuoteValidityCalculation, UpdateDocumentDate);
- if QuoteValidityCalculation <> BlankDateFormula then
- "Quote Valid Until Date" := CalcDate(QuoteValidityCalculation, "Document Date");
- end;
-
- ///
- /// Returns the value of the global variable SkipTaxCalculation.
- ///
- ///
- /// Currently SkipTaxCalculation in sales header is used only in variable set and get procedures.
- ///
- /// The value of the global variable SkipTaxCalculation.
- procedure CanCalculateTax(): Boolean
- begin
- exit(SkipTaxCalculation);
- end;
-
- ///
- /// Sets the value of the global variable SkipTaxCalculation.
- ///
- ///
- /// Currently SkipTaxCalculation in sales header is used only in variable set and get procedures.
- ///
- /// The new value to set.
- procedure SetSkipTaxCalulation(Skip: Boolean)
- begin
- SkipTaxCalculation := Skip;
- end;
-
- ///
- /// Checks if the sales line quantity shipped is zero. If it is not, an error is raised.
- ///
- /// Sales line which shipped quantity has to be checked.
- procedure TestQuantityShippedField(SalesLine: Record "Sales Line")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeTestQuantityShippedField(SalesLine, IsHandled);
- if IsHandled then
- exit;
-
- SalesLine.TestField("Quantity Shipped", 0);
- OnAfterTestQuantityShippedField(SalesLine);
- end;
-
- ///
- /// Determines if sales document status is not pending approval.
- ///
- /// True if status is not pending approval, otherwise false.
- procedure TestStatusIsNotPendingApproval() NotPending: Boolean;
- begin
- NotPending := Status <> Status::"Pending Approval";
-
- OnTestStatusIsNotPendingApproval(Rec, NotPending);
- end;
-
- ///
- /// Determines if sales document status is not pending prepayment.
- ///
- /// True if status is not pending prepayment, otherwise false.
- procedure TestStatusIsNotPendingPrepayment() NotPending: Boolean;
- begin
- NotPending := Status <> Status::"Pending Prepayment";
-
- OnTestStatusIsNotPendingPrepayment(Rec, NotPending);
- end;
-
- ///
- /// Determines if sales document status is not released.
- ///
- /// True if status is not released, otherwise false.
- procedure TestStatusIsNotReleased() NotReleased: Boolean;
- begin
- NotReleased := Status <> Status::Released;
-
- OnTestStatusIsNotReleased(Rec, NotReleased);
- end;
-
- ///
- /// Checks if sales document status is open. If it is not, an error is raised.
- ///
- ///
- /// If global flag StatusCheckSuspended is set to true, the procedure is not executed.
- ///
- procedure TestStatusOpen()
- begin
- OnBeforeTestStatusOpen(Rec, xRec, CurrFieldNo);
-
- if StatusCheckSuspended then
- exit;
-
- TestField(Status, Status::Open);
-
- OnAfterTestStatusOpen(Rec);
- end;
-
- ///
- /// Checks if sales document status is open. If it is not, an error is raised.
- ///
- /// Determines if an error should be raised if status is not open.
- /// True if status is open, otherwise false.
- ///
- /// If global flag StatusCheckSuspended is set to true, the procedure is not executed.
- ///
- procedure TestStatusOpen(ThrowErrorIfNot: Boolean): Boolean
- begin
- OnBeforeTestStatusOpen(Rec, xRec, CurrFieldNo);
-
- if StatusCheckSuspended then
- exit(true);
-
- if Rec.Status <> Rec.Status::Open then begin
- if ThrowErrorIfNot then
- Error(DocumentNotOpenErr);
- exit(false)
- end;
- OnAfterTestStatusOpen(Rec);
- exit(true)
- end;
-
- ///
- /// Sets the value of the global flag StatusCheckSuspended.
- ///
- ///
- /// The global flag is used to suspend the check if the document status is open.
- ///
- /// The new value to set.
- procedure SuspendStatusCheck(Suspend: Boolean)
- begin
- StatusCheckSuspended := Suspend;
- end;
-
- ///
- /// Checks if there are any blocked items or resources in the sales lines of the sales header.
- ///
- procedure CheckForBlockedLines()
- var
- CurrentSalesLine: Record "Sales Line";
- Item: Record Item;
- ItemVariant: Record "Item Variant";
- Resource: Record Resource;
- begin
- CurrentSalesLine.SetCurrentKey("Document Type", "Document No.", Type);
- CurrentSalesLine.SetRange("Document Type", "Document Type");
- CurrentSalesLine.SetRange("Document No.", "No.");
- CurrentSalesLine.SetFilter(Type, '%1|%2', CurrentSalesLine.Type::Item, CurrentSalesLine.Type::Resource);
- CurrentSalesLine.SetFilter("No.", '<>''''');
- if "Document Type" = "Document Type"::"Blanket Order" then
- CurrentSalesLine.SetFilter("Qty. to Ship", '<>0');
-
- if CurrentSalesLine.FindSet() then
- repeat
- case CurrentSalesLine.Type of
- CurrentSalesLine.Type::Item:
- begin
- Item.Get(CurrentSalesLine."No.");
- Item.TestField(Blocked, false);
-
- if CurrentSalesLine."Variant Code" <> '' then begin
- ItemVariant.SetLoadFields(Blocked);
- ItemVariant.Get(CurrentSalesLine."No.", CurrentSalesLine."Variant Code");
- ItemVariant.TestField(Blocked, false);
- end
- end;
- CurrentSalesLine.Type::Resource:
- begin
- Resource.Get(CurrentSalesLine."No.");
- Resource.CheckResourcePrivacyBlocked(false);
- Resource.TestField(Blocked, false);
- end;
- end;
- until CurrentSalesLine.Next() = 0;
- end;
-
- ///
- /// Runs the copy sales document report for the sales header.
- ///
- ///
- /// The report creates new sales documents based on the existing one.
- ///
- procedure CopyDocument()
- var
- CopySalesDocument: Report "Copy Sales Document";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCopyDocument(Rec, IsHandled);
- if IsHandled then
- exit;
-
- CopySalesDocument.SetSalesHeader(Rec);
- CopySalesDocument.RunModal();
- end;
-
- local procedure CheckContactRelatedToCustomerCompany(ContactNo: Code[20]; CustomerNo: Code[20])
- var
- Contact: Record Contact;
- ContBusRel: Record "Contact Business Relation";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckContactRelatedToCustomerCompany(Rec, CurrFieldNo, IsHandled, ContactNo, CustomerNo);
- if IsHandled then
- exit;
-
- Contact.Get(ContactNo);
- if ContBusRel.FindByRelation(ContBusRel."Link to Table"::Customer, CustomerNo) then
- if (ContBusRel."Contact No." <> Contact."Company No.") and (ContBusRel."Contact No." <> Contact."No.") then
- Error(Text038, Contact."No.", Contact.Name, CustomerNo);
- end;
-
- local procedure ConfirmRecalculatePrice(var SalesLine: Record "Sales Line") Result: Boolean
- var
- ConfirmManagement: Codeunit "Confirm Management";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeConfirmRecalculatePrice(Rec, xRec, CurrFieldNo, Result, HideValidationDialog, IsHandled);
- if IsHandled then
- exit;
-
- if GetHideValidationDialog() or not GuiAllowed then
- Result := true
- else
- Result :=
- ConfirmManagement.GetResponseOrDefault(
- StrSubstNo(Text024, FieldCaption("Prices Including VAT"), SalesLine.FieldCaption("Unit Price")), true);
- end;
-
- ///
- /// Opens customer lookup page to select a customer.
- ///
- /// Return value: Selected customer name.
- /// True if customer is selected, otherwise false.
- procedure LookupSellToCustomerName(var CustomerName: Text): Boolean
- var
- Customer: Record Customer;
- LookupStateManager: Codeunit "Lookup State Manager";
- RecVariant: Variant;
- SearchCustomerName: Text;
- begin
- SearchCustomerName := CustomerName;
- Customer.SetFilter("Date Filter", GetFilter("Date Filter"));
- if "Sell-to Customer No." <> '' then
- Customer.Get("Sell-to Customer No.");
-
- OnLookupSellToCustomerNameOnBeforeSelectCustomer(Rec, Customer, CustomerName);
-
- if Customer.SelectCustomer(Customer) then begin
- if Rec."Sell-to Customer Name" = Customer.Name then
- CustomerName := SearchCustomerName
- else
- CustomerName := Customer.Name;
- RecVariant := Customer;
- LookupStateManager.SaveRecord(RecVariant);
- exit(true);
- end;
- end;
-
- local procedure CheckPromisedDeliveryDate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckPromisedDeliveryDate(IsHandled, Rec);
- if IsHandled then
- exit;
-
- if "Promised Delivery Date" <> 0D then
- Error(Text028, FieldCaption("Requested Delivery Date"), FieldCaption("Promised Delivery Date"));
- end;
-
- ///
- /// Sets the bill-to customer number based on the provided customer record.
- ///
- /// Specifies the customer record to determine the bill-to customer number.
- procedure SetBillToCustomerNo(var Cust: Record Customer)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetBillToCustomerNo(Rec, Cust, IsHandled, xRec, CurrFieldNo);
- if IsHandled then
- exit;
-
- if Cust."Bill-to Customer No." <> '' then
- Validate("Bill-to Customer No.", Cust."Bill-to Customer No.")
- else begin
- if "Bill-to Customer No." = "Sell-to Customer No." then
- SkipBillToContact := true;
- Rec.Validate("Bill-to Customer No.", Rec."Sell-to Customer No.");
- SkipBillToContact := false;
- end;
- end;
-
- ///
- /// Returns the value of the global flag StatusCheckSuspended.
- ///
- ///
- /// The global flag is used to suspend the check if the document status is open.
- ///
- /// The value of the global flag StatusCheckSuspended.
- procedure GetStatusCheckSuspended(): Boolean
- begin
- exit(StatusCheckSuspended);
- end;
-
- ///
- /// Returns the value of the global flag CalledFromWhseDoc.
- ///
- ///
- /// Global flag CalledFromWhseDoc is used on posting date validation to check if currency factor can be updated.
- ///
- /// The value of the global flag CalledFromWhseDoc.
- procedure GetCalledFromWhseDoc(): Boolean
- begin
- exit(CalledFromWhseDoc);
- end;
-
- ///
- /// Sets the value of the global flag CalledFromWhseDoc.
- ///
- ///
- /// Global flag CalledFromWhseDoc is set to true on init source header in warahoure shipment and receipt posting.
- ///
- /// The new value to set.
- procedure SetCalledFromWhseDoc(NewCalledFromWhseDoc: Boolean)
- begin
- CalledFromWhseDoc := NewCalledFromWhseDoc;
- end;
-
- local procedure CheckCustomerPostingGroupChange()
- var
- BillToCustomer: Record Customer;
- PostingGroupChangeInterface: Interface "Posting Group Change Method";
- IsHandled: Boolean;
- begin
- OnBeforeCheckCustomerPostingGroupChange(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if ("Customer Posting Group" <> xRec."Customer Posting Group") and (xRec."Customer Posting Group" <> '') then begin
- TestField("Bill-to Customer No.");
- BillToCustomer.Get("Bill-to Customer No.");
- GetSalesSetup();
- if SalesSetup."Allow Multiple Posting Groups" then begin
- BillToCustomer.TestField("Allow Multiple Posting Groups");
- PostingGroupChangeInterface := SalesSetup."Check Multiple Posting Groups";
- PostingGroupChangeInterface.ChangePostingGroup("Customer Posting Group", xRec."Customer Posting Group", Rec);
- end;
- end;
- end;
-
- local procedure UpdatePrepmtAmounts(var SalesLine: Record "Sales Line")
- var
- Currency: Record Currency;
- begin
- Currency.Initialize("Currency Code");
- if "Document Type" = "Document Type"::Order then begin
- SalesLine."Prepmt. Line Amount" := Round(
- SalesLine."Line Amount" * SalesLine."Prepayment %" / 100, Currency."Amount Rounding Precision");
- if Abs(SalesLine."Inv. Discount Amount" + SalesLine."Prepmt. Line Amount") > Abs(SalesLine."Line Amount") then
- SalesLine."Prepmt. Line Amount" := SalesLine."Line Amount" - SalesLine."Inv. Discount Amount";
- end;
- end;
-
- ///
- /// Returns the date to use for the sales document.
- ///
- /// Posting date if posting date is set in sales header, otherwise work date.
- procedure GetUseDate(): Date
- begin
- if "Posting Date" = 0D then
- exit(WorkDate());
-
- exit("Posting Date");
- end;
-
- ///
- /// Initializes the number series for sales document posting based on the document type.
- ///
- procedure InitPostingNoSeries()
- var
- NoSeries: Codeunit "No. Series";
- PostingNoSeries: Code[20];
- begin
- GLSetup.GetRecordOnce();
- if GLSetup."Journal Templ. Name Mandatory" then begin
- if "Journal Templ. Name" = '' then begin
- if not IsCreditDocType() then
- GenJournalTemplate.Get(SalesSetup."S. Invoice Template Name")
- else
- GenJournalTemplate.Get(SalesSetup."S. Cr. Memo Template Name");
- "Journal Templ. Name" := GenJournalTemplate.Name;
- end else
- GenJournalTemplate.Get("Journal Templ. Name");
- PostingNoSeries := GenJournalTemplate."Posting No. Series";
- end else
- if IsCreditDocType() then
- PostingNoSeries := SalesSetup."Posted Credit Memo Nos."
- else
- PostingNoSeries := SalesSetup."Posted Invoice Nos.";
-
- case "Document Type" of
- "Document Type"::Quote, "Document Type"::Order:
- begin
- if NoSeries.IsAutomatic(PostingNoSeries) then
- "Posting No. Series" := PostingNoSeries;
- if NoSeries.IsAutomatic(SalesSetup."Posted Shipment Nos.") then
- "Shipping No. Series" := SalesSetup."Posted Shipment Nos.";
- if NoSeries.IsAutomatic(SalesSetup."Posted Prepmt. Inv. Nos.") then
- "Prepayment No. Series" := SalesSetup."Posted Prepmt. Inv. Nos.";
- if NoSeries.IsAutomatic(SalesSetup."Posted Prepmt. Cr. Memo Nos.") then
- "Prepmt. Cr. Memo No. Series" := SalesSetup."Posted Prepmt. Cr. Memo Nos.";
- end;
- "Document Type"::Invoice:
- begin
- if ("No. Series" <> '') and (SalesSetup."Invoice Nos." = PostingNoSeries) then
- "Posting No. Series" := "No. Series"
- else
- if NoSeries.IsAutomatic(PostingNoSeries) then
- "Posting No. Series" := PostingNoSeries;
-
- if SalesSetup."Shipment on Invoice" then
- if NoSeries.IsAutomatic(SalesSetup."Posted Shipment Nos.") then
- "Shipping No. Series" := SalesSetup."Posted Shipment Nos.";
- end;
- "Document Type"::"Return Order":
- begin
- if NoSeries.IsAutomatic(PostingNoSeries) then
- "Posting No. Series" := PostingNoSeries;
- if NoSeries.IsAutomatic(SalesSetup."Posted Return Receipt Nos.") then
- "Return Receipt No. Series" := SalesSetup."Posted Return Receipt Nos.";
- end;
- "Document Type"::"Credit Memo":
- begin
- if ("No. Series" <> '') and (SalesSetup."Credit Memo Nos." = PostingNoSeries) then
- "Posting No. Series" := "No. Series"
- else
- if NoSeries.IsAutomatic(PostingNoSeries) then
- "Posting No. Series" := PostingNoSeries;
- if SalesSetup."Return Receipt on Credit Memo" then
- if NoSeries.IsAutomatic(SalesSetup."Posted Return Receipt Nos.") then
- "Return Receipt No. Series" := SalesSetup."Posted Return Receipt Nos."
- end;
- end;
-
- OnAfterInitPostingNoSeries(Rec, xRec);
- end;
-
- ///
- /// Initializes the dimensions for the document from default dimensions for the related entry specified in the field.
- ///
- /// The field number for which to initialize the dimensions.
- procedure CreateDimFromDefaultDim(FieldNo: Integer)
- var
- DefaultDimSource: List of [Dictionary of [Integer, Code[20]]];
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateDimFromDefaultDim(Rec, FieldNo, IsHandled);
- if IsHandled then
- exit;
- InitDefaultDimensionSources(DefaultDimSource, FieldNo);
- CreateDim(DefaultDimSource);
- end;
-
- local procedure InitDefaultDimensionSources(var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; FieldNo: Integer)
- begin
- OnBeforeInitDefaultDimensionSources(Rec, DefaultDimSource, FieldNo);
-
- DimMgt.AddDimSource(DefaultDimSource, Database::Customer, Rec."Bill-to Customer No.", FieldNo = Rec.FieldNo("Bill-to Customer No."));
- DimMgt.AddDimSource(DefaultDimSource, Database::"Salesperson/Purchaser", Rec."Salesperson Code", FieldNo = Rec.FieldNo("Salesperson Code"));
- DimMgt.AddDimSource(DefaultDimSource, Database::Campaign, Rec."Campaign No.", FieldNo = Rec.FieldNo("Campaign No."));
- DimMgt.AddDimSource(DefaultDimSource, Database::"Responsibility Center", Rec."Responsibility Center", FieldNo = Rec.FieldNo("Responsibility Center"));
- DimMgt.AddDimSource(DefaultDimSource, Database::"Customer Templ.", Rec."Bill-to Customer Templ. Code", FieldNo = Rec.FieldNo("Bill-to Customer Templ. Code"));
- DimMgt.AddDimSource(DefaultDimSource, Database::Location, Rec."Location Code", FieldNo = Rec.FieldNo("Location Code"));
-
- OnAfterInitDefaultDimensionSources(Rec, DefaultDimSource, FieldNo);
- end;
-
- ///
- /// Opens a contact lookup page and validates the sell-to contact number with the selected contact.
- ///
- /// True if the contact was validated, otherwise false.
- procedure SelltoContactLookup(): Boolean
- var
- Contact: Record Contact;
- ContactBusinessRelation: Record "Contact Business Relation";
- IsHandled: Boolean;
- Result: Boolean;
- begin
- IsHandled := false;
- OnBeforeLookupSellToContactNo(Rec, xRec, IsHandled, Result);
- if IsHandled then
- exit(Result);
-
- Contact.FilterGroup(2);
- if ("Sell-to Customer No." <> '') and ("Document Type" <> "Document Type"::Quote) then
- if Contact.Get("Sell-to Contact No.") then
- Contact.SetRange("Company No.", Contact."Company No.")
- else
- if ContactBusinessRelation.FindByRelation(ContactBusinessRelation."Link to Table"::Customer, "Sell-to Customer No.") then
- Contact.SetRange("Company No.", ContactBusinessRelation."Contact No.")
- else
- Contact.SetRange("No.", '');
-
- if "Sell-to Contact No." <> '' then
- if Contact.Get("Sell-to Contact No.") then;
- if Page.RunModal(0, Contact) = Action::LookupOK then begin
- xRec := Rec;
- CurrFieldNo := FieldNo("Sell-to Contact No.");
- Validate("Sell-to Contact No.", Contact."No.");
- exit(true);
- end;
- Contact.FilterGroup(0);
- exit(false);
- end;
-
- local procedure ShouldCheckShowRecurringSalesLines(var xHeader: Record "Sales Header"; var Header: Record "Sales Header"): Boolean
- begin
- exit(
- (xHeader."Bill-to Customer No." <> '') and
- (Header."No." <> '') and
- (Header."Currency Code" <> xHeader."Currency Code")
- );
- end;
-
- ///
- /// Inserts the default notification to warn before posting lines on sales documents where quantity is 0.
- ///
- ///
- /// Notification is enabled by default.
- ///
- procedure SetWarnZeroQuantitySalesPosting()
- var
- MyNotifications: Record "My Notifications";
- begin
- MyNotifications.InsertDefault(GetWarnWhenZeroQuantitySalesLinePosting(),
- WarnZeroQuantitySalesPostingTxt, WarnZeroQuantitySalesPostingDescriptionTxt, true);
- end;
-
- ///
- /// Determines if the sales lines are editable based on whether sell-to information is in the sales header.
- ///
- /// True if sales lines are editable, otherwise false.
- procedure SalesLinesEditable() IsEditable: Boolean;
- begin
- if "Document Type" = "Document Type"::Quote then
- IsEditable := (Rec."Sell-to Customer No." <> '') or (Rec."Sell-to Customer Templ. Code" <> '') or (Rec."Sell-to Contact No." <> '') or (Rec.GetFilter("Sell-to Contact No.") <> '')
- else
- IsEditable := Rec."Sell-to Customer No." <> '';
-
- OnAfterSalesLinesEditable(Rec, IsEditable);
- end;
-
-
- local procedure FindDocumentWithSameExternalDocNo(): Boolean
- var
- CustomerMgt: Codeunit "Customer Mgt.";
- begin
- exit(CustomerMgt.SearchForExternalDocNo(Rec));
- end;
-
- local procedure ShowExternalDocAlreadyExistNotification()
- var
- MyNotifications: Record "My Notifications";
- NotificationLifecycleMgt: Codeunit "Notification Lifecycle Mgt.";
- InstructionMgt: Codeunit "Instruction Mgt.";
- DocAlreadyExistNotification: Notification;
- begin
- if not MyNotifications.IsEnabled(GetShowExternalDocAlreadyExistNotificationId()) then
- exit;
- InstructionMgt.CreateMissingMyNotificationsWithDefaultState(GetShowExternalDocAlreadyExistNotificationId());
-
- if not IsDocAlreadyExistNotificationEnabled() then
- exit;
-
- DocAlreadyExistNotification.Id := GetShowExternalDocAlreadyExistNotificationId();
- DocAlreadyExistNotification.Message :=
- StrSubstNo(SalesAlreadyExistsTxt, "Document Type", "External Document No.");
- DocAlreadyExistNotification.Scope := NOTIFICATIONSCOPE::LocalScope;
- DocAlreadyExistNotification.SetData(FieldName("Document Type"), Format("Document Type"));
- DocAlreadyExistNotification.SetData(FieldName("No."), "No.");
- NotificationLifecycleMgt.SendNotificationWithAdditionalContext(
- DocAlreadyExistNotification, RecordId, GetShowExternalDocAlreadyExistNotificationId());
- end;
-
- ///
- /// Returns the GUID for the external document already exists notification.
- ///
- /// The notification GUID.
- procedure GetShowExternalDocAlreadyExistNotificationId(): Guid
- begin
- exit('0677e7f8-cc39-442e-b9c2-65aadaa85ae9');
- end;
-
- local procedure RecallExternalDocAlreadyExistsNotification()
- var
- NotificationLifecycleMgt: Codeunit "Notification Lifecycle Mgt.";
- begin
- if not IsDocAlreadyExistNotificationEnabled() then
- exit;
-
- NotificationLifecycleMgt.RecallNotificationsForRecordWithAdditionalContext(
- RecordId, GetShowExternalDocAlreadyExistNotificationId(), true);
- end;
-
- local procedure IsDocAlreadyExistNotificationEnabled(): Boolean
- var
- InstructionMgt: Codeunit "Instruction Mgt.";
- begin
- exit(InstructionMgt.IsMyNotificationEnabled(GetShowExternalDocAlreadyExistNotificationId()));
- end;
-
- ///
- /// Updates the related sales order line if a posted credit memo exists for this document.
- ///
- procedure UpdateSalesOrderLineIfExist()
- var
- SalesCreditMemoHeader: Record "Sales Cr.Memo Header";
- CorrectPostedSalesInvoice: Codeunit "Correct Posted Sales Invoice";
- IsHandled: Boolean;
- begin
- SalesCreditMemoHeader.SetLoadFields("Pre-Assigned No.", "Cust. Ledger Entry No.");
- SalesCreditMemoHeader.SetRange("Pre-Assigned No.", Rec."No.");
- if not SalesCreditMemoHeader.FindFirst() then
- exit;
-
- IsHandled := false;
- OnBeforeUpdateSalesOrderLineIfExist(Rec, IsHandled);
- if IsHandled then
- exit;
-
- CorrectPostedSalesInvoice.UpdateSalesOrderLineIfExist(SalesCreditMemoHeader."No.");
- end;
-
- internal procedure GetQtyReservedFromStockState() Result: Enum "Reservation From Stock"
- var
- QtyReservedFromStock: Decimal;
- begin
- QtyReservedFromStock := SalesLineReserve.GetReservedQtyFromInventory(Rec);
- if QtyReservedFromStock = 0 then
- exit(Result::None);
-
- if QtyReservedFromStock = CalculateReservableOutstandingQuantityBase() then
- exit(Result::Full);
-
- exit(Result::Partial);
- end;
-
- internal procedure CalculateReservableOutstandingQuantityBase() OutstandingQtyBase: Decimal
- var
- RemQtyBaseInvtItemSalesLine: Query RemQtyBaseInvtItemSalesLine;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCalculateReservableOutstandingQuantityBase(Rec, IsHandled, OutstandingQtyBase);
- if IsHandled then
- exit(OutstandingQtyBase);
-
- OutstandingQtyBase := 0;
- RemQtyBaseInvtItemSalesLine.SetSalesLineFilter(Rec);
- if RemQtyBaseInvtItemSalesLine.Open() then
- if RemQtyBaseInvtItemSalesLine.Read() then
- OutstandingQtyBase := RemQtyBaseInvtItemSalesLine.Outstanding_Qty___Base_;
- RemQtyBaseInvtItemSalesLine.Close();
- end;
-
- local procedure UpdateVATReportingDate(CalledByFieldNo: Integer)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateVATReportingDate(Rec, CalledByFieldNo, IsHandled);
- if IsHandled then
- exit;
-
- if not (CalledByFieldNo in [FieldNo("Posting Date"), FieldNo("Document Date")]) then
- exit;
-
- GLSetup.GetRecordOnce();
- case CalledByFieldNo of
- FieldNo("Posting Date"):
- GLSetup.UpdateVATDate("Posting Date", Enum::"VAT Reporting Date"::"Posting Date", "VAT Reporting Date");
- FieldNo("Document Date"):
- GLSetup.UpdateVATDate("Document Date", Enum::"VAT Reporting Date"::"Document Date", "VAT Reporting Date");
- end;
- Validate("VAT Reporting Date");
- end;
-
- local procedure FindContactBusinessRelation(CustomerNo: Code[20]; ContactNo: Code[20]; ContactBusinessRelationLinkType: Enum "Contact Business Relation Link To Table"): Boolean
- var
- ContactBusinessRelation: Record "Contact Business Relation";
- begin
- ContactBusinessRelation.SetRange("No.", CustomerNo);
- ContactBusinessRelation.SetRange("Contact No.", ContactNo);
- ContactBusinessRelation.SetRange(ContactBusinessRelation."Link to Table", ContactBusinessRelationLinkType);
- exit(ContactBusinessRelation.IsEmpty());
- end;
-
- local procedure UpdateDocumentDateFromLinkedPostingDate(WithValidate: Boolean)
- var
- IsHandled: Boolean;
- begin
- OnValidatePostingDateOnBeforeAssignDocumentDate(Rec, IsHandled);
- if IsHandled then
- exit;
- if Rec."Incoming Document Entry No." <> 0 then
- exit;
- GetSalesSetup();
- if SalesSetup."Link Doc. Date To Posting Date" then
- if WithValidate then
- Rec.Validate("Document Date", Rec."Posting Date")
- else
- Rec."Document Date" := Rec."Posting Date";
- end;
-
- ///
- /// Sends filtered sales documents to intercompany partners through the IC inbox/outbox.
- ///
- /// Specifies the filtered sales header records to send.
- procedure SendICSalesDoc(var SalesHeader: Record "Sales Header")
- var
- ICInOutboxMgt: Codeunit ICInboxOutboxMgt;
- begin
- if SalesHeader.FindSet() then
- repeat
- if ApprovalsMgmt.PrePostApprovalCheckSales(SalesHeader) then
- ICInOutboxMgt.SendSalesDoc(SalesHeader, false);
- until SalesHeader.Next() = 0;
- end;
-
- local procedure SetupDisableAggregateTableUpdate(var DisableAggregateTableUpdate: Codeunit "Disable Aggregate Table Update")
- var
- AggregateTableID: Integer;
- begin
- AggregateTableID := DisableAggregateTableUpdate.GetAggregateTableIDFromSalesHeader(Rec);
- if not (AggregateTableID > 0) then
- exit;
-
- DisableAggregateTableUpdate.SetAggregateTableIDDisabled(AggregateTableID);
- DisableAggregateTableUpdate.SetTableSystemIDDisabled(SystemId);
- BindSubscription(DisableAggregateTableUpdate);
- end;
-
- local procedure EnableAggregateTableUpdate(var DisableAggregateTableUpdate: Codeunit "Disable Aggregate Table Update")
- begin
- if UnbindSubscription(DisableAggregateTableUpdate) then;
- end;
-
- ///
- /// Raised after the default VAT business posting group is assigned to the sales header.
- ///
- /// The sales header record being modified.
- /// The sales header record before modification.
- /// The general business posting group used to determine the VAT business posting group.
- [IntegrationEvent(false, false)]
- local procedure OnAfterAssignDefaultVATBusPostingGroup(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; GenBusinessPostingGroup: Record "Gen. Business Posting Group")
- begin
- end;
-
- ///
- /// Raised after the default dimension sources are initialized for the sales header.
- ///
- /// The sales header record being modified.
- /// The list of default dimension sources.
- /// The field number that triggered the dimension initialization.
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitDefaultDimensionSources(var SalesHeader: Record "Sales Header"; var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; FieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised after the sales header record is initialized.
- ///
- /// The sales header record that was initialized.
- [IntegrationEvent(true, false)]
- local procedure OnAfterInitRecord(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after the number series is initialized for the sales header.
- ///
- /// The sales header record being modified.
- /// The sales header record before modification.
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitNoSeries(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after the rounding precision is initialized from the currency.
- ///
- /// The sales header record being modified.
- /// The currency record used to initialize rounding precision.
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitializeRoundingPrecision(var SalesHeader: Record "Sales Header"; var Currency: Record Currency)
- begin
- end;
-
- ///
- /// Raised after checking if the bill-to address equals the sell-to address.
- ///
- /// The sales header with sell-to address information.
- /// The sales header with bill-to address information.
- /// The result of the address comparison.
- [IntegrationEvent(false, false)]
- local procedure OnAfterIsBillToAddressEqualToSellToAddress(SellToSalesHeader: Record "Sales Header"; BillToSalesHeader: Record "Sales Header"; var Result: Boolean)
- begin
- end;
-
- ///
- /// Raised after the credit limit check condition is evaluated.
- ///
- /// The sales header record being checked.
- /// Specifies whether to run the credit limit check.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckCreditLimitCondition(var SalesHeader: Record "Sales Header"; var RunCheck: Boolean)
- begin
- end;
-
- ///
- /// Raised after the credit maximum is checked before inserting the sales header.
- ///
- /// The sales header record being checked.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckCreditMaxBeforeInsert(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after the bill-to customer is validated.
- ///
- /// The sales header record being modified.
- /// The sales header record before modification.
- /// The bill-to customer record.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckBillToCust(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised after the sell-to customer is validated.
- ///
- /// The sales header record being modified.
- /// The sales header record before modification.
- /// The sell-to customer record.
- /// The field number that triggered the validation.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckSellToCust(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; Customer: Record Customer; CurrentFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised after the shipping advice is checked.
- ///
- /// The sales header record being checked.
- /// The result of the shipping advice check.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckShippingAdvice(var SalesHeader: Record "Sales Header"; var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckShippingAdviceOnAfterSetLineFilters(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after the user confirms sales price changes.
- ///
- /// The sales header record being modified.
- /// The sales line record affected by price changes.
- /// Specifies whether to recalculate the sales lines.
- [IntegrationEvent(false, false)]
- local procedure OnAfterConfirmSalesPrice(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var RecalculateLines: Boolean)
- begin
- end;
-
- ///
- /// Raised after the user confirms the currency factor update.
- ///
- /// The sales header record being modified.
- /// Specifies whether the user confirmed the update.
- [IntegrationEvent(false, false)]
- local procedure OnAfterConfirmCurrencyFactorUpdate(var SalesHeader: Record "Sales Header"; var Confirmed: Boolean)
- begin
- end;
-
- ///
- /// Raised after checking if dimensions could be kept when changing header fields.
- ///
- /// The sales header record being modified.
- /// The sales header record before modification.
- /// The result indicating if dimensions can be kept.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCouldDimensionsBeKept(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var Result: Boolean)
- begin
- end;
-
- ///
- /// Raised after a sales line is recreated from temporary storage.
- ///
- /// The recreated sales line record.
- /// The temporary sales line used as source.
- /// The parent sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnAfterRecreateSalesLine(var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary; var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after all temporary sales lines are deleted.
- ///
- /// The sales header record whose temporary lines were deleted.
- [IntegrationEvent(false, false)]
- local procedure OnAfterDeleteAllTempSalesLines(SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after sales lines are deleted from the sales header.
- ///
- /// The sales line record that was deleted.
- /// The parent sales header record.
- [IntegrationEvent(true, false)]
- local procedure OnAfterDeleteSalesLines(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after the sales header is initialized from another sales header.
- ///
- /// The sales header record being initialized.
- /// The source sales header used for initialization.
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitFromSalesHeader(var SalesHeader: Record "Sales Header"; SourceSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after the sales header is initialized from a bill-to customer template.
- ///
- /// The sales header record being initialized.
- /// The customer template used for initialization.
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitFromBillToCustTemplate(var SalesHeader: Record "Sales Header"; BillToCustTemplate: Record "Customer Templ.")
- begin
- end;
-
- ///
- /// Raised after a sales line is inserted into temporary storage.
- ///
- /// The sales line record being stored.
- /// The temporary sales line record.
- [IntegrationEvent(false, false)]
- local procedure OnAfterInsertTempSalesLine(SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary)
- begin
- end;
-
- ///
- /// Raised after checking if the sales header is approved for posting.
- ///
- /// The sales header record being checked.
- /// Specifies whether the sales header is approved for posting.
- [IntegrationEvent(false, false)]
- local procedure OnAfterIsApprovedForPosting(SalesHeader: Record "Sales Header"; var Approved: Boolean)
- begin
- end;
-
- ///
- /// Raised after checking if the sales header is approved for batch posting.
- ///
- /// The sales header record being checked.
- /// Specifies whether the sales header is approved for batch posting.
- [IntegrationEvent(false, false)]
- local procedure OnAfterIsApprovedForPostingBatch(SalesHeader: Record "Sales Header"; var Approved: Boolean)
- begin
- end;
-
- ///
- /// Raised after the number series code is retrieved for the sales header.
- ///
- /// The sales header record.
- /// The sales and receivables setup record.
- /// The number series code that was retrieved.
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetNoSeriesCode(var SalesHeader: Record "Sales Header"; SalesReceivablesSetup: Record "Sales & Receivables Setup"; var NoSeriesCode: Code[20])
- begin
- end;
-
- ///
- /// Raised after the posting number series code is retrieved.
- ///
- /// The sales header record.
- /// The posting number series code that was retrieved.
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetPostingNoSeriesCode(SalesHeader: Record "Sales Header"; var PostingNos: Code[20])
- begin
- end;
-
- ///
- /// Raised after the prepayment posting number series code is retrieved.
- ///
- /// The sales header record.
- /// The prepayment posting number series code that was retrieved.
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetPrepaymentPostingNoSeriesCode(SalesHeader: Record "Sales Header"; var PostingNos: Code[20])
- begin
- end;
-
- ///
- /// Raised after the sales and receivables setup is retrieved.
- ///
- /// The sales header record.
- /// The sales and receivables setup record that was retrieved.
- /// The field number that triggered the retrieval.
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetSalesSetup(SalesHeader: Record "Sales Header"; var SalesReceivablesSetup: Record "Sales & Receivables Setup"; CalledByFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised after the document type text is retrieved.
- ///
- /// The sales header record.
- /// The document type text that was retrieved.
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetDocTypeText(var SalesHeader: Record "Sales Header"; var TypeText: Text[50])
- begin
- end;
-
- ///
- /// Raised after the status style text is retrieved.
- ///
- /// The sales header record.
- /// The status style text that was retrieved.
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetStatusStyleText(SalesHeader: Record "Sales Header"; var StatusStyleText: Text)
- begin
- end;
-
- ///
- /// Raised after the sales header record is inserted.
- ///
- /// The sales header record that was inserted.
- [IntegrationEvent(false, false)]
- local procedure OnAfterOnInsert(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after checking if the sales header has a different sell-to address than the customer.
- ///
- /// The sales header record being checked.
- /// The customer record to compare with.
- /// The result of the address comparison.
- [IntegrationEvent(false, false)]
- local procedure OnAfterHasDifferentSellToAddress(var SalesHeader: Record "Sales Header"; Customer: Record Customer; var Result: Boolean)
- begin
- end;
-
- ///
- /// Raised after checking if the sales header has a different bill-to address than the customer.
- ///
- /// The sales header record being checked.
- /// The customer record to compare with.
- /// The result of the address comparison.
- [IntegrationEvent(false, false)]
- local procedure OnAfterHasDifferentBillToAddress(var SalesHeader: Record "Sales Header"; Customer: Record Customer; var Result: Boolean)
- begin
- end;
-
- ///
- /// Raised after checking if the sales header has a different ship-to address than the customer.
- ///
- /// The sales header record being checked.
- /// The customer record to compare with.
- /// The result of the address comparison.
- [IntegrationEvent(false, false)]
- local procedure OnAfterHasDifferentShipToAddress(var SalesHeader: Record "Sales Header"; Customer: Record Customer; var Result: Boolean)
- begin
- end;
-
- ///
- /// Raised after determining if the sales lines are editable.
- ///
- /// The sales header record.
- /// Specifies whether the sales lines are editable.
- [IntegrationEvent(false, false)]
- local procedure OnAfterSalesLinesEditable(SalesHeader: Record "Sales Header"; var IsEditable: Boolean)
- begin
- end;
-
- ///
- /// Raised after testing the number series for the sales header.
- ///
- /// The sales header record being tested.
- /// The sales and receivables setup record.
- [IntegrationEvent(false, false)]
- local procedure OnAfterTestNoSeries(var SalesHeader: Record "Sales Header"; var SalesReceivablesSetup: Record "Sales & Receivables Setup")
- begin
- end;
-
- ///
- /// Raised after the ship-to address is updated on the sales header.
- ///
- /// The sales header record being modified.
- /// The sales header record before modification.
- /// The field number that triggered the update.
- /// The location record used for the update.
- /// The company information record used for the update.
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateShipToAddress(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; Location: Record Location; CompanyInformation: Record "Company Information")
- begin
- end;
-
- ///
- /// Raised after the currency factor is updated on the sales header.
- ///
- /// The sales header record being modified.
- /// Specifies whether to hide the validation dialog.
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateCurrencyFactor(var SalesHeader: Record "Sales Header"; HideValidationDialog: Boolean)
- begin
- end;
-
- ///
- /// Raised after looking up the applies-to document number.
- ///
- /// The sales header record.
- /// The customer ledger entry selected from the lookup.
- [IntegrationEvent(false, false)]
- local procedure OnAfterAppliesToDocNoOnLookup(var SalesHeader: Record "Sales Header"; CustLedgerEntry: Record "Cust. Ledger Entry")
- begin
- end;
-
- ///
- /// Raised during sales line update when a field changes by name.
- ///
- /// The sales header record.
- /// The sales line record being updated.
- /// The name of the changed field.
- /// The number of the changed field.
- /// The sales header record before modification.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesLineByChangedFieldName(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; ChangedFieldName: Text[100]; ChangedFieldNo: Integer; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after filters are set on sales lines during update by field number.
- ///
- /// The sales header record.
- /// The sales header record before modification.
- /// The sales line record with filters applied.
- /// The number of the changed field.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesLinesByFieldNoOnAfterSalesLineSetFilters(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; ChangedFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised after the sales header is modified during sales line amounts update.
- ///
- /// The sales header record that was modified.
- /// The sales line record being updated.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesLineAmountsOnAfterSalesHeaderModify(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised before validating the ship-to contact during ship-to contact update.
- ///
- /// The sales header record being modified.
- /// The sales header record before modification.
- /// The field number that triggered the update.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateShipToContactOnBeforeValidateShipToContact(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean);
- begin
- end;
-
- ///
- /// Raised before modifying the opportunity during opportunity update.
- ///
- /// The opportunity record being modified.
- /// The related sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateOpportunityOnBeforeModify(var Opportunity: Record Opportunity; var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before modifying the opportunity during opportunity link update.
- ///
- /// The opportunity record being modified.
- /// The related sales header record.
- /// The sales document type option value.
- /// The sales header document number.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateOpportunityLinkOnBeforeModify(var Opportunity: Record Opportunity; var SalesHeader: Record "Sales Header"; SalesDocumentType: Option; SalesHeaderNo: Code[20])
- begin
- end;
-
- ///
- /// Raised before updating all line dimensions during shortcut dimension code validation.
- ///
- /// The sales header record being modified.
- /// The sales header record before modification.
- /// The shortcut dimension field number being validated.
- [IntegrationEvent(false, false)]
- local procedure OnValidateShortcutDimCodeOnBeforeUpdateAllLineDim(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; FieldNumber: Integer)
- begin
- end;
-
- ///
- /// Raised after the shortcut dimension code is validated.
- ///
- /// The sales header record being modified.
- /// The sales header record before modification.
- /// The shortcut dimension field number that was validated.
- /// The shortcut dimension code value.
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateShortcutDimCode(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; FieldNumber: Integer; var ShortcutDimCode: Code[20])
- begin
- end;
-
- ///
- /// Raised after a sales line is created from temporary storage.
- ///
- /// The created sales line record.
- /// The temporary sales line used as source.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCreateSalesLine(var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary)
- begin
- end;
-
- ///
- /// Raised after checking if the ship-to address equals the sell-to address.
- ///
- /// The sales header with sell-to address information.
- /// The sales header with ship-to address information.
- /// The result of the address comparison.
- [IntegrationEvent(false, false)]
- local procedure OnAfterIsShipToAddressEqualToSellToAddress(SellToSalesHeader: Record "Sales Header"; ShipToSalesHeader: Record "Sales Header"; var Result: Boolean)
- begin
- end;
-
- ///
- /// Raised after a sales quote is accepted.
- ///
- /// The sales header record that was accepted.
- [IntegrationEvent(false, false)]
- local procedure OnAfterSalesQuoteAccepted(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after the Prices Including VAT field is changed.
- ///
- /// The sales header record that was modified.
- [IntegrationEvent(false, false)]
- local procedure OnAfterChangePricesIncludingVAT(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after the sell-to customer number is validated.
- ///
- /// The sales header record being modified.
- /// The sales header record before modification.
- [IntegrationEvent(false, false)]
- local procedure OnAfterSelltoCustomerNoOnAfterValidate(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after the sales header is sent.
- ///
- /// The sales header record that was sent.
- /// Specifies whether a dialog was shown during sending.
- [IntegrationEvent(false, false)]
- local procedure OnAfterSendSalesHeader(var SalesHeader: Record "Sales Header"; ShowDialog: Boolean)
- begin
- end;
-
- ///
- /// Raised after filters are set for applying customer ledger entries.
- ///
- /// The customer ledger entry record with filters applied.
- /// The sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetApplyToFilters(var CustLedgerEntry: Record "Cust. Ledger Entry"; SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after bill-to customer fields are set on the sales header.
- ///
- /// The sales header record being modified.
- /// The bill-to customer record.
- /// The sales header record before modification.
- /// Specifies whether to skip bill-to contact update.
- /// The field number that triggered the update.
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetFieldsBilltoCustomer(var SalesHeader: Record "Sales Header"; Customer: Record Customer; xSalesHeader: Record "Sales Header"; SkipBillToContact: Boolean; CUrrentFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised after extended text is transferred for sales line recreation.
- ///
- /// The sales line record receiving extended text.
- /// The temporary sales line with extended text.
- [IntegrationEvent(false, false)]
- local procedure OnAfterTransferExtendedTextForSalesLineRecreation(var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary)
- begin
- end;
-
- ///
- /// Raised after copying fields from a new sell-to customer template.
- ///
- /// The sales header record being modified.
- /// The customer template used for copying.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyFromNewSellToCustTemplate(var SalesHeader: Record "Sales Header"; SellToCustTemplate: Record "Customer Templ.")
- begin
- end;
-
- ///
- /// Raised after the sell-to address is copied to the ship-to address.
- ///
- /// The sales header record that was modified.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySellToAddressToShipToAddress(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after the sell-to address is copied to the bill-to address.
- ///
- /// The sales header record that was modified.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySellToAddressToBillToAddress(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after sell-to customer address fields are copied from the customer.
- ///
- /// The sales header record being modified.
- /// The sell-to customer record used as source.
- /// The field number that triggered the copy.
- /// Specifies whether to skip bill-to contact update.
- /// Specifies whether to skip sell-to contact update.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySellToCustomerAddressFieldsFromCustomer(var SalesHeader: Record "Sales Header"; SellToCustomer: Record Customer; CurrentFieldNo: Integer; var SkipBillToContact: Boolean; var SkipSellToContact: Boolean)
- begin
- end;
-
- ///
- /// Raised after ship-to customer address fields are copied from the customer.
- ///
- /// The sales header record being modified.
- /// The customer record used as source.
- /// The sales header record before modification.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyShipToCustomerAddressFieldsFromCustomer(var SalesHeader: Record "Sales Header"; SellToCustomer: Record Customer; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after ship-to customer address fields are copied from a ship-to address.
- ///
- /// The sales header record being modified.
- /// The ship-to address record used as source.
- /// The sales header record before modification.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyShipToCustomerAddressFieldsFromShipToAddr(var SalesHeader: Record "Sales Header"; ShipToAddress: Record "Ship-to Address"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after sales lines are updated by field number.
- ///
- /// The sales header record.
- /// The sales header record before modification.
- /// The field number that triggered the update.
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateSalesLinesByFieldNo(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; ChangedFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised before the assist edit function is executed.
- ///
- /// The sales header record being modified.
- /// The original sales header record.
- /// Set to true to skip the default assist edit logic.
- /// The result of the assist edit operation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeAssistEdit(var SalesHeader: Record "Sales Header"; OldSalesHeader: Record "Sales Header"; var IsHandled: Boolean; var Result: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking the available credit limit.
- ///
- /// The sales header record being checked.
- /// The available credit limit value.
- /// Set to true to skip the default credit limit check.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckAvailableCreditLimit(var SalesHeader: Record "Sales Header"; var ReturnValue: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking the customer credit limit.
- ///
- /// The sales header record being checked.
- /// Set to true to skip the default credit limit check.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckCreditLimit(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking the credit maximum before inserting the sales header.
- ///
- /// The sales header record being checked.
- /// Set to true to skip the default credit check.
- /// Specifies whether to hide the credit check dialog.
- /// The customer number filter.
- /// The contact number filter.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckCreditMaxBeforeInsert(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; HideCreditCheckDialogue: Boolean; FilterCustNo: Code[20]; FilterContNo: Code[20])
- begin
- end;
-
- ///
- /// Raised before checking the credit limit when no sales line is inserted yet.
- ///
- /// The sales header record being checked.
- /// Set to true to skip the default credit limit check.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckCreditLimitIfLineNotInsertedYet(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking the customer-contact relation.
- ///
- /// The sales header record being checked.
- /// The contact record being validated.
- /// Set to true to skip the default relation check.
- /// The customer number being validated.
- /// The contact business relation number.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckCustomerContactRelation(var SalesHeader: Record "Sales Header"; Cont: Record Contact; var IsHandled: Boolean; CustomerNo: Code[20]; ContBusinessRelationNo: Code[20])
- begin
- end;
-
- ///
- /// Raised before checking document numbers and showing a confirmation dialog.
- ///
- /// The sales header record being checked.
- /// The sales shipment header record.
- /// The sales invoice header record.
- /// The sales credit memo header record.
- /// The return receipt header record.
- /// The prepayment sales invoice header record.
- /// The prepayment sales credit memo header record.
- /// The source code record.
- /// The result of the check.
- /// Set to true to skip the default check logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckNoAndShowConfirm(SalesHeader: Record "Sales Header"; var SalesShptHeader: Record "Sales Shipment Header"; var SalesInvHeader: Record "Sales Invoice Header"; var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var ReturnRcptHeader: Record "Return Receipt Header"; var SalesInvHeaderPrePmt: Record "Sales Invoice Header"; var SalesCrMemoHeaderPrePmt: Record "Sales Cr.Memo Header"; SourceCode: Record "Source Code"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking prepayment information on the sales header.
- ///
- /// The sales header record being checked.
- /// The sales header record before modification.
- /// The sales line record being checked.
- /// Set to true to skip the default prepayment check.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckPrepmtInfo(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking return information on the sales header.
- ///
- /// The sales header record being checked.
- /// Set to true to skip the default return info check.
- /// The sales header record before modification.
- /// Specifies whether checking bill-to information.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckReturnInfo(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; xSalesHeader: Record "Sales Header"; BillTo: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking shipment information on the sales header.
- ///
- /// The sales header record being checked.
- /// The sales header record before modification.
- /// The sales line record being checked.
- /// Specifies whether checking bill-to information.
- /// Set to true to skip the default shipment check.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckShipmentInfo(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; BillTo: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking the shipping advice on the sales header.
- ///
- /// The sales header record being checked.
- /// Set to true to skip the default shipping advice check.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckShippingAdvice(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before creating dimensions from bill-to customer number validation.
- ///
- /// The sales header record being modified.
- /// Set to true to skip the default dimension creation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateDimensionsFromValidateBillToCustomerNo(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before creating dimensions from salesperson code validation.
- ///
- /// The sales header record being modified.
- /// Set to true to skip the default dimension creation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateDimensionsFromValidateSalesPersonCode(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before confirming to clear the opportunity number.
- ///
- /// The opportunity record being cleared.
- /// The user confirmation result.
- /// Set to true to skip the default confirmation dialog.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCofirmClearOpportunityNo(Opportunity: Record Opportunity; var Confirmed: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before confirming whether to keep existing dimensions.
- ///
- /// The sales header record being modified.
- /// The sales header record before modification.
- /// The field number that triggered the dimension change.
- /// The old dimension set ID.
- /// The user confirmation result.
- /// Set to true to skip the default confirmation dialog.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeConfirmKeepExistingDimensions(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; FieldNo: Integer; OldDimSetID: Integer; var Confirmed: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before confirming to update all line dimensions.
- ///
- /// The sales header record being modified.
- /// The sales header record before modification.
- /// The new parent dimension set ID.
- /// The old parent dimension set ID.
- /// The user confirmation result.
- /// Set to true to skip the default confirmation dialog.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeConfirmUpdateAllLineDim(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; NewParentDimSetID: Integer; OldParentDimSetID: Integer; var Confirmed: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before confirming the bill-to contact number change.
- ///
- /// The sales header record being modified.
- /// The sales header record before modification.
- /// The field number that triggered the change.
- /// The user confirmation result.
- /// Set to true to skip the default confirmation dialog.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeConfirmBillToContactNoChange(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var Confirmed: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before confirming the sell-to contact number change.
- ///
- /// The sales header record being modified.
- /// The sales header record before modification.
- /// The field number that triggered the change.
- /// The user confirmation result.
- /// Set to true to skip the default confirmation dialog.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeConfirmSellToContactNoChange(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var Confirmed: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before confirming the currency factor update.
- ///
- /// The sales header record being modified.
- /// Specifies whether to hide the validation dialog.
- /// The sales header record before modification.
- /// Set to true to skip the default confirmation dialog.
- /// Specifies whether to force the confirmation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeConfirmUpdateCurrencyFactor(var SalesHeader: Record "Sales Header"; var HideValidationDialog: Boolean; var xSalesHeader: Record "Sales Header"; var IsHandled: Boolean; var ForceConfirm: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting the contact as a company.
- ///
- /// The contact record to search.
- /// The contact record used for searching.
- /// Set to true to skip the default search logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetContactAsCompany(Contact: Record Contact; var SearchContact: Record Contact; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before confirming deletion of the sales header.
- ///
- /// The sales header record to be deleted.
- /// The result of the deletion confirmation.
- /// Set to true to skip the default confirmation dialog.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeConfirmDeletion(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before copying ship-to customer address fields from the customer.
- ///
- /// The sales header record being modified.
- /// The customer record used as source.
- /// Set to true to skip the default copy logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyShipToCustomerAddressFieldsFromCustomer(var SalesHeader: Record "Sales Header"; Customer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before copying sell-to customer address fields from the customer.
- ///
- /// The sales header record being modified.
- /// The customer record used as source.
- /// Set to true to skip the default copy logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySellToCustomerAddressFieldsFromCustomer(var SalesHeader: Record "Sales Header"; Customer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before copying the sell-to address to the bill-to address.
- ///
- /// The sales header record being modified.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySellToAddressToBillToAddress(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before copying ship-to customer address fields from a ship-to address.
- ///
- /// The sales header record being modified.
- /// The ship-to address record used as source.
- /// Set to true to skip the default copy logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyShipToCustomerAddressFieldsFromShipToAddr(var SalesHeader: Record "Sales Header"; var ShipToAddress: Record "Ship-to Address"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before creating a customer from the sell-to customer template.
- ///
- /// The sales header record.
- /// The contact record associated with the customer.
- /// Set to true to skip the default customer creation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateCustomerFromSellToCustomerTemplate(var SalesHeader: Record "Sales Header"; var Cont: Record Contact; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before creating a customer from the bill-to customer template.
- ///
- /// The sales header record.
- /// The contact record associated with the customer.
- /// Set to true to skip the default customer creation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateCustomerFromBillToCustomerTemplate(var SalesHeader: Record "Sales Header"; var Cont: Record Contact; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before creating a sales line from temporary storage.
- ///
- /// The temporary sales line used as source.
- /// Set to true to skip the default sales line creation.
- /// The parent sales header record.
- /// The sales line record being created.
- [IntegrationEvent(true, false)]
- local procedure OnBeforeCreateSalesLine(var TempSalesLine: Record "Sales Line" temporary; var IsHandled: Boolean; var SalesHeader: record "Sales Header"; var SalesLine: record "Sales Line")
- begin
- end;
-
- ///
- /// Raised before creating dimensions for the sales header.
- ///
- /// The sales header record being modified.
- /// Set to true to skip the default dimension creation.
- /// The list of default dimension sources.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateDim(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])
- begin
- end;
-
- ///
- /// Raised before creating inventory put-away or pick documents.
- ///
- /// The sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateInvtPutAwayPick(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before deleting sales lines from the sales header.
- ///
- /// The sales line record to be deleted.
- /// Set to true to skip the default deletion logic.
- /// The parent sales header record.
- [IntegrationEvent(true, false)]
- local procedure OnBeforeDeleteSalesLines(var SalesLine: Record "Sales Line"; var IsHandled: Boolean; var SalesHeader: Record "Sales Header");
- begin
- end;
-
- ///
- /// Raised before deleting the record in the approval request.
- ///
- /// The sales header record.
- /// Set to true to skip the default deletion logic.
- [IntegrationEvent(true, false)]
- local procedure OnBeforeDeleteRecordInApprovalRequest(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean);
- begin
- end;
-
- ///
- /// Raised before ensuring the document type is Quote.
- ///
- /// The sales header record being checked.
- /// The sales header record before modification.
- /// The field number that triggered the check.
- /// Set to true to skip the default document type check.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeEnsureDocumentTypeIsQuote(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting the customer record.
- ///
- /// The sales header record.
- /// The customer record being retrieved.
- /// The customer number to retrieve.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetCust(var SalesHeader: Record "Sales Header"; var Customer: Record Customer; CustNo: Code[20])
- begin
- end;
-
- ///
- /// Raised before getting the customer VAT registration number.
- ///
- /// The sales header record.
- /// The VAT registration number value.
- /// Set to true to skip the default retrieval logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetCustomerVATRegistrationNumber(var SalesHeader: Record "Sales Header"; var ReturnValue: Text; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting the customer VAT registration number label.
- ///
- /// The sales header record.
- /// The VAT registration number label value.
- /// Set to true to skip the default retrieval logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetCustomerVATRegistrationNumberLbl(var SalesHeader: Record "Sales Header"; var ReturnValue: Text; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting the number series code for the sales header.
- ///
- /// The sales header record.
- /// The sales and receivables setup record.
- /// The number series code being retrieved.
- /// Set to true to skip the default retrieval logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetNoSeriesCode(var SalesHeader: Record "Sales Header"; SalesSetup: Record "Sales & Receivables Setup"; var NoSeriesCode: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting posted document lines to reverse.
- ///
- /// The sales header record.
- /// Set to true to skip the default retrieval logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetPstdDocLinesToReverse(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting the posting number series code.
- ///
- /// The sales header record.
- /// The sales and receivables setup record.
- /// The posting number series code being retrieved.
- /// Set to true to skip the default retrieval logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetPostingNoSeriesCode(var SalesHeader: Record "Sales Header"; SalesSetup: Record "Sales & Receivables Setup"; var NoSeriesCode: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting the shipping time for the sales header.
- ///
- /// The sales header record.
- /// The sales header record before modification.
- /// The field number that triggered the retrieval.
- /// Set to true to skip the default retrieval logic.
- /// The current field number being processed.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetShippingTime(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var CalledByFieldNo: Integer; var IsHandled: Boolean; CurrentFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised before getting the shipment method code.
- ///
- /// The sales header record.
- /// Set to true to skip the default retrieval logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetShipmentMethodCode(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before initializing the sales header from another sales header.
- ///
- /// The sales header record being initialized.
- /// The source sales header used for initialization.
- /// Set to true to skip the default initialization logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitFromSalesHeader(var SalesHeader: Record "Sales Header"; SourceSalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before initializing the sales header during insert.
- ///
- /// The sales header record being initialized.
- /// The sales header record before modification.
- /// Set to true to skip the default initialization logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitInsert(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before initializing the posting description.
- ///
- /// The sales header record being initialized.
- /// Set to true to skip the default initialization logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitPostingDescription(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before initializing the sales header record.
- ///
- /// The sales header record being initialized.
- /// Set to true to skip the default initialization logic.
- /// The sales header record before modification.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitRecord(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before checking if the document type is a credit document.
- ///
- /// The sales header record being checked.
- /// Specifies whether the document is a credit document type.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeIsCreditDocType(SalesHeader: Record "Sales Header"; var CreditDocType: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking if the sales header is approved for posting.
- ///
- /// The sales header record being checked.
- /// Specifies whether the sales header is approved.
- /// Set to true to skip the default approval check.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeIsApprovedForPosting(var SalesHeader: Record "Sales Header"; var Approved: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking if the sales header is approved for batch posting.
- ///
- /// The sales header record being checked.
- /// Specifies whether the sales header is approved for batch posting.
- /// Set to true to skip the default approval check.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeIsApprovedForPostingBatch(var SalesHeader: Record "Sales Header"; var Approved: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before looking up the applies-to document number.
- ///
- /// The sales header record.
- /// The customer ledger entry record for lookup.
- /// Set to true to skip the default lookup logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupAppliesToDocNo(var SalesHeader: Record "Sales Header"; var CustLedgEntry: Record "Cust. Ledger Entry"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before looking up the bill-to post code.
- ///
- /// The sales header record.
- /// The post code record for lookup.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupBillToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code")
- begin
- end;
-
- ///
- /// Raised before looking up the bill-to city.
- ///
- /// The sales header record.
- /// The post code record for lookup.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupBillToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code")
- begin
- end;
-
- ///
- /// Raised before looking up the contact.
- ///
- /// The customer number for the contact lookup.
- /// The contact number for the lookup.
- /// The contact record for lookup.
- /// Set to true to skip the default lookup logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupContact(CustomerNo: Code[20]; ContactNo: Code[20]; var Contact: Record Contact; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before looking up the sell-to contact.
- ///
- /// The sales header record.
- /// The sales header record before modification.
- /// Set to true to skip the default lookup logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupSelltoContact(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before looking up the sell-to contact number.
- ///
- /// The sales header record.
- /// The sales header record before modification.
- /// Set to true to skip the default lookup logic.
- /// The result of the lookup operation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupSellToContactNo(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean; var Result: Boolean)
- begin
- end;
-
- ///
- /// Raised before looking up the sell-to city.
- ///
- /// The sales header record.
- /// The post code record for lookup.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupSellToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code")
- begin
- end;
-
- ///
- /// Raised before looking up the sell-to post code.
- ///
- /// The sales header record.
- /// The post code record for lookup.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupSellToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code")
- begin
- end;
-
- ///
- /// Raised after looking up the ship-to city.
- ///
- /// The sales header record.
- /// The post code record from the lookup.
- /// The sales header record before modification.
- [IntegrationEvent(false, false)]
- local procedure OnAfterLookupShipToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before looking up the ship-to city.
- ///
- /// The sales header record.
- /// The post code record for lookup.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupShipToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code")
- begin
- end;
-
- ///
- /// Raised after looking up the ship-to post code.
- ///
- /// The sales header record.
- /// The post code record from the lookup.
- /// The sales header record before modification.
- [IntegrationEvent(false, false)]
- local procedure OnAfterLookupShipToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after looking up the bill-to post code.
- ///
- /// The sales header record.
- /// The post code record from the lookup.
- /// The sales header record before modification.
- [IntegrationEvent(false, false)]
- local procedure OnAfterLookupBillToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after looking up the bill-to city.
- ///
- /// The sales header record.
- /// The post code record from the lookup.
- /// The sales header record before modification.
- [IntegrationEvent(false, false)]
- local procedure OnAfterLookupBillToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after looking up the sell-to post code.
- ///
- /// The sales header record.
- /// The post code record from the lookup.
- /// The sales header record before modification.
- [IntegrationEvent(false, false)]
- local procedure OnAfterLookupSellToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after looking up the sell-to city.
- ///
- /// The sales header record.
- /// The post code record from the lookup.
- /// The sales header record before modification.
- [IntegrationEvent(false, false)]
- local procedure OnAfterLookupSellToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before looking up the ship-to post code.
- ///
- /// The sales header record.
- /// The post code record for lookup.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupShipToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code")
- begin
- end;
-
- ///
- /// Raised before looking up the shipping number series.
- ///
- /// The sales header record.
- /// Set to true to skip the default lookup logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupShippingNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before looking up the return receipt number series.
- ///
- /// The sales header record.
- /// Set to true to skip the default lookup logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupReturnReceiptNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking if the quantity to ship is zero.
- ///
- /// The sales header record.
- /// The sales line record being checked.
- /// The result of the check.
- /// Set to true to skip the default check logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeQtyToShipIsZero(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before showing the document dimensions.
- ///
- /// The sales header record.
- /// The sales header record before modification.
- /// Set to true to skip the default dimension display.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowDocDim(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before showing interaction log entries.
- ///
- /// The interaction log entry record to display.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowInteractionLogEntries(var InteractionLogEntry: Record "Interaction Log Entry")
- begin
- end;
-
- ///
- /// Raised before determining if the customer should be searched by name.
- ///
- /// The customer number being searched.
- /// The result of the search decision.
- /// Set to true to skip the default search logic.
- /// The field number that triggered the search.
- /// The sales header record.
- /// The sales header record before modification.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShouldSearchForCustomerByName(CustomerNo: Code[20]; var Result: Boolean; var IsHandled: Boolean; var CallingFieldNo: Integer; var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before transferring item charge assignments to temporary storage.
- ///
- /// The sales header record.
- /// The item charge assignment record.
- /// The temporary item charge assignment record.
- /// Set to true to skip the default transfer logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTransferItemChargeAssgntSalesToTemp(var SalesHeader: Record "Sales Header"; var ItemChargeAssgntSales: Record "Item Charge Assignment (Sales)"; var TempItemChargeAssgntSales: Record "Item Charge Assignment (Sales)" temporary; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating the currency factor.
- ///
- /// The sales header record being modified.
- /// Specifies whether the currency factor was updated.
- /// The currency exchange rate record.
- /// The sales header record before modification.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateCurrencyFactor(var SalesHeader: Record "Sales Header"; var Updated: Boolean; var CurrencyExchangeRate: Record "Currency Exchange Rate"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before updating the bill-to contact.
- ///
- /// The sales header record being modified.
- /// The customer number.
- /// Specifies whether to skip the bill-to contact update.
- /// Set to true to skip the default update logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateBillToCont(var SalesHeader: Record "Sales Header"; CustomerNo: Code[20]; var SkipBillToContact: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating the sell-to email from the contact.
- ///
- /// The sales header record being modified.
- /// The contact record with email information.
- /// Set to true to skip the default email update.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateSellToEmail(var SalesHeader: Record "Sales Header"; Contact: Record Contact; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the bill-to city.
- ///
- /// The sales header record being validated.
- /// The post code record for validation.
- /// The field number that triggered the validation.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateBillToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the bill-to post code.
- ///
- /// The sales header record being validated.
- /// The post code record for validation.
- /// The field number that triggered the validation.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateBillToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the document date.
- ///
- /// The sales header record being validated.
- /// The sales header record before modification.
- /// The field number that triggered the validation.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateDocumentDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the promised delivery date.
- ///
- /// The sales header record being validated.
- /// The sales header record before modification.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePromisedDeliveryDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the location code.
- ///
- /// The sales header record being validated.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateLocationCode(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the payment terms code.
- ///
- /// The sales header record being validated.
- /// The sales header record before modification.
- /// The field number that triggered the validation.
- /// Specifies whether to update the document date.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePaymentTermsCode(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; CallingFieldNo: Integer; UpdateDocumentDate: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the return receipt number series.
- ///
- /// The sales header record being validated.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateReturnReceiptNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the sell-to city.
- ///
- /// The sales header record being validated.
- /// The post code record for validation.
- /// The field number that triggered the validation.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateSellToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the sell-to post code.
- ///
- /// The sales header record being validated.
- /// The post code record for validation.
- /// The field number that triggered the validation.
- /// Set to true to skip the default validation logic.
- /// Specifies whether to exit after handling.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateSellToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean; var DoExit: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the ship-to city.
- ///
- /// The sales header record being validated.
- /// The post code record for validation.
- /// The field number that triggered the validation.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShipToCity(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the ship-to post code.
- ///
- /// The sales header record being validated.
- /// The post code record for validation.
- /// The field number that triggered the validation.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShipToPostCode(var SalesHeader: Record "Sales Header"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the VAT registration number.
- ///
- /// The sales header record being validated.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateVATRegistrationNo(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the requested delivery date.
- ///
- /// The sales header record being validated.
- /// Set to true to skip the default validation logic.
- /// The sales header record before modification.
- /// The field number that triggered the validation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateRequestedDeliveryDate(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised before showing a message when sales lines exist and a field changes.
- ///
- /// The sales header record.
- /// The caption of the changed field.
- /// Set to true to skip the default message display.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeMessageIfSalesLinesExist(var SalesHeader: Record "Sales Header"; ChangedFieldCaption: Text; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before showing a price message when sales lines exist.
- ///
- /// The sales header record.
- /// The caption of the changed field.
- /// Set to true to skip the default message display.
- [IntegrationEvent(false, false)]
- local procedure OnBeforePriceMessageIfSalesLinesExist(SalesHeader: Record "Sales Header"; ChangedFieldCaption: Text; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before creating a dimension set for prepayment account default dimensions.
- ///
- /// The sales header record.
- /// Set to true to skip the default dimension set creation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateDimSetForPrepmtAccDefaultDim(SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before recreating sales lines.
- ///
- /// The sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeRecreateSalesLines(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before handling the recreate sales lines process.
- ///
- /// The sales header record.
- /// The sales header record before modification.
- /// The name of the changed field.
- /// Set to true to skip the default recreation handling.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeRecreateSalesLinesHandler(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; ChangedFieldName: Text[100]; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before handling supplement types during sales line recreation.
- ///
- /// The temporary sales line record.
- /// Set to true to skip the default supplement type handling.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeRecreateSalesLinesHandleSupplementTypes(var TempSalesLine: Record "Sales Line" temporary; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating the sales line by changed field number.
- ///
- /// The sales header record.
- /// The sales line record being updated.
- /// The number of the changed field.
- /// Set to true to skip the default update logic.
- /// The sales header record before modification.
- /// The current field number being processed.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSalesLineByChangedFieldNo(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; ChangedFieldNo: Integer; var IsHandled: Boolean; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised before inserting a sales line during line recreation.
- ///
- /// The sales line record being inserted.
- /// The temporary sales line used as source.
- /// The parent sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSalesLineInsert(var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary; SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before setting the customer location code.
- ///
- /// The sales header record being modified.
- /// Set to true to skip the default location code setting.
- /// The sell-to customer record.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetCustomerLocationCode(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; SellToCustomer: Record Customer)
- begin
- end;
-
- ///
- /// Raised before setting the default payment services.
- ///
- /// The sales header record being modified.
- /// Set to true to skip the default payment services setting.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetDefaultPaymentServices(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before setting the default salesperson.
- ///
- /// The sales header record being modified.
- /// Set to true to skip the default salesperson setting.
- /// Specifies whether the record is being inserted.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetDefaultSalesperson(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; InsertMode: Boolean)
- begin
- end;
-
- ///
- /// Raised before storing sales comment lines to temporary storage.
- ///
- /// The sales header record.
- /// The sales header record before modification.
- /// Set to true to skip the default storage logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeStoreSalesCommentLineToTemp(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before testing the number series.
- ///
- /// The sales header record being tested.
- /// Set to true to skip the default number series test.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTestNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before setting the security filter on the responsibility center.
- ///
- /// The sales header record.
- /// Set to true to skip the default security filter setting.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetSecurityFilterOnRespCenter(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before showing the posted documents to print created message.
- ///
- /// Specifies whether to show the posted documents to print message.
- [IntegrationEvent(true, false)]
- local procedure OnBeforeShowPostedDocsToPrintCreatedMsg(var ShowPostedDocsToPrint: Boolean)
- begin
- end;
-
- ///
- /// Raised before synchronizing for reservations.
- ///
- /// The sales header record.
- /// The new sales line record.
- /// The old sales line record.
- /// Set to true to skip the default synchronization logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSynchronizeForReservations(var SalesHeader: Record "Sales Header"; var NewSalesLine: Record "Sales Line"; OldSalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating the bill-to customer contact.
- ///
- /// The sales header record being modified.
- /// The contact record.
- /// Set to true to skip the default contact update.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateBillToCustContact(var SalesHeader: Record "Sales Header"; Conact: Record Contact; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating direct debit payment terms code.
- ///
- /// The sales header record being modified.
- /// Set to true to skip the default payment terms update.
- /// The payment method record.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateDirectDebitPmtTermsCode(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; var PaymentMethod: Record "Payment Method")
- begin
- end;
-
- ///
- /// Raised before updating the sell-to customer.
- ///
- /// The sales header record being modified.
- /// The contact record.
- /// The customer record.
- /// The contact number.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateSellToCust(var SalesHeader: Record "Sales Header"; var Contact: Record Contact; var Customer: Record Customer; ContactNo: Code[20])
- begin
- end;
-
- ///
- /// Raised before updating all line dimensions.
- ///
- /// The sales header record.
- /// The new parent dimension set ID.
- /// The old parent dimension set ID.
- /// Set to true to skip the default dimension update.
- /// The sales header record before modification.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateAllLineDim(var SalesHeader: Record "Sales Header"; NewParentDimSetID: Integer; OldParentDimSetID: Integer; var IsHandled: Boolean; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before updating the location code.
- ///
- /// The sales header record being modified.
- /// The new location code.
- /// Set to true to skip the default location code update.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateLocationCode(var SalesHeader: Record "Sales Header"; LocationCode: Code[10]; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating the outbound warehouse handling time.
- ///
- /// The sales header record being modified.
- /// Set to true to skip the default handling time update.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateOutboundWhseHandlingTime(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating sales line amounts.
- ///
- /// The sales header record.
- /// The sales header record before modification.
- /// The field number that triggered the update.
- /// Set to true to skip the default amounts update.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateSalesLineAmounts(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating sales lines by field number.
- ///
- /// The sales header record.
- /// The number of the changed field.
- /// Specifies whether to ask the user a confirmation question.
- /// Set to true to skip the default update logic.
- /// The sales header record before modification.
- /// The current field number being processed.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateSalesLinesByFieldNo(var SalesHeader: Record "Sales Header"; ChangedFieldNo: Integer; var AskQuestion: Boolean; var IsHandled: Boolean; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised before updating sales lines.
- ///
- /// The sales header record.
- /// The name of the changed field.
- /// Specifies whether to ask the user a confirmation question.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateSalesLines(var SalesHeader: Record "Sales Header"; ChangedFieldName: Text[100]; var AskQuestion: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating the sell-to customer contact.
- ///
- /// The sales header record being modified.
- /// The contact record.
- /// Set to true to skip the default contact update.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateSellToCustContact(var SalesHeader: Record "Sales Header"; Conact: Record Contact; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating the ship-to address.
- ///
- /// The sales header record being modified.
- /// Set to true to skip the default address update.
- /// The current field number being processed.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateShipToAddress(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; CurrFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised before updating the ship-to code from the customer.
- ///
- /// The sales header record being modified.
- /// The customer record.
- /// Set to true to skip the default ship-to code update.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateShipToCodeFromCust(var SalesHeader: Record "Sales Header"; var Customer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the posting date.
- ///
- /// The sales header record being validated.
- /// The sales header record before modification.
- /// The field number that triggered the validation.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePostingDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after filters are set on sales lines during item availability check.
- ///
- /// The sales line record with filters applied.
- [IntegrationEvent(false, false)]
- local procedure OnCheckItemAvailabilityInLinesOnAfterSetFilters(var SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised after filters are set on temporary sales lines during dimension set collection.
- ///
- /// The temporary sales line record with filters applied.
- /// The source sales line record.
- [IntegrationEvent(false, false)]
- local procedure OnCollectParamsInBufferForCreateDimSetOnAfterSetTempSalesLineFilters(var TempSalesLine: Record "Sales Line" temporary; SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised after assigning the responsibility center during sell-to customer address copy.
- ///
- /// The sales header record being modified.
- /// The customer record.
- /// The field number that triggered the copy.
- [IntegrationEvent(false, false)]
- local procedure OnCopySelltoCustomerAddressFieldsFromCustomerOnAfterAssignRespCenter(var SalesHeader: Record "Sales Header"; Customer: Record Customer; CallingFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised after assigning the sell-to customer address during customer address copy.
- ///
- /// The sales header record being modified.
- /// The customer record.
- [IntegrationEvent(false, false)]
- procedure OnCopySellToCustomerAddressFieldsFromCustomerOnAfterAssignSellToCustomerAddress(var SalesHeader: Record "Sales Header"; Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised before updating lines during dimension creation.
- ///
- /// The sales header record.
- /// The sales header record before modification.
- /// The field number that triggered the dimension creation.
- /// The old dimension set ID.
- /// The list of default dimension sources.
- [IntegrationEvent(false, false)]
- local procedure OnCreateDimOnBeforeUpdateLines(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; OldDimSetID: Integer; DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])
- begin
- end;
-
- ///
- /// Raised before modifying the sales header during dimension creation.
- ///
- /// The sales header record being modified.
- /// The sales header record before modification.
- /// The field number that triggered the dimension creation.
- /// The old dimension set ID.
- [IntegrationEvent(false, false)]
- local procedure OnCreateDimOnBeforeModify(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; FieldNo: Integer; OldDimSetID: Integer)
- begin
- end;
-
- ///
- /// Raised after updating global dimensions when keeping dimensions during dimension creation.
- ///
- /// The sales header record being modified.
- /// The sales header record before modification.
- /// The field number that triggered the dimension creation.
- /// The old dimension set ID.
- [IntegrationEvent(false, false)]
- local procedure OnCreateDimOnKeepDimensionsOnAfterUpdateGlobalDim(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; FieldNo: Integer; OldDimSetID: Integer)
- begin
- end;
-
- ///
- /// Raised after assigning the type during sales line creation.
- ///
- /// The sales line record being created.
- /// The temporary sales line used as source.
- [IntegrationEvent(false, false)]
- local procedure OnCreateSalesLineOnAfterAssignType(var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary)
- begin
- end;
-
- ///
- /// Raised before validating the quantity during sales line creation.
- ///
- /// The sales line record being created.
- /// The temporary sales line used as source.
- /// Specifies whether to validate the quantity.
- [IntegrationEvent(false, false)]
- local procedure OnCreateSalesLineOnBeforeValidateQuantity(var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary; var ShouldValidateQuantity: Boolean)
- begin
- end;
-
- ///
- /// Raised before transferring fields from temporary sales line during sales line creation.
- ///
- /// The sales line record being created.
- /// The temporary sales line used as source.
- /// The parent sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnCreateSalesLineOnBeforeTransferFieldsFromTempSalesLine(var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary; var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before deleting a line during sales lines deletion.
- ///
- /// The sales line record being deleted.
- [IntegrationEvent(false, false)]
- local procedure OnDeleteSalesLinesOnBeforeDeleteLine(var SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised after the sales header is deleted during post-sales delete processing.
- ///
- /// The sales header record that was deleted.
- [IntegrationEvent(false, false)]
- local procedure OnDeleteOnAfterPostSalesDeleteDeleteHeader(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before archiving the sales document during deletion.
- ///
- /// The sales header record being deleted.
- /// The sales header record before deletion.
- [IntegrationEvent(false, false)]
- local procedure OnDeleteOnBeforeArchiveSalesDocument(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after initializing the number series during initialization from a contact.
- ///
- /// The sales header record being initialized.
- /// The sales header record before initialization.
- [IntegrationEvent(false, false)]
- local procedure OnInitFromContactOnAfterInitNoSeries(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before initializing the record during initialization from a contact.
- ///
- /// The sales header record being initialized.
- /// The sales header record before initialization.
- [IntegrationEvent(false, false)]
- local procedure OnInitFromContactOnBeforeInitRecord(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after initializing the number series during initialization from a template.
- ///
- /// The sales header record being initialized.
- /// The sales header record before initialization.
- [IntegrationEvent(false, false)]
- local procedure OnInitFromTemplateOnAfterInitNoSeries(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before initializing the record during initialization from a template.
- ///
- /// The sales header record being initialized.
- /// The sales header record before initialization.
- [IntegrationEvent(false, false)]
- local procedure OnInitFromTemplateOnBeforeInitRecord(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before initializing the record during insert initialization.
- ///
- /// The sales header record being initialized.
- /// The sales header record before initialization.
- [IntegrationEvent(false, false)]
- local procedure OnInitInsertOnBeforeInitRecord(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before assigning the shipment date during record initialization.
- ///
- /// The sales header record being initialized.
- /// Set to true to skip the default shipment date assignment.
- [IntegrationEvent(false, false)]
- local procedure OnInitRecordOnBeforeAssignShipmentDate(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before assigning the order date during record initialization.
- ///
- /// The sales header record being initialized.
- /// The new order date to be assigned.
- [IntegrationEvent(false, false)]
- local procedure OnInitRecordOnBeforeAssignOrderDate(var SalesHeader: Record "Sales Header"; var NewOrderDate: Date)
- begin
- end;
-
- ///
- /// Raised before inserting a temporary sales line during buffer insertion.
- ///
- /// The temporary sales line record being inserted.
- /// The source sales line record.
- [IntegrationEvent(false, false)]
- local procedure OnInsertTempSalesLineInBufferOnBeforeTempSalesLineInsert(var TempSalesLine: Record "Sales Line" temporary; SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised after updating the bill-to customer on a sales quote.
- ///
- /// The sales header record being updated.
- /// The contact record associated with the bill-to customer.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateBillToCustOnAfterSalesQuote(var SalesHeader: Record "Sales Header"; Contact: Record Contact)
- begin
- end;
-
- ///
- /// Raised before recreating sales lines when validating the bill-to customer template code.
- ///
- /// The sales header record being validated.
- /// The field number that triggered the validation.
- [IntegrationEvent(false, false)]
- local procedure OnValidateBilltoCustomerTemplCodeOnBeforeRecreateSalesLines(var SalesHeader: Record "Sales Header"; CallingFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised before recreating sales lines when validating the responsibility center.
- ///
- /// The sales header record being validated.
- /// The field number that triggered the validation.
- [IntegrationEvent(false, false)]
- local procedure OnValidateResponsibilityCenterOnBeforeRecreateSalesLines(var SalesHeader: Record "Sales Header"; CallingFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised after initialization when validating the sell-to customer number.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnValidateSellToCustomerNoAfterInit(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after calculating whether to skip the confirm sell-to customer dialog during sell-to customer number validation.
- ///
- /// The sales header record being validated.
- /// Set to true to skip the confirmation dialog.
- /// Set to true to indicate that the confirmed result should be false.
- [IntegrationEvent(false, false)]
- local procedure OnValidateSellToCustomerNoOnAfterCalcShouldSkipConfirmSellToCustomerDialog(var SalesHeader: Record "Sales Header"; var ShouldSkipConfirmSellToCustomerDialog: Boolean; var ConfirmedShouldBeFalse: Boolean)
- begin
- end;
-
- ///
- /// Raised after calculating whether to update the opportunity when validating the sell-to contact number.
- ///
- /// The sales header record being validated.
- /// Set to true to update the related opportunity.
- [IntegrationEvent(false, false)]
- local procedure OnValidateSelltoContactNoOnAfterCalcShouldUpdateOpportunity(var SalesHeader: Record "Sales Header"; var ShouldUpdateOpportunity: Boolean)
- begin
- end;
-
- ///
- /// Raised after testing the quantity shipped field on a sales line.
- ///
- /// The sales line record that was tested.
- [IntegrationEvent(false, false)]
- local procedure OnAfterTestQuantityShippedField(SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised before testing sales line fields before recreating lines.
- ///
- /// The sales header record.
- /// Set to true to skip the default test logic.
- /// The sales line record being tested.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTestSalesLineFieldsBeforeRecreate(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; var SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised before testing the quantity shipped field on a sales line.
- ///
- /// The sales line record being tested.
- /// Set to true to skip the default test logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTestQuantityShippedField(SalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after preparing to open document statistics.
- ///
- /// The sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnAfterPrepareOpeningDocumentStatistics(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before testing if the status is open.
- ///
- /// The sales header record being tested.
- /// The previous version of the sales header record.
- /// The field number that triggered the test.
- [IntegrationEvent(true, false)]
- local procedure OnBeforeTestStatusOpen(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CallingFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised after testing if the status is open.
- ///
- /// The sales header record that was tested.
- [IntegrationEvent(true, false)]
- local procedure OnAfterTestStatusOpen(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after updating the bill-to contact from customer and contact records.
- ///
- /// The sales header record being updated.
- /// The customer record.
- /// The contact record.
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateBillToCont(var SalesHeader: Record "Sales Header"; Customer: Record Customer; Contact: Record Contact)
- begin
- end;
-
- ///
- /// Raised after updating the bill-to customer from a contact.
- ///
- /// The sales header record being updated.
- /// The contact record used to update the bill-to customer.
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateBillToCust(var SalesHeader: Record "Sales Header"; Contact: Record Contact)
- begin
- end;
-
- ///
- /// Raised after updating the sell-to contact from customer and contact records.
- ///
- /// The sales header record being updated.
- /// The customer record.
- /// The contact record.
- /// Indicates whether validation dialogs should be hidden.
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateSellToCont(var SalesHeader: Record "Sales Header"; Customer: Record Customer; Contact: Record Contact; HideValidationDialog: Boolean)
- begin
- end;
-
- ///
- /// Raised after updating the sell-to customer from a contact.
- ///
- /// The sales header record being updated.
- /// The contact record used to update the sell-to customer.
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateSellToCust(var SalesHeader: Record "Sales Header"; Contact: Record Contact)
- begin
- end;
-
- ///
- /// Raised after updating sales lines.
- ///
- /// The sales header record whose lines were updated.
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateSalesLines(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after setting the company bank account.
- ///
- /// The sales header record being updated.
- /// The previous version of the sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetCompanyBankAccount(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before validating the applies-to document number.
- ///
- /// The sales header record being validated.
- /// The customer ledger entry to apply.
- /// The previous version of the sales header record.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateAppliesToDocNo(var SalesHeader: Record "Sales Header"; var CustLedgEntry: Record "Cust. Ledger Entry"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean);
- begin
- end;
-
- ///
- /// Raised before validating the bill-to customer name.
- ///
- /// The sales header record being validated.
- /// The customer record to validate against.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateBillToCustomerName(var SalesHeader: Record "Sales Header"; var Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised before validating the sell-to customer name.
- ///
- /// The sales header record being validated.
- /// The customer record to validate against.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateSellToCustomerName(var SalesHeader: Record "Sales Header"; var Customer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating a shortcut dimension code.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// The field number of the shortcut dimension being validated.
- /// The shortcut dimension code value.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShortcutDimCode(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; FieldNumber: Integer; var ShortcutDimCode: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before modifying the sales header when linking a sales document with an opportunity.
- ///
- /// The sales header record being linked.
- /// The previous opportunity number.
- /// The opportunity record being linked.
- [IntegrationEvent(false, false)]
- local procedure OnLinkSalesDocWithOpportunityOnBeforeSalesHeaderModify(var SalesHeader: Record "Sales Header"; OldOpportunityNo: Code[20]; Opportunity: Record Opportunity)
- begin
- end;
-
- ///
- /// Raised after setting sales line filters during sales line recreation.
- ///
- /// The sales line record with filters applied.
- /// The sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnRecreateSalesLinesOnAfterSetSalesLineFilters(var SalesLine: Record "Sales Line"; var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before confirming the recreation of sales lines.
- ///
- /// The sales header record.
- /// The previous version of the sales header record.
- /// The name of the field that was changed.
- /// Indicates whether validation dialogs should be hidden.
- /// The confirmation result.
- /// Set to true to skip the default confirmation logic.
- [IntegrationEvent(false, false)]
- local procedure OnRecreateSalesLinesOnBeforeConfirm(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; ChangedFieldName: Text[100]; HideValidationDialog: Boolean; var Confirmed: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before deleting all sales lines during recreation.
- ///
- /// The sales header record.
- /// The sales line record to be deleted.
- /// The current field number being processed.
- /// Set to true to skip the default delete logic.
- [IntegrationEvent(false, false)]
- local procedure OnRecreateSalesLinesOnBeforeSalesLineDeleteAll(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after processing temporary sales lines during recreation.
- ///
- /// The temporary sales line record that was processed.
- /// The sales header record.
- /// The previous version of the sales header record.
- /// The name of the field that was changed.
- [IntegrationEvent(false, false)]
- local procedure OnRecreateSalesLinesOnAfterProcessTempSalesLines(var TempSalesLine: Record "Sales Line" temporary; var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; ChangedFieldName: Text[100])
- begin
- end;
-
- ///
- /// Raised after the loop during reservation entry and requisition line recreation.
- ///
- /// The sales header record.
- /// The sales line record being processed.
- [IntegrationEvent(false, false)]
- local procedure OnRecreateReservEntryReqLineOnAfterLoop(var SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised after calculating whether to validate the location code during reservation entry recreation.
- ///
- /// The sales header record.
- /// The previous version of the sales header record.
- /// The sales line record being processed.
- /// Set to true to validate the location code.
- [IntegrationEvent(false, false)]
- local procedure OnRecreateReservEntryReqLineOnAfterCalcShouldValidateLocationCode(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var ShouldValidateLocationCode: Boolean)
- begin
- end;
-
- ///
- /// Raised after calculating whether to create a sales line when handling supplement types during recreation.
- ///
- /// The temporary sales line record.
- /// Set to true to create the sales line.
- /// The sales line record being created.
- [IntegrationEvent(false, false)]
- local procedure OnRecreateSalesLinesHandleSupplementTypesOnAfterCalcShouldCreateSalsesLine(var TempSalesLine: Record "Sales Line"; var ShouldCreateSalsesLine: Boolean; var SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised after assigning the bill-to customer address from the customer record.
- ///
- /// The sales header record being updated.
- /// The customer record used as the source.
- [IntegrationEvent(false, false)]
- procedure OnSetBillToCustomerAddressFieldsFromCustomerOnAfterAssignBillToCustomerAddress(var SalesHeader: Record "Sales Header"; Customer: Record Customer)
- begin
- end;
-
- ///
- /// Raised after calculating whether to copy location code and salesperson code from ship-to address.
- ///
- /// The sales header record being updated.
- /// The previous version of the sales header record.
- /// The ship-to address record.
- /// Set to true to copy the location code.
- /// Set to true to copy the salesperson code.
- [IntegrationEvent(false, false)]
- local procedure OnSetShipToCustomerAddressFieldsFromShipToAddrOnAfterCalcShouldCopyLocationCode(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; ShipToAddress: Record "Ship-to Address"; var ShouldCopyLocationCode: Boolean; var ShouldCopySalespersonCode: Boolean)
- begin
- end;
-
- ///
- /// Raised to test if the status is not pending approval.
- ///
- /// The sales header record being tested.
- /// Set to true if the status is not pending approval.
- [IntegrationEvent(false, false)]
- local procedure OnTestStatusIsNotPendingApproval(SalesHeader: Record "Sales Header"; var NotPending: Boolean)
- begin
- end;
-
- ///
- /// Raised to test if the status is not pending prepayment.
- ///
- /// The sales header record being tested.
- /// Set to true if the status is not pending prepayment.
- [IntegrationEvent(false, false)]
- local procedure OnTestStatusIsNotPendingPrepayment(SalesHeader: Record "Sales Header"; var NotPending: Boolean)
- begin
- end;
-
- ///
- /// Raised to test if the status is not released.
- ///
- /// The sales header record being tested.
- /// Set to true if the status is not released.
- [IntegrationEvent(false, false)]
- local procedure OnTestStatusIsNotReleased(SalesHeader: Record "Sales Header"; var NotReleased: Boolean)
- begin
- end;
-
- ///
- /// Raised after modifying a sales line when updating all line dimensions.
- ///
- /// The sales line record that was modified.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateAllLineDimOnAfterSalesLineModify(var SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised before modifying a sales line when updating all line dimensions.
- ///
- /// The sales line record being modified.
- /// The previous version of the sales line record.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateAllLineDimOnBeforeSalesLineModify(var SalesLine: Record "Sales Line"; xSalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised before modifying a sales line when updating sales lines by field number.
- ///
- /// The sales line record being modified.
- /// The field number that was changed.
- /// The current field number being processed.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesLinesByFieldNoOnBeforeSalesLineModify(var SalesLine: Record "Sales Line"; ChangedFieldNo: Integer; CurrentFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised after calculating whether to confirm a reservation date conflict when updating sales lines by field number.
- ///
- /// The sales header record.
- /// The field number that was changed.
- /// Set to true to confirm the reservation date conflict.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesLinesByFieldNoOnAfterCalcShouldConfirmReservationDateConflict(var SalesHeader: Record "Sales Header"; ChangedFieldNo: Integer; var ShouldConfirmReservationDateConflict: Boolean)
- begin
- end;
-
- ///
- /// Raised before displaying an error that the contact is not related to any customer when updating bill-to customer.
- ///
- /// The sales header record being updated.
- /// The contact record.
- /// The contact business relation record.
- /// Set to true to skip the default error logic.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateBillToCustOnBeforeContactIsNotRelatedToAnyCostomerErr(var SalesHeader: Record "Sales Header"; Contact: Record Contact; var ContactBusinessRelation: Record "Contact Business Relation"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before finding the contact business relation when updating bill-to customer.
- ///
- /// The contact record.
- /// The contact business relation record to find.
- /// Indicates whether the contact business relation was found.
- /// Set to true to skip the default find logic.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateBillToCustOnBeforeFindContactBusinessRelation(Contact: Record Contact; var ContBusinessRelation: Record "Contact Business Relation"; var ContactBusinessRelationFound: Boolean; var IsHandled: Boolean);
- begin
- end;
-
- ///
- /// Raised after setting the sales header from a search contact when updating sell-to customer.
- ///
- /// The sales header record being updated.
- /// The search contact record used as the source.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSellToCustOnAfterSetFromSearchContact(var SalesHeader: Record "Sales Header"; var SearchContact: Record Contact)
- begin
- end;
-
- ///
- /// Raised after setting the ship-to address when updating sell-to customer.
- ///
- /// The sales header record being updated.
- /// The search contact record.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSellToCustOnAfterSetShipToAddress(var SalesHeader: Record "Sales Header"; var SearchContact: Record Contact)
- begin
- end;
-
- ///
- /// Raised after setting the sell-to contact number when updating sell-to customer.
- ///
- /// The sales header record being updated.
- /// The customer record.
- /// The contact record.
- /// Set to true to indicate custom handling was performed.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSellToCustOnAfterSetSellToContactNo(var SalesHeader: Record "Sales Header"; var Customer: Record Customer; var Cont: Record Contact; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before displaying an error that the contact is not related to any customer when updating sell-to customer.
- ///
- /// The sales header record being updated.
- /// The contact record.
- /// The contact business relation record.
- /// Set to true to skip the default error logic.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSellToCustOnBeforeContactIsNotRelatedToAnyCostomerErr(var SalesHeader: Record "Sales Header"; Contact: Record Contact; var ContactBusinessRelation: Record "Contact Business Relation"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before finding the contact business relation when updating sell-to customer.
- ///
- /// The contact record.
- /// The contact business relation record to find.
- /// Indicates whether the contact business relation was found.
- /// Set to true to skip the default find logic.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSellToCustOnBeforeFindContactBusinessRelation(Cont: Record Contact; var ContBusinessRelation: Record "Contact Business Relation"; var ContactBusinessRelationFound: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after confirming the bill-to customer number change.
- ///
- /// The sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnValidateBillToCustomerNoOnAfterConfirmed(var SalesHeader: Record "Sales Header");
- begin
- end;
-
- ///
- /// Raised before calculating the due date when validating payment terms code.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// The field number that called the validation.
- /// The field number that triggered the validation.
- /// Set to true to skip the default calculation logic.
- [IntegrationEvent(false, false)]
- local procedure OnValidatePaymentTermsCodeOnBeforeCalcDueDate(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; CalledByFieldNo: Integer; CallingFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before calculating the payment discount date when validating payment terms code.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// The field number that called the validation.
- /// The field number that triggered the validation.
- /// Set to true to skip the default calculation logic.
- [IntegrationEvent(false, false)]
- local procedure OnValidatePaymentTermsCodeOnBeforeCalcPmtDiscDate(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; CalledByFieldNo: Integer; CallingFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the due date when validating payment terms code.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// The current field number being processed.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnValidatePaymentTermsCodeOnBeforeValidateDueDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the due date when payment terms code is blank.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// The current field number being processed.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnValidatePaymentTermsCodeOnBeforeValidateDueDateWhenBlank(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before assigning the document date when validating posting date.
- ///
- /// The sales header record being validated.
- /// Set to true to skip the default assignment logic.
- [IntegrationEvent(false, false)]
- local procedure OnValidatePostingDateOnBeforeAssignDocumentDate(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before resetting the invoice discount value when validating posting date.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnValidatePostingDateOnBeforeResetInvoiceDiscountValue(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before checking if the currency factor needs to be updated when validating posting date.
- ///
- /// The sales header record being validated.
- /// The confirmation result for updating the currency factor.
- /// Indicates whether the currency factor needs to be updated.
- /// The previous version of the sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnValidatePostingDateOnBeforeCheckNeedUpdateCurrencyFactor(var SalesHeader: Record "Sales Header"; var IsConfirmed: Boolean; var NeedUpdateCurrencyFactor: Boolean; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before calculating the prepayment due date when validating payment terms code.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// The current field number being processed.
- /// Set to true to skip the default calculation logic.
- [IntegrationEvent(false, false)]
- local procedure OnValidatePaymentTermsCodeOnBeforeCalculatePrepaymentDueDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before modifying a sales line when validating prices including VAT.
- ///
- /// The sales header record being validated.
- /// The sales line record being modified.
- /// The currency record.
- /// Indicates whether the price should be recalculated.
- [IntegrationEvent(false, false)]
- local procedure OnValidatePricesIncludingVATOnBeforeSalesLineModify(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; Currency: Record Currency; RecalculatePrice: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating lines when validating shipping agent code.
- ///
- /// The sales header record being validated.
- /// The field number that triggered the validation.
- /// Indicates whether validation dialogs should be hidden.
- [IntegrationEvent(false, false)]
- local procedure OnValidateShippingAgentCodeOnBeforeUpdateLines(var SalesHeader: Record "Sales Header"; CallingFieldNo: Integer; HideValidationDialog: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting the full document type text.
- ///
- /// The sales header record.
- /// The full document type text to return.
- /// Set to true to skip the default logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetFullDocTypeTxt(var SalesHeader: Record "Sales Header"; var FullDocTypeTxt: Text; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before inserting a temporary sales line in the buffer when collecting parameters for creating a dimension set.
- ///
- /// The general posting setup record.
- /// The default dimension record.
- [IntegrationEvent(true, false)]
- local procedure OnCollectParamsInBufferForCreateDimSetOnBeforeInsertTempSalesLineInBuffer(var GenPostingSetup: Record "General Posting Setup"; var DefaultDimension: Record "Default Dimension")
- begin
- end;
-
- ///
- /// Raised before copying a document.
- ///
- /// The sales header record.
- /// Set to true to skip the default copy logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyDocument(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean);
- begin
- end;
-
- ///
- /// Raised before updating the bill-to customer.
- ///
- /// The sales header record being updated.
- /// The contact number to use for the update.
- /// Set to true to skip the default update logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateBillToCust(var SalesHeader: Record "Sales Header"; ContactNo: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before finding the temporary sales line set during recreation.
- ///
- /// The temporary sales line record.
- [IntegrationEvent(false, false)]
- local procedure OnRecreateSalesLinesOnBeforeTempSalesLineFindSet(var TempSalesLine: Record "Sales Line" temporary; var SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised before checking if a contact is related to a customer company.
- ///
- /// The sales header record.
- /// The current field number being processed.
- /// Set to true to skip the default check logic.
- /// The contact number to check.
- /// The customer number to check against.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckContactRelatedToCustomerCompany(SalesHeader: Record "Sales Header"; CurrFieldNo: Integer; var IsHandled: Boolean; ContactNo: Code[20]; CustomerNo: Code[20])
- begin
- end;
-
- ///
- /// Raised before showing the modify address notification.
- ///
- /// Set to true to skip the default notification logic.
- /// The sales header record.
- /// The customer number for the notification.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowModifyAddressNotification(var IsHandled: Boolean; SalesHeader: Record "Sales Header"; CustomerNumber: Code[20])
- begin
- end;
-
- ///
- /// Raised before updating sales lines when showing document dimensions.
- ///
- /// The sales header record.
- /// The previous version of the sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnShowDocDimOnBeforeUpdateSalesLines(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before confirming price recalculation.
- ///
- /// The sales header record.
- /// The previous version of the sales header record.
- /// The current field number being processed.
- /// The confirmation result.
- /// Indicates whether validation dialogs should be hidden.
- /// Set to true to skip the default confirmation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeConfirmRecalculatePrice(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrFieldNo: Integer; var Result: Boolean; var HideValidationDialog: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting a new dimension set ID for a sales line when updating all line dimensions.
- ///
- /// The sales line record being updated.
- /// The new parent dimension set ID.
- /// The old parent dimension set ID.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateAllLineDimOnBeforeGetSalesLineNewDimSetID(var SalesLine: Record "Sales Line"; NewParentDimSetID: Integer; OldParentDimSetID: Integer)
- begin
- end;
-
- ///
- /// Raised after getting a new dimension set ID for a sales line when updating all line dimensions.
- ///
- /// The sales header record.
- /// The previous version of the sales header record.
- /// The sales line record being updated.
- /// The new dimension set ID.
- /// The new parent dimension set ID.
- /// The old parent dimension set ID.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateAllLineDimOnAfterGetSalesLineNewDimsetID(SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; var NewDimSetID: Integer; NewParentDimSetID: Integer; OldParentDimSetID: Integer)
- begin
- end;
-
- ///
- /// Raised before validating the shipping number series.
- ///
- /// The sales header record being validated.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShippingNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before renaming the sales header.
- ///
- /// The sales header record being renamed.
- /// Set to true to skip the default rename logic.
- /// The previous version of the sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeRename(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before looking up the bill-to contact number.
- ///
- /// Set to true to skip the default lookup logic.
- /// The sales header record.
- /// The previous version of the sales header record.
- [IntegrationEvent(true, false)]
- local procedure OnBeforeLookupBillToContactNo(var IsHandled: Boolean; var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before updating the opportunity.
- ///
- /// Set to true to skip the default update logic.
- /// The sales header record.
- [IntegrationEvent(true, false)]
- local procedure OnBeforeUpdateOpportunity(var IsHandled: Boolean; var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before checking the promised delivery date.
- ///
- /// Set to true to skip the default check logic.
- /// The sales header record.
- [IntegrationEvent(true, false)]
- local procedure OnBeforeCheckPromisedDeliveryDate(var IsHandled: Boolean; var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before updating the ship-to address from the sell-to address.
- ///
- /// The sales header record being updated.
- /// The field number triggering the update.
- /// Set to true to skip the default update logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateShipToAddressFromSellToAddress(var SalesHeader: Record "Sales Header"; FieldNumber: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating the ship-to salesperson code.
- ///
- /// The sales header record being updated.
- /// Set to true to skip the default update logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateShipToSalespersonCode(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before setting the salesperson code.
- ///
- /// The sales header record being updated.
- /// The salesperson code to check.
- /// The salesperson code to assign.
- /// Set to true to skip the default logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetSalespersonCode(var SalesHeader: Record "Sales Header"; SalesPersonCodeToCheck: Code[20]; var SalesPersonCodeToAssign: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after updating the ship-to address from the sell-to address.
- ///
- /// The sales header record that was updated.
- /// The previous version of the sales header record.
- /// The field number that triggered the update.
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateShipToAddressFromSellToAddress(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; FieldNumber: Integer)
- begin
- end;
-
- ///
- /// Raised before validating the ship-to code.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// The customer record.
- /// The ship-to address record.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShipToCode(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; Cust: Record Customer; ShipToAddr: Record "Ship-to Address"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking if the customer is blocked on documents when validating sell-to customer number.
- ///
- /// The sales header record being validated.
- /// The customer record to check.
- /// Set to true to skip the default check logic.
- [IntegrationEvent(false, false)]
- local procedure OnValidateSellToCustomerNoOnBeforeCheckBlockedCustOnDocs(var SalesHeader: Record "Sales Header"; var Cust: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking if the customer is blocked on documents when validating bill-to customer number.
- ///
- /// The sales header record being validated.
- /// The customer record to check.
- /// Set to true to skip the default check logic.
- [IntegrationEvent(false, false)]
- local procedure OnValidateBillToCustomerNoOnBeforeCheckBlockedCustOnDocs(var SalesHeader: Record "Sales Header"; var Cust: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before setting bill-to customer address fields from the customer record.
- ///
- /// The sales header record being updated.
- /// The bill-to customer record.
- /// Set to true to skip updating the bill-to contact.
- /// Set to true to skip the default logic.
- /// The previous version of the sales header record.
- /// The general ledger setup record.
- /// The current field number being processed.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetBillToCustomerAddressFieldsFromCustomer(var SalesHeader: Record "Sales Header"; var BillToCustomer: Record Customer; var SkipBillToContact: Boolean; var IsHandled: Boolean; xSalesHeader: Record "Sales Header"; var GLSetup: Record "General Ledger Setup"; CurrentFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised before recalling the modify address notification when validating bill-to customer number.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnValidateBillToCustomerNoOnBeforeRecallModifyAddressNotification(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")
- begin
- end;
-
-#if not CLEAN27
- ///
- /// Raised before validating the bill-to name.
- ///
- /// The sales header record being validated.
- /// The customer record.
- /// Set to true to skip the default validation logic.
- /// The previous version of the sales header record.
- [Obsolete('This event is never raised.', '27.0')]
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateBillToName(var SalesHeader: Record "Sales Header"; var Customer: Record Customer; var IsHandled: Boolean; xSalesHeader: Record "Sales Header")
- begin
- end;
-#endif
- ///
- /// Raised before validating tax liable when validating the ship-to code.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnValidateShipToCodeOnBeforeValidateTaxLiable(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before copying the ship-to address when validating the ship-to code.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// Set to true to copy the ship-to address.
- [IntegrationEvent(false, false)]
- local procedure OnValidateShipToCodeOnBeforeCopyShipToAddress(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; var CopyShipToAddress: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the shipment method code.
- ///
- /// The sales header record being validated.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShipmentMethodCode(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the shipping agent code.
- ///
- /// The sales header record being validated.
- /// Set to true to skip the default validation logic.
- /// The previous version of the sales header record.
- /// The current field number being processed.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShippingAgentCode(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; var xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised before assigning the work date to the posting date during record initialization.
- ///
- /// The sales header record being initialized.
- /// Set to true to skip the default assignment logic.
- [IntegrationEvent(false, false)]
- local procedure OnInitRecordOnBeforeAssignWorkDateToPostingDate(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before setting the bill-to customer number.
- ///
- /// The sales header record being updated.
- /// The customer record.
- /// Set to true to skip the default logic.
- /// The previous version of the sales header record.
- /// The current field number being processed.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetBillToCustomerNo(var SalesHeader: Record "Sales Header"; var Cust: Record Customer; var IsHandled: Boolean; xSalesHeader: Record "Sales Header"; var CurrentFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised before validating the shipping agent service code.
- ///
- /// The sales header record being validated.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShippingAgentServiceCode(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the prepayment payment terms code.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// The field number that called the validation.
- /// The field number that triggered the validation.
- /// Indicates whether the document date should be updated.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePrepmtPaymentTermsCode(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; CalledByFieldNo: Integer; CallingFieldNo: Integer; UpdateDocumentDate: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after recreating sales lines.
- ///
- /// The sales header record whose lines were recreated.
- /// The name of the field that was changed.
- [IntegrationEvent(false, false)]
- local procedure OnAfterRecreateSalesLines(var SalesHeader: Record "Sales Header"; ChangedFieldName: Text[100])
- begin
- end;
-
- ///
- /// Raised after setting the sell-to customer from a filter.
- ///
- /// The sales header record that was updated.
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetSellToCustomerFromFilter(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before calculating the invoice discount for the header.
- ///
- /// The sales header record.
- /// Set to true to skip the default calculation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCalcInvDiscForHeader(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before determining if dimensions could be kept.
- ///
- /// The sales header record.
- /// The previous version of the sales header record.
- /// The result indicating whether dimensions could be kept.
- /// Set to true to skip the default logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCouldDimensionsBeKept(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before confirming the bill-to customer change.
- ///
- /// The sales header record being updated.
- /// The previous version of the sales header record.
- /// The current field number being processed.
- /// The confirmation result.
- /// Set to true to skip the default confirmation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeConfirmBillToCustomerChange(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrFieldNo: Integer; var Confirmed: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before recalling the modify address notification when validating sell-to customer number.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnValidateSellToCustomerNoOnBeforeRecallModifyAddressNotification(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before checking the sales header case during credit max check before insert.
- ///
- /// The sales header record to check.
- /// The sales header record being inserted.
- [IntegrationEvent(false, false)]
- local procedure OnCheckCreditMaxBeforeInsertOnCaseIfOnBeforeSalesHeaderCheckCase(var SalesHeader: Record "Sales Header"; Rec: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after confirming the customer creation process.
- ///
- /// The sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnCheckCustomerCreatedOnAfterConfirmProcess(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before validating the prepayment due date in the else case of prepayment payment terms code.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// The current field number being processed.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnPrepmtPaymentTermsCodeOnCaseElseOnBeforeValidatePrepaymentDueDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the prepayment due date in the if case when validating prepayment payment terms code.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// The current field number being processed.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnValidatePrepmtPaymentTermsCodeOnCaseIfOnBeforeValidatePrepaymentDueDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after handling supplement types during sales lines recreation.
- ///
- /// The sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnAfterRecreateSalesLinesHandleSupplementTypes(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after initializing the posting number series.
- ///
- /// The sales header record.
- /// The previous version of the sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitPostingNoSeries(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before initializing from the bill-to customer template.
- ///
- /// The sales header record being initialized.
- /// The previous version of the sales header record.
- /// The bill-to customer template record.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitFromBillToCustTemplate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var BillToCustTemplate: Record "Customer Templ.")
- begin
- end;
-
- ///
- /// Raised before copying from a new sell-to customer template.
- ///
- /// The sales header record being updated.
- /// The previous version of the sales header record.
- /// The sell-to customer template record.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyFromNewSellToCustTemplate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var SellToCustTemplate: Record "Customer Templ.")
- begin
- end;
-
- ///
- /// Raised before modifying the customer address.
- ///
- /// The sales header record.
- /// The previous version of the sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeModifyCustomerAddress(var Rec: Record "Sales Header"; var xRec: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before determining if the address should be copied from the bill-to customer.
- ///
- /// The bill-to customer record.
- /// The sales header record.
- /// The previous version of the sales header record.
- /// The result indicating whether to copy the address.
- /// Set to true to skip the default logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShouldCopyAddressFromBillToCustomer(BillToCustomer: Record Customer; Rec: Record "Sales Header"; xRec: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before determining if the bill-to customer is replaced.
- ///
- /// The sales header record.
- /// The previous version of the sales header record.
- /// The result indicating whether the bill-to customer was replaced.
- /// Set to true to skip the default logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeBillToCustomerIsReplaced(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after finding a sales line during recreation.
- ///
- /// The sales header record.
- /// The sales line record that was found.
- /// The name of the field that was changed.
- [IntegrationEvent(false, false)]
- local procedure OnRecreateSalesLinesOnAfterFindSalesLine(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; ChangedFieldName: Text[100])
- begin
- end;
-
- ///
- /// Raised before assigning the responsibility center when copying sell-to customer address fields.
- ///
- /// The sales header record being updated.
- /// The sell-to customer record.
- /// Set to true to skip the default assignment logic.
- [IntegrationEvent(false, false)]
- local procedure OnCopySelltoCustomerAddressFieldsFromCustomerOnBeforeAssignRespCenter(var SalesHeader: Record "Sales Header"; var SellToCustomer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the external document number.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// The current field number being processed.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateExternalDocumentNo(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after checking if the currency factor needs to be updated when validating posting date.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// Indicates whether the currency factor needs to be updated.
- [IntegrationEvent(false, false)]
- local procedure OnValidatePostingDateOnAfterCheckNeedUpdateCurrencyFactor(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var NeedUpdateCurrencyFactor: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting the customer when validating sell-to customer number.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnValidateSellToCustomerNoOnBeforeGetCust(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before assigning the responsibility center during record initialization.
- ///
- /// The sales header record being initialized.
- /// Set to true to skip the default assignment logic.
- [IntegrationEvent(false, false)]
- local procedure OnInitRecordOnBeforeAssignResponsibilityCenter(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the location code when validating sell-to customer number.
- ///
- /// The sales header record being validated.
- /// The customer record.
- /// Set to true to skip the default validation logic.
- /// The previous version of the sales header record.
- /// The location code to validate.
- [IntegrationEvent(false, false)]
- local procedure OnValidateSellToCustomerNoOnBeforeValidateLocationCode(var SalesHeader: Record "Sales Header"; var Cust: Record Customer; var IsHandled: Boolean; xSalesHeader: Record "Sales Header"; var LocationCode: Code[10])
- begin
- end;
-
- ///
- /// Raised before checking the IC direction when validating send IC document.
- ///
- /// The sales header record being validated.
- /// Set to true to skip the default check logic.
- [IntegrationEvent(false, false)]
- local procedure OnValidateSendICDocumentOnBeforeCheckICDirection(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after getting posted document lines to reverse.
- ///
- /// The sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetPstdDocLinesToReverse(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before validating shipping agent fields when copying ship-to customer address fields from customer.
- ///
- /// The sales header record being updated.
- /// The previous version of the sales header record.
- /// The sell-to customer record.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnCopyShipToCustomerAddressFieldsFromCustOnBeforeValidateShippingAgentFields(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; SellToCustomer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating shipping agent fields when setting ship-to customer address fields from ship-to address.
- ///
- /// The sales header record being updated.
- /// The previous version of the sales header record.
- /// The ship-to address record.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnSetShipToCustomerAddressFieldsFromShipToAddrOnBeforeValidateShippingAgentFields(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; ShipToAddr: Record "Ship-to Address"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting the next archive document occurrence number during record initialization.
- ///
- /// The sales header record being initialized.
- /// Set to true to skip the default logic.
- [IntegrationEvent(false, false)]
- local procedure OnInitRecordOnBeforeGetNextArchiveDocOccurrenceNo(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before copying reservation entries from temporary records during sales lines recreation.
- ///
- /// The sales line record.
- /// The temporary sales line record.
- /// The sales header record.
- /// The previous version of the sales header record.
- /// The name of the field that was changed.
- [IntegrationEvent(false, false)]
- local procedure OnRecreateSalesLinesOnBeforeCopyReservEntryFromTemp(var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary; var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; ChangedFieldName: Text[100])
- begin
- end;
-
- ///
- /// Raised before checking if the customer posting group has changed.
- ///
- /// The sales header record.
- /// The previous version of the sales header record.
- /// Set to true to skip the default check logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckCustomerPostingGroupChange(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after validating the payment discount when payment terms code is blank.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// The current field number being processed.
- [IntegrationEvent(false, false)]
- local procedure OnValidatePaymentTermsCodeOnAfterValidatePaymentDiscountWhenBlank(var SalesHeader: Record "Sales Header"; var xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer)
- begin
- end;
-
- ///
- /// Raised after setting sales line filters when updating sales line amounts.
- ///
- /// The sales header record.
- /// The sales line record with filters applied.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesLineAmountsOnAfterSalesLineSetFilters(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised for the else case of document type when looking up adjustment value entries.
- ///
- /// The sales header record.
- /// The sales line record.
- /// The quantity type (General or Invoicing).
- [IntegrationEvent(false, false)]
- local procedure OnLookupAdjmtValueEntriesCaseDocumentTypeElse(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; QtyType: Option General,Invoicing);
- begin
- end;
-
- ///
- /// Raised before checking if sales lines exist.
- ///
- /// The sales header record.
- /// Set to true to skip the default check logic.
- /// The result indicating whether sales lines exist.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSalesLinesExist(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; var Result: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the VAT base discount percentage.
- ///
- /// The sales header record being validated.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateVATBaseDiscountPct(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before finding the first sales line when validating prices including VAT.
- ///
- /// The sales line record with filters applied.
- [IntegrationEvent(false, false)]
- local procedure OnValidatePricesIncludingVATOnBeforeSalesLineFindFirst(var SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised before validating the payment method code.
- ///
- /// The sales header record being validated.
- /// The payment method record.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePaymentMethodCode(var SalesHeader: Record "Sales Header"; PaymentMethod: Record "Payment Method"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before the OnInsert trigger.
- ///
- /// The sales header record being inserted.
- /// Set to true to skip the default insert logic.
- /// Indicates the insert mode.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOnInsert(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; var InsertMode: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating the sell-to contact when validating sell-to customer number.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// The sell-to customer record.
- /// Set to true to skip updating the sell-to contact.
- [IntegrationEvent(false, false)]
- local procedure OnValidateSellToCustomerNoOnBeforeUpdateSellToCont(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; SellToCustomer: Record Customer; var SkipSellToContact: Boolean)
- begin
- end;
-
- ///
- /// Raised after setting filters when checking if deferral headers exist.
- ///
- /// The sales header record.
- /// The deferral header record with filters applied.
- [IntegrationEvent(false, false)]
- local procedure OnDeferralHeadersExistOnAfterSetFilters(var SalesHeader: Record "Sales Header"; var DeferralHeader: Record "Deferral Header")
- begin
- end;
-
- ///
- /// Raised before updating the location when copying sell-to customer address fields.
- ///
- /// The sales header record being updated.
- /// The sell-to customer record.
- /// Set to true to skip the default update logic.
- [IntegrationEvent(false, false)]
- local procedure OnCopySellToCustomerAddressFieldsFromCustomerOnBeforeUpdateLocation(var SalesHeader: Record "Sales Header"; var SellToCustomer: Record Customer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before initializing the VAT date when validating VAT reporting date.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// Set to true to skip the default initialization logic.
- [IntegrationEvent(false, false)]
- local procedure OnValidateVATReportingDateOnBeforeInitVATDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before modifying the sales header when showing document dimensions.
- ///
- /// The sales header record being modified.
- [IntegrationEvent(false, false)]
- local procedure OnShowDocDimOnBeforeSalesHeaderModify(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before creating dimensions on a temporary sales line for prepayment account default dimensions.
- ///
- /// The default dimension source list.
- /// The sales line record.
- [IntegrationEvent(false, false)]
- local procedure OnCreateDimSetForPrepmtAccDefaultDimOnBeforeTempSalesLineCreateDim(var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised before initializing default dimension sources.
- ///
- /// The sales header record.
- /// The default dimension source list to initialize.
- /// The field number triggering the initialization.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitDefaultDimensionSources(var SalesHeader: Record "Sales Header"; var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; FieldNo: Integer)
- begin
- end;
-
-
- ///
- /// Raised before validating the salesperson code when validating sell-to contact number.
- ///
- /// The sales header record being validated.
- /// The contact record.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnValidateSelltoContactNoOnBeforeValidateSalespersonCode(var SalesHeader: Record "Sales Header"; Contact: Record Contact; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before testing the status when creating inventory put-away or pick.
- ///
- /// The sales header record being tested.
- [IntegrationEvent(false, false)]
- local procedure OnCreateInvtPutAwayPickOnBeforeTestingStatus(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after posting when sending to posting.
- ///
- /// The sales header record that was posted.
- /// Indicates whether the posting was successful.
- [IntegrationEvent(false, false)]
- local procedure OnSendToPostingOnAfterPost(var SalesHeader: Record "Sales Header"; IsSuccess: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking item availability in lines.
- ///
- /// The sales header record.
- /// The sales line record to check.
- /// Set to true to skip the default check logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckItemAvailabilityInLines(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after testing status open when validating sell-to customer number.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// Set to true to skip further processing.
- [IntegrationEvent(false, false)]
- local procedure OnValidateSellToCustomerNoOnAfterTestStatusOpen(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after checking if bill-to customer number changed when validating bill-to customer number.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// The current field number being processed.
- /// Set to true to skip further processing.
- /// Set to true to indicate that the do exist check was handled.
- [IntegrationEvent(false, false)]
- local procedure OnValidateBillToCustomerNoOnAfterCheckBilltoCustomerNoChanged(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrFieldNo: Integer; var IsHandled: Boolean; var IsHandledDoExist: Boolean)
- begin
- end;
-
- ///
- /// Raised after checking if contact is privacy blocked when validating sell-to contact number.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// Set to true to skip further processing.
- [IntegrationEvent(false, false)]
- local procedure OnValidateSellToContactNoOnAfterContCheckIfPrivacyBlockedGeneric(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after creating a sales line when handling supplement types during recreation.
- ///
- /// The sales header record.
- /// The sales line record that was created.
- /// The temporary sales line record used as source.
- [IntegrationEvent(false, false)]
- local procedure OnRecreateSalesLinesHandleSupplementTypesOnAfterCreateSalesLine(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var TempSalesLine: Record "Sales Line" temporary)
- begin
- end;
-
- ///
- /// Raised before confirming close unposted.
- ///
- /// The sales header record.
- /// The result indicating whether to proceed with closing.
- /// Set to true to skip the default confirmation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeConfirmCloseUnposted(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting filter customer number.
- ///
- /// The sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetFilterCustNo(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised when confirming close unposted and sales lines exist.
- ///
- /// The sales header record.
- /// The result indicating whether to proceed with closing.
- /// Set to true to skip the default confirmation logic.
- [IntegrationEvent(false, false)]
- local procedure OnConfirmCloseUnpostedOnSalesLinesExist(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before resetting the invoice discount value.
- ///
- /// The sales header record.
- /// Set to true to skip the default reset logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeResetInvoiceDiscountValue(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before assigning the type when creating a sales line.
- ///
- /// The sales line record being created.
- /// The temporary sales line record used as source.
- /// The sales header record.
- [IntegrationEvent(false, false)]
- local procedure OnCreateSalesLineOnBeforeAssignType(var SalesLine: Record "Sales Line"; TempSalesLine: Record "Sales Line" temporary; var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before validating the shipment date when creating a sales line.
- ///
- /// The sales line record being created.
- /// The temporary sales line record used as source.
- /// The sales header record.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnCreateSalesLineOnBeforeValidateShipmentDate(var SalesLine: Record "Sales Line"; TempSalesLine: Record "Sales Line" temporary; SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before setting the drop shipment flag when creating a sales line.
- ///
- /// The sales line record being created.
- /// The temporary sales line record used as source.
- /// Set to true to skip the default logic.
- [IntegrationEvent(false, false)]
- local procedure OnCreateSalesLineOnBeforeSetDropShipment(var SalesLine: Record "Sales Line"; TempSalesLine: Record "Sales Line" temporary; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after validating the number field when creating a sales line.
- ///
- /// The sales line record that was created.
- /// The temporary sales line record used as source.
- [IntegrationEvent(false, false)]
- local procedure OnCreateSalesLineOnAfterValidateNo(var SalesLine: Record "Sales Line"; TempSalesLine: Record "Sales Line" temporary)
- begin
- end;
-
- ///
- /// Raised before confirming the customer creation process.
- ///
- /// The sales header record.
- /// Indicates whether to prompt the user.
- /// The result of the check.
- /// Set to true to skip the default confirmation logic.
- [IntegrationEvent(false, false)]
- local procedure OnCheckCustomerCreatedOnBeforeConfirmProcess(SalesHeader: Record "Sales Header"; var Prompt: Boolean; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before confirming the deferral date update.
- ///
- /// The sales header record.
- /// The previous version of the sales header record.
- /// The current field number being processed.
- /// Set to true to skip the default confirmation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeConfirmUpdateDeferralDate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before setting the company bank account.
- ///
- /// The sales header record being updated.
- /// Set to true to skip the default logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetCompanyBankAccount(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after finding the contact business relation when updating sell-to customer.
- ///
- /// The sales header record.
- /// The contact record.
- /// The contact business relation record that was found.
- /// Indicates whether the contact business relation was found.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSellToCustOnAfterFindContactBusinessRelation(SalesHeader: Record "Sales Header"; Contact: Record Contact; var ContactBusinessRelation: Record "Contact Business Relation"; var ContactBusinessRelationFound: Boolean)
- begin
- end;
-
- ///
- /// Raised after finding the contact business relation when updating bill-to customer.
- ///
- /// The sales header record.
- /// The contact record.
- /// The contact business relation record that was found.
- /// Indicates whether the contact business relation was found.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateBillToCustOnAfterFindContactBusinessRelation(SalesHeader: Record "Sales Header"; Contact: Record Contact; var ContactBusinessRelation: Record "Contact Business Relation"; var ContactBusinessRelationFound: Boolean)
- begin
- end;
-
- ///
- /// Raised after assigning the address from sell-to customer when copying ship-to customer address fields.
- ///
- /// The sales header record that was updated.
- /// The sell-to customer record used as source.
- [IntegrationEvent(false, false)]
- procedure OnCopyShipToCustomerAddressFieldsFromCustOnAfterAssignAddressFromSellToCustomer(var SalesHeader: Record "Sales Header"; SellToCustomer: Record Customer)
- begin
- end;
-
- ///
- /// Raised before checking if the sales header has a sell-to address.
- ///
- /// The sales header record.
- /// The result indicating whether the sales header has a sell-to address.
- /// Set to true to skip the default check logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeHasSellToAddress(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking if the sales header has a ship-to address.
- ///
- /// The sales header record.
- /// The result indicating whether the sales header has a ship-to address.
- /// Set to true to skip the default check logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeHasShipToAddress(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking if the sales header has a bill-to address.
- ///
- /// The sales header record.
- /// The result indicating whether the sales header has a bill-to address.
- /// Set to true to skip the default check logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeHasBillToAddress(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after setting the ship-to address.
- ///
- /// The sales header record that was updated.
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetShipToAddress(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before validating the shipment date.
- ///
- /// The sales header record being validated.
- /// The current field number being processed.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShipmentDate(var SalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the payment discount.
- ///
- /// The sales header record being validated.
- /// The current field number being processed.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePaymentDiscount(var SalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating sales order lines if they exist.
- ///
- /// The sales header record.
- /// Set to true to skip the default update logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateSalesOrderLineIfExist(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before linking a sales document with an opportunity.
- ///
- /// The sales header record being linked.
- /// The old opportunity number.
- /// Set to true to skip the default link logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLinkSalesDocWithOpportunity(var SalesHeader: Record "Sales Header"; OldOpportunityNo: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating the VAT reporting date.
- ///
- /// The sales header record being updated.
- /// The field number that called the update.
- /// Set to true to skip the default update logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateVATReportingDate(var SalesHeader: Record "Sales Header"; CalledByFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before sending the document to posting.
- ///
- /// The sales header record being posted.
- /// Indicates whether the posting was successful.
- /// Set to true to skip the default posting logic.
- /// The codeunit ID used for posting.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSendToPosting(var SalesHeader: Record "Sales Header"; var IsSuccess: Boolean; var IsHandled: Boolean; PostingCodeunitID: Integer)
- begin
- end;
-
- ///
- /// Raised before validating the bill-to contact number when updating sell-to customer.
- ///
- /// The sales header record being updated.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSellToCustOnBeforeValidateBillToContactNo(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before performing a manual release.
- ///
- /// The sales header record being released.
- /// Set to true to skip the default release logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforePerformManualRelease(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
-#if not CLEAN27
- ///
- /// Raised before checking if the document is not fully cancelled.
- ///
- /// The sales credit memo header record.
- /// The result indicating whether the document is not fully cancelled.
- /// Set to true to skip the default check logic.
- [Obsolete('Removed Not used anymore.', '27.0')]
- [IntegrationEvent(false, false)]
- local procedure OnBeforeIsNotFullyCancelled(var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-#endif
-
- ///
- /// Raised after the credit limit check.
- ///
- /// The sales header record that was checked.
- [IntegrationEvent(false, false)]
- local procedure OnCheckCreditLimitOnAfterCreditLimitCheck(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before creating dimensions from default dimensions.
- ///
- /// The sales header record.
- /// The field number triggering the dimension creation.
- /// Set to true to skip the default creation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateDimFromDefaultDim(var Rec: Record "Sales Header"; FieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the customer discount group.
- ///
- /// The sales header record being validated.
- /// The previous version of the sales header record.
- /// The current field number being processed.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateCustomerDiscGroup(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CurrentFieldNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before setting the work description.
- ///
- /// The sales header record being updated.
- /// The new work description text.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetWorkDescription(var SalesHeader: Record "Sales Header"; var NewWorkDescription: Text)
- begin
- end;
-
- ///
- /// Raised before looking up the prepayment credit memo number series.
- ///
- /// The sales header record.
- /// Set to true to skip the default lookup logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupPrepmtCrMemoNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the prepayment credit memo number series.
- ///
- /// The sales header record being validated.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePrepmtCrMemoNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
-
-#if not CLEAN27
- ///
- /// Raised after setting sales line filters when calculating outstanding quantity base.
- ///
- /// The sales line record with filters applied.
- [Obsolete('Not used anymore due to new implementation that uses Query. Replaced by OnBeforeCalculateReservableOutstandingQuantityBase.', '27.0')]
- [IntegrationEvent(false, false)]
- local procedure OnCalcOutstandingQuantityBaseOnAfterSalesLineSetFilters(var SalesLine: Record "Sales Line")
- begin
- end;
-#endif
-
- ///
- /// Raised before calculating the reservable outstanding quantity base.
- ///
- /// The sales header record.
- /// Set to true to skip the default calculation logic.
- /// The outstanding quantity base to calculate.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCalculateReservableOutstandingQuantityBase(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean; var OutstandingQtyBase: Decimal)
- begin
- end;
-
- ///
- /// Raised before modifying the bill-to customer address.
- ///
- /// The sales header record being updated.
- /// Set to true to skip the default modification logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeModifyBillToCustomerAddress(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after validating the applies-to document number.
- ///
- /// The sales header record that was validated.
- /// The previous version of the sales header record.
- /// The customer ledger entry that was applied.
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateAppliesToDocNo(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; CustLedgEntry: Record "Cust. Ledger Entry")
- begin
- end;
-
- ///
- /// Raised before looking up the prepayment number series.
- ///
- /// The sales header record.
- /// Set to true to skip the default lookup logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupPrepmtNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the prepayment number series.
- ///
- /// The sales header record being validated.
- /// Set to true to skip the default validation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePrepmtNoSeries(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after getting the sell-to customer filter when copying.
- ///
- /// The sales header record.
- /// The sell-to customer filter text.
- [IntegrationEvent(false, false)]
- local procedure OnCopySellToCustomerFilterOnAfterGetSellToCustomerFilter(var SalesHeader: Record "Sales Header"; var SellToCustomerFilter: Text)
- begin
- end;
-
- ///
- /// Raised before setting the sell-to customer from a filter.
- ///
- /// The sales header record being updated.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetSellToCustomerFromFilter(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before selecting a customer when looking up sell-to customer name.
- ///
- /// The sales header record.
- /// The customer record to select.
- /// The customer name text.
- [IntegrationEvent(false, false)]
- local procedure OnLookupSellToCustomerNameOnBeforeSelectCustomer(SalesHeader: Record "Sales Header"; var Customer: Record Customer; var CustomerName: Text)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCalcQuoteValidUntilDateOnBeforeAssign(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var QuoteValidityCalculation: DateFormula; UpdateDocumentDate: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeResponsibilityCenterValidate(var SalesHeader: Record "Sales Header"; xSalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Sales/Document/SalesInvoice.Page.al b/src/Layers/NL/BaseApp/Sales/Document/SalesInvoice.Page.al
deleted file mode 100644
index 082a6ad083..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Document/SalesInvoice.Page.al
+++ /dev/null
@@ -1,2260 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.Bank.Setup;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Outlook;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.VAT.Calculation;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Attachment;
-using Microsoft.Foundation.Enums;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Intercompany;
-using Microsoft.Intercompany.Journal;
-using Microsoft.Intercompany.Outbox;
-using Microsoft.Inventory.Item;
-using Microsoft.Inventory.Location;
-using Microsoft.Projects.Resources.Resource;
-using Microsoft.Purchases.Document;
-using Microsoft.Sales.Comment;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.History;
-using Microsoft.Sales.Posting;
-using Microsoft.Sales.Pricing;
-using Microsoft.Sales.Setup;
-using Microsoft.Utilities;
-using System.Automation;
-using System.Environment;
-using System.Environment.Configuration;
-using System.Privacy;
-using System.Security.User;
-using System.Threading;
-
-///
-/// Displays and manages a single sales invoice document for direct customer billing.
-///
-page 43 "Sales Invoice"
-{
- Caption = 'Sales Invoice';
- PageType = Document;
- RefreshOnActivate = true;
- SourceTable = "Sales Header";
- SourceTableView = where("Document Type" = filter(Invoice));
- AdditionalSearchTerms = 'Sales Bill, Sales Receipt, Commerce Invoice, Client Invoice, Sales Slip, Sales Transaction Invoice';
-
- AboutTitle = 'About sales invoice details';
- AboutText = 'You can update and add to the sales invoice until you post it. If you leave the invoice without posting, you can return to it later from the list of ongoing invoices.';
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field("No."; Rec."No.")
- {
- ApplicationArea = All;
- Importance = Standard;
- ToolTip = 'Specifies the number of the involved entry or record, according to the specified number series.';
- Visible = DocNoVisible;
-
- trigger OnAssistEdit()
- begin
- if Rec.AssistEdit(xRec) then
- CurrPage.Update();
- end;
- }
- field("Sell-to Customer No."; Rec."Sell-to Customer No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer No.';
- Importance = Additional;
- NotBlank = true;
- ToolTip = 'Specifies the number of the customer who will receive the products and be billed by default.';
-
- trigger OnValidate()
- begin
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- Rec.SelltoCustomerNoOnAfterValidate(Rec, xRec);
- CurrPage.Update();
- end;
- }
- field("Sell-to Customer Name"; Rec."Sell-to Customer Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer Name';
- Importance = Promoted;
- NotBlank = true;
- ShowMandatory = true;
- AboutTitle = 'Who you are selling to';
- AboutText = 'This can be an existing customer, or you can register a new from here. Customers can have special prices and discounts that are automatically used when you enter the sales lines.';
- ToolTip = 'Specifies the name of the customer who will receive the products and be billed by default.';
-
- trigger OnAfterLookup(Selected: RecordRef)
- var
- Customer: Record Customer;
- begin
- Selected.SetTable(Customer);
- if Rec."Sell-to Customer No." <> Customer."No." then begin
- Rec.Validate("Sell-to Customer No.", Customer."No.");
- if Rec."Sell-to Customer No." <> Customer."No." then
- error('');
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- CurrPage.Update();
- end;
- end;
-
- trigger OnValidate()
- begin
- Rec.SelltoCustomerNoOnAfterValidate(Rec, xRec);
- CurrPage.Update();
- end;
- }
- field("Sell-to Customer Name 2"; Rec."Sell-to Customer Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer Name 2';
- QuickEntry = false;
- Visible = false;
- }
- field("Registration Number"; Rec."Registration Number")
- {
- ApplicationArea = VAT;
- Editable = false;
- Importance = Additional;
- Visible = false;
- }
- field("Posting Description"; Rec."Posting Description")
- {
- ApplicationArea = Suite;
- Visible = false;
- }
- group("Sell-to")
- {
- Caption = 'Sell-to';
- field("Sell-to Address"; Rec."Sell-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Importance = Additional;
- QuickEntry = false;
- }
- field("Sell-to Address 2"; Rec."Sell-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Importance = Additional;
- QuickEntry = false;
- }
- field("Sell-to City"; Rec."Sell-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Importance = Additional;
- QuickEntry = false;
- }
- group(Control60)
- {
- ShowCaption = false;
- Visible = IsSellToCountyVisible;
- field("Sell-to County"; Rec."Sell-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Sell-to Country/Region Code";
- Importance = Additional;
- QuickEntry = false;
- }
- }
- field("Sell-to Post Code"; Rec."Sell-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the postal code.';
- }
- field("Sell-to Country/Region Code"; Rec."Sell-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region Code';
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the country or region of the address.';
-
- trigger OnValidate()
- begin
- IsSellToCountyVisible := FormatAddress.UseCounty(Rec."Sell-to Country/Region Code");
- end;
- }
- field("Sell-to Contact No."; Rec."Sell-to Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact No.';
- Importance = Additional;
-
- trigger OnLookup(var Text: Text): Boolean
- begin
- if not Rec.SelltoContactLookup() then
- exit(false);
- Text := Rec."Sell-to Contact No.";
- CurrPage.Update();
- exit(true);
- end;
-
- trigger OnValidate()
- begin
- if ApplicationAreaMgmtFacade.IsAdvancedEnabled() then
- if Rec.GetFilter("Sell-to Contact No.") = xRec."Sell-to Contact No." then
- if Rec."Sell-to Contact No." <> xRec."Sell-to Contact No." then
- Rec.SetRange("Sell-to Contact No.");
- if Rec."Sell-to Contact No." <> xRec."Sell-to Contact No." then
- CurrPage.Update();
- end;
- }
- field(SellToPhoneNo; SellToContact."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the contact person that the sales document will be sent to.';
- }
- field(SellToMobilePhoneNo; SellToContact."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mobile Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the contact person that the sales document will be sent to.';
- }
- field(SellToEmail; SellToContact."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the email address of the contact person that the sales document will be sent to.';
- }
- }
- field("Sell-to Contact"; Rec."Sell-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = Rec."Sell-to Customer No." <> '';
- ToolTip = 'Specifies the name of the person to contact at the customer.';
- }
- field("Your Reference"; Rec."Your Reference")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- ToolTip = 'Specifies the customer''s reference. The contents will be printed on sales documents.';
- }
- field("Document Date"; Rec."Document Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Posting Date"; Rec."Posting Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
-
- trigger OnValidate()
- begin
- SaveInvoiceDiscountAmount();
- end;
- }
- field("VAT Reporting Date"; Rec."VAT Reporting Date")
- {
- ApplicationArea = VAT;
- Importance = Promoted;
- Editable = VATDateEnabled;
- Visible = VATDateEnabled;
- }
- field("Due Date"; Rec."Due Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Incoming Document Entry No."; Rec."Incoming Document Entry No.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = false;
- }
- field("External Document No."; Rec."External Document No.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- ShowMandatory = ExternalDocNoMandatory;
- }
- field("Salesperson Code"; Rec."Salesperson Code")
- {
- ApplicationArea = Suite;
- Importance = Additional;
-
- trigger OnValidate()
- begin
- SalespersonCodeOnAfterValidate();
- end;
- }
- field("Campaign No."; Rec."Campaign No.")
- {
- ApplicationArea = RelationshipMgmt;
- Importance = Additional;
- ToolTip = 'Specifies the number of the campaign that the document is linked to.';
- trigger OnValidate()
- begin
- if Rec."Campaign No." <> xRec."Campaign No." then
- CurrPage.Update();
- end;
- }
- field("Responsibility Center"; Rec."Responsibility Center")
- {
- AccessByPermission = TableData "Responsibility Center" = R;
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Assigned User ID"; Rec."Assigned User ID")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field(Status; Rec.Status)
- {
- ApplicationArea = Suite;
- Importance = Promoted;
- StyleExpr = StatusStyleTxt;
- AboutTitle = 'Check the invoice status here';
- AboutText = 'You can only edit an open invoice. When status is Released, it means the invoice is up for next stage in processing, such as reserving the products being sold. Use Reopen if you must edit a released invoice.';
- }
- field("Job Queue Status"; Rec."Job Queue Status")
- {
- ApplicationArea = All;
- Importance = Additional;
- ToolTip = 'Specifies the status of a job queue entry or task that handles the posting of sales invoices.';
- Visible = JobQueuesUsed;
-
- 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;
- }
- group("Work Description")
- {
- Caption = 'Work Description';
- field(WorkDescription; WorkDescription)
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- MultiLine = true;
- ShowCaption = false;
- ToolTip = 'Specifies the products or service being offered';
-
- trigger OnValidate()
- begin
- Rec.SetWorkDescription(WorkDescription);
- end;
- }
- }
- }
- part(SalesLines; "Sales Invoice Subform")
- {
- ApplicationArea = Basic, Suite;
- Editable = IsSalesLinesEditable;
- Enabled = IsSalesLinesEditable;
- SubPageLink = "Document No." = field("No.");
- UpdatePropagation = Both;
- }
- group("Invoice Details")
- {
- Caption = 'Invoice Details';
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- Importance = Promoted;
-
- trigger OnAssistEdit()
- begin
- Clear(ChangeExchangeRate);
- if Rec."Posting Date" <> 0D then
- ChangeExchangeRate.SetParameter(Rec."Currency Code", Rec."Currency Factor", Rec."Posting Date")
- else
- ChangeExchangeRate.SetParameter(Rec."Currency Code", Rec."Currency Factor", WorkDate());
- if ChangeExchangeRate.RunModal() = ACTION::OK then begin
- Rec.Validate("Currency Factor", ChangeExchangeRate.GetParameter());
- SaveInvoiceDiscountAmount();
- end;
- Clear(ChangeExchangeRate);
- end;
-
- trigger OnValidate()
- begin
- CurrPage.Update();
- end;
- }
- field("Company Bank Account Code"; Rec."Company Bank Account Code")
- {
- ApplicationArea = Suite;
- Importance = Promoted;
- }
- field("Shipment Date"; Rec."Shipment Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- group(Control58)
- {
- ShowCaption = false;
- Visible = ShowQuoteNo;
- field("Quote No."; Rec."Quote No.")
- {
- ApplicationArea = All;
- }
- }
- field("Prices Including VAT"; Rec."Prices Including VAT")
- {
- ApplicationArea = VAT;
-
- trigger OnValidate()
- begin
- CurrPage.SalesLines.Page.ForceTotalsCalculation();
- CurrPage.Update();
- end;
- }
- field("VAT Country/Region Code"; Rec."VAT Country/Region Code")
- {
- ApplicationArea = VAT;
- Importance = Additional;
- }
- field("VAT Registration No."; Rec."VAT Registration No.")
- {
- ApplicationArea = VAT;
- Importance = Additional;
- }
- field("Gen. Bus. Posting Group"; Rec."Gen. Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("VAT Bus. Posting Group"; Rec."VAT Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
-
- trigger OnValidate()
- begin
- CurrPage.Update();
- end;
- }
- field("Customer Posting Group"; Rec."Customer Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Editable = IsPostingGroupEditable;
- Importance = Additional;
- }
- field("Payment Terms Code"; Rec."Payment Terms Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Payment Method Code"; Rec."Payment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = IsPaymentMethodCodeVisible;
-
- trigger OnValidate()
- begin
- UpdatePaymentService();
- end;
- }
- field("Reason Code"; Rec."Reason Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = false;
- }
- field("EU 3-Party Trade"; Rec."EU 3-Party Trade")
- {
- ApplicationArea = BasicEU;
- }
- group(Control174)
- {
- ShowCaption = false;
- Visible = PaymentServiceVisible;
- field(SelectedPayments; Rec.GetSelectedPaymentServicesText())
- {
- ApplicationArea = All;
- Caption = 'Payment Service';
- Editable = false;
- Enabled = PaymentServiceEnabled;
- MultiLine = true;
- ToolTip = 'Specifies the online payment service, such as PayPal, that customers can use to pay the sales document.';
-
- trigger OnAssistEdit()
- begin
- Rec.ChangePaymentServiceSetting();
- end;
- }
- }
- field("Shortcut Dimension 1 Code"; Rec."Shortcut Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
-
- trigger OnValidate()
- begin
- CurrPage.Update();
- end;
- }
- field("Shortcut Dimension 2 Code"; Rec."Shortcut Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
-
- trigger OnValidate()
- begin
- CurrPage.Update();
- end;
- }
- 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.';
- }
- field("Pmt. Discount Date"; Rec."Pmt. Discount Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Journal Templ. Name"; Rec."Journal Templ. Name")
- {
- ApplicationArea = BasicBE;
- Visible = IsJournalTemplNameVisible;
- }
- field("Direct Debit Mandate ID"; Rec."Direct Debit Mandate ID")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the transaction mode used in telebanking.';
- }
- field("Bank Account Code"; Rec."Bank Account Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the customer''s bank account that is used for payments and collections through telebanking.';
- }
- field("Location Code"; Rec."Location Code")
- {
- ApplicationArea = Location;
- Importance = Additional;
- }
- }
- group("Shipping and Billing")
- {
- Caption = 'Shipping and Billing';
- Enabled = Rec."Sell-to Customer No." <> '';
- group(Control34)
- {
- ShowCaption = false;
- group(Control200)
- {
- ShowCaption = false;
- field(ShippingOptions; ShipToOptions)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Ship-to';
- ToolTip = 'Specifies the address that the products on the sales document are shipped to. Default (Sell-to Address): The same as the customer''s sell-to address. Alternate Ship-to Address: One of the customer''s alternate ship-to addresses. Custom Address: Any ship-to address that you specify in the fields below.';
-
- trigger OnValidate()
- var
- ShipToAddress: Record "Ship-to Address";
- ShipToAddressList: Page "Ship-to Address List";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShipToOptions(Rec, ShipToOptions.AsInteger(), IsHandled);
- if not IsHandled then
- case ShipToOptions of
- ShipToOptions::"Default (Sell-to Address)":
- begin
- Rec.Validate("Ship-to Code", '');
- Rec.CopySellToAddressToShipToAddress();
- end;
- ShipToOptions::"Alternate Shipping Address":
- begin
- ShipToAddress.SetRange("Customer No.", Rec."Sell-to Customer No.");
- ShipToAddressList.LookupMode := true;
- ShipToAddressList.SetTableView(ShipToAddress);
-
- if ShipToAddressList.RunModal() = ACTION::LookupOK then begin
- ShipToAddressList.GetRecord(ShipToAddress);
- Rec.Validate("Ship-to Code", ShipToAddress.Code);
- IsShipToCountyVisible := FormatAddress.UseCounty(ShipToAddress."Country/Region Code");
- end else
- ShipToOptions := ShipToOptions::"Custom Address";
- end;
- ShipToOptions::"Custom Address":
- begin
- Rec.Validate("Ship-to Code", '');
- IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
- end;
- end;
-
- OnAfterValidateShipToOptions(Rec, ShipToOptions.AsInteger());
- end;
- }
- group(Control202)
- {
- ShowCaption = false;
- Visible = not (ShipToOptions = ShipToOptions::"Default (Sell-to Address)");
- field("Ship-to Code"; Rec."Ship-to Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Code';
- Editable = ShipToOptions = ShipToOptions::"Alternate Shipping Address";
- Importance = Promoted;
- ToolTip = 'Specifies the code for another shipment address than the customer''s own address, which is entered by default.';
-
- trigger OnValidate()
- var
- ShipToAddress: Record "Ship-to Address";
- begin
- if (xRec."Ship-to Code" <> '') and (Rec."Ship-to Code" = '') then
- Error(EmptyShipToCodeErr);
- if Rec."Ship-to Code" <> '' then begin
- ShipToAddress.Get(Rec."Sell-to Customer No.", Rec."Ship-to Code");
- IsShipToCountyVisible := FormatAddress.UseCounty(ShipToAddress."Country/Region Code");
- end else
- IsShipToCountyVisible := false;
- end;
- }
- field("Ship-to Name"; Rec."Ship-to Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- ToolTip = 'Specifies the name that products on the sales document will be shipped to.';
- }
- field("Ship-to Name 2"; Rec."Ship-to Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name 2';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- Importance = Additional;
- QuickEntry = false;
- Visible = false;
- }
- field("Ship-to Address"; Rec."Ship-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- QuickEntry = false;
- }
- field("Ship-to Address 2"; Rec."Ship-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- QuickEntry = false;
- }
- field("Ship-to City"; Rec."Ship-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- QuickEntry = false;
- }
- group(Control82)
- {
- ShowCaption = false;
- Visible = IsShipToCountyVisible;
- field("Ship-to County"; Rec."Ship-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Ship-to Country/Region Code";
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- QuickEntry = false;
- }
- }
- field("Ship-to Post Code"; Rec."Ship-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- QuickEntry = false;
- ToolTip = 'Specifies the postal code.';
- }
- field("Ship-to Country/Region Code"; Rec."Ship-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the customer''s country/region.';
-
- trigger OnValidate()
- begin
- IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
- end;
- }
- }
- field("Ship-to Phone No."; Rec."Ship-to Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- }
- field("Ship-to Contact"; Rec."Ship-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- ToolTip = 'Specifies the name of the contact person at the address that products on the sales document will be shipped to.';
- }
- }
- group("Shipment Method")
- {
- Caption = 'Shipment Method';
- field("Shipment Method Code"; Rec."Shipment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Code';
- Importance = Additional;
- ToolTip = 'Specifies how items on the sales document are shipped to the customer.';
- }
- field("Shipping Agent Code"; Rec."Shipping Agent Code")
- {
- ApplicationArea = Suite;
- Caption = 'Agent';
- Importance = Additional;
- ToolTip = 'Specifies which shipping agent is used to transport the items on the sales document to the customer.';
- }
- field("Shipping Agent Service Code"; Rec."Shipping Agent Service Code")
- {
- ApplicationArea = Suite;
- Caption = 'Agent service';
- Importance = Additional;
- ToolTip = 'Specifies which shipping agent service is used to transport the items on the sales document to the customer.';
- }
- field("Package Tracking No."; Rec."Package Tracking No.")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- }
- }
- group(Control203)
- {
- ShowCaption = false;
- field(BillToOptions; BillToOptions)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Bill-to';
- ToolTip = 'Specifies the customer that the sales invoice will be sent to. Default (Customer): The same as the customer on the sales invoice. Another Customer: Any customer that you specify in the fields below.';
-
- trigger OnValidate()
- begin
- if BillToOptions = BillToOptions::"Default (Customer)" then begin
- Rec.Validate("Bill-to Customer No.", Rec."Sell-to Customer No.");
- Rec.RecallModifyAddressNotification(Rec.GetModifyBillToCustomerAddressNotificationId());
- end;
-
- Rec.CopySellToAddressToBillToAddress();
- end;
- }
- group(Control205)
- {
- ShowCaption = false;
- Visible = not (BillToOptions = BillToOptions::"Default (Customer)");
- field("Bill-to Name"; Rec."Bill-to Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name';
- Editable = ((BillToOptions = BillToOptions::"Another Customer") or ((BillToOptions = BillToOptions::"Custom Address") and not ShouldSearchForCustByName));
- Enabled = ((BillToOptions = BillToOptions::"Another Customer") or ((BillToOptions = BillToOptions::"Custom Address") and not ShouldSearchForCustByName));
- Importance = Promoted;
- NotBlank = true;
- ToolTip = 'Specifies the customer to whom you will send the sales invoice, when different from the customer that you are selling to.';
-
- trigger OnValidate()
- begin
- if not ((BillToOptions = BillToOptions::"Custom Address") and not ShouldSearchForCustByName) then begin
- if Rec.GetFilter("Bill-to Customer No.") = xRec."Bill-to Customer No." then
- if Rec."Bill-to Customer No." <> xRec."Bill-to Customer No." then
- Rec.SetRange("Bill-to Customer No.");
-
- CurrPage.Update();
- end;
- end;
-
- trigger OnLookup(var Text: Text): Boolean
- var
- Customer: Record Customer;
- begin
- OnBeforeLookupBillToName(Customer, Rec);
- if Customer.SelectCustomer(Customer) then begin
- xRec := Rec;
- Rec."Bill-to Name" := Customer.Name;
- Rec.Validate("Bill-to Customer No.", Customer."No.");
- end;
-
- if not ((BillToOptions = BillToOptions::"Custom Address") and not ShouldSearchForCustByName) then begin
- if Rec.GetFilter("Bill-to Customer No.") = xRec."Bill-to Customer No." then
- if Rec."Bill-to Customer No." <> xRec."Bill-to Customer No." then
- Rec.SetRange("Bill-to Customer No.");
-
- CurrPage.Update();
- end;
- end;
- }
- field("Bill-to Name 2"; Rec."Bill-to Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name 2';
- Editable = (BillToOptions = BillToOptions::"Another Customer");
- Enabled = (BillToOptions = BillToOptions::"Another Customer");
- Importance = Additional;
- QuickEntry = false;
- Visible = false;
- }
- field("Bill-to Address"; Rec."Bill-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- QuickEntry = false;
- }
- field("Bill-to Address 2"; Rec."Bill-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- QuickEntry = false;
- }
- field("Bill-to City"; Rec."Bill-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- QuickEntry = false;
- }
- group(Control85)
- {
- ShowCaption = false;
- Visible = IsBillToCountyVisible;
- field("Bill-to County"; Rec."Bill-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Bill-to Country/Region Code";
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- QuickEntry = false;
- }
- }
- field("Bill-to Post Code"; Rec."Bill-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the postal code.';
- }
- field("Bill-to Country/Region Code"; Rec."Bill-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the country or region of the address.';
-
- trigger OnValidate()
- begin
- IsBillToCountyVisible := FormatAddress.UseCounty(Rec."Bill-to Country/Region Code");
- end;
- }
- field("Bill-to Contact No."; Rec."Bill-to Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact No.';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- }
- field("Bill-to Contact"; Rec."Bill-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- ToolTip = 'Specifies the name of the person you should contact at the customer you are sending the invoice to.';
- }
- field(BillToContactPhoneNo; BillToContact."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the person you should contact at the customer you are sending the invoice to.';
- }
- field(BillToContactMobilePhoneNo; BillToContact."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mobile Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the person you should contact at the customer you are sending the invoice to.';
- }
- field(BillToContactEmail; BillToContact."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the email address of the person you should contact at the customer you are sending the invoice to.';
- }
- }
- }
- }
- group("Foreign Trade")
- {
- Caption = 'Foreign Trade';
- field("Transaction Specification"; Rec."Transaction Specification")
- {
- ApplicationArea = BasicEU;
- }
- field("Transaction Type"; Rec."Transaction Type")
- {
- ApplicationArea = BasicEU;
- }
- field("Transport Method"; Rec."Transport Method")
- {
- ApplicationArea = BasicEU;
- }
- field("Exit Point"; Rec."Exit Point")
- {
- ApplicationArea = BasicEU;
- }
- field("Area"; Rec.Area)
- {
- ApplicationArea = BasicEU;
- }
- field("Language Code"; Rec."Language Code")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Format Region"; Rec."Format Region")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- }
- }
- area(factboxes)
- {
- part(SalesDocCheckFactbox; "Sales Doc. Check Factbox")
- {
- ApplicationArea = All;
- Caption = 'Document Check';
- Visible = SalesDocCheckFactboxVisible;
- SubPageLink = "No." = field("No."),
- "Document Type" = field("Document Type");
- }
- 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(Control31; "Pending Approval FactBox")
- {
- ApplicationArea = All;
- SubPageLink = "Table ID" = const(36),
- "Document Type" = field("Document Type"),
- "Document No." = field("No."),
- Status = const(Open);
- Visible = OpenApprovalEntriesExistForCurrUser;
- }
- part(Control1903720907; "Sales Hist. Sell-to FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("Sell-to Customer No."),
- "Date Filter" = field("Date Filter");
- Visible = false;
- }
- part(Control1907234507; "Sales Hist. Bill-to FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("Bill-to Customer No."),
- "Date Filter" = field("Date Filter");
- Visible = false;
- }
- 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("Sell-to Customer No."),
- "Date Filter" = field("Date Filter");
- }
- part(Control1906127307; "Sales Line FactBox")
- {
- ApplicationArea = Basic, Suite;
- Provider = SalesLines;
- SubPageLink = "Document Type" = field("Document Type"),
- "Document No." = field("Document No."),
- "Line No." = field("Line No.");
- Visible = false;
- }
- part(Control1901314507; "Item Invoicing FactBox")
- {
- ApplicationArea = Basic, Suite;
- Provider = SalesLines;
- SubPageLink = "No." = field("No.");
- }
- part(IncomingDocAttachFactBox; "Incoming Doc. Attach. FactBox")
- {
- ApplicationArea = Basic, Suite;
- ShowFilter = false;
- Visible = false;
- }
- part(ApprovalFactBox; "Approval FactBox")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control1907012907; "Resource Details FactBox")
- {
- ApplicationArea = Basic, Suite;
- Provider = SalesLines;
- SubPageLink = "No." = field("No.");
- Visible = false;
- }
- part(WorkflowStatus; "Workflow Status FactBox")
- {
- ApplicationArea = All;
- Editable = false;
- Enabled = false;
- ShowFilter = false;
- Visible = ShowWorkflowStatus;
- }
- 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';
- Enabled = IsCustomerOrContactNotEmpty;
- 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(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(Function_CustomerCard)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer';
- Enabled = IsCustomerOrContactNotEmpty;
- Image = Customer;
- RunObject = Page "Customer Card";
- RunPageLink = "No." = field("Sell-to Customer No."),
- "Date Filter" = field("Date Filter");
- ShortCutKey = 'Shift+F7';
- ToolTip = 'View or edit detailed information about the customer on the sales document.';
- }
- action(Dimensions)
- {
- AccessByPermission = TableData Dimension = R;
- ApplicationArea = Dimensions;
- Caption = 'Dimensions';
- Enabled = Rec."No." <> '';
- 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();
- CurrPage.SaveRecord();
- 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(History)
- {
- Caption = 'History';
- action(PageInteractionLogEntries)
- {
- ApplicationArea = Suite;
- Caption = 'Interaction Log E&ntries';
- Image = InteractionLog;
- ShortCutKey = 'Ctrl+F7';
- ToolTip = 'View a list of interaction log entries related to this document.';
-
- trigger OnAction()
- begin
- Rec.ShowInteractionLogEntries();
- end;
- }
- }
- }
- area(processing)
- {
- group(Approval)
- {
- Caption = 'Approval';
- action(Approve)
- {
- ApplicationArea = All;
- Caption = 'Approve';
- Image = Approve;
- ToolTip = 'Approve the requested changes.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- begin
- ApprovalsMgmt.ApproveRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Reject)
- {
- ApplicationArea = All;
- Caption = 'Reject';
- Image = Reject;
- ToolTip = 'Reject the approval request.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- begin
- ApprovalsMgmt.RejectRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Delegate)
- {
- ApplicationArea = All;
- Caption = 'Delegate';
- Image = Delegate;
- ToolTip = 'Delegate the approval to a substitute approver.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- begin
- ApprovalsMgmt.DelegateRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Comment)
- {
- ApplicationArea = All;
- Caption = 'Comments';
- Image = ViewComments;
- ToolTip = 'View or add comments for the record.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.GetApprovalComment(Rec);
- end;
- }
- }
- group(Action9)
- {
- Caption = 'Release';
- Image = ReleaseDoc;
- action(Release)
- {
- ApplicationArea = Suite;
- Caption = 'Re&lease';
- Enabled = IsCustomerOrContactNotEmpty and (Rec.Status <> Rec.Status::Released);
- 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
- ReleaseSalesDoc: Codeunit "Release Sales Document";
- begin
- ReleaseSalesDoc.PerformManualRelease(Rec);
- CurrPage.SalesLines.PAGE.ClearTotalSalesHeader();
- end;
- }
- action(Reopen)
- {
- ApplicationArea = Suite;
- Caption = 'Re&open';
- Enabled = Rec.Status <> Rec.Status::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
- ReleaseSalesDoc: Codeunit "Release Sales Document";
- begin
- ReleaseSalesDoc.PerformManualReopen(Rec);
- CurrPage.SalesLines.PAGE.ClearTotalSalesHeader();
- end;
- }
- action("Reject IC Sales Invoice")
- {
- ApplicationArea = Intercompany;
- Caption = 'Reject IC Sales Invoice';
- Enabled = RejectICSalesInvoiceEnabled;
- Image = Cancel;
- ToolTip = 'Deletes the invoice and sends the rejection to the company that created it.';
-
- trigger OnAction()
- var
- ICInboxOutboxMgt: Codeunit ICInboxOutboxMgt;
- begin
- if not ICInboxOutboxMgt.IsSalesHeaderFromIncomingIC(Rec) then
- exit;
- if Confirm(SureToRejectMsg) then
- ICInboxOutboxMgt.RejectAcceptedSalesHeader(Rec);
- end;
- }
- }
- group("F&unctions")
- {
- Caption = 'F&unctions';
- Image = "Action";
- action(CreatePurchaseInvoice)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Purchase Invoice';
- Image = NewPurchaseInvoice;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category7;
- //The property 'PromotedIsBig' can only be set if the property 'Promoted' is set to 'true'
- //PromotedIsBig = true;
- ToolTip = 'Create a new purchase invoice to buy all the items that are required by the sales document, even if some of the items are already available.';
-
- trigger OnAction()
- var
- SelectedSalesLine: Record "Sales Line";
- PurchDocFromSalesDoc: Codeunit "Purch. Doc. From Sales Doc.";
- begin
- CurrPage.SalesLines.PAGE.SetSelectionFilter(SelectedSalesLine);
- PurchDocFromSalesDoc.CreatePurchaseInvoice(Rec, SelectedSalesLine);
- end;
- }
- action(GetRecurringSalesLines)
- {
- ApplicationArea = Suite;
- Caption = 'Get Recurring Sales Lines';
- Ellipsis = true;
- Enabled = IsCustomerOrContactNotEmpty;
- Image = CustomerCode;
- ToolTip = 'Insert sales document lines that you have set up for the customer as recurring. Recurring sales lines could be for a monthly replenishment order or a fixed freight expense.';
-
- trigger OnAction()
- var
- StdCustSalesCode: Record "Standard Customer Sales Code";
- begin
- StdCustSalesCode.InsertSalesLines(Rec);
- end;
- }
- action(CalculateInvoiceDiscount)
- {
- AccessByPermission = TableData "Cust. Invoice Disc." = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Calculate &Invoice Discount';
- Enabled = IsCustomerOrContactNotEmpty;
- Image = CalculateInvoiceDiscount;
- ToolTip = 'Calculate the invoice discount for the entire sales document when all sales invoice lines are entered.';
-
- trigger OnAction()
- begin
- ApproveCalcInvDisc();
- SalesCalcDiscountByType.ResetRecalculateInvoiceDisc(Rec);
- end;
- }
- action(CopyDocument)
- {
- ApplicationArea = Suite;
- Caption = 'Copy Document';
- Ellipsis = true;
- Enabled = Rec."No." <> '';
- Image = CopyDocument;
- ToolTip = 'Copy document lines and header information from another sales document to this document. You can copy a posted sales invoice into a new sales invoice to quickly create a similar document.';
-
- trigger OnAction()
- begin
- Rec.CopyDocument();
- if Rec.Get(Rec."Document Type", Rec."No.") then;
- CurrPage.SalesLines.Page.ForceTotalsCalculation();
- CurrPage.Update();
- end;
- }
- action("Move Negative Lines")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Move Negative Lines';
- Ellipsis = true;
- Image = MoveNegativeLines;
- ToolTip = 'Prepare to create a replacement sales order in a sales return process.';
-
- trigger OnAction()
- begin
- Clear(MoveNegSalesLines);
- MoveNegSalesLines.SetSalesHeader(Rec);
- MoveNegSalesLines.RunModal();
- MoveNegSalesLines.ShowDocument();
- end;
- }
- group("Incoming Document")
- {
- Caption = 'Incoming Document';
- Image = Documents;
- action(IncomingDocCard)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'View Incoming Document';
- Enabled = HasIncomingDocument;
- Image = ViewOrder;
- ToolTip = 'View any incoming document records and file attachments that exist for the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.ShowCardFromEntryNo(Rec."Incoming Document Entry No.");
- end;
- }
- action(SelectIncomingDoc)
- {
- AccessByPermission = TableData "Incoming Document" = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Select Incoming Document';
- Image = SelectLineToApply;
- ToolTip = 'Select an incoming document record and file attachment that you want to link to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- Rec.Validate("Incoming Document Entry No.", IncomingDocument.SelectIncomingDocument(Rec."Incoming Document Entry No.", Rec.RecordId));
- end;
- }
- action(IncomingDocAttachFile)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Incoming Document from File';
- Ellipsis = true;
- Enabled = not HasIncomingDocument;
- Image = Attach;
- ToolTip = 'Create an incoming document record by selecting a file to attach, and then link the incoming document record to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocumentAttachment: Record "Incoming Document Attachment";
- begin
- IncomingDocumentAttachment.NewAttachmentFromSalesDocument(Rec);
- end;
- }
- action(RemoveIncomingDoc)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Remove Incoming Document';
- Enabled = HasIncomingDocument;
- Image = RemoveLine;
- ToolTip = 'Remove any incoming document records and file attachments.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- if IncomingDocument.Get(Rec."Incoming Document Entry No.") then
- IncomingDocument.RemoveLinkToRelatedRecord();
- Rec."Incoming Document Entry No." := 0;
- Rec.Modify(true);
- end;
- }
- }
- }
- group("Request Approval")
- {
- Caption = 'Request Approval';
- 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()
- 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
- WorkflowWebhookMgt: Codeunit "Workflow Webhook Management";
- begin
- ApprovalsMgmt.OnCancelSalesApprovalRequest(Rec);
- WorkflowWebhookMgt.FindAndCancel(Rec.RecordId);
- end;
- }
- group(Flow)
- {
- Caption = 'Power Automate';
- Image = Flow;
-
- customaction(CreateFlowFromTemplate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create approval flow';
- ToolTip = 'Create a new flow in Power Automate from a list of relevant flow templates.';
- Visible = IsSaaS and IsPowerAutomatePrivacyNoticeApproved;
- CustomActionType = FlowTemplateGallery;
- FlowTemplateCategoryName = 'd365bc_approval_salesInvoice';
- }
- }
- }
- group("P&osting")
- {
- Caption = 'P&osting';
- Image = Post;
- action(Post)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'P&ost';
- Image = PostOrder;
- ShortCutKey = 'F9';
- AboutTitle = 'When all is set, you post';
- AboutText = 'After entering the sales lines and other information, you post the invoice to make it count. After posting, the sales invoice is moved to the Posted Sales Invoices list.';
- ToolTip = 'Finalize the document or journal by posting the amounts and quantities to the related accounts in your company books.';
-
- trigger OnAction()
- begin
- PostDocument(CODEUNIT::"Sales-Post (Yes/No)", Enum::"Navigate After Posting"::"Posted Document");
- end;
- }
- action(PostAndNew)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post and New';
- Ellipsis = true;
- Image = PostOrder;
- ShortCutKey = 'Alt+F9';
- ToolTip = 'Post the sales document and create a new, empty one.';
-
- trigger OnAction()
- begin
- PostDocument(CODEUNIT::"Sales-Post (Yes/No)", Enum::"Navigate After Posting"::"New Document");
- 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
- PostDocument(CODEUNIT::"Sales-Post and Send", Enum::"Navigate After Posting"::"Do Nothing");
- 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;
- }
- action(DraftInvoice)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Draft Invoice';
- Ellipsis = true;
- Image = ViewPostedOrder;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category5;
- ToolTip = 'View or print the sales invoice as a draft before you perform the actual posting.';
-
- trigger OnAction()
- var
- DocumentPrint: Codeunit "Document-Print";
- begin
- DocumentPrint.PrintSalesHeader(Rec);
- end;
- }
- action(ProformaInvoice)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Pro Forma Invoice';
- Ellipsis = true;
- Image = ViewPostedOrder;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category5;
- ToolTip = 'View or print the pro forma sales invoice.';
-
- trigger OnAction()
- var
- DocumentPrint: Codeunit "Document-Print";
- begin
- DocumentPrint.PrintProformaSalesInvoice(Rec);
- end;
- }
- action("Test Report")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Test Report';
- Ellipsis = true;
- Image = TestReport;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category5;
- 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("Remove From Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Remove From Job Queue';
- Image = RemoveLine;
- ToolTip = 'Remove the scheduled processing of this record from the job queue.';
-
- trigger OnAction()
- begin
- Rec.CancelBackgroundPosting();
- end;
- }
- action(PrintToAttachment)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Attach as PDF';
- Ellipsis = true;
- Image = PrintAttachment;
- ToolTip = 'Create a PDF file and attach it to the document.';
-
- trigger OnAction()
- var
- SalesHeader: Record "Sales Header";
- DocumentPrint: Codeunit "Document-Print";
- begin
- SalesHeader := Rec;
- SalesHeader.SetRecFilter();
- DocumentPrint.PrintSalesInvoiceToDocumentAttachment(SalesHeader, DocumentPrint.GetSalesInvoicePrintToAttachmentOption(Rec));
- end;
- }
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- group(Category_Category5)
- {
- Caption = 'Posting', Comment = 'Generated from the PromotedActionCategories property index 4.';
- ShowAs = SplitButton;
-
- actionref(Post_Promoted; Post)
- {
- }
- actionref(PostAndSend_Promoted; PostAndSend)
- {
- }
- actionref(Preview_Promoted; Preview)
- {
- }
- actionref(PostAndNew_Promoted; PostAndNew)
- {
- }
- }
- group(Category_Category8)
- {
- Caption = 'Release', Comment = 'Generated from the PromotedActionCategories property index 7.';
- ShowAs = SplitButton;
-
- actionref(Release_Promoted; Release)
- {
- }
- actionref(Reopen_Promoted; Reopen)
- {
- }
- }
- }
- group(Category_Category6)
- {
- Caption = 'Prepare', Comment = 'Generated from the PromotedActionCategories property index 5.';
-
- actionref(CopyDocument_Promoted; CopyDocument)
- {
- }
- actionref(GetRecurringSalesLines_Promoted; GetRecurringSalesLines)
- {
- }
- group("Category_Incoming Document")
- {
- Caption = 'Incoming Document';
-
- actionref(IncomingDocAttachFile_Promoted; IncomingDocAttachFile)
- {
- }
- actionref(IncomingDocCard_Promoted; IncomingDocCard)
- {
- }
- actionref(SelectIncomingDoc_Promoted; SelectIncomingDoc)
- {
- }
- actionref(RemoveIncomingDoc_Promoted; RemoveIncomingDoc)
- {
- }
- }
- actionref(CalculateInvoiceDiscount_Promoted; CalculateInvoiceDiscount)
- {
- }
- actionref("Move Negative Lines_Promoted"; "Move Negative Lines")
- {
- }
- }
- group(Category_PrintSend)
- {
- Caption = 'Print/Send';
-
- actionref(DraftInvoice_Promoted; DraftInvoice)
- {
- }
- actionref(ProformaInvoice_Promoted; ProformaInvoice)
- {
- }
- }
- group(Category_Category4)
- {
- Caption = 'Approve', Comment = 'Generated from the PromotedActionCategories property index 3.';
-
- actionref(Approve_Promoted; Approve)
- {
- }
- actionref(Reject_Promoted; Reject)
- {
- }
- actionref(Comment_Promoted; Comment)
- {
- }
- actionref(Delegate_Promoted; Delegate)
- {
- }
- }
- group(Category_Category9)
- {
- Caption = 'Request Approval', Comment = 'Generated from the PromotedActionCategories property index 8.';
-
- actionref(SendApprovalRequest_Promoted; SendApprovalRequest)
- {
- }
- actionref(CancelApprovalRequest_Promoted; CancelApprovalRequest)
- {
- }
- }
- group(Category_Category7)
- {
- Caption = 'Invoice', Comment = 'Generated from the PromotedActionCategories property index 6.';
-
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref(SalesStatistics_Promoted; SalesStatistics)
- {
- }
- actionref("Co&mments_Promoted"; "Co&mments")
- {
- }
- actionref(DocAttach_Promoted; DocAttach)
- {
- }
- actionref(Approvals_Promoted; Approvals)
- {
- }
- separator(Navigate_Separator)
- {
- }
- actionref(Function_CustomerCard_Promoted; Function_CustomerCard)
- {
- }
- }
- group(Category_Category10)
- {
- Caption = 'View', Comment = 'Generated from the PromotedActionCategories property index 9.';
- }
- group(Category_Category11)
- {
- Caption = 'Navigate', Comment = 'Generated from the PromotedActionCategories property index 10.';
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- begin
- CurrPage.IncomingDocAttachFactBox.PAGE.LoadDataFromRecord(Rec);
- CurrPage.ApprovalFactBox.PAGE.UpdateApprovalEntriesFromSourceRecord(Rec.RecordId);
- ShowWorkflowStatus := CurrPage.WorkflowStatus.PAGE.SetFilterOnWorkflowRecord(Rec.RecordId);
- StatusStyleTxt := Rec.GetStatusStyleText();
- UpdatePaymentService();
- SetControlAppearance();
- end;
-
- trigger OnAfterGetRecord()
- var
- ICInboxOutboxMgt: Codeunit ICInboxOutboxMgt;
- begin
- RejectICSalesInvoiceEnabled := ICInboxOutboxMgt.IsSalesHeaderFromIncomingIC(Rec);
- WorkDescription := Rec.GetWorkDescription();
- UpdateShipToBillToGroupVisibility();
- SellToContact.GetOrClear(Rec."Sell-to Contact No.");
- BillToContact.GetOrClear(Rec."Bill-to Contact No.");
- CurrPage.IncomingDocAttachFactBox.Page.SetCurrentRecordID(Rec.RecordId);
-
- OnAfterOnAfterGetRecord(Rec);
- end;
-
- trigger OnDeleteRecord(): Boolean
- var
- IsHandled: Boolean;
- Result: Boolean;
- begin
- CurrPage.SaveRecord();
-
- OnBeforeOnDeleteRecord(Rec, Result, IsHandled);
- if IsHandled then
- exit(Result)
- else
- exit(Rec.ConfirmDeletion());
- end;
-
- trigger OnInit()
- begin
- JobQueuesUsed := SalesSetup.JobQueueActive();
- SetExtDocNoMandatoryCondition();
- IsPowerAutomatePrivacyNoticeApproved := PrivacyNotice.GetPrivacyNoticeApprovalState(FlowServiceManagement.GetPowerAutomatePrivacyNoticeId()) = "Privacy Notice Approval State"::Agreed;
- end;
-
- trigger OnInsertRecord(BelowxRec: Boolean): Boolean
- begin
- if DocNoVisible then
- Rec.CheckCreditMaxBeforeInsert();
-
- if (Rec."Sell-to Customer No." = '') and (Rec.GetFilter("Sell-to Customer No.") <> '') then
- CurrPage.Update(false);
- end;
-
- trigger OnNewRecord(BelowxRec: Boolean)
- begin
- xRec.Init();
- Rec."Responsibility Center" := UserMgt.GetSalesFilter();
- if (not DocNoVisible) and (Rec."No." = '') then
- Rec.SetSellToCustomerFromFilter();
-
- Rec.SetDefaultPaymentServices();
- UpdateShipToBillToGroupVisibility();
- end;
-
- trigger OnOpenPage()
- var
- PaymentServiceSetup: Record "Payment Service Setup";
- OfficeMgt: Codeunit "Office Management";
- EnvironmentInfo: Codeunit "Environment Information";
- ICInboxOutboxMgt: Codeunit ICInboxOutboxMgt;
- VATReportingDateMgt: Codeunit "VAT Reporting Date Mgt";
- begin
- Rec.SetSecurityFilterOnRespCenter();
-
- Rec.SetRange("Date Filter", 0D, WorkDate());
-
- ActivateFields();
-
- SetDocNoVisible();
-
- if Rec."No." = '' then
- if OfficeMgt.CheckForExistingInvoice(Rec."Sell-to Customer No.") then
- Error(''); // Cancel invoice creation
- IsSaaS := EnvironmentInfo.IsSaaS();
- if (Rec."No." <> '') and (Rec."Sell-to Customer No." = '') then
- DocumentIsPosted := (not Rec.Get(Rec."Document Type", Rec."No."));
- PaymentServiceVisible := PaymentServiceSetup.IsPaymentServiceVisible();
-
- CheckShowBackgrValidationNotification();
- RejectICSalesInvoiceEnabled := ICInboxOutboxMgt.IsSalesHeaderFromIncomingIC(Rec);
- VATDateEnabled := VATReportingDateMgt.IsVATDateEnabled();
- end;
-
- trigger OnQueryClosePage(CloseAction: Action): Boolean
- var
- Result: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeOnQueryClosePage(Rec, DocumentIsPosted, CloseAction, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if not (SkipConfirmationDialogOnClosing or DocumentIsPosted) then
- exit(Rec.ConfirmCloseUnposted());
- end;
-
- var
- SellToContact: Record Contact;
- BillToContact: Record Contact;
- SalesSetup: Record "Sales & Receivables Setup";
- GLSetup: Record "General Ledger Setup";
- MoveNegSalesLines: Report "Move Negative Sales Lines";
- ApplicationAreaMgmtFacade: Codeunit "Application Area Mgmt. Facade";
- ReportPrint: Codeunit "Test Report-Print";
- UserMgt: Codeunit "User Setup Management";
- SalesCalcDiscountByType: Codeunit "Sales - Calc Discount By Type";
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- LinesInstructionMgt: Codeunit "Lines Instruction Mgt.";
- CustomerMgt: Codeunit "Customer Mgt.";
- FormatAddress: Codeunit "Format Address";
- PrivacyNotice: Codeunit "Privacy Notice";
- FlowServiceManagement: Codeunit "Flow Service Management";
- ChangeExchangeRate: Page "Change Exchange Rate";
- WorkDescription: Text;
- StatusStyleTxt: Text;
- HasIncomingDocument: Boolean;
- DocNoVisible: Boolean;
- ExternalDocNoMandatory: Boolean;
- OpenApprovalEntriesExistForCurrUser: Boolean;
- IsPowerAutomatePrivacyNoticeApproved: Boolean;
- OpenApprovalEntriesExist: Boolean;
- ShowWorkflowStatus: Boolean;
- PaymentServiceVisible: Boolean;
- PaymentServiceEnabled: Boolean;
- SureToRejectMsg: Label 'Rejecting this order will remove it from your company and send it back to the partner company.\\Do you want to continue?';
- OpenPostedSalesInvQst: Label 'The invoice is posted as number %1 and moved to the Posted Sales Invoices window.\\Do you want to open the posted invoice?', Comment = '%1 = posted document number';
- IsCustomerOrContactNotEmpty: Boolean;
- ShowQuoteNo: Boolean;
- JobQueuesUsed: Boolean;
- CanCancelApprovalForRecord: Boolean;
- EmptyShipToCodeErr: Label 'The Code field can only be empty if you select Custom Address in the Ship-to field.';
- IsSaaS: Boolean;
- IsBillToCountyVisible: Boolean;
- IsSellToCountyVisible: Boolean;
- IsShipToCountyVisible: Boolean;
- SalesDocCheckFactboxVisible: Boolean;
- IsJournalTemplNameVisible: Boolean;
- IsPaymentMethodCodeVisible: Boolean;
- IsSalesLinesEditable: Boolean;
- ShouldSearchForCustByName: Boolean;
- CanRequestApprovalForFlow: Boolean;
- CanCancelApprovalForFlow: Boolean;
- RejectICSalesInvoiceEnabled: Boolean;
- VATDateEnabled: Boolean;
-
- protected var
- ShipToOptions: Enum "Sales Ship-to Options";
- BillToOptions: Enum "Sales Bill-to Options";
- DocumentIsPosted: Boolean;
- SkipConfirmationDialogOnClosing: Boolean;
- IsPostingGroupEditable: Boolean;
-
- local procedure ActivateFields()
- begin
- IsBillToCountyVisible := FormatAddress.UseCounty(Rec."Bill-to Country/Region Code");
- IsSellToCountyVisible := FormatAddress.UseCounty(Rec."Sell-to Country/Region Code");
- IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
- GLSetup.Get();
- IsJournalTemplNameVisible := GLSetup."Journal Templ. Name Mandatory";
- IsPaymentMethodCodeVisible := not GLSetup."Hide Payment Method Code";
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- end;
-
- ///
- /// Calls the document posting procedure with the specified posting codeunit and navigation option.
- ///
- /// The ID of the posting codeunit to execute.
- /// The navigation option after posting.
- procedure CallPostDocument(PostingCodeunitID: Integer; Navigate: Enum "Navigate After Posting")
- begin
- PostDocument(PostingCodeunitID, Navigate);
- end;
-
- local procedure PostDocument(PostingCodeunitID: Integer; Navigate: Enum "Navigate After Posting")
- var
- SalesHeader: Record "Sales Header";
- SalesInvoiceHeader: Record "Sales Invoice Header";
- OfficeMgt: Codeunit "Office Management";
- InstructionMgt: Codeunit "Instruction Mgt.";
- PageManagement: Codeunit "Page Management";
- PreAssignedNo: Code[20];
- xLastPostingNo: Code[20];
- IsScheduledPosting: Boolean;
- IsHandled: Boolean;
- begin
- LinesInstructionMgt.SalesCheckAllLinesHaveQuantityAssigned(Rec);
- PreAssignedNo := Rec."No.";
- xLastPostingNo := Rec."Last Posting No.";
-
- Rec.SendToPosting(PostingCodeunitID);
-
- IsScheduledPosting := Rec."Job Queue Status" = Rec."Job Queue Status"::"Scheduled for Posting";
- DocumentIsPosted := (not SalesHeader.Get(Rec."Document Type", Rec."No.")) or IsScheduledPosting;
- OnPostOnAfterSetDocumentIsPosted(SalesHeader, IsScheduledPosting, DocumentIsPosted);
-
- if IsScheduledPosting then
- CurrPage.Close();
- CurrPage.Update(false);
-
- IsHandled := false;
- OnPostDocumentBeforeNavigateAfterPosting(Rec, PostingCodeunitID, Navigate, DocumentIsPosted, IsHandled);
- if IsHandled then
- exit;
-
- if PostingCodeunitID <> CODEUNIT::"Sales-Post (Yes/No)" then
- exit;
-
- if OfficeMgt.IsAvailable() then 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
- PageManagement.PageRun(SalesInvoiceHeader);
- end else
- case Navigate of
- Enum::"Navigate After Posting"::"Posted Document":
- if InstructionMgt.IsEnabled(InstructionMgt.ShowPostedConfirmationMessageCode()) then
- ShowPostedConfirmationMessage(PreAssignedNo, xLastPostingNo);
- Enum::"Navigate After Posting"::"New Document":
- if DocumentIsPosted then begin
- SalesHeader.Init();
- SalesHeader.Validate("Document Type", SalesHeader."Document Type"::Invoice);
- OnPostOnBeforeSalesHeaderInsert(SalesHeader);
- SalesHeader.Insert(true);
- PAGE.Run(PAGE::"Sales Invoice", SalesHeader);
- end;
- else
- OnPostDocumentOnElseCaseNavigateAfterPosting(SalesHeader, PostingCodeunitID, Navigate);
- end;
- end;
-
- local procedure ApproveCalcInvDisc()
- begin
- Rec.TestStatusOpen();
- CurrPage.SalesLines.PAGE.ApproveCalcInvDisc();
- end;
-
- local procedure SaveInvoiceDiscountAmount()
- var
- DocumentTotals: Codeunit "Document Totals";
- begin
- CurrPage.SaveRecord();
- DocumentTotals.SalesRedistributeInvoiceDiscountAmountsOnDocument(Rec);
- CurrPage.Update(false);
- end;
-
- local procedure ShowPostedConfirmationMessage(PreAssignedNo: Code[20]; xLastPostingNo: Code[20])
- var
- SalesInvoiceHeader: Record "Sales Invoice Header";
- InstructionMgt: Codeunit "Instruction Mgt.";
- ICFeedback: Codeunit "IC Feedback";
- 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 begin
- ICFeedback.ShowIntercompanyMessage(Rec, Enum::"IC Transaction Document Type"::Invoice, SalesInvoiceHeader."No.");
- if InstructionMgt.ShowConfirm(StrSubstNo(OpenPostedSalesInvQst, SalesInvoiceHeader."No."),
- InstructionMgt.ShowPostedConfirmationMessageCode())
- then
- InstructionMgt.ShowPostedDocument(SalesInvoiceHeader, Page::"Sales Invoice");
- end;
- end;
-
- local procedure SalespersonCodeOnAfterValidate()
- begin
- CurrPage.SalesLines.PAGE.UpdatePage(true);
- end;
-
- local procedure SetDocNoVisible()
- var
- DocumentNoVisibility: Codeunit DocumentNoVisibility;
- DocType: Option Quote,"Order",Invoice,"Credit Memo","Blanket Order","Return Order",Reminder,FinChMemo;
- begin
- DocNoVisible := DocumentNoVisibility.SalesDocumentNoIsVisible(DocType::Invoice, Rec."No.");
- end;
-
- local procedure SetExtDocNoMandatoryCondition()
- begin
- SalesSetup.GetRecordOnce();
- ExternalDocNoMandatory := SalesSetup."Ext. Doc. No. Mandatory";
- end;
-
- local procedure ShowPreview()
- var
- SalesPostYesNo: Codeunit "Sales-Post (Yes/No)";
- begin
- OnBeforeShowPreview(Rec);
- SalesPostYesNo.Preview(Rec);
- end;
-
- local procedure SetControlAppearance()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- DocumentErrorsMgt: Codeunit "Document Errors Mgt.";
- WorkflowWebhookMgt: Codeunit "Workflow Webhook Management";
- begin
- HasIncomingDocument := Rec."Incoming Document Entry No." <> 0;
- ShowQuoteNo := Rec."Quote No." <> '';
- SetExtDocNoMandatoryCondition();
- SetPostingGroupEditable();
-
- OpenApprovalEntriesExistForCurrUser := ApprovalsMgmt.HasOpenApprovalEntriesForCurrentUser(Rec.RecordId);
- OpenApprovalEntriesExist := ApprovalsMgmt.HasOpenApprovalEntries(Rec.RecordId);
- CanCancelApprovalForRecord := ApprovalsMgmt.CanCancelApprovalForRecord(Rec.RecordId);
-
- IsCustomerOrContactNotEmpty := (Rec."Sell-to Customer No." <> '') or (Rec."Sell-to Contact No." <> '');
- IsSalesLinesEditable := Rec.SalesLinesEditable();
-
- SalesDocCheckFactboxVisible := DocumentErrorsMgt.BackgroundValidationEnabled();
- WorkflowWebhookMgt.GetCanRequestAndCanCancel(Rec.RecordId, CanRequestApprovalForFlow, CanCancelApprovalForFlow);
- ShouldSearchForCustByName := Rec.ShouldSearchForCustomerByName(Rec."Sell-to Customer No.");
- end;
-
- ///
- /// Runs a background check for document errors.
- ///
- procedure RunBackgroundCheck()
- begin
- CurrPage.SalesDocCheckFactbox.Page.CheckErrorsInBackground(Rec);
- end;
-
- local procedure CheckShowBackgrValidationNotification()
- var
- DocumentErrorsMgt: Codeunit "Document Errors Mgt.";
- begin
- if DocumentErrorsMgt.CheckShowEnableBackgrValidationNotification() then
- SetControlAppearance();
- end;
-
- ///
- /// Sets whether to skip the confirmation dialog when closing the page.
- ///
- /// Whether to skip the confirmation dialog.
- procedure SetSkipConfirmationDialogOnClosing(Skip: Boolean)
- begin
- SkipConfirmationDialogOnClosing := Skip;
- end;
-
- protected procedure UpdatePaymentService()
- var
- PaymentServiceSetup: Record "Payment Service Setup";
- begin
- PaymentServiceEnabled := PaymentServiceSetup.CanChangePaymentService(Rec);
- end;
-
- ///
- /// Sets whether the posting group field should be editable based on customer settings.
- ///
- procedure SetPostingGroupEditable()
- var
- BillToCustomer: Record Customer;
- begin
- if BillToCustomer.Get(Rec."Bill-to Customer No.") then
- IsPostingGroupEditable := BillToCustomer."Allow Multiple Posting Groups";
- end;
-
- local procedure UpdateShipToBillToGroupVisibility()
- begin
- CustomerMgt.CalculateShipBillToOptions(ShipToOptions, BillToOptions, Rec);
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnAfterOnAfterGetRecord(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowPreview(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnPostOnAfterSetDocumentIsPosted(SalesHeader: Record "Sales Header"; var IsScheduledPosting: Boolean; var DocumentIsPosted: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnPostOnBeforeSalesHeaderInsert(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShipToOptions(var SalesHeader: Record "Sales Header"; ShipToOptions: Option; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateShipToOptions(var SalesHeader: Record "Sales Header"; ShipToOptions: Option)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnPostDocumentBeforeNavigateAfterPosting(var SalesHeader: Record "Sales Header"; var PostingCodeunitID: Integer; var Navigate: Enum "Navigate After Posting"; DocumentIsPosted: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeOnDeleteRecord(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeOnQueryClosePage(var SalesHeader: Record "Sales Header"; DocumentIsPosted: Boolean; CloseAction: Action; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupBillToName(var Customer: Record Customer; SalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnPostDocumentOnElseCaseNavigateAfterPosting(var SalesHeader: Record "Sales Header"; PostingCodeunitID: Integer; Navigate: Enum "Navigate After Posting")
- begin
- end;
-}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Sales/Document/SalesOrder.Page.al b/src/Layers/NL/BaseApp/Sales/Document/SalesOrder.Page.al
deleted file mode 100644
index a432585eaf..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Document/SalesOrder.Page.al
+++ /dev/null
@@ -1,3031 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.Assembly.Document;
-using Microsoft.Bank.Setup;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Outlook;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.VAT.Calculation;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Attachment;
-using Microsoft.Foundation.Enums;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Integration.D365Sales;
-using Microsoft.Integration.Dataverse;
-using Microsoft.Intercompany;
-using Microsoft.Intercompany.GLAccount;
-using Microsoft.Intercompany.Journal;
-using Microsoft.Intercompany.Outbox;
-using Microsoft.Inventory.Availability;
-using Microsoft.Inventory.BOM;
-using Microsoft.Inventory.Item;
-using Microsoft.Inventory.Location;
-using Microsoft.Projects.Resources.Resource;
-using Microsoft.Purchases.Document;
-using Microsoft.Sales.Comment;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.History;
-using Microsoft.Sales.Posting;
-using Microsoft.Sales.Pricing;
-using Microsoft.Sales.Setup;
-using Microsoft.Utilities;
-using Microsoft.Warehouse.Activity;
-using Microsoft.Warehouse.Document;
-using Microsoft.Warehouse.InventoryDocument;
-using Microsoft.Warehouse.Request;
-using Microsoft.Warehouse.Setup;
-using System.Automation;
-using System.Environment;
-using System.Environment.Configuration;
-using System.Privacy;
-using System.Security.User;
-using System.Threading;
-using System.Utilities;
-
-///
-/// Displays and manages a single sales order document for processing customer orders.
-///
-page 42 "Sales Order"
-{
- Caption = 'Sales Order';
- PageType = Document;
- RefreshOnActivate = true;
- SourceTable = "Sales Header";
- SourceTableView = where("Document Type" = filter(Order));
- AdditionalSearchTerms = 'Sales Commitment, Sale Order, Client Order';
-
- AboutTitle = 'About sales order details';
- AboutText = 'Choose the order details and fill in order lines with quantities of what you are selling. Post the order when you are ready to ship or invoice. This creates posted sales shipments and posted sales invoices.';
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field("No."; Rec."No.")
- {
- ApplicationArea = All;
- Importance = Standard;
- ToolTip = 'Specifies the number of the involved entry or record, according to the specified number series.';
- Visible = DocNoVisible;
-
- trigger OnAssistEdit()
- begin
- if Rec.AssistEdit(xRec) then
- CurrPage.Update();
- end;
- }
- field("Sell-to Customer No."; Rec."Sell-to Customer No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer No.';
- Importance = Additional;
- NotBlank = true;
- ToolTip = 'Specifies the number of the customer who will receive the products and be billed by default.';
-
- trigger OnValidate()
- begin
- Rec.SelltoCustomerNoOnAfterValidate(Rec, xRec);
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- CurrPage.Update();
- end;
- }
- field("Sell-to Customer Name"; Rec."Sell-to Customer Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer Name';
- ShowMandatory = true;
- ToolTip = 'Specifies the name of the customer who will receive the products and be billed by default.';
-
- AboutTitle = 'Who are you selling to?';
- AboutText = 'You can choose existing customers, or add new customers when you create orders. Orders can automatically choose special prices and discounts that you have set for each customer.';
-
- trigger OnAfterLookup(Selected: RecordRef)
- var
- Customer: Record Customer;
- begin
- Selected.SetTable(Customer);
- if Rec."Sell-to Customer No." <> Customer."No." then begin
- Rec.Validate("Sell-to Customer No.", Customer."No.");
- if Rec."Sell-to Customer No." <> Customer."No." then
- error('');
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- CurrPage.Update();
- end;
- end;
-
- trigger OnValidate()
- begin
- Rec.SelltoCustomerNoOnAfterValidate(Rec, xRec);
- CurrPage.Update();
- end;
- }
- field("Sell-to Customer Name 2"; Rec."Sell-to Customer Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer Name 2';
- QuickEntry = false;
- Visible = false;
- }
- group(Control114)
- {
- ShowCaption = false;
- Visible = ShowQuoteNo;
- field("Quote No."; Rec."Quote No.")
- {
- ApplicationArea = All;
- }
- }
- field("Posting Description"; Rec."Posting Description")
- {
- ApplicationArea = Suite;
- Visible = false;
- }
- group("Sell-to")
- {
- Caption = 'Sell-to';
- field("Sell-to Address"; Rec."Sell-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Importance = Additional;
- QuickEntry = false;
- }
- field("Sell-to Address 2"; Rec."Sell-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Importance = Additional;
- QuickEntry = false;
- }
- field("Sell-to City"; Rec."Sell-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Importance = Additional;
- QuickEntry = false;
- }
- group(Control123)
- {
- ShowCaption = false;
- Visible = IsSellToCountyVisible;
- field("Sell-to County"; Rec."Sell-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Sell-to Country/Region Code";
- Importance = Additional;
- QuickEntry = false;
- }
- }
- field("Sell-to Post Code"; Rec."Sell-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the postal code.';
- }
- field("Sell-to Country/Region Code"; Rec."Sell-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region Code';
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the country or region of the address.';
-
- trigger OnValidate()
- begin
- IsSellToCountyVisible := FormatAddress.UseCounty(Rec."Sell-to Country/Region Code");
- end;
- }
- field("Sell-to Contact No."; Rec."Sell-to Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact No.';
- Importance = Additional;
-
- trigger OnLookup(var Text: Text): Boolean
- begin
- if not Rec.SelltoContactLookup() then
- exit(false);
- Text := Rec."Sell-to Contact No.";
- CurrPage.Update();
- exit(true);
- end;
-
- trigger OnValidate()
- begin
- if Rec.GetFilter("Sell-to Contact No.") = xRec."Sell-to Contact No." then
- if Rec."Sell-to Contact No." <> xRec."Sell-to Contact No." then
- Rec.SetRange("Sell-to Contact No.");
- if Rec."Sell-to Contact No." <> xRec."Sell-to Contact No." then
- CurrPage.Update();
- end;
- }
- field("Sell-to Phone No."; Rec."Sell-to Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Importance = Additional;
- }
- field(SellToMobilePhoneNo; SellToContact."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mobile Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the contact person that the sales document will be sent to.';
- }
- field("Sell-to E-Mail"; Rec."Sell-to E-Mail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email';
- Importance = Additional;
- }
- }
- field("Sell-to Contact"; Rec."Sell-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = Rec."Sell-to Customer No." <> '';
- ToolTip = 'Specifies the name of the person to contact at the customer.';
-
- trigger OnLookup(var Text: Text): Boolean
- var
- Contact: Record Contact;
- begin
- Contact.FilterGroup(2);
- Rec.LookupContact(Rec."Sell-to Customer No.", Rec."Sell-to Contact No.", Contact);
- if Page.RunModal(0, Contact) = ACTION::LookupOK then
- Rec.Validate("Sell-to Contact No.", Contact."No.");
-
- if ShipToOptions = ShipToOptions::"Default (Sell-to Address)" then
- Rec.Validate("Ship-to Contact", Rec."Sell-to Contact");
- Contact.FilterGroup(0);
-
- Text := Rec."Sell-to Contact";
- CurrPage.Update();
- end;
- }
- field("No. of Archived Versions"; Rec."No. of Archived Versions")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Document Date"; Rec."Document Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Posting Date"; Rec."Posting Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
-
- trigger OnValidate()
- begin
- SaveInvoiceDiscountAmount();
- end;
- }
- field("VAT Reporting Date"; Rec."VAT Reporting Date")
- {
- ApplicationArea = VAT;
- Importance = Promoted;
- Editable = VATDateEnabled;
- Visible = VATDateEnabled;
- }
- field("Order Date"; Rec."Order Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- QuickEntry = false;
- ToolTip = 'Specifies the date the order was created. The order date is also used to determine the prices and discounts on the document.';
- }
- field("Due Date"; Rec."Due Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- ToolTip = 'Specifies when the related sales invoice must be paid.';
-
- AboutTitle = 'When is payment due?';
- AboutText = 'When you post an order, the invoice gets it''s due date. You can set default due dates for orders by assigning payment terms to customers.';
- }
- field("Requested Delivery Date"; Rec."Requested Delivery Date")
- {
- ApplicationArea = Basic, Suite;
-
- trigger OnValidate()
- begin
- CurrPage.Update();
- end;
- }
- field("Promised Delivery Date"; Rec."Promised Delivery Date")
- {
- ApplicationArea = OrderPromising;
- Importance = Additional;
- }
- field("External Document No."; Rec."External Document No.")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- ShowMandatory = ExternalDocNoMandatory;
- }
- field("Your Reference"; Rec."Your Reference")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Salesperson Code"; Rec."Salesperson Code")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- QuickEntry = false;
-
- trigger OnValidate()
- begin
- SalespersonCodeOnAfterValidate();
- end;
- }
- field("Campaign No."; Rec."Campaign No.")
- {
- ApplicationArea = RelationshipMgmt;
- Importance = Additional;
- ToolTip = 'Specifies the number of the campaign that the document is linked to.';
- trigger OnValidate()
- begin
- if Rec."Campaign No." <> xRec."Campaign No." then
- CurrPage.Update();
- end;
- }
- field("Opportunity No."; Rec."Opportunity No.")
- {
- ApplicationArea = RelationshipMgmt;
- Importance = Additional;
- }
- field("Responsibility Center"; Rec."Responsibility Center")
- {
- AccessByPermission = TableData "Responsibility Center" = R;
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Assigned User ID"; Rec."Assigned User ID")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Job Queue Status"; Rec."Job Queue Status")
- {
- ApplicationArea = All;
- Importance = Additional;
- Visible = JobQueuesUsed;
-
- 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(Status; Rec.Status)
- {
- ApplicationArea = Suite;
- Importance = Promoted;
- StyleExpr = StatusStyleTxt;
- QuickEntry = false;
- }
- group("Work Description")
- {
- Caption = 'Work Description';
- field(WorkDescription; WorkDescription)
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- MultiLine = true;
- ShowCaption = false;
- ToolTip = 'Specifies the products or service being offered.';
-
- trigger OnValidate()
- begin
- Rec.SetWorkDescription(WorkDescription);
- end;
- }
- }
- }
- part(SalesLines; "Sales Order Subform")
- {
- ApplicationArea = Basic, Suite;
- Editable = IsSalesLinesEditable;
- Enabled = IsSalesLinesEditable;
- SubPageLink = "Document No." = field("No.");
- UpdatePropagation = Both;
- }
- group("Invoice Details")
- {
- Caption = 'Invoice Details';
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- Importance = Promoted;
-
- trigger OnAssistEdit()
- begin
- Clear(ChangeExchangeRate);
- if Rec."Posting Date" <> 0D then
- ChangeExchangeRate.SetParameter(Rec."Currency Code", Rec."Currency Factor", Rec."Posting Date")
- else
- ChangeExchangeRate.SetParameter(Rec."Currency Code", Rec."Currency Factor", WorkDate());
- if ChangeExchangeRate.RunModal() = ACTION::OK then begin
- Rec.Validate("Currency Factor", ChangeExchangeRate.GetParameter());
- SaveInvoiceDiscountAmount();
- end;
- Clear(ChangeExchangeRate);
- end;
-
- trigger OnValidate()
- begin
- CurrPage.Update();
- end;
- }
- field("Company Bank Account Code"; Rec."Company Bank Account Code")
- {
- ApplicationArea = Suite;
- Importance = Promoted;
- }
- field("Prices Including VAT"; Rec."Prices Including VAT")
- {
- ApplicationArea = VAT;
-
- trigger OnValidate()
- begin
- PricesIncludingVATOnAfterValid();
- end;
- }
- field("VAT Country/Region Code"; Rec."VAT Country/Region Code")
- {
- ApplicationArea = VAT;
- Importance = Additional;
- }
- field("VAT Registration No."; Rec."VAT Registration No.")
- {
- ApplicationArea = VAT;
- Importance = Additional;
- ToolTip = 'Specifies the VAT registration number for customers.';
- }
- field("Gen. Bus. Posting Group"; Rec."Gen. Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("VAT Bus. Posting Group"; Rec."VAT Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
-
- trigger OnValidate()
- begin
- CurrPage.Update();
- end;
- }
- field("Customer Posting Group"; Rec."Customer Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Editable = IsPostingGroupEditable;
- Importance = Additional;
- }
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the transaction mode used in telebanking.';
- }
- field("Bank Account Code"; Rec."Bank Account Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the customer''s bank account that is used for payments and collections through telebanking.';
- }
- field("Payment Terms Code"; Rec."Payment Terms Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Payment Method Code"; Rec."Payment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = IsPaymentMethodCodeVisible;
-
- trigger OnValidate()
- begin
- UpdatePaymentService();
- end;
- }
- field("EU 3-Party Trade"; Rec."EU 3-Party Trade")
- {
- ApplicationArea = BasicEU;
- }
- group(Control76)
- {
- ShowCaption = false;
- Visible = PaymentServiceVisible;
- field(SelectedPayments; Rec.GetSelectedPaymentServicesText())
- {
- ApplicationArea = All;
- Caption = 'Payment Service';
- Editable = false;
- Enabled = PaymentServiceEnabled;
- MultiLine = true;
- ToolTip = 'Specifies the online payment service, such as PayPal, that customers can use to pay the sales document.';
-
- trigger OnAssistEdit()
- begin
- Rec.ChangePaymentServiceSetting();
- end;
- }
- }
- field("Shortcut Dimension 1 Code"; Rec."Shortcut Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
-
- trigger OnValidate()
- begin
- ShortcutDimension1CodeOnAfterV();
- end;
- }
- field("Shortcut Dimension 2 Code"; Rec."Shortcut Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
-
- trigger OnValidate()
- begin
- ShortcutDimension2CodeOnAfterV();
- end;
- }
- 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.';
- }
- field("Pmt. Discount Date"; Rec."Pmt. Discount Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Journal Templ. Name"; Rec."Journal Templ. Name")
- {
- ApplicationArea = Basic, Suite;
- Visible = IsJournalTemplNameVisible;
- }
- field("Direct Debit Mandate ID"; Rec."Direct Debit Mandate ID")
- {
- ApplicationArea = Basic, Suite;
- }
- }
- group("Shipping and Billing")
- {
- Caption = 'Shipping and Billing';
- group(Control91)
- {
- ShowCaption = false;
- group(Control90)
- {
- ShowCaption = false;
- field(ShippingOptions; ShipToOptions)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Ship-to';
- ToolTip = 'Specifies the address that the products on the sales document are shipped to. Default (Sell-to Address): The same as the customer''s sell-to address. Alternate Ship-to Address: One of the customer''s alternate ship-to addresses. Custom Address: Any ship-to address that you specify in the fields below.';
-
- trigger OnValidate()
- var
- ShipToAddress: Record "Ship-to Address";
- ShipToAddressList: Page "Ship-to Address List";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShipToOptions(Rec, ShipToOptions.AsInteger(), IsHandled);
- if IsHandled then
- exit;
-
- case ShipToOptions of
- ShipToOptions::"Default (Sell-to Address)":
- begin
- Rec.Validate("Ship-to Code", '');
- Rec.CopySellToAddressToShipToAddress();
- end;
- ShipToOptions::"Alternate Shipping Address":
- begin
- ShipToAddress.SetRange("Customer No.", Rec."Sell-to Customer No.");
- ShipToAddressList.LookupMode := true;
- ShipToAddressList.SetTableView(ShipToAddress);
-
- if ShipToAddressList.RunModal() = ACTION::LookupOK then begin
- ShipToAddressList.GetRecord(ShipToAddress);
- OnValidateShipToOptionsOnAfterShipToAddressListGetRecord(ShipToAddress, Rec);
- Rec.Validate("Ship-to Code", ShipToAddress.Code);
- IsShipToCountyVisible := FormatAddress.UseCounty(ShipToAddress."Country/Region Code");
- end else
- ShipToOptions := ShipToOptions::"Custom Address";
- end;
- ShipToOptions::"Custom Address":
- begin
- Rec.Validate("Ship-to Code", '');
- IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
- end;
- end;
-
- OnAfterValidateShippingOptions(Rec, ShipToOptions.AsInteger());
- end;
- }
- group(Control4)
- {
- ShowCaption = false;
- Visible = not (ShipToOptions = ShipToOptions::"Default (Sell-to Address)");
- field("Ship-to Code"; Rec."Ship-to Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Code';
- Editable = ShipToOptions = ShipToOptions::"Alternate Shipping Address";
- Importance = Promoted;
- ToolTip = 'Specifies the code for another shipment address than the customer''s own address, which is entered by default.';
-
- trigger OnValidate()
- var
- ShipToAddress: Record "Ship-to Address";
- begin
- if (xRec."Ship-to Code" <> '') and (Rec."Ship-to Code" = '') then
- Error(EmptyShipToCodeErr);
- if Rec."Ship-to Code" <> '' then begin
- ShipToAddress.Get(Rec."Sell-to Customer No.", Rec."Ship-to Code");
- IsShipToCountyVisible := FormatAddress.UseCounty(ShipToAddress."Country/Region Code");
- end else
- IsShipToCountyVisible := false;
- end;
- }
- field("Ship-to Name"; Rec."Ship-to Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- ToolTip = 'Specifies the name that products on the sales document will be shipped to.';
- }
- field("Ship-to Name 2"; Rec."Ship-to Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name 2';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- Importance = Additional;
- QuickEntry = false;
- Visible = false;
- }
- field("Ship-to Address"; Rec."Ship-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- QuickEntry = false;
- }
- field("Ship-to Address 2"; Rec."Ship-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- QuickEntry = false;
- }
- field("Ship-to City"; Rec."Ship-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- QuickEntry = false;
- }
- group(Control297)
- {
- ShowCaption = false;
- Visible = IsShipToCountyVisible;
- field("Ship-to County"; Rec."Ship-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Ship-to Country/Region Code";
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- QuickEntry = false;
- }
- }
- field("Ship-to Post Code"; Rec."Ship-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- QuickEntry = false;
- ToolTip = 'Specifies the postal code.';
- }
- field("Ship-to Country/Region Code"; Rec."Ship-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the customer''s country/region.';
-
- trigger OnValidate()
- begin
- IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
- end;
- }
- }
- field("Ship-to Phone No."; Rec."Ship-to Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- }
- field("Ship-to Contact"; Rec."Ship-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- ToolTip = 'Specifies the name of the contact person at the address that products on the sales document will be shipped to.';
- }
- }
- group("Shipment Method")
- {
- Caption = 'Shipment Method';
- field("Shipment Method Code"; Rec."Shipment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Code';
- Importance = Additional;
- ToolTip = 'Specifies how items on the sales document are shipped to the customer.';
- }
- field("Shipping Agent Code"; Rec."Shipping Agent Code")
- {
- ApplicationArea = Suite;
- Caption = 'Agent';
- Importance = Additional;
- ToolTip = 'Specifies which shipping agent is used to transport the items on the sales document to the customer.';
- }
- field("Shipping Agent Service Code"; Rec."Shipping Agent Service Code")
- {
- ApplicationArea = Suite;
- Caption = 'Agent Service';
- Importance = Additional;
- ToolTip = 'Specifies the code that represents the default shipping agent service you are using for this sales order.';
- }
- field("Package Tracking No."; Rec."Package Tracking No.")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- }
- }
- group(Control85)
- {
- ShowCaption = false;
- field(BillToOptions; BillToOptions)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Bill-to';
- ToolTip = 'Specifies the customer that the sales invoice will be sent to. Default (Customer): The same as the customer on the sales invoice. Another Customer: Any customer that you specify in the fields below.';
-
- trigger OnValidate()
- begin
- if BillToOptions = BillToOptions::"Default (Customer)" then begin
- Rec.Validate("Bill-to Customer No.", Rec."Sell-to Customer No.");
- Rec.RecallModifyAddressNotification(Rec.GetModifyBillToCustomerAddressNotificationId());
- end;
-
- Rec.CopySellToAddressToBillToAddress();
- end;
- }
- group(Control82)
- {
- ShowCaption = false;
- Visible = not (BillToOptions = BillToOptions::"Default (Customer)");
- field("Bill-to Name"; Rec."Bill-to Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name';
- Editable = ((BillToOptions = BillToOptions::"Another Customer") or ((BillToOptions = BillToOptions::"Custom Address") and not ShouldSearchForCustByName));
- Enabled = ((BillToOptions = BillToOptions::"Another Customer") or ((BillToOptions = BillToOptions::"Custom Address") and not ShouldSearchForCustByName));
- Importance = Promoted;
- ToolTip = 'Specifies the customer to whom you will send the sales invoice, when different from the customer that you are selling to.';
-
- trigger OnAfterLookup(Selected: RecordRef)
- var
- Customer: Record Customer;
- begin
- Selected.SetTable(Customer);
- OnBeforeLookupBillToName(Customer, Rec);
- if Rec."Bill-to Customer No." <> Customer."No." then begin
- Rec.Validate("Bill-to Customer No.", Customer."No.");
- if Rec."Bill-to Customer No." <> Customer."No." then // User responded 'no' to change
- error('');
-
- if not ((BillToOptions = BillToOptions::"Custom Address") and not ShouldSearchForCustByName) then
- if Rec.GetFilter("Bill-to Customer No.") = xRec."Bill-to Customer No." then
- if Rec."Bill-to Customer No." <> xRec."Bill-to Customer No." then
- Rec.SetRange("Bill-to Customer No.");
-
- CurrPage.Update();
- end;
- end;
- }
- field("Bill-to Name 2"; Rec."Bill-to Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name 2';
- Editable = (BillToOptions = BillToOptions::"Another Customer");
- Enabled = (BillToOptions = BillToOptions::"Another Customer");
- Importance = Additional;
- QuickEntry = false;
- Visible = false;
- }
- field("Bill-to Address"; Rec."Bill-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- QuickEntry = false;
- }
- field("Bill-to Address 2"; Rec."Bill-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- QuickEntry = false;
- }
- field("Bill-to City"; Rec."Bill-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- QuickEntry = false;
- }
- group(Control130)
- {
- ShowCaption = false;
- Visible = IsBillToCountyVisible;
- field("Bill-to County"; Rec."Bill-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Bill-to Country/Region Code";
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- QuickEntry = false;
- }
- }
- field("Bill-to Post Code"; Rec."Bill-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the postal code.';
- }
- field("Bill-to Country/Region Code"; Rec."Bill-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region Code';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the country or region of the address.';
-
- trigger OnValidate()
- begin
- IsBillToCountyVisible := FormatAddress.UseCounty(Rec."Bill-to Country/Region Code");
- end;
- }
- field("Bill-to Contact No."; Rec."Bill-to Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact No.';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- }
- field("Bill-to Contact"; Rec."Bill-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- ToolTip = 'Specifies the name of the person you should contact at the customer who you are sending the invoice to.';
- }
- field(BillToContactPhoneNo; BillToContact."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the person you should contact at the customer you are sending the invoice to.';
- }
- field(BillToContactMobilePhoneNo; BillToContact."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mobile Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the person you should contact at the customer you are sending the invoice to.';
- }
- field(BillToContactEmail; BillToContact."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the email address of the person you should contact at the customer you are sending the invoice to.';
- }
- }
- }
- field("Location Code"; Rec."Location Code")
- {
- ApplicationArea = Location;
- }
- field("Shipment Date"; Rec."Shipment Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Shipping Advice"; Rec."Shipping Advice")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
-
- trigger OnValidate()
- var
- ConfirmManagement: Codeunit "Confirm Management";
- begin
- if Rec."Shipping Advice" <> xRec."Shipping Advice" then
- if not ConfirmManagement.GetResponseOrDefault(StrSubstNo(Text001, Rec.FieldCaption("Shipping Advice")), true) then
- Error(Text002);
- end;
- }
- field("Outbound Whse. Handling Time"; Rec."Outbound Whse. Handling Time")
- {
- ApplicationArea = Warehouse;
- Importance = Additional;
- }
- field("Shipping Time"; Rec."Shipping Time")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Late Order Shipping"; Rec."Late Order Shipping")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Combine Shipments"; Rec."Combine Shipments")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Completely Shipped"; Rec."Completely Shipped")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- }
- group("Foreign Trade")
- {
- Caption = 'Foreign Trade';
- Visible = BasicEUEnabled;
-
- field("Transaction Specification"; Rec."Transaction Specification")
- {
- ApplicationArea = BasicEU;
- }
- field("Transaction Type"; Rec."Transaction Type")
- {
- ApplicationArea = BasicEU;
- }
- field("Transport Method"; Rec."Transport Method")
- {
- ApplicationArea = BasicEU;
- }
- field("Exit Point"; Rec."Exit Point")
- {
- ApplicationArea = BasicEU;
- }
- field("Area"; Rec.Area)
- {
- ApplicationArea = BasicEU;
- }
- field("Language Code"; Rec."Language Code")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Format Region"; Rec."Format Region")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- }
- group(Control1900201301)
- {
- Caption = 'Prepayment';
- field("Prepayment %"; Rec."Prepayment %")
- {
- ApplicationArea = Prepayments;
- Importance = Promoted;
-
- trigger OnValidate()
- begin
- Prepayment37OnAfterValidate();
- end;
- }
- field("Compress Prepayment"; Rec."Compress Prepayment")
- {
- ApplicationArea = Prepayments;
- }
- field("Prepmt. Payment Terms Code"; Rec."Prepmt. Payment Terms Code")
- {
- ApplicationArea = Prepayments;
- }
- field("Prepayment Due Date"; Rec."Prepayment Due Date")
- {
- ApplicationArea = Prepayments;
- Importance = Promoted;
- }
- field("Prepmt. Payment Discount %"; Rec."Prepmt. Payment Discount %")
- {
- ApplicationArea = Prepayments;
- }
- field("Prepmt. Pmt. Discount Date"; Rec."Prepmt. Pmt. Discount Date")
- {
- ApplicationArea = Prepayments;
- }
- }
- }
- area(factboxes)
- {
- part(SalesDocCheckFactbox; "Sales Doc. Check Factbox")
- {
- ApplicationArea = All;
- Caption = 'Document Check';
- Visible = SalesDocCheckFactboxVisible;
- SubPageLink = "No." = field("No."),
- "Document Type" = field("Document Type");
- }
- 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(Control35; "Pending Approval FactBox")
- {
- ApplicationArea = All;
- SubPageLink = "Table ID" = const(36),
- "Document Type" = field("Document Type"),
- "Document No." = field("No."),
- Status = const(Open);
- Visible = OpenApprovalEntriesExistForCurrUser;
- }
- part(Control1903720907; "Sales Hist. Sell-to FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("Sell-to Customer No."),
- "Date Filter" = field("Date Filter");
- }
- part(Control1902018507; "Customer Statistics FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("Bill-to Customer No."),
- "Date Filter" = field("Date Filter");
- Visible = false;
- }
- part(Control1900316107; "Customer Details FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("Sell-to Customer No."),
- "Date Filter" = field("Date Filter");
- }
- part(Control1906127307; "Sales Line FactBox")
- {
- ApplicationArea = Suite;
- Provider = SalesLines;
- SubPageLink = "Document Type" = field("Document Type"),
- "Document No." = field("Document No."),
- "Line No." = field("Line No.");
- }
- part(Control1901314507; "Item Invoicing FactBox")
- {
- ApplicationArea = Basic, Suite;
- Provider = SalesLines;
- SubPageLink = "No." = field("No.");
- }
- part(ApprovalFactBox; "Approval FactBox")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(IncomingDocAttachFactBox; "Incoming Doc. Attach. FactBox")
- {
- ApplicationArea = Basic, Suite;
- ShowFilter = false;
- Visible = false;
- }
- part(Control1907012907; "Resource Details FactBox")
- {
- ApplicationArea = Basic, Suite;
- Provider = SalesLines;
- SubPageLink = "No." = field("No.");
- Visible = false;
- }
- part(Control1901796907; "Item Warehouse FactBox")
- {
- ApplicationArea = Basic, Suite;
- Provider = SalesLines;
- SubPageLink = "No." = field("No.");
- Visible = false;
- }
- part(Control1907234507; "Sales Hist. Bill-to FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("Bill-to Customer No."),
- "Date Filter" = field("Date Filter");
- Visible = false;
- }
- part(WorkflowStatus; "Workflow Status FactBox")
- {
- ApplicationArea = All;
- Editable = false;
- Enabled = false;
- ShowFilter = false;
- Visible = ShowWorkflowStatus;
- }
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("O&rder")
- {
- Caption = 'O&rder';
- Image = "Order";
- action(SalesOrderStatistics)
- {
- 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 Order Statistics";
- RunPageOnRec = true;
- }
- action(Customer)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer';
- Enabled = IsCustomerOrContactNotEmpty;
- Image = Customer;
- RunObject = Page "Customer Card";
- RunPageLink = "No." = field("Sell-to Customer No."),
- "Date Filter" = field("Date Filter");
- ShortCutKey = 'Shift+F7';
- ToolTip = 'View or edit detailed information about the customer on the sales document.';
- }
- action(CustomerStatistics)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer Statistics';
- Enabled = IsCustomerOrContactNotEmpty;
- 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(Dimensions)
- {
- AccessByPermission = TableData Dimension = R;
- ApplicationArea = Dimensions;
- Caption = 'Dimensions';
- Enabled = Rec."No." <> '';
- 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();
- CurrPage.SaveRecord();
- 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("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(AssemblyOrders)
- {
- AccessByPermission = TableData "BOM Component" = R;
- ApplicationArea = Assembly;
- Caption = 'Assembly Orders';
- Image = AssemblyOrder;
- ToolTip = 'View ongoing assembly orders related to the sales order. ';
-
- trigger OnAction()
- var
- AssembleToOrderLink: Record "Assemble-to-Order Link";
- begin
- AssembleToOrderLink.ShowAsmOrders(Rec);
- end;
- }
- action(DocAttach)
- {
- ApplicationArea = Basic, Suite;
- 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(ActionGroupCRM)
- {
- Caption = 'Dynamics 365 Sales';
- Visible = CRMIntegrationEnabled;
- action(CRMGoToSalesOrder)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Sales Order';
- Enabled = CRMIntegrationEnabled and CRMIsCoupledToRecord;
- Image = CoupledOrder;
- ToolTip = 'View the selected sales order.';
-
- trigger OnAction()
- var
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- begin
- CRMIntegrationManagement.ShowCRMEntityFromRecordID(Rec.RecordId);
- end;
- }
- action(CRMSynchronizeNow)
- {
- AccessByPermission = TableData "CRM Integration Record" = IM;
- ApplicationArea = Suite;
- Caption = 'Synchronize';
- Image = Refresh;
- ToolTip = 'Send updated data to Dynamics 365 Sales.';
- Enabled = IsBidirectionalSyncEnabled and (Rec.Status = Rec.Status::Released);
-
- trigger OnAction()
- var
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- begin
- CRMIntegrationManagement.UpdateOneNow(Rec.RecordId);
- end;
- }
- group(Coupling)
- {
- Caption = 'Coupling', Comment = 'Coupling is a noun';
- Image = LinkAccount;
- ToolTip = 'Create, change, or delete a coupling between the Business Central record and a Dynamics 365 Sales record.';
- Enabled = IsBidirectionalSyncEnabled and (Rec.Status = Rec.Status::Released);
- action(ManageCRMCoupling)
- {
- AccessByPermission = TableData "CRM Integration Record" = IM;
- ApplicationArea = Suite;
- Caption = 'Set Up Coupling';
- Image = LinkAccount;
- ToolTip = 'Create or modify the coupling to a Dynamics 365 Sales order.';
-
- trigger OnAction()
- var
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- begin
- CRMIntegrationManagement.DefineCoupling(Rec.RecordId);
- end;
- }
- action(DeleteCRMCoupling)
- {
- AccessByPermission = TableData "CRM Integration Record" = D;
- ApplicationArea = Suite;
- Caption = 'Delete Coupling';
- Enabled = CRMIsCoupledToRecord;
- Image = UnLinkAccount;
- ToolTip = 'Delete the coupling to a Dynamics 365 Sales order.';
-
- trigger OnAction()
- var
- SalesHeader: Record "Sales Header";
- CRMCouplingManagement: Codeunit "CRM Coupling Management";
- RecRef: RecordRef;
- begin
- CurrPage.SetSelectionFilter(SalesHeader);
- RecRef.GetTable(SalesHeader);
- CRMCouplingManagement.RemoveCoupling(RecRef);
- end;
- }
- }
- action(ShowLog)
- {
- ApplicationArea = Suite;
- Caption = 'Synchronization Log';
- Image = Log;
- ToolTip = 'View integration synchronization jobs for the sales order table.';
- Enabled = IsBidirectionalSyncEnabled and (Rec.Status = Rec.Status::Released);
-
- trigger OnAction()
- var
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- begin
- CRMIntegrationManagement.ShowLog(Rec.RecordId);
- end;
- }
- }
- group(Documents)
- {
- Caption = 'Documents';
- Image = Documents;
- action("S&hipments")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'S&hipments';
- Image = Shipment;
- RunObject = Page "Posted Sales Shipments";
- RunPageLink = "Order No." = field("No.");
- RunPageView = sorting("Order No.");
- ToolTip = 'View related posted sales shipments.';
- }
- action(Invoices)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Invoices';
- Image = Invoice;
- ToolTip = 'View a list of ongoing sales invoices for the order.';
-
- trigger OnAction()
- var
- TempSalesInvoiceHeader: Record "Sales Invoice Header" temporary;
- SalesGetShipment: Codeunit "Sales-Get Shipment";
- begin
- SalesGetShipment.GetSalesOrderInvoices(TempSalesInvoiceHeader, Rec."No.");
- Page.Run(Page::"Posted Sales Invoices", TempSalesInvoiceHeader);
- end;
- }
- }
- group(Warehouse)
- {
- Caption = 'Warehouse';
- Image = Warehouse;
- action("In&vt. Put-away/Pick Lines")
- {
- ApplicationArea = Warehouse;
- Caption = 'In&vt. Put-away/Pick Lines';
- Image = PickLines;
- RunObject = Page "Warehouse Activity List";
- RunPageLink = "Source Document" = const("Sales Order"),
- "Source No." = field("No.");
- RunPageView = sorting("Source Document", "Source No.", "Location Code");
- ToolTip = 'View items that are inbound or outbound on inventory put-away or inventory pick documents for the sales order.';
- }
- action("Warehouse Shipment Lines")
- {
- ApplicationArea = Warehouse;
- Caption = 'Warehouse Shipment Lines';
- Image = ShipmentLines;
- RunObject = Page "Whse. Shipment Lines";
- RunPageLink = "Source Type" = const(37),
-#pragma warning disable AL0603
- "Source Subtype" = field("Document Type"),
-#pragma warning restore
- "Source No." = field("No.");
- RunPageView = sorting("Source Type", "Source Subtype", "Source No.", "Source Line No.");
- ToolTip = 'View ongoing warehouse shipments for the document, in advanced warehouse configurations.';
- }
- action("Whse. Pick Lines")
- {
- ApplicationArea = Warehouse;
- Caption = 'Warehouse Pick Lines';
- Image = PickLines;
- RunObject = page "Warehouse Activity Lines";
- RunPageLink = "Source Document" = const("Sales Order"), "Source No." = field("No.");
- RunPageView = sorting("Source Type", "Source Subtype", "Source No.");
- ToolTip = 'View items that are outbound on warehouse pick documents for the sales order.';
- }
- }
- group(Prepayment)
- {
- Caption = 'Prepayment';
- Image = Prepayment;
- action(PagePostedSalesPrepaymentInvoices)
- {
- ApplicationArea = Prepayments;
- Caption = 'Prepa&yment Invoices';
- Image = PrepaymentInvoice;
- RunObject = Page "Posted Sales Invoices";
- RunPageLink = "Prepayment Order No." = field("No.");
- RunPageView = sorting("Prepayment Order No.");
- ToolTip = 'View related posted sales invoices that involve a prepayment. ';
- }
- action(PagePostedSalesPrepaymentCrMemos)
- {
- ApplicationArea = Prepayments;
- Caption = 'Prepayment Credi&t Memos';
- Image = PrepaymentCreditMemo;
- RunObject = Page "Posted Sales Credit Memos";
- RunPageLink = "Prepayment Order No." = field("No.");
- RunPageView = sorting("Prepayment Order No.");
- ToolTip = 'View related posted sales credit memos that involve a prepayment. ';
- }
- }
- group(History)
- {
- Caption = 'History';
- action(PageInteractionLogEntries)
- {
- ApplicationArea = Suite;
- Caption = 'Interaction Log E&ntries';
- Image = InteractionLog;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category10;
- ShortCutKey = 'Ctrl+F7';
- ToolTip = 'View a list of interaction log entries related to this document.';
-
- trigger OnAction()
- begin
- Rec.ShowInteractionLogEntries();
- end;
- }
- }
- }
- area(processing)
- {
- group(Approval)
- {
- Caption = 'Approval';
- action(Approve)
- {
- ApplicationArea = All;
- Caption = 'Approve';
- Image = Approve;
- ToolTip = 'Approve the requested changes.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.ApproveRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Reject)
- {
- ApplicationArea = All;
- Caption = 'Reject';
- Image = Reject;
- ToolTip = 'Reject the approval request.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.RejectRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Delegate)
- {
- ApplicationArea = All;
- Caption = 'Delegate';
- Image = Delegate;
- ToolTip = 'Delegate the approval to a substitute approver.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.DelegateRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Comment)
- {
- ApplicationArea = All;
- Caption = 'Comments';
- Image = ViewComments;
- ToolTip = 'View or add comments for the record.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.GetApprovalComment(Rec);
- end;
- }
- }
- group(Action21)
- {
- Caption = 'Release';
- Image = ReleaseDoc;
- action(Release)
- {
- ApplicationArea = Suite;
- Caption = 'Re&lease';
- Enabled = Rec.Status <> Rec.Status::Released;
- 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()
- begin
- Rec.PerformManualRelease();
- CurrPage.SalesLines.PAGE.ClearTotalSalesHeader();
- end;
- }
- action(Reopen)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Re&open';
- Enabled = Rec.Status <> Rec.Status::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
- ReleaseSalesDoc: Codeunit "Release Sales Document";
- begin
- ReleaseSalesDoc.PerformManualReopen(Rec);
- CurrPage.SalesLines.PAGE.ClearTotalSalesHeader();
- end;
- }
- }
- group("F&unctions")
- {
- Caption = 'F&unctions';
- Image = "Action";
- group("Create Purchase Document")
- {
- Caption = 'Create Purchase Document';
- Image = NewPurchaseInvoice;
- ToolTip = 'Create a new purchase document so you can buy items from a vendor.';
- action(CreatePurchaseOrder)
- {
- ApplicationArea = Suite;
- Caption = 'Create Purchase Orders';
- Image = Document;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category8;
- //The property 'PromotedIsBig' can only be set if the property 'Promoted' is set to 'true'
- //PromotedIsBig = true;
- ToolTip = 'Create one or more new purchase orders to buy the items that are required by this sales document, minus any quantity that is already available.';
-
- trigger OnAction()
- var
- PurchDocFromSalesDoc: Codeunit "Purch. Doc. From Sales Doc.";
- begin
- PurchDocFromSalesDoc.CreatePurchaseOrder(Rec);
- end;
- }
- action(CreatePurchaseInvoice)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Purchase Invoice';
- Image = NewPurchaseInvoice;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category8;
- //The property 'PromotedIsBig' can only be set if the property 'Promoted' is set to 'true'
- //PromotedIsBig = true;
- ToolTip = 'Create a new purchase invoice to buy all the items that are required by the sales document, even if some of the items are already available.';
-
- trigger OnAction()
- var
- SelectedSalesLine: Record "Sales Line";
- PurchDocFromSalesDoc: Codeunit "Purch. Doc. From Sales Doc.";
- begin
- CurrPage.SalesLines.PAGE.SetSelectionFilter(SelectedSalesLine);
- PurchDocFromSalesDoc.CreatePurchaseInvoice(Rec, SelectedSalesLine);
- end;
- }
- }
- action(CalculateInvoiceDiscount)
- {
- AccessByPermission = TableData "Cust. Invoice Disc." = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Calculate &Invoice Discount';
- Image = CalculateInvoiceDiscount;
- ToolTip = 'Calculate the invoice discount that applies to the sales order.';
-
- trigger OnAction()
- begin
- ApproveCalcInvDisc();
- SalesCalcDiscountByType.ResetRecalculateInvoiceDisc(Rec);
- end;
- }
- action(GetRecurringSalesLines)
- {
- ApplicationArea = Suite;
- Caption = 'Get Recurring Sales Lines';
- Ellipsis = true;
- Image = CustomerCode;
- ToolTip = 'Insert sales document lines that you have set up for the customer as recurring. Recurring sales lines could be for a monthly replenishment order or a fixed freight expense.';
-
- trigger OnAction()
- var
- StdCustSalesCode: Record "Standard Customer Sales Code";
- begin
- StdCustSalesCode.InsertSalesLines(Rec);
- end;
- }
- action(CopyDocument)
- {
- ApplicationArea = Suite;
- Caption = 'Copy Document';
- Ellipsis = true;
- Enabled = Rec."No." <> '';
- Image = CopyDocument;
- ToolTip = 'Copy document lines and header information from another sales document to this document. You can copy a posted sales invoice into a new sales invoice to quickly create a similar document.';
-
- trigger OnAction()
- begin
- Rec.CopyDocument();
- if Rec.Get(Rec."Document Type", Rec."No.") then;
- CurrPage.SalesLines.Page.ForceTotalsCalculation();
- CurrPage.Update();
- end;
- }
- action(MoveNegativeLines)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Move Negative Lines';
- Ellipsis = true;
- Image = MoveNegativeLines;
- ToolTip = 'Prepare to create a replacement sales order in a sales return process.';
-
- trigger OnAction()
- begin
- Clear(MoveNegSalesLines);
- MoveNegSalesLines.SetSalesHeader(Rec);
- MoveNegSalesLines.RunModal();
- MoveNegSalesLines.ShowDocument();
- end;
- }
- action("Archive Document")
- {
- ApplicationArea = Suite;
- Caption = 'Archi&ve Document';
- Image = Archive;
- ToolTip = 'Send the document to the archive, for example because it is too soon to delete it. Later, you delete or reprocess the archived document.';
-
- trigger OnAction()
- begin
- ArchiveManagement.ArchiveSalesDocument(Rec);
- CurrPage.Update(false);
- end;
- }
- action("Send IC Sales Order")
- {
- AccessByPermission = TableData "IC G/L Account" = R;
- ApplicationArea = Intercompany;
- Caption = 'Send IC Sales Order';
- Image = IntercompanyOrder;
- ToolTip = 'Send the sales order to the intercompany outbox or directly to the intercompany partner if automatic transaction sending is enabled.';
-
- trigger OnAction()
- var
- ICInOutboxMgt: Codeunit ICInboxOutboxMgt;
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- ICFeedback: Codeunit "IC Feedback";
- begin
- Rec.TestField("IC Direction", Rec."IC Direction"::Outgoing);
- if ApprovalsMgmt.PrePostApprovalCheckSales(Rec) then begin
- ICInOutboxMgt.SendSalesDoc(Rec, false);
- ICFeedback.ShowIntercompanyMessage(Rec, Enum::"IC Transaction Document Type"::Order);
- end;
- end;
- }
- action("Reject IC Sales Order")
- {
- ApplicationArea = Intercompany;
- Caption = 'Reject IC Sales Order';
- Enabled = RejectICSalesOrderEnabled;
- Image = Cancel;
- ToolTip = 'Deletes the order and sends the rejection to the company that created it.';
-
- trigger OnAction()
- var
- ICInboxOutboxMgt: Codeunit ICInboxOutboxMgt;
- begin
- if not ICInboxOutboxMgt.IsSalesHeaderFromIncomingIC(Rec) then
- exit;
- if Confirm(SureToRejectMsg) then
- ICInboxOutboxMgt.RejectAcceptedSalesHeader(Rec);
- end;
- }
- group(IncomingDocument)
- {
- Caption = 'Incoming Document';
- Image = Documents;
- action(IncomingDocCard)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'View Incoming Document';
- Enabled = HasIncomingDocument;
- Image = ViewOrder;
- ToolTip = 'View any incoming document records and file attachments that exist for the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.ShowCardFromEntryNo(Rec."Incoming Document Entry No.");
- end;
- }
- action(SelectIncomingDoc)
- {
- AccessByPermission = TableData "Incoming Document" = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Select Incoming Document';
- Image = SelectLineToApply;
- ToolTip = 'Select an incoming document record and file attachment that you want to link to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- Rec.Validate("Incoming Document Entry No.", IncomingDocument.SelectIncomingDocument(Rec."Incoming Document Entry No.", Rec.RecordId));
- end;
- }
- action(IncomingDocAttachFile)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Incoming Document from File';
- Ellipsis = true;
- Enabled = not HasIncomingDocument;
- Image = Attach;
- ToolTip = 'Create an incoming document record by selecting a file to attach, and then link the incoming document record to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocumentAttachment: Record "Incoming Document Attachment";
- begin
- IncomingDocumentAttachment.NewAttachmentFromSalesDocument(Rec);
- end;
- }
- action(RemoveIncomingDoc)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Remove Incoming Document';
- Enabled = HasIncomingDocument;
- Image = RemoveLine;
- ToolTip = 'Remove any incoming document records and file attachments.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- if IncomingDocument.Get(Rec."Incoming Document Entry No.") then
- IncomingDocument.RemoveLinkToRelatedRecord();
- Rec."Incoming Document Entry No." := 0;
- Rec.Modify(true);
- end;
- }
- }
- }
- group(Plan)
- {
- Caption = 'Plan';
- Image = Planning;
- action(OrderPromising)
- {
- AccessByPermission = TableData "Order Promising Line" = R;
- ApplicationArea = OrderPromising;
- Caption = 'Order &Promising';
- Image = OrderPromising;
- ToolTip = 'Calculate the shipment and delivery dates based on the item''s known and expected availability dates, and then promise the dates to the customer.';
-
- trigger OnAction()
- var
- OrderPromisingLine: Record "Order Promising Line" temporary;
- begin
- OrderPromisingLine.SetRange("Source Type", Rec."Document Type");
- OrderPromisingLine.SetRange("Source ID", Rec."No.");
- PAGE.RunModal(PAGE::"Order Promising Lines", OrderPromisingLine);
- end;
- }
- action("Demand Overview")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Demand Overview';
- Image = Forecast;
- ToolTip = 'Get an overview of demand for your items when planning sales, production, projects, or service management and when they will be available.';
-
- trigger OnAction()
- var
- DemandOverview: Page "Demand Overview";
- begin
- DemandOverview.SetCalculationParameter(true);
- DemandOverview.SetParameters(0D, Microsoft.Inventory.Requisition."Demand Order Source Type"::"Sales Demand", Rec."No.", '', '');
- DemandOverview.RunModal();
- end;
- }
- action("Pla&nning")
- {
- ApplicationArea = Planning;
- Caption = 'Pla&nning';
- Image = Planning;
- ToolTip = 'Open a tool for manual supply planning that displays all new demand along with availability information and suggestions for supply. It provides the visibility and tools needed to plan for demand from sales lines and component lines and then create different types of supply orders directly.';
-
- trigger OnAction()
- var
- SalesPlanForm: Page "Sales Order Planning";
- begin
- SalesPlanForm.SetSalesOrder(Rec."No.");
- SalesPlanForm.RunModal();
- end;
- }
- }
- group("Request Approval")
- {
- Caption = 'Request Approval';
- Image = SendApprovalRequest;
- 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.";
- WorkflowWebhookMgt: Codeunit "Workflow Webhook Management";
- begin
- ApprovalsMgmt.OnCancelSalesApprovalRequest(Rec);
- WorkflowWebhookMgt.FindAndCancel(Rec.RecordId);
- end;
- }
- group(Flow)
- {
- Caption = 'Power Automate';
- Image = Flow;
-
- customaction(CreateFlowFromTemplate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create approval flow';
- ToolTip = 'Create a new flow in Power Automate from a list of relevant flow templates.';
- Visible = IsSaaS and IsPowerAutomatePrivacyNoticeApproved;
- CustomActionType = FlowTemplateGallery;
- FlowTemplateCategoryName = 'd365bc_approval_salesOrder';
- }
- }
- }
- group(Action3)
- {
- Caption = 'Warehouse';
- Image = Warehouse;
- action("Create Inventor&y Put-away/Pick")
- {
- AccessByPermission = TableData "Posted Invt. Pick Header" = R;
- ApplicationArea = Warehouse;
- Caption = 'Create Inventor&y Put-away/Pick';
- Ellipsis = true;
- Image = CreateInventoryPickup;
- ToolTip = 'Create an inventory put-away or inventory pick to handle items on the document according to a basic warehouse configuration that does not require warehouse receipt or shipment documents.';
-
- trigger OnAction()
- begin
- Rec.PerformManualRelease();
- Rec.CreateInvtPutAwayPick();
-
- if not Rec.Find('=><') then
- Rec.Init();
- end;
- }
- action("Create &Warehouse Shipment")
- {
- AccessByPermission = TableData "Warehouse Shipment Header" = R;
- ApplicationArea = Warehouse;
- Caption = 'Create &Warehouse Shipment';
- Image = NewShipment;
- ToolTip = 'Create a warehouse shipment to start a pick a ship process according to an advanced warehouse configuration.';
-
- trigger OnAction()
- var
- GetSourceDocOutbound: Codeunit "Get Source Doc. Outbound";
- begin
- Rec.PerformManualRelease();
- GetSourceDocOutbound.CreateFromSalesOrder(Rec);
-
- if not Rec.Find('=><') then
- Rec.Init();
- end;
- }
- }
- group("P&osting")
- {
- Caption = 'P&osting';
- Image = Post;
- action(Post)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'P&ost';
- Ellipsis = true;
- Image = PostOrder;
- ShortCutKey = 'F9';
- ToolTip = 'Finalize the document or journal by posting the amounts and quantities to the related accounts in your company books.';
-
- AboutTitle = 'Posting the order';
- AboutText = 'Posting will ship or invoice the quantities on the order, or both. **Post** and **Send** can save the order as a file, print it, or attach it to an email, all in one go.';
-
- trigger OnAction()
- begin
- PostSalesOrder(CODEUNIT::"Sales-Post (Yes/No)", Enum::"Navigate After Posting"::"Posted Document");
- end;
- }
- action(PostAndNew)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post and New';
- Ellipsis = true;
- Image = PostOrder;
- ShortCutKey = 'Alt+F9';
- ToolTip = 'Post the sales document and create a new, empty one.';
-
- trigger OnAction()
- begin
- PostSalesOrder(CODEUNIT::"Sales-Post (Yes/No)", Enum::"Navigate After Posting"::"New Document");
- end;
- }
- action(PostAndSend)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post and Send';
- Ellipsis = true;
- Image = PostMail;
- 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
- PostSalesOrder(CODEUNIT::"Sales-Post and Send", Enum::"Navigate After Posting"::"Do Nothing");
- end;
- }
- 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("Remove From Job Queue")
- {
- ApplicationArea = All;
- Caption = 'Remove From Job Queue';
- Image = RemoveLine;
- ToolTip = 'Remove the scheduled processing of this record from the job queue.';
- Visible = JobQueueVisible;
-
- trigger OnAction()
- begin
- Rec.CancelBackgroundPosting();
- end;
- }
- action(PreviewPosting)
- {
- 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;
- }
- action(ProformaInvoice)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Pro Forma Invoice';
- Ellipsis = true;
- Image = ViewPostedOrder;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category5;
- ToolTip = 'View or print the pro forma sales invoice.';
-
- trigger OnAction()
- begin
- DocPrint.PrintProformaSalesInvoice(Rec);
- end;
- }
- group("Prepa&yment")
- {
- Caption = 'Prepa&yment';
- Image = Prepayment;
- action("Prepayment &Test Report")
- {
- ApplicationArea = Prepayments;
- Caption = 'Prepayment &Test Report';
- Ellipsis = true;
- Image = PrepaymentSimulation;
- ToolTip = 'Preview the prepayment transactions that will results from posting the sales document as invoiced. ';
-
- trigger OnAction()
- begin
- ReportPrint.PrintSalesHeaderPrepmt(Rec);
- end;
- }
- action(PostPrepaymentInvoice)
- {
- ApplicationArea = Prepayments;
- Caption = 'Post Prepayment &Invoice';
- Ellipsis = true;
- Image = PrepaymentPost;
- ToolTip = 'Post the specified prepayment information. ';
-
- trigger OnAction()
- var
- SalesPostYNPrepmt: Codeunit "Sales-Post Prepayment (Yes/No)";
- begin
- if ApprovalsMgmt.PrePostApprovalCheckSales(Rec) then
- SalesPostYNPrepmt.PostPrepmtInvoiceYN(Rec, false);
- end;
- }
- action("Post and Print Prepmt. Invoic&e")
- {
- ApplicationArea = Prepayments;
- Caption = 'Post and Print Prepmt. Invoic&e';
- Ellipsis = true;
- Image = PrepaymentPostPrint;
- ToolTip = 'Post the specified prepayment information and print the related report. ';
-
- trigger OnAction()
- var
- SalesPostYNPrepmt: Codeunit "Sales-Post Prepayment (Yes/No)";
- begin
- if ApprovalsMgmt.PrePostApprovalCheckSales(Rec) then
- SalesPostYNPrepmt.PostPrepmtInvoiceYN(Rec, true);
- end;
- }
- action(PreviewPrepmtInvoicePosting)
- {
- ApplicationArea = Prepayments;
- Caption = 'Preview Prepmt. Invoice Posting';
- Image = ViewPostedOrder;
- ToolTip = 'Review the different types of entries that will be created when you post the prepayment invoice.';
-
- trigger OnAction()
- begin
- ShowPrepmtInvoicePreview();
- end;
- }
- action(PostPrepaymentCreditMemo)
- {
- ApplicationArea = Prepayments;
- Caption = 'Post Prepayment &Credit Memo';
- Ellipsis = true;
- Image = PrepaymentPost;
- ToolTip = 'Create and post a credit memo for the specified prepayment information.';
-
- trigger OnAction()
- var
- SalesPostYNPrepmt: Codeunit "Sales-Post Prepayment (Yes/No)";
- begin
- if ApprovalsMgmt.PrePostApprovalCheckSales(Rec) then
- SalesPostYNPrepmt.PostPrepmtCrMemoYN(Rec, false);
- end;
- }
- action("Post and Print Prepmt. Cr. Mem&o")
- {
- ApplicationArea = Prepayments;
- Caption = 'Post and Print Prepmt. Cr. Mem&o';
- Ellipsis = true;
- Image = PrepaymentPostPrint;
- ToolTip = 'Create and post a credit memo for the specified prepayment information and print the related report.';
-
- trigger OnAction()
- var
- SalesPostYNPrepmt: Codeunit "Sales-Post Prepayment (Yes/No)";
- begin
- if ApprovalsMgmt.PrePostApprovalCheckSales(Rec) then
- SalesPostYNPrepmt.PostPrepmtCrMemoYN(Rec, true);
- end;
- }
- action(PreviewPrepmtCrMemoPosting)
- {
- ApplicationArea = Prepayments;
- Caption = 'Preview Prepmt. Cr. Memo Posting';
- Image = ViewPostedOrder;
- ToolTip = 'Review the different types of entries that will be created when you post the prepayment credit memo.';
-
- trigger OnAction()
- begin
- ShowPrepmtCrMemoPreview();
- end;
- }
- }
- }
- group("&Print")
- {
- Caption = '&Print';
- Image = Print;
- action("Work Order")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Work Order';
- Ellipsis = true;
- Image = Print;
- ToolTip = 'Prepare to registers actual item quantities or time used in connection with the sales order. For example, the document can be used by staff who perform any kind of processing work in connection with the sales order. It can also be exported to Excel if you need to process the sales line data further.';
-
- trigger OnAction()
- begin
- DocPrint.PrintSalesOrder(Rec, Usage::"Work Order");
- end;
- }
- action("Pick Instruction")
- {
- ApplicationArea = Warehouse;
- Caption = 'Pick Instruction';
- Image = Print;
- ToolTip = 'Print a picking list that shows which items to pick and ship for the sales order. If an item is assembled to order, then the report includes rows for the assembly components that must be picked. Use this report as a pick instruction to employees in charge of picking sales items or assembly components for the sales order.';
-
- trigger OnAction()
- begin
- DocPrint.PrintSalesOrder(Rec, Usage::"Pick Instruction");
- end;
- }
- }
- group("&Order Confirmation")
- {
- Caption = '&Order Confirmation';
- Image = Email;
- action(SendEmailConfirmation)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email Confirmation';
- Ellipsis = true;
- Image = Email;
- ToolTip = 'Send a sales order confirmation by email. The attachment is sent as a .pdf.';
-
- trigger OnAction()
- begin
- DocPrint.EmailSalesHeader(Rec);
- end;
- }
- group(Action96)
- {
- action("Print Confirmation")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Print Confirmation';
- Ellipsis = true;
- Image = Print;
- ToolTip = 'Print a sales order confirmation.';
- Visible = not IsOfficeHost;
-
- trigger OnAction()
- begin
- DocPrint.PrintSalesOrder(Rec, Usage::"Order Confirmation");
- end;
- }
- action(AttachAsPDF)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Attach as PDF';
- Ellipsis = true;
- Image = PrintAttachment;
- ToolTip = 'Create a PDF file and attach it to the document.';
-
- trigger OnAction()
- var
- SalesHeader: Record "Sales Header";
- begin
- SalesHeader := Rec;
- SalesHeader.SetRecFilter();
- DocPrint.PrintSalesOrderToDocumentAttachment(SalesHeader, DocPrint.GetSalesOrderPrintToAttachmentOption(Rec));
- end;
- }
- }
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- group(Category_Category6)
- {
- Caption = 'Posting', Comment = 'Generated from the PromotedActionCategories property index 5.';
- ShowAs = SplitButton;
-
- actionref(Post_Promoted; Post)
- {
- }
- actionref(PostAndSend_Promoted; PostAndSend)
- {
- }
- actionref(PreviewPosting_Promoted; PreviewPosting)
- {
- }
- actionref(PostAndNew_Promoted; PostAndNew)
- {
- }
- }
- group(Category_Category5)
- {
- Caption = 'Release', Comment = 'Generated from the PromotedActionCategories property index 4.';
- ShowAs = SplitButton;
-
- actionref(Release_Promoted; Release)
- {
- }
- actionref(Reopen_Promoted; Reopen)
- {
- }
- }
- actionref("Create &Warehouse Shipment_Promoted"; "Create &Warehouse Shipment")
- {
- }
- actionref("Create Inventor&y Put-away/Pick_Promoted"; "Create Inventor&y Put-away/Pick")
- {
- }
- actionref("Archive Document_Promoted"; "Archive Document")
- {
- }
- }
- group(Category_Category7)
- {
- Caption = 'Prepare', Comment = 'Generated from the PromotedActionCategories property index 6.';
-
- actionref(CopyDocument_Promoted; CopyDocument)
- {
- }
- actionref(GetRecurringSalesLines_Promoted; GetRecurringSalesLines)
- {
- }
- group("Category_Incoming Document")
- {
- Caption = 'Incoming Document';
-
- actionref(IncomingDocAttachFile_Promoted; IncomingDocAttachFile)
- {
- }
- actionref(IncomingDocCard_Promoted; IncomingDocCard)
- {
- }
- actionref(SelectIncomingDoc_Promoted; SelectIncomingDoc)
- {
- }
- actionref(RemoveIncomingDoc_Promoted; RemoveIncomingDoc)
- {
- }
- }
- actionref(CalculateInvoiceDiscount_Promoted; CalculateInvoiceDiscount)
- {
- }
- actionref(MoveNegativeLines_Promoted; MoveNegativeLines)
- {
- }
- }
- group(Category_Category4)
- {
- Caption = 'Approve', Comment = 'Generated from the PromotedActionCategories property index 3.';
-
- actionref(Approve_Promoted; Approve)
- {
- }
- actionref(Reject_Promoted; Reject)
- {
- }
- actionref(Comment_Promoted; Comment)
- {
- }
- actionref(Delegate_Promoted; Delegate)
- {
- }
- }
- group(Category_Category11)
- {
- Caption = 'Print/Send', Comment = 'Generated from the PromotedActionCategories property index 10.';
-
- actionref(SendEmailConfirmation_Promoted; SendEmailConfirmation)
- {
- }
- actionref("Print Confirmation_Promoted"; "Print Confirmation")
- {
- }
- actionref("Pick Instruction_Promoted"; "Pick Instruction")
- {
- }
- actionref(AttachAsPDF_Promoted; AttachAsPDF)
- {
- }
- actionref("Work Order_Promoted"; "Work Order")
- {
- }
- actionref(ProformaInvoice_Promoted; ProformaInvoice)
- {
- }
- }
- group(Category_Category9)
- {
- Caption = 'Request Approval', Comment = 'Generated from the PromotedActionCategories property index 8.';
-
- actionref(SendApprovalRequest_Promoted; SendApprovalRequest)
- {
- }
- actionref(CancelApprovalRequest_Promoted; CancelApprovalRequest)
- {
- }
- }
- group(Category_Category8)
- {
- Caption = 'Order', Comment = 'Generated from the PromotedActionCategories property index 7.';
-
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref(SalesOrderStatistics_Promoted; SalesOrderStatistics)
- {
- }
- actionref("Co&mments_Promoted"; "Co&mments")
- {
- }
- actionref(DocAttach_Promoted; DocAttach)
- {
- }
- actionref(Approvals_Promoted; Approvals)
- {
- }
- separator(Navigate_Separator)
- {
- }
- actionref(Invoices_Promoted; Invoices)
- {
- }
- actionref(Customer_Promoted; Customer)
- {
- }
- actionref("S&hipments_Promoted"; "S&hipments")
- {
- }
- }
- group(Category_Category10)
- {
- Caption = 'History', Comment = 'Generated from the PromotedActionCategories property index 9.';
- }
- group(Category_Category12)
- {
- Caption = 'Navigate', Comment = 'Generated from the PromotedActionCategories property index 11.';
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- group(Category_Synchronize)
- {
- Caption = 'Synchronize';
- Visible = CRMIntegrationEnabled;
-
- actionref(CRMGoToSalesOrder_Promoted; CRMGoToSalesOrder)
- {
- }
- group(Category_Coupling)
- {
- Caption = 'Coupling';
- ShowAs = SplitButton;
-
- actionref(ManageCRMCoupling_Promoted; ManageCRMCoupling)
- {
- }
- actionref(DeleteCRMCoupling_Promoted; DeleteCRMCoupling)
- {
- }
- }
- actionref(ShowLog_Promoted; ShowLog)
- {
- }
- actionref(CRMSynchronizeNow_Promoted; CRMSynchronizeNow)
- {
- }
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- var
- SalesHeader: Record "Sales Header";
- CRMCouplingManagement: Codeunit "CRM Coupling Management";
- CustCheckCrLimit: Codeunit "Cust-Check Cr. Limit";
- IsHandled: Boolean;
- begin
- if GuiAllowed() then begin
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- CurrPage.IncomingDocAttachFactBox.PAGE.LoadDataFromRecord(Rec);
- CurrPage.ApprovalFactBox.PAGE.UpdateApprovalEntriesFromSourceRecord(Rec.RecordId);
- end;
- CRMIsCoupledToRecord := CRMIntegrationEnabled;
- if CRMIsCoupledToRecord then
- CRMIsCoupledToRecord := CRMCouplingManagement.IsRecordCoupledToCRM(Rec.RecordId);
- if GuiAllowed() then begin
- ShowWorkflowStatus := CurrPage.WorkflowStatus.PAGE.SetFilterOnWorkflowRecord(Rec.RecordId);
- UpdatePaymentService();
- if CallNotificationCheck then begin
- SalesHeader := Rec;
- SalesHeader.CalcFields("Amount Including VAT");
- OnOnAfterGetCurrRecordOnBeforeSalesHeaderCheck(SalesHeader);
- CustCheckCrLimit.SalesHeaderCheck(SalesHeader);
- IsHandled := false;
- OnAfterGetCurrRecordOnBeforeCheckItemAvailabilityInLines(Rec, IsHandled);
- if not IsHandled then
- Rec.CheckItemAvailabilityInLines();
- CallNotificationCheck := false;
- end;
- StatusStyleTxt := Rec.GetStatusStyleText();
- SetControlVisibility();
- end;
- end;
-
- trigger OnAfterGetRecord()
- var
- ICInboxOutboxMgt: Codeunit ICInboxOutboxMgt;
- begin
- WorkDescription := Rec.GetWorkDescription();
- RejectICSalesOrderEnabled := ICInboxOutboxMgt.IsSalesHeaderFromIncomingIC(Rec);
- if GuiAllowed() then begin
- SetControlVisibility();
- UpdateShipToBillToGroupVisibility();
- BillToContact.GetOrClear(Rec."Bill-to Contact No.");
- SellToContact.GetOrClear(Rec."Sell-to Contact No.");
- CurrPage.IncomingDocAttachFactBox.Page.SetCurrentRecordID(Rec.RecordId);
- end;
- OnAfterOnAfterGetRecord(Rec);
- end;
-
- trigger OnDeleteRecord(): Boolean
- begin
- CurrPage.SaveRecord();
- exit(Rec.ConfirmDeletion());
- end;
-
- trigger OnInit()
- begin
- JobQueuesUsed := SalesSetup.JobQueueActive();
- SetExtDocNoMandatoryCondition();
- IsPowerAutomatePrivacyNoticeApproved := PrivacyNotice.GetPrivacyNoticeApprovalState(FlowServiceManagement.GetPowerAutomatePrivacyNoticeId()) = "Privacy Notice Approval State"::Agreed;
- end;
-
- trigger OnInsertRecord(BelowxRec: Boolean): Boolean
- begin
- if DocNoVisible then
- Rec.CheckCreditMaxBeforeInsert();
-
- if (Rec."Sell-to Customer No." = '') and (Rec.GetFilter("Sell-to Customer No.") <> '') then
- CurrPage.Update(false);
- end;
-
- trigger OnNewRecord(BelowxRec: Boolean)
- begin
- xRec.Init();
- Rec."Responsibility Center" := UserMgt.GetSalesFilter();
- if (not DocNoVisible) and (Rec."No." = '') then
- Rec.SetSellToCustomerFromFilter();
-
- Rec.SetDefaultPaymentServices();
- UpdateShipToBillToGroupVisibility();
- end;
-
- trigger OnOpenPage()
- var
- PaymentServiceSetup: Record "Payment Service Setup";
- CRMConnectionSetup: Record "CRM Connection Setup";
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- OfficeMgt: Codeunit "Office Management";
- EnvironmentInfo: Codeunit "Environment Information";
- ICInboxOutboxMgt: Codeunit ICInboxOutboxMgt;
- VATReportingDateMgt: Codeunit "VAT Reporting Date Mgt";
- ApplicationAreaMgmtFacade: Codeunit "Application Area Mgmt. Facade";
- begin
- Rec.SetSecurityFilterOnRespCenter();
-
- Rec.SetRange("Date Filter", 0D, WorkDate());
-
- ActivateFields();
-
- SetDocNoVisible();
-
- CRMIntegrationEnabled := CRMIntegrationManagement.IsCRMIntegrationEnabled();
- if CRMIntegrationEnabled then
- IsBidirectionalSyncEnabled := CRMConnectionSetup.IsBidirectionalSalesOrderIntEnabled();
- IsOfficeHost := OfficeMgt.IsAvailable();
- IsSaas := EnvironmentInfo.IsSaaS();
-
- if (Rec."No." <> '') and (Rec."Sell-to Customer No." = '') then
- DocumentIsPosted := (not Rec.Get(Rec."Document Type", Rec."No."));
- PaymentServiceVisible := PaymentServiceSetup.IsPaymentServiceVisible();
-
- if GuiAllowed() then
- CheckShowBackgrValidationNotification();
- RejectICSalesOrderEnabled := ICInboxOutboxMgt.IsSalesHeaderFromIncomingIC(Rec);
- VATDateEnabled := VATReportingDateMgt.IsVATDateEnabled();
- BasicEUEnabled := ApplicationAreaMgmtFacade.IsBasicCountryEnabled('EU');
- end;
-
- trigger OnQueryClosePage(CloseAction: Action): Boolean
- var
- InstructionMgt: Codeunit "Instruction Mgt.";
- IsHandled: Boolean;
- Result: Boolean;
- DoShowReleaseNotification: Boolean;
- begin
- IsHandled := false;
- DoShowReleaseNotification := ShowReleaseNotification();
- OnBeforeQueryClosePage(DocumentIsScheduledForPosting, Rec, CloseAction, DoShowReleaseNotification, DocumentIsPosted, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if not DocumentIsScheduledForPosting and DoShowReleaseNotification then
- if not InstructionMgt.ShowConfirmUnreleased() then
- exit(false);
-
- OnQueryClosePageOnBeforeConfirmCloseUnposted(DocumentIsPosted);
- if not DocumentIsPosted then
- exit(Rec.ConfirmCloseUnposted());
- end;
-
- var
- BillToContact: Record Contact;
- SellToContact: Record Contact;
- SalesSetup: Record "Sales & Receivables Setup";
- GLSetup: Record "General Ledger Setup";
- MoveNegSalesLines: Report "Move Negative Sales Lines";
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- ReportPrint: Codeunit "Test Report-Print";
- DocPrint: Codeunit "Document-Print";
- ArchiveManagement: Codeunit ArchiveManagement;
- SalesCalcDiscountByType: Codeunit "Sales - Calc Discount By Type";
- UserMgt: Codeunit "User Setup Management";
- CustomerMgt: Codeunit "Customer Mgt.";
- FormatAddress: Codeunit "Format Address";
- PrivacyNotice: Codeunit "Privacy Notice";
- FlowServiceManagement: Codeunit "Flow Service Management";
- ChangeExchangeRate: Page "Change Exchange Rate";
- Usage: Option "Order Confirmation","Work Order","Pick Instruction";
- JobQueueVisible: Boolean;
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text001: Label 'Do you want to change %1 in all related records in the warehouse?';
-#pragma warning restore AA0470
- Text002: Label 'The update has been interrupted to respect the warning.';
-#pragma warning restore AA0074
- HasIncomingDocument: Boolean;
- DocNoVisible: Boolean;
- ExternalDocNoMandatory: Boolean;
- OpenApprovalEntriesExistForCurrUser: Boolean;
- IsPowerAutomatePrivacyNoticeApproved: Boolean;
- OpenApprovalEntriesExist: Boolean;
- CRMIntegrationEnabled: Boolean;
- CRMIsCoupledToRecord: Boolean;
- ShowWorkflowStatus: Boolean;
- IsOfficeHost: Boolean;
- CanCancelApprovalForRecord: Boolean;
- JobQueuesUsed: Boolean;
- DocumentIsScheduledForPosting: Boolean;
- OpenPostedSalesOrderQst: Label 'The order is posted as number %1 and moved to the Posted Sales Invoices window.\\Do you want to open the posted invoice?', Comment = '%1 = posted document number';
- PaymentServiceVisible: Boolean;
- PaymentServiceEnabled: Boolean;
- EmptyShipToCodeErr: Label 'The Code field can only be empty if you select Custom Address in the Ship-to field.';
- SureToRejectMsg: Label 'Rejecting this order will remove it from your company and send it back to the partner company.\\Do you want to continue?';
- CanRequestApprovalForFlow: Boolean;
- CanCancelApprovalForFlow: Boolean;
- IsCustomerOrContactNotEmpty: Boolean;
- SalesDocCheckFactboxVisible: Boolean;
- WorkDescription: Text;
- StatusStyleTxt: Text;
- IsSaas: Boolean;
- IsBillToCountyVisible: Boolean;
- IsSellToCountyVisible: Boolean;
- IsShipToCountyVisible: Boolean;
- IsJournalTemplNameVisible: Boolean;
- IsPaymentMethodCodeVisible: Boolean;
- IsSalesLinesEditable: Boolean;
- ShouldSearchForCustByName: Boolean;
- IsBidirectionalSyncEnabled: Boolean;
- RejectICSalesOrderEnabled: Boolean;
- VATDateEnabled: Boolean;
- BasicEUEnabled: Boolean;
-
- protected var
- ShipToOptions: Enum "Sales Ship-to Options";
- BillToOptions: Enum "Sales Bill-to Options";
- CallNotificationCheck: Boolean;
- DocumentIsPosted: Boolean;
- ShowQuoteNo: Boolean;
- IsPostingGroupEditable: Boolean;
-
- local procedure ActivateFields()
- begin
- IsBillToCountyVisible := FormatAddress.UseCounty(Rec."Bill-to Country/Region Code");
- IsSellToCountyVisible := FormatAddress.UseCounty(Rec."Sell-to Country/Region Code");
- IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
- GLSetup.Get();
- IsJournalTemplNameVisible := GLSetup."Journal Templ. Name Mandatory";
- IsPaymentMethodCodeVisible := not GLSetup."Hide Payment Method Code";
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- end;
-
- protected procedure PostSalesOrder(PostingCodeunitID: Integer; Navigate: Enum "Navigate After Posting")
- var
- SalesHeader: Record "Sales Header";
- LinesInstructionMgt: Codeunit "Lines Instruction Mgt.";
- InstructionMgt: Codeunit "Instruction Mgt.";
- IsHandled: Boolean;
- begin
- OnBeforePostSalesOrder(Rec, PostingCodeunitID, Navigate);
- LinesInstructionMgt.SalesCheckAllLinesHaveQuantityAssigned(Rec);
-
- Rec.SendToPosting(PostingCodeunitID);
-
- DocumentIsScheduledForPosting := Rec."Job Queue Status" = Rec."Job Queue Status"::"Scheduled for Posting";
- DocumentIsPosted := (not SalesHeader.Get(Rec."Document Type", Rec."No.")) or DocumentIsScheduledForPosting;
- OnPostOnAfterSetDocumentIsPosted(SalesHeader, DocumentIsScheduledForPosting, DocumentIsPosted);
-
- CurrPage.Update(false);
-
- IsHandled := false;
- OnPostDocumentBeforeNavigateAfterPosting(Rec, PostingCodeunitID, Navigate, DocumentIsPosted, IsHandled);
- if IsHandled then
- exit;
-
- if PostingCodeunitID <> CODEUNIT::"Sales-Post (Yes/No)" then
- exit;
-
- case Navigate of
- Enum::"Navigate After Posting"::"Posted Document":
- begin
- if InstructionMgt.IsEnabled(InstructionMgt.ShowPostedConfirmationMessageCode()) then
- ShowPostedConfirmationMessage();
-
- if DocumentIsScheduledForPosting or DocumentIsPosted then
- CurrPage.Close();
- end;
- Enum::"Navigate After Posting"::"New Document":
- if DocumentIsPosted then begin
- Clear(SalesHeader);
- SalesHeader.Init();
- SalesHeader.Validate("Document Type", SalesHeader."Document Type"::Order);
- OnPostOnBeforeSalesHeaderInsert(SalesHeader);
- SalesHeader.Insert(true);
- PAGE.Run(PAGE::"Sales Order", SalesHeader);
- end;
- end;
- end;
-
- local procedure ApproveCalcInvDisc()
- begin
- Rec.TestStatusOpen();
- CurrPage.SalesLines.PAGE.ApproveCalcInvDisc();
- end;
-
- local procedure SaveInvoiceDiscountAmount()
- var
- DocumentTotals: Codeunit "Document Totals";
- begin
- CurrPage.SaveRecord();
- DocumentTotals.SalesRedistributeInvoiceDiscountAmountsOnDocument(Rec);
- CurrPage.Update(false);
- end;
-
- local procedure SalespersonCodeOnAfterValidate()
- begin
- CurrPage.SalesLines.PAGE.UpdateForm(false);
- end;
-
- local procedure ShortcutDimension1CodeOnAfterV()
- begin
- CurrPage.Update();
- end;
-
- local procedure ShortcutDimension2CodeOnAfterV()
- begin
- CurrPage.Update();
- end;
-
- local procedure PricesIncludingVATOnAfterValid()
- begin
- CurrPage.SalesLines.Page.ForceTotalsCalculation();
- CurrPage.Update();
- end;
-
- local procedure Prepayment37OnAfterValidate()
- begin
- CurrPage.Update();
- end;
-
- local procedure SetDocNoVisible()
- var
- DocumentNoVisibility: Codeunit DocumentNoVisibility;
- DocType: Option Quote,"Order",Invoice,"Credit Memo","Blanket Order","Return Order",Reminder,FinChMemo;
- begin
- DocNoVisible := DocumentNoVisibility.SalesDocumentNoIsVisible(DocType::Order, Rec."No.");
- end;
-
- local procedure SetExtDocNoMandatoryCondition()
- begin
- SalesSetup.GetRecordOnce();
- ExternalDocNoMandatory := SalesSetup."Ext. Doc. No. Mandatory";
- end;
-
- local procedure ShowPreview()
- var
- SalesPostYesNo: Codeunit "Sales-Post (Yes/No)";
- begin
- SalesPostYesNo.Preview(Rec);
- end;
-
- local procedure ShowPrepmtInvoicePreview()
- var
- SalesPostPrepaymentYesNo: Codeunit "Sales-Post Prepayment (Yes/No)";
- begin
- SalesPostPrepaymentYesNo.Preview(Rec, 2);
- end;
-
- local procedure ShowPrepmtCrMemoPreview()
- var
- SalesPostPrepaymentYesNo: Codeunit "Sales-Post Prepayment (Yes/No)";
- begin
- SalesPostPrepaymentYesNo.Preview(Rec, 3);
- end;
-
- local procedure SetControlVisibility()
- var
- DocumentErrorsMgt: Codeunit "Document Errors Mgt.";
- WorkflowWebhookMgt: Codeunit "Workflow Webhook Management";
- begin
- JobQueueVisible := Rec."Job Queue Status" = Rec."Job Queue Status"::"Scheduled for Posting";
- HasIncomingDocument := Rec."Incoming Document Entry No." <> 0;
- ShowQuoteNo := Rec."Quote No." <> '';
- SetExtDocNoMandatoryCondition();
- SetPostingGroupEditable();
-
- OpenApprovalEntriesExistForCurrUser := ApprovalsMgmt.HasOpenApprovalEntriesForCurrentUser(Rec.RecordId);
- OpenApprovalEntriesExist := ApprovalsMgmt.HasOpenApprovalEntries(Rec.RecordId);
- CanCancelApprovalForRecord := ApprovalsMgmt.CanCancelApprovalForRecord(Rec.RecordId);
-
- WorkflowWebhookMgt.GetCanRequestAndCanCancel(Rec.RecordId, CanRequestApprovalForFlow, CanCancelApprovalForFlow);
- IsCustomerOrContactNotEmpty := (Rec."Sell-to Customer No." <> '') or (Rec."Sell-to Contact No." <> '');
- SalesDocCheckFactboxVisible := DocumentErrorsMgt.BackgroundValidationEnabled();
- ShouldSearchForCustByName := Rec.ShouldSearchForCustomerByName(Rec."Sell-to Customer No.");
- end;
-
- local procedure ShowPostedConfirmationMessage()
- var
- OrderSalesHeader: Record "Sales Header";
- SalesInvoiceHeader: Record "Sales Invoice Header";
- InstructionMgt: Codeunit "Instruction Mgt.";
- ICFeedback: Codeunit "IC Feedback";
- begin
- if not OrderSalesHeader.Get(Rec."Document Type", Rec."No.") then begin
- SalesInvoiceHeader.SetRange("No.", Rec."Last Posting No.");
- if SalesInvoiceHeader.FindFirst() then begin
- ICFeedback.ShowIntercompanyMessage(Rec, Enum::"IC Transaction Document Type"::Order);
- if InstructionMgt.ShowConfirm(StrSubstNo(OpenPostedSalesOrderQst, SalesInvoiceHeader."No."),
- InstructionMgt.ShowPostedConfirmationMessageCode())
- then
- InstructionMgt.ShowPostedDocument(SalesInvoiceHeader, Page::"Sales Order");
- end;
- end;
- end;
-
- ///
- /// Runs a background check for document errors.
- ///
- procedure RunBackgroundCheck()
- begin
- CurrPage.SalesDocCheckFactbox.Page.CheckErrorsInBackground(Rec);
- end;
-
- protected procedure UpdatePaymentService()
- var
- PaymentServiceSetup: Record "Payment Service Setup";
- begin
- PaymentServiceVisible := PaymentServiceSetup.IsPaymentServiceVisible();
- PaymentServiceEnabled := PaymentServiceSetup.CanChangePaymentService(Rec);
- end;
-
- ///
- /// Updates the visibility of ship-to and bill-to address option groups.
- ///
- procedure UpdateShipToBillToGroupVisibility()
- begin
- CustomerMgt.CalculateShipBillToOptions(ShipToOptions, BillToOptions, Rec);
- end;
-
- ///
- /// Sets whether the posting group field should be editable based on customer settings.
- ///
- procedure SetPostingGroupEditable()
- var
- BillToCustomer: Record Customer;
- begin
- if BillToCustomer.Get(Rec."Bill-to Customer No.") then
- IsPostingGroupEditable := BillToCustomer."Allow Multiple Posting Groups";
- end;
-
- ///
- /// Sets a flag to check notifications once on the next update.
- ///
- procedure CheckNotificationsOnce()
- begin
- CallNotificationCheck := true;
- end;
-
- local procedure CheckShowBackgrValidationNotification()
- var
- DocumentErrorsMgt: Codeunit "Document Errors Mgt.";
- begin
- if DocumentErrorsMgt.CheckShowEnableBackgrValidationNotification() then
- SetControlVisibility();
- end;
-
- local procedure ShowReleaseNotification() Result: Boolean
- var
- LocationsQuery: Query "Locations from items Sales";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeShowReleaseNotification(Rec, Result, IsHandled);
- if IsHandled then
- exit;
-
- if Rec.TestStatusIsNotReleased() then begin
- LocationsQuery.SetRange(Document_No, Rec."No.");
- LocationsQuery.SetRange(Require_Pick, true);
- LocationsQuery.Open();
- if LocationsQuery.Read() then
- exit(true);
- LocationsQuery.SetRange(Require_Pick);
- LocationsQuery.SetRange(Require_Shipment, true);
- LocationsQuery.Open();
- exit(LocationsQuery.Read());
- end;
- exit(false);
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateShippingOptions(var SalesHeader: Record "Sales Header"; ShipToOptions: Option "Default (Sell-to Address)","Alternate Shipping Address","Custom Address")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnAfterOnAfterGetRecord(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforePostSalesOrder(var SalesHeader: Record "Sales Header"; PostingCodeunitID: Integer; Navigate: Enum "Navigate After Posting")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowReleaseNotification(var SalesHeader: Record "Sales Header"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShipToOptions(var SalesHeader: Record "Sales Header"; ShipToOptions: Option "Default (Sell-to Address)","Alternate Shipping Address","Custom Address"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnPostOnAfterSetDocumentIsPosted(SalesHeader: Record "Sales Header"; var IsScheduledPosting: Boolean; var DocumentIsPosted: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnPostOnBeforeSalesHeaderInsert(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnAfterGetCurrRecordOnBeforeCheckItemAvailabilityInLines(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnOnAfterGetCurrRecordOnBeforeSalesHeaderCheck(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnValidateShipToOptionsOnAfterShipToAddressListGetRecord(var ShipToAddress: Record "Ship-to Address"; var SalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnPostDocumentBeforeNavigateAfterPosting(var SalesHeader: Record "Sales Header"; var PostingCodeunitID: Integer; var Navigate: Enum "Navigate After Posting"; DocumentIsPosted: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeQueryClosePage(var DocumentIsScheduledForPosting: Boolean; var SalesHeader: Record "Sales Header"; CloseAction: Action; ShowReleaseNotification: Boolean; DocumentIsPosted: Boolean; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnQueryClosePageOnBeforeConfirmCloseUnposted(var DocumentIsPosted: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupBillToName(var Customer: Record Customer; SalesHeader: Record "Sales Header")
- begin
- end;
-}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Sales/Document/SalesQuote.Page.al b/src/Layers/NL/BaseApp/Sales/Document/SalesQuote.Page.al
deleted file mode 100644
index 3dad2ccd45..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Document/SalesQuote.Page.al
+++ /dev/null
@@ -1,2013 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.Bank.Setup;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Outlook;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Attachment;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Inventory.Item;
-using Microsoft.Inventory.Location;
-using Microsoft.Projects.Resources.Resource;
-using Microsoft.Sales.Archive;
-using Microsoft.Sales.Comment;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.Pricing;
-using Microsoft.Utilities;
-using System.Automation;
-using System.Environment;
-using System.Privacy;
-using System.Security.User;
-
-///
-/// Displays and manages a single sales quote document for customer proposals.
-///
-page 41 "Sales Quote"
-{
- Caption = 'Sales Quote';
- PageType = Document;
- RefreshOnActivate = true;
- SourceTable = "Sales Header";
- SourceTableView = where("Document Type" = filter(Quote));
-
- AboutTitle = 'About sales quote details';
- AboutText = 'You can update, send, and resend a quote as needed. If the quote is accepted, the details will transfer to the sales order or invoice you create from it.';
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field("No."; Rec."No.")
- {
- ApplicationArea = All;
- Importance = Standard;
- ToolTip = 'Specifies the number of the involved entry or record, according to the specified number series.';
- Visible = DocNoVisible;
-
- trigger OnAssistEdit()
- begin
- if Rec.AssistEdit(xRec) then
- CurrPage.Update();
- end;
- }
- field("Sell-to Customer No."; Rec."Sell-to Customer No.")
- {
- ApplicationArea = All;
- Caption = 'Customer No.';
- Importance = Additional;
- NotBlank = true;
- ToolTip = 'Specifies the number of the customer who will receive the products and be billed by default.';
-
- AboutTitle = 'Who is the quote for?';
- AboutText = 'You can choose existing customers, or add new customers when you create quotes. Quotes can automatically choose special prices and discounts that you have set for each customer.';
-
- trigger OnValidate()
- begin
- Rec.SelltoCustomerNoOnAfterValidate(Rec, xRec);
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- CurrPage.Update();
- end;
- }
- field("Sell-to Customer Name"; Rec."Sell-to Customer Name")
- {
- ApplicationArea = All;
- Caption = 'Customer Name';
- Importance = Promoted;
- ShowMandatory = true;
- ToolTip = 'Specifies the name of the customer who will receive the products and be billed by default.';
-
- trigger OnAfterLookup(Selected: RecordRef)
- var
- Customer: Record Customer;
- begin
- Selected.SetTable(Customer);
- if Rec."Sell-to Customer No." <> Customer."No." then begin
- Rec.Validate("Sell-to Customer No.", Customer."No.");
- if Rec."Sell-to Customer No." <> Customer."No." then
- error('');
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- CurrPage.Update();
- end;
- end;
-
- trigger OnValidate()
- begin
- Rec.SelltoCustomerNoOnAfterValidate(Rec, xRec);
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- CurrPage.Update();
- end;
- }
- field("Sell-to Customer Name 2"; Rec."Sell-to Customer Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name 2';
- QuickEntry = false;
- Visible = false;
- }
- field("External Document No."; Rec."External Document No.")
- {
- ApplicationArea = Basic, Suite;
- }
- group("Sell-to")
- {
- Caption = 'Sell-to';
- field("Sell-to Address"; Rec."Sell-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Importance = Additional;
- QuickEntry = false;
- }
- field("Sell-to Address 2"; Rec."Sell-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Importance = Additional;
- QuickEntry = false;
- }
- field("Sell-to City"; Rec."Sell-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Importance = Additional;
- QuickEntry = false;
- }
- group(Control105)
- {
- ShowCaption = false;
- Visible = IsSellToCountyVisible;
- field("Sell-to County"; Rec."Sell-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Sell-to Country/Region Code";
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the county of the address.';
- }
- }
- field("Sell-to Post Code"; Rec."Sell-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the postal code.';
- }
- field("Sell-to Country/Region Code"; Rec."Sell-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the country or region of the address.';
-
- trigger OnValidate()
- begin
- IsSellToCountyVisible := FormatAddress.UseCounty(Rec."Sell-to Country/Region Code");
- end;
- }
- field("Sell-to Contact No."; Rec."Sell-to Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact No.';
- Importance = Additional;
-
- trigger OnLookup(var Text: Text): Boolean
- begin
- if not Rec.SelltoContactLookup() then
- exit(false);
- Text := Rec."Sell-to Contact No.";
- CurrPage.Update();
- exit(true);
- end;
-
- trigger OnValidate()
- begin
- ClearSellToFilter();
- ActivateFields();
- CurrPage.Update();
- end;
- }
- field(SellToPhoneNo; SellToContact."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the contact person that the sales document will be sent to.';
- }
- field(SellToMobilePhoneNo; SellToContact."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mobile Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the contact person that the sales document will be sent to.';
- }
- field(SellToEmail; SellToContact."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the email address of the contact person that the sales document will be sent to.';
- }
- }
- field("Sell-to Contact"; Rec."Sell-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = Rec."Sell-to Customer No." <> '';
- ToolTip = 'Specifies the name of the person to contact at the customer.';
-
- trigger OnLookup(var Text: Text): Boolean
- var
- Contact: Record Contact;
- begin
- Contact.FilterGroup(2);
- Rec.LookupContact(Rec."Sell-to Customer No.", Rec."Sell-to Contact No.", Contact);
- if PAGE.RunModal(0, Contact) = ACTION::LookupOK then
- Rec.Validate("Sell-to Contact No.", Contact."No.");
-
- if ShipToOptions = ShipToOptions::"Default (Sell-to Address)" then
- Rec.Validate("Ship-to Contact", Rec."Sell-to Contact");
- Contact.FilterGroup(0);
-
- Text := Rec."Sell-to Contact";
- CurrPage.Update();
- end;
- }
- field("Sell-to Customer Templ. Code"; Rec."Sell-to Customer Templ. Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer Template Code';
- Enabled = EnableNewSellToCustomerTemplateCode;
- Importance = Additional;
-
- trigger OnValidate()
- begin
- ActivateFields();
- CurrPage.Update();
- end;
- }
- field("No. of Archived Versions"; Rec."No. of Archived Versions")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
-
- trigger OnDrillDown()
- begin
- CurrPage.SaveRecord();
- Commit();
- SalesHeaderArchive.SetRange("Document Type", Rec."Document Type"::Quote);
- SalesHeaderArchive.SetRange("No.", Rec."No.");
- SalesHeaderArchive.SetRange("Doc. No. Occurrence", Rec."Doc. No. Occurrence");
- if SalesHeaderArchive.Get(Rec."Document Type"::Quote, Rec."No.", Rec."Doc. No. Occurrence", Rec."No. of Archived Versions") then;
- PAGE.RunModal(PAGE::"Sales List Archive", SalesHeaderArchive);
- CurrPage.Update(false);
- end;
- }
- field("Order Date"; Rec."Order Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the date when the related order was created.';
- }
- field("Document Date"; Rec."Document Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Quote Valid Until Date"; Rec."Quote Valid Until Date")
- {
- ApplicationArea = Suite;
- }
- field("Quote Accepted"; Rec."Quote Accepted")
- {
- ApplicationArea = Suite;
- }
- field("Quote Accepted Date"; Rec."Quote Accepted Date")
- {
- ApplicationArea = Suite;
- }
- field("Due Date"; Rec."Due Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- ToolTip = 'Specifies when the related sales invoice must be paid.';
- }
- field("Requested Delivery Date"; Rec."Requested Delivery Date")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Your Reference"; Rec."Your Reference")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- field("Salesperson Code"; Rec."Salesperson Code")
- {
- ApplicationArea = Suite;
- Importance = Additional;
-
- trigger OnValidate()
- begin
- CurrPage.SalesLines.PAGE.UpdateForm(true)
- end;
- }
- field("Campaign No."; Rec."Campaign No.")
- {
- ApplicationArea = RelationshipMgmt;
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the number of the campaign that the document is linked to.';
- trigger OnValidate()
- begin
- if Rec."Campaign No." <> xRec."Campaign No." then
- CurrPage.Update();
- end;
- }
- field("Opportunity No."; Rec."Opportunity No.")
- {
- ApplicationArea = RelationshipMgmt;
- Importance = Additional;
- QuickEntry = false;
- }
- field("Responsibility Center"; Rec."Responsibility Center")
- {
- AccessByPermission = TableData "Responsibility Center" = R;
- ApplicationArea = Suite;
- Importance = Additional;
- }
- field("Assigned User ID"; Rec."Assigned User ID")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field(Status; Rec.Status)
- {
- ApplicationArea = Suite;
- Importance = Promoted;
- StyleExpr = StatusStyleTxt;
-
- AboutTitle = 'Check the quote status';
- AboutText = 'While preparing a quote it''s status is *Open*. When it''s ready, you can change the status to *Released* to reserve the items or services you''re selling. To change a released quote you''ll need to reopen it.';
- }
- group("Work Description")
- {
- Caption = 'Work Description';
- field(WorkDescription; WorkDescription)
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- MultiLine = true;
- ShowCaption = false;
- ToolTip = 'Specifies the products or service being offered';
-
- trigger OnValidate()
- begin
- Rec.SetWorkDescription(WorkDescription);
- end;
- }
- }
- }
- part(SalesLines; "Sales Quote Subform")
- {
- ApplicationArea = Basic, Suite;
- Editable = IsSalesLinesEditable;
- Enabled = IsSalesLinesEditable;
- SubPageLink = "Document No." = field("No.");
- UpdatePropagation = Both;
- }
- group("Invoice Details")
- {
- Caption = 'Invoice Details';
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- Importance = Promoted;
-
- trigger OnAssistEdit()
- begin
- Clear(ChangeExchangeRate);
- ChangeExchangeRate.SetParameter(Rec."Currency Code", Rec."Currency Factor", WorkDate());
- if ChangeExchangeRate.RunModal() = ACTION::OK then begin
- Rec.Validate("Currency Factor", ChangeExchangeRate.GetParameter());
- SaveInvoiceDiscountAmount();
- end;
- Clear(ChangeExchangeRate);
- end;
-
- trigger OnValidate()
- begin
- CurrPage.Update();
- end;
- }
- field("Company Bank Account Code"; Rec."Company Bank Account Code")
- {
- ApplicationArea = Suite;
- Importance = Promoted;
- }
- field("Prices Including VAT"; Rec."Prices Including VAT")
- {
- ApplicationArea = VAT;
-
- trigger OnValidate()
- begin
- CurrPage.SalesLines.Page.ForceTotalsCalculation();
- CurrPage.Update();
- end;
- }
- field("VAT Bus. Posting Group"; Rec."VAT Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
-
- trigger OnValidate()
- begin
- CurrPage.Update();
- end;
- }
- field("Payment Terms Code"; Rec."Payment Terms Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the transaction mode used in telebanking.';
- }
- field("Bank Account Code"; Rec."Bank Account Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the customer''s bank account that is used for payments and collections through telebanking.';
- }
- field("Payment Method Code"; Rec."Payment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = IsPaymentMethodCodeVisible;
- }
- field("Tax Liable"; Rec."Tax Liable")
- {
- ApplicationArea = SalesTax;
- }
- field("Tax Area Code"; Rec."Tax Area Code")
- {
- ApplicationArea = SalesTax;
-
- trigger OnValidate()
- var
- SalesHeader: Record "Sales Header";
- begin
- if SalesHeader.Get(Rec."Document Type", Rec."No.") then
- CurrPage.SalesLines.PAGE.RedistributeTotalsOnAfterValidate();
- end;
- }
- group(Control47)
- {
- ShowCaption = false;
- Visible = PaymentServiceVisible;
- field(SelectedPayments; Rec.GetSelectedPaymentServicesText())
- {
- ApplicationArea = All;
- Caption = 'Payment Service';
- Editable = false;
- Enabled = PaymentServiceEnabled;
- MultiLine = true;
- ToolTip = 'Specifies the online payment service, such as PayPal, that customers can use to pay the sales document.';
-
- trigger OnAssistEdit()
- begin
- Rec.ChangePaymentServiceSetting();
- end;
- }
- }
- field("Transaction Type"; Rec."Transaction Type")
- {
- ApplicationArea = BasicEU, BasicNO;
- }
- field("Shortcut Dimension 1 Code"; Rec."Shortcut Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
-
- trigger OnValidate()
- begin
- CurrPage.Update();
- end;
- }
- field("Shortcut Dimension 2 Code"; Rec."Shortcut Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
-
- trigger OnValidate()
- begin
- CurrPage.Update();
- end;
- }
- field("Payment Discount %"; Rec."Payment Discount %")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Pmt. Discount Date"; Rec."Pmt. Discount Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("Journal Templ. Name"; Rec."Journal Templ. Name")
- {
- ApplicationArea = Basic, Suite;
- Visible = IsJournalTemplNameVisible;
- }
- field("Location Code"; Rec."Location Code")
- {
- ApplicationArea = Location;
- Importance = Additional;
- }
- }
- group("Shipping and Billing")
- {
- Caption = 'Shipping and Billing';
- group(Control60)
- {
- ShowCaption = false;
- group(Control53)
- {
- ShowCaption = false;
- field(ShippingOptions; ShipToOptions)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Ship-to';
- ToolTip = 'Specifies the address that the products on the sales document are shipped to. Default (Sell-to Address): The same as the customer''s sell-to address. Alternate Ship-to Address: One of the customer''s alternate ship-to addresses. Custom Address: Any ship-to address that you specify in the fields below.';
-
- trigger OnValidate()
- var
- ShipToAddress: Record "Ship-to Address";
- ShipToAddressList: Page "Ship-to Address List";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateShipToOptions(Rec, ShipToOptions.AsInteger(), IsHandled);
- if IsHandled then
- exit;
-
- case ShipToOptions of
- ShipToOptions::"Default (Sell-to Address)":
- begin
- Rec.Validate("Ship-to Code", '');
- Rec.CopySellToAddressToShipToAddress();
- end;
- ShipToOptions::"Alternate Shipping Address":
- begin
- ShipToAddress.SetRange("Customer No.", Rec."Sell-to Customer No.");
- ShipToAddressList.LookupMode := true;
- ShipToAddressList.SetTableView(ShipToAddress);
-
- if ShipToAddressList.RunModal() = ACTION::LookupOK then begin
- ShipToAddressList.GetRecord(ShipToAddress);
- Rec.Validate("Ship-to Code", ShipToAddress.Code);
- IsShipToCountyVisible := FormatAddress.UseCounty(ShipToAddress."Country/Region Code");
- end else
- ShipToOptions := ShipToOptions::"Custom Address";
- end;
- ShipToOptions::"Custom Address":
- begin
- Rec.Validate("Ship-to Code", '');
- IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
- end;
- end;
-
- OnAfterValidateShipToOptions(Rec, ShipToOptions.AsInteger());
- end;
- }
- group(Control72)
- {
- ShowCaption = false;
- Visible = not (ShipToOptions = ShipToOptions::"Default (Sell-to Address)");
- field("Ship-to Code"; Rec."Ship-to Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Code';
- Editable = ShipToOptions = ShipToOptions::"Alternate Shipping Address";
- Importance = Promoted;
- ToolTip = 'Specifies the code for another shipment address than the customer''s own address, which is entered by default.';
-
- trigger OnValidate()
- var
- ShipToAddress: Record "Ship-to Address";
- begin
- if (xRec."Ship-to Code" <> '') and (Rec."Ship-to Code" = '') then
- Error(EmptyShipToCodeErr);
- if Rec."Ship-to Code" <> '' then begin
- ShipToAddress.Get(Rec."Sell-to Customer No.", Rec."Ship-to Code");
- IsShipToCountyVisible := FormatAddress.UseCounty(ShipToAddress."Country/Region Code");
- end else
- IsShipToCountyVisible := false;
- end;
- }
- field("Ship-to Name"; Rec."Ship-to Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- ToolTip = 'Specifies the name that products on the sales document will be shipped to.';
- }
- field("Ship-to Name 2"; Rec."Ship-to Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name 2';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- Importance = Additional;
- QuickEntry = false;
- Visible = false;
- }
- field("Ship-to Address"; Rec."Ship-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- QuickEntry = false;
- ToolTip = 'Specifies the address that products on the sales document will be shipped to. By default, the field is filled with the value in the Address field on the customer card or with the value in the Address field in the Ship-to Address window.';
- }
- field("Ship-to Address 2"; Rec."Ship-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- QuickEntry = false;
- }
- field("Ship-to City"; Rec."Ship-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- QuickEntry = false;
- }
- group(Control107)
- {
- ShowCaption = false;
- Visible = IsShipToCountyVisible;
- field("Ship-to County"; Rec."Ship-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Ship-to Country/Region Code";
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- QuickEntry = false;
- ToolTip = 'Specifies the county of the address.';
- }
- }
- field("Ship-to Post Code"; Rec."Ship-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- QuickEntry = false;
- ToolTip = 'Specifies the postal code.';
- }
- field("Ship-to Country/Region Code"; Rec."Ship-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Editable = ShipToOptions = ShipToOptions::"Custom Address";
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the customer''s country/region.';
-
- trigger OnValidate()
- begin
- IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
- end;
- }
- }
- field("Ship-to Phone No."; Rec."Ship-to Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- }
- field("Ship-to Contact"; Rec."Ship-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- ToolTip = 'Specifies the name of the contact person at the address that products on the sales document will be shipped to.';
- }
- field("Shipment Date"; Rec."Shipment Date")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- }
- group("Shipment Method")
- {
- Caption = 'Shipment Method';
- field("Shipment Method Code"; Rec."Shipment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Code';
- Importance = Additional;
- ToolTip = 'Specifies how items on the sales document are shipped to the customer.';
- }
- field("Shipping Agent Code"; Rec."Shipping Agent Code")
- {
- ApplicationArea = Suite;
- Caption = 'Agent';
- Importance = Additional;
- ToolTip = 'Specifies which shipping agent is used to transport the items on the sales document to the customer.';
- }
- field("Shipping Agent Service Code"; Rec."Shipping Agent Service Code")
- {
- ApplicationArea = Suite;
- Caption = 'Agent service';
- Importance = Additional;
- ToolTip = 'Specifies which shipping agent service is used to transport the items on the sales document to the customer.';
- }
- field("Package Tracking No."; Rec."Package Tracking No.")
- {
- ApplicationArea = Suite;
- Importance = Additional;
- }
- }
- }
- group(Control49)
- {
- Enabled = not EnableSellToCustomerTemplateCode;
- ShowCaption = false;
- field(BillToOptions; BillToOptions)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Bill-to';
- ToolTip = 'Specifies the customer that the sales invoice will be sent to. Default (Customer): The same as the customer on the sales invoice. Another Customer: Any customer that you specify in the fields below.';
-
- trigger OnValidate()
- begin
- if BillToOptions = BillToOptions::"Default (Customer)" then begin
- Rec.Validate("Bill-to Customer No.", Rec."Sell-to Customer No.");
- Rec.RecallModifyAddressNotification(Rec.GetModifyBillToCustomerAddressNotificationId());
- end;
-
- Rec.CopySellToAddressToBillToAddress();
- end;
- }
- group(Control41)
- {
- ShowCaption = false;
- Visible = not (BillToOptions = BillToOptions::"Default (Customer)");
-
- field("Bill-to Name"; Rec."Bill-to Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name';
- Editable = BillToOptions = BillToOptions::"Another Customer";
- Enabled = EnableBillToCustomerNo;
- Importance = Promoted;
- ToolTip = 'Specifies the customer to whom you will send the sales invoice, when different from the customer that you are selling to.';
-
- trigger OnValidate()
- begin
- if Rec.GetFilter("Bill-to Customer No.") = xRec."Bill-to Customer No." then
- if Rec."Bill-to Customer No." <> xRec."Bill-to Customer No." then
- Rec.SetRange("Bill-to Customer No.");
-
- CurrPage.Update();
- end;
-
- trigger OnLookup(var Text: Text): Boolean
- var
- Customer: Record Customer;
- begin
- OnBeforeLookupBillToName(Customer, Rec);
- if Customer.SelectCustomer(Customer) then begin
- xRec := Rec;
- Rec."Bill-to Name" := Customer.Name;
- Rec.Validate("Bill-to Customer No.", Customer."No.");
- end;
-
- if Rec.GetFilter("Bill-to Customer No.") = xRec."Bill-to Customer No." then
- if Rec."Bill-to Customer No." <> xRec."Bill-to Customer No." then
- Rec.SetRange("Bill-to Customer No.");
-
- CurrPage.Update();
- end;
- }
- field("Bill-to Name 2"; Rec."Bill-to Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name 2';
- Editable = BillToOptions = BillToOptions::"Another Customer";
- Enabled = BillToOptions = BillToOptions::"Another Customer";
- Importance = Additional;
- QuickEntry = false;
- Visible = false;
- }
- field("Bill-to Address"; Rec."Bill-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- QuickEntry = false;
- }
- field("Bill-to Address 2"; Rec."Bill-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- QuickEntry = false;
- }
- field("Bill-to City"; Rec."Bill-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- QuickEntry = false;
- }
- group(Control109)
- {
- ShowCaption = false;
- Visible = IsBillToCountyVisible;
- field("Bill-to County"; Rec."Bill-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Bill-to Country/Region Code";
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the county of the address.';
- }
- }
- field("Bill-to Post Code"; Rec."Bill-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- QuickEntry = false;
- ToolTip = 'Specifies the postal code.';
- }
- field("Bill-to Country/Region Code"; Rec."Bill-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- QuickEntry = false;
- ToolTip = 'Specifies the customer''s country/region.';
-
- trigger OnValidate()
- begin
- IsBillToCountyVisible := FormatAddress.UseCounty(Rec."Bill-to Country/Region Code");
- end;
- }
- field("Bill-to Contact No."; Rec."Bill-to Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact No.';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Importance = Additional;
- }
- field("Bill-to Contact"; Rec."Bill-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- Enabled = (BillToOptions = BillToOptions::"Custom Address") or (Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.");
- ToolTip = 'Specifies the name of the person you should contact at the customer who you are sending the invoice to.';
- }
- field(BillToContactPhoneNo; BillToContact."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the person you should contact at the customer you are sending the invoice to.';
- }
- field(BillToContactMobilePhoneNo; BillToContact."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mobile Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the person you should contact at the customer you are sending the invoice to.';
- }
- field(BillToContactEmail; BillToContact."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the email address of the person you should contact at the customer you are sending the invoice to.';
- }
- }
- }
- }
- group("Foreign Trade")
- {
- Caption = 'Foreign Trade';
- field("EU 3-Party Trade"; Rec."EU 3-Party Trade")
- {
- ApplicationArea = BasicEU, BasicNO;
- }
- field("Transaction Specification"; Rec."Transaction Specification")
- {
- ApplicationArea = BasicEU, BasicNO;
- }
- field("Transport Method"; Rec."Transport Method")
- {
- ApplicationArea = BasicEU, BasicNO;
- }
- field("Exit Point"; Rec."Exit Point")
- {
- ApplicationArea = BasicEU, BasicNO;
- }
- field("Area"; Rec.Area)
- {
- ApplicationArea = BasicEU, BasicNO;
- }
- field("Language Code"; Rec."Language Code")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Format Region"; Rec."Format Region")
- {
- 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(IncomingDocAttachFactBox; "Incoming Doc. Attach. FactBox")
- {
- ApplicationArea = Basic, Suite;
- ShowFilter = false;
- Visible = false;
- }
- part(Control11; "Pending Approval FactBox")
- {
- ApplicationArea = All;
- SubPageLink = "Table ID" = const(36),
- "Document Type" = field("Document Type"),
- "Document No." = field("No."),
- Status = const(Open);
- Visible = OpenApprovalEntriesExistForCurrUser;
- }
- part(Control1903720907; "Sales Hist. Sell-to FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("Sell-to Customer No."),
- "Date Filter" = field("Date Filter");
- }
- part(Control1907234507; "Sales Hist. Bill-to FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("Bill-to Customer No."),
- "Date Filter" = field("Date Filter");
- Visible = false;
- }
- part(Control1902018507; "Customer Statistics FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("Bill-to Customer No."),
- "Date Filter" = field("Date Filter");
- Visible = false;
- }
- part(Control1900316107; "Customer Details FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("Sell-to Customer No."),
- "Date Filter" = field("Date Filter");
- Visible = false;
- }
- part(Control1906127307; "Sales Line FactBox")
- {
- ApplicationArea = Suite;
- Provider = SalesLines;
- SubPageLink = "Document Type" = field("Document Type"),
- "Document No." = field("Document No."),
- "Line No." = field("Line No.");
- }
- part(Control1901314507; "Item Invoicing FactBox")
- {
- ApplicationArea = Basic, Suite;
- Provider = SalesLines;
- SubPageLink = "No." = field("No.");
- Visible = false;
- }
- part(ApprovalFactBox; "Approval FactBox")
- {
- ApplicationArea = Suite;
- Visible = false;
- }
- part(Control1907012907; "Resource Details FactBox")
- {
- ApplicationArea = Basic, Suite;
- Provider = SalesLines;
- SubPageLink = "No." = field("No.");
- Visible = false;
- }
- part(WorkflowStatus; "Workflow Status FactBox")
- {
- ApplicationArea = All;
- Editable = false;
- Enabled = false;
- ShowFilter = false;
- Visible = ShowWorkflowStatus;
- }
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("&Quote")
- {
- Caption = '&Quote';
- Image = Quote;
- 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(Dimensions)
- {
- AccessByPermission = TableData Dimension = R;
- ApplicationArea = Dimensions;
- Caption = 'Dimensions';
- Enabled = Rec."No." <> '';
- 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();
- CurrPage.SaveRecord();
- end;
- }
- }
- group("&View")
- {
- Caption = '&View';
- action(Customer)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer';
- Enabled = IsCustomerOrContactNotEmpty;
- Image = Customer;
- RunObject = Page "Customer Card";
- RunPageLink = "No." = field("Sell-to Customer No."),
- "Date Filter" = field("Date Filter");
- ShortCutKey = 'Shift+F7';
- ToolTip = 'View or edit detailed information about the customer on the sales document.';
- }
- action("C&ontact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'C&ontact';
- Image = Card;
- RunObject = Page "Contact Card";
- RunPageLink = "No." = field("Sell-to Contact No.");
- ToolTip = 'View or edit detailed information about the contact person at the customer.';
- }
- }
- group(History)
- {
- Caption = 'History';
- action(PageInteractionLogEntries)
- {
- ApplicationArea = Suite;
- Caption = 'Interaction Log E&ntries';
- Image = InteractionLog;
- //The property 'PromotedCategory' can only be set if the property 'Promoted' is set to 'true'
- //PromotedCategory = Category8;
- ShortCutKey = 'Ctrl+F7';
- ToolTip = 'View a list of interaction log entries related to this document.';
-
- trigger OnAction()
- begin
- Rec.ShowInteractionLogEntries();
- end;
- }
- }
- }
- area(processing)
- {
- group(Action59)
- {
- Caption = '&Quote';
- Image = Quote;
- 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';
- Enabled = IsCustomerOrContactNotEmpty;
- 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(Print)
- {
- ApplicationArea = Basic, Suite;
- Caption = '&Print';
- Ellipsis = true;
- Enabled = IsCustomerOrContactNotEmpty;
- 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.';
- Visible = not IsOfficeAddin;
-
- trigger OnAction()
- begin
- CheckSalesCheckAllLinesHaveQuantityAssigned();
- DocPrint.PrintSalesHeader(Rec);
- end;
- }
- action(Email)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Send by &Email';
- Enabled = IsCustomerOrContactNotEmpty;
- Image = Email;
- ToolTip = 'Prepare to mail the document. The Send Email window opens prefilled with the customer''s email address so you can add or edit information.';
-
- trigger OnAction()
- begin
- CheckSalesCheckAllLinesHaveQuantityAssigned();
- if not Rec.Find() then
- Rec.Insert(true);
- DocPrint.EmailSalesHeader(Rec);
- end;
- }
- action(AttachAsPDF)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Attach as PDF';
- Enabled = IsCustomerOrContactNotEmpty;
- Image = PrintAttachment;
- ToolTip = 'Create a PDF file and attach it to the document.';
-
- trigger OnAction()
- var
- SalesHeader: Record "Sales Header";
- begin
- SalesHeader := Rec;
- SalesHeader.SetRecFilter();
- DocPrint.PrintSalesHeaderToDocumentAttachment(SalesHeader);
- end;
- }
- action(GetRecurringSalesLines)
- {
- ApplicationArea = Suite;
- Caption = 'Get Recurring Sales Lines';
- Ellipsis = true;
- Enabled = IsSellToCustomerNotEmpty;
- Image = CustomerCode;
- ToolTip = 'Get standard sales lines that are available to assign to customers.';
-
- trigger OnAction()
- var
- StdCustSalesCode: Record "Standard Customer Sales Code";
- begin
- StdCustSalesCode.InsertSalesLines(Rec);
- end;
- }
- action(CopyDocument)
- {
- ApplicationArea = Suite;
- Caption = 'Copy Document';
- Ellipsis = true;
- Enabled = Rec."No." <> '';
- Image = CopyDocument;
- ToolTip = 'Copy document lines and header information from another sales document to this document. You can copy a posted sales invoice into a new sales invoice to quickly create a similar document.';
-
- trigger OnAction()
- begin
- if not Rec.Find() then begin
- Rec.Insert(true);
- Commit();
- end;
- Rec.CopyDocument();
- if Rec.Get(Rec."Document Type", Rec."No.") then;
- CurrPage.SalesLines.Page.ForceTotalsCalculation();
- CurrPage.Update();
- 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(Approval)
- {
- Caption = 'Approval';
- action(Approve)
- {
- ApplicationArea = All;
- Caption = 'Approve';
- Image = Approve;
- ToolTip = 'Approve the requested changes.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.ApproveRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Reject)
- {
- ApplicationArea = All;
- Caption = 'Reject';
- Image = Reject;
- ToolTip = 'Reject the approval request.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.RejectRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Delegate)
- {
- ApplicationArea = All;
- Caption = 'Delegate';
- Image = Delegate;
- ToolTip = 'Delegate the approval to a substitute approver.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.DelegateRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Comment)
- {
- ApplicationArea = All;
- Caption = 'Comments';
- Image = ViewComments;
- ToolTip = 'View or add comments for the record.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.GetApprovalComment(Rec);
- end;
- }
- }
- group(Create)
- {
- Caption = 'Create';
- Image = NewCustomer;
- action(MakeOrder)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Make &Order';
- Enabled = IsCustomerOrContactNotEmpty;
- Image = MakeOrder;
- ToolTip = 'Convert the sales quote to a sales order.';
-
- AboutTitle = 'When a quote gets accepted';
- AboutText = 'When your customer is ready to buy, you can turn quotes into orders. Or, unless you need partial shipments, skip the order and create an invoice instead.';
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- if ApprovalsMgmt.PrePostApprovalCheckSales(Rec) then
- CODEUNIT.Run(CODEUNIT::"Sales-Quote to Order (Yes/No)", Rec);
- end;
- }
- action(MakeInvoice)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Make Invoice';
- Enabled = IsCustomerOrContactNotEmpty;
- Image = MakeOrder;
- ToolTip = 'Convert the sales quote to a sales invoice.';
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- if ApprovalsMgmt.PrePostApprovalCheckSales(Rec) then begin
- CheckSalesCheckAllLinesHaveQuantityAssigned();
- CODEUNIT.Run(CODEUNIT::"Sales-Quote to Invoice Yes/No", Rec);
- end;
- end;
- }
- action("C&reate Customer")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'C&reate Customer';
- Image = NewCustomer;
- ToolTip = 'Create a new customer card for the contact.';
-
- trigger OnAction()
- begin
- if Rec.CheckCustomerCreated(false) then
- CurrPage.Update(true);
- end;
- }
- action("Create &Task")
- {
- AccessByPermission = TableData Contact = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Create &Task';
- Image = NewToDo;
- ToolTip = 'Create a new marketing task for the contact.';
-
- trigger OnAction()
- begin
- Rec.CreateTask();
- end;
- }
- }
- group(Action3)
- {
- Caption = 'Release';
- Image = ReleaseDoc;
- action(Release)
- {
- ApplicationArea = Suite;
- Caption = 'Re&lease';
- Enabled = Rec.Status <> Rec.Status::Released;
- 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
- ReleaseSalesDoc: Codeunit "Release Sales Document";
- begin
- ReleaseSalesDoc.PerformManualRelease(Rec);
- CurrPage.SalesLines.PAGE.ClearTotalSalesHeader();
- end;
- }
- action(Reopen)
- {
- ApplicationArea = Suite;
- Caption = 'Re&open';
- Enabled = Rec.Status <> Rec.Status::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
- ReleaseSalesDoc: Codeunit "Release Sales Document";
- begin
- ReleaseSalesDoc.PerformManualReopen(Rec);
- CurrPage.SalesLines.PAGE.ClearTotalSalesHeader();
- end;
- }
- }
- group("Request Approval")
- {
- Caption = 'Request Approval';
- Image = Approval;
- 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.";
- WorkflowWebhookMgt: Codeunit "Workflow Webhook Management";
- begin
- ApprovalsMgmt.OnCancelSalesApprovalRequest(Rec);
- WorkflowWebhookMgt.FindAndCancel(Rec.RecordId);
- end;
- }
- group(Flow)
- {
- Caption = 'Power Automate';
- Image = Flow;
-
- customaction(CreateFlowFromTemplate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create approval flow';
- ToolTip = 'Create a new flow in Power Automate from a list of relevant flow templates.';
- Visible = IsSaaS and IsPowerAutomatePrivacyNoticeApproved;
- CustomActionType = FlowTemplateGallery;
- FlowTemplateCategoryName = 'd365bc_approval_salesQuote';
- }
- }
- }
- group("F&unctions")
- {
- Caption = 'F&unctions';
- Image = "Action";
- action(CalculateInvoiceDiscount)
- {
- AccessByPermission = TableData "Cust. Invoice Disc." = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Calculate &Invoice Discount';
- Enabled = IsCustomerOrContactNotEmpty;
- Image = CalculateInvoiceDiscount;
- ToolTip = 'Calculate the invoice discount that applies to the sales quote.';
-
- trigger OnAction()
- begin
- ApproveCalcInvDisc();
- SalesCalcDiscByType.ResetRecalculateInvoiceDisc(Rec);
- end;
- }
- separator(Action139)
- {
- }
- action("Archive Document")
- {
- ApplicationArea = Suite;
- Caption = 'Archi&ve Document';
- Image = Archive;
- ToolTip = 'Send the document to the archive, for example because it is too soon to delete it. Later, you delete or reprocess the archived document.';
-
- trigger OnAction()
- begin
- ArchiveManagement.ArchiveSalesDocument(Rec);
- CurrPage.Update(false);
- end;
- }
- group(IncomingDocument)
- {
- Caption = 'Incoming Document';
- Image = Documents;
- action(IncomingDocCard)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'View Incoming Document';
- Enabled = HasIncomingDocument;
- Image = ViewOrder;
- ToolTip = 'View any incoming document records and file attachments that exist for the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.ShowCardFromEntryNo(Rec."Incoming Document Entry No.");
- end;
- }
- action(SelectIncomingDoc)
- {
- AccessByPermission = TableData "Incoming Document" = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Select Incoming Document';
- Image = SelectLineToApply;
- ToolTip = 'Select an incoming document record and file attachment that you want to link to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- Rec.Validate("Incoming Document Entry No.", IncomingDocument.SelectIncomingDocument(Rec."Incoming Document Entry No.", Rec.RecordId));
- end;
- }
- action(IncomingDocAttachFile)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Incoming Document from File';
- Ellipsis = true;
- Enabled = not HasIncomingDocument;
- Image = Attach;
- ToolTip = 'Create an incoming document record by selecting a file to attach, and then link the incoming document record to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocumentAttachment: Record "Incoming Document Attachment";
- begin
- IncomingDocumentAttachment.NewAttachmentFromSalesDocument(Rec);
- end;
- }
- action(RemoveIncomingDoc)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Remove Incoming Document';
- Enabled = HasIncomingDocument;
- Image = RemoveLine;
- ToolTip = 'Remove any incoming document records and file attachments.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- if IncomingDocument.Get(Rec."Incoming Document Entry No.") then
- IncomingDocument.RemoveLinkToRelatedRecord();
- Rec."Incoming Document Entry No." := 0;
- Rec.Modify(true);
- end;
- }
- }
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- actionref(MakeOrder_Promoted; MakeOrder)
- {
- }
- actionref(MakeInvoice_Promoted; MakeInvoice)
- {
- }
- group(Category_Category10)
- {
- Caption = 'Release', Comment = 'Generated from the PromotedActionCategories property index 9.';
- ShowAs = SplitButton;
-
- actionref(Release_Promoted; Release)
- {
- }
- actionref(Reopen_Promoted; Reopen)
- {
- }
- }
- actionref("Archive Document_Promoted"; "Archive Document")
- {
- }
- }
- group(Category_Prepare)
- {
- Caption = 'Prepare';
-
- actionref(CopyDocument_Promoted; CopyDocument)
- {
- }
- actionref(GetRecurringSalesLines_Promoted; GetRecurringSalesLines)
- {
- }
- actionref(CalculateInvoiceDiscount_Promoted; CalculateInvoiceDiscount)
- {
- }
- group("Category_Incoming Document")
- {
- Caption = 'Incoming Document';
-
- actionref(IncomingDocAttachFile_Promoted; IncomingDocAttachFile)
- {
- }
- actionref(IncomingDocCard_Promoted; IncomingDocCard)
- {
- }
- actionref(SelectIncomingDoc_Promoted; SelectIncomingDoc)
- {
- }
- actionref(RemoveIncomingDoc_Promoted; RemoveIncomingDoc)
- {
- }
- }
- }
- group(Category_Category6)
- {
- Caption = 'Approve', Comment = 'Generated from the PromotedActionCategories property index 5.';
-
- actionref(Approve_Promoted; Approve)
- {
- }
- actionref(Reject_Promoted; Reject)
- {
- }
- actionref(Comment_Promoted; Comment)
- {
- }
- actionref(Delegate_Promoted; Delegate)
- {
- }
- }
- group(Category_Category9)
- {
- Caption = 'Print/Send', Comment = 'Generated from the PromotedActionCategories property index 8.';
-
- actionref(Email_Promoted; Email)
- {
- }
- actionref(Print_Promoted; Print)
- {
- }
- actionref(AttachAsPDF_Promoted; AttachAsPDF)
- {
- }
- }
- group(Category_Category7)
- {
- Caption = 'Request Approval', Comment = 'Generated from the PromotedActionCategories property index 6.';
-
- actionref(SendApprovalRequest_Promoted; SendApprovalRequest)
- {
- }
- actionref(CancelApprovalRequest_Promoted; CancelApprovalRequest)
- {
- }
- }
- group(Category_Category4)
- {
- Caption = 'Quote', Comment = 'Generated from the PromotedActionCategories property index 3.';
-
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref(SalesStatistics_Promoted; SalesStatistics)
- {
- }
- actionref("Co&mments_Promoted"; "Co&mments")
- {
- }
- actionref(DocAttach_Promoted; DocAttach)
- {
- }
- actionref(Approvals_Promoted; Approvals)
- {
- }
- separator(Navigate_Separator)
- {
- }
- actionref(Customer_Promoted; Customer)
- {
- }
- actionref("C&ontact_Promoted"; "C&ontact")
- {
- }
- }
- group(Category_Category5)
- {
- Caption = 'View', Comment = 'Generated from the PromotedActionCategories property index 4.';
- }
- group(Category_Category8)
- {
- Caption = 'History', Comment = 'Generated from the PromotedActionCategories property index 7.';
- }
- group(Category_Category11)
- {
- Caption = 'Navigate', Comment = 'Generated from the PromotedActionCategories property index 10.';
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- begin
- ActivateFields();
- CurrPage.IncomingDocAttachFactBox.PAGE.LoadDataFromRecord(Rec);
- CurrPage.ApprovalFactBox.PAGE.UpdateApprovalEntriesFromSourceRecord(Rec.RecordId);
- ShowWorkflowStatus := CurrPage.WorkflowStatus.PAGE.SetFilterOnWorkflowRecord(Rec.RecordId);
- StatusStyleTxt := Rec.GetStatusStyleText();
- UpdatePaymentService();
- SetControlAppearance();
- end;
-
- trigger OnAfterGetRecord()
- begin
- ActivateFields();
- SetControlAppearance();
- WorkDescription := Rec.GetWorkDescription();
- UpdateShipToBillToGroupVisibility();
- SellToContact.GetOrClear(Rec."Sell-to Contact No.");
- BillToContact.GetOrClear(Rec."Bill-to Contact No.");
- CurrPage.IncomingDocAttachFactBox.Page.SetCurrentRecordID(Rec.RecordId);
-
- OnAfterOnAfterGetRecord(Rec);
- end;
-
- trigger OnDeleteRecord(): Boolean
- begin
- CurrPage.SaveRecord();
- exit(Rec.ConfirmDeletion());
- end;
-
- trigger OnInit()
- begin
- EnableBillToCustomerNo := true;
- EnableSellToCustomerTemplateCode := true;
- IsPowerAutomatePrivacyNoticeApproved := PrivacyNotice.GetPrivacyNoticeApprovalState(FlowServiceManagement.GetPowerAutomatePrivacyNoticeId()) = "Privacy Notice Approval State"::Agreed;
- end;
-
- trigger OnInsertRecord(BelowxRec: Boolean): Boolean
- begin
- if DocNoVisible then
- Rec.CheckCreditMaxBeforeInsert();
-
- if (Rec."Sell-to Customer No." = '') and (Rec.GetFilter("Sell-to Customer No.") <> '') then
- CurrPage.Update(false);
- end;
-
- trigger OnNewRecord(BelowxRec: Boolean)
- begin
- xRec.Init();
- Rec."Responsibility Center" := UserMgt.GetSalesFilter();
- OnOnNewRecordOnAfterSetResponsibilityCenter(Rec);
- if (not DocNoVisible) and (Rec."No." = '') then
- Rec.SetSellToCustomerFromFilter();
-
- Rec.SetDefaultPaymentServices();
- SetControlAppearance();
- UpdateShipToBillToGroupVisibility();
- end;
-
- trigger OnOpenPage()
- var
- PaymentServiceSetup: Record "Payment Service Setup";
- OfficeMgt: Codeunit "Office Management";
- EnvironmentInfo: Codeunit "Environment Information";
- begin
- Rec.SetSecurityFilterOnRespCenter();
- OnOpenPageOnAfterSetSecurityFilterOnRespCenter(Rec);
-
- Rec.SetRange("Date Filter", 0D, WorkDate());
-
- ActivateFields();
-
- SetDocNoVisible();
- IsOfficeAddin := OfficeMgt.IsAvailable();
- SetControlAppearance();
- IsSaaS := EnvironmentInfo.IsSaaS();
- PaymentServiceVisible := PaymentServiceSetup.IsPaymentServiceVisible();
-
- SetEnableSellToCustomerTemplateCode();
- end;
-
- var
- SalesHeaderArchive: Record "Sales Header Archive";
- SellToContact: Record Contact;
- BillToContact: Record Contact;
- GLSetup: Record "General Ledger Setup";
- DocPrint: Codeunit "Document-Print";
- UserMgt: Codeunit "User Setup Management";
- ArchiveManagement: Codeunit ArchiveManagement;
- SalesCalcDiscByType: Codeunit "Sales - Calc Discount By Type";
- CustomerMgt: Codeunit "Customer Mgt.";
- FormatAddress: Codeunit "Format Address";
- PrivacyNotice: Codeunit "Privacy Notice";
- FlowServiceManagement: Codeunit "Flow Service Management";
- ChangeExchangeRate: Page "Change Exchange Rate";
- EnableSellToCustomerTemplateCode: Boolean;
- HasIncomingDocument: Boolean;
- DocNoVisible: Boolean;
- OpenApprovalEntriesExistForCurrUser: Boolean;
- IsPowerAutomatePrivacyNoticeApproved: Boolean;
- OpenApprovalEntriesExist: Boolean;
- ShowWorkflowStatus: Boolean;
- IsOfficeAddin: Boolean;
- CanCancelApprovalForRecord: Boolean;
- PaymentServiceVisible: Boolean;
- PaymentServiceEnabled: Boolean;
- IsCustomerOrContactNotEmpty: Boolean;
- WorkDescription: Text;
- StatusStyleTxt: Text;
- EmptyShipToCodeErr: Label 'The Code field can only be empty if you select Custom Address in the Ship-to field.';
- CanRequestApprovalForFlow: Boolean;
- CanCancelApprovalForFlow: Boolean;
- IsSaaS: Boolean;
- IsBillToCountyVisible: Boolean;
- IsSellToCountyVisible: Boolean;
- IsShipToCountyVisible: Boolean;
- IsSellToCustomerNotEmpty: Boolean;
- EnableNewSellToCustomerTemplateCode: Boolean;
- IsJournalTemplNameVisible: Boolean;
- IsPaymentMethodCodeVisible: Boolean;
- IsSalesLinesEditable: Boolean;
-
- protected var
- ShipToOptions: Enum "Sales Ship-to Options";
- BillToOptions: Enum "Sales Bill-to Options";
- EnableBillToCustomerNo: Boolean;
-
- local procedure ActivateFields()
- begin
- EnableBillToCustomerNo := Rec."Bill-to Customer Templ. Code" = '';
- EnableSellToCustomerTemplateCode := Rec."Sell-to Customer No." = '';
- IsBillToCountyVisible := FormatAddress.UseCounty(Rec."Bill-to Country/Region Code");
- IsSellToCountyVisible := FormatAddress.UseCounty(Rec."Sell-to Country/Region Code");
- IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
- GLSetup.Get();
- IsJournalTemplNameVisible := GLSetup."Journal Templ. Name Mandatory";
- IsPaymentMethodCodeVisible := not GLSetup."Hide Payment Method Code";
- SetEnableSellToCustomerTemplateCode();
-
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- end;
-
- local procedure ApproveCalcInvDisc()
- begin
- CurrPage.SalesLines.PAGE.ApproveCalcInvDisc();
- end;
-
- local procedure SaveInvoiceDiscountAmount()
- var
- DocumentTotals: Codeunit "Document Totals";
- begin
- CurrPage.SaveRecord();
- DocumentTotals.SalesRedistributeInvoiceDiscountAmountsOnDocument(Rec);
- CurrPage.Update(false);
- end;
-
- local procedure ClearSellToFilter()
- begin
- if Rec.GetFilter("Sell-to Customer No.") = xRec."Sell-to Customer No." then
- if Rec."Sell-to Customer No." <> xRec."Sell-to Customer No." then
- Rec.SetRange("Sell-to Customer No.");
- if Rec.GetFilter("Sell-to Contact No.") = xRec."Sell-to Contact No." then
- if Rec."Sell-to Contact No." <> xRec."Sell-to Contact No." then
- Rec.SetRange("Sell-to Contact No.");
- end;
-
- local procedure SetDocNoVisible()
- var
- DocumentNoVisibility: Codeunit DocumentNoVisibility;
- DocType: Option Quote,"Order",Invoice,"Credit Memo","Blanket Order","Return Order",Reminder,FinChMemo;
- begin
- DocNoVisible := DocumentNoVisibility.SalesDocumentNoIsVisible(DocType::Quote, Rec."No.");
- end;
-
- local procedure SetControlAppearance()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- WorkflowWebhookMgt: Codeunit "Workflow Webhook Management";
- begin
- HasIncomingDocument := Rec."Incoming Document Entry No." <> 0;
-
- OpenApprovalEntriesExistForCurrUser := ApprovalsMgmt.HasOpenApprovalEntriesForCurrentUser(Rec.RecordId);
- OpenApprovalEntriesExist := ApprovalsMgmt.HasOpenApprovalEntries(Rec.RecordId);
- CanCancelApprovalForRecord := ApprovalsMgmt.CanCancelApprovalForRecord(Rec.RecordId);
- IsCustomerOrContactNotEmpty := (Rec."Sell-to Customer No." <> '') or (Rec."Sell-to Contact No." <> '');
- IsSellToCustomerNotEmpty := (Rec."Sell-to Customer No." <> '');
-
- WorkflowWebhookMgt.GetCanRequestAndCanCancel(Rec.RecordId, CanRequestApprovalForFlow, CanCancelApprovalForFlow);
- end;
-
- local procedure CheckSalesCheckAllLinesHaveQuantityAssigned()
- var
- LinesInstructionMgt: Codeunit "Lines Instruction Mgt.";
- begin
- LinesInstructionMgt.SalesCheckAllLinesHaveQuantityAssigned(Rec);
- end;
-
- local procedure UpdatePaymentService()
- var
- PaymentServiceSetup: Record "Payment Service Setup";
- begin
- PaymentServiceEnabled := PaymentServiceSetup.CanChangePaymentService(Rec);
- end;
-
- local procedure UpdateShipToBillToGroupVisibility()
- begin
- CustomerMgt.CalculateShipBillToOptions(ShipToOptions, BillToOptions, Rec);
- end;
-
- local procedure SetEnableSellToCustomerTemplateCode()
- begin
- EnableNewSellToCustomerTemplateCode := Rec."Sell-to Customer No." = '';
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateShipToOptions(var SalesHeader: Record "Sales Header"; ShipToOptions: Option; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterValidateShipToOptions(var SalesHeader: Record "Sales Header"; ShipToOptions: Option)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnOpenPageOnAfterSetSecurityFilterOnRespCenter(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupBillToName(var Customer: Record Customer; SalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnOnNewRecordOnAfterSetResponsibilityCenter(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnAfterOnAfterGetRecord(var SalesHeader: Record "Sales Header")
- begin
- end;
-}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Sales/Document/SalesReturnOrder.Page.al b/src/Layers/NL/BaseApp/Sales/Document/SalesReturnOrder.Page.al
deleted file mode 100644
index 83b9372490..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Document/SalesReturnOrder.Page.al
+++ /dev/null
@@ -1,1956 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.CRM.Contact;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.VAT.Calculation;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Attachment;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Intercompany;
-using Microsoft.Intercompany.GLAccount;
-using Microsoft.Projects.Resources.Resource;
-using Microsoft.Sales.Comment;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.History;
-using Microsoft.Sales.Posting;
-using Microsoft.Sales.Pricing;
-using Microsoft.Sales.Setup;
-using Microsoft.Utilities;
-using Microsoft.Warehouse.Activity;
-using Microsoft.Warehouse.Document;
-using Microsoft.Warehouse.InventoryDocument;
-using Microsoft.Warehouse.Request;
-using System.Automation;
-using System.Security.User;
-using System.Threading;
-
-///
-/// Displays and manages a single sales return order document for processing customer returns.
-///
-page 6630 "Sales Return Order"
-{
- Caption = 'Sales Return Order';
- PageType = Document;
- RefreshOnActivate = true;
- SourceTable = "Sales Header";
- SourceTableView = where("Document Type" = filter("Return Order"));
-
- AboutTitle = 'About sales return order details';
- AboutText = 'When you receive items back from the customer, you post the quantity received and the quantity you choose to credit the customer. Posting issues a related sales credit memo and return-related documents.';
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field("No."; Rec."No.")
- {
- ApplicationArea = All;
- ToolTip = 'Specifies the number of the involved entry or record, according to the specified number series.';
- Visible = DocNoVisible;
-
- trigger OnAssistEdit()
- begin
- if Rec.AssistEdit(xRec) then
- CurrPage.Update();
- end;
- }
- field("Sell-to Customer No."; Rec."Sell-to Customer No.")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Customer No.';
- Importance = Additional;
- NotBlank = true;
- ToolTip = 'Specifies the number of the customer associated with the sales return.';
-
- trigger OnValidate()
- begin
- Rec.SelltoCustomerNoOnAfterValidate(Rec, xRec);
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- CurrPage.Update();
- end;
- }
- field("Sell-to Customer Name"; Rec."Sell-to Customer Name")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Customer Name';
- Importance = Promoted;
- ShowMandatory = true;
- ToolTip = 'Specifies the name of the customer.';
-
- AboutTitle = 'Who''s returning the items?';
- AboutText = 'This is the customer that bought the items now being returned, and who will be credited if you choose to accept the return.';
-
- trigger OnAfterLookup(Selected: RecordRef)
- var
- Customer: Record Customer;
- begin
- Selected.SetTable(Customer);
- if Rec."Sell-to Customer No." <> Customer."No." then begin
- Rec.Validate("Sell-to Customer No.", Customer."No.");
- if Rec."Sell-to Customer No." <> Customer."No." then
- error('');
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- CurrPage.Update();
- end;
- end;
-
- trigger OnValidate()
- begin
- Rec.SelltoCustomerNoOnAfterValidate(Rec, xRec);
- CurrPage.Update();
- end;
- }
- field("Sell-to Customer Name 2"; Rec."Sell-to Customer Name 2")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Customer Name 2';
- QuickEntry = false;
- Visible = false;
- }
- group("Sell-to")
- {
- Caption = 'Sell-to';
- field("Sell-to Address"; Rec."Sell-to Address")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Address';
- Importance = Additional;
- ToolTip = 'Specifies the customer''s address.';
- }
- field("Sell-to Address 2"; Rec."Sell-to Address 2")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Address 2';
- Importance = Additional;
- ToolTip = 'Specifies an additional part of the customer''s address.';
- }
- field("Sell-to City"; Rec."Sell-to City")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'City';
- Importance = Additional;
- ToolTip = 'Specifies the city of the customer''s address.';
- }
- group(Control170)
- {
- ShowCaption = false;
- Visible = IsSellToCountyVisible;
- field("Sell-to County"; Rec."Sell-to County")
- {
- ApplicationArea = SalesReturnOrder;
- CaptionClass = '5,1,' + Rec."Sell-to Country/Region Code";
- Importance = Additional;
- ToolTip = 'Specifies the county of the address.';
- }
- }
- field("Sell-to Post Code"; Rec."Sell-to Post Code")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Post Code';
- Importance = Additional;
- ToolTip = 'Specifies the postal code of the customer''s address.';
- }
- field("Sell-to Country/Region Code"; Rec."Sell-to Country/Region Code")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Country/Region';
- ToolTip = 'Specifies the country or region of the address.';
-
- trigger OnValidate()
- begin
- IsSellToCountyVisible := FormatAddress.UseCounty(Rec."Sell-to Country/Region Code");
- end;
- }
- field("Sell-to Contact No."; Rec."Sell-to Contact No.")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Contact No.';
- Importance = Additional;
- ToolTip = 'Specifies the number of the contact person at the customer.';
-
- trigger OnLookup(var Text: Text): Boolean
- begin
- if not Rec.SelltoContactLookup() then
- exit(false);
- Text := Rec."Sell-to Contact No.";
- CurrPage.Update();
- exit(true);
- end;
-
- trigger OnValidate()
- begin
- if Rec.GetFilter("Sell-to Contact No.") = xRec."Sell-to Contact No." then
- if Rec."Sell-to Contact No." <> xRec."Sell-to Contact No." then
- Rec.SetRange("Sell-to Contact No.");
- if Rec."Sell-to Contact No." <> xRec."Sell-to Contact No." then
- CurrPage.Update();
- end;
- }
- field(SellToPhoneNo; SellToContact."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the contact person that the sales document will be sent to.';
- }
- field(SellToMobilePhoneNo; SellToContact."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mobile Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the contact person that the sales document will be sent to.';
- }
- field(SellToEmail; SellToContact."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the email address of the contact person that the sales document will be sent to.';
- }
- }
- field("Sell-to Contact"; Rec."Sell-to Contact")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Contact';
- Editable = Rec."Sell-to Customer No." <> '';
- ToolTip = 'Specifies the name of the contact person at the customer.';
- }
- field("Document Date"; Rec."Document Date")
- {
- ApplicationArea = SalesReturnOrder;
- Importance = Additional;
- }
- field("Posting Date"; Rec."Posting Date")
- {
- ApplicationArea = SalesReturnOrder;
- Importance = Promoted;
- ToolTip = 'Specifies the date when the sales document was posted.';
-
- trigger OnValidate()
- begin
- SaveInvoiceDiscountAmount();
- end;
- }
- field("VAT Reporting Date"; Rec."VAT Reporting Date")
- {
- ApplicationArea = VAT;
- Importance = Promoted;
- Editable = VATDateEnabled;
- Visible = VATDateEnabled;
- }
- field("Order Date"; Rec."Order Date")
- {
- ApplicationArea = SalesReturnOrder;
- Importance = Promoted;
- QuickEntry = false;
- }
- field("External Document No."; Rec."External Document No.")
- {
- ApplicationArea = SalesReturnOrder;
- Importance = Promoted;
- }
- field("Your Reference"; Rec."Your Reference")
- {
- ApplicationArea = SalesReturnOrder;
- Importance = Additional;
- }
- field("No. of Archived Versions"; Rec."No. of Archived Versions")
- {
- ApplicationArea = SalesReturnOrder;
- }
- field("Salesperson Code"; Rec."Salesperson Code")
- {
- ApplicationArea = SalesReturnOrder;
- Importance = Additional;
- QuickEntry = false;
-
- trigger OnValidate()
- begin
- SalespersonCodeOnAfterValidate();
- end;
- }
- field("Campaign No."; Rec."Campaign No.")
- {
- ApplicationArea = SalesReturnOrder;
- trigger OnValidate()
- begin
- if Rec."Campaign No." <> xRec."Campaign No." then
- CurrPage.Update();
- end;
- }
- field("Responsibility Center"; Rec."Responsibility Center")
- {
- ApplicationArea = Suite;
- }
- field("Assigned User ID"; Rec."Assigned User ID")
- {
- ApplicationArea = SalesReturnOrder;
- }
- field("Job Queue Status"; Rec."Job Queue Status")
- {
- ApplicationArea = All;
- Importance = Additional;
- ToolTip = 'Specifies the status of a job queue entry or task that handles the posting of sales return orders.';
- Visible = JobQueueUsed;
-
- 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(Status; Rec.Status)
- {
- ApplicationArea = SalesReturnOrder;
- Importance = Promoted;
- StyleExpr = StatusStyleTxt;
- QuickEntry = false;
- }
- field("Language Code"; Rec."Language Code")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Format Region"; Rec."Format Region")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- }
- part(SalesLines; "Sales Return Order Subform")
- {
- ApplicationArea = SalesReturnOrder;
- Editable = IsSalesLinesEditable;
- Enabled = IsSalesLinesEditable;
- SubPageLink = "Document No." = field("No.");
- UpdatePropagation = Both;
- }
- group("Invoice Details")
- {
- Caption = 'Invoice Details';
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = SalesReturnOrder;
- Importance = Promoted;
- ToolTip = 'Specifies the currency that is used on the entry.';
-
- trigger OnAssistEdit()
- begin
- if Rec."Posting Date" <> 0D then
- ChangeExchangeRate.SetParameter(Rec."Currency Code", Rec."Currency Factor", Rec."Posting Date")
- else
- ChangeExchangeRate.SetParameter(Rec."Currency Code", Rec."Currency Factor", WorkDate());
- if ChangeExchangeRate.RunModal() = ACTION::OK then begin
- Rec.Validate("Currency Factor", ChangeExchangeRate.GetParameter());
- SaveInvoiceDiscountAmount();
- end;
- Clear(ChangeExchangeRate);
- end;
-
- trigger OnValidate()
- begin
- CurrPage.Update();
- end;
- }
- field("Company Bank Account Code"; Rec."Company Bank Account Code")
- {
- ApplicationArea = SalesReturnOrder;
- Importance = Promoted;
- }
- field("Prices Including VAT"; Rec."Prices Including VAT")
- {
- ApplicationArea = VAT;
-
- trigger OnValidate()
- begin
- PricesIncludingVATOnAfterValid();
- end;
- }
- field("VAT Country/Region Code"; Rec."VAT Country/Region Code")
- {
- ApplicationArea = VAT;
- Importance = Additional;
- }
- field("VAT Registration No."; Rec."VAT Registration No.")
- {
- ApplicationArea = VAT;
- Editable = false;
- Importance = Additional;
- }
- field("Gen. Bus. Posting Group"; Rec."Gen. Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- }
- field("VAT Bus. Posting Group"; Rec."VAT Bus. Posting Group")
- {
- ApplicationArea = Basic, Suite;
-
- trigger OnValidate()
- begin
- CurrPage.Update();
- end;
- }
- field("Customer Posting Group"; Rec."Customer Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Editable = IsPostingGroupEditable;
- Importance = Additional;
- }
- field("Payment Terms Code"; Rec."Payment Terms Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Promoted;
- }
- field("EU 3-Party Trade"; Rec."EU 3-Party Trade")
- {
- ApplicationArea = SalesReturnOrder;
- }
- field("Payment Method Code"; Rec."Payment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Visible = IsPaymentMethodCodeVisible;
- }
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = SalesReturnOrder;
- ToolTip = 'Specifies the transaction mode used in telebanking.';
- }
- field("Bank Account Code"; Rec."Bank Account Code")
- {
- ApplicationArea = SalesReturnOrder;
- ToolTip = 'Specifies the customer''s bank account that is used for payments and collections through telebanking.';
- }
- field("Shortcut Dimension 1 Code"; Rec."Shortcut Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
-
- trigger OnValidate()
- begin
- ShortcutDimension1CodeOnAfterV();
- end;
- }
- field("Shortcut Dimension 2 Code"; Rec."Shortcut Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
-
- trigger OnValidate()
- begin
- ShortcutDimension2CodeOnAfterV();
- end;
- }
- field("Shipment Date"; Rec."Shipment Date")
- {
- ApplicationArea = SalesReturnOrder;
- Importance = Promoted;
- }
- field("Applies-to Doc. Type"; Rec."Applies-to Doc. Type")
- {
- ApplicationArea = SalesReturnOrder;
- Importance = Promoted;
- }
- field("Applies-to Doc. No."; Rec."Applies-to Doc. No.")
- {
- ApplicationArea = SalesReturnOrder;
- Importance = Promoted;
- }
- field("Applies-to ID"; Rec."Applies-to ID")
- {
- ApplicationArea = SalesReturnOrder;
- }
- field("Journal Templ. Name"; Rec."Journal Templ. Name")
- {
- ApplicationArea = SalesReturnOrder;
- Visible = IsJournalTemplNameVisible;
- }
- field("Tax Liable"; Rec."Tax Liable")
- {
- ApplicationArea = SalesTax;
- }
- field("Tax Area Code"; Rec."Tax Area Code")
- {
- ApplicationArea = SalesTax;
- ToolTip = 'Specifies the tax area code for the customer.';
-
- trigger OnValidate()
- begin
- CurrPage.SalesLines.PAGE.RedistributeTotalsOnAfterValidate();
- end;
- }
- }
- group("Shipping and Billing")
- {
- Caption = 'Shipping and Billing';
- group("Shipment Method")
- {
- Caption = 'Shipment Method';
- field("Shipping Agent Code"; Rec."Shipping Agent Code")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Agent';
- Importance = Additional;
- ToolTip = 'Specifies which shipping agent is used to transport the items on the sales document to the customer.';
- }
- field("Shipping Agent Service Code"; Rec."Shipping Agent Service Code")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Agent Service';
- Importance = Additional;
- ToolTip = 'Specifies which shipping agent service is used to transport the items on the sales document to the customer.';
- }
- field("Package Tracking No."; Rec."Package Tracking No.")
- {
- ApplicationArea = SalesReturnOrder;
- Importance = Additional;
- }
- }
- group("Ship-to")
- {
- Caption = 'Ship-to';
- field("Location Code"; Rec."Location Code")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Location';
- Importance = Promoted;
- ToolTip = 'Specifies the code for the location where the items are to be received. When you select the customer and the customer has a location assigned, the value is taken from the Customer card. If the customer has no location, but a Responsibility Center is populated, the location code is taken from the Responsibility Center. If neither is specified, the value is taken from Company Information. This field acts as the default location for new lines. You can update the location code for individual lines as needed.';
- }
- field("Ship-to Name"; Rec."Ship-to Name")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Name';
- ToolTip = 'Specifies the name that products on the sales document will be shipped to.';
- }
- field("Ship-to Name 2"; Rec."Ship-to Name 2")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Name 2';
- Importance = Additional;
- ToolTip = 'Specifies an additional part of the name of the customer at the address that the items are shipped to.';
- Visible = false;
- }
- field("Ship-to Address"; Rec."Ship-to Address")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Address';
- }
- field("Ship-to Address 2"; Rec."Ship-to Address 2")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Address 2';
- ToolTip = 'Specifies an additional part of the shipping address.';
- }
- field("Ship-to City"; Rec."Ship-to City")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'City';
- ToolTip = 'Specifies the city of the shipping address.';
- }
- group(Control76)
- {
- ShowCaption = false;
- Visible = IsShipToCountyVisible;
- field("Ship-to County"; Rec."Ship-to County")
- {
- ApplicationArea = SalesReturnOrder;
- CaptionClass = '5,1,' + Rec."Ship-to Country/Region Code";
- ToolTip = 'Specifies the county of the address.';
- }
- }
- field("Ship-to Post Code"; Rec."Ship-to Post Code")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Post Code';
- ToolTip = 'Specifies the postal code of the shipping address.';
- }
- field("Ship-to Country/Region Code"; Rec."Ship-to Country/Region Code")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Country/Region';
- ToolTip = 'Specifies the country or region of the address.';
-
- trigger OnValidate()
- begin
- IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
- end;
- }
- field("Ship-to Phone No."; Rec."Ship-to Phone No.")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Phone No.';
- }
- field("Ship-to Contact"; Rec."Ship-to Contact")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Contact';
- ToolTip = 'Specifies the name of the contact person at the shipping address.';
- }
- }
- group("Bill-to")
- {
- Caption = 'Bill-to';
- field("Bill-to Name"; Rec."Bill-to Name")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Name';
- Importance = Promoted;
- ToolTip = 'Specifies the customer to whom you will send the sales invoice, when different from the customer that you are selling to.';
-
- trigger OnValidate()
- begin
- if Rec.GetFilter("Bill-to Customer No.") = xRec."Bill-to Customer No." then
- if Rec."Bill-to Customer No." <> xRec."Bill-to Customer No." then
- Rec.SetRange("Bill-to Customer No.");
-
- CurrPage.Update();
- end;
-
- trigger OnLookup(var Text: Text): Boolean
- var
- Customer: Record Customer;
- begin
- OnBeforeLookupBillToName(Customer, Rec);
- if Customer.SelectCustomer(Customer) then begin
- xRec := Rec;
- Rec."Bill-to Name" := Customer.Name;
- Rec.Validate("Bill-to Customer No.", Customer."No.");
- end;
-
- if Rec.GetFilter("Bill-to Customer No.") = xRec."Bill-to Customer No." then
- if Rec."Bill-to Customer No." <> xRec."Bill-to Customer No." then
- Rec.SetRange("Bill-to Customer No.");
-
- CurrPage.Update();
- end;
- }
- field("Bill-to Name 2"; Rec."Bill-to Name 2")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Name 2';
- Editable = Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.";
- Enabled = Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.";
- Importance = Additional;
- QuickEntry = false;
- Visible = false;
- }
- field("Bill-to Address"; Rec."Bill-to Address")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Address';
- Editable = Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.";
- Enabled = Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.";
- Importance = Additional;
- }
- field("Bill-to Address 2"; Rec."Bill-to Address 2")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Address 2';
- Editable = Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.";
- Enabled = Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.";
- Importance = Additional;
- ToolTip = 'Specifies an additional part of the billing address.';
- }
- field("Bill-to City"; Rec."Bill-to City")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'City';
- Editable = Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.";
- Enabled = Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.";
- Importance = Additional;
- ToolTip = 'Specifies the city of the billing address.';
- }
- group(Control80)
- {
- ShowCaption = false;
- Visible = IsBillToCountyVisible;
- field("Bill-to County"; Rec."Bill-to County")
- {
- ApplicationArea = SalesReturnOrder;
- CaptionClass = '5,1,' + Rec."Bill-to Country/Region Code";
- Editable = Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.";
- Enabled = Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.";
- Importance = Additional;
- ToolTip = 'Specifies the county of the address.';
- }
- }
- field("Bill-to Post Code"; Rec."Bill-to Post Code")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Post Code';
- Editable = Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.";
- Enabled = Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.";
- Importance = Additional;
- ToolTip = 'Specifies the postal code of the billing address.';
- }
- field("Bill-to Country/Region Code"; Rec."Bill-to Country/Region Code")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Country/Region';
- Editable = Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.";
- Enabled = Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.";
- Importance = Additional;
- ToolTip = 'Specifies the country or region of the address.';
-
- trigger OnValidate()
- begin
- IsBillToCountyVisible := FormatAddress.UseCounty(Rec."Bill-to Country/Region Code");
- end;
- }
- field("Bill-to Contact No."; Rec."Bill-to Contact No.")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Contact No.';
- Editable = Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.";
- Enabled = Rec."Bill-to Customer No." <> Rec."Sell-to Customer No.";
- Importance = Additional;
- ToolTip = 'Specifies the number of the contact person at the billing address.';
- }
- field("Bill-to Contact"; Rec."Bill-to Contact")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Contact';
- ToolTip = 'Specifies the name of the contact person at the billing address.';
- }
- field(BillToContactPhoneNo; BillToContact."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the person you should contact at the customer you are sending the invoice to.';
- }
- field(BillToContactMobilePhoneNo; BillToContact."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mobile Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the person you should contact at the customer you are sending the invoice to.';
- }
- field(BillToContactEmail; BillToContact."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the email address of the person you should contact at the customer you are sending the invoice to.';
- }
- }
- }
- group("Foreign Trade")
- {
- Caption = 'Foreign Trade';
- field("Transaction Specification"; Rec."Transaction Specification")
- {
- ApplicationArea = BasicEU;
- }
- field("Transaction Type"; Rec."Transaction Type")
- {
- ApplicationArea = BasicEU;
- }
- field("Transport Method"; Rec."Transport Method")
- {
- ApplicationArea = BasicEU;
- }
- field("Exit Point"; Rec."Exit Point")
- {
- ApplicationArea = BasicEU;
- }
- field("Area"; Rec.Area)
- {
- ApplicationArea = BasicEU;
- }
- field("Rcvd-from Country/Region Code"; Rec."Rcvd.-from Count./Region Code")
- {
- ApplicationArea = BasicEU, BasicCH, BasicNO;
- }
- }
- }
- area(factboxes)
- {
- part(SalesDocCheckFactbox; "Sales Doc. Check Factbox")
- {
- ApplicationArea = All;
- Caption = 'Document Check';
- Visible = SalesDocCheckFactboxVisible;
- SubPageLink = "No." = field("No."),
- "Document Type" = field("Document Type");
- }
- 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(Control19; "Pending Approval FactBox")
- {
- ApplicationArea = SalesReturnOrder;
- SubPageLink = "Table ID" = const(36),
- "Document Type" = field("Document Type"),
- "Document No." = field("No."),
- Status = const(Open);
- Visible = OpenApprovalEntriesExistForCurrUser;
- }
- part(Control1903720907; "Sales Hist. Sell-to FactBox")
- {
- ApplicationArea = SalesReturnOrder;
- SubPageLink = "No." = field("Sell-to Customer No."),
- "Date Filter" = field("Date Filter");
- }
- part(Control1907234507; "Sales Hist. Bill-to FactBox")
- {
- ApplicationArea = SalesReturnOrder;
- SubPageLink = "No." = field("Sell-to Customer No."),
- "Date Filter" = field("Date Filter");
- Visible = false;
- }
- part(Control1902018507; "Customer Statistics FactBox")
- {
- ApplicationArea = SalesReturnOrder;
- SubPageLink = "No." = field("Bill-to Customer No."),
- "Date Filter" = field("Date Filter");
- Visible = false;
- }
- part(Control1900316107; "Customer Details FactBox")
- {
- ApplicationArea = SalesReturnOrder;
- SubPageLink = "No." = field("Sell-to Customer No."),
- "Date Filter" = field("Date Filter");
- }
- part(Control1906127307; "Sales Line FactBox")
- {
- ApplicationArea = SalesReturnOrder;
- Provider = SalesLines;
- SubPageLink = "Document Type" = field("Document Type"),
- "Document No." = field("Document No."),
- "Line No." = field("Line No.");
- Visible = false;
- }
- part(ApprovalFactBox; "Approval FactBox")
- {
- ApplicationArea = SalesReturnOrder;
- Visible = false;
- }
- part(Control1907012907; "Resource Details FactBox")
- {
- ApplicationArea = SalesReturnOrder;
- Provider = SalesLines;
- SubPageLink = "No." = field("No.");
- Visible = false;
- }
- part(WorkflowStatus; "Workflow Status FactBox")
- {
- ApplicationArea = SalesReturnOrder;
- Editable = false;
- Enabled = false;
- ShowFilter = false;
- Visible = ShowWorkflowStatus;
- }
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("&Return Order")
- {
- Caption = '&Return Order';
- Image = Return;
- action(SalesOrderStatistics)
- {
- 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 Order Statistics";
- RunPageOnRec = true;
- }
- action(Customer)
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Customer';
- Enabled = IsCustomerOrContactNotEmpty;
- Image = EditLines;
- RunObject = Page "Customer Card";
- RunPageLink = "No." = field("Sell-to Customer No.");
- ShortCutKey = 'Shift+F7';
- ToolTip = 'View or edit detailed information about the customer on the sales document.';
- }
- action(CustomerStatistics)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer Statistics';
- Enabled = IsCustomerOrContactNotEmpty;
- 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(Dimensions)
- {
- AccessByPermission = TableData Dimension = R;
- ApplicationArea = Dimensions;
- Caption = 'Dimensions';
- Enabled = Rec."No." <> '';
- 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();
- CurrPage.SaveRecord();
- 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("Co&mments")
- {
- ApplicationArea = Comments;
- Caption = 'Co&mments';
- Image = ViewComments;
- RunObject = Page "Sales Comment Sheet";
- RunPageLink = "Document Type" = const("Return Order"),
- "No." = field("No."),
- "Document Line No." = const(0);
- ToolTip = 'View or add comments for the record.';
- }
- }
- group(Documents)
- {
- Caption = 'Documents';
- Image = Documents;
- action("Return Receipts")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Return Receipts';
- Image = ReturnReceipt;
- RunObject = Page "Posted Return Receipts";
- RunPageLink = "Return Order No." = field("No.");
- RunPageView = sorting("Return Order No.");
- ToolTip = 'View a list of posted return receipts for the order.';
- }
- action("Cred&it Memos")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Cred&it Memos';
- Image = CreditMemo;
- ToolTip = 'View a list of ongoing credit memos for the order.';
-
- trigger OnAction()
- var
- TempSalesCrMemoHeader: Record "Sales Cr.Memo Header" temporary;
- SalesGetReturnReceipts: Codeunit "Sales-Get Return Receipts";
- begin
- SalesGetReturnReceipts.GetSalesRetOrderCrMemos(TempSalesCrMemoHeader, Rec."No.");
- Page.Run(Page::"Posted Sales Credit Memos", TempSalesCrMemoHeader);
- end;
- }
- separator(Action131)
- {
- }
- }
- group(Warehouse)
- {
- Caption = 'Warehouse';
- Image = Warehouse;
- action("In&vt. Put-away/Pick Lines")
- {
- ApplicationArea = Warehouse;
- Caption = 'In&vt. Put-away/Pick Lines';
- Image = PickLines;
- RunObject = Page "Warehouse Activity List";
- RunPageLink = "Source Document" = const("Sales Return Order"),
- "Source No." = field("No.");
- RunPageView = sorting("Source Document", "Source No.", "Location Code");
- ToolTip = 'View items that are inbound or outbound on inventory put-away or inventory pick documents for the sales return order.';
- }
- action("Whse. Receipt Lines")
- {
- ApplicationArea = Warehouse;
- Caption = 'Whse. Receipt Lines';
- Image = ReceiptLines;
- RunObject = Page "Whse. Receipt Lines";
- RunPageLink = "Source Type" = const(37),
-#pragma warning disable AL0603
- "Source Subtype" = field("Document Type"),
-#pragma warning restore
- "Source No." = field("No.");
- RunPageView = sorting("Source Type", "Source Subtype", "Source No.", "Source Line No.");
- ToolTip = 'View ongoing warehouse receipts for the document, in advanced warehouse configurations.';
- }
- action("Whse. Put-away Lines")
- {
- ApplicationArea = Warehouse;
- Caption = 'Warehouse Put-away Lines';
- Image = PutawayLines;
- RunObject = page "Warehouse Activity Lines";
- RunPageLink = "Source Document" = const("Sales Return Order"), "Source No." = field("No.");
- RunPageView = sorting("Source Type", "Source Subtype", "Source No.");
- ToolTip = 'View ongoing warehouse put-aways for the document, in advanced warehouse configurations.';
- }
- }
- }
- area(processing)
- {
- group(Approval)
- {
- Caption = 'Approval';
- action(Approve)
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Approve';
- Image = Approve;
- ToolTip = 'Approve the requested changes.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.ApproveRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Reject)
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Reject';
- Image = Reject;
- ToolTip = 'Reject the approval request.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.RejectRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Delegate)
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Delegate';
- Image = Delegate;
- ToolTip = 'Delegate the approval to a substitute approver.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.DelegateRecordApprovalRequest(Rec.RecordId);
- end;
- }
- action(Comment)
- {
- ApplicationArea = All;
- Caption = 'Comments';
- Image = ViewComments;
- ToolTip = 'View or add comments for the record.';
- Visible = OpenApprovalEntriesExistForCurrUser;
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.GetApprovalComment(Rec);
- end;
- }
- }
- action("&Print")
- {
- ApplicationArea = SalesReturnOrder;
- 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()
- begin
- DocPrint.PrintSalesHeader(Rec);
- end;
- }
- action(AttachAsPDF)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Attach as PDF';
- Image = PrintAttachment;
- ToolTip = 'Create a PDF file and attach it to the document.';
-
- trigger OnAction()
- var
- SalesHeader: Record "Sales Header";
- begin
- SalesHeader := Rec;
- SalesHeader.SetRecFilter();
- DocPrint.PrintSalesHeaderToDocumentAttachment(SalesHeader);
- end;
- }
- group(Action7)
- {
- Caption = 'Release';
- Image = ReleaseDoc;
- action(Release)
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Re&lease';
- Enabled = Rec.Status <> Rec.Status::Released;
- 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()
- begin
- Rec.PerformManualRelease();
- CurrPage.SalesLines.PAGE.ClearTotalSalesHeader();
- end;
- }
- action(Reopen)
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Re&open';
- Enabled = Rec.Status <> Rec.Status::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
- ReleaseSalesDoc: Codeunit "Release Sales Document";
- begin
- ReleaseSalesDoc.PerformManualReopen(Rec);
- CurrPage.SalesLines.PAGE.ClearTotalSalesHeader();
- end;
- }
- separator(Action600)
- {
- }
- }
- group("F&unctions")
- {
- Caption = 'F&unctions';
- Image = "Action";
- action(CalculateInvoiceDiscount)
- {
- AccessByPermission = TableData "Cust. Invoice Disc." = R;
- ApplicationArea = SalesReturnOrder;
- Caption = 'Calculate &Invoice Discount';
- Image = CalculateInvoiceDiscount;
- ToolTip = 'Calculate the invoice discount that applies to the sales return order.';
-
- trigger OnAction()
- begin
- ApproveCalcInvDisc();
- SalesCalcDiscByType.ResetRecalculateInvoiceDisc(Rec);
- end;
- }
- separator(Action132)
- {
- }
- action("Apply Entries")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Apply Entries';
- Ellipsis = true;
- Image = ApplyEntries;
- ShortCutKey = 'Shift+F11';
- ToolTip = 'Select one or more ledger entries that you want to apply this record to so that the related posted documents are closed as paid or refunded.';
-
- trigger OnAction()
- begin
- CODEUNIT.Run(CODEUNIT::"Sales Header Apply", Rec);
- end;
- }
- action("Create Return-Related &Documents")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Create Return-Related &Documents';
- Ellipsis = true;
- Image = ApplyEntries;
- ToolTip = 'Prepare to automatically create related documents, such as a replacement sales order, a purchase return order, or a replacement purchase order.';
-
- trigger OnAction()
- begin
- Clear(CreateRetRelDocs);
- CreateRetRelDocs.SetSalesHeader(Rec);
- CreateRetRelDocs.RunModal();
- CreateRetRelDocs.ShowDocuments();
- end;
- }
- separator(Action133)
- {
- }
- action(CopyDocument)
- {
- ApplicationArea = Suite;
- Caption = 'Copy Document';
- Ellipsis = true;
- Enabled = Rec."No." <> '';
- Image = CopyDocument;
- ToolTip = 'Copy document lines and header information from another sales document to this document. You can copy a posted sales invoice into a new sales invoice to quickly create a similar document.';
-
- trigger OnAction()
- begin
- Rec.CopyDocument();
- if Rec.Get(Rec."Document Type", Rec."No.") then;
- CurrPage.SalesLines.Page.ForceTotalsCalculation();
- CurrPage.Update();
- end;
- }
- action(MoveNegativeLines)
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Move Negative Lines';
- Ellipsis = true;
- Image = MoveNegativeLines;
- ToolTip = 'Prepare to create a replacement sales order in a sales return process.';
-
- trigger OnAction()
- begin
- Clear(MoveNegSalesLines);
- MoveNegSalesLines.SetSalesHeader(Rec);
- MoveNegSalesLines.RunModal();
- MoveNegSalesLines.ShowDocument();
- end;
- }
- action("Post and &Print")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Post and &Print';
- Ellipsis = true;
- 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
- PostDocument(CODEUNIT::"Sales-Post + Print");
- end;
- }
- action(GetPostedDocumentLinesToReverse)
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Get Posted Doc&ument Lines to Reverse';
- Ellipsis = true;
- Image = ReverseLines;
- ToolTip = 'Copy one or more posted sales document lines in order to reverse the original order.';
-
- AboutTitle = 'Choosing what is returned';
- AboutText = 'To create lines for the sales return order, you can overview and select lines from the documents posted for a certain customer, and have the information copied here.';
-
- trigger OnAction()
- begin
- Rec.GetPstdDocLinesToReverse();
- CurrPage.SalesLines.Page.SalesDocTotalsNotUpToDate();
- CurrPage.SalesLines.Page.Update(false);
- end;
- }
- action("Archive Document")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Archive Document';
- Image = Archive;
- ToolTip = 'Send the document to the archive, for example because it is too soon to delete it. Later, you delete or reprocess the archived document.';
-
- trigger OnAction()
- begin
- ArchiveManagement.ArchiveSalesDocument(Rec);
- CurrPage.Update(false);
- end;
- }
- action("Send IC Return Order Cnfmn.")
- {
- AccessByPermission = TableData "IC G/L Account" = R;
- ApplicationArea = Intercompany;
- Caption = 'Send IC Return Order Cnfmn.';
- Image = IntercompanyOrder;
- ToolTip = 'Prepare to send the return order confirmation to an intercompany partner.';
-
- trigger OnAction()
- var
- ICInOutboxMgt: Codeunit ICInboxOutboxMgt;
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- if ApprovalsMgmt.PrePostApprovalCheckSales(Rec) then
- ICInOutboxMgt.SendSalesDoc(Rec, false);
- end;
- }
- separator(Action135)
- {
- }
- action(Post)
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'P&ost';
- Ellipsis = true;
- Image = PostOrder;
- ShortCutKey = 'F9';
- ToolTip = 'Finalize the document or journal by posting the amounts and quantities to the related accounts in your company books.';
-
- AboutTitle = 'Post the quantities you''ve set';
- AboutText = 'Choose one of the post actions to trigger receipt and/or crediting of the quantities you entered on the lines. You can post multiple times from the same return order if the items are not received at once.';
-
- trigger OnAction()
- begin
- PostDocument(CODEUNIT::"Sales-Post (Yes/No)");
- end;
- }
- action("Preview Posting")
- {
- ApplicationArea = SalesReturnOrder;
- 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;
- }
- 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(Action13)
- {
- Caption = 'Warehouse';
- Image = Warehouse;
- separator(Action136)
- {
- }
- action("Create &Whse. Receipt")
- {
- AccessByPermission = TableData "Warehouse Receipt Header" = R;
- ApplicationArea = Warehouse;
- Caption = 'Create &Whse. Receipt';
- Image = NewReceipt;
- ToolTip = 'Create a warehouse receipt to start a receive and put-away process according to an advanced warehouse configuration.';
-
- trigger OnAction()
- var
- GetSourceDocInbound: Codeunit "Get Source Doc. Inbound";
- begin
- Rec.PerformManualRelease();
- CurrPage.SalesLines.PAGE.ClearTotalSalesHeader();
-
- GetSourceDocInbound.CreateFromSalesReturnOrder(Rec);
- end;
- }
- action("Create Inventor&y Put-away/Pick")
- {
- AccessByPermission = TableData "Posted Invt. Put-away Header" = R;
- ApplicationArea = Warehouse;
- Caption = 'Create Inventor&y Put-away/Pick';
- Ellipsis = true;
- Image = CreateInventoryPickup;
- ToolTip = 'Create an inventory put-away or inventory pick to handle items on the document according to a basic warehouse configuration that does not require warehouse receipt or shipment documents.';
-
- trigger OnAction()
- begin
- Rec.PerformManualRelease();
- CurrPage.SalesLines.PAGE.ClearTotalSalesHeader();
-
- Rec.CreateInvtPutAwayPick();
- end;
- }
- separator(Action30)
- {
- }
- }
- group("P&osting")
- {
- Caption = 'P&osting';
- Image = Post;
- action("Test Report")
- {
- ApplicationArea = SalesReturnOrder;
- 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 &Batch")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Post &Batch';
- Ellipsis = true;
- Image = PostBatch;
- //The property 'PromotedOnly' can only be set if the property 'Promoted' is set to 'true'
- //PromotedOnly = false;
- ToolTip = 'Post several documents at once. A report request window opens where you can specify which documents to post.';
-
- trigger OnAction()
- begin
- REPORT.RunModal(REPORT::"Batch Post Sales Return Orders", true, true, Rec);
- CurrPage.Update(false);
- end;
- }
- action("Remove From Job Queue")
- {
- ApplicationArea = All;
- Caption = 'Remove From Job Queue';
- Image = RemoveLine;
- ToolTip = 'Remove the scheduled processing of this record from the job queue.';
- Visible = JobQueueVisible;
-
- trigger OnAction()
- begin
- Rec.CancelBackgroundPosting();
- end;
- }
- }
- group("Request Approval")
- {
- Caption = 'Request Approval';
- action(SendApprovalRequest)
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Send A&pproval Request';
- Enabled = not OpenApprovalEntriesExist;
- 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 = SalesReturnOrder;
- Caption = 'Cancel Approval Re&quest';
- Enabled = CanCancelApprovalForRecord;
- Image = CancelApprovalRequest;
- ToolTip = 'Cancel the approval request.';
-
- trigger OnAction()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- begin
- ApprovalsMgmt.OnCancelSalesApprovalRequest(Rec);
- end;
- }
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- group(Category_Category6)
- {
- Caption = 'Posting', Comment = 'Generated from the PromotedActionCategories property index 5.';
- ShowAs = SplitButton;
-
- actionref(Post_Promoted; Post)
- {
- }
- actionref("Post and &Print_Promoted"; "Post and &Print")
- {
- }
- actionref("Preview Posting_Promoted"; "Preview Posting")
- {
- }
- actionref("Post &Batch_Promoted"; "Post &Batch")
- {
- }
- }
- group(Category_Category5)
- {
- Caption = 'Release', Comment = 'Generated from the PromotedActionCategories property index 4.';
- ShowAs = SplitButton;
-
- actionref(Release_Promoted; Release)
- {
- }
- actionref(Reopen_Promoted; Reopen)
- {
- }
- }
- actionref("Create &Whse. Receipt_Promoted"; "Create &Whse. Receipt")
- {
- }
- actionref("Create Return-Related &Documents_Promoted"; "Create Return-Related &Documents")
- {
- }
- actionref("Apply Entries_Promoted"; "Apply Entries")
- {
- }
- actionref("Archive Document_Promoted"; "Archive Document")
- {
- }
- }
- group(Category_Category7)
- {
- Caption = 'Prepare', Comment = 'Generated from the PromotedActionCategories property index 6.';
-
- actionref(CopyDocument_Promoted; CopyDocument)
- {
- }
- actionref(GetPostedDocumentLinesToReverse_Promoted; GetPostedDocumentLinesToReverse)
- {
- }
- actionref(CalculateInvoiceDiscount_Promoted; CalculateInvoiceDiscount)
- {
- }
- actionref(MoveNegativeLines_Promoted; MoveNegativeLines)
- {
- }
- }
- group(Category_Category4)
- {
- Caption = 'Approve', Comment = 'Generated from the PromotedActionCategories property index 3.';
-
- actionref(Approve_Promoted; Approve)
- {
- }
- actionref(Reject_Promoted; Reject)
- {
- }
- actionref(Comment_Promoted; Comment)
- {
- }
- actionref(Delegate_Promoted; Delegate)
- {
- }
- }
- group(Category_Category10)
- {
- Caption = 'Print/Send', Comment = 'Generated from the PromotedActionCategories property index 9.';
-
- actionref("&Print_Promoted"; "&Print")
- {
- }
- actionref(AttachAsPDF_Promoted; AttachAsPDF)
- {
- }
- }
- group(Category_Category9)
- {
- Caption = 'Request Approval', Comment = 'Generated from the PromotedActionCategories property index 8.';
-
- actionref(SendApprovalRequest_Promoted; SendApprovalRequest)
- {
- }
- actionref(CancelApprovalRequest_Promoted; CancelApprovalRequest)
- {
- }
- }
- group(Category_Category8)
- {
- Caption = 'Invoice', Comment = 'Generated from the PromotedActionCategories property index 7.';
- }
- group(Category_Category11)
- {
- Caption = 'Return Order', Comment = 'Generated from the PromotedActionCategories property index 10.';
-
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref(SalesOrderStatistics_Promoted; SalesOrderStatistics)
- {
- }
- actionref("Co&mments_Promoted"; "Co&mments")
- {
- }
- actionref(DocAttach_Promoted; DocAttach)
- {
- }
- actionref(Approvals_Promoted; Approvals)
- {
- }
- separator(Navigate_Separator)
- {
- }
- actionref(Customer_Promoted; Customer)
- {
- }
- actionref("Return Receipts_Promoted"; "Return Receipts")
- {
- }
- actionref("Cred&it Memos_Promoted"; "Cred&it Memos")
- {
- }
- }
- group(Category_Category12)
- {
- Caption = 'Navigate', Comment = 'Generated from the PromotedActionCategories property index 11.';
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- begin
- SetControlAppearance();
- ShowWorkflowStatus := CurrPage.WorkflowStatus.PAGE.SetFilterOnWorkflowRecord(Rec.RecordId());
- CurrPage.ApprovalFactBox.PAGE.UpdateApprovalEntriesFromSourceRecord(Rec.RecordId());
- StatusStyleTxt := Rec.GetStatusStyleText();
- end;
-
- trigger OnAfterGetRecord()
- begin
- SellToContact.GetOrClear(Rec."Sell-to Contact No.");
- BillToContact.GetOrClear(Rec."Bill-to Contact No.");
-
- OnAfterOnAfterGetRecord(Rec);
- end;
-
- trigger OnDeleteRecord(): Boolean
- begin
- CurrPage.SaveRecord();
- exit(Rec.ConfirmDeletion());
- end;
-
- trigger OnInit()
- begin
- JobQueueUsed := SalesSetup.JobQueueActive();
- end;
-
- trigger OnInsertRecord(BelowxRec: Boolean): Boolean
- begin
- if DocNoVisible then
- Rec.CheckCreditMaxBeforeInsert();
- end;
-
- trigger OnNewRecord(BelowxRec: Boolean)
- begin
- Rec."Responsibility Center" := UserMgt.GetSalesFilter();
- if (not DocNoVisible) and (Rec."No." = '') then
- Rec.SetSellToCustomerFromFilter();
- end;
-
- trigger OnOpenPage()
- var
- VATReportingDateMgt: Codeunit "VAT Reporting Date Mgt";
- begin
- Rec.SetSecurityFilterOnRespCenter();
-
- ActivateFields();
-
- SetDocNoVisible();
- if (Rec."No." <> '') and (Rec."Sell-to Customer No." = '') then
- DocumentIsPosted := (not Rec.Get(Rec."Document Type", Rec."No."));
-
- CheckShowBackgrValidationNotification();
- VATDateEnabled := VATReportingDateMgt.IsVATDateEnabled();
- end;
-
- trigger OnQueryClosePage(CloseAction: Action): Boolean
- var
- IsHandled: Boolean;
- Result: Boolean;
- begin
- IsHandled := false;
- OnBeforeOnQueryClosePage(Rec, CloseAction, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if not DocumentIsPosted then
- exit(Rec.ConfirmCloseUnposted());
- end;
-
- var
- SellToContact: Record Contact;
- BillToContact: Record Contact;
- SalesSetup: Record "Sales & Receivables Setup";
- GLSetup: Record "General Ledger Setup";
- MoveNegSalesLines: Report "Move Negative Sales Lines";
- CreateRetRelDocs: Report "Create Ret.-Related Documents";
- ReportPrint: Codeunit "Test Report-Print";
- DocPrint: Codeunit "Document-Print";
- UserMgt: Codeunit "User Setup Management";
- ArchiveManagement: Codeunit ArchiveManagement;
- SalesCalcDiscByType: Codeunit "Sales - Calc Discount By Type";
- FormatAddress: Codeunit "Format Address";
- ChangeExchangeRate: Page "Change Exchange Rate";
- JobQueueVisible: Boolean;
- JobQueueUsed: Boolean;
- StatusStyleTxt: Text;
- DocNoVisible: Boolean;
- OpenApprovalEntriesExistForCurrUser: Boolean;
- OpenApprovalEntriesExist: Boolean;
- ShowWorkflowStatus: Boolean;
- CanCancelApprovalForRecord: Boolean;
- DocumentIsPosted: Boolean;
- OpenPostedSalesReturnOrderQst: Label 'The return order is posted as number %1 and moved to the Posted Sales Credit Memos window.\\Do you want to open the posted credit memo?', Comment = '%1 = posted document number';
- IsCustomerOrContactNotEmpty: Boolean;
- IsBillToCountyVisible: Boolean;
- IsSellToCountyVisible: Boolean;
- IsShipToCountyVisible: Boolean;
- SalesDocCheckFactboxVisible: Boolean;
- IsJournalTemplNameVisible: Boolean;
- IsPaymentMethodCodeVisible: Boolean;
- IsSalesLinesEditable: Boolean;
- VATDateEnabled: Boolean;
-
- protected var
- IsPostingGroupEditable: Boolean;
-
- local procedure ActivateFields()
- begin
- IsBillToCountyVisible := FormatAddress.UseCounty(Rec."Bill-to Country/Region Code");
- IsSellToCountyVisible := FormatAddress.UseCounty(Rec."Sell-to Country/Region Code");
- IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
- GLSetup.Get();
- IsJournalTemplNameVisible := GLSetup."Journal Templ. Name Mandatory";
- IsPaymentMethodCodeVisible := not GLSetup."Hide Payment Method Code";
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- end;
-
- ///
- /// Posts the sales return order using the specified posting codeunit.
- ///
- /// The ID of the codeunit to use for posting.
- procedure CallPostDocument(PostingCodeunitID: Integer)
- begin
- PostDocument(PostingCodeunitID);
- end;
-
- local procedure PostDocument(PostingCodeunitID: Integer)
- var
- SalesHeader: Record "Sales Header";
- InstructionMgt: Codeunit "Instruction Mgt.";
- LinesInstructionMgt: Codeunit "Lines Instruction Mgt.";
- DocumentIsScheduledForPosting: Boolean;
- IsHandled: Boolean;
- begin
- LinesInstructionMgt.SalesCheckAllLinesHaveQuantityAssigned(Rec);
- Rec.SendToPosting(PostingCodeunitID);
-
- SalesHeader.SetRange("Document Type", Rec."Document Type");
- SalesHeader.SetRange("No.", Rec."No.");
- DocumentIsPosted := SalesHeader.IsEmpty();
-
- DocumentIsScheduledForPosting := Rec."Job Queue Status" = Rec."Job Queue Status"::"Scheduled for Posting";
- OnPostDocumentOnAfterCalcDocumentIsScheduledForPosting(Rec, DocumentIsScheduledForPosting, DocumentIsPosted);
- if DocumentIsScheduledForPosting then
- CurrPage.Close();
- CurrPage.Update(false);
-
- IsHandled := false;
- OnPostDocumentBeforeNavigateAfterPosting(Rec, PostingCodeunitID, DocumentIsPosted, IsHandled);
- if IsHandled then
- exit;
-
- if PostingCodeunitID <> CODEUNIT::"Sales-Post (Yes/No)" then
- exit;
-
- if InstructionMgt.IsEnabled(InstructionMgt.ShowPostedConfirmationMessageCode()) then
- ShowPostedConfirmationMessage();
- end;
-
- local procedure ApproveCalcInvDisc()
- begin
- CurrPage.SalesLines.PAGE.ApproveCalcInvDisc();
- end;
-
- local procedure SaveInvoiceDiscountAmount()
- var
- DocumentTotals: Codeunit "Document Totals";
- begin
- CurrPage.SaveRecord();
- DocumentTotals.SalesRedistributeInvoiceDiscountAmountsOnDocument(Rec);
- CurrPage.Update(false);
- end;
-
- local procedure SalespersonCodeOnAfterValidate()
- begin
- CurrPage.SalesLines.PAGE.UpdateForm(true);
- end;
-
- local procedure ShortcutDimension1CodeOnAfterV()
- begin
- CurrPage.SalesLines.PAGE.UpdateForm(true);
- end;
-
- local procedure ShortcutDimension2CodeOnAfterV()
- begin
- CurrPage.SalesLines.PAGE.UpdateForm(true);
- end;
-
- local procedure PricesIncludingVATOnAfterValid()
- begin
- CurrPage.SalesLines.Page.ForceTotalsCalculation();
- CurrPage.Update();
- end;
-
- local procedure SetDocNoVisible()
- var
- DocumentNoVisibility: Codeunit DocumentNoVisibility;
- DocType: Option Quote,"Order",Invoice,"Credit Memo","Blanket Order","Return Order",Reminder,FinChMemo;
- begin
- DocNoVisible := DocumentNoVisibility.SalesDocumentNoIsVisible(DocType::"Return Order", Rec."No.");
- end;
-
- ///
- /// Sets whether the posting group field is editable based on the bill-to customer's settings.
- ///
- procedure SetPostingGroupEditable()
- var
- BillToCustomer: Record Customer;
- begin
- if BillToCustomer.Get(Rec."Bill-to Customer No.") then
- IsPostingGroupEditable := BillToCustomer."Allow Multiple Posting Groups";
- end;
-
- ///
- /// Shows a preview of the posting results for the sales return order.
- ///
- procedure ShowPreview()
- var
- SalesPostYesNo: Codeunit "Sales-Post (Yes/No)";
- begin
- SalesPostYesNo.Preview(Rec);
- end;
-
- local procedure SetControlAppearance()
- var
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- DocumentErrorsMgt: Codeunit "Document Errors Mgt.";
- begin
- JobQueueVisible := Rec."Job Queue Status" = Rec."Job Queue Status"::"Scheduled for Posting";
-
- OpenApprovalEntriesExistForCurrUser := ApprovalsMgmt.HasOpenApprovalEntriesForCurrentUser(Rec.RecordId);
- OpenApprovalEntriesExist := ApprovalsMgmt.HasOpenApprovalEntries(Rec.RecordId);
- CanCancelApprovalForRecord := ApprovalsMgmt.CanCancelApprovalForRecord(Rec.RecordId);
- IsCustomerOrContactNotEmpty := (Rec."Sell-to Customer No." <> '') or (Rec."Sell-to Contact No." <> '');
- IsSalesLinesEditable := Rec.SalesLinesEditable();
- SalesDocCheckFactboxVisible := DocumentErrorsMgt.BackgroundValidationEnabled();
- SetPostingGroupEditable();
- end;
-
- ///
- /// Runs background validation to check for errors in the sales return order.
- ///
- procedure RunBackgroundCheck()
- begin
- CurrPage.SalesDocCheckFactbox.Page.CheckErrorsInBackground(Rec);
- end;
-
- local procedure CheckShowBackgrValidationNotification()
- var
- DocumentErrorsMgt: Codeunit "Document Errors Mgt.";
- begin
- if DocumentErrorsMgt.CheckShowEnableBackgrValidationNotification() then
- SetControlAppearance();
- end;
-
- local procedure ShowPostedConfirmationMessage()
- var
- ReturnOrderSalesHeader: Record "Sales Header";
- SalesCrMemoHeader: Record "Sales Cr.Memo Header";
- InstructionMgt: Codeunit "Instruction Mgt.";
- begin
- if not ReturnOrderSalesHeader.Get(Rec."Document Type", Rec."No.") then begin
- SalesCrMemoHeader.SetRange("No.", Rec."Last Posting No.");
- if SalesCrMemoHeader.FindFirst() then
- if InstructionMgt.ShowConfirm(StrSubstNo(OpenPostedSalesReturnOrderQst, SalesCrMemoHeader."No."),
- InstructionMgt.ShowPostedConfirmationMessageCode())
- then
- InstructionMgt.ShowPostedDocument(SalesCrMemoHeader, Page::"Sales Return Order");
- end;
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnAfterOnAfterGetRecord(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnPostDocumentBeforeNavigateAfterPosting(var SalesHeader: Record "Sales Header"; var PostingCodeunitID: Integer; DocumentIsPosted: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeOnQueryClosePage(var SalesHeader: Record "Sales Header"; CloseAction: Action; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnPostDocumentOnAfterCalcDocumentIsScheduledForPosting(var SalesHeader: Record "Sales Header"; var DocumentIsScheduledForPosting: Boolean; var DocumentIsPosted: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeLookupBillToName(var Customer: Record Customer; SalesHeader: Record "Sales Header")
- begin
- end;
-}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Sales/History/PostedSalesCreditMemo.Page.al b/src/Layers/NL/BaseApp/Sales/History/PostedSalesCreditMemo.Page.al
deleted file mode 100644
index 044667f665..0000000000
--- a/src/Layers/NL/BaseApp/Sales/History/PostedSalesCreditMemo.Page.al
+++ /dev/null
@@ -1,1071 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.History;
-
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Outlook;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.VAT.Calculation;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Attachment;
-using Microsoft.Sales.Comment;
-using Microsoft.Sales.Customer;
-using System.Automation;
-
-///
-/// Displays a single posted sales credit memo document with header and line details.
-///
-page 134 "Posted Sales Credit Memo"
-{
- Caption = 'Posted Sales Credit Memo';
- InsertAllowed = false;
- PageType = Document;
- RefreshOnActivate = true;
- SourceTable = "Sales Cr.Memo Header";
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field("No."; Rec."No.")
- {
- ApplicationArea = All;
- Editable = false;
- Importance = Promoted;
- ToolTip = 'Specifies the posted credit memo number.';
- }
- field("Sell-to Customer No."; Rec."Sell-to Customer No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer No.';
- Editable = false;
- Visible = false;
- }
- field("Sell-to Customer Name"; Rec."Sell-to Customer Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer';
- Editable = false;
- ShowMandatory = true;
- TableRelation = Customer.Name;
- }
- field("Sell-to Customer Name 2"; Rec."Sell-to Customer Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer Name 2';
- Editable = false;
- Visible = false;
- }
- field("VAT Registration No."; Rec."VAT Registration No.")
- {
- ApplicationArea = VAT;
- Editable = false;
- Importance = Additional;
- Visible = false;
- }
- group("Sell-to")
- {
- Caption = 'Sell-to';
- field("Sell-to Address"; Rec."Sell-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = false;
- Importance = Additional;
- }
- field("Sell-to Address 2"; Rec."Sell-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = false;
- Importance = Additional;
- }
- field("Sell-to City"; Rec."Sell-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = false;
- Importance = Additional;
- }
- group(Control45)
- {
- ShowCaption = false;
- Visible = IsSellToCountyVisible;
- field("Sell-to County"; Rec."Sell-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Sell-to Country/Region Code";
- Editable = false;
- Importance = Additional;
- }
- }
- field("Sell-to Post Code"; Rec."Sell-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = false;
- Importance = Additional;
- ToolTip = 'Specifies the postal code.';
- }
- field("Sell-to Country/Region Code"; Rec."Sell-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region Code';
- Editable = false;
- Importance = Additional;
- }
- field("Sell-to Contact No."; Rec."Sell-to Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact No.';
- Editable = false;
- Importance = Additional;
- }
- field(SellToPhoneNo; SellToContact."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the contact at the customer who handles the credit memo.';
- }
- field(SellToMobilePhoneNo; SellToContact."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mobile Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the contact at the customer who handles the credit memo.';
- }
- field(SellToEmail; SellToContact."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the email address of the contact at the customer who handles the credit memo.';
- }
- }
- field("Sell-to Contact"; Rec."Sell-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = false;
- ToolTip = 'Specifies the name of the person to contact when you communicate with the customer who you shipped the items on the credit memo to.';
- }
- field("Posting Date"; Rec."Posting Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Promoted;
- ToolTip = 'Specifies the date on which the credit memo was posted.';
- }
- field("VAT Reporting Date"; Rec."VAT Reporting Date")
- {
- ApplicationArea = VAT;
- Editable = false;
- Visible = VATDateEnabled;
- Importance = Promoted;
- }
- field("Your Reference"; Rec."Your Reference")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Editable = false;
- }
- field("Document Date"; Rec."Document Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- group(Control20)
- {
- ShowCaption = false;
- Visible = DocExchStatusVisible;
- field("Document Exchange Status"; Rec."Document Exchange Status")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- StyleExpr = DocExchStatusStyle;
-
- trigger OnDrillDown()
- var
- DocExchServDocStatus: Codeunit "Doc. Exch. Serv.- Doc. Status";
- begin
- DocExchServDocStatus.DocExchStatusDrillDown(Rec);
- end;
- }
- }
- field("Pre-Assigned No."; Rec."Pre-Assigned No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- field("External Document No."; Rec."External Document No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Promoted;
- }
- field("Salesperson Code"; Rec."Salesperson Code")
- {
- ApplicationArea = Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Responsibility Center"; Rec."Responsibility Center")
- {
- ApplicationArea = Suite;
- Editable = false;
- Importance = Additional;
- }
- field(Cancelled; Rec.Cancelled)
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Style = Unfavorable;
- StyleExpr = Rec.Cancelled;
-
- trigger OnDrillDown()
- begin
- Rec.ShowCorrectiveInvoice();
- end;
- }
- field(Corrective; Rec.Corrective)
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Style = Unfavorable;
- StyleExpr = Rec.Corrective;
-
- trigger OnDrillDown()
- begin
- Rec.ShowCancelledInvoice();
- end;
- }
- field("No. Printed"; Rec."No. Printed")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- group("Work Description")
- {
- Caption = 'Work Description';
- field(GetWorkDescription; Rec.GetWorkDescription())
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- MultiLine = true;
- ShowCaption = false;
- ToolTip = 'Specifies the products or services being offered.';
- }
- }
- }
- part(SalesCrMemoLines; "Posted Sales Cr. Memo Subform")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "Document No." = field("No.");
- }
- group("Invoice Details")
- {
- Caption = 'Credit Memo Details';
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- Importance = Promoted;
-
- trigger OnAssistEdit()
- var
- UpdateCurrencyFactor: Codeunit "Update Currency Factor";
- begin
- ChangeExchangeRate.SetParameter(Rec."Currency Code", Rec."Currency Factor", Rec."Posting Date");
- ChangeExchangeRate.Editable(false);
- if ChangeExchangeRate.RunModal() = ACTION::OK then begin
- Rec."Currency Factor" := ChangeExchangeRate.GetParameter();
- UpdateCurrencyFactor.ModifyPostedSalesCreditMemo(Rec);
- end;
- Clear(ChangeExchangeRate);
- end;
- }
- field("Company Bank Account Code"; Rec."Company Bank Account Code")
- {
- ApplicationArea = Suite;
- Editable = false;
- Importance = Promoted;
- }
- field("Shortcut Dimension 1 Code"; Rec."Shortcut Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- }
- field("Shortcut Dimension 2 Code"; Rec."Shortcut Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- }
- field("Location Code"; Rec."Location Code")
- {
- ApplicationArea = Location;
- Editable = false;
- Importance = Promoted;
- }
- field("Customer Posting Group"; Rec."Customer Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Applies-to Doc. Type"; Rec."Applies-to Doc. Type")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Promoted;
- }
- field("Applies-to Doc. No."; Rec."Applies-to Doc. No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Promoted;
- }
- field("Payment Method Code"; Rec."Payment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Transaction Mode"; Rec."Transaction Mode")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ToolTip = 'Specifies the transaction mode used in telebanking.';
- }
- field("Bank Account"; Rec."Bank Account")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ToolTip = 'Specifies the customer''s bank account used for payments and collections through telebanking.';
- }
- field("EU 3-Party Trade"; Rec."EU 3-Party Trade")
- {
- ApplicationArea = BasicEU;
- Editable = false;
- }
- field("Tax Liable"; Rec."Tax Liable")
- {
- ApplicationArea = SalesTax;
- Editable = false;
- }
- field("Tax Area Code"; Rec."Tax Area Code")
- {
- ApplicationArea = SalesTax;
- Editable = false;
- }
- field(Correction; Rec.Correction)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- }
- group("Shipping and Billing")
- {
- Caption = 'Shipping and Billing';
- group("Ship-to")
- {
- Caption = 'Ship-to';
- field("Ship-to Name"; Rec."Ship-to Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name';
- Editable = false;
- ToolTip = 'Specifies the name of the customer that the items were shipped to.';
- }
- field("Ship-to Name 2"; Rec."Ship-to Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name 2';
- Editable = false;
- Importance = Additional;
- Visible = false;
- }
- field("Ship-to Address"; Rec."Ship-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = false;
- }
- field("Ship-to Address 2"; Rec."Ship-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = false;
- }
- field("Ship-to City"; Rec."Ship-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = false;
- }
- group(Control48)
- {
- ShowCaption = false;
- Visible = IsShipToCountyVisible;
- field("Ship-to County"; Rec."Ship-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Ship-to Country/Region Code";
- Editable = false;
- }
- }
- field("Ship-to Post Code"; Rec."Ship-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = false;
- ToolTip = 'Specifies the postal code.';
- }
- field("Ship-to Country/Region Code"; Rec."Ship-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Editable = false;
- }
- field("Ship-to Phone No."; Rec."Ship-to Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Editable = false;
- }
- field("Ship-to Contact"; Rec."Ship-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = false;
- }
- }
- group("Bill-to")
- {
- Caption = 'Bill-to';
- field("Bill-to Name"; Rec."Bill-to Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name';
- Editable = false;
- Importance = Promoted;
- ToolTip = 'Specifies the name of the customer that the credit memo was sent to.';
- }
- field("Bill-to Name 2"; Rec."Bill-to Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name 2';
- Editable = false;
- Importance = Additional;
- Visible = false;
- }
- field("Bill-to Address"; Rec."Bill-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = false;
- Importance = Additional;
- }
- field("Bill-to Address 2"; Rec."Bill-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = false;
- Importance = Additional;
- }
- field("Bill-to City"; Rec."Bill-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = false;
- Importance = Additional;
- }
- group(Control60)
- {
- ShowCaption = false;
- Visible = IsBillToCountyVisible;
- field("Bill-to County"; Rec."Bill-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Bill-to Country/Region Code";
- Editable = false;
- Importance = Additional;
- }
- }
- field("Bill-to Post Code"; Rec."Bill-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = false;
- Importance = Additional;
- ToolTip = 'Specifies the postal code.';
- }
- field("Bill-to Country/Region Code"; Rec."Bill-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Editable = false;
- Importance = Additional;
- }
- field("Bill-to Contact No."; Rec."Bill-to Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact No.';
- Editable = false;
- Importance = Additional;
- }
- field(BillToContactPhoneNo; BillToContact."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the contact at the customer who handles the credit memo.';
- }
- field(BillToContactMobilePhoneNo; BillToContact."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mobile Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the contact at the customer who handles the credit memo.';
- }
- field(BillToContactEmail; BillToContact."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the email address of the contact at the customer who handles the credit memo.';
- }
- field("Bill-to Contact"; Rec."Bill-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = false;
- }
- }
- group("Shipment Method")
- {
- Caption = 'Shipment Method';
- field("Shipment Method Code"; Rec."Shipment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Code';
- Editable = false;
- }
- field("Shipping Agent Code"; Rec."Shipping Agent Code")
- {
- ApplicationArea = Suite;
- Caption = 'Agent';
- Editable = false;
- Importance = Additional;
- }
- field("Shipping Agent Service Code"; Rec."Shipping Agent Service Code")
- {
- ApplicationArea = Suite;
- Caption = 'Agent Service';
- Editable = false;
- Importance = Additional;
- }
- field("Package Tracking No."; Rec."Package Tracking No.")
- {
- ApplicationArea = Suite;
- Editable = false;
- Importance = Additional;
- }
- }
- }
- }
- area(factboxes)
- {
- part("Attached Documents List"; "Doc. Attachment List Factbox")
- {
- ApplicationArea = All;
- Caption = 'Documents';
- UpdatePropagation = Both;
- SubPageLink = "Table ID" = const(Database::"Sales Cr.Memo Header"),
- "No." = field("No.");
- }
- part(IncomingDocAttachFactBox; "Incoming Doc. Attach. FactBox")
- {
- ApplicationArea = Basic, Suite;
- ShowFilter = false;
- Visible = not IsOfficeAddin;
- }
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("&Cr. Memo")
- {
- Caption = '&Cr. Memo';
- Image = CreditMemo;
- action(Statistics)
- {
- ApplicationArea = Suite;
- Caption = 'Statistics';
- Image = Statistics;
- RunObject = Page "Sales Credit Memo Statistics";
- RunPageLink = "No." = field("No.");
- ShortCutKey = 'F7';
- ToolTip = 'View statistical information, such as the value of posted entries, for the record.';
- }
- action("Co&mments")
- {
- ApplicationArea = Comments;
- Caption = 'Co&mments';
- Image = ViewComments;
- RunObject = Page "Sales Comment Sheet";
- RunPageLink = "Document Type" = const("Posted Credit Memo"),
- "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.ShowDimensions();
- end;
- }
- action(Approvals)
- {
- AccessByPermission = TableData "Posted 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.ShowPostedApprovalEntries(Rec.RecordId);
- 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;
- }
- }
- }
- area(processing)
- {
- group("F&unctions")
- {
- Caption = 'F&unctions';
- Image = "Action";
- action("&Track Package")
- {
- ApplicationArea = Basic, Suite;
- Caption = '&Track Package';
- Image = ItemTracking;
- ToolTip = 'Open the shipping agent''s tracking page to track the package. ';
-
- trigger OnAction()
- begin
- Rec.StartTrackingSite();
- end;
- }
- }
- action(Customer)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer';
- Image = Customer;
- RunObject = Page "Customer Card";
- RunPageLink = "No." = field("Sell-to Customer No.");
- ShortCutKey = 'Shift+F7';
- ToolTip = 'View or edit detailed information about the customer.';
- }
- action(SendCustom)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Send';
- Ellipsis = true;
- Image = SendToMultiple;
- ToolTip = '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()
- var
- SalesCrMemoHeader: Record "Sales Cr.Memo Header";
- begin
- SalesCrMemoHeader := Rec;
- CurrPage.SetSelectionFilter(SalesCrMemoHeader);
- SalesCrMemoHeader.SendRecords();
- end;
- }
- action(Print)
- {
- ApplicationArea = Basic, Suite;
- 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.';
- Visible = not IsOfficeAddin;
-
- trigger OnAction()
- begin
- SalesCrMemoHeader := Rec;
- CurrPage.SetSelectionFilter(SalesCrMemoHeader);
- SalesCrMemoHeader.PrintRecords(true);
- end;
- }
- action("Send by &Email")
- {
- ApplicationArea = All;
- Caption = 'Send by &Email';
- Image = Email;
- ToolTip = 'Send the sales credit memo document as a PDF file attached to an email.';
-
- trigger OnAction()
- begin
- SalesCrMemoHeader := Rec;
- CurrPage.SetSelectionFilter(SalesCrMemoHeader);
- SalesCrMemoHeader.EmailRecords(true);
- end;
- }
- action(AttachAsPDF)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Attach as PDF';
- Image = PrintAttachment;
- ToolTip = 'Create a PDF file and attach it to the document.';
-
- trigger OnAction()
- var
- SalesCrMemoHeader: Record "Sales Cr.Memo Header";
- begin
- SalesCrMemoHeader := Rec;
- SalesCrMemoHeader.SetRecFilter();
- Rec.PrintToDocumentAttachment(SalesCrMemoHeader);
- end;
- }
- action("&Navigate")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Find entries...';
- Image = Navigate;
- ShortCutKey = 'Ctrl+Alt+Q';
- ToolTip = 'Find entries and documents that exist for the document number and posting date on the selected document. (Formerly this action was named Navigate.)';
- Visible = not IsOfficeAddin;
-
- trigger OnAction()
- begin
- Rec.Navigate();
- end;
- }
- action("Update Document")
- {
- ApplicationArea = Suite;
- Caption = 'Update Document';
- Image = Edit;
- ToolTip = 'Add new information that is relevant to the document, such as information from the shipping agent. You can only edit a few fields because the document has already been posted.';
-
- trigger OnAction()
- var
- PstdSalesCrMemoUpdate: Page "Pstd. Sales Cr. Memo - Update";
- begin
- PstdSalesCrMemoUpdate.LookupMode := true;
- PstdSalesCrMemoUpdate.SetRec(Rec);
- PstdSalesCrMemoUpdate.RunModal();
- end;
- }
- action(ActivityLog)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Activity Log';
- Image = Log;
- ToolTip = 'View the status and any errors if the document was sent as an electronic document or OCR file through the document exchange service.';
-
- trigger OnAction()
- begin
- Rec.ShowActivityLog();
- end;
- }
- group(Cancel)
- {
- Caption = 'Cancel';
- action(CancelCrMemo)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Cancel';
- Image = Cancel;
- ToolTip = 'Create and post a sales invoice that reverses this posted sales credit memo. This posted sales credit memo will be canceled.';
- Visible = not Rec.Cancelled and Rec.Corrective;
-
- trigger OnAction()
- begin
- CODEUNIT.Run(CODEUNIT::"Cancel PstdSalesCrM (Yes/No)", Rec);
- end;
- }
- action(ShowInvoice)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Show Canceled/Corrective Invoice';
- Image = Invoice;
- Scope = Repeater;
- ToolTip = 'Open the posted sales invoice that was created when you canceled the posted sales credit memo. If the posted sales credit memo is the result of a canceled sales invoice, then canceled invoice will open.';
- Visible = Rec.Cancelled or Rec.Corrective;
-
- trigger OnAction()
- begin
- Rec.ShowCanceledOrCorrInvoice();
- end;
- }
- }
- group(IncomingDocument)
- {
- Caption = 'Incoming Document';
- Image = Documents;
- action(IncomingDocCard)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'View Incoming Document';
- Enabled = HasIncomingDocument;
- Image = ViewOrder;
- ToolTip = 'View any incoming document records and file attachments that exist for the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.ShowCard(Rec."No.", Rec."Posting Date");
- end;
- }
- action(SelectIncomingDoc)
- {
- AccessByPermission = TableData "Incoming Document" = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Select Incoming Document';
- Enabled = not HasIncomingDocument;
- Image = SelectLineToApply;
- ToolTip = 'Select an incoming document record and file attachment that you want to link to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.SelectIncomingDocumentForPostedDocument(Rec."No.", Rec."Posting Date", Rec.RecordId);
- end;
- }
- action(IncomingDocAttachFile)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Incoming Document from File';
- Ellipsis = true;
- Enabled = not HasIncomingDocument;
- Image = Attach;
- ToolTip = 'Create an incoming document record by selecting a file to attach, and then link the incoming document record to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocumentAttachment: Record "Incoming Document Attachment";
- begin
- IncomingDocumentAttachment.NewAttachmentFromPostedDocument(Rec."No.", Rec."Posting Date");
- end;
- }
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- actionref("Update Document_Promoted"; "Update Document")
- {
- }
- actionref("&Navigate_Promoted"; "&Navigate")
- {
- }
- group(Category_Category5)
- {
- Caption = 'Cancel', Comment = 'Generated from the PromotedActionCategories property index 4.';
- ShowAs = SplitButton;
-
- actionref(CancelCrMemo_Promoted; CancelCrMemo)
- {
- }
- actionref(ShowInvoice_Promoted; ShowInvoice)
- {
- }
- }
- actionref("&Track Package_Promoted"; "&Track Package")
- {
- }
- }
- group(Category_Category7)
- {
- Caption = 'Print/Send', Comment = 'Generated from the PromotedActionCategories property index 6.';
-
- actionref(Print_Promoted; Print)
- {
- }
- actionref("Send by &Email_Promoted"; "Send by &Email")
- {
- }
- actionref(AttachAsPDF_Promoted; AttachAsPDF)
- {
- }
- actionref(SendCustom_Promoted; SendCustom)
- {
- }
- }
- group(Category_Category4)
- {
- Caption = 'Credit Memo', Comment = 'Generated from the PromotedActionCategories property index 3.';
-
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref(Statistics_Promoted; Statistics)
- {
- }
- actionref(DocAttach_Promoted; DocAttach)
- {
- }
- actionref(ActivityLog_Promoted; ActivityLog)
- {
- }
- actionref(Approvals_Promoted; Approvals)
- {
- }
- actionref("Co&mments_Promoted"; "Co&mments")
- {
- }
-
- separator(Navigate_Separator)
- {
- }
-
- actionref(Customer_Promoted; Customer)
- {
- }
- }
- group("Category_Incoming Document")
- {
- Caption = 'Incoming Document';
-
- actionref(IncomingDocAttachFile_Promoted; IncomingDocAttachFile)
- {
- }
- actionref(SelectIncomingDoc_Promoted; SelectIncomingDoc)
- {
- }
- actionref(IncomingDocCard_Promoted; IncomingDocCard)
- {
- }
- }
- group(Category_Category6)
- {
- Caption = 'Navigate', Comment = 'Generated from the PromotedActionCategories property index 5.';
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- HasIncomingDocument := IncomingDocument.PostedDocExists(Rec."No.", Rec."Posting Date");
- DocExchStatusStyle := Rec.GetDocExchStatusStyle();
- DocExchStatusVisible := Rec.DocExchangeStatusIsSent();
- CurrPage.IncomingDocAttachFactBox.PAGE.LoadDataFromRecord(Rec);
- end;
-
- trigger OnAfterGetRecord()
- begin
- DocExchStatusStyle := Rec.GetDocExchStatusStyle();
- SellToContact.GetOrClear(Rec."Sell-to Contact No.");
- BillToContact.GetOrClear(Rec."Bill-to Contact No.");
- end;
-
- trigger OnOpenPage()
- var
- OfficeMgt: Codeunit "Office Management";
- VATReportingDateMgt: Codeunit "VAT Reporting Date Mgt";
- begin
- Rec.SetSecurityFilterOnRespCenter();
- IsOfficeAddin := OfficeMgt.IsAvailable();
-
- ActivateFields();
- VATDateEnabled := VATReportingDateMgt.IsVATDateEnabled();
- end;
-
- var
- SalesCrMemoHeader: Record "Sales Cr.Memo Header";
- SellToContact: Record Contact;
- BillToContact: Record Contact;
- FormatAddress: Codeunit "Format Address";
- ChangeExchangeRate: Page "Change Exchange Rate";
- HasIncomingDocument: Boolean;
- DocExchStatusStyle: Text;
- DocExchStatusVisible: Boolean;
- IsOfficeAddin: Boolean;
- IsBillToCountyVisible: Boolean;
- IsSellToCountyVisible: Boolean;
- IsShipToCountyVisible: Boolean;
- VATDateEnabled: Boolean;
-
- local procedure ActivateFields()
- begin
- IsBillToCountyVisible := FormatAddress.UseCounty(Rec."Bill-to Country/Region Code");
- IsSellToCountyVisible := FormatAddress.UseCounty(Rec."Sell-to Country/Region Code");
- IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Sales/History/PostedSalesInvoice.Page.al b/src/Layers/NL/BaseApp/Sales/History/PostedSalesInvoice.Page.al
deleted file mode 100644
index 08acef71e3..0000000000
--- a/src/Layers/NL/BaseApp/Sales/History/PostedSalesInvoice.Page.al
+++ /dev/null
@@ -1,1383 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.History;
-
-using Microsoft.Bank.Setup;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Outlook;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.VAT.Calculation;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Attachment;
-using Microsoft.Integration.Dataverse;
-using Microsoft.Inventory.Location;
-using Microsoft.Sales.Comment;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.Document;
-using System.Automation;
-
-///
-/// Displays a single posted sales invoice document with header and line details.
-///
-page 132 "Posted Sales Invoice"
-{
- Caption = 'Posted Sales Invoice';
- InsertAllowed = false;
- PageType = Document;
- RefreshOnActivate = true;
- SourceTable = "Sales Invoice Header";
-
- AboutTitle = 'About posted sales invoice details';
- AboutText = 'This sales invoice is posted and counting in the books. You can''t edit it directly, but you can post corrections if you have to make adjustments.';
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field("No."; Rec."No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Promoted;
- ToolTip = 'Specifies the posted invoice number.';
- }
- field("Sell-to Customer No."; Rec."Sell-to Customer No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer No.';
- Editable = false;
- Visible = false;
- }
- field("Sell-to Customer Name"; Rec."Sell-to Customer Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer';
- Editable = false;
- Importance = Promoted;
- TableRelation = Customer.Name;
- }
- field("Sell-to Customer Name 2"; Rec."Sell-to Customer Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer Name 2';
- Editable = false;
- Visible = false;
- }
- field("VAT Registration No."; Rec."VAT Registration No.")
- {
- ApplicationArea = VAT;
- Editable = false;
- Importance = Additional;
- Visible = false;
- }
- group("Sell-to")
- {
- Caption = 'Sell-to';
- field("Sell-to Address"; Rec."Sell-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = false;
- Importance = Additional;
- }
- field("Sell-to Address 2"; Rec."Sell-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = false;
- Importance = Additional;
- }
- field("Sell-to City"; Rec."Sell-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = false;
- Importance = Additional;
- }
- group(Control88)
- {
- ShowCaption = false;
- Visible = IsSellToCountyVisible;
- field("Sell-to County"; Rec."Sell-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Sell-to Country/Region Code";
- Editable = false;
- Importance = Additional;
- }
- }
- field("Sell-to Post Code"; Rec."Sell-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = false;
- Importance = Additional;
- ToolTip = 'Specifies the postal code.';
- }
- field("Sell-to Country/Region Code"; Rec."Sell-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Editable = false;
- Importance = Additional;
- }
- field("Sell-to Contact No."; Rec."Sell-to Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact No.';
- Editable = false;
- Importance = Additional;
- }
- field(SellToPhoneNo; SellToContact."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the contact person at the customer the invoice was sent to.';
- }
- field(SellToMobilePhoneNo; SellToContact."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mobile Phone No.';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the contact person at the customer the invoice was sent to.';
- }
- field(SellToEmail; SellToContact."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email';
- Importance = Additional;
- Editable = false;
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the email address of the contact person at the customer the invoice was sent to.';
- }
- }
- field("Sell-to Contact"; Rec."Sell-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = false;
- ToolTip = 'Specifies the name of the contact person at the customer the invoice was sent to.';
- }
- field("Your Reference"; Rec."Your Reference")
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Editable = false;
- }
- field("Document Date"; Rec."Document Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Posting Date"; Rec."Posting Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("VAT Reporting Date"; Rec."VAT Reporting Date")
- {
- ApplicationArea = VAT;
- Editable = false;
- Visible = VATDateEnabled;
- }
- field("Due Date"; Rec."Due Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Promoted;
- }
- field("Promised Pay Date"; Rec."Promised Pay Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Promoted;
- }
- group(Control3)
- {
- ShowCaption = false;
- Visible = DocExcStatusVisible;
- field("Document Exchange Status"; Rec."Document Exchange Status")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- StyleExpr = DocExchStatusStyle;
-
- trigger OnDrillDown()
- var
- DocExchServDocStatus: Codeunit "Doc. Exch. Serv.- Doc. Status";
- begin
- DocExchServDocStatus.DocExchStatusDrillDown(Rec);
- end;
- }
- }
- field("Quote No."; Rec."Quote No.")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Order No."; Rec."Order No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Promoted;
- ToolTip = 'Specifies the number of the sales order that this invoice was posted from.';
- }
- field("Pre-Assigned No."; Rec."Pre-Assigned No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- field("External Document No."; Rec."External Document No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Salesperson Code"; Rec."Salesperson Code")
- {
- ApplicationArea = Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Responsibility Center"; Rec."Responsibility Center")
- {
- AccessByPermission = TableData "Responsibility Center" = R;
- ApplicationArea = Suite;
- Editable = false;
- Importance = Additional;
- }
- field("No. Printed"; Rec."No. Printed")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- field(Cancelled; Rec.Cancelled)
- {
- ApplicationArea = Basic, Suite;
- Style = Unfavorable;
- StyleExpr = Rec.Cancelled;
- AboutTitle = 'Canceled invoice';
- AboutText = 'If an invoice is canceled, here''s a link to the associated credit memo that shows if the sales invoice was credited partly or in full.';
-
- trigger OnDrillDown()
- begin
- Rec.ShowCorrectiveCreditMemo();
- end;
- }
- field(Corrective; Rec.Corrective)
- {
- ApplicationArea = Basic, Suite;
- Importance = Additional;
- Style = Unfavorable;
- StyleExpr = Rec.Corrective;
-
- trigger OnDrillDown()
- begin
- Rec.ShowCancelledCreditMemo();
- end;
- }
- field(Closed; Rec.Closed)
- {
- ApplicationArea = Basic, Suite;
- DrillDown = false;
- Importance = Promoted;
- AboutTitle = 'Closed means paid';
- AboutText = 'A sales invoice is marked as *Closed* when the invoice is paid in full, or when a credit memo is applied for the remaining amount.';
- }
- field("Dispute Status"; Rec."Dispute Status")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- DrillDown = false;
- Importance = Promoted;
- Tooltip = 'Specifies if there is an ongoing dispute for this Invoice';
- }
- group("Work Description")
- {
- Caption = 'Work Description';
- field(GetWorkDescription; Rec.GetWorkDescription())
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- MultiLine = true;
- ShowCaption = false;
- }
- }
- }
- part(SalesInvLines; "Posted Sales Invoice Subform")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "Document No." = field("No.");
- }
- group("Invoice Details")
- {
- Caption = 'Invoice Details';
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- Editable = false;
- Importance = Promoted;
-
- trigger OnAssistEdit()
- var
- UpdateCurrencyFactor: Codeunit "Update Currency Factor";
- begin
- ChangeExchangeRate.SetParameter(Rec."Currency Code", Rec."Currency Factor", Rec."Posting Date");
- ChangeExchangeRate.Editable(false);
- if ChangeExchangeRate.RunModal() = ACTION::OK then begin
- Rec."Currency Factor" := ChangeExchangeRate.GetParameter();
- UpdateCurrencyFactor.ModifyPostedSalesInvoice(Rec);
- end;
- Clear(ChangeExchangeRate);
- end;
- }
- field("Company Bank Account Code"; Rec."Company Bank Account Code")
- {
- ApplicationArea = Suite;
- Editable = false;
- Importance = Promoted;
- }
- field("Shipment Date"; Rec."Shipment Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Promoted;
- }
- field("Payment Terms Code"; Rec."Payment Terms Code")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Promoted;
- }
- field("Payment Method Code"; Rec."Payment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- group(Control15)
- {
- ShowCaption = false;
- Visible = PaymentServiceVisible;
- field(SelectedPayments; Rec.GetSelectedPaymentsText())
- {
- ApplicationArea = All;
- Caption = 'Payment Service';
- Editable = false;
- Enabled = PaymentServiceEnabled;
- MultiLine = true;
- ToolTip = 'Specifies the payment service, such as PayPal, that the sales invoice can be paid with.';
-
- trigger OnAssistEdit()
- var
- PaymentServiceSetup: Record "Payment Service Setup";
- begin
- PaymentServiceSetup.ChangePaymentServicePostedInvoice(Rec);
- CurrPage.Update(false);
- end;
- }
- }
- field("Shortcut Dimension 1 Code"; Rec."Shortcut Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- }
- field("Shortcut Dimension 2 Code"; Rec."Shortcut Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- }
- field("Payment Discount %"; Rec."Payment Discount %")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Pmt. Discount Date"; Rec."Pmt. Discount Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Importance = Additional;
- }
- field("Direct Debit Mandate ID"; Rec."Direct Debit Mandate ID")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Customer Posting Group"; Rec."Customer Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Tax Liable"; Rec."Tax Liable")
- {
- ApplicationArea = SalesTax;
- Editable = false;
- }
- field("Tax Area Code"; Rec."Tax Area Code")
- {
- ApplicationArea = SalesTax;
- Editable = false;
- }
- field("Location Code"; Rec."Location Code")
- {
- ApplicationArea = Location;
- Editable = false;
- Importance = Additional;
- }
- field("Transaction Mode"; Rec."Transaction Mode")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ToolTip = 'Specifies the transaction mode used in telebanking.';
- }
- field("Bank Account"; Rec."Bank Account")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ToolTip = 'Specifies the customer''s bank account used for payments and collections through telebanking.';
- }
- }
- group("Shipping and Billing")
- {
- Caption = 'Shipping and Billing';
- group("Shipping Details")
- {
- Caption = 'Shipping Details';
- field("Shipment Method Code"; Rec."Shipment Method Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Method';
- Editable = false;
- Importance = Additional;
- }
- field("Shipping Agent Code"; Rec."Shipping Agent Code")
- {
- ApplicationArea = Suite;
- Caption = 'Agent';
- Editable = false;
- Importance = Additional;
- }
- field("Shipping Agent Service Code"; Rec."Shipping Agent Service Code")
- {
- ApplicationArea = Suite;
- Caption = 'Agent Service';
- Editable = false;
- Importance = Additional;
- }
- field("Package Tracking No."; Rec."Package Tracking No.")
- {
- ApplicationArea = Suite;
- Editable = false;
- Importance = Additional;
- }
- }
- group("Ship-to")
- {
- Caption = 'Ship-to';
- field("Ship-to Code"; Rec."Ship-to Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address Code';
- Editable = false;
- Importance = Promoted;
- }
- field("Ship-to Name"; Rec."Ship-to Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name';
- Editable = false;
- ToolTip = 'Specifies the name of the customer that the items were shipped to.';
- }
- field("Ship-to Name 2"; Rec."Ship-to Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name 2';
- Editable = false;
- Importance = Additional;
- Visible = false;
- }
- field("Ship-to Address"; Rec."Ship-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = false;
- }
- field("Ship-to Address 2"; Rec."Ship-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = false;
- }
- field("Ship-to City"; Rec."Ship-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = false;
- }
- group(Control93)
- {
- ShowCaption = false;
- Visible = IsShipToCountyVisible;
- }
- field("Ship-to County"; Rec."Ship-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Ship-to Country/Region Code";
- Editable = false;
- }
- field("Ship-to Post Code"; Rec."Ship-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = false;
- ToolTip = 'Specifies the postal code.';
- }
- field("Ship-to Country/Region Code"; Rec."Ship-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Editable = false;
- }
- field("Ship-to Phone No."; Rec."Ship-to Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Editable = false;
- }
- field("Ship-to Contact"; Rec."Ship-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = false;
- }
- }
- group("Bill-to")
- {
- Caption = 'Bill-to';
- field("Bill-to Name"; Rec."Bill-to Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name';
- Editable = false;
- Importance = Promoted;
- ToolTip = 'Specifies the name of the customer that the invoice was sent to.';
- }
- field("Bill-to Name 2"; Rec."Bill-to Name 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Name 2';
- Editable = false;
- Importance = Additional;
- Visible = false;
- }
- field("Bill-to Address"; Rec."Bill-to Address")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address';
- Editable = false;
- Importance = Additional;
- }
- field("Bill-to Address 2"; Rec."Bill-to Address 2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Address 2';
- Editable = false;
- Importance = Additional;
- }
- field("Bill-to City"; Rec."Bill-to City")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'City';
- Editable = false;
- Importance = Additional;
- }
- group(Control95)
- {
- ShowCaption = false;
- Visible = IsBillToCountyVisible;
- field("Bill-to County"; Rec."Bill-to County")
- {
- ApplicationArea = Basic, Suite;
- CaptionClass = '5,1,' + Rec."Bill-to Country/Region Code";
- Editable = false;
- Importance = Additional;
- }
- }
- field("Bill-to Post Code"; Rec."Bill-to Post Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Post Code';
- Editable = false;
- Importance = Additional;
- ToolTip = 'Specifies the postal code.';
- }
- field("Bill-to Country/Region Code"; Rec."Bill-to Country/Region Code")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Country/Region';
- Editable = false;
- Importance = Additional;
- }
- field("Bill-to Contact No."; Rec."Bill-to Contact No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact No.';
- Editable = false;
- Importance = Additional;
- }
- field("Bill-to Contact"; Rec."Bill-to Contact")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Contact';
- Editable = false;
- ToolTip = 'Specifies the name of the person you regularly contact when you communicate with the customer to whom the invoice was sent.';
- }
- field(BillToContactPhoneNo; BillToContact."Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the person you regularly contact when you communicate with the customer to whom the invoice was sent.';
- }
- field(BillToContactMobilePhoneNo; BillToContact."Mobile Phone No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Mobile Phone No.';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the mobile telephone number of the person you regularly contact when you communicate with the customer to whom the invoice was sent.';
- }
- field(BillToContactEmail; BillToContact."E-Mail")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Email';
- Editable = false;
- Importance = Additional;
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the email address of the person you regularly contact when you communicate with the customer to whom the invoice was sent.';
- }
- }
- }
- group("Foreign Trade")
- {
- Caption = 'Foreign Trade';
- field("EU 3-Party Trade"; Rec."EU 3-Party Trade")
- {
- ApplicationArea = BasicEU;
- Editable = false;
- }
- field("Transaction Specification"; Rec."Transaction Specification")
- {
- ApplicationArea = BasicEU;
- Editable = false;
- }
- field("Transport Method"; Rec."Transport Method")
- {
- ApplicationArea = BasicEU;
- Editable = false;
- }
- field("Exit Point"; Rec."Exit Point")
- {
- ApplicationArea = BasicEU;
- Editable = false;
- }
- field("Area"; Rec.Area)
- {
- ApplicationArea = BasicEU;
- Editable = false;
- }
- }
- }
- area(factboxes)
- {
- part("Attached Documents List"; "Doc. Attachment List Factbox")
- {
- ApplicationArea = All;
- Caption = 'Documents';
- UpdatePropagation = Both;
- SubPageLink = "Table ID" = const(Database::"Sales Invoice Header"),
- "No." = field("No.");
- }
- part(IncomingDocAttachFactBox; "Incoming Doc. Attach. FactBox")
- {
- ApplicationArea = Basic, Suite;
- ShowFilter = false;
- Visible = not IsOfficeAddin;
- }
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("&Invoice")
- {
- Caption = '&Invoice';
- Image = Invoice;
- action(Statistics)
- {
- ApplicationArea = Suite;
- Caption = 'Statistics';
- Image = Statistics;
- RunObject = Page "Sales Invoice Statistics";
- RunPageLink = "No." = field("No.");
- ShortCutKey = 'F7';
- ToolTip = 'View statistical information, such as the value of posted entries, for the record.';
- }
- action("Co&mments")
- {
- ApplicationArea = Comments;
- Caption = 'Co&mments';
- Image = ViewComments;
- RunObject = Page "Sales Comment Sheet";
- RunPageLink = "Document Type" = const("Posted Invoice"),
- "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.ShowDimensions();
- end;
- }
- action(Approvals)
- {
- AccessByPermission = TableData "Posted 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.ShowPostedApprovalEntries(Rec.RecordId);
- 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;
- }
- separator(Action171)
- {
- }
- action(ChangePaymentService)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Change Payment Service';
- Image = ElectronicPayment;
- ToolTip = 'Change or add the payment service, such as PayPal Standard, that will be included on the sales document so the customer can quickly access the payment site.';
- Visible = PaymentServiceVisible;
-
- trigger OnAction()
- var
- PaymentServiceSetup: Record "Payment Service Setup";
- begin
- PaymentServiceSetup.ChangePaymentServicePostedInvoice(Rec);
- end;
- }
- }
- group(ActionGroupCRM)
- {
- Caption = 'Dynamics 365 Sales';
- Visible = CRMIntegrationEnabled;
- action(CRMGotoInvoice)
- {
- ApplicationArea = Suite;
- Caption = 'Invoice';
- Enabled = CRMIsCoupledToRecord;
- Image = CoupledSalesInvoice;
- ToolTip = 'Open the coupled Dynamics 365 Sales invoice.';
-
- trigger OnAction()
- var
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- begin
- CRMIntegrationManagement.ShowCRMEntityFromRecordID(Rec.RecordId);
- end;
- }
- action(CreateInCRM)
- {
- ApplicationArea = Suite;
- Caption = 'Create Invoice in Dynamics 365 Sales';
- Enabled = not CRMIsCoupledToRecord;
- Image = NewSalesInvoice;
- ToolTip = 'Create a sales invoice in Dynamics 365 Sales that is connected to this posted sales invoice.';
-
- trigger OnAction()
- var
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- begin
- CRMIntegrationManagement.CreateNewRecordsInCRM(Rec.RecordId);
- end;
- }
- action(ShowLog)
- {
- ApplicationArea = Suite;
- Caption = 'Synchronization Log';
- Image = Log;
- ToolTip = 'View integration synchronization jobs for the posted sales invoice table.';
-
- trigger OnAction()
- var
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- begin
- CRMIntegrationManagement.ShowLog(Rec.RecordId);
- end;
- }
- }
- }
- area(processing)
- {
- group("F&unctions")
- {
- Caption = 'F&unctions';
- Image = "Action";
- action("&Track Package")
- {
- ApplicationArea = Basic, Suite;
- Caption = '&Track Package';
- Image = ItemTracking;
- ToolTip = 'Open the shipping agent''s tracking page to track the package. ';
-
- trigger OnAction()
- begin
- Rec.StartTrackingSite();
- end;
- }
- }
- action(SendCustom)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Send';
- Ellipsis = true;
- Image = SendToMultiple;
- ToolTip = '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()
- var
- SalesInvHeader: Record "Sales Invoice Header";
- begin
- SalesInvHeader := Rec;
- CurrPage.SetSelectionFilter(SalesInvHeader);
- SalesInvHeader.SendRecords();
- end;
- }
- action(Print)
- {
- ApplicationArea = Basic, Suite;
- 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.';
- Visible = not IsOfficeAddin;
-
- trigger OnAction()
- var
- IsHandled: Boolean;
- begin
- SalesInvHeader := Rec;
- CurrPage.SetSelectionFilter(SalesInvHeader);
- IsHandled := false;
- OnBeforeSalesInvHeaderPrintRecords(SalesInvHeader, IsHandled);
- if not IsHandled then
- SalesInvHeader.PrintRecords(true);
- end;
- }
- action(Email)
- {
- ApplicationArea = Basic, Suite;
- Caption = '&Email';
- Image = Email;
- ToolTip = 'Prepare to email the document. The Send Email window opens prefilled with the customer''s email address so you can add or edit information.';
-
- trigger OnAction()
- begin
- SalesInvHeader := Rec;
- CurrPage.SetSelectionFilter(SalesInvHeader);
- SalesInvHeader.EmailRecords(true);
- end;
- }
- action(AttachAsPDF)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Attach as PDF';
- Image = PrintAttachment;
- ToolTip = 'Create a PDF file and attach it to the document.';
-
- trigger OnAction()
- var
- SalesInvoiceHeader: Record "Sales Invoice Header";
- begin
- SalesInvoiceHeader := Rec;
- SalesInvoiceHeader.SetRecFilter();
- Rec.PrintToDocumentAttachment(SalesInvoiceHeader);
- end;
- }
- action("&Navigate")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Find entries...';
- Image = Navigate;
- ShortCutKey = 'Ctrl+Alt+Q';
- AboutTitle = 'Get detailed posting details';
- AboutText = 'Here, you can look up the ledger entries that were created when this invoice was posted, as well as any related documents.';
- ToolTip = 'Find entries and documents that exist for the document number and posting date on the selected document. (Formerly this action was named Navigate.)';
- Visible = not IsOfficeAddin;
-
- trigger OnAction()
- begin
- Rec.Navigate();
- end;
- }
- action(ActivityLog)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Activity Log';
- Image = Log;
- ToolTip = 'View the status and any errors if the document was sent as an electronic document or OCR file through the document exchange service.';
-
- trigger OnAction()
- begin
- Rec.ShowActivityLog();
- end;
- }
- action("Update Document")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Update Document';
- Image = Edit;
- ToolTip = 'Add new information that is relevant to the document, such as a payment reference. You can only edit a few fields because the document has already been posted.';
-
- trigger OnAction()
- var
- PostedSalesInvUpdate: Page "Posted Sales Inv. - Update";
- begin
- PostedSalesInvUpdate.LookupMode := true;
- PostedSalesInvUpdate.SetRec(Rec);
- PostedSalesInvUpdate.RunModal();
- end;
- }
- group(IncomingDocument)
- {
- Caption = 'Incoming Document';
- Image = Documents;
- action(IncomingDocCard)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'View Incoming Document';
- Enabled = HasIncomingDocument;
- Image = ViewOrder;
- ToolTip = 'View any incoming document records and file attachments that exist for the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.ShowCard(Rec."No.", Rec."Posting Date");
- end;
- }
- action(SelectIncomingDoc)
- {
- AccessByPermission = TableData "Incoming Document" = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Select Incoming Document';
- Enabled = not HasIncomingDocument;
- Image = SelectLineToApply;
- ToolTip = 'Select an incoming document record and file attachment that you want to link to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.SelectIncomingDocumentForPostedDocument(Rec."No.", Rec."Posting Date", Rec.RecordId);
- end;
- }
- action(IncomingDocAttachFile)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Incoming Document from File';
- Ellipsis = true;
- Enabled = not HasIncomingDocument;
- Image = Attach;
- ToolTip = 'Create an incoming document record by selecting a file to attach, and then link the incoming document record to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocumentAttachment: Record "Incoming Document Attachment";
- begin
- IncomingDocumentAttachment.NewAttachmentFromPostedDocument(Rec."No.", Rec."Posting Date");
- end;
- }
- }
- group(Correct)
- {
- Caption = 'Correct';
- action(CorrectInvoice)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Correct';
- Image = Undo;
- AboutTitle = 'Correct an invoice';
- AboutText = 'If you have to make adjustments to this invoice, you can post a correction or cancel the invoice entirely. In both cases, a credit memo is created to represent the adjustment you make.';
- ToolTip = 'Reverse this posted invoice. A credit memo will be created and matched with the invoice, and the invoice will be canceled. Shipments for the invoice will be reversed. To create a new invoice with the same information, use the Copy function. When you copy an invoice, remember to post shipments for the new invoice.';
- Visible = not Rec.Cancelled;
-
- trigger OnAction()
- var
- CorrectPstdSalesInvYesNo: Codeunit "Correct PstdSalesInv (Yes/No)";
- begin
- if CorrectPstdSalesInvYesNo.CorrectInvoice(Rec) then
- CurrPage.Close();
- end;
- }
- action(CancelInvoice)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Cancel';
- Image = Cancel;
- ToolTip = 'Create and post a sales credit memo that reverses this posted sales invoice. This posted sales invoice will be canceled.';
- Visible = not Rec.Cancelled;
-
- trigger OnAction()
- var
- CancelPstdSalesInvYesNo: Codeunit "Cancel PstdSalesInv (Yes/No)";
- begin
- if CancelPstdSalesInvYesNo.CancelInvoice(Rec) then
- CurrPage.Close();
- end;
- }
- action(CreateCreditMemo)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Corrective Credit Memo';
- Image = CreateCreditMemo;
- ToolTip = 'Create a credit memo for this posted invoice that you complete and post manually to reverse the posted invoice.';
-
- trigger OnAction()
- var
- SalesHeader: Record "Sales Header";
- CorrectPostedSalesInvoice: Codeunit "Correct Posted Sales Invoice";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateCreditMemoOnAction(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if CorrectPostedSalesInvoice.CreateCreditMemoCopyDocument(Rec, SalesHeader) then begin
- PAGE.Run(PAGE::"Sales Credit Memo", SalesHeader);
- CurrPage.Close();
- end;
- end;
- }
- action(ShowCreditMemo)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Show Canceled/Corrective Credit Memo';
- Image = CreditMemo;
- ToolTip = 'Open the posted sales credit memo that was created when you canceled the posted sales invoice. If the posted sales invoice is the result of a canceled sales credit memo, then the canceled sales credit memo will open.';
- Visible = Rec.Cancelled or Rec.Corrective;
-
- trigger OnAction()
- begin
- Rec.ShowCanceledOrCorrCrMemo();
- end;
- }
- }
- group(Invoice)
- {
- Caption = 'Invoice';
- Image = Invoice;
- action(Customer)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer';
- Image = Customer;
- RunObject = Page "Customer Card";
- RunPageLink = "No." = field("Sell-to Customer No.");
- ShortCutKey = 'Shift+F7';
- ToolTip = 'View or edit detailed information about the customer.';
- }
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- actionref("Update Document_Promoted"; "Update Document")
- {
- }
- group(Category_Category5)
- {
- Caption = 'Correct', Comment = 'Generated from the PromotedActionCategories property index 4.';
- ShowAs = SplitButton;
-
- actionref(CorrectInvoice_Promoted; CorrectInvoice)
- {
- }
- actionref(CancelInvoice_Promoted; CancelInvoice)
- {
- }
- actionref(CreateCreditMemo_Promoted; CreateCreditMemo)
- {
- }
- actionref(ShowCreditMemo_Promoted; ShowCreditMemo)
- {
- }
- }
- actionref("&Navigate_Promoted"; "&Navigate")
- {
- }
- actionref("&Track Package_Promoted"; "&Track Package")
- {
- }
- actionref(ChangePaymentService_Promoted; ChangePaymentService)
- {
- }
- }
- group(Category_Category6)
- {
- Caption = 'Print/Send', Comment = 'Generated from the PromotedActionCategories property index 5.';
-
- actionref(Print_Promoted; Print)
- {
- }
- actionref(Email_Promoted; Email)
- {
- }
- actionref(AttachAsPDF_Promoted; AttachAsPDF)
- {
- }
- actionref(SendCustom_Promoted; SendCustom)
- {
- }
- }
- group(Category_Category4)
- {
- Caption = 'Invoice', Comment = 'Generated from the PromotedActionCategories property index 3.';
-
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref(Statistics_Promoted; Statistics)
- {
- }
- actionref("Co&mments_Promoted"; "Co&mments")
- {
- }
- actionref(DocAttach_Promoted; DocAttach)
- {
- }
- actionref(Approvals_Promoted; Approvals)
- {
- }
- actionref(ActivityLog_Promoted; ActivityLog)
- {
- }
- separator(Navigate_Separator)
- {
- }
- actionref(Customer_Promoted; Customer)
- {
- }
- }
- group("Category_Incoming Document")
- {
- Caption = 'Incoming Document';
-
- actionref(SelectIncomingDoc_Promoted; SelectIncomingDoc)
- {
- }
- actionref(IncomingDocAttachFile_Promoted; IncomingDocAttachFile)
- {
- }
- actionref(IncomingDocCard_Promoted; IncomingDocCard)
- {
- }
- }
- group(Category_Category7)
- {
- Caption = 'Navigate', Comment = 'Generated from the PromotedActionCategories property index 6.';
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- group(Category_Synchronize)
- {
- Caption = 'Synchronize';
- Visible = CRMIntegrationEnabled;
-
- actionref(CreateInCRM_Promoted; CreateInCRM)
- {
- }
- actionref(CRMGotoInvoice_Promoted; CRMGotoInvoice)
- {
- }
- actionref(ShowLog_Promoted; ShowLog)
- {
- }
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- var
- IncomingDocument: Record "Incoming Document";
- CRMCouplingManagement: Codeunit "CRM Coupling Management";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeOnAfterGetCurrRecord(Rec, IsHandled, CRMIsCoupledToRecord, CRMIntegrationEnabled);
- if IsHandled then
- exit;
-
- if GuiAllowed() then begin
- HasIncomingDocument := IncomingDocument.PostedDocExists(Rec."No.", Rec."Posting Date");
- DocExchStatusStyle := Rec.GetDocExchStatusStyle();
- CurrPage.IncomingDocAttachFactBox.PAGE.LoadDataFromRecord(Rec);
- if CRMIntegrationEnabled then begin
- CRMIsCoupledToRecord := CRMCouplingManagement.IsRecordCoupledToCRM(Rec.RecordId);
- if Rec."No." <> xRec."No." then
- CRMIntegrationManagement.SendResultNotification(Rec);
- end;
- end;
- UpdatePaymentService();
- DocExcStatusVisible := Rec.DocExchangeStatusIsSent();
- end;
-
- trigger OnAfterGetRecord()
- begin
- DocExchStatusStyle := Rec.GetDocExchStatusStyle();
- SellToContact.GetOrClear(Rec."Sell-to Contact No.");
- BillToContact.GetOrClear(Rec."Bill-to Contact No.");
- end;
-
- trigger OnInit()
- begin
- DocExcStatusVisible := true;
- end;
-
- trigger OnOpenPage()
- var
- PaymentServiceSetup: Record "Payment Service Setup";
- OfficeMgt: Codeunit "Office Management";
- VATReportingDateMgt: Codeunit "VAT Reporting Date Mgt";
- begin
- Rec.SetSecurityFilterOnRespCenter();
- CRMIntegrationEnabled := CRMIntegrationManagement.IsCRMIntegrationEnabled();
-
- IsOfficeAddin := OfficeMgt.IsAvailable();
-
- ActivateFields();
- PaymentServiceVisible := PaymentServiceSetup.IsPaymentServiceVisible();
- VATDateEnabled := VATReportingDateMgt.IsVATDateEnabled();
- end;
-
- var
- SellToContact: Record Contact;
- BillToContact: Record Contact;
- CRMIntegrationManagement: Codeunit "CRM Integration Management";
- FormatAddress: Codeunit "Format Address";
- ChangeExchangeRate: Page "Change Exchange Rate";
- HasIncomingDocument: Boolean;
- DocExchStatusStyle: Text;
- CRMIntegrationEnabled: Boolean;
- CRMIsCoupledToRecord: Boolean;
- PaymentServiceVisible: Boolean;
- PaymentServiceEnabled: Boolean;
- DocExcStatusVisible: Boolean;
- IsBillToCountyVisible: Boolean;
- IsSellToCountyVisible: Boolean;
- IsShipToCountyVisible: Boolean;
- VATDateEnabled: Boolean;
-
- protected var
- SalesInvHeader: Record "Sales Invoice Header";
- IsOfficeAddin: Boolean;
-
- local procedure ActivateFields()
- begin
- IsBillToCountyVisible := FormatAddress.UseCounty(Rec."Bill-to Country/Region Code");
- IsSellToCountyVisible := FormatAddress.UseCounty(Rec."Sell-to Country/Region Code");
- IsShipToCountyVisible := FormatAddress.UseCounty(Rec."Ship-to Country/Region Code");
- end;
-
- local procedure UpdatePaymentService()
- var
- PaymentServiceSetup: Record "Payment Service Setup";
- begin
- PaymentServiceEnabled := PaymentServiceSetup.CanChangePaymentService(Rec);
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSalesInvHeaderPrintRecords(var SalesInvHeader: Record "Sales Invoice Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateCreditMemoOnAction(var SalesInvoiceHeader: Record "Sales Invoice Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOnAfterGetCurrRecord(var SalesInvoiceHeader: Record "Sales Invoice Header"; var IsHandled: Boolean; var CRMIsCoupledToRecord: Boolean; var CRMIntegrationEnabled: Boolean)
- begin
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Sales/History/SalesCrMemoHeader.Table.al b/src/Layers/NL/BaseApp/Sales/History/SalesCrMemoHeader.Table.al
deleted file mode 100644
index 1284c76960..0000000000
--- a/src/Layers/NL/BaseApp/Sales/History/SalesCrMemoHeader.Table.al
+++ /dev/null
@@ -1,1669 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.History;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.Payment;
-using Microsoft.CRM.Campaign;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Opportunity;
-using Microsoft.CRM.Team;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Deferral;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.SalesTax;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.Navigate;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Foundation.PaymentTerms;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Foundation.Shipping;
-using Microsoft.Inventory.Intrastat;
-using Microsoft.Inventory.Ledger;
-using Microsoft.Inventory.Location;
-using Microsoft.Pricing.Calculation;
-using Microsoft.Sales.Comment;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.Pricing;
-using Microsoft.Sales.Receivables;
-using Microsoft.Sales.Setup;
-using Microsoft.Utilities;
-using System.Automation;
-using System.Globalization;
-using System.Reflection;
-using System.Security.AccessControl;
-using System.Security.User;
-
-///
-/// Stores header information for posted sales credit memos including customer details and credited amounts.
-///
-table 114 "Sales Cr.Memo Header"
-{
- Caption = 'Sales Cr.Memo Header';
- DataCaptionFields = "No.", "Sell-to Customer Name";
- DrillDownPageID = "Posted Sales Credit Memos";
- LookupPageID = "Posted Sales Credit Memos";
- DataClassification = CustomerContent;
-
- fields
- {
- ///
- /// Specifies the customer number who received the credited items.
- ///
- field(2; "Sell-to Customer No."; Code[20])
- {
- Caption = 'Sell-to Customer No.';
- NotBlank = true;
- TableRelation = Customer;
- ToolTip = 'Specifies the number of the customer that you shipped the items on the credit memo to.';
- }
- ///
- /// Specifies the unique identifier for the posted sales credit memo.
- ///
- field(3; "No."; Code[20])
- {
- Caption = 'No.';
- ToolTip = 'Specifies the posted credit memo number. You cannot change the number because the document has already been posted.';
- }
- ///
- /// Specifies the customer number who receives the credit memo for billing purposes.
- ///
- field(4; "Bill-to Customer No."; Code[20])
- {
- Caption = 'Bill-to Customer No.';
- NotBlank = true;
- TableRelation = Customer;
- ToolTip = 'Specifies the number of the customer that you send or sent the credit memo to.';
- }
- ///
- /// Specifies the name of the customer who receives the credit memo.
- ///
- field(5; "Bill-to Name"; Text[100])
- {
- Caption = 'Bill-to Name';
- ToolTip = 'Specifies the name of the customer that you send or sent the invoice or credit memo to.';
- }
- ///
- /// Specifies an additional part of the bill-to customer name.
- ///
- field(6; "Bill-to Name 2"; Text[50])
- {
- Caption = 'Bill-to Name 2';
- ToolTip = 'Specifies an additional part of the name of the customer that you send or sent the credit memo to.';
- }
- ///
- /// Specifies the street address of the customer who receives the credit memo.
- ///
- field(7; "Bill-to Address"; Text[100])
- {
- Caption = 'Bill-to Address';
- ToolTip = 'Specifies the address of the customer that the credit memo was sent to.';
- }
- ///
- /// Specifies additional address information for the bill-to customer.
- ///
- field(8; "Bill-to Address 2"; Text[50])
- {
- Caption = 'Bill-to Address 2';
- ToolTip = 'Specifies additional address information.';
- }
- ///
- /// Specifies the city of the customer who receives the credit memo.
- ///
- field(9; "Bill-to City"; Text[30])
- {
- Caption = 'Bill-to City';
- ToolTip = 'Specifies the city of the customer on the sales document.';
- TableRelation = "Post Code".City;
- ValidateTableRelation = false;
- }
- ///
- /// Specifies the name of the contact person at the bill-to customer.
- ///
- field(10; "Bill-to Contact"; Text[100])
- {
- Caption = 'Bill-to Contact';
- ToolTip = 'Specifies the name of the person you regularly contact when you communicate with the customer to whom the credit memo was sent.';
- }
- ///
- /// Specifies the customer's own reference number for this transaction.
- ///
- field(11; "Your Reference"; Text[35])
- {
- Caption = 'Your Reference';
- ToolTip = 'Specifies the customer''s reference. The contents will be printed on sales documents.';
- }
- ///
- /// Specifies the code for the ship-to address used on the credit memo.
- ///
- field(12; "Ship-to Code"; Code[10])
- {
- Caption = 'Ship-to Code';
- ToolTip = 'Specifies a code for an alternate shipment address if you want to ship to another address than the one that has been entered automatically. This field is also used in case of drop shipment.';
- TableRelation = "Ship-to Address".Code where("Customer No." = field("Sell-to Customer No."));
- }
- ///
- /// Specifies the name of the location where items were shipped.
- ///
- field(13; "Ship-to Name"; Text[100])
- {
- Caption = 'Ship-to Name';
- ToolTip = 'Specifies the name of the customer at the address that the items are shipped to.';
- }
- ///
- /// Specifies an additional part of the ship-to name.
- ///
- field(14; "Ship-to Name 2"; Text[50])
- {
- Caption = 'Ship-to Name 2';
- ToolTip = 'Specifies an additional part of the name of the customer that the items were shipped to.';
- }
- ///
- /// Specifies the street address of the ship-to location.
- ///
- field(15; "Ship-to Address"; Text[100])
- {
- Caption = 'Ship-to Address';
- ToolTip = 'Specifies the address that the items were shipped to.';
- }
- ///
- /// Specifies additional address information for the ship-to location.
- ///
- field(16; "Ship-to Address 2"; Text[50])
- {
- Caption = 'Ship-to Address 2';
- ToolTip = 'Specifies additional address information.';
- }
- ///
- /// Specifies the city of the ship-to location.
- ///
- field(17; "Ship-to City"; Text[30])
- {
- Caption = 'Ship-to City';
- ToolTip = 'Specifies the city of the customer on the sales document.';
- TableRelation = "Post Code".City;
- ValidateTableRelation = false;
- }
- ///
- /// Specifies the name of the contact person at the ship-to location.
- ///
- field(18; "Ship-to Contact"; Text[100])
- {
- Caption = 'Ship-to Contact';
- ToolTip = 'Specifies the name of the person you regularly contact at the customer to whom the items were shipped.';
- }
- ///
- /// Specifies the date when the credit memo was posted to the ledger.
- ///
- field(20; "Posting Date"; Date)
- {
- Caption = 'Posting Date';
- ToolTip = 'Specifies the date when the credit memo was posted.';
- }
- ///
- /// Specifies the date when items were shipped related to this credit memo.
- ///
- field(21; "Shipment Date"; Date)
- {
- Caption = 'Shipment Date';
- }
- ///
- /// Specifies the text that describes this posted credit memo.
- ///
- field(22; "Posting Description"; Text[100])
- {
- Caption = 'Posting Description';
- ToolTip = 'Specifies any text that is entered to accompany the posting, for example for information to auditors.';
- }
- ///
- /// Specifies the code for the payment terms used on the credit memo.
- ///
- field(23; "Payment Terms Code"; Code[10])
- {
- Caption = 'Payment Terms Code';
- TableRelation = "Payment Terms";
- }
- ///
- /// Specifies the date when the credit memo payment is due.
- ///
- field(24; "Due Date"; Date)
- {
- Caption = 'Due Date';
- ToolTip = 'Specifies the date on which the shipment is due for payment.';
- }
- ///
- /// Specifies the payment discount percentage applied to the credit memo.
- ///
- field(25; "Payment Discount %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Payment Discount %';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
- }
- ///
- /// Specifies the last date for the customer to take the payment discount.
- ///
- field(26; "Pmt. Discount Date"; Date)
- {
- Caption = 'Pmt. Discount Date';
- }
- ///
- /// Specifies the code for the shipment method used on the credit memo.
- ///
- field(27; "Shipment Method Code"; Code[10])
- {
- Caption = 'Shipment Method Code';
- ToolTip = 'Specifies the shipment method for the shipment.';
- TableRelation = "Shipment Method";
- }
- ///
- /// Specifies the location from which items were shipped or returned.
- ///
- field(28; "Location Code"; Code[10])
- {
- Caption = 'Location Code';
- ToolTip = 'Specifies the location where the credit memo was registered.';
- TableRelation = Location where("Use As In-Transit" = const(false));
- }
- ///
- /// Specifies the first global dimension code used for analysis.
- ///
- field(29; "Shortcut Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,2,1';
- Caption = 'Shortcut Dimension 1 Code';
- 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.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1));
- }
- ///
- /// Specifies the second global dimension code used for analysis.
- ///
- field(30; "Shortcut Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,2,2';
- Caption = 'Shortcut Dimension 2 Code';
- 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.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2));
- }
- ///
- /// Specifies the customer posting group used to post receivables to the general ledger.
- ///
- field(31; "Customer Posting Group"; Code[20])
- {
- Caption = 'Customer Posting Group';
- ToolTip = 'Specifies the customer''s market type to link business transactions to.';
- Editable = false;
- TableRelation = "Customer Posting Group";
- }
- ///
- /// Specifies the currency code used for the credit memo amounts.
- ///
- field(32; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- ToolTip = 'Specifies the currency code of the credit memo.';
- Editable = false;
- TableRelation = Currency;
- }
- ///
- /// Specifies the exchange rate used to convert amounts to local currency.
- ///
- field(33; "Currency Factor"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Currency Factor';
- DecimalPlaces = 0 : 15;
- MinValue = 0;
- }
- ///
- /// Specifies the customer price group used for pricing on the credit memo.
- ///
- field(34; "Customer Price Group"; Code[10])
- {
- Caption = 'Customer Price Group';
- TableRelation = "Customer Price Group";
- }
- ///
- /// Indicates whether the prices on the credit memo include VAT.
- ///
- field(35; "Prices Including VAT"; Boolean)
- {
- Caption = 'Prices Including VAT';
- }
- ///
- /// Specifies the code used to calculate invoice discounts for this customer.
- ///
- field(37; "Invoice Disc. Code"; Code[20])
- {
- Caption = 'Invoice Disc. Code';
- }
- ///
- /// Specifies the customer discount group used for line discounts.
- ///
- field(40; "Customer Disc. Group"; Code[20])
- {
- Caption = 'Customer Disc. Group';
- TableRelation = "Customer Discount Group";
- }
- ///
- /// Specifies the language code for the credit memo document.
- ///
- field(41; "Language Code"; Code[10])
- {
- Caption = 'Language Code';
- TableRelation = Language;
- }
- ///
- /// Specifies the regional format for dates and numbers on the document.
- ///
- field(42; "Format Region"; Text[80])
- {
- Caption = 'Format Region';
- TableRelation = "Language Selection"."Language Tag";
- }
- ///
- /// Specifies the salesperson responsible for the credit memo.
- ///
- field(43; "Salesperson Code"; Code[20])
- {
- Caption = 'Salesperson Code';
- ToolTip = 'Specifies which salesperson is associated with the credit memo.';
- TableRelation = "Salesperson/Purchaser";
- }
- ///
- /// Indicates whether comments exist for this posted credit memo.
- ///
- field(46; Comment; Boolean)
- {
- CalcFormula = exist("Sales Comment Line" where("Document Type" = const("Posted Credit Memo"),
- "No." = field("No."),
- "Document Line No." = const(0)));
- Caption = 'Comment';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies how many times the credit memo has been printed.
- ///
- field(47; "No. Printed"; Integer)
- {
- Caption = 'No. Printed';
- ToolTip = 'Specifies how many times the document has been printed.';
- Editable = false;
- }
- ///
- /// Specifies the on hold status to block further processing.
- ///
- field(51; "On Hold"; Code[3])
- {
- Caption = 'On Hold';
- }
- ///
- /// Specifies the type of document this credit memo is applied to.
- ///
- field(52; "Applies-to Doc. Type"; Enum "Gen. Journal Document Type")
- {
- Caption = 'Applies-to Doc. Type';
- ToolTip = 'Specifies the type of the posted document that this document or journal line will be applied to when you post, for example to register payment.';
- }
- ///
- /// Specifies the document number this credit memo is applied to.
- ///
- field(53; "Applies-to Doc. No."; Code[20])
- {
- Caption = 'Applies-to Doc. No.';
- ToolTip = 'Specifies the number of the posted document that this document or journal line will be applied to when you post, for example to register payment.';
-
- trigger OnLookup()
- var
- CustLedgEntry: Record "Cust. Ledger Entry";
- begin
- CustLedgEntry.SetCurrentKey("Document No.");
- CustLedgEntry.SetRange("Document Type", "Applies-to Doc. Type");
- CustLedgEntry.SetRange("Document No.", "Applies-to Doc. No.");
- OnLookupAppliesToDocNoOnAfterSetFilters(CustLedgEntry, Rec);
- PAGE.Run(0, CustLedgEntry);
- end;
- }
- ///
- /// Specifies the balancing account number for the credit memo posting.
- ///
- field(55; "Bal. Account No."; Code[20])
- {
- Caption = 'Bal. Account No.';
- TableRelation = if ("Bal. Account Type" = const("G/L Account")) "G/L Account"
- else
- if ("Bal. Account Type" = const("Bank Account")) "Bank Account";
- }
- ///
- /// Specifies the total amount of the credit memo excluding VAT.
- ///
- field(60; Amount; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Sales Cr.Memo Line".Amount where("Document No." = field("No.")));
- Caption = 'Amount';
- ToolTip = 'Specifies the total of the amounts on all the credit memo lines, in the currency of the credit memo. The amount does not include VAT.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the total amount of the credit memo including VAT.
- ///
- field(61; "Amount Including VAT"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Sales Cr.Memo Line"."Amount Including VAT" where("Document No." = field("No.")));
- Caption = 'Amount Including VAT';
- ToolTip = 'Specifies the total of the amounts, including VAT, on all the lines on the document.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the customer's VAT registration number.
- ///
- field(70; "VAT Registration No."; Text[20])
- {
- Caption = 'VAT Registration No.';
- ToolTip = 'Specifies the customer''s VAT registration number for customers.';
- }
- ///
- /// Specifies the customer's company registration number.
- ///
- field(72; "Registration Number"; Text[50])
- {
- Caption = 'Registration No.';
- DataClassification = CustomerContent;
- }
- ///
- /// Specifies the reason code for the credit memo posting.
- ///
- field(73; "Reason Code"; Code[10])
- {
- Caption = 'Reason Code';
- TableRelation = "Reason Code";
- }
- ///
- /// Specifies the general business posting group used for the credit memo.
- ///
- field(74; "Gen. Bus. Posting Group"; Code[20])
- {
- Caption = 'Gen. Bus. Posting Group';
- TableRelation = "Gen. Business Posting Group";
- }
- ///
- /// Indicates whether the transaction involves three-party trade within the EU.
- ///
- field(75; "EU 3-Party Trade"; Boolean)
- {
- Caption = 'EU 3-Party Trade';
- ToolTip = 'Specifies whether the invoice was part of an EU 3-party trade transaction.';
- }
- ///
- /// Specifies the transaction type code for Intrastat reporting.
- ///
- field(76; "Transaction Type"; Code[10])
- {
- Caption = 'Transaction Type';
- TableRelation = "Transaction Type";
- }
- ///
- /// Specifies the transport method code for Intrastat reporting.
- ///
- field(77; "Transport Method"; Code[10])
- {
- Caption = 'Transport Method';
- TableRelation = "Transport Method";
- }
- ///
- /// Specifies the country/region code for VAT purposes.
- ///
- field(78; "VAT Country/Region Code"; Code[10])
- {
- Caption = 'VAT Country/Region Code';
- TableRelation = "Country/Region";
- }
- ///
- /// Specifies the name of the customer who received the credited items.
- ///
- field(79; "Sell-to Customer Name"; Text[100])
- {
- Caption = 'Sell-to Customer Name';
- ToolTip = 'Specifies the name of the customer that you shipped the items on the credit memo to.';
- }
- ///
- /// Specifies an additional part of the sell-to customer name.
- ///
- field(80; "Sell-to Customer Name 2"; Text[50])
- {
- Caption = 'Sell-to Customer Name 2';
- ToolTip = 'Specifies an additional part of the name of the customer who will receive the products and be billed by default.';
- }
- ///
- /// Specifies the street address of the sell-to customer.
- ///
- field(81; "Sell-to Address"; Text[100])
- {
- Caption = 'Sell-to Address';
- ToolTip = 'Specifies the address of the customer that the items on the credit memo were sent to.';
- }
- ///
- /// Specifies additional address information for the sell-to customer.
- ///
- field(82; "Sell-to Address 2"; Text[50])
- {
- Caption = 'Sell-to Address 2';
- ToolTip = 'Specifies additional address information.';
- }
- ///
- /// Specifies the city of the sell-to customer.
- ///
- field(83; "Sell-to City"; Text[30])
- {
- Caption = 'Sell-to City';
- ToolTip = 'Specifies the city of the customer on the sales document.';
- TableRelation = "Post Code".City;
- ValidateTableRelation = false;
- }
- ///
- /// Specifies the name of the contact person at the sell-to customer.
- ///
- field(84; "Sell-to Contact"; Text[100])
- {
- Caption = 'Sell-to Contact';
- ToolTip = 'Specifies the name of the contact person at the customer''s main address.';
- }
- ///
- /// Specifies the postal code of the bill-to customer address.
- ///
- field(85; "Bill-to Post Code"; Code[20])
- {
- Caption = 'Bill-to Post Code';
- ToolTip = 'Specifies the postal code of the customer''s billing address.';
- TableRelation = "Post Code";
- ValidateTableRelation = false;
- }
- ///
- /// Specifies the county or state of the bill-to customer address.
- ///
- field(86; "Bill-to County"; Text[30])
- {
- CaptionClass = '5,3,' + "Bill-to Country/Region Code";
- Caption = 'Bill-to County';
- ToolTip = 'Specifies the state, province or county as a part of the address.';
- }
- ///
- /// Specifies the country/region code of the bill-to customer address.
- ///
- field(87; "Bill-to Country/Region Code"; Code[10])
- {
- Caption = 'Bill-to Country/Region Code';
- ToolTip = 'Specifies the country or region of the address.';
- TableRelation = "Country/Region";
- }
- ///
- /// Specifies the postal code of the sell-to customer address.
- ///
- field(88; "Sell-to Post Code"; Code[20])
- {
- Caption = 'Sell-to Post Code';
- ToolTip = 'Specifies the postal code of the customer''s main address.';
- TableRelation = "Post Code";
- ValidateTableRelation = false;
- }
- ///
- /// Specifies the county or state of the sell-to customer address.
- ///
- field(89; "Sell-to County"; Text[30])
- {
- CaptionClass = '5,2,' + "Sell-to Country/Region Code";
- Caption = 'Sell-to County';
- ToolTip = 'Specifies the state, province or county as a part of the address.';
- }
- ///
- /// Specifies the country/region code of the sell-to customer address.
- ///
- field(90; "Sell-to Country/Region Code"; Code[10])
- {
- Caption = 'Sell-to Country/Region Code';
- ToolTip = 'Specifies the country or region of the address.';
- TableRelation = "Country/Region";
- }
- ///
- /// Specifies the postal code of the ship-to address.
- ///
- field(91; "Ship-to Post Code"; Code[20])
- {
- Caption = 'Ship-to Post Code';
- ToolTip = 'Specifies the postal code of the address that the items are shipped to.';
- TableRelation = "Post Code";
- ValidateTableRelation = false;
- }
- ///
- /// Specifies the county or state of the ship-to address.
- ///
- field(92; "Ship-to County"; Text[30])
- {
- CaptionClass = '5,4,' + "Ship-to Country/Region Code";
- Caption = 'Ship-to County';
- ToolTip = 'Specifies the state, province or county as a part of the address.';
- }
- ///
- /// Specifies the country/region code of the ship-to address.
- ///
- field(93; "Ship-to Country/Region Code"; Code[10])
- {
- Caption = 'Ship-to Country/Region Code';
- ToolTip = 'Specifies the country or region of the address.';
- TableRelation = "Country/Region";
- }
- ///
- /// Specifies the type of balancing account used for posting.
- ///
- field(94; "Bal. Account Type"; enum "Payment Balance Account Type")
- {
- Caption = 'Bal. Account Type';
- }
- ///
- /// Specifies the exit point for goods leaving the country for Intrastat.
- ///
- field(97; "Exit Point"; Code[10])
- {
- Caption = 'Exit Point';
- TableRelation = "Entry/Exit Point";
- }
- ///
- /// Indicates whether this is a correcting entry that reverses a previous posting.
- ///
- field(98; Correction; Boolean)
- {
- Caption = 'Correction';
- ToolTip = 'Specifies the entry was posted as a corrective entry.';
- }
- ///
- /// Specifies the date when the credit memo document was created.
- ///
- field(99; "Document Date"; Date)
- {
- Caption = 'Document Date';
- ToolTip = 'Specifies the date on which you created the sales document.';
- }
- ///
- /// Specifies the external document number provided by the customer.
- ///
- field(100; "External Document No."; Code[35])
- {
- Caption = 'External Document No.';
- ToolTip = 'Specifies the external document number that is entered on the sales header that this line was posted from.';
- }
- ///
- /// Specifies the area code for Intrastat reporting.
- ///
- field(101; "Area"; Code[10])
- {
- Caption = 'Area';
- TableRelation = Area;
- }
- ///
- /// Specifies the transaction specification code for Intrastat reporting.
- ///
- field(102; "Transaction Specification"; Code[10])
- {
- Caption = 'Transaction Specification';
- TableRelation = "Transaction Specification";
- }
- ///
- /// Specifies the payment method code for the credit memo.
- ///
- field(104; "Payment Method Code"; Code[10])
- {
- Caption = 'Payment Method Code';
- ToolTip = 'Specifies the customer''s method of payment. The program has copied the code from the Payment Method Code field on the sales header.';
- TableRelation = "Payment Method";
- }
- ///
- /// Specifies the shipping agent responsible for delivering goods.
- ///
- field(105; "Shipping Agent Code"; Code[10])
- {
- AccessByPermission = TableData "Shipping Agent Services" = R;
- Caption = 'Shipping Agent Code';
- ToolTip = 'Specifies which shipping agent is used to transport the items on the sales document to the customer.';
- TableRelation = "Shipping Agent";
- }
- ///
- /// Specifies the tracking number for the shipped package.
- ///
-#if not CLEAN27
-#pragma warning disable AS0086
-#endif
- field(106; "Package Tracking No."; Text[50])
-#if not CLEAN27
-#pragma warning restore AS0086
-#endif
- {
- Caption = 'Package Tracking No.';
- ToolTip = 'Specifies the shipping agent''s package number.';
- }
- ///
- /// Specifies the number series used before the credit memo was posted.
- ///
- field(107; "Pre-Assigned No. Series"; Code[20])
- {
- Caption = 'Pre-Assigned No. Series';
- TableRelation = "No. Series";
- }
- ///
- /// Specifies the number series used for the posted credit memo.
- ///
- field(108; "No. Series"; Code[20])
- {
- Caption = 'No. Series';
- Editable = false;
- TableRelation = "No. Series";
- }
- ///
- /// Specifies the document number assigned before posting.
- ///
- field(111; "Pre-Assigned No."; Code[20])
- {
- Caption = 'Pre-Assigned No.';
- ToolTip = 'Specifies the number of the credit memo that the posted credit memo was created from.';
- }
- ///
- /// Specifies the user who posted the credit memo.
- ///
- field(112; "User ID"; Code[50])
- {
- Caption = 'User ID';
- DataClassification = EndUserIdentifiableInformation;
- TableRelation = User."User Name";
- }
- ///
- /// Specifies the source code that identifies the posting origin.
- ///
- field(113; "Source Code"; Code[10])
- {
- Caption = 'Source Code';
- TableRelation = "Source Code";
- }
- ///
- /// Specifies the tax area code for sales tax calculations.
- ///
- field(114; "Tax Area Code"; Code[20])
- {
- Caption = 'Tax Area Code';
- ToolTip = 'Specifies the tax area that is used to calculate and post sales tax.';
- TableRelation = "Tax Area";
- }
- ///
- /// Indicates whether the credit memo is subject to sales tax.
- ///
- field(115; "Tax Liable"; Boolean)
- {
- Caption = 'Tax Liable';
- ToolTip = 'Specifies if the customer or vendor is liable for sales tax.';
- }
- ///
- /// Specifies the VAT business posting group used for tax calculations.
- ///
- field(116; "VAT Bus. Posting Group"; Code[20])
- {
- Caption = 'VAT Bus. Posting Group';
- TableRelation = "VAT Business Posting Group";
- }
- ///
- /// Specifies the percentage used to reduce the VAT base amount for discounts.
- ///
- field(119; "VAT Base Discount %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'VAT Base Discount %';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
- }
- ///
- /// Specifies the number series for prepayment credit memos.
- ///
- field(134; "Prepmt. Cr. Memo No. Series"; Code[20])
- {
- Caption = 'Prepmt. Cr. Memo No. Series';
- TableRelation = "No. Series";
- }
- ///
- /// Indicates whether this is a prepayment credit memo.
- ///
- field(136; "Prepayment Credit Memo"; Boolean)
- {
- Caption = 'Prepayment Credit Memo';
- }
- ///
- /// Specifies the prepayment order number related to this credit memo.
- ///
- field(137; "Prepayment Order No."; Code[20])
- {
- Caption = 'Prepayment Order No.';
- }
- ///
- /// Specifies the company bank account used for the credit memo payment.
- ///
- field(163; "Company Bank Account Code"; Code[20])
- {
- Caption = 'Company Bank Account Code';
- ToolTip = 'Specifies the bank account to use for bank information when the document is printed.';
- TableRelation = "Bank Account" where("Currency Code" = field("Currency Code"));
- }
- ///
- /// Indicates whether an alternative VAT registration number was used.
- ///
- field(166; "Alt. VAT Registration No."; Boolean)
- {
- Caption = 'Alternative VAT Registration No.';
- Editable = false;
- }
- ///
- /// Indicates whether an alternative general business posting group was used.
- ///
- field(167; "Alt. Gen. Bus Posting Group"; Boolean)
- {
- Caption = 'Alternative Gen. Bus. Posting Group';
- Editable = false;
- }
- ///
- /// Indicates whether an alternative VAT business posting group was used.
- ///
- field(168; "Alt. VAT Bus Posting Group"; Boolean)
- {
- Caption = 'Alternative VAT Bus. Posting Group';
- Editable = false;
- }
- ///
- /// Specifies the phone number of the sell-to customer.
- ///
- field(171; "Sell-to Phone No."; Text[30])
- {
- Caption = 'Sell-to Phone No.';
- ExtendedDatatype = PhoneNo;
- }
- ///
- /// Specifies the email address of the sell-to customer.
- ///
- field(172; "Sell-to E-Mail"; Text[80])
- {
- Caption = 'Email';
- ExtendedDatatype = EMail;
- }
- ///
- /// Specifies the date used for VAT reporting purposes.
- ///
- field(179; "VAT Reporting Date"; Date)
- {
- Caption = 'VAT Date';
- ToolTip = 'Specifies the VAT date on the invoice.';
- Editable = false;
- }
- ///
- /// Specifies the country/region code from which the goods were received.
- ///
- field(181; "Rcvd.-from Count./Region Code"; Code[10])
- {
- Caption = 'Received-from Country/Region Code';
- TableRelation = "Country/Region";
- }
- ///
- /// Stores the work description or detailed notes for the credit memo.
- ///
- field(200; "Work Description"; BLOB)
- {
- Caption = 'Work Description';
- DataClassification = CustomerContent;
- }
- ///
- /// Specifies the phone number of the ship-to location.
- ///
- field(210; "Ship-to Phone No."; Text[30])
- {
- Caption = 'Ship-to Phone No.';
- ToolTip = 'Specifies the telephone number of the company''s shipping address.';
- ExtendedDatatype = PhoneNo;
- }
- ///
- /// Specifies the unique identifier for the dimension set applied to this credit memo.
- ///
- field(480; "Dimension Set ID"; Integer)
- {
- Caption = 'Dimension Set ID';
- Editable = false;
- TableRelation = "Dimension Set Entry";
-
- trigger OnLookup()
- begin
- Rec.ShowDimensions();
- end;
- }
- ///
- /// Specifies the identifier used when exchanging the document electronically.
- ///
- field(710; "Document Exchange Identifier"; Text[50])
- {
- Caption = 'Document Exchange Identifier';
- }
- ///
- /// Specifies the status of the document exchange process.
- ///
- field(711; "Document Exchange Status"; Enum "Sales Document Exchange Status")
- {
- Caption = 'Document Exchange Status';
- ToolTip = 'Specifies the status of the document if you are using a document exchange service to send it as an electronic document. The status values are reported by the document exchange service.';
- }
- ///
- /// Specifies the original identifier from the document exchange service.
- ///
- field(712; "Doc. Exch. Original Identifier"; Text[50])
- {
- Caption = 'Doc. Exch. Original Identifier';
- }
- ///
- /// Indicates whether the credit memo has been fully paid or applied.
- ///
- field(1302; Paid; Boolean)
- {
- CalcFormula = - exist("Cust. Ledger Entry" where("Entry No." = field("Cust. Ledger Entry No."),
- Open = filter(true)));
- Caption = 'Paid';
- ToolTip = 'Specifies if the posted sales invoice that relates to this sales credit memo is paid.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the remaining amount to be applied from the credit memo.
- ///
- field(1303; "Remaining Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Cust. Ledg. Entry".Amount where("Cust. Ledger Entry No." = field("Cust. Ledger Entry No.")));
- Caption = 'Remaining Amount';
- ToolTip = 'Specifies the amount that remains to be paid for the posted sales invoice.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the entry number of the related customer ledger entry.
- ///
- field(1304; "Cust. Ledger Entry No."; Integer)
- {
- Caption = 'Cust. Ledger Entry No.';
- Editable = false;
- TableRelation = "Cust. Ledger Entry"."Entry No.";
- }
- ///
- /// Specifies the total invoice discount amount applied to the credit memo.
- ///
- field(1305; "Invoice Discount Amount"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = Rec."Currency Code";
- CalcFormula = sum("Sales Cr.Memo Line"."Inv. Discount Amount" where("Document No." = field("No.")));
- Caption = 'Invoice Discount Amount';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Indicates whether this credit memo has been cancelled by another document.
- ///
- field(1310; Cancelled; Boolean)
- {
- CalcFormula = exist("Cancelled Document" where("Source ID" = const(114),
- "Cancelled Doc. No." = field("No.")));
- Caption = 'Cancelled';
- ToolTip = 'Specifies if the posted sales invoice that relates to this sales credit memo has been either corrected or canceled.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Indicates whether this credit memo is a correction of a posted invoice.
- ///
- field(1311; Corrective; Boolean)
- {
- CalcFormula = exist("Cancelled Document" where("Source ID" = const(112),
- "Cancelled By Doc. No." = field("No.")));
- Caption = 'Corrective';
- ToolTip = 'Specifies if the posted sales invoice has been either corrected or canceled by this sales credit memo.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the marketing campaign associated with the credit memo.
- ///
- field(5050; "Campaign No."; Code[20])
- {
- Caption = 'Campaign No.';
- TableRelation = Campaign;
- }
- ///
- /// Specifies the contact number of the sell-to customer.
- ///
- field(5052; "Sell-to Contact No."; Code[20])
- {
- Caption = 'Sell-to Contact No.';
- ToolTip = 'Specifies the number of the contact at the customer who handles the credit memo.';
- TableRelation = Contact;
- }
- ///
- /// Specifies the contact number of the bill-to customer.
- ///
- field(5053; "Bill-to Contact No."; Code[20])
- {
- Caption = 'Bill-to Contact No.';
- ToolTip = 'Specifies the number of the contact at the customer who handles the credit memo.';
- TableRelation = Contact;
- }
- ///
- /// Specifies the sales opportunity associated with this credit memo.
- ///
- field(5055; "Opportunity No."; Code[20])
- {
- Caption = 'Opportunity No.';
- TableRelation = Opportunity;
- }
- ///
- /// Specifies the responsibility center that processed the credit memo.
- ///
- field(5700; "Responsibility Center"; Code[10])
- {
- Caption = 'Responsibility Center';
- ToolTip = 'Specifies the code for the responsibility center that serves the customer on this sales document.';
- TableRelation = "Responsibility Center";
- }
- ///
- /// Specifies the shipping agent service code for delivery options.
- ///
- field(5794; "Shipping Agent Service Code"; Code[10])
- {
- Caption = 'Shipping Agent Service Code';
- ToolTip = 'Specifies which shipping agent service is used to transport the items on the sales document to the customer.';
- TableRelation = "Shipping Agent Services".Code where("Shipping Agent Code" = field("Shipping Agent Code"));
- }
- ///
- /// Specifies the return order number that this credit memo was created from.
- ///
- field(6601; "Return Order No."; Code[20])
- {
- AccessByPermission = TableData "Return Receipt Header" = R;
- Caption = 'Return Order No.';
- }
- ///
- /// Specifies the number series used for the return order.
- ///
- field(6602; "Return Order No. Series"; Code[20])
- {
- Caption = 'Return Order No. Series';
- TableRelation = "No. Series";
- }
- ///
- /// Specifies the method used to calculate prices on the credit memo.
- ///
- field(7000; "Price Calculation Method"; Enum "Price Calculation Method")
- {
- Caption = 'Price Calculation Method';
- }
- ///
- /// Indicates whether line discounts are allowed on the credit memo.
- ///
- field(7001; "Allow Line Disc."; Boolean)
- {
- Caption = 'Allow Line Disc.';
- }
- ///
- /// Indicates whether the Get Return Receipt function was used to create lines.
- ///
- field(7200; "Get Return Receipt Used"; Boolean)
- {
- Caption = 'Get Return Receipt Used';
- }
- ///
- /// Specifies the system ID of the draft credit memo before posting.
- ///
- field(8001; "Draft Cr. Memo SystemId"; Guid)
- {
- Caption = 'Draft Cr. Memo System Id';
- DataClassification = SystemMetadata;
- }
- field(11000000; "Transaction Mode"; Code[20])
- {
- Caption = 'Transaction Mode';
- TableRelation = "Transaction Mode".Code where("Account Type" = const(Customer));
- }
- field(11000001; "Bank Account"; Code[20])
- {
- Caption = 'Bank Account';
- TableRelation = "Customer Bank Account".Code where("Customer No." = field("Sell-to Customer No."));
- }
- }
-
- keys
- {
- key(Key1; "No.")
- {
- Clustered = true;
- }
- key(Key2; "Pre-Assigned No.")
- {
- }
- key(Key3; "Return Order No.")
- {
- }
- key(Key4; "Sell-to Customer No.")
- {
- }
- key(Key5; "Prepayment Order No.")
- {
- }
- key(Key6; "Bill-to Customer No.")
- {
- }
- key(Key7; "Posting Date")
- {
- }
- key(Key8; "Document Exchange Status")
- {
- }
- key(Key9; "Salesperson Code")
- {
- }
- }
-
- fieldgroups
- {
- fieldgroup(DropDown; "No.", "Sell-to Customer No.", "Bill-to Customer No.", "Posting Date", "Posting Description")
- {
- }
- fieldgroup(Brick; "No.", "Sell-to Customer Name", Amount, "Due Date", "Amount Including VAT")
- {
- }
- }
-
- trigger OnDelete()
- var
- PostedDeferralHeader: Record "Posted Deferral Header";
- PostSalesDelete: Codeunit "PostSales-Delete";
- begin
- PostSalesDelete.IsDocumentDeletionAllowed("Posting Date");
- CheckNoPrinted();
- LockTable();
- PostSalesDelete.DeleteSalesCrMemoLines(Rec);
-
- SalesCommentLine.SetRange("Document Type", SalesCommentLine."Document Type"::"Posted Credit Memo");
- SalesCommentLine.SetRange("No.", "No.");
- SalesCommentLine.DeleteAll();
-
- ApprovalsMgmt.DeletePostedApprovalEntries(RecordId);
- PostedDeferralHeader.DeleteForDoc(
- "Deferral Document Type"::Sales.AsInteger(), '', '',
- SalesCommentLine."Document Type"::"Posted Credit Memo".AsInteger(), "No.");
- end;
-
- var
- SalesCommentLine: Record "Sales Comment Line";
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- DimMgt: Codeunit DimensionManagement;
- UserSetupMgt: Codeunit "User Setup Management";
-
- ///
- /// Sends the credit memo records using the customer's document sending profile.
- ///
- procedure SendRecords()
- var
- DocumentSendingProfile: Record "Document Sending Profile";
- DummyReportSelections: Record "Report Selections";
- ReportDistributionMgt: Codeunit "Report Distribution Management";
- DocumentTypeTxt: Text[50];
- IsHandled: Boolean;
- begin
- DocumentTypeTxt := ReportDistributionMgt.GetFullDocumentTypeText(Rec);
-
- IsHandled := false;
- OnBeforeSendRecords(DummyReportSelections, Rec, DocumentTypeTxt, IsHandled);
- if IsHandled then
- exit;
-
- DocumentSendingProfile.SendCustomerRecords(
- DummyReportSelections.Usage::"S.Cr.Memo".AsInteger(), Rec, DocumentTypeTxt, "Bill-to Customer No.", "No.",
- FieldNo("Bill-to Customer No."), FieldNo("No."));
- end;
-
- ///
- /// Sends the credit memo using a specific document sending profile.
- ///
- /// The document sending profile to use.
- procedure SendProfile(var DocumentSendingProfile: Record "Document Sending Profile")
- var
- DummyReportSelections: Record "Report Selections";
- ReportDistributionMgt: Codeunit "Report Distribution Management";
- DocumentTypeTxt: Text[50];
- IsHandled: Boolean;
- begin
- DocumentTypeTxt := ReportDistributionMgt.GetFullDocumentTypeText(Rec);
-
- IsHandled := false;
- OnBeforeSendProfile(DummyReportSelections, Rec, DocumentTypeTxt, IsHandled, DocumentSendingProfile);
- if IsHandled then
- exit;
-
- DocumentSendingProfile.Send(
- DummyReportSelections.Usage::"S.Cr.Memo".AsInteger(), Rec, "No.", "Bill-to Customer No.",
- DocumentTypeTxt, FieldNo("Bill-to Customer No."), FieldNo("No."));
- end;
-
- ///
- /// Opens the shipping agent's tracking website for this return shipment.
- ///
- procedure StartTrackingSite()
- var
- ShippingAgent: Record "Shipping Agent";
- begin
- TestField("Shipping Agent Code");
- ShippingAgent.Get("Shipping Agent Code");
- HyperLink(ShippingAgent.GetTrackingInternetAddr("Package Tracking No."));
- end;
-
- ///
- /// Prints the selected credit memo records.
- ///
- /// Whether to show the report request page.
- procedure PrintRecords(ShowRequestPage: Boolean)
- var
- DocumentSendingProfile: Record "Document Sending Profile";
- DummyReportSelections: Record "Report Selections";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforePrintRecords(DummyReportSelections, Rec, ShowRequestPage, IsHandled);
- if IsHandled then
- exit;
-
- DocumentSendingProfile.TrySendToPrinter(
- DummyReportSelections.Usage::"S.Cr.Memo".AsInteger(), Rec, FieldNo("Bill-to Customer No."), ShowRequestPage);
- end;
-
- ///
- /// Validates that the credit memo has been printed at least once.
- ///
- procedure CheckNoPrinted()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckNoPrinted(Rec, IsHandled);
- if IsHandled then
- exit;
-
- Rec.TestField("No. Printed");
- end;
-
- ///
- /// Sends the credit memo records by email.
- ///
- /// Whether to show the email dialog.
- procedure EmailRecords(ShowRequestPage: Boolean)
- var
- DocumentSendingProfile: Record "Document Sending Profile";
- DummyReportSelections: Record "Report Selections";
- ReportDistributionMgt: Codeunit "Report Distribution Management";
- DocumentTypeTxt: Text[50];
- IsHandled: Boolean;
- begin
- DocumentTypeTxt := ReportDistributionMgt.GetFullDocumentTypeText(Rec);
-
- IsHandled := false;
- OnBeforeEmailRecords(DummyReportSelections, Rec, DocumentTypeTxt, ShowRequestPage, IsHandled);
- if IsHandled then
- exit;
-
- DocumentSendingProfile.TrySendToEMail(
- DummyReportSelections.Usage::"S.Cr.Memo".AsInteger(), Rec, FieldNo("No."), DocumentTypeTxt,
- FieldNo("Bill-to Customer No."), ShowRequestPage);
- end;
-
- ///
- /// Prints the credit memos and saves them as document attachments.
- ///
- /// The credit memo records to print and attach.
- procedure PrintToDocumentAttachment(var SalesCrMemoHeader: Record "Sales Cr.Memo Header")
- var
- ShowNotificationAction: Boolean;
- begin
- ShowNotificationAction := SalesCrMemoHeader.Count() = 1;
- if SalesCrMemoHeader.FindSet() then
- repeat
- DoPrintToDocumentAttachment(SalesCrMemoHeader, ShowNotificationAction);
- until SalesCrMemoHeader.Next() = 0;
- end;
-
- local procedure DoPrintToDocumentAttachment(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; ShowNotificationAction: Boolean)
- var
- ReportSelections: Record "Report Selections";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeDoPrintToDocumentAttachment(SalesCrMemoHeader, ShowNotificationAction, IsHandled);
- if IsHandled then
- exit;
-
- SalesCrMemoHeader.SetRecFilter();
- ReportSelections.SaveAsDocumentAttachment(
- ReportSelections.Usage::"S.Cr.Memo".AsInteger(), SalesCrMemoHeader, SalesCrMemoHeader."No.", SalesCrMemoHeader."Bill-to Customer No.", ShowNotificationAction);
- end;
-
- ///
- /// Opens the Navigate page to show related entries for this credit memo.
- ///
- procedure Navigate()
- var
- NavigatePage: Page Navigate;
- begin
- NavigatePage.SetDoc("Posting Date", "No.");
- NavigatePage.SetRec(Rec);
- NavigatePage.Run();
- end;
-
- ///
- /// Opens a page showing value entries with adjustments for this credit memo.
- ///
- procedure LookupAdjmtValueEntries()
- var
- ValueEntry: Record "Value Entry";
- begin
- ValueEntry.SetCurrentKey("Document No.");
- ValueEntry.SetRange("Document No.", "No.");
- ValueEntry.SetRange("Document Type", ValueEntry."Document Type"::"Sales Credit Memo");
- ValueEntry.SetRange(Adjustment, true);
- PAGE.RunModal(0, ValueEntry);
- end;
-
- ///
- /// Gets the customer's VAT registration number.
- ///
- /// The VAT registration number.
- procedure GetCustomerVATRegistrationNumber(): Text
- begin
- exit("VAT Registration No.");
- end;
-
- ///
- /// Gets the label for the VAT registration number field.
- ///
- /// The field caption.
- procedure GetCustomerVATRegistrationNumberLbl(): Text
- begin
- exit(FieldCaption("VAT Registration No."));
- end;
-
-
- ///
- /// Gets the legal statement from sales setup for printing on credit memos.
- ///
- /// The legal statement text.
- procedure GetLegalStatement(): Text
- var
- SalesSetup: Record "Sales & Receivables Setup";
- begin
- SalesSetup.Get();
- exit(SalesSetup.GetLegalStatement());
- end;
-
- ///
- /// Shows the dimension set entries for this credit memo.
- ///
- procedure ShowDimensions()
- begin
- DimMgt.ShowDimensionSet("Dimension Set ID", StrSubstNo('%1 %2', TableCaption(), "No."));
- end;
-
- ///
- /// Sets a security filter based on the user's responsibility center.
- ///
- procedure SetSecurityFilterOnRespCenter()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetSecurityFilterOnRespCenter(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if UserSetupMgt.GetSalesFilter() <> '' then begin
- FilterGroup(2);
- SetRange("Responsibility Center", UserSetupMgt.GetSalesFilter());
- FilterGroup(0);
- end;
- end;
-
- ///
- /// Gets the style class for displaying the document exchange status.
- ///
- /// A style name for UI display.
- procedure GetDocExchStatusStyle(): Text
- begin
- case "Document Exchange Status" of
- "Document Exchange Status"::"Not Sent":
- exit('Standard');
- "Document Exchange Status"::"Sent to Document Exchange Service":
- exit('Ambiguous');
- "Document Exchange Status"::"Delivered to Recipient":
- exit('Favorable');
- else
- exit('Unfavorable');
- end;
- end;
-
- ///
- /// Shows the activity log entries for this credit memo.
- ///
- procedure ShowActivityLog()
- var
- ActivityLog: Record "Activity Log";
- begin
- ActivityLog.ShowEntries(Rec.RecordId);
- end;
-
- ///
- /// Checks if the credit memo has been sent via document exchange.
- ///
- /// True if the document has been sent.
- procedure DocExchangeStatusIsSent(): Boolean
- begin
- exit("Document Exchange Status" <> "Document Exchange Status"::"Not Sent");
- end;
-
- ///
- /// Shows the invoice that was canceled or corrected by this credit memo.
- ///
- procedure ShowCanceledOrCorrInvoice()
- begin
- CalcFields(Cancelled, Corrective);
- case true of
- Cancelled:
- Rec.ShowCorrectiveInvoice();
- Corrective:
- Rec.ShowCancelledInvoice();
- end;
- end;
-
- ///
- /// Opens the invoice that corrected this cancelled credit memo.
- ///
- procedure ShowCorrectiveInvoice()
- var
- CancelledDocument: Record "Cancelled Document";
- SalesInvHeader: Record "Sales Invoice Header";
- begin
- CalcFields(Cancelled);
- if not Cancelled then
- exit;
-
- if CancelledDocument.FindSalesCancelledCrMemo("No.") then begin
- SalesInvHeader.Get(CancelledDocument."Cancelled By Doc. No.");
- RunSalesInvoiceHeaderPage(SalesInvHeader, PAGE::"Posted Sales Invoice");
- end;
- end;
-
- ///
- /// Opens the invoice that was cancelled by this corrective credit memo.
- ///
- procedure ShowCancelledInvoice()
- var
- CancelledDocument: Record "Cancelled Document";
- SalesInvHeader: Record "Sales Invoice Header";
- begin
- CalcFields(Corrective);
- if not Corrective then
- exit;
-
- if CancelledDocument.FindSalesCorrectiveCrMemo("No.") then begin
- SalesInvHeader.Get(CancelledDocument."Cancelled Doc. No.");
- RunSalesInvoiceHeaderPage(SalesInvHeader, PAGE::"Posted Sales Invoice");
- end;
- end;
-
- local procedure RunSalesInvoiceHeaderPage(var SalesInvoiceHeader: Record "Sales Invoice Header"; PageID: Integer)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeRunSalesInvoiceHeaderPage(SalesInvoiceHeader, PageID, IsHandled);
- if IsHandled then
- exit;
-
- PAGE.Run(PageID, SalesInvoiceHeader);
- end;
-
- ///
- /// Retrieves the work description text from the BLOB field.
- ///
- /// The work description text.
- procedure GetWorkDescription(): Text
- var
- TypeHelper: Codeunit "Type Helper";
- InStream: InStream;
- begin
- CalcFields("Work Description");
- "Work Description".CreateInStream(InStream, TEXTENCODING::UTF8);
- exit(TypeHelper.TryReadAsTextWithSepAndFieldErrMsg(InStream, TypeHelper.LFSeparator(), FieldName("Work Description")));
- end;
-
- ///
- /// Raised before emailing sales credit memo records to customers.
- ///
- /// The report selections to use.
- /// The sales credit memo header to email.
- /// The document type text.
- /// Indicates whether to show the email dialog.
- /// Set to true to skip default email processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeEmailRecords(var ReportSelections: Record "Report Selections"; var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; DocTxt: Text; var ShowDialog: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before printing sales credit memo records.
- ///
- /// The report selections to use.
- /// The sales credit memo header to print.
- /// Indicates whether to show the report request page.
- /// Set to true to skip default print processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforePrintRecords(var ReportSelections: Record "Report Selections"; var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; ShowRequestPage: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before sending the sales credit memo using the document sending profile.
- ///
- /// The report selections to use.
- /// The sales credit memo header to send.
- /// The document type text.
- /// Set to true to skip default sending profile processing.
- /// The document sending profile to use.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSendProfile(var ReportSelections: Record "Report Selections"; var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; DocTxt: Text; var IsHandled: Boolean; var DocumentSendingProfile: Record "Document Sending Profile")
- begin
- end;
-
- ///
- /// Raised before sending sales credit memo records.
- ///
- /// The report selections to use.
- /// The sales credit memo header to send.
- /// The document type text.
- /// Set to true to skip default sending processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSendRecords(var ReportSelections: Record "Report Selections"; var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; DocTxt: Text; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before setting security filter on responsibility center for the sales credit memo.
- ///
- /// The sales credit memo header to filter.
- /// Set to true to skip default security filter application.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetSecurityFilterOnRespCenter(var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after setting filters when looking up the applies-to document number.
- ///
- /// The customer ledger entry with applied filters.
- /// The sales credit memo header being processed.
- [IntegrationEvent(false, false)]
- local procedure OnLookupAppliesToDocNoOnAfterSetFilters(var CustLedgEntry: Record "Cust. Ledger Entry"; SalesCrMemoHeader: Record "Sales Cr.Memo Header")
- begin
- end;
-
- ///
- /// Raised before running the sales invoice header page when showing the cancelled invoice.
- ///
- /// The sales invoice header to display.
- /// The page ID to run.
- /// Set to true to skip default page execution.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeRunSalesInvoiceHeaderPage(var SalesInvoiceHeader: Record "Sales Invoice Header"; var PageID: Integer; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before printing to document attachment for the sales credit memo.
- ///
- /// The sales credit memo header to print.
- /// Indicates whether to show notification action.
- /// Set to true to skip default document attachment processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeDoPrintToDocumentAttachment(var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; ShowNotificationAction: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking if the credit memo has been printed.
- ///
- /// The sales credit memo header being checked.
- /// Set to true to skip default print status check.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckNoPrinted(var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var IsHandled: Boolean)
- begin
- end;
-}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Sales/History/SalesInvoiceHeader.Table.al b/src/Layers/NL/BaseApp/Sales/History/SalesInvoiceHeader.Table.al
deleted file mode 100644
index 4824df58fc..0000000000
--- a/src/Layers/NL/BaseApp/Sales/History/SalesInvoiceHeader.Table.al
+++ /dev/null
@@ -1,2061 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.History;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.DirectDebit;
-using Microsoft.Bank.Payment;
-using Microsoft.Bank.Setup;
-using Microsoft.CRM.Campaign;
-using Microsoft.CRM.Contact;
-using Microsoft.CRM.Opportunity;
-using Microsoft.CRM.Team;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Deferral;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.SalesTax;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.Navigate;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Foundation.PaymentTerms;
-using Microsoft.Foundation.Reporting;
-using Microsoft.Foundation.Shipping;
-using Microsoft.Integration.Dataverse;
-using Microsoft.Inventory.Intrastat;
-using Microsoft.Inventory.Ledger;
-using Microsoft.Inventory.Location;
-using Microsoft.Pricing.Calculation;
-using Microsoft.Sales.Comment;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.Pricing;
-using Microsoft.Sales.Receivables;
-using Microsoft.Sales.Setup;
-using Microsoft.Utilities;
-using System.Automation;
-using System.Email;
-using System.Globalization;
-using System.Reflection;
-using System.Security.AccessControl;
-using System.Security.User;
-using System.Utilities;
-
-///
-/// Stores header information for posted sales invoices including customer details, amounts, and payment terms.
-///
-table 112 "Sales Invoice Header"
-{
- Caption = 'Sales Invoice Header';
- DataCaptionFields = "No.", "Sell-to Customer Name";
- DrillDownPageID = "Posted Sales Invoices";
- LookupPageID = "Posted Sales Invoices";
- DataClassification = CustomerContent;
-
- fields
- {
- ///
- /// Specifies the customer number who received the shipped items on this invoice.
- ///
- field(2; "Sell-to Customer No."; Code[20])
- {
- Caption = 'Sell-to Customer No.';
- NotBlank = true;
- TableRelation = Customer;
- ToolTip = 'Specifies the number of the customer that you shipped the items on the invoice to.';
- }
- ///
- /// Specifies the unique document number of the posted sales invoice.
- ///
- field(3; "No."; Code[20])
- {
- Caption = 'No.';
- ToolTip = 'Specifies the posted sales invoice number. Each posted sales invoice gets a unique number. Typically, the number is generated based on a number series.';
- }
- ///
- /// Specifies the customer number to whom the invoice was sent for payment.
- ///
- field(4; "Bill-to Customer No."; Code[20])
- {
- Caption = 'Bill-to Customer No.';
- ToolTip = 'Specifies the number of the customer that you send or sent the invoice to.';
- NotBlank = true;
- TableRelation = Customer;
- }
- ///
- /// Specifies the name of the customer receiving the invoice for payment.
- ///
- field(5; "Bill-to Name"; Text[100])
- {
- Caption = 'Bill-to Name';
- ToolTip = 'Specifies the name of the customer that you send or sent the invoice or credit memo to.';
- }
- ///
- /// Specifies additional name information for the bill-to customer.
- ///
- field(6; "Bill-to Name 2"; Text[50])
- {
- Caption = 'Bill-to Name 2';
- ToolTip = 'Specifies an additional part of the name of the customer that you send or sent the invoice to.';
- }
- ///
- /// Specifies the street address of the customer receiving the invoice.
- ///
- field(7; "Bill-to Address"; Text[100])
- {
- Caption = 'Bill-to Address';
- ToolTip = 'Specifies the address of the customer that the invoice was sent to.';
- }
- ///
- /// Specifies additional street address information for the bill-to customer.
- ///
- field(8; "Bill-to Address 2"; Text[50])
- {
- Caption = 'Bill-to Address 2';
- ToolTip = 'Specifies additional address information.';
- }
- ///
- /// Specifies the city of the customer receiving the invoice.
- ///
- field(9; "Bill-to City"; Text[30])
- {
- Caption = 'Bill-to City';
- ToolTip = 'Specifies the city of the customer on the sales document.';
- TableRelation = "Post Code".City;
- ValidateTableRelation = false;
- }
- ///
- /// Specifies the name of the contact person at the bill-to customer's address.
- ///
- field(10; "Bill-to Contact"; Text[100])
- {
- Caption = 'Bill-to Contact';
- ToolTip = 'Specifies the name of the contact person at the customer''s billing address.';
- }
- ///
- /// Specifies the customer's own reference number for this document.
- ///
- field(11; "Your Reference"; Text[35])
- {
- Caption = 'Your Reference';
- ToolTip = 'Specifies the customer''s reference. The contents will be printed on sales documents.';
- }
- ///
- /// Specifies the code for an alternate ship-to address.
- ///
- field(12; "Ship-to Code"; Code[10])
- {
- Caption = 'Ship-to Code';
- ToolTip = 'Specifies the address on purchase orders shipped with a drop shipment directly from the vendor to a customer.';
- TableRelation = "Ship-to Address".Code where("Customer No." = field("Sell-to Customer No."));
- }
- ///
- /// Specifies the name of the recipient at the ship-to address.
- ///
- field(13; "Ship-to Name"; Text[100])
- {
- Caption = 'Ship-to Name';
- ToolTip = 'Specifies the name of the customer at the address that the items are shipped to.';
- }
- ///
- /// Specifies additional name information for the ship-to address.
- ///
- field(14; "Ship-to Name 2"; Text[50])
- {
- Caption = 'Ship-to Name 2';
- ToolTip = 'Specifies an additional part of the the name of the customer that you delivered the items to.';
- }
- ///
- /// Specifies the street address where items were shipped.
- ///
- field(15; "Ship-to Address"; Text[100])
- {
- Caption = 'Ship-to Address';
- ToolTip = 'Specifies the address that the items on the invoice were shipped to.';
- }
- ///
- /// Specifies additional street address information for the ship-to address.
- ///
- field(16; "Ship-to Address 2"; Text[50])
- {
- Caption = 'Ship-to Address 2';
- ToolTip = 'Specifies additional address information.';
- }
- ///
- /// Specifies the city of the ship-to address.
- ///
- field(17; "Ship-to City"; Text[30])
- {
- Caption = 'Ship-to City';
- ToolTip = 'Specifies the city of the customer on the sales document.';
- TableRelation = "Post Code".City;
- ValidateTableRelation = false;
- }
- ///
- /// Specifies the name of the contact person at the ship-to address.
- ///
- field(18; "Ship-to Contact"; Text[100])
- {
- Caption = 'Ship-to Contact';
- ToolTip = 'Specifies the name of the person you regularly contact at the address that the items were shipped to.';
- }
- ///
- /// Specifies the date when the sales order was created.
- ///
- field(19; "Order Date"; Date)
- {
- Caption = 'Order Date';
- }
- ///
- /// Specifies the date when the invoice was posted to the ledger.
- ///
- field(20; "Posting Date"; Date)
- {
- Caption = 'Posting Date';
- ToolTip = 'Specifies the date on which the invoice was posted.';
- }
- ///
- /// Specifies the date when the items were shipped to the customer.
- ///
- field(21; "Shipment Date"; Date)
- {
- Caption = 'Shipment Date';
- ToolTip = 'Specifies when items on the document are shipped or were shipped. A shipment date is usually calculated from a requested delivery date plus lead time.';
- }
- ///
- /// Specifies a description of the posting that appears in the general ledger.
- ///
- field(22; "Posting Description"; Text[100])
- {
- Caption = 'Posting Description';
- ToolTip = 'Specifies any text that is entered to accompany the posting, for example for information to auditors.';
- }
- ///
- /// Specifies the code for payment terms used for this invoice.
- ///
- field(23; "Payment Terms Code"; Code[10])
- {
- Caption = 'Payment Terms Code';
- ToolTip = 'Specifies a formula that calculates the payment due date, payment discount date, and payment discount amount on the sales document.';
- TableRelation = "Payment Terms";
- }
- ///
- /// Specifies the date by which payment for this invoice is due.
- ///
- field(24; "Due Date"; Date)
- {
- Caption = 'Due Date';
- ToolTip = 'Specifies the date on which the invoice is due for payment.';
- }
- ///
- /// Specifies the percentage of payment discount given if payment is made within the discount period.
- ///
- field(25; "Payment Discount %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Payment Discount %';
- ToolTip = 'Specifies the payment discount percent granted if payment is made on or before the date in the Pmt. Discount Date field.';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
- }
- ///
- /// Specifies the last date for taking the payment discount.
- ///
- field(26; "Pmt. Discount Date"; Date)
- {
- Caption = 'Pmt. Discount Date';
- ToolTip = 'Specifies the date on which the amount in the entry must be paid for a payment discount to be granted.';
- }
- ///
- /// Specifies the shipment method used for delivering the items.
- ///
- field(27; "Shipment Method Code"; Code[10])
- {
- Caption = 'Shipment Method Code';
- ToolTip = 'Specifies the code that represents the shipment method for the invoice.';
- TableRelation = "Shipment Method";
- }
- ///
- /// Specifies the warehouse location from which items were shipped.
- ///
- field(28; "Location Code"; Code[10])
- {
- Caption = 'Location Code';
- ToolTip = 'Specifies the code for the location from which the items were shipped.';
- TableRelation = Location where("Use As In-Transit" = const(false));
- }
- ///
- /// Specifies the first global dimension code used for analysis.
- ///
- field(29; "Shortcut Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,2,1';
- Caption = 'Shortcut Dimension 1 Code';
- 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.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1));
- }
- ///
- /// Specifies the second global dimension code used for analysis.
- ///
- field(30; "Shortcut Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,2,2';
- Caption = 'Shortcut Dimension 2 Code';
- 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.';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2));
- }
- ///
- /// Specifies the customer posting group that determines the G/L accounts for posting.
- ///
- field(31; "Customer Posting Group"; Code[20])
- {
- Caption = 'Customer Posting Group';
- ToolTip = 'Specifies the customer''s market type to link business transactions to.';
- Editable = false;
- TableRelation = "Customer Posting Group";
- }
- ///
- /// Specifies the currency code for amounts on the invoice.
- ///
- field(32; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- ToolTip = 'Specifies the currency code of the invoice.';
- Editable = false;
- TableRelation = Currency;
- }
- ///
- /// Specifies the exchange rate between the document currency and the local currency.
- ///
- field(33; "Currency Factor"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Currency Factor';
- DecimalPlaces = 0 : 15;
- MinValue = 0;
- }
- ///
- /// Specifies the customer price group for determining sales prices.
- ///
- field(34; "Customer Price Group"; Code[10])
- {
- Caption = 'Customer Price Group';
- TableRelation = "Customer Price Group";
- }
- ///
- /// Indicates whether the unit prices on the invoice include VAT.
- ///
- field(35; "Prices Including VAT"; Boolean)
- {
- Caption = 'Prices Including VAT';
- }
- ///
- /// Specifies the code used to determine invoice discount terms.
- ///
- field(37; "Invoice Disc. Code"; Code[20])
- {
- Caption = 'Invoice Disc. Code';
- }
- ///
- /// Specifies the customer discount group for determining line discounts.
- ///
- field(40; "Customer Disc. Group"; Code[20])
- {
- Caption = 'Customer Disc. Group';
- TableRelation = "Customer Discount Group";
- }
- ///
- /// Specifies the language code used for printing documents.
- ///
- field(41; "Language Code"; Code[10])
- {
- Caption = 'Language Code';
- TableRelation = Language;
- }
- ///
- /// Specifies the regional format for dates, numbers, and other data on printed documents.
- ///
- field(42; "Format Region"; Text[80])
- {
- Caption = 'Format Region';
- TableRelation = "Language Selection"."Language Tag";
- }
- ///
- /// Specifies the salesperson responsible for this sale.
- ///
- field(43; "Salesperson Code"; Code[20])
- {
- Caption = 'Salesperson Code';
- ToolTip = 'Specifies which salesperson is associated with the invoice.';
- TableRelation = "Salesperson/Purchaser";
- }
- ///
- /// Specifies the sales order number from which this invoice was created.
- ///
- field(44; "Order No."; Code[20])
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Order No.';
- ToolTip = 'Specifies the number of the related order.';
- }
- ///
- /// Indicates whether comments exist for this invoice.
- ///
- field(46; Comment; Boolean)
- {
- CalcFormula = exist("Sales Comment Line" where("Document Type" = const("Posted Invoice"),
- "No." = field("No."),
- "Document Line No." = const(0)));
- Caption = 'Comment';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies how many times the invoice has been printed.
- ///
- field(47; "No. Printed"; Integer)
- {
- Caption = 'No. Printed';
- ToolTip = 'Specifies how many times the document has been printed.';
- Editable = false;
- }
- ///
- /// Specifies a code indicating that processing of the invoice is on hold.
- ///
- field(51; "On Hold"; Code[3])
- {
- Caption = 'On Hold';
- }
- ///
- /// Specifies the type of document this invoice applies to for payment application.
- ///
- field(52; "Applies-to Doc. Type"; Enum "Gen. Journal Document Type")
- {
- Caption = 'Applies-to Doc. Type';
- }
- ///
- /// Specifies the document number this invoice applies to for payment application.
- ///
- field(53; "Applies-to Doc. No."; Code[20])
- {
- Caption = 'Applies-to Doc. No.';
-
- trigger OnLookup()
- var
- CustLedgEntry: Record "Cust. Ledger Entry";
- begin
- CustLedgEntry.SetCurrentKey("Document No.");
- CustLedgEntry.SetRange("Document Type", "Applies-to Doc. Type");
- CustLedgEntry.SetRange("Document No.", "Applies-to Doc. No.");
- OnLookupAppliesToDocNoOnAfterSetFilters(CustLedgEntry, Rec);
- PAGE.Run(0, CustLedgEntry);
- end;
- }
- ///
- /// Specifies the balancing account number used for posting.
- ///
- field(55; "Bal. Account No."; Code[20])
- {
- Caption = 'Bal. Account No.';
- TableRelation = if ("Bal. Account Type" = const("G/L Account")) "G/L Account"
- else
- if ("Bal. Account Type" = const("Bank Account")) "Bank Account";
- }
- ///
- /// Contains the total invoice amount excluding VAT.
- ///
- field(60; Amount; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Sales Invoice Line".Amount where("Document No." = field("No.")));
- Caption = 'Amount';
- ToolTip = 'Specifies the total, in the currency of the invoice, of the amounts on all the invoice lines. The amount does not include VAT.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the total invoice amount including VAT.
- ///
- field(61; "Amount Including VAT"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Sales Invoice Line"."Amount Including VAT" where("Document No." = field("No.")));
- Caption = 'Amount Including VAT';
- ToolTip = 'Specifies the total of the amounts, including VAT, on all the lines on the document.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the customer's VAT registration number.
- ///
- field(70; "VAT Registration No."; Text[20])
- {
- Caption = 'VAT Registration No.';
- ToolTip = 'Specifies the customer''s VAT registration number for customers.';
- }
- ///
- /// Specifies the customer's company registration number.
- ///
- field(72; "Registration Number"; Text[50])
- {
- Caption = 'Registration No.';
- DataClassification = CustomerContent;
- }
- ///
- /// Specifies the reason code for the transaction.
- ///
- field(73; "Reason Code"; Code[10])
- {
- Caption = 'Reason Code';
- TableRelation = "Reason Code";
- }
- ///
- /// Specifies the general business posting group for determining G/L accounts.
- ///
- field(74; "Gen. Bus. Posting Group"; Code[20])
- {
- Caption = 'Gen. Bus. Posting Group';
- TableRelation = "Gen. Business Posting Group";
- }
- ///
- /// Indicates whether the transaction is part of a three-party trade within the EU.
- ///
- field(75; "EU 3-Party Trade"; Boolean)
- {
- Caption = 'EU 3-Party Trade';
- ToolTip = 'Specifies whether the invoice was part of an EU 3-party trade transaction.';
- }
- ///
- /// Specifies the transaction type for Intrastat reporting.
- ///
- field(76; "Transaction Type"; Code[10])
- {
- Caption = 'Transaction Type';
- TableRelation = "Transaction Type";
- }
- ///
- /// Specifies the transport method for Intrastat reporting.
- ///
- field(77; "Transport Method"; Code[10])
- {
- Caption = 'Transport Method';
- ToolTip = 'Specifies the transport method of the sales header that this line was posted from.';
- TableRelation = "Transport Method";
- }
- ///
- /// Specifies the country or region code for VAT purposes.
- ///
- field(78; "VAT Country/Region Code"; Code[10])
- {
- Caption = 'VAT Country/Region Code';
- TableRelation = "Country/Region";
- }
- ///
- /// Specifies the name of the sell-to customer.
- ///
- field(79; "Sell-to Customer Name"; Text[100])
- {
- Caption = 'Sell-to Customer Name';
- ToolTip = 'Specifies the name of the customer that you shipped the items on the invoice to.';
- }
- ///
- /// Specifies additional name information for the sell-to customer.
- ///
- field(80; "Sell-to Customer Name 2"; Text[50])
- {
- Caption = 'Sell-to Customer Name 2';
- ToolTip = 'Specifies an additional part of the name of the customer who will receive the products and be billed by default.';
- }
- ///
- /// Specifies the street address of the sell-to customer.
- ///
- field(81; "Sell-to Address"; Text[100])
- {
- Caption = 'Sell-to Address';
- ToolTip = 'Specifies the address of the customer that the items on the invoice were shipped to.';
- }
- ///
- /// Specifies additional street address information for the sell-to customer.
- ///
- field(82; "Sell-to Address 2"; Text[50])
- {
- Caption = 'Sell-to Address 2';
- ToolTip = 'Specifies additional address information.';
- }
- ///
- /// Specifies the city of the sell-to customer.
- ///
- field(83; "Sell-to City"; Text[30])
- {
- Caption = 'Sell-to City';
- ToolTip = 'Specifies the city of the customer on the sales document.';
- TableRelation = "Post Code".City;
- ValidateTableRelation = false;
- }
- ///
- /// Specifies the name of the contact person at the sell-to customer.
- ///
- field(84; "Sell-to Contact"; Text[100])
- {
- Caption = 'Sell-to Contact';
- ToolTip = 'Specifies the name of the contact person at the customer''s main address.';
- }
- ///
- /// Specifies the postal code of the bill-to customer.
- ///
- field(85; "Bill-to Post Code"; Code[20])
- {
- Caption = 'Bill-to Post Code';
- ToolTip = 'Specifies the postal code of the customer''s billing address.';
- TableRelation = "Post Code";
- ValidateTableRelation = false;
- }
- ///
- /// Specifies the county or state of the bill-to customer.
- ///
- field(86; "Bill-to County"; Text[30])
- {
- CaptionClass = '5,3,' + "Bill-to Country/Region Code";
- Caption = 'Bill-to County';
- ToolTip = 'Specifies the state, province or county as a part of the address.';
- }
- ///
- /// Specifies the country or region of the bill-to customer.
- ///
- field(87; "Bill-to Country/Region Code"; Code[10])
- {
- Caption = 'Bill-to Country/Region Code';
- ToolTip = 'Specifies the country or region of the address.';
- TableRelation = "Country/Region";
- }
- ///
- /// Specifies the postal code of the sell-to customer.
- ///
- field(88; "Sell-to Post Code"; Code[20])
- {
- Caption = 'Sell-to Post Code';
- ToolTip = 'Specifies the postal code of the customer''s main address.';
- TableRelation = "Post Code";
- ValidateTableRelation = false;
- }
- ///
- /// Specifies the county or state of the sell-to customer.
- ///
- field(89; "Sell-to County"; Text[30])
- {
- CaptionClass = '5,2,' + "Sell-to Country/Region Code";
- Caption = 'Sell-to County';
- ToolTip = 'Specifies the state, province or county as a part of the address.';
- }
- ///
- /// Specifies the country or region of the sell-to customer.
- ///
- field(90; "Sell-to Country/Region Code"; Code[10])
- {
- Caption = 'Sell-to Country/Region Code';
- ToolTip = 'Specifies the country or region of the address.';
- TableRelation = "Country/Region";
- }
- ///
- /// Specifies the postal code of the ship-to address.
- ///
- field(91; "Ship-to Post Code"; Code[20])
- {
- Caption = 'Ship-to Post Code';
- ToolTip = 'Specifies the postal code of the address that the items are shipped to.';
- TableRelation = "Post Code";
- ValidateTableRelation = false;
- }
- ///
- /// Specifies the county or state of the ship-to address.
- ///
- field(92; "Ship-to County"; Text[30])
- {
- CaptionClass = '5,4,' + "Ship-to Country/Region Code";
- Caption = 'Ship-to County';
- ToolTip = 'Specifies the state, province or county as a part of the address.';
- }
- ///
- /// Specifies the country or region of the ship-to address.
- ///
- field(93; "Ship-to Country/Region Code"; Code[10])
- {
- Caption = 'Ship-to Country/Region Code';
- ToolTip = 'Specifies the country or region of the address.';
- TableRelation = "Country/Region";
- }
- ///
- /// Specifies the type of balancing account used for posting.
- ///
- field(94; "Bal. Account Type"; enum "Payment Balance Account Type")
- {
- Caption = 'Bal. Account Type';
- }
- ///
- /// Specifies the exit point for goods leaving the country for Intrastat reporting.
- ///
- field(97; "Exit Point"; Code[10])
- {
- Caption = 'Exit Point';
- ToolTip = 'Specifies the point of exit through which you ship the items out of your country/region, for reporting to Intrastat.';
- TableRelation = "Entry/Exit Point";
- }
- ///
- /// Indicates whether this invoice is a correction entry.
- ///
- field(98; Correction; Boolean)
- {
- Caption = 'Correction';
- }
- ///
- /// Specifies the date when the document was created.
- ///
- field(99; "Document Date"; Date)
- {
- Caption = 'Document Date';
- ToolTip = 'Specifies the date on which you created the sales document.';
- }
- ///
- /// Specifies an external document number such as the customer's purchase order number.
- ///
- field(100; "External Document No."; Code[35])
- {
- Caption = 'External Document No.';
- ToolTip = 'Specifies the external document number that is entered on the sales header that this line was posted from.';
- }
- ///
- /// Specifies the geographic area for Intrastat reporting.
- ///
- field(101; "Area"; Code[10])
- {
- Caption = 'Area';
- ToolTip = 'Specifies the area code used in the invoice.';
- TableRelation = Area;
- }
- ///
- /// Specifies additional transaction details for Intrastat reporting.
- ///
- field(102; "Transaction Specification"; Code[10])
- {
- Caption = 'Transaction Specification';
- ToolTip = 'Specifies the transaction specification that was used in the invoice.';
- TableRelation = "Transaction Specification";
- }
- ///
- /// Specifies the method of payment for the invoice.
- ///
- field(104; "Payment Method Code"; Code[10])
- {
- Caption = 'Payment Method Code';
- ToolTip = 'Specifies how the customer must pay for products on the sales document.';
- TableRelation = "Payment Method";
- }
- ///
- /// Specifies the shipping agent used for delivery.
- ///
- field(105; "Shipping Agent Code"; Code[10])
- {
- AccessByPermission = TableData "Shipping Agent Services" = R;
- Caption = 'Shipping Agent Code';
- ToolTip = 'Specifies which shipping agent is used to transport the items on the sales document to the customer.';
- TableRelation = "Shipping Agent";
- }
- ///
- /// Specifies the tracking number for tracking shipped packages.
- ///
-#if not CLEAN27
-#pragma warning disable AS0086
-#endif
- field(106; "Package Tracking No."; Text[50])
-#if not CLEAN27
-#pragma warning restore AS0086
-#endif
- {
- Caption = 'Package Tracking No.';
- ToolTip = 'Specifies the shipping agent''s package number.';
- }
- ///
- /// Specifies the number series used before the invoice was posted.
- ///
- field(107; "Pre-Assigned No. Series"; Code[20])
- {
- Caption = 'Pre-Assigned No. Series';
- TableRelation = "No. Series";
- }
- ///
- /// Specifies the number series used for the posted invoice.
- ///
- field(108; "No. Series"; Code[20])
- {
- Caption = 'No. Series';
- Editable = false;
- TableRelation = "No. Series";
- }
- ///
- /// Specifies the number series of the original sales order.
- ///
- field(110; "Order No. Series"; Code[20])
- {
- Caption = 'Order No. Series';
- TableRelation = "No. Series";
- }
- ///
- /// Specifies the document number that was assigned before posting.
- ///
- field(111; "Pre-Assigned No."; Code[20])
- {
- Caption = 'Pre-Assigned No.';
- ToolTip = 'Specifies the number of the sales document that the posted invoice was created for.';
- }
- ///
- /// Specifies the user who posted the invoice.
- ///
- field(112; "User ID"; Code[50])
- {
- Caption = 'User ID';
- DataClassification = EndUserIdentifiableInformation;
- TableRelation = User."User Name";
- }
- ///
- /// Specifies the source code that identifies where the entry was created.
- ///
- field(113; "Source Code"; Code[10])
- {
- Caption = 'Source Code';
- TableRelation = "Source Code";
- }
- ///
- /// Specifies the tax area code for sales tax calculation.
- ///
- field(114; "Tax Area Code"; Code[20])
- {
- Caption = 'Tax Area Code';
- ToolTip = 'Specifies the tax area that is used to calculate and post sales tax.';
- TableRelation = "Tax Area";
- }
- ///
- /// Indicates whether the customer is liable for sales tax.
- ///
- field(115; "Tax Liable"; Boolean)
- {
- Caption = 'Tax Liable';
- ToolTip = 'Specifies if the customer or vendor is liable for sales tax.';
- }
- ///
- /// Specifies the VAT business posting group for VAT calculation.
- ///
- field(116; "VAT Bus. Posting Group"; Code[20])
- {
- Caption = 'VAT Bus. Posting Group';
- TableRelation = "VAT Business Posting Group";
- }
- ///
- /// Specifies the percentage of the payment discount that is deducted from the VAT base.
- ///
- field(119; "VAT Base Discount %"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'VAT Base Discount %';
- DecimalPlaces = 0 : 5;
- MaxValue = 100;
- MinValue = 0;
- }
- ///
- /// Specifies the method used to calculate the invoice discount.
- ///
- field(121; "Invoice Discount Calculation"; Option)
- {
- Caption = 'Invoice Discount Calculation';
- OptionCaption = 'None,%,Amount';
- OptionMembers = "None","%",Amount;
- }
- ///
- /// Specifies the invoice discount value as a percentage or amount.
- ///
- field(122; "Invoice Discount Value"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = Rec."Currency Code";
- Caption = 'Invoice Discount Value';
- }
- ///
- /// Specifies the number series for prepayment invoices.
- ///
- field(131; "Prepayment No. Series"; Code[20])
- {
- Caption = 'Prepayment No. Series';
- TableRelation = "No. Series";
- }
- ///
- /// Indicates whether this invoice is a prepayment invoice.
- ///
- field(136; "Prepayment Invoice"; Boolean)
- {
- Caption = 'Prepayment Invoice';
- }
- ///
- /// Specifies the order number associated with the prepayment.
- ///
- field(137; "Prepayment Order No."; Code[20])
- {
- Caption = 'Prepayment Order No.';
- }
- ///
- /// Specifies the quote number from which the invoice originated.
- ///
- field(151; "Quote No."; Code[20])
- {
- Caption = 'Quote No.';
- ToolTip = 'Specifies the number of the sales quote document if a quote was used to start the sales process.';
- Editable = false;
- }
- ///
- /// Specifies the company bank account for receiving payment.
- ///
- field(163; "Company Bank Account Code"; Code[20])
- {
- Caption = 'Company Bank Account Code';
- ToolTip = 'Specifies the bank account to use for bank information when the document is printed.';
- TableRelation = "Bank Account" where("Currency Code" = field("Currency Code"));
- }
- ///
- /// Indicates whether an alternative VAT registration number was used.
- ///
- field(166; "Alt. VAT Registration No."; Boolean)
- {
- Caption = 'Alternative VAT Registration No.';
- Editable = false;
- }
- ///
- /// Indicates whether an alternative general business posting group was used.
- ///
- field(167; "Alt. Gen. Bus Posting Group"; Boolean)
- {
- Caption = 'Alternative Gen. Bus. Posting Group';
- Editable = false;
- }
- ///
- /// Indicates whether an alternative VAT business posting group was used.
- ///
- field(168; "Alt. VAT Bus Posting Group"; Boolean)
- {
- Caption = 'Alternative VAT Bus. Posting Group';
- Editable = false;
- }
- ///
- /// Specifies the phone number of the sell-to customer.
- ///
- field(171; "Sell-to Phone No."; Text[30])
- {
- Caption = 'Sell-to Phone No.';
- ExtendedDatatype = PhoneNo;
- }
- ///
- /// Specifies the email address of the sell-to customer.
- ///
- field(172; "Sell-to E-Mail"; Text[80])
- {
- Caption = 'Email';
- ExtendedDatatype = EMail;
- }
- ///
- /// Specifies the date used for VAT reporting purposes.
- ///
- field(179; "VAT Reporting Date"; Date)
- {
- Caption = 'VAT Date';
- ToolTip = 'Specifies the VAT date on the invoice.';
- Editable = false;
- }
- ///
- /// Specifies a reference number for customer payments.
- ///
- field(180; "Payment Reference"; Code[50])
- {
- Caption = 'Payment Reference';
- ToolTip = 'Specifies the payment of the sales invoice.';
- }
- ///
- /// Contains the timestamp of when the last email was sent for this invoice.
- ///
- field(185; "Last Email Sent Time"; DateTime)
- {
- Caption = 'Last Email Sent Time';
- FieldClass = FlowField;
- CalcFormula = max("Email Related Record".SystemCreatedAt where("Table Id" = const(Database::"Sales Invoice Header"),
- "System Id" = field(SystemId)));
- }
- field(186; "Last Email Sent Message Id"; Guid)
- {
- Caption = 'Last Email Sent Message Id';
- FieldClass = FlowField;
- CalcFormula = lookup("Email Related Record"."Email Message Id" where(SystemCreatedAt = field("Last Email Sent Time")));
- }
- ///
- /// Contains the work or job description for the invoice.
- ///
- field(200; "Work Description"; BLOB)
- {
- Caption = 'Work Description';
- }
- ///
- /// Specifies the phone number at the ship-to address.
- ///
- field(210; "Ship-to Phone No."; Text[30])
- {
- Caption = 'Ship-to Phone No.';
- ToolTip = 'Specifies the telephone number of the company''s shipping address.';
- ExtendedDatatype = PhoneNo;
- }
- ///
- /// Specifies the unique identifier for the dimension set applied to this document.
- ///
- field(480; "Dimension Set ID"; Integer)
- {
- Caption = 'Dimension Set ID';
- Editable = false;
- TableRelation = "Dimension Set Entry";
-
- trigger OnLookup()
- begin
- Rec.ShowDimensions();
- end;
- }
- ///
- /// Specifies the ID of the payment service set used for online payments.
- ///
- field(600; "Payment Service Set ID"; Integer)
- {
- Caption = 'Payment Service Set ID';
- }
- ///
- /// Specifies the identifier for the document in the document exchange service.
- ///
- field(710; "Document Exchange Identifier"; Text[50])
- {
- Caption = 'Document Exchange Identifier';
- }
- ///
- /// Specifies the status of the document exchange process.
- ///
- field(711; "Document Exchange Status"; Enum "Sales Document Exchange Status")
- {
- Caption = 'Document Exchange Status';
- ToolTip = 'Specifies the status of the document if you are using a document exchange service to send it as an electronic document. The status values are reported by the document exchange service.';
- }
- ///
- /// Specifies the original identifier of the document in the exchange service.
- ///
- field(712; "Doc. Exch. Original Identifier"; Text[50])
- {
- Caption = 'Doc. Exch. Original Identifier';
- }
-#if not CLEANSCHEMA26
- field(720; "Coupled to CRM"; Boolean)
- {
- Caption = 'Coupled to Dynamics 365 Sales';
- Editable = false;
- ObsoleteReason = 'Replaced by flow field Coupled to Dataverse';
- ObsoleteState = Removed;
- ObsoleteTag = '26.0';
- }
-#endif
- ///
- /// Indicates whether this invoice is coupled to Dynamics 365 Sales.
- ///
- field(721; "Coupled to Dataverse"; Boolean)
- {
- FieldClass = FlowField;
- Caption = 'Coupled to Dynamics 365 Sales';
- ToolTip = 'Specifies that the posted sales order is coupled to a sales order in Dynamics 365 Sales.';
- Editable = false;
- CalcFormula = exist("CRM Integration Record" where("Integration ID" = field(SystemId), "Table ID" = const(Database::"Sales Invoice Header")));
- }
- ///
- /// Specifies the direct debit mandate ID for collecting payment.
- ///
- field(1200; "Direct Debit Mandate ID"; Code[35])
- {
- Caption = 'Direct Debit Mandate ID';
- ToolTip = 'Specifies the direct-debit mandate that the customer has signed to allow direct debit collection of payments.';
- TableRelation = "SEPA Direct Debit Mandate" where("Customer No." = field("Bill-to Customer No."));
- }
- ///
- /// Indicates whether the invoice has been fully paid and closed.
- ///
- field(1302; Closed; Boolean)
- {
- CalcFormula = - exist("Cust. Ledger Entry" where("Entry No." = field("Cust. Ledger Entry No."),
- Open = filter(true)));
- Caption = 'Closed';
- ToolTip = 'Specifies if the posted invoice is paid. The check box will also be selected if a credit memo for the remaining amount has been applied.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Contains the remaining unpaid amount on the invoice.
- ///
- field(1303; "Remaining Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Cust. Ledg. Entry".Amount where("Cust. Ledger Entry No." = field("Cust. Ledger Entry No.")));
- Caption = 'Remaining Amount';
- ToolTip = 'Specifies the amount that remains to be paid on the sales invoices that are due next week.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Specifies the entry number in the customer ledger.
- ///
- field(1304; "Cust. Ledger Entry No."; Integer)
- {
- Caption = 'Cust. Ledger Entry No.';
- Editable = false;
- TableRelation = "Cust. Ledger Entry"."Entry No.";
- }
- ///
- /// Contains the total invoice discount amount.
- ///
- field(1305; "Invoice Discount Amount"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = Rec."Currency Code";
- CalcFormula = sum("Sales Invoice Line"."Inv. Discount Amount" where("Document No." = field("No.")));
- Caption = 'Invoice Discount Amount';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Indicates whether this invoice has been cancelled by a credit memo.
- ///
- field(1310; Cancelled; Boolean)
- {
- CalcFormula = exist("Cancelled Document" where("Source ID" = const(112),
- "Cancelled Doc. No." = field("No.")));
- Caption = 'Cancelled';
- ToolTip = 'Specifies if the posted sales invoice has been either corrected or canceled.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Indicates whether this invoice was created to correct a cancelled credit memo.
- ///
- field(1311; Corrective; Boolean)
- {
- CalcFormula = exist("Cancelled Document" where("Source ID" = const(114),
- "Cancelled By Doc. No." = field("No.")));
- Caption = 'Corrective';
- ToolTip = 'Specifies if the posted sales invoice is a corrective document.';
- Editable = false;
- FieldClass = FlowField;
- }
- ///
- /// Indicates whether the associated ledger entry has been reversed.
- ///
- field(1312; Reversed; Boolean)
- {
- Caption = 'Reversed';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Cust. Ledger Entry".Reversed where("Entry No." = field("Cust. Ledger Entry No.")));
- }
- ///
- /// Specifies the dispute status code if the invoice is under dispute.
- ///
- field(1340; "Dispute Status"; Code[10])
- {
- Caption = 'Dispute Status';
- TableRelation = "Dispute Status";
- DataClassification = CustomerContent;
- trigger OnValidate()
- begin
- UpdateDisputeStatusId();
- end;
- }
- ///
- /// Specifies the date when the customer promised to pay the invoice.
- ///
- field(1341; "Promised Pay Date"; Date)
- {
- Caption = 'Promised Pay Date';
- ToolTip = 'Specifies the date on which the customer have promised to pay this invoice.';
- DataClassification = CustomerContent;
- }
- ///
- /// Specifies the marketing campaign associated with this invoice.
- ///
- field(5050; "Campaign No."; Code[20])
- {
- Caption = 'Campaign No.';
- TableRelation = Campaign;
- }
- ///
- /// Specifies the contact number for the sell-to customer.
- ///
- field(5052; "Sell-to Contact No."; Code[20])
- {
- Caption = 'Sell-to Contact No.';
- ToolTip = 'Specifies a unique identifier for the contact person at the customer the invoice was sent to.';
- TableRelation = Contact;
- }
- ///
- /// Specifies the contact number for the bill-to customer.
- ///
- field(5053; "Bill-to Contact No."; Code[20])
- {
- Caption = 'Bill-to Contact No.';
- ToolTip = 'Specifies the number of the contact the invoice was sent to.';
- TableRelation = Contact;
- }
- ///
- /// Specifies the sales opportunity associated with this invoice.
- ///
- field(5055; "Opportunity No."; Code[20])
- {
- Caption = 'Opportunity No.';
- TableRelation = Opportunity;
- }
- ///
- /// Specifies the responsibility center for this invoice.
- ///
- field(5700; "Responsibility Center"; Code[10])
- {
- Caption = 'Responsibility Center';
- ToolTip = 'Specifies the code of the responsibility center associated with the user who created the invoice, your company, or the customer in the sales invoice.';
- TableRelation = "Responsibility Center";
- }
- ///
- /// Specifies the shipping agent service level used for delivery.
- ///
- field(5794; "Shipping Agent Service Code"; Code[10])
- {
- Caption = 'Shipping Agent Service Code';
- ToolTip = 'Specifies which shipping agent service is used to transport the items on the sales document to the customer.';
- TableRelation = "Shipping Agent Services".Code where("Shipping Agent Code" = field("Shipping Agent Code"));
- }
- ///
- /// Specifies the method used for calculating prices on this invoice.
- ///
- field(7000; "Price Calculation Method"; Enum "Price Calculation Method")
- {
- Caption = 'Price Calculation Method';
- }
- ///
- /// Indicates whether line discounts are allowed on this invoice.
- ///
- field(7001; "Allow Line Disc."; Boolean)
- {
- Caption = 'Allow Line Disc.';
- }
- ///
- /// Indicates whether the Get Shipment Lines function was used.
- ///
- field(7200; "Get Shipment Used"; Boolean)
- {
- Caption = 'Get Shipment Used';
- }
- ///
- /// Stores the system ID of the draft invoice before posting.
- ///
- field(8001; "Draft Invoice SystemId"; Guid)
- {
- Caption = 'Draft Invoice SystemId';
- DataClassification = SystemMetadata;
- }
- ///
- /// Stores the unique identifier for the dispute status record.
- ///
- field(8010; "Dispute Status Id"; Guid)
- {
- Caption = 'Dispute Status Id';
- TableRelation = "Dispute Status".SystemId;
- trigger OnValidate()
- begin
- UpdateDisputeStatus();
- end;
- }
- field(11000000; "Transaction Mode"; Code[20])
- {
- Caption = 'Transaction Mode';
- TableRelation = "Transaction Mode".Code where("Account Type" = const(Customer));
- }
- field(11000001; "Bank Account"; Code[20])
- {
- Caption = 'Bank Account';
- TableRelation = "Customer Bank Account".Code where("Customer No." = field("Sell-to Customer No."));
- }
- }
-
- keys
- {
- key(Key1; "No.")
- {
- Clustered = true;
- }
- key(Key2; "Order No.")
- {
- }
- key(Key3; "Pre-Assigned No.")
- {
- }
- key(Key4; "Sell-to Customer No.", "External Document No.")
- {
- MaintainSQLIndex = false;
- }
- key(Key5; "Sell-to Customer No.", "Order Date")
- {
- MaintainSQLIndex = false;
- }
- key(Key6; "Sell-to Customer No.")
- {
- }
- key(Key7; "Prepayment Order No.", "Prepayment Invoice")
- {
- }
- key(Key8; "Bill-to Customer No.")
- {
- }
- key(Key9; "Posting Date")
- {
- }
- key(Key10; "Document Exchange Status")
- {
- }
- key(Key11; "Due Date")
- {
- }
- key(Key12; "Salesperson Code")
- {
- }
- key(Key13; SystemModifiedAt)
- {
- }
- }
-
- fieldgroups
- {
- fieldgroup(DropDown; "No.", "Sell-to Customer No.", "Bill-to Customer No.", "Posting Date", "Posting Description")
- {
- }
- fieldgroup(Brick; "No.", "Sell-to Customer Name", Amount, "Due Date", "Amount Including VAT")
- {
- }
- }
-
- trigger OnDelete()
- var
- PostedDeferralHeader: Record "Posted Deferral Header";
- PostSalesDelete: Codeunit "PostSales-Delete";
- begin
- PostSalesDelete.IsDocumentDeletionAllowed("Posting Date");
- CheckNoPrinted();
- LockTable();
- PostSalesDelete.DeleteSalesInvLines(Rec);
-
- SalesCommentLine.SetRange("Document Type", SalesCommentLine."Document Type"::"Posted Invoice");
- SalesCommentLine.SetRange("No.", "No.");
- SalesCommentLine.DeleteAll();
-
- ApprovalsMgmt.DeletePostedApprovalEntries(RecordId);
-
- PostedDeferralHeader.DeleteForDoc(
- Enum::"Deferral Document Type"::Sales.AsInteger(), '', '',
- SalesCommentLine."Document Type"::"Posted Invoice".AsInteger(), "No.");
- end;
-
- var
- SalesCommentLine: Record "Sales Comment Line";
- SalesSetup: Record "Sales & Receivables Setup";
- DimMgt: Codeunit DimensionManagement;
- ApprovalsMgmt: Codeunit "Approvals Mgmt.";
- UserSetupMgt: Codeunit "User Setup Management";
- DocTxt: Label 'Invoice';
- PaymentReference: Text;
- PaymentReferenceLbl: Text;
-
- ///
- /// Checks if the invoice is fully open (no payments applied).
- ///
- /// True if the remaining amount equals the amount including VAT.
- procedure IsFullyOpen(): Boolean
- var
- FullyOpen: Boolean;
- IsHandled: Boolean;
- begin
- OnPostedSalesInvoiceFullyOpen(Rec, FullyOpen, IsHandled);
- if IsHandled then
- exit(FullyOpen);
-
- CalcFields("Amount Including VAT", "Remaining Amount");
- exit("Amount Including VAT" = "Remaining Amount");
- end;
-
- ///
- /// Validates that the invoice has been printed at least once.
- ///
- procedure CheckNoPrinted()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckNoPrinted(Rec, IsHandled);
- if IsHandled then
- exit;
-
- Rec.TestField("No. Printed");
- end;
-
- ///
- /// Sends the invoice records using the customer's document sending profile.
- ///
- procedure SendRecords()
- var
- DocumentSendingProfile: Record "Document Sending Profile";
- DummyReportSelections: Record "Report Selections";
- ReportDistributionMgt: Codeunit "Report Distribution Management";
- DocumentTypeTxt: Text[50];
- IsHandled: Boolean;
- begin
- DocumentTypeTxt := ReportDistributionMgt.GetFullDocumentTypeText(Rec);
-
- IsHandled := false;
- OnBeforeSendRecords(DummyReportSelections, Rec, DocumentTypeTxt, IsHandled);
- if not IsHandled then
- DocumentSendingProfile.SendCustomerRecords(
- DummyReportSelections.Usage::"S.Invoice".AsInteger(), Rec, DocumentTypeTxt, "Bill-to Customer No.", "No.",
- FieldNo("Bill-to Customer No."), FieldNo("No."));
- end;
-
- ///
- /// Sends the invoice using a specific document sending profile.
- ///
- /// The document sending profile to use.
- procedure SendProfile(var DocumentSendingProfile: Record "Document Sending Profile")
- var
- DummyReportSelections: Record "Report Selections";
- ReportDistributionMgt: Codeunit "Report Distribution Management";
- DocumentTypeTxt: Text[50];
- IsHandled: Boolean;
- begin
- DocumentTypeTxt := ReportDistributionMgt.GetFullDocumentTypeText(Rec);
-
- IsHandled := false;
- OnBeforeSendProfile(DummyReportSelections, Rec, DocumentTypeTxt, IsHandled, DocumentSendingProfile);
- if not IsHandled then
- DocumentSendingProfile.Send(
- DummyReportSelections.Usage::"S.Invoice".AsInteger(), Rec, "No.", "Bill-to Customer No.",
- DocumentTypeTxt, FieldNo("Bill-to Customer No."), FieldNo("No."));
- end;
-
- ///
- /// Prints the selected invoice records.
- ///
- /// Whether to show the report request page.
- procedure PrintRecords(ShowRequestPage: Boolean)
- var
- DocumentSendingProfile: Record "Document Sending Profile";
- DummyReportSelections: Record "Report Selections";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforePrintRecords(DummyReportSelections, Rec, ShowRequestPage, IsHandled);
- if not IsHandled then
- DocumentSendingProfile.TrySendToPrinter(
- DummyReportSelections.Usage::"S.Invoice".AsInteger(), Rec, FieldNo("Bill-to Customer No."), ShowRequestPage);
- end;
-
- ///
- /// Updates the Dispute Status field from the Dispute Status Id.
- ///
- procedure UpdateDisputeStatus()
- var
- DisputeStatus: Record "Dispute Status";
- begin
- if not IsNullGuid("Dispute Status Id") then
- DisputeStatus.GetBySystemId("Dispute Status Id");
- Validate("Dispute Status", DisputeStatus.Code);
- end;
-
- ///
- /// Updates the Dispute Status Id from the Dispute Status code.
- ///
- procedure UpdateDisputeStatusId()
- var
- DisputeStatus: Record "Dispute Status";
- begin
- if "Dispute Status" = '' then begin
- Clear("Dispute Status Id");
- exit;
- end;
- if not DisputeStatus.Get("Dispute Status") then
- exit;
- "Dispute Status Id" := DisputeStatus.SystemId;
- end;
-
- ///
- /// Prints the invoices and saves them as document attachments.
- ///
- /// The invoice records to print and attach.
- procedure PrintToDocumentAttachment(var SalesInvoiceHeader: Record "Sales Invoice Header")
- var
- ShowNotificationAction: Boolean;
- begin
- ShowNotificationAction := SalesInvoiceHeader.Count() = 1;
- if SalesInvoiceHeader.FindSet() then
- repeat
- DoPrintToDocumentAttachment(SalesInvoiceHeader, ShowNotificationAction);
- until SalesInvoiceHeader.Next() = 0;
- end;
-
- local procedure DoPrintToDocumentAttachment(SalesInvoiceHeader: Record "Sales Invoice Header"; ShowNotificationAction: Boolean)
- var
- ReportSelections: Record "Report Selections";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeDoPrintToDocumentAttachment(SalesInvoiceHeader, ShowNotificationAction, IsHandled);
- if IsHandled then
- exit;
-
- SalesInvoiceHeader.SetRecFilter();
- ReportSelections.SaveAsDocumentAttachment(
- ReportSelections.Usage::"S.Invoice".AsInteger(), SalesInvoiceHeader, SalesInvoiceHeader."No.", SalesInvoiceHeader."Bill-to Customer No.", ShowNotificationAction);
- end;
-
- ///
- /// Sends the invoice records by email.
- ///
- /// Whether to show the email dialog.
- procedure EmailRecords(ShowDialog: Boolean)
- var
- DocumentSendingProfile: Record "Document Sending Profile";
- DummyReportSelections: Record "Report Selections";
- ReportDistributionMgt: Codeunit "Report Distribution Management";
- DocumentTypeTxt: Text[50];
- IsHandled: Boolean;
- begin
- DocumentTypeTxt := ReportDistributionMgt.GetFullDocumentTypeText(Rec);
-
- IsHandled := false;
- OnBeforeEmailRecords(DummyReportSelections, Rec, DocumentTypeTxt, ShowDialog, IsHandled);
- if not IsHandled then
- DocumentSendingProfile.TrySendToEMail(
- DummyReportSelections.Usage::"S.Invoice".AsInteger(), Rec, FieldNo("No."), DocumentTypeTxt,
- FieldNo("Bill-to Customer No."), ShowDialog);
- end;
-
- ///
- /// Gets the full document type text for the invoice.
- ///
- /// The document type text.
- procedure GetDocTypeTxt(): Text[50]
- var
- ReportDistributionMgt: Codeunit "Report Distribution Management";
- begin
- exit(ReportDistributionMgt.GetFullDocumentTypeText(Rec));
- end;
-
- ///
- /// Opens the Navigate page to show related entries for this invoice.
- ///
- procedure Navigate()
- var
- NavigatePage: Page Navigate;
- begin
- NavigatePage.SetDoc("Posting Date", "No.");
- NavigatePage.SetRec(Rec);
- NavigatePage.Run();
- end;
-
- ///
- /// Opens a page showing value entries with adjustments for this invoice.
- ///
- procedure LookupAdjmtValueEntries()
- var
- ValueEntry: Record "Value Entry";
- begin
- ValueEntry.SetCurrentKey("Document No.");
- ValueEntry.SetRange("Document No.", "No.");
- ValueEntry.SetRange("Document Type", ValueEntry."Document Type"::"Sales Invoice");
- ValueEntry.SetRange(Adjustment, true);
- PAGE.RunModal(0, ValueEntry);
- end;
-
- ///
- /// Gets the customer's VAT registration number.
- ///
- /// The VAT registration number.
- procedure GetCustomerVATRegistrationNumber(): Text
- begin
- exit("VAT Registration No.");
- end;
-
- ///
- /// Gets the label for the VAT registration number field.
- ///
- /// The field caption if VAT registration number exists, otherwise empty.
- procedure GetCustomerVATRegistrationNumberLbl(): Text
- begin
- if "VAT Registration No." = '' then
- exit('');
- exit(FieldCaption("VAT Registration No."));
- end;
-
- ///
- /// Gets the customer's global location number (GLN).
- ///
- /// The GLN if customer exists, otherwise empty.
- procedure GetCustomerGlobalLocationNumber(): Text
- var
- Customer: Record Customer;
- begin
- if Customer.Get("Sell-to Customer No.") then
- exit(Customer.GLN);
- exit('');
- end;
-
- ///
- /// Gets the label for the GLN field.
- ///
- /// The field caption if customer exists, otherwise empty.
- procedure GetCustomerGlobalLocationNumberLbl(): Text
- var
- Customer: Record Customer;
- begin
- if Customer.Get("Sell-to Customer No.") then
- exit(Customer.FieldCaption(GLN));
- exit('');
- end;
-
- ///
- /// Gets the sell-to customer's fax number.
- ///
- /// The fax number if customer exists.
- procedure GetSellToCustomerFaxNo(): Text
- var
- Customer: Record Customer;
- begin
- if Customer.Get("Sell-to Customer No.") then
- exit(Customer."Fax No.");
- end;
-
- ///
- /// Gets the payment reference for the invoice.
- ///
- /// The payment reference text.
- procedure GetPaymentReference(): Text
- begin
- OnGetPaymentReference(PaymentReference);
- exit(PaymentReference);
- end;
-
- ///
- /// Gets the label for the payment reference field.
- ///
- /// The payment reference label text.
- procedure GetPaymentReferenceLbl(): Text
- begin
- OnGetPaymentReferenceLbl(PaymentReferenceLbl);
- exit(PaymentReferenceLbl);
- end;
-
- ///
- /// Gets the legal statement from sales setup for printing on invoices.
- ///
- /// The legal statement text.
- procedure GetLegalStatement(): Text
- begin
- SalesSetup.Get();
- exit(SalesSetup.GetLegalStatement());
- end;
-
- ///
- /// Gets the remaining amount from the associated customer ledger entry.
- ///
- /// The remaining amount.
- procedure GetRemainingAmount(): Decimal
- var
- CustLedgerEntry: Record "Cust. Ledger Entry";
- begin
- CustLedgerEntry.SetRange("Customer No.", "Bill-to Customer No.");
- CustLedgerEntry.SetRange("Posting Date", "Posting Date");
- CustLedgerEntry.SetRange("Document Type", CustLedgerEntry."Document Type"::Invoice);
- CustLedgerEntry.SetRange("Document No.", "No.");
- CustLedgerEntry.SetAutoCalcFields("Remaining Amount");
-
- if not CustLedgerEntry.FindFirst() then
- exit(0);
-
- exit(CustLedgerEntry."Remaining Amount");
- end;
-
- ///
- /// Shows the dimension set entries for this invoice.
- ///
- procedure ShowDimensions()
- begin
- DimMgt.ShowDimensionSet("Dimension Set ID", StrSubstNo('%1 %2', TableCaption(), "No."));
- end;
-
- ///
- /// Sets a security filter based on the user's responsibility center.
- ///
- procedure SetSecurityFilterOnRespCenter()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetSecurityFilterOnRespCenter(Rec, IsHandled);
- if IsHandled then
- exit;
-
- if UserSetupMgt.GetSalesFilter() <> '' then begin
- FilterGroup(2);
- SetRange("Responsibility Center", UserSetupMgt.GetSalesFilter());
- FilterGroup(0);
- end;
- end;
-
- ///
- /// Gets the style class for displaying the document exchange status.
- ///
- /// A style name for UI display.
- procedure GetDocExchStatusStyle(): Text
- begin
- case "Document Exchange Status" of
- "Document Exchange Status"::"Not Sent":
- exit('Standard');
- "Document Exchange Status"::"Sent to Document Exchange Service":
- exit('Ambiguous');
- "Document Exchange Status"::"Delivered to Recipient":
- exit('Favorable');
- else
- exit('Unfavorable');
- end;
- end;
-
- ///
- /// Shows the activity log entries for this invoice.
- ///
- procedure ShowActivityLog()
- var
- ActivityLog: Record "Activity Log";
- begin
- ActivityLog.ShowEntries(Rec.RecordId);
- end;
-
- ///
- /// Opens the shipping agent's tracking website for this shipment.
- ///
- procedure StartTrackingSite()
- var
- ShippingAgent: Record "Shipping Agent";
- begin
- TestField("Shipping Agent Code");
- ShippingAgent.Get("Shipping Agent Code");
- HyperLink(ShippingAgent.GetTrackingInternetAddr("Package Tracking No."));
- end;
-
- ///
- /// Gets the text describing the selected payment services for this invoice.
- ///
- /// The payment services text.
- procedure GetSelectedPaymentsText(): Text
- var
- PaymentServiceSetup: Record "Payment Service Setup";
- begin
- exit(PaymentServiceSetup.GetSelectedPaymentsText("Payment Service Set ID"));
- end;
-
- ///
- /// Gets the work description text from the blob field.
- ///
- /// The work description text.
- procedure GetWorkDescription(): Text
- var
- TempBlob: Codeunit "Temp Blob";
- TypeHelper: Codeunit "Type Helper";
- InStream: InStream;
- begin
- OnBeforeGetWorkDescription(Rec);
- TempBlob.FromRecord(Rec, FieldNo("Work Description"));
- TempBlob.CreateInStream(InStream, TEXTENCODING::UTF8);
- exit(TypeHelper.TryReadAsTextWithSepAndFieldErrMsg(InStream, TypeHelper.LFSeparator(), FieldName("Work Description")));
- end;
-
- ///
- /// Gets the currency symbol for display purposes.
- ///
- /// The currency symbol or code.
- procedure GetCurrencySymbol(): Text[10]
- var
- GeneralLedgerSetup: Record "General Ledger Setup";
- Currency: Record Currency;
- begin
- if GeneralLedgerSetup.Get() then
- if ("Currency Code" = '') or ("Currency Code" = GeneralLedgerSetup."LCY Code") then
- exit(GeneralLedgerSetup.GetCurrencySymbol());
-
- if Currency.Get("Currency Code") then
- exit(Currency.GetCurrencySymbol());
-
- exit("Currency Code");
- end;
-
- ///
- /// Checks if the invoice has been sent via document exchange.
- ///
- /// True if the document has been sent.
- procedure DocExchangeStatusIsSent(): Boolean
- begin
- exit("Document Exchange Status" <> "Document Exchange Status"::"Not Sent");
- end;
-
- ///
- /// Shows the credit memo that canceled or corrected this invoice.
- ///
- procedure ShowCanceledOrCorrCrMemo()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeShowCanceledOrCorrCrMemo(Rec, IsHandled);
- if IsHandled then
- exit;
-
- CalcFields(Cancelled, Corrective);
- case true of
- Cancelled:
- Rec.ShowCorrectiveCreditMemo();
- Corrective:
- Rec.ShowCancelledCreditMemo();
- end;
- end;
-
- ///
- /// Opens the credit memo that corrected this cancelled invoice.
- ///
- procedure ShowCorrectiveCreditMemo()
- var
- CancelledDocument: Record "Cancelled Document";
- SalesCrMemoHeader: Record "Sales Cr.Memo Header";
- PageManagement: Codeunit "Page Management";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeShowCorrectiveCreditMemo(Rec, IsHandled);
- if IsHandled then
- exit;
-
- CalcFields(Cancelled);
- if not Cancelled then
- exit;
-
- if CancelledDocument.FindSalesCancelledInvoice("No.") then begin
- SalesCrMemoHeader.Get(CancelledDocument."Cancelled By Doc. No.");
- PageManagement.PageRun(SalesCrMemoHeader);
- end;
- end;
-
- ///
- /// Opens the credit memo that was cancelled by this corrective invoice.
- ///
- procedure ShowCancelledCreditMemo()
- var
- CancelledDocument: Record "Cancelled Document";
- SalesCrMemoHeader: Record "Sales Cr.Memo Header";
- PageManagement: Codeunit "Page Management";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeShowCancelledCreditMemo(Rec, IsHandled);
- if IsHandled then
- exit;
-
- CalcFields(Corrective);
- if not Corrective then
- exit;
-
- if CancelledDocument.FindSalesCorrectiveInvoice("No.") then begin
- SalesCrMemoHeader.Get(CancelledDocument."Cancelled Doc. No.");
- PageManagement.PageRun(SalesCrMemoHeader);
- end;
- end;
-
- ///
- /// Gets the default document name for email purposes.
- ///
- /// The default email document name.
- procedure GetDefaultEmailDocumentName(): Text[150]
- begin
- exit(DocTxt);
- end;
-
- ///
- /// Raised before checking if the invoice has been printed.
- ///
- /// The sales invoice header being checked.
- /// Set to true to skip default print status check.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckNoPrinted(var SalesInvoiceHeader: Record "Sales Invoice Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before emailing sales invoice records to customers.
- ///
- /// The report selections to use.
- /// The sales invoice header to email.
- /// The document type text.
- /// Indicates whether to show the email dialog.
- /// Set to true to skip default email processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeEmailRecords(var ReportSelections: Record "Report Selections"; var SalesInvoiceHeader: Record "Sales Invoice Header"; DocTxt: Text; var ShowDialog: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before printing sales invoice records.
- ///
- /// The report selections to use.
- /// The sales invoice header to print.
- /// Indicates whether to show the report request page.
- /// Set to true to skip default print processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforePrintRecords(var ReportSelections: Record "Report Selections"; var SalesInvoiceHeader: Record "Sales Invoice Header"; ShowRequestPage: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before printing to document attachment for the sales invoice.
- ///
- /// The sales invoice header to print.
- /// Indicates whether to show notification action.
- /// Set to true to skip default document attachment processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeDoPrintToDocumentAttachment(var SalesInvoiceHeader: Record "Sales Invoice Header"; var ShowNotificationAction: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before sending the sales invoice using the document sending profile.
- ///
- /// The report selections to use.
- /// The sales invoice header to send.
- /// The document type text.
- /// Set to true to skip default sending profile processing.
- /// The document sending profile to use.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSendProfile(var ReportSelections: Record "Report Selections"; var SalesInvoiceHeader: Record "Sales Invoice Header"; DocTxt: Text; var IsHandled: Boolean; var DocumentSendingProfile: Record "Document Sending Profile")
- begin
- end;
-
- ///
- /// Raised before sending sales invoice records.
- ///
- /// The report selections to use.
- /// The sales invoice header to send.
- /// The document type text.
- /// Set to true to skip default sending processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSendRecords(var ReportSelections: Record "Report Selections"; var SalesInvoiceHeader: Record "Sales Invoice Header"; DocTxt: Text; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before showing the cancelled or corrective credit memo related to this invoice.
- ///
- /// The sales invoice header.
- /// Set to true to skip default credit memo display.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowCanceledOrCorrCrMemo(var SalesInvoiceHeader: Record "Sales Invoice Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before showing the corrective credit memo that cancelled this invoice.
- ///
- /// The cancelled sales invoice header.
- /// Set to true to skip default corrective credit memo display.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowCorrectiveCreditMemo(var SalesInvoiceHeader: Record "Sales Invoice Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before showing the cancelled credit memo when this invoice is a corrective invoice.
- ///
- /// The corrective sales invoice header.
- /// Set to true to skip default cancelled credit memo display.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowCancelledCreditMemo(var SalesInvoiceHeader: Record "Sales Invoice Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before setting security filter on responsibility center for the sales invoice.
- ///
- /// The sales invoice header to filter.
- /// Set to true to skip default security filter application.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetSecurityFilterOnRespCenter(var SalesInvoiceHeader: Record "Sales Invoice Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised to retrieve the payment reference for the sales invoice.
- ///
- /// Returns the payment reference text.
- [IntegrationEvent(true, false)]
- local procedure OnGetPaymentReference(var PaymentReference: Text)
- begin
- end;
-
- ///
- /// Raised to retrieve the payment reference label for display.
- ///
- /// Returns the payment reference label text.
- [IntegrationEvent(false, false)]
- local procedure OnGetPaymentReferenceLbl(var PaymentReferenceLbl: Text)
- begin
- end;
-
- ///
- /// Raised after setting filters when looking up the applies-to document number.
- ///
- /// The customer ledger entry with applied filters.
- /// The sales invoice header being processed.
- [IntegrationEvent(false, false)]
- local procedure OnLookupAppliesToDocNoOnAfterSetFilters(var CustLedgEntry: Record "Cust. Ledger Entry"; SalesInvoiceHeader: Record "Sales Invoice Header")
- begin
- end;
-
- ///
- /// Raised to determine whether the posted sales invoice is fully open.
- ///
- /// The sales invoice header being checked.
- /// Returns whether the invoice is fully open.
- /// Set to true to skip default open status check.
- [IntegrationEvent(false, false)]
- local procedure OnPostedSalesInvoiceFullyOpen(var SalesInvoiceHeader: Record "Sales Invoice Header"; var FullyOpen: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before retrieving the work description text for the sales invoice.
- ///
- /// The sales invoice header.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetWorkDescription(var SalesInvoiceHeader: Record "Sales Invoice Header")
- begin
- end;
-}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Sales/Posting/SalesPostPrepayments.Codeunit.al b/src/Layers/NL/BaseApp/Sales/Posting/SalesPostPrepayments.Codeunit.al
deleted file mode 100644
index d081df4226..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Posting/SalesPostPrepayments.Codeunit.al
+++ /dev/null
@@ -1,2867 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.Posting;
-
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Posting;
-using Microsoft.Finance.GeneralLedger.Preview;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.Finance.VAT.Calculation;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.ExtendedText;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Foundation.PaymentTerms;
-using Microsoft.Inventory.Location;
-using Microsoft.Projects.Project.Job;
-using Microsoft.Sales.Comment;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.Document;
-using Microsoft.Sales.History;
-using Microsoft.Sales.Receivables;
-using Microsoft.Sales.Setup;
-using Microsoft.Utilities;
-using System.Telemetry;
-using System.Utilities;
-
-///
-/// Posts prepayment invoices and credit memos for sales orders, creating the corresponding ledger entries and posted documents.
-///
-codeunit 442 "Sales-Post Prepayments"
-{
- Permissions = TableData "Sales Line" = rimd,
- TableData "Sales Invoice Header" = rimd,
- TableData "Sales Invoice Line" = rimd,
- TableData "Sales Cr.Memo Header" = rimd,
- TableData "Sales Cr.Memo Line" = rimd,
- TableData "General Posting Setup" = rimd;
- TableNo = "Sales Header";
-
- trigger OnRun()
- var
- SequenceNoMgt: Codeunit "Sequence No. Mgt.";
- begin
- SequenceNoMgt.SetPreviewMode(PreviewMode);
- Execute(Rec);
- end;
-
- var
- GLSetup: Record "General Ledger Setup";
- SalesSetup: Record "Sales & Receivables Setup";
- GenPostingSetup: Record "General Posting Setup";
- TempGlobalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer" temporary;
- TempSalesLine: Record "Sales Line" temporary;
- GenJournalTemplate: Record "Gen. Journal Template";
- ErrorMessageMgt: Codeunit "Error Message Management";
- DocumentErrorsMgt: Codeunit "Document Errors Mgt.";
- GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line";
- FeatureTelemetry: Codeunit "Feature Telemetry";
- PrepmtDocumentType: Option ,,Invoice,"Credit Memo";
- SuppressCommit: Boolean;
- PreviewMode: Boolean;
-
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text002: Label 'Posting Prepayment Lines #2######\';
- Text003: Label '%1 %2 -> Invoice %3';
- Text004: Label 'Posting sales and VAT #3######\';
- Text005: Label 'Posting to customers #4######\';
- Text006: Label 'Posting to bal. account #5######';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- PostingDateNotAllowedErr: Label '%1 is not within your range of allowed posting dates.', Comment = '%1 - Posting Date field caption';
- SpecifyInvNoSerieTok: Label 'Specify the code for the number series that will be used to assign numbers to posted sales prepayment invoices.';
- SpecifyCrNoSerieTok: Label 'Specify the code for the number series that will be used to assign numbers to posted sales prepayment credit memos.';
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text011: Label '%1 %2 -> Credit Memo %3';
- Text012: Label 'Prepayment %1, %2 %3.';
- Text013: Label 'It is not possible to assign a prepayment amount of %1 to the sales lines.';
-#pragma warning restore AA0470
- Text014: Label 'VAT Amount';
-#pragma warning disable AA0470
- Text015: Label '%1% VAT';
- Text016: Label 'The new prepayment amount must be between %1 and %2.';
- Text017: Label 'At least one line must have %1 > 0 to distribute prepayment amount.';
- Text018: Label 'must be positive when %1 is not 0';
-#pragma warning restore AA0470
- Text019: Label 'Invoice,Credit Memo';
-#pragma warning restore AA0074
- PrepaymentSalesTok: Label 'Prepayment Sales', Locked = true;
- UpdateTok: Label '%1 %2', Locked = true;
-
- ///
- /// Sets the prepayment document type to be posted.
- ///
- /// Specifies the prepayment document type (Invoice or Credit Memo).
- procedure SetDocumentType(DocumentType: Option ,,Invoice,"Credit Memo")
- begin
- PrepmtDocumentType := DocumentType;
- end;
-
- local procedure Execute(var SalesHeader: Record "Sales Header")
- begin
- case PrepmtDocumentType of
- PrepmtDocumentType::Invoice:
- Invoice(SalesHeader);
- PrepmtDocumentType::"Credit Memo":
- CreditMemo(SalesHeader);
- end;
- end;
-
- ///
- /// Posts a prepayment invoice for the sales order.
- ///
- /// Specifies the sales header of the order for which to post the prepayment invoice.
- procedure Invoice(var SalesHeader: Record "Sales Header")
- var
- Handled: Boolean;
- begin
- OnBeforeInvoice(SalesHeader, Handled);
- if not Handled then
- Code(SalesHeader, 0);
- end;
-
- ///
- /// Posts a prepayment credit memo for the sales order.
- ///
- /// Specifies the sales header of the order for which to post the prepayment credit memo.
- procedure CreditMemo(var SalesHeader: Record "Sales Header")
- var
- Handled: Boolean;
- begin
- OnBeforeCreditMemo(SalesHeader, Handled);
- if not Handled then
- Code(SalesHeader, 1);
- end;
-
- local procedure "Code"(var SalesHeader2: Record "Sales Header"; DocumentType: Option Invoice,"Credit Memo")
- var
- SourceCodeSetup: Record "Source Code Setup";
- SalesHeader: Record "Sales Header";
- SalesLine: Record "Sales Line";
- SalesInvHeader: Record "Sales Invoice Header";
- SalesCrMemoHeader: Record "Sales Cr.Memo Header";
- TempPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary;
- TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer";
- TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer";
- GenJnlLine: Record "Gen. Journal Line";
- TempVATAmountLine: Record "VAT Amount Line" temporary;
- TempVATAmountLineDeduct: Record "VAT Amount Line" temporary;
- CustLedgEntry: Record "Cust. Ledger Entry";
- TempSalesLines: Record "Sales Line" temporary;
- GenJnlPostPreview: Codeunit "Gen. Jnl.-Post Preview";
- DocumentTotals: Codeunit "Document Totals";
- Window: Dialog;
- GenJnlLineDocNo: Code[20];
- GenJnlLineExtDocNo: Code[35];
- SrcCode: Code[10];
- PostingNoSeriesCode: Code[20];
- ModifyHeader: Boolean;
- IsHandled: Boolean;
- ShouldSetPendingPrepaymentStatus: Boolean;
- CalcPmtDiscOnCrMemos: Boolean;
- PostingDescription: Text[100];
- GenJnlLineDocType: Enum "Gen. Journal Document Type";
- PrevLineNo: Integer;
- LineCount: Integer;
- PostedDocTabNo: Integer;
- LineNo: Integer;
- begin
- OnBeforePostPrepayments(SalesHeader2, DocumentType, SuppressCommit, PreviewMode);
-
- SalesHeader := SalesHeader2;
- GLSetup.GetRecordOnce();
- SalesSetup.Get();
-
- FeatureTelemetry.LogUptake('0000KQB', PrepaymentSalesTok, Enum::"Feature Uptake Status"::Used);
- FeatureTelemetry.LogUsage('0000KQC', PrepaymentSalesTok, PrepaymentSalesTok);
-
- if (SalesSetup."Calc. Inv. Discount" and (SalesHeader.Status = SalesHeader.Status::Open)) then begin
- DocumentTotals.SalesRedistributeInvoiceDiscountAmountsOnDocument(SalesHeader);
- SalesHeader.Get(SalesHeader."Document Type", SalesHeader."No."); // Reload SalesHeader that might have been changed
- end;
-
- OnCodeOnBeforeCheckPrepmtDoc(SalesHeader, DocumentType);
-
- CheckPrepmtDoc(SalesHeader, DocumentType);
-
- UpdateDocNos(SalesHeader, DocumentType, GenJnlLineDocNo, PostingNoSeriesCode, ModifyHeader);
-
- if not PreviewMode and ModifyHeader then begin
- SalesHeader.Modify();
- if not SuppressCommit then
- Commit();
- end;
-
- OnCodeOnBeforeWindowOpen(SalesHeader, DocumentType);
- if GuiAllowed then begin
- Window.Open(
- '#1#################################\\' +
- Text002 +
- Text004 +
- Text005 +
- Text006);
- Window.Update(1, StrSubstNo(UpdateTok, SelectStr(1 + DocumentType, Text019), SalesHeader."No."));
- end;
-
- SourceCodeSetup.Get();
- SrcCode := SourceCodeSetup.Sales;
- OnCodeOnAfterSetSourceCode(SalesHeader, SourceCodeSetup, SrcCode);
- if SalesHeader."Prepmt. Posting Description" <> '' then
- PostingDescription := SalesHeader."Prepmt. Posting Description"
- else
- PostingDescription :=
- CopyStr(
- StrSubstNo(Text012, SelectStr(1 + DocumentType, Text019), SalesHeader."Document Type", SalesHeader."No."),
- 1, MaxStrLen(SalesHeader."Posting Description"));
- OnCodeOnAfterPostingDescriptionSet(SalesHeader, DocumentType, PostingDescription);
- // Create posted header
- if SalesSetup."Ext. Doc. No. Mandatory" then
- SalesHeader.TestField("External Document No.");
-
- OnCodeOnBeforeInsertPostedHeaders(SalesHeader);
- case DocumentType of
- DocumentType::Invoice:
- begin
- InsertSalesInvHeader(SalesInvHeader, SalesHeader, PostingDescription, GenJnlLineDocNo, SrcCode, PostingNoSeriesCode);
- GenJnlLineDocType := GenJnlLine."Document Type"::Invoice;
- PostedDocTabNo := Database::"Sales Invoice Header";
- if GuiAllowed then
- Window.Update(1, StrSubstNo(Text003, SalesHeader."Document Type", SalesHeader."No.", SalesInvHeader."No."));
- end;
- DocumentType::"Credit Memo":
- begin
- CalcPmtDiscOnCrMemos := GetCalcPmtDiscOnCrMemos(SalesHeader."Prepmt. Payment Terms Code");
- InsertSalesCrMemoHeader(
- SalesCrMemoHeader, SalesHeader, PostingDescription, GenJnlLineDocNo, SrcCode, PostingNoSeriesCode,
- CalcPmtDiscOnCrMemos);
- GenJnlLineDocType := GenJnlLine."Document Type"::"Credit Memo";
- PostedDocTabNo := Database::"Sales Cr.Memo Header";
- if GuiAllowed then
- Window.Update(1, StrSubstNo(Text011, SalesHeader."Document Type", SalesHeader."No.", SalesCrMemoHeader."No."));
- end;
- end;
- GenJnlLineExtDocNo := SalesHeader."External Document No.";
- // Reverse old lines
- if DocumentType = DocumentType::Invoice then begin
- GetSalesLinesToDeduct(SalesHeader, TempSalesLines);
- if not TempSalesLines.IsEmpty() then
- CalcVATAmountLines(SalesHeader, TempSalesLines, TempVATAmountLineDeduct, DocumentType::"Credit Memo");
- end;
- // Create Lines
- TempPrepmtInvLineBuffer.DeleteAll();
-
- IsHandled := false;
- OnCodeOnBeforeCalcAndUpdateVATAmountLines(SalesHeader, SalesLine, TempPrepmtInvLineBuffer, DocumentType, IsHandled);
- if not IsHandled then begin
- CalcVATAmountLines(SalesHeader, SalesLine, TempVATAmountLine, DocumentType);
- TempVATAmountLine.DeductVATAmountLine(TempVATAmountLineDeduct);
- UpdateVATOnLines(SalesHeader, SalesLine, TempVATAmountLine, DocumentType);
- BuildInvLineBuffer(SalesHeader, SalesLine, DocumentType, TempPrepmtInvLineBuffer, true);
- end;
- OnCodeOnAfterBuildInvLineBuffer(TempVATAmountLine, TempPrepmtInvLineBuffer);
-
- CreateLinesFromBuffer(SalesHeader, SalesLine, TempPrepmtInvLineBuffer, SalesInvHeader, SalesCrMemoHeader, PrevLineNo, LineCount, PostedDocTabNo, LineNo, DocumentType, Window, GenJnlLineDocNo);
-
- if SalesHeader."Compress Prepayment" then
- case DocumentType of
- DocumentType::Invoice:
- CopyLineCommentLinesCompressedPrepayment(SalesHeader."No.", Database::"Sales Invoice Header", SalesInvHeader."No.");
- DocumentType::"Credit Memo":
- CopyLineCommentLinesCompressedPrepayment(SalesHeader."No.", Database::"Sales Cr.Memo Header", SalesCrMemoHeader."No.");
- end;
-
- OnAfterCreateLinesOnBeforeGLPosting(SalesHeader, SalesInvHeader, SalesCrMemoHeader, TempPrepmtInvLineBuffer, DocumentType, LineNo);
-
- // G/L Posting
- LineCount := 0;
- if not SalesHeader."Compress Prepayment" then
- TempPrepmtInvLineBuffer.CompressBuffer();
- TempPrepmtInvLineBuffer.SetRange(Adjustment, false);
- TempPrepmtInvLineBuffer.FindSet(true);
- repeat
- if DocumentType = DocumentType::Invoice then
- TempPrepmtInvLineBuffer.ReverseAmounts();
- RoundAmounts(SalesHeader, TempPrepmtInvLineBuffer, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY);
- if SalesHeader."Currency Code" = '' then begin
- AdjustInvLineBuffers(SalesHeader, TempPrepmtInvLineBuffer, TotalPrepmtInvLineBuffer, DocumentType);
- TotalPrepmtInvLineBufferLCY := TotalPrepmtInvLineBuffer;
- end else
- AdjustInvLineBuffers(SalesHeader, TempPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY, DocumentType);
- TempPrepmtInvLineBuffer.Modify();
- until TempPrepmtInvLineBuffer.Next() = 0;
-
-
- if (TotalPrepmtInvLineBuffer."VAT Amount" <> 0) and (SalesLine."VAT %" = 0) then
- SalesAssertPrepmtAmountNotMoreThanDocAmountBeforePost(TotalPrepmtInvLineBuffer, SalesHeader);
-
- TempPrepmtInvLineBuffer.Reset();
- TempPrepmtInvLineBuffer.SetCurrentKey(Adjustment);
- TempPrepmtInvLineBuffer.Find('+');
- repeat
- LineCount := LineCount + 1;
- if GuiAllowed then
- Window.Update(3, LineCount);
-
- PostPrepmtInvLineBuffer(
- SalesHeader, TempPrepmtInvLineBuffer, DocumentType, PostingDescription,
- GenJnlLineDocType, GenJnlLineDocNo, GenJnlLineExtDocNo, SrcCode, PostingNoSeriesCode);
- until TempPrepmtInvLineBuffer.Next(-1) = 0;
- // Post customer entry
- if GuiAllowed then
- Window.Update(4, 1);
- OnCodeOnBeforePostCustomerEntry(SalesHeader, TempPrepmtInvLineBuffer);
- PostCustomerEntry(
- SalesHeader, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY, DocumentType, PostingDescription,
- GenJnlLineDocType, GenJnlLineDocNo, GenJnlLineExtDocNo, SrcCode, PostingNoSeriesCode, CalcPmtDiscOnCrMemos);
-
- UpdatePostedSalesDocument(DocumentType, GenJnlLineDocNo, CustLedgEntry);
-
- SalesAssertPrepmtAmountNotMoreThanDocAmount(CustLedgEntry, SalesHeader, SalesLine);
- // Balancing account
- if SalesHeader."Bal. Account No." <> '' then begin
- if GuiAllowed then
- Window.Update(5, 1);
- OnCodeOnBeforePostBalancingEntry(SalesHeader, TempPrepmtInvLineBuffer);
- PostBalancingEntry(
- SalesHeader, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY, CustLedgEntry, DocumentType,
- PostingDescription, GenJnlLineDocType, GenJnlLineDocNo, GenJnlLineExtDocNo, SrcCode, PostingNoSeriesCode);
- end;
- // Update lines & header
- UpdateSalesDocument(SalesHeader, SalesLine, DocumentType, GenJnlLineDocNo);
- ShouldSetPendingPrepaymentStatus := SalesHeader.TestStatusIsNotPendingPrepayment();
- OnCodeOnAfterCalcShouldSetPendingPrepaymentStatus(SalesHeader, SalesInvHeader, SalesCrMemoHeader, DocumentType, PreviewMode, ShouldSetPendingPrepaymentStatus);
- if ShouldSetPendingPrepaymentStatus then
- SalesHeader.Status := SalesHeader.Status::"Pending Prepayment";
- SalesHeader.Modify();
-
- OnAfterPostPrepaymentsOnBeforeThrowPreviewModeError(SalesHeader, SalesInvHeader, SalesCrMemoHeader, GenJnlPostLine, PreviewMode);
-
- if PreviewMode then begin
- if GuiAllowed then
- Window.Close();
- OnBeforeThrowPreviewError(SalesHeader);
- GenJnlPostPreview.ThrowError();
- end;
-
- SalesHeader2 := SalesHeader;
-
- OnAfterPostPrepayments(SalesHeader2, DocumentType, SuppressCommit, SalesInvHeader, SalesCrMemoHeader, CustLedgEntry);
- end;
-
- local procedure CreateLinesFromBuffer(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var TempPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary; var SalesInvHeader: Record "Sales Invoice Header"; var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var PrevLineNo: Integer; var LineCount: Integer; var PostedDocTabNo: Integer; var LineNo: Integer; DocumentType: Option Invoice,"Credit Memo"; var Window: Dialog; GenJnlLineDocNo: Code[20])
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateLinesFromBuffer(SalesHeader, SalesLine, TempPrepmtInvLineBuffer, LineCount, SalesInvHeader, SalesCrMemoHeader, PostedDocTabNo, DocumentType, LineNo, GenJnlLineDocNo, IsHandled);
- if IsHandled then
- exit;
-
- TempPrepmtInvLineBuffer.Find('-');
- repeat
- LineCount := LineCount + 1;
- if GuiAllowed then
- Window.Update(2, LineCount);
- LineNo := PrevLineNo + 10000;
- case DocumentType of
- DocumentType::Invoice:
- begin
- InsertSalesInvLine(SalesInvHeader, LineNo, TempPrepmtInvLineBuffer, SalesHeader);
- PostedDocTabNo := Database::"Sales Invoice Line";
- end;
- DocumentType::"Credit Memo":
- begin
- InsertSalesCrMemoLine(SalesCrMemoHeader, LineNo, TempPrepmtInvLineBuffer, SalesHeader);
- PostedDocTabNo := Database::"Sales Cr.Memo Line";
- end;
- end;
- PrevLineNo := LineNo;
- InsertExtendedText(PostedDocTabNo, GenJnlLineDocNo, TempPrepmtInvLineBuffer."G/L Account No.", SalesHeader."Document Date", SalesHeader."Language Code", PrevLineNo, SalesHeader);
- until TempPrepmtInvLineBuffer.Next() = 0;
- end;
-
- local procedure SalesAssertPrepmtAmountNotMoreThanDocAmount(var CustLedgEntry: Record "Cust. Ledger Entry"; SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line")
- var
- PrepaymentMgt: Codeunit "Prepayment Mgt.";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSalesAssertPrepmtAmountNotMoreThanDocAmount(CustLedgEntry, SalesHeader, SalesLine, IsHandled);
- if IsHandled then
- exit;
-
- if CustLedgEntry."Entry No." = 0 then // Fallback if the Customer Ledger Entry was not provided from UpdatePostedSalesDocument or the event
- CustLedgEntry.FindLast();
-
- CustLedgEntry.CalcFields(Amount);
- if SalesHeader."Document Type" = SalesHeader."Document Type"::Order then begin
- SalesLine.CalcSums("Amount Including VAT");
- PrepaymentMgt.AssertPrepmtAmountNotMoreThanDocAmount(
- SalesLine."Amount Including VAT", CustLedgEntry.Amount, SalesHeader."Currency Code", SalesSetup."Invoice Rounding");
- end;
- end;
-
- local procedure SalesAssertPrepmtAmountNotMoreThanDocAmountBeforePost(TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; SalesHeader: Record "Sales Header")
- var
- FromSalesLine: Record "Sales Line";
- PrepaymentMgt: Codeunit "Prepayment Mgt.";
- PrepmtAmountInclVAT: Decimal;
- SalesPrepmtAmount: Decimal;
- begin
- if not (SalesHeader."Document Type" = SalesHeader."Document Type"::Order) then
- exit;
- FromSalesLine.SetLoadFields("Document Type", "Document No.", "Type", "Prepayment %", "Amount Including VAT");
- FromSalesLine.SetRange("Document Type", SalesHeader."Document Type");
- FromSalesLine.SetRange("Document No.", SalesHeader."No.");
- FromSalesLine.SetFilter(Type, '<>%1', FromSalesLine.Type::" ");
- FromSalesLine.SetFilter("Line Amount", '<>0');
- FromSalesLine.SetFilter("Prepayment %", '<>0');
- if FromSalesLine.FindSet() then
- repeat
- SalesPrepmtAmount += FromSalesLine."Amount Including VAT" * FromSalesLine."Prepayment %" / 100;
- until FromSalesLine.Next() = 0;
- PrepmtAmountInclVAT := -TotalPrepmtInvLineBuffer."Amount Incl. VAT";
- PrepaymentMgt.AssertPrepmtAmountNotMoreThanDocAmount(
- SalesPrepmtAmount, PrepmtAmountInclVAT, SalesHeader."Currency Code", SalesSetup."Invoice Rounding");
- end;
- ///
- /// Validates the sales order and prepayment settings before posting a prepayment document.
- ///
- /// Specifies the sales header of the order to validate.
- /// Specifies the prepayment document type (Invoice or Credit Memo) to validate for.
- procedure CheckPrepmtDoc(SalesHeader: Record "Sales Header"; DocumentType: Option Invoice,"Credit Memo")
- var
- Cust: Record Customer;
- GenJnlCheckLine: Codeunit "Gen. Jnl.-Check Line";
- CheckDimensions: Codeunit "Check Dimensions";
- ForwardLinkMgt: codeunit "Forward Link Mgt.";
- ErrorContextElement: Codeunit "Error Context Element";
- SetupRecID: RecordID;
- begin
- OnBeforeCheckPrepmtDoc(SalesHeader, DocumentType, SuppressCommit);
-
- SalesHeader.TestField("Document Type", SalesHeader."Document Type"::Order);
- SalesHeader.TestField("Sell-to Customer No.");
- SalesHeader.TestField("Bill-to Customer No.");
- SalesHeader.TestField("Posting Date");
- SalesHeader.TestField("Document Date");
- GLSetup.GetRecordOnce();
- if GLSetup."Journal Templ. Name Mandatory" then
- SalesHeader.TestField("Journal Templ. Name");
- ErrorMessageMgt.PushContext(ErrorContextElement, SalesHeader.RecordId, 0, '');
- if GenJnlCheckLine.DateNotAllowed(SalesHeader."Posting Date", SalesHeader."Journal Templ. Name") then
- ErrorMessageMgt.LogContextFieldError(
- SalesHeader.FieldNo("Posting Date"), StrSubstNo(PostingDateNotAllowedErr, SalesHeader.FieldCaption("Posting Date")),
- SetupRecID, ErrorMessageMgt.GetFieldNo(SetupRecID.TableNo, ''),
- ForwardLinkMgt.GetHelpCodeForAllowedPostingDate());
-
- if not CheckOpenPrepaymentLines(SalesHeader, DocumentType) then
- Error(DocumentErrorsMgt.GetNothingToPostErrorMsg());
-
- CheckDimensions.CheckSalesPrepmtDim(SalesHeader);
-
- SalesHeader.CheckSalesPostRestrictions();
- Cust.Get(SalesHeader."Sell-to Customer No.");
- Cust.CheckBlockedCustOnDocs(Cust, Enum::"Sales Document Type".FromInteger(PrepmtDocTypeToDocType(DocumentType)), false, true);
- if SalesHeader."Bill-to Customer No." <> SalesHeader."Sell-to Customer No." then begin
- Cust.Get(SalesHeader."Bill-to Customer No.");
- Cust.CheckBlockedCustOnDocs(Cust, Enum::"Sales Document Type".FromInteger(PrepmtDocTypeToDocType(DocumentType)), false, true);
- end;
- OnAfterCheckPrepmtDoc(SalesHeader, DocumentType, SuppressCommit, ErrorMessageMgt);
- ErrorMessageMgt.Finish(SalesHeader.RecordId);
- end;
-
- local procedure UpdateDocNos(var SalesHeader: Record "Sales Header"; DocumentType: Option Invoice,"Credit Memo"; var DocNo: Code[20]; var NoSeriesCode: Code[20]; var ModifyHeader: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateDocNos(SalesHeader, DocumentType, DocNo, NoSeriesCode, ModifyHeader, PreviewMode, IsHandled);
- if IsHandled then
- exit;
-
- ModifyHeader := false;
- case DocumentType of
- DocumentType::Invoice:
- begin
- SalesHeader.TestField("Prepayment Due Date");
- SalesHeader.TestField("Prepmt. Cr. Memo No.", '');
- if SalesHeader."Prepayment No." = '' then
- if not PreviewMode then
- UpdateInvoiceDocNos(SalesHeader, ModifyHeader)
- else
- SalesHeader."Prepayment No." := '***';
- DocNo := SalesHeader."Prepayment No.";
- NoSeriesCode := SalesHeader."Prepayment No. Series";
- end;
- DocumentType::"Credit Memo":
- begin
- SalesHeader.TestField("Prepayment No.", '');
- if SalesHeader."Prepmt. Cr. Memo No." = '' then
- if not PreviewMode then
- UpdateCrMemoDocNos(SalesHeader, ModifyHeader)
- else
- SalesHeader."Prepmt. Cr. Memo No." := '***';
- DocNo := SalesHeader."Prepmt. Cr. Memo No.";
- NoSeriesCode := SalesHeader."Prepmt. Cr. Memo No. Series";
- end;
- end;
-
- if GLSetup."Journal Templ. Name Mandatory" then
- GenJournalTemplate.Get(SalesHeader."Journal Templ. Name");
-
- OnAfterUpdateDocNos(SalesHeader);
- end;
-
- local procedure UpdateInvoiceDocNos(var SalesHeader: Record "Sales Header"; var ModifyHeader: Boolean)
- var
- SalesReceivablesSetup: Record "Sales & Receivables Setup";
- NoSeries: Codeunit "No. Series";
- ErrorContextElement: Codeunit "Error Context Element";
- begin
- if GLSetup."Journal Templ. Name Mandatory" then begin
- SalesReceivablesSetup.GetRecordOnce();
- SalesReceivablesSetup.TestField("S. Prep. Inv. Template Name");
- GenJournalTemplate.Get(SalesReceivablesSetup."S. Prep. Inv. Template Name");
- GenJournalTemplate.TestField("Posting No. Series");
- SalesHeader."Prepayment No." := NoSeries.GetNextNo(GenJournalTemplate."Posting No. Series", SalesHeader."Posting Date");
- ModifyHeader := true;
- end else begin
- if SalesHeader."Prepayment No. Series" = '' then begin
- SalesReceivablesSetup.Get();
- ErrorMessageMgt.PushContext(ErrorContextElement, SalesReceivablesSetup.RecordId, 0, '');
- if SalesReceivablesSetup."Posted Prepmt. Inv. Nos." = '' then
- ErrorMessageMgt.LogContextFieldError(
- SalesReceivablesSetup.FieldNo("Posted Prepmt. Inv. Nos."), SpecifyInvNoSerieTok,
- SalesReceivablesSetup.RecordId, SalesReceivablesSetup.FieldNo("Posted Prepmt. Inv. Nos."), '');
- ErrorMessageMgt.Finish(SalesReceivablesSetup.RecordId);
- SalesHeader."Prepayment No. Series" := SalesReceivablesSetup."Posted Prepmt. Inv. Nos.";
- ModifyHeader := true;
- end;
- SalesHeader.TestField("Prepayment No. Series");
- SalesHeader."Prepayment No." := NoSeries.GetNextNo(SalesHeader."Prepayment No. Series", SalesHeader."Posting Date");
- ModifyHeader := true;
- end;
- end;
-
- local procedure UpdateCrMemoDocNos(var SalesHeader: Record "Sales Header"; var ModifyHeader: Boolean)
- var
- SalesReceivablesSetup: Record "Sales & Receivables Setup";
- NoSeries: Codeunit "No. Series";
- ErrorContextElement: Codeunit "Error Context Element";
- begin
- if GLSetup."Journal Templ. Name Mandatory" then begin
- SalesReceivablesSetup.GetRecordOnce();
- SalesReceivablesSetup.TestField("S. Prep. Cr.Memo Template Name");
- GenJournalTemplate.Get(SalesReceivablesSetup."S. Prep. Cr.Memo Template Name");
- GenJournalTemplate.TestField("Posting No. Series");
- SalesHeader."Prepmt. Cr. Memo No." := NoSeries.GetNextNo(GenJournalTemplate."Posting No. Series", SalesHeader."Posting Date");
- ModifyHeader := true;
- end else begin
- if SalesHeader."Prepmt. Cr. Memo No. Series" = '' then begin
- SalesReceivablesSetup.Get();
- ErrorMessageMgt.PushContext(ErrorContextElement, SalesReceivablesSetup.RecordId, 0, '');
- if SalesReceivablesSetup."Posted Prepmt. Cr. Memo Nos." = '' then
- ErrorMessageMgt.LogContextFieldError(
- SalesReceivablesSetup.FieldNo("Posted Prepmt. Cr. Memo Nos."), SpecifyCrNoSerieTok,
- SalesReceivablesSetup.RecordId, SalesReceivablesSetup.FieldNo("Posted Prepmt. Cr. Memo Nos."), '');
- ErrorMessageMgt.Finish(SalesReceivablesSetup.RecordId);
- SalesReceivablesSetup.Testfield("Posted Prepmt. Cr. Memo Nos.");
- SalesHeader."Prepmt. Cr. Memo No. Series" := SalesReceivablesSetup."Posted Prepmt. Cr. Memo Nos.";
- ModifyHeader := true;
- end;
- SalesHeader.TestField("Prepmt. Cr. Memo No. Series");
- SalesHeader."Prepmt. Cr. Memo No." := NoSeries.GetNextNo(SalesHeader."Prepmt. Cr. Memo No. Series", SalesHeader."Posting Date");
- ModifyHeader := true;
- end;
- end;
-
- ///
- /// Checks if there are open prepayment lines available for posting.
- ///
- /// Specifies the sales header of the order to check.
- /// Specifies the prepayment document type to check for.
- /// Returns true if open prepayment lines are found.
- procedure CheckOpenPrepaymentLines(SalesHeader: Record "Sales Header"; DocumentType: Option) Found: Boolean
- var
- SalesLine: Record "Sales Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckOpenPrepaymentLines(SalesHeader, DocumentType, Found, IsHandled);
- if IsHandled then
- exit(Found);
-
- ApplyFilter(SalesHeader, DocumentType, SalesLine);
- if SalesLine.Find('-') then
- repeat
- if not Found then
- Found := PrepmtAmount(SalesLine, DocumentType) <> 0;
- if SalesLine."Prepmt. Amt. Inv." = 0 then begin
- SalesLine.UpdatePrepmtSetupFields();
- SalesLine.Modify();
- end;
- until SalesLine.Next() = 0;
- exit(Found);
- end;
-
- local procedure RoundAmounts(SalesHeader: Record "Sales Header"; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBufLCY: Record "Prepayment Inv. Line Buffer")
- var
- VAT: Boolean;
- begin
- TotalPrepmtInvLineBuf.IncrAmounts(PrepmtInvLineBuf);
-
- if SalesHeader."Currency Code" <> '' then begin
- VAT := PrepmtInvLineBuf.Amount <> PrepmtInvLineBuf."Amount Incl. VAT";
- PrepmtInvLineBuf."Amount Incl. VAT" :=
- AmountToLCY(SalesHeader, TotalPrepmtInvLineBuf."Amount Incl. VAT", TotalPrepmtInvLineBufLCY."Amount Incl. VAT");
- if VAT then
- PrepmtInvLineBuf.Amount := AmountToLCY(SalesHeader, TotalPrepmtInvLineBuf.Amount, TotalPrepmtInvLineBufLCY.Amount)
- else
- PrepmtInvLineBuf.Amount := PrepmtInvLineBuf."Amount Incl. VAT";
- PrepmtInvLineBuf."VAT Amount" := PrepmtInvLineBuf."Amount Incl. VAT" - PrepmtInvLineBuf.Amount;
- if PrepmtInvLineBuf."VAT Base Amount" <> 0 then
- PrepmtInvLineBuf."VAT Base Amount" := PrepmtInvLineBuf.Amount;
- PrepmtInvLineBuf."Orig. Pmt. Disc. Possible" :=
- AmountToLCY(
- SalesHeader,
- TotalPrepmtInvLineBuf."Orig. Pmt. Disc. Possible", TotalPrepmtInvLineBufLCY."Orig. Pmt. Disc. Possible");
- end;
-
- OnRoundAmountsOnBeforeIncrAmounts(SalesHeader, PrepmtInvLineBuf, TotalPrepmtInvLineBuf, TotalPrepmtInvLineBufLCY);
-
- TotalPrepmtInvLineBufLCY.IncrAmounts(PrepmtInvLineBuf);
-
- OnAfterRoundAmounts(SalesHeader, PrepmtInvLineBuf, TotalPrepmtInvLineBuf, TotalPrepmtInvLineBufLCY);
- end;
-
- local procedure AmountToLCY(SalesHeader: Record "Sales Header"; TotalAmt: Decimal; PrevTotalAmt: Decimal): Decimal
- var
- CurrExchRate: Record "Currency Exchange Rate";
- begin
- CurrExchRate.Init();
- exit(
- Round(
- CurrExchRate.ExchangeAmtFCYToLCY(SalesHeader."Posting Date", SalesHeader."Currency Code", TotalAmt, SalesHeader."Currency Factor")) -
- PrevTotalAmt);
- end;
-
- local procedure BuildInvLineBuffer(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; DocumentType: Option; var TempPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer" temporary; UpdateLines: Boolean)
- var
- PrepmtInvLineBuf2: Record "Prepayment Inv. Line Buffer";
- TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer";
- TotalPrepmtInvLineBufferDummy: Record "Prepayment Inv. Line Buffer";
- HasInvoiceDiscount: Boolean;
- begin
- TempGlobalPrepmtInvLineBuf.Reset();
- TempGlobalPrepmtInvLineBuf.DeleteAll();
- TempSalesLine.Reset();
- TempSalesLine.DeleteAll();
- SalesSetup.Get();
- ApplyFilter(SalesHeader, DocumentType, SalesLine);
- if SalesLine.Find('-') then
- repeat
- if PrepmtAmount(SalesLine, DocumentType) <> 0 then begin
- if not CheckSystemCreatedInvoiceRoundEntry(SalesLine, SalesHeader."Customer Posting Group") then
- CheckSalesLineIsNegative(SalesHeader, SalesLine);
-
- if SalesLine."Inv. Discount Amount" <> 0 then
- HasInvoiceDiscount := true;
-
- OnBuildInvLineBufferOnBeforeFillInvLineBuffer(SalesHeader, SalesLine);
- FillInvLineBuffer(SalesHeader, SalesLine, PrepmtInvLineBuf2);
- if UpdateLines then
- TempGlobalPrepmtInvLineBuf.CopyWithLineNo(PrepmtInvLineBuf2, SalesLine."Line No.");
- TempPrepmtInvLineBuf.InsertInvLineBuffer(PrepmtInvLineBuf2);
- if SalesSetup."Invoice Rounding" then
- RoundAmounts(SalesHeader, PrepmtInvLineBuf2, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferDummy);
- TempSalesLine := SalesLine;
- TempSalesLine.Insert();
- end;
- until SalesLine.Next() = 0;
-UpdateDifferenceAmount(SalesHeader, TotalPrepmtInvLineBuffer, TempPrepmtInvLineBuf, HasInvoiceDiscount);
-
- if SalesSetup."Invoice Rounding" then
- if InsertInvoiceRounding(
- SalesHeader, PrepmtInvLineBuf2, TotalPrepmtInvLineBuffer, SalesLine."Line No.")
- then
- TempPrepmtInvLineBuf.InsertInvLineBuffer(PrepmtInvLineBuf2);
- ErrorMessageMgt.FinishTopContext();
-
- OnAfterBuildInvLineBuffer(TempPrepmtInvLineBuf);
- end;
-
- ///
- /// Builds the prepayment invoice line buffer from the sales lines for posting.
- ///
- /// Specifies the sales header of the order.
- /// Specifies the sales lines to process.
- /// Specifies the prepayment document type.
- /// Returns the prepayment invoice line buffer records.
- procedure BuildInvLineBuffer(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; DocumentType: Option Invoice,"Credit Memo",Statistic; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer")
- begin
- BuildInvLineBuffer(SalesHeader, SalesLine, DocumentType, PrepmtInvLineBuf, false);
- end;
-
- local procedure AdjustInvLineBuffers(SalesHeader: Record "Sales Header"; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; DocumentType: Option Invoice,"Credit Memo")
- var
- VATAdjustment: array[2] of Decimal;
- VAT: Option ,Base,Amount;
- begin
- CalcPrepmtAmtInvLCYInLines(SalesHeader, PrepmtInvLineBuf, DocumentType, VATAdjustment);
- if Abs(VATAdjustment[VAT::Base]) > GLSetup."Amount Rounding Precision" then
- InsertCorrInvLineBuffer(PrepmtInvLineBuf, SalesHeader, VATAdjustment[VAT::Base])
- else
- if (VATAdjustment[VAT::Base] <> 0) or (VATAdjustment[VAT::Amount] <> 0) then begin
- PrepmtInvLineBuf.AdjustVATBase(VATAdjustment);
- TotalPrepmtInvLineBuf.AdjustVATBase(VATAdjustment);
- end;
- end;
-
- local procedure CalcPrepmtAmtInvLCYInLines(SalesHeader: Record "Sales Header"; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; DocumentType: Option Invoice,"Credit Memo"; var VATAdjustment: array[2] of Decimal)
- var
- SalesLine: Record "Sales Line";
- PrepmtInvBufAmount: array[2] of Decimal;
- TotalAmount: array[2] of Decimal;
- LineAmount: array[2] of Decimal;
- Ratio: array[2] of Decimal;
- PrepmtAmtReminder: array[2] of Decimal;
- PrepmtAmountRnded: array[2] of Decimal;
- VAT: Option ,Base,Amount;
- begin
- PrepmtInvLineBuf.AmountsToArray(PrepmtInvBufAmount);
- if DocumentType = DocumentType::Invoice then
- ReverseDecArray(PrepmtInvBufAmount);
-
- TempGlobalPrepmtInvLineBuf.SetFilterOnPKey(PrepmtInvLineBuf);
- TempGlobalPrepmtInvLineBuf.CalcSums(Amount, "Amount Incl. VAT");
- TempGlobalPrepmtInvLineBuf.AmountsToArray(TotalAmount);
- for VAT := VAT::Base to VAT::Amount do
- if TotalAmount[VAT] = 0 then
- Ratio[VAT] := 0
- else
- Ratio[VAT] := PrepmtInvBufAmount[VAT] / TotalAmount[VAT];
- if TempGlobalPrepmtInvLineBuf.FindSet() then
- repeat
- TempGlobalPrepmtInvLineBuf.AmountsToArray(LineAmount);
- PrepmtAmountRnded[VAT::Base] :=
- CalcRoundedAmount(LineAmount[VAT::Base], Ratio[VAT::Base], PrepmtAmtReminder[VAT::Base]);
- PrepmtAmountRnded[VAT::Amount] :=
- CalcRoundedAmount(LineAmount[VAT::Amount], Ratio[VAT::Amount], PrepmtAmtReminder[VAT::Amount]);
-
- SalesLine.Get(SalesHeader."Document Type", SalesHeader."No.", TempGlobalPrepmtInvLineBuf."Line No.");
- if DocumentType = DocumentType::"Credit Memo" then begin
- VATAdjustment[VAT::Base] += SalesLine."Prepmt. Amount Inv. (LCY)" - PrepmtAmountRnded[VAT::Base];
- SalesLine."Prepmt. Amount Inv. (LCY)" := 0;
- VATAdjustment[VAT::Amount] += SalesLine."Prepmt. VAT Amount Inv. (LCY)" - PrepmtAmountRnded[VAT::Amount];
- SalesLine."Prepmt. VAT Amount Inv. (LCY)" := 0;
- end else begin
- SalesLine."Prepmt. Amount Inv. (LCY)" += PrepmtAmountRnded[VAT::Base];
- SalesLine."Prepmt. VAT Amount Inv. (LCY)" += PrepmtAmountRnded[VAT::Amount];
- end;
- SalesLine.Modify();
- until TempGlobalPrepmtInvLineBuf.Next() = 0;
- TempGlobalPrepmtInvLineBuf.DeleteAll();
- end;
-
- local procedure CalcRoundedAmount(LineAmount: Decimal; Ratio: Decimal; var Reminder: Decimal) RoundedAmount: Decimal
- var
- Amount: Decimal;
- begin
- Amount := Reminder + LineAmount * Ratio;
- RoundedAmount := Round(Amount);
- Reminder := Amount - RoundedAmount;
- end;
-
- local procedure ReverseDecArray(var DecArray: array[2] of Decimal)
- var
- Idx: Integer;
- begin
- for Idx := 1 to ArrayLen(DecArray) do
- DecArray[Idx] := -DecArray[Idx];
- end;
-
- local procedure InsertCorrInvLineBuffer(var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; SalesHeader: Record "Sales Header"; VATBaseAdjustment: Decimal)
- var
- NewPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer";
- SavedPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer";
- AdjmtAmountACY: Decimal;
- begin
- SavedPrepmtInvLineBuf := PrepmtInvLineBuf;
-
- if SalesHeader."Currency Code" = '' then
- AdjmtAmountACY := VATBaseAdjustment
- else
- AdjmtAmountACY := 0;
-
- NewPrepmtInvLineBuf.FillAdjInvLineBuffer(
- PrepmtInvLineBuf,
- GetPrepmtAccNo(PrepmtInvLineBuf."Gen. Bus. Posting Group", PrepmtInvLineBuf."Gen. Prod. Posting Group"),
- VATBaseAdjustment, AdjmtAmountACY);
- PrepmtInvLineBuf.InsertInvLineBuffer(NewPrepmtInvLineBuf);
-
- NewPrepmtInvLineBuf.FillAdjInvLineBuffer(
- PrepmtInvLineBuf,
- GetCorrBalAccNo(SalesHeader, VATBaseAdjustment > 0),
- -VATBaseAdjustment, -AdjmtAmountACY);
- PrepmtInvLineBuf.InsertInvLineBuffer(NewPrepmtInvLineBuf);
-
- PrepmtInvLineBuf := SavedPrepmtInvLineBuf;
- end;
-
- local procedure GetPrepmtAccNo(GenBusPostingGroup: Code[20]; GenProdPostingGroup: Code[20]) PrepmtAccNo: Code[20]
- begin
- if (GenBusPostingGroup <> GenPostingSetup."Gen. Bus. Posting Group") or
- (GenProdPostingGroup <> GenPostingSetup."Gen. Prod. Posting Group")
- then
- GenPostingSetup.Get(GenBusPostingGroup, GenProdPostingGroup);
- PrepmtAccNo := GenPostingSetup.GetSalesPrepmtAccount();
- OnAfterGetPrepmtAccNo(GenPostingSetup, PrepmtAccNo);
- exit(PrepmtAccNo);
- end;
-
- ///
- /// Gets the correction balancing account number for prepayment adjustments.
- ///
- /// Specifies the sales header of the order.
- /// Specifies whether the adjustment amount is positive.
- /// Returns the G/L account number for balancing the correction.
- procedure GetCorrBalAccNo(SalesHeader: Record "Sales Header"; PositiveAmount: Boolean): Code[20]
- var
- BalAccNo: Code[20];
- begin
- if SalesHeader."Currency Code" = '' then
- BalAccNo := GetInvRoundingAccNo(SalesHeader."Customer Posting Group")
- else
- BalAccNo := GetGainLossGLAcc(SalesHeader."Currency Code", PositiveAmount);
-
- OnAfterGetCorrBalAccNo(SalesHeader, PositiveAmount, BalAccNo);
- exit(BalAccNo);
- end;
-
- ///
- /// Gets the invoice rounding account number from the customer posting group.
- ///
- /// Specifies the customer posting group code.
- /// Returns the invoice rounding G/L account number.
- procedure GetInvRoundingAccNo(CustomerPostingGroup: Code[20]): Code[20]
- var
- CustPostingGr: Record "Customer Posting Group";
- GLAcc: Record "G/L Account";
- begin
- CustPostingGr.Get(CustomerPostingGroup);
- GLAcc.Get(CustPostingGr.GetInvRoundingAccount());
- exit(CustPostingGr."Invoice Rounding Account");
- end;
-
- local procedure GetGainLossGLAcc(CurrencyCode: Code[10]; PositiveAmount: Boolean): Code[20]
- var
- Currency: Record Currency;
- begin
- Currency.Get(CurrencyCode);
- if PositiveAmount then
- exit(Currency.GetRealizedGainsAccount());
- exit(Currency.GetRealizedLossesAccount());
- end;
-
- local procedure GetCurrencyAmountRoundingPrecision(CurrencyCode: Code[10]): Decimal
- var
- Currency: Record Currency;
- begin
- Currency.Initialize(CurrencyCode);
- Currency.TestField("Amount Rounding Precision");
- exit(Currency."Amount Rounding Precision");
- end;
-
- ///
- /// Fills the prepayment invoice line buffer with data from a sales line.
- ///
- /// Specifies the sales header of the order.
- /// Specifies the sales line to copy data from.
- /// Returns the filled prepayment invoice line buffer record.
- procedure FillInvLineBuffer(SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer")
- begin
- PrepmtInvLineBuf.Init();
- OnBeforeFillInvLineBuffer(PrepmtInvLineBuf, SalesHeader, SalesLine);
- PrepmtInvLineBuf."G/L Account No." := GetPrepmtAccNo(SalesLine."Gen. Bus. Posting Group", SalesLine."Gen. Prod. Posting Group");
-
- if not SalesHeader."Compress Prepayment" then begin
- PrepmtInvLineBuf."Line No." := SalesLine."Line No.";
- PrepmtInvLineBuf.Description := SalesLine.Description;
- end;
-
- PrepmtInvLineBuf.CopyFromSalesLine(SalesLine);
- PrepmtInvLineBuf.FillFromGLAcc(SalesHeader."Compress Prepayment");
-
- PrepmtInvLineBuf.SetAmounts(
- SalesLine."Prepayment Amount", SalesLine."Prepmt. Amt. Incl. VAT", SalesLine."Prepayment Amount",
- SalesLine."Prepayment Amount", SalesLine."Prepayment Amount", SalesLine."Prepayment VAT Difference");
-
- PrepmtInvLineBuf."VAT Amount" := SalesLine."Prepmt. Amt. Incl. VAT" - SalesLine."Prepayment Amount";
- PrepmtInvLineBuf."VAT Amount (ACY)" := SalesLine."Prepmt. Amt. Incl. VAT" - SalesLine."Prepayment Amount";
- PrepmtInvLineBuf."VAT Base Before Pmt. Disc." := -SalesLine."Prepayment Amount";
- PrepmtInvLineBuf."Orig. Pmt. Disc. Possible" := SalesLine."Prepmt. Pmt. Discount Amount";
-
- OnAfterFillInvLineBuffer(PrepmtInvLineBuf, SalesLine, SuppressCommit, SalesHeader);
- end;
-
- local procedure InsertInvoiceRounding(SalesHeader: Record "Sales Header"; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; PrevLineNo: Integer): Boolean
- var
- SalesLine: Record "Sales Line";
- begin
- if InitInvoiceRoundingLine(SalesHeader, TotalPrepmtInvLineBuf."Amount Incl. VAT", SalesLine) then begin
- CreateDimensions(SalesLine);
- PrepmtInvLineBuf.Init();
- PrepmtInvLineBuf."Line No." := PrevLineNo + 10000;
- PrepmtInvLineBuf."Invoice Rounding" := true;
- PrepmtInvLineBuf."G/L Account No." := SalesLine."No.";
- PrepmtInvLineBuf.Description := SalesLine.Description;
-
- PrepmtInvLineBuf.CopyFromSalesLine(SalesLine);
- PrepmtInvLineBuf."Gen. Bus. Posting Group" := SalesHeader."Gen. Bus. Posting Group";
- PrepmtInvLineBuf."VAT Bus. Posting Group" := SalesHeader."VAT Bus. Posting Group";
-
- PrepmtInvLineBuf.SetAmounts(
- SalesLine."Line Amount", SalesLine."Amount Including VAT", SalesLine."Line Amount",
- SalesLine."Prepayment Amount", SalesLine."Line Amount", 0);
-
- PrepmtInvLineBuf."VAT Amount" := SalesLine."Amount Including VAT" - SalesLine."Line Amount";
- PrepmtInvLineBuf."VAT Amount (ACY)" := SalesLine."Amount Including VAT" - SalesLine."Line Amount";
- OnAfterInsertInvoiceRounding(SalesHeader, PrepmtInvLineBuf, TotalPrepmtInvLineBuf, PrevLineNo);
- exit(true);
- end;
- end;
-
- ///
- /// Initializes an invoice rounding line for the prepayment if rounding is required.
- ///
- /// Specifies the sales header of the order.
- /// Specifies the total prepayment amount to check for rounding.
- /// Returns the initialized invoice rounding sales line if rounding is needed.
- /// Returns true if an invoice rounding line was created.
- procedure InitInvoiceRoundingLine(SalesHeader: Record "Sales Header"; TotalAmount: Decimal; var SalesLine: Record "Sales Line"): Boolean
- var
- Currency: Record Currency;
- InvoiceRoundingAmount: Decimal;
- begin
- Currency.Initialize(SalesHeader."Currency Code");
- Currency.TestField("Invoice Rounding Precision");
- InvoiceRoundingAmount :=
- -Round(
- TotalAmount -
- Round(
- TotalAmount,
- Currency."Invoice Rounding Precision",
- Currency.InvoiceRoundingDirection()),
- Currency."Amount Rounding Precision");
-
- if InvoiceRoundingAmount = 0 then
- exit(false);
-
- SalesLine.SetHideValidationDialog(true);
- SalesLine."Document Type" := SalesHeader."Document Type";
- SalesLine."Document No." := SalesHeader."No.";
- SalesLine."System-Created Entry" := true;
- SalesLine.Type := SalesLine.Type::"G/L Account";
- SalesLine.Validate("No.", GetInvRoundingAccNo(SalesHeader."Customer Posting Group"));
- SalesLine.Validate(Quantity, 1);
- if SalesHeader."Prices Including VAT" then
- SalesLine.Validate("Unit Price", InvoiceRoundingAmount)
- else
- SalesLine.Validate(
- "Unit Price",
- Round(
- InvoiceRoundingAmount /
- (1 + (1 - SalesLine.GetVatBaseDiscountPct(SalesHeader) / 100) * SalesLine."VAT %" / 100),
- Currency."Amount Rounding Precision"));
- SalesLine."Prepayment Amount" := SalesLine."Unit Price";
- SalesLine.Validate("Amount Including VAT", InvoiceRoundingAmount);
- exit(true);
- end;
-
- local procedure CopyHeaderCommentLines(FromNumber: Code[20]; ToDocType: Integer; ToNumber: Code[20])
- var
- SalesCommentLine: Record "Sales Comment Line";
- begin
- if not SalesSetup."Copy Comments Order to Invoice" then
- exit;
-
- case ToDocType of
- Database::"Sales Invoice Header":
- SalesCommentLine.CopyHeaderComments(
- SalesCommentLine."Document Type"::Order.AsInteger(), SalesCommentLine."Document Type"::"Posted Invoice".AsInteger(),
- FromNumber, ToNumber);
- Database::"Sales Cr.Memo Header":
- SalesCommentLine.CopyHeaderComments(
- SalesCommentLine."Document Type"::Order.AsInteger(), SalesCommentLine."Document Type"::"Posted Credit Memo".AsInteger(),
- FromNumber, ToNumber);
- end;
- end;
-
- local procedure CopyLineCommentLines(FromNumber: Code[20]; ToDocType: Integer; ToNumber: Code[20]; FromLineNo: Integer; ToLineNo: Integer)
- var
- SalesCommentLine: Record "Sales Comment Line";
- begin
- if not SalesSetup."Copy Comments Order to Invoice" then
- exit;
-
- case ToDocType of
- Database::"Sales Invoice Header":
- SalesCommentLine.CopyLineComments(
- SalesCommentLine."Document Type"::Order.AsInteger(), SalesCommentLine."Document Type"::"Posted Invoice".AsInteger(),
- FromNumber, ToNumber, FromLineNo, ToLineNo);
- Database::"Sales Cr.Memo Header":
- SalesCommentLine.CopyLineComments(
- SalesCommentLine."Document Type"::Order.AsInteger(), SalesCommentLine."Document Type"::"Posted Credit Memo".AsInteger(),
- FromNumber, ToNumber, FromLineNo, ToLineNo);
- end;
- end;
-
- local procedure CopyLineCommentLinesCompressedPrepayment(FromNumber: Code[20]; ToDocType: Integer; ToNumber: Code[20])
- var
- SalesCommentLine: Record "Sales Comment Line";
- begin
- if not SalesSetup."Copy Comments Order to Invoice" then
- exit;
-
- case ToDocType of
- Database::"Sales Invoice Header":
- SalesCommentLine.CopyLineCommentsFromSalesLines(
- SalesCommentLine."Document Type"::Order.AsInteger(), SalesCommentLine."Document Type"::"Posted Invoice".AsInteger(),
- FromNumber, ToNumber, TempSalesLine);
- Database::"Sales Cr.Memo Header":
- SalesCommentLine.CopyLineCommentsFromSalesLines(
- SalesCommentLine."Document Type"::Order.AsInteger(), SalesCommentLine."Document Type"::"Posted Credit Memo".AsInteger(),
- FromNumber, ToNumber, TempSalesLine);
- end;
- end;
-
- local procedure InsertExtendedText(TabNo: Integer; DocNo: Code[20]; GLAccNo: Code[20]; DocDate: Date; LanguageCode: Code[10]; var PrevLineNo: Integer; var SalesHeader: Record "Sales Header")
- var
- TempExtTextLine: Record "Extended Text Line" temporary;
- SalesInvLine: Record "Sales Invoice Line";
- SalesCrMemoLine: Record "Sales Cr.Memo Line";
- TransferExtText: Codeunit "Transfer Extended Text";
- NextLineNo: Integer;
- begin
- OnBeforeInsertExtendedText(TabNo, DocNo, GLAccNo, DocDate, LanguageCode, PrevLineNo);
- TransferExtText.PrepmtGetAnyExtText(GLAccNo, TabNo, DocDate, LanguageCode, TempExtTextLine);
- if TempExtTextLine.Find('-') then begin
- NextLineNo := PrevLineNo + 10000;
- repeat
- case TabNo of
- Database::"Sales Invoice Line":
- begin
- SalesInvLine.Init();
- SalesInvLine."Document No." := DocNo;
- SalesInvLine."Line No." := NextLineNo;
- SalesInvLine.Description := TempExtTextLine.Text;
- OnInsertExtendedTextOnBeforeSalesInvLineInsert(SalesInvLine, TabNo, DocNo, NextLineNo, TempExtTextLine, SalesHeader);
- SalesInvLine.Insert();
- end;
- Database::"Sales Cr.Memo Line":
- begin
- SalesCrMemoLine.Init();
- SalesCrMemoLine."Document No." := DocNo;
- SalesCrMemoLine."Line No." := NextLineNo;
- SalesCrMemoLine.Description := TempExtTextLine.Text;
- OnInsertExtendedTextOnBeforeSalesCrMemoLineInsert(SalesCrMemoLine, TabNo, DocNo, NextLineNo, TempExtTextLine, SalesHeader);
- SalesCrMemoLine.Insert();
- end;
- end;
- PrevLineNo := NextLineNo;
- NextLineNo := NextLineNo + 10000;
- until TempExtTextLine.Next() = 0;
- end;
- end;
-
- ///
- /// Updates the VAT amounts on sales lines based on the VAT amount lines for prepayment documents.
- ///
- /// Specifies the sales header of the order.
- /// Specifies the sales lines to update.
- /// Specifies the VAT amount lines with calculated VAT amounts.
- /// Specifies the prepayment document type.
- procedure UpdateVATOnLines(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var VATAmountLine: Record "VAT Amount Line"; DocumentType: Option Invoice,"Credit Memo",Statistic)
- var
- TempVATAmountLineRemainder: Record "VAT Amount Line" temporary;
- Currency: Record Currency;
- PrepmtAmt: Decimal;
- NewAmount: Decimal;
- NewAmountIncludingVAT: Decimal;
- NewVATBaseAmount: Decimal;
- NewPmtDiscAmount: Decimal;
- VATAmount: Decimal;
- VATDifference: Decimal;
- PrepmtAmtToInvTotal: Decimal;
- RemainderExists: Boolean;
- begin
- GLSetup.GetRecordOnce();
- Currency.Initialize(SalesHeader."Currency Code");
-
- ApplyFilter(SalesHeader, DocumentType, SalesLine);
- SalesLine.LockTable();
- SalesLine.CalcSums("Prepmt. Line Amount", "Prepmt. Amt. Inv.");
- PrepmtAmtToInvTotal := SalesLine."Prepmt. Line Amount" - SalesLine."Prepmt. Amt. Inv.";
- if SalesLine.FindSet() then
- repeat
- PrepmtAmt := PrepmtAmount(SalesLine, DocumentType);
- if PrepmtAmt <> 0 then begin
- FindVATAmountLine(SalesLine, VATAmountLine, PrepmtAmt);
- OnUpdateVATOnLinesOnAfterVATAmountLineGet(VATAmountLine);
- if VATAmountLine.Modified then begin
- RemainderExists :=
- FindVATAmountLine(SalesLine, TempVATAmountLineRemainder, PrepmtAmt);
- OnUpdateVATOnLinesOnAfterGetRemainder(TempVATAmountLineRemainder, RemainderExists);
- if not RemainderExists then begin
- TempVATAmountLineRemainder := VATAmountLine;
- TempVATAmountLineRemainder.Init();
- TempVATAmountLineRemainder.Insert();
- end;
-
- if SalesHeader."Prices Including VAT" then begin
- if PrepmtAmt = 0 then begin
- VATAmount := 0;
- NewAmountIncludingVAT := 0;
- end else begin
- VATAmount :=
- TempVATAmountLineRemainder."VAT Amount" +
- VATAmountLine."VAT Amount" * PrepmtAmt / VATAmountLine."Line Amount";
- NewAmountIncludingVAT :=
- TempVATAmountLineRemainder."Amount Including VAT" +
- VATAmountLine."Amount Including VAT" * PrepmtAmt / VATAmountLine."Line Amount";
- end;
- NewAmount :=
- Round(NewAmountIncludingVAT, Currency."Amount Rounding Precision") -
- Round(VATAmount, Currency."Amount Rounding Precision");
- NewVATBaseAmount :=
- Round(
- NewAmount * (1 - SalesLine.GetVatBaseDiscountPct(SalesHeader) / 100),
- Currency."Amount Rounding Precision");
- end else begin
- if SalesLine."VAT Calculation Type" = SalesLine."VAT Calculation Type"::"Full VAT" then begin
- VATAmount := PrepmtAmt;
- NewAmount := 0;
- NewVATBaseAmount := 0;
- end else begin
- NewAmount := PrepmtAmt;
- NewVATBaseAmount :=
- Round(
- NewAmount * (1 - SalesLine.GetVatBaseDiscountPct(SalesHeader) / 100),
- Currency."Amount Rounding Precision");
- if VATAmountLine."VAT Base" = 0 then
- VATAmount := 0
- else
- VATAmount :=
- TempVATAmountLineRemainder."VAT Amount" +
- VATAmountLine."VAT Amount" * NewAmount / VATAmountLine."VAT Base";
- end;
- NewAmountIncludingVAT := NewAmount + Round(VATAmount, Currency."Amount Rounding Precision");
- end;
- if DocumentType = DocumentType::"Credit Memo" then
- NewAmountIncludingVAT := CalcDifferAmt(SalesLine, NewAmountIncludingVAT, Currency."Amount Rounding Precision");
-
- SalesLine."Prepayment Amount" := NewAmount;
- SalesLine."Prepmt. Amt. Incl. VAT" :=
- Round(NewAmountIncludingVAT, Currency."Amount Rounding Precision");
- SalesLine."Prepmt. VAT Base Amt." := NewVATBaseAmount;
-
- if (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount") = 0 then
- VATDifference := 0
- else begin
- if PrepmtAmtToInvTotal = 0 then
- VATDifference :=
- VATAmountLine."VAT Difference" * (SalesLine."Prepmt. Line Amount" - SalesLine."Prepmt. Amt. Inv.") /
- (VATAmountLine."Line Amount" - VATAmountLine."Invoice Discount Amount")
- else
- VATDifference :=
- VATAmountLine."VAT Difference" * (SalesLine."Prepmt. Line Amount" - SalesLine."Prepmt. Amt. Inv.") /
- PrepmtAmtToInvTotal;
- NewPmtDiscAmount :=
- TempVATAmountLineRemainder."Pmt. Discount Amount" +
- NewAmount * SalesHeader."Payment Discount %" / 100;
- end;
-
- SalesLine."Prepayment VAT Difference" := Round(VATDifference, Currency."Amount Rounding Precision");
- SalesLine."Prepmt. Pmt. Discount Amount" := Round(NewPmtDiscAmount, Currency."Amount Rounding Precision");
- OnUpdateVATOnLinesOnBeforeSalesLineModify(SalesHeader, SalesLine, TempVATAmountLineRemainder, NewAmount, NewAmountIncludingVAT, NewVATBaseAmount);
- SalesLine.Modify();
-
- TempVATAmountLineRemainder."Amount Including VAT" :=
- NewAmountIncludingVAT - Round(NewAmountIncludingVAT, Currency."Amount Rounding Precision");
- TempVATAmountLineRemainder."VAT Amount" := VATAmount - NewAmountIncludingVAT + NewAmount;
- TempVATAmountLineRemainder."VAT Difference" := VATDifference - SalesLine."Prepayment VAT Difference";
- TempVATAmountLineRemainder."Pmt. Discount Amount" := NewPmtDiscAmount - Round(NewPmtDiscAmount);
- TempVATAmountLineRemainder.Modify();
- end;
- end;
- until SalesLine.Next() = 0;
- VATAmountLine.Reset();
-
- OnAfterUpdateVATOnLines(SalesHeader, SalesLine, VATAmountLine, DocumentType);
- end;
-
- ///
- /// Calculates the VAT amount lines for prepayment documents.
- ///
- /// Specifies the sales header of the order.
- /// Specifies the sales lines to calculate VAT for.
- /// Returns the calculated VAT amount lines.
- /// Specifies the prepayment document type.
- procedure CalcVATAmountLines(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var VATAmountLine: Record "VAT Amount Line"; DocumentType: Option Invoice,"Credit Memo",Statistic)
- var
- Currency: Record Currency;
- NewAmount: Decimal;
- NewPrepmtVATDiffAmt: Decimal;
- IsHandled: Boolean;
- begin
- GLSetup.GetRecordOnce();
- Currency.Initialize(SalesHeader."Currency Code");
-
- VATAmountLine.DeleteAll();
-
- ApplyFilter(SalesHeader, DocumentType, SalesLine);
- if SalesLine.Find('-') then
- repeat
- NewAmount := PrepmtAmount(SalesLine, DocumentType);
- if NewAmount <> 0 then begin
- if DocumentType = DocumentType::Invoice then
- NewAmount := SalesLine."Prepmt. Line Amount";
- if SalesLine."Prepmt. VAT Calc. Type" in
- [SalesLine."VAT Calculation Type"::"Reverse Charge VAT", SalesLine."VAT Calculation Type"::"Sales Tax"]
- then
- SalesLine."VAT %" := 0;
-
- if not FindVATAmountLine(SalesLine, VATAmountLine, NewAmount) then
- InsertVATAmountLine(SalesLine, VATAmountLine, NewAmount);
-
- VATAmountLine."Line Amount" := VATAmountLine."Line Amount" + NewAmount;
- NewPrepmtVATDiffAmt := PrepmtVATDiffAmount(SalesLine, DocumentType);
- if DocumentType = DocumentType::Invoice then
- NewPrepmtVATDiffAmt := SalesLine."Prepayment VAT Difference" + SalesLine."Prepmt VAT Diff. to Deduct" +
- SalesLine."Prepmt VAT Diff. Deducted";
- VATAmountLine."VAT Difference" := VATAmountLine."VAT Difference" + NewPrepmtVATDiffAmt;
- VATAmountLine.Modify();
- end;
- until SalesLine.Next() = 0;
- VATAmountLine.Reset();
-
- IsHandled := false;
- OnCalcVATAmountLinesOnBeforeUpdateLines(NewAmount, Currency, SalesHeader, IsHandled);
- if not IsHandled then
- VATAmountLine.UpdateLines(
- NewAmount, Currency, SalesHeader."Currency Factor", SalesHeader."Prices Including VAT",
- SalesLine.GetVatBaseDiscountPct(SalesHeader), SalesHeader."Tax Area Code", SalesHeader."Tax Liable", SalesHeader."Posting Date");
-
- OnAfterCalcVATAmountLines(SalesHeader, SalesLine, VATAmountLine, DocumentType, Currency);
- end;
-
- local procedure FindVATAmountLine(var SalesLine: Record "Sales Line"; var VATAmountLine: Record "VAT Amount Line" temporary; LineAmount: Decimal): Boolean
- begin
- VATAmountLine.Reset();
- VATAmountLine.SetRange("VAT Identifier", SalesLine."Prepayment VAT Identifier");
- VATAmountLine.SetRange("VAT Calculation Type", SalesLine."Prepmt. VAT Calc. Type");
- VATAmountLine.SetRange("Tax Group Code", SalesLine."Prepayment Tax Group Code");
- VATAmountLine.SetRange("Use Tax", false);
- VATAmountLine.SetRange(Positive, LineAmount >= 0);
- OnFindVATAmountLineOnAfterSetFilters(SalesLine, VATAmountLine);
- exit(VATAmountLine.FindFirst());
- end;
-
- local procedure InsertVATAmountLine(var SalesLine: Record "Sales Line"; var VATAmountLine: Record "VAT Amount Line"; LineAmount: Decimal)
- begin
- VATAmountLine.Init();
- VATAmountLine."VAT Identifier" := SalesLine."Prepayment VAT Identifier";
- VATAmountLine."VAT Calculation Type" := SalesLine."Prepmt. VAT Calc. Type";
- VATAmountLine."Tax Group Code" := SalesLine."Prepayment Tax Group Code";
- VATAmountLine."VAT %" := SalesLine."Prepayment VAT %";
- VATAmountLine.Positive := LineAmount >= 0;
- VATAmountLine.Modified := true;
- VATAmountLine."Includes Prepayment" := true;
- OnInsertVATAmountOnBeforeInsert(SalesLine, VATAmountLine);
- VATAmountLine.Insert();
- end;
-
- ///
- /// Calculates the total prepayment amount and VAT amount for statistics.
- ///
- /// Specifies the sales header of the order.
- /// Specifies the sales lines to summarize.
- /// Returns the calculated VAT amount lines.
- /// Returns the total prepayment amount.
- /// Returns the total VAT amount.
- /// Returns the VAT percentage text for display.
- procedure SumPrepmt(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var VATAmountLine: Record "VAT Amount Line"; var TotalAmount: Decimal; var TotalVATAmount: Decimal; var VATAmountText: Text[30])
- var
- TempPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer" temporary;
- TotalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer";
- TotalPrepmtInvLineBufLCY: Record "Prepayment Inv. Line Buffer";
- DifVATPct: Boolean;
- PrevVATPct: Decimal;
- begin
- CalcVATAmountLines(SalesHeader, SalesLine, VATAmountLine, 2);
- UpdateVATOnLines(SalesHeader, SalesLine, VATAmountLine, 2);
- BuildInvLineBuffer(SalesHeader, SalesLine, 2, TempPrepmtInvLineBuf, false);
- if TempPrepmtInvLineBuf.Find('-') then begin
- PrevVATPct := TempPrepmtInvLineBuf.GetVATPct();
- repeat
- RoundAmounts(SalesHeader, TempPrepmtInvLineBuf, TotalPrepmtInvLineBuf, TotalPrepmtInvLineBufLCY);
- if TempPrepmtInvLineBuf.GetVATPct() <> PrevVATPct then
- DifVATPct := true;
- until TempPrepmtInvLineBuf.Next() = 0;
- end;
-
- TotalAmount := TotalPrepmtInvLineBuf.Amount;
- TotalVATAmount := TotalPrepmtInvLineBuf."VAT Amount";
- if DifVATPct or (TempPrepmtInvLineBuf."VAT %" = 0) then
- VATAmountText := Text014
- else
- VATAmountText := StrSubstNo(Text015, PrevVATPct);
- end;
-
- ///
- /// Gets the sales lines with prepayment amounts for the specified document type.
- ///
- /// Specifies the sales header of the order.
- /// Specifies the prepayment document type.
- /// Returns the sales lines with prepayment amounts.
- procedure GetSalesLines(SalesHeader: Record "Sales Header"; DocumentType: Option Invoice,"Credit Memo",Statistic; var ToSalesLine: Record "Sales Line")
- var
- FromSalesLine: Record "Sales Line";
- InvRoundingSalesLine: Record "Sales Line";
- TempVATAmountLine: Record "VAT Amount Line" temporary;
- TotalAmt: Decimal;
- NextLineNo: Integer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetSalesLines(SalesHeader, DocumentType, ToSalesLine, IsHandled);
- if IsHandled then
- exit;
-
- ApplyFilter(SalesHeader, DocumentType, FromSalesLine);
- if FromSalesLine.Find('-') then begin
- repeat
- ToSalesLine := FromSalesLine;
- ToSalesLine.Insert();
- until FromSalesLine.Next() = 0;
-
- SalesSetup.Get();
- if SalesSetup."Invoice Rounding" then begin
- CalcVATAmountLines(SalesHeader, ToSalesLine, TempVATAmountLine, 2);
- UpdateVATOnLines(SalesHeader, ToSalesLine, TempVATAmountLine, 2);
- ToSalesLine.CalcSums("Prepmt. Amt. Incl. VAT");
- TotalAmt := ToSalesLine."Prepmt. Amt. Incl. VAT";
- ToSalesLine.FindLast();
- if InitInvoiceRoundingLine(SalesHeader, TotalAmt, InvRoundingSalesLine) then begin
- NextLineNo := ToSalesLine."Line No." + 1;
- ToSalesLine := InvRoundingSalesLine;
- ToSalesLine."Line No." := NextLineNo;
-
- if DocumentType <> DocumentType::"Credit Memo" then
- ToSalesLine."Prepmt. Line Amount" := ToSalesLine."Line Amount"
- else
- ToSalesLine."Prepmt. Amt. Inv." := ToSalesLine."Line Amount";
- ToSalesLine."Prepmt. VAT Calc. Type" := ToSalesLine."VAT Calculation Type";
- ToSalesLine."Prepayment VAT Identifier" := ToSalesLine."VAT Identifier";
- ToSalesLine."Prepayment Tax Group Code" := ToSalesLine."Tax Group Code";
- ToSalesLine."Prepayment VAT Identifier" := ToSalesLine."VAT Identifier";
- ToSalesLine."Prepayment Tax Group Code" := ToSalesLine."Tax Group Code";
- ToSalesLine."Prepayment VAT %" := ToSalesLine."VAT %";
- OnGetSalesLinesOnBeforeInsertToSalesLine(ToSalesLine);
- ToSalesLine.Insert();
- end;
- end;
- end;
- end;
-
- ///
- /// Applies filters to the sales lines for prepayment processing based on document type.
- ///
- /// Specifies the sales header of the order.
- /// Specifies the prepayment document type.
- /// Returns the filtered sales lines.
- procedure ApplyFilter(SalesHeader: Record "Sales Header"; DocumentType: Option Invoice,"Credit Memo",Statistic; var SalesLine: Record "Sales Line")
- begin
- SalesLine.Reset();
- SalesLine.SetRange("Document Type", SalesHeader."Document Type");
- SalesLine.SetRange("Document No.", SalesHeader."No.");
- SalesLine.SetFilter(Type, '<>%1', SalesLine.Type::" ");
- if DocumentType in [DocumentType::Invoice, DocumentType::Statistic] then
- SalesLine.SetFilter("Prepmt. Line Amount", '<>0')
- else
- SalesLine.SetFilter("Prepmt. Amt. Inv.", '<>0');
-
- OnAfterApplyFilter(SalesLine, SalesHeader, DocumentType);
- end;
-
- ///
- /// Calculates the prepayment amount for the sales line based on the document type.
- ///
- /// Specifies the sales line to calculate the prepayment amount for.
- /// Specifies the prepayment document type.
- /// Returns the prepayment amount.
- procedure PrepmtAmount(SalesLine: Record "Sales Line"; DocumentType: Option Invoice,"Credit Memo",Statistic) Result: Decimal
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforePrepmtAmount(SalesLine, DocumentType, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- case DocumentType of
- DocumentType::Statistic:
- exit(SalesLine."Prepmt. Line Amount");
- DocumentType::Invoice:
- exit(SalesLine."Prepmt. Line Amount" - SalesLine."Prepmt. Amt. Inv.");
- else
- exit(SalesLine."Prepmt. Amt. Inv." - SalesLine."Prepmt Amt Deducted");
- end;
- end;
-
- local procedure PostPrepmtInvLineBuffer(SalesHeader: Record "Sales Header"; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; DocumentType: Option Invoice,"Credit Memo"; PostingDescription: Text[100]; DocType: Enum "Gen. Journal Document Type"; DocNo: Code[20]; ExtDocNo: Text[35]; SrcCode: Code[10]; PostingNoSeriesCode: Code[20])
- var
- GenJnlLine: Record "Gen. Journal Line";
- begin
- GenJnlLine.InitNewLine(
- SalesHeader."Posting Date", SalesHeader."Document Date", SalesHeader."VAT Reporting Date", PostingDescription,
- PrepmtInvLineBuffer."Global Dimension 1 Code", PrepmtInvLineBuffer."Global Dimension 2 Code",
- PrepmtInvLineBuffer."Dimension Set ID", SalesHeader."Reason Code");
-
- GenJnlLine.CopyDocumentFields(DocType, DocNo, ExtDocNo, SrcCode, PostingNoSeriesCode);
- GenJnlLine.CopyFromSalesHeaderPrepmt(SalesHeader);
- GenJnlLine.CopyFromPrepmtInvoiceBuffer(PrepmtInvLineBuffer);
-
- if not PrepmtInvLineBuffer.Adjustment then
- GenJnlLine."Gen. Posting Type" := GenJnlLine."Gen. Posting Type"::Sale;
- GenJnlLine.Correction :=
- (DocumentType = DocumentType::"Credit Memo") and GLSetup."Mark Cr. Memos as Corrections";
-
- if GLSetup."Journal Templ. Name Mandatory" then
- GenJnlLine."Journal Template Name" := GenJournalTemplate.Name;
-
- OnBeforePostPrepmtInvLineBuffer(GenJnlLine, PrepmtInvLineBuffer, SuppressCommit);
- RunGenJnlPostLine(GenJnlLine);
- OnAfterPostPrepmtInvLineBuffer(GenJnlLine, PrepmtInvLineBuffer, SuppressCommit, GenJnlPostLine);
- end;
-
- local procedure PostCustomerEntry(SalesHeader: Record "Sales Header"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; DocumentType: Option Invoice,"Credit Memo"; PostingDescription: Text[100]; DocType: Enum "Gen. Journal Document Type"; DocNo: Code[20]; ExtDocNo: Text[35]; SrcCode: Code[10]; PostingNoSeriesCode: Code[20]; CalcPmtDisc: Boolean)
- var
- GenJnlLine: Record "Gen. Journal Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforePostCustomerEntryProcedure(SalesHeader, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY, DocumentType, PostingDescription, DocType, DocNo, ExtDocNo, SrcCode, PostingNoSeriesCode, CalcPmtDisc, GenJnlPostLine, IsHandled);
- if not IsHandled then begin
- GenJnlLine.InitNewLine(
- SalesHeader."Posting Date", SalesHeader."Document Date", SalesHeader."VAT Reporting Date", PostingDescription,
- SalesHeader."Shortcut Dimension 1 Code", SalesHeader."Shortcut Dimension 2 Code",
- SalesHeader."Dimension Set ID", SalesHeader."Reason Code");
- GenJnlLine.Validate("Your Reference", SalesHeader."Your Reference");
-
- GenJnlLine.CopyDocumentFields(DocType, DocNo, ExtDocNo, SrcCode, PostingNoSeriesCode);
-
- GenJnlLine.CopyFromSalesHeaderPrepmtPost(SalesHeader, (DocumentType = DocumentType::Invoice) or CalcPmtDisc);
- GenJnlLine."Transaction Mode Code" := SalesHeader."Transaction Mode Code";
- GenJnlLine."Recipient Bank Account" := SalesHeader."Bank Account Code";
-
- GenJnlLine.Amount := -TotalPrepmtInvLineBuffer."Amount Incl. VAT";
- GenJnlLine."Source Currency Amount" := -TotalPrepmtInvLineBuffer."Amount Incl. VAT";
- GenJnlLine."Amount (LCY)" := -TotalPrepmtInvLineBufferLCY."Amount Incl. VAT";
- GenJnlLine."Sales/Purch. (LCY)" := -TotalPrepmtInvLineBufferLCY.Amount;
- GenJnlLine."Profit (LCY)" := -TotalPrepmtInvLineBufferLCY.Amount;
-
- GenJnlLine.Correction := (DocumentType = DocumentType::"Credit Memo") and GLSetup."Mark Cr. Memos as Corrections";
-
- GenJnlLine."Orig. Pmt. Disc. Possible" := -TotalPrepmtInvLineBuffer."Orig. Pmt. Disc. Possible";
- GenJnlLine."Orig. Pmt. Disc. Possible(LCY)" := -TotalPrepmtInvLineBufferLCY."Orig. Pmt. Disc. Possible";
- if GLSetup."Journal Templ. Name Mandatory" then
- GenJnlLine."Journal Template Name" := GenJournalTemplate.Name;
-
- OnBeforePostCustomerEntry(GenJnlLine, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY, SuppressCommit, SalesHeader, DocumentType);
- GenJnlPostLine.RunWithCheck(GenJnlLine);
- end;
-
- OnAfterPostCustomerEntry(GenJnlLine, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY, SuppressCommit);
- end;
-
- local procedure PostBalancingEntry(SalesHeader: Record "Sales Header"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; CustLedgEntry: Record "Cust. Ledger Entry"; DocumentType: Option Invoice,"Credit Memo"; PostingDescription: Text[100]; DocType: Enum "Gen. Journal Document Type"; DocNo: Code[20]; ExtDocNo: Text[35]; SrcCode: Code[10]; PostingNoSeriesCode: Code[20])
- var
- GenJnlLine: Record "Gen. Journal Line";
- begin
- GenJnlLine.InitNewLine(
- SalesHeader."Posting Date", SalesHeader."Document Date", SalesHeader."VAT Reporting Date", PostingDescription,
- SalesHeader."Shortcut Dimension 1 Code", SalesHeader."Shortcut Dimension 2 Code",
- SalesHeader."Dimension Set ID", SalesHeader."Reason Code");
-
- if DocType = GenJnlLine."Document Type"::"Credit Memo" then
- GenJnlLine.CopyDocumentFields(GenJnlLine."Document Type"::Refund, DocNo, ExtDocNo, SrcCode, PostingNoSeriesCode)
- else
- GenJnlLine.CopyDocumentFields(GenJnlLine."Document Type"::Payment, DocNo, ExtDocNo, SrcCode, PostingNoSeriesCode);
-
- GenJnlLine.CopyFromSalesHeaderPrepmtPost(SalesHeader, false);
- if SalesHeader."Bal. Account Type" = SalesHeader."Bal. Account Type"::"Bank Account" then
- GenJnlLine."Bal. Account Type" := GenJnlLine."Bal. Account Type"::"Bank Account";
- GenJnlLine."Bal. Account No." := SalesHeader."Bal. Account No.";
-
- GenJnlLine.Amount := TotalPrepmtInvLineBuffer."Amount Incl. VAT" + CustLedgEntry."Remaining Pmt. Disc. Possible";
- GenJnlLine."Source Currency Amount" := GenJnlLine.Amount;
- if CustLedgEntry.Amount = 0 then
- GenJnlLine."Amount (LCY)" := TotalPrepmtInvLineBufferLCY."Amount Incl. VAT"
- else
- GenJnlLine."Amount (LCY)" :=
- TotalPrepmtInvLineBufferLCY."Amount Incl. VAT" +
- Round(
- CustLedgEntry."Remaining Pmt. Disc. Possible" / CustLedgEntry."Adjusted Currency Factor");
-
- GenJnlLine.Correction := (DocumentType = DocumentType::"Credit Memo") and GLSetup."Mark Cr. Memos as Corrections";
-
- GenJnlLine."Applies-to Doc. Type" := DocType;
- GenJnlLine."Applies-to Doc. No." := DocNo;
-
- GenJnlLine."Orig. Pmt. Disc. Possible" := TotalPrepmtInvLineBuffer."Orig. Pmt. Disc. Possible";
- GenJnlLine."Orig. Pmt. Disc. Possible(LCY)" := TotalPrepmtInvLineBufferLCY."Orig. Pmt. Disc. Possible";
- if GLSetup."Journal Templ. Name Mandatory" then
- GenJnlLine."Journal Template Name" := GenJournalTemplate.Name;
- OnPostBalancingEntryOnBeforeGenJnlPostLineRunWithCheck(GenJnlLine, CustLedgEntry, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY, SuppressCommit, SalesHeader, DocType);
- GenJnlPostLine.RunWithCheck(GenJnlLine);
- OnAfterPostBalancingEntry(GenJnlLine, CustLedgEntry, TotalPrepmtInvLineBuffer, TotalPrepmtInvLineBufferLCY, SuppressCommit, SalesHeader);
- end;
-
- local procedure RunGenJnlPostLine(var GenJnlLine: Record "Gen. Journal Line")
- begin
- OnBeforeRunGenJnlPostLine(GenJnlLine);
- GenJnlPostLine.RunWithCheck(GenJnlLine);
- end;
-
- ///
- /// Distributes the new total prepayment amount across the sales lines proportionally.
- ///
- /// Specifies the sales header of the order.
- /// Specifies the new total prepayment amount to distribute.
- procedure UpdatePrepmtAmountOnSaleslines(SalesHeader: Record "Sales Header"; NewTotalPrepmtAmount: Decimal)
- var
- Currency: Record Currency;
- SalesLine: Record "Sales Line";
- TotalLineAmount: Decimal;
- TotalPrepmtAmount: Decimal;
- TotalPrepmtAmtInv: Decimal;
- LastLineNo: Integer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdatePrepmtAmountOnSaleslines(SalesHeader, NewTotalPrepmtAmount, IsHandled);
- if IsHandled then
- exit;
-
- Currency.Initialize(SalesHeader."Currency Code");
-
- SalesLine.SetRange("Document Type", SalesHeader."Document Type");
- SalesLine.SetRange("Document No.", SalesHeader."No.");
- SalesLine.SetFilter(Type, '<>%1', SalesLine.Type::" ");
- SalesLine.SetFilter("Line Amount", '<>0');
- SalesLine.SetFilter("Prepayment %", '<>0');
- SalesLine.LockTable();
- if SalesLine.Find('-') then
- repeat
- TotalLineAmount := TotalLineAmount + SalesLine."Line Amount";
- TotalPrepmtAmtInv := TotalPrepmtAmtInv + SalesLine."Prepmt. Amt. Inv.";
- LastLineNo := SalesLine."Line No.";
- until SalesLine.Next() = 0
- else
- Error(Text017, SalesLine.FieldCaption("Prepayment %"));
- if TotalLineAmount = 0 then
- Error(Text013, NewTotalPrepmtAmount);
- if not (NewTotalPrepmtAmount in [TotalPrepmtAmtInv .. TotalLineAmount]) then
- Error(Text016, TotalPrepmtAmtInv, TotalLineAmount);
-
- TotalPrepmtAmount := 0;
- if SalesLine.Find('-') then
- repeat
- if SalesLine."Line No." <> LastLineNo then
- SalesLine.Validate(
- SalesLine."Prepmt. Line Amount",
- Round(
- NewTotalPrepmtAmount * SalesLine."Line Amount" / TotalLineAmount,
- Currency."Amount Rounding Precision"))
- else
- SalesLine.Validate("Prepmt. Line Amount", NewTotalPrepmtAmount - TotalPrepmtAmount);
- TotalPrepmtAmount := TotalPrepmtAmount + SalesLine."Prepmt. Line Amount";
- SalesLine.Modify();
- until SalesLine.Next() = 0;
- end;
-
- local procedure CreateDimensions(var SalesLine: Record "Sales Line")
- var
- SourceCodeSetup: Record "Source Code Setup";
- DimMgt: Codeunit DimensionManagement;
- DefaultDimSource: List of [Dictionary of [Integer, Code[20]]];
- begin
- SourceCodeSetup.Get();
- DimMgt.AddDimSource(DefaultDimSource, Database::"G/L Account", SalesLine."No.");
- DimMgt.AddDimSource(DefaultDimSource, Database::Job, SalesLine."Job No.");
- DimMgt.AddDimSource(DefaultDimSource, Database::"Responsibility Center", SalesLine."Responsibility Center");
- SalesLine."Shortcut Dimension 1 Code" := '';
- SalesLine."Shortcut Dimension 2 Code" := '';
- SalesLine."Dimension Set ID" :=
- DimMgt.GetRecDefaultDimID(
- SalesLine, 0, DefaultDimSource, SourceCodeSetup.Sales,
- SalesLine."Shortcut Dimension 1 Code", SalesLine."Shortcut Dimension 2 Code", SalesLine."Dimension Set ID", Database::Customer);
-
- OnAfterCreateDimensions(SalesLine, DefaultDimSource);
- end;
-
- ///
- /// Converts the prepayment document type to the corresponding sales document type integer value.
- ///
- /// Specifies the prepayment document type.
- /// Returns the corresponding sales document type as an integer.
- procedure PrepmtDocTypeToDocType(DocumentType: Option Invoice,"Credit Memo"): Integer
- begin
- case DocumentType of
- DocumentType::Invoice:
- exit(2);
- DocumentType::"Credit Memo":
- exit(3);
- end;
- exit(2);
- end;
-
- ///
- /// Gets the sales lines that have prepayment amounts to deduct during final invoicing.
- ///
- /// Specifies the sales header of the order.
- /// Returns the sales lines with prepayment amounts to deduct.
- procedure GetSalesLinesToDeduct(SalesHeader: Record "Sales Header"; var SalesLines: Record "Sales Line")
- var
- SalesLine: Record "Sales Line";
- begin
- ApplyFilter(SalesHeader, 1, SalesLine);
- if SalesLine.FindSet() then
- repeat
- if (PrepmtAmount(SalesLine, 0) <> 0) and (PrepmtAmount(SalesLine, 1) <> 0) then begin
- SalesLines := SalesLine;
- SalesLines.Insert();
- end;
- until SalesLine.Next() = 0;
- end;
-
- local procedure PrepmtVATDiffAmount(SalesLine: Record "Sales Line"; DocumentType: Option Invoice,"Credit Memo",Statistic): Decimal
- begin
- case DocumentType of
- DocumentType::Statistic:
- exit(SalesLine."Prepayment VAT Difference");
- DocumentType::Invoice:
- exit(SalesLine."Prepayment VAT Difference");
- else
- exit(SalesLine."Prepmt VAT Diff. to Deduct");
- end;
- end;
-
- local procedure UpdateSalesDocument(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; DocumentType: Option Invoice,"Credit Memo"; GenJnlLineDocNo: Code[20])
- begin
- OnBeforeUpdateSalesDocument(SalesHeader, SalesLine, DocumentType, GenJnlLineDocNo);
-
- SalesLine.Reset();
- SalesLine.SetRange("Document Type", SalesHeader."Document Type");
- SalesLine.SetRange("Document No.", SalesHeader."No.");
- if DocumentType = DocumentType::Invoice then begin
- SalesHeader."Last Prepayment No." := GenJnlLineDocNo;
- SalesHeader."Prepayment No." := '';
- SalesLine.SetFilter("Prepmt. Line Amount", '<>0');
- if SalesLine.FindSet(true) then
- repeat
- if SalesLine."Prepmt. Line Amount" <> SalesLine."Prepmt. Amt. Inv." then begin
- SalesLine."Prepmt. Amt. Inv." := SalesLine."Prepmt. Line Amount";
- SalesLine."Prepmt. Amount Inv. Incl. VAT" := SalesLine."Prepmt. Amt. Incl. VAT";
- SalesLine.CalcPrepaymentToDeduct();
- SalesLine."Prepmt VAT Diff. to Deduct" :=
- SalesLine."Prepmt VAT Diff. to Deduct" + SalesLine."Prepayment VAT Difference";
- SalesLine."Prepayment VAT Difference" := 0;
- OnUpdateSalesDocumentOnBeforeModifyInvoiceSalesLine(SalesLine);
- SalesLine.Modify();
- end;
- until SalesLine.Next() = 0;
- end else begin
- SalesHeader."Last Prepmt. Cr. Memo No." := GenJnlLineDocNo;
- SalesHeader."Prepmt. Cr. Memo No." := '';
- SalesLine.SetFilter("Prepmt. Amt. Inv.", '<>0');
- if SalesLine.FindSet(true) then
- repeat
- SalesLine."Prepmt. Amt. Inv." := SalesLine."Prepmt Amt Deducted";
- if SalesHeader."Prices Including VAT" then
- SalesLine."Prepmt. Amount Inv. Incl. VAT" := SalesLine."Prepmt. Amt. Inv."
- else
- SalesLine."Prepmt. Amount Inv. Incl. VAT" :=
- Round(
- SalesLine."Prepmt. Amt. Inv." * (100 + SalesLine."Prepayment VAT %") / 100,
- GetCurrencyAmountRoundingPrecision(SalesLine."Currency Code"));
- SalesLine."Prepmt. Amt. Incl. VAT" := SalesLine."Prepmt. Amount Inv. Incl. VAT";
- SalesLine."Prepayment Amount" := SalesLine."Prepmt. Amt. Inv.";
- SalesLine."Prepmt Amt to Deduct" := 0;
- SalesLine."Prepmt VAT Diff. to Deduct" := 0;
- SalesLine."Prepayment VAT Difference" := 0;
- OnUpdateSalesDocumentOnBeforeModifyCreditMemoSalesLine(SalesLine);
- SalesLine.Modify();
- until SalesLine.Next() = 0;
- end;
- end;
-
- local procedure UpdatePostedSalesDocument(DocumentType: Option Invoice,"Credit Memo"; DocumentNo: Code[20]; var CustLedgerEntry: Record "Cust. Ledger Entry")
- var
- SalesInvoiceHeader: Record "Sales Invoice Header";
- SalesCrMemoHeader: Record "Sales Cr.Memo Header";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdatePostedSalesDocument(CustLedgerEntry, SalesInvoiceHeader, SalesCrMemoHeader, DocumentType, IsHandled, DocumentNo);
- if IsHandled then
- exit;
-
- case DocumentType of
- DocumentType::Invoice:
- begin
- CustLedgerEntry.SetRange("Document Type", CustLedgerEntry."Document Type"::Invoice);
- CustLedgerEntry.SetRange("Document No.", DocumentNo);
- CustLedgerEntry.FindFirst();
- SalesInvoiceHeader.Get(DocumentNo);
- SalesInvoiceHeader."Cust. Ledger Entry No." := CustLedgerEntry."Entry No.";
- SalesInvoiceHeader.Modify();
- end;
- DocumentType::"Credit Memo":
- begin
- CustLedgerEntry.SetRange("Document Type", CustLedgerEntry."Document Type"::"Credit Memo");
- CustLedgerEntry.SetRange("Document No.", DocumentNo);
- CustLedgerEntry.FindFirst();
- SalesCrMemoHeader.Get(DocumentNo);
- SalesCrMemoHeader."Cust. Ledger Entry No." := CustLedgerEntry."Entry No.";
- SalesCrMemoHeader.Modify();
- end;
- end;
-
- OnAfterUpdatePostedSalesDocument(DocumentType, DocumentNo, SuppressCommit);
- end;
-
- local procedure InsertSalesInvHeader(var SalesInvHeader: Record "Sales Invoice Header"; SalesHeader: Record "Sales Header"; PostingDescription: Text[100]; GenJnlLineDocNo: Code[20]; SrcCode: Code[10]; PostingNoSeriesCode: Code[20])
- begin
- SalesInvHeader.Init();
- SalesInvHeader.TransferFields(SalesHeader);
- SalesInvHeader."Posting Description" := PostingDescription;
- SalesInvHeader."Payment Terms Code" := SalesHeader."Prepmt. Payment Terms Code";
- SalesInvHeader."Due Date" := SalesHeader."Prepayment Due Date";
- SalesInvHeader."Pmt. Discount Date" := SalesHeader."Prepmt. Pmt. Discount Date";
- SalesInvHeader."Payment Discount %" := SalesHeader."Prepmt. Payment Discount %";
- SalesInvHeader."No." := GenJnlLineDocNo;
- SalesInvHeader."Pre-Assigned No. Series" := '';
- SalesInvHeader."Source Code" := SrcCode;
- SalesInvHeader."User ID" := CopyStr(UserId(), 1, MaxStrLen(SalesInvHeader."User ID"));
- SalesInvHeader."No. Printed" := 0;
- SalesInvHeader."Prepayment Invoice" := true;
- SalesInvHeader."Prepayment Order No." := SalesHeader."No.";
- SalesInvHeader."No. Series" := PostingNoSeriesCode;
- OnBeforeSalesInvHeaderInsert(SalesInvHeader, SalesHeader, SuppressCommit, GenJnlLineDocNo);
- SalesInvHeader.Insert();
- CopyHeaderCommentLines(SalesHeader."No.", Database::"Sales Invoice Header", GenJnlLineDocNo);
- OnAfterSalesInvHeaderInsert(SalesInvHeader, SalesHeader, SuppressCommit);
- end;
-
- local procedure InsertSalesInvLine(SalesInvHeader: Record "Sales Invoice Header"; LineNo: Integer; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; SalesHeader: Record "Sales Header")
- var
- SalesInvLine: Record "Sales Invoice Line";
- VATPostingSetup: Record "VAT Posting Setup";
- SalesLine: Record "Sales Line";
- begin
- SalesInvLine.Init();
- SalesInvLine."Document No." := SalesInvHeader."No.";
- SalesInvLine."Line No." := LineNo;
- SalesInvLine."Sell-to Customer No." := SalesInvHeader."Sell-to Customer No.";
- SalesInvLine."Bill-to Customer No." := SalesInvHeader."Bill-to Customer No.";
- SalesInvLine.Type := SalesInvLine.Type::"G/L Account";
- SalesInvLine."No." := PrepmtInvLineBuffer."G/L Account No.";
- SalesInvLine."Posting Date" := SalesInvHeader."Posting Date";
- SalesInvLine."Shortcut Dimension 1 Code" := PrepmtInvLineBuffer."Global Dimension 1 Code";
- SalesInvLine."Shortcut Dimension 2 Code" := PrepmtInvLineBuffer."Global Dimension 2 Code";
- SalesInvLine."Dimension Set ID" := PrepmtInvLineBuffer."Dimension Set ID";
- SalesInvLine.Description := PrepmtInvLineBuffer.Description;
- if not SalesHeader."Compress Prepayment" then
- if SalesLine.Get(SalesHeader."Document Type", SalesHeader."No.", PrepmtInvLineBuffer."Line No.") then
- SalesInvLine."Description 2" := SalesLine."Description 2";
-
- SalesInvLine.Quantity := 1;
- if SalesInvHeader."Prices Including VAT" then begin
- SalesInvLine."Unit Price" := PrepmtInvLineBuffer."Amount Incl. VAT";
- SalesInvLine."Line Amount" := PrepmtInvLineBuffer."Amount Incl. VAT";
- end else begin
- SalesInvLine."Unit Price" := PrepmtInvLineBuffer.Amount;
- SalesInvLine."Line Amount" := PrepmtInvLineBuffer.Amount;
- end;
- SalesInvLine."Gen. Bus. Posting Group" := PrepmtInvLineBuffer."Gen. Bus. Posting Group";
- SalesInvLine."Gen. Prod. Posting Group" := PrepmtInvLineBuffer."Gen. Prod. Posting Group";
- SalesInvLine."VAT Bus. Posting Group" := PrepmtInvLineBuffer."VAT Bus. Posting Group";
- SalesInvLine."VAT Prod. Posting Group" := PrepmtInvLineBuffer."VAT Prod. Posting Group";
- SalesInvLine."VAT %" := PrepmtInvLineBuffer."VAT %";
- if VATPostingSetup.GET(PrepmtInvLineBuffer."VAT Bus. Posting Group", PrepmtInvLineBuffer."VAT Prod. Posting Group") then
- SalesInvLine."VAT Clause Code" := VATPostingSetup."VAT Clause Code";
- SalesInvLine.Amount := PrepmtInvLineBuffer.Amount;
- SalesInvLine."VAT Difference" := PrepmtInvLineBuffer."VAT Difference";
- SalesInvLine."Amount Including VAT" := PrepmtInvLineBuffer."Amount Incl. VAT";
- SalesInvLine."VAT Calculation Type" := PrepmtInvLineBuffer."VAT Calculation Type";
- SalesInvLine."VAT Base Amount" := PrepmtInvLineBuffer."VAT Base Amount";
- SalesInvLine."VAT Identifier" := PrepmtInvLineBuffer."VAT Identifier";
- SalesInvLine."Pmt. Discount Amount" := PrepmtInvLineBuffer."Orig. Pmt. Disc. Possible";
- OnBeforeSalesInvLineInsert(SalesInvLine, SalesInvHeader, PrepmtInvLineBuffer, SuppressCommit);
- SalesInvLine.Insert();
- if not SalesHeader."Compress Prepayment" then
- CopyLineCommentLines(
- SalesHeader."No.", Database::"Sales Invoice Header", SalesInvHeader."No.", PrepmtInvLineBuffer."Line No.", LineNo);
- OnAfterSalesInvLineInsert(SalesInvLine, SalesInvHeader, PrepmtInvLineBuffer, SuppressCommit);
- end;
-
- local procedure InsertSalesCrMemoHeader(var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesHeader: Record "Sales Header"; PostingDescription: Text[100]; GenJnlLineDocNo: Code[20]; SrcCode: Code[10]; PostingNoSeriesCode: Code[20]; CalcPmtDiscOnCrMemos: Boolean)
- begin
- SalesCrMemoHeader.Init();
- SalesCrMemoHeader.TransferFields(SalesHeader);
- SalesCrMemoHeader."Payment Terms Code" := SalesHeader."Prepmt. Payment Terms Code";
- SalesCrMemoHeader."Pmt. Discount Date" := SalesHeader."Prepmt. Pmt. Discount Date";
- SalesCrMemoHeader."Payment Discount %" := SalesHeader."Prepmt. Payment Discount %";
- if (SalesHeader."Prepmt. Payment Terms Code" <> '') and not CalcPmtDiscOnCrMemos then begin
- SalesCrMemoHeader."Payment Discount %" := 0;
- SalesCrMemoHeader."Pmt. Discount Date" := 0D;
- end;
- SalesCrMemoHeader."Posting Description" := PostingDescription;
- SalesCrMemoHeader."Due Date" := SalesHeader."Prepayment Due Date";
- SalesCrMemoHeader."No." := GenJnlLineDocNo;
- SalesCrMemoHeader."Pre-Assigned No. Series" := '';
- SalesCrMemoHeader."Source Code" := SrcCode;
- SalesCrMemoHeader."User ID" := CopyStr(UserId(), 1, MaxStrLen(SalesCrMemoHeader."User ID"));
- SalesCrMemoHeader."No. Printed" := 0;
- SalesCrMemoHeader."Prepayment Credit Memo" := true;
- SalesCrMemoHeader."Prepayment Order No." := SalesHeader."No.";
- SalesCrMemoHeader.Correction := GLSetup."Mark Cr. Memos as Corrections";
- SalesCrMemoHeader."No. Series" := PostingNoSeriesCode;
- OnBeforeSalesCrMemoHeaderInsert(SalesCrMemoHeader, SalesHeader, SuppressCommit);
- SalesCrMemoHeader.Insert();
- CopyHeaderCommentLines(SalesHeader."No.", Database::"Sales Cr.Memo Header", GenJnlLineDocNo);
- OnAfterSalesCrMemoHeaderInsert(SalesCrMemoHeader, SalesHeader, SuppressCommit);
- end;
-
- local procedure InsertSalesCrMemoLine(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; LineNo: Integer; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; SalesHeader: Record "Sales Header")
- var
- SalesCrMemoLine: Record "Sales Cr.Memo Line";
- VATPostingSetup: Record "VAT Posting Setup";
- begin
- SalesCrMemoLine.Init();
- SalesCrMemoLine."Document No." := SalesCrMemoHeader."No.";
- SalesCrMemoLine."Line No." := LineNo;
- SalesCrMemoLine."Sell-to Customer No." := SalesCrMemoHeader."Sell-to Customer No.";
- SalesCrMemoLine."Bill-to Customer No." := SalesCrMemoHeader."Bill-to Customer No.";
- SalesCrMemoLine.Type := SalesCrMemoLine.Type::"G/L Account";
- SalesCrMemoLine."No." := PrepmtInvLineBuffer."G/L Account No.";
- SalesCrMemoLine."Posting Date" := SalesCrMemoHeader."Posting Date";
- SalesCrMemoLine."Shortcut Dimension 1 Code" := PrepmtInvLineBuffer."Global Dimension 1 Code";
- SalesCrMemoLine."Shortcut Dimension 2 Code" := PrepmtInvLineBuffer."Global Dimension 2 Code";
- SalesCrMemoLine."Dimension Set ID" := PrepmtInvLineBuffer."Dimension Set ID";
- SalesCrMemoLine.Description := PrepmtInvLineBuffer.Description;
- SalesCrMemoLine.Quantity := 1;
- if SalesCrMemoHeader."Prices Including VAT" then begin
- SalesCrMemoLine."Unit Price" := PrepmtInvLineBuffer."Amount Incl. VAT";
- SalesCrMemoLine."Line Amount" := PrepmtInvLineBuffer."Amount Incl. VAT";
- end else begin
- SalesCrMemoLine."Unit Price" := PrepmtInvLineBuffer.Amount;
- SalesCrMemoLine."Line Amount" := PrepmtInvLineBuffer.Amount;
- end;
- SalesCrMemoLine."Gen. Bus. Posting Group" := PrepmtInvLineBuffer."Gen. Bus. Posting Group";
- SalesCrMemoLine."Gen. Prod. Posting Group" := PrepmtInvLineBuffer."Gen. Prod. Posting Group";
- SalesCrMemoLine."VAT Bus. Posting Group" := PrepmtInvLineBuffer."VAT Bus. Posting Group";
- SalesCrMemoLine."VAT Prod. Posting Group" := PrepmtInvLineBuffer."VAT Prod. Posting Group";
- SalesCrMemoLine."VAT %" := PrepmtInvLineBuffer."VAT %";
- if VATPostingSetup.GET(PrepmtInvLineBuffer."VAT Bus. Posting Group", PrepmtInvLineBuffer."VAT Prod. Posting Group") then
- SalesCrMemoLine."VAT Clause Code" := VATPostingSetup."VAT Clause Code";
- SalesCrMemoLine.Amount := PrepmtInvLineBuffer.Amount;
- SalesCrMemoLine."VAT Difference" := PrepmtInvLineBuffer."VAT Difference";
- SalesCrMemoLine."Amount Including VAT" := PrepmtInvLineBuffer."Amount Incl. VAT";
- SalesCrMemoLine."VAT Calculation Type" := PrepmtInvLineBuffer."VAT Calculation Type";
- SalesCrMemoLine."VAT Base Amount" := PrepmtInvLineBuffer."VAT Base Amount";
- SalesCrMemoLine."VAT Identifier" := PrepmtInvLineBuffer."VAT Identifier";
- SalesCrMemoLine."Pmt. Discount Amount" := PrepmtInvLineBuffer."Orig. Pmt. Disc. Possible";
- OnBeforeSalesCrMemoLineInsert(SalesCrMemoLine, SalesCrMemoHeader, PrepmtInvLineBuffer, SuppressCommit);
- SalesCrMemoLine.Insert();
- if not SalesHeader."Compress Prepayment" then
- CopyLineCommentLines(
- SalesHeader."No.", Database::"Sales Cr.Memo Header", SalesCrMemoHeader."No.", PrepmtInvLineBuffer."Line No.", LineNo);
- OnAfterSalesCrMemoLineInsert(SalesCrMemoLine, SalesCrMemoHeader, PrepmtInvLineBuffer, SuppressCommit);
- end;
-
- local procedure GetCalcPmtDiscOnCrMemos(PrepmtPmtTermsCode: Code[10]): Boolean
- var
- PaymentTerms: Record "Payment Terms";
- begin
- if PrepmtPmtTermsCode = '' then
- exit(false);
- PaymentTerms.Get(PrepmtPmtTermsCode);
- exit(PaymentTerms."Calc. Pmt. Disc. on Cr. Memos");
- end;
-
- ///
- /// Gets whether the prepayment posting is running in preview mode.
- ///
- /// Returns true if preview mode is enabled.
- procedure GetPreviewMode(): Boolean
- begin
- exit(PreviewMode);
- end;
-
- ///
- /// Gets whether database commits are being suppressed during prepayment posting.
- ///
- /// Returns true if commits are suppressed.
- procedure GetSuppressCommit(): Boolean
- begin
- exit(SuppressCommit);
- end;
-
- ///
- /// Sets whether database commits should be suppressed during prepayment posting.
- ///
- /// Specifies whether to suppress commits.
- procedure SetSuppressCommit(NewSuppressCommit: Boolean)
- begin
- SuppressCommit := NewSuppressCommit;
- end;
-
- ///
- /// Sets whether the prepayment posting is running in preview mode.
- ///
- /// Specifies whether preview mode is enabled.
- procedure SetPreviewMode(NewPreviewMode: Boolean)
- begin
- PreviewMode := NewPreviewMode;
- end;
-
- local procedure CalcDifferAmt(SalesLine: Record "Sales Line"; NewAmountIncludingVAT: Decimal; AmtRoundingPrecision: Decimal): Decimal
- var
- AmountInclVAT: Decimal;
- AmountInclVATDiff: Decimal;
- begin
- if SalesLine."Prepayment %" = 100 then begin
- AmountInclVATDiff := NewAmountIncludingVAT - SalesLine."Prepmt. Amt. Incl. VAT";
- if (AmountInclVATDiff <> 0) and (Abs(AmountInclVATDiff) <= AmtRoundingPrecision) then
- AmountInclVAT := NewAmountIncludingVAT - AmountInclVATDiff
- else
- AmountInclVAT := NewAmountIncludingVAT;
- end else
- AmountInclVAT := NewAmountIncludingVAT;
- exit(AmountInclVAT);
- end;
-
- local procedure CheckSalesLineIsNegative(SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckSalesLineIsNegative(SalesLine, IsHandled);
- if IsHandled then
- exit;
-
- if SalesLine.Quantity < 0 then
- SalesLine.FieldError(Quantity, StrSubstNo(Text018, SalesHeader.FieldCaption("Prepayment %")));
- if SalesLine."Unit Price" < 0 then
- SalesLine.FieldError("Unit Price", StrSubstNo(Text018, SalesHeader.FieldCaption("Prepayment %")));
- end;
-
- local procedure CheckSystemCreatedInvoiceRoundEntry(SalesLine: Record "Sales Line"; CustomerPostingGroupCode: Code[20]): Boolean
- var
- CustomerPostingGroup: Record "Customer Posting Group";
- begin
- if (SalesLine.Type <> SalesLine.Type::"G/L Account") or (not SalesLine."System-Created Entry") then
- exit(false);
-
- if CustomerPostingGroupCode = '' then
- exit(false);
-
- CustomerPostingGroup.SetLoadFields("Invoice Rounding Account");
- if not CustomerPostingGroup.Get(CustomerPostingGroupCode) then
- exit(false);
-
- if CustomerPostingGroup."Invoice Rounding Account" = '' then
- exit(false);
-
- if SalesLine."No." = CustomerPostingGroup."Invoice Rounding Account" then
- exit(true);
- end;
-
- local procedure UpdateDifferenceAmount(SalesHeader: Record "Sales Header"; var TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary; var TempPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; HasInvoiceDiscount: Boolean)
- var
- Currency: Record Currency;
- PrepmtAmt: Decimal;
- DifferenceAmt: Decimal;
- begin
- if HasInvoiceDiscount and (SalesHeader."Prepayment %" <> 0) then begin
- Currency.Initialize(SalesHeader."Currency Code");
- SalesHeader.CalcFields(Amount);
- PrepmtAmt := Round(SalesHeader.Amount * SalesHeader."Prepayment %" / 100, Currency."Amount Rounding Precision");
- if TotalPrepmtInvLineBuffer.Amount > PrepmtAmt then begin
- DifferenceAmt := TotalPrepmtInvLineBuffer.Amount - PrepmtAmt;
-
- TempPrepmtInvLineBuf.Reset();
- TempPrepmtInvLineBuf.SetCurrentKey(Adjustment);
- if TempPrepmtInvLineBuf.FindLast() then begin
- TempPrepmtInvLineBuf.Amount := Round(TempPrepmtInvLineBuf.Amount - DifferenceAmt, Currency."Amount Rounding Precision");
- TempPrepmtInvLineBuf."Amount Incl. VAT" := Round(TempPrepmtInvLineBuf."Amount Incl. VAT" - DifferenceAmt, Currency."Amount Rounding Precision");
- TempPrepmtInvLineBuf.Modify();
- end;
- end;
- end;
- end;
-
- ///
- /// Raised after applying filters on sales lines for prepayment processing.
- ///
- /// The filtered sales lines.
- /// The sales header being processed.
- /// The document type (Invoice or Credit Memo).
- [IntegrationEvent(false, false)]
- local procedure OnAfterApplyFilter(var SalesLine: Record "Sales Line"; SalesHeader: Record "Sales Header"; DocumentType: Option)
- begin
- end;
-
- ///
- /// Raised after building the prepayment invoice line buffer.
- ///
- /// The prepayment invoice line buffer that was built.
- [IntegrationEvent(false, false)]
- local procedure OnAfterBuildInvLineBuffer(var PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer")
- begin
- end;
-
- ///
- /// Raised after calculating VAT amount lines for prepayments.
- ///
- /// The sales header being processed.
- /// The sales lines being processed.
- /// The calculated VAT amount lines.
- /// The document type (Invoice, Credit Memo, or Statistic).
- /// The currency used for the calculation.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCalcVATAmountLines(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var VATAmountLine: Record "VAT Amount Line"; DocumentType: Option Invoice,"Credit Memo",Statistic; Currency: Record Currency)
- begin
- end;
-
- ///
- /// Raised after checking the prepayment document for posting readiness.
- ///
- /// The sales header that was checked.
- /// The document type (Invoice or Credit Memo).
- /// Indicates whether database commits are suppressed.
- /// The error message management codeunit for handling errors.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckPrepmtDoc(SalesHeader: Record "Sales Header"; DocumentType: Option Invoice,"Credit Memo"; CommitIsSuppressed: Boolean; var ErrorMessageMgt: Codeunit "Error Message Management")
- begin
- end;
-
- ///
- /// Raised after creating dimensions for prepayment lines.
- ///
- /// The sales line with dimensions.
- /// The default dimension sources used.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCreateDimensions(var SalesLine: Record "Sales Line"; DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])
- begin
- end;
-
- ///
- /// Raised after creating prepayment lines and before posting to the general ledger.
- ///
- /// The sales header being processed.
- /// The posted sales invoice header.
- /// The posted sales credit memo header.
- /// The temporary prepayment invoice line buffer.
- /// The document type being posted.
- /// The last line number used.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCreateLinesOnBeforeGLPosting(var SalesHeader: Record "Sales Header"; SalesInvHeader: Record "Sales Invoice Header"; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var TempPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary; DocumentType: Option; var LastLineNo: Integer)
- begin
- end;
-
- ///
- /// Raised after filling the prepayment invoice line buffer from a sales line.
- ///
- /// The prepayment invoice line buffer that was filled.
- /// The source sales line.
- /// Indicates whether database commits are suppressed.
- /// The sales header being processed.
- [IntegrationEvent(false, false)]
- local procedure OnAfterFillInvLineBuffer(var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; SalesLine: Record "Sales Line"; CommitIsSuppressed: Boolean; SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after inserting the invoice rounding line for prepayments.
- ///
- /// The sales header being processed.
- /// The prepayment invoice line buffer with rounding.
- /// The total prepayment invoice line buffer.
- /// The previous line number.
- [IntegrationEvent(false, false)]
- local procedure OnAfterInsertInvoiceRounding(SalesHeader: Record "Sales Header"; var PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var PrevLineNo: Integer)
- begin
- end;
-
- ///
- /// Raised after posting prepayments.
- ///
- /// The sales header that was posted.
- /// The document type (Invoice or Credit Memo).
- /// Indicates whether database commits are suppressed.
- /// The posted prepayment invoice header.
- /// The posted prepayment credit memo header.
- /// The customer ledger entry that was created.
- [IntegrationEvent(false, false)]
- local procedure OnAfterPostPrepayments(var SalesHeader: Record "Sales Header"; DocumentType: Option Invoice,"Credit Memo"; CommitIsSuppressed: Boolean; var SalesInvoiceHeader: Record "Sales Invoice Header"; var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var CustLedgerEntry: Record "Cust. Ledger Entry")
- begin
- end;
-
- ///
- /// Raised after posting prepayments before throwing a preview mode error.
- ///
- /// The sales header being processed.
- /// The posted sales invoice header.
- /// The posted sales credit memo header.
- /// The general journal post line codeunit instance.
- /// Indicates whether the posting is in preview mode.
- [IntegrationEvent(false, false)]
- local procedure OnAfterPostPrepaymentsOnBeforeThrowPreviewModeError(var SalesHeader: Record "Sales Header"; var SalesInvHeader: Record "Sales Invoice Header"; var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; PreviewMode: Boolean)
- begin
- end;
-
- ///
- /// Raised after posting the balancing entry for prepayments.
- ///
- /// The general journal line that was posted.
- /// The customer ledger entry.
- /// The total prepayment invoice line buffer.
- /// The total prepayment invoice line buffer in LCY.
- /// Indicates whether database commits are suppressed.
- /// The sales header being processed.
- [IntegrationEvent(false, false)]
- local procedure OnAfterPostBalancingEntry(var GenJnlLine: Record "Gen. Journal Line"; CustLedgEntry: Record "Cust. Ledger Entry"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; CommitIsSuppressed: Boolean; SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised after posting the customer entry for prepayments.
- ///
- /// The general journal line that was posted.
- /// The total prepayment invoice line buffer.
- /// The total prepayment invoice line buffer in LCY.
- /// Indicates whether database commits are suppressed.
- [IntegrationEvent(false, false)]
- local procedure OnAfterPostCustomerEntry(var GenJnlLine: Record "Gen. Journal Line"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; CommitIsSuppressed: Boolean)
- begin
- end;
-
- ///
- /// Raised after posting a prepayment invoice line buffer entry.
- ///
- /// The general journal line that was posted.
- /// The prepayment invoice line buffer that was posted.
- /// Indicates whether database commits are suppressed.
- /// The general journal post line codeunit instance.
- [IntegrationEvent(false, false)]
- local procedure OnAfterPostPrepmtInvLineBuffer(var GenJnlLine: Record "Gen. Journal Line"; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSuppressed: Boolean; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")
- begin
- end;
-
- ///
- /// Raised after rounding prepayment amounts.
- ///
- /// The sales header being processed.
- /// The prepayment invoice line buffer with rounded amounts.
- /// The total prepayment invoice line buffer.
- /// The total prepayment invoice line buffer in LCY.
- [IntegrationEvent(false, false)]
- local procedure OnAfterRoundAmounts(SalesHeader: Record "Sales Header"; var PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBufLCY: Record "Prepayment Inv. Line Buffer")
- begin
- end;
-
- ///
- /// Raised after inserting a prepayment sales invoice header.
- ///
- /// The sales invoice header that was inserted.
- /// The source sales header.
- /// Indicates whether database commits are suppressed.
- [IntegrationEvent(false, false)]
- local procedure OnAfterSalesInvHeaderInsert(var SalesInvoiceHeader: Record "Sales Invoice Header"; SalesHeader: Record "Sales Header"; CommitIsSuppressed: Boolean)
- begin
- end;
-
- ///
- /// Raised after inserting a prepayment sales invoice line.
- ///
- /// The sales invoice line that was inserted.
- /// The sales invoice header.
- /// The prepayment invoice line buffer.
- /// Indicates whether database commits are suppressed.
- [IntegrationEvent(false, false)]
- local procedure OnAfterSalesInvLineInsert(var SalesInvLine: Record "Sales Invoice Line"; SalesInvHeader: Record "Sales Invoice Header"; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSuppressed: Boolean)
- begin
- end;
-
- ///
- /// Raised after inserting a prepayment sales credit memo header.
- ///
- /// The sales credit memo header that was inserted.
- /// The source sales header.
- /// Indicates whether database commits are suppressed.
- [IntegrationEvent(false, false)]
- local procedure OnAfterSalesCrMemoHeaderInsert(var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesHeader: Record "Sales Header"; CommitIsSuppressed: Boolean)
- begin
- end;
-
- ///
- /// Raised after inserting a prepayment sales credit memo line.
- ///
- /// The sales credit memo line that was inserted.
- /// The sales credit memo header.
- /// The prepayment invoice line buffer.
- /// Indicates whether database commits are suppressed.
- [IntegrationEvent(false, false)]
- local procedure OnAfterSalesCrMemoLineInsert(var SalesCrMemoLine: Record "Sales Cr.Memo Line"; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSuppressed: Boolean)
- begin
- end;
-
- ///
- /// Raised after updating the posted sales document with prepayment information.
- ///
- /// The document type (Invoice or Credit Memo).
- /// The document number.
- /// Indicates whether database commits are suppressed.
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdatePostedSalesDocument(DocumentType: Option Invoice,"Credit Memo"; DocumentNo: Code[20]; CommitIsSuppressed: Boolean)
- begin
- end;
-
- ///
- /// Raised after updating VAT on lines for prepayments.
- ///
- /// The sales header being processed.
- /// The sales lines being updated.
- /// The VAT amount lines.
- /// The document type (Invoice, Credit Memo, or Statistic).
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateVATOnLines(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var VATAmountLine: Record "VAT Amount Line"; DocumentType: Option Invoice,"Credit Memo",Statistic)
- begin
- end;
-
- ///
- /// Raised before checking the prepayment document for posting readiness.
- ///
- /// The sales header to check.
- /// The document type to check.
- /// Indicates whether database commits are suppressed.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckPrepmtDoc(SalesHeader: Record "Sales Header"; DocumentType: Option; CommitIsSuppressed: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking for open prepayment lines.
- ///
- /// The sales header to check.
- /// The document type to check.
- /// Returns whether open prepayment lines were found.
- /// Set to true to skip the default check logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckOpenPrepaymentLines(SalesHeader: Record "Sales Header"; DocumentType: Option; var Found: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before creating lines from the prepayment buffer.
- ///
- /// The sales header being processed.
- /// The sales line record.
- /// The temporary prepayment invoice line buffer.
- /// The line count.
- /// The sales invoice header.
- /// The sales credit memo header.
- /// The posted document table number.
- /// The document type.
- /// The last line number.
- /// The general journal line document number.
- /// Set to true to skip the default line creation.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateLinesFromBuffer(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var TempGlobalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer" temporary; var LineCount: Integer; var SalesInvHeader: Record "Sales Invoice Header"; var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var PostedDocTabNo: Integer; DocumentType: Option; var LastLineNo: Integer; GenJnlLineDocNo: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before posting a prepayment invoice.
- ///
- /// The sales header for the prepayment invoice.
- /// Set to true to skip the default invoice posting.
- [IntegrationEvent(true, false)]
- local procedure OnBeforeInvoice(var SalesHeader: Record "Sales Header"; var Handled: Boolean)
- begin
- end;
-
- ///
- /// Raised before posting a prepayment credit memo.
- ///
- /// The sales header for the prepayment credit memo.
- /// Set to true to skip the default credit memo posting.
- [IntegrationEvent(true, false)]
- local procedure OnBeforeCreditMemo(var SalesHeader: Record "Sales Header"; var Handled: Boolean)
- begin
- end;
-
- ///
- /// Raised before filling the prepayment invoice line buffer.
- ///
- /// The prepayment invoice line buffer to fill.
- /// The sales header being processed.
- /// The source sales line.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeFillInvLineBuffer(var PrepaymentInvLineBuffer: Record "Prepayment Inv. Line Buffer"; SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised before inserting extended text for prepayment lines.
- ///
- /// The table number.
- /// The document number.
- /// The G/L account number.
- /// The document date.
- /// The language code.
- /// The previous line number.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInsertExtendedText(TabNo: Integer; DocNo: Code[20]; GLAccNo: Code[20]; DocDate: Date; LanguageCode: Code[10]; var PrevLineNo: Integer);
- begin
- end;
-
- ///
- /// Raised before posting prepayments.
- ///
- /// The sales header to be posted.
- /// The document type (Invoice or Credit Memo).
- /// Indicates whether database commits are suppressed.
- /// Indicates whether the posting is in preview mode.
- [IntegrationEvent(false, false)]
- local procedure OnBeforePostPrepayments(var SalesHeader: Record "Sales Header"; DocumentType: Option Invoice,"Credit Memo"; CommitIsSuppressed: Boolean; PreviewMode: Boolean)
- begin
- end;
-
- ///
- /// Raised before inserting the prepayment sales invoice header.
- ///
- /// The sales invoice header to be inserted.
- /// The source sales header.
- /// Indicates whether database commits are suppressed.
- /// The general journal document number.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSalesInvHeaderInsert(var SalesInvHeader: Record "Sales Invoice Header"; SalesHeader: Record "Sales Header"; CommitIsSuppressed: Boolean; GenJnlDocNo: Code[20])
- begin
- end;
-
- ///
- /// Raised before asserting that the prepayment amount is not more than the document amount.
- ///
- /// The customer ledger entry being checked.
- /// The sales header being processed.
- /// The sales line being processed.
- /// Set to true to skip the default assertion logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSalesAssertPrepmtAmountNotMoreThanDocAmount(var CustLedgEntry: Record "Cust. Ledger Entry"; SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before inserting a prepayment sales invoice line.
- ///
- /// The sales invoice line to be inserted.
- /// The sales invoice header.
- /// The prepayment invoice line buffer.
- /// Indicates whether database commits are suppressed.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSalesInvLineInsert(var SalesInvLine: Record "Sales Invoice Line"; SalesInvHeader: Record "Sales Invoice Header"; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSuppressed: Boolean)
- begin
- end;
-
- ///
- /// Raised before inserting the prepayment sales credit memo header.
- ///
- /// The sales credit memo header to be inserted.
- /// The source sales header.
- /// Indicates whether database commits are suppressed.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSalesCrMemoHeaderInsert(var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; SalesHeader: Record "Sales Header"; CommitIsSuppressed: Boolean)
- begin
- end;
-
- ///
- /// Raised before inserting a prepayment sales credit memo line.
- ///
- /// The sales credit memo line to be inserted.
- /// The sales credit memo header.
- /// The prepayment invoice line buffer.
- /// Indicates whether database commits are suppressed.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSalesCrMemoLineInsert(var SalesCrMemoLine: Record "Sales Cr.Memo Line"; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSuppressed: Boolean)
- begin
- end;
-
- ///
- /// Raised before posting the customer entry for the prepayment.
- ///
- /// The general journal line to be posted.
- /// The total prepayment invoice line buffer.
- /// The total prepayment invoice line buffer in LCY.
- /// Indicates whether database commits are suppressed.
- /// The sales header being processed.
- /// The document type (Invoice or Credit Memo).
- [IntegrationEvent(false, false)]
- local procedure OnBeforePostCustomerEntry(var GenJnlLine: Record "Gen. Journal Line"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; CommitIsSuppressed: Boolean; SalesHeader: Record "Sales Header"; DocumentType: Option Invoice,"Credit Memo")
- begin
- end;
-
- ///
- /// Raised before running the general journal post line codeunit.
- ///
- /// The general journal line to be posted.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeRunGenJnlPostLine(var GenJnlLine: Record "Gen. Journal Line")
- begin
- end;
-
- ///
- /// Raised before updating the sales document after prepayment posting.
- ///
- /// The sales header to be updated.
- /// The sales line to be updated.
- /// The document type.
- /// The general journal line document number.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateSalesDocument(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; DocumentType: Option; GenJnlLineDocNo: Code[20])
- begin
- end;
-
- ///
- /// Raised before updating document numbers for prepayment posting.
- ///
- /// The sales header being processed.
- /// The document type (Invoice or Credit Memo).
- /// The document number to be assigned.
- /// The number series code to use.
- /// Indicates whether the header should be modified.
- /// Indicates whether the posting is in preview mode.
- /// Set to true to skip the default document number update logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateDocNos(var SalesHeader: Record "Sales Header"; DocumentType: Option Invoice,"Credit Memo"; var DocNo: Code[20]; var NoSeriesCode: Code[20]; var ModifyHeader: Boolean; IsPreviewMode: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating the posted sales document with the customer ledger entry number.
- ///
- /// The customer ledger entry that was created.
- /// The posted sales invoice header.
- /// The posted sales credit memo header.
- /// The document type (Invoice or Credit Memo).
- /// Set to true to skip the default update logic.
- /// The document number.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdatePostedSalesDocument(var CustLedgerEntry: Record "Cust. Ledger Entry"; var SalesInvoiceHeader: Record "Sales Invoice Header"; var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; DocumentType: Option Invoice,"Credit Memo"; var IsHandled: Boolean; DocumentNo: Code[20])
- begin
- end;
-
- ///
- /// Raised before posting the prepayment invoice line buffer to the general journal.
- ///
- /// The general journal line to be posted.
- /// The prepayment invoice line buffer.
- /// Indicates whether database commits are suppressed.
- [IntegrationEvent(false, false)]
- local procedure OnBeforePostPrepmtInvLineBuffer(var GenJnlLine: Record "Gen. Journal Line"; PrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; CommitIsSuppressed: Boolean)
- begin
- end;
-
- ///
- /// Raised during VAT amount lines calculation before updating lines.
- ///
- /// The new amount calculated.
- /// The currency used for the calculation.
- /// The sales header being processed.
- /// Set to true to skip the default update logic.
- [IntegrationEvent(false, false)]
- local procedure OnCalcVATAmountLinesOnBeforeUpdateLines(var NewAmount: Decimal; Currency: Record Currency; SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after building the prepayment invoice line buffer in the Code procedure.
- ///
- /// The temporary VAT amount lines.
- /// The temporary prepayment invoice line buffer.
- [IntegrationEvent(false, false)]
- local procedure OnCodeOnAfterBuildInvLineBuffer(var TempVATAmountLine: Record "VAT Amount Line" temporary; var TempPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary)
- begin
- end;
-
- ///
- /// Raised before calculating and updating VAT amount lines in the Code procedure.
- ///
- /// The sales header being processed.
- /// The sales line being processed.
- /// The temporary prepayment invoice line buffer.
- /// The document type.
- /// Set to true to skip the default calculation logic.
- [IntegrationEvent(false, false)]
- local procedure OnCodeOnBeforeCalcAndUpdateVATAmountLines(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var TempPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary; DocumentType: Option; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before posting the customer entry in the Code procedure.
- ///
- /// The sales header being processed.
- /// The temporary prepayment invoice line buffer.
- [IntegrationEvent(false, false)]
- local procedure OnCodeOnBeforePostCustomerEntry(var SalesHeader: Record "Sales Header"; var TempPrepaymentInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary)
- begin
- end;
-
- ///
- /// Raised before posting the balancing entry in the Code procedure.
- ///
- /// The sales header being processed.
- /// The temporary prepayment invoice line buffer.
- [IntegrationEvent(false, false)]
- local procedure OnCodeOnBeforePostBalancingEntry(var SalesHeader: Record "Sales Header"; var TempPrepaymentInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary)
- begin
- end;
-
- ///
- /// Raised before opening the progress window in the Code procedure.
- ///
- /// The sales header being processed.
- /// The document type (Invoice or Credit Memo).
- [IntegrationEvent(false, false)]
- local procedure OnCodeOnBeforeWindowOpen(var SalesHeader: Record "Sales Header"; DocumentType: Option Invoice,"Credit Memo")
- begin
- end;
-
- ///
- /// Raised after calculating whether to set pending prepayment status in the Code procedure.
- ///
- /// The sales header being processed.
- /// The posted prepayment invoice header.
- /// The posted prepayment credit memo header.
- /// The document type (Invoice or Credit Memo).
- /// Indicates whether the posting is in preview mode.
- /// Indicates whether pending prepayment status should be set.
- [IntegrationEvent(false, false)]
- local procedure OnCodeOnAfterCalcShouldSetPendingPrepaymentStatus(var SalesHeader: Record "Sales Header"; var SalesInvoiceHeader: Record "Sales Invoice Header"; var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; DocumentType: Option Invoice,"Credit Memo"; PreviewMode: Boolean; var ShouldSetPendingPrepaymentStatus: Boolean)
- begin
- end;
-
- ///
- /// Raised before inserting a sales invoice line during extended text insertion.
- ///
- /// The sales invoice line to be inserted.
- /// The table number.
- /// The document number.
- /// The next line number.
- /// The temporary extended text line.
- /// The sales header being processed.
- [IntegrationEvent(false, false)]
- local procedure OnInsertExtendedTextOnBeforeSalesInvLineInsert(var SalesInvoiceLine: Record "Sales Invoice Line"; TabNo: Integer; DocNo: Code[20]; NextLineNo: Integer; var TempExtendedTextLine: Record "Extended Text Line" temporary; SalesHeader: Record "Sales Header");
- begin
- end;
-
- ///
- /// Raised before inserting a sales credit memo line during extended text insertion.
- ///
- /// The sales credit memo line to be inserted.
- /// The table number.
- /// The document number.
- /// The next line number.
- /// The temporary extended text line.
- /// The sales header being processed.
- [IntegrationEvent(false, false)]
- local procedure OnInsertExtendedTextOnBeforeSalesCrMemoLineInsert(var SalesCrMemoLine: Record "Sales Cr.Memo Line"; TabNo: Integer; DocNo: Code[20]; NextLineNo: Integer; var TempExtendedTextLine: Record "Extended Text Line" temporary; SalesHeader: Record "Sales Header");
- begin
- end;
-
- ///
- /// Raised before running the general journal post line with check during balancing entry posting.
- ///
- /// The general journal line to be posted.
- /// The customer ledger entry.
- /// The total prepayment invoice line buffer.
- /// The total prepayment invoice line buffer in LCY.
- /// Indicates whether database commits are suppressed.
- /// The sales header being processed.
- /// The general journal document type.
- [IntegrationEvent(false, false)]
- local procedure OnPostBalancingEntryOnBeforeGenJnlPostLineRunWithCheck(var GenJnlLine: Record "Gen. Journal Line"; CustLedgEntry: Record "Cust. Ledger Entry"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer"; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; CommitIsSuppressed: Boolean; SalesHeader: Record "Sales Header"; DocType: enum "Gen. Journal Document Type")
- begin
- end;
-
- ///
- /// Raised before incrementing amounts during the rounding process.
- ///
- /// The sales header being processed.
- /// The prepayment invoice line buffer.
- /// The total prepayment invoice line buffer.
- /// The total prepayment invoice line buffer in LCY.
- [IntegrationEvent(false, false)]
- local procedure OnRoundAmountsOnBeforeIncrAmounts(SalesHeader: Record "Sales Header"; var PrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBuf: Record "Prepayment Inv. Line Buffer"; var TotalPrepmtInvLineBufLCY: Record "Prepayment Inv. Line Buffer")
- begin
- end;
-
- ///
- /// Raised before modifying the sales line during credit memo prepayment document update.
- ///
- /// The sales line to be modified.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesDocumentOnBeforeModifyCreditMemoSalesLine(var SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised before modifying the sales line during invoice prepayment document update.
- ///
- /// The sales line to be modified.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesDocumentOnBeforeModifyInvoiceSalesLine(var SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised after getting the remainder during VAT update on lines.
- ///
- /// The VAT amount line remainder.
- /// Indicates whether a remainder exists.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnAfterGetRemainder(var VATAmountLineRemainder: Record "VAT Amount Line"; var RemainderExists: Boolean)
- begin
- end;
-
- ///
- /// Raised after getting the VAT amount line during VAT update on lines.
- ///
- /// The VAT amount line that was retrieved.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnAfterVATAmountLineGet(var VATAmountLine: Record "VAT Amount Line")
- begin
- end;
-
- ///
- /// Raised before modifying the sales line during VAT update on lines.
- ///
- /// The sales header being processed.
- /// The sales line to be modified.
- /// The temporary VAT amount line remainder.
- /// The new amount.
- /// The new amount including VAT.
- /// The new VAT base amount.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateVATOnLinesOnBeforeSalesLineModify(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var TempVATAmountLineRemainder: Record "VAT Amount Line"; NewAmount: Decimal; NewAmountIncludingVAT: Decimal; NewVATBaseAmount: Decimal)
- begin
- end;
-
- ///
- /// Raised before throwing a preview error.
- ///
- /// The sales header being processed in preview mode.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeThrowPreviewError(SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before checking if the sales line is negative.
- ///
- /// The sales line to check.
- /// Set to true to skip the default negative check logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckSalesLineIsNegative(SalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before getting sales lines for prepayment processing.
- ///
- /// The sales header being processed.
- /// The document type (Invoice, Credit Memo, or Statistic).
- /// The sales line record to populate.
- /// Set to true to skip the default get sales lines logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetSalesLines(SalesHeader: Record "Sales Header"; DocumentType: Option Invoice,"Credit Memo",Statistic; var ToSalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating prepayment amounts on sales lines.
- ///
- /// The sales header being processed.
- /// The new total prepayment amount.
- /// Set to true to skip the default update logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdatePrepmtAmountOnSaleslines(SalesHeader: Record "Sales Header"; NewTotalPrepmtAmount: Decimal; var IsHandled: Boolean);
- begin
- end;
-
- ///
- /// Raised before inserting to the sales line in the GetSalesLines procedure.
- ///
- /// The sales line to be inserted.
- [IntegrationEvent(false, false)]
- local procedure OnGetSalesLinesOnBeforeInsertToSalesLine(var ToSalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised before inserting posted headers in the Code procedure.
- ///
- /// The sales header being processed.
- [IntegrationEvent(false, false)]
- local procedure OnCodeOnBeforeInsertPostedHeaders(var SalesHeader: Record "Sales Header");
- begin
- end;
-
- ///
- /// Raised after updating document numbers for prepayment posting.
- ///
- /// The sales header that was updated.
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateDocNos(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before filling the invoice line buffer in the BuildInvLineBuffer procedure.
- ///
- /// The sales header being processed.
- /// The source sales line.
- [IntegrationEvent(false, false)]
- local procedure OnBuildInvLineBufferOnBeforeFillInvLineBuffer(var SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Raised after setting the posting description in the Code procedure.
- ///
- /// The sales header being processed.
- /// The document type (Invoice or Credit Memo).
- /// The posting description that was set.
- [IntegrationEvent(false, false)]
- local procedure OnCodeOnAfterPostingDescriptionSet(var SalesHeader: Record "Sales Header"; DocumentType: Option Invoice,"Credit Memo"; var PostingDescription: Text[100])
- begin
- end;
-
- ///
- /// Raised before the PostCustomerEntry procedure.
- ///
- /// The sales header being processed.
- /// The total prepayment invoice line buffer.
- /// The total prepayment invoice line buffer in LCY.
- /// The document type (Invoice or Credit Memo).
- /// The posting description.
- /// The general journal document type.
- /// The document number.
- /// The external document number.
- /// The source code.
- /// The posting number series code.
- /// Indicates whether to calculate payment discount.
- /// The general journal post line codeunit instance.
- /// Set to true to skip the default customer entry posting logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforePostCustomerEntryProcedure(var SalesHeader: Record "Sales Header"; TotalPrepmtInvLineBuffer: Record "Prepayment Inv. Line Buffer" temporary; TotalPrepmtInvLineBufferLCY: Record "Prepayment Inv. Line Buffer"; DocumentType: Option Invoice,"Credit Memo"; PostingDescription: Text[100]; DocType: Enum "Gen. Journal Document Type"; DocNo: Code[20]; ExtDocNo: Text[35]; SrcCode: Code[10]; PostingNoSeriesCode: Code[20]; CalcPmtDisc: Boolean; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before calculating the prepayment amount.
- ///
- /// The sales line being processed.
- /// The document type (Invoice, Credit Memo, or Statistic).
- /// The calculated prepayment amount.
- /// Set to true to skip the default calculation logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforePrepmtAmount(var SalesLine: Record "Sales Line"; DocumentType: Option Invoice,"Credit Memo",Statistic; var Result: Decimal; var IsHandled: Boolean);
- begin
- end;
-
- ///
- /// Raised before inserting a VAT amount line in the InsertVATAmount procedure.
- ///
- /// The sales line being processed.
- /// The VAT amount line to be inserted.
- [IntegrationEvent(false, false)]
- local procedure OnInsertVATAmountOnBeforeInsert(var SalesLine: Record "Sales Line"; var VATAmountLine: Record "VAT Amount Line")
- begin
- end;
-
- ///
- /// Raised after setting filters in the FindVATAmountLine procedure.
- ///
- /// The sales line being processed.
- /// The VAT amount line with filters applied.
- [IntegrationEvent(false, false)]
- local procedure OnFindVATAmountLineOnAfterSetFilters(var SalesLine: Record "Sales Line"; var VATAmountLine: Record "VAT Amount Line")
- begin
- end;
-
- ///
- /// Raised before checking the prepayment document in the Code procedure.
- ///
- /// The sales header being processed.
- /// The document type (Invoice or Credit Memo).
- [IntegrationEvent(false, false)]
- local procedure OnCodeOnBeforeCheckPrepmtDoc(var SalesHeader: Record "Sales Header"; var DocumentType: Option Invoice,"Credit Memo")
- begin
- end;
-
- ///
- /// Raised after getting the prepayment account number from the general posting setup.
- ///
- /// The general posting setup used to retrieve the account.
- /// The prepayment account number that was retrieved.
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetPrepmtAccNo(GenPostingSetup: Record "General Posting Setup"; var PrepmtAccNo: Code[20])
- begin
- end;
-
- ///
- /// Raised after getting the correction balancing account number.
- ///
- /// The sales header being processed.
- /// Indicates whether the amount is positive.
- /// The balancing account number that was retrieved.
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetCorrBalAccNo(SalesHeader: Record "Sales Header"; PositiveAmount: Boolean; var BalAccNo: Code[20])
- begin
- end;
-
- ///
- /// Raised after setting the source code in the Code procedure.
- ///
- /// The sales header being processed.
- /// The source code setup record.
- /// The source code that was set.
- [IntegrationEvent(false, false)]
- local procedure OnCodeOnAfterSetSourceCode(var SalesHeader: Record "Sales Header"; SourceCodeSetup: Record "Source Code Setup"; var SrcCode: Code[10])
- begin
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Sales/Receivables/ApplyCustomerEntries.Page.al b/src/Layers/NL/BaseApp/Sales/Receivables/ApplyCustomerEntries.Page.al
deleted file mode 100644
index 18d8f75a88..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Receivables/ApplyCustomerEntries.Page.al
+++ /dev/null
@@ -1,2066 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.Receivables;
-
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.Foundation.Navigate;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.Document;
-using Microsoft.Sales.FinanceCharge;
-using Microsoft.Sales.Posting;
-using Microsoft.Sales.Setup;
-
-///
-/// Displays open customer ledger entries and enables users to select and apply payments to invoices.
-///
-page 232 "Apply Customer Entries"
-{
- Caption = 'Apply Customer Entries';
- DataCaptionFields = "Customer No.";
- DeleteAllowed = false;
- InsertAllowed = false;
- LinksAllowed = false;
- PageType = Worksheet;
- SourceTable = "Cust. Ledger Entry";
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
-#pragma warning disable AA0100
- field("ApplyingCustLedgEntry.""Posting Date"""; TempApplyingCustLedgEntry."Posting Date")
-#pragma warning restore AA0100
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posting Date';
- Editable = false;
- ToolTip = 'Specifies the posting date of the entry to be applied. This date is used to find the correct exchange rate when applying entries in different currencies.';
- }
-#pragma warning disable AA0100
- field("ApplyingCustLedgEntry.""Document Type"""; TempApplyingCustLedgEntry."Document Type")
-#pragma warning restore AA0100
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Document Type';
- Editable = false;
- ToolTip = 'Specifies the document type of the entry to be applied.';
- }
-#pragma warning disable AA0100
- field("ApplyingCustLedgEntry.""Document No."""; TempApplyingCustLedgEntry."Document No.")
-#pragma warning restore AA0100
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Document No.';
- Editable = false;
- ToolTip = 'Specifies the document number of the entry to be applied.';
- }
- field(ApplyingCustomerNo; TempApplyingCustLedgEntry."Customer No.")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer No.';
- Editable = false;
- ToolTip = 'Specifies the customer number of the entry to be applied.';
- Visible = false;
- }
- field(ApplyingCustomerName; TempApplyingCustLedgEntry."Customer Name")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer Name';
- Editable = false;
- ToolTip = 'Specifies the customer name of the entry to be applied.';
- Visible = CustNameVisible;
- }
- field(ApplyingDescription; TempApplyingCustLedgEntry.Description)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Description';
- Editable = false;
- ToolTip = 'Specifies the description of the entry to be applied.';
- Visible = false;
- }
-#pragma warning disable AA0100
- field("ApplyingCustLedgEntry.""Currency Code"""; TempApplyingCustLedgEntry."Currency Code")
-#pragma warning restore AA0100
- {
- ApplicationArea = Suite;
- Caption = 'Currency Code';
- Editable = false;
- ToolTip = 'Specifies the code for the currency that amounts are shown in.';
- }
- field("ApplyingCustLedgEntry.Amount"; TempApplyingCustLedgEntry.Amount)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Amount';
- Editable = false;
- ToolTip = 'Specifies the amount on the entry to be applied.';
- }
-#pragma warning disable AA0100
- field("ApplyingCustLedgEntry.""Remaining Amount"""; TempApplyingCustLedgEntry."Remaining Amount")
-#pragma warning restore AA0100
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Remaining Amount';
- Editable = false;
- ToolTip = 'Specifies the amount on the entry to be applied.';
- }
- }
- repeater(Control1)
- {
- ShowCaption = false;
- field(AppliesToID; Rec."Applies-to ID")
- {
- ApplicationArea = All;
- Visible = AppliesToIDVisible;
-
- trigger OnValidate()
- begin
- if Rec."Applies-to ID" = xRec."Applies-to ID" then
- exit;
-
- if (CalcType = CalcType::"Gen. Jnl. Line") and (ApplnType = ApplnType::"Applies-to Doc. No.") then
- Error(CannotSetAppliesToIDErr);
-
- SetCustApplId(true);
- Rec.Get(Rec."Entry No.");
- if Rec."Applies-to ID" <> '' then
- UpdateCustomAppliesToIDForGenJournal(Rec."Applies-to ID");
-
- CurrPage.Update(false);
- end;
- }
- field("Posting Date"; Rec."Posting Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Document Type"; Rec."Document Type")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- StyleExpr = StyleTxt;
- }
- field("Document No."; Rec."Document No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- StyleExpr = StyleTxt;
- }
- field(Prepayment; Rec.Prepayment)
- {
- ApplicationArea = Prepayments;
- Editable = false;
- }
- field("Customer No."; Rec."Customer No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Customer Name"; Rec."Customer Name")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = CustNameVisible;
- }
- field(Description; Rec.Description)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- }
- field("Original Amount"; Rec."Original Amount")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field(Amount; Rec.Amount)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Debit Amount"; Rec."Debit Amount")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Credit Amount"; Rec."Credit Amount")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Remaining Amount"; Rec."Remaining Amount")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
-#pragma warning disable AA0100
- field("CalcApplnRemainingAmount(""Remaining Amount"")"; CalcApplnRemainingAmount(Rec."Remaining Amount"))
-#pragma warning restore AA0100
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Appln. Remaining Amount';
- ToolTip = 'Specifies the amount that remains to be applied to before the entry is totally applied to.';
- }
- field("Amount to Apply"; Rec."Amount to Apply")
- {
- ApplicationArea = Basic, Suite;
- trigger OnValidate()
- begin
- CODEUNIT.Run(CODEUNIT::"Cust. Entry-Edit", Rec);
-
- if (xRec."Amount to Apply" = 0) or (Rec."Amount to Apply" = 0) and
- ((ApplnType = ApplnType::"Applies-to ID") or (CalcType = CalcType::Direct))
- then
- SetCustApplId(false);
- Rec.Get(Rec."Entry No.");
- AmountToApplyOnAfterValidate();
- end;
- }
- field(ApplnAmountToApply; CalcApplnAmountToApply(Rec."Amount to Apply"))
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Appln. Amount to Apply';
- ToolTip = 'Specifies the amount to apply.';
- }
- field("Due Date"; Rec."Due Date")
- {
- ApplicationArea = Basic, Suite;
- StyleExpr = StyleTxt;
- }
- field("Pmt. Discount Date"; Rec."Pmt. Discount Date")
- {
- ApplicationArea = Basic, Suite;
- trigger OnValidate()
- begin
- RecalcApplnAmount();
- end;
- }
- field("Pmt. Disc. Tolerance Date"; Rec."Pmt. Disc. Tolerance Date")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Original Pmt. Disc. Possible"; Rec."Original Pmt. Disc. Possible")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Remaining Pmt. Disc. Possible"; Rec."Remaining Pmt. Disc. Possible")
- {
- ApplicationArea = Basic, Suite;
- trigger OnValidate()
- begin
- RecalcApplnAmount();
- end;
- }
-#pragma warning disable AA0100
- field("CalcApplnRemainingAmount(""Remaining Pmt. Disc. Possible"")"; CalcApplnRemainingAmount(Rec."Remaining Pmt. Disc. Possible"))
-#pragma warning restore AA0100
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Appln. Pmt. Disc. Possible';
- ToolTip = 'Specifies the discount that the customer can obtain if the entry is applied to before the payment discount date.';
- }
- field("Max. Payment Tolerance"; Rec."Max. Payment Tolerance")
- {
- ApplicationArea = Basic, Suite;
- }
- field("External Document No."; Rec."External Document No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Your Reference"; Rec."Your Reference")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field(Open; Rec.Open)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field(Positive; Rec.Positive)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Payments in Process"; Rec."Payments in Process")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the total amount of payments/collections in process.';
- }
- field("Global Dimension 1 Code"; Rec."Global Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
- }
- field("Global Dimension 2 Code"; Rec."Global Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
- }
- }
- group(Control41)
- {
- ShowCaption = false;
- fixed(Control1903222401)
- {
- ShowCaption = false;
- group("Appln. Currency")
- {
- Caption = 'Appln. Currency';
- field(ApplnCurrencyCode; ApplnCurrencyCode)
- {
- ApplicationArea = Suite;
- Editable = false;
- ShowCaption = false;
- TableRelation = Currency;
- ToolTip = 'Specifies the currency code that the amount will be applied in, in case of different currencies.';
- }
- }
- group(Control1903098801)
- {
- Caption = 'Amount to Apply';
- field(AmountToApply; AppliedAmount)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Amount to Apply';
- Editable = false;
- ToolTip = 'Specifies the sum of the amounts on all the selected customer ledger entries that will be applied by the entry shown in the Available Amount field. The amount is in the currency represented by the code in the Currency Code field.';
- }
- }
- group("Pmt. Disc. Amount")
- {
- Caption = 'Pmt. Disc. Amount';
- field(PmtDiscountAmount; -PmtDiscAmount)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Pmt. Disc. Amount';
- Editable = false;
- ToolTip = 'Specifies the sum of the payment discount amounts granted on all the selected customer ledger entries that will be applied by the entry shown in the Available Amount field. The amount is in the currency represented by the code in the Currency Code field.';
- }
- }
- group(Rounding)
- {
- Caption = 'Rounding';
- field(ApplnRounding; ApplnRounding)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Rounding';
- Editable = false;
- ToolTip = 'Specifies the rounding difference when you apply entries in different currencies to one another. The amount is in the currency represented by the code in the Currency Code field.';
- }
- }
- group("Applied Amount")
- {
- Caption = 'Applied Amount';
- field(AppliedAmount; AppliedAmount + (-PmtDiscAmount) + ApplnRounding)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Applied Amount';
- Editable = false;
- ToolTip = 'Specifies the sum of the amounts in the Amount to Apply field, Pmt. Disc. Amount field, and the Rounding. The amount is in the currency represented by the code in the Currency Code field.';
- }
- }
- group("Available Amount")
- {
- Caption = 'Available Amount';
- field(ApplyingAmount; ApplyingAmount)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Available Amount';
- Editable = false;
- ToolTip = 'Specifies the amount of the journal entry, sales credit memo, or current customer ledger entry that you have selected as the applying entry.';
- }
- }
- group(Balance)
- {
- Caption = 'Balance';
- field(ControlBalance; AppliedAmount + (-PmtDiscAmount) + ApplyingAmount + ApplnRounding)
- {
- ApplicationArea = Basic, Suite;
- AutoFormatExpression = ApplnCurrencyCode;
- AutoFormatType = 1;
- Caption = 'Balance';
- Editable = false;
- ToolTip = 'Specifies any extra amount that will remain after the application.';
- }
- }
- }
- }
- }
- area(factboxes)
- {
- part(Control1903096107; "Customer Ledger Entry FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "Entry No." = field("Entry No.");
- Visible = true;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("Ent&ry")
- {
- Caption = 'Ent&ry';
- Image = Entry;
- action("Reminder/Fin. Charge Entries")
- {
- ApplicationArea = Suite;
- Caption = 'Reminder/Fin. Charge Entries';
- Image = Reminder;
- RunObject = Page "Reminder/Fin. Charge Entries";
- RunPageLink = "Customer Entry No." = field("Entry No.");
- RunPageView = sorting("Customer Entry No.");
- ToolTip = 'View the reminders and finance charge entries that you have entered for the customer.';
- }
- action("Applied E&ntries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Applied E&ntries';
- Image = Approve;
- RunObject = Page "Applied Customer Entries";
- RunPageOnRec = true;
- ToolTip = 'View the ledger entries that have been applied to this 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.ShowDimensions();
- end;
- }
- action("Detailed &Ledger Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Detailed &Ledger Entries';
- Image = View;
- RunObject = Page "Detailed Cust. Ledg. Entries";
- RunPageLink = "Cust. Ledger Entry No." = field("Entry No.");
- RunPageView = sorting("Cust. Ledger Entry No.", "Posting Date");
- ShortCutKey = 'Ctrl+F7';
- ToolTip = 'View a summary of the all posted entries and adjustments related to a specific customer ledger entry.';
- }
- action("&Navigate")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Find entries...';
- Image = Navigate;
- ShortCutKey = 'Ctrl+Alt+Q';
- ToolTip = 'Find entries and documents that exist for the document number and posting date on the selected document. (Formerly this action was named Navigate.)';
-
- trigger OnAction()
- begin
- Navigate.SetDoc(Rec."Posting Date", Rec."Document No.");
- Navigate.Run();
- end;
- }
- }
- }
- area(processing)
- {
- group("&Application")
- {
- Caption = '&Application';
- Image = Apply;
- action("Set Applies-to ID")
- {
- ApplicationArea = Basic, Suite;
- Visible = AppliesToIDVisible;
- Caption = 'Set Applies-to ID';
- Image = SelectLineToApply;
- ShortCutKey = 'Shift+F11';
- ToolTip = 'Set the Applies-to ID field on the posted entry to automatically be filled in with the document number of the entry in the journal.';
-
- trigger OnAction()
- begin
- if (CalcType = CalcType::"Gen. Jnl. Line") and (ApplnType = ApplnType::"Applies-to Doc. No.") then
- Error(CannotSetAppliesToIDErr);
-
- SetCustApplId(false);
- end;
- }
- action("Post Application")
- {
- ApplicationArea = Basic, Suite;
- Visible = CalledFromEntry;
- Caption = 'Post Application';
- Ellipsis = true;
- Image = PostApplication;
- ShortCutKey = 'F9';
- ToolTip = 'Define the document number of the ledger entry to use to perform the application. In addition, you specify the Posting Date for the application.';
-
- trigger OnAction()
- begin
- PostDirectApplication(false);
- end;
- }
- action(Preview)
- {
- ApplicationArea = Basic, Suite;
- Visible = CalledFromEntry;
- 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
- PostDirectApplication(true);
- end;
- }
- separator("-")
- {
- Caption = '-';
- }
- action("Show Only Selected Entries to Be Applied")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Show Only Selected Entries to Be Applied';
- Image = ShowSelected;
- ToolTip = 'View the selected ledger entries that will be applied to the specified record.';
-
- trigger OnAction()
- begin
- ShowAppliedEntries := not ShowAppliedEntries;
- if ShowAppliedEntries then
- if CalcType = CalcType::"Gen. Jnl. Line" then
- Rec.SetRange("Applies-to ID", GenJnlLine."Applies-to ID")
- else begin
- CustEntryApplID := UserId;
- if CustEntryApplID = '' then
- CustEntryApplID := '***';
- Rec.SetRange("Applies-to ID", CustEntryApplID);
- end
- else
- Rec.SetRange("Applies-to ID");
- end;
- }
- }
- action(ShowPostedDocument)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Show Posted Document';
- Image = Document;
- ToolTip = 'Show details for the posted payment, invoice, or credit memo.';
-
- trigger OnAction()
- begin
- Rec.ShowDoc();
- end;
- }
- action(ShowDocumentAttachment)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Show Document Attachment';
- Enabled = HasDocumentAttachment;
- Image = Attach;
- ToolTip = 'View documents or images that are attached to the posted invoice or credit memo.';
-
- trigger OnAction()
- begin
- Rec.ShowPostedDocAttachment();
- end;
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- actionref("Set Applies-to ID_Promoted"; "Set Applies-to ID")
- {
- }
- actionref("Post Application_Promoted"; "Post Application")
- {
- }
- actionref(Preview_Promoted; Preview)
- {
- }
- actionref("Show Only Selected Entries to Be Applied_Promoted"; "Show Only Selected Entries to Be Applied")
- {
- }
- group(Category_Category4)
- {
- Caption = 'Line', Comment = 'Generated from the PromotedActionCategories property index 3.';
- ShowAs = SplitButton;
-
- actionref(ShowPostedDocument_Promoted; ShowPostedDocument)
- {
- }
- actionref(ShowDocumentAttachment_Promoted; ShowDocumentAttachment)
- {
- }
- }
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- group(Category_Category5)
- {
- Caption = 'Entry', Comment = 'Generated from the PromotedActionCategories property index 4.';
-
- actionref("&Navigate_Promoted"; "&Navigate")
- {
- }
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref("Reminder/Fin. Charge Entries_Promoted"; "Reminder/Fin. Charge Entries")
- {
- }
- actionref("Applied E&ntries_Promoted"; "Applied E&ntries")
- {
- }
- actionref("Detailed &Ledger Entries_Promoted"; "Detailed &Ledger Entries")
- {
- }
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- begin
- if ApplnType = ApplnType::"Applies-to Doc. No." then
- CalcApplnAmount();
- HasDocumentAttachment := Rec.HasPostedDocAttachment();
- end;
-
- trigger OnAfterGetRecord()
- begin
- StyleTxt := Rec.SetStyle();
- end;
-
- trigger OnInit()
- begin
- AppliesToIDVisible := true;
- end;
-
- trigger OnModifyRecord(): Boolean
- begin
- CODEUNIT.Run(CODEUNIT::"Cust. Entry-Edit", Rec);
- if Rec."Applies-to ID" <> xRec."Applies-to ID" then
- CalcApplnAmount();
- exit(false);
- end;
-
- trigger OnOpenPage()
- begin
- if CalcType = CalcType::Direct then begin
- Cust.Get(Rec."Customer No.");
- ApplnCurrencyCode := Cust."Currency Code";
- FindApplyingEntry();
- end;
-
- ActivateFields();
-
- SalesSetup.Get();
- CustNameVisible := SalesSetup."Copy Customer Name to Entries";
-
- AppliesToIDVisible := ApplnType <> ApplnType::"Applies-to Doc. No.";
-
- GLSetup.Get();
-
- if ApplnType = ApplnType::"Applies-to Doc. No." then
- CalcApplnAmount();
- PostingDone := false;
-
- OnAfterOnOpenPage(GenJnlLine, Rec, TempApplyingCustLedgEntry);
- end;
-
- trigger OnQueryClosePage(CloseAction: Action): Boolean
- var
- RaiseError: Boolean;
- begin
- if CloseAction = ACTION::LookupOK then
- LookupOKOnPush();
- if ApplnType = ApplnType::"Applies-to Doc. No." then begin
- if OK then begin
- RaiseError := TempApplyingCustLedgEntry."Posting Date" < Rec."Posting Date";
- OnBeforeEarlierPostingDateError(TempApplyingCustLedgEntry, Rec, RaiseError, CalcType.AsInteger(), OK);
- if RaiseError then begin
- OK := false;
- Error(
- EarlierPostingDateErr, TempApplyingCustLedgEntry."Document Type", TempApplyingCustLedgEntry."Document No.",
- Rec."Document Type", Rec."Document No.");
- end;
- OnQueryClosePageOnAfterEarlierPostingDateTest(TempApplyingCustLedgEntry, Rec, CalcType, OK);
- end;
- if OK then begin
- if Rec."Amount to Apply" = 0 then
- Rec."Amount to Apply" := Rec."Remaining Amount";
- CODEUNIT.Run(CODEUNIT::"Cust. Entry-Edit", Rec);
- end;
- end;
- if (CalcType = CalcType::Direct) and not OK and not PostingDone then begin
- Rec := TempApplyingCustLedgEntry;
- Rec."Applying Entry" := false;
- if AppliesToID = '' then begin
- Rec."Applies-to ID" := '';
- Rec."Amount to Apply" := 0;
- end;
-
- OnOnQueryClosePageOnBeforeRunCustEntryEdit(Rec);
- CODEUNIT.Run(CODEUNIT::"Cust. Entry-Edit", Rec);
- end;
- end;
-
- var
- Cust: Record Customer;
- GLSetup: Record "General Ledger Setup";
- SalesSetup: Record "Sales & Receivables Setup";
- TotalSalesLine: Record "Sales Line";
- TotalSalesLineLCY: Record "Sales Line";
- CustEntrySetApplID: Codeunit "Cust. Entry-SetAppl.ID";
- GenJnlApply: Codeunit "Gen. Jnl.-Apply";
- SalesPost: Codeunit "Sales-Post";
- PaymentToleranceMgt: Codeunit "Payment Tolerance Management";
- Navigate: Page Navigate;
- StyleTxt: Text;
- AppliesToID: Code[50];
- CustomAppliesToID: Code[50];
- TimesSetCustomAppliesToID: Integer;
- ValidExchRate: Boolean;
- MustSelectEntryErr: Label 'You must select an applying entry before you can post the application.';
- PostingInWrongContextErr: Label 'You must post the application from the window where you entered the applying entry.';
- CannotSetAppliesToIDErr: Label 'You cannot set Applies-to ID while selecting Applies-to Doc. No.';
- ShowAppliedEntries: Boolean;
- CalledFromEntry: Boolean;
- EarlierPostingDateErr: Label 'You cannot apply and post an entry to an entry with an earlier posting date.\\Instead, post the document of type %1 with the number %2 and then apply it to the document of type %3 with the number %4.', Comment = '%1 - document type, %2 - document number,%3 - document type,%4 - document number';
- ApplicationPostedMsg: Label 'The application was successfully posted.';
-#pragma warning disable AA0470
- ApplicationDateErr: Label 'The %1 entered must not be before the %1 on the %2.';
-#pragma warning restore AA0470
- HasDocumentAttachment: Boolean;
- CustNameVisible: Boolean;
- GenJnlLineApply: Boolean;
-
- protected var
- Currency: Record Currency;
- CurrExchRate: Record "Currency Exchange Rate";
- CustLedgEntry: Record "Cust. Ledger Entry";
- TempApplyingCustLedgEntry: Record "Cust. Ledger Entry" temporary;
- AppliedCustLedgEntry: Record "Cust. Ledger Entry";
- GenJnlLine: Record "Gen. Journal Line";
- GenJnlLine2: Record "Gen. Journal Line";
- SalesHeader: Record "Sales Header";
- ApplnDate: Date;
- ApplnRoundingPrecision: Decimal;
- ApplnRounding: Decimal;
- ApplnType: Enum "Customer Apply-to Type";
- AmountRoundingPrecision: Decimal;
- VATAmount: Decimal;
- VATAmountText: Text[30];
- AppliedAmount: Decimal;
- ApplyingAmount: Decimal;
- PmtDiscAmount: Decimal;
- ApplnCurrencyCode: Code[10];
- CustEntryApplID: Code[50];
- AppliesToIDVisible: Boolean;
- DifferentCurrenciesInAppln: Boolean;
- PostingDone: Boolean;
- ProfitLCY: Decimal;
- ProfitPct: Decimal;
- CalcType: Enum "Customer Apply Calculation Type";
- OK: Boolean;
-
- ///
- /// Sets up the page to apply entries from a general journal line context.
- ///
- /// The general journal line from which to apply entries.
- /// The field number indicating the application type selection.
- procedure SetGenJnlLine(NewGenJnlLine: Record "Gen. Journal Line"; ApplnTypeSelect: Integer)
- begin
- GenJnlLine := NewGenJnlLine;
- GenJnlLineApply := true;
-
- if GenJnlLine."Account Type" = GenJnlLine."Account Type"::Customer then
- ApplyingAmount := GenJnlLine.Amount;
- if GenJnlLine."Bal. Account Type" = GenJnlLine."Bal. Account Type"::Customer then
- ApplyingAmount := -GenJnlLine.Amount;
- ApplnDate := GenJnlLine."Posting Date";
- ApplnCurrencyCode := GenJnlLine."Currency Code";
- CalcType := CalcType::"Gen. Jnl. Line";
-
- case ApplnTypeSelect of
- GenJnlLine.FieldNo("Applies-to Doc. No."):
- ApplnType := ApplnType::"Applies-to Doc. No.";
- GenJnlLine.FieldNo("Applies-to ID"):
- ApplnType := ApplnType::"Applies-to ID";
- end;
-
- SetApplyingCustLedgEntry();
- end;
-
- ///
- /// Sets up the page to apply entries from a sales header document context.
- ///
- /// The sales header document from which to apply entries.
- /// The customer ledger entry filters to apply.
- /// The field number indicating the application type selection.
- procedure SetSales(NewSalesHeader: Record "Sales Header"; var NewCustLedgEntry: Record "Cust. Ledger Entry"; ApplnTypeSelect: Integer)
- var
- TotalAdjCostLCY: Decimal;
- begin
- SalesHeader := NewSalesHeader;
- Rec.CopyFilters(NewCustLedgEntry);
-
- SalesPost.SumSalesLines(
- SalesHeader, 0, TotalSalesLine, TotalSalesLineLCY,
- VATAmount, VATAmountText, ProfitLCY, ProfitPct, TotalAdjCostLCY);
-
- case SalesHeader."Document Type" of
- SalesHeader."Document Type"::"Return Order",
- SalesHeader."Document Type"::"Credit Memo":
- ApplyingAmount := -TotalSalesLine."Amount Including VAT"
- else
- ApplyingAmount := TotalSalesLine."Amount Including VAT";
- end;
-
- ApplnDate := SalesHeader."Posting Date";
- ApplnCurrencyCode := SalesHeader."Currency Code";
- CalcType := CalcType::"Sales Header";
-
- case ApplnTypeSelect of
- SalesHeader.FieldNo("Applies-to Doc. No."):
- ApplnType := ApplnType::"Applies-to Doc. No.";
- SalesHeader.FieldNo("Applies-to ID"):
- ApplnType := ApplnType::"Applies-to ID";
- end;
-
- SetApplyingCustLedgEntry();
- end;
-
-
- ///
- /// Sets the current record to the specified customer ledger entry.
- ///
- /// The customer ledger entry to set as the current record.
- procedure SetCustLedgEntry(NewCustLedgEntry: Record "Cust. Ledger Entry")
- begin
- Rec := NewCustLedgEntry;
- end;
-
- ///
- /// Initializes the applying customer ledger entry based on the current calculation type.
- ///
- procedure SetApplyingCustLedgEntry()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetApplyingCustLedgerEntry(TempApplyingCustLedgEntry, GenJnlLine, SalesHeader, CalcType, IsHandled);
- if not IsHandled then begin
- case CalcType of
- CalcType::"Sales Header":
- SetApplyingCustledgEntrySalesHeader();
- CalcType::"Gen. Jnl. Line":
- SetApplyingCustLedgEntryGenJnlLine();
- CalcType::Direct:
- SetApplyingCustLedgEntryDirect();
- end;
-
- CalcApplnAmount();
- end;
-
- OnAfterSetApplyingCustLedgEntry(TempApplyingCustLedgEntry, GenJnlLine, SalesHeader);
- end;
-
- ///
- /// Gets the custom Applies-to ID if it was set exactly once during the session.
- ///
- /// The custom Applies-to ID or an empty string if not set or set multiple times.
- internal procedure GetCustomAppliesToID(): Code[50]
- begin
- if TimesSetCustomAppliesToID <> 1 then
- exit('');
- exit(CustomAppliesToID);
- end;
-
- local procedure UpdateCustomAppliesToIDForGenJournal(NewAppliesToID: Code[50])
- begin
- if (not GenJnlLineApply) or (ApplnType <> ApplnType::"Applies-to ID") then
- exit;
- if JournalHasDocumentNo(NewAppliesToID) then
- exit;
- if (CustomAppliesToID = '') or ((CustomAppliesToID <> '') and (CustomAppliesToID <> NewAppliesToID)) then
- TimesSetCustomAppliesToID += 1;
-
- CustomAppliesToID := NewAppliesToID;
- end;
-
- local procedure JournalHasDocumentNo(AppliesToIDCode: Code[50]): Boolean
- var
- GenJournalLine: Record "Gen. Journal Line";
- begin
- GenJournalLine.SetRange("Journal Template Name", GenJnlLine."Journal Template Name");
- GenJournalLine.SetRange("Journal Batch Name", GenJnlLine."Journal Batch Name");
- GenJournalLine.SetRange("Document No.", CopyStr(AppliesToIDCode, 1, MaxStrLen(GenJournalLine."Document No.")));
- exit(not GenJournalLine.IsEmpty());
- end;
-
- local procedure SetApplyingCustledgEntrySalesHeader()
- begin
- TempApplyingCustLedgEntry."Entry No." := 1;
- TempApplyingCustLedgEntry."Posting Date" := SalesHeader."Posting Date";
- if SalesHeader."Document Type" = SalesHeader."Document Type"::"Return Order" then
- TempApplyingCustLedgEntry."Document Type" := TempApplyingCustLedgEntry."Document Type"::"Credit Memo"
- else
- TempApplyingCustLedgEntry."Document Type" := TempApplyingCustLedgEntry."Document Type"::Invoice;
- TempApplyingCustLedgEntry."Document No." := SalesHeader."No.";
- TempApplyingCustLedgEntry."Customer No." := SalesHeader."Bill-to Customer No.";
- TempApplyingCustLedgEntry.Description := SalesHeader."Posting Description";
- TempApplyingCustLedgEntry."Currency Code" := SalesHeader."Currency Code";
- if TempApplyingCustLedgEntry."Document Type" = TempApplyingCustLedgEntry."Document Type"::"Credit Memo" then begin
- TempApplyingCustLedgEntry.Amount := -TotalSalesLine."Amount Including VAT";
- TempApplyingCustLedgEntry."Remaining Amount" := -TotalSalesLine."Amount Including VAT";
- end else begin
- TempApplyingCustLedgEntry.Amount := TotalSalesLine."Amount Including VAT";
- TempApplyingCustLedgEntry."Remaining Amount" := TotalSalesLine."Amount Including VAT";
- end;
-
- OnAfterSetApplyingCustLedgEntrySalesHeader(TempApplyingCustLedgEntry, SalesHeader);
- end;
-
-
- local procedure SetApplyingCustLedgEntryGenJnlLine()
- var
- Customer: Record Customer;
- begin
- TempApplyingCustLedgEntry."Entry No." := 1;
- TempApplyingCustLedgEntry."Posting Date" := GenJnlLine."Posting Date";
- TempApplyingCustLedgEntry."Document Type" := GenJnlLine."Document Type";
- TempApplyingCustLedgEntry."Document No." := GenJnlLine."Document No.";
- if GenJnlLine."Bal. Account Type" = GenJnlLine."Account Type"::Customer then begin
- TempApplyingCustLedgEntry."Customer No." := GenJnlLine."Bal. Account No.";
- Customer.Get(TempApplyingCustLedgEntry."Customer No.");
- TempApplyingCustLedgEntry.Description := Customer.Name;
- end else begin
- TempApplyingCustLedgEntry."Customer No." := GenJnlLine."Account No.";
- TempApplyingCustLedgEntry.Description := GenJnlLine.Description;
- end;
- TempApplyingCustLedgEntry."Currency Code" := GenJnlLine."Currency Code";
- TempApplyingCustLedgEntry.Amount := GenJnlLine.Amount;
- TempApplyingCustLedgEntry."Remaining Amount" := GenJnlLine.Amount;
-
- OnAfterSetApplyingCustLedgEntryGenJnlLine(TempApplyingCustLedgEntry, GenJnlLine);
- end;
-
- local procedure SetApplyingCustledgEntryDirect()
- begin
- if Rec."Applying Entry" then begin
- if TempApplyingCustLedgEntry."Entry No." <> 0 then
- CustLedgEntry := TempApplyingCustLedgEntry;
- CODEUNIT.Run(CODEUNIT::"Cust. Entry-Edit", Rec);
- if Rec."Applies-to ID" = '' then
- SetCustApplId(false);
- Rec.CalcFields(Amount);
- TempApplyingCustLedgEntry := Rec;
- if CustLedgEntry."Entry No." <> 0 then begin
- Rec := CustLedgEntry;
- Rec."Applying Entry" := false;
- SetCustApplId(false);
- end;
- Rec.SetFilter("Entry No.", '<> %1', TempApplyingCustLedgEntry."Entry No.");
- ApplyingAmount := TempApplyingCustLedgEntry."Remaining Amount";
- ApplnDate := TempApplyingCustLedgEntry."Posting Date";
- ApplnCurrencyCode := TempApplyingCustLedgEntry."Currency Code";
- end;
- OnSetApplyingCustLedgEntryOnBeforeCalcTypeDirectCalcApplnAmount(Rec, ApplyingAmount, TempApplyingCustLedgEntry);
- end;
-
- ///
- /// Sets the Applies-to ID on selected customer ledger entries for application.
- ///
- /// Indicates whether to apply only to the current record or to all selected records.
- procedure SetCustApplId(CurrentRec: Boolean)
- begin
- CurrPage.SetSelectionFilter(CustLedgEntry);
- CheckCustLedgEntry(CustLedgEntry);
-
- OnSetCustApplIdOnAfterCheckAgainstApplnCurrency(Rec, CustLedgEntry, CalcType.AsInteger(), GenJnlLine, SalesHeader, TempApplyingCustLedgEntry);
- SetCustEntryApplID(CurrentRec);
-
- CalcApplnAmount();
- end;
-
- local procedure SetCustEntryApplID(CurrentRec: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSetCustEntryApplID(Rec, CurrentRec, ApplyingAmount, TempApplyingCustLedgEntry, GetAppliesToID(), IsHandled, GenJnlLine);
- if IsHandled then
- exit;
-
- CustLedgEntry.Copy(Rec);
- if CurrentRec then begin
- CustLedgEntry.SetRecFilter();
- CustEntrySetApplID.SetApplId(CustLedgEntry, TempApplyingCustLedgEntry, Rec."Applies-to ID")
- end else begin
- CurrPage.SetSelectionFilter(CustLedgEntry);
- CustEntrySetApplID.SetApplId(CustLedgEntry, TempApplyingCustLedgEntry, GetAppliesToID())
- end;
- end;
-
- ///
- /// Validates that selected customer ledger entries can be applied against the applying entry.
- ///
- /// The customer ledger entries to validate.
- procedure CheckCustLedgEntry(var CustLedgerEntry: Record "Cust. Ledger Entry")
- var
- RaiseError: Boolean;
- begin
- if CustLedgerEntry.FindSet() then
- repeat
- if CalcType = CalcType::"Gen. Jnl. Line" then begin
- RaiseError := TempApplyingCustLedgEntry."Posting Date" < CustLedgerEntry."Posting Date";
- OnBeforeEarlierPostingDateError(TempApplyingCustLedgEntry, CustLedgerEntry, RaiseError, CalcType.AsInteger(), OK);
- if RaiseError then
- Error(
- EarlierPostingDateErr, TempApplyingCustLedgEntry."Document Type", TempApplyingCustLedgEntry."Document No.",
- CustLedgerEntry."Document Type", CustLedgerEntry."Document No.");
-
- OnCheckCustLedgEntryOnAfterEarlierPostingDateTest(TempApplyingCustLedgEntry, Rec, CalcType, OK);
- end;
-
- OnCheckCustLedgEntryOnBeforeCheckAgainstApplnCurrency(CustLedgerEntry, GenJnlLine, TempApplyingCustLedgEntry, CalcType);
-
- if TempApplyingCustLedgEntry."Entry No." <> 0 then begin
- OnCheckCustLedgEntryOnBeforeCheckAgainstApplnCurrencyWhenEntryNoIsNotNull(CustLedgerEntry, GenJnlLine);
- GenJnlApply.CheckAgainstApplnCurrency(
- ApplnCurrencyCode, CustLedgerEntry."Currency Code", GenJnlLine."Account Type"::Customer, true);
- end;
- until CustLedgerEntry.Next() = 0;
- end;
-
- local procedure GetAppliesToID() AppliesToID: Code[50]
- begin
- case CalcType of
- CalcType::"Gen. Jnl. Line":
- AppliesToID := GenJnlLine."Applies-to ID";
- CalcType::"Sales Header":
- AppliesToID := SalesHeader."Applies-to ID";
- end;
- OnAfterGetAppliesToID(CalcType, AppliesToID);
- end;
-
- ///
- /// Calculates the application amounts including applied amount, payment discount, and rounding.
- ///
- procedure CalcApplnAmount()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCalcApplnAmount(
- Rec, GenJnlLine, SalesHeader, AppliedCustLedgEntry, CalcType.AsInteger(), ApplnType.AsInteger(), IsHandled);
- if not IsHandled then begin
- AppliedAmount := 0;
- PmtDiscAmount := 0;
- DifferentCurrenciesInAppln := false;
-
- case CalcType of
- CalcType::Direct:
- begin
- FindAmountRounding();
- CustEntryApplID := UserId;
- if CustEntryApplID = '' then
- CustEntryApplID := '***';
-
- CustLedgEntry := TempApplyingCustLedgEntry;
-
- AppliedCustLedgEntry.SetCurrentKey("Customer No.", Open, Positive);
- AppliedCustLedgEntry.SetRange("Customer No.", Rec."Customer No.");
- AppliedCustLedgEntry.SetRange(Open, true);
- if AppliesToID = '' then
- AppliedCustLedgEntry.SetRange("Applies-to ID", CustEntryApplID)
- else
- AppliedCustLedgEntry.SetRange("Applies-to ID", AppliesToID);
-
- if TempApplyingCustLedgEntry."Entry No." <> 0 then begin
- CustLedgEntry.CalcFields("Remaining Amount");
- AppliedCustLedgEntry.SetFilter("Entry No.", '<>%1', TempApplyingCustLedgEntry."Entry No.");
- end;
-
- HandleChosenEntries(
- CalcType::Direct, CustLedgEntry."Remaining Amount", CustLedgEntry."Currency Code", CustLedgEntry."Posting Date");
- end;
- CalcType::"Gen. Jnl. Line":
- begin
- FindAmountRounding();
- if GenJnlLine."Bal. Account Type" = GenJnlLine."Bal. Account Type"::Customer then
- CODEUNIT.Run(CODEUNIT::"Exchange Acc. G/L Journal Line", GenJnlLine);
-
- case ApplnType of
- ApplnType::"Applies-to Doc. No.":
- begin
- AppliedCustLedgEntry := Rec;
- AppliedCustLedgEntry.CalcFields("Remaining Amount");
- if AppliedCustLedgEntry."Currency Code" <> ApplnCurrencyCode then
- AppliedCustLedgEntry.UpdateAmountsForApplication(ApplnDate, ApplnCurrencyCode, false, false);
-
- OnCalcApplnAmountOnCalcTypeGenJnlLineOnApplnTypeToDocNoOnBeforeSetAppliedAmount(Rec, ApplnDate, ApplnCurrencyCode);
- if AppliedCustLedgEntry."Amount to Apply" <> 0 then
- AppliedAmount := Round(AppliedCustLedgEntry."Amount to Apply", AmountRoundingPrecision)
- else
- AppliedAmount := Round(AppliedCustLedgEntry."Remaining Amount", AmountRoundingPrecision);
- OnCalcApplnAmountOnCalcTypeGenJnlLineOnApplnTypeToDocNoOnAfterSetAppliedAmount(Rec, ApplnDate, ApplnCurrencyCode, AppliedAmount);
-
- if PaymentToleranceMgt.CheckCalcPmtDiscGenJnlCust(
- GenJnlLine, AppliedCustLedgEntry, 0, false) and
- ((Abs(GenJnlLine.Amount) + ApplnRoundingPrecision >=
- Abs(AppliedAmount - AppliedCustLedgEntry.GetRemainingPmtDiscPossible(GenJnlLine."Posting Date"))) or
- (GenJnlLine.Amount = 0))
- then
- PmtDiscAmount := AppliedCustLedgEntry.GetRemainingPmtDiscPossible(GenJnlLine."Posting Date");
-
- if not DifferentCurrenciesInAppln then
- DifferentCurrenciesInAppln := ApplnCurrencyCode <> AppliedCustLedgEntry."Currency Code";
- CheckRounding();
- end;
- ApplnType::"Applies-to ID":
- begin
- GenJnlLine2 := GenJnlLine;
- AppliedCustLedgEntry.SetCurrentKey("Customer No.", Open, Positive);
- AppliedCustLedgEntry.SetRange("Customer No.", GenJnlLine."Account No.");
- AppliedCustLedgEntry.SetRange(Open, true);
- AppliedCustLedgEntry.SetRange("Applies-to ID", GenJnlLine."Applies-to ID");
-
- HandleChosenEntries(
- CalcType::"Gen. Jnl. Line", GenJnlLine2.Amount, GenJnlLine2."Currency Code", GenJnlLine2."Posting Date");
- end;
- end;
- end;
- CalcType::"Sales Header", CalcType::"Service Header":
- begin
- FindAmountRounding();
-
- case ApplnType of
- ApplnType::"Applies-to Doc. No.":
- begin
- AppliedCustLedgEntry := Rec;
- AppliedCustLedgEntry.CalcFields("Remaining Amount");
-
- if AppliedCustLedgEntry."Currency Code" <> ApplnCurrencyCode then
- AppliedCustLedgEntry."Remaining Amount" :=
- CurrExchRate.ExchangeAmtFCYToFCY(
- ApplnDate, AppliedCustLedgEntry."Currency Code", ApplnCurrencyCode, AppliedCustLedgEntry."Remaining Amount");
-
- OnCalcApplnAmountOnCalcTypeSalesHeaderOnApplnTypeToDocNoOnBeforeSetAppliedAmount(Rec, ApplnDate, ApplnCurrencyCode);
- AppliedAmount := Round(AppliedCustLedgEntry."Remaining Amount", AmountRoundingPrecision);
-
- if not DifferentCurrenciesInAppln then
- DifferentCurrenciesInAppln := ApplnCurrencyCode <> AppliedCustLedgEntry."Currency Code";
- CheckRounding();
- end;
- ApplnType::"Applies-to ID":
- begin
- AppliedCustLedgEntry.SetCurrentKey("Customer No.", Open, Positive);
- case CalcType of
- CalcType::"Sales Header":
- AppliedCustLedgEntry.SetRange("Customer No.", SalesHeader."Bill-to Customer No.");
- end;
- AppliedCustLedgEntry.SetRange(Open, true);
- AppliedCustLedgEntry.SetRange("Applies-to ID", GetAppliesToID());
-
- HandleChosenEntries(CalcType::"Sales Header", ApplyingAmount, ApplnCurrencyCode, ApplnDate);
- end;
- end;
- end;
- end;
- end;
-
- OnAfterCalcApplnAmount(Rec, AppliedAmount, ApplyingAmount, CalcType, AppliedCustLedgEntry, GenJnlLine);
- end;
-
- protected procedure CalcApplnRemainingAmount(Amount: Decimal): Decimal
- var
- ApplnRemainingAmount: Decimal;
- begin
- ValidExchRate := true;
- if ApplnCurrencyCode = Rec."Currency Code" then
- exit(Amount);
-
- if ApplnDate = 0D then
- ApplnDate := Rec."Posting Date";
- ApplnRemainingAmount :=
- CurrExchRate.ApplnExchangeAmtFCYToFCY(
- ApplnDate, Rec."Currency Code", ApplnCurrencyCode, Amount, ValidExchRate);
-
- OnAfterCalcApplnRemainingAmount(Rec, ApplnRemainingAmount);
- exit(ApplnRemainingAmount);
- end;
-
- local procedure CalcApplnAmountToApply(AmountToApply: Decimal): Decimal
- var
- ApplnAmountToApply: Decimal;
- begin
- ValidExchRate := true;
-
- if ApplnCurrencyCode = Rec."Currency Code" then
- exit(AmountToApply);
-
- if ApplnDate = 0D then
- ApplnDate := Rec."Posting Date";
- ApplnAmountToApply :=
- CurrExchRate.ApplnExchangeAmtFCYToFCY(
- ApplnDate, Rec."Currency Code", ApplnCurrencyCode, AmountToApply, ValidExchRate);
-
- OnAfterCalcApplnAmountToApply(Rec, ApplnAmountToApply);
- exit(ApplnAmountToApply);
- end;
-
- protected procedure FindAmountRounding()
- begin
- if ApplnCurrencyCode = '' then begin
- Currency.Init();
- Currency.Code := '';
- Currency.InitRoundingPrecision();
- end else
- if ApplnCurrencyCode <> Currency.Code then
- Currency.Get(ApplnCurrencyCode);
-
- AmountRoundingPrecision := Currency."Amount Rounding Precision";
- end;
-
- ///
- /// Calculates any rounding amount needed when applying entries in different currencies.
- ///
- procedure CheckRounding()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckRounding(CalcType, ApplnRounding, IsHandled);
- if IsHandled then
- exit;
-
- ApplnRounding := 0;
-
- case CalcType of
- CalcType::"Sales Header", CalcType::"Service Header":
- exit;
- CalcType::"Gen. Jnl. Line":
- if (GenJnlLine."Document Type" <> GenJnlLine."Document Type"::Payment) and
- (GenJnlLine."Document Type" <> GenJnlLine."Document Type"::Refund)
- then
- exit;
- end;
-
- if ApplnCurrencyCode = '' then
- ApplnRoundingPrecision := GLSetup."Appln. Rounding Precision"
- else begin
- if ApplnCurrencyCode <> Rec."Currency Code" then
- Currency.Get(ApplnCurrencyCode);
- ApplnRoundingPrecision := Currency."Appln. Rounding Precision";
- end;
-
- if (Abs((AppliedAmount - PmtDiscAmount) + ApplyingAmount) <= ApplnRoundingPrecision) and DifferentCurrenciesInAppln then
- ApplnRounding := -((AppliedAmount - PmtDiscAmount) + ApplyingAmount);
- end;
-
- ///
- /// Gets the current customer ledger entry record.
- ///
- /// Returns the current customer ledger entry.
- procedure GetCustLedgEntry(var CustLedgEntry: Record "Cust. Ledger Entry")
- begin
- CustLedgEntry := Rec;
- end;
-
- local procedure FindApplyingEntry()
- begin
- if CalcType = CalcType::Direct then begin
- CustEntryApplID := UserId;
- if CustEntryApplID = '' then
- CustEntryApplID := '***';
-
- CustLedgEntry.SetCurrentKey("Customer No.", "Applies-to ID", Open);
- CustLedgEntry.SetRange("Customer No.", Rec."Customer No.");
- if AppliesToID = '' then
- CustLedgEntry.SetRange("Applies-to ID", CustEntryApplID)
- else
- CustLedgEntry.SetRange("Applies-to ID", AppliesToID);
- CustLedgEntry.SetRange(Open, true);
- CustLedgEntry.SetRange("Applying Entry", true);
- OnFindFindApplyingEntryOnAfterCustLedgEntrySetFilters(Rec, CustLedgEntry);
- if CustLedgEntry.FindFirst() then begin
- CustLedgEntry.CalcFields(Amount, "Remaining Amount");
- TempApplyingCustLedgEntry := CustLedgEntry;
- Rec.SetFilter("Entry No.", '<>%1', CustLedgEntry."Entry No.");
- ApplyingAmount := CustLedgEntry."Remaining Amount";
- ApplnDate := CustLedgEntry."Posting Date";
- ApplnCurrencyCode := CustLedgEntry."Currency Code";
- end;
- OnFindApplyingEntryOnBeforeCalcApplnAmount(Rec);
- CalcApplnAmount();
- end;
- end;
-
- protected procedure HandleChosenEntries(Type: Enum "Customer Apply Calculation Type"; CurrentAmount: Decimal; CurrencyCode: Code[10]; PostingDate: Date)
- var
- TempAppliedCustLedgEntry: Record "Cust. Ledger Entry" temporary;
- PossiblePmtDisc: Decimal;
- OldPmtDisc: Decimal;
- CorrectionAmount: Decimal;
- RemainingAmountExclDiscounts: Decimal;
- CanUseDisc: Boolean;
- FromZeroGenJnl: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeHandledChosenEntries(Type.AsInteger(), CurrentAmount, CurrencyCode, PostingDate, AppliedCustLedgEntry, IsHandled, CustLedgEntry);
- if IsHandled then
- exit;
-
- if not AppliedCustLedgEntry.FindSet(false) then
- exit;
-
- repeat
- TempAppliedCustLedgEntry := AppliedCustLedgEntry;
- TempAppliedCustLedgEntry.Insert();
- OnHandleChosenEntriesOnAfterTempAppliedCustLedgEntryInsert(TempAppliedCustLedgEntry);
- until AppliedCustLedgEntry.Next() = 0;
-
- FromZeroGenJnl := (CurrentAmount = 0) and (Type = Type::"Gen. Jnl. Line");
-
- repeat
- if not FromZeroGenJnl then
- TempAppliedCustLedgEntry.SetRange(Positive, CurrentAmount < 0);
- if TempAppliedCustLedgEntry.FindFirst() then begin
- ExchangeLedgerEntryAmounts(Type, CurrencyCode, TempAppliedCustLedgEntry, PostingDate);
-
- case Type of
- Type::Direct:
- CanUseDisc := PaymentToleranceMgt.CheckCalcPmtDiscCust(CustLedgEntry, TempAppliedCustLedgEntry, 0, false, false);
- Type::"Gen. Jnl. Line":
- CanUseDisc := PaymentToleranceMgt.CheckCalcPmtDiscGenJnlCust(GenJnlLine2, TempAppliedCustLedgEntry, 0, false)
- else
- CanUseDisc := false;
- end;
-
- if CanUseDisc and
- (Abs(TempAppliedCustLedgEntry."Amount to Apply") >=
- Abs(TempAppliedCustLedgEntry."Remaining Amount" - TempAppliedCustLedgEntry.GetRemainingPmtDiscPossible(PostingDate)))
- then
- if Abs(CurrentAmount) >
- Abs(TempAppliedCustLedgEntry."Remaining Amount" - TempAppliedCustLedgEntry.GetRemainingPmtDiscPossible(PostingDate))
- then begin
- PmtDiscAmount += TempAppliedCustLedgEntry.GetRemainingPmtDiscPossible(PostingDate);
- CurrentAmount += TempAppliedCustLedgEntry."Remaining Amount" - TempAppliedCustLedgEntry.GetRemainingPmtDiscPossible(PostingDate);
- end else
- if Abs(CurrentAmount) =
- Abs(TempAppliedCustLedgEntry."Remaining Amount" - TempAppliedCustLedgEntry.GetRemainingPmtDiscPossible(PostingDate))
- then begin
- PmtDiscAmount += TempAppliedCustLedgEntry.GetRemainingPmtDiscPossible(PostingDate);
- CurrentAmount +=
- TempAppliedCustLedgEntry."Remaining Amount" - TempAppliedCustLedgEntry.GetRemainingPmtDiscPossible(PostingDate);
- AppliedAmount += CorrectionAmount;
- end else
- if FromZeroGenJnl then begin
- PmtDiscAmount += TempAppliedCustLedgEntry.GetRemainingPmtDiscPossible(PostingDate);
- CurrentAmount +=
- TempAppliedCustLedgEntry."Remaining Amount" - TempAppliedCustLedgEntry.GetRemainingPmtDiscPossible(PostingDate);
- end else begin
- PossiblePmtDisc := TempAppliedCustLedgEntry.GetRemainingPmtDiscPossible(PostingDate);
- RemainingAmountExclDiscounts :=
- TempAppliedCustLedgEntry."Remaining Amount" - PossiblePmtDisc - TempAppliedCustLedgEntry."Max. Payment Tolerance";
- if Abs(CurrentAmount) + Abs(CalcOppositeEntriesAmount(TempAppliedCustLedgEntry)) >=
- Abs(RemainingAmountExclDiscounts)
- then begin
- PmtDiscAmount += PossiblePmtDisc;
- AppliedAmount += CorrectionAmount;
- end;
- CurrentAmount +=
- TempAppliedCustLedgEntry."Remaining Amount" - TempAppliedCustLedgEntry.GetRemainingPmtDiscPossible(PostingDate);
- end
- else begin
- if ((CurrentAmount + TempAppliedCustLedgEntry."Amount to Apply") * CurrentAmount) <= 0 then
- AppliedAmount += CorrectionAmount;
- CurrentAmount += TempAppliedCustLedgEntry."Amount to Apply";
- end;
- end else begin
- TempAppliedCustLedgEntry.SetRange(Positive);
- TempAppliedCustLedgEntry.FindFirst();
- ExchangeLedgerEntryAmounts(Type, CurrencyCode, TempAppliedCustLedgEntry, PostingDate);
- end;
-
- if OldPmtDisc <> PmtDiscAmount then
- AppliedAmount += TempAppliedCustLedgEntry."Remaining Amount"
- else
- AppliedAmount += TempAppliedCustLedgEntry."Amount to Apply";
- OldPmtDisc := PmtDiscAmount;
-
- if PossiblePmtDisc <> 0 then
- CorrectionAmount := TempAppliedCustLedgEntry."Remaining Amount" - TempAppliedCustLedgEntry."Amount to Apply"
- else
- CorrectionAmount := 0;
-
- if not DifferentCurrenciesInAppln then
- DifferentCurrenciesInAppln := ApplnCurrencyCode <> TempAppliedCustLedgEntry."Currency Code";
-
- OnHandleChosenEntriesOnBeforeDeleteTempAppliedCustLedgEntry(Rec, TempAppliedCustLedgEntry, CurrencyCode);
- TempAppliedCustLedgEntry.Delete();
- TempAppliedCustLedgEntry.SetRange(Positive);
-
- until not TempAppliedCustLedgEntry.FindFirst();
- CheckRounding();
- end;
-
- local procedure AmountToApplyOnAfterValidate()
- begin
- if ApplnType <> ApplnType::"Applies-to Doc. No." then begin
- CalcApplnAmount();
- CurrPage.Update(false);
- end;
- end;
-
- local procedure RecalcApplnAmount()
- begin
- CurrPage.Update(true);
- CalcApplnAmount();
- end;
-
- local procedure LookupOKOnPush()
- begin
- OK := true;
-
- OnAfterLookupOKOnPush(OK);
- end;
-
- local procedure PostDirectApplication(PreviewMode: Boolean)
- var
- RecBeforeRunPostApplicationCustLedgerEntry: Record "Cust. Ledger Entry";
- ApplyUnapplyParameters: Record "Apply Unapply Parameters";
- NewApplyUnapplyParameters: Record "Apply Unapply Parameters";
- CustEntryApplyPostedEntries: Codeunit "CustEntry-Apply Posted Entries";
- PostApplication: Page "Post Application";
- Applied: Boolean;
- ApplicationDate: Date;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforePostDirectApplication(Rec, PreviewMode, IsHandled, TempApplyingCustLedgEntry);
- if IsHandled then
- exit;
-
- if CalcType = CalcType::Direct then begin
- if TempApplyingCustLedgEntry."Entry No." <> 0 then begin
- Rec := TempApplyingCustLedgEntry;
- IsTheApplicationValid();
- ApplicationDate := CustEntryApplyPostedEntries.GetApplicationDate(Rec);
-
- OnPostDirectApplicationBeforeSetValues(ApplicationDate);
- Clear(ApplyUnapplyParameters);
- ApplyUnapplyParameters.CopyFromCustLedgEntry(Rec);
- GLSetup.GetRecordOnce();
- ApplyUnapplyParameters."Posting Date" := ApplicationDate;
- if GLSetup."Journal Templ. Name Mandatory" then begin
- GLSetup.TestField("Apply Jnl. Template Name");
- GLSetup.TestField("Apply Jnl. Batch Name");
- ApplyUnapplyParameters."Journal Template Name" := GLSetup."Apply Jnl. Template Name";
- ApplyUnapplyParameters."Journal Batch Name" := GLSetup."Apply Jnl. Batch Name";
- end;
- PostApplication.SetParameters(ApplyUnapplyParameters);
- RecBeforeRunPostApplicationCustLedgerEntry := Rec;
- if ACTION::OK = PostApplication.RunModal() then begin
- if Rec."Entry No." <> RecBeforeRunPostApplicationCustLedgerEntry."Entry No." then
- Rec := RecBeforeRunPostApplicationCustLedgerEntry;
- PostApplication.GetParameters(NewApplyUnapplyParameters);
- if NewApplyUnapplyParameters."Posting Date" < ApplicationDate then
- Error(ApplicationDateErr, Rec.FieldCaption("Posting Date"), Rec.TableCaption());
- end else
- exit;
-
- OnPostDirectApplicationBeforeApply(GLSetup, NewApplyUnapplyParameters);
- if PreviewMode then
- CustEntryApplyPostedEntries.PreviewApply(Rec, NewApplyUnapplyParameters)
- else
- Applied := CustEntryApplyPostedEntries.Apply(Rec, NewApplyUnapplyParameters);
-
- OnPostDirectApplicationOnAfterApply(Rec, NewApplyUnapplyParameters, PreviewMode, Applied);
-
- if (not PreviewMode) and Applied then begin
- Message(ApplicationPostedMsg);
- PostingDone := true;
- CurrPage.Close();
- end;
- end else
- Error(MustSelectEntryErr);
- end else
- Error(PostingInWrongContextErr);
- end;
-
- ///
- /// Sets the Applies-to ID to use for filtering entries.
- ///
- /// The Applies-to ID value to set.
- procedure SetAppliesToID(AppliesToID2: Code[50])
- begin
- AppliesToID := AppliesToID2;
- end;
-
- ///
- /// Converts ledger entry amounts to the specified currency using the exchange rate at the posting date.
- ///
- /// The calculation type context for the exchange.
- /// The target currency code for conversion.
- /// The customer ledger entry with amounts to convert.
- /// The date to use for the exchange rate.
- procedure ExchangeLedgerEntryAmounts(Type: Enum "Customer Apply Calculation Type"; CurrencyCode: Code[10]; var CalcCustLedgEntry: Record "Cust. Ledger Entry"; PostingDate: Date)
- var
- CalculateCurrency, IsHandled : Boolean;
- begin
- CalcCustLedgEntry.CalcFields("Remaining Amount");
-
- if Type = Type::Direct then
- CalculateCurrency := TempApplyingCustLedgEntry."Entry No." <> 0
- else
- CalculateCurrency := true;
-
- IsHandled := false;
- OnExchangeLedgerEntryAmountsOnBeforeCalculateAmounts(CalcCustLedgEntry, CustLedgEntry, CurrencyCode, CalculateCurrency, IsHandled);
- if IsHandled then
- exit;
-
- if (CurrencyCode <> CalcCustLedgEntry."Currency Code") and CalculateCurrency then begin
- CalcCustLedgEntry."Remaining Amount" :=
- CurrExchRate.ExchangeAmount(
- CalcCustLedgEntry."Remaining Amount", CalcCustLedgEntry."Currency Code", CurrencyCode, PostingDate);
- CalcCustLedgEntry."Remaining Pmt. Disc. Possible" :=
- CurrExchRate.ExchangeAmount(
- CalcCustLedgEntry."Remaining Pmt. Disc. Possible", CalcCustLedgEntry."Currency Code", CurrencyCode, PostingDate);
- CalcCustLedgEntry."Amount to Apply" :=
- CurrExchRate.ExchangeAmount(
- CalcCustLedgEntry."Amount to Apply", CalcCustLedgEntry."Currency Code", CurrencyCode, PostingDate);
- end;
-
- OnAfterExchangeLedgerEntryAmounts(CalcCustLedgEntry, CustLedgEntry, CurrencyCode);
- end;
-
- local procedure IsTheApplicationValid()
- var
- ApplyToCustLedgEntry: Record "Cust. Ledger Entry";
- IsFirst, IsPositiv, ThereAreEntriesToApply : boolean;
- Counter: Integer;
- AllEntriesHaveTheSameSignErr: Label 'All entries have the same sign this will not lead to an application. Update the application by including entries with opposite sign.';
- begin
- IsFirst := true;
- ThereAreEntriesToApply := false;
- Counter := 0;
- ApplyToCustLedgEntry.SetCurrentKey("Customer No.", "Applies-to ID");
- ApplyToCustLedgEntry.SetRange("Customer No.", CustLedgEntry."Customer No.");
- ApplyToCustLedgEntry.SetRange("Applies-to ID", CustLedgEntry."Applies-to ID");
- if ApplyToCustLedgEntry.FindSet() then
- repeat
- if not IsFirst then
- ThereAreEntriesToApply := (IsPositiv <> ApplyToCustLedgEntry.Positive)
- else
- IsPositiv := ApplyToCustLedgEntry.Positive;
- IsFirst := false;
- Counter += 1;
- until (ApplyToCustLedgEntry.next() = 0) or ThereAreEntriesToApply;
- if not ThereAreEntriesToApply and (Counter > 1) then
- error(AllEntriesHaveTheSameSignErr)
- end;
-
- local procedure ActivateFields()
- begin
- CalledFromEntry := CalcType = CalcType::Direct;
- AppliesToIDVisible := ApplnType <> ApplnType::"Applies-to Doc. No.";
- end;
-
- ///
- /// Calculates the total remaining amount of entries with the opposite sign.
- ///
- /// The temporary applied customer ledger entry set to analyze.
- /// The total remaining amount of entries with opposite sign.
- procedure CalcOppositeEntriesAmount(var TempAppliedCustLedgerEntry: Record "Cust. Ledger Entry" temporary) Result: Decimal
- var
- SavedAppliedCustLedgerEntry: Record "Cust. Ledger Entry";
- CurrPosFilter: Text;
- begin
- CurrPosFilter := TempAppliedCustLedgerEntry.GetFilter(Positive);
- if CurrPosFilter <> '' then begin
- SavedAppliedCustLedgerEntry := TempAppliedCustLedgerEntry;
- TempAppliedCustLedgerEntry.SetRange(Positive, not TempAppliedCustLedgerEntry.Positive);
- if TempAppliedCustLedgerEntry.FindSet() then
- repeat
- TempAppliedCustLedgerEntry.CalcFields("Remaining Amount");
- Result += TempAppliedCustLedgerEntry."Remaining Amount";
- until TempAppliedCustLedgerEntry.Next() = 0;
- TempAppliedCustLedgerEntry.SetFilter(Positive, CurrPosFilter);
- TempAppliedCustLedgerEntry := SavedAppliedCustLedgerEntry;
- end;
- end;
-
- ///
- /// Gets the application currency code.
- ///
- /// The currency code used for the application.
- procedure GetApplnCurrencyCode(): Code[10]
- begin
- exit(ApplnCurrencyCode);
- end;
-
- ///
- /// Gets the calculation type as an integer value.
- ///
- /// The calculation type as an integer.
- procedure GetCalcType(): Integer
- begin
- exit(CalcType.AsInteger());
- end;
-
- ///
- /// Sets the calculation type for the application process.
- ///
- /// The calculation type to set.
- procedure SetCalcType(NewCalcType: Enum "Customer Apply Calculation Type")
- begin
- CalcType := NewCalcType;
- end;
-
- ///
- /// Raised after the application amount has been calculated.
- ///
- /// The customer ledger entry being applied.
- /// The calculated applied amount.
- /// The applying amount from the source document.
- /// The calculation type used.
- /// The applied customer ledger entry.
- /// The general journal line if applicable.
- [IntegrationEvent(true, false)]
- local procedure OnAfterCalcApplnAmount(CustLedgerEntry: Record "Cust. Ledger Entry"; var AppliedAmount: Decimal; var ApplyingAmount: Decimal; var CalcType: Enum "Customer Apply Calculation Type"; var AppliedCustLedgEntry: Record "Cust. Ledger Entry"; var GenJournalLine: Record "Gen. Journal Line")
- begin
- end;
-
- ///
- /// Raised after the application amount to apply has been calculated.
- ///
- /// The customer ledger entry.
- /// The calculated amount to apply.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCalcApplnAmountToApply(CustLedgerEntry: Record "Cust. Ledger Entry"; var ApplnAmountToApply: Decimal)
- begin
- end;
-
- ///
- /// Raised after the remaining application amount has been calculated.
- ///
- /// The customer ledger entry.
- /// The calculated remaining amount.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCalcApplnRemainingAmount(CustLedgerEntry: Record "Cust. Ledger Entry"; var ApplnRemainingAmount: Decimal)
- begin
- end;
-
- ///
- /// Raised after ledger entry amounts have been exchanged to the application currency.
- ///
- /// The customer ledger entry with converted amounts.
- /// The original customer ledger entry.
- /// The target currency code.
- [IntegrationEvent(false, false)]
- local procedure OnAfterExchangeLedgerEntryAmounts(var CalcCustLedgEntry: Record "Cust. Ledger Entry"; CustLedgerEntry: Record "Cust. Ledger Entry"; CurrencyCode: Code[10])
- begin
- end;
-
- ///
- /// Raised after the Applies-to ID has been retrieved.
- ///
- /// The calculation type.
- /// The Applies-to ID value.
- [IntegrationEvent(true, false)]
- local procedure OnAfterGetAppliesToID(CalcType: Enum "Customer Apply Calculation Type"; var AppliesToID: Code[50])
- begin
- end;
-
- ///
- /// Raised after the Lookup OK action has been processed.
- ///
- /// Indicates whether the lookup was successful.
- [IntegrationEvent(false, false)]
- local procedure OnAfterLookupOKOnPush(var OK: Boolean)
- begin
- end;
-
- ///
- /// Raised after the page has been opened.
- ///
- /// The general journal line if applicable.
- /// The customer ledger entry record.
- /// The applying customer ledger entry.
- [IntegrationEvent(true, false)]
- local procedure OnAfterOnOpenPage(var GenJnlLine: Record "Gen. Journal Line"; var CustLedgerEntry: Record "Cust. Ledger Entry"; var ApplyingCustLedgEntry: Record "Cust. Ledger Entry")
- begin
- end;
-
- ///
- /// Raised after the applying customer ledger entry has been set.
- ///
- /// The applying customer ledger entry.
- /// The general journal line if applicable.
- /// The sales header if applicable.
- [IntegrationEvent(true, false)]
- local procedure OnAfterSetApplyingCustLedgEntry(var ApplyingCustLedgEntry: Record "Cust. Ledger Entry"; GenJournalLine: Record "Gen. Journal Line"; SalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Raised before the application amount is calculated.
- ///
- /// The customer ledger entry.
- /// The general journal line if applicable.
- /// The sales header if applicable.
- /// The applied customer ledger entry.
- /// The calculation type option.
- /// The application type option.
- /// Set to true to skip default processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCalcApplnAmount(var CustLedgerEntry: Record "Cust. Ledger Entry"; var GenJournalLine: Record "Gen. Journal Line"; SalesHeader: Record "Sales Header"; var AppliedCustLedgerEntry: Record "Cust. Ledger Entry"; CalculationType: Option; ApplicationType: Option; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before rounding is checked for the application.
- ///
- /// The calculation type.
- /// The application rounding amount.
- /// Set to true to skip default processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckRounding(CalcType: Enum "Customer Apply Calculation Type"; var ApplnRounding: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before chosen entries are processed for application.
- ///
- /// The calculation type option.
- /// The current amount being applied.
- /// The currency code.
- /// The posting date.
- /// The applied customer ledger entries.
- /// Set to true to skip default processing.
- /// The customer ledger entry.
- [IntegrationEvent(true, false)]
- local procedure OnBeforeHandledChosenEntries(Type: Option Direct,GenJnlLine,SalesHeader; CurrentAmount: Decimal; CurrencyCode: Code[10]; PostingDate: Date; var AppliedCustLedgerEntry: Record "Cust. Ledger Entry"; var IsHandled: Boolean; var CustLedgEntry: Record "Cust. Ledger Entry")
- begin
- end;
-
- ///
- /// Raised before an error is raised for applying entries with earlier posting dates.
- ///
- /// The applying customer ledger entry.
- /// The customer ledger entry being applied to.
- /// Set to false to suppress the error.
- /// The calculation type option.
- /// Indicates whether the operation is successful.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeEarlierPostingDateError(ApplyingCustLedgerEntry: Record "Cust. Ledger Entry"; CustLedgerEntry: Record "Cust. Ledger Entry"; var RaiseError: Boolean; CalcType: Option; var OK: Boolean)
- begin
- end;
-
- ///
- /// Raised before a direct application is posted.
- ///
- /// The customer ledger entry.
- /// Indicates whether posting is in preview mode.
- /// Set to true to skip default processing.
- /// The applying customer ledger entry.
- [IntegrationEvent(true, false)]
- local procedure OnBeforePostDirectApplication(var CustLedgerEntry: Record "Cust. Ledger Entry"; PreviewMode: Boolean; var IsHandled: Boolean; var ApplyingCustLedgEntry: Record "Cust. Ledger Entry" temporary)
- begin
- end;
-
-
- ///
- /// Raised before the applying customer ledger entry is set.
- ///
- /// The applying customer ledger entry.
- /// The general journal line if applicable.
- /// The sales header if applicable.
- /// The calculation type.
- /// Set to true to skip default processing.
- [IntegrationEvent(true, false)]
- local procedure OnBeforeSetApplyingCustLedgerEntry(var ApplyingCustLedgEntry: Record "Cust. Ledger Entry"; GenJournalLine: Record "Gen. Journal Line"; SalesHeader: Record "Sales Header"; var CalcType: Enum "Customer Apply Calculation Type"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before the customer entry Applies-to ID is set.
- ///
- /// The customer ledger entry.
- /// Indicates whether applying to current record only.
- /// The applying amount.
- /// The applying customer ledger entry.
- /// The Applies-to ID.
- /// Set to true to skip default processing.
- /// The general journal line.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetCustEntryApplID(CustLedgerEntry: Record "Cust. Ledger Entry"; CurrentRec: Boolean; var ApplyingAmount: Decimal; var ApplyingCustLedgerEntry: Record "Cust. Ledger Entry"; AppliesToID: Code[50]; var IsHandled: Boolean; var GenJournalLine: Record "Gen. Journal Line")
- begin
- end;
-
- ///
- /// Raised before setting the applied amount during general journal line application to document number.
- ///
- /// The applied customer ledger entry.
- /// The application date.
- /// The application currency code.
- [IntegrationEvent(false, false)]
- local procedure OnCalcApplnAmountOnCalcTypeGenJnlLineOnApplnTypeToDocNoOnBeforeSetAppliedAmount(var AppliedCustLedgEntry: Record "Cust. Ledger Entry"; ApplnDate: Date; ApplnCurrencyCode: Code[10])
- begin
- end;
-
- ///
- /// Raised before checking against application currency during customer ledger entry validation.
- ///
- /// The customer ledger entry being validated.
- /// The general journal line.
- /// The applying customer ledger entry.
- /// The calculation type.
- [IntegrationEvent(false, false)]
- local procedure OnCheckCustLedgEntryOnBeforeCheckAgainstApplnCurrency(var CustLedgerEntry: Record "Cust. Ledger Entry"; GenJournalLine: Record "Gen. Journal Line"; var TempApplyingCustLedgEntry: Record "Cust. Ledger Entry" temporary; CalcType: Enum "Customer Apply Calculation Type")
- begin
- end;
-
- ///
- /// Raised after setting the applied amount during general journal line application to document number.
- ///
- /// The applied customer ledger entry.
- /// The application date.
- /// The application currency code.
- /// The applied amount.
- [IntegrationEvent(false, false)]
- local procedure OnCalcApplnAmountOnCalcTypeGenJnlLineOnApplnTypeToDocNoOnAfterSetAppliedAmount(var AppliedCustLedgEntry: Record "Cust. Ledger Entry"; ApplnDate: Date; ApplnCurrencyCode: Code[10]; var AppliedAmount: Decimal)
- begin
- end;
-
- ///
- /// Raised before setting the applied amount during sales header application to document number.
- ///
- /// The applied customer ledger entry.
- /// The application date.
- /// The application currency code.
- [IntegrationEvent(false, false)]
- local procedure OnCalcApplnAmountOnCalcTypeSalesHeaderOnApplnTypeToDocNoOnBeforeSetAppliedAmount(var AppliedCustLedgEntry: Record "Cust. Ledger Entry"; ApplnDate: Date; ApplnCurrencyCode: Code[10])
- begin
- end;
-
- ///
- /// Raised after filters have been set when finding the applying entry.
- ///
- /// The applying customer ledger entry.
- /// The customer ledger entry being filtered.
- [IntegrationEvent(false, false)]
- local procedure OnFindFindApplyingEntryOnAfterCustLedgEntrySetFilters(ApplyingCustLedgerEntry: Record "Cust. Ledger Entry"; var CustLedgerEntry: Record "Cust. Ledger Entry")
- begin
- end;
-
- ///
- /// Raised before calculating the application amount when finding the applying entry.
- ///
- /// The customer ledger entry.
- [IntegrationEvent(true, false)]
- local procedure OnFindApplyingEntryOnBeforeCalcApplnAmount(var CustLedgerEntry: Record "Cust. Ledger Entry")
- begin
- end;
-
- ///
- /// Raised after a temporary applied customer ledger entry has been inserted during entry handling.
- ///
- /// The temporary applied customer ledger entry.
- [IntegrationEvent(true, false)]
- local procedure OnHandleChosenEntriesOnAfterTempAppliedCustLedgEntryInsert(var TempAppliedCustLedgerEntry: Record "Cust. Ledger Entry" temporary)
- begin
- end;
-
- ///
- /// Raised before deleting a temporary applied customer ledger entry during entry handling.
- ///
- /// The applied customer ledger entry.
- /// The temporary applied customer ledger entry to delete.
- /// The currency code.
- [IntegrationEvent(false, false)]
- local procedure OnHandleChosenEntriesOnBeforeDeleteTempAppliedCustLedgEntry(var AppliedCustLedgEntry: Record "Cust. Ledger Entry"; TempAppliedCustLedgEntry: Record "Cust. Ledger Entry" temporary; CurrencyCode: Code[10])
- begin
- end;
-
-
- ///
- /// Raised after checking against application currency when setting the Applies-to ID.
- ///
- /// The customer ledger entry.
- /// The second customer ledger entry.
- /// The calculation type option.
- /// The general journal line.
- /// The sales header.
- /// The applying customer ledger entry.
- [IntegrationEvent(false, false)]
- local procedure OnSetCustApplIdOnAfterCheckAgainstApplnCurrency(var CustLedgerEntry: Record "Cust. Ledger Entry"; var CustLedgerEntry2: Record "Cust. Ledger Entry"; CalcType: Option; var GenJnlLine: Record "Gen. Journal Line"; SalesHeader: Record "Sales Header"; ApplyingCustLedgEntry: Record "Cust. Ledger Entry")
- begin
- end;
-
- ///
- /// Raised before calculating the application amount for direct calculation type.
- ///
- /// The customer ledger entry.
- /// The applying amount.
- /// The applying customer ledger entry.
- [IntegrationEvent(true, false)]
- local procedure OnSetApplyingCustLedgEntryOnBeforeCalcTypeDirectCalcApplnAmount(var CustLedgerEntry: Record "Cust. Ledger Entry"; var ApplyingAmount: Decimal; var TempApplyingCustLedgEntry: Record "Cust. Ledger Entry")
- begin
- end;
-
- ///
- /// Raised before running customer entry edit when closing the page.
- ///
- /// The customer ledger entry.
- [IntegrationEvent(true, false)]
- local procedure OnOnQueryClosePageOnBeforeRunCustEntryEdit(var CustLedgerEntry: Record "Cust. Ledger Entry")
- begin
- end;
-
- ///
- /// Raised before setting values during direct application posting.
- ///
- /// The application date.
- [IntegrationEvent(false, false)]
- local procedure OnPostDirectApplicationBeforeSetValues(var ApplicationDate: Date)
- begin
- end;
-
- ///
- /// Raised before applying during direct application posting.
- ///
- /// The general ledger setup.
- /// The apply/unapply parameters.
- [IntegrationEvent(false, false)]
- local procedure OnPostDirectApplicationBeforeApply(GLSetup: Record "General Ledger Setup"; var NewApplyUnapplyParameters: Record "Apply Unapply Parameters")
- begin
- end;
-
- ///
- /// Raised after setting the applying customer ledger entry from a sales header.
- ///
- /// The applying customer ledger entry.
- /// The sales header.
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetApplyingCustLedgEntrySalesHeader(var TempApplyingCustLedgEntry: Record "Cust. Ledger Entry" temporary; var SalesHeader: Record "Sales Header")
- begin
- end;
-
-
- ///
- /// Raised after setting the applying customer ledger entry from a general journal line.
- ///
- /// The applying customer ledger entry.
- /// The general journal line.
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetApplyingCustLedgEntryGenJnlLine(var TempApplyingCustLedgEntry: Record "Cust. Ledger Entry" temporary; var GenJnlLine: Record "Gen. Journal Line")
- begin
- end;
-
- ///
- /// Raised before calculating amounts during ledger entry exchange.
- ///
- /// The customer ledger entry for calculation.
- /// The original customer ledger entry.
- /// The currency code.
- /// Indicates whether to calculate currency conversion.
- /// Set to true to skip default processing.
- [IntegrationEvent(false, false)]
- local procedure OnExchangeLedgerEntryAmountsOnBeforeCalculateAmounts(var CalcCustLedgerEntry: Record "Cust. Ledger Entry"; CustLedgerEntry: Record "Cust. Ledger Entry"; CurrencyCode: Code[10]; CalculateCurrency: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after testing for earlier posting date during customer ledger entry check.
- ///
- /// The applying customer ledger entry.
- /// The customer ledger entry being checked.
- /// The calculation type.
- /// Indicates whether the check passed.
- [IntegrationEvent(false, false)]
- local procedure OnCheckCustLedgEntryOnAfterEarlierPostingDateTest(ApplyingCustLedgerEntry: Record "Cust. Ledger Entry"; CustLedgerEntry: Record "Cust. Ledger Entry"; CalcType: Enum "Customer Apply Calculation Type"; var OK: Boolean)
- begin
- end;
-
- ///
- /// Raised after testing for earlier posting date when closing the page.
- ///
- /// The applying customer ledger entry.
- /// The customer ledger entry.
- /// The calculation type.
- /// Indicates whether the check passed.
- [IntegrationEvent(false, false)]
- local procedure OnQueryClosePageOnAfterEarlierPostingDateTest(ApplyingCustLedgerEntry: Record "Cust. Ledger Entry"; CustLedgerEntry: Record "Cust. Ledger Entry"; CalcType: Enum "Customer Apply Calculation Type"; var OK: Boolean)
- begin
- end;
-
- ///
- /// Raised before checking against application currency when entry number is not null.
- ///
- /// The customer ledger entry.
- /// The general journal line.
- [IntegrationEvent(false, false)]
- local procedure OnCheckCustLedgEntryOnBeforeCheckAgainstApplnCurrencyWhenEntryNoIsNotNull(CustLedgerEntry: Record "Cust. Ledger Entry"; GenJournalLine: Record "Gen. Journal Line")
- begin
- end;
-
- ///
- /// Raised after the application has been posted during direct application.
- ///
- /// The customer ledger entry.
- /// The apply/unapply parameters used.
- /// Indicates whether posting was in preview mode.
- /// Indicates whether the application was successful.
- [IntegrationEvent(false, false)]
- local procedure OnPostDirectApplicationOnAfterApply(var CustLedgerEntry: Record "Cust. Ledger Entry"; var NewApplyUnapplyParameters: Record "Apply Unapply Parameters"; PreviewMode: Boolean; Applied: Boolean)
- begin
- end;
-}
\ No newline at end of file
diff --git a/src/Layers/NL/BaseApp/Sales/Receivables/CustEntryEdit.Codeunit.al b/src/Layers/NL/BaseApp/Sales/Receivables/CustEntryEdit.Codeunit.al
deleted file mode 100644
index ce3c156187..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Receivables/CustEntryEdit.Codeunit.al
+++ /dev/null
@@ -1,205 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.Receivables;
-
-using Microsoft.Sales.History;
-
-///
-/// Processes modifications to customer ledger entries, updating fields such as payment terms, due dates, and on-hold status.
-///
-codeunit 103 "Cust. Entry-Edit"
-{
- Permissions = TableData "Cust. Ledger Entry" = m,
- TableData "Detailed Cust. Ledg. Entry" = m,
- tabledata "Sales Invoice Header" = m;
-
- TableNo = "Cust. Ledger Entry";
-
- var
- CalledFromSalesInvEdit: Boolean;
-
- trigger OnRun()
- var
- LedgEntryTrackChanges: Codeunit "Ledg. Entry-Track Changes";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeOnRun(Rec, CustLedgEntry, DtldCustLedgEntry, IsHandled);
- if IsHandled then
- exit;
-
- CustLedgEntry := Rec;
- CustLedgEntry.LockTable();
- CustLedgEntry.Find();
-
- if LogFieldChanged(CustLedgEntry, Rec) then
- BindSubscription(LedgEntryTrackChanges);
-
- CustLedgEntry."On Hold" := Rec."On Hold";
- if CustLedgEntry.Open then begin
- CustLedgEntry."Due Date" := Rec."Due Date";
- DtldCustLedgEntry.SetCurrentKey("Cust. Ledger Entry No.");
- DtldCustLedgEntry.SetRange("Cust. Ledger Entry No.", CustLedgEntry."Entry No.");
- DtldCustLedgEntry.ModifyAll("Initial Entry Due Date", Rec."Due Date");
- CustLedgEntry."Pmt. Discount Date" := Rec."Pmt. Discount Date";
- CustLedgEntry."Applies-to ID" := Rec."Applies-to ID";
- CustLedgEntry.Validate("Payment Method Code", Rec."Payment Method Code");
- CustLedgEntry.Validate("Payment Reference", Rec."Payment Reference");
- CustLedgEntry.Validate("Your Reference", Rec."Your Reference");
- CustLedgEntry.Validate("Remaining Pmt. Disc. Possible", Rec."Remaining Pmt. Disc. Possible");
- CustLedgEntry."Transaction Mode Code" := Rec."Transaction Mode Code";
- CustLedgEntry."Pmt. Disc. Tolerance Date" := Rec."Pmt. Disc. Tolerance Date";
- CustLedgEntry.Validate("Max. Payment Tolerance", Rec."Max. Payment Tolerance");
- CustLedgEntry.Validate("Accepted Payment Tolerance", Rec."Accepted Payment Tolerance");
- CustLedgEntry.Validate("Accepted Pmt. Disc. Tolerance", Rec."Accepted Pmt. Disc. Tolerance");
- CustLedgEntry.Validate("Amount to Apply", Rec."Amount to Apply");
- CustLedgEntry.Validate("Applying Entry", Rec."Applying Entry");
- CustLedgEntry.Validate("Applies-to Ext. Doc. No.", Rec."Applies-to Ext. Doc. No.");
- CustLedgEntry.Validate("Message to Recipient", Rec."Message to Recipient");
- CustLedgEntry.Validate("Recipient Bank Account", Rec."Recipient Bank Account");
- CustLedgEntry."Direct Debit Mandate ID" := Rec."Direct Debit Mandate ID";
- end;
- CustLedgEntry.Description := Rec.Description;
- CustLedgEntry.Validate("Exported to Payment File", Rec."Exported to Payment File");
- CustLedgEntry.Validate("Promised Pay Date", Rec."Promised Pay Date");
- CustLedgEntry.Validate("Dispute Status", Rec."Dispute Status");
- OnBeforeCustLedgEntryModify(CustLedgEntry, Rec);
- CustLedgEntry.TestField("Entry No.", Rec."Entry No.");
- CustLedgEntry.Modify();
- OnRunOnAfterCustLedgEntryModify(Rec, CustLedgEntry);
- UpdateSalesInvoiceHeader(CustLedgEntry);
- Rec := CustLedgEntry;
- end;
-
- var
- CustLedgEntry: Record "Cust. Ledger Entry";
- DtldCustLedgEntry: Record "Detailed Cust. Ledg. Entry";
-
- ///
- /// Sets the On Hold status of a customer ledger entry.
- ///
- /// Specifies the customer ledger entry to update.
- /// Specifies the new On Hold code to set on the entry.
- procedure SetOnHold(var OnHoldCustLedgEntry: Record "Cust. Ledger Entry"; NewOnHold: Code[3])
- var
- LedgEntryTrackChanges: Codeunit "Ledg. Entry-Track Changes";
- xOnHold: Code[3];
- begin
- BindSubscription(LedgEntryTrackChanges);
-
- xOnHold := OnHoldCustLedgEntry."On Hold";
- OnHoldCustLedgEntry."On Hold" := NewOnHold;
- if xOnHold <> OnHoldCustLedgEntry."On Hold" then
- OnHoldCustLedgEntry.Modify();
- end;
-
- ///
- /// Sets a flag indicating whether the codeunit is called from a sales invoice edit operation.
- ///
- /// Specifies whether the call originates from a sales invoice edit.
- procedure SetCalledFromSalesInvoice(CalledFromSalesInvEditSet: Boolean)
- begin
- CalledFromSalesInvEdit := CalledFromSalesInvEditSet;
- end;
-
- local procedure UpdateSalesInvoiceHeader(UpdateSalesInvoiceCustLedgEntry: Record "Cust. Ledger Entry")
- var
- SalesInvoiceHeader: Record "Sales Invoice Header";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateSalesInvoiceHeader(UpdateSalesInvoiceCustLedgEntry, CalledFromSalesInvEdit, IsHandled);
- if IsHandled then
- exit;
-
- if CalledFromSalesInvEdit then
- exit;
- if UpdateSalesInvoiceCustLedgEntry."Document Type" <> UpdateSalesInvoiceCustLedgEntry."Document Type"::Invoice then
- exit;
- if not SalesInvoiceHeader.get(UpdateSalesInvoiceCustLedgEntry."Document No.") then
- exit;
-
- SalesInvoiceHeader.validate("Payment Method Code", UpdateSalesInvoiceCustLedgEntry."Payment Method Code");
- SalesInvoiceHeader.Validate("Payment Reference", UpdateSalesInvoiceCustLedgEntry."Payment Reference");
- SalesInvoiceHeader.Validate("Posting Description", UpdateSalesInvoiceCustLedgEntry.Description);
- SalesInvoiceHeader.validate("Dispute Status", UpdateSalesInvoiceCustLedgEntry."Dispute Status");
- SalesInvoiceHeader.Validate("Promised Pay Date", UpdateSalesInvoiceCustLedgEntry."Promised Pay Date");
- SalesInvoiceHeader.validate("Due Date", UpdateSalesInvoiceCustLedgEntry."Due Date");
- SalesInvoiceHeader.Modify(true);
- end;
-
-
- local procedure LogFieldChanged(CurrCustLedgerEntry: Record "Cust. Ledger Entry"; NewCustLedgerEntry: Record "Cust. Ledger Entry"): Boolean
- var
- Changed: Boolean;
- begin
- Changed :=
- (CurrCustLedgerEntry.Description <> NewCustLedgerEntry.Description) or
- (CurrCustLedgerEntry."Due Date" <> NewCustLedgerEntry."Due Date") or
- (CurrCustLedgerEntry."Payment Method Code" <> NewCustLedgerEntry."Payment Method Code") or
- (CurrCustLedgerEntry."Payment Reference" <> NewCustLedgerEntry."Payment Reference") or
- (CurrCustLedgerEntry."Message to Recipient" <> NewCustLedgerEntry."Message to Recipient") or
- (CurrCustLedgerEntry."Recipient Bank Account" <> NewCustLedgerEntry."Recipient Bank Account") or
- (CurrCustLedgerEntry."On Hold" <> NewCustLedgerEntry."On Hold") or
- (CurrCustLedgerEntry."Your Reference" <> NewCustLedgerEntry."Your Reference");
- OnAfterLogFieldChanged(CurrCustLedgerEntry, NewCustLedgerEntry, Changed);
- exit(Changed);
- end;
-
- ///
- /// Raised before the customer ledger entry is modified.
- ///
- /// The customer ledger entry that will be modified.
- /// The customer ledger entry containing the new values.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCustLedgEntryModify(var CustLedgEntry: Record "Cust. Ledger Entry"; FromCustLedgEntry: Record "Cust. Ledger Entry")
- begin
- end;
-
- ///
- /// Raised before the OnRun trigger executes to allow custom processing.
- ///
- /// The customer ledger entry record passed to the codeunit.
- /// The internal customer ledger entry record.
- /// The detailed customer ledger entry record.
- /// Set to true to skip default processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeOnRun(var CustLedgerEntryRec: Record "Cust. Ledger Entry"; var CustLedgerEntry: Record "Cust. Ledger Entry"; var DetailedCustLedgEntry: Record "Detailed Cust. Ledg. Entry"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after the customer ledger entry has been modified.
- ///
- /// The customer ledger entry record passed to the codeunit.
- /// The modified customer ledger entry.
- [IntegrationEvent(false, false)]
- local procedure OnRunOnAfterCustLedgEntryModify(var CustLedgerEntryRec: Record "Cust. Ledger Entry"; var CustLedgerEntry: Record "Cust. Ledger Entry")
- begin
- end;
-
- ///
- /// Raised after determining if fields have changed to allow additional change tracking.
- ///
- /// The current customer ledger entry.
- /// The customer ledger entry with new values.
- /// Returns whether any fields have changed.
- [IntegrationEvent(false, false)]
- local procedure OnAfterLogFieldChanged(CurrCustLedgerEntry: Record "Cust. Ledger Entry"; NewCustLedgerEntry: Record "Cust. Ledger Entry"; var Changed: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating the sales invoice header with customer ledger entry changes.
- ///
- /// The customer ledger entry with updated values.
- /// Indicates whether called from a sales invoice edit operation.
- /// Set to true to skip default processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateSalesInvoiceHeader(var UpdateSalesInvoiceCustLedgerEntry: Record "Cust. Ledger Entry"; CalledFromSalesInvEdit: Boolean; var IsHandled: Boolean)
- begin
- end;
-}
-
diff --git a/src/Layers/NL/BaseApp/Sales/Receivables/CustLedgerEntry.Table.al b/src/Layers/NL/BaseApp/Sales/Receivables/CustLedgerEntry.Table.al
deleted file mode 100644
index 033cf8387b..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Receivables/CustLedgerEntry.Table.al
+++ /dev/null
@@ -1,1862 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.Receivables;
-
-using Microsoft.Bank.BankAccount;
-using Microsoft.Bank.DirectDebit;
-using Microsoft.Bank.Payment;
-using Microsoft.CRM.Team;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Ledger;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.FixedAssets.FixedAsset;
-using Microsoft.Foundation.Attachment;
-using Microsoft.Foundation.AuditCodes;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Intercompany.Partner;
-using Microsoft.Purchases.Vendor;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.FinanceCharge;
-using Microsoft.Sales.History;
-using Microsoft.Sales.Reminder;
-using Microsoft.Utilities;
-using System.Security.AccessControl;
-using System.Utilities;
-
-///
-/// Stores customer ledger entries representing all financial transactions posted to customer accounts, including invoices, payments, credit memos, and finance charges.
-///
-table 21 "Cust. Ledger Entry"
-{
- Caption = 'Cust. Ledger Entry';
- DrillDownPageID = "Customer Ledger Entries";
- LookupPageID = "Customer Ledger Entries";
- Permissions = tabledata "Reminder/Fin. Charge Entry" = R;
- DataClassification = CustomerContent;
-
- fields
- {
- ///
- /// Specifies the unique sequential number assigned to this customer ledger entry.
- ///
- field(1; "Entry No."; Integer)
- {
- Caption = 'Entry No.';
- ToolTip = 'Specifies the number of the entry, as assigned from the specified number series when the entry was created.';
- }
- ///
- /// Specifies the customer account number associated with this ledger entry.
- ///
- field(3; "Customer No."; Code[20])
- {
- Caption = 'Customer No.';
- TableRelation = Customer;
- ToolTip = 'Specifies the customer account number that the entry is linked to.';
- }
- ///
- /// Specifies the date when the transaction was posted to the general ledger.
- ///
- field(4; "Posting Date"; Date)
- {
- Caption = 'Posting Date';
- ToolTip = 'Specifies the customer entry''s posting date.';
- }
- ///
- /// Specifies the type of document that created this entry, such as Invoice, Credit Memo, Payment, or Reminder.
- ///
- field(5; "Document Type"; Enum "Gen. Journal Document Type")
- {
- Caption = 'Document Type';
- ToolTip = 'Specifies the document type that the customer entry belongs to.';
- }
- ///
- /// Specifies the document number of the source document that generated this entry.
- ///
- field(6; "Document No."; Code[20])
- {
- Caption = 'Document No.';
- ToolTip = 'Specifies the entry''s document number.';
-
- trigger OnLookup()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.HyperlinkToDocument("Document No.", "Posting Date");
- end;
- }
- ///
- /// Specifies a text description of the transaction represented by this entry.
- ///
- field(7; Description; Text[100])
- {
- Caption = 'Description';
- ToolTip = 'Specifies a description of the customer entry.';
- }
- ///
- /// Specifies the name of the customer associated with this ledger entry.
- ///
- field(8; "Customer Name"; Text[100])
- {
- Caption = 'Customer Name';
- ToolTip = 'Specifies the customer name that the entry is linked to.';
- }
- ///
- /// Specifies the customer's own reference number for the transaction.
- ///
- field(10; "Your Reference"; Text[35])
- {
- Caption = 'Your Reference';
- DataClassification = CustomerContent;
- ToolTip = 'Specifies the customer''s reference.';
- }
- ///
- /// Specifies the currency in which the transaction amount is expressed.
- ///
- field(11; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- TableRelation = Currency;
- ToolTip = 'Specifies the currency code for the amount on the line.';
- }
- ///
- /// Contains the total transaction amount in the original currency, calculated from detailed ledger entries.
- ///
- field(13; Amount; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Cust. Ledg. Entry".Amount where("Ledger Entry Amount" = const(true),
- "Cust. Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Amount';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies the amount of the entry.';
- }
- ///
- /// Contains the outstanding balance that has not yet been applied or paid, in the original currency.
- ///
- field(14; "Remaining Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Cust. Ledg. Entry".Amount where("Cust. Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Remaining Amount';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies the amount that remains to be applied to before the entry has been completely applied.';
- }
- ///
- /// Contains the original transaction amount in local currency when the entry was first created.
- ///
- field(15; "Original Amt. (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Cust. Ledger Entry No." = field("Entry No."),
- "Entry Type" = filter("Initial Entry"),
- "Posting Date" = field("Date Filter")));
- Caption = 'Original Amt. (LCY)';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies the amount that the entry originally consisted of, in LCY.';
- }
- ///
- /// Contains the outstanding balance that has not yet been applied or paid, expressed in local currency.
- ///
- field(16; "Remaining Amt. (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Cust. Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Remaining Amt. (LCY)';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies the amount that remains to be applied to before the entry is totally applied to.';
- }
- ///
- /// Contains the total transaction amount expressed in local currency, calculated from detailed ledger entries.
- ///
- field(17; "Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Amount (LCY)" where("Ledger Entry Amount" = const(true),
- "Cust. Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Amount (LCY)';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies the amount of the entry in LCY.';
- }
- ///
- /// Stores the total sales amount excluding VAT in local currency for statistical purposes.
- ///
- field(18; "Sales (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Sales (LCY)';
- ToolTip = 'Specifies the total sales amount excl. VAT to the customer in LCY.';
- }
- ///
- /// Stores the profit amount from the sales transaction in local currency.
- ///
- field(19; "Profit (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Profit (LCY)';
- }
- ///
- /// Stores the invoice discount amount granted to the customer in local currency.
- ///
- field(20; "Inv. Discount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Inv. Discount (LCY)';
- }
- ///
- /// Specifies the customer who purchased the goods or services, which may differ from the bill-to customer.
- ///
- field(21; "Sell-to Customer No."; Code[20])
- {
- Caption = 'Sell-to Customer No.';
- TableRelation = Customer;
- }
- ///
- /// Specifies the posting group that determines the general ledger accounts used for posting customer transactions.
- ///
- field(22; "Customer Posting Group"; Code[20])
- {
- Caption = 'Customer Posting Group';
- TableRelation = "Customer Posting Group";
- ToolTip = 'Specifies the customer''s market type to link business transactions to.';
- }
- ///
- /// Specifies the first global dimension value used for analysis and reporting of this entry.
- ///
- field(23; "Global Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,1,1';
- Caption = 'Global Dimension 1 Code';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1));
- ToolTip = 'Specifies the code for the global dimension that is linked to the record or entry for analysis purposes. Two global dimensions, typically for the company''s most important activities, are available on all cards, documents, reports, and lists.';
- }
- ///
- /// Specifies the second global dimension value used for analysis and reporting of this entry.
- ///
- field(24; "Global Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,1,2';
- Caption = 'Global Dimension 2 Code';
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2));
- ToolTip = 'Specifies the code for the global dimension that is linked to the record or entry for analysis purposes. Two global dimensions, typically for the company''s most important activities, are available on all cards, documents, reports, and lists.';
- }
- ///
- /// Specifies the salesperson responsible for the customer or the transaction.
- ///
- field(25; "Salesperson Code"; Code[20])
- {
- Caption = 'Salesperson Code';
- TableRelation = "Salesperson/Purchaser";
- ToolTip = 'Specifies the code for the salesperson whom the entry is linked to.';
- }
- ///
- /// Specifies the user who posted this ledger entry for audit trail purposes.
- ///
- field(27; "User ID"; Code[50])
- {
- Caption = 'User ID';
- DataClassification = EndUserIdentifiableInformation;
- TableRelation = User."User Name";
- ValidateTableRelation = false;
- ToolTip = 'Specifies the ID of the user who posted the entry, to be used, for example, in the change log.';
- }
- ///
- /// Specifies the source code identifying the origin of the transaction, such as Sales Journal or Cash Receipt.
- ///
- field(28; "Source Code"; Code[10])
- {
- Caption = 'Source Code';
- TableRelation = "Source Code";
- ToolTip = 'Specifies the source code that specifies where the entry was created.';
- }
- ///
- /// Indicates that this entry is excluded from payment suggestions, reminders, or finance charge calculations.
- ///
- field(33; "On Hold"; Code[3])
- {
- Caption = 'On Hold';
- ToolTip = 'Specifies that the related entry represents an unpaid invoice for which either a payment suggestion, a reminder, or a finance charge memo exists.';
-
- trigger OnValidate()
- var
- GenJournalLine: Record "Gen. Journal Line";
- begin
- if "On Hold" = xRec."On Hold" then
- exit;
- GenJournalLine.Reset();
- GenJournalLine.SetLoadFields("On Hold");
- GenJournalLine.SetRange("Account Type", GenJournalLine."Account Type"::Customer);
- GenJournalLine.SetRange("Account No.", "Customer No.");
- GenJournalLine.SetRange("Applies-to Doc. Type", "Document Type");
- GenJournalLine.SetRange("Applies-to Doc. No.", "Document No.");
- GenJournalLine.SetRange("On Hold", xRec."On Hold");
- if GenJournalLine.FIndFirst() then
- if not Confirm(
- StrSubstNo(
- NetBalanceOnHoldErr,
- GenJournalLine."Journal Template Name", GenJournalLine."Journal Batch Name", GenJournalLine."Line No."))
- then
- Error('');
- end;
- }
- ///
- /// Specifies the document type of the entry to which this entry is applied.
- ///
- field(34; "Applies-to Doc. Type"; Enum "Gen. Journal Document Type")
- {
- Caption = 'Applies-to Doc. Type';
- }
- ///
- /// Specifies the document number of the entry to which this entry is applied.
- ///
- field(35; "Applies-to Doc. No."; Code[20])
- {
- Caption = 'Applies-to Doc. No.';
- }
- ///
- /// Indicates whether this entry has an outstanding balance that has not been fully applied or paid.
- ///
- field(36; Open; Boolean)
- {
- Caption = 'Open';
- ToolTip = 'Specifies whether the amount on the entry has been fully paid or there is still a remaining amount that must be applied to.';
- }
- ///
- /// Specifies the date by which payment is expected from the customer.
- ///
- field(37; "Due Date"; Date)
- {
- Caption = 'Due Date';
- ToolTip = 'Specifies the due date on the entry.';
-
- trigger OnValidate()
- var
- ReminderEntry: Record "Reminder/Fin. Charge Entry";
- ReminderIssue: Codeunit "Reminder-Issue";
- begin
- TestField(Open, true);
- if "Due Date" <> xRec."Due Date" then begin
- ReminderEntry.SetCurrentKey("Customer Entry No.", Type);
- ReminderEntry.SetRange("Customer Entry No.", "Entry No.");
- ReminderEntry.SetRange(Type, ReminderEntry.Type::Reminder);
- ReminderEntry.SetRange("Reminder Level", "Last Issued Reminder Level");
- if ReminderEntry.FindLast() then
- ReminderIssue.ChangeDueDate(ReminderEntry, "Due Date", xRec."Due Date");
- end;
- end;
- }
- ///
- /// Specifies the last date on which the customer can pay to receive a payment discount.
- ///
- field(38; "Pmt. Discount Date"; Date)
- {
- Caption = 'Pmt. Discount Date';
- ToolTip = 'Specifies the date on which the amount in the entry must be paid for a payment discount to be granted.';
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- end;
- }
- ///
- /// Stores the original payment discount amount that could be granted if paid before the discount date.
- ///
- field(39; "Original Pmt. Disc. Possible"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Original Pmt. Disc. Possible';
- Editable = false;
- ToolTip = 'Specifies the discount that the customer can obtain if the entry is applied to before the payment discount date.';
- }
- ///
- /// Stores the payment discount amount that was actually granted to the customer in local currency.
- ///
- field(40; "Pmt. Disc. Given (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Pmt. Disc. Given (LCY)';
- }
- ///
- /// Stores the original payment discount amount in local currency that could be granted if paid before the discount date.
- ///
- field(42; "Orig. Pmt. Disc. Possible(LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Orig. Pmt. Disc. Possible (LCY)';
- Editable = false;
- }
- ///
- /// Indicates whether this entry represents a debit (positive) or credit (negative) amount.
- ///
- field(43; Positive; Boolean)
- {
- Caption = 'Positive';
- ToolTip = 'Specifies if the entry to be applied is positive.';
- }
- ///
- /// Specifies the entry number of the customer ledger entry that closed this entry through application.
- ///
- field(44; "Closed by Entry No."; Integer)
- {
- Caption = 'Closed by Entry No.';
- TableRelation = "Cust. Ledger Entry";
- }
- ///
- /// Specifies the date when this entry was closed through application of payments or credit memos.
- ///
- field(45; "Closed at Date"; Date)
- {
- Caption = 'Closed at Date';
- ToolTip = 'Specifies when the entry was closed.';
- }
- ///
- /// Stores the amount in the original currency that was applied to close this entry.
- ///
- field(46; "Closed by Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Closed by Amount';
- ToolTip = 'Specifies the amount that the entry was finally applied to (closed) with.';
- }
- ///
- /// Specifies an identifier used to group entries that will be applied together in a single application operation.
- ///
- field(47; "Applies-to ID"; Code[50])
- {
- Caption = 'Applies-to ID';
- ToolTip = 'Specifies the ID of entries that will be applied to when you choose the Apply Entries action.';
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- end;
- }
- ///
- /// Specifies the journal template from which this entry was posted.
- ///
- field(48; "Journal Templ. Name"; Code[10])
- {
- Caption = 'Journal Template Name';
- }
- ///
- /// Specifies the journal batch from which this entry was posted.
- ///
- field(49; "Journal Batch Name"; Code[10])
- {
- Caption = 'Journal Batch Name';
- }
- ///
- /// Specifies a supplementary code that provides additional context about the purpose of this transaction.
- ///
- field(50; "Reason Code"; Code[10])
- {
- Caption = 'Reason Code';
- TableRelation = "Reason Code";
- ToolTip = 'Specifies the reason code, a supplementary source code that enables you to trace the entry.';
- }
- ///
- /// Specifies the type of balancing account used in the original transaction, such as G/L Account, Bank Account, or Vendor.
- ///
- field(51; "Bal. Account Type"; Enum "Gen. Journal Account Type")
- {
- Caption = 'Bal. Account Type';
- ToolTip = 'Specifies the type of account that a balancing entry is posted to, such as BANK for a cash account.';
- }
- ///
- /// Specifies the account number of the balancing account used in the original transaction.
- ///
- field(52; "Bal. Account No."; Code[20])
- {
- Caption = 'Bal. Account No.';
- TableRelation = if ("Bal. Account Type" = const("G/L Account")) "G/L Account"
- else
- if ("Bal. Account Type" = const(Customer)) Customer
- else
- if ("Bal. Account Type" = const(Vendor)) Vendor
- else
- if ("Bal. Account Type" = const("Bank Account")) "Bank Account"
- else
- if ("Bal. Account Type" = const("Fixed Asset")) "Fixed Asset";
- ToolTip = 'Specifies the number of the general ledger, customer, vendor, or bank account that the balancing entry is posted to, such as a cash account for cash purchases.';
- }
- ///
- /// Specifies the transaction number that links all entries posted in the same posting operation.
- ///
- field(53; "Transaction No."; Integer)
- {
- Caption = 'Transaction No.';
- TableRelation = "G/L Transaction";
- ToolTip = 'Specifies the transaction number that groups related G/L entries from the same posting.';
- }
- ///
- /// Stores the amount in local currency that was applied to close this entry.
- ///
- field(54; "Closed by Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Closed by Amount (LCY)';
- }
- ///
- /// Contains the total debit amount in the original currency, calculated from detailed ledger entries.
- ///
- field(58; "Debit Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- BlankZero = true;
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Debit Amount" where("Ledger Entry Amount" = const(true),
- "Cust. Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Debit Amount';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies the total of the ledger entries that represent debits.';
- }
- ///
- /// Contains the total credit amount in the original currency, calculated from detailed ledger entries.
- ///
- field(59; "Credit Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- BlankZero = true;
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Credit Amount" where("Ledger Entry Amount" = const(true),
- "Cust. Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Credit Amount';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies the total of the ledger entries that represent credits.';
- }
- ///
- /// Contains the total debit amount in local currency, calculated from detailed ledger entries.
- ///
- field(60; "Debit Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- BlankZero = true;
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Debit Amount (LCY)" where("Ledger Entry Amount" = const(true),
- "Cust. Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Debit Amount (LCY)';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies the total of the ledger entries that represent debits, expressed in LCY.';
- }
- ///
- /// Contains the total credit amount in local currency, calculated from detailed ledger entries.
- ///
- field(61; "Credit Amount (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- BlankZero = true;
- CalcFormula = sum("Detailed Cust. Ledg. Entry"."Credit Amount (LCY)" where("Ledger Entry Amount" = const(true),
- "Cust. Ledger Entry No." = field("Entry No."),
- "Posting Date" = field("Date Filter")));
- Caption = 'Credit Amount (LCY)';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies the total of the ledger entries that represent credits, expressed in LCY.';
- }
- ///
- /// Specifies the date on the original source document, which may differ from the posting date.
- ///
- field(62; "Document Date"; Date)
- {
- Caption = 'Document Date';
- ToolTip = 'Specifies the customer entry''s document date.';
- }
- ///
- /// Specifies an external document number from the customer's or trading partner's system.
- ///
- field(63; "External Document No."; Code[35])
- {
- Caption = 'External Document No.';
- ToolTip = 'Specifies a document number that refers to the customer''s or vendor''s numbering system.';
- }
- ///
- /// Indicates whether finance charges should be calculated for this entry on overdue amounts.
- ///
- field(64; "Calculate Interest"; Boolean)
- {
- Caption = 'Calculate Interest';
- }
- ///
- /// Indicates whether closing interest has already been calculated when the entry was closed.
- ///
- field(65; "Closing Interest Calculated"; Boolean)
- {
- Caption = 'Closing Interest Calculated';
- }
- ///
- /// Specifies the number series used to generate the document number for this entry.
- ///
- field(66; "No. Series"; Code[20])
- {
- Caption = 'No. Series';
- TableRelation = "No. Series";
- }
- ///
- /// Specifies the currency code of the entry that was applied to close this customer ledger entry.
- ///
- field(67; "Closed by Currency Code"; Code[10])
- {
- Caption = 'Closed by Currency Code';
- TableRelation = Currency;
- ToolTip = 'Specifies the code of the currency of the entry that was applied to (and closed) this customer ledger entry.';
- }
- ///
- /// Stores the amount in the closing entry's currency that was applied to close this entry.
- ///
- field(68; "Closed by Currency Amount"; Decimal)
- {
- AccessByPermission = TableData Currency = R;
- AutoFormatExpression = "Closed by Currency Code";
- AutoFormatType = 1;
- Caption = 'Closed by Currency Amount';
- ToolTip = 'Specifies the amount that was finally applied to (and closed) this customer ledger entry.';
- }
- ///
- /// Stores the currency exchange rate after exchange rate adjustments have been applied.
- ///
- field(73; "Adjusted Currency Factor"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Adjusted Currency Factor';
- DecimalPlaces = 0 : 15;
- }
- ///
- /// Stores the original currency exchange rate used when the entry was created.
- ///
- field(74; "Original Currency Factor"; Decimal)
- {
- AutoFormatType = 0;
- Caption = 'Original Currency Factor';
- DecimalPlaces = 0 : 15;
- }
- ///
- /// Contains the original transaction amount in the original currency when the entry was first created.
- ///
- field(75; "Original Amount"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- CalcFormula = sum("Detailed Cust. Ledg. Entry".Amount where("Cust. Ledger Entry No." = field("Entry No."),
- "Entry Type" = filter("Initial Entry"),
- "Posting Date" = field("Date Filter")));
- Caption = 'Original Amount';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies the amount of the original entry.';
- }
- ///
- /// Specifies a date filter used to calculate flow fields for specific date ranges.
- ///
- field(76; "Date Filter"; Date)
- {
- Caption = 'Date Filter';
- FieldClass = FlowFilter;
- }
- ///
- /// Stores the remaining payment discount amount that can still be granted if the customer pays early.
- ///
- field(77; "Remaining Pmt. Disc. Possible"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Remaining Pmt. Disc. Possible';
- ToolTip = 'Specifies the remaining payment discount which can be received if the payment is made before the payment discount date.';
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- CalcFields(Amount, "Original Amount");
-
- if "Remaining Pmt. Disc. Possible" * Amount < 0 then
- FieldError("Remaining Pmt. Disc. Possible", StrSubstNo(Text000, FieldCaption(Amount)));
-
- if Abs("Remaining Pmt. Disc. Possible") > Abs("Original Amount") then
- FieldError("Remaining Pmt. Disc. Possible", StrSubstNo(Text001, FieldCaption("Original Amount")));
- end;
- }
- ///
- /// Specifies the final date on which the customer can pay and still receive the payment discount tolerance.
- ///
- field(78; "Pmt. Disc. Tolerance Date"; Date)
- {
- Caption = 'Pmt. Disc. Tolerance Date';
- ToolTip = 'Specifies the latest date the amount in the entry must be paid in order for a payment discount tolerance to be granted.';
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- end;
- }
- ///
- /// Specifies the maximum amount difference allowed when applying payments that is accepted as a tolerance.
- ///
- field(79; "Max. Payment Tolerance"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Max. Payment Tolerance';
- ToolTip = 'Specifies the maximum tolerated amount the entry can differ from the amount on the invoice or credit memo.';
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- CalcFields(Amount, "Remaining Amount");
- OnValidateMaxPaymentToleranceOnBeforeFieldError(Rec);
-
- if "Max. Payment Tolerance" * Amount < 0 then
- FieldError("Max. Payment Tolerance", StrSubstNo(Text000, FieldCaption(Amount)));
-
- if Abs("Max. Payment Tolerance") > Abs("Remaining Amount") then
- FieldError("Max. Payment Tolerance", StrSubstNo(Text001, FieldCaption("Remaining Amount")));
- end;
- }
- ///
- /// Stores the highest reminder level that has been issued to the customer for this entry.
- ///
- field(80; "Last Issued Reminder Level"; Integer)
- {
- Caption = 'Last Issued Reminder Level';
- }
- ///
- /// Stores the payment tolerance amount that has been accepted when applying this entry.
- ///
- field(81; "Accepted Payment Tolerance"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Accepted Payment Tolerance';
- }
- ///
- /// Indicates whether a payment discount tolerance has been accepted when applying this entry.
- ///
- field(82; "Accepted Pmt. Disc. Tolerance"; Boolean)
- {
- Caption = 'Accepted Pmt. Disc. Tolerance';
- }
- ///
- /// Stores the payment tolerance amount in local currency that has been applied to this entry.
- ///
- field(83; "Pmt. Tolerance (LCY)"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Pmt. Tolerance (LCY)';
- }
- ///
- /// Specifies the amount that should be applied when performing entry application.
- ///
- field(84; "Amount to Apply"; Decimal)
- {
- AutoFormatExpression = Rec."Currency Code";
- AutoFormatType = 1;
- Caption = 'Amount to Apply';
- ToolTip = 'Specifies the amount to apply.';
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- CalcFields("Remaining Amount");
- OnValidateAmounttoApplyBeforeFieldError(Rec);
-
- if AreOppositeSign("Amount to Apply", "Remaining Amount") then
- FieldError("Amount to Apply", StrSubstNo(Text000, FieldCaption("Remaining Amount")));
-
- if Abs("Amount to Apply") > Abs("Remaining Amount") then
- FieldError("Amount to Apply", StrSubstNo(Text001, FieldCaption("Remaining Amount")));
- end;
- }
- ///
- /// Specifies the intercompany partner involved in this transaction for intercompany trade.
- ///
- field(85; "IC Partner Code"; Code[20])
- {
- Caption = 'IC Partner Code';
- TableRelation = "IC Partner";
- ToolTip = 'Specifies the code of the intercompany partner that the transaction is related to if the entry was created from an intercompany transaction.';
- }
- ///
- /// Indicates whether this entry is the applying entry in a payment application operation.
- ///
- field(86; "Applying Entry"; Boolean)
- {
- Caption = 'Applying Entry';
- }
- ///
- /// Indicates whether this entry has been reversed through a reversal transaction.
- ///
- field(87; Reversed; Boolean)
- {
- BlankZero = true;
- Caption = 'Reversed';
- ToolTip = 'Specifies if the entry has been part of a reverse transaction.';
- }
- ///
- /// Specifies the entry number of the correcting entry that reversed this original entry.
- ///
- field(88; "Reversed by Entry No."; Integer)
- {
- BlankZero = true;
- Caption = 'Reversed by Entry No.';
- TableRelation = "Cust. Ledger Entry";
- ToolTip = 'Specifies the number of the correcting entry that replaced the original entry in the reverse transaction.';
- }
- ///
- /// Specifies the entry number of the original entry that was reversed by this correcting entry.
- ///
- field(89; "Reversed Entry No."; Integer)
- {
- BlankZero = true;
- Caption = 'Reversed Entry No.';
- TableRelation = "Cust. Ledger Entry";
- ToolTip = 'Specifies the number of the original entry that was undone by the reverse transaction.';
- }
- ///
- /// Indicates whether this entry represents a prepayment received before goods or services are delivered.
- ///
- field(90; Prepayment; Boolean)
- {
- Caption = 'Prepayment';
- ToolTip = 'Specifies if the related payment is a prepayment.';
- }
- field(95; "G/L Register No."; Integer)
- {
- Caption = 'G/L Register No.';
- Editable = false;
- TableRelation = "G/L Register";
- ToolTip = 'Specifies the G/L register number that groups related G/L entries from the same posting.';
- }
- ///
- /// Specifies the payment reference number used by banks to identify and track the payment.
- ///
- field(171; "Payment Reference"; Code[50])
- {
- Caption = 'Payment Reference';
- }
- ///
- /// Specifies the payment method used or expected for this transaction, such as bank transfer, cash, or check.
- ///
- field(172; "Payment Method Code"; Code[10])
- {
- Caption = 'Payment Method Code';
- TableRelation = "Payment Method";
- ToolTip = 'Specifies how to make payment, such as with bank transfer, cash, or check.';
-
- trigger OnValidate()
- begin
- TestField(Open, true);
- end;
- }
- ///
- /// Specifies the external document number of the entry to which this entry applies.
- ///
- field(173; "Applies-to Ext. Doc. No."; Code[35])
- {
- Caption = 'Applies-to Ext. Doc. No.';
- }
- ///
- /// Specifies the customer's bank account where refund payments should be transferred.
- ///
- field(288; "Recipient Bank Account"; Code[20])
- {
- Caption = 'Recipient Bank Account';
- TableRelation = "Customer Bank Account".Code where("Customer No." = field("Customer No."));
- ToolTip = 'Specifies the bank account to transfer the amount to.';
- }
- ///
- /// Specifies the message text that will be sent to the recipient when the payment is exported.
- ///
- field(289; "Message to Recipient"; Text[140])
- {
- Caption = 'Message to Recipient';
- ToolTip = 'Specifies the message exported to the payment file when you use the Export Payments to File function in the Payment Journal window.';
-
- trigger OnValidate()
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidateMessagetoRecipient(Rec, IsHandled);
- if IsHandled then
- exit;
-
- TestField(Open, true);
- end;
- }
- ///
- /// Indicates whether this entry has been exported to a payment file for electronic processing.
- ///
- field(290; "Exported to Payment File"; Boolean)
- {
- Caption = 'Exported to Payment File';
- Editable = false;
- ToolTip = 'Specifies that the entry was created as a result of exporting a payment journal line.';
- }
- ///
- /// Specifies the combination of dimension values applied to this entry for analysis and reporting.
- ///
- field(480; "Dimension Set ID"; Integer)
- {
- Caption = 'Dimension Set ID';
- Editable = false;
- TableRelation = "Dimension Set Entry";
- ToolTip = 'Specifies a reference to a combination of dimension values. The actual values are stored in the Dimension Set Entry table.';
-
- trigger OnLookup()
- begin
- Rec.ShowDimensions();
- end;
- }
- ///
- /// Contains the third shortcut dimension value for additional analysis and reporting capabilities.
- ///
- field(481; "Shortcut Dimension 3 Code"; Code[20])
- {
- CaptionClass = '1,2,3';
- Caption = 'Shortcut Dimension 3 Code';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(3)));
- ToolTip = 'Specifies the code for Shortcut Dimension 3, which is one of dimension codes that you set up in the General Ledger Setup window.';
- }
- ///
- /// Contains the fourth shortcut dimension value for additional analysis and reporting capabilities.
- ///
- field(482; "Shortcut Dimension 4 Code"; Code[20])
- {
- CaptionClass = '1,2,4';
- Caption = 'Shortcut Dimension 4 Code';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(4)));
- ToolTip = 'Specifies the code for Shortcut Dimension 4, which is one of dimension codes that you set up in the General Ledger Setup window.';
- }
- ///
- /// Contains the fifth shortcut dimension value for additional analysis and reporting capabilities.
- ///
- field(483; "Shortcut Dimension 5 Code"; Code[20])
- {
- CaptionClass = '1,2,5';
- Caption = 'Shortcut Dimension 5 Code';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(5)));
- ToolTip = 'Specifies the code for Shortcut Dimension 5, which is one of dimension codes that you set up in the General Ledger Setup window.';
- }
- ///
- /// Contains the sixth shortcut dimension value for additional analysis and reporting capabilities.
- ///
- field(484; "Shortcut Dimension 6 Code"; Code[20])
- {
- CaptionClass = '1,2,6';
- Caption = 'Shortcut Dimension 6 Code';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(6)));
- ToolTip = 'Specifies the code for Shortcut Dimension 6, which is one of dimension codes that you set up in the General Ledger Setup window.';
- }
- ///
- /// Contains the seventh shortcut dimension value for additional analysis and reporting capabilities.
- ///
- field(485; "Shortcut Dimension 7 Code"; Code[20])
- {
- CaptionClass = '1,2,7';
- Caption = 'Shortcut Dimension 7 Code';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(7)));
- ToolTip = 'Specifies the code for Shortcut Dimension 7, which is one of dimension codes that you set up in the General Ledger Setup window.';
- }
- ///
- /// Contains the eighth shortcut dimension value for additional analysis and reporting capabilities.
- ///
- field(486; "Shortcut Dimension 8 Code"; Code[20])
- {
- CaptionClass = '1,2,8';
- Caption = 'Shortcut Dimension 8 Code';
- Editable = false;
- FieldClass = FlowField;
- CalcFormula = lookup("Dimension Set Entry"."Dimension Value Code" where("Dimension Set ID" = field("Dimension Set ID"),
- "Global Dimension No." = const(8)));
- ToolTip = 'Specifies the code for Shortcut Dimension 8, which is one of dimension codes that you set up in the General Ledger Setup window.';
- }
- ///
- /// Specifies the SEPA direct debit mandate used to collect payments directly from the customer's bank account.
- ///
- field(1200; "Direct Debit Mandate ID"; Code[35])
- {
- Caption = 'Direct Debit Mandate ID';
- TableRelation = "SEPA Direct Debit Mandate" where("Customer No." = field("Customer No."));
- ToolTip = 'Specifies the direct-debit mandate that the customer has signed to allow direct debit collection of payments.';
- }
- ///
- /// Specifies the dispute status when the customer has raised an issue regarding the invoice.
- ///
- field(1340; "Dispute Status"; Code[10])
- {
- Caption = 'Dispute Status';
- TableRelation = "Dispute Status";
- DataClassification = CustomerContent;
- ToolTip = 'Specifies if there is an ongoing dispute for this Invoice';
-
- trigger OnValidate()
- var
- DisputeStatus: Record "Dispute Status";
- MarkedAsOnHoldLbl: label 'X', Locked = true;
- begin
- if Rec."Dispute Status" = '' then
- exit;
- if DisputeStatus.get(Rec."Dispute Status") then
- if DisputeStatus."Overwrite on hold" then
- "On Hold" := MarkedAsOnHoldLbl;
- end;
- }
- ///
- /// Specifies the date on which the customer has committed to pay the outstanding balance.
- ///
- field(1341; "Promised Pay Date"; Date)
- {
- Caption = 'Promised Pay Date';
- DataClassification = CustomerContent;
- ToolTip = 'Specifies the date on which the customer have promised to pay this invoice.';
- }
- field(11000000; "Transaction Mode Code"; Code[20])
- {
- Caption = 'Transaction Mode Code';
- TableRelation = "Transaction Mode".Code where("Account Type" = const(Customer));
-
- trigger OnValidate()
- var
- begin
- end;
- }
- field(11000002; "Payments in Process"; Decimal)
- {
- AutoFormatType = 1;
- AutoFormatExpression = Rec."Currency Code";
- BlankZero = true;
- CalcFormula = sum("Detail Line"."Amount (Entry)" where("Serial No. (Entry)" = field("Entry No."),
- Status = const("In process"),
- "Account Type" = const(Customer),
- "Connect Batches" = field("Connect Batches Filter"),
- "Connect Lines" = field("Connect Lines Filter"),
- "Our Bank" = field("Our Bank Filter")));
- Caption = 'Payments in Process';
- Editable = false;
- FieldClass = FlowField;
- }
- field(11000003; "Connect Batches Filter"; Code[20])
- {
- Caption = 'Connect Batches Filter';
- FieldClass = FlowFilter;
- }
- field(11000004; "Connect Lines Filter"; Integer)
- {
- Caption = 'Connect Lines Filter';
- FieldClass = FlowFilter;
- }
- field(11000005; "Our Bank Filter"; Code[20])
- {
- Caption = 'Our Bank Filter';
- FieldClass = FlowFilter;
- }
- }
-
- keys
- {
- key(Key1; "Entry No.")
- {
- Clustered = true;
- }
- key(Key2; "Customer No.", "Currency Code")
- {
- SumIndexFields = "Sales (LCY)", "Profit (LCY)", "Inv. Discount (LCY)";
- }
- key(Key4; "Document No.")
- {
- }
- key(Key5; "External Document No.")
- {
- }
- key(Key6; "Customer No.", Open, Positive, "Due Date", "Currency Code")
- {
- }
- key(Key7; Open, "Due Date")
- {
- }
- key(Key8; "Customer No.", "Document Type", "Posting Date", "Currency Code")
- {
- IncludedFields = "Sales (LCY)", "Profit (LCY)", "Inv. Discount (LCY)";
- }
- key(Key9; "Salesperson Code", "Posting Date")
- {
- }
- key(Key10; "Closed by Entry No.")
- {
- }
- key(Key11; "Transaction No.")
- {
- }
- key(Key17; "Customer No.", "Applies-to ID", Open, Positive, "Due Date")
- {
- }
- key(Key18; Open, "On Hold", "Transaction Mode Code")
- {
- }
- key(Key19; "Document Type", "Posting Date")
- {
- SumIndexFields = "Sales (LCY)";
- }
- key(Key20; "Document Type", "Customer No.", Open, "Due Date")
- {
- }
- key(Key21; "Customer Posting Group")
- {
- }
- key(Key22; "Document Type", Open, "Posting Date", "Closed at Date")
- {
- }
- key(Key23; "Salesperson Code")
- {
- }
- key(Key24; SystemModifiedAt)
- {
- }
- key(Key35; "Customer No.", "Posting Date", "Applies-to ID")
- {
- IncludedFields = "Currency Code", "Amount to Apply", Open;
- }
- key(Key36; "Document Type", Reversed, "Posting Date")
- {
- IncludedFields = "Customer No.", Open, "Sales (LCY)";
- }
- key(Key37; "Applies-to ID")
- {
- IncludedFields = "Accepted Payment Tolerance";
- }
- }
-
- fieldgroups
- {
- fieldgroup(DropDown; "Entry No.", Description, "Customer No.", "Posting Date", "Document Type", "Document No.")
- {
- }
- fieldgroup(Brick; "Document No.", Description, "Remaining Amt. (LCY)", "Due Date")
- {
- }
- }
-
- trigger OnInsert()
- begin
- TestField("G/L Register No.");
- end;
-
- var
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text000: Label 'must have the same sign as %1';
- Text001: Label 'must not be larger than %1';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- NetBalanceOnHoldErr: Label 'General journal line number %3 on template name %1 batch name %2 is applied. Do you want to change On Hold value anyway?', Comment = '%1 - template name, %2 - batch name, %3 - line number';
-
- ///
- /// Gets the entry number of the last customer ledger entry in the table.
- ///
- /// The entry number of the last customer ledger entry.
- [InherentPermissions(PermissionObjectType::TableData, Database::"Cust. Ledger Entry", 'r')]
- procedure GetLastEntryNo(): Integer;
- var
- FindRecordManagement: Codeunit "Find Record Management";
- begin
- exit(FindRecordManagement.GetLastEntryIntFieldValue(Rec, FieldNo("Entry No.")))
- end;
-
- ///
- /// Opens the appropriate posted document page based on the document type.
- ///
- /// True if a document was found and displayed; otherwise, false.
- procedure ShowDoc(): Boolean
- var
- SalesInvoiceHdr: Record "Sales Invoice Header";
- SalesCrMemoHdr: Record "Sales Cr.Memo Header";
- IssuedFinChargeMemoHeader: Record "Issued Fin. Charge Memo Header";
- IssuedReminderHeader: Record "Issued Reminder Header";
- PageManagement: Codeunit "Page Management";
- IsHandled: Boolean;
- IsPageOpened: Boolean;
- begin
- IsHandled := false;
- OnBeforeShowDoc(Rec, IsPageOpened, IsHandled);
- if IsHandled then
- exit(IsPageOpened);
-
- case "Document Type" of
- "Document Type"::Invoice:
- if SalesInvoiceHdr.Get("Document No.") then begin
- PageManagement.PageRun(SalesInvoiceHdr);
- exit(true);
- end;
- "Document Type"::"Credit Memo":
- if SalesCrMemoHdr.Get("Document No.") then begin
- PageManagement.PageRun(SalesCrMemoHdr);
- exit(true);
- end;
- "Document Type"::"Finance Charge Memo":
- if IssuedFinChargeMemoHeader.Get("Document No.") then begin
- PAGE.Run(PAGE::"Issued Finance Charge Memo", IssuedFinChargeMemoHeader);
- exit(true);
- end;
- "Document Type"::Reminder:
- if IssuedReminderHeader.Get("Document No.") then begin
- PAGE.Run(PAGE::"Issued Reminder", IssuedReminderHeader);
- exit(true);
- end;
- end;
-
- OnAfterShowDoc(Rec);
- end;
-
- ///
- /// Opens the document attachment details page for the posted document associated with this entry.
- ///
- procedure ShowPostedDocAttachment()
- var
- SalesInvoiceHeader: Record "Sales Invoice Header";
- SalesCrMemoHeader: Record "Sales Cr.Memo Header";
- DocumentFound: Boolean;
- begin
- case "Document Type" of
- "Document Type"::Invoice:
- if SalesInvoiceHeader.Get("Document No.") then begin
- OpenDocumentAttachmentDetails(SalesInvoiceHeader);
- DocumentFound := true;
- end;
- "Document Type"::"Credit Memo":
- if SalesCrMemoHeader.Get("Document No.") then begin
- OpenDocumentAttachmentDetails(SalesCrMemoHeader);
- DocumentFound := true;
- end;
- end;
-
- OnAfterShowPostedDocAttachment(Rec, DocumentFound);
- end;
-
- local procedure OpenDocumentAttachmentDetails("Record": Variant)
- var
- DocumentAttachmentDetails: Page "Document Attachment Details";
- RecRef: RecordRef;
- begin
- RecRef.GetTable(Record);
- DocumentAttachmentDetails.OpenForRecRef(RecRef);
- DocumentAttachmentDetails.RunModal();
- end;
-
- ///
- /// Checks whether the posted document associated with this entry has any attachments.
- ///
- /// True if the posted document has attachments; otherwise, false.
- procedure HasPostedDocAttachment(): Boolean
- var
- [SecurityFiltering(SecurityFilter::Filtered)]
- SalesInvoiceHeader: Record "Sales Invoice Header";
- [SecurityFiltering(SecurityFilter::Filtered)]
- SalesCrMemoHeader: Record "Sales Cr.Memo Header";
- DocumentAttachment: Record "Document Attachment";
- HasPostedDocumentAttachment: Boolean;
- begin
- case "Document Type" of
- "Document Type"::Invoice:
- if SalesInvoiceHeader.Get("Document No.") then
- exit(DocumentAttachment.HasPostedDocumentAttachment(SalesInvoiceHeader));
- "Document Type"::"Credit Memo":
- if SalesCrMemoHeader.Get("Document No.") then
- exit(DocumentAttachment.HasPostedDocumentAttachment(SalesCrMemoHeader));
- end;
-
- OnAfterHasPostedDocAttachment(Rec, HasPostedDocumentAttachment);
- exit(HasPostedDocumentAttachment);
- end;
-
- ///
- /// Opens the Customer Ledger Entries page filtered by the specified detailed customer ledger entry filters.
- ///
- /// The detailed customer ledger entry with filters to apply.
- procedure DrillDownOnEntries(var DtldCustLedgEntry: Record "Detailed Cust. Ledg. Entry")
- var
- CustLedgEntry: Record "Cust. Ledger Entry";
- DrillDownPageID: Integer;
- begin
- CustLedgEntry.Reset();
- DtldCustLedgEntry.CopyFilter("Customer No.", CustLedgEntry."Customer No.");
- DtldCustLedgEntry.CopyFilter("Currency Code", CustLedgEntry."Currency Code");
- DtldCustLedgEntry.CopyFilter("Initial Entry Global Dim. 1", CustLedgEntry."Global Dimension 1 Code");
- DtldCustLedgEntry.CopyFilter("Initial Entry Global Dim. 2", CustLedgEntry."Global Dimension 2 Code");
- DtldCustLedgEntry.CopyFilter("Initial Entry Due Date", CustLedgEntry."Due Date");
- CustLedgEntry.SetCurrentKey("Customer No.", "Posting Date");
- CustLedgEntry.SetRange(Open, true);
- OnBeforeDrillDownEntries(CustLedgEntry, DtldCustLedgEntry, DrillDownPageID);
- PAGE.Run(DrillDownPageID, CustLedgEntry);
- end;
-
- ///
- /// Opens the Customer Ledger Entries page filtered to show only overdue entries.
- ///
- /// The detailed customer ledger entry with filters to apply.
- procedure DrillDownOnOverdueEntries(var DtldCustLedgEntry: Record "Detailed Cust. Ledg. Entry")
- var
- CustLedgEntry: Record "Cust. Ledger Entry";
- DrillDownPageID: Integer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeDrillDownOnOverdueEntriesBeforeCode(DtldCustLedgEntry, IsHandled);
- if IsHandled then
- exit;
-
- CustLedgEntry.Reset();
- DtldCustLedgEntry.CopyFilter("Customer No.", CustLedgEntry."Customer No.");
- DtldCustLedgEntry.CopyFilter("Currency Code", CustLedgEntry."Currency Code");
- DtldCustLedgEntry.CopyFilter("Initial Entry Global Dim. 1", CustLedgEntry."Global Dimension 1 Code");
- DtldCustLedgEntry.CopyFilter("Initial Entry Global Dim. 2", CustLedgEntry."Global Dimension 2 Code");
- CustLedgEntry.SetCurrentKey("Customer No.", "Posting Date");
- CustLedgEntry.SetFilter("Date Filter", '..%1', Today);
- CustLedgEntry.SetFilter("Due Date", '<%1', Today);
- CustLedgEntry.SetFilter("Remaining Amount", '<>%1', 0);
- OnBeforeDrillDownOnOverdueEntries(CustLedgEntry, DtldCustLedgEntry, DrillDownPageID);
- PAGE.Run(DrillDownPageID, CustLedgEntry);
- end;
-
- ///
- /// Gets the original currency factor, returning 1 if not set.
- ///
- /// The original currency factor or 1 if not set.
- procedure GetOriginalCurrencyFactor(): Decimal
- begin
- if "Original Currency Factor" = 0 then
- exit(1);
- exit("Original Currency Factor");
- end;
-
- ///
- /// Gets the adjusted currency factor, returning 1 if not set.
- ///
- /// The adjusted currency factor or 1 if not set.
- procedure GetAdjustedCurrencyFactor(): Decimal
- begin
- if "Adjusted Currency Factor" = 0 then
- exit(1);
- exit("Adjusted Currency Factor");
- end;
-
- ///
- /// Opens the Dimension Set Entries page showing the dimensions for this entry.
- ///
- procedure ShowDimensions()
- var
- DimMgt: Codeunit DimensionManagement;
- begin
- DimMgt.ShowDimensionSet("Dimension Set ID", StrSubstNo('%1 %2', TableCaption(), "Entry No."));
- end;
-
- ///
- /// Determines the visual style for displaying this entry based on its payment status.
- ///
- /// A style text for page rendering: 'Unfavorable' for overdue open entries, 'Attention' for entries closed after due date.
- procedure SetStyle() Style: Text
- var
- IsHandled: Boolean;
- begin
- OnBeforeSetStyle(Style, IsHandled);
- if IsHandled then
- exit(Style);
-
- if Open then begin
- if WorkDate() > "Due Date" then
- exit('Unfavorable')
- end else
- if "Closed at Date" > "Due Date" then
- exit('Attention');
- exit('');
- end;
-
- ///
- /// Sets filters on the record to show entries that can be applied based on the specified criteria.
- ///
- /// The customer number to filter by.
- /// The document type to filter by.
- /// The document number to filter by.
- /// The amount to filter by for determining positive/negative entries.
- procedure SetApplyToFilters(CustomerNo: Code[20]; ApplyDocType: Option; ApplyDocNo: Code[20]; ApplyAmount: Decimal)
- begin
- SetCurrentKey("Customer No.", Open, Positive, "Due Date");
- SetRange("Customer No.", CustomerNo);
- SetRange(Open, true);
- if ApplyDocNo <> '' then begin
- SetRange("Document Type", ApplyDocType);
- SetRange("Document No.", ApplyDocNo);
- if FindFirst() then;
- SetRange("Document Type");
- SetRange("Document No.");
- end else
- if ApplyDocType <> 0 then begin
- SetRange("Document Type", ApplyDocType);
- if FindFirst() then;
- SetRange("Document Type");
- end else
- if ApplyAmount <> 0 then begin
- SetRange(Positive, ApplyAmount < 0);
- if FindFirst() then;
- SetRange(Positive);
- end;
- end;
-
- ///
- /// Toggles the Amount to Apply field between the remaining amount and zero for the specified document.
- ///
- /// The document number to set the amount to apply for.
- /// The customer number of the entry.
- procedure SetAmountToApply(AppliesToDocNo: Code[20]; CustomerNo: Code[20])
- begin
- OnBeforeSetAmountToApply(Rec, AppliesToDocNo, CustomerNo);
-
- SetCurrentKey("Document No.");
- SetRange("Document No.", AppliesToDocNo);
- SetRange("Customer No.", CustomerNo);
- SetRange(Open, true);
- if FindFirst() then begin
- if "Amount to Apply" = 0 then begin
- CalcFields("Remaining Amount");
- OnSetAmountToApplyOnAfterCalcRemainingAmount(Rec);
- "Amount to Apply" := "Remaining Amount";
- end else
- "Amount to Apply" := 0;
- "Accepted Payment Tolerance" := 0;
- "Accepted Pmt. Disc. Tolerance" := false;
- CODEUNIT.Run(CODEUNIT::"Cust. Entry-Edit", Rec);
- end;
- end;
-
- ///
- /// Copies field values from a general journal line to this customer ledger entry.
- ///
- /// The general journal line to copy values from.
- procedure CopyFromGenJnlLine(GenJnlLine: Record "Gen. Journal Line")
- begin
- "Customer No." := GenJnlLine."Account No.";
- "Posting Date" := GenJnlLine."Posting Date";
- "Document Date" := GenJnlLine."Document Date";
- "Document Type" := GenJnlLine."Document Type";
- "Document No." := GenJnlLine."Document No.";
- "External Document No." := GenJnlLine."External Document No.";
- "Your Reference" := GenJnlLine."Your Reference";
- Description := GenJnlLine.Description;
- "Currency Code" := GenJnlLine."Currency Code";
- "Sales (LCY)" := GenJnlLine."Sales/Purch. (LCY)";
- "Profit (LCY)" := GenJnlLine."Profit (LCY)";
- "Inv. Discount (LCY)" := GenJnlLine."Inv. Discount (LCY)";
- "Sell-to Customer No." := GenJnlLine."Sell-to/Buy-from No.";
- "Customer Posting Group" := GenJnlLine."Posting Group";
- "Global Dimension 1 Code" := GenJnlLine."Shortcut Dimension 1 Code";
- "Global Dimension 2 Code" := GenJnlLine."Shortcut Dimension 2 Code";
- "Dimension Set ID" := GenJnlLine."Dimension Set ID";
- "Salesperson Code" := GenJnlLine."Salespers./Purch. Code";
- "Source Code" := GenJnlLine."Source Code";
- "On Hold" := GenJnlLine."On Hold";
- "Applies-to Doc. Type" := GenJnlLine."Applies-to Doc. Type";
- "Applies-to Doc. No." := GenJnlLine."Applies-to Doc. No.";
- "Due Date" := GenJnlLine."Due Date";
- "Pmt. Discount Date" := GenJnlLine."Pmt. Discount Date";
- "Applies-to ID" := GenJnlLine."Applies-to ID";
- "Journal Templ. Name" := GenJnlLine."Journal Template Name";
- "Journal Batch Name" := GenJnlLine."Journal Batch Name";
- "Reason Code" := GenJnlLine."Reason Code";
- "Direct Debit Mandate ID" := GenJnlLine."Direct Debit Mandate ID";
- "User ID" := CopyStr(UserId(), 1, MaxStrLen("User ID"));
- "Bal. Account Type" := GenJnlLine."Bal. Account Type";
- "Bal. Account No." := GenJnlLine."Bal. Account No.";
- "No. Series" := GenJnlLine."Posting No. Series";
- "IC Partner Code" := GenJnlLine."IC Partner Code";
- Prepayment := GenJnlLine.Prepayment;
- "Recipient Bank Account" := GenJnlLine."Recipient Bank Account";
- "Message to Recipient" := GenJnlLine."Message to Recipient";
- "Applies-to Ext. Doc. No." := GenJnlLine."Applies-to Ext. Doc. No.";
- "Payment Method Code" := GenJnlLine."Payment Method Code";
- "Payment Reference" := GenJnlLine."Payment Reference";
- "Exported to Payment File" := GenJnlLine."Exported to Payment File";
- "Transaction Mode Code" := GenJnlLine."Transaction Mode Code";
-
- OnAfterCopyCustLedgerEntryFromGenJnlLine(Rec, GenJnlLine);
- end;
-
- ///
- /// Copies field values from a CV ledger entry buffer to this customer ledger entry.
- ///
- /// The CV ledger entry buffer to copy values from.
- procedure CopyFromCVLedgEntryBuffer(var CVLedgerEntryBuffer: Record "CV Ledger Entry Buffer")
- begin
- TransferFields(CVLedgerEntryBuffer);
- Amount := CVLedgerEntryBuffer.Amount;
- "Amount (LCY)" := CVLedgerEntryBuffer."Amount (LCY)";
- "Remaining Amount" := CVLedgerEntryBuffer."Remaining Amount";
- "Remaining Amt. (LCY)" := CVLedgerEntryBuffer."Remaining Amt. (LCY)";
- "Original Amount" := CVLedgerEntryBuffer."Original Amount";
- "Original Amt. (LCY)" := CVLedgerEntryBuffer."Original Amt. (LCY)";
-
- OnAfterCopyCustLedgerEntryFromCVLedgEntryBuffer(Rec, CVLedgerEntryBuffer);
- end;
-
- ///
- /// Recalculates amount fields from one currency to another using exchange rates at the specified posting date.
- ///
- /// The source currency code.
- /// The target currency code.
- /// The date to use for the exchange rate.
- procedure RecalculateAmounts(FromCurrencyCode: Code[10]; ToCurrencyCode: Code[10]; PostingDate: Date)
- var
- CurrExchRate: Record "Currency Exchange Rate";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeRecalculateAmounts(Rec, FromCurrencyCode, ToCurrencyCode, PostingDate, IsHandled);
- if not IsHandled then begin
- if ToCurrencyCode = FromCurrencyCode then
- exit;
-
- "Remaining Amount" :=
- CurrExchRate.ExchangeAmount("Remaining Amount", FromCurrencyCode, ToCurrencyCode, PostingDate);
- "Remaining Pmt. Disc. Possible" :=
- CurrExchRate.ExchangeAmount("Remaining Pmt. Disc. Possible", FromCurrencyCode, ToCurrencyCode, PostingDate);
- "Accepted Payment Tolerance" :=
- CurrExchRate.ExchangeAmount("Accepted Payment Tolerance", FromCurrencyCode, ToCurrencyCode, PostingDate);
- "Amount to Apply" :=
- CurrExchRate.ExchangeAmount("Amount to Apply", FromCurrencyCode, ToCurrencyCode, PostingDate);
- end;
- OnAfterRecalculateAmounts(Rec, FromCurrencyCode, ToCurrencyCode, PostingDate);
- end;
-
- ///
- /// Updates amount fields for application by converting to the application currency.
- ///
- /// The application date for exchange rate lookup.
- /// The application currency code.
- /// Specifies whether to use rounded exchange amounts.
- /// Specifies whether to update the maximum payment tolerance.
- procedure UpdateAmountsForApplication(ApplnDate: Date; ApplnCurrencyCode: Code[10]; RoundAmounts: Boolean; UpdateMaxPaymentTolerance: Boolean)
- var
- CurrencyExchangeRate: Record "Currency Exchange Rate";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateAmountsForApplication(Rec, ApplnDate, ApplnCurrencyCode, RoundAmounts, UpdateMaxPaymentTolerance, IsHandled);
- if not IsHandled then begin
- //new
- if "Currency Code" = ApplnCurrencyCode then
- exit;
- if RoundAmounts then begin
- "Remaining Amount" :=
- CurrencyExchangeRate.ExchangeAmount(
- "Remaining Amount", "Currency Code", ApplnCurrencyCode, ApplnDate);
- "Remaining Pmt. Disc. Possible" :=
- CurrencyExchangeRate.ExchangeAmount(
- "Remaining Pmt. Disc. Possible", "Currency Code", ApplnCurrencyCode, ApplnDate);
- if UpdateMaxPaymentTolerance then
- "Max. Payment Tolerance" :=
- CurrencyExchangeRate.ExchangeAmount(
- "Max. Payment Tolerance", "Currency Code", ApplnCurrencyCode, ApplnDate);
- "Amount to Apply" :=
- CurrencyExchangeRate.ExchangeAmount(
- "Amount to Apply", "Currency Code", ApplnCurrencyCode, ApplnDate);
- end else begin
- "Remaining Amount" :=
- CurrencyExchangeRate.ExchangeAmtFCYToFCY(
- ApplnDate, "Currency Code", ApplnCurrencyCode, "Remaining Amount");
- "Remaining Pmt. Disc. Possible" :=
- CurrencyExchangeRate.ExchangeAmtFCYToFCY(
- ApplnDate, "Currency Code", ApplnCurrencyCode, "Remaining Pmt. Disc. Possible");
- if UpdateMaxPaymentTolerance then // If it is not a problem that "Max. Payment Tolerance" is updated in procedure CalcApplnAmount() on the page "Apply Customer Entries", then maybe the argument UpdateMaxPaymentTolerance can be removed.
- "Max. Payment Tolerance" :=
- CurrencyExchangeRate.ExchangeAmtFCYToFCY(
- ApplnDate, "Currency Code", ApplnCurrencyCode, "Max. Payment Tolerance");
- "Amount to Apply" :=
- CurrencyExchangeRate.ExchangeAmtFCYToFCY(
- ApplnDate, "Currency Code", ApplnCurrencyCode, "Amount to Apply");
- end;
- end;
- OnAfterUpdateAmountsForApplication(Rec, ApplnDate, ApplnCurrencyCode, RoundAmounts, UpdateMaxPaymentTolerance);
- end;
-
- ///
- /// Gets the remaining payment discount possible, allowing for customization through events.
- ///
- /// The reference date for calculating the payment discount.
- /// The remaining payment discount amount possible.
- procedure GetRemainingPmtDiscPossible(ReferenceDate: Date) RemainingPmtDiscPossible: Decimal
- begin
- RemainingPmtDiscPossible := "Remaining Pmt. Disc. Possible";
-
- OnAfterGetRemainingPmtDiscPossible(Rec, ReferenceDate, RemainingPmtDiscPossible);
- end;
-
- local procedure AreOppositeSign(Amount1: Decimal; Amount2: Decimal): Boolean
- var
- Math: Codeunit "Math";
- begin
- if (Amount1 = 0) or (Amount2 = 0) then
- exit(false);
-
- exit(Math.Sign(Amount1) <> Math.Sign(Amount2));
- end;
-
- ///
- /// Raised after copying customer ledger entry fields from a general journal line.
- ///
- /// The customer ledger entry that was updated.
- /// The general journal line that was copied from.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyCustLedgerEntryFromGenJnlLine(var CustLedgerEntry: Record "Cust. Ledger Entry"; GenJournalLine: Record "Gen. Journal Line")
- begin
- end;
-
- ///
- /// Raised after copying customer ledger entry fields from a CV ledger entry buffer.
- ///
- /// The customer ledger entry that was updated.
- /// The CV ledger entry buffer that was copied from.
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyCustLedgerEntryFromCVLedgEntryBuffer(var CustLedgerEntry: Record "Cust. Ledger Entry"; CVLedgerEntryBuffer: Record "CV Ledger Entry Buffer")
- begin
- end;
-
- ///
- /// Raised after recalculating amounts from one currency to another.
- ///
- /// The customer ledger entry with recalculated amounts.
- /// The source currency code.
- /// The target currency code.
- /// The posting date used for exchange rates.
- [IntegrationEvent(false, false)]
- local procedure OnAfterRecalculateAmounts(var CustLedgerEntry: Record "Cust. Ledger Entry"; FromCurrencyCode: Code[10]; ToCurrencyCode: Code[10]; PostingDate: Date)
- begin
- end;
-
- ///
- /// Raised before validating the Amount to Apply field to allow custom validation.
- ///
- /// The customer ledger entry being validated.
- [IntegrationEvent(false, false)]
- local procedure OnValidateAmounttoApplyBeforeFieldError(var CustLedgerEntry: Record "Cust. Ledger Entry")
- begin
- end;
-
- ///
- /// Raised after attempting to show the document associated with the entry.
- ///
- /// The customer ledger entry.
- [IntegrationEvent(false, false)]
- local procedure OnAfterShowDoc(var CustLedgerEntry: Record "Cust. Ledger Entry")
- begin
- end;
-
- ///
- /// Raised after showing the posted document attachment.
- ///
- /// The customer ledger entry.
- /// Indicates whether a document was found.
- [IntegrationEvent(false, false)]
- local procedure OnAfterShowPostedDocAttachment(var CustLedgerEntry: Record "Cust. Ledger Entry"; DocumentFound: Boolean)
- begin
- end;
-
- ///
- /// Raised after checking whether the posted document has attachments.
- ///
- /// The customer ledger entry.
- /// Returns whether attachments were found.
- [IntegrationEvent(false, false)]
- local procedure OnAfterHasPostedDocAttachment(var CustLedgerEntry: Record "Cust. Ledger Entry"; var HasPostedDocumentAttachment: Boolean)
- begin
- end;
-
- ///
- /// Raised before drilling down on customer ledger entries.
- ///
- /// The customer ledger entry record.
- /// The detailed customer ledger entry with filters.
- /// The page ID to use for drill-down.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeDrillDownEntries(var CustLedgerEntry: Record "Cust. Ledger Entry"; var DetailedCustLedgEntry: Record "Detailed Cust. Ledg. Entry"; var DrillDownPageID: Integer)
- begin
- end;
-
- ///
- /// Raised before drilling down on overdue customer ledger entries.
- ///
- /// The customer ledger entry record.
- /// The detailed customer ledger entry with filters.
- /// The page ID to use for drill-down.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeDrillDownOnOverdueEntries(var CustLedgerEntry: Record "Cust. Ledger Entry"; var DetailedCustLedgEntry: Record "Detailed Cust. Ledg. Entry"; var DrillDownPageID: Integer)
- begin
- end;
-
- ///
- /// Raised before setting the amount to apply for a customer ledger entry.
- ///
- /// The customer ledger entry.
- /// The document number to apply to.
- /// The customer number.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetAmountToApply(var CustLedgerEntry: Record "Cust. Ledger Entry"; AppliesToDocNo: Code[20]; CustomerNo: Code[20])
- begin
- end;
-
- ///
- /// Raised before determining the visual style for the entry.
- ///
- /// The style text to set.
- /// Set to true to skip default processing.
- [IntegrationEvent(true, false)]
- local procedure OnBeforeSetStyle(var Style: Text; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before showing the document associated with the entry.
- ///
- /// The customer ledger entry.
- /// Returns whether a page was opened.
- /// Set to true to skip default processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowDoc(CustLedgerEntry: Record "Cust. Ledger Entry"; var IsPageOpened: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before validating the Message to Recipient field.
- ///
- /// The customer ledger entry being validated.
- /// Set to true to skip default processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidateMessagetoRecipient(var CustLedgerEntry: Record "Cust. Ledger Entry"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after updating amounts for application.
- ///
- /// The customer ledger entry with updated amounts.
- /// The application date.
- /// The application currency code.
- /// Indicates whether amounts were rounded.
- /// Indicates whether max payment tolerance was updated.
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateAmountsForApplication(var CustLedgerEntry: Record "Cust. Ledger Entry"; ApplnDate: Date; ApplnCurrencyCode: Code[10]; RoundAmounts: Boolean; UpdateMaxPaymentTolerance: Boolean)
- begin
- end;
-
- ///
- /// Raised after getting the remaining payment discount possible.
- ///
- /// The customer ledger entry.
- /// The reference date used.
- /// The remaining payment discount amount.
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetRemainingPmtDiscPossible(CustLedgerEntry: Record "Cust. Ledger Entry"; ReferenceDate: Date; var RemainingPmtDiscPossible: Decimal)
- begin
- end;
-
- ///
- /// Raised before drilling down on overdue entries to allow custom handling.
- ///
- /// The detailed customer ledger entry with filters.
- /// Set to true to skip default processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeDrillDownOnOverdueEntriesBeforeCode(var DetailedCustLedgEntry: Record "Detailed Cust. Ledg. Entry"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before recalculating amounts from one currency to another.
- ///
- /// The customer ledger entry.
- /// The source currency code.
- /// The target currency code.
- /// The posting date for exchange rates.
- /// Set to true to skip default processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeRecalculateAmounts(var CustLedgerEntry: Record "Cust. Ledger Entry"; FromCurrencyCode: Code[10]; ToCurrencyCode: Code[10]; PostingDate: Date; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised before updating amounts for application.
- ///
- /// The customer ledger entry.
- /// The application date.
- /// The application currency code.
- /// Indicates whether to round amounts.
- /// Indicates whether to update max payment tolerance.
- /// Set to true to skip default processing.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateAmountsForApplication(var CustLedgerEntry: Record "Cust. Ledger Entry"; ApplnDate: Date; ApplnCurrencyCode: Code[10]; RoundAmounts: Boolean; UpdateMaxPaymentTolerance: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Raised after calculating the remaining amount when setting amount to apply.
- ///
- /// The customer ledger entry.
- [IntegrationEvent(false, false)]
- local procedure OnSetAmountToApplyOnAfterCalcRemainingAmount(var CustLedgerEntry: Record "Cust. Ledger Entry")
- begin
- end;
-
- ///
- /// Raised before validating the Max Payment Tolerance field to allow custom validation.
- ///
- /// The customer ledger entry being validated.
- [IntegrationEvent(false, false)]
- local procedure OnValidateMaxPaymentToleranceOnBeforeFieldError(var CustLedgerEntry: Record "Cust. Ledger Entry")
- begin
- end;
-}
-
diff --git a/src/Layers/NL/BaseApp/Sales/Receivables/CustomerLedgerEntries.Page.al b/src/Layers/NL/BaseApp/Sales/Receivables/CustomerLedgerEntries.Page.al
deleted file mode 100644
index 1756722e33..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Receivables/CustomerLedgerEntries.Page.al
+++ /dev/null
@@ -1,933 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.Receivables;
-
-using Microsoft.Bank.Reconciliation;
-using Microsoft.EServices.EDocument;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Ledger;
-using Microsoft.Finance.GeneralLedger.Reversal;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Foundation.Navigate;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.FinanceCharge;
-using Microsoft.Sales.Reminder;
-using Microsoft.Sales.Setup;
-using System.Diagnostics;
-using System.Security.User;
-using System.Utilities;
-
-///
-/// Displays all customer ledger entries with options to view details, apply entries, navigate to related documents, and perform entry management tasks.
-///
-page 25 "Customer Ledger Entries"
-{
- ApplicationArea = Basic, Suite;
- Caption = 'Customer Ledger Entries';
- DataCaptionFields = "Customer No.";
- DeleteAllowed = false;
- InsertAllowed = false;
- PageType = List;
- AboutTitle = 'About Customer Ledger Entries';
- AboutText = 'View and manage all financial transactions posted to customer accounts, including invoices, payments, credit memos, and refunds, and apply payments or credits to close outstanding entries and keep customer balances up-to-date.';
- Permissions = TableData "Cust. Ledger Entry" = m;
- SourceTable = "Cust. Ledger Entry";
- SourceTableView = sorting("Customer No.", "Posting Date") order(descending);
- UsageCategory = History;
-
- layout
- {
- area(content)
- {
- repeater(Control1)
- {
- ShowCaption = false;
- field("Posting Date"; Rec."Posting Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Document Date"; Rec."Document Date")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Document Type"; Rec."Document Type")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- StyleExpr = StyleTxt;
- }
- field("Document No."; Rec."Document No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- StyleExpr = StyleTxt;
- }
- field("Customer No."; Rec."Customer No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Customer Name"; Rec."Customer Name")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = CustNameVisible;
- }
- field(Description; Rec.Description)
- {
- ApplicationArea = Basic, Suite;
- Editable = true;
- }
- field("Global Dimension 1 Code"; Rec."Global Dimension 1 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim1Visible;
- }
- field("Global Dimension 2 Code"; Rec."Global Dimension 2 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim2Visible;
- }
- field("Customer Posting Group"; Rec."Customer Posting Group")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("IC Partner Code"; Rec."IC Partner Code")
- {
- ApplicationArea = Intercompany;
- Editable = false;
- Visible = false;
- }
- field("Salesperson Code"; Rec."Salesperson Code")
- {
- ApplicationArea = Suite;
- Editable = false;
- Visible = false;
- }
- field("Currency Code"; Rec."Currency Code")
- {
- ApplicationArea = Suite;
- Editable = false;
- }
- field("Original Amount"; Rec."Original Amount")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Original Amt. (LCY)"; Rec."Original Amt. (LCY)")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field(Amount; Rec.Amount)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = AmountVisible;
- }
- field("Amount (LCY)"; Rec."Amount (LCY)")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = AmountVisible;
- }
- field("Debit Amount"; Rec."Debit Amount")
- {
- ApplicationArea = Basic, Suite;
- Visible = DebitCreditVisible;
- }
- field("Debit Amount (LCY)"; Rec."Debit Amount (LCY)")
- {
- ApplicationArea = Basic, Suite;
- Visible = DebitCreditVisible;
- }
- field("Credit Amount"; Rec."Credit Amount")
- {
- ApplicationArea = Basic, Suite;
- Visible = DebitCreditVisible;
- }
- field("Credit Amount (LCY)"; Rec."Credit Amount (LCY)")
- {
- ApplicationArea = Basic, Suite;
- Visible = DebitCreditVisible;
- }
- field(RunningBalanceLCY; CalcRunningCustBalance.GetCustomerBalanceLCY(Rec))
- {
- ApplicationArea = Basic, Suite;
- AutoFormatType = 1;
- AutoFormatExpression = '';
- Caption = 'Running Balance (LCY)';
- ToolTip = 'Specifies the running balance in LCY.';
- Visible = false;
- }
- field("Remaining Amount"; Rec."Remaining Amount")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Remaining Amt. (LCY)"; Rec."Remaining Amt. (LCY)")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Payments in Process"; Rec."Payments in Process")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the total amount of payments/collections in process.';
- }
- field("Sales (LCY)"; Rec."Sales (LCY)")
- {
- ApplicationArea = Suite;
- Editable = false;
- }
- field("Bal. Account Type"; Rec."Bal. Account Type")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Bal. Account No."; Rec."Bal. Account No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Due Date"; Rec."Due Date")
- {
- ApplicationArea = Basic, Suite;
- StyleExpr = StyleTxt;
- }
- field("Promised Pay Date"; Rec."Promised Pay Date")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- Importance = Promoted;
- }
-
- field("Pmt. Discount Date"; Rec."Pmt. Discount Date")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Pmt. Disc. Tolerance Date"; Rec."Pmt. Disc. Tolerance Date")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Original Pmt. Disc. Possible"; Rec."Original Pmt. Disc. Possible")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Remaining Pmt. Disc. Possible"; Rec."Remaining Pmt. Disc. Possible")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Max. Payment Tolerance"; Rec."Max. Payment Tolerance")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Payment Method Code"; Rec."Payment Method Code")
- {
- ApplicationArea = Basic, Suite;
- }
- field(Open; Rec.Open)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Closed at Date"; Rec."Closed at Date")
- {
- Visible = false;
- ApplicationArea = Basic, Suite;
- }
- field("Dispute Status"; Rec."Dispute Status")
- {
- ApplicationArea = Basic, Suite;
- }
- field("On Hold"; Rec."On Hold")
- {
- ApplicationArea = Basic, Suite;
- }
-
- field("User ID"; Rec."User ID")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
-
- trigger OnDrillDown()
- var
- UserMgt: Codeunit "User Management";
- begin
- UserMgt.DisplayUserInformation(Rec."User ID");
- end;
- }
- field("Source Code"; Rec."Source Code")
- {
- ApplicationArea = Suite;
- Editable = false;
- Visible = false;
- }
- field("Reason Code"; Rec."Reason Code")
- {
- ApplicationArea = Suite;
- Editable = false;
- Visible = false;
- }
- field(Reversed; Rec.Reversed)
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Reversed by Entry No."; Rec."Reversed by Entry No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Reversed Entry No."; Rec."Reversed Entry No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Entry No."; Rec."Entry No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("G/L Register No."; Rec."G/L Register No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Transaction Mode Code"; Rec."Transaction Mode Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the way a ledger entry can be paid or collected through telebanking.';
- }
- field("Transaction No."; Rec."Transaction No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- }
- field("Exported to Payment File"; Rec."Exported to Payment File")
- {
- ApplicationArea = Basic, Suite;
- Editable = true;
- trigger OnValidate()
- var
- ConfirmManagement: Codeunit "Confirm Management";
- begin
- if not ConfirmManagement.GetResponseOrDefault(ExportToPaymentFileConfirmTxt, true) then
- Error('');
- end;
- }
- field("Message to Recipient"; Rec."Message to Recipient")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Direct Debit Mandate ID"; Rec."Direct Debit Mandate ID")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- field("Dimension Set ID"; Rec."Dimension Set ID")
- {
- ApplicationArea = Dimensions;
- Visible = false;
- }
- field("External Document No."; Rec."External Document No.")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field("Your Reference"; Rec."Your Reference")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- Visible = false;
- }
- field(RecipientBankAccount; Rec."Recipient Bank Account")
- {
- ApplicationArea = Basic, Suite;
- }
- field("Shortcut Dimension 3 Code"; Rec."Shortcut Dimension 3 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim3Visible;
- }
- field("Shortcut Dimension 4 Code"; Rec."Shortcut Dimension 4 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim4Visible;
- }
- field("Shortcut Dimension 5 Code"; Rec."Shortcut Dimension 5 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim5Visible;
- }
- field("Shortcut Dimension 6 Code"; Rec."Shortcut Dimension 6 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim6Visible;
- }
- field("Shortcut Dimension 7 Code"; Rec."Shortcut Dimension 7 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim7Visible;
- }
- field("Shortcut Dimension 8 Code"; Rec."Shortcut Dimension 8 Code")
- {
- ApplicationArea = Dimensions;
- Editable = false;
- Visible = Dim8Visible;
- }
- }
- }
- area(factboxes)
- {
- part(Control1903096107; "Customer Ledger Entry FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "Entry No." = field("Entry No.");
- Visible = true;
- }
- part(IncomingDocAttachFactBox; "Incoming Doc. Attach. FactBox")
- {
- ApplicationArea = Basic, Suite;
- ShowFilter = false;
- SubPageLink = "Posting Date" = field("Posting Date"), "Document No." = field("Document No.");
- }
- part(Control38; "Customer Details FactBox")
- {
- ApplicationArea = Basic, Suite;
- SubPageLink = "No." = field("Customer No."),
- "Date Filter" = field("Date Filter");
- }
- part(GLEntriesPart; "G/L Entries Part")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Related G/L Entries';
- ShowFilter = false;
- SubPageLink = "Posting Date" = field("Posting Date"), "Document No." = field("Document No.");
- }
- systempart(Control1900383207; Links)
- {
- ApplicationArea = RecordLinks;
- Visible = false;
- }
- systempart(Control1905767507; Notes)
- {
- ApplicationArea = Notes;
- Visible = false;
- }
- }
- }
-
- actions
- {
- area(navigation)
- {
- group("Ent&ry")
- {
- Caption = 'Ent&ry';
- Image = Entry;
- action("Reminder/Fin. Charge Entries")
- {
- ApplicationArea = Suite;
- Caption = 'Reminder/Fin. Charge Entries';
- Image = Reminder;
- RunObject = Page "Reminder/Fin. Charge Entries";
- RunPageLink = "Customer Entry No." = field("Entry No.");
- RunPageView = sorting("Customer Entry No.");
- Scope = Repeater;
- ToolTip = 'View the reminders and finance charge entries that you have entered for the customer.';
- }
- action(AppliedEntries)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Applied E&ntries';
- Image = Approve;
- RunObject = Page "Applied Customer Entries";
- RunPageOnRec = true;
- Scope = Repeater;
- ToolTip = 'View the ledger entries that have been applied to this record.';
- }
- action(Customer)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer';
- Image = Customer;
- RunObject = Page "Customer Card";
- RunPageLink = "No." = field("Customer No.");
- ShortCutKey = 'Shift+F7';
- ToolTip = 'View or edit detailed information about the customer.';
- }
- action(Dimensions)
- {
- AccessByPermission = TableData Dimension = R;
- ApplicationArea = Dimensions;
- Caption = 'Dimensions';
- Image = Dimensions;
- Scope = Repeater;
- ShortCutKey = 'Alt+D';
- ToolTip = 'View or edit dimensions, such as area, project, or department, that you can assign to sales and purchase documents to distribute costs and analyze transaction history.';
-
- trigger OnAction()
- begin
- Rec.ShowDimensions();
- end;
- }
- action(SetDimensionFilter)
- {
- ApplicationArea = Dimensions;
- Caption = 'Set Dimension Filter';
- Ellipsis = true;
- Image = "Filter";
- ToolTip = 'Limit the entries according to the dimension filters that you specify. NOTE: If you use a high number of dimension combinations, this function may not work and can result in a message that the SQL server only supports a maximum of 2100 parameters.';
-
- trigger OnAction()
- begin
- Rec.SetFilter("Dimension Set ID", DimensionSetIDFilter.LookupFilter());
- end;
- }
- action("Detailed &Ledger Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Detailed &Ledger Entries';
- Image = View;
- RunObject = Page "Detailed Cust. Ledg. Entries";
- RunPageLink = "Cust. Ledger Entry No." = field("Entry No."),
- "Customer No." = field("Customer No.");
- RunPageView = sorting("Cust. Ledger Entry No.", "Posting Date");
- Scope = Repeater;
- ShortCutKey = 'Ctrl+F7';
- ToolTip = 'View a summary of the all posted entries and adjustments related to a specific customer ledger entry.';
- }
- }
- }
- area(processing)
- {
- group("F&unctions")
- {
- Caption = 'F&unctions';
- Image = "Action";
- action("Create Reminder")
- {
- ApplicationArea = Basic, Suite;
- Scope = Repeater;
- Ellipsis = true;
- Image = CreateReminders;
- Caption = 'Create Reminder';
- ToolTip = 'Create reminders for this customer if they have overdue payments.';
- trigger OnAction()
- var
- Customer: Record "Customer";
- ReminderHeader: Record "Reminder Header";
- begin
- ReminderHeader.SetRange("Customer No.", Rec."Customer No.");
- if ReminderHeader.FindFirst() then begin
- page.RunModal(Page::Reminder, ReminderHeader);
- exit
- end;
- Customer.SetRange("No.", Rec."Customer No.");
- REPORT.RunModal(REPORT::"Create Reminders", true, true, Customer);
- ReminderHeader.SetRange("Customer No.", Rec."Customer No.");
- if ReminderHeader.FindFirst() then begin
- commit();
- page.RunModal(Page::Reminder, ReminderHeader);
- exit
- end;
- Error(NoReminderCreatedErr);
- end;
- }
- action("Create Finance Charge Memo")
- {
- ApplicationArea = Basic, Suite;
- Scope = Repeater;
- Ellipsis = true;
- Caption = 'Create Finance Charge Memo';
- Image = CreateReminders;
- ToolTip = 'Create finance charge memos for this customer if they have overdue payments';
- trigger OnAction()
- var
- Customer: Record "Customer";
- FinanceChargeMemoHeader: Record "Finance Charge Memo Header";
- begin
- FinanceChargeMemoHeader.SetRange("Customer No.", Rec."Customer No.");
- if FinanceChargeMemoHeader.FindFirst() then begin
- page.RunModal(Page::"Finance Charge Memo", FinanceChargeMemoHeader);
- exit
- end;
- Customer.SetRange("No.", Rec."Customer No.");
- REPORT.RunModal(REPORT::"Create Finance Charge Memos", true, true, Customer);
- FinanceChargeMemoHeader.SetRange("Customer No.", Rec."Customer No.");
- if FinanceChargeMemoHeader.FindFirst() then begin
- Commit();
- page.RunModal(Page::"Finance Charge Memo", FinanceChargeMemoHeader);
- exit
- end;
- Error(NoFinanceChargeMemoHeaderCreatedErr);
- end;
- }
- action("Apply Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Apply Entries';
- Image = ApplyEntries;
- Scope = Repeater;
- ShortCutKey = 'Shift+F11';
- ToolTip = 'Select one or more ledger entries that you want to apply this record to so that the related posted documents are closed as paid or refunded.';
-
- trigger OnAction()
- var
- CustLedgEntry: Record "Cust. Ledger Entry";
- CustEntryApplyPostEntries: Codeunit "CustEntry-Apply Posted Entries";
- begin
- CustLedgEntry.Copy(Rec);
- CustEntryApplyPostEntries.ApplyCustEntryFormEntry(CustLedgEntry);
- CustLedgEntry.Get(CustLedgEntry."Entry No.");
- Rec := CustLedgEntry;
- CurrPage.Update();
- end;
- }
- action(UnapplyEntries)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Unapply Entries';
- Ellipsis = true;
- Image = UnApply;
- Scope = Repeater;
- ToolTip = 'Unselect one or more ledger entries that you want to unapply this record.';
-
- trigger OnAction()
- var
- CustEntryApplyPostedEntries: Codeunit "CustEntry-Apply Posted Entries";
- begin
- CustEntryApplyPostedEntries.UnApplyCustLedgEntry(Rec."Entry No.");
- end;
- }
- action(ReverseTransaction)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Reverse Transaction';
- Ellipsis = true;
- Image = ReverseRegister;
- Scope = Repeater;
- ToolTip = 'Reverse an erroneous customer ledger entry.';
-
- trigger OnAction()
- var
- ReversalEntry: Record "Reversal Entry";
- ReversePaymentRecJournal: Codeunit "Reverse Payment Rec. Journal";
- begin
- ReversePaymentRecJournal.ErrorIfEntryIsNotReversable(Rec);
- ReversalEntry.ReverseTransaction(Rec."Transaction No.");
- Clear(CalcRunningCustBalance);
- end;
- }
- group(IncomingDocument)
- {
- Caption = 'Incoming Document';
- Image = Documents;
- action(IncomingDocCard)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'View Incoming Document';
- Enabled = HasIncomingDocument;
- Image = ViewOrder;
- ToolTip = 'View any incoming document records and file attachments that exist for the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.ShowCard(Rec."Document No.", Rec."Posting Date");
- end;
- }
- action(SelectIncomingDoc)
- {
- AccessByPermission = TableData "Incoming Document" = R;
- ApplicationArea = Basic, Suite;
- Caption = 'Select Incoming Document';
- Enabled = not HasIncomingDocument;
- Image = SelectLineToApply;
- ToolTip = 'Select an incoming document record and file attachment that you want to link to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- IncomingDocument.SelectIncomingDocumentForPostedDocument(Rec."Document No.", Rec."Posting Date", Rec.RecordId);
- end;
- }
- action(IncomingDocAttachFile)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Create Incoming Document from File';
- Ellipsis = true;
- Enabled = not HasIncomingDocument;
- Image = Attach;
- ToolTip = 'Create an incoming document record by selecting a file to attach, and then link the incoming document record to the entry or document.';
-
- trigger OnAction()
- var
- IncomingDocumentAttachment: Record "Incoming Document Attachment";
- begin
- IncomingDocumentAttachment.NewAttachmentFromPostedDocument(Rec."Document No.", Rec."Posting Date");
- end;
- }
- }
- }
- action("&Navigate")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Find entries...';
- Image = Navigate;
- Scope = Repeater;
- ShortCutKey = 'Ctrl+Alt+Q';
- ToolTip = 'Find entries and documents that exist for the document number and posting date on the selected document. (Formerly this action was named Navigate.)';
-
- trigger OnAction()
- begin
- Navigate.SetDoc(Rec."Posting Date", Rec."Document No.");
- Navigate.Run();
- end;
- }
- action("Show Document")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Show Document';
- Image = Document;
- ShortCutKey = 'Return';
- ToolTip = 'Show details for the posted payment, invoice, or credit memo.';
-
- trigger OnAction()
- begin
- Rec.ShowDoc();
- end;
- }
- action(ShowDocumentAttachment)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Show Document Attachment';
- Enabled = HasDocumentAttachment;
- Image = Attach;
- ToolTip = 'View documents or images that are attached to the posted invoice or credit memo.';
-
- trigger OnAction()
- begin
- Rec.ShowPostedDocAttachment();
- end;
- }
- action(ShowChangeHistory)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Show Change History';
- Image = History;
- ToolTip = 'View the history of changes for this entry.';
-
- trigger OnAction()
- var
- ChangeLogEntry: Record "Change Log Entry";
- begin
- SetChangeLogEntriesFilter(ChangeLogEntry);
- Page.RunModal(Page::"Change Log Entries", ChangeLogEntry);
- end;
- }
- }
- area(Promoted)
- {
- group(Category_Process)
- {
- Caption = 'Process', Comment = 'Generated from the PromotedActionCategories property index 1.';
-
- group(Category_Category4)
- {
- Caption = 'Line', Comment = 'Generated from the PromotedActionCategories property index 3.';
- ShowAs = SplitButton;
-
- actionref("Show Document_Promoted"; "Show Document")
- {
- }
- actionref(ShowDocumentAttachment_Promoted; ShowDocumentAttachment)
- {
- }
- }
- group(Category_ApplyEntries)
- {
- Caption = 'Apply Entries';
- ShowAs = SplitButton;
-
- actionref("Apply Entries_Promoted"; "Apply Entries")
- {
- }
- actionref(UnapplyEntries_Promoted; UnapplyEntries)
- {
- }
- }
- actionref("&Navigate_Promoted"; "&Navigate")
- {
- }
- actionref(ReverseTransaction_Promoted; ReverseTransaction)
- {
- }
- actionref("Create Reminder_Promoted"; "Create Reminder")
- {
- }
- actionref("Create Finance Charge Memo_Promoted"; "Create Finance Charge Memo")
- {
- }
- }
- group(Category_Category5)
- {
- Caption = 'Entry', Comment = 'Generated from the PromotedActionCategories property index 4.';
-
- actionref(Dimensions_Promoted; Dimensions)
- {
- }
- actionref(SetDimensionFilter_Promoted; SetDimensionFilter)
- {
- }
- actionref(AppliedEntries_Promoted; AppliedEntries)
- {
- }
- actionref("Reminder/Fin. Charge Entries_Promoted"; "Reminder/Fin. Charge Entries")
- {
- }
- actionref("Detailed &Ledger Entries_Promoted"; "Detailed &Ledger Entries")
- {
- }
-
- separator(Navigate_Separator)
- {
- }
-
- actionref(Customer_Promoted; Customer)
- {
- }
- }
- group(Category_Category6)
- {
- Caption = 'Navigate', Comment = 'Generated from the PromotedActionCategories property index 5.';
- }
- group(Category_Report)
- {
- Caption = 'Report', Comment = 'Generated from the PromotedActionCategories property index 2.';
- }
- }
- }
-
- analysisviews
- {
- analysisview("Aged accounts by month")
- {
- Caption = 'Aged accounts by month';
- DefinitionFile = './Sales/Receivables/Aged accounts by month.analysis.json';
- ToolTip = 'See what your customers owe you, for example, broken down into time intervals for when amounts are due.';
- }
- analysisview("Customer sales by volume")
- {
- Caption = 'Customer sales by volume';
- DefinitionFile = './Sales/Receivables/Customer sales by volume.analysis.json';
- ToolTip = 'Get an overview of the customers that purchase the most, or that owe the most.';
- }
- }
-
- trigger OnAfterGetCurrRecord()
- var
- IncomingDocument: Record "Incoming Document";
- begin
- HasIncomingDocument := IncomingDocument.PostedDocExists(Rec."Document No.", Rec."Posting Date");
- HasDocumentAttachment := Rec.HasPostedDocAttachment();
- end;
-
- trigger OnAfterGetRecord()
- begin
- StyleTxt := Rec.SetStyle();
- end;
-
- trigger OnInit()
- begin
- AmountVisible := true;
- end;
-
- trigger OnModifyRecord(): Boolean
- begin
- CODEUNIT.Run(CODEUNIT::"Cust. Entry-Edit", Rec);
- exit(false);
- end;
-
- trigger OnOpenPage()
- begin
- SetControlVisibility();
- SetDimVisibility();
-
- if (Rec.GetFilters() <> '') and not Rec.Find() then
- if Rec.FindFirst() then;
- end;
-
- var
- CalcRunningCustBalance: Codeunit "Calc. Running Cust. Balance";
- Navigate: Page Navigate;
- DimensionSetIDFilter: Page "Dimension Set ID Filter";
- HasIncomingDocument: Boolean;
- HasDocumentAttachment: Boolean;
- AmountVisible: Boolean;
- DebitCreditVisible: Boolean;
- CustNameVisible: Boolean;
- ExportToPaymentFileConfirmTxt: Label 'Editing the Exported to Payment File field will change the payment suggestions in the Payment Journal. Edit this field only if you must correct a mistake.\Do you want to continue?';
- NoReminderCreatedErr: Label 'No reminder was created. Check the reminder terms for the customer.';
- NoFinanceChargeMemoHeaderCreatedErr: Label 'No finance charge memo was created. Check the finance charge terms for the customer.';
-
- protected var
- Dim1Visible: Boolean;
- Dim2Visible: Boolean;
- Dim3Visible: Boolean;
- Dim4Visible: Boolean;
- Dim5Visible: Boolean;
- Dim6Visible: Boolean;
- Dim7Visible: Boolean;
- Dim8Visible: Boolean;
- StyleTxt: Text;
-
- local procedure SetDimVisibility()
- var
- DimensionManagement: Codeunit DimensionManagement;
- begin
- DimensionManagement.UseShortcutDims(Dim1Visible, Dim2Visible, Dim3Visible, Dim4Visible, Dim5Visible, Dim6Visible, Dim7Visible, Dim8Visible);
- end;
-
- local procedure SetControlVisibility()
- var
- GLSetup: Record "General Ledger Setup";
- SalesSetup: Record "Sales & Receivables Setup";
- begin
- GLSetup.Get();
- AmountVisible := not (GLSetup."Show Amounts" = GLSetup."Show Amounts"::"Debit/Credit Only");
- DebitCreditVisible := not (GLSetup."Show Amounts" = GLSetup."Show Amounts"::"Amount Only");
- SalesSetup.Get();
- CustNameVisible := SalesSetup."Copy Customer Name to Entries";
- end;
-
- local procedure SetChangeLogEntriesFilter(var ChangeLogEntry: Record "Change Log Entry")
- begin
- ChangeLogEntry.SetRange("Table No.", Database::"Cust. Ledger Entry");
- ChangeLogEntry.SetRange("Primary Key Field 1 Value", Format(Rec."Entry No.", 0, 9));
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Sales/Setup/SalesReceivablesSetup.Table.al b/src/Layers/NL/BaseApp/Sales/Setup/SalesReceivablesSetup.Table.al
deleted file mode 100644
index fac2cd2772..0000000000
--- a/src/Layers/NL/BaseApp/Sales/Setup/SalesReceivablesSetup.Table.al
+++ /dev/null
@@ -1,1072 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// 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.Setup;
-
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.Foundation.Enums;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Integration.D365Sales;
-using Microsoft.Integration.Dataverse;
-using Microsoft.Inventory.Item;
-using Microsoft.Pricing.Calculation;
-using Microsoft.Pricing.PriceList;
-using Microsoft.Projects.Resources.Resource;
-using Microsoft.Sales.Document;
-using Microsoft.Sales.History;
-using Microsoft.Sales.Pricing;
-using Microsoft.Upgrade;
-using Microsoft.Utilities;
-using Microsoft.Warehouse.Structure;
-using System.Environment;
-using System.Threading;
-
-///
-/// Stores configuration settings for the Sales and Receivables module, including posting options, number series, pricing methods, archiving preferences, and Dynamics 365 Sales integration.
-///
-table 311 "Sales & Receivables Setup"
-{
- Caption = 'Sales & Receivables Setup';
- DrillDownPageID = "Sales & Receivables Setup";
- LookupPageID = "Sales & Receivables Setup";
- DataClassification = CustomerContent;
-
- fields
- {
- ///
- /// Specifies the unique identifier for the Sales and Receivables Setup record.
- ///
- field(1; "Primary Key"; Code[10])
- {
- AllowInCustomizations = Never;
- Caption = 'Primary Key';
- }
- ///
- /// Specifies how sales discounts are posted to the general ledger, including options for invoice discounts, line discounts, or both.
- ///
- field(2; "Discount Posting"; Option)
- {
- Caption = 'Discount Posting';
- OptionCaption = 'No Discounts,Invoice Discounts,Line Discounts,All Discounts';
- OptionMembers = "No Discounts","Invoice Discounts","Line Discounts","All Discounts";
- ToolTip = 'Specifies the type of sales discounts to post separately. No Discounts: Discounts are not posted separately but instead will subtract the discount before posting. Invoice Discounts: The invoice discount and invoice amount are posted simultaneously, based on the Sales Inv. Disc. Account field in the General Posting Setup window. Line Discounts: The line discount and the invoice amount will be posted simultaneously, based on Sales Line Disc. Account field in the General Posting Setup window. All Discounts: The invoice and line discounts and the invoice amount will be posted simultaneously, based on the Sales Inv. Disc. Account field and Sales Line. Disc. Account fields in the General Posting Setup window.';
-
- trigger OnValidate()
- var
- DiscountNotificationMgt: Codeunit "Discount Notification Mgt.";
- begin
- DiscountNotificationMgt.NotifyAboutMissingSetup(RecordId, '', "Discount Posting", 0);
- end;
- }
- ///
- /// Specifies which warnings to display when creating sales documents for customers with credit limit or overdue balance issues.
- ///
- field(4; "Credit Warnings"; Option)
- {
- Caption = 'Credit Warnings';
- OptionCaption = 'Both Warnings,Credit Limit,Overdue Balance,No Warning';
- OptionMembers = "Both Warnings","Credit Limit","Overdue Balance","No Warning";
- ToolTip = 'Specifies whether to warn about the customer''s status when you create a sales order or invoice.';
- }
- ///
- /// Indicates whether to display a warning when entering a quantity on a sales document that would reduce inventory below zero.
- ///
- field(5; "Stockout Warning"; Boolean)
- {
- Caption = 'Stockout Warning';
- InitValue = true;
- ToolTip = 'Specifies if a warning is displayed when you enter a quantity on a sales document that brings the item''s inventory level below zero.';
- }
- ///
- /// Indicates whether a shipment document is automatically created when posting a sales invoice.
- ///
- field(6; "Shipment on Invoice"; Boolean)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Shipment on Invoice';
- ToolTip = 'Specifies if a posted shipment and a posted invoice are automatically created when you post an invoice.';
- }
- ///
- /// Indicates whether invoice amounts are rounded according to the invoice rounding precision defined in General Ledger Setup.
- ///
- field(7; "Invoice Rounding"; Boolean)
- {
- Caption = 'Invoice Rounding';
- ToolTip = 'Specifies if amounts are rounded for sales invoices. Rounding is applied as specified in the Inv. Rounding Precision (LCY) field in the General Ledger Setup window. ';
- }
- ///
- /// Indicates whether an external document number must be entered on sales documents and general journal lines.
- ///
- field(8; "Ext. Doc. No. Mandatory"; Boolean)
- {
- Caption = 'Ext. Doc. No. Mandatory';
- ToolTip = 'Specifies if it is mandatory to enter an external document number in the External Document No. field on a sales header or the External Document No. field on a general journal line.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to new customers.
- ///
- field(9; "Customer Nos."; Code[20])
- {
- Caption = 'Customer Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to customers.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to new sales quotes.
- ///
- field(10; "Quote Nos."; Code[20])
- {
- Caption = 'Quote Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to sales quotes.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to new sales orders.
- ///
- field(11; "Order Nos."; Code[20])
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Order Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to sales orders.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to new sales invoices.
- ///
- field(12; "Invoice Nos."; Code[20])
- {
- Caption = 'Invoice Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to sales invoices.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to posted sales invoices.
- ///
- field(13; "Posted Invoice Nos."; Code[20])
- {
- Caption = 'Posted Invoice Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to posted sales invoices.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to new sales credit memos.
- ///
- field(14; "Credit Memo Nos."; Code[20])
- {
- Caption = 'Credit Memo Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to sales credit memos.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to posted sales credit memos.
- ///
- field(15; "Posted Credit Memo Nos."; Code[20])
- {
- Caption = 'Posted Credit Memo Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to posted sales credit memos.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to posted sales shipments.
- ///
- field(16; "Posted Shipment Nos."; Code[20])
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Posted Shipment Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to posted shipments.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to new reminders.
- ///
- field(17; "Reminder Nos."; Code[20])
- {
- Caption = 'Reminder Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to reminders.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to issued reminders.
- ///
- field(18; "Issued Reminder Nos."; Code[20])
- {
- Caption = 'Issued Reminder Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to issued reminders.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to new finance charge memos.
- ///
- field(19; "Fin. Chrg. Memo Nos."; Code[20])
- {
- Caption = 'Fin. Chrg. Memo Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to finance charge memos.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to issued finance charge memos.
- ///
- field(20; "Issued Fin. Chrg. M. Nos."; Code[20])
- {
- Caption = 'Issued Fin. Chrg. M. Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to issued finance charge memos.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to posted sales prepayment invoices.
- ///
- field(21; "Posted Prepmt. Inv. Nos."; Code[20])
- {
- Caption = 'Posted Prepmt. Inv. Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to posted sales prepayment invoices.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to posted sales prepayment credit memos.
- ///
- field(22; "Posted Prepmt. Cr. Memo Nos."; Code[20])
- {
- Caption = 'Posted Prepmt. Cr. Memo Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to posted sales prepayment credit memos.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to new blanket sales orders.
- ///
- field(23; "Blanket Order Nos."; Code[20])
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Blanket Order Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to blanket sales orders.';
- }
- ///
- /// Indicates whether the invoice discount is automatically calculated based on customer discount settings.
- ///
- field(24; "Calc. Inv. Discount"; Boolean)
- {
- Caption = 'Calc. Inv. Discount';
- ToolTip = 'Specifies if the invoice discount amount is automatically calculated with sales documents. If this check box is selected, then the invoice discount amount is calculated automatically, based on sales lines where the Allow Invoice Disc. field is selected.';
- }
- ///
- /// Specifies which currency combinations are allowed when applying customer payments to invoices in different currencies.
- ///
- field(25; "Appln. between Currencies"; Option)
- {
- AccessByPermission = TableData Currency = R;
- Caption = 'Appln. between Currencies';
- OptionCaption = 'None,EMU,All';
- OptionMembers = "None",EMU,All;
- ToolTip = 'Specifies whether it is allowed to apply customer payments in different currencies. None: All entries involved in one application must be in the same currency. EMU: You can apply entries in euro and one of the old national currencies (for EMU countries/regions) to one another. All: You can apply entries in different currencies to one another. The entries can be in any currency.';
- }
- ///
- /// Indicates whether comments from blanket sales orders are copied to the related sales orders.
- ///
- field(26; "Copy Comments Blanket to Order"; Boolean)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Copy Comments Blanket to Order';
- InitValue = true;
- ToolTip = 'Specifies whether to copy comments from blanket sales orders to sales orders.';
- }
- ///
- /// Indicates whether comments from sales orders are copied to the related sales invoices.
- ///
- field(27; "Copy Comments Order to Invoice"; Boolean)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Copy Comments Order to Invoice';
- InitValue = true;
- ToolTip = 'Specifies whether to copy comments from sales orders to sales invoices.';
- }
- ///
- /// Indicates whether comments from sales orders are copied to the related shipment documents.
- ///
- field(28; "Copy Comments Order to Shpt."; Boolean)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Copy Comments Order to Shpt.';
- InitValue = true;
- ToolTip = 'Specifies whether to copy comments from sales orders to shipments.';
- }
- ///
- /// Indicates whether users can manually adjust VAT amounts on sales documents within the allowed VAT difference.
- ///
- field(29; "Allow VAT Difference"; Boolean)
- {
- Caption = 'Allow VAT Difference';
- ToolTip = 'Specifies whether to allow the manual adjustment of VAT amounts in sales documents.';
- }
- ///
- /// Indicates whether invoice discounts are calculated separately for each VAT identifier on the document.
- ///
- field(30; "Calc. Inv. Disc. per VAT ID"; Boolean)
- {
- Caption = 'Calc. Inv. Disc. per VAT ID';
- ToolTip = 'Specifies whether the invoice discount is calculated according to the VAT identifier that is defined in the VAT posting setup. If you choose not to select this check box, the invoice discount will be calculated based on the invoice total.';
- }
- ///
- /// Specifies the position where the company logo appears on printed sales documents such as invoices and orders.
- ///
- field(31; "Logo Position on Documents"; Option)
- {
- Caption = 'Logo Position on Documents';
- OptionCaption = 'No Logo,Left,Center,Right';
- OptionMembers = "No Logo",Left,Center,Right;
- ToolTip = 'Specifies the position of your company logo on business letters and documents.';
- }
- ///
- /// Indicates whether posting is blocked when prepayment invoices remain unpaid on sales orders.
- ///
- field(32; "Check Prepmt. when Posting"; Boolean)
- {
- Caption = 'Check Prepmt. when Posting';
- ToolTip = 'Specifies that you cannot ship or invoice an order that has an unpaid prepayment amount.';
- }
- ///
- /// Specifies how often a job queue entry runs to automatically update the prepayment status of sales orders.
- ///
- field(33; "Prepmt. Auto Update Frequency"; Option)
- {
- Caption = 'Prepmt. Auto Update Frequency';
- DataClassification = SystemMetadata;
- OptionCaption = 'Never,Daily,Weekly';
- OptionMembers = Never,Daily,Weekly;
- ToolTip = 'Specifies how often the job must run that automatically updates the status of orders that are pending prepayment.';
-
- trigger OnValidate()
- var
- PrepaymentMgt: Codeunit "Prepayment Mgt.";
- begin
- if "Prepmt. Auto Update Frequency" = xRec."Prepmt. Auto Update Frequency" then
- exit;
-
- PrepaymentMgt.CreateAndStartJobQueueEntrySales("Prepmt. Auto Update Frequency");
- end;
- }
- ///
- /// Specifies whether new sales documents default to the work date or no date for the posting date field.
- ///
- field(35; "Default Posting Date"; Enum "Default Posting Date")
- {
- Caption = 'Default Posting Date';
- ToolTip = 'Specifies which date must be used as the default posting date on sales documents. If you select Work Date, the Posting Date field will be populated with the work date at the time of creating a new sales document. If you select No Date, the Posting Date field will be empty by default and you must manually enter a posting date before posting.';
- }
- ///
- /// Specifies whether the quantity to ship field on sales order lines defaults to the remaining quantity or blank.
- ///
- field(36; "Default Quantity to Ship"; Option)
- {
- AccessByPermission = TableData "Sales Shipment Header" = R;
- Caption = 'Default Quantity to Ship';
- OptionCaption = 'Remainder,Blank';
- OptionMembers = Remainder,Blank;
- ToolTip = 'Specifies the default value for the Qty. to Ship field on sales order lines and the Return Qty. to Receive field on sales return order lines. If you choose Blank, the quantity to ship is not automatically calculated.';
- }
- ///
- /// Indicates whether sales documents are posted in the background using job queue entries.
- ///
- field(38; "Post with Job Queue"; Boolean)
- {
- Caption = 'Post with Job Queue';
- ToolTip = 'Specifies if you use job queues to post sales documents in the background.';
-
- trigger OnValidate()
- begin
- if not "Post with Job Queue" then
- "Post & Print with Job Queue" := false;
- end;
- }
- ///
- /// Specifies the category code for job queue entries used for background posting of sales documents.
- ///
- field(39; "Job Queue Category Code"; Code[10])
- {
- Caption = 'Job Queue Category Code';
- TableRelation = "Job Queue Category";
- ToolTip = 'Specifies the code for the category of the job queue that you want to associate with background posting.';
- }
- ///
- /// Specifies the priority level for job queue entries that post sales documents in the background.
- ///
- field(40; "Job Queue Priority for Post"; Integer)
- {
- Caption = 'Job Queue Priority for Post';
- InitValue = 1000;
- MinValue = 0;
-
- trigger OnValidate()
- begin
- if "Job Queue Priority for Post" < 0 then
- Error(JobQueuePriorityErr);
- end;
- }
- ///
- /// Indicates whether sales documents are posted and printed in the background using job queue entries.
- ///
- field(41; "Post & Print with Job Queue"; Boolean)
- {
- Caption = 'Post & Print with Job Queue';
- ToolTip = 'Specifies if you use job queues to post and print sales documents in the background.';
-
- trigger OnValidate()
- begin
- if "Post & Print with Job Queue" then
- "Post with Job Queue" := true;
- end;
- }
- ///
- /// Specifies the priority level for job queue entries that post and print sales documents in the background.
- ///
- field(42; "Job Q. Prio. for Post & Print"; Integer)
- {
- Caption = 'Job Q. Prio. for Post & Print';
- InitValue = 1000;
- MinValue = 0;
-
- trigger OnValidate()
- begin
- if "Job Queue Priority for Post" < 0 then
- Error(JobQueuePriorityErr);
- end;
- }
- ///
- /// Contains a legacy setting that no longer has any functional effect on the system.
- ///
- field(43; "Notify On Success"; Boolean)
- {
- Caption = 'Notify On Success';
- ToolTip = 'Specifies a setting that has no effect. Legacy field.';
- }
- ///
- /// Specifies the VAT business posting group used for customers who want item prices shown including VAT.
- ///
- field(44; "VAT Bus. Posting Gr. (Price)"; Code[20])
- {
- Caption = 'VAT Bus. Posting Gr. (Price)';
- TableRelation = "VAT Business Posting Group";
- ToolTip = 'Specifies a VAT business posting group for customers for whom you want the item price including VAT to apply.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to new direct debit mandates.
- ///
- field(45; "Direct Debit Mandate Nos."; Code[20])
- {
- Caption = 'Direct Debit Mandate Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to direct-debit mandates.';
- }
- ///
- /// Specifies the cutoff date before which posted sales documents can be deleted.
- ///
- field(46; "Allow Document Deletion Before"; Date)
- {
- Caption = 'Allow Document Deletion Before';
- ToolTip = 'Specifies if and when posted sales invoices and credit memos can be deleted. If you enter a date, posted sales documents with a posting date on or after this date cannot be deleted.';
- }
- ///
- /// Specifies the output format for reports scheduled through job queue when posting and printing sales documents.
- ///
- field(47; "Report Output Type"; Enum "Setup Report Output Type")
- {
- Caption = 'Report Output Type';
- DataClassification = CustomerContent;
- ToolTip = 'Specifies the output of the report that will be scheduled with a job queue entry when the Post and Print with Job Queue check box is selected.';
-
- trigger OnValidate()
- var
- EnvironmentInformation: Codeunit "Environment Information";
- begin
- if "Report Output Type" = "Report Output Type"::Print then
- if EnvironmentInformation.IsSaaS() then
- TestField("Report Output Type", "Report Output Type"::PDF);
- end;
- }
- ///
- /// Specifies the default line type that appears on the first line when creating new sales documents.
- ///
- field(49; "Document Default Line Type"; Enum "Sales Line Type")
- {
- Caption = 'Document Default Line Type';
- ToolTip = 'Specifies the default value for the Type field on the first line in new sales documents. If needed, you can change the value on the line.';
- }
- ///
- /// Indicates whether the quantity field is automatically set to 1 when selecting an item on sales document lines.
- ///
- field(50; "Default Item Quantity"; Boolean)
- {
- Caption = 'Default Item Quantity';
- ToolTip = 'Specifies that the Quantity field is set to 1 when you fill in the Item No. field.';
- }
- ///
- /// Indicates whether the system suggests creating a new item when a description entered on sales lines does not match existing items.
- ///
- field(51; "Create Item from Description"; Boolean)
- {
- Caption = 'Create Item from Description';
- ToolTip = 'Specifies if the system will suggest to create a new item when no item matches the description that you enter in the Description field on sales lines.';
- }
- ///
- /// Specifies whether sales quotes are archived automatically when they are deleted, processed, or printed.
- ///
- field(52; "Archive Quotes"; Option)
- {
- Caption = 'Archive Quotes';
- OptionCaption = 'Never,Question,Always';
- OptionMembers = Never,Question,Always;
- ToolTip = 'Specifies if you want to automatically archive sales quotes when: deleted, processed or printed.';
- }
- ///
- /// Indicates whether sales orders are archived automatically when they are deleted, posted, or printed.
- ///
- field(53; "Archive Orders"; Boolean)
- {
- Caption = 'Archive Orders';
- ToolTip = 'Specifies if you want to automatically archive sales orders when: deleted, posted or printed.';
-
- trigger OnValidate()
- var
- CRMConnectionSetup: Record "CRM Connection Setup";
- begin
- if CRMConnectionSetup.IsBidirectionalSalesOrderIntEnabled() then
- Error(CRMBidirectionalSalesOrderIntEnabledErr);
- end;
- }
- ///
- /// Indicates whether blanket sales orders are archived automatically when they are deleted, processed, or printed.
- ///
- field(54; "Archive Blanket Orders"; Boolean)
- {
- Caption = 'Archive Blanket Orders';
- ToolTip = 'Specifies if you want to automatically archive sales blanket orders when: deleted, processed or printed.';
- }
- ///
- /// Indicates whether sales return orders are archived automatically when they are deleted or posted.
- ///
- field(55; "Archive Return Orders"; Boolean)
- {
- Caption = 'Archive Return Orders';
- ToolTip = 'Specifies if you want to automatically archive sales return orders when deleted or posted.';
- }
- ///
- /// Indicates whether the quantity field is automatically set to 1 for sales lines of type G/L Account.
- ///
- field(56; "Default G/L Account Quantity"; Boolean)
- {
- Caption = 'Default G/L Account Quantity';
- ToolTip = 'Specifies that Quantity is set to 1 on lines of type G/L Account.';
- }
-#if not CLEANSCHEMA29
- ///
- /// Contains a discontinued setting that previously controlled item creation from item numbers on sales lines.
- ///
- field(57; "Create Item from Item No."; Boolean)
- {
- Caption = 'Create Item from Item No.';
- ToolTip = 'Specifies if the system will suggest to create a new item when no item matches the number that you enter in the No. Field on sales lines.';
- ObsoleteReason = 'Discontinued function';
-#if CLEAN27
- ObsoleteState = Removed;
- ObsoleteTag = '29.0';
-#else
- ObsoleteState = Pending;
- ObsoleteTag = '27.0';
-#endif
- }
-#endif
- ///
- /// Indicates whether the customer name from the customer card is copied to customer ledger entries during posting.
- ///
- field(58; "Copy Customer Name to Entries"; Boolean)
- {
- Caption = 'Copy Customer Name to Entries';
- ToolTip = 'Specifies if you want the name on customer cards to be copied to customer ledger entries during posting.';
-
- trigger OnValidate()
- var
- UpdateNameInLedgerEntries: Codeunit "Update Name In Ledger Entries";
- begin
- if "Copy Customer Name to Entries" then
- UpdateNameInLedgerEntries.NotifyAboutBlankNamesInLedgerEntries(RecordId);
- end;
- }
- ///
- /// Indicates whether changes to customer addresses made on sales documents are not copied back to the customer card.
- ///
- field(61; "Ignore Updated Addresses"; Boolean)
- {
- Caption = 'Ignore Updated Addresses';
- ToolTip = 'Specifies if changes to addresses made on sales documents are copied to the customer card. By default, changes are copied to the customer card.';
- }
- ///
- /// Indicates whether the reservation confirmation dialog is suppressed when processing sales lines.
- ///
- field(65; "Skip Manual Reservation"; Boolean)
- {
- Caption = 'Skip Manual Reservation';
- DataClassification = SystemMetadata;
- ToolTip = 'Specifies that the reservation confirmation message is not shown on sales lines. This is useful to avoid noise when you are processing many lines.';
- }
- ///
- /// Indicates whether customer name changes on open sales documents apply only to the document without searching for matching customers.
- ///
- field(160; "Disable Search by Name"; Boolean)
- {
- Caption = 'Disable Search by Name';
- DataClassification = SystemMetadata;
- ToolTip = 'Specifies that you can change the names of customers on open sales documents. The change applies only to the documents.';
- }
- ///
- /// Indicates whether different posting groups can be used for the same customer across sales documents.
- ///
- field(175; "Allow Multiple Posting Groups"; Boolean)
- {
- Caption = 'Allow Multiple Posting Groups';
- DataClassification = SystemMetadata;
- ToolTip = 'Specifies if multiple posting groups can be used for the same customer in sales documents.';
- }
- ///
- /// Specifies the method used to validate which posting groups are allowed when multiple posting groups are enabled.
- ///
- field(176; "Check Multiple Posting Groups"; enum "Posting Group Change Method")
- {
- Caption = 'Check Multiple Posting Groups';
- DataClassification = SystemMetadata;
- ToolTip = 'Specifies implementation method of checking which posting groups can be used for the customer.';
- }
- ///
- /// Specifies the date formula used to calculate the default expiration date for sales quotes.
- ///
- field(200; "Quote Validity Calculation"; DateFormula)
- {
- Caption = 'Quote Validity Calculation';
- DataClassification = SystemMetadata;
- ToolTip = 'Specifies a formula that determines how to calculate the quote expiration date based on the document date.';
- }
- ///
- /// Specifies the general journal template used for posting sales invoices.
- ///
- field(201; "S. Invoice Template Name"; Code[10])
- {
- Caption = 'Sales Invoice Journal Template';
- TableRelation = "Gen. Journal Template" where(Type = filter(Sales));
- ToolTip = 'Specifies the journal template to use for posting sales invoices.';
- }
- ///
- /// Specifies the general journal template used for posting sales credit memos.
- ///
- field(202; "S. Cr. Memo Template Name"; Code[10])
- {
- Caption = 'Sales Cr. Memo Journal Template';
- TableRelation = "Gen. Journal Template" where(Type = filter(Sales));
- ToolTip = 'Specifies the journal template to use for posting sales credit memos.';
- }
- ///
- /// Specifies the general journal template used for posting sales prepayment invoices.
- ///
- field(203; "S. Prep. Inv. Template Name"; Code[10])
- {
- Caption = 'Sales Prep. Invoice Template Name';
- TableRelation = "Gen. Journal Template" where(Type = filter(Sales));
- ToolTip = 'Specifies which general journal template to use for sales invoices.';
- }
- ///
- /// Specifies the general journal template used for posting sales prepayment credit memos.
- ///
- field(204; "S. Prep. Cr.Memo Template Name"; Code[10])
- {
- Caption = 'Sales Prep. Cr. Memo Template Name';
- TableRelation = "Gen. Journal Template" where(Type = filter(Sales));
- ToolTip = 'Specifies which general journal template to use for sales credit memos.';
- }
- ///
- /// Specifies the intercompany journal template used for posting intercompany sales invoices.
- ///
- field(205; "IC Sales Invoice Template Name"; Code[10])
- {
- Caption = 'IC Sales Invoice Template Name';
- TableRelation = "Gen. Journal Template" where(Type = filter(Intercompany));
- ToolTip = 'Specifies the intercompany journal template to use for sales invoices.';
- }
- ///
- /// Specifies the intercompany journal template used for posting intercompany sales credit memos.
- ///
- field(206; "IC Sales Cr. Memo Templ. Name"; Code[10])
- {
- Caption = 'IC Sales Cr. Memo Template Name';
- TableRelation = "Gen. Journal Template" where(Type = filter(Intercompany));
- ToolTip = 'Specifies the intercompany journal template to use for sales credit memos.';
- }
- ///
- /// Specifies the general journal template used for posting finance charge memos.
- ///
- field(207; "Fin. Charge Jnl. Template Name"; Code[10])
- {
- Caption = 'Finance Charge Journal Template Name';
- TableRelation = "Gen. Journal Template" where(Type = filter(Sales));
- ToolTip = 'Specifies which general journal template to use for finance charges.';
- }
- ///
- /// Specifies the general journal template used for posting reminders.
- ///
- field(208; "Reminder Journal Template Name"; Code[10])
- {
- Caption = 'Reminder Journal Template Name';
- TableRelation = "Gen. Journal Template" where(Type = filter(Sales));
- ToolTip = 'Specifies which general journal template to use for reminders.';
- }
- ///
- /// Specifies the general journal batch used for posting reminders within the selected template.
- ///
- field(209; "Reminder Journal Batch Name"; Code[10])
- {
- Caption = 'Reminder Journal Batch Name';
- TableRelation = if ("Reminder Journal Template Name" = filter(<> '')) "Gen. Journal Batch".Name where("Journal Template Name" = field("Reminder Journal Template Name"));
- ToolTip = 'Specifies which general journal batch to use for reminders.';
-
- trigger OnValidate()
- begin
- TestField("Reminder Journal Template Name");
- end;
- }
- ///
- /// Indicates whether descriptions from G/L Account type lines on sales documents are copied to the resulting general ledger entries.
- ///
- field(210; "Copy Line Descr. to G/L Entry"; Boolean)
- {
- Caption = 'Copy Line Descr. to G/L Entry';
- DataClassification = SystemMetadata;
- ToolTip = 'Specifies that the description on document lines of type G/L Account will be carried to the resulting general ledger entries.';
- }
- ///
- /// Specifies the general journal batch used for posting finance charge memos within the selected template.
- ///
- field(211; "Fin. Charge Jnl. Batch Name"; Code[10])
- {
- Caption = 'Finance Charge Journal Batch Name';
- TableRelation = if ("Fin. Charge Jnl. Template Name" = filter(<> '')) "Gen. Journal Batch".Name where("Journal Template Name" = field("Fin. Charge Jnl. Template Name"));
- ToolTip = 'Specifies which general journal batch to use for finance charges.';
-
- trigger OnValidate()
- begin
- TestField("Fin. Charge Jnl. Template Name");
- end;
- }
- ///
- /// Specifies the number series used to assign unique identifiers to canceled issued reminders.
- ///
- field(393; "Canceled Issued Reminder Nos."; Code[20])
- {
- Caption = 'Canceled Issued Reminder Nos.';
- DataClassification = CustomerContent;
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to canceled issued reminders.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to canceled issued finance charge memos.
- ///
- field(395; "Canc. Iss. Fin. Ch. Mem. Nos."; Code[20])
- {
- Caption = 'Canceled Issued Fin. Charge Memo Nos.';
- DataClassification = CustomerContent;
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to canceled issued finance charge memos.';
- }
- ///
- /// Specifies whether write-in products from Dynamics 365 Sales are created as items or resources in sales documents.
- ///
- field(5329; "Write-in Product Type"; Option)
- {
- Caption = 'Write-in Product Type';
- OptionCaption = 'Item,Resource';
- OptionMembers = Item,Resource;
- ToolTip = 'Specifies the sales line type that will be used for write-in products in Dynamics 365 Sales.';
- }
- ///
- /// Specifies the item or resource number used for write-in products imported from Dynamics 365 Sales.
- ///
- field(5330; "Write-in Product No."; Code[20])
- {
- Caption = 'Write-in Product No.';
- TableRelation = if ("Write-in Product Type" = const(Item)) Item."No." where(Type = filter(Service | "Non-Inventory"))
- else
- if ("Write-in Product Type" = const(Resource)) Resource."No.";
- ToolTip = 'Specifies the number of the item or resource depending on the write-in product type that will be used for Dynamics 365 Sales.';
-
- trigger OnValidate()
- var
- Item: Record Item;
- Resource: Record Resource;
- CRMIntegrationRecord: Record "CRM Integration Record";
- CRMProductName: Codeunit "CRM Product Name";
- RecId: RecordId;
- begin
- case "Write-in Product Type" of
- "Write-in Product Type"::Item:
- begin
- if not Item.Get("Write-in Product No.") then
- exit;
- RecId := Item.RecordId();
- end;
- "Write-in Product Type"::Resource:
- begin
- if not Resource.Get("Write-in Product No.") then
- exit;
- RecId := Resource.RecordId();
- end;
- end;
- if CRMIntegrationRecord.FindByRecordID(RecId) then
- Error(ProductCoupledErr, CRMProductName.Short());
- end;
- }
- ///
- /// Specifies which non-inventory item lines are automatically posted when posting sales documents through warehouse.
- ///
- field(5775; "Auto Post Non-Invt. via Whse."; Enum "Non-Invt. Item Whse. Policy")
- {
- Caption = 'Auto Post Non-Invt. via Whse.';
- ToolTip = 'Specifies if non-inventory item lines in a sales document will be posted automatically when the document is posted via warehouse. None: Do not automatically post non-inventory item lines. Attached/Assigned: Post item charges and other non-inventory item lines assigned or attached to regular items. All: Post all non-inventory item lines.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to posted return receipts.
- ///
- field(5800; "Posted Return Receipt Nos."; Code[20])
- {
- AccessByPermission = TableData "Return Receipt Header" = R;
- Caption = 'Posted Return Receipt Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to posted return receipts.';
- }
- ///
- /// Indicates whether comments from sales return orders are copied to the posted return receipt documents.
- ///
- field(5801; "Copy Cmts Ret.Ord. to Ret.Rcpt"; Boolean)
- {
- AccessByPermission = TableData "Return Receipt Header" = R;
- Caption = 'Copy Cmts Ret.Ord. to Ret.Rcpt';
- InitValue = true;
- ToolTip = 'Specifies that comments are copied from the sales return order to the posted return receipt.';
- }
- ///
- /// Indicates whether comments from sales return orders are copied to the related credit memo documents.
- ///
- field(5802; "Copy Cmts Ret.Ord. to Cr. Memo"; Boolean)
- {
- AccessByPermission = TableData "Return Receipt Header" = R;
- Caption = 'Copy Cmts Ret.Ord. to Cr. Memo';
- InitValue = true;
- ToolTip = 'Specifies whether to copy comments from sales return orders to sales credit memos.';
- }
- ///
- /// Specifies the number series used to assign unique identifiers to new sales return orders.
- ///
- field(6600; "Return Order Nos."; Code[20])
- {
- AccessByPermission = TableData "Return Receipt Header" = R;
- Caption = 'Return Order Nos.';
- TableRelation = "No. Series";
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to new sales return orders.';
- }
- ///
- /// Indicates whether a return receipt is automatically created when posting a sales credit memo.
- ///
- field(6601; "Return Receipt on Credit Memo"; Boolean)
- {
- AccessByPermission = TableData "Return Receipt Header" = R;
- Caption = 'Return Receipt on Credit Memo';
- ToolTip = 'Specifies that a posted return receipt and a posted sales credit memo are automatically created when you post a credit memo.';
- }
- ///
- /// Indicates whether return transactions require an exact item entry application to ensure correct cost reversal.
- ///
- field(6602; "Exact Cost Reversing Mandatory"; Boolean)
- {
- Caption = 'Exact Cost Reversing Mandatory';
- ToolTip = 'Specifies that a return transaction cannot be posted unless the Appl.-from Item Entry field on the sales order line specifies an entry.';
- }
- ///
- /// Specifies the default price calculation method used for sales transactions.
- ///
- field(7000; "Price Calculation Method"; Enum "Price Calculation Method")
- {
- Caption = 'Price Calculation Method';
- InitValue = "Lowest Price";
- ToolTip = 'Specifies the price calculation method that will be default for sales transactions.';
-
- trigger OnValidate()
- var
- PriceCalculationMgt: Codeunit "Price Calculation Mgt.";
- PriceType: Enum "Price Type";
- begin
- PriceCalculationMgt.VerifyMethodImplemented("Price Calculation Method", PriceType::Sale);
- end;
- }
- ///
- /// Specifies the number series used to assign unique identifiers to new sales price lists.
- ///
- field(7001; "Price List Nos."; Code[20])
- {
- Caption = 'Price List Nos.';
- TableRelation = "No. Series";
- DataClassification = CustomerContent;
- ToolTip = 'Specifies the code for the number series that will be used to assign numbers to sales price lists.';
- }
- ///
- /// Indicates whether users can modify or add price lines in active sales price lists.
- ///
- field(7002; "Allow Editing Active Price"; Boolean)
- {
- Caption = 'Allow Editing Active Price';
- DataClassification = SystemMetadata;
- ToolTip = 'Specifies it the existing active sales price line can be modified or removed, or a new price line can be added to the active price list.';
- }
- ///
- /// Specifies the default sales price list where new price lines are stored when created from the price worksheet.
- ///
- field(7003; "Default Price List Code"; Code[20])
- {
- Caption = 'Default Price List Code';
- TableRelation = "Price List Header" where("Price Type" = const(Sale), "Source Group" = const(Customer), "Allow Updating Defaults" = const(true));
- DataClassification = CustomerContent;
- ToolTip = 'Specifies the code of the existing sales price list that stores all new price lines created in the price worksheet page.';
-
- trigger OnLookup()
- var
- PriceListHeader: Record "Price List Header";
- begin
- if Page.RunModal(Page::"Sales Price Lists", PriceListHeader) = Action::LookupOK then begin
- PriceListHeader.TestField("Allow Updating Defaults");
- Validate("Default Price List Code", PriceListHeader.Code);
- end;
- end;
- }
- ///
- /// Indicates whether customized lookup implementations are used instead of standard lookups on price list pages.
- ///
- field(7005; "Use Customized Lookup"; Boolean)
- {
- Caption = 'Use Your Custom Lookup';
- DataClassification = SystemMetadata;
- ToolTip = 'Specifies whether the Assign-to Parent No., Assign-to No., and Product No. fields on price list pages use standard lookups to find records. If you have customized these fields and prefer your implementation, turn on this toggle.';
- }
- ///
- /// Specifies the dimension code used to categorize customers into groups for sales analysis reporting.
- ///
- field(7101; "Customer Group Dimension Code"; Code[20])
- {
- Caption = 'Customer Group Dimension Code';
- TableRelation = Dimension;
- ToolTip = 'Specifies the dimension code for customer groups in your analysis report.';
- }
- ///
- /// Specifies the dimension code used to track salespeople for sales analysis reporting.
- ///
- field(7102; "Salesperson Dimension Code"; Code[20])
- {
- Caption = 'Salesperson Dimension Code';
- TableRelation = Dimension;
- ToolTip = 'Specifies the dimension code for salespeople in your analysis report';
- }
- ///
- /// Specifies the general ledger account used to post freight charges from Dynamics 365 Sales integration.
- ///
- field(7103; "Freight G/L Acc. No."; Code[20])
- {
- Caption = 'Freight G/L Account No.';
- TableRelation = "G/L Account";
- ToolTip = 'Specifies the general ledger account that must be used to handle freight charges from Dynamics 365 Sales.';
-
- trigger OnValidate()
- begin
- CheckGLAccPostingTypeBlockedAndGenProdPostingType("Freight G/L Acc. No.");
- end;
- }
- ///
- /// Indicates whether the document date is automatically updated when the posting date changes on sales documents.
- ///
- field(7104; "Link Doc. Date To Posting Date"; Boolean)
- {
- Caption = 'Link Doc. Date to Posting Date';
- DataClassification = SystemMetadata;
- InitValue = true;
- ToolTip = 'Specifies whether the document date changes when the posting date is modified.';
- }
- ///
- /// Indicates whether the posting date is validated against defined rules when posting sales documents.
- ///
- field(10500; "Posting Date Check on Posting"; Boolean)
- {
- Caption = 'Posting Date Check on Posting';
- ToolTip = 'Specifies if you want the program to warn you when you post a sales document with a posting date that is different from the Work Date.';
- }
- field(11316; Orders; Boolean)
- {
- Caption = 'Orders';
- }
- }
-
- keys
- {
- key(Key1; "Primary Key")
- {
- Clustered = true;
- }
- }
-
- fieldgroups
- {
- }
-
- var
- JobQueuePriorityErr: Label 'Job Queue Priority must be zero or positive.';
- ProductCoupledErr: Label 'You must choose a record that is not coupled to a product in %1.', Comment = '%1 - Dynamics 365 Sales product name';
- RecordHasBeenRead: Boolean;
- CRMBidirectionalSalesOrderIntEnabledErr: Label 'You cannot disable Archive Orders when Dynamics 365 Sales connection and Bidirectional Sales Order Integration are enabled.';
-
- ///
- /// Retrieves the Sales and Receivables Setup record from the database, caching the result to avoid repeated reads within the same session.
- ///
- procedure GetRecordOnce()
- begin
- if RecordHasBeenRead then
- exit;
- Get();
- RecordHasBeenRead := true;
- end;
-
- ///
- /// Returns the legal statement text to be displayed on sales documents. Base implementation returns an empty string; localized versions may override this.
- ///
- /// The legal statement text.
- procedure GetLegalStatement(): Text
- begin
- exit('');
- end;
-
- ///
- /// Determines whether sales document posting is configured to use the job queue for background processing.
- ///
- /// True if either Post with Job Queue or Post and Print with Job Queue is enabled; otherwise, false.
- procedure JobQueueActive(): Boolean
- begin
- Get();
- exit("Post with Job Queue" or "Post & Print with Job Queue");
- end;
-
- local procedure CheckGLAccPostingTypeBlockedAndGenProdPostingType(AccNo: Code[20])
- var
- GLAccount: Record "G/L Account";
- begin
- if AccNo <> '' then begin
- GLAccount.Get(AccNo);
- GLAccount.CheckGLAcc();
- GLAccount.TestField("Gen. Prod. Posting Group");
- end;
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al b/src/Layers/NL/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al
deleted file mode 100644
index 7b0f52588e..0000000000
--- a/src/Layers/NL/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al
+++ /dev/null
@@ -1,12536 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Utilities;
-
-using Microsoft.Assembly.Document;
-using Microsoft.Assembly.History;
-using Microsoft.CRM.Team;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Deferral;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.FixedAssets.FixedAsset;
-using Microsoft.Foundation.Enums;
-using Microsoft.Foundation.ExtendedText;
-using Microsoft.Foundation.NoSeries;
-using Microsoft.Foundation.PaymentTerms;
-using Microsoft.Foundation.UOM;
-using Microsoft.Inventory.Availability;
-using Microsoft.Inventory.Item;
-using Microsoft.Inventory.Ledger;
-using Microsoft.Inventory.Tracking;
-using Microsoft.Projects.Project.Planning;
-using Microsoft.Projects.Resources.Resource;
-using Microsoft.Purchases.Archive;
-using Microsoft.Purchases.Comment;
-using Microsoft.Purchases.Document;
-using Microsoft.Purchases.History;
-using Microsoft.Purchases.Payables;
-using Microsoft.Purchases.Setup;
-using Microsoft.Purchases.Vendor;
-using Microsoft.Sales.Archive;
-using Microsoft.Sales.Comment;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.Document;
-using Microsoft.Sales.History;
-using Microsoft.Sales.Receivables;
-using Microsoft.Sales.Setup;
-using System.IO;
-using System.Utilities;
-
-codeunit 6620 "Copy Document Mgt."
-{
-
- trigger OnRun()
- begin
- end;
-
- var
- Currency: Record Currency;
- TempAsmHeader: Record "Assembly Header" temporary;
- TempAsmLine: Record "Assembly Line" temporary;
- TempSalesInvLine: Record "Sales Invoice Line" temporary;
- GLSetup: Record "General Ledger Setup";
- TranslationHelper: Codeunit "Translation Helper";
- CustCheckCreditLimit: Codeunit "Cust-Check Cr. Limit";
- ItemCheckAvail: Codeunit "Item-Check Avail.";
- TransferExtendedText: Codeunit "Transfer Extended Text";
- TransferOldExtLines: Codeunit "Transfer Old Ext. Text Lines";
- ItemTrackingDocMgt: Codeunit "Item Tracking Doc. Management";
- UOMMgt: Codeunit "Unit of Measure Management";
- ErrorMessageMgt: Codeunit "Error Message Management";
- Window: Dialog;
- HideProcessWindow: Boolean;
- WindowUpdateDateTime: DateTime;
- InsertCancellationLine: Boolean;
- QtyToAsmToOrder: Decimal;
- QtyToAsmToOrderBase: Decimal;
- IncludeHeader: Boolean;
- RecalculateLines: Boolean;
- MoveNegLines: Boolean;
-#pragma warning disable AA0074
- Text008: Label 'There are no negative sales lines to move.';
-#pragma warning disable AA0470
- Text009: Label 'NOTE: A Payment Discount was Received by %1 %2.';
-#pragma warning restore AA0470
- Text010: Label 'There are no negative purchase lines to move.';
-#pragma warning restore AA0074
- CreateToHeader: Boolean;
-#pragma warning disable AA0074
- Text011: Label 'Please enter a Vendor No.';
-#pragma warning restore AA0074
- HideDialog: Boolean;
-#pragma warning disable AA0074
- Text012: Label 'There are no sales lines to copy.';
- Text013: Label 'Shipment No.,Invoice No.,Return Receipt No.,Credit Memo No.';
- Text014: Label 'Receipt No.,Invoice No.,Return Shipment No.,Credit Memo No.';
-#pragma warning disable AA0470
- Text015: Label '%1 %2:';
-#pragma warning restore AA0470
- Text016: Label 'Inv. No. ,Shpt. No. ,Cr. Memo No. ,Rtrn. Rcpt. No. ';
- Text017: Label 'Inv. No. ,Rcpt. No. ,Cr. Memo No. ,Rtrn. Shpt. No. ';
-#pragma warning disable AA0470
- Text018: Label '%1 - %2:';
-#pragma warning restore AA0470
- Text019: Label 'Exact Cost Reversing Link has not been created for all copied document lines.';
- Text022: Label 'Copying document lines...\';
-#pragma warning disable AA0470
- Text023: Label 'Processing source lines #1######\';
- Text024: Label 'Creating new lines #2######';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- ExactCostRevMandatory: Boolean;
- ApplyFully: Boolean;
- AskApply: Boolean;
- ReappDone: Boolean;
-#pragma warning disable AA0074
- Text025: Label 'For one or more return document lines, you chose to return the original quantity, which is already fully applied. Therefore, when you post the return document, the program will reapply relevant entries. Beware that this may change the cost of existing entries. To avoid this, you must delete the affected return document lines before posting.';
-#pragma warning restore AA0074
- SkippedLine: Boolean;
-#pragma warning disable AA0074
- Text029: Label 'One or more return document lines were not inserted or they contain only the remaining quantity of the original document line. This is because quantities on the posted document line are already fully or partially applied. If you want to reverse the full quantity, you must select Return Original Quantity before getting the posted document lines.';
- Text030: Label 'One or more return document lines were not copied. This is because quantities on the posted document line are already fully or partially applied, so the Exact Cost Reversing link could not be created.';
- Text031: Label 'Return document line contains only the original document line quantity, that is not already manually applied.';
-#pragma warning restore AA0074
- SomeAreFixed: Boolean;
- AsmHdrExistsForFromDocLine: Boolean;
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text032: Label 'The posted sales invoice %1 covers more than one shipment of linked assembly orders that potentially have different assembly components. Select Posted Shipment as document type, and then select a specific shipment of assembled items.';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- FromDocOccurrenceNo: Integer;
- FromDocVersionNo: Integer;
- SkipCopyFromDescription: Boolean;
- SkipTestCreditLimit: Boolean;
- WarningDone: Boolean;
- DiffPostDateOrderQst: Label 'The Posting Date of the copied document is different from the Posting Date of the original document. The original document already has a Posting No. based on a number series with date order. When you post the copied document, you may have the wrong date order in the posted documents.\Do you want to continue?';
- CopyPostedDeferral: Boolean;
- CrMemoCancellationMsg: Label 'Cancellation of credit memo %1.', Comment = '%1 = Document No.';
- CopyExtText: Boolean;
- CopyJobData: Boolean;
- SkipWarningNotification: Boolean;
- SkipOldInvoiceDesc: Boolean;
- IsBlockedErr: Label '%1 %2 is blocked.', Comment = '%1 - type of entity, e.g. Item; %2 - entity''s No.';
- IsSalesBlockedItemErr: Label 'You cannot sell %1 %2 because the %3 check box is selected on the %1 card.', Comment = '%1 - Table Caption (item/variant), %2 - Entity Code, %3 - Field Caption';
- IsPurchBlockedItemErr: Label 'You cannot purchase %1 %2 because the %3 check box is selected on the %1 card.', Comment = '%1 - Table Caption (item/variant), %2 - Entity Code, %3 - Field Caption';
- FAIsInactiveErr: Label 'Fixed asset %1 is inactive.', Comment = '%1 - fixed asset no.';
- DirectPostingErr: Label 'G/L account %1 does not allow direct posting.', Comment = '%1 - g/l account no.';
- SalesErrorContextMsg: Label 'Copying sales document %1', Comment = '%1 - document no.';
- PurchErrorContextMsg: Label 'Copying purchase document %1', Comment = '%1 - document no.';
-#pragma warning disable AA0074
- Text000: Label 'Please enter a Document No.';
-#pragma warning disable AA0470
- Text001: Label '%1 %2 cannot be copied onto itself.';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
- DeleteLinesQst: Label 'The existing lines for %1 %2 will be deleted.\\Do you want to continue?', Comment = '%1=Document type, e.g. Invoice. %2=Document No., e.g. 001';
-#pragma warning disable AA0074
-#pragma warning disable AA0470
- Text006: Label 'NOTE: A Payment Discount was Granted by %1 %2.';
-#pragma warning restore AA0470
-#pragma warning restore AA0074
-
- procedure SetProperties(NewIncludeHeader: Boolean; NewRecalculateLines: Boolean; NewMoveNegLines: Boolean; NewCreateToHeader: Boolean; NewHideDialog: Boolean; NewExactCostRevMandatory: Boolean; NewApplyFully: Boolean)
- begin
- IncludeHeader := NewIncludeHeader;
- RecalculateLines := NewRecalculateLines;
- MoveNegLines := NewMoveNegLines;
- CreateToHeader := NewCreateToHeader;
- HideDialog := NewHideDialog;
- ExactCostRevMandatory := NewExactCostRevMandatory;
- ApplyFully := NewApplyFully;
- AskApply := false;
- ReappDone := false;
- SkippedLine := false;
- SomeAreFixed := false;
- SkipCopyFromDescription := false;
- SkipTestCreditLimit := false;
-
- OnAfterSetProperties(IncludeHeader, RecalculateLines, MoveNegLines, CreateToHeader, HideDialog, ExactCostRevMandatory, ApplyFully);
- end;
-
- procedure SetPropertiesForCreditMemoCorrection()
- begin
- SetProperties(true, false, false, false, true, true, false);
- end;
-
- procedure SetPropertiesForInvoiceCorrection(NewSkipCopyFromDescription: Boolean)
- begin
- SetProperties(true, false, false, false, true, false, false);
- SkipTestCreditLimit := true;
- SkipCopyFromDescription := NewSkipCopyFromDescription;
- end;
-
- procedure GetSalesDocumentType(FromDocType: Enum "Sales Document Type From") ToDocType: Enum "Sales Document Type"
- begin
- case FromDocType of
- FromDocType::Quote:
- exit("Sales Document Type"::Quote);
- FromDocType::"Blanket Order":
- exit("Sales Document Type"::"Blanket Order");
- FromDocType::Order:
- exit("Sales Document Type"::Order);
- FromDocType::Invoice:
- exit("Sales Document Type"::Invoice);
- FromDocType::"Return Order":
- exit("Sales Document Type"::"Return Order");
- FromDocType::"Credit Memo":
- exit("Sales Document Type"::"Credit Memo");
- FromDocType::"Arch. Quote":
- exit("Sales Document Type"::Quote);
- FromDocType::"Arch. Order":
- exit("Sales Document Type"::Order);
- FromDocType::"Arch. Blanket Order":
- exit("Sales Document Type"::"Blanket Order");
- FromDocType::"Arch. Return Order":
- exit("Sales Document Type"::"Return Order");
- else
- OnGetSalesDocumentTypeCaseElse(FromDocType, ToDocType);
- end;
- end;
-
- procedure GetPurchaseDocumentType(FromDocType: Enum "Purchase Document Type From") ToDocType: Enum "Purchase Document Type"
- begin
- case FromDocType of
- FromDocType::Quote:
- exit("Purchase Document Type"::Quote);
- FromDocType::"Blanket Order":
- exit("Purchase Document Type"::"Blanket Order");
- FromDocType::Order:
- exit("Purchase Document Type"::Order);
- FromDocType::Invoice:
- exit("Purchase Document Type"::Invoice);
- FromDocType::"Return Order":
- exit("Purchase Document Type"::"Return Order");
- FromDocType::"Credit Memo":
- exit("Purchase Document Type"::"Credit Memo");
- FromDocType::"Arch. Quote":
- exit("Purchase Document Type"::Quote);
- FromDocType::"Arch. Order":
- exit("Purchase Document Type"::Order);
- FromDocType::"Arch. Blanket Order":
- exit("Purchase Document Type"::"Blanket Order");
- FromDocType::"Arch. Return Order":
- exit("Purchase Document Type"::"Return Order");
- else
- OnGetPurchaseDocumentTypeCaseElse(FromDocType, ToDocType);
- end;
- end;
-
- procedure CopySalesDocForInvoiceCancelling(FromDocNo: Code[20]; var ToSalesHeader: Record "Sales Header")
- begin
- CopyJobData := true;
- SkipWarningNotification := true;
- OnBeforeCopySalesDocForInvoiceCancelling(ToSalesHeader, FromDocNo);
-
- CopySalesDoc("Sales Document Type From"::"Posted Invoice", FromDocNo, ToSalesHeader);
- OnAfterCopySalesDocForInvoiceCancelling(FromDocNo, ToSalesHeader, IncludeHeader, RecalculateLines, MoveNegLines, CreateToHeader, HideDialog, ExactCostRevMandatory, ApplyFully, SkipTestCreditLimit, SkipCopyFromDescription);
- end;
-
- procedure CopySalesDocForCrMemoCancelling(FromDocNo: Code[20]; var ToSalesHeader: Record "Sales Header")
- begin
- CopyJobData := true;
- SkipWarningNotification := true;
- InsertCancellationLine := true;
- OnBeforeCopySalesDocForCrMemoCancelling(ToSalesHeader, FromDocNo, CopyJobData);
-
- CopySalesDoc("Sales Document Type From"::"Posted Credit Memo", FromDocNo, ToSalesHeader);
- InsertCancellationLine := false;
- OnAfterCopySalesDocForCrMemoCancelling(FromDocNo, ToSalesHeader, IncludeHeader, RecalculateLines, MoveNegLines, CreateToHeader, HideDialog, ExactCostRevMandatory, ApplyFully, SkipTestCreditLimit, SkipCopyFromDescription);
- end;
-
- procedure CopySalesDoc(FromDocType: Enum "Sales Document Type From"; FromDocNo: Code[20]; var ToSalesHeader: Record "Sales Header")
- var
- ToSalesLine: Record "Sales Line";
- FromSalesHeader: Record "Sales Header";
- FromSalesShptHeader: Record "Sales Shipment Header";
- FromSalesInvHeader: Record "Sales Invoice Header";
- FromReturnRcptHeader: Record "Return Receipt Header";
- FromSalesCrMemoHeader: Record "Sales Cr.Memo Header";
- FromSalesHeaderArchive: Record "Sales Header Archive";
- ReleaseSalesDocument: Codeunit "Release Sales Document";
- ConfirmManagement: Codeunit "Confirm Management";
- ErrorContextElement: Codeunit "Error Context Element";
- ErrorMessageHandler: Codeunit "Error Message Handler";
- NextLineNo: Integer;
- LinesNotCopied: Integer;
- MissingExCostRevLink: Boolean;
- ReleaseDocument: Boolean;
- IsHandled, ShouldExit : Boolean;
- begin
- if not CreateToHeader then begin
- ToSalesHeader.TestField(Status, ToSalesHeader.Status::Open);
- if FromDocNo = '' then
- Error(Text000);
- ToSalesHeader.Find();
- end;
-
- IsHandled := false;
- OnBeforeCopySalesDocument(FromDocType.AsInteger(), FromDocNo, ToSalesHeader, IsHandled);
- if IsHandled then
- exit;
-
- TransferOldExtLines.ClearLineNumbers();
-
- if not InitAndCheckSalesDocuments(
- FromDocType.AsInteger(), FromDocNo, FromSalesHeader, ToSalesHeader, ToSalesLine,
- FromSalesShptHeader, FromSalesInvHeader, FromReturnRcptHeader, FromSalesCrMemoHeader,
- FromSalesHeaderArchive)
- then
- exit;
-
- ToSalesLine.LockTable();
-
- ToSalesLine.SetRange("Document Type", ToSalesHeader."Document Type");
- if CreateToHeader then begin
- OnCopySalesDocOnBeforeToSalesHeaderInsert(ToSalesHeader, FromSalesHeader, MoveNegLines);
- ToSalesHeader.Insert(true);
- ToSalesLine.SetRange("Document No.", ToSalesHeader."No.");
- end else begin
- ToSalesLine.SetRange("Document No.", ToSalesHeader."No.");
- if IncludeHeader then
- if not ToSalesLine.IsEmpty() then begin
- Commit();
- IsHandled := false;
- OnCopySalesDocOnBeforeConfirmDeleteLines(ToSalesHeader, ToSalesLine, IsHandled);
- if not IsHandled then
- if not ConfirmManagement.GetResponseOrDefault(
- StrSubstNo(DeleteLinesQst, ToSalesHeader."Document Type", ToSalesHeader."No."), true)
- then
- exit;
- OnCopySalesDocOnBeforeToSalesLineDeleteAll(ToSalesLine);
- ToSalesLine.DeleteAll(true);
- OnCopySalesDocOnAfterToSalesLineDeleteAll(ToSalesLine);
- end;
- end;
-
- if ToSalesLine.FindLast() then
- NextLineNo := ToSalesLine."Line No."
- else
- NextLineNo := 0;
-
- if IncludeHeader then begin
- CopySalesDocUpdateHeader(
- FromDocType, FromDocNo, ToSalesHeader, FromSalesHeader,
- FromSalesShptHeader, FromSalesInvHeader, FromReturnRcptHeader, FromSalesCrMemoHeader, FromSalesHeaderArchive, ReleaseDocument);
- OnCopySalesDocOnAfterCopySalesDocUpdateHeader(ToSalesHeader, FromSalesInvHeader, FromDocType);
- end else
- OnCopySalesDocWithoutHeader(ToSalesHeader, FromDocType.AsInteger(), FromDocNo, FromDocOccurrenceNo, FromDocVersionNo, FromSalesInvHeader, FromSalesCrMemoHeader);
-
- LinesNotCopied := 0;
- ErrorMessageMgt.Activate(ErrorMessageHandler);
- ErrorMessageMgt.PushContext(ErrorContextElement, ToSalesHeader.RecordId, 0, StrSubstNo(SalesErrorContextMsg, FromDocNo));
-
- IsHandled := false;
- OnCopySalesDocOnBeforeCopyLines(FromSalesHeader, ToSalesHeader, IsHandled, FromDocType);
- if not IsHandled then
- case FromDocType of
- "Sales Document Type From"::Quote,
- "Sales Document Type From"::"Blanket Order",
- "Sales Document Type From"::Order,
- "Sales Document Type From"::Invoice,
- "Sales Document Type From"::"Return Order",
- "Sales Document Type From"::"Credit Memo":
- CopySalesDocSalesLine(FromSalesHeader, ToSalesHeader, LinesNotCopied, NextLineNo);
- "Sales Document Type From"::"Posted Shipment":
- begin
- FromSalesHeader.TransferFields(FromSalesShptHeader);
- OnCopySalesDocOnBeforeCopySalesDocShptLine(FromSalesShptHeader, ToSalesHeader);
- CopySalesDocShptLine(FromSalesShptHeader, ToSalesHeader, LinesNotCopied, MissingExCostRevLink);
- end;
- "Sales Document Type From"::"Posted Invoice":
- begin
- FromSalesHeader.TransferFields(FromSalesInvHeader);
- ShouldExit := false;
- OnCopySalesDocOnBeforeCopySalesDocInvLine(FromSalesInvHeader, ToSalesHeader, ShouldExit);
- if ShouldExit then
- exit;
- CopySalesDocInvLine(FromSalesInvHeader, ToSalesHeader, LinesNotCopied, MissingExCostRevLink);
- end;
- "Sales Document Type From"::"Posted Return Receipt":
- begin
- FromSalesHeader.TransferFields(FromReturnRcptHeader);
- OnCopySalesDocOnBeforeCopySalesDocReturnRcptLine(FromReturnRcptHeader, ToSalesHeader);
- CopySalesDocReturnRcptLine(FromReturnRcptHeader, ToSalesHeader, LinesNotCopied, MissingExCostRevLink);
- end;
- "Sales Document Type From"::"Posted Credit Memo":
- begin
- FromSalesHeader.TransferFields(FromSalesCrMemoHeader);
- OnCopySalesDocOnBeforeCopySalesDocCrMemoLine(FromSalesCrMemoHeader, ToSalesHeader);
- CopySalesDocCrMemoLine(FromSalesCrMemoHeader, ToSalesHeader, LinesNotCopied, MissingExCostRevLink);
- end;
- "Sales Document Type From"::"Arch. Quote",
- "Sales Document Type From"::"Arch. Order",
- "Sales Document Type From"::"Arch. Blanket Order",
- "Sales Document Type From"::"Arch. Return Order":
- CopySalesDocSalesLineArchive(FromSalesHeaderArchive, ToSalesHeader, LinesNotCopied, NextLineNo);
- end;
-
- OnCopySalesDocOnBeforeUpdateSalesInvoiceDiscountValue(
- ToSalesHeader, FromDocType.AsInteger(), FromDocNo, FromDocOccurrenceNo, FromDocVersionNo, RecalculateLines);
-
- UpdateSalesInvoiceDiscountValue(ToSalesHeader);
-
- if MoveNegLines then begin
- OnBeforeDeleteNegSalesLines(FromDocType.AsInteger(), FromDocNo, ToSalesHeader);
- DeleteSalesLinesWithNegQty(FromSalesHeader, false);
- LinkJobPlanningLine(ToSalesHeader);
- end;
-
- IsHandled := false;
- OnCopySalesDocOnAfterCopySalesDocLines(
- FromDocType.AsInteger(), FromDocNo, FromDocOccurrenceNo, FromDocVersionNo, FromSalesHeader, IncludeHeader, ToSalesHeader, HideDialog, ReleaseDocument, IsHandled);
-
- if IsHandled then
- if ReleaseDocument then begin
- ToSalesHeader.Status := ToSalesHeader.Status::Released;
- ReleaseSalesDocument.Reopen(ToSalesHeader);
- end else
- if (FromDocType in
- ["Sales Document Type From"::Quote,
- "Sales Document Type From"::"Blanket Order",
- "Sales Document Type From"::Order,
- "Sales Document Type From"::Invoice,
- "Sales Document Type From"::"Return Order",
- "Sales Document Type From"::"Credit Memo"])
- and not IncludeHeader and not RecalculateLines
- then
- if FromSalesHeader.Status = FromSalesHeader.Status::Released then begin
- ReleaseSalesDocument.SetSkipCheckReleaseRestrictions();
- ReleaseSalesDocument.Run(ToSalesHeader);
- ReleaseSalesDocument.Reopen(ToSalesHeader);
- end;
-
- if ShowWarningNotification(ToSalesHeader, MissingExCostRevLink) then begin
- ErrorMessageHandler.NotifyAboutErrors();
- ErrorMessageMgt.PopContext(ErrorContextElement);
- end;
-
- ToSalesLine.GetCaptionClass(ToSalesHeader.FieldNo("Prices Including VAT"));
-
- OnAfterCopySalesDocument(
- FromDocType.AsInteger(), FromDocNo, ToSalesHeader, FromDocOccurrenceNo, FromDocVersionNo, IncludeHeader, RecalculateLines, MoveNegLines);
- end;
-
- procedure CopySalesDocSalesLine(FromSalesHeader: Record "Sales Header"; var ToSalesHeader: Record "Sales Header"; var LinesNotCopied: Integer; NextLineNo: Integer)
- var
- AssemblyHeader: Record "Assembly Header";
- ToSalesLine: Record "Sales Line";
- FromSalesLine: Record "Sales Line";
- ItemChargeAssgntNextLineNo: Integer;
- ShouldRunIteration: Boolean;
- begin
- OnBeforeCopySalesDocSalesLine(FromSalesHeader, ToSalesHeader);
- ItemChargeAssgntNextLineNo := 0;
-
- FromSalesLine.Reset();
- FromSalesLine.SetRange("Document Type", FromSalesHeader."Document Type");
- FromSalesLine.SetRange("Document No.", FromSalesHeader."No.");
- if MoveNegLines then
- FromSalesLine.SetFilter(Quantity, '<=0');
- OnCopySalesDocSalesLineOnAfterSetFilters(FromSalesHeader, FromSalesLine, ToSalesHeader, RecalculateLines);
- if FromSalesLine.Find('-') then
- repeat
- ShouldRunIteration := not ExtTxtAttachedToPosSalesLine(FromSalesHeader, FromSalesLine);
- OnCopySalesDocSalesLineOnAfterCalcShouldRunIteration(FromSalesHeader, ToSalesHeader, FromSalesLine, ShouldRunIteration);
- if ShouldRunIteration then begin
- InitAsmCopyHandling(true);
- ToSalesLine."Document Type" := ToSalesHeader."Document Type";
- AsmHdrExistsForFromDocLine := FromSalesLine.AsmToOrderExists(AssemblyHeader);
- if AsmHdrExistsForFromDocLine then begin
- case ToSalesLine."Document Type" of
- ToSalesLine."Document Type"::Order:
- begin
- QtyToAsmToOrder := FromSalesLine."Qty. to Assemble to Order";
- QtyToAsmToOrderBase := FromSalesLine."Qty. to Asm. to Order (Base)";
- end;
- ToSalesLine."Document Type"::Quote,
- ToSalesLine."Document Type"::"Blanket Order":
- begin
- QtyToAsmToOrder := FromSalesLine.Quantity;
- QtyToAsmToOrderBase := FromSalesLine."Quantity (Base)";
- end;
- end;
- GenerateAsmDataFromNonPosted(AssemblyHeader);
- end;
- if CopySalesDocLine(
- ToSalesHeader, ToSalesLine, FromSalesHeader, FromSalesLine,
- NextLineNo, LinesNotCopied, false,
- ConvertToSalesDocumentTypeFrom(FromSalesHeader."Document Type"),
- CopyPostedDeferral, FromSalesLine."Line No.")
- then begin
- OnCopySalesDocSalesLineOnBeforeCopyFromSalesDocAssgntToLine(FromSalesLine, ToSalesLine, RecalculateLines, NextLineNo, LinesNotCopied);
- if FromSalesLine.Type = FromSalesLine.Type::"Charge (Item)" then
- CopyFromSalesDocAssgntToLine(
- ToSalesLine, FromSalesLine."Document Type", FromSalesLine."Document No.", FromSalesLine."Line No.",
- ItemChargeAssgntNextLineNo);
- OnAfterCopySalesLineFromSalesDocSalesLine(
- ToSalesHeader, ToSalesLine, FromSalesLine, IncludeHeader, RecalculateLines);
- end;
- end;
- OnCopySalesDocSalesLineOnBeforeFinishSalesDocSalesLine(FromSalesHeader, ToSalesHeader, ToSalesLine, FromSalesLine, RecalculateLines);
- until FromSalesLine.Next() = 0;
-
- OnAfterCopySalesDocSalesLine(ToSalesLine, TransferOldExtLines, FromSalesHeader, ToSalesHeader);
- end;
-
- local procedure ConvertToSalesDocumentTypeFrom(SalesDocType: Enum "Sales Document Type") SalesDocTypeFrom: Enum "Sales Document Type From"
- begin
- case SalesDocType of
- SalesDocType::Quote:
- exit(SalesDocTypeFrom::Quote);
- SalesDocType::Order:
- exit(SalesDocTypeFrom::Order);
- SalesDocType::Invoice:
- exit(SalesDocTypeFrom::Invoice);
- SalesDocType::"Credit Memo":
- exit(SalesDocTypeFrom::"Credit Memo");
- SalesDocType::"Blanket Order":
- exit(SalesDocTypeFrom::"Blanket Order");
- SalesDocType::"Return Order":
- exit(SalesDocTypeFrom::"Return Order");
- end;
- end;
-
- ///
- /// Converts a Purchase Document Type enum value to the corresponding Purchase Document Type From enum value.
- ///
- /// The purchase document type to convert.
- /// The corresponding Purchase Document Type From value.
- procedure ConvertToPurchaseDocumentTypeFrom(PurchaseDocType: Enum "Purchase Document Type") PurchaseDocTypeFrom: Enum "Purchase Document Type From"
- begin
- case PurchaseDocType of
- PurchaseDocType::Quote:
- exit(PurchaseDocTypeFrom::Quote);
- PurchaseDocType::Order:
- exit(PurchaseDocTypeFrom::Order);
- PurchaseDocType::Invoice:
- exit(PurchaseDocTypeFrom::Invoice);
- PurchaseDocType::"Credit Memo":
- exit(PurchaseDocTypeFrom::"Credit Memo");
- PurchaseDocType::"Blanket Order":
- exit(PurchaseDocTypeFrom::"Blanket Order");
- PurchaseDocType::"Return Order":
- exit(PurchaseDocTypeFrom::"Return Order");
- end;
- end;
-
- local procedure CopySalesDocShptLine(FromSalesShptHeader: Record "Sales Shipment Header"; ToSalesHeader: Record "Sales Header"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- FromSalesShptLine: Record "Sales Shipment Line";
- begin
- FromSalesShptLine.Reset();
- FromSalesShptLine.SetRange("Document No.", FromSalesShptHeader."No.");
- if MoveNegLines then
- FromSalesShptLine.SetFilter(Quantity, '<=0');
- OnCopySalesDocShptLineOnAfterSetFilters(ToSalesHeader, FromSalesShptHeader, FromSalesShptLine, RecalculateLines);
- CopySalesShptLinesToDoc(ToSalesHeader, FromSalesShptLine, LinesNotCopied, MissingExCostRevLink);
- end;
-
- local procedure CopySalesDocInvLine(FromSalesInvHeader: Record "Sales Invoice Header"; ToSalesHeader: Record "Sales Header"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- FromSalesInvLine: Record "Sales Invoice Line";
- begin
- FromSalesInvLine.Reset();
- FromSalesInvLine.SetRange("Document No.", FromSalesInvHeader."No.");
- if MoveNegLines then
- FromSalesInvLine.SetFilter(Quantity, '<=0');
- OnCopySalesDocInvLineOnAfterSetFilters(ToSalesHeader, FromSalesInvHeader, FromSalesInvLine, RecalculateLines);
- CopySalesInvLinesToDoc(ToSalesHeader, FromSalesInvLine, LinesNotCopied, MissingExCostRevLink);
- OnAfterCopySalesDocInvLine(FromSalesInvHeader, ToSalesHeader, FromSalesInvLine);
- end;
-
- local procedure CopySalesDocCrMemoLine(FromSalesCrMemoHeader: Record "Sales Cr.Memo Header"; ToSalesHeader: Record "Sales Header"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- FromSalesCrMemoLine: Record "Sales Cr.Memo Line";
- begin
- FromSalesCrMemoLine.Reset();
- FromSalesCrMemoLine.SetRange("Document No.", FromSalesCrMemoHeader."No.");
- if MoveNegLines then
- FromSalesCrMemoLine.SetFilter(Quantity, '<=0');
- OnCopySalesDocCrMemoLineOnAfterSetFilters(ToSalesHeader, FromSalesCrMemoHeader, FromSalesCrMemoLine, RecalculateLines);
- CopySalesCrMemoLinesToDoc(ToSalesHeader, FromSalesCrMemoLine, LinesNotCopied, MissingExCostRevLink);
- OnAfterCopySalesDocCrMemoLine(FromSalesCrMemoHeader, ToSalesHeader, FromSalesCrMemoLine);
- end;
-
- local procedure CopySalesDocReturnRcptLine(FromReturnRcptHeader: Record "Return Receipt Header"; ToSalesHeader: Record "Sales Header"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- FromReturnRcptLine: Record "Return Receipt Line";
- begin
- FromReturnRcptLine.Reset();
- FromReturnRcptLine.SetRange("Document No.", FromReturnRcptHeader."No.");
- if MoveNegLines then
- FromReturnRcptLine.SetFilter(Quantity, '<=0');
- OnCopySalesDocReturnRcptLineOnAfterSetFilters(ToSalesHeader, FromReturnRcptHeader, FromReturnRcptLine);
- CopySalesReturnRcptLinesToDoc(ToSalesHeader, FromReturnRcptLine, LinesNotCopied, MissingExCostRevLink);
- end;
-
- procedure CopySalesDocSalesLineArchive(FromSalesHeaderArchive: Record "Sales Header Archive"; var ToSalesHeader: Record "Sales Header"; var LinesNotCopied: Integer; NextLineNo: Integer)
- var
- ToSalesLine: Record "Sales Line";
- FromSalesLineArchive: Record "Sales Line Archive";
- ItemChargeAssgntNextLineNo: Integer;
- begin
- OnBeforeCopySalesDocSalesLineArchive(FromSalesHeaderArchive, ToSalesHeader);
- ItemChargeAssgntNextLineNo := 0;
-
- FromSalesLineArchive.Reset();
- FromSalesLineArchive.SetRange("Document Type", FromSalesHeaderArchive."Document Type");
- FromSalesLineArchive.SetRange("Document No.", FromSalesHeaderArchive."No.");
- FromSalesLineArchive.SetRange("Doc. No. Occurrence", FromSalesHeaderArchive."Doc. No. Occurrence");
- FromSalesLineArchive.SetRange("Version No.", FromSalesHeaderArchive."Version No.");
- if MoveNegLines then
- FromSalesLineArchive.SetFilter(Quantity, '<=0');
- OnCopySalesDocSalesLineArchiveOnAfterSetFilters(FromSalesHeaderArchive, FromSalesLineArchive, ToSalesHeader);
- if FromSalesLineArchive.Find('-') then
- repeat
- if CopyArchSalesLine(
- ToSalesHeader, ToSalesLine, FromSalesHeaderArchive, FromSalesLineArchive, NextLineNo, LinesNotCopied, false)
- then begin
- OnCopyArchSalesLineOnBeforeCopyFromArchSalesDocDimToLine(ToSalesHeader, ToSalesLine, FromSalesHeaderArchive, FromSalesLineArchive, RecalculateLines, LinesNotCopied);
- if ToSalesLine."Qty. to Assemble to Order" <> 0 then
- ToSalesLine.AutoAsmToOrder();
- CopyFromArchSalesDocDimToLine(ToSalesLine, FromSalesLineArchive);
- if FromSalesLineArchive.Type = FromSalesLineArchive.Type::"Charge (Item)" then
- CopyFromSalesDocAssgntToLine(
- ToSalesLine, FromSalesLineArchive."Document Type", FromSalesLineArchive."Document No.", FromSalesLineArchive."Line No.",
- ItemChargeAssgntNextLineNo);
- OnAfterCopyArchSalesLine(ToSalesHeader, ToSalesLine, FromSalesLineArchive, IncludeHeader, RecalculateLines);
- end;
- until FromSalesLineArchive.Next() = 0;
- OnAfterCopySalesDocSalesLineArchive(FromSalesHeaderArchive, ToSalesHeader, ToSalesLine, TransferOldExtLines);
- end;
-
- procedure CopySalesDocUpdateHeader(FromDocType: Enum "Sales Document Type From"; FromDocNo: Code[20]; var ToSalesHeader: Record "Sales Header"; FromSalesHeader: Record "Sales Header"; FromSalesShptHeader: Record "Sales Shipment Header"; FromSalesInvHeader: Record "Sales Invoice Header"; FromReturnRcptHeader: Record "Return Receipt Header"; FromSalesCrMemoHeader: Record "Sales Cr.Memo Header"; FromSalesHeaderArchive: Record "Sales Header Archive"; var ReleaseDocument: Boolean);
- var
- OldSalesHeader: Record "Sales Header";
- SavedDimSetId: Integer;
- IsHandled: Boolean;
- ShouldValidateDimensionsAndLocation: Boolean;
- begin
- CheckCustomer(FromSalesHeader, ToSalesHeader);
- OldSalesHeader := ToSalesHeader;
- OnBeforeCopySalesHeaderDone(ToSalesHeader, FromSalesHeader, FromDocType, OldSalesHeader, FromSalesShptHeader, FromSalesInvHeader, FromReturnRcptHeader, FromSalesCrMemoHeader, FromSalesHeaderArchive);
- case FromDocType of
- "Sales Document Type From"::Quote,
- "Sales Document Type From"::"Blanket Order",
- "Sales Document Type From"::Order,
- "Sales Document Type From"::Invoice,
- "Sales Document Type From"::"Return Order",
- "Sales Document Type From"::"Credit Memo":
- CopySalesHeaderFromSalesHeader(FromDocType, FromSalesHeader, OldSalesHeader, ToSalesHeader);
- "Sales Document Type From"::"Posted Shipment":
- CopySalesHeaderFromPostedShipment(FromSalesShptHeader, ToSalesHeader, OldSalesHeader);
- "Sales Document Type From"::"Posted Invoice":
- CopySalesHeaderFromPostedInvoice(FromSalesInvHeader, ToSalesHeader, OldSalesHeader);
- "Sales Document Type From"::"Posted Return Receipt":
- CopySalesHeaderFromPostedReturnReceipt(FromReturnRcptHeader, ToSalesHeader, OldSalesHeader);
- "Sales Document Type From"::"Posted Credit Memo":
- TransferFieldsFromCrMemoToInv(ToSalesHeader, FromSalesCrMemoHeader);
- "Sales Document Type From"::"Arch. Quote",
- "Sales Document Type From"::"Arch. Order",
- "Sales Document Type From"::"Arch. Blanket Order",
- "Sales Document Type From"::"Arch. Return Order":
- CopySalesHeaderFromSalesHeaderArchive(FromSalesHeaderArchive, ToSalesHeader, OldSalesHeader);
- end;
- OnAfterCopySalesHeaderDone(
- ToSalesHeader, OldSalesHeader, FromSalesHeader, FromSalesShptHeader, FromSalesInvHeader,
- FromReturnRcptHeader, FromSalesCrMemoHeader, FromSalesHeaderArchive, FromDocType);
-
- ClearInvoiceAndShip(ToSalesHeader);
-
- if ToSalesHeader.Status = ToSalesHeader.Status::Released then begin
- ToSalesHeader.Status := ToSalesHeader.Status::Open;
- ReleaseDocument := true;
- end;
- ShouldValidateDimensionsAndLocation := MoveNegLines or IncludeHeader;
- OnCopySalesDocUpdateHeaderOnAfterSetStatusOpen(ToSalesHeader, OldSalesHeader, ShouldValidateDimensionsAndLocation);
- IsHandled := false;
- OnCopySalesDocUpdateHeaderOnBeforeValidateLocationCode(ToSalesHeader, IsHandled);
- if not IsHandled then
- if ShouldValidateDimensionsAndLocation then begin
- SavedDimSetId := ToSalesHeader."Dimension Set ID";
- if not ToSalesHeader.IsCreditDocType() then
- ToSalesHeader.Validate(ToSalesHeader."Location Code");
- ToSalesHeader.Validate(ToSalesHeader."Dimension Set ID", SavedDimSetId);
- end;
- CopyShiptoCodeFromInvToCrMemo(ToSalesHeader, FromSalesInvHeader, FromDocType);
- CopyFieldsFromOldSalesHeader(ToSalesHeader, OldSalesHeader);
- OnAfterCopyFieldsFromOldSalesHeader(ToSalesHeader, OldSalesHeader, MoveNegLines, IncludeHeader, FromDocType, RecalculateLines);
- if RecalculateLines then begin
- if IncludeHeader then
- SavedDimSetId := ToSalesHeader."Dimension Set ID";
- ToSalesHeader.CreateDimFromDefaultDim(0);
- if IncludeHeader then
- ToSalesHeader.Validate("Dimension Set ID", SavedDimSetId);
- end;
-
- ToSalesHeader."No. Printed" := 0;
- ToSalesHeader."Applies-to Doc. Type" := ToSalesHeader."Applies-to Doc. Type"::" ";
- ToSalesHeader."Applies-to Doc. No." := '';
- ToSalesHeader."Applies-to ID" := '';
- ToSalesHeader."Opportunity No." := '';
- ToSalesHeader."Quote No." := '';
- OnCopySalesDocUpdateHeaderOnBeforeUpdateCustLedgerEntry(ToSalesHeader, FromDocType.AsInteger(), FromDocNo, OldSalesHeader);
-
- if ((FromDocType = "Sales Document Type From"::"Posted Invoice") and
- (ToSalesHeader."Document Type" in [ToSalesHeader."Document Type"::"Return Order", ToSalesHeader."Document Type"::"Credit Memo"])) or
- ((FromDocType = "Sales Document Type From"::"Posted Credit Memo") and
- not (ToSalesHeader."Document Type" in [ToSalesHeader."Document Type"::"Return Order", ToSalesHeader."Document Type"::"Credit Memo"]))
- then
- UpdateCustLedgerEntry(ToSalesHeader, FromDocType, FromDocNo);
-
- HandleZeroAmountPostedInvoices(FromSalesInvHeader, ToSalesHeader, FromDocType, FromDocNo);
-
- if ToSalesHeader."Document Type" in [ToSalesHeader."Document Type"::"Blanket Order", ToSalesHeader."Document Type"::Quote] then
- ToSalesHeader."Posting Date" := 0D;
-
- ToSalesHeader.Correction := false;
- if ToSalesHeader."Document Type" in [ToSalesHeader."Document Type"::"Return Order", ToSalesHeader."Document Type"::"Credit Memo"] then
- UpdateSalesCreditMemoHeader(ToSalesHeader);
-
- GLSetup.Get();
- if GLSetup."Journal Templ. Name Mandatory" then
- if ToSalesHeader.IsCreditDocType() <> IsCreditSalesFromDocType(FromDocType) then
- ToSalesHeader."Journal Templ. Name" := OldSalesHeader."Journal Templ. Name";
-
- OnBeforeModifySalesHeader(ToSalesHeader, FromDocType.AsInteger(), FromDocNo, IncludeHeader, FromDocOccurrenceNo, FromDocVersionNo, RecalculateLines,
- FromSalesHeader, FromSalesInvHeader, FromSalesCrMemoHeader, OldSalesHeader);
-
- if CreateToHeader then begin
- ToSalesHeader.Validate(ToSalesHeader."Payment Terms Code");
- ToSalesHeader.Modify(true);
- end else
- ToSalesHeader.Modify();
- OnCopySalesDocWithHeader(FromDocType.AsInteger(), FromDocNo, ToSalesHeader, FromDocOccurrenceNo, FromDocVersionNo, FromSalesHeader);
- end;
-
- local procedure IsCreditSalesFromDocType(FromDocType: Enum "Sales Document Type From"): Boolean
- begin
- exit(FromDocType in ["Sales Document Type From"::"Return Order", "Sales Document Type From"::"Credit Memo"]);
- end;
-
- local procedure ClearInvoiceAndShip(var ToSalesHeader: Record "Sales Header")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeClearInvoiceAndShip(ToSalesHeader, IsHandled);
- if IsHandled then
- exit;
-
- ToSalesHeader.Invoice := false;
- ToSalesHeader.Ship := false;
- end;
-
- local procedure CopySalesHeaderFromSalesHeader(FromDocType: Enum "Sales Document Type From"; FromSalesHeader: Record "Sales Header"; OldSalesHeader: Record "Sales Header"; var ToSalesHeader: Record "Sales Header")
- begin
- FromSalesHeader.CalcFields("Work Description");
- ToSalesHeader.TransferFields(FromSalesHeader, false);
- UpdateShipToAddress(ToSalesHeader);
- UpdateSalesHeaderWhenCopyFromSalesHeader(ToSalesHeader, OldSalesHeader, FromDocType);
- SetReceivedFromCountryCode(FromDocType, ToSalesHeader);
- OnAfterCopySalesHeader(ToSalesHeader, OldSalesHeader, FromSalesHeader, FromDocType);
- end;
-
- local procedure CopySalesHeaderFromPostedShipment(FromSalesShptHeader: Record "Sales Shipment Header"; var ToSalesHeader: Record "Sales Header"; var OldSalesHeader: Record "Sales Header")
- begin
- FromSalesShptHeader.CalcFields("Work Description");
- ToSalesHeader.Validate("Sell-to Customer No.", FromSalesShptHeader."Sell-to Customer No.");
- OnCopySalesDocOnBeforeTransferPostedShipmentFields(ToSalesHeader, FromSalesShptHeader);
- if ToSalesHeader."Sell-to Customer No." <> FromSalesShptHeader."Sell-to Customer No." then
- exit;
- ToSalesHeader.TransferFields(FromSalesShptHeader, false);
- UpdateShipToAddress(ToSalesHeader);
- SetReceivedFromCountryCode(FromSalesShptHeader, ToSalesHeader);
- OnAfterCopyPostedShipment(ToSalesHeader, OldSalesHeader, FromSalesShptHeader);
- end;
-
- local procedure CopySalesHeaderFromPostedInvoice(FromSalesInvHeader: Record "Sales Invoice Header"; var ToSalesHeader: Record "Sales Header"; var OldSalesHeader: Record "Sales Header")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCopySalesHeaderFromPostedInvoice(ToSalesHeader, FromSalesInvHeader, IsHandled);
- if not IsHandled then begin
- FromSalesInvHeader.CalcFields("Work Description");
- ToSalesHeader.Validate("Sell-to Customer No.", FromSalesInvHeader."Sell-to Customer No.");
- OnCopySalesDocOnBeforeTransferPostedInvoiceFields(ToSalesHeader, FromSalesInvHeader, CopyJobData);
- if ToSalesHeader."Sell-to Customer No." <> FromSalesInvHeader."Sell-to Customer No." then
- exit;
- ToSalesHeader.TransferFields(FromSalesInvHeader, false);
- UpdateShipToAddress(ToSalesHeader);
- SetReceivedFromCountryCode(FromSalesInvHeader, ToSalesHeader);
- OnCopySalesDocOnAfterTransferPostedInvoiceFields(ToSalesHeader, FromSalesInvHeader, OldSalesHeader);
- end;
- end;
-
- local procedure CopySalesHeaderFromPostedReturnReceipt(FromReturnRcptHeader: Record "Return Receipt Header"; var ToSalesHeader: Record "Sales Header"; var OldSalesHeader: Record "Sales Header")
- begin
- ToSalesHeader.Validate("Sell-to Customer No.", FromReturnRcptHeader."Sell-to Customer No.");
- OnCopySalesDocOnBeforeTransferPostedReturnReceiptFields(ToSalesHeader, FromReturnRcptHeader);
- if ToSalesHeader."Sell-to Customer No." <> FromReturnRcptHeader."Sell-to Customer No." then
- exit;
- ToSalesHeader.TransferFields(FromReturnRcptHeader, false);
- SetReceivedFromCountryCode(ToSalesHeader);
- OnAfterCopyPostedReturnReceipt(ToSalesHeader, OldSalesHeader, FromReturnRcptHeader);
- end;
-
- local procedure CopySalesHeaderFromSalesHeaderArchive(FromSalesHeaderArchive: Record "Sales Header Archive"; var ToSalesHeader: Record "Sales Header"; var OldSalesHeader: Record "Sales Header")
- begin
- FromSalesHeaderArchive.CalcFields("Work Description");
- ToSalesHeader.Validate("Sell-to Customer No.", FromSalesHeaderArchive."Sell-to Customer No.");
- if ToSalesHeader."Sell-to Customer No." <> FromSalesHeaderArchive."Sell-to Customer No." then
- exit;
- ToSalesHeader.TransferFields(FromSalesHeaderArchive, false);
- OnCopySalesDocOnAfterTransferArchSalesHeaderFields(ToSalesHeader, FromSalesHeaderArchive);
- UpdateSalesHeaderWhenCopyFromSalesHeaderArchive(ToSalesHeader);
- CopyFromArchSalesDocDimToHdr(ToSalesHeader, FromSalesHeaderArchive);
- SetReceivedFromCountryCode(FromSalesHeaderArchive, ToSalesHeader);
- OnAfterCopySalesHeaderArchive(ToSalesHeader, OldSalesHeader, FromSalesHeaderArchive)
- end;
-
- procedure CheckCustomer(var FromSalesHeader: Record "Sales Header"; var ToSalesHeader: Record "Sales Header")
- var
- Cust: Record Customer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckCustomer(FromSalesHeader, ToSalesHeader, IsHandled);
- if IsHandled then
- exit;
-
- if Cust.Get(FromSalesHeader."Sell-to Customer No.") then
- Cust.CheckBlockedCustOnDocs(Cust, ToSalesHeader."Document Type", false, false);
- if Cust.Get(FromSalesHeader."Bill-to Customer No.") then
- Cust.CheckBlockedCustOnDocs(Cust, ToSalesHeader."Document Type", false, false);
- end;
-
- local procedure CheckAsmHdrExistsForFromDocLine(ToSalesHeader: Record "Sales Header"; FromSalesLine2: Record "Sales Line"; var BufferCount: Integer; LineCountsEqual: Boolean)
- begin
- BufferCount += 1;
- AsmHdrExistsForFromDocLine := RetrieveSalesInvLine(FromSalesLine2, BufferCount, LineCountsEqual);
- InitAsmCopyHandling(true);
- if AsmHdrExistsForFromDocLine then begin
- AsmHdrExistsForFromDocLine := GetAsmDataFromSalesInvLine(ToSalesHeader."Document Type");
- if AsmHdrExistsForFromDocLine then begin
- QtyToAsmToOrder := TempSalesInvLine.Quantity;
- QtyToAsmToOrderBase := TempSalesInvLine.Quantity * TempSalesInvLine."Qty. per Unit of Measure";
- end;
- end;
- end;
-
- local procedure HandleZeroAmountPostedInvoices(var FromSalesInvHeader: Record "Sales Invoice Header"; var ToSalesHeader: Record "Sales Header"; FromDocType: Enum "Sales Document Type From"; FromDocNo: Code[20])
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeHandleZeroAmountPostedInvoices(FromSalesInvHeader, ToSalesHeader, FromDocType, FromDocNo, IsHandled);
- if IsHandled then
- exit;
-
- // Apply credit memo to invoice in case of Sales Invoices with total amount 0
- FromSalesInvHeader.CalcFields(Amount);
- if (ToSalesHeader."Applies-to Doc. Type" = ToSalesHeader."Applies-to Doc. Type"::" ") and (ToSalesHeader."Applies-to Doc. No." = '') and
- (FromDocType = "Sales Document Type From"::"Posted Invoice") and (FromSalesInvHeader.Amount = 0) and
- (ToSalesHeader."Document Type" = ToSalesHeader."Document Type"::"Credit Memo")
- then begin
- ToSalesHeader."Applies-to Doc. Type" := ToSalesHeader."Applies-to Doc. Type"::Invoice;
- ToSalesHeader."Applies-to Doc. No." := FromDocNo;
- end;
- end;
-
- local procedure HandleZeroAmountPostedPurchaseInvoices(var FromPurchInvHeader: Record "Purch. Inv. Header"; var ToPurchaseHeader: Record "Purchase Header"; FromDocType: Enum "Purchase Document Type From"; FromDocNo: Code[20])
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeHandleZeroAmountPostedPurchaseInvoices(FromPurchInvHeader, ToPurchaseHeader, FromDocType, FromDocNo, IsHandled);
- if IsHandled then
- exit;
-
- // Apply credit memo to invoice in case of Purchase Invoices with total amount 0
- FromPurchInvHeader.CalcFields(Amount);
- if (ToPurchaseHeader."Applies-to Doc. Type" = ToPurchaseHeader."Applies-to Doc. Type"::" ") and (ToPurchaseHeader."Applies-to Doc. No." = '') and
- (FromDocType = "Purchase Document Type From"::"Posted Invoice") and (FromPurchInvHeader.Amount = 0) and
- (ToPurchaseHeader."Document Type" = ToPurchaseHeader."Document Type"::"Credit Memo")
- then begin
- ToPurchaseHeader."Applies-to Doc. Type" := ToPurchaseHeader."Applies-to Doc. Type"::Invoice;
- ToPurchaseHeader."Applies-to Doc. No." := FromDocNo;
- end;
- end;
-
- procedure CopyPurchaseDocForInvoiceCancelling(FromDocNo: Code[20]; var ToPurchaseHeader: Record "Purchase Header")
- begin
- SkipWarningNotification := true;
- OnBeforeCopyPurchaseDocForInvoiceCancelling(ToPurchaseHeader, FromDocNo);
-
- CopyPurchDoc("Purchase Document Type From"::"Posted Invoice", FromDocNo, ToPurchaseHeader);
- end;
-
- procedure CopyPurchDocForCrMemoCancelling(FromDocNo: Code[20]; var ToPurchaseHeader: Record "Purchase Header")
- begin
- SkipWarningNotification := true;
- InsertCancellationLine := true;
- OnBeforeCopyPurchaseDocForCrMemoCancelling(ToPurchaseHeader, FromDocNo);
-
- CopyPurchDoc("Sales Document Type From"::"Posted Credit Memo", FromDocNo, ToPurchaseHeader);
- InsertCancellationLine := false;
- end;
-
- procedure CopyPurchDoc(FromDocType: Enum "Purchase Document Type From"; FromDocNo: Code[20]; var ToPurchHeader: Record "Purchase Header")
- begin
- CopyPurchDoc(FromDocType, FromDocNo, ToPurchHeader, false);
- end;
-
- procedure CopyPurchDoc(FromDocType: Enum "Purchase Document Type From"; FromDocNo: Code[20]; var ToPurchHeader: Record "Purchase Header"; ClearOriginalDocNo: Boolean)
- var
- ToPurchLine: Record "Purchase Line";
- FromPurchHeader: Record "Purchase Header";
- FromPurchRcptHeader: Record "Purch. Rcpt. Header";
- FromPurchInvHeader: Record "Purch. Inv. Header";
- FromReturnShptHeader: Record "Return Shipment Header";
- FromPurchCrMemoHeader: Record "Purch. Cr. Memo Hdr.";
- FromPurchHeaderArchive: Record "Purchase Header Archive";
- ReleasePurchaseDocument: Codeunit "Release Purchase Document";
- ConfirmManagement: Codeunit "Confirm Management";
- ErrorContextElement: Codeunit "Error Context Element";
- ErrorMessageHandler: Codeunit "Error Message Handler";
- NextLineNo: Integer;
- LinesNotCopied: Integer;
- MissingExCostRevLink: Boolean;
- ReleaseDocument: Boolean;
- IsHandled: Boolean;
- DoExit: Boolean;
- begin
- if not CreateToHeader then begin
- ToPurchHeader.TestField(Status, ToPurchHeader.Status::Open);
- if FromDocNo = '' then
- Error(Text000);
- ToPurchHeader.Find();
- end;
-
- IsHandled := false;
- OnBeforeCopyPurchaseDocument(FromDocType.AsInteger(), FromDocNo, ToPurchHeader, IsHandled);
- if IsHandled then
- exit;
-
- TransferOldExtLines.ClearLineNumbers();
-
- if not InitAndCheckPurchaseDocuments(
- FromDocType.AsInteger(), FromDocNo, FromPurchHeader, ToPurchHeader,
- FromPurchRcptHeader, FromPurchInvHeader, FromReturnShptHeader, FromPurchCrMemoHeader,
- FromPurchHeaderArchive)
- then
- exit;
-
- ToPurchLine.LockTable();
-
- IsHandled := false;
- OnCopyPurchDocOnBeforeCreateOrIncludeHeader(ToPurchHeader, ToPurchLine, CreateToHeader, IncludeHeader, DoExit, IsHandled);
- if IsHandled then
- if DoExit then
- exit;
- if not IsHandled then
- if CreateToHeader then begin
- OnCopyPurchDocOnBeforeToPurchHeaderInsert(ToPurchHeader, FromPurchHeader, MoveNegLines);
- ToPurchHeader.Insert(true);
- ToPurchLine.SetRange("Document Type", ToPurchHeader."Document Type");
- ToPurchLine.SetRange("Document No.", ToPurchHeader."No.");
- end else begin
- ToPurchLine.SetRange("Document Type", ToPurchHeader."Document Type");
- ToPurchLine.SetRange("Document No.", ToPurchHeader."No.");
- if IncludeHeader then
- if ToPurchLine.FindFirst() then begin
- Commit();
- if not ConfirmManagement.GetResponseOrDefault(
- StrSubstNo(DeleteLinesQst, ToPurchHeader."Document Type", ToPurchHeader."No."), true)
- then
- exit;
- ToPurchLine.DeleteAll(true);
- end;
- end;
-
- if ToPurchLine.FindLast() then
- NextLineNo := ToPurchLine."Line No."
- else
- NextLineNo := 0;
-
- if IncludeHeader then
- CopyPurchDocUpdateHeader(
- FromDocType, FromDocNo, ToPurchHeader, FromPurchHeader,
- FromPurchRcptHeader, FromPurchInvHeader, FromReturnShptHeader, FromPurchCrMemoHeader, FromPurchHeaderArchive, ReleaseDocument, ClearOriginalDocNo)
- else
- OnCopyPurchDocWithoutHeader(ToPurchHeader, FromDocType.AsInteger(), FromDocNo, FromDocOccurrenceNo, FromDocVersionNo, FromPurchInvHeader, FromPurchCrMemoHeader);
-
- LinesNotCopied := 0;
- ErrorMessageMgt.Activate(ErrorMessageHandler);
- ErrorMessageMgt.PushContext(ErrorContextElement, ToPurchHeader.RecordId, 0, StrSubstNo(PurchErrorContextMsg, FromDocNo));
- case FromDocType of
- "Purchase Document Type From"::Quote,
- "Purchase Document Type From"::"Blanket Order",
- "Purchase Document Type From"::Order,
- "Purchase Document Type From"::Invoice,
- "Purchase Document Type From"::"Return Order",
- "Purchase Document Type From"::"Credit Memo":
- CopyPurchDocPurchLine(FromPurchHeader, ToPurchHeader, LinesNotCopied, NextLineNo);
- "Purchase Document Type From"::"Posted Receipt":
- begin
- FromPurchHeader.TransferFields(FromPurchRcptHeader);
- OnCopyPurchDocOnBeforeCopyPurchDocRcptLine(FromPurchRcptHeader, ToPurchHeader);
- CopyPurchDocRcptLine(FromPurchRcptHeader, ToPurchHeader, LinesNotCopied, MissingExCostRevLink);
- end;
- "Purchase Document Type From"::"Posted Invoice":
- begin
- FromPurchHeader.TransferFields(FromPurchInvHeader);
- OnCopyPurchDocOnBeforeCopyPurchDocInvLine(FromPurchInvHeader, ToPurchHeader);
- CopyPurchDocInvLine(FromPurchInvHeader, ToPurchHeader, LinesNotCopied, MissingExCostRevLink);
- end;
- "Purchase Document Type From"::"Posted Return Shipment":
- begin
- FromPurchHeader.TransferFields(FromReturnShptHeader);
- OnCopyPurchDocOnBeforeCopyPurchDocReturnShptLine(FromReturnShptHeader, ToPurchHeader);
- CopyPurchDocReturnShptLine(FromReturnShptHeader, ToPurchHeader, LinesNotCopied, MissingExCostRevLink);
- end;
- "Purchase Document Type From"::"Posted Credit Memo":
- begin
- FromPurchHeader.TransferFields(FromPurchCrMemoHeader);
- OnCopyPurchDocOnBeforeCopyPurchDocCrMemoLine(FromPurchCrMemoHeader, ToPurchHeader);
- CopyPurchDocCrMemoLine(FromPurchCrMemoHeader, ToPurchHeader, LinesNotCopied, MissingExCostRevLink);
- end;
- "Purchase Document Type From"::"Arch. Order",
- "Purchase Document Type From"::"Arch. Quote",
- "Purchase Document Type From"::"Arch. Blanket Order",
- "Purchase Document Type From"::"Arch. Return Order":
- CopyPurchDocPurchLineArchive(FromPurchHeaderArchive, ToPurchHeader, LinesNotCopied, NextLineNo);
- end;
-
- OnCopyPurchDocOnBeforeUpdatePurchInvoiceDiscountValue(
- ToPurchHeader, FromDocType.AsInteger(), FromDocNo, FromDocOccurrenceNo, FromDocVersionNo, RecalculateLines, FromPurchHeader, LinesNotCopied, NextLineNo, MissingExCostRevLink);
-
- UpdatePurchaseInvoiceDiscountValue(ToPurchHeader);
-
- if MoveNegLines then
- DeletePurchLinesWithNegQty(FromPurchHeader, false);
-
- IsHandled := false;
- OnCopyPurchDocOnAfterCopyPurchDocLines(FromDocType.AsInteger(), FromDocNo, FromPurchHeader, IncludeHeader, ToPurchHeader, MoveNegLines, ReleaseDocument, IsHandled);
-
- if not IsHandled then
- if ReleaseDocument then begin
- ToPurchHeader.Status := ToPurchHeader.Status::Released;
- ReleasePurchaseDocument.Reopen(ToPurchHeader);
- end else
- if (FromDocType in
- ["Purchase Document Type From"::Quote,
- "Purchase Document Type From"::"Blanket Order",
- "Purchase Document Type From"::Order,
- "Purchase Document Type From"::Invoice,
- "Purchase Document Type From"::"Return Order",
- "Purchase Document Type From"::"Credit Memo"])
- and not IncludeHeader and not RecalculateLines
- then
- if FromPurchHeader.Status = FromPurchHeader.Status::Released then begin
- ReleasePurchaseDocument.SetSkipCheckReleaseRestrictions();
- ReleasePurchaseDocument.Run(ToPurchHeader);
- ReleasePurchaseDocument.Reopen(ToPurchHeader);
- end;
-
- if ShowWarningNotification(ToPurchHeader, MissingExCostRevLink) then begin
- ErrorMessageHandler.NotifyAboutErrors();
- ErrorMessageMgt.PopContext(ErrorContextElement);
- end;
-
- ToPurchLine.GetCaptionClass(ToPurchHeader.FieldNo("Prices Including VAT"));
-
- OnAfterCopyPurchaseDocument(
- FromDocType.AsInteger(), FromDocNo, ToPurchHeader, FromDocOccurrenceNo, FromDocVersionNo, IncludeHeader, RecalculateLines, MoveNegLines);
- end;
-
- procedure CopyPurchDocPurchLine(FromPurchHeader: Record "Purchase Header"; ToPurchHeader: Record "Purchase Header"; var LinesNotCopied: Integer; NextLineNo: Integer)
- var
- ToPurchLine: Record "Purchase Line";
- FromPurchLine: Record "Purchase Line";
- ItemChargeAssgntNextLineNo: Integer;
- begin
- ItemChargeAssgntNextLineNo := 0;
-
- FromPurchLine.Reset();
- FromPurchLine.SetRange("Document Type", FromPurchHeader."Document Type");
- FromPurchLine.SetRange("Document No.", FromPurchHeader."No.");
- if MoveNegLines then
- FromPurchLine.SetFilter(Quantity, '<=0');
- OnCopyPurchDocPurchLineOnAfterSetFilters(FromPurchHeader, FromPurchLine, ToPurchHeader, RecalculateLines);
- if FromPurchLine.Find('-') then
- repeat
- if not ExtTxtAttachedToPosPurchLine(FromPurchHeader, FromPurchLine) then
- if CopyPurchDocLine(
- ToPurchHeader, ToPurchLine, FromPurchHeader, FromPurchLine, NextLineNo, LinesNotCopied, false,
- ConvertToPurchaseDocumentTypeFrom(FromPurchHeader."Document Type"),
- CopyPostedDeferral, FromPurchLine."Line No.")
- then begin
- if FromPurchLine.Type = FromPurchLine.Type::"Charge (Item)" then
- CopyFromPurchDocAssgntToLine(
- ToPurchLine, FromPurchLine."Document Type", FromPurchLine."Document No.", FromPurchLine."Line No.",
- ItemChargeAssgntNextLineNo);
- OnCopyPurchDocPurchLineOnAfterCopyPurchLine(ToPurchHeader, ToPurchLine, FromPurchHeader, FromPurchLine, IncludeHeader, RecalculateLines);
- end;
- OnCopyPurchDocPurchLineOnAfterProcessFromPurchLineInLoop(ToPurchHeader, ToPurchLine, FromPurchLine, RecalculateLines);
- until FromPurchLine.Next() = 0;
- end;
-
- local procedure CopyPurchDocRcptLine(FromPurchRcptHeader: Record "Purch. Rcpt. Header"; ToPurchHeader: Record "Purchase Header"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- FromPurchRcptLine: Record "Purch. Rcpt. Line";
- begin
- FromPurchRcptLine.Reset();
- FromPurchRcptLine.SetRange("Document No.", FromPurchRcptHeader."No.");
- if MoveNegLines then
- FromPurchRcptLine.SetFilter(Quantity, '<=0');
- OnCopyPurchDocRcptLineOnAfterSetFilters(ToPurchHeader, FromPurchRcptHeader, FromPurchRcptLine, RecalculateLines);
- CopyPurchRcptLinesToDoc(ToPurchHeader, FromPurchRcptLine, LinesNotCopied, MissingExCostRevLink);
- end;
-
- local procedure CopyPurchDocInvLine(FromPurchInvHeader: Record "Purch. Inv. Header"; ToPurchHeader: Record "Purchase Header"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- FromPurchInvLine: Record "Purch. Inv. Line";
- begin
- FromPurchInvLine.Reset();
- FromPurchInvLine.SetRange("Document No.", FromPurchInvHeader."No.");
- if MoveNegLines then
- FromPurchInvLine.SetFilter(Quantity, '<=0');
- OnCopyPurchDocInvLineOnAfterSetFilters(ToPurchHeader, FromPurchInvLine, LinesNotCopied, MissingExCostRevLink, RecalculateLines);
- CopyPurchInvLinesToDoc(ToPurchHeader, FromPurchInvLine, LinesNotCopied, MissingExCostRevLink);
- end;
-
- local procedure CopyPurchDocCrMemoLine(FromPurchCrMemoHeader: Record "Purch. Cr. Memo Hdr."; ToPurchHeader: Record "Purchase Header"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- FromPurchCrMemoLine: Record "Purch. Cr. Memo Line";
- begin
- FromPurchCrMemoLine.Reset();
- FromPurchCrMemoLine.SetRange("Document No.", FromPurchCrMemoHeader."No.");
- if MoveNegLines then
- FromPurchCrMemoLine.SetFilter(Quantity, '<=0');
- OnCopyPurchDocCrMemoLineOnAfterSetFilters(ToPurchHeader, FromPurchCrMemoLine, LinesNotCopied, MissingExCostRevLink, RecalculateLines);
- CopyPurchCrMemoLinesToDoc(ToPurchHeader, FromPurchCrMemoLine, LinesNotCopied, MissingExCostRevLink);
- end;
-
- local procedure CopyPurchDocReturnShptLine(FromReturnShptHeader: Record "Return Shipment Header"; ToPurchHeader: Record "Purchase Header"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- FromReturnShptLine: Record "Return Shipment Line";
- begin
- FromReturnShptLine.Reset();
- FromReturnShptLine.SetRange("Document No.", FromReturnShptHeader."No.");
- if MoveNegLines then
- FromReturnShptLine.SetFilter(Quantity, '<=0');
- OnCopyPurchDocReturnShptLineOnAfterSetFilters(ToPurchHeader, FromReturnShptLine, LinesNotCopied, MissingExCostRevLink);
- CopyPurchReturnShptLinesToDoc(ToPurchHeader, FromReturnShptLine, LinesNotCopied, MissingExCostRevLink);
- end;
-
- procedure CopyPurchDocPurchLineArchive(FromPurchHeaderArchive: Record "Purchase Header Archive"; var ToPurchHeader: Record "Purchase Header"; var LinesNotCopied: Integer; NextLineNo: Integer)
- var
- ToPurchLine: Record "Purchase Line";
- FromPurchLineArchive: Record "Purchase Line Archive";
- ItemChargeAssgntNextLineNo: Integer;
- begin
- ItemChargeAssgntNextLineNo := 0;
-
- FromPurchLineArchive.Reset();
- FromPurchLineArchive.SetRange("Document Type", FromPurchHeaderArchive."Document Type");
- FromPurchLineArchive.SetRange("Document No.", FromPurchHeaderArchive."No.");
- FromPurchLineArchive.SetRange("Doc. No. Occurrence", FromPurchHeaderArchive."Doc. No. Occurrence");
- FromPurchLineArchive.SetRange("Version No.", FromPurchHeaderArchive."Version No.");
- if MoveNegLines then
- FromPurchLineArchive.SetFilter(Quantity, '<=0');
- OnCopyPurchDocPurchLineArchiveOnAfterSetFilters(ToPurchHeader, ToPurchLine, FromPurchHeaderArchive, FromPurchLineArchive, NextLineNo, LinesNotCopied);
- if FromPurchLineArchive.Find('-') then
- repeat
- if CopyArchPurchLine(
- ToPurchHeader, ToPurchLine, FromPurchHeaderArchive, FromPurchLineArchive, NextLineNo, LinesNotCopied, false)
- then begin
- CopyFromArchPurchDocDimToLine(ToPurchLine, FromPurchLineArchive);
- if FromPurchLineArchive.Type = FromPurchLineArchive.Type::"Charge (Item)" then
- CopyFromPurchDocAssgntToLine(
- ToPurchLine, FromPurchLineArchive."Document Type", FromPurchLineArchive."Document No.", FromPurchLineArchive."Line No.",
- ItemChargeAssgntNextLineNo);
- OnAfterCopyArchPurchLine(ToPurchHeader, ToPurchLine, FromPurchLineArchive, IncludeHeader, RecalculateLines);
- end;
- until FromPurchLineArchive.Next() = 0;
- end;
-
- local procedure CopyPurchDocUpdateHeader(FromDocType: Enum "Purchase Document Type From"; FromDocNo: Code[20]; var ToPurchHeader: Record "Purchase Header"; FromPurchHeader: Record "Purchase Header"; FromPurchRcptHeader: Record "Purch. Rcpt. Header"; FromPurchInvHeader: Record "Purch. Inv. Header"; FromReturnShptHeader: Record "Return Shipment Header"; FromPurchCrMemoHeader: Record "Purch. Cr. Memo Hdr."; FromPurchHeaderArchive: Record "Purchase Header Archive"; var ReleaseDocument: Boolean; ClearOriginalDocNosOnTarget: Boolean)
- var
- BuyFromVendor: Record Vendor;
- PayToVendor: Record Vendor;
- OldPurchHeader: Record "Purchase Header";
- SavedDimSetId: Integer;
- begin
- if BuyFromVendor.Get(FromPurchHeader."Buy-from Vendor No.") then
- BuyFromVendor.CheckBlockedVendOnDocs(BuyFromVendor, false);
- if PayToVendor.Get(FromPurchHeader."Pay-to Vendor No.") then
- PayToVendor.CheckBlockedVendOnDocs(PayToVendor, false);
- OldPurchHeader := ToPurchHeader;
- OnBeforeCopyPurchHeaderDone(ToPurchHeader, FromPurchHeader, FromDocType, OldPurchHeader, FromPurchRcptHeader, FromPurchInvHeader, FromReturnShptHeader, FromPurchCrMemoHeader, FromPurchHeaderArchive, BuyFromVendor, PayToVendor);
- case FromDocType of
- "Purchase Document Type From"::Quote,
- "Purchase Document Type From"::"Blanket Order",
- "Purchase Document Type From"::Order,
- "Purchase Document Type From"::Invoice,
- "Purchase Document Type From"::"Return Order",
- "Purchase Document Type From"::"Credit Memo":
- CopyPurchHeaderFromPurchHeader(FromDocType, FromPurchHeader, OldPurchHeader, ToPurchHeader);
- "Purchase Document Type From"::"Posted Receipt":
- CopyPurchHeaderFromPostedReceipt(FromPurchRcptHeader, ToPurchHeader, OldPurchHeader);
- "Purchase Document Type From"::"Posted Invoice":
- CopyPurchHeaderFromPostedInvoice(FromPurchInvHeader, ToPurchHeader, OldPurchHeader);
- "Purchase Document Type From"::"Posted Return Shipment":
- CopyPurchHeaderFromPostedReturnShipment(FromReturnShptHeader, ToPurchHeader, OldPurchHeader);
- "Purchase Document Type From"::"Posted Credit Memo":
- CopyPurchHeaderFromPostedCreditMemo(FromPurchCrMemoHeader, ToPurchHeader, OldPurchHeader);
- "Purchase Document Type From"::"Arch. Order",
- "Purchase Document Type From"::"Arch. Quote",
- "Purchase Document Type From"::"Arch. Blanket Order",
- "Purchase Document Type From"::"Arch. Return Order":
- CopyPurchHeaderFromPurchHeaderArchive(FromPurchHeaderArchive, ToPurchHeader, OldPurchHeader);
- end;
- OnAfterCopyPurchHeaderDone(
- ToPurchHeader, OldPurchHeader, FromPurchHeader, FromPurchRcptHeader, FromPurchInvHeader,
- FromReturnShptHeader, FromPurchCrMemoHeader, FromPurchHeaderArchive);
-
- ToPurchHeader.Invoice := false;
- ToPurchHeader.Receive := false;
- if ToPurchHeader.Status = ToPurchHeader.Status::Released then begin
- ToPurchHeader.Status := ToPurchHeader.Status::Open;
- ReleaseDocument := true;
- end;
- if MoveNegLines or IncludeHeader then begin
- SavedDimSetId := ToPurchHeader."Dimension Set ID";
- ToPurchHeader.Validate(ToPurchHeader."Location Code");
- ToPurchHeader.Validate(ToPurchHeader."Dimension Set ID", SavedDimSetId);
- CopyShippingInfoPurchOrder(ToPurchHeader, FromPurchHeader);
- end;
- if MoveNegLines then
- ToPurchHeader.Validate(ToPurchHeader."Order Address Code");
-
- CopyFieldsFromOldPurchHeader(ToPurchHeader, OldPurchHeader);
- OnAfterCopyFieldsFromOldPurchHeader(ToPurchHeader, OldPurchHeader, MoveNegLines, IncludeHeader);
- if RecalculateLines then begin
- if IncludeHeader then
- SavedDimSetId := ToPurchHeader."Dimension Set ID";
- ToPurchHeader.CreateDimFromDefaultDim(0);
- if IncludeHeader then
- ToPurchHeader.Validate("Dimension Set ID", SavedDimSetId);
- end;
- ToPurchHeader."No. Printed" := 0;
- ToPurchHeader."Applies-to Doc. Type" := ToPurchHeader."Applies-to Doc. Type"::" ";
- ToPurchHeader."Applies-to Doc. No." := '';
- ToPurchHeader."Applies-to ID" := '';
- ToPurchHeader."Quote No." := '';
- if ClearOriginalDocNosOnTarget then
- ClearOriginalDocumentNos(ToPurchHeader);
-
- OnCopyPurchDocUpdateHeaderOnBeforeUpdateVendLedgerEntry(ToPurchHeader, FromDocType.AsInteger(), FromDocNo);
-
- if ((FromDocType = "Purchase Document Type From"::"Posted Invoice") and
- (ToPurchHeader."Document Type" in [ToPurchHeader."Document Type"::"Return Order", ToPurchHeader."Document Type"::"Credit Memo"])) or
- ((FromDocType = "Purchase Document Type From"::"Posted Credit Memo") and
- not (ToPurchHeader."Document Type" in [ToPurchHeader."Document Type"::"Return Order", ToPurchHeader."Document Type"::"Credit Memo"]))
- then
- UpdateVendLedgEntry(ToPurchHeader, FromDocType, FromDocNo);
-
- HandleZeroAmountPostedPurchaseInvoices(FromPurchInvHeader, ToPurchHeader, FromDocType, FromDocNo);
-
- if ToPurchHeader."Document Type" in [ToPurchHeader."Document Type"::"Blanket Order", ToPurchHeader."Document Type"::Quote] then
- ToPurchHeader."Posting Date" := 0D;
-
- ToPurchHeader.Correction := false;
- if ToPurchHeader."Document Type" in [ToPurchHeader."Document Type"::"Return Order", ToPurchHeader."Document Type"::"Credit Memo"] then
- UpdatePurchCreditMemoHeader(ToPurchHeader);
-
- GLSetup.Get();
- if GLSetup."Journal Templ. Name Mandatory" then
- if ToPurchHeader.IsCreditDocType() <> IsCreditPurchFromDocType(FromDocType) then
- ToPurchHeader."Journal Templ. Name" := OldPurchHeader."Journal Templ. Name";
-
- OnBeforeModifyPurchHeader(ToPurchHeader, FromDocType.AsInteger(), FromDocNo, IncludeHeader, FromDocOccurrenceNo, FromDocVersionNo, RecalculateLines,
- FromPurchHeader, FromPurchInvHeader, FromPurchCrMemoHeader, OldPurchHeader);
-
- if CreateToHeader then begin
- ToPurchHeader.Validate(ToPurchHeader."Payment Terms Code");
- ToPurchHeader.Modify(true);
- end else
- ToPurchHeader.Modify();
-
- OnCopyPurchDocWithHeader(FromDocType.AsInteger(), FromDocNo, ToPurchHeader, FromDocOccurrenceNo, FromDocVersionNo);
- end;
-
- local procedure IsCreditPurchFromDocType(FromDocType: Enum "Purchase Document Type From"): Boolean
- begin
- exit(FromDocType in ["Purchase Document Type From"::"Return Order", "Purchase Document Type From"::"Credit Memo"]);
- end;
-
- local procedure CopyPurchHeaderFromPurchHeader(FromDocType: Enum "Purchase Document Type From"; FromPurchHeader: Record "Purchase Header"; OldPurchHeader: Record "Purchase Header"; var ToPurchHeader: Record "Purchase Header")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCopyPurchHeaderFromPurchHeader(FromDocType, FromPurchHeader, OldPurchHeader, ToPurchHeader, IsHandled);
- if IsHandled then
- exit;
-
- ToPurchHeader.TransferFields(FromPurchHeader, false);
- UpdatePurchHeaderWhenCopyFromPurchHeader(ToPurchHeader, OldPurchHeader, FromDocType);
- OnAfterCopyPurchaseHeader(ToPurchHeader, OldPurchHeader, FromPurchHeader);
- end;
-
- local procedure CopyPurchHeaderFromPostedReceipt(FromPurchRcptHeader: Record "Purch. Rcpt. Header"; var ToPurchHeader: Record "Purchase Header"; var OldPurchHeader: Record "Purchase Header")
- begin
- ToPurchHeader.Validate("Buy-from Vendor No.", FromPurchRcptHeader."Buy-from Vendor No.");
- OnCopyPurchHeaderFromPostedReceiptOnBeforeTransferFields(ToPurchHeader, OldPurchHeader, FromPurchRcptHeader);
- ToPurchHeader.TransferFields(FromPurchRcptHeader, false);
- OnAfterCopyPostedReceipt(ToPurchHeader, OldPurchHeader, FromPurchRcptHeader);
- end;
-
- local procedure CopyPurchHeaderFromPostedInvoice(FromPurchInvHeader: Record "Purch. Inv. Header"; var ToPurchHeader: Record "Purchase Header"; var OldPurchHeader: Record "Purchase Header")
- var
- PurchasesPayablesSetup: Record "Purchases & Payables Setup";
- begin
- PurchasesPayablesSetup.Get();
-
- ToPurchHeader.Validate("Buy-from Vendor No.", FromPurchInvHeader."Buy-from Vendor No.");
-
- if PurchasesPayablesSetup.ShouldDocumentTotalAmountsBeChecked(ToPurchHeader) then begin
- FromPurchInvHeader.CalcFields("Amount Including VAT", Amount);
- ToPurchHeader.Validate("Doc. Amount Incl. VAT", FromPurchInvHeader."Amount Including VAT");
- ToPurchHeader.Validate("Doc. Amount VAT", FromPurchInvHeader."Amount Including VAT" - FromPurchInvHeader.Amount);
- end;
- OnCopyPurchHeaderFromPostedInvoiceOnBeforeTransferFields(ToPurchHeader, OldPurchHeader, FromPurchInvHeader);
- ToPurchHeader.TransferFields(FromPurchInvHeader, false);
- OnAfterCopyPostedPurchInvoice(ToPurchHeader, OldPurchHeader, FromPurchInvHeader);
- end;
-
- local procedure CopyPurchHeaderFromPostedReturnShipment(FromReturnShptHeader: Record "Return Shipment Header"; var ToPurchHeader: Record "Purchase Header"; var OldPurchHeader: Record "Purchase Header")
- begin
- ToPurchHeader.Validate("Buy-from Vendor No.", FromReturnShptHeader."Buy-from Vendor No.");
- OnCopyPurchHeaderFromPostedReturnShipmentOnBeforeTransferFields(ToPurchHeader, OldPurchHeader, FromReturnShptHeader);
- ToPurchHeader.TransferFields(FromReturnShptHeader, false);
- OnAfterCopyPostedReturnShipment(ToPurchHeader, OldPurchHeader, FromReturnShptHeader);
- end;
-
- local procedure CopyPurchHeaderFromPostedCreditMemo(FromPurchCrMemoHeader: Record "Purch. Cr. Memo Hdr."; var ToPurchHeader: Record "Purchase Header"; var OldPurchHeader: Record "Purchase Header")
- begin
- ToPurchHeader.Validate("Buy-from Vendor No.", FromPurchCrMemoHeader."Buy-from Vendor No.");
- OnCopyPurchHeaderFromPostedCreditMemoOnBeforeTransferFields(ToPurchHeader, OldPurchHeader, FromPurchCrMemoHeader);
- ToPurchHeader.TransferFields(FromPurchCrMemoHeader, false);
- OnAfterCopyPurchHeaderFromPostedCreditMemo(ToPurchHeader, OldPurchHeader, FromPurchCrMemoHeader);
- end;
-
- local procedure CopyPurchHeaderFromPurchHeaderArchive(FromPurchHeaderArchive: Record "Purchase Header Archive"; var ToPurchHeader: Record "Purchase Header"; var OldPurchHeader: Record "Purchase Header")
- begin
- ToPurchHeader.Validate("Buy-from Vendor No.", FromPurchHeaderArchive."Buy-from Vendor No.");
- ToPurchHeader.TransferFields(FromPurchHeaderArchive, false);
- UpdatePurchHeaderWhenCopyFromPurchHeaderArchive(ToPurchHeader);
- CopyFromArchPurchDocDimToHdr(ToPurchHeader, FromPurchHeaderArchive);
- OnAfterCopyPurchHeaderArchive(ToPurchHeader, OldPurchHeader, FromPurchHeaderArchive)
- end;
-
- procedure ShowSalesDoc(ToSalesHeader: Record "Sales Header")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeShowSalesDoc(ToSalesHeader, IsHandled);
- if IsHandled then
- exit;
-
- case ToSalesHeader."Document Type" of
- ToSalesHeader."Document Type"::Order:
- PAGE.Run(PAGE::"Sales Order", ToSalesHeader);
- ToSalesHeader."Document Type"::Invoice:
- PAGE.Run(PAGE::"Sales Invoice", ToSalesHeader);
- ToSalesHeader."Document Type"::"Return Order":
- PAGE.Run(PAGE::"Sales Return Order", ToSalesHeader);
- ToSalesHeader."Document Type"::"Credit Memo":
- PAGE.Run(PAGE::"Sales Credit Memo", ToSalesHeader);
- end;
- end;
-
- procedure ShowPurchDoc(ToPurchHeader: Record "Purchase Header")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeShowPurchDoc(ToPurchHeader, IsHandled);
- if IsHandled then
- exit;
-
- case ToPurchHeader."Document Type" of
- ToPurchHeader."Document Type"::Order:
- PAGE.Run(PAGE::"Purchase Order", ToPurchHeader);
- ToPurchHeader."Document Type"::Invoice:
- PAGE.Run(PAGE::"Purchase Invoice", ToPurchHeader);
- ToPurchHeader."Document Type"::"Return Order":
- PAGE.Run(PAGE::"Purchase Return Order", ToPurchHeader);
- ToPurchHeader."Document Type"::"Credit Memo":
- PAGE.Run(PAGE::"Purchase Credit Memo", ToPurchHeader);
- end;
- end;
-
- local procedure ShowWarningNotification(SourceVariant: Variant; MissingExCostRevLink: Boolean): Boolean
- var
- TempErrorMessage: Record "Error Message" temporary;
- begin
- if MissingExCostRevLink then
- ErrorMessageMgt.LogWarning(0, Text019, SourceVariant, 0, '');
-
- if ErrorMessageMgt.GetErrors(TempErrorMessage) then begin
- TempErrorMessage.SetRange("Message Type", TempErrorMessage."Message Type"::Error);
- if TempErrorMessage.FindFirst() then begin
- if SkipWarningNotification then
- Error(TempErrorMessage."Message");
- exit(true);
- end;
- exit(not SkipWarningNotification);
- end;
- end;
-
- procedure CopyFromSalesToPurchDoc(VendorNo: Code[20]; FromSalesHeader: Record "Sales Header"; var ToPurchHeader: Record "Purchase Header")
- var
- FromSalesLine: Record "Sales Line";
- ToPurchLine: Record "Purchase Line";
- NextLineNo: Integer;
- ShouldCopyItemTracking: Boolean;
- begin
- if VendorNo = '' then
- Error(Text011);
-
- ToPurchLine.LockTable();
- OnCopyFromSalesToPurchDocOnBeforePurchaseHeaderInsert(ToPurchHeader, FromSalesHeader, VendorNo);
- ToPurchHeader.Insert(true);
- ToPurchHeader.Validate("Buy-from Vendor No.", VendorNo);
- OnCopyFromSalesToPurchDocOnBeforeToPurchHeaderModify(ToPurchHeader, FromSalesHeader);
- ToPurchHeader.Modify(true);
- FromSalesLine.SetRange("Document Type", FromSalesHeader."Document Type");
- FromSalesLine.SetRange("Document No.", FromSalesHeader."No.");
- OnCopyFromSalesToPurchDocOnAfterSetFilters(FromSalesLine, FromSalesHeader);
- if not FromSalesLine.Find('-') then
- Error(Text012);
- repeat
- NextLineNo := NextLineNo + 10000;
- Clear(ToPurchLine);
- ToPurchLine.Init();
- ToPurchLine."Document Type" := ToPurchHeader."Document Type";
- ToPurchLine."Document No." := ToPurchHeader."No.";
- ToPurchLine."Line No." := NextLineNo;
- if FromSalesLine.Type = FromSalesLine.Type::" " then
- ToPurchLine.Description := FromSalesLine.Description
- else
- TransfldsFromSalesToPurchLine(FromSalesLine, ToPurchLine);
- OnBeforeCopySalesToPurchDoc(ToPurchLine, FromSalesLine);
- ToPurchLine.Insert(true);
- ShouldCopyItemTracking := (FromSalesLine.Type <> FromSalesLine.Type::" ") and (ToPurchLine.Type = ToPurchLine.Type::Item) and (ToPurchLine.Quantity <> 0);
- OnCopyFromSalesToPurchDocOnAfterCalcShouldCopyItemTracking(ToPurchLine, ShouldCopyItemTracking);
- if ShouldCopyItemTracking then
- CopyItemTrackingEntries(
- FromSalesLine, ToPurchLine, FromSalesHeader."Prices Including VAT",
- ToPurchHeader."Prices Including VAT");
- OnAfterCopySalesToPurchDoc(ToPurchLine, FromSalesLine);
- until FromSalesLine.Next() = 0;
-
- OnAfterCopyFromSalesToPurchDoc(FromSalesHeader, ToPurchHeader);
- end;
-
- procedure TransfldsFromSalesToPurchLine(var FromSalesLine: Record "Sales Line"; var ToPurchLine: Record "Purchase Line")
- var
- DimMgt: Codeunit DimensionManagement;
- DimensionSetIDArr: array[10] of Integer;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeTransfldsFromSalesToPurchLine(FromSalesLine, ToPurchLine, IsHandled);
- if IsHandled then
- exit;
-
- ToPurchLine.Validate(ToPurchLine.Type, FromSalesLine.Type);
- ToPurchLine.Validate(ToPurchLine."No.", FromSalesLine."No.");
- ToPurchLine.Validate(ToPurchLine."Variant Code", FromSalesLine."Variant Code");
- ToPurchLine.Validate(ToPurchLine."Location Code", FromSalesLine."Location Code");
- ToPurchLine.Validate(ToPurchLine."Unit of Measure Code", FromSalesLine."Unit of Measure Code");
- if (ToPurchLine.Type = ToPurchLine.Type::Item) and (ToPurchLine."No." <> '') then
- ToPurchLine.UpdateUOMQtyPerStockQty();
- ToPurchLine."Expected Receipt Date" := FromSalesLine."Shipment Date";
- ToPurchLine."Bin Code" := FromSalesLine."Bin Code";
- OnTransfldsFromSalesToPurchLineOnBeforeValidateQuantity(FromSalesLine, ToPurchLine);
- if (FromSalesLine."Document Type" = FromSalesLine."Document Type"::"Return Order") and
- (ToPurchLine."Document Type" = ToPurchLine."Document Type"::"Return Order")
- then
- ToPurchLine.Validate(ToPurchLine.Quantity, FromSalesLine.Quantity)
- else
- ToPurchLine.Validate(ToPurchLine.Quantity, FromSalesLine."Outstanding Quantity");
- ToPurchLine.Validate(ToPurchLine."Return Reason Code", FromSalesLine."Return Reason Code");
- ToPurchLine.Validate(ToPurchLine."Direct Unit Cost");
- AssignDescriptionsFromSalesLine(ToPurchLine, FromSalesLine);
- if ToPurchLine."Dimension Set ID" <> FromSalesLine."Dimension Set ID" then begin
- DimensionSetIDArr[1] := ToPurchLine."Dimension Set ID";
- DimensionSetIDArr[2] := FromSalesLine."Dimension Set ID";
- ToPurchLine."Dimension Set ID" :=
- DimMgt.GetCombinedDimensionSetID(DimensionSetIDArr, ToPurchLine."Shortcut Dimension 1 Code", ToPurchLine."Shortcut Dimension 2 Code");
- end;
-
- OnAfterTransfldsFromSalesToPurchLine(FromSalesLine, ToPurchLine);
- end;
-
- local procedure AssignDescriptionsFromSalesLine(var PurchaseLine: Record "Purchase Line"; SalesLine: Record "Sales Line")
- begin
- OnBeforeAssignDescriptionsFromSalesLine(PurchaseLine, SalesLine);
- PurchaseLine.Description := SalesLine.Description;
- PurchaseLine."Description 2" := SalesLine."Description 2";
- end;
-
- local procedure DeleteSalesLinesWithNegQty(FromSalesHeader: Record "Sales Header"; OnlyTest: Boolean)
- var
- FromSalesLine: Record "Sales Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeDeleteSalesLinesWithNegQty(FromSalesHeader, OnlyTest, IsHandled);
- if IsHandled then
- exit;
-
- FromSalesLine.SetRange("Document Type", FromSalesHeader."Document Type");
- FromSalesLine.SetRange("Document No.", FromSalesHeader."No.");
- FromSalesLine.SetFilter(FromSalesLine.Quantity, '<0');
- OnDeleteSalesLinesWithNegQtyOnAfterSetFilters(FromSalesLine, OnlyTest);
- if OnlyTest then begin
- if not FromSalesLine.Find('-') then
- Error(Text008);
- repeat
- FromSalesLine.TestField("Shipment No.", '');
- FromSalesLine.TestField("Return Receipt No.", '');
- FromSalesLine.TestField("Quantity Shipped", 0);
- FromSalesLine.TestField("Quantity Invoiced", 0);
- until FromSalesLine.Next() = 0;
- end else
- FromSalesLine.DeleteAll(true);
- OnAfterDeleteSalesLinesWithNegQty(FromSalesLine, OnlyTest);
- end;
-
- local procedure DeletePurchLinesWithNegQty(FromPurchHeader: Record "Purchase Header"; OnlyTest: Boolean)
- var
- FromPurchLine: Record "Purchase Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeDeletePurchLinesWithNegQty(FromPurchHeader, OnlyTest, IsHandled);
- if IsHandled then
- exit;
-
- FromPurchLine.SetRange("Document Type", FromPurchHeader."Document Type");
- FromPurchLine.SetRange("Document No.", FromPurchHeader."No.");
- FromPurchLine.SetFilter(Quantity, '<0');
- if OnlyTest then begin
- if not FromPurchLine.Find('-') then
- Error(Text010);
- repeat
- FromPurchLine.TestField("Receipt No.", '');
- FromPurchLine.TestField("Return Shipment No.", '');
- FromPurchLine.TestField("Quantity Received", 0);
- FromPurchLine.TestField("Quantity Invoiced", 0);
- until FromPurchLine.Next() = 0;
- end else
- FromPurchLine.DeleteAll(true);
- end;
-
- procedure CopySalesDocLine(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesHeader: Record "Sales Header"; var FromSalesLine: Record "Sales Line"; var NextLineNo: Integer; var LinesNotCopied: Integer; RecalculateAmount: Boolean; FromSalesDocType: Enum "Sales Document Type From"; var CopyPostedDeferral: Boolean; DocLineNo: Integer) Result: Boolean
- var
- RoundingLineInserted: Boolean;
- CopyThisLine: Boolean;
- InvDiscountAmount: Decimal;
- IsHandled: Boolean;
- ShouldValidateQuantityMoveNegLines: Boolean;
- ShouldInitToSalesLine: Boolean;
- begin
- CopyThisLine := true;
- IsHandled := false;
- OnBeforeCopySalesLine(ToSalesHeader, FromSalesHeader, FromSalesLine, RecalculateLines, CopyThisLine, MoveNegLines, Result, IsHandled, DocLineNo);
- if IsHandled then
- exit(Result);
-
- if not CopyThisLine then begin
- LinesNotCopied := LinesNotCopied + 1;
- exit(false);
- end;
-
- CheckSalesRounding(FromSalesLine, RoundingLineInserted);
-
- CopyThisLine := not (((ToSalesHeader."Language Code" <> FromSalesHeader."Language Code") or RecalculateLines) and
- FromSalesLine.IsExtendedText() or
- FromSalesLine."Prepayment Line" or RoundingLineInserted);
- OnCopySalesDocLineOnAfterCalcCopyThisLine(ToSalesHeader, FromSalesHeader, FromSalesLine, RoundingLineInserted, CopyThisLine, RecalculateLines);
- if not CopyThisLine then
- exit(false);
-
- if IsEntityBlocked(Database::"Sales Line", ToSalesHeader.IsCreditDocType(), FromSalesLine.Type.AsInteger(), FromSalesLine."No.", FromSalesLine."Variant Code") then begin
- LinesNotCopied := LinesNotCopied + 1;
- exit(false);
- end;
-
- OnCopySalesDocLineOnBeforeSetSalesHeader(ToSalesHeader, ToSalesLine, FromSalesHeader, FromSalesLine, NextLineNo);
-
- ToSalesLine.SetSalesHeader(ToSalesHeader);
- ShouldInitToSalesLine := RecalculateLines and not FromSalesLine."System-Created Entry";
- OnCopySalesDocLineOnBeforeInitToSalesLine(ToSalesLine, FromSalesLine, ShouldInitToSalesLine);
- if ShouldInitToSalesLine then begin
- ToSalesLine.Init();
- OnAfterInitToSalesLine(ToSalesLine);
- end else begin
- ToSalesLine := FromSalesLine;
- ToSalesLine."Returns Deferral Start Date" := 0D;
- OnCopySalesLineOnAfterTransferFieldsToSalesLine(ToSalesLine, FromSalesLine);
- if ToSalesHeader."Document Type" in [ToSalesHeader."Document Type"::Quote, ToSalesHeader."Document Type"::"Blanket Order"] then
- ToSalesLine."Deferral Code" := '';
- if MoveNegLines and (ToSalesLine.Type <> ToSalesLine.Type::" ") then begin
- ToSalesLine.Amount := -ToSalesLine.Amount;
- ToSalesLine."Amount Including VAT" := -ToSalesLine."Amount Including VAT";
- end
- end;
-
- NextLineNo := NextLineNo + 10000;
- ToSalesLine."Document Type" := ToSalesHeader."Document Type";
- ToSalesLine."Document No." := ToSalesHeader."No.";
- ToSalesLine."Line No." := NextLineNo;
- if ToSalesHeader."Document Type" = ToSalesHeader."Document Type"::Quote then
- ToSalesLine."Promised Delivery Date" := 0D;
- if not IncludeHeader then
- CheckSalesVATBusPostingGroup(ToSalesHeader, ToSalesLine);
- ToSalesLine."Copied From Posted Doc." := FromSalesLine."Copied From Posted Doc.";
- OnCopySalesDocLineOnAfterAssignCopiedFromPostedDoc(ToSalesLine, ToSalesHeader);
- if (ToSalesLine.Type <> ToSalesLine.Type::" ") and
- (ToSalesLine."Document Type" in [ToSalesLine."Document Type"::"Return Order", ToSalesLine."Document Type"::"Credit Memo"])
- then begin
- ToSalesLine."Job Contract Entry No." := 0;
- if (ToSalesLine.Amount = 0) or
- (ToSalesHeader."Prices Including VAT" <> FromSalesHeader."Prices Including VAT") or
- (ToSalesHeader."Currency Factor" <> FromSalesHeader."Currency Factor")
- then begin
- InvDiscountAmount := ToSalesLine."Inv. Discount Amount";
- IsHandled := false;
- OnCopySalesDocLineOnBeforeValidateLineDiscountPct(ToSalesLine, IsHandled);
- if not IsHandled then
- ToSalesLine.Validate("Line Discount %");
- IsHandled := false;
- OnCopySalesDocLineOnBeforeValidateInvDiscountAmount(ToSalesLine, InvDiscountAmount, IsHandled);
- if not IsHandled then
- ToSalesLine.Validate("Inv. Discount Amount", InvDiscountAmount);
- end;
- end;
- ToSalesLine.Validate("Currency Code", FromSalesHeader."Currency Code");
-
- UpdateSalesLine(
- ToSalesHeader, ToSalesLine, FromSalesHeader, FromSalesLine,
- CopyThisLine, RecalculateAmount, FromSalesDocType, CopyPostedDeferral);
-
- IsHandled := false;
- OnCopySalesDocLineOnBeforeCheckLocationOnWMS(ToSalesHeader, ToSalesLine, FromSalesLine, IsHandled, IncludeHeader, RecalculateLines);
- if not IsHandled then
- ToSalesLine.CheckLocationOnWMS();
-
- RecalculateAndApplySalesLine(ToSalesHeader, ToSalesLine, FromSalesLine, RecalculateAmount);
-
- ShouldValidateQuantityMoveNegLines := MoveNegLines and (ToSalesLine.Type <> ToSalesLine.Type::" ");
- OnCopySalesDocLineOnAfterCalcShouldValidateQuantityMoveNegLines(ToSalesLine, FromSalesLine, ShouldValidateQuantityMoveNegLines);
- if ShouldValidateQuantityMoveNegLines then begin
- ToSalesLine.Validate(Quantity, -FromSalesLine.Quantity);
- OnCopySalesDocLineOnAfterValidateQuantityMoveNegLines(ToSalesLine, FromSalesLine);
- ToSalesLine.Validate("Unit Price", FromSalesLine."Unit Price");
- ToSalesLine.Validate("Line Discount %", FromSalesLine."Line Discount %");
- ToSalesLine."Appl.-to Item Entry" := FromSalesLine."Appl.-to Item Entry";
- ToSalesLine."Appl.-from Item Entry" := FromSalesLine."Appl.-from Item Entry";
- ToSalesLine."Job No." := FromSalesLine."Job No.";
- ToSalesLine."Job Task No." := FromSalesLine."Job Task No.";
- ToSalesLine."Job Contract Entry No." := FromSalesLine."Job Contract Entry No.";
- OnCopySalesDocLineOnAfterMoveNegLines(ToSalesLine, FromSalesLine);
- end;
-
- OnCopySalesDocLineOnBeforeCopySalesJobFields(ToSalesHeader, ToSalesLine, FromSalesHeader, FromSalesLine, FromSalesDocType);
- if CopyJobData then
- CopySalesJobFields(ToSalesLine, ToSalesHeader, FromSalesLine);
-
- CopySalesLineExtText(ToSalesHeader, ToSalesLine, FromSalesHeader, FromSalesLine, DocLineNo, NextLineNo);
-
- if not RecalculateLines then begin
- ToSalesLine."Dimension Set ID" := FromSalesLine."Dimension Set ID";
- ToSalesLine."Shortcut Dimension 1 Code" := FromSalesLine."Shortcut Dimension 1 Code";
- ToSalesLine."Shortcut Dimension 2 Code" := FromSalesLine."Shortcut Dimension 2 Code";
- OnCopySalesLineOnAfterSetDimensions(ToSalesLine, FromSalesLine);
- end;
-
- IsHandled := false;
- OnCopySalesDocLineOnBeforeCopyThisLine(ToSalesHeader, ToSalesLine, FromSalesLine, FromSalesDocType, RecalculateLines, CopyThisLine, LinesNotCopied, Result, IsHandled, NextLineNo, DocLineNo, MoveNegLines);
- if IsHandled then
- exit(Result);
- if CopyThisLine then begin
- IsHandled := false;
- OnBeforeInsertToSalesLine(
- ToSalesLine, FromSalesLine, FromSalesDocType.AsInteger(), RecalculateLines, ToSalesHeader, DocLineNo, NextLineNo, RecalculateAmount, IsHandled);
- if not IsHandled then
- ToSalesLine.Insert();
- OnCopySalesDocLineOnAfterInsertToSalesLine(ToSalesLine, FromSalesLine, FromSalesDocType, MoveNegLines);
- HandleAsmAttachedToSalesLine(ToSalesLine);
- IsHandled := false;
- OnCopySalesDocLineOnBeforeAutoReserve(ToSalesHeader, ToSalesLine, IsHandled);
- if not IsHandled then
- if ToSalesLine.Reserve = ToSalesLine.Reserve::Always then
- ToSalesLine.AutoReserve();
- OnAfterInsertToSalesLine(ToSalesLine, FromSalesLine, RecalculateLines, DocLineNo, FromSalesDocType, FromSalesHeader, NextLineNo, ToSalesHeader);
- end else
- LinesNotCopied := LinesNotCopied + 1;
-
- exit(CopyThisLine);
- end;
-
- local procedure RecalculateAndApplySalesLine(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesLine: Record "Sales Line"; var RecalculateAmount: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeRecalculateAndApplySalesLine(ToSalesHeader, ToSalesLine, FromSalesLine, Currency, ExactCostRevMandatory, RecalculateAmount, CreateToHeader, MoveNegLines, IsHandled);
- if IsHandled then
- exit;
-
- if ExactCostRevMandatory and
- (FromSalesLine.Type = FromSalesLine.Type::Item) and
- (FromSalesLine."Appl.-from Item Entry" <> 0) and
- not MoveNegLines
- then begin
- if RecalculateAmount then
- RecalculateSalesLineAmounts(FromSalesLine, ToSalesLine);
- ToSalesLine.Validate("Appl.-from Item Entry", FromSalesLine."Appl.-from Item Entry");
- if not CreateToHeader then
- if ToSalesLine."Shipment Date" = 0D then
- InitShipmentDateInLine(ToSalesHeader, ToSalesLine);
- end;
- end;
-
- local procedure RecalculateSalesLineAmounts(FromSalesLine: Record "Sales Line"; var ToSalesLine: Record "Sales Line")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeRecalculateSalesLineAmounts(FromSalesLine, ToSalesLine, Currency, IsHandled);
- if IsHandled then
- exit;
-
- ToSalesLine.Validate("Unit Price", FromSalesLine."Unit Price");
- ToSalesLine.Validate("Line Discount %", FromSalesLine."Line Discount %");
- ToSalesLine.Validate(
- "Line Discount Amount",
- Round(FromSalesLine."Line Discount Amount", Currency."Amount Rounding Precision"));
- ToSalesLine.Validate(
- "Inv. Discount Amount",
- Round(FromSalesLine."Inv. Discount Amount", Currency."Amount Rounding Precision"));
- end;
-
- procedure UpdateSalesHeaderWhenCopyFromSalesHeader(var SalesHeader: Record "Sales Header"; OriginalSalesHeader: Record "Sales Header"; FromDocType: Enum "Sales Document Type From")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateSalesHeaderWhenCopyFromSalesHeader(SalesHeader, OriginalSalesHeader, FromDocType, IsHandled);
- if IsHandled then
- exit;
-
- ClearSalesLastNoSFields(SalesHeader);
- SalesHeader.Status := SalesHeader.Status::Open;
- if SalesHeader."Document Type" <> SalesHeader."Document Type"::Order then
- SalesHeader."Prepayment %" := 0;
- if FromDocType = "Sales Document Type From"::"Return Order" then begin
- SalesHeader.CopySellToAddressToShipToAddress();
- OnUpdateSalesHeaderWhenCopyFromSalesHeaderOnBeforeValidateShipToCode(SalesHeader);
- SalesHeader.Validate(SalesHeader."Ship-to Code");
- end;
- if FromDocType in ["Sales Document Type From"::Quote, "Sales Document Type From"::"Blanket Order"] then
- if OriginalSalesHeader."Posting Date" = 0D then
- SalesHeader."Posting Date" := WorkDate()
- else
- SalesHeader."Posting Date" := OriginalSalesHeader."Posting Date";
- end;
-
- local procedure UpdateSalesHeaderWhenCopyFromSalesHeaderArchive(var SalesHeader: Record "Sales Header")
- begin
- ClearSalesLastNoSFields(SalesHeader);
- SalesHeader.Status := SalesHeader.Status::Open;
- end;
-
- procedure ClearSalesLastNoSFields(var SalesHeader: Record "Sales Header")
- begin
- SalesHeader."Last Shipping No." := '';
- SalesHeader."Last Posting No." := '';
- SalesHeader."Last Prepayment No." := '';
- SalesHeader."Last Prepmt. Cr. Memo No." := '';
- SalesHeader."Last Return Receipt No." := '';
- end;
-
- local procedure UpdateSalesLine(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesHeader: Record "Sales Header"; var FromSalesLine: Record "Sales Line"; var CopyThisLine: Boolean; RecalculateAmount: Boolean; FromSalesDocType: Enum "Sales Document Type From"; var DoCopyPostedDeferral: Boolean)
- var
- SalesItem: Record Item;
- VATPostingSetup: Record "VAT Posting Setup";
- FromSalesCommentDocTypeInt: Integer;
- ShouldGetUnitCost: Boolean;
- IsHandled: Boolean;
- ShouldRecalculateSalesLine: Boolean;
- begin
- OnBeforeUpdateSalesLine(
- ToSalesHeader, ToSalesLine, FromSalesHeader, FromSalesLine,
- CopyThisLine, RecalculateAmount, FromSalesDocType.AsInteger(), DoCopyPostedDeferral);
-
- FromSalesCommentDocTypeInt := DeferralTypeForSalesDoc(FromSalesDocType.AsInteger());
- DoCopyPostedDeferral := false;
- ShouldRecalculateSalesLine := RecalculateLines and not FromSalesLine."System-Created Entry";
- OnUpdateSalesLineOnBeforeValidateToSalesLine(ToSalesHeader, ToSalesLine, FromSalesHeader, FromSalesLine, ShouldRecalculateSalesLine);
- if ShouldRecalculateSalesLine then begin
- OnUpdateSalesLineOnBeforeRecalculateSalesLine(ToSalesLine, FromSalesLine);
- RecalculateSalesLine(ToSalesHeader, ToSalesLine, FromSalesHeader, FromSalesLine, CopyThisLine);
- if IsDeferralToBeCopied(
- "Deferral Document Type"::Sales, ToSalesLine."Document Type".AsInteger(), FromSalesCommentDocTypeInt)
- then
- ToSalesLine.Validate("Deferral Code", FromSalesLine."Deferral Code");
- OnUpdateSalesLineOnAfterRecalculateSalesLine(ToSalesLine, FromSalesLine);
- end else begin
- SetDefaultValuesToSalesLine(ToSalesLine, ToSalesHeader, FromSalesLine);
- if IsDeferralToBeCopied(
- "Deferral Document Type"::Sales, ToSalesLine."Document Type".AsInteger(), FromSalesCommentDocTypeInt)
- then
- if IsDeferralPosted("Deferral Document Type"::Sales, FromSalesCommentDocTypeInt) then
- DoCopyPostedDeferral := true
- else
- ToSalesLine."Returns Deferral Start Date" :=
- CopyDeferrals("Deferral Document Type"::Sales, FromSalesLine."Document Type".AsInteger(), FromSalesLine."Document No.",
- FromSalesLine."Line No.", ToSalesLine."Document Type".AsInteger(), ToSalesLine."Document No.", ToSalesLine."Line No.")
- else
- if IsDeferralToBeDefaulted("Deferral Document Type"::Sales, ToSalesLine."Document Type".AsInteger(), FromSalesCommentDocTypeInt) then
- InitSalesDeferralCode(ToSalesLine);
-
- OnUpdateSalesLineOnBeforeClearDropShipmentAndSpecialOrder(ToSalesLine, FromSalesLine);
- if not (ToSalesLine."Document Type" in ["Sales Document Type"::Order, "Sales Document Type"::Quote, "Sales Document Type"::"Blanket Order"]) then begin
- ToSalesLine."Drop Shipment" := false;
- ToSalesLine."Special Order" := false;
- end else
- if FromSalesLine."Purchasing Code" <> '' then
- ToSalesLine.Validate("Purchasing Code", FromSalesLine."Purchasing Code");
- OnUpdateSalesLineBeforeRecalculateAmount(ToSalesLine, FromSalesLine);
- if RecalculateAmount and (FromSalesLine."Appl.-from Item Entry" = 0) then begin
- if (ToSalesLine.Type <> ToSalesLine.Type::" ") and (ToSalesLine."No." <> '') then begin
- ToSalesLine.Validate("Line Discount %", FromSalesLine."Line Discount %");
- ToSalesLine.Validate(
- "Inv. Discount Amount", Round(FromSalesLine."Inv. Discount Amount", Currency."Amount Rounding Precision"));
- end;
- IsHandled := false;
- OnUpdateSalesLineOnBeforeToSalesLineValidateUnitCostLcy(ToSalesLine, FromSalesLine, IsHandled);
- if not IsHandled then
- ToSalesLine.Validate("Unit Cost (LCY)", FromSalesLine."Unit Cost (LCY)");
- end;
- if VATPostingSetup.Get(ToSalesLine."VAT Bus. Posting Group", ToSalesLine."VAT Prod. Posting Group") then begin
- ToSalesLine."VAT Identifier" := VATPostingSetup."VAT Identifier";
- ToSalesLine."VAT Clause Code" := VATPostingSetup."VAT Clause Code";
- end;
-
- ToSalesLine.UpdateWithWarehouseShip();
- if (ToSalesLine.Type = ToSalesLine.Type::Item) and (ToSalesLine."No." <> '') then begin
- SalesItem.Get(ToSalesLine."No.");
- ShouldGetUnitCost := (SalesItem."Costing Method" = SalesItem."Costing Method"::Standard) and not ToSalesLine.IsShipment() and not IsCreatedFromJob(FromSalesLine);
- OnUpdateSalesLineOnAfterCalcShouldGetUnitCost(SalesItem, ShouldGetUnitCost);
- if ShouldGetUnitCost then
- ToSalesLine.GetUnitCost();
-
- if SalesItem.Reserve = SalesItem.Reserve::Optional then
- ToSalesLine.Reserve := ToSalesHeader.Reserve
- else
- ToSalesLine.Reserve := SalesItem.Reserve;
- OnUpdateSalesLineOnAfterSetReserve(ToSalesLine, FromSalesLine, FromSalesDocType);
- if ToSalesLine.Reserve = ToSalesLine.Reserve::Always then
- InitShipmentDateInLine(ToSalesHeader, ToSalesLine);
- end;
- OnUpdateSalesLineOnAfterUpdateWithWarehouseShip(ToSalesHeader, ToSalesLine, FromSalesHeader, FromSalesLine);
- end;
-
- OnAfterUpdateSalesLine(
- ToSalesHeader, ToSalesLine, FromSalesHeader, FromSalesLine,
- CopyThisLine, RecalculateAmount, FromSalesDocType.AsInteger(), DoCopyPostedDeferral,
- ExactCostRevMandatory, MoveNegLines, RecalculateLines);
- end;
-
- local procedure IsCreatedFromJob(var SalesLine: Record "Sales Line"): Boolean
- begin
- if (SalesLine."Job No." <> '') and (SalesLine."Job Task No." <> '') and (SalesLine."Job Contract Entry No." <> 0) then
- exit(true);
- end;
-
- local procedure RecalculateSalesLine(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesHeader: Record "Sales Header"; var FromSalesLine: Record "Sales Line"; var CopyThisLine: Boolean)
- var
- GLAcc: Record "G/L Account";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeRecalculateSalesLine(ToSalesHeader, ToSalesLine, FromSalesHeader, FromSalesLine, CopyThisLine, IsHandled);
- if not IsHandled then begin
- ToSalesLine.Validate(Type, FromSalesLine.Type);
- ToSalesLine.Description := FromSalesLine.Description;
- ToSalesLine.Validate("Description 2", FromSalesLine."Description 2");
- if FromSalesLine.Type = FromSalesLine.Type::Item then
- ToSalesLine.ExcludeDefaultItemQuantity(true);
- OnUpdateSalesLine(ToSalesLine, FromSalesLine);
-
- if (FromSalesLine.Type <> FromSalesLine.Type::" ") and (FromSalesLine."No." <> '') then begin
- if ToSalesLine.Type = ToSalesLine.Type::"G/L Account" then begin
- ToSalesLine."No." := FromSalesLine."No.";
- GLAcc.Get(FromSalesLine."No.");
- CopyThisLine := GLAcc."Direct Posting";
- OnRecalculateSalesLineOnBeforeCopyThisLine(ToSalesLine, FromSalesLine);
- if CopyThisLine then
- ToSalesLine.Validate("No.", FromSalesLine."No.");
- end else
- ToSalesLine.Validate("No.", FromSalesLine."No.");
-
- if FromSalesLine.Type = FromSalesLine.Type::Item then
- ToSalesLine.ExcludeDefaultItemQuantity(false);
-
- OnRecalculateSalesLineOnAfterValidateNo(ToSalesLine, FromSalesLine);
-
- ToSalesLine.Validate("Variant Code", FromSalesLine."Variant Code");
-
- IsHandled := false;
- OnRecalculateSalesLineOnBeforeValidateLocationCode(ToSalesLine, IsHandled);
- if not IsHandled then
- ToSalesLine.Validate("Location Code", FromSalesLine."Location Code");
-
- ToSalesLine.Validate("Unit of Measure", FromSalesLine."Unit of Measure");
- ToSalesLine.Validate("Unit of Measure Code", FromSalesLine."Unit of Measure Code");
- ToSalesLine.Validate(Quantity, FromSalesLine.Quantity);
- OnRecalculateSalesLineOnAfterValidateQuantity(ToSalesLine, FromSalesLine);
-
- if not (FromSalesLine.Type in [FromSalesLine.Type::Item, FromSalesLine.Type::Resource]) then begin
- if (FromSalesHeader."Currency Code" <> ToSalesHeader."Currency Code") or
- (FromSalesHeader."Prices Including VAT" <> ToSalesHeader."Prices Including VAT")
- then begin
- ToSalesLine."Unit Price" := 0;
- ToSalesLine."Line Discount %" := 0;
- end else begin
- ToSalesLine.Validate("Unit Price", FromSalesLine."Unit Price");
- ToSalesLine.Validate("Line Discount %", FromSalesLine."Line Discount %");
- end;
- if ToSalesLine.Quantity <> 0 then
- ToSalesLine.Validate("Line Discount Amount", FromSalesLine."Line Discount Amount");
- OnRecalculateSalesLineOnAfterValidateLineDiscountAmount(ToSalesLine, FromSalesLine);
- end;
-
- OnRecalculateSalesLineOnBeforeValidateWorkTypeCode(ToSalesLine, FromSalesLine);
-
- ToSalesLine.Validate("Work Type Code", FromSalesLine."Work Type Code");
- if (ToSalesLine."Document Type" in [ToSalesLine."Document Type"::Order, ToSalesLine."Document Type"::Quote, ToSalesLine."Document Type"::"Blanket Order"]) and
- (FromSalesLine."Purchasing Code" <> '')
- then
- ToSalesLine.Validate("Purchasing Code", FromSalesLine."Purchasing Code");
- end;
- if (FromSalesLine.Type = FromSalesLine.Type::" ") and (FromSalesLine."No." <> '') then
- ToSalesLine.Validate("No.", FromSalesLine."No.");
- end;
-
- OnAfterRecalculateSalesLine(ToSalesHeader, ToSalesLine, FromSalesHeader, FromSalesLine, CopyThisLine);
- end;
-
- procedure HandleAsmAttachedToSalesLine(var ToSalesLine: Record "Sales Line")
- var
- AssemblyItem: Record Item;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeHandleAsmAttachedToSalesLine(ToSalesLine, IsHandled);
- if IsHandled then
- exit;
-
- if ToSalesLine.Type <> ToSalesLine.Type::Item then
- exit;
- if not (ToSalesLine."Document Type" in [ToSalesLine."Document Type"::Quote, ToSalesLine."Document Type"::Order, ToSalesLine."Document Type"::"Blanket Order"]) then
- exit;
- if AsmHdrExistsForFromDocLine then begin
- ToSalesLine."Qty. to Assemble to Order" := QtyToAsmToOrder;
- ToSalesLine."Qty. to Asm. to Order (Base)" := QtyToAsmToOrderBase;
- ToSalesLine.Modify();
- CopyAsmOrderToAsmOrder(
- TempAsmHeader, TempAsmLine, ToSalesLine, GetAsmOrderType(ToSalesLine."Document Type"), '', true);
- end else begin
- AssemblyItem.Get(ToSalesLine."No.");
- if (AssemblyItem."Assembly Policy" = AssemblyItem."Assembly Policy"::"Assemble-to-Order") and
- AssemblyItem.IsAssemblyItem() and ToSalesLine.IsAsmToOrderAllowed()
- then begin
- ToSalesLine.Validate("Qty. to Assemble to Order", ToSalesLine.Quantity);
- ToSalesLine.Modify();
- end;
- end;
-
- OnAfterHandleAsmAttachedToSalesLine(ToSalesLine);
- end;
-
- procedure CopyPurchDocLine(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; var FromPurchHeader: Record "Purchase Header"; var FromPurchLine: Record "Purchase Line"; var NextLineNo: Integer; var LinesNotCopied: Integer; RecalculateAmount: Boolean; FromPurchDocType: Enum "Purchase Document Type From"; var CopyPostedDeferral: Boolean; DocLineNo: Integer) Result: Boolean
- var
- RoundingLineInserted: Boolean;
- CopyThisLine: Boolean;
- ShouldRevertQuantitySign: Boolean;
- IsHandled: Boolean;
- begin
- CopyThisLine := true;
- IsHandled := false;
- OnBeforeCopyPurchLine(
- ToPurchHeader, FromPurchHeader, FromPurchLine, RecalculateLines, CopyThisLine, ToPurchLine, MoveNegLines,
- RoundingLineInserted, Result, IsHandled, FromPurchDocType, DocLineNo, RecalculateLines, LinesNotCopied, CopyPostedDeferral, NextLineNo);
- if IsHandled then
- exit(Result);
- if not CopyThisLine then begin
- LinesNotCopied := LinesNotCopied + 1;
- exit(false);
- end;
-
- CheckPurchRounding(FromPurchLine, RoundingLineInserted);
-
- if ((ToPurchHeader."Language Code" <> FromPurchHeader."Language Code") or RecalculateLines) and
- FromPurchLine.IsExtendedText() or
- FromPurchLine."Prepayment Line" or RoundingLineInserted
- then
- exit(false);
-
- if IsEntityBlocked(Database::"Purchase Line", ToPurchHeader.IsCreditDocType(), FromPurchLine.Type.AsInteger(), FromPurchLine."No.", FromPurchLine."Variant Code") then begin
- LinesNotCopied := LinesNotCopied + 1;
- exit(false);
- end;
-
- OnCopyPurchDocLineOnBeforeRecalculateLines(ToPurchHeader, ToPurchLine, FromPurchHeader, FromPurchLine, NextLineNo);
- if RecalculateLines and not FromPurchLine."System-Created Entry" then begin
- ToPurchLine.Init();
- OnAfterInitToPurchLine(ToPurchLine);
- end else begin
- ToPurchLine := FromPurchLine;
- ToPurchLine."Returns Deferral Start Date" := 0D;
- if ToPurchHeader."Document Type" in [ToPurchHeader."Document Type"::Quote, ToPurchHeader."Document Type"::"Blanket Order"] then
- ToPurchLine."Deferral Code" := '';
- if MoveNegLines and (ToPurchLine.Type <> ToPurchLine.Type::" ") then begin
- ToPurchLine.Amount := -ToPurchLine.Amount;
- ToPurchLine."Amount Including VAT" := -ToPurchLine."Amount Including VAT";
- end
- end;
-
- NextLineNo := NextLineNo + 10000;
- OnCopyPurchDocLineOnAfterSetNextLineNo(ToPurchLine, FromPurchLine, NextLineNo);
- ToPurchLine."Document Type" := ToPurchHeader."Document Type";
- ToPurchLine."Document No." := ToPurchHeader."No.";
- ToPurchLine."Line No." := NextLineNo;
- if not IncludeHeader then
- CheckPurchVATBusPostingGroup(ToPurchHeader, ToPurchLine);
- ToPurchLine."Copied From Posted Doc." := FromPurchLine."Copied From Posted Doc.";
- ToPurchLine.Validate("Currency Code", FromPurchHeader."Currency Code");
- ValidatePurchLineDiscountFields(FromPurchHeader, ToPurchHeader, ToPurchLine);
- UpdatePurchLine(
- ToPurchHeader, ToPurchLine, FromPurchHeader, FromPurchLine,
- CopyThisLine, RecalculateAmount, FromPurchDocType, CopyPostedDeferral);
-
- IsHandled := false;
- OnCopyPurchDocLineOnBeforeCheckLocationOnWMS(ToPurchHeader, ToPurchLine, FromPurchLine, IsHandled);
- if not IsHandled then
- ToPurchLine.CheckLocationOnWMS();
-
- RecalculateAndApplyPurchLine(ToPurchHeader, ToPurchLine, FromPurchLine, RecalculateAmount);
-
- ShouldRevertQuantitySign := MoveNegLines and (ToPurchLine.Type <> ToPurchLine.Type::" ");
- OnCopyPurchLineOnBeforeValidateQuantity(ToPurchLine, RecalculateLines, FromPurchLine, MoveNegLines, ShouldRevertQuantitySign);
-
- if ShouldRevertQuantitySign then begin
- ToPurchLine.Validate(Quantity, -FromPurchLine.Quantity);
- OnCopyPurchLineOnAfterValidateQuantityMoveNegLines(ToPurchLine, FromPurchLine);
- ToPurchLine."Appl.-to Item Entry" := FromPurchLine."Appl.-to Item Entry"
- end;
-
- CopyPurchLineExtText(ToPurchHeader, ToPurchLine, FromPurchHeader, FromPurchLine, DocLineNo, NextLineNo);
-
- if FromPurchLine."Job No." <> '' then
- CopyPurchaseJobFields(ToPurchLine, FromPurchLine);
-
- if not RecalculateLines then begin
- ToPurchLine."Dimension Set ID" := FromPurchLine."Dimension Set ID";
- ToPurchLine."Shortcut Dimension 1 Code" := FromPurchLine."Shortcut Dimension 1 Code";
- ToPurchLine."Shortcut Dimension 2 Code" := FromPurchLine."Shortcut Dimension 2 Code";
- OnCopyPurchLineOnAfterSetDimensions(ToPurchLine, FromPurchLine);
- end;
-
- IsHandled := false;
- OnCopyPurchDocLineOnBeforeCopyThisLine(ToPurchLine, FromPurchLine, MoveNegLines, FromPurchDocType, LinesNotCopied, CopyThisLine, Result, IsHandled, ToPurchHeader, RecalculateLines, NextLineNo);
- if IsHandled then
- exit(Result);
-
- if CopyThisLine then begin
- OnBeforeInsertToPurchLine(
- ToPurchLine, FromPurchLine, FromPurchDocType.AsInteger(), RecalculateLines, ToPurchHeader, DocLineNo, NextLineNo);
- ToPurchLine.Insert();
- OnAfterInsertToPurchLine(ToPurchLine, FromPurchLine, RecalculateLines, DocLineNo, FromPurchDocType, ToPurchHeader, MoveNegLines, FromPurchHeader);
- end else
- LinesNotCopied := LinesNotCopied + 1;
-
- exit(CopyThisLine);
- end;
-
- local procedure RecalculateAndApplyPurchLine(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; var FromPurchLine: Record "Purchase Line"; RecalculateAmount: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeRecalculateAndApplyPurchLine(ToPurchHeader, ToPurchLine, FromPurchLine, Currency, RecalculateAmount, ExactCostRevMandatory, CreateToHeader, MoveNegLines, IsHandled);
- if IsHandled then
- exit;
-
- if ExactCostRevMandatory and
- (FromPurchLine.Type = FromPurchLine.Type::Item) and
- (FromPurchLine."Appl.-to Item Entry" <> 0) and
- not MoveNegLines
- then begin
- if RecalculateAmount then begin
- ToPurchLine.Validate("Direct Unit Cost", FromPurchLine."Direct Unit Cost");
- ToPurchLine.Validate("Line Discount %", FromPurchLine."Line Discount %");
- ToPurchLine.Validate(
- "Line Discount Amount",
- Round(FromPurchLine."Line Discount Amount", Currency."Amount Rounding Precision"));
- ToPurchLine.Validate(
- "Inv. Discount Amount",
- Round(FromPurchLine."Inv. Discount Amount", Currency."Amount Rounding Precision"));
- end;
- ToPurchLine.Validate("Appl.-to Item Entry", FromPurchLine."Appl.-to Item Entry");
- if not CreateToHeader then
- if ToPurchLine."Expected Receipt Date" = 0D then
- if ToPurchHeader."Expected Receipt Date" <> 0D then
- ToPurchLine."Expected Receipt Date" := ToPurchHeader."Expected Receipt Date"
- else
- ToPurchLine."Expected Receipt Date" := WorkDate();
- end;
-
- end;
-
- local procedure ValidatePurchLineDiscountFields(FromPurchHeader: Record "Purchase Header"; ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line")
- var
- InvDiscountAmount: Decimal;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeValidatePurchLineDiscountFields(FromPurchHeader, ToPurchHeader, ToPurchLine, InvDiscountAmount, IsHandled, RecalculateLines);
- if IsHandled then
- exit;
-
- if (ToPurchLine.Type <> ToPurchLine.Type::" ") and
- ((ToPurchLine.Amount = 0) or
- (ToPurchHeader."Prices Including VAT" <> FromPurchHeader."Prices Including VAT") or
- (ToPurchHeader."Currency Factor" <> FromPurchHeader."Currency Factor"))
- then begin
- InvDiscountAmount := ToPurchLine."Inv. Discount Amount";
- ToPurchLine.Validate("Line Discount %");
- ToPurchLine.Validate("Inv. Discount Amount", InvDiscountAmount);
- end;
- end;
-
- procedure UpdatePurchHeaderWhenCopyFromPurchHeader(var PurchaseHeader: Record "Purchase Header"; OriginalPurchaseHeader: Record "Purchase Header"; FromDocType: Enum "Purchase Document Type From")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdatePurchHeaderWhenCopyFromPurchHeader(PurchaseHeader, OriginalPurchaseHeader, FromDocType, IsHandled);
- if IsHandled then
- exit;
-
- ClearPurchLastNoSFields(PurchaseHeader);
- PurchaseHeader.Receive := false;
- PurchaseHeader.Status := PurchaseHeader.Status::Open;
- PurchaseHeader."IC Status" := PurchaseHeader."IC Status"::New;
- if PurchaseHeader."Document Type" <> PurchaseHeader."Document Type"::Order then
- PurchaseHeader."Prepayment %" := 0;
- if FromDocType in ["Purchase Document Type From"::Quote, "Purchase Document Type From"::"Blanket Order"] then
- if OriginalPurchaseHeader."Posting Date" = 0D then
- PurchaseHeader."Posting Date" := WorkDate()
- else
- PurchaseHeader."Posting Date" := OriginalPurchaseHeader."Posting Date";
- end;
-
- local procedure UpdatePurchHeaderWhenCopyFromPurchHeaderArchive(var PurchaseHeader: Record "Purchase Header")
- begin
- ClearPurchLastNoSFields(PurchaseHeader);
- PurchaseHeader.Status := PurchaseHeader.Status::Open;
- end;
-
- procedure ClearPurchLastNoSFields(var PurchaseHeader: Record "Purchase Header")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeClearPurchLastNoSFields(PurchaseHeader, IsHandled);
- if IsHandled then
- exit;
-
- PurchaseHeader."Last Receiving No." := '';
- PurchaseHeader."Last Posting No." := '';
- PurchaseHeader."Last Prepayment No." := '';
- PurchaseHeader."Last Prepmt. Cr. Memo No." := '';
- PurchaseHeader."Last Return Shipment No." := '';
- end;
-
- local procedure UpdatePurchLine(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; var FromPurchHeader: Record "Purchase Header"; var FromPurchLine: Record "Purchase Line"; var CopyThisLine: Boolean; RecalculateAmount: Boolean; FromPurchDocType: Enum "Purchase Document Type From"; var DoCopyPostedDeferral: Boolean)
- var
- VATPostingSetup: Record "VAT Posting Setup";
- FromPurchCommentDocTypeInt: Integer;
- begin
- OnBeforeUpdatePurchLine(
- ToPurchHeader, ToPurchLine, FromPurchHeader, FromPurchLine,
- CopyThisLine, RecalculateAmount, FromPurchDocType.AsInteger(), DoCopyPostedDeferral);
-
- FromPurchCommentDocTypeInt := DeferralTypeForPurchDoc(FromPurchDocType.AsInteger());
- DoCopyPostedDeferral := false;
- if RecalculateLines and not FromPurchLine."System-Created Entry" then begin
- RecalculatePurchLine(ToPurchHeader, ToPurchLine, FromPurchHeader, FromPurchLine, CopyThisLine);
- if IsDeferralToBeCopied("Deferral Document Type"::Purchase, ToPurchLine."Document Type".AsInteger(), FromPurchCommentDocTypeInt) then
- ToPurchLine.Validate("Deferral Code", FromPurchLine."Deferral Code");
- end else begin
- SetDefaultValuesToPurchLine(ToPurchLine, ToPurchHeader, FromPurchLine."VAT Difference", FromPurchLine."Non-Deductible VAT Diff.");
- if IsDeferralToBeCopied("Deferral Document Type"::Purchase, ToPurchLine."Document Type".AsInteger(), FromPurchCommentDocTypeInt) then
- if IsDeferralPosted("Deferral Document Type"::Purchase, FromPurchCommentDocTypeInt) then
- DoCopyPostedDeferral := true
- else
- ToPurchLine."Returns Deferral Start Date" :=
- CopyDeferrals("Deferral Document Type"::Purchase, FromPurchLine."Document Type".AsInteger(), FromPurchLine."Document No.",
- FromPurchLine."Line No.", ToPurchLine."Document Type".AsInteger(), ToPurchLine."Document No.", ToPurchLine."Line No.")
- else
- if IsDeferralToBeDefaulted("Deferral Document Type"::Purchase, ToPurchLine."Document Type".AsInteger(), FromPurchCommentDocTypeInt) then
- InitPurchDeferralCode(ToPurchLine);
-
- if FromPurchLine."Drop Shipment" or FromPurchLine."Special Order" then
- ToPurchLine."Purchasing Code" := '';
- ToPurchLine."Drop Shipment" := false;
- ToPurchLine."Special Order" := false;
- if VATPostingSetup.Get(ToPurchLine."VAT Bus. Posting Group", ToPurchLine."VAT Prod. Posting Group") then
- ToPurchLine."VAT Identifier" := VATPostingSetup."VAT Identifier";
-
- OnBeforeCopyPurchLines(ToPurchLine);
-
- CopyDocLines(RecalculateAmount, ToPurchLine, FromPurchLine);
-
- ToPurchLine.UpdateWithWarehouseReceive();
- ToPurchLine."Pay-to Vendor No." := ToPurchHeader."Pay-to Vendor No.";
- OnUpdatePurchLineOnAfterCopyDocLine(ToPurchLine, FromPurchLine);
- end;
- ToPurchLine.Validate("Order No.", FromPurchLine."Order No.");
- ToPurchLine.Validate("Order Line No.", FromPurchLine."Order Line No.");
-
- OnAfterUpdatePurchLine(
- ToPurchHeader, ToPurchLine, FromPurchHeader, FromPurchLine,
- CopyThisLine, RecalculateAmount, FromPurchDocType.AsInteger(), DoCopyPostedDeferral, RecalculateLines);
- end;
-
- local procedure RecalculatePurchLine(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; var FromPurchHeader: Record "Purchase Header"; var FromPurchLine: Record "Purchase Line"; var CopyThisLine: Boolean)
- var
- GLAcc: Record "G/L Account";
- IsHandled: Boolean;
- begin
- OnBeforeRecalculatePurchLine(ToPurchHeader, ToPurchLine, FromPurchHeader, FromPurchLine, CopyThisLine);
-
- ToPurchLine.Validate(Type, FromPurchLine.Type);
- ToPurchLine.Description := FromPurchLine.Description;
- ToPurchLine.Validate("Description 2", FromPurchLine."Description 2");
- OnUpdatePurchLine(ToPurchLine, FromPurchLine);
-
- if (FromPurchLine.Type <> FromPurchLine.Type::" ") and (FromPurchLine."No." <> '') then begin
- if ToPurchLine.Type = ToPurchLine.Type::"G/L Account" then begin
- ToPurchLine."No." := FromPurchLine."No.";
- GLAcc.Get(FromPurchLine."No.");
- CopyThisLine := GLAcc."Direct Posting";
- OnRecalculatePurchLineOnAfterCopyThisLine(ToPurchLine, FromPurchLine);
- if CopyThisLine then
- ToPurchLine.Validate("No.", FromPurchLine."No.");
- end else
- ToPurchLine.Validate("No.", FromPurchLine."No.");
- OnRecalculatePurchLineOnAfterValidateNo(ToPurchLine, FromPurchLine);
- ToPurchLine.Validate("Variant Code", FromPurchLine."Variant Code");
-
- IsHandled := false;
- OnRecalculatePurchLineOnBeforeValidateLocationCode(ToPurchLine, IsHandled);
- if not IsHandled then
- ToPurchLine.Validate("Location Code", FromPurchLine."Location Code");
-
- ToPurchLine.Validate("Unit of Measure", FromPurchLine."Unit of Measure");
- ToPurchLine.Validate("Unit of Measure Code", FromPurchLine."Unit of Measure Code");
- ToPurchLine.Validate(Quantity, FromPurchLine.Quantity);
- OnRecalculatePurchLineOnAfterValidateQuantity(ToPurchLine, FromPurchLine);
-
- if not (FromPurchLine.Type in [FromPurchLine.Type::Item, FromPurchLine.Type::Resource]) then begin
- ToPurchHeader.TestField("Currency Code", FromPurchHeader."Currency Code");
- ToPurchLine.Validate("Direct Unit Cost", FromPurchLine."Direct Unit Cost");
- ToPurchLine.Validate("Line Discount %", FromPurchLine."Line Discount %");
- if ToPurchLine.Quantity <> 0 then
- ToPurchLine.Validate("Line Discount Amount", FromPurchLine."Line Discount Amount");
- end;
- IsHandled := false;
- OnRecalculatePurchLineOnBeforeValidatePurchasingCode(ToPurchHeader, ToPurchLine, FromPurchHeader, FromPurchLine, CopyThisLine, IsHandled);
- if not IsHandled then
- if (ToPurchLine."Document Type" = ToPurchLine."Document Type"::Order) and
- (FromPurchLine."Purchasing Code" <> '') and not FromPurchLine."Drop Shipment" and not FromPurchLine."Special Order"
- then
- ToPurchLine.Validate("Purchasing Code", FromPurchLine."Purchasing Code");
- OnRecalculatePurchLineOnAfterValidatePurchasingCode(ToPurchLine, FromPurchLine);
- end;
- if (FromPurchLine.Type = FromPurchLine.Type::" ") and (FromPurchLine."No." <> '') then
- ToPurchLine.Validate("No.", FromPurchLine."No.");
-
- OnAfterRecalculatePurchLine(ToPurchLine, ToPurchHeader, FromPurchHeader, FromPurchLine, CopyThisLine);
- end;
-
- local procedure CheckPurchRounding(FromPurchLine: Record "Purchase Line"; var RoundingLineInserted: Boolean)
- var
- PurchSetup: Record "Purchases & Payables Setup";
- Vendor: Record Vendor;
- VendorPostingGroup: Record "Vendor Posting Group";
- begin
- if (FromPurchLine.Type <> FromPurchLine.Type::"G/L Account") or (FromPurchLine."No." = '') then
- exit;
- if not FromPurchLine."System-Created Entry" then
- exit;
-
- PurchSetup.Get();
- if PurchSetup."Invoice Rounding" then begin
- GetVendor(FromPurchLine, Vendor);
- VendorPostingGroup.Get(Vendor."Vendor Posting Group");
- RoundingLineInserted := FromPurchLine."No." = VendorPostingGroup.GetInvRoundingAccount();
- end;
- end;
-
- local procedure GetVendor(var FromPurchLine: Record "Purchase Line"; var Vendor: Record Vendor)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeGetVendor(FromPurchLine, Vendor, IsHandled);
- if not IsHandled then
- Vendor.Get(FromPurchLine."Pay-to Vendor No.");
- end;
-
- local procedure CheckSalesRounding(FromSalesLine: Record "Sales Line"; var RoundingLineInserted: Boolean)
- var
- SalesSetup: Record "Sales & Receivables Setup";
- Customer: Record Customer;
- CustomerPostingGroup: Record "Customer Posting Group";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckSalesRounding(FromSalesLine, RoundingLineInserted, IsHandled);
- if IsHandled then
- exit;
-
- if (FromSalesLine.Type <> FromSalesLine.Type::"G/L Account") or (FromSalesLine."No." = '') then
- exit;
- if not FromSalesLine."System-Created Entry" then
- exit;
-
- SalesSetup.Get();
- if SalesSetup."Invoice Rounding" then begin
- Customer.Get(FromSalesLine."Bill-to Customer No.");
- CustomerPostingGroup.Get(Customer."Customer Posting Group");
- RoundingLineInserted := FromSalesLine."No." = CustomerPostingGroup.GetInvRoundingAccount();
- end;
-
- OnAfterCheckSalesRounding(FromSalesLine, RoundingLineInserted);
- end;
-
- local procedure CopyFromSalesDocAssgntToLine(var ToSalesLine: Record "Sales Line"; FromDocType: Enum "Sales Document Type"; FromDocNo: Code[20]; FromLineNo: Integer; var ItemChargeAssgntNextLineNo: Integer)
- var
- FromItemChargeAssgntSales: Record "Item Charge Assignment (Sales)";
- ToItemChargeAssgntSales: Record "Item Charge Assignment (Sales)";
- ItemChargeAssgntSales: Codeunit "Item Charge Assgnt. (Sales)";
- IsHandled: Boolean;
- begin
- FromItemChargeAssgntSales.Reset();
- FromItemChargeAssgntSales.SetRange("Document Type", FromDocType);
- FromItemChargeAssgntSales.SetRange("Document No.", FromDocNo);
- FromItemChargeAssgntSales.SetRange("Document Line No.", FromLineNo);
- FromItemChargeAssgntSales.SetFilter("Applies-to Doc. Type", '<>%1', FromDocType);
- OnCopyFromSalesDocAssgntToLineOnAfterSetFilters(FromItemChargeAssgntSales, RecalculateLines);
- if FromItemChargeAssgntSales.Find('-') then
- repeat
- ToItemChargeAssgntSales.Copy(FromItemChargeAssgntSales);
- ToItemChargeAssgntSales."Document Type" := ToSalesLine."Document Type";
- ToItemChargeAssgntSales."Document No." := ToSalesLine."Document No.";
- ToItemChargeAssgntSales."Document Line No." := ToSalesLine."Line No.";
- IsHandled := false;
- OnCopyFromSalesDocAssgntToLineOnBeforeInsert(FromItemChargeAssgntSales, RecalculateLines, IsHandled);
- if not IsHandled then
- ItemChargeAssgntSales.InsertItemChargeAssignment(
- ToItemChargeAssgntSales, ToItemChargeAssgntSales."Applies-to Doc. Type",
- ToItemChargeAssgntSales."Applies-to Doc. No.", ToItemChargeAssgntSales."Applies-to Doc. Line No.",
- ToItemChargeAssgntSales."Item No.", ToItemChargeAssgntSales.Description, ItemChargeAssgntNextLineNo);
- until FromItemChargeAssgntSales.Next() = 0;
-
- OnAfterCopyFromSalesDocAssgntToLine(ToSalesLine, RecalculateLines);
- end;
-
- local procedure CopyFromPurchDocAssgntToLine(var ToPurchLine: Record "Purchase Line"; FromDocType: Enum "Purchase Document Type"; FromDocNo: Code[20]; FromLineNo: Integer; var ItemChargeAssgntNextLineNo: Integer)
- var
- FromItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)";
- ToItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)";
- ItemChargeAssgntPurch: Codeunit "Item Charge Assgnt. (Purch.)";
- IsHandled: Boolean;
- begin
- FromItemChargeAssgntPurch.Reset();
- FromItemChargeAssgntPurch.SetRange("Document Type", FromDocType);
- FromItemChargeAssgntPurch.SetRange("Document No.", FromDocNo);
- FromItemChargeAssgntPurch.SetRange("Document Line No.", FromLineNo);
- FromItemChargeAssgntPurch.SetFilter("Applies-to Doc. Type", '<>%1', FromDocType);
- OnCopyFromPurchDocAssgntToLineOnAfterSetFilters(FromItemChargeAssgntPurch, RecalculateLines);
- if FromItemChargeAssgntPurch.Find('-') then
- repeat
- ToItemChargeAssgntPurch.Copy(FromItemChargeAssgntPurch);
- ToItemChargeAssgntPurch."Document Type" := ToPurchLine."Document Type";
- ToItemChargeAssgntPurch."Document No." := ToPurchLine."Document No.";
- ToItemChargeAssgntPurch."Document Line No." := ToPurchLine."Line No.";
- IsHandled := false;
- OnCopyFromPurchDocAssgntToLineOnBeforeInsert(FromItemChargeAssgntPurch, RecalculateLines, IsHandled);
- if not IsHandled then
- ItemChargeAssgntPurch.InsertItemChargeAssignment(
- ToItemChargeAssgntPurch, ToItemChargeAssgntPurch."Applies-to Doc. Type",
- ToItemChargeAssgntPurch."Applies-to Doc. No.", ToItemChargeAssgntPurch."Applies-to Doc. Line No.",
- ToItemChargeAssgntPurch."Item No.", ToItemChargeAssgntPurch.Description, ItemChargeAssgntNextLineNo);
- until FromItemChargeAssgntPurch.Next() = 0;
-
- OnAfterCopyFromPurchDocAssgntToLine(ToPurchLine, RecalculateLines);
- end;
-
- local procedure CopyFromPurchLineItemChargeAssign(FromPurchLine: Record "Purchase Line"; ToPurchLine: Record "Purchase Line"; FromPurchHeader: Record "Purchase Header"; var ItemChargeAssgntNextLineNo: Integer)
- var
- TempToItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)" temporary;
- ToItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)";
- ValueEntry: Record "Value Entry";
- ItemLedgerEntry: Record "Item Ledger Entry";
- PurchaseItem: Record Item;
- PurchaseCurrency: Record Currency;
- ItemChargeAssgntPurch: Codeunit "Item Charge Assgnt. (Purch.)";
- CurrencyFactor: Decimal;
- QtyToAssign: Decimal;
- SumQtyToAssign: Decimal;
- RemainingQty: Decimal;
- begin
- if FromPurchLine."Document Type" = FromPurchLine."Document Type"::"Credit Memo" then
- ValueEntry.SetRange("Document Type", ValueEntry."Document Type"::"Purchase Credit Memo")
- else
- ValueEntry.SetRange("Document Type", ValueEntry."Document Type"::"Purchase Invoice");
-
- ValueEntry.SetRange("Document No.", FromPurchLine."Document No.");
- ValueEntry.SetRange("Document Line No.", FromPurchLine."Line No.");
- ValueEntry.SetRange("Item Charge No.", FromPurchLine."No.");
- ToItemChargeAssignmentPurch."Document Type" := ToPurchLine."Document Type";
- ToItemChargeAssignmentPurch."Document No." := ToPurchLine."Document No.";
- ToItemChargeAssignmentPurch."Document Line No." := ToPurchLine."Line No.";
- ToItemChargeAssignmentPurch."Item Charge No." := FromPurchLine."No.";
- ToItemChargeAssignmentPurch."Unit Cost" := FromPurchLine."Unit Cost";
-
- if ValueEntry.FindSet() then begin
- repeat
- if ItemLedgerEntry.Get(ValueEntry."Item Ledger Entry No.") then
- if ItemLedgerEntry."Document Type" = ItemLedgerEntry."Document Type"::"Purchase Receipt" then begin
- PurchaseItem.Get(ItemLedgerEntry."Item No.");
- CurrencyFactor := FromPurchHeader."Currency Factor";
-
- if not PurchaseCurrency.Get(FromPurchHeader."Currency Code") then begin
- CurrencyFactor := 1;
- PurchaseCurrency.InitRoundingPrecision();
- end;
-
- if ToPurchLine."Unit Cost" = 0 then
- QtyToAssign := 0
- else
- QtyToAssign :=
- Sign(ToPurchLine.Quantity) * Abs(ValueEntry."Cost Amount (Actual)") * CurrencyFactor / ToPurchLine."Unit Cost";
- SumQtyToAssign += QtyToAssign;
-
- ItemChargeAssgntPurch.InsertItemChargeAssignmentWithValuesTo(
- ToItemChargeAssignmentPurch, ToItemChargeAssignmentPurch."Applies-to Doc. Type"::Receipt,
- ItemLedgerEntry."Document No.", ItemLedgerEntry."Document Line No.", ItemLedgerEntry."Item No.", PurchaseItem.Description,
- QtyToAssign, 0, ItemChargeAssgntNextLineNo, TempToItemChargeAssignmentPurch);
- end;
- OnCopyFromPurchLineItemChargeAssignOnAfterValueEntryLoop(
- FromPurchHeader, ToPurchLine, ValueEntry, TempToItemChargeAssignmentPurch, ToItemChargeAssignmentPurch,
- ItemChargeAssgntNextLineNo, SumQtyToAssign);
- until ValueEntry.Next() = 0;
- ItemChargeAssgntPurch.Summarize(TempToItemChargeAssignmentPurch, ToItemChargeAssignmentPurch);
-
- // Use 2 passes to correct rounding issues
- ToItemChargeAssignmentPurch.SetRange("Document Type", ToPurchLine."Document Type");
- ToItemChargeAssignmentPurch.SetRange("Document No.", ToPurchLine."Document No.");
- ToItemChargeAssignmentPurch.SetRange("Document Line No.", ToPurchLine."Line No.");
- if ToItemChargeAssignmentPurch.FindSet(true) then begin
- RemainingQty := (FromPurchLine.Quantity - SumQtyToAssign) / ValueEntry.Count();
- SumQtyToAssign := 0;
- repeat
- AddRemainingQtyToPurchItemCharge(ToItemChargeAssignmentPurch, RemainingQty);
- SumQtyToAssign += ToItemChargeAssignmentPurch."Qty. to Assign";
- until ToItemChargeAssignmentPurch.Next() = 0;
-
- RemainingQty := FromPurchLine.Quantity - SumQtyToAssign;
- if RemainingQty <> 0 then
- AddRemainingQtyToPurchItemCharge(ToItemChargeAssignmentPurch, RemainingQty);
- end;
- end;
- end;
-
- local procedure CopyFromSalesLineItemChargeAssign(FromSalesLine: Record "Sales Line"; ToSalesLine: Record "Sales Line"; FromSalesHeader: Record "Sales Header"; var ItemChargeAssgntNextLineNo: Integer)
- var
- ValueEntry: Record "Value Entry";
- SalesCurrency: Record Currency;
- TempToItemChargeAssignmentSales: Record "Item Charge Assignment (Sales)" temporary;
- ToItemChargeAssignmentSales: Record "Item Charge Assignment (Sales)";
- ItemLedgerEntry: Record "Item Ledger Entry";
- SalesItem: Record Item;
- ItemChargeAssgntSales: Codeunit "Item Charge Assgnt. (Sales)";
- CurrencyFactor: Decimal;
- QtyToAssign: Decimal;
- SumQtyToAssign: Decimal;
- RemainingQty: Decimal;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCopyFromSalesLineItemChargeAssign(FromSalesLine, ToSalesLine, FromSalesHeader, ItemChargeAssgntNextLineNo, IsHandled);
- if IsHandled then
- exit;
-
- if FromSalesLine."Document Type" = FromSalesLine."Document Type"::"Credit Memo" then
- ValueEntry.SetRange("Document Type", ValueEntry."Document Type"::"Sales Credit Memo")
- else
- ValueEntry.SetRange("Document Type", ValueEntry."Document Type"::"Sales Invoice");
-
- ValueEntry.SetRange("Document No.", FromSalesLine."Document No.");
- ValueEntry.SetRange("Document Line No.", FromSalesLine."Line No.");
- ValueEntry.SetRange("Item Charge No.", FromSalesLine."No.");
- ToItemChargeAssignmentSales."Document Type" := ToSalesLine."Document Type";
- ToItemChargeAssignmentSales."Document No." := ToSalesLine."Document No.";
- ToItemChargeAssignmentSales."Document Line No." := ToSalesLine."Line No.";
- ToItemChargeAssignmentSales."Item Charge No." := FromSalesLine."No.";
- ToItemChargeAssignmentSales."Unit Cost" := FromSalesLine."Unit Price";
-
- if ValueEntry.FindSet() then begin
- repeat
- if ItemLedgerEntry.Get(ValueEntry."Item Ledger Entry No.") then
- if ItemLedgerEntry."Document Type" = ItemLedgerEntry."Document Type"::"Sales Shipment" then begin
- SalesItem.Get(ItemLedgerEntry."Item No.");
- CurrencyFactor := FromSalesHeader."Currency Factor";
-
- if not SalesCurrency.Get(FromSalesHeader."Currency Code") then begin
- CurrencyFactor := 1;
- SalesCurrency.InitRoundingPrecision();
- end;
-
- QtyToAssign :=
- Sign(ToSalesLine.Quantity) * Abs(ValueEntry."Sales Amount (Actual)") * CurrencyFactor / ToSalesLine."Unit Price";
- SumQtyToAssign += QtyToAssign;
-
- ItemChargeAssgntSales.InsertItemChargeAssignmentWithValuesTo(
- ToItemChargeAssignmentSales, ToItemChargeAssignmentSales."Applies-to Doc. Type"::Shipment,
- ItemLedgerEntry."Document No.", ItemLedgerEntry."Document Line No.", ItemLedgerEntry."Item No.", SalesItem.Description,
- QtyToAssign, 0, ItemChargeAssgntNextLineNo, TempToItemChargeAssignmentSales);
- end;
- OnCopyFromSalesLineItemChargeAssignOnAfterValueEntryLoop(
- FromSalesHeader, ToSalesLine, ValueEntry, TempToItemChargeAssignmentSales, ToItemChargeAssignmentSales,
- ItemChargeAssgntNextLineNo, SumQtyToAssign);
- until ValueEntry.Next() = 0;
- ItemChargeAssgntSales.Summarize(TempToItemChargeAssignmentSales, ToItemChargeAssignmentSales);
-
- // Use 2 passes to correct rounding issues
- ToItemChargeAssignmentSales.SetRange("Document Type", ToSalesLine."Document Type");
- ToItemChargeAssignmentSales.SetRange("Document No.", ToSalesLine."Document No.");
- ToItemChargeAssignmentSales.SetRange("Document Line No.", ToSalesLine."Line No.");
- if ToItemChargeAssignmentSales.FindSet(true) then begin
- RemainingQty := (FromSalesLine.Quantity - SumQtyToAssign) / ValueEntry.Count();
- SumQtyToAssign := 0;
- repeat
- AddRemainingQtyToSalesItemCharge(ToItemChargeAssignmentSales, RemainingQty);
- SumQtyToAssign += ToItemChargeAssignmentSales."Qty. to Assign";
- until ToItemChargeAssignmentSales.Next() = 0;
-
- RemainingQty := FromSalesLine.Quantity - SumQtyToAssign;
- if RemainingQty <> 0 then
- AddRemainingQtyToSalesItemCharge(ToItemChargeAssignmentSales, RemainingQty);
- end;
- end;
- end;
-
- local procedure AddRemainingQtyToPurchItemCharge(var ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; RemainingQty: Decimal)
- begin
- ItemChargeAssignmentPurch.Validate(
- "Qty. to Assign", Round(ItemChargeAssignmentPurch."Qty. to Assign" + RemainingQty, UOMMgt.QtyRndPrecision()));
- ItemChargeAssignmentPurch.Modify(true);
- end;
-
- local procedure AddRemainingQtyToSalesItemCharge(var ItemChargeAssignmentSales: Record "Item Charge Assignment (Sales)"; RemainingQty: Decimal)
- begin
- ItemChargeAssignmentSales.Validate(
- "Qty. to Assign", Round(ItemChargeAssignmentSales."Qty. to Assign" + RemainingQty, UOMMgt.QtyRndPrecision()));
- ItemChargeAssignmentSales.Modify(true);
- end;
-
- local procedure WarnSalesInvoicePmtDisc(var ToSalesHeader: Record "Sales Header"; FromDocType: Enum "Sales Document Type From"; FromDocNo: Code[20])
- var
- CustLedgEntry: Record "Cust. Ledger Entry";
- begin
- if HideDialog then
- exit;
-
- if IncludeHeader and
- (ToSalesHeader."Document Type" in
- [ToSalesHeader."Document Type"::"Return Order", ToSalesHeader."Document Type"::"Credit Memo"])
- then begin
- CustLedgEntry.SetCurrentKey("Document No.");
- CustLedgEntry.SetRange("Document Type", CustLedgEntry."Document Type"::Invoice);
- CustLedgEntry.SetRange("Document No.", FromDocNo);
- if CustLedgEntry.FindFirst() then
- if (CustLedgEntry."Pmt. Disc. Given (LCY)" <> 0) and
- (CustLedgEntry."Journal Batch Name" = '')
- then
- Message(Text006, FromDocType, FromDocNo);
- end;
-
- if IncludeHeader and
- (ToSalesHeader."Document Type" in
- [ToSalesHeader."Document Type"::Invoice, ToSalesHeader."Document Type"::Order,
- ToSalesHeader."Document Type"::Quote, ToSalesHeader."Document Type"::"Blanket Order"]) and
- (FromDocType = "Sales Document Type From"::"Posted Return Receipt")
- then begin
- CustLedgEntry.SetCurrentKey("Document No.");
- CustLedgEntry.SetRange("Document Type", CustLedgEntry."Document Type"::"Credit Memo");
- CustLedgEntry.SetRange("Document No.", FromDocNo);
- if CustLedgEntry.FindFirst() then
- if (CustLedgEntry."Pmt. Disc. Given (LCY)" <> 0) and
- (CustLedgEntry."Journal Batch Name" = '')
- then
- Message(Text006, FromDocType, FromDocNo);
- end;
- end;
-
- local procedure WarnPurchInvoicePmtDisc(var ToPurchHeader: Record "Purchase Header"; FromDocType: Enum "Purchase Document Type From"; FromDocNo: Code[20])
- var
- VendLedgEntry: Record "Vendor Ledger Entry";
- begin
- if HideDialog then
- exit;
-
- if IncludeHeader and
- (ToPurchHeader."Document Type" in
- [ToPurchHeader."Document Type"::"Return Order", ToPurchHeader."Document Type"::"Credit Memo"])
- then begin
- VendLedgEntry.SetCurrentKey("Document No.");
- VendLedgEntry.SetRange("Document Type", VendLedgEntry."Document Type"::Invoice);
- VendLedgEntry.SetRange("Document No.", FromDocNo);
- if VendLedgEntry.FindFirst() then
- if (VendLedgEntry."Pmt. Disc. Rcd.(LCY)" <> 0) and
- (VendLedgEntry."Journal Batch Name" = '')
- then
- Message(Text009, FromDocType, FromDocNo);
- end;
-
- if IncludeHeader and
- (ToPurchHeader."Document Type" in
- [ToPurchHeader."Document Type"::Invoice, ToPurchHeader."Document Type"::Order,
- ToPurchHeader."Document Type"::Quote, ToPurchHeader."Document Type"::"Blanket Order"]) and
- (FromDocType = "Purchase Document Type From"::"Posted Return Shipment")
- then begin
- VendLedgEntry.SetCurrentKey("Document No.");
- VendLedgEntry.SetRange("Document Type", VendLedgEntry."Document Type"::"Credit Memo");
- VendLedgEntry.SetRange("Document No.", FromDocNo);
- if VendLedgEntry.FindFirst() then
- if (VendLedgEntry."Pmt. Disc. Rcd.(LCY)" <> 0) and
- (VendLedgEntry."Journal Batch Name" = '')
- then
- Message(Text006, FromDocType, FromDocNo);
- end;
- end;
-
- local procedure CheckCopyFromSalesHeaderAvail(FromSalesHeader: Record "Sales Header"; ToSalesHeader: Record "Sales Header")
- var
- FromSalesLine: Record "Sales Line";
- ToSalesLine: Record "Sales Line";
- begin
- if ToSalesHeader."Document Type" in [ToSalesHeader."Document Type"::Order, ToSalesHeader."Document Type"::Invoice] then begin
- FromSalesLine.SetRange("Document Type", FromSalesHeader."Document Type");
- FromSalesLine.SetRange("Document No.", FromSalesHeader."No.");
- FromSalesLine.SetRange(Type, FromSalesLine.Type::Item);
- FromSalesLine.SetFilter("No.", '<>%1', '');
- FromSalesLine.SetFilter(Quantity, '>0');
- OnCheckCopyFromSalesHeaderAvailOnAfterSetFilters(FromSalesLine, FromSalesHeader, ToSalesHeader);
- if FromSalesLine.FindSet() then
- repeat
- if not IsItemOrVariantBlocked(FromSalesLine."No.", FromSalesLine."Variant Code") then begin
- ToSalesLine.CopyFromSalesLine(FromSalesLine);
- if ToSalesHeader."Document Type" = ToSalesHeader."Document Type"::Order then
- ToSalesLine."Outstanding Quantity" := FromSalesLine.Quantity - FromSalesLine."Qty. to Assemble to Order";
- CheckItemAvailability(ToSalesHeader, ToSalesLine);
- OnCheckCopyFromSalesHeaderAvailOnAfterCheckItemAvailability(
- ToSalesHeader, ToSalesLine, FromSalesHeader, IncludeHeader, FromSalesLine);
-
- if ToSalesHeader."Document Type" = ToSalesHeader."Document Type"::Order then begin
- ToSalesLine."Outstanding Quantity" := FromSalesLine.Quantity;
- if ToSalesHeader."Document Type" = ToSalesHeader."Document Type"::Order then
- ToSalesLine."Outstanding Quantity" := FromSalesLine.Quantity - FromSalesLine."Qty. to Assemble to Order";
- ToSalesLine."Qty. to Assemble to Order" := 0;
- ToSalesLine."Drop Shipment" := FromSalesLine."Drop Shipment";
- CheckItemAvailability(ToSalesHeader, ToSalesLine);
-
- if ToSalesHeader."Document Type" = ToSalesHeader."Document Type"::Order then begin
- ToSalesLine."Outstanding Quantity" := FromSalesLine.Quantity;
- ToSalesLine."Qty. to Assemble to Order" := FromSalesLine."Qty. to Assemble to Order";
- CheckATOItemAvailable(FromSalesLine, ToSalesLine);
- end;
- end;
- end;
- until FromSalesLine.Next() = 0;
- end;
- end;
-
- local procedure CheckCopyFromSalesShptAvail(FromSalesShptHeader: Record "Sales Shipment Header"; ToSalesHeader: Record "Sales Header")
- var
- FromSalesShptLine: Record "Sales Shipment Line";
- ToSalesLine: Record "Sales Line";
- FromPostedAsmHeader: Record "Posted Assembly Header";
- begin
- if not (ToSalesHeader."Document Type" in [ToSalesHeader."Document Type"::Order, ToSalesHeader."Document Type"::Invoice]) then
- exit;
-
- FromSalesShptLine.SetRange("Document No.", FromSalesShptHeader."No.");
- FromSalesShptLine.SetRange(Type, FromSalesShptLine.Type::Item);
- FromSalesShptLine.SetFilter("No.", '<>%1', '');
- FromSalesShptLine.SetFilter(Quantity, '>0');
- OnCheckCopyFromSalesShptAvailOnAfterSetFilters(FromSalesShptLine, FromSalesShptHeader, ToSalesHeader);
- if FromSalesShptLine.FindSet() then
- repeat
- if not IsItemOrVariantBlocked(FromSalesShptLine."No.", FromSalesShptLine."Variant Code") then begin
- ToSalesLine.CopyFromSalesShptLine(FromSalesShptLine);
- if ToSalesLine."Document Type" = ToSalesLine."Document Type"::Order then
- if FromSalesShptLine.AsmToShipmentExists(FromPostedAsmHeader) then
- ToSalesLine."Outstanding Quantity" := FromSalesShptLine.Quantity - FromPostedAsmHeader.Quantity;
- CheckItemAvailability(ToSalesHeader, ToSalesLine);
- OnCheckCopyFromSalesShptAvailOnAfterCheckItemAvailability(
- ToSalesHeader, ToSalesLine, FromSalesShptHeader, IncludeHeader, FromSalesShptLine);
-
- if ToSalesLine."Document Type" = ToSalesLine."Document Type"::Order then
- if FromSalesShptLine.AsmToShipmentExists(FromPostedAsmHeader) then begin
- ToSalesLine."Qty. to Assemble to Order" := FromPostedAsmHeader.Quantity;
- CheckPostedATOItemAvailable(FromSalesShptLine, ToSalesLine);
- end;
- end;
- until FromSalesShptLine.Next() = 0;
- end;
-
- local procedure CheckCopyFromSalesInvoiceAvail(FromSalesInvHeader: Record "Sales Invoice Header"; ToSalesHeader: Record "Sales Header")
- var
- FromSalesInvLine: Record "Sales Invoice Line";
- ToSalesLine: Record "Sales Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckCopyFromSalesInvoiceAvail(FromSalesInvHeader, ToSalesHeader, FromSalesInvLine, ToSalesLine, IsHandled);
- if IsHandled then
- exit;
-
- if not (ToSalesHeader."Document Type" in [ToSalesHeader."Document Type"::Order, ToSalesHeader."Document Type"::Invoice]) then
- exit;
-
- FromSalesInvLine.SetRange("Document No.", FromSalesInvHeader."No.");
- FromSalesInvLine.SetRange(Type, FromSalesInvLine.Type::Item);
- FromSalesInvLine.SetFilter("No.", '<>%1', '');
- FromSalesInvLine.SetRange("Prepayment Line", false);
- FromSalesInvLine.SetFilter(Quantity, '>0');
- OnCheckCopyFromSalesInvoiceAvailOnAfterSetFilters(FromSalesInvLine, FromSalesInvHeader, ToSalesHeader);
- if FromSalesInvLine.FindSet() then
- repeat
- if not IsItemOrVariantBlocked(FromSalesInvLine."No.", FromSalesInvLine."Variant Code") then begin
- ToSalesLine.CopyFromSalesInvLine(FromSalesInvLine);
- CheckCopyFromSalesInvoiceAvailOnBeforeCheckItemAvailability(ToSalesLine, FromSalesInvLine, ToSalesHeader, FromSalesInvHeader);
- CheckItemAvailability(ToSalesHeader, ToSalesLine);
- OnCheckCopyFromSalesInvoiceAvailOnAfterCheckItemAvailability(
- ToSalesHeader, ToSalesLine, FromSalesInvHeader, IncludeHeader, FromSalesInvLine);
- end;
- until FromSalesInvLine.Next() = 0;
- end;
-
- local procedure CheckCopyFromSalesRetRcptAvail(FromReturnRcptHeader: Record "Return Receipt Header"; ToSalesHeader: Record "Sales Header")
- var
- FromReturnRcptLine: Record "Return Receipt Line";
- ToSalesLine: Record "Sales Line";
- begin
- if not (ToSalesHeader."Document Type" in [ToSalesHeader."Document Type"::Order, ToSalesHeader."Document Type"::Invoice]) then
- exit;
-
- FromReturnRcptLine.SetRange("Document No.", FromReturnRcptHeader."No.");
- FromReturnRcptLine.SetRange(Type, FromReturnRcptLine.Type::Item);
- FromReturnRcptLine.SetFilter("No.", '<>%1', '');
- FromReturnRcptLine.SetFilter(Quantity, '>0');
- OnCheckCopyFromSalesRetRcptAvailOnAfterSetFilters(FromReturnRcptLine, FromReturnRcptHeader, ToSalesHeader);
- if FromReturnRcptLine.FindSet() then
- repeat
- if not IsItemOrVariantBlocked(FromReturnRcptLine."No.", FromReturnRcptLine."Variant Code") then begin
- ToSalesLine.CopyFromReturnRcptLine(FromReturnRcptLine);
- CheckItemAvailability(ToSalesHeader, ToSalesLine);
- OnCheckCopyFromSalesRetRcptAvailOnAfterCheckItemAvailability(
- ToSalesHeader, ToSalesLine, FromReturnRcptHeader, IncludeHeader, FromReturnRcptLine);
- end;
- until FromReturnRcptLine.Next() = 0;
- end;
-
- local procedure CheckCopyFromSalesCrMemoAvail(FromSalesCrMemoHeader: Record "Sales Cr.Memo Header"; ToSalesHeader: Record "Sales Header")
- var
- FromSalesCrMemoLine: Record "Sales Cr.Memo Line";
- ToSalesLine: Record "Sales Line";
- begin
- if not (ToSalesHeader."Document Type" in [ToSalesHeader."Document Type"::Order, ToSalesHeader."Document Type"::Invoice]) then
- exit;
-
- FromSalesCrMemoLine.SetRange("Document No.", FromSalesCrMemoHeader."No.");
- FromSalesCrMemoLine.SetRange(Type, FromSalesCrMemoLine.Type::Item);
- FromSalesCrMemoLine.SetFilter("No.", '<>%1', '');
- FromSalesCrMemoLine.SetRange("Prepayment Line", false);
- FromSalesCrMemoLine.SetFilter(Quantity, '>0');
- OnCheckCopyFromSalesCrMemoAvailOnAfterSetFilters(FromSalesCrMemoLine, FromSalesCrMemoHeader, ToSalesHeader);
- if FromSalesCrMemoLine.FindSet() then
- repeat
- if not IsItemOrVariantBlocked(FromSalesCrMemoLine."No.", FromSalesCrMemoLine."Variant Code") then begin
- ToSalesLine.CopyFromSalesCrMemoLine(FromSalesCrMemoLine);
- OnCheckCopyFromSalesCrMemoAvailOnBeforeCheckItemAvailability(FromSalesCrMemoLine, ToSalesLine);
- CheckItemAvailability(ToSalesHeader, ToSalesLine);
- OnCheckCopyFromSalesCrMemoAvailOnAfterCheckItemAvailability(
- ToSalesHeader, ToSalesLine, FromSalesCrMemoHeader, IncludeHeader, FromSalesCrMemoLine);
- end;
- until FromSalesCrMemoLine.Next() = 0;
- end;
-
- local procedure CheckCopyFromSalesHeaderArchiveAvail(FromSalesHeaderArchive: Record "Sales Header Archive"; ToSalesHeader: Record "Sales Header")
- var
- FromSalesLineArchive: Record "Sales Line Archive";
- ToSalesLine: Record "Sales Line";
- begin
- OnBeforeCheckCopyFromSalesHeaderArchiveAvail(FromSalesHeaderArchive, ToSalesHeader, MoveNegLines);
- if not (ToSalesHeader."Document Type" in [ToSalesHeader."Document Type"::Order, ToSalesHeader."Document Type"::Invoice]) then
- exit;
-
- FromSalesLineArchive.SetRange("Document Type", FromSalesHeaderArchive."Document Type");
- FromSalesLineArchive.SetRange("Document No.", FromSalesHeaderArchive."No.");
- FromSalesLineArchive.SetRange("Doc. No. Occurrence", FromSalesHeaderArchive."Doc. No. Occurrence");
- FromSalesLineArchive.SetRange("Version No.", FromSalesHeaderArchive."Version No.");
- FromSalesLineArchive.SetRange(Type, FromSalesLineArchive.Type::Item);
- FromSalesLineArchive.SetFilter("No.", '<>%1', '');
- OnCheckCopyFromSalesHeaderArchiveAvailOnAfterSetFilters(FromSalesLineArchive, FromSalesHeaderArchive, ToSalesHeader);
- if FromSalesLineArchive.FindSet() then
- repeat
- if FromSalesLineArchive.Quantity > 0 then begin
- ToSalesLine."No." := FromSalesLineArchive."No.";
- ToSalesLine."Variant Code" := FromSalesLineArchive."Variant Code";
- ToSalesLine."Location Code" := FromSalesLineArchive."Location Code";
- ToSalesLine."Bin Code" := FromSalesLineArchive."Bin Code";
- ToSalesLine."Unit of Measure Code" := FromSalesLineArchive."Unit of Measure Code";
- ToSalesLine."Qty. per Unit of Measure" := FromSalesLineArchive."Qty. per Unit of Measure";
- ToSalesLine."Outstanding Quantity" := FromSalesLineArchive.Quantity;
- CheckItemAvailability(ToSalesHeader, ToSalesLine);
- OnCheckCopyFromSalesHeaderArchiveAvailOnAfterCheckItemAvailability(ToSalesHeader, ToSalesLine,
- FromSalesHeaderArchive, FromSalesLineArchive, IncludeHeader);
- end;
- until FromSalesLineArchive.Next() = 0;
- end;
-
- local procedure CheckItemAvailability(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line")
- var
- IsHandled: Boolean;
- begin
- OnBeforeCheckItemAvailability(ToSalesHeader, ToSalesLine, HideDialog, IsHandled, RecalculateLines);
- if IsHandled then
- exit;
-
- if HideDialog then
- exit;
-
- ToSalesLine."Document Type" := ToSalesHeader."Document Type";
- ToSalesLine."Document No." := ToSalesHeader."No.";
- ToSalesLine.Type := ToSalesLine.Type::Item;
- ToSalesLine."Purchase Order No." := '';
- ToSalesLine."Purch. Order Line No." := 0;
- ToSalesLine."Drop Shipment" :=
- not RecalculateLines and ToSalesLine."Drop Shipment" and
- (ToSalesHeader."Document Type" = ToSalesHeader."Document Type"::Order);
-
- SetShipmentDateInLine(ToSalesHeader, ToSalesLine);
-
- IsHandled := false;
- OnCheckItemAvailabilityOnBeforeRunSalesLineCheck(ToSalesHeader, ToSalesLine, IsHandled);
- if not IsHandled then
- if ItemCheckAvail.SalesLineCheck(ToSalesLine) then
- ItemCheckAvail.RaiseUpdateInterruptedError();
- end;
-
- local procedure InitShipmentDateInLine(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line")
- begin
- if SalesHeader."Shipment Date" <> 0D then
- SalesLine."Shipment Date" := SalesHeader."Shipment Date"
- else
- SalesLine."Shipment Date" := WorkDate();
- OnAfterInitShipmentDateInLine(SalesHeader, SalesLine);
- end;
-
- local procedure SetShipmentDateInLine(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line")
- begin
- OnBeforeSetShipmentDateInLine(SalesHeader, SalesLine);
- if SalesLine."Shipment Date" = 0D then begin
- InitShipmentDateInLine(SalesHeader, SalesLine);
- SalesLine.Validate("Shipment Date");
- end;
- end;
-
- local procedure CheckATOItemAvailable(var FromSalesLine: Record "Sales Line"; ToSalesLine: Record "Sales Line")
- var
- ATOLink: Record "Assemble-to-Order Link";
- AssemblyHeader: Record "Assembly Header";
- TempAssemblyHeader: Record "Assembly Header" temporary;
- TempAssemblyLine: Record "Assembly Line" temporary;
- begin
- if HideDialog then
- exit;
-
- if ATOLink.ATOCopyCheckAvailShowWarning(
- AssemblyHeader, ToSalesLine, TempAssemblyHeader, TempAssemblyLine,
- not FromSalesLine.AsmToOrderExists(AssemblyHeader))
- then
- if ItemCheckAvail.ShowAsmWarningYesNo(TempAssemblyHeader, TempAssemblyLine) then
- ItemCheckAvail.RaiseUpdateInterruptedError();
- end;
-
- local procedure CheckPostedATOItemAvailable(var FromSalesShptLine: Record "Sales Shipment Line"; ToSalesLine: Record "Sales Line")
- var
- ATOLink: Record "Assemble-to-Order Link";
- PostedAssemblyHeader: Record "Posted Assembly Header";
- TempAssemblyHeader: Record "Assembly Header" temporary;
- TempAssemblyLine: Record "Assembly Line" temporary;
- begin
- if HideDialog then
- exit;
-
- if ATOLink.PstdATOCopyCheckAvailShowWarn(
- PostedAssemblyHeader, ToSalesLine, TempAssemblyHeader, TempAssemblyLine,
- not FromSalesShptLine.AsmToShipmentExists(PostedAssemblyHeader))
- then
- if ItemCheckAvail.ShowAsmWarningYesNo(TempAssemblyHeader, TempAssemblyLine) then
- ItemCheckAvail.RaiseUpdateInterruptedError();
- end;
-
-
-
- procedure CopySalesShptLinesToDoc(ToSalesHeader: Record "Sales Header"; var FromSalesShptLine: Record "Sales Shipment Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- ItemLedgEntry: Record "Item Ledger Entry";
- TempTrkgItemLedgEntry: Record "Item Ledger Entry" temporary;
- FromSalesHeader: Record "Sales Header";
- FromSalesLine: Record "Sales Line";
- ToSalesLine: Record "Sales Line";
- TempFromSalesLineBuf: Record "Sales Line" temporary;
- FromSalesShptHeader: Record "Sales Shipment Header";
- TempItemTrkgEntry: Record "Reservation Entry" temporary;
- TempDocSalesLine: Record "Sales Line" temporary;
- PostedAssemblyHeader: Record "Posted Assembly Header";
- ItemTrackingMgt: Codeunit "Item Tracking Management";
- OldDocNo: Code[20];
- NextLineNo: Integer;
- NextItemTrkgEntryNo: Integer;
- FromLineCounter: Integer;
- ToLineCounter: Integer;
- CopyItemTrkg: Boolean;
- SplitLine: Boolean;
- FillExactCostRevLink: Boolean;
- CopyLine: Boolean;
- InsertDocNoLine: Boolean;
- IsHandled: Boolean;
- begin
- MissingExCostRevLink := false;
- InitCurrency(ToSalesHeader."Currency Code");
- OpenWindow();
-
- OnBeforeCopySalesShptLinesToDoc(TempDocSalesLine, ToSalesHeader, FromSalesShptLine);
-
- if FromSalesShptLine.FindSet() then
- repeat
- FromLineCounter := FromLineCounter + 1;
- if IsTimeForUpdate() then
- UpdateWindow(1, FromLineCounter);
- if FromSalesShptHeader."No." <> FromSalesShptLine."Document No." then begin
- FromSalesShptHeader.Get(FromSalesShptLine."Document No.");
- TransferOldExtLines.ClearLineNumbers();
- end;
-
- IsHandled := false;
- OnCopySalesShptLinesToDocOnBeforeTestPricesInclVAT(ToSalesHeader, IncludeHeader, RecalculateLines, IsHandled);
- if not IsHandled then
- FromSalesShptHeader.TestField("Prices Including VAT", ToSalesHeader."Prices Including VAT");
-
- OnCopySalesShptLinesToDocOnBeforeFromSalesHeaderTransferFields(FromSalesShptHeader, FromSalesHeader, ToSalesHeader, FromSalesShptLine);
- FromSalesHeader.TransferFields(FromSalesShptHeader);
- OnCopySalesShptLinesToDocOnAfterFromSalesHeaderTransferFields(FromSalesShptHeader, FromSalesHeader);
- FillExactCostRevLink :=
- IsSalesFillExactCostRevLink(ToSalesHeader, 0, FromSalesHeader."Currency Code");
- FromSalesLine.TransferFields(FromSalesShptLine);
- FromSalesLine."Appl.-from Item Entry" := 0;
- FromSalesLine."Copied From Posted Doc." := true;
-
- CheckUpdateOldDocumentNoFromSalesShptLine(FromSalesShptLine, OldDocNo, InsertDocNoLine);
-
- OnBeforeCopySalesShptLinesToBuffer(FromSalesLine, FromSalesShptLine, ToSalesHeader);
-
- SplitLine := true;
- FromSalesShptLine.FilterPstdDocLnItemLedgEntries(ItemLedgEntry);
- OnCopySalesShptLinesToDocOnBeforeSplitPstdSalesLinesPerILE(ItemLedgEntry, FromSalesShptLine);
- if not SplitPstdSalesLinesPerILE(
- ToSalesHeader, FromSalesHeader, ItemLedgEntry, TempFromSalesLineBuf,
- FromSalesLine, TempDocSalesLine, NextLineNo, CopyItemTrkg, MissingExCostRevLink, FillExactCostRevLink, true)
- then
- if CopyItemTrkg then
- SplitLine :=
- SplitSalesDocLinesPerItemTrkg(
- ItemLedgEntry, TempItemTrkgEntry, TempFromSalesLineBuf,
- FromSalesLine, TempDocSalesLine, NextLineNo, NextItemTrkgEntryNo, MissingExCostRevLink, true)
- else
- SplitLine := false;
-
- if not SplitLine then begin
- TempFromSalesLineBuf := FromSalesLine;
- CopyLine := true;
- end else
- CopyLine := TempFromSalesLineBuf.FindSet() and FillExactCostRevLink;
-
- OnCopySalesShptLinesToDocOnAfterSplitPstdSalesLinesPerILE(TempFromSalesLineBuf, FromSalesShptLine);
-
- UpdateWindow(1, FromLineCounter);
- if CopyLine then begin
- NextLineNo := GetLastToSalesLineNo(ToSalesHeader);
- OnCopySalesShptLinesToDocOnAfterCalcNextLineNo(ToSalesHeader, FromSalesShptLine, FromSalesHeader, NextLineNo, InsertDocNoLine, FromLineCounter, TempFromSalesLineBuf);
- AsmHdrExistsForFromDocLine := FromSalesShptLine.AsmToShipmentExists(PostedAssemblyHeader);
- InitAsmCopyHandling(true);
- if AsmHdrExistsForFromDocLine then begin
- QtyToAsmToOrder := FromSalesShptLine.Quantity;
- QtyToAsmToOrderBase := FromSalesShptLine."Quantity (Base)";
- GenerateAsmDataFromPosted(PostedAssemblyHeader, ToSalesHeader."Document Type");
- end;
- if InsertDocNoLine then begin
- InsertOldSalesDocNoLine(ToSalesHeader, FromSalesShptLine."Document No.", 1, NextLineNo);
- InsertDocNoLine := false;
- end;
- repeat
- ToLineCounter := ToLineCounter + 1;
- if IsTimeForUpdate() then
- UpdateWindow(2, ToLineCounter);
-
- OnCopySalesShptLinesToDocOnBeforeCopySalesLine(ToSalesHeader, TempFromSalesLineBuf, FromSalesShptLine, CopyItemTrkg);
-
- if CopySalesDocLine(
- ToSalesHeader, ToSalesLine, FromSalesHeader, TempFromSalesLineBuf, NextLineNo, LinesNotCopied, false,
- "Sales Document Type From"::"Posted Shipment", CopyPostedDeferral, TempFromSalesLineBuf."Line No.")
- then begin
- if CopyItemTrkg then begin
- if SplitLine then
- ItemTrackingDocMgt.CollectItemTrkgPerPostedDocLine(
- TempItemTrkgEntry, TempTrkgItemLedgEntry, false, TempFromSalesLineBuf."Document No.", TempFromSalesLineBuf."Line No.")
- else
- ItemTrackingDocMgt.CopyItemLedgerEntriesToTemp(TempTrkgItemLedgEntry, ItemLedgEntry);
-
- ItemTrackingMgt.CopyItemLedgEntryTrkgToSalesLn(
- TempTrkgItemLedgEntry, ToSalesLine,
- FillExactCostRevLink and ExactCostRevMandatory, MissingExCostRevLink,
- FromSalesHeader."Prices Including VAT", ToSalesHeader."Prices Including VAT", true);
- end;
- OnAfterCopySalesLineFromSalesShptLineBuffer(
- ToSalesLine, FromSalesShptLine, IncludeHeader, RecalculateLines, TempDocSalesLine, ToSalesHeader, TempFromSalesLineBuf, ExactCostRevMandatory, FromSalesHeader, LinesNotCopied);
- end;
- OnCopySalesShptLinesToDocOnAfterCopySalesLine(ToSalesHeader, ToSalesLine, FromSalesShptLine);
- until TempFromSalesLineBuf.Next() = 0;
- end;
- OnCopySalesShptLinesToDocOnAfterCopySalesShptLineToSalesLine(FromSalesShptLine, ToSalesLine);
- until FromSalesShptLine.Next() = 0;
-
- CloseWindow();
-
- OnAfterCopySalesShptLinesToDoc(ToSalesHeader, FromSalesShptLine, LinesNotCopied, MissingExCostRevLink);
- end;
-
- local procedure CheckUpdateOldDocumentNoFromSalesShptLine(FromSalesShptLine: Record "Sales Shipment Line"; var OldDocNo: Code[20]; var InsertDocNoLine: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckUpdateOldDocumentNoFromSalesShptLine(FromSalesShptLine, OldDocNo, InsertDocNoLine, IsHandled);
- if IsHandled then
- exit;
-
- if FromSalesShptLine."Document No." <> OldDocNo then begin
- OldDocNo := FromSalesShptLine."Document No.";
- InsertDocNoLine := true;
- end;
- end;
-
- procedure CopySalesInvLinesToDoc(ToSalesHeader: Record "Sales Header"; var FromSalesInvLine: Record "Sales Invoice Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- TempItemLedgEntryBuf: Record "Item Ledger Entry" temporary;
- FromSalesHeader: Record "Sales Header";
- FromSalesLine: Record "Sales Line";
- FromSalesLine2: Record "Sales Line";
- ToSalesLine: Record "Sales Line";
- TempSalesLineBuf: Record "Sales Line" temporary;
- FromSalesInvHeader: Record "Sales Invoice Header";
- TempItemTrkgEntry: Record "Reservation Entry" temporary;
- TempDocSalesLine: Record "Sales Line" temporary;
- OldInvDocNo: Code[20];
- OldShptDocNo: Code[20];
- OldBufDocNo: Code[20];
- NextLineNo: Integer;
- SalesCombDocLineNo: Integer;
- NextItemTrkgEntryNo: Integer;
- FromLineCounter: Integer;
- ToLineCounter: Integer;
- CopyItemTrkg: Boolean;
- SplitLine: Boolean;
- FillExactCostRevLink: Boolean;
- SalesInvLineCount: Integer;
- SalesLineCount: Integer;
- BufferCount: Integer;
- FirstLineShipped: Boolean;
- IsHandled: Boolean;
- FirstLineText: Boolean;
- ItemChargeAssgntNextLineNo: Integer;
- ShouldInsertOldSalesDocNoLine: Boolean;
- ShouldGetNextLineNo, ShouldIncrementNextLineNo : Boolean;
- begin
- IsHandled := false;
- OnBeforeCopySalesInvLinesToDoc(ToSalesHeader, FromSalesInvLine, CopyJobData, RecalculateLines, IsHandled);
- if IsHandled then
- exit;
-
- MissingExCostRevLink := false;
- InitCurrency(ToSalesHeader."Currency Code");
- TempSalesLineBuf.Reset();
- TempSalesLineBuf.DeleteAll();
- TempItemTrkgEntry.Reset();
- TempItemTrkgEntry.DeleteAll();
- OpenWindow();
- InitAsmCopyHandling(true);
- TempSalesInvLine.DeleteAll();
-
- OnBeforeCopySalesInvLines(TempDocSalesLine, ToSalesHeader, FromSalesInvLine, CopyJobData);
-
- // Fill sales line buffer
- SalesInvLineCount := 0;
- FirstLineText := false;
- if FromSalesInvLine.FindSet() then
- repeat
- FromLineCounter := FromLineCounter + 1;
- if IsTimeForUpdate() then
- UpdateWindow(1, FromLineCounter);
- SetTempSalesInvLine(FromSalesInvLine, TempSalesInvLine, SalesInvLineCount, NextLineNo, FirstLineText);
- if FromSalesInvHeader."No." <> FromSalesInvLine."Document No." then begin
- FromSalesInvHeader.Get(FromSalesInvLine."Document No.");
- TransferOldExtLines.ClearLineNumbers();
- OnCopySalesInvLinesToDocOnAfterGetFromSalesInvHeader(ToSalesHeader, FromSalesInvHeader);
- end;
-
- IsHandled := false;
- OnCopySalesInvLinesToDocOnBeforeTestPricesInclVAT(ToSalesHeader, IncludeHeader, RecalculateLines, IsHandled);
- if not IsHandled then
- FromSalesInvHeader.TestField("Prices Including VAT", ToSalesHeader."Prices Including VAT");
-
- OnCopySalesInvLinesToDocOnBeforeFromSalesHeaderTransferFields(FromSalesHeader, FromSalesInvHeader, ToSalesHeader, FromSalesInvLine);
- FromSalesHeader.TransferFields(FromSalesInvHeader);
- OnCopySalesInvLinesToDocOnAfterFromSalesHeaderTransferFields(FromSalesHeader, FromSalesInvHeader);
- FillExactCostRevLink := IsSalesFillExactCostRevLink(ToSalesHeader, 1, FromSalesHeader."Currency Code");
- FromSalesLine.TransferFields(FromSalesInvLine);
- FromSalesLine."Appl.-from Item Entry" := 0;
- // Reuse fields to buffer invoice line information
- FromSalesLine."Shipment No." := FromSalesInvLine."Document No.";
- FromSalesLine."Shipment Line No." := 0;
- FromSalesLine."Return Receipt No." := '';
- FromSalesLine."Return Receipt Line No." := FromSalesInvLine."Line No.";
- FromSalesLine."Copied From Posted Doc." := true;
-
- OnBeforeCopySalesInvLinesToBuffer(FromSalesLine, FromSalesInvLine, ToSalesHeader);
-
- SplitLine := true;
- FromSalesInvLine.GetItemLedgEntries(TempItemLedgEntryBuf, true);
- if not SplitPstdSalesLinesPerILE(
- ToSalesHeader, FromSalesHeader, TempItemLedgEntryBuf, TempSalesLineBuf,
- FromSalesLine, TempDocSalesLine, NextLineNo, CopyItemTrkg, MissingExCostRevLink, FillExactCostRevLink, false)
- then
- if CopyItemTrkg then
- SplitLine := SplitSalesDocLinesPerItemTrkg(
- TempItemLedgEntryBuf, TempItemTrkgEntry, TempSalesLineBuf,
- FromSalesLine, TempDocSalesLine, NextLineNo, NextItemTrkgEntryNo, MissingExCostRevLink, false)
- else
- SplitLine := false;
-
- if not SplitLine then
- CopySalesLinesToBuffer(
- FromSalesHeader, FromSalesLine, FromSalesLine2, TempSalesLineBuf,
- ToSalesHeader, TempDocSalesLine, FromSalesInvLine."Document No.", NextLineNo);
-
- if TempSalesLineBuf."Shipment Line No." <> 0 then
- SkipOldInvoiceDescription(true);
-
- OnAfterCopySalesInvLine(TempDocSalesLine, ToSalesHeader, TempSalesLineBuf, FromSalesInvLine);
- until FromSalesInvLine.Next() = 0;
-
- OnCopySalesInvLinesToDocOnAfterFillSalesLinesBuffer(ToSalesHeader);
-
- // Create sales line from buffer
- UpdateWindow(1, FromLineCounter);
- BufferCount := 0;
- FirstLineShipped := true;
-
- OnCopySalesInvLinesToDocOnBeforeTempSalesLineBufLoop(ToSalesHeader, TempSalesLineBuf);
-
- // Sorting according to Sales Line Document No.,Line No.
- TempSalesLineBuf.SetCurrentKey("Line No.");
- SalesLineCount := 0;
- if TempSalesLineBuf.FindSet() then
- repeat
- if TempSalesLineBuf.Type = TempSalesLineBuf.Type::Item then
- SalesLineCount += 1;
- until TempSalesLineBuf.Next() = 0;
- if TempSalesLineBuf.FindSet() then begin
- ShouldGetNextLineNo := true;
- OnCopySalesInvLinesToDocOnBeforeGetNextLineNo(ToSalesHeader, TempSalesLineBuf, ShouldGetNextLineNo, NextLineNo);
- if ShouldGetNextLineNo then
- NextLineNo := GetLastToSalesLineNo(ToSalesHeader);
- Clear(OldInvDocNo);
- Clear(OldBufDocNo);
- repeat
- ToLineCounter := ToLineCounter + 1;
- if IsTimeForUpdate() then
- UpdateWindow(2, ToLineCounter);
- ShouldInsertOldSalesDocNoLine := TempSalesLineBuf."Shipment No." <> OldInvDocNo;
- OnCopySalesInvLinesToDocOnAfterCalcShouldInsertOldSalesDocNoLine(TempSalesLineBuf, ToSalesHeader, ShouldInsertOldSalesDocNoLine);
- if ShouldInsertOldSalesDocNoLine then begin
- OldInvDocNo := TempSalesLineBuf."Shipment No.";
- OldShptDocNo := '';
- FirstLineShipped := true;
- OnCopySalesInvLinesToDocOnBeforeInsertOldSalesDocNoLine(ToSalesHeader, SkipCopyFromDescription);
- InsertOldSalesDocNoLine(ToSalesHeader, OldInvDocNo, 2, NextLineNo);
- OnCopySalesInvLinesToDocOnAfterInsertOldSalesDocNoLine(ToSalesHeader, SkipCopyFromDescription);
- end;
- CheckFirstLineShipped(ToSalesHeader, TempSalesLineBuf, SalesCombDocLineNo, NextLineNo, FirstLineShipped);
- OnCopySalesInvLinesToDocOnAfterCheckFirstLineShipped(ToSalesHeader, 2, TempSalesLineBuf."Document No.", OldShptDocNo);
- if (TempSalesLineBuf."Document No." <> OldShptDocNo) and (TempSalesLineBuf."Shipment Line No." > 0) then begin
- if FirstLineShipped then
- SalesCombDocLineNo := NextLineNo;
- OldShptDocNo := TempSalesLineBuf."Document No.";
- InsertOldSalesCombDocNoLine(ToSalesHeader, OldInvDocNo, OldShptDocNo, SalesCombDocLineNo, true);
- ShouldIncrementNextLineNo := true;
- OnCopySalesInvLinesToDocOnBeforeIncrementNextLineNo(ToSalesHeader, TempSalesLineBuf, ShouldIncrementNextLineNo, NextLineNo);
- if ShouldIncrementNextLineNo then
- NextLineNo := NextLineNo + 10000;
- FirstLineShipped := true;
- end;
-
- InitFromSalesLine(FromSalesLine2, TempSalesLineBuf);
- if GetSalesDocNo(TempDocSalesLine, TempSalesLineBuf."Line No.") <> OldBufDocNo then begin
- OldBufDocNo := GetSalesDocNo(TempDocSalesLine, TempSalesLineBuf."Line No.");
- TransferOldExtLines.ClearLineNumbers();
- end;
-
- OnCopySalesInvLinesToDocOnBeforeCopySalesLine(ToSalesHeader, FromSalesLine2, TempSalesLineBuf,
- ToSalesLine, FromSalesInvLine, IncludeHeader, RecalculateLines,
- TempDocSalesLine, FromSalesLine, ExactCostRevMandatory);
-
- AsmHdrExistsForFromDocLine := false;
- if (TempSalesLineBuf.Type = TempSalesLineBuf.Type::Item) and (ToSalesHeader."Document Type" in [ToSalesHeader."Document Type"::Quote, ToSalesHeader."Document Type"::Order, ToSalesHeader."Document Type"::"Blanket Order"]) then
- CheckAsmHdrExistsForFromDocLine(ToSalesHeader, FromSalesLine2, BufferCount, SalesLineCount = SalesInvLineCount);
-
- if CopySalesDocLine(
- ToSalesHeader, ToSalesLine, FromSalesHeader, FromSalesLine2, NextLineNo, LinesNotCopied, TempSalesLineBuf."Return Receipt No." = '',
- "Sales Document Type From"::"Posted Invoice", CopyPostedDeferral, GetSalesLineNo(TempDocSalesLine, FromSalesLine2."Line No."))
- then begin
- if CopyPostedDeferral then
- CopySalesPostedDeferrals(ToSalesLine, "Deferral Document Type"::Sales,
- DeferralTypeForSalesDoc("Sales Document Type From"::"Posted Invoice".AsInteger()), TempSalesLineBuf."Shipment No.", TempSalesLineBuf."Return Receipt Line No.",
- ToSalesLine."Document Type".AsInteger(), ToSalesLine."Document No.", ToSalesLine."Line No.");
- FromSalesInvLine.Get(TempSalesLineBuf."Shipment No.", TempSalesLineBuf."Return Receipt Line No.");
- OnCopySalesInvLinesToDocOnAfterCopySalesPostedDeferrals(FromSalesInvLine, NextLineNo, ToSalesLine, TempSalesLineBuf);
- // copy item charges
- if TempSalesLineBuf.Type = TempSalesLineBuf.Type::"Charge (Item)" then begin
- FromSalesLine.TransferFields(FromSalesInvLine);
- FromSalesLine."Document Type" := FromSalesLine."Document Type"::Invoice;
- CopyFromSalesLineItemChargeAssign(FromSalesLine, ToSalesLine, FromSalesHeader, ItemChargeAssgntNextLineNo);
- end;
-
- IsHandled := false;
- OnCopySalesInvLinesToDocOnBeforeCopyItemTracking(TempSalesLineBuf, ToSalesHeader, FromSalesInvLine, TempItemLedgEntryBuf, TempItemTrkgEntry, IsHandled);
- // copy item tracking
- if not IsHandled then
- if (TempSalesLineBuf.Type = TempSalesLineBuf.Type::Item) and (TempSalesLineBuf.Quantity <> 0) and SalesDocCanReceiveTracking(ToSalesHeader) then begin
- FromSalesInvLine."Document No." := OldInvDocNo;
- FromSalesInvLine."Line No." := TempSalesLineBuf."Return Receipt Line No.";
- FromSalesInvLine.GetItemLedgEntries(TempItemLedgEntryBuf, true);
- if IsCopyItemTrkg(TempItemLedgEntryBuf, CopyItemTrkg, FillExactCostRevLink) then begin
- CopyItemLedgEntryTrackingToSalesLine(
- TempItemLedgEntryBuf, TempItemTrkgEntry, TempSalesLineBuf, ToSalesLine, ToSalesHeader."Prices Including VAT",
- FromSalesHeader."Prices Including VAT", FillExactCostRevLink, MissingExCostRevLink);
- OnCopySalesInvLinesToDocOnAfterCopyItemLedgEntryTrackingToSalesLine(ToSalesLine);
- end;
- end;
-
- OnAfterCopySalesLineFromSalesLineBuffer(
- ToSalesLine, FromSalesInvLine, IncludeHeader, RecalculateLines, TempDocSalesLine, ToSalesHeader, TempSalesLineBuf,
- FromSalesLine2, FromSalesLine, ExactCostRevMandatory, FromSalesInvHeader, LinesNotCopied);
- end;
- OnCopySalesInvLinesToDocOnAfterCopySalesDocLine(ToSalesLine, FromSalesInvLine);
- OnCopySalesInvLinesToDocOnEndOfCopyLineIteration(ToSalesHeader, ToSalesLine, FromSalesInvLine, TempSalesLineBuf, LinesNotCopied, NextLineNo);
- until TempSalesLineBuf.Next() = 0;
- end;
- CloseWindow();
-
- OnAfterCopySalesInvLinesToDoc(ToSalesHeader, FromSalesInvLine, LinesNotCopied, MissingExCostRevLink);
- end;
-
- procedure CopySalesCrMemoLinesToDoc(ToSalesHeader: Record "Sales Header"; var FromSalesCrMemoLine: Record "Sales Cr.Memo Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- TempItemLedgEntryBuf: Record "Item Ledger Entry" temporary;
- TempTrkgItemLedgEntry: Record "Item Ledger Entry" temporary;
- FromSalesHeader: Record "Sales Header";
- FromSalesLine: Record "Sales Line";
- FromSalesLine2: Record "Sales Line";
- ToSalesLine: Record "Sales Line";
- TempFromSalesLineBuf: Record "Sales Line" temporary;
- FromSalesCrMemoHeader: Record "Sales Cr.Memo Header";
- TempItemTrkgEntry: Record "Reservation Entry" temporary;
- TempDocSalesLine: Record "Sales Line" temporary;
- ItemTrackingMgt: Codeunit "Item Tracking Management";
- OldCrMemoDocNo: Code[20];
- OldReturnRcptDocNo: Code[20];
- OldBufDocNo: Code[20];
- NextLineNo: Integer;
- NextItemTrkgEntryNo: Integer;
- FromLineCounter: Integer;
- ToLineCounter: Integer;
- ItemChargeAssgntNextLineNo: Integer;
- CopyItemTrkg: Boolean;
- SplitLine: Boolean;
- FillExactCostRevLink: Boolean;
- ShouldCopyItemTracking: Boolean;
- ShouldGetNextLineNo: Boolean;
- begin
- MissingExCostRevLink := false;
- InitCurrency(ToSalesHeader."Currency Code");
- TempFromSalesLineBuf.Reset();
- TempFromSalesLineBuf.DeleteAll();
- TempItemTrkgEntry.Reset();
- TempItemTrkgEntry.DeleteAll();
- OpenWindow();
-
- OnBeforeCopySalesCrMemoLinesToDoc(TempDocSalesLine, ToSalesHeader, FromSalesCrMemoLine, CopyJobData);
-
- // Fill sales line buffer
- if FromSalesCrMemoLine.FindSet() then
- repeat
- FromLineCounter := FromLineCounter + 1;
- if IsTimeForUpdate() then
- UpdateWindow(1, FromLineCounter);
- if FromSalesCrMemoHeader."No." <> FromSalesCrMemoLine."Document No." then begin
- FromSalesCrMemoHeader.Get(FromSalesCrMemoLine."Document No.");
- TransferOldExtLines.ClearLineNumbers();
- end;
- OnCopySalesCrMemoLinesToDocOnBeforeFromSalesHeaderTransferFields(FromSalesCrMemoHeader, FromSalesHeader, ToSalesHeader, FromSalesCrMemoLine);
- FromSalesHeader.TransferFields(FromSalesCrMemoHeader);
- OnCopySalesCrMemoLinesToDocOnAfterFromSalesHeaderTransferFields(FromSalesCrMemoHeader, FromSalesHeader);
- FillExactCostRevLink :=
- IsSalesFillExactCostRevLink(ToSalesHeader, 3, FromSalesHeader."Currency Code");
- FromSalesLine.TransferFields(FromSalesCrMemoLine);
- FromSalesLine."Appl.-from Item Entry" := 0;
- // Reuse fields to buffer credit memo line information
- FromSalesLine."Shipment No." := FromSalesCrMemoLine."Document No.";
- FromSalesLine."Shipment Line No." := 0;
- FromSalesLine."Return Receipt No." := '';
- FromSalesLine."Return Receipt Line No." := FromSalesCrMemoLine."Line No.";
- FromSalesLine."Copied From Posted Doc." := true;
-
- OnBeforeCopySalesCrMemoLinesToBuffer(FromSalesLine, FromSalesCrMemoLine, ToSalesHeader);
-
- SplitLine := true;
- FromSalesCrMemoLine.GetItemLedgEntries(TempItemLedgEntryBuf, true);
- if not SplitPstdSalesLinesPerILE(
- ToSalesHeader, FromSalesHeader, TempItemLedgEntryBuf, TempFromSalesLineBuf,
- FromSalesLine, TempDocSalesLine, NextLineNo, CopyItemTrkg, MissingExCostRevLink, FillExactCostRevLink, false)
- then
- if CopyItemTrkg then
- SplitLine :=
- SplitSalesDocLinesPerItemTrkg(
- TempItemLedgEntryBuf, TempItemTrkgEntry, TempFromSalesLineBuf,
- FromSalesLine, TempDocSalesLine, NextLineNo, NextItemTrkgEntryNo, MissingExCostRevLink, false)
- else
- SplitLine := false;
-
- if not SplitLine then
- CopySalesLinesToBuffer(
- FromSalesHeader, FromSalesLine, FromSalesLine2, TempFromSalesLineBuf,
- ToSalesHeader, TempDocSalesLine, FromSalesCrMemoLine."Document No.", NextLineNo);
- OnAfterCopySalesCrMemoLine(TempDocSalesLine, ToSalesHeader, TempFromSalesLineBuf, FromSalesCrMemoLine, FromSalesLine, SplitLine);
- until FromSalesCrMemoLine.Next() = 0;
-
- OnCopySalesCrMemoLinesToDocOnAfterFillSalesLineBuffer(ToSalesHeader, TempFromSalesLineBuf);
-
- // Create sales line from buffer
- UpdateWindow(1, FromLineCounter);
- // Sorting according to Sales Line Document No.,Line No.
- TempFromSalesLineBuf.SetCurrentKey("Document Type", "Document No.", "Line No.");
- if TempFromSalesLineBuf.FindSet() then begin
- ShouldGetNextLineNo := true;
- OnCopySalesCrMemoLinesToDocOnBeforeGetNextLineNo(ToSalesHeader, TempFromSalesLineBuf, ShouldGetNextLineNo, NextLineNo);
- if ShouldGetNextLineNo then
- NextLineNo := GetLastToSalesLineNo(ToSalesHeader);
- Clear(OldCrMemoDocNo);
- Clear(OldBufDocNo);
- repeat
- ToLineCounter := ToLineCounter + 1;
- if IsTimeForUpdate() then
- UpdateWindow(2, ToLineCounter);
- if TempFromSalesLineBuf."Shipment No." <> OldCrMemoDocNo then begin
- OldCrMemoDocNo := TempFromSalesLineBuf."Shipment No.";
- OldReturnRcptDocNo := '';
- InsertOldSalesDocNoLine(ToSalesHeader, OldCrMemoDocNo, 4, NextLineNo);
- end;
- if (TempFromSalesLineBuf."Document No." <> OldReturnRcptDocNo) and (TempFromSalesLineBuf."Shipment Line No." > 0) then begin
- OldReturnRcptDocNo := TempFromSalesLineBuf."Document No.";
- InsertOldSalesCombDocNoLine(ToSalesHeader, OldCrMemoDocNo, OldReturnRcptDocNo, NextLineNo, false);
- end;
- // Empty buffer fields
- FromSalesLine2 := TempFromSalesLineBuf;
- FromSalesLine2."Shipment No." := '';
- FromSalesLine2."Shipment Line No." := 0;
- FromSalesLine2."Return Receipt No." := '';
- FromSalesLine2."Return Receipt Line No." := 0;
- if GetSalesDocNo(TempDocSalesLine, TempFromSalesLineBuf."Line No.") <> OldBufDocNo then begin
- OldBufDocNo := GetSalesDocNo(TempDocSalesLine, TempFromSalesLineBuf."Line No.");
- TransferOldExtLines.ClearLineNumbers();
- end;
-
- OnCopySalesCrMemoLinesToDocOnBeforeCopySalesLine(ToSalesHeader, FromSalesLine2, TempFromSalesLineBuf);
-
- if CopySalesDocLine(
- ToSalesHeader, ToSalesLine, FromSalesHeader,
- FromSalesLine2, NextLineNo, LinesNotCopied, TempFromSalesLineBuf."Return Receipt No." = '',
- "Sales Document Type From"::"Posted Credit Memo", CopyPostedDeferral, GetSalesLineNo(TempDocSalesLine, FromSalesLine2."Line No."))
- then begin
- if CopyPostedDeferral then
- CopySalesPostedDeferrals(ToSalesLine, "Deferral Document Type"::Sales,
- DeferralTypeForSalesDoc("Sales Document Type From"::"Posted Credit Memo".AsInteger()), TempFromSalesLineBuf."Shipment No.",
- TempFromSalesLineBuf."Return Receipt Line No.", ToSalesLine."Document Type".AsInteger(), ToSalesLine."Document No.", ToSalesLine."Line No.");
- FromSalesCrMemoLine.Get(TempFromSalesLineBuf."Shipment No.", TempFromSalesLineBuf."Return Receipt Line No.");
- // copy item charges
- if TempFromSalesLineBuf.Type = TempFromSalesLineBuf.Type::"Charge (Item)" then begin
- FromSalesLine.TransferFields(FromSalesCrMemoLine);
- FromSalesLine."Document Type" := FromSalesLine."Document Type"::"Credit Memo";
- CopyFromSalesLineItemChargeAssign(FromSalesLine, ToSalesLine, FromSalesHeader, ItemChargeAssgntNextLineNo);
- end;
- // copy item tracking
- ShouldCopyItemTracking := (TempFromSalesLineBuf.Type = TempFromSalesLineBuf.Type::Item) and (TempFromSalesLineBuf.Quantity <> 0);
- OnCopySalesCrMemoLinesToDocOnAfterCalcShouldCopyItemTracking(ToSalesHeader, ShouldCopyItemTracking, ToSalesLine);
- if ShouldCopyItemTracking then begin
- FromSalesCrMemoLine."Document No." := OldCrMemoDocNo;
- FromSalesCrMemoLine."Line No." := TempFromSalesLineBuf."Return Receipt Line No.";
- FromSalesCrMemoLine.GetItemLedgEntries(TempItemLedgEntryBuf, true);
- if IsCopyItemTrkg(TempItemLedgEntryBuf, CopyItemTrkg, FillExactCostRevLink) then begin
- if MoveNegLines or not ExactCostRevMandatory then
- ItemTrackingDocMgt.CopyItemLedgerEntriesToTemp(TempTrkgItemLedgEntry, TempItemLedgEntryBuf)
- else
- ItemTrackingDocMgt.CollectItemTrkgPerPostedDocLine(
- TempItemTrkgEntry, TempTrkgItemLedgEntry, false, TempFromSalesLineBuf."Document No.", TempFromSalesLineBuf."Line No.");
-
- ItemTrackingMgt.CopyItemLedgEntryTrkgToSalesLn(
- TempTrkgItemLedgEntry, ToSalesLine,
- FillExactCostRevLink and ExactCostRevMandatory, MissingExCostRevLink,
- FromSalesHeader."Prices Including VAT", ToSalesHeader."Prices Including VAT", false);
- OnCopySalesCrMemoLinesToDocOnAfterCopyItemLedgEntryTrkgToSalesLn(ToSalesLine);
- end;
- end;
- OnAfterCopySalesLineFromSalesCrMemoLineBuffer(
- ToSalesLine, FromSalesCrMemoLine, IncludeHeader, RecalculateLines, TempDocSalesLine, ToSalesHeader, TempFromSalesLineBuf, FromSalesLine);
- end;
- until TempFromSalesLineBuf.Next() = 0;
- end;
-
- CloseWindow();
-
- OnAfterCopySalesCrMemoLinesToDoc(ToSalesHeader, FromSalesCrMemoLine, LinesNotCopied, MissingExCostRevLink);
- end;
-
- procedure CopySalesReturnRcptLinesToDoc(ToSalesHeader: Record "Sales Header"; var FromReturnRcptLine: Record "Return Receipt Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- ItemLedgEntry: Record "Item Ledger Entry";
- TempTrkgItemLedgEntry: Record "Item Ledger Entry" temporary;
- FromSalesHeader: Record "Sales Header";
- FromSalesLine: Record "Sales Line";
- ToSalesLine: Record "Sales Line";
- TempFromSalesLineBuf: Record "Sales Line" temporary;
- FromReturnRcptHeader: Record "Return Receipt Header";
- TempItemTrkgEntry: Record "Reservation Entry" temporary;
- TempDocSalesLine: Record "Sales Line" temporary;
- ItemTrackingMgt: Codeunit "Item Tracking Management";
- OldDocNo: Code[20];
- NextLineNo: Integer;
- NextItemTrkgEntryNo: Integer;
- FromLineCounter: Integer;
- ToLineCounter: Integer;
- CopyItemTrkg: Boolean;
- SplitLine: Boolean;
- FillExactCostRevLink: Boolean;
- CopyLine: Boolean;
- InsertDocNoLine: Boolean;
- begin
- MissingExCostRevLink := false;
- InitCurrency(ToSalesHeader."Currency Code");
- OpenWindow();
-
- OnBeforeCopySalesReturnRcptLinesToDoc(TempDocSalesLine, ToSalesHeader, FromReturnRcptLine);
-
- if FromReturnRcptLine.FindSet() then
- repeat
- FromLineCounter := FromLineCounter + 1;
- if IsTimeForUpdate() then
- UpdateWindow(1, FromLineCounter);
- if FromReturnRcptHeader."No." <> FromReturnRcptLine."Document No." then begin
- FromReturnRcptHeader.Get(FromReturnRcptLine."Document No.");
- TransferOldExtLines.ClearLineNumbers();
- end;
- OnCopySalesReturnRcptLinesToDocOnBeforeFromSalesHeaderTransferFields(FromReturnRcptHeader, FromSalesHeader, ToSalesHeader, FromReturnRcptLine);
- FromSalesHeader.TransferFields(FromReturnRcptHeader);
- OnCopySalesReturnRcptLinesToDocOnAfterFromSalesHeaderTransferFields(FromReturnRcptHeader, FromSalesHeader);
- FillExactCostRevLink :=
- IsSalesFillExactCostRevLink(ToSalesHeader, 2, FromSalesHeader."Currency Code");
- FromSalesLine.TransferFields(FromReturnRcptLine);
- FromSalesLine."Appl.-from Item Entry" := 0;
- FromSalesLine."Copied From Posted Doc." := true;
-
- CheckUpdateOldDocumentNoFromReturnRcptLine(FromReturnRcptLine, OldDocNo, InsertDocNoLine);
-
- OnBeforeCopySalesReturnRcptLinesToBuffer(FromSalesLine, FromReturnRcptLine, ToSalesHeader);
-
- SplitLine := true;
- FromReturnRcptLine.FilterPstdDocLnItemLedgEntries(ItemLedgEntry);
- if not SplitPstdSalesLinesPerILE(
- ToSalesHeader, FromSalesHeader, ItemLedgEntry, TempFromSalesLineBuf,
- FromSalesLine, TempDocSalesLine, NextLineNo, CopyItemTrkg, MissingExCostRevLink, FillExactCostRevLink, true)
- then
- if CopyItemTrkg then
- SplitLine :=
- SplitSalesDocLinesPerItemTrkg(
- ItemLedgEntry, TempItemTrkgEntry, TempFromSalesLineBuf,
- FromSalesLine, TempDocSalesLine, NextLineNo, NextItemTrkgEntryNo, MissingExCostRevLink, true)
- else
- SplitLine := false;
-
- if not SplitLine then begin
- TempFromSalesLineBuf := FromSalesLine;
- CopyLine := true;
- end else
- CopyLine := TempFromSalesLineBuf.FindSet() and FillExactCostRevLink;
-
- UpdateWindow(1, FromLineCounter);
-
- OnCopySalesReturnRcptLinesToDocOnBeforeCopyLines(ToSalesHeader, FromReturnRcptLine, TempFromSalesLineBuf);
-
- if CopyLine then begin
- NextLineNo := GetLastToSalesLineNo(ToSalesHeader);
- OnCopySalesReturnRcptLinesToDocOnAfterCalcNextLineNo(ToSalesHeader, FromReturnRcptLine, FromSalesHeader, NextLineNo, InsertDocNoLine, FromLineCounter, TempFromSalesLineBuf);
- if InsertDocNoLine then begin
- InsertOldSalesDocNoLine(ToSalesHeader, FromReturnRcptLine."Document No.", 3, NextLineNo);
- InsertDocNoLine := false;
- end;
- repeat
- ToLineCounter := ToLineCounter + 1;
- if IsTimeForUpdate() then
- UpdateWindow(2, ToLineCounter);
- OnCopySalesReturnRcptLinesToDocOnBeforeCopySalesDocLine(ToSalesHeader, TempFromSalesLineBuf, CopyItemTrkg);
- if CopySalesDocLine(
- ToSalesHeader, ToSalesLine, FromSalesHeader, TempFromSalesLineBuf, NextLineNo, LinesNotCopied, false,
- "Sales Document Type From"::"Posted Return Receipt", CopyPostedDeferral, TempFromSalesLineBuf."Line No.")
- then begin
- if CopyItemTrkg then begin
- if SplitLine then
- ItemTrackingDocMgt.CollectItemTrkgPerPostedDocLine(
- TempItemTrkgEntry, TempTrkgItemLedgEntry, false, TempFromSalesLineBuf."Document No.", TempFromSalesLineBuf."Line No.")
- else
- ItemTrackingDocMgt.CopyItemLedgerEntriesToTemp(TempTrkgItemLedgEntry, ItemLedgEntry);
-
- ItemTrackingMgt.CopyItemLedgEntryTrkgToSalesLn(
- TempTrkgItemLedgEntry, ToSalesLine,
- FillExactCostRevLink and ExactCostRevMandatory, MissingExCostRevLink,
- FromSalesHeader."Prices Including VAT", ToSalesHeader."Prices Including VAT", true);
- end;
- OnAfterCopySalesLineFromReturnRcptLineBuffer(
- ToSalesLine, FromReturnRcptLine, IncludeHeader, RecalculateLines,
- TempDocSalesLine, ToSalesHeader, TempFromSalesLineBuf, CopyItemTrkg);
- end;
- until TempFromSalesLineBuf.Next() = 0
- end;
- OnCopySalesReturnRcptLinesToDocOnAfterCopySalesDocLine(FromReturnRcptLine, ToSalesLine);
- until FromReturnRcptLine.Next() = 0;
-
- CloseWindow();
-
- OnAfterCopySalesReturnRcptLinesToDoc(ToSalesHeader, FromReturnRcptLine, LinesNotCopied, MissingExCostRevLink);
- end;
-
- local procedure CheckUpdateOldDocumentNoFromReturnRcptLine(FromReturnRcptLine: Record "Return Receipt Line"; var OldDocNo: Code[20]; var InsertDocNoLine: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckUpdateOldDocumentNoFromReturnRcptLine(FromReturnRcptLine, OldDocNo, InsertDocNoLine, IsHandled);
- if IsHandled then
- exit;
-
- if FromReturnRcptLine."Document No." <> OldDocNo then begin
- OldDocNo := FromReturnRcptLine."Document No.";
- InsertDocNoLine := true;
- end;
- end;
-
- local procedure CopySalesLinesToBuffer(FromSalesHeader: Record "Sales Header"; FromSalesLine: Record "Sales Line"; var FromSalesLine2: Record "Sales Line"; var TempSalesLineBuf: Record "Sales Line" temporary; ToSalesHeader: Record "Sales Header"; var TempDocSalesLine: Record "Sales Line" temporary; DocNo: Code[20]; var NextLineNo: Integer)
- begin
- FromSalesLine2 := TempSalesLineBuf;
- TempSalesLineBuf := FromSalesLine;
- TempSalesLineBuf."Document No." := '';
- TempSalesLineBuf."Line No." := NextLineNo;
- OnAfterCopySalesLinesToBufferFields(TempSalesLineBuf, FromSalesLine2, FromSalesLine);
-
- NextLineNo := NextLineNo + 10000;
- if not IsRecalculateAmount(
- FromSalesHeader."Currency Code", ToSalesHeader."Currency Code",
- FromSalesHeader."Prices Including VAT", ToSalesHeader."Prices Including VAT")
- then
- TempSalesLineBuf."Return Receipt No." := DocNo;
- ReCalcSalesLine(FromSalesHeader, ToSalesHeader, TempSalesLineBuf);
- OnCopySalesLinesToBufferTransferFields(FromSalesHeader, FromSalesLine, TempSalesLineBuf);
- TempSalesLineBuf.Insert();
- AddSalesDocLine(TempDocSalesLine, TempSalesLineBuf."Line No.", DocNo, FromSalesLine."Line No.");
- end;
-
- local procedure CopyItemLedgEntryTrackingToSalesLine(var TempItemLedgEntry: Record "Item Ledger Entry" temporary; var TempReservationEntry: Record "Reservation Entry" temporary; TempFromSalesLine: Record "Sales Line" temporary; ToSalesLine: Record "Sales Line"; ToSalesPricesInctVAT: Boolean; FromSalesPricesInctVAT: Boolean; FillExactCostRevLink: Boolean; var MissingExCostRevLink: Boolean)
- var
- TempTrkgItemLedgEntry: Record "Item Ledger Entry" temporary;
- AssemblyHeader: Record "Assembly Header";
- ItemTrackingMgt: Codeunit "Item Tracking Management";
- begin
- if MoveNegLines or not ExactCostRevMandatory then
- ItemTrackingDocMgt.CopyItemLedgerEntriesToTemp(TempTrkgItemLedgEntry, TempItemLedgEntry)
- else
- ItemTrackingDocMgt.CollectItemTrkgPerPostedDocLine(
- TempReservationEntry, TempTrkgItemLedgEntry, false, TempFromSalesLine."Document No.", TempFromSalesLine."Line No.");
-
- if ToSalesLine.AsmToOrderExists(AssemblyHeader) then
- SetTrackingOnAssemblyReservation(AssemblyHeader, TempItemLedgEntry)
- else
- ItemTrackingMgt.CopyItemLedgEntryTrkgToSalesLn(
- TempTrkgItemLedgEntry, ToSalesLine, FillExactCostRevLink and ExactCostRevMandatory, MissingExCostRevLink,
- FromSalesPricesInctVAT, ToSalesPricesInctVAT, false);
- end;
-
- procedure SplitPstdSalesLinesPerILE(ToSalesHeader: Record "Sales Header"; FromSalesHeader: Record "Sales Header"; var ItemLedgEntry: Record "Item Ledger Entry"; var TempSalesLineBuf: Record "Sales Line" temporary; FromSalesLine: Record "Sales Line"; var TempDocSalesLine: Record "Sales Line" temporary; var NextLineNo: Integer; var CopyItemTrkg: Boolean; var MissingExCostRevLink: Boolean; FillExactCostRevLink: Boolean; FromShptOrRcpt: Boolean) Result: Boolean
- var
- OrgQtyBase: Decimal;
- OneRecord: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSplitPstdSalesLinesPerILE(ToSalesHeader, FromSalesHeader, FromSalesLine, TempSalesLineBuf, FromShptOrRcpt, IsHandled);
- if IsHandled then
- exit(Result);
-
- if FromShptOrRcpt then begin
- TempSalesLineBuf.Reset();
- TempSalesLineBuf.DeleteAll();
- end else
- TempSalesLineBuf.Init();
-
- CopyItemTrkg := false;
-
- if (FromSalesLine.Type <> FromSalesLine.Type::Item) or (FromSalesLine.Quantity = 0) then
- exit(false);
- if IsCopyItemTrkg(ItemLedgEntry, CopyItemTrkg, FillExactCostRevLink) or
- not FillExactCostRevLink or MoveNegLines or
- not ExactCostRevMandatory
- then
- exit(false);
-
- OneRecord := ItemLedgEntry.count() = 1;
- ItemLedgEntry.FindSet();
- if ItemLedgEntry.Quantity >= 0 then begin
- TempSalesLineBuf."Document No." := ItemLedgEntry."Document No.";
- if GetSalesDocTypeForItemLedgEntry(ItemLedgEntry) in
- [TempSalesLineBuf."Document Type"::Order, TempSalesLineBuf."Document Type"::"Return Order"]
- then
- TempSalesLineBuf."Shipment Line No." := 1;
- OnSplitPstdSalesLinesPerILEOnAfterAssignShipmentLineNo(ItemLedgEntry, TempSalesLineBuf);
- exit(false);
- end;
- OrgQtyBase := FromSalesLine."Quantity (Base)";
- repeat
- OnSplitPstdSalesLinesPerILEOnBeforeItemLedgEntryLoop(ItemLedgEntry, FromSalesLine);
- if ItemLedgEntry."Shipped Qty. Not Returned" = 0 then
- SkippedLine := true;
-
- if ItemLedgEntry."Shipped Qty. Not Returned" < 0 then begin
- TempSalesLineBuf := FromSalesLine;
-
- if -ItemLedgEntry."Shipped Qty. Not Returned" < Abs(FromSalesLine."Quantity (Base)") then begin
- if FromSalesLine."Quantity (Base)" > 0 then
- TempSalesLineBuf."Quantity (Base)" := -ItemLedgEntry."Shipped Qty. Not Returned"
- else
- TempSalesLineBuf."Quantity (Base)" := ItemLedgEntry."Shipped Qty. Not Returned";
- if TempSalesLineBuf."Qty. per Unit of Measure" = 0 then
- TempSalesLineBuf.Quantity := TempSalesLineBuf."Quantity (Base)"
- else
- TempSalesLineBuf.Quantity :=
- Round(
- TempSalesLineBuf."Quantity (Base)" / TempSalesLineBuf."Qty. per Unit of Measure", UOMMgt.QtyRndPrecision());
- end;
- FromSalesLine."Quantity (Base)" := FromSalesLine."Quantity (Base)" - TempSalesLineBuf."Quantity (Base)";
- FromSalesLine.Quantity := FromSalesLine.Quantity - TempSalesLineBuf.Quantity;
- TempSalesLineBuf."Appl.-from Item Entry" := ItemLedgEntry."Entry No.";
- NextLineNo := NextLineNo + 1;
- TempSalesLineBuf."Line No." := NextLineNo;
- NextLineNo := NextLineNo + 1;
- TempSalesLineBuf."Document No." := ItemLedgEntry."Document No.";
- if GetSalesDocTypeForItemLedgEntry(ItemLedgEntry) in
- [TempSalesLineBuf."Document Type"::Order, TempSalesLineBuf."Document Type"::"Return Order"]
- then
- TempSalesLineBuf."Shipment Line No." := 1;
-
- if not FromShptOrRcpt then
- UpdateRevSalesLineAmount(
- TempSalesLineBuf, OrgQtyBase,
- FromSalesHeader."Prices Including VAT", ToSalesHeader."Prices Including VAT");
-
- OnSplitPstdSalesLinesPerILETransferFields(FromSalesHeader, FromSalesLine, TempSalesLineBuf, ToSalesHeader, ItemLedgEntry);
- TempSalesLineBuf.Insert();
- if OneRecord then
- AddSalesDocLine(TempDocSalesLine, TempSalesLineBuf."Line No.", FromSalesLine."Document No.", FromSalesLine."Line No.")
- else
- AddSalesDocLine(TempDocSalesLine, TempSalesLineBuf."Line No.", ItemLedgEntry."Document No.", TempSalesLineBuf."Line No.");
- end;
- until (ItemLedgEntry.Next() = 0) or (FromSalesLine."Quantity (Base)" = 0);
-
- if (FromSalesLine."Quantity (Base)" <> 0) and FillExactCostRevLink then
- MissingExCostRevLink := true;
- OnSplitPstdSalesLinesPerILEOnBeforeCheckUnappliedLines(ToSalesHeader, SkippedLine, MissingExCostRevLink);
- CheckUnappliedLines(SkippedLine, MissingExCostRevLink);
- exit(true);
- end;
-
- local procedure SplitSalesDocLinesPerItemTrkg(var ItemLedgEntry: Record "Item Ledger Entry"; var TempItemTrkgEntry: Record "Reservation Entry" temporary; var TempSalesLineBuf: Record "Sales Line" temporary; FromSalesLine: Record "Sales Line"; var TempDocSalesLine: Record "Sales Line" temporary; var NextLineNo: Integer; var NextItemTrkgEntryNo: Integer; var MissingExCostRevLink: Boolean; FromShptOrRcpt: Boolean): Boolean
- var
- SalesLineBuf: array[2] of Record "Sales Line" temporary;
- Tracked: Boolean;
- ReversibleQtyBase: Decimal;
- SignFactor: Integer;
- i: Integer;
- Result: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSplitSalesDocLinesPerItemTrkg(ItemLedgEntry, TempItemTrkgEntry, TempSalesLineBuf, FromSalesLine, TempDocSalesLine, NextLineNo, NextItemTrkgEntryNo, MissingExCostRevLink, FromShptOrRcpt, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if FromShptOrRcpt then begin
- TempSalesLineBuf.Reset();
- TempSalesLineBuf.DeleteAll();
- TempItemTrkgEntry.Reset();
- TempItemTrkgEntry.DeleteAll();
- end else
- TempSalesLineBuf.Init();
-
- if MoveNegLines or not ExactCostRevMandatory then
- exit(false);
-
- if FromSalesLine."Quantity (Base)" < 0 then
- SignFactor := -1
- else
- SignFactor := 1;
- OnSplitSalesDocLinesPerItemTrkgOnAfterCalcSignFactor(FromSalesLine, SignFactor);
-
- ItemLedgEntry.SetCurrentKey("Document No.", "Document Type", "Document Line No.");
- ItemLedgEntry.FindSet();
- repeat
- SalesLineBuf[1] := FromSalesLine;
- SalesLineBuf[1]."Line No." := NextLineNo;
- SalesLineBuf[1]."Quantity (Base)" := 0;
- SalesLineBuf[1].Quantity := 0;
- SalesLineBuf[1]."Document No." := ItemLedgEntry."Document No.";
- if GetSalesDocTypeForItemLedgEntry(ItemLedgEntry) in
- [SalesLineBuf[1]."Document Type"::Order, SalesLineBuf[1]."Document Type"::"Return Order"]
- then
- SalesLineBuf[1]."Shipment Line No." := 1;
- OnSplitSalesDocLinesPerItemTrkgOnAfterInitSalesLineBuf1(SalesLineBuf[1], ItemLedgEntry);
- SalesLineBuf[2] := SalesLineBuf[1];
- SalesLineBuf[2]."Line No." := SalesLineBuf[2]."Line No." + 1;
-
- if not FromShptOrRcpt then begin
- ItemLedgEntry.SetRange("Document No.", ItemLedgEntry."Document No.");
- ItemLedgEntry.SetRange("Document Type", ItemLedgEntry."Document Type");
- ItemLedgEntry.SetRange("Document Line No.", ItemLedgEntry."Document Line No.");
- end;
- repeat
- i := 1;
- CalcReversibleQtyBaseSalesDoc(ItemLedgEntry, FromSalesLine, SalesLineBuf, TempItemTrkgEntry, ReversibleQtyBase, SignFactor);
-
- if ReversibleQtyBase <> 0 then begin
- if not FromShptOrRcpt then
- if not ItemLedgEntry.Positive then
- if IsSplitItemLedgEntry(ItemLedgEntry) then
- i := 2;
-
- UpdateSalesLineQtyBaseFromReversibleQtyBase(FromSalesLine, SalesLineBuf[i], ReversibleQtyBase);
- // Fill buffer with exact cost reversing link
- InsertTempReservationEntry(
- ItemLedgEntry, TempItemTrkgEntry, -Abs(ReversibleQtyBase),
- SalesLineBuf[i]."Line No.", NextItemTrkgEntryNo, true);
- Tracked := true;
- end;
- until (ItemLedgEntry.Next() = 0) or (FromSalesLine."Quantity (Base)" = 0);
-
- for i := 1 to 2 do
- if SalesLineBuf[i]."Quantity (Base)" <> 0 then begin
- TempSalesLineBuf := SalesLineBuf[i];
- TempSalesLineBuf.Insert();
- AddSalesDocLine(TempDocSalesLine, TempSalesLineBuf."Line No.", ItemLedgEntry."Document No.", TempSalesLineBuf."Line No.");
- NextLineNo := SalesLineBuf[i]."Line No." + 1;
- end;
-
- if not FromShptOrRcpt then begin
- ItemLedgEntry.SetRange("Document No.");
- ItemLedgEntry.SetRange("Document Type");
- ItemLedgEntry.SetRange("Document Line No.");
- end;
- until (ItemLedgEntry.Next() = 0) or FromShptOrRcpt;
-
- if (FromSalesLine."Quantity (Base)" <> 0) and not Tracked then
- MissingExCostRevLink := true;
- CheckUnappliedLines(SkippedLine, MissingExCostRevLink);
-
- exit(true);
- end;
-
- local procedure CalcReversibleQtyBaseSalesDoc(var ItemLedgEntry: Record "Item Ledger Entry"; FromSalesLine: Record "Sales Line"; var SalesLineBuf: array[2] of Record "Sales Line" temporary; var TempItemTrkgEntry: Record "Reservation Entry" temporary; var ReversibleQtyBase: Decimal; SignFactor: Integer)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCalcReversibleQtyBaseSalesDoc(FromSalesLine, ItemLedgEntry, ReversibleQtyBase, IsHandled);
- if IsHandled then
- exit;
-
- if not ItemLedgEntry.Positive then
- ItemLedgEntry."Shipped Qty. Not Returned" :=
- ItemLedgEntry."Shipped Qty. Not Returned" -
- CalcDistributedQty(TempItemTrkgEntry, ItemLedgEntry, SalesLineBuf[2]."Line No." + 1);
- if ItemLedgEntry."Shipped Qty. Not Returned" = 0 then
- SkippedLine := true;
-
- if ItemLedgEntry."Document Type" in [ItemLedgEntry."Document Type"::"Sales Return Receipt", ItemLedgEntry."Document Type"::"Sales Credit Memo"] then
- if ItemLedgEntry."Remaining Quantity" < FromSalesLine."Quantity (Base)" * SignFactor then
- ReversibleQtyBase := ItemLedgEntry."Remaining Quantity" * SignFactor
- else
- ReversibleQtyBase := FromSalesLine."Quantity (Base)"
- else
- if ItemLedgEntry.Positive then begin
- ReversibleQtyBase := ItemLedgEntry."Remaining Quantity";
- if ReversibleQtyBase < FromSalesLine."Quantity (Base)" * SignFactor then
- ReversibleQtyBase := ReversibleQtyBase * SignFactor
- else
- ReversibleQtyBase := FromSalesLine."Quantity (Base)";
- end else
- if -ItemLedgEntry."Shipped Qty. Not Returned" < FromSalesLine."Quantity (Base)" * SignFactor then
- ReversibleQtyBase := -ItemLedgEntry."Shipped Qty. Not Returned" * SignFactor
- else
- ReversibleQtyBase := FromSalesLine."Quantity (Base)";
- end;
-
- local procedure UpdateSalesLineQtyBaseFromReversibleQtyBase(var FromSalesLine: Record "Sales Line"; var SalesLineBuf: Record "Sales Line" temporary; ReversibleQtyBase: Decimal)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateSalesLineQtyBaseFromReversibleQtyBase(FromSalesLine, SalesLineBuf, ReversibleQtyBase, IsHandled);
- if IsHandled then
- exit;
-
- SalesLineBuf."Quantity (Base)" := SalesLineBuf."Quantity (Base)" + ReversibleQtyBase;
- if SalesLineBuf."Qty. per Unit of Measure" = 0 then
- SalesLineBuf.Quantity := SalesLineBuf."Quantity (Base)"
- else
- SalesLineBuf.Quantity :=
- Round(
- SalesLineBuf."Quantity (Base)" / SalesLineBuf."Qty. per Unit of Measure", UOMMgt.QtyRndPrecision());
- FromSalesLine."Quantity (Base)" := FromSalesLine."Quantity (Base)" - ReversibleQtyBase;
- end;
-
- procedure CopyPurchRcptLinesToDoc(ToPurchHeader: Record "Purchase Header"; var FromPurchRcptLine: Record "Purch. Rcpt. Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- ItemLedgEntry: Record "Item Ledger Entry";
- TempTrkgItemLedgEntry: Record "Item Ledger Entry" temporary;
- FromPurchHeader: Record "Purchase Header";
- FromPurchLine: Record "Purchase Line";
- OriginalPurchHeader: Record "Purchase Header";
- ToPurchLine: Record "Purchase Line";
- TempFromPurchLineBuf: Record "Purchase Line" temporary;
- FromPurchRcptHeader: Record "Purch. Rcpt. Header";
- TempItemTrkgEntry: Record "Reservation Entry" temporary;
- TempDocPurchaseLine: Record "Purchase Line" temporary;
- ItemTrackingMgt: Codeunit "Item Tracking Management";
- OldDocNo: Code[20];
- NextLineNo: Integer;
- NextItemTrkgEntryNo: Integer;
- FromLineCounter: Integer;
- ToLineCounter: Integer;
- CopyItemTrkg: Boolean;
- FillExactCostRevLink: Boolean;
- SplitLine: Boolean;
- CopyLine: Boolean;
- InsertDocNoLine: Boolean;
- IsHandled: Boolean;
- begin
- OnBeforeCopyPurchRcptLinesToDoc(ToPurchHeader, FromPurchRcptLine);
- MissingExCostRevLink := false;
- InitCurrency(ToPurchHeader."Currency Code");
- OpenWindow();
-
- if FromPurchRcptLine.FindSet() then
- repeat
- FromLineCounter := FromLineCounter + 1;
- if IsTimeForUpdate() then
- UpdateWindow(1, FromLineCounter);
- if FromPurchRcptHeader."No." <> FromPurchRcptLine."Document No." then begin
- FromPurchRcptHeader.Get(FromPurchRcptLine."Document No.");
- IsHandled := false;
- OnCopyPurchRcptLinesToDocOnBeforeTestFieldPricesIncludingVAT(ToPurchHeader, IncludeHeader, RecalculateLines, FromPurchRcptHeader, IsHandled);
- if not IsHandled then
- if OriginalPurchHeader.Get(OriginalPurchHeader."Document Type"::Order, FromPurchRcptHeader."Order No.") then
- OriginalPurchHeader.TestField("Prices Including VAT", ToPurchHeader."Prices Including VAT");
- TransferOldExtLines.ClearLineNumbers();
- end;
- FromPurchHeader.TransferFields(FromPurchRcptHeader);
- FillExactCostRevLink :=
- IsPurchFillExactCostRevLink(ToPurchHeader, 0, FromPurchHeader."Currency Code");
- FromPurchLine.TransferFields(FromPurchRcptLine);
- FromPurchLine."Appl.-to Item Entry" := 0;
- FromPurchLine."Copied From Posted Doc." := true;
-
- OnCopyPurchRcptLinesToDocOnAfterTransferFields(FromPurchLine, FromPurchHeader, ToPurchHeader, FromPurchRcptHeader, FromPurchRcptLine, RecalculateLines);
-
- CheckUpdateOldDocumentNoFromPurchRcptLine(FromPurchRcptLine, OldDocNo, InsertDocNoLine);
-
- SplitLine := true;
- FromPurchRcptLine.FilterPstdDocLnItemLedgEntries(ItemLedgEntry);
- OnCopyPurchRcptLinesToDocOnAfterFilterPstdDocLnItemLedgEntries(FromPurchLine, ItemLedgEntry);
- if not SplitPstdPurchLinesPerILE(
- ToPurchHeader, FromPurchHeader, ItemLedgEntry, TempFromPurchLineBuf,
- FromPurchLine, TempDocPurchaseLine, NextLineNo, CopyItemTrkg, MissingExCostRevLink, FillExactCostRevLink, true)
- then
- if CopyItemTrkg then
- SplitLine :=
- SplitPurchDocLinesPerItemTrkg(
- ItemLedgEntry, TempItemTrkgEntry, TempFromPurchLineBuf,
- FromPurchLine, TempDocPurchaseLine, NextLineNo, NextItemTrkgEntryNo, MissingExCostRevLink, true)
- else
- SplitLine := false;
-
- if not SplitLine then begin
- TempFromPurchLineBuf := FromPurchLine;
- CopyLine := true;
- end else
- CopyLine := TempFromPurchLineBuf.FindSet() and FillExactCostRevLink;
-
- UpdateWindow(1, FromLineCounter);
- if CopyLine then begin
- NextLineNo := GetLastToPurchLineNo(ToPurchHeader);
- OnCopyPurchRcptLinesToDocOnBeforeCheckInsertDocNoLine(ToPurchHeader, FromPurchRcptLine, FromPurchHeader, NextLineNo, InsertDocNoLine);
- if InsertDocNoLine then begin
- InsertOldPurchDocNoLine(ToPurchHeader, FromPurchRcptLine."Document No.", 1, NextLineNo);
- InsertDocNoLine := false;
- end;
- repeat
- ToLineCounter := ToLineCounter + 1;
- if IsTimeForUpdate() then
- UpdateWindow(2, ToLineCounter);
- if FromPurchLine.IsProdOrder() then
- FromPurchLine."Quantity (Base)" := 0;
-
- OnCopyPurchRcptLinesToDocOnBeforeCopyPurchLine(ToPurchHeader, TempFromPurchLineBuf, CopyItemTrkg);
-
- if CopyPurchDocLine(
- ToPurchHeader, ToPurchLine, FromPurchHeader, TempFromPurchLineBuf, NextLineNo, LinesNotCopied, false,
- "Purchase Document Type From"::"Posted Receipt", CopyPostedDeferral, TempFromPurchLineBuf."Line No.")
- then begin
- OnCopyPurchRcptLinesToDocOnBeforeCopyItemTrkg(ToPurchHeader, ToPurchLine, TempFromPurchLineBuf, RecalculateLines);
- if CopyItemTrkg then begin
- if SplitLine then
- ItemTrackingDocMgt.CollectItemTrkgPerPostedDocLine(
- TempItemTrkgEntry, TempTrkgItemLedgEntry, true, TempFromPurchLineBuf."Document No.", TempFromPurchLineBuf."Line No.")
- else
- ItemTrackingDocMgt.CopyItemLedgerEntriesToTemp(TempTrkgItemLedgEntry, ItemLedgEntry);
-
- ItemTrackingMgt.CopyItemLedgEntryTrkgToPurchLn(
- TempTrkgItemLedgEntry, ToPurchLine,
- FillExactCostRevLink and ExactCostRevMandatory, MissingExCostRevLink,
- FromPurchHeader."Prices Including VAT", ToPurchHeader."Prices Including VAT", true);
- end;
- OnAfterCopyPurchLineFromPurchRcptLineBuffer(
- ToPurchLine, FromPurchRcptLine, IncludeHeader, RecalculateLines,
- TempDocPurchaseLine, ToPurchHeader, TempFromPurchLineBuf, CopyItemTrkg, NextLineNo);
- end;
- until TempFromPurchLineBuf.Next() = 0;
- OnAfterCopyPurchRcptLine(FromPurchRcptLine, ToPurchLine);
- end;
- until FromPurchRcptLine.Next() = 0;
-
- CloseWindow();
-
- OnAfterCopyPurchRcptLinesToDoc(ToPurchHeader, FromPurchRcptLine, LinesNotCopied, MissingExCostRevLink);
- end;
-
- local procedure CheckUpdateOldDocumentNoFromPurchRcptLine(FromPurchRcptLine: Record "Purch. Rcpt. Line"; var OldDocNo: Code[20]; var InsertDocNoLine: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckUpdateOldDocumentNoFromPurchRcptLine(FromPurchRcptLine, OldDocNo, InsertDocNoLine, IsHandled);
- if IsHandled then
- exit;
-
- if FromPurchRcptLine."Document No." <> OldDocNo then begin
- OldDocNo := FromPurchRcptLine."Document No.";
- InsertDocNoLine := true;
- end;
- end;
-
- procedure CopyPurchInvLinesToDoc(ToPurchHeader: Record "Purchase Header"; var FromPurchInvLine: Record "Purch. Inv. Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- TempItemLedgEntryBuf: Record "Item Ledger Entry" temporary;
- TempTrkgItemLedgEntry: Record "Item Ledger Entry" temporary;
- FromPurchHeader: Record "Purchase Header";
- FromPurchLine: Record "Purchase Line";
- FromPurchLine2: Record "Purchase Line";
- ToPurchLine: Record "Purchase Line";
- TempFromPurchLineBuf: Record "Purchase Line" temporary;
- FromPurchInvHeader: Record "Purch. Inv. Header";
- TempItemTrkgEntry: Record "Reservation Entry" temporary;
- TempDocPurchaseLine: Record "Purchase Line" temporary;
- ItemTrackingMgt: Codeunit "Item Tracking Management";
- OldInvDocNo: Code[20];
- OldRcptDocNo: Code[20];
- OldBufDocNo: Code[20];
- NextLineNo: Integer;
- NextItemTrkgEntryNo: Integer;
- FromLineCounter: Integer;
- ToLineCounter: Integer;
- CopyItemTrkg: Boolean;
- SplitLine: Boolean;
- FillExactCostRevLink: Boolean;
- ItemChargeAssgntNextLineNo: Integer;
- ShouldInsertOldPurchDocNoLine: Boolean;
- ShouldCopyItemTrackingEntries: Boolean;
- IsHandled: Boolean;
- begin
- MissingExCostRevLink := false;
- InitCurrency(ToPurchHeader."Currency Code");
- TempFromPurchLineBuf.Reset();
- TempFromPurchLineBuf.DeleteAll();
- TempItemTrkgEntry.Reset();
- TempItemTrkgEntry.DeleteAll();
- OpenWindow();
-
- OnBeforeCopyPurchInvLines(TempDocPurchaseLine, ToPurchHeader, FromPurchInvLine);
-
- // Fill purchase line buffer
- if FromPurchInvLine.FindSet() then
- repeat
- FromLineCounter := FromLineCounter + 1;
- if IsTimeForUpdate() then
- UpdateWindow(1, FromLineCounter);
- if FromPurchInvHeader."No." <> FromPurchInvLine."Document No." then begin
- FromPurchInvHeader.Get(FromPurchInvLine."Document No.");
- IsHandled := false;
- OnCopyPurchInvLinesToDocOnBeforeTestFieldPricesIncludingVAT(ToPurchHeader, IncludeHeader, RecalculateLines, FromPurchInvHeader, IsHandled);
- if not IsHandled then
- FromPurchInvHeader.TestField("Prices Including VAT", ToPurchHeader."Prices Including VAT");
- TransferOldExtLines.ClearLineNumbers();
- end;
- FromPurchHeader.TransferFields(FromPurchInvHeader);
- FillExactCostRevLink := IsPurchFillExactCostRevLink(ToPurchHeader, 1, FromPurchHeader."Currency Code");
- FromPurchLine.TransferFields(FromPurchInvLine);
- FromPurchLine."Appl.-to Item Entry" := 0;
- // Reuse fields to buffer invoice line information
- FromPurchLine."Receipt No." := FromPurchInvLine."Document No.";
- FromPurchLine."Receipt Line No." := 0;
- FromPurchLine."Return Shipment No." := '';
- FromPurchLine."Return Shipment Line No." := FromPurchInvLine."Line No.";
- FromPurchLine."Copied From Posted Doc." := true;
-
- OnCopyPurchInvLinesToDocOnAfterTransferFields(FromPurchLine, FromPurchHeader, ToPurchHeader, FromPurchInvHeader, FromPurchInvLine, RecalculateLines);
-
- SplitLine := true;
- FromPurchInvLine.GetItemLedgEntries(TempItemLedgEntryBuf, true);
- if not SplitPstdPurchLinesPerILE(
- ToPurchHeader, FromPurchHeader, TempItemLedgEntryBuf, TempFromPurchLineBuf,
- FromPurchLine, TempDocPurchaseLine, NextLineNo, CopyItemTrkg, MissingExCostRevLink, FillExactCostRevLink, false)
- then
- if CopyItemTrkg then
- SplitLine := SplitPurchDocLinesPerItemTrkg(
- TempItemLedgEntryBuf, TempItemTrkgEntry, TempFromPurchLineBuf,
- FromPurchLine, TempDocPurchaseLine, NextLineNo, NextItemTrkgEntryNo, MissingExCostRevLink, false)
- else
- SplitLine := false;
-
- if not SplitLine then
- CopyPurchLinesToBuffer(
- FromPurchHeader, FromPurchLine, FromPurchLine2, TempFromPurchLineBuf, ToPurchHeader, TempDocPurchaseLine,
- FromPurchInvLine."Document No.", NextLineNo);
-
- if TempFromPurchLineBuf."Receipt Line No." <> 0 then
- SkipOldInvoiceDescription(true);
-
- OnAfterCopyPurchInvLines(TempDocPurchaseLine, ToPurchHeader, TempFromPurchLineBuf, FromPurchInvLine);
- until FromPurchInvLine.Next() = 0;
-
- OnCopyPurchInvLinesToDocOnAfterFillPurchLineBuffer(ToPurchHeader);
-
- // Create purchase line from buffer
- UpdateWindow(1, FromLineCounter);
- // Sorting according to Purchase Line Document No.,Line No.
- TempFromPurchLineBuf.SetCurrentKey("Line No.");
- if TempFromPurchLineBuf.FindSet() then begin
- NextLineNo := GetLastToPurchLineNo(ToPurchHeader);
- Clear(OldBufDocNo);
- repeat
- ToLineCounter := ToLineCounter + 1;
- if IsTimeForUpdate() then
- UpdateWindow(2, ToLineCounter);
-
- IsHandled := false;
- OnCopyPurchInvLinesToDocOnBeforeInsertOldPurchLine(ToPurchHeader, TempFromPurchLineBuf, OldInvDocNo, OldRcptDocNo, NextLineNo, SkipCopyFromDescription, InsertCancellationLine, IsHandled);
- if not IsHandled then begin
- ShouldInsertOldPurchDocNoLine := TempFromPurchLineBuf."Receipt No." <> OldInvDocNo;
- OnCopyPurchInvLinesToDocOnAfterCalcShouldInsertOldPurchDocNoLine(ToPurchHeader, FromPurchInvHeader, FromPurchHeader, NextLineNo, OldInvDocNo, OldRcptDocNo, ShouldInsertOldPurchDocNoLine);
- if ShouldInsertOldPurchDocNoLine then begin
- OldInvDocNo := TempFromPurchLineBuf."Receipt No.";
- OldRcptDocNo := '';
- InsertOldPurchDocNoLine(ToPurchHeader, OldInvDocNo, 2, NextLineNo);
- end;
- if (TempFromPurchLineBuf."Document No." <> OldRcptDocNo) and (TempFromPurchLineBuf."Receipt Line No." > 0) then begin
- OldRcptDocNo := TempFromPurchLineBuf."Document No.";
- InsertOldPurchCombDocNoLine(ToPurchHeader, OldInvDocNo, OldRcptDocNo, NextLineNo, true);
- end;
- end;
- // Empty buffer fields
- FromPurchLine2 := TempFromPurchLineBuf;
- FromPurchLine2."Receipt No." := '';
- FromPurchLine2."Receipt Line No." := 0;
- FromPurchLine2."Return Shipment No." := '';
- FromPurchLine2."Return Shipment Line No." := 0;
- if GetPurchDocNo(TempDocPurchaseLine, TempFromPurchLineBuf."Line No.") <> OldBufDocNo then begin
- OldBufDocNo := GetPurchDocNo(TempDocPurchaseLine, TempFromPurchLineBuf."Line No.");
- TransferOldExtLines.ClearLineNumbers();
- end;
-
- OnCopyPurchInvLinesToDocOnBeforeCopyPurchLine(ToPurchHeader, FromPurchLine2, TempFromPurchLineBuf);
-
- if CopyPurchDocLine(
- ToPurchHeader, ToPurchLine, FromPurchHeader, FromPurchLine2, NextLineNo, LinesNotCopied,
- TempFromPurchLineBuf."Return Shipment No." = '',
- "Purchase Document Type From"::"Posted Invoice", CopyPostedDeferral, GetPurchLineNo(TempDocPurchaseLine, FromPurchLine2."Line No."))
- then begin
- if CopyPostedDeferral then
- CopyPurchPostedDeferrals(
- ToPurchLine, "Deferral Document Type"::Purchase,
- DeferralTypeForPurchDoc("Purchase Document Type From"::"Posted Invoice".AsInteger()), TempFromPurchLineBuf."Receipt No.",
- TempFromPurchLineBuf."Return Shipment Line No.", ToPurchLine."Document Type".AsInteger(), ToPurchLine."Document No.", ToPurchLine."Line No.");
- FromPurchInvLine.Get(TempFromPurchLineBuf."Receipt No.", TempFromPurchLineBuf."Return Shipment Line No.");
-
- OnCopyPurchInvLinesToDocOnBeforeCopyItemCharges(FromPurchInvLine, NextLineNo, ToPurchLine, TempDocPurchaseLine, RecalculateLines);
- // copy item charges
- if TempFromPurchLineBuf.Type = TempFromPurchLineBuf.Type::"Charge (Item)" then begin
- FromPurchLine.TransferFields(FromPurchInvLine);
- FromPurchLine."Document Type" := FromPurchLine."Document Type"::Invoice;
- CopyFromPurchLineItemChargeAssign(FromPurchLine, ToPurchLine, FromPurchHeader, ItemChargeAssgntNextLineNo);
- end;
- // copy item tracking
- ShouldCopyItemTrackingEntries := (TempFromPurchLineBuf.Type = TempFromPurchLineBuf.Type::Item) and (TempFromPurchLineBuf.Quantity <> 0) and (not TempFromPurchLineBuf.IsProdOrder()) and PurchaseDocCanReceiveTracking(ToPurchHeader);
- OnCopyPurchInvLinesToDocOnAfterCalcShouldCopyItemTrackingEntries(ToPurchLine, ShouldCopyItemTrackingEntries);
- if ShouldCopyItemTrackingEntries then begin
- FromPurchInvLine."Document No." := OldInvDocNo;
- FromPurchInvLine."Line No." := TempFromPurchLineBuf."Return Shipment Line No.";
- FromPurchInvLine.GetItemLedgEntries(TempItemLedgEntryBuf, true);
- if IsCopyItemTrkg(TempItemLedgEntryBuf, CopyItemTrkg, FillExactCostRevLink) then begin
- if TempFromPurchLineBuf."Job No." <> '' then
- TempItemLedgEntryBuf.SetFilter("Entry Type", '<> %1', TempItemLedgEntryBuf."Entry Type"::"Negative Adjmt.");
- if MoveNegLines or not ExactCostRevMandatory then
- ItemTrackingDocMgt.CopyItemLedgerEntriesToTemp(TempTrkgItemLedgEntry, TempItemLedgEntryBuf)
- else
- ItemTrackingDocMgt.CollectItemTrkgPerPostedDocLine(
- TempItemTrkgEntry, TempTrkgItemLedgEntry, true, TempFromPurchLineBuf."Document No.", TempFromPurchLineBuf."Line No.");
-
- ItemTrackingMgt.CopyItemLedgEntryTrkgToPurchLn(TempTrkgItemLedgEntry, ToPurchLine,
- FillExactCostRevLink and ExactCostRevMandatory, MissingExCostRevLink,
- FromPurchHeader."Prices Including VAT", ToPurchHeader."Prices Including VAT", false);
- end;
- end;
- OnAfterCopyPurchLineFromPurchLineBuffer(
- ToPurchLine, FromPurchInvLine, IncludeHeader, RecalculateLines, TempDocPurchaseLine, ToPurchHeader, TempFromPurchLineBuf);
- end;
- OnAfterCopyPurchInvLine(FromPurchInvLine, ToPurchLine, ToPurchHeader);
- until TempFromPurchLineBuf.Next() = 0;
- end;
-
- CloseWindow();
-
- OnAfterCopyPurchInvLinesToDoc(ToPurchHeader, FromPurchInvLine, LinesNotCopied, MissingExCostRevLink);
- end;
-
- procedure CopyPurchCrMemoLinesToDoc(ToPurchHeader: Record "Purchase Header"; var FromPurchCrMemoLine: Record "Purch. Cr. Memo Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- TempItemLedgEntryBuf: Record "Item Ledger Entry" temporary;
- TempTrkgItemLedgEntry: Record "Item Ledger Entry" temporary;
- FromPurchHeader: Record "Purchase Header";
- FromPurchLine: Record "Purchase Line";
- FromPurchLine2: Record "Purchase Line";
- ToPurchLine: Record "Purchase Line";
- TempFromPurchLineBuf: Record "Purchase Line" temporary;
- FromPurchCrMemoHeader: Record "Purch. Cr. Memo Hdr.";
- TempItemTrkgEntry: Record "Reservation Entry" temporary;
- TempDocPurchaseLine: Record "Purchase Line" temporary;
- ItemTrackingMgt: Codeunit "Item Tracking Management";
- OldCrMemoDocNo: Code[20];
- OldReturnShptDocNo: Code[20];
- OldBufDocNo: Code[20];
- NextLineNo: Integer;
- NextItemTrkgEntryNo: Integer;
- FromLineCounter: Integer;
- ToLineCounter: Integer;
- ItemChargeAssgntNextLineNo: Integer;
- CopyItemTrkg: Boolean;
- SplitLine: Boolean;
- FillExactCostRevLink: Boolean;
- ShouldCopyItemTrackingEntries: Boolean;
- IsHandled: Boolean;
- begin
- MissingExCostRevLink := false;
- InitCurrency(ToPurchHeader."Currency Code");
- TempFromPurchLineBuf.Reset();
- TempFromPurchLineBuf.DeleteAll();
- TempItemTrkgEntry.Reset();
- TempItemTrkgEntry.DeleteAll();
- OpenWindow();
-
- OnBeforeCopyPurchCrMemoLinesToDoc(TempDocPurchaseLine, ToPurchHeader, FromPurchCrMemoLine);
-
- // Fill purchase line buffer
- if FromPurchCrMemoLine.FindSet() then
- repeat
- FromLineCounter := FromLineCounter + 1;
- if IsTimeForUpdate() then
- UpdateWindow(1, FromLineCounter);
- if FromPurchCrMemoHeader."No." <> FromPurchCrMemoLine."Document No." then begin
- FromPurchCrMemoHeader.Get(FromPurchCrMemoLine."Document No.");
- IsHandled := false;
- OnCopyPurchCrMemoLinesToDocOnBeforeTestFieldPricesIncludingVAT(ToPurchHeader, IncludeHeader, RecalculateLines, FromPurchCrMemoHeader, IsHandled);
- if not IsHandled then
- FromPurchCrMemoHeader.TestField("Prices Including VAT", ToPurchHeader."Prices Including VAT");
- TransferOldExtLines.ClearLineNumbers();
- end;
- FromPurchHeader.TransferFields(FromPurchCrMemoHeader);
- FillExactCostRevLink :=
- IsPurchFillExactCostRevLink(ToPurchHeader, 3, FromPurchHeader."Currency Code");
- FromPurchLine.TransferFields(FromPurchCrMemoLine);
- FromPurchLine."Appl.-to Item Entry" := 0;
- // Reuse fields to buffer credit memo line information
- FromPurchLine."Receipt No." := FromPurchCrMemoLine."Document No.";
- FromPurchLine."Receipt Line No." := 0;
- FromPurchLine."Return Shipment No." := '';
- FromPurchLine."Return Shipment Line No." := FromPurchCrMemoLine."Line No.";
- FromPurchLine."Copied From Posted Doc." := true;
-
- OnCopyPurchCrMemoLinesToDocOnAfterTransferFields(FromPurchLine, FromPurchHeader, ToPurchHeader, FromPurchCrMemoHeader, FromPurchCrMemoLine, RecalculateLines);
-
- SplitLine := true;
- FromPurchCrMemoLine.GetItemLedgEntries(TempItemLedgEntryBuf, true);
- if not SplitPstdPurchLinesPerILE(
- ToPurchHeader, FromPurchHeader, TempItemLedgEntryBuf, TempFromPurchLineBuf,
- FromPurchLine, TempDocPurchaseLine, NextLineNo, CopyItemTrkg, MissingExCostRevLink, FillExactCostRevLink, false)
- then
- if CopyItemTrkg then
- SplitLine :=
- SplitPurchDocLinesPerItemTrkg(
- TempItemLedgEntryBuf, TempItemTrkgEntry, TempFromPurchLineBuf,
- FromPurchLine, TempDocPurchaseLine, NextLineNo, NextItemTrkgEntryNo, MissingExCostRevLink, false)
- else
- SplitLine := false;
-
- if not SplitLine then
- CopyPurchLinesToBuffer(
- FromPurchHeader, FromPurchLine, FromPurchLine2, TempFromPurchLineBuf, ToPurchHeader, TempDocPurchaseLine,
- FromPurchCrMemoLine."Document No.", NextLineNo);
- OnCopyPurchCrMemoLinesToDocOnAfterFromPurchCrMemoLineLoop(TempDocPurchaseLine, ToPurchHeader, TempFromPurchLineBuf, FromPurchCrMemoLine, SplitLine);
- until FromPurchCrMemoLine.Next() = 0;
-
- OnCopyPurchCrMemoLinesToDocOnAfterFillPurchLineBuffer(ToPurchHeader);
-
- // Create purchase line from buffer
- UpdateWindow(1, FromLineCounter);
- // Sorting according to Purchase Line Document No.,Line No.
- TempFromPurchLineBuf.SetCurrentKey("Document Type", "Document No.", "Line No.");
- if TempFromPurchLineBuf.FindSet() then begin
- NextLineNo := GetLastToPurchLineNo(ToPurchHeader);
- Clear(OldBufDocNo);
- Clear(OldCrMemoDocNo);
- repeat
- ToLineCounter := ToLineCounter + 1;
- if IsTimeForUpdate() then
- UpdateWindow(2, ToLineCounter);
- if TempFromPurchLineBuf."Receipt No." <> OldCrMemoDocNo then begin
- OldCrMemoDocNo := TempFromPurchLineBuf."Receipt No.";
- OldReturnShptDocNo := '';
- InsertOldPurchDocNoLine(ToPurchHeader, OldCrMemoDocNo, 4, NextLineNo);
- end;
- if TempFromPurchLineBuf."Document No." <> OldReturnShptDocNo then begin
- OldReturnShptDocNo := TempFromPurchLineBuf."Document No.";
- InsertOldPurchCombDocNoLine(ToPurchHeader, OldCrMemoDocNo, OldReturnShptDocNo, NextLineNo, false);
- end;
- // Empty buffer fields
- FromPurchLine2 := TempFromPurchLineBuf;
- FromPurchLine2."Receipt No." := '';
- FromPurchLine2."Receipt Line No." := 0;
- FromPurchLine2."Return Shipment No." := '';
- FromPurchLine2."Return Shipment Line No." := 0;
- if GetPurchDocNo(TempDocPurchaseLine, TempFromPurchLineBuf."Line No.") <> OldBufDocNo then begin
- OldBufDocNo := GetPurchDocNo(TempDocPurchaseLine, TempFromPurchLineBuf."Line No.");
- TransferOldExtLines.ClearLineNumbers();
- end;
-
- OnCopyPurchCrMemoLinesToDocOnBeforeCopyPurchLine(ToPurchHeader, FromPurchLine2);
-
- if CopyPurchDocLine(
- ToPurchHeader, ToPurchLine, FromPurchHeader, FromPurchLine2, NextLineNo, LinesNotCopied, TempFromPurchLineBuf."Return Shipment No." = '',
- "Purchase Document Type From"::"Posted Credit Memo", CopyPostedDeferral, GetPurchLineNo(TempDocPurchaseLine, FromPurchLine2."Line No."))
- then begin
- if CopyPostedDeferral then
- CopyPurchPostedDeferrals(
- ToPurchLine, "Deferral Document Type"::Purchase,
- DeferralTypeForPurchDoc("Purchase Document Type From"::"Posted Credit Memo".AsInteger()), TempFromPurchLineBuf."Receipt No.",
- TempFromPurchLineBuf."Return Shipment Line No.", ToPurchLine."Document Type".AsInteger(), ToPurchLine."Document No.", ToPurchLine."Line No.");
- FromPurchCrMemoLine.Get(TempFromPurchLineBuf."Receipt No.", TempFromPurchLineBuf."Return Shipment Line No.");
-
- OnCopyPurchCrMemoLinesToDocOnBeforeCopyItemCharges(ToPurchLine, TempFromPurchLineBuf, RecalculateLines);
- // copy item charges
- if TempFromPurchLineBuf.Type = TempFromPurchLineBuf.Type::"Charge (Item)" then begin
- FromPurchLine.TransferFields(FromPurchCrMemoLine);
- FromPurchLine."Document Type" := FromPurchLine."Document Type"::"Credit Memo";
- CopyFromPurchLineItemChargeAssign(FromPurchLine, ToPurchLine, FromPurchHeader, ItemChargeAssgntNextLineNo);
- end;
- // copy item tracking
- ShouldCopyItemTrackingEntries := (TempFromPurchLineBuf.Type = TempFromPurchLineBuf.Type::Item) and (TempFromPurchLineBuf.Quantity <> 0) and (not TempFromPurchLineBuf.IsProdOrder());
- OnCopyPurchCrMemoLinesToDocOnAfterCalcShouldCopyItemTrackingEntries(ToPurchLine, ShouldCopyItemTrackingEntries);
- if ShouldCopyItemTrackingEntries then begin
- FromPurchCrMemoLine."Document No." := OldCrMemoDocNo;
- FromPurchCrMemoLine."Line No." := TempFromPurchLineBuf."Return Shipment Line No.";
- FromPurchCrMemoLine.GetItemLedgEntries(TempItemLedgEntryBuf, true);
- if IsCopyItemTrkg(TempItemLedgEntryBuf, CopyItemTrkg, FillExactCostRevLink) then begin
- if TempFromPurchLineBuf."Job No." <> '' then
- TempItemLedgEntryBuf.SetFilter("Entry Type", '<> %1', TempItemLedgEntryBuf."Entry Type"::"Negative Adjmt.");
- OnCopyPurchCrMemoLinesToDocOnAfterFilterEntryType(TempFromPurchLineBuf, TempItemLedgEntryBuf);
- if MoveNegLines or not ExactCostRevMandatory then
- ItemTrackingDocMgt.CopyItemLedgerEntriesToTemp(TempTrkgItemLedgEntry, TempItemLedgEntryBuf)
- else
- ItemTrackingDocMgt.CollectItemTrkgPerPostedDocLine(
- TempItemTrkgEntry, TempTrkgItemLedgEntry, true, TempFromPurchLineBuf."Document No.", TempFromPurchLineBuf."Line No.");
-
- ItemTrackingMgt.CopyItemLedgEntryTrkgToPurchLn(
- TempTrkgItemLedgEntry, ToPurchLine,
- FillExactCostRevLink and ExactCostRevMandatory, MissingExCostRevLink,
- FromPurchHeader."Prices Including VAT", ToPurchHeader."Prices Including VAT", false);
- end;
- end;
- OnAfterCopyPurchLineFromPurchCrMemoLineBuffer(
- ToPurchLine, FromPurchCrMemoLine, IncludeHeader, RecalculateLines, TempDocPurchaseLine, ToPurchHeader, TempFromPurchLineBuf);
- end;
- OnAfterCopyPurchCrMemoLine(FromPurchCrMemoLine, ToPurchLine, ToPurchHeader);
- until TempFromPurchLineBuf.Next() = 0;
- end;
-
- CloseWindow();
-
- OnAfterCopyPurchCrMemoLinesToDoc(ToPurchHeader, FromPurchCrMemoLine, LinesNotCopied, MissingExCostRevLink);
- end;
-
- procedure CopyPurchReturnShptLinesToDoc(ToPurchHeader: Record "Purchase Header"; var FromReturnShptLine: Record "Return Shipment Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- ItemLedgEntry: Record "Item Ledger Entry";
- TempTrkgItemLedgEntry: Record "Item Ledger Entry" temporary;
- FromPurchHeader: Record "Purchase Header";
- FromPurchLine: Record "Purchase Line";
- OriginalPurchHeader: Record "Purchase Header";
- ToPurchLine: Record "Purchase Line";
- TempFromPurchLineBuf: Record "Purchase Line" temporary;
- FromReturnShptHeader: Record "Return Shipment Header";
- TempItemTrkgEntry: Record "Reservation Entry" temporary;
- TempDocPurchaseLine: Record "Purchase Line" temporary;
- ItemTrackingMgt: Codeunit "Item Tracking Management";
- OldDocNo: Code[20];
- NextLineNo: Integer;
- NextItemTrkgEntryNo: Integer;
- FromLineCounter: Integer;
- ToLineCounter: Integer;
- CopyItemTrkg: Boolean;
- SplitLine: Boolean;
- FillExactCostRevLink: Boolean;
- CopyLine: Boolean;
- InsertDocNoLine: Boolean;
- IsHandled: Boolean;
- begin
- MissingExCostRevLink := false;
- InitCurrency(ToPurchHeader."Currency Code");
- OpenWindow();
-
- OnBeforeCopyPurchReturnShptLinesToDoc(TempDocPurchaseLine, ToPurchHeader, FromReturnShptLine);
-
- if FromReturnShptLine.FindSet() then
- repeat
- FromLineCounter := FromLineCounter + 1;
- if IsTimeForUpdate() then
- UpdateWindow(1, FromLineCounter);
- if FromReturnShptHeader."No." <> FromReturnShptLine."Document No." then begin
- FromReturnShptHeader.Get(FromReturnShptLine."Document No.");
- IsHandled := false;
- OnCopyPurchReturnShptLinesToDocOnBeforeTestFieldPricesIncludingVAT(ToPurchHeader, IncludeHeader, RecalculateLines, FromReturnShptHeader, IsHandled);
- if not IsHandled then
- if OriginalPurchHeader.Get(OriginalPurchHeader."Document Type"::"Return Order", FromReturnShptHeader."Return Order No.") then
- OriginalPurchHeader.TestField("Prices Including VAT", ToPurchHeader."Prices Including VAT");
- TransferOldExtLines.ClearLineNumbers();
- end;
- FromPurchHeader.TransferFields(FromReturnShptHeader);
- FillExactCostRevLink :=
- IsPurchFillExactCostRevLink(ToPurchHeader, 2, FromPurchHeader."Currency Code");
- FromPurchLine.TransferFields(FromReturnShptLine);
- FromPurchLine.Validate("Order No.", FromReturnShptLine."Return Order No.");
- FromPurchLine.Validate("Order Line No.", FromReturnShptLine."Return Order Line No.");
- FromPurchLine."Appl.-to Item Entry" := 0;
- FromPurchLine."Copied From Posted Doc." := true;
-
- OnCopyPurchReturnShptLinesToDocOnAfterTransferFields(FromPurchLine, FromPurchHeader, ToPurchHeader, FromReturnShptHeader, FromReturnShptLine, RecalculateLines);
-
- CheckUpdateOldDocumentNoFromReturnShptLine(FromReturnShptLine, OldDocNo, InsertDocNoLine);
-
- SplitLine := true;
- FromReturnShptLine.FilterPstdDocLnItemLedgEntries(ItemLedgEntry);
- if not SplitPstdPurchLinesPerILE(
- ToPurchHeader, FromPurchHeader, ItemLedgEntry, TempFromPurchLineBuf,
- FromPurchLine, TempDocPurchaseLine, NextLineNo, CopyItemTrkg, MissingExCostRevLink, FillExactCostRevLink, true)
- then
- if CopyItemTrkg then
- SplitLine :=
- SplitPurchDocLinesPerItemTrkg(
- ItemLedgEntry, TempItemTrkgEntry, TempFromPurchLineBuf,
- FromPurchLine, TempDocPurchaseLine, NextLineNo, NextItemTrkgEntryNo, MissingExCostRevLink, true)
- else
- SplitLine := false;
-
- if not SplitLine then begin
- TempFromPurchLineBuf := FromPurchLine;
- CopyLine := true;
- end else
- CopyLine := TempFromPurchLineBuf.FindSet() and FillExactCostRevLink;
-
- UpdateWindow(1, FromLineCounter);
- if CopyLine then begin
- NextLineNo := GetLastToPurchLineNo(ToPurchHeader);
- OnCopyPurchReturnShptLinesToDocOnAfterCalcNextLineNo(ToPurchHeader, FromReturnShptLine, FromPurchHeader, NextLineNo, InsertDocNoLine);
- if InsertDocNoLine then begin
- InsertOldPurchDocNoLine(ToPurchHeader, FromReturnShptLine."Document No.", 3, NextLineNo);
- InsertDocNoLine := false;
- end;
- repeat
- ToLineCounter := ToLineCounter + 1;
- if IsTimeForUpdate() then
- UpdateWindow(2, ToLineCounter);
-
- OnCopyPurchReturnShptLinesToDocOnBeforeCopyPurchLine(ToPurchHeader, TempFromPurchLineBuf, CopyItemTrkg);
-
- if CopyPurchDocLine(
- ToPurchHeader, ToPurchLine, FromPurchHeader, TempFromPurchLineBuf, NextLineNo, LinesNotCopied, false,
- "Purchase Document Type From"::"Posted Return Shipment", CopyPostedDeferral, TempFromPurchLineBuf."Line No.")
- then begin
- OnCopyPurchReturnShptLinesToDocOnBeforeCopyItemTrkg(ToPurchLine, TempFromPurchLineBuf, RecalculateLines);
- if CopyItemTrkg then begin
- if SplitLine then
- ItemTrackingDocMgt.CollectItemTrkgPerPostedDocLine(
- TempItemTrkgEntry, TempTrkgItemLedgEntry, true, TempFromPurchLineBuf."Document No.", TempFromPurchLineBuf."Line No.")
- else
- ItemTrackingDocMgt.CopyItemLedgerEntriesToTemp(TempTrkgItemLedgEntry, ItemLedgEntry);
-
- ItemTrackingMgt.CopyItemLedgEntryTrkgToPurchLn(
- TempTrkgItemLedgEntry, ToPurchLine,
- FillExactCostRevLink and ExactCostRevMandatory, MissingExCostRevLink,
- FromPurchHeader."Prices Including VAT", ToPurchHeader."Prices Including VAT", true);
- end;
- OnAfterCopyPurchLineFromReturnShptLineBuffer(
- ToPurchLine, FromReturnShptLine, IncludeHeader, RecalculateLines,
- TempDocPurchaseLine, ToPurchHeader, TempFromPurchLineBuf, CopyItemTrkg);
- end;
- until TempFromPurchLineBuf.Next() = 0;
- end;
- OnAfterCopyReturnShptLine(FromReturnShptLine, ToPurchLine);
- until FromReturnShptLine.Next() = 0;
-
- CloseWindow();
-
- OnAfterCopyPurchReturnShptLinesToDoc(ToPurchHeader, FromReturnShptLine, LinesNotCopied, MissingExCostRevLink);
- end;
-
- local procedure CheckUpdateOldDocumentNoFromReturnShptLine(FromReturnShptLine: Record "Return Shipment Line"; var OldDocNo: Code[20]; var InsertDocNoLine: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckUpdateOldDocumentNoFromReturnShptLine(FromReturnShptLine, OldDocNo, InsertDocNoLine, IsHandled);
- if IsHandled then
- exit;
-
- if FromReturnShptLine."Document No." <> OldDocNo then begin
- OldDocNo := FromReturnShptLine."Document No.";
- InsertDocNoLine := true;
- end;
- end;
-
- local procedure CopyPurchLinesToBuffer(FromPurchHeader: Record "Purchase Header"; FromPurchLine: Record "Purchase Line"; var FromPurchLine2: Record "Purchase Line"; var TempPurchLineBuf: Record "Purchase Line" temporary; ToPurchHeader: Record "Purchase Header"; var TempDocPurchaseLine: Record "Purchase Line" temporary; DocNo: Code[20]; var NextLineNo: Integer)
- begin
- FromPurchLine2 := TempPurchLineBuf;
- TempPurchLineBuf := FromPurchLine;
- TempPurchLineBuf."Document No." := '';
- TempPurchLineBuf."Line No." := NextLineNo;
- OnAfterCopyPurchLinesToBufferFields(TempPurchLineBuf, FromPurchLine2, FromPurchLine, ToPurchHeader);
-
- NextLineNo := NextLineNo + 10000;
- if not IsRecalculateAmount(
- FromPurchHeader."Currency Code", ToPurchHeader."Currency Code",
- FromPurchHeader."Prices Including VAT", ToPurchHeader."Prices Including VAT")
- then
- TempPurchLineBuf."Return Shipment No." := DocNo;
- ReCalcPurchLine(FromPurchHeader, ToPurchHeader, TempPurchLineBuf);
- TempPurchLineBuf.Insert();
- AddPurchDocLine(TempDocPurchaseLine, TempPurchLineBuf."Line No.", DocNo, FromPurchLine."Line No.");
-
- OnAfterCopyPurchLinesToBuffer(TempPurchLineBuf, FromPurchLine2, FromPurchLine);
- end;
-
- local procedure CreateJobPlanningLine(SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; JobContractEntryNo: Integer): Integer
- var
- JobPlanningLine: Record "Job Planning Line";
- NewJobPlanningLine: Record "Job Planning Line";
- JobPlanningLineInvoice: Record "Job Planning Line Invoice";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCreateJobPlanningLine(SalesHeader, SalesLine, JobContractEntryNo, IsHandled);
- if IsHandled then
- exit;
-
- JobPlanningLine.SetCurrentKey("Job Contract Entry No.");
- JobPlanningLine.SetRange("Job Contract Entry No.", JobContractEntryNo);
- if JobPlanningLine.FindFirst() then begin
- NewJobPlanningLine.InitFromJobPlanningLine(JobPlanningLine, SalesLine.Quantity);
- OnCreateJobPlanningLineOnAfterInitFromJobPlanningLine(NewJobPlanningLine, JobPlanningLine, SalesLine);
- JobPlanningLineInvoice.InitFromJobPlanningLine(NewJobPlanningLine);
- JobPlanningLineInvoice.InitFromSales(SalesHeader, SalesHeader."Posting Date", SalesLine."Line No.");
- JobPlanningLineInvoice.Insert();
-
- NewJobPlanningLine.UpdateQtyToTransfer();
- NewJobPlanningLine.Insert();
- end;
-
- exit(NewJobPlanningLine."Job Contract Entry No.");
- end;
-
- local procedure SplitPstdPurchLinesPerILE(ToPurchHeader: Record "Purchase Header"; FromPurchHeader: Record "Purchase Header"; var ItemLedgEntry: Record "Item Ledger Entry"; var FromPurchLineBuf: Record "Purchase Line"; FromPurchLine: Record "Purchase Line"; var TempDocPurchaseLine: Record "Purchase Line" temporary; var NextLineNo: Integer; var CopyItemTrkg: Boolean; var MissingExCostRevLink: Boolean; FillExactCostRevLink: Boolean; FromShptOrRcpt: Boolean) Result: Boolean
- var
- PurchaseItem: Record Item;
- ApplyRec: Record "Item Application Entry";
- OrgQtyBase: Decimal;
- OneRecord: Boolean;
- IsHandled: Boolean;
- begin
- if FromShptOrRcpt then begin
- FromPurchLineBuf.Reset();
- FromPurchLineBuf.DeleteAll();
- end else
- FromPurchLineBuf.Init();
-
- CopyItemTrkg := false;
-
- if (FromPurchLine.Type <> FromPurchLine.Type::Item) or (FromPurchLine.Quantity = 0) or FromPurchLine.IsProdOrder() then
- exit(false);
-
- PurchaseItem.Get(FromPurchLine."No.");
- if PurchaseItem.IsNonInventoriableType() then
- exit(false);
-
- if IsCopyItemTrkg(ItemLedgEntry, CopyItemTrkg, FillExactCostRevLink) or
- not FillExactCostRevLink or MoveNegLines or
- not ExactCostRevMandatory
- then
- exit(false);
-
- IsHandled := false;
- OnSplitPstdPurchLinesPerILEOnBeforeCheckJobNo(FromPurchLine, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if FromPurchLine."Job No." <> '' then
- exit(false);
-
- OneRecord := ItemLedgEntry.count() = 1;
- ItemLedgEntry.FindSet();
- if ItemLedgEntry.Quantity <= 0 then begin
- FromPurchLineBuf."Document No." := ItemLedgEntry."Document No.";
- if GetPurchDocTypeForItemLedgEntry(ItemLedgEntry) in
- [FromPurchLineBuf."Document Type"::Order, FromPurchLineBuf."Document Type"::"Return Order"]
- then
- FromPurchLineBuf."Receipt Line No." := 1;
- exit(false);
- end;
- OrgQtyBase := FromPurchLine."Quantity (Base)";
- repeat
- if not ApplyFully then begin
- ApplyRec.AppliedOutbndEntryExists(ItemLedgEntry."Entry No.", false, false);
- if ApplyRec.Find('-') then
- SkippedLine := SkippedLine or ApplyRec.Find('-');
- end;
- if ApplyFully then begin
- ApplyRec.AppliedOutbndEntryExists(ItemLedgEntry."Entry No.", false, false);
- if ApplyRec.Find('-') then
- repeat
- SomeAreFixed := SomeAreFixed or ApplyRec.Fixed();
- until ApplyRec.Next() = 0;
- end;
-
- if AskApply and (ItemLedgEntry."Item Tracking" = ItemLedgEntry."Item Tracking"::None) then
- if not (ItemLedgEntry."Remaining Quantity" > 0) or (ItemLedgEntry."Item Tracking" <> ItemLedgEntry."Item Tracking"::None) then
- ConfirmApply();
- if AskApply then
- if ItemLedgEntry."Remaining Quantity" < Abs(FromPurchLine."Quantity (Base)") then
- ConfirmApply();
- if (ItemLedgEntry."Remaining Quantity" > 0) or ApplyFully then begin
- FromPurchLineBuf := FromPurchLine;
- if ItemLedgEntry."Remaining Quantity" < Abs(FromPurchLine."Quantity (Base)") then
- if not ApplyFully then begin
- if FromPurchLine."Quantity (Base)" > 0 then
- FromPurchLineBuf."Quantity (Base)" := ItemLedgEntry."Remaining Quantity"
- else
- FromPurchLineBuf."Quantity (Base)" := -ItemLedgEntry."Remaining Quantity";
- ConvertFromBase(
- FromPurchLineBuf.Quantity, FromPurchLineBuf."Quantity (Base)", FromPurchLineBuf."Qty. per Unit of Measure");
- end else begin
- ReappDone := true;
- FromPurchLineBuf."Quantity (Base)" := Sign(ItemLedgEntry.Quantity) * ItemLedgEntry.Quantity - ApplyRec.Returned(ItemLedgEntry."Entry No.");
- ConvertFromBase(
- FromPurchLineBuf.Quantity, FromPurchLineBuf."Quantity (Base)", FromPurchLineBuf."Qty. per Unit of Measure");
- end;
- FromPurchLine."Quantity (Base)" := FromPurchLine."Quantity (Base)" - FromPurchLineBuf."Quantity (Base)";
- FromPurchLine.Quantity := FromPurchLine.Quantity - FromPurchLineBuf.Quantity;
- FromPurchLineBuf."Appl.-to Item Entry" := ItemLedgEntry."Entry No.";
- NextLineNo := NextLineNo + 1;
- FromPurchLineBuf."Line No." := NextLineNo;
- NextLineNo := NextLineNo + 1;
- FromPurchLineBuf."Document No." := ItemLedgEntry."Document No.";
- if GetPurchDocTypeForItemLedgEntry(ItemLedgEntry) in
- [FromPurchLineBuf."Document Type"::Order, FromPurchLineBuf."Document Type"::"Return Order"]
- then
- FromPurchLineBuf."Receipt Line No." := 1;
-
- if not FromShptOrRcpt then
- UpdateRevPurchLineAmount(
- FromPurchLineBuf, OrgQtyBase,
- FromPurchHeader."Prices Including VAT", ToPurchHeader."Prices Including VAT");
- if FromPurchLineBuf.Quantity <> 0 then begin
- OnSplitPstdPurchLinesPerILEOnBeforeFromPurchLineBufInsert(FromPurchHeader, FromPurchLine, FromPurchLineBuf, ToPurchHeader);
- FromPurchLineBuf.Insert();
- if OneRecord then
- AddPurchDocLine(TempDocPurchaseLine, FromPurchLineBuf."Line No.", FromPurchLine."Document No.", FromPurchLine."Line No.")
- else
- AddPurchDocLine(TempDocPurchaseLine, FromPurchLineBuf."Line No.", ItemLedgEntry."Document No.", FromPurchLineBuf."Line No.");
- end else
- SkippedLine := true;
- end else
- if ItemLedgEntry."Remaining Quantity" = 0 then
- SkippedLine := true;
- until (ItemLedgEntry.Next() = 0) or (FromPurchLine."Quantity (Base)" = 0);
-
- if (FromPurchLine."Quantity (Base)" <> 0) and FillExactCostRevLink then
- MissingExCostRevLink := true;
- OnSplitPstdPurchLinesPerILEOnBeforeCheckUnappliedLines(ToPurchHeader, SkippedLine, MissingExCostRevLink);
- CheckUnappliedLines(SkippedLine, MissingExCostRevLink);
-
- exit(true);
- end;
-
- local procedure SplitPurchDocLinesPerItemTrkg(var ItemLedgEntry: Record "Item Ledger Entry"; var TempItemTrkgEntry: Record "Reservation Entry" temporary; var FromPurchLineBuf: Record "Purchase Line"; FromPurchLine: Record "Purchase Line"; var TempDocPurchaseLine: Record "Purchase Line" temporary; var NextLineNo: Integer; var NextItemTrkgEntryNo: Integer; var MissingExCostRevLink: Boolean; FromShptOrRcpt: Boolean): Boolean
- var
- PurchLineBuf: array[2] of Record "Purchase Line" temporary;
- ApplyRec: Record "Item Application Entry";
- Tracked: Boolean;
- RemainingQtyBase: Decimal;
- SignFactor: Integer;
- i: Integer;
- Result: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeSplitPurchDocLinesPerItemTrkg(ItemLedgEntry, TempItemTrkgEntry, FromPurchLineBuf, FromPurchLine, TempDocPurchaseLine, NextLineNo, NextItemTrkgEntryNo, MissingExCostRevLink, FromShptOrRcpt, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if FromShptOrRcpt then begin
- FromPurchLineBuf.Reset();
- FromPurchLineBuf.DeleteAll();
- TempItemTrkgEntry.Reset();
- TempItemTrkgEntry.DeleteAll();
- end else
- FromPurchLineBuf.Init();
-
- if MoveNegLines or not ExactCostRevMandatory then
- exit(false);
-
- if FromPurchLine."Quantity (Base)" < 0 then
- SignFactor := -1
- else
- SignFactor := 1;
-
- ItemLedgEntry.SetCurrentKey("Document No.", "Document Type", "Document Line No.");
- ItemLedgEntry.FindSet();
- repeat
- PurchLineBuf[1] := FromPurchLine;
- PurchLineBuf[1]."Line No." := NextLineNo;
- PurchLineBuf[1]."Quantity (Base)" := 0;
- PurchLineBuf[1].Quantity := 0;
- PurchLineBuf[1]."Document No." := ItemLedgEntry."Document No.";
- if GetPurchDocTypeForItemLedgEntry(ItemLedgEntry) in
- [PurchLineBuf[1]."Document Type"::Order, PurchLineBuf[1]."Document Type"::"Return Order"]
- then
- PurchLineBuf[1]."Receipt Line No." := 1;
- PurchLineBuf[2] := PurchLineBuf[1];
- PurchLineBuf[2]."Line No." := PurchLineBuf[2]."Line No." + 1;
-
- if not FromShptOrRcpt then begin
- ItemLedgEntry.SetRange("Document No.", ItemLedgEntry."Document No.");
- ItemLedgEntry.SetRange("Document Type", ItemLedgEntry."Document Type");
- ItemLedgEntry.SetRange("Document Line No.", ItemLedgEntry."Document Line No.");
- end;
- repeat
- i := 1;
- if ItemLedgEntry.Positive then
- ItemLedgEntry."Remaining Quantity" :=
- ItemLedgEntry."Remaining Quantity" -
- CalcDistributedQty(TempItemTrkgEntry, ItemLedgEntry, PurchLineBuf[2]."Line No." + 1);
-
- if ItemLedgEntry."Document Type" in [ItemLedgEntry."Document Type"::"Purchase Return Shipment", ItemLedgEntry."Document Type"::"Purchase Credit Memo"] then
- if -ItemLedgEntry."Shipped Qty. Not Returned" < FromPurchLine."Quantity (Base)" * SignFactor then
- RemainingQtyBase := -ItemLedgEntry."Shipped Qty. Not Returned" * SignFactor
- else
- RemainingQtyBase := FromPurchLine."Quantity (Base)"
- else
- if not ItemLedgEntry.Positive then begin
- RemainingQtyBase := -ItemLedgEntry."Shipped Qty. Not Returned";
- if RemainingQtyBase < FromPurchLine."Quantity (Base)" * SignFactor then
- RemainingQtyBase := RemainingQtyBase * SignFactor
- else
- RemainingQtyBase := FromPurchLine."Quantity (Base)";
- end else
- if ItemLedgEntry."Remaining Quantity" < FromPurchLine."Quantity (Base)" * SignFactor then begin
- if (ItemLedgEntry."Item Tracking" = ItemLedgEntry."Item Tracking"::None) and AskApply then
- ConfirmApply();
- if (not ApplyFully) or (ItemLedgEntry."Item Tracking" <> ItemLedgEntry."Item Tracking"::None) then
- RemainingQtyBase := GetQtyOfPurchILENotShipped(ItemLedgEntry."Entry No.", FromPurchLine) * SignFactor
- else
- RemainingQtyBase := FromPurchLine."Quantity (Base)" - ApplyRec.Returned(ItemLedgEntry."Entry No.");
- end else
- RemainingQtyBase := FromPurchLine."Quantity (Base)";
-
- if RemainingQtyBase <> 0 then begin
- if ItemLedgEntry.Positive then
- if IsSplitItemLedgEntry(ItemLedgEntry) then
- i := 2;
-
- PurchLineBuf[i]."Quantity (Base)" := PurchLineBuf[i]."Quantity (Base)" + RemainingQtyBase;
- if PurchLineBuf[i]."Qty. per Unit of Measure" = 0 then
- PurchLineBuf[i].Quantity := PurchLineBuf[i]."Quantity (Base)"
- else
- PurchLineBuf[i].Quantity :=
- Round(
- PurchLineBuf[i]."Quantity (Base)" / PurchLineBuf[i]."Qty. per Unit of Measure", UOMMgt.QtyRndPrecision());
- FromPurchLine."Quantity (Base)" := FromPurchLine."Quantity (Base)" - RemainingQtyBase;
- // Fill buffer with exact cost reversing link for remaining quantity
- if ItemLedgEntry."Document Type" in [ItemLedgEntry."Document Type"::"Purchase Return Shipment", ItemLedgEntry."Document Type"::"Purchase Credit Memo"] then
- InsertTempReservationEntry(
- ItemLedgEntry, TempItemTrkgEntry, -Abs(RemainingQtyBase),
- PurchLineBuf[i]."Line No.", NextItemTrkgEntryNo, true)
- else
- InsertTempReservationEntry(
- ItemLedgEntry, TempItemTrkgEntry, Abs(RemainingQtyBase),
- PurchLineBuf[i]."Line No.", NextItemTrkgEntryNo, true);
- Tracked := true;
- end else
- SkippedLine := true;
- until (ItemLedgEntry.Next() = 0) or (FromPurchLine."Quantity (Base)" = 0);
-
- for i := 1 to 2 do
- if PurchLineBuf[i]."Quantity (Base)" <> 0 then begin
- FromPurchLineBuf := PurchLineBuf[i];
- FromPurchLineBuf.Insert();
- AddPurchDocLine(TempDocPurchaseLine, FromPurchLineBuf."Line No.", ItemLedgEntry."Document No.", FromPurchLine."Line No.");
- NextLineNo := PurchLineBuf[i]."Line No." + 1;
- end;
-
- if not FromShptOrRcpt then begin
- ItemLedgEntry.SetRange("Document No.");
- ItemLedgEntry.SetRange("Document Type");
- ItemLedgEntry.SetRange("Document Line No.");
- end;
- until (ItemLedgEntry.Next() = 0) or FromShptOrRcpt;
- if (FromPurchLine."Quantity (Base)" <> 0) and not Tracked then
- MissingExCostRevLink := true;
- CheckUnappliedLines(SkippedLine, MissingExCostRevLink);
-
- exit(true);
- end;
-
- local procedure CalcDistributedQty(var TempItemTrkgEntry: Record "Reservation Entry" temporary; ItemLedgEntry: Record "Item Ledger Entry"; NextLineNo: Integer): Decimal
- begin
- TempItemTrkgEntry.Reset();
- TempItemTrkgEntry.SetCurrentKey("Source ID", "Source Ref. No.");
- TempItemTrkgEntry.SetRange("Source ID", ItemLedgEntry."Document No.");
- TempItemTrkgEntry.SetFilter("Source Ref. No.", '<%1', NextLineNo);
- TempItemTrkgEntry.SetRange("Item Ledger Entry No.", ItemLedgEntry."Entry No.");
- TempItemTrkgEntry.CalcSums("Quantity (Base)");
- TempItemTrkgEntry.Reset();
- exit(TempItemTrkgEntry."Quantity (Base)");
- end;
-
- [Scope('OnPrem')]
- procedure IsEntityBlocked(TableNo: Integer; CreditDocType: Boolean; Type: Option; EntityNo: Code[20]; EntityCode: Code[10]) EntityIsBlocked: Boolean
- var
- GLAccount: Record "G/L Account";
- FixedAsset: Record "Fixed Asset";
- Item: Record Item;
- ItemVariant: Record "Item Variant";
- Resource: Record Resource;
- ForwardLinkMgt: Codeunit "Forward Link Mgt.";
- MessageType: Option Error,Warning,Information;
- BlockedForSalesPurch: Boolean;
- IsHandled: Boolean;
- ItemItemVariantLbl: Label '%1 %2', Comment = '%1 - Item No., %2 - Variant Code';
- begin
- OnBeforeIsEntityBlocked(TableNo, CreditDocType, Type, EntityNo, EntityIsBlocked, IsHandled, EntityCode);
- if IsHandled then
- exit(EntityIsBlocked);
-
- if SkipWarningNotification then
- MessageType := MessageType::Error
- else
- MessageType := MessageType::Warning;
-
- case Type of
- "Sales Line Type"::"G/L Account".AsInteger():
- if GLAccount.Get(EntityNo) then begin
- if not GLAccount."Direct Posting" then
- ErrorMessageMgt.LogMessage(
- MessageType, 0, StrSubstNo(DirectPostingErr, GLAccount."No."), GLAccount, GLAccount.FieldNo("Direct Posting"), '')
- else
- if GLAccount.Blocked then
- ErrorMessageMgt.LogMessage(
- MessageType, 0, StrSubstNo(IsBlockedErr, GLAccount.TableCaption(), GLAccount."No.")
- , GLAccount, GLAccount.FieldNo(Blocked), '');
- exit(not GLAccount."Direct Posting" or GLAccount.Blocked);
- end;
- "Sales Line Type"::Item.AsInteger():
- if Item.Get(EntityNo) then begin
- if Item.Blocked then begin
- ErrorMessageMgt.LogMessage(
- MessageType, 0, StrSubstNo(IsBlockedErr, Item.TableCaption(), Item."No."),
- Item, Item.FieldNo(Blocked), ForwardLinkMgt.GetHelpCodeForBlockedItem());
- exit(true);
- end;
-
- if not CreditDocType then
- case TableNo of
- Database::"Sales Line":
- if Item."Sales Blocked" then begin
- BlockedForSalesPurch := true;
- ErrorMessageMgt.LogMessage(
- MessageType, 0, StrSubstNo(IsSalesBlockedItemErr, Item.TableCaption(), Item."No.", Item.FieldCaption("Sales Blocked")), Item,
- Item.FieldNo("Sales Blocked"), ForwardLinkMgt.GetHelpCodeForBlockedItem());
- end;
- Database::"Purchase Line":
- if Item."Purchasing Blocked" then begin
- BlockedForSalesPurch := true;
- ErrorMessageMgt.LogMessage(
- MessageType, 0, StrSubstNo(IsPurchBlockedItemErr, Item.TableCaption(), Item."No.", Item.FieldCaption("Purchasing Blocked")), Item,
- Item.FieldNo("Purchasing Blocked"), ForwardLinkMgt.GetHelpCodeForBlockedItem());
- end;
- else
- BlockedForSalesPurch := false;
- end;
-
- if not BlockedForSalesPurch then
- if (EntityCode <> '') and ItemVariant.Get(EntityNo, EntityCode) then begin
- if ItemVariant.Blocked then begin
- ErrorMessageMgt.LogMessage(
- MessageType, 0, StrSubstNo(IsBlockedErr, ItemVariant.TableCaption(), StrSubstNo(ItemItemVariantLbl, ItemVariant."Item No.", ItemVariant.Code)),
- ItemVariant, ItemVariant.FieldNo(Blocked), ForwardLinkMgt.GetHelpCodeForBlockedItem());
- exit(true);
- end;
-
- if not CreditDocType then
- case TableNo of
- Database::"Sales Line":
- if ItemVariant."Sales Blocked" then begin
- BlockedForSalesPurch := true;
- ErrorMessageMgt.LogMessage(
- MessageType, 0,
- StrSubstNo(IsSalesBlockedItemErr, ItemVariant.TableCaption(), StrSubstNo(ItemItemVariantLbl, ItemVariant."Item No.", ItemVariant.Code), ItemVariant.FieldCaption("Sales Blocked")),
- ItemVariant, ItemVariant.FieldNo("Sales Blocked"), ForwardLinkMgt.GetHelpCodeForBlockedItem());
- end;
- Database::"Purchase Line":
- if ItemVariant."Purchasing Blocked" then begin
- BlockedForSalesPurch := true;
- ErrorMessageMgt.LogMessage(
- MessageType, 0,
- StrSubstNo(IsPurchBlockedItemErr, ItemVariant.TableCaption(), StrSubstNo(ItemItemVariantLbl, ItemVariant."Item No.", ItemVariant.Code), ItemVariant.FieldCaption("Purchasing Blocked")),
- ItemVariant, ItemVariant.FieldNo("Purchasing Blocked"), ForwardLinkMgt.GetHelpCodeForBlockedItem());
- end;
- end;
- end;
- exit(BlockedForSalesPurch);
- end;
- "Sales Line Type"::Resource.AsInteger():
- if Resource.Get(EntityNo) then begin
- if Resource.Blocked then
- ErrorMessageMgt.LogMessage(
- MessageType, 0, StrSubstNo(IsBlockedErr, Resource.TableCaption(), Resource."No."), Resource, Resource.FieldNo(Blocked), '');
- exit(Resource.Blocked);
- end;
- "Sales Line Type"::"Fixed Asset".AsInteger():
- if FixedAsset.Get(EntityNo) then begin
- if FixedAsset.Blocked then
- ErrorMessageMgt.LogMessage(
- MessageType, 0, StrSubstNo(IsBlockedErr, FixedAsset.TableCaption(), FixedAsset."No."),
- FixedAsset, FixedAsset.FieldNo(Blocked), '')
- else
- if FixedAsset.Inactive then
- ErrorMessageMgt.LogMessage(
- MessageType, 0, StrSubstNo(FAIsInactiveErr, FixedAsset."No."), FixedAsset, FixedAsset.FieldNo(Inactive), '');
- exit(FixedAsset.Blocked or FixedAsset.Inactive);
- end;
- end;
- end;
-
- local procedure IsItemOrVariantBlocked(ItemNo: Code[20]; VariantCode: Code[10]): Boolean
- var
- Item: Record Item;
- ItemVariant: Record "Item Variant";
- begin
- if (Item.Get(ItemNo) and Item.Blocked) then
- exit(true);
- if VariantCode <> '' then begin
- ItemVariant.SetLoadFields(Blocked);
- exit(ItemVariant.Get(ItemNo, VariantCode) and ItemVariant.Blocked);
- end;
- end;
-
- local procedure IsSplitItemLedgEntry(OrgItemLedgEntry: Record "Item Ledger Entry"): Boolean
- var
- ItemLedgEntry: Record "Item Ledger Entry";
- begin
- ItemLedgEntry.SetCurrentKey("Document No.");
- ItemLedgEntry.SetRange("Document No.", OrgItemLedgEntry."Document No.");
- ItemLedgEntry.SetRange("Document Type", OrgItemLedgEntry."Document Type");
- ItemLedgEntry.SetRange("Document Line No.", OrgItemLedgEntry."Document Line No.");
- ItemLedgEntry.SetTrackingFilterFromItemLedgEntry(OrgItemLedgEntry);
- ItemLedgEntry.SetFilter("Entry No.", '<%1', OrgItemLedgEntry."Entry No.");
- OnIsSplitItemLedgEntryOnAfterItemLedgEntrySetFilters(ItemLedgEntry, OrgItemLedgEntry);
- exit(not ItemLedgEntry.IsEmpty());
- end;
-
- procedure IsCopyItemTrkg(var ItemLedgEntry: Record "Item Ledger Entry"; var CopyItemTrkg: Boolean; FillExactCostRevLink: Boolean) Result: Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeIsCopyItemTrkg(ItemLedgEntry, CopyItemTrkg, FillExactCostRevLink, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if ItemLedgEntry.IsEmpty() then
- exit(true);
- ItemLedgEntry.SetFilter("Serial No.", '<>%1', '');
- if not ItemLedgEntry.IsEmpty() then begin
- if FillExactCostRevLink then
- CopyItemTrkg := true;
- exit(true);
- end;
- ItemLedgEntry.SetRange("Serial No.");
- ItemLedgEntry.SetFilter("Lot No.", '<>%1', '');
- if not ItemLedgEntry.IsEmpty() then begin
- if FillExactCostRevLink then
- CopyItemTrkg := true;
- exit(true);
- end;
- ItemLedgEntry.SetRange("Lot No.");
-
- OnAfterIsCopyItemTrkg(ItemLedgEntry, FillExactCostRevLink, CopyItemTrkg, IsHandled);
- if IsHandled then
- exit(true);
-
- exit(false);
- end;
-
- local procedure InsertTempReservationEntry(ItemLedgEntry: Record "Item Ledger Entry"; var TempReservationEntry: Record "Reservation Entry"; QtyBase: Decimal; DocLineNo: Integer; var NextEntryNo: Integer; FillExactCostRevLink: Boolean)
- begin
- if QtyBase = 0 then
- exit;
-
- TempReservationEntry.Init();
- TempReservationEntry."Entry No." := NextEntryNo;
- NextEntryNo := NextEntryNo + 1;
- if not FillExactCostRevLink then
- TempReservationEntry."Reservation Status" := TempReservationEntry."Reservation Status"::Prospect;
- TempReservationEntry."Source ID" := ItemLedgEntry."Document No.";
- TempReservationEntry."Source Ref. No." := DocLineNo;
- TempReservationEntry."Item Ledger Entry No." := ItemLedgEntry."Entry No.";
- TempReservationEntry."Quantity (Base)" := QtyBase;
- OnInsertTempReservationEntryOnBeforeInsert(TempReservationEntry, ItemLedgEntry);
- TempReservationEntry.Insert();
- end;
-
- procedure GetLastToSalesLineNo(ToSalesHeader: Record "Sales Header"): Decimal
- var
- ToSalesLine: Record "Sales Line";
- begin
- ToSalesLine.LockTable();
- ToSalesLine.SetRange("Document Type", ToSalesHeader."Document Type");
- ToSalesLine.SetRange("Document No.", ToSalesHeader."No.");
- if ToSalesLine.FindLast() then
- exit(ToSalesLine."Line No.");
- exit(0);
- end;
-
- procedure GetLastToPurchLineNo(ToPurchHeader: Record "Purchase Header"): Decimal
- var
- ToPurchLine: Record "Purchase Line";
- begin
- ToPurchLine.LockTable();
- ToPurchLine.SetRange("Document Type", ToPurchHeader."Document Type");
- ToPurchLine.SetRange("Document No.", ToPurchHeader."No.");
- if ToPurchLine.FindLast() then
- exit(ToPurchLine."Line No.");
- exit(0);
- end;
-
- procedure InsertOldSalesDocNoLine(ToSalesHeader: Record "Sales Header"; OldDocNo: Code[20]; OldDocType: Integer; var NextLineNo: Integer)
- var
- ToSalesLine2: Record "Sales Line";
- ShouldIncrementNextLineNo: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInsertOldSalesDocNoLineProcedure(ToSalesHeader, ToSalesLine2, OldDocType, OldDocNo, IsHandled);
- if IsHandled then
- exit;
-
- if ShouldSkipCopyFromDescription() then
- exit;
-
- ShouldIncrementNextLineNo := true;
- OnInsertOldSalesDocNoLineOnBeforeIncrementNextLineNo(ToSalesHeader, ShouldIncrementNextLineNo, NextLineNo);
- if ShouldIncrementNextLineNo then
- NextLineNo := NextLineNo + 10000;
- ToSalesLine2.Init();
- ToSalesLine2."Line No." := NextLineNo;
- ToSalesLine2."Document Type" := ToSalesHeader."Document Type";
- ToSalesLine2."Document No." := ToSalesHeader."No.";
-
- TranslationHelper.SetGlobalLanguageByCode(ToSalesHeader."Language Code");
- if InsertCancellationLine then
- ToSalesLine2.Description := StrSubstNo(CrMemoCancellationMsg, OldDocNo)
- else
- ToSalesLine2.Description := StrSubstNo(Text015, SelectStr(OldDocType, Text013), OldDocNo);
- TranslationHelper.RestoreGlobalLanguage();
-
- IsHandled := false;
- OnBeforeInsertOldSalesDocNoLine(ToSalesHeader, ToSalesLine2, OldDocType, OldDocNo, NextLineNo, IsHandled);
- if not IsHandled then
- ToSalesLine2.Insert();
- end;
-
- local procedure ShouldSkipCopyFromDescription() Result: Boolean
- begin
- Result := SkipCopyFromDescription;
- OnAfterShouldSkipCopyFromDescription(Result);
- end;
-
- local procedure InsertOldSalesCombDocNoLine(ToSalesHeader: Record "Sales Header"; OldDocNo: Code[20]; OldDocNo2: Code[20]; var NextLineNo: Integer; CopyFromInvoice: Boolean)
- var
- ToSalesLine2: Record "Sales Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInsertOldSalesCombDocNoLineProcedure(ToSalesHeader, ToSalesLine2, CopyFromInvoice, OldDocNo, OldDocNo2, NextLineNo, IsHandled);
- if IsHandled then
- exit;
-
- NextLineNo := NextLineNo + 10000;
- ToSalesLine2.Init();
- ToSalesLine2."Line No." := NextLineNo;
- ToSalesLine2."Document Type" := ToSalesHeader."Document Type";
- ToSalesLine2."Document No." := ToSalesHeader."No.";
-
- TranslationHelper.SetGlobalLanguageByCode(ToSalesHeader."Language Code");
- if CopyFromInvoice then
- ToSalesLine2.Description :=
- StrSubstNo(
- Text018,
- CopyStr(SelectStr(1, Text016) + OldDocNo, 1, 48),
- CopyStr(SelectStr(2, Text016) + OldDocNo2, 1, 48))
- else
- ToSalesLine2.Description :=
- StrSubstNo(
- Text018,
- CopyStr(SelectStr(3, Text016) + OldDocNo, 1, 48),
- CopyStr(SelectStr(4, Text016) + OldDocNo2, 1, 48));
- TranslationHelper.RestoreGlobalLanguage();
-
- IsHandled := false;
- OnBeforeInsertOldSalesCombDocNoLine(ToSalesHeader, ToSalesLine2, CopyFromInvoice, OldDocNo, OldDocNo2, IsHandled);
- if not IsHandled then
- ToSalesLine2.Insert();
- end;
-
- local procedure InsertOldPurchDocNoLine(ToPurchHeader: Record "Purchase Header"; OldDocNo: Code[20]; OldDocType: Integer; var NextLineNo: Integer)
- var
- ToPurchLine2: Record "Purchase Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInsertOldPurchDocNoLineProcedure(ToPurchHeader, ToPurchLine2, OldDocType, OldDocNo, IsHandled);
- if IsHandled then
- exit;
-
- if ShouldSkipCopyFromDescription() then
- exit;
-
- NextLineNo := NextLineNo + 10000;
- ToPurchLine2.Init();
- ToPurchLine2."Line No." := NextLineNo;
- ToPurchLine2."Document Type" := ToPurchHeader."Document Type";
- ToPurchLine2."Document No." := ToPurchHeader."No.";
-
- TranslationHelper.SetGlobalLanguageByCode(ToPurchHeader."Language Code");
- if InsertCancellationLine then
- ToPurchLine2.Description := StrSubstNo(CrMemoCancellationMsg, OldDocNo)
- else
- ToPurchLine2.Description := StrSubstNo(Text015, SelectStr(OldDocType, Text014), OldDocNo);
- TranslationHelper.RestoreGlobalLanguage();
-
- IsHandled := false;
- OnBeforeInsertOldPurchDocNoLine(ToPurchHeader, ToPurchLine2, OldDocType, OldDocNo, NextLineNo, IsHandled);
- if not IsHandled then
- ToPurchLine2.Insert();
- end;
-
- local procedure InsertOldPurchCombDocNoLine(ToPurchHeader: Record "Purchase Header"; OldDocNo: Code[20]; OldDocNo2: Code[20]; var NextLineNo: Integer; CopyFromInvoice: Boolean)
- var
- ToPurchLine2: Record "Purchase Line";
- begin
- NextLineNo := NextLineNo + 10000;
- ToPurchLine2.Init();
- ToPurchLine2."Line No." := NextLineNo;
- ToPurchLine2."Document Type" := ToPurchHeader."Document Type";
- ToPurchLine2."Document No." := ToPurchHeader."No.";
-
- TranslationHelper.SetGlobalLanguageByCode(ToPurchHeader."Language Code");
- if CopyFromInvoice then
- ToPurchLine2.Description :=
- StrSubstNo(
- Text018,
- CopyStr(SelectStr(1, Text017) + OldDocNo, 1, 48),
- CopyStr(SelectStr(2, Text017) + OldDocNo2, 1, 48))
- else
- ToPurchLine2.Description :=
- StrSubstNo(
- Text018,
- CopyStr(SelectStr(3, Text017) + OldDocNo, 1, 48),
- CopyStr(SelectStr(4, Text017) + OldDocNo2, 1, 48));
- TranslationHelper.RestoreGlobalLanguage();
-
- OnBeforeInsertOldPurchCombDocNoLine(ToPurchHeader, ToPurchLine2, CopyFromInvoice, OldDocNo, OldDocNo2);
- ToPurchLine2.Insert();
- end;
-
- procedure IsSalesFillExactCostRevLink(ToSalesHeader: Record "Sales Header"; FromDocType: Option "Sales Shipment","Sales Invoice","Sales Return Receipt","Sales Credit Memo"; CurrencyCode: Code[10]) Result: Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeIsSalesFillExactCostRevLink(ToSalesHeader, FromDocType, CurrencyCode, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- case FromDocType of
- FromDocType::"Sales Shipment":
- exit(ToSalesHeader."Document Type" in [ToSalesHeader."Document Type"::"Return Order", ToSalesHeader."Document Type"::"Credit Memo"]);
- FromDocType::"Sales Invoice":
- exit(
- (ToSalesHeader."Document Type" in [ToSalesHeader."Document Type"::"Return Order", ToSalesHeader."Document Type"::"Credit Memo"]) and
- (ToSalesHeader."Currency Code" = CurrencyCode));
- FromDocType::"Sales Return Receipt":
- exit(ToSalesHeader."Document Type" in [ToSalesHeader."Document Type"::Order, ToSalesHeader."Document Type"::Invoice]);
- FromDocType::"Sales Credit Memo":
- exit(
- (ToSalesHeader."Document Type" in [ToSalesHeader."Document Type"::Order, ToSalesHeader."Document Type"::Invoice]) and
- (ToSalesHeader."Currency Code" = CurrencyCode));
- end;
- exit(false);
- end;
-
- procedure IsPurchFillExactCostRevLink(ToPurchHeader: Record "Purchase Header"; FromDocType: Option "Purchase Receipt","Purchase Invoice","Purchase Return Shipment","Purchase Credit Memo"; CurrencyCode: Code[10]) Result: Boolean
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeIsPurchFillExactCostRevLink(ToPurchHeader, FromDocType, CurrencyCode, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- case FromDocType of
- FromDocType::"Purchase Receipt":
- exit(ToPurchHeader."Document Type" in [ToPurchHeader."Document Type"::"Return Order", ToPurchHeader."Document Type"::"Credit Memo"]);
- FromDocType::"Purchase Invoice":
- exit(
- (ToPurchHeader."Document Type" in [ToPurchHeader."Document Type"::"Return Order", ToPurchHeader."Document Type"::"Credit Memo"]) and
- (ToPurchHeader."Currency Code" = CurrencyCode));
- FromDocType::"Purchase Return Shipment":
- exit(ToPurchHeader."Document Type" in [ToPurchHeader."Document Type"::Order, ToPurchHeader."Document Type"::Invoice]);
- FromDocType::"Purchase Credit Memo":
- exit(
- (ToPurchHeader."Document Type" in [ToPurchHeader."Document Type"::Order, ToPurchHeader."Document Type"::Invoice]) and
- (ToPurchHeader."Currency Code" = CurrencyCode));
- end;
- exit(false);
- end;
-
- local procedure GetSalesDocTypeForItemLedgEntry(ItemLedgEntry: Record "Item Ledger Entry"): Enum "Sales Document Type"
- begin
- case ItemLedgEntry."Document Type" of
- ItemLedgEntry."Document Type"::"Sales Shipment":
- exit("Sales Document Type"::Order);
- ItemLedgEntry."Document Type"::"Sales Invoice":
- exit("Sales Document Type"::Invoice);
- ItemLedgEntry."Document Type"::"Sales Credit Memo":
- exit("Sales Document Type"::"Credit Memo");
- ItemLedgEntry."Document Type"::"Sales Return Receipt":
- exit("Sales Document Type"::"Return Order");
- end;
- end;
-
- local procedure GetPurchDocTypeForItemLedgEntry(ItemLedgEntry: Record "Item Ledger Entry"): Enum "Purchase Document Type"
- begin
- case ItemLedgEntry."Document Type" of
- ItemLedgEntry."Document Type"::"Purchase Receipt":
- exit("Purchase Document Type"::Order);
- ItemLedgEntry."Document Type"::"Purchase Invoice":
- exit("Purchase Document Type"::Invoice);
- ItemLedgEntry."Document Type"::"Purchase Credit Memo":
- exit("Purchase Document Type"::"Credit Memo");
- ItemLedgEntry."Document Type"::"Purchase Return Shipment":
- exit("Purchase Document Type"::"Return Order");
- end;
- end;
-
- local procedure CalcVAT(var Value: Decimal; VATPercentage: Decimal; FromPricesInclVAT: Boolean; ToPricesInclVAT: Boolean; RndgPrecision: Decimal)
- begin
- if (ToPricesInclVAT = FromPricesInclVAT) or (Value = 0) then
- exit;
-
- if ToPricesInclVAT then
- Value := Round(Value * (100 + VATPercentage) / 100, RndgPrecision)
- else
- Value := Round(Value * 100 / (100 + VATPercentage), RndgPrecision);
- end;
-
- local procedure ReCalcSalesLine(FromSalesHeader: Record "Sales Header"; ToSalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line")
- var
- CurrExchRate: Record "Currency Exchange Rate";
- SalesLineAmount: Decimal;
- IsHandled: Boolean;
- begin
- if not IsRecalculateAmount(
- FromSalesHeader."Currency Code", ToSalesHeader."Currency Code",
- FromSalesHeader."Prices Including VAT", ToSalesHeader."Prices Including VAT")
- then
- exit;
-
- if FromSalesHeader."Currency Code" <> ToSalesHeader."Currency Code" then begin
- if SalesLine.Quantity <> 0 then
- SalesLineAmount := SalesLine."Unit Price" * SalesLine.Quantity
- else
- SalesLineAmount := SalesLine."Unit Price";
- if FromSalesHeader."Currency Code" <> '' then begin
- SalesLineAmount :=
- CurrExchRate.ExchangeAmtFCYToLCY(
- FromSalesHeader."Posting Date", FromSalesHeader."Currency Code",
- SalesLineAmount, FromSalesHeader."Currency Factor");
- SalesLine."Line Discount Amount" :=
- CurrExchRate.ExchangeAmtFCYToLCY(
- FromSalesHeader."Posting Date", FromSalesHeader."Currency Code",
- SalesLine."Line Discount Amount", FromSalesHeader."Currency Factor");
- SalesLine."Inv. Discount Amount" :=
- CurrExchRate.ExchangeAmtFCYToLCY(
- FromSalesHeader."Posting Date", FromSalesHeader."Currency Code",
- SalesLine."Inv. Discount Amount", FromSalesHeader."Currency Factor");
- end;
-
- if ToSalesHeader."Currency Code" <> '' then begin
- SalesLineAmount :=
- CurrExchRate.ExchangeAmtLCYToFCY(
- ToSalesHeader."Posting Date", ToSalesHeader."Currency Code", SalesLineAmount, ToSalesHeader."Currency Factor");
- SalesLine."Line Discount Amount" :=
- CurrExchRate.ExchangeAmtLCYToFCY(
- ToSalesHeader."Posting Date", ToSalesHeader."Currency Code", SalesLine."Line Discount Amount", ToSalesHeader."Currency Factor");
- SalesLine."Inv. Discount Amount" :=
- CurrExchRate.ExchangeAmtLCYToFCY(
- ToSalesHeader."Posting Date", ToSalesHeader."Currency Code", SalesLine."Inv. Discount Amount", ToSalesHeader."Currency Factor");
- end;
- end;
-
- IsHandled := false;
- OnRecalcSalesLineOnBeforeRoundUnitPrice(SalesLine, IsHandled);
- if not IsHandled then begin
- SalesLine."Currency Code" := ToSalesHeader."Currency Code";
- if SalesLine.Quantity <> 0 then begin
- SalesLineAmount := Round(SalesLineAmount, Currency."Amount Rounding Precision");
- SalesLine."Unit Price" := Round(SalesLineAmount / SalesLine.Quantity, Currency."Unit-Amount Rounding Precision");
- end else
- SalesLine."Unit Price" := Round(SalesLineAmount, Currency."Unit-Amount Rounding Precision");
- end;
- SalesLine."Line Discount Amount" := Round(SalesLine."Line Discount Amount", Currency."Amount Rounding Precision");
- SalesLine."Inv. Discount Amount" := Round(SalesLine."Inv. Discount Amount", Currency."Amount Rounding Precision");
-
- IsHandled := false;
- OnReCalcSalesLineOnBeforeCalcVAT(FromSalesHeader, ToSalesHeader, SalesLine, IsHandled);
- if not IsHandled then begin
- CalcVAT(
- SalesLine."Unit Price", SalesLine."VAT %", FromSalesHeader."Prices Including VAT",
- ToSalesHeader."Prices Including VAT", Currency."Unit-Amount Rounding Precision");
- CalcVAT(
- SalesLine."Line Discount Amount", SalesLine."VAT %", FromSalesHeader."Prices Including VAT",
- ToSalesHeader."Prices Including VAT", Currency."Amount Rounding Precision");
- CalcVAT(
- SalesLine."Inv. Discount Amount", SalesLine."VAT %", FromSalesHeader."Prices Including VAT",
- ToSalesHeader."Prices Including VAT", Currency."Amount Rounding Precision");
- end;
- end;
-
- local procedure ReCalcPurchLine(FromPurchHeader: Record "Purchase Header"; ToPurchHeader: Record "Purchase Header"; var PurchLine: Record "Purchase Line")
- var
- CurrExchRate: Record "Currency Exchange Rate";
- PurchLineAmount: Decimal;
- begin
- if not IsRecalculateAmount(
- FromPurchHeader."Currency Code", ToPurchHeader."Currency Code",
- FromPurchHeader."Prices Including VAT", ToPurchHeader."Prices Including VAT")
- then
- exit;
-
- if FromPurchHeader."Currency Code" <> ToPurchHeader."Currency Code" then begin
- if PurchLine.Quantity <> 0 then
- PurchLineAmount := PurchLine."Direct Unit Cost" * PurchLine.Quantity
- else
- PurchLineAmount := PurchLine."Direct Unit Cost";
- if FromPurchHeader."Currency Code" <> '' then begin
- PurchLineAmount :=
- CurrExchRate.ExchangeAmtFCYToLCY(
- FromPurchHeader."Posting Date", FromPurchHeader."Currency Code",
- PurchLineAmount, FromPurchHeader."Currency Factor");
- PurchLine."Line Discount Amount" :=
- CurrExchRate.ExchangeAmtFCYToLCY(
- FromPurchHeader."Posting Date", FromPurchHeader."Currency Code",
- PurchLine."Line Discount Amount", FromPurchHeader."Currency Factor");
- PurchLine."Inv. Discount Amount" :=
- CurrExchRate.ExchangeAmtFCYToLCY(
- FromPurchHeader."Posting Date", FromPurchHeader."Currency Code",
- PurchLine."Inv. Discount Amount", FromPurchHeader."Currency Factor");
- end;
-
- if ToPurchHeader."Currency Code" <> '' then begin
- PurchLineAmount :=
- CurrExchRate.ExchangeAmtLCYToFCY(
- ToPurchHeader."Posting Date", ToPurchHeader."Currency Code", PurchLineAmount, ToPurchHeader."Currency Factor");
- PurchLine."Line Discount Amount" :=
- CurrExchRate.ExchangeAmtLCYToFCY(
- ToPurchHeader."Posting Date", ToPurchHeader."Currency Code", PurchLine."Line Discount Amount", ToPurchHeader."Currency Factor");
- PurchLine."Inv. Discount Amount" :=
- CurrExchRate.ExchangeAmtLCYToFCY(
- ToPurchHeader."Posting Date", ToPurchHeader."Currency Code", PurchLine."Inv. Discount Amount", ToPurchHeader."Currency Factor");
- end;
- end;
-
- PurchLine."Currency Code" := ToPurchHeader."Currency Code";
- if PurchLine.Quantity <> 0 then begin
- PurchLineAmount := Round(PurchLineAmount, Currency."Amount Rounding Precision");
- PurchLine."Direct Unit Cost" := Round(PurchLineAmount / PurchLine.Quantity, Currency."Unit-Amount Rounding Precision");
- end else
- PurchLine."Direct Unit Cost" := Round(PurchLineAmount, Currency."Unit-Amount Rounding Precision");
- PurchLine."Line Discount Amount" := Round(PurchLine."Line Discount Amount", Currency."Amount Rounding Precision");
- PurchLine."Inv. Discount Amount" := Round(PurchLine."Inv. Discount Amount", Currency."Amount Rounding Precision");
-
- OnReCalcPurchLineOnBeforeCalcVAT(FromPurchHeader, ToPurchHeader, PurchLine);
- CalcVAT(
- PurchLine."Direct Unit Cost", PurchLine."VAT %", FromPurchHeader."Prices Including VAT",
- ToPurchHeader."Prices Including VAT", Currency."Unit-Amount Rounding Precision");
- CalcVAT(
- PurchLine."Line Discount Amount", PurchLine."VAT %", FromPurchHeader."Prices Including VAT",
- ToPurchHeader."Prices Including VAT", Currency."Amount Rounding Precision");
- CalcVAT(
- PurchLine."Inv. Discount Amount", PurchLine."VAT %", FromPurchHeader."Prices Including VAT",
- ToPurchHeader."Prices Including VAT", Currency."Amount Rounding Precision");
- end;
-
- procedure IsRecalculateAmount(FromCurrencyCode: Code[10]; ToCurrencyCode: Code[10]; FromPricesInclVAT: Boolean; ToPricesInclVAT: Boolean): Boolean
- begin
- exit(
- (FromCurrencyCode <> ToCurrencyCode) or
- (FromPricesInclVAT <> ToPricesInclVAT));
- end;
-
- local procedure UpdateRevSalesLineAmount(var SalesLine: Record "Sales Line"; OrgQtyBase: Decimal; FromPricesInclVAT: Boolean; ToPricesInclVAT: Boolean)
- var
- Amount: Decimal;
- begin
- if (OrgQtyBase = 0) or (SalesLine.Quantity = 0) or
- ((FromPricesInclVAT = ToPricesInclVAT) and (OrgQtyBase = SalesLine."Quantity (Base)"))
- then
- exit;
-
- Amount := SalesLine.Quantity * SalesLine."Unit Price";
- CalcVAT(
- Amount, SalesLine."VAT %", FromPricesInclVAT, ToPricesInclVAT, Currency."Amount Rounding Precision");
- SalesLine."Unit Price" := Amount / SalesLine.Quantity;
- SalesLine."Line Discount Amount" :=
- Round(
- Round(SalesLine.Quantity * SalesLine."Unit Price", Currency."Amount Rounding Precision") *
- SalesLine."Line Discount %" / 100,
- Currency."Amount Rounding Precision");
- Amount :=
- Round(SalesLine."Inv. Discount Amount" / OrgQtyBase * SalesLine."Quantity (Base)", Currency."Amount Rounding Precision");
- CalcVAT(
- Amount, SalesLine."VAT %", FromPricesInclVAT, ToPricesInclVAT, Currency."Amount Rounding Precision");
- SalesLine."Inv. Discount Amount" := Amount;
-
- OnAfterUpdateRevSalesLineAmount(SalesLine, OrgQtyBase, FromPricesInclVAT, ToPricesInclVAT);
- end;
-
- procedure CalculateRevSalesLineAmount(var SalesLine: Record "Sales Line"; OrgQtyBase: Decimal; FromPricesInclVAT: Boolean; ToPricesInclVAT: Boolean)
- var
- UnitPrice: Decimal;
- LineDiscAmt: Decimal;
- InvDiscAmt: Decimal;
- begin
- UpdateRevSalesLineAmount(SalesLine, OrgQtyBase, FromPricesInclVAT, ToPricesInclVAT);
-
- UnitPrice := SalesLine."Unit Price";
- LineDiscAmt := SalesLine."Line Discount Amount";
- InvDiscAmt := SalesLine."Inv. Discount Amount";
-
- SalesLine.Validate("Unit Price", UnitPrice);
- SalesLine.Validate("Line Discount Amount", LineDiscAmt);
- SalesLine.Validate("Inv. Discount Amount", InvDiscAmt);
- end;
-
- local procedure UpdateRevPurchLineAmount(var PurchLine: Record "Purchase Line"; OrgQtyBase: Decimal; FromPricesInclVAT: Boolean; ToPricesInclVAT: Boolean)
- var
- Amount: Decimal;
- begin
- if (OrgQtyBase = 0) or (PurchLine.Quantity = 0) or
- ((FromPricesInclVAT = ToPricesInclVAT) and (OrgQtyBase = PurchLine."Quantity (Base)"))
- then
- exit;
-
- Amount := PurchLine.Quantity * PurchLine."Direct Unit Cost";
- CalcVAT(
- Amount, PurchLine."VAT %", FromPricesInclVAT, ToPricesInclVAT, Currency."Amount Rounding Precision");
- PurchLine."Direct Unit Cost" := Amount / PurchLine.Quantity;
- PurchLine."Line Discount Amount" :=
- Round(
- Round(PurchLine.Quantity * PurchLine."Direct Unit Cost", Currency."Amount Rounding Precision") *
- PurchLine."Line Discount %" / 100,
- Currency."Amount Rounding Precision");
- Amount :=
- Round(PurchLine."Inv. Discount Amount" / Abs(OrgQtyBase) * PurchLine."Quantity (Base)", Currency."Amount Rounding Precision");
- CalcVAT(
- Amount, PurchLine."VAT %", FromPricesInclVAT, ToPricesInclVAT, Currency."Amount Rounding Precision");
- PurchLine."Inv. Discount Amount" := Amount;
-
- OnAfterUpdateRevPurchLineAmount(PurchLine, OrgQtyBase, FromPricesInclVAT, ToPricesInclVAT);
- end;
-
- procedure CalculateRevPurchLineAmount(var PurchLine: Record "Purchase Line"; OrgQtyBase: Decimal; FromPricesInclVAT: Boolean; ToPricesInclVAT: Boolean)
- var
- DirectUnitCost: Decimal;
- LineDiscAmt: Decimal;
- InvDiscAmt: Decimal;
- begin
- UpdateRevPurchLineAmount(PurchLine, OrgQtyBase, FromPricesInclVAT, ToPricesInclVAT);
-
- DirectUnitCost := PurchLine."Direct Unit Cost";
- LineDiscAmt := PurchLine."Line Discount Amount";
- InvDiscAmt := PurchLine."Inv. Discount Amount";
-
- PurchLine.Validate("Direct Unit Cost", DirectUnitCost);
- PurchLine.Validate("Line Discount Amount", LineDiscAmt);
- PurchLine.Validate("Inv. Discount Amount", InvDiscAmt);
- end;
-
- local procedure InitCurrency(CurrencyCode: Code[10])
- begin
- if CurrencyCode <> '' then
- Currency.Get(CurrencyCode)
- else
- Currency.InitRoundingPrecision();
-
- Currency.TestField("Unit-Amount Rounding Precision");
- Currency.TestField("Amount Rounding Precision");
- end;
-
- procedure SetHideProcessWindow(NewHideProcessWindow: Boolean)
- begin
- HideProcessWindow := NewHideProcessWindow;
- end;
-
- local procedure OpenWindow()
- begin
- if not HideProcessWindow then begin
- Window.Open(
- Text022 +
- Text023 +
- Text024);
- WindowUpdateDateTime := CurrentDateTime;
- end;
- end;
-
- local procedure CloseWindow()
- begin
- if not HideProcessWindow then
- Window.Close();
- end;
-
- local procedure UpdateWindow(Number: Integer; CounterValue: Integer)
- begin
- if not HideProcessWindow then
- Window.Update(Number, CounterValue);
- end;
-
- procedure IsTimeForUpdate(): Boolean
- begin
- if HideProcessWindow then
- exit(false);
-
- if CurrentDateTime - WindowUpdateDateTime >= 1000 then begin
- WindowUpdateDateTime := CurrentDateTime;
- exit(true);
- end;
- exit(false);
- end;
-
- local procedure ConfirmApply()
- begin
- AskApply := false;
- ApplyFully := false;
- end;
-
- local procedure ConvertFromBase(var Quantity: Decimal; QuantityBase: Decimal; QtyPerUOM: Decimal)
- begin
- if QtyPerUOM = 0 then
- Quantity := QuantityBase
- else
- Quantity := Round(QuantityBase / QtyPerUOM, UOMMgt.QtyRndPrecision());
- end;
-
- local procedure Sign(Quantity: Decimal): Decimal
- begin
- if Quantity < 0 then
- exit(-1);
- exit(1);
- end;
-
- procedure ShowMessageReapply(OriginalQuantity: Boolean)
- var
- Text: Text[1024];
- begin
- Text := '';
- if SkippedLine then
- Text := Text029;
- if OriginalQuantity and ReappDone then
- if Text = '' then
- Text := Text025;
- if SomeAreFixed then
- Message(Text031);
- if Text <> '' then
- Message(Text);
- end;
-
- procedure LinkJobPlanningLine(SalesHeader: Record "Sales Header")
- var
- SalesLine: Record "Sales Line";
- JobPlanningLine: Record "Job Planning Line";
- JobPlanningLineInvoice: Record "Job Planning Line Invoice";
- begin
- JobPlanningLine.SetCurrentKey("Job Contract Entry No.");
- SalesLine.SetRange("Document Type", SalesHeader."Document Type");
- SalesLine.SetRange("Document No.", SalesHeader."No.");
- repeat
- JobPlanningLine.SetRange("Job Contract Entry No.", SalesLine."Job Contract Entry No.");
- if JobPlanningLine.FindFirst() then begin
- JobPlanningLineInvoice."Job No." := JobPlanningLine."Job No.";
- JobPlanningLineInvoice."Job Task No." := JobPlanningLine."Job Task No.";
- JobPlanningLineInvoice."Job Planning Line No." := JobPlanningLine."Line No.";
- case SalesHeader."Document Type" of
- SalesHeader."Document Type"::Invoice:
- begin
- JobPlanningLineInvoice."Document Type" := JobPlanningLineInvoice."Document Type"::Invoice;
- JobPlanningLineInvoice."Quantity Transferred" := SalesLine.Quantity;
- end;
- SalesHeader."Document Type"::"Credit Memo":
- begin
- JobPlanningLineInvoice."Document Type" := JobPlanningLineInvoice."Document Type"::"Credit Memo";
- JobPlanningLineInvoice."Quantity Transferred" := -SalesLine.Quantity;
- end;
- else
- exit;
- end;
- JobPlanningLineInvoice."Document No." := SalesHeader."No.";
- JobPlanningLineInvoice."Line No." := SalesLine."Line No.";
- JobPlanningLineInvoice."Transferred Date" := SalesHeader."Posting Date";
- JobPlanningLineInvoice.Insert();
-
- JobPlanningLine.UpdateQtyToTransfer();
- JobPlanningLine.Modify();
- OnLinkJobPlanningLineOnAfterJobPlanningLineModify(JobPlanningLineInvoice, JobPlanningLine);
- end;
- until SalesLine.Next() = 0;
- end;
-
- local procedure GetQtyOfPurchILENotShipped(ItemLedgerEntryNo: Integer; FromPurchLine: Record "Purchase Line"): Decimal
- var
- ItemApplicationEntry: Record "Item Application Entry";
- ItemLedgerEntryLocal: Record "Item Ledger Entry";
- QtyNotShipped: Decimal;
- begin
- QtyNotShipped := 0;
- ItemApplicationEntry.Reset();
- ItemApplicationEntry.SetCurrentKey("Inbound Item Entry No.", "Outbound Item Entry No.");
- ItemApplicationEntry.SetRange("Inbound Item Entry No.", ItemLedgerEntryNo);
- ItemApplicationEntry.SetRange("Outbound Item Entry No.", 0);
- if not ItemApplicationEntry.FindFirst() then
- exit(QtyNotShipped);
- QtyNotShipped := ItemApplicationEntry.Quantity;
- ItemApplicationEntry.SetFilter("Outbound Item Entry No.", '<>0');
- if not ItemApplicationEntry.FindSet(false) then begin
- if FromPurchLine."Copied From Posted Doc." and (FromPurchLine."Receipt No." <> '') then begin
- ItemLedgerEntryLocal.SetLoadFields("Invoiced Quantity");
- ItemLedgerEntryLocal.Get(ItemLedgerEntryNo);
- if Abs(ItemLedgerEntryLocal."Invoiced Quantity") < Abs(QtyNotShipped) then
- QtyNotShipped := ItemLedgerEntryLocal."Invoiced Quantity";
- end;
- exit(QtyNotShipped);
- end;
- repeat
- ItemLedgerEntryLocal.Get(ItemApplicationEntry."Outbound Item Entry No.");
- if (ItemLedgerEntryLocal."Entry Type" in
- [ItemLedgerEntryLocal."Entry Type"::Sale,
- ItemLedgerEntryLocal."Entry Type"::Purchase]) or
- ((ItemLedgerEntryLocal."Entry Type" in
- [ItemLedgerEntryLocal."Entry Type"::"Positive Adjmt.", ItemLedgerEntryLocal."Entry Type"::"Negative Adjmt."]) and
- (ItemLedgerEntryLocal."Job No." = ''))
- then
- QtyNotShipped += ItemApplicationEntry.Quantity;
- until ItemApplicationEntry.Next() = 0;
- exit(QtyNotShipped);
- end;
-
- local procedure CopyAsmOrderToAsmOrder(var TempFromAsmHeader: Record "Assembly Header" temporary; var TempFromAsmLine: Record "Assembly Line" temporary; ToSalesLine: Record "Sales Line"; ToAsmHeaderDocType: Option; ToAsmHeaderDocNo: Code[20]; InclAsmHeader: Boolean)
- var
- FromAsmHeader: Record "Assembly Header";
- ToAsmHeader: Record "Assembly Header";
- TempToAsmHeader: Record "Assembly Header" temporary;
- AssembleToOrderLink: Record "Assemble-to-Order Link";
- ToAsmLine: Record "Assembly Line";
- BasicAsmOrderCopy: Boolean;
- begin
- OnBeforeCopyAsmOrderToAsmOrderProcedure(TempFromAsmHeader, TempFromAsmLine, ToSalesLine, ToAsmHeaderDocType, ToAsmHeaderDocNo, InclAsmHeader);
- if ToAsmHeaderDocType = -1 then
- exit;
- BasicAsmOrderCopy := ToAsmHeaderDocNo <> '';
- if BasicAsmOrderCopy then
- ToAsmHeader.Get(ToAsmHeaderDocType, ToAsmHeaderDocNo)
- else begin
- if ToSalesLine.AsmToOrderExists(FromAsmHeader) then
- exit;
- Clear(ToAsmHeader);
- AssembleToOrderLink.InsertAsmHeader(ToAsmHeader, "Assembly Document Type".FromInteger(ToAsmHeaderDocType), '');
- InclAsmHeader := true;
- end;
-
- if InclAsmHeader then begin
- if BasicAsmOrderCopy then begin
- TempToAsmHeader := ToAsmHeader;
- TempToAsmHeader.Insert();
- ProcessToAsmHeader(TempToAsmHeader, TempFromAsmHeader, ToSalesLine, true, true); // Basic, Availabilitycheck
- CheckAsmOrderAvailability(TempToAsmHeader, TempFromAsmLine, ToSalesLine);
- end;
- ProcessToAsmHeader(ToAsmHeader, TempFromAsmHeader, ToSalesLine, BasicAsmOrderCopy, false);
- end else
- if BasicAsmOrderCopy then
- CheckAsmOrderAvailability(ToAsmHeader, TempFromAsmLine, ToSalesLine);
- CreateToAsmLines(ToAsmHeader, TempFromAsmLine, ToAsmLine, ToSalesLine, BasicAsmOrderCopy, false);
- if not BasicAsmOrderCopy then begin
- AssembleToOrderLink."Assembly Document Type" := ToAsmHeader."Document Type";
- AssembleToOrderLink."Assembly Document No." := ToAsmHeader."No.";
- AssembleToOrderLink.Type := AssembleToOrderLink.Type::Sale;
- AssembleToOrderLink."Document Type" := ToSalesLine."Document Type";
- AssembleToOrderLink."Document No." := ToSalesLine."Document No.";
- AssembleToOrderLink."Document Line No." := ToSalesLine."Line No.";
- AssembleToOrderLink.Insert();
- if ToSalesLine."Document Type" = ToSalesLine."Document Type"::Order then begin
- if ToSalesLine."Shipment Date" = 0D then begin
- ToSalesLine."Shipment Date" := ToAsmHeader."Due Date";
- OnCopyAsmOrderToAsmOrderOnBeforeModifySalesLine(ToSalesLine);
- ToSalesLine.Modify();
- end;
- AssembleToOrderLink.ReserveAsmToSale(ToSalesLine, ToSalesLine.Quantity, ToSalesLine."Quantity (Base)");
- end;
- end;
-
- ToAsmHeader.ShowDueDateBeforeWorkDateMsg();
- end;
-
- procedure CopyAsmHeaderToAsmHeader(FromAsmHeader: Record "Assembly Header"; ToAsmHeader: Record "Assembly Header"; IncludeHeader: Boolean)
- var
- EmptyToSalesLine: Record "Sales Line";
- begin
- InitialToAsmHeaderCheck(ToAsmHeader, IncludeHeader);
- GenerateAsmDataFromNonPosted(FromAsmHeader);
- Clear(EmptyToSalesLine);
- EmptyToSalesLine.Init();
- CopyAsmOrderToAsmOrder(
- TempAsmHeader, TempAsmLine, EmptyToSalesLine, ToAsmHeader."Document Type".AsInteger(), ToAsmHeader."No.", IncludeHeader);
- end;
-
- procedure CopyPostedAsmHeaderToAsmHeader(PostedAsmHeader: Record "Posted Assembly Header"; ToAsmHeader: Record "Assembly Header"; IncludeHeader: Boolean)
- var
- EmptyToSalesLine: Record "Sales Line";
- begin
- InitialToAsmHeaderCheck(ToAsmHeader, IncludeHeader);
- GenerateAsmDataFromPosted(PostedAsmHeader, "Assembly Document Type"::Quote);
- Clear(EmptyToSalesLine);
- EmptyToSalesLine.Init();
- CopyAsmOrderToAsmOrder(
- TempAsmHeader, TempAsmLine, EmptyToSalesLine, ToAsmHeader."Document Type".AsInteger(), ToAsmHeader."No.", IncludeHeader);
- end;
-
- local procedure GenerateAsmDataFromNonPosted(AsmHeader: Record "Assembly Header")
- var
- AsmLine: Record "Assembly Line";
- begin
- InitAsmCopyHandling(false);
- TempAsmHeader := AsmHeader;
- TempAsmHeader.Insert();
- AsmLine.SetRange("Document Type", AsmHeader."Document Type");
- AsmLine.SetRange("Document No.", AsmHeader."No.");
- if AsmLine.FindSet() then
- repeat
- TempAsmLine := AsmLine;
- TempAsmLine.Insert();
- until AsmLine.Next() = 0;
- end;
-
- local procedure GenerateAsmDataFromPosted(PostedAssemblyHeader: Record "Posted Assembly Header"; DocType: Enum "Assembly Document Type")
- var
- PostedAsmLine: Record "Posted Assembly Line";
- begin
- InitAsmCopyHandling(false);
- TempAsmHeader.TransferFields(PostedAssemblyHeader);
- OnAfterTransferTempAsmHeader(TempAsmHeader, PostedAssemblyHeader);
- TempAsmHeader."Document Type" := DocType;
- TempAsmHeader.Insert();
- PostedAsmLine.SetRange("Document No.", PostedAssemblyHeader."No.");
- if PostedAsmLine.FindSet() then
- repeat
- TempAsmLine.TransferFields(PostedAsmLine);
- TempAsmLine."Document No." := TempAsmHeader."No.";
- TempAsmLine."Cost Amount" := PostedAsmLine.Quantity * PostedAsmLine."Unit Cost";
- TempAsmLine.Insert();
- until PostedAsmLine.Next() = 0;
- end;
-
- local procedure GetAsmDataFromSalesInvLine(DocType: Enum "Sales Document Type"): Boolean
- var
- ValueEntry: Record "Value Entry";
- ValueEntry2: Record "Value Entry";
- ItemLedgerEntry: Record "Item Ledger Entry";
- ItemLedgerEntry2: Record "Item Ledger Entry";
- SalesShipmentLine: Record "Sales Shipment Line";
- PostedAssemblyHeader: Record "Posted Assembly Header";
- begin
- if TempSalesInvLine.Type <> TempSalesInvLine.Type::Item then
- exit(false);
- ValueEntry.SetCurrentKey("Document No.");
- ValueEntry.SetRange("Document No.", TempSalesInvLine."Document No.");
- ValueEntry.SetRange("Document Type", ValueEntry."Document Type"::"Sales Invoice");
- ValueEntry.SetRange("Document Line No.", TempSalesInvLine."Line No.");
- if not ValueEntry.FindFirst() then
- exit(false);
- if not ItemLedgerEntry.Get(ValueEntry."Item Ledger Entry No.") then
- exit(false);
- if ItemLedgerEntry."Document Type" <> ItemLedgerEntry."Document Type"::"Sales Shipment" then
- exit(false);
- SalesShipmentLine.Get(ItemLedgerEntry."Document No.", ItemLedgerEntry."Document Line No.");
- if not SalesShipmentLine.AsmToShipmentExists(PostedAssemblyHeader) then
- exit(false);
- if ValueEntry.Count > 1 then begin
- ValueEntry2.Copy(ValueEntry);
- ValueEntry2.SetFilter("Item Ledger Entry No.", '<>%1', ValueEntry."Item Ledger Entry No.");
- if ValueEntry2.FindSet() then
- repeat
- ItemLedgerEntry2.Get(ValueEntry2."Item Ledger Entry No.");
- if (ItemLedgerEntry2."Document Type" <> ItemLedgerEntry."Document Type") or
- (ItemLedgerEntry2."Document No." <> ItemLedgerEntry."Document No.") or
- (ItemLedgerEntry2."Document Line No." <> ItemLedgerEntry."Document Line No.")
- then
- Error(Text032, TempSalesInvLine."Document No.");
- until ValueEntry2.Next() = 0;
- end;
- GenerateAsmDataFromPosted(PostedAssemblyHeader, DocType);
- exit(true);
- end;
-
- procedure InitAsmCopyHandling(ResetQuantities: Boolean)
- begin
- if ResetQuantities then begin
- QtyToAsmToOrder := 0;
- QtyToAsmToOrderBase := 0;
- end;
- TempAsmHeader.DeleteAll();
- TempAsmLine.DeleteAll();
- end;
-
- local procedure RetrieveSalesInvLine(SalesLine: Record "Sales Line"; PosNo: Integer; LineCountsEqual: Boolean): Boolean
- begin
- if not LineCountsEqual then
- exit(false);
- TempSalesInvLine.FindSet();
- if PosNo > 1 then
- TempSalesInvLine.Next(PosNo - 1);
- exit((SalesLine.Type = TempSalesInvLine.Type) and (SalesLine."No." = TempSalesInvLine."No."));
- end;
-
- procedure InitialToAsmHeaderCheck(ToAsmHeader: Record "Assembly Header"; IncludeHeader: Boolean)
- begin
- ToAsmHeader.TestField("No.");
- if IncludeHeader then begin
- ToAsmHeader.TestField("Item No.", '');
- ToAsmHeader.TestField(Quantity, 0);
- end else begin
- ToAsmHeader.TestField("Item No.");
- ToAsmHeader.TestField(Quantity);
- end;
- end;
-
- local procedure GetAsmOrderType(SalesLineDocType: Enum "Sales Document Type"): Integer
- begin
- if SalesLineDocType in [SalesLineDocType::Quote, SalesLineDocType::Order, SalesLineDocType::"Blanket Order"] then
- exit(SalesLineDocType.AsInteger());
- exit(-1);
- end;
-
- local procedure ProcessToAsmHeader(var ToAsmHeader: Record "Assembly Header"; TempFromAsmHeader: Record "Assembly Header" temporary; ToSalesLine: Record "Sales Line"; BasicAsmOrderCopy: Boolean; AvailabilityCheck: Boolean)
- begin
- if AvailabilityCheck then begin
- ToAsmHeader."Item No." := TempFromAsmHeader."Item No.";
- ToAsmHeader."Location Code" := TempFromAsmHeader."Location Code";
- ToAsmHeader."Variant Code" := TempFromAsmHeader."Variant Code";
- ToAsmHeader."Unit of Measure Code" := TempFromAsmHeader."Unit of Measure Code";
- end else begin
- ToAsmHeader.Validate(ToAsmHeader."Item No.", TempFromAsmHeader."Item No.");
- ToAsmHeader.Validate(ToAsmHeader."Location Code", TempFromAsmHeader."Location Code");
- ToAsmHeader.Validate(ToAsmHeader."Variant Code", TempFromAsmHeader."Variant Code");
- ToAsmHeader.Validate(ToAsmHeader."Unit of Measure Code", TempFromAsmHeader."Unit of Measure Code");
- end;
- if BasicAsmOrderCopy then begin
- ToAsmHeader.Validate(ToAsmHeader."Due Date", TempFromAsmHeader."Due Date");
- ToAsmHeader.Quantity := TempFromAsmHeader.Quantity;
- ToAsmHeader."Quantity (Base)" := TempFromAsmHeader."Quantity (Base)";
- end else begin
- if ToSalesLine."Shipment Date" <> 0D then
- ToAsmHeader.Validate(ToAsmHeader."Due Date", ToSalesLine."Shipment Date");
- ToAsmHeader.Quantity := QtyToAsmToOrder;
- ToAsmHeader."Quantity (Base)" := QtyToAsmToOrderBase;
- end;
- OnProcessToAsmHeaderOnAfterValidateQty(ToAsmHeader, TempFromAsmHeader, ToSalesLine, BasicAsmOrderCopy, AvailabilityCheck);
- ToAsmHeader."Bin Code" := TempFromAsmHeader."Bin Code";
- ToAsmHeader."Unit Cost" := TempFromAsmHeader."Unit Cost";
- ToAsmHeader.RoundQty(ToAsmHeader.Quantity);
- ToAsmHeader.RoundQty(ToAsmHeader."Quantity (Base)");
- ToAsmHeader."Cost Amount" := Round(ToAsmHeader.Quantity * ToAsmHeader."Unit Cost");
- ToAsmHeader.InitRemainingQty();
- ToAsmHeader.InitQtyToAssemble();
- if not AvailabilityCheck then begin
- ToAsmHeader.Validate(ToAsmHeader."Quantity to Assemble");
- ToAsmHeader.Validate(ToAsmHeader."Planning Flexibility", TempFromAsmHeader."Planning Flexibility");
- end;
- CopyFromAsmOrderDimToHdr(ToAsmHeader, TempFromAsmHeader, ToSalesLine);
- ToAsmHeader.Modify();
-
- OnAfterProcessToAsmHeader(ToAsmHeader, TempFromAsmHeader, ToSalesLine, BasicAsmOrderCopy, AvailabilityCheck);
- end;
-
- local procedure CreateToAsmLines(ToAsmHeader: Record "Assembly Header"; var FromAsmLine: Record "Assembly Line"; var ToAssemblyLine: Record "Assembly Line"; ToSalesLine: Record "Sales Line"; BasicAsmOrderCopy: Boolean; AvailabilityCheck: Boolean)
- var
- AssemblyLineMgt: Codeunit "Assembly Line Management";
- begin
- if FromAsmLine.FindSet() then
- repeat
- ToAssemblyLine.Init();
- ToAssemblyLine."Document Type" := ToAsmHeader."Document Type";
- ToAssemblyLine."Document No." := ToAsmHeader."No.";
- ToAssemblyLine."Line No." := AssemblyLineMgt.GetNextAsmLineNo(ToAssemblyLine, AvailabilityCheck);
- ToAssemblyLine.Insert(not AvailabilityCheck);
- if AvailabilityCheck then begin
- ToAssemblyLine.Type := FromAsmLine.Type;
- ToAssemblyLine."No." := FromAsmLine."No.";
- ToAssemblyLine."Resource Usage Type" := FromAsmLine."Resource Usage Type";
- ToAssemblyLine."Unit of Measure Code" := FromAsmLine."Unit of Measure Code";
- ToAssemblyLine."Quantity per" := FromAsmLine."Quantity per";
- ToAssemblyLine.Quantity := GetAppliedQuantityForAsmLine(BasicAsmOrderCopy, ToAsmHeader, FromAsmLine, ToSalesLine);
- end else begin
- ToAssemblyLine.Validate(Type, FromAsmLine.Type);
- ToAssemblyLine.Validate("No.", FromAsmLine."No.");
- ToAssemblyLine.Validate("Resource Usage Type", FromAsmLine."Resource Usage Type");
- ToAssemblyLine.Validate("Unit of Measure Code", FromAsmLine."Unit of Measure Code");
- if ToAssemblyLine.Type <> ToAssemblyLine.Type::" " then
- ToAssemblyLine.Validate("Quantity per", FromAsmLine."Quantity per");
- ToAssemblyLine.Validate(Quantity, GetAppliedQuantityForAsmLine(BasicAsmOrderCopy, ToAsmHeader, FromAsmLine, ToSalesLine));
- end;
- OnCreateToAsmLinesOnAfterValidateQty(ToAsmHeader, FromAsmLine, ToAssemblyLine, ToSalesLine, BasicAsmOrderCopy, AvailabilityCheck);
- ToAssemblyLine.ValidateDueDate(ToAsmHeader, ToAsmHeader."Starting Date", false);
- ToAssemblyLine.ValidateLeadTimeOffset(ToAsmHeader, FromAsmLine."Lead-Time Offset", false);
- ToAssemblyLine.Description := FromAsmLine.Description;
- ToAssemblyLine."Description 2" := FromAsmLine."Description 2";
- ToAssemblyLine.Position := FromAsmLine.Position;
- ToAssemblyLine."Position 2" := FromAsmLine."Position 2";
- ToAssemblyLine."Position 3" := FromAsmLine."Position 3";
- if ToAssemblyLine.Type = ToAssemblyLine.Type::Item then
- if AvailabilityCheck then begin
- ToAssemblyLine."Location Code" := FromAsmLine."Location Code";
- ToAssemblyLine."Variant Code" := FromAsmLine."Variant Code";
- end else begin
- ToAssemblyLine.Validate("Location Code", FromAsmLine."Location Code");
- ToAssemblyLine.Validate("Variant Code", FromAsmLine."Variant Code");
- end;
- if ToAssemblyLine.Type <> ToAssemblyLine.Type::" " then begin
- if RecalculateLines then
- ToAssemblyLine."Unit Cost" := ToAssemblyLine.GetUnitCost()
- else
- ToAssemblyLine."Unit Cost" := FromAsmLine."Unit Cost";
- ToAssemblyLine."Cost Amount" := ToAssemblyLine.CalcCostAmount(ToAssemblyLine.Quantity, ToAssemblyLine."Unit Cost");
- if AvailabilityCheck then begin
- ToAssemblyLine."Quantity (Base)" :=
- UOMMgt.CalcBaseQty(
- ToAssemblyLine."No.", ToAssemblyLine."Variant Code", ToAssemblyLine."Unit of Measure Code",
- ToAssemblyLine.Quantity, ToAssemblyLine."Qty. per Unit of Measure");
- ToAssemblyLine."Remaining Quantity" := ToAssemblyLine."Quantity (Base)";
- ToAssemblyLine.InitQtyToConsume();
- end else begin
- ToAssemblyLine.InitQtyToConsume();
- ToAssemblyLine.Validate("Quantity to Consume");
- end;
- end;
- CopyFromAsmOrderDimToLine(ToAssemblyLine, FromAsmLine, BasicAsmOrderCopy);
- OnCreateToAsmLinesOnBeforeToAssemblyLineModify(ToAsmHeader, ToAssemblyLine, FromAsmLine, ToSalesLine, BasicAsmOrderCopy, AvailabilityCheck);
- ToAssemblyLine.Modify(not AvailabilityCheck);
- until FromAsmLine.Next() = 0;
- end;
-
- local procedure CheckAsmOrderAvailability(ToAsmHeader: Record "Assembly Header"; var FromAsmLine: Record "Assembly Line"; ToSalesLine: Record "Sales Line")
- var
- TempToAsmHeader: Record "Assembly Header" temporary;
- TempToAsmLine: Record "Assembly Line" temporary;
- AsmLineOnDestinationOrder: Record "Assembly Line";
- AssemblyLineMgt: Codeunit "Assembly Line Management";
- LineNo: Integer;
- begin
- TempToAsmHeader := ToAsmHeader;
- TempToAsmHeader.Insert();
- CreateToAsmLines(TempToAsmHeader, FromAsmLine, TempToAsmLine, ToSalesLine, true, true);
- if TempToAsmLine.FindLast() then
- LineNo := TempToAsmLine."Line No.";
- Clear(TempToAsmLine);
- AsmLineOnDestinationOrder.SetRange("Document Type", ToAsmHeader."Document Type");
- AsmLineOnDestinationOrder.SetRange("Document No.", ToAsmHeader."No.");
- AsmLineOnDestinationOrder.SetRange(Type, AsmLineOnDestinationOrder.Type::Item);
- if AsmLineOnDestinationOrder.FindSet() then
- repeat
- TempToAsmLine := AsmLineOnDestinationOrder;
- LineNo += 10000;
- TempToAsmLine."Line No." := LineNo;
- TempToAsmLine.Insert();
- until AsmLineOnDestinationOrder.Next() = 0;
- if AssemblyLineMgt.ShowAvailability(false, TempToAsmHeader, TempToAsmLine) then
- ItemCheckAvail.RaiseUpdateInterruptedError();
- TempToAsmLine.DeleteAll();
- end;
-
- local procedure GetAppliedQuantityForAsmLine(BasicAsmOrderCopy: Boolean; ToAsmHeader: Record "Assembly Header"; TempFromAsmLine: Record "Assembly Line" temporary; ToSalesLine: Record "Sales Line"): Decimal
- begin
- if (TempFromAsmLine.Type = TempFromAsmLine.Type::Resource) and
- (TempFromAsmLine."Resource Usage Type" = TempFromAsmLine."Resource Usage Type"::Fixed)
- then
- exit(TempFromAsmLine."Quantity per");
-
- if BasicAsmOrderCopy then
- exit(ToAsmHeader.Quantity * TempFromAsmLine."Quantity per");
- case ToSalesLine."Document Type" of
- ToSalesLine."Document Type"::Order:
- exit(ToSalesLine."Qty. to Assemble to Order" * TempFromAsmLine."Quantity per");
- ToSalesLine."Document Type"::Quote,
- ToSalesLine."Document Type"::"Blanket Order":
- exit(ToSalesLine.Quantity * TempFromAsmLine."Quantity per");
- end;
- end;
-
- local procedure CopyFromArchSalesDocDimToHdr(var ToSalesHeader: Record "Sales Header"; FromSalesHeaderArchive: Record "Sales Header Archive")
- begin
- ToSalesHeader."Shortcut Dimension 1 Code" := FromSalesHeaderArchive."Shortcut Dimension 1 Code";
- ToSalesHeader."Shortcut Dimension 2 Code" := FromSalesHeaderArchive."Shortcut Dimension 2 Code";
- ToSalesHeader."Dimension Set ID" := FromSalesHeaderArchive."Dimension Set ID";
- OnAfterCopyFromArchSalesDocDimToHdr(ToSalesHeader, FromSalesHeaderArchive);
- end;
-
- local procedure CopyFromArchSalesDocDimToLine(var ToSalesLine: Record "Sales Line"; FromSalesLineArchive: Record "Sales Line Archive")
- begin
- if IncludeHeader then begin
- ToSalesLine."Shortcut Dimension 1 Code" := FromSalesLineArchive."Shortcut Dimension 1 Code";
- ToSalesLine."Shortcut Dimension 2 Code" := FromSalesLineArchive."Shortcut Dimension 2 Code";
- ToSalesLine."Dimension Set ID" := FromSalesLineArchive."Dimension Set ID";
- end;
- OnAfterCopyFromArchSalesDocDimToLine(ToSalesLine, FromSalesLineArchive);
- end;
-
- local procedure CopyFromArchPurchDocDimToHdr(var ToPurchHeader: Record "Purchase Header"; FromPurchHeaderArchive: Record "Purchase Header Archive")
- begin
- ToPurchHeader."Shortcut Dimension 1 Code" := FromPurchHeaderArchive."Shortcut Dimension 1 Code";
- ToPurchHeader."Shortcut Dimension 2 Code" := FromPurchHeaderArchive."Shortcut Dimension 2 Code";
- ToPurchHeader."Dimension Set ID" := FromPurchHeaderArchive."Dimension Set ID";
- end;
-
- local procedure CopyFromArchPurchDocDimToLine(var ToPurchLine: Record "Purchase Line"; FromPurchLineArchive: Record "Purchase Line Archive")
- begin
- if IncludeHeader then begin
- ToPurchLine."Shortcut Dimension 1 Code" := FromPurchLineArchive."Shortcut Dimension 1 Code";
- ToPurchLine."Shortcut Dimension 2 Code" := FromPurchLineArchive."Shortcut Dimension 2 Code";
- ToPurchLine."Dimension Set ID" := FromPurchLineArchive."Dimension Set ID";
- end;
- end;
-
- local procedure CopyFromAsmOrderDimToHdr(var ToAssemblyHeader: Record "Assembly Header"; FromAssemblyHeader: Record "Assembly Header"; ToSalesLine: Record "Sales Line")
- begin
- if RecalculateLines then begin
- ToAssemblyHeader."Dimension Set ID" := ToSalesLine."Dimension Set ID";
- ToAssemblyHeader."Shortcut Dimension 1 Code" := ToSalesLine."Shortcut Dimension 1 Code";
- ToAssemblyHeader."Shortcut Dimension 2 Code" := ToSalesLine."Shortcut Dimension 2 Code";
- end else begin
- ToAssemblyHeader."Dimension Set ID" := FromAssemblyHeader."Dimension Set ID";
- ToAssemblyHeader."Shortcut Dimension 1 Code" := FromAssemblyHeader."Shortcut Dimension 1 Code";
- ToAssemblyHeader."Shortcut Dimension 2 Code" := FromAssemblyHeader."Shortcut Dimension 2 Code";
- end;
- end;
-
- local procedure CopyFromAsmOrderDimToLine(var ToAssemblyLine: Record "Assembly Line"; FromAssemblyLine: Record "Assembly Line"; BasicAsmOrderCopy: Boolean)
- begin
- if RecalculateLines or BasicAsmOrderCopy then
- exit;
-
- ToAssemblyLine."Dimension Set ID" := FromAssemblyLine."Dimension Set ID";
- ToAssemblyLine."Shortcut Dimension 1 Code" := FromAssemblyLine."Shortcut Dimension 1 Code";
- ToAssemblyLine."Shortcut Dimension 2 Code" := FromAssemblyLine."Shortcut Dimension 2 Code";
- end;
-
- procedure SetArchDocVal(DocOccurrencyNo: Integer; DocVersionNo: Integer)
- begin
- FromDocOccurrenceNo := DocOccurrencyNo;
- FromDocVersionNo := DocVersionNo;
- end;
-
- procedure CopyArchSalesLine(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesHeaderArchive: Record "Sales Header Archive"; var FromSalesLineArchive: Record "Sales Line Archive"; var NextLineNo: Integer; var LinesNotCopied: Integer; RecalculateAmount: Boolean): Boolean
- var
- SalesItem: Record Item;
- LastInsertedSalesLine: Record "Sales Line";
- VATPostingSetup: Record "VAT Posting Setup";
- FromSalesHeader: Record "Sales Header";
- FromSalesLine: Record "Sales Line";
- CopyThisLine: Boolean;
- IsHandled: Boolean;
- ShouldRecalculateAmount: Boolean;
- ShouldIncrementLinesNotCopied: Boolean;
- begin
- CopyThisLine := true;
- OnBeforeCopyArchSalesLine(ToSalesHeader, FromSalesHeaderArchive, FromSalesLineArchive, RecalculateLines, CopyThisLine);
- if not CopyThisLine then begin
- LinesNotCopied := LinesNotCopied + 1;
- exit(false);
- end;
-
- if ((ToSalesHeader."Language Code" <> FromSalesHeaderArchive."Language Code") or RecalculateLines) and
- FromSalesLineArchive.IsExtendedText()
- then
- exit(false);
-
- ToSalesLine.SetSalesHeader(ToSalesHeader);
- if RecalculateLines and not FromSalesLineArchive."System-Created Entry" then
- ToSalesLine.Init()
- else
- ToSalesLine.TransferFields(FromSalesLineArchive);
- NextLineNo := NextLineNo + 10000;
- OnCopyArchSalesLineOnAfterIncrementNextLineNo(ToSalesLine, FromSalesLineArchive, NextLineNo, ToSalesHeader);
- ToSalesLine."Document Type" := ToSalesHeader."Document Type";
- ToSalesLine."Document No." := ToSalesHeader."No.";
- ToSalesLine."Line No." := NextLineNo;
- ToSalesLine.Validate("Currency Code", FromSalesHeaderArchive."Currency Code");
-
- if RecalculateLines and not FromSalesLineArchive."System-Created Entry" then begin
- FromSalesHeader.TransferFields(FromSalesHeaderArchive, true);
- FromSalesLine.TransferFields(FromSalesLineArchive, true);
- RecalculateSalesLine(ToSalesHeader, ToSalesLine, FromSalesHeader, FromSalesLine, CopyThisLine);
- end else begin
- InitSalesLineFields(ToSalesLine);
- OnCopyArchSalesLineOnAfterInitSalesLineFields(ToSalesLine, FromSalesLineArchive);
-
- ToSalesLine.InitOutstanding();
- if ToSalesLine."Document Type" in
- [ToSalesLine."Document Type"::"Return Order", ToSalesLine."Document Type"::"Credit Memo"]
- then
- ToSalesLine.InitQtyToReceive()
- else
- ToSalesLine.InitQtyToShip();
- ToSalesLine."VAT Difference" := FromSalesLineArchive."VAT Difference";
- if not CreateToHeader then
- ToSalesLine."Shipment Date" := ToSalesHeader."Shipment Date";
- ToSalesLine."Appl.-from Item Entry" := 0;
- ToSalesLine."Appl.-to Item Entry" := 0;
-
- OnCopyArchSalesLineOnBeforeCleanSpecialOrderDropShipmentInSalesLine(ToSalesHeader, ToSalesLine, FromSalesHeader, FromSalesLine, CreateToHeader);
-
- CleanSpecialOrderDropShipmentInSalesLine(ToSalesLine);
- if RecalculateAmount and (FromSalesLineArchive."Appl.-from Item Entry" = 0) then begin
- ToSalesLine.Validate("Line Discount %", FromSalesLineArchive."Line Discount %");
- ToSalesLine.Validate(
- "Inv. Discount Amount",
- Round(FromSalesLineArchive."Inv. Discount Amount", Currency."Amount Rounding Precision"));
- ToSalesLine.Validate("Unit Cost (LCY)", FromSalesLineArchive."Unit Cost (LCY)");
- end;
- if VATPostingSetup.Get(ToSalesLine."VAT Bus. Posting Group", ToSalesLine."VAT Prod. Posting Group") then
- ToSalesLine."VAT Identifier" := VATPostingSetup."VAT Identifier";
-
- ToSalesLine.UpdateWithWarehouseShip();
- if (ToSalesLine.Type = ToSalesLine.Type::Item) and (ToSalesLine."No." <> '') then begin
- SalesItem.Get(ToSalesLine."No.");
- if (SalesItem."Costing Method" = SalesItem."Costing Method"::Standard) and not ToSalesLine.IsShipment() then
- ToSalesLine.GetUnitCost();
- end;
- end;
-
- ShouldRecalculateAmount := ExactCostRevMandatory and
- (FromSalesLineArchive.Type = FromSalesLineArchive.Type::Item) and
- (FromSalesLineArchive."Appl.-from Item Entry" <> 0) and
- not MoveNegLines;
-
- OnCopyArchSalesLineOnAfterCalcShouldRecalculateAmount(ToSalesLine, FromSalesLineArchive, ShouldRecalculateAmount);
-
- if ShouldRecalculateAmount then begin
- if RecalculateAmount then begin
- ToSalesLine.Validate("Unit Price", FromSalesLineArchive."Unit Price");
- ToSalesLine.Validate(
- "Line Discount Amount",
- Round(FromSalesLineArchive."Line Discount Amount", Currency."Amount Rounding Precision"));
- ToSalesLine.Validate(
- "Inv. Discount Amount",
- Round(FromSalesLineArchive."Inv. Discount Amount", Currency."Amount Rounding Precision"));
- end;
- ToSalesLine.Validate("Appl.-from Item Entry", FromSalesLineArchive."Appl.-from Item Entry");
- if not CreateToHeader then
- if ToSalesLine."Shipment Date" = 0D then
- InitShipmentDateInLine(ToSalesHeader, ToSalesLine);
- end;
-
- if MoveNegLines and (ToSalesLine.Type <> ToSalesLine.Type::" ") then begin
- ToSalesLine.Validate(Quantity, -FromSalesLineArchive.Quantity);
- OnCopyArchSalesLineOnAfterValidateQuantityMoveNegLines(ToSalesLine, FromSalesLineArchive);
- ToSalesLine.Validate("Line Discount %", FromSalesLineArchive."Line Discount %");
- ToSalesLine."Appl.-to Item Entry" := FromSalesLineArchive."Appl.-to Item Entry";
- ToSalesLine."Appl.-from Item Entry" := FromSalesLineArchive."Appl.-from Item Entry";
- end;
-
- IsHandled := false;
- OnCopyArchSalesLineOnBeforeTransferExtendedText(ToSalesHeader, ToSalesLine, FromSalesHeaderArchive, FromSalesLineArchive, RecalculateLines, NextLineNo, TransferOldExtLines, IsHandled, MoveNegLines);
- if not IsHandled then
- if not ((ToSalesHeader."Language Code" <> FromSalesHeaderArchive."Language Code") or RecalculateLines) then begin
- if FromSalesLineArchive.IsExtendedText() then
- ToSalesLine."Attached to Line No." :=
- TransferOldExtLines.TransferExtendedText(
- FromSalesLineArchive."Line No.", NextLineNo, FromSalesLineArchive."Attached to Line No.");
- end else
- if TransferExtendedText.SalesCheckIfAnyExtText(ToSalesLine, false) then begin
- TransferExtendedText.InsertSalesExtTextRetLast(ToSalesLine, LastInsertedSalesLine);
- NextLineNo := LastInsertedSalesLine."Line No.";
- end;
-
- if CopyThisLine then begin
- OnCopyArchSalesLineOnBeforeToSalesLineInsert(ToSalesLine, FromSalesLineArchive, RecalculateLines, NextLineNo, TransferOldExtLines, ToSalesHeader);
- ToSalesLine.Insert();
- OnCopyArchSalesLineOnAfterToSalesLineInsert(ToSalesLine, FromSalesLineArchive, RecalculateLines, NextLineNo);
- end else begin
- ShouldIncrementLinesNotCopied := true;
- OnCopyArchSalesLineOnBeforeIncrementLinesNotCopied(FromSalesLineArchive, ShouldIncrementLinesNotCopied, LinesNotCopied);
- if ShouldIncrementLinesNotCopied then
- LinesNotCopied := LinesNotCopied + 1;
- end;
-
- exit(CopyThisLine);
- end;
-
- procedure CopyArchPurchLine(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; var FromPurchHeaderArchive: Record "Purchase Header Archive"; var FromPurchLineArchive: Record "Purchase Line Archive"; var NextLineNo: Integer; var LinesNotCopied: Integer; RecalculateAmount: Boolean): Boolean
- var
- LastInsertedPurchLine: Record "Purchase Line";
- VATPostingSetup: Record "VAT Posting Setup";
- FromPurchHeader: Record "Purchase Header";
- FromPurchLine: Record "Purchase Line";
- CopyThisLine: Boolean;
- IsHandled: Boolean;
- begin
- CopyThisLine := true;
- OnBeforeCopyArchPurchLine(ToPurchHeader, FromPurchHeaderArchive, FromPurchLineArchive, RecalculateLines, CopyThisLine);
- if not CopyThisLine then begin
- LinesNotCopied := LinesNotCopied + 1;
- exit(false);
- end;
-
- if ((ToPurchHeader."Language Code" <> FromPurchHeaderArchive."Language Code") or RecalculateLines) and
- FromPurchLineArchive.IsExtendedText()
- then
- exit(false);
-
- if RecalculateLines and not FromPurchLineArchive."System-Created Entry" then
- ToPurchLine.Init()
- else
- ToPurchLine.TransferFields(FromPurchLineArchive);
- NextLineNo := NextLineNo + 10000;
- OnCopyArchPurchLineOnAfterSetNextLineNo(ToPurchLine, FromPurchLineArchive, NextLineNo);
- ToPurchLine."Document Type" := ToPurchHeader."Document Type";
- ToPurchLine."Document No." := ToPurchHeader."No.";
- ToPurchLine."Line No." := NextLineNo;
- ToPurchLine.Validate("Currency Code", FromPurchHeaderArchive."Currency Code");
-
- if RecalculateLines and not FromPurchLineArchive."System-Created Entry" then begin
- FromPurchHeader.TransferFields(FromPurchHeaderArchive, true);
- FromPurchLine.TransferFields(FromPurchLineArchive, true);
- RecalculatePurchLine(ToPurchHeader, ToPurchLine, FromPurchHeader, FromPurchLine, CopyThisLine);
- OnCopyArchPurchLineOnAfterRecalculatePurchLine(ToPurchLine, FromPurchLineArchive);
- end else begin
- InitPurchLineFields(ToPurchLine);
-
- ToPurchLine.InitOutstanding();
- if ToPurchLine."Document Type" in
- [ToPurchLine."Document Type"::"Return Order", ToPurchLine."Document Type"::"Credit Memo"]
- then
- ToPurchLine.InitQtyToShip()
- else
- ToPurchLine.InitQtyToReceive();
- ToPurchLine."VAT Difference" := FromPurchLineArchive."VAT Difference";
- ToPurchLine."Receipt No." := '';
- ToPurchLine."Receipt Line No." := 0;
- if not CreateToHeader then
- ToPurchLine."Expected Receipt Date" := ToPurchHeader."Expected Receipt Date";
- ToPurchLine."Appl.-to Item Entry" := 0;
-
- if FromPurchLineArchive."Drop Shipment" or FromPurchLineArchive."Special Order" then
- ToPurchLine."Purchasing Code" := '';
-
- OnCopyArchPurchLineOnBeforeCleanSpecialOrderDropShipmentInPurchLine(ToPurchHeader, ToPurchLine, FromPurchHeader, FromPurchLine, CreateToHeader);
-
- CleanSpecialOrderDropShipmentInPurchLine(ToPurchLine);
-
- if RecalculateAmount then begin
- ToPurchLine.Validate("Line Discount %", FromPurchLineArchive."Line Discount %");
- ToPurchLine.Validate(
- "Inv. Discount Amount",
- Round(FromPurchLineArchive."Inv. Discount Amount", Currency."Amount Rounding Precision"));
- end;
- if VATPostingSetup.Get(ToPurchLine."VAT Bus. Posting Group", ToPurchLine."VAT Prod. Posting Group") then
- ToPurchLine."VAT Identifier" := VATPostingSetup."VAT Identifier";
-
- ToPurchLine.UpdateWithWarehouseReceive();
- ToPurchLine."Pay-to Vendor No." := ToPurchHeader."Pay-to Vendor No.";
- end;
-
- OnCopyArchPurchLineOnBeforeCheckExactCostRevMandatory(ToPurchLine, FromPurchLineArchive);
-
- if ExactCostRevMandatory and
- (FromPurchLineArchive.Type = FromPurchLineArchive.Type::Item) and
- (FromPurchLineArchive."Appl.-to Item Entry" <> 0) and
- not MoveNegLines
- then begin
- if RecalculateAmount then begin
- ToPurchLine.Validate("Direct Unit Cost", FromPurchLineArchive."Direct Unit Cost");
- ToPurchLine.Validate(
- "Line Discount Amount",
- Round(FromPurchLineArchive."Line Discount Amount", Currency."Amount Rounding Precision"));
- ToPurchLine.Validate(
- "Inv. Discount Amount",
- Round(FromPurchLineArchive."Inv. Discount Amount", Currency."Amount Rounding Precision"));
- end;
- ToPurchLine.Validate("Appl.-to Item Entry", FromPurchLineArchive."Appl.-to Item Entry");
- if not CreateToHeader then
- if ToPurchLine."Expected Receipt Date" = 0D then
- if ToPurchHeader."Expected Receipt Date" <> 0D then
- ToPurchLine."Expected Receipt Date" := ToPurchHeader."Expected Receipt Date"
- else
- ToPurchLine."Expected Receipt Date" := WorkDate();
- end;
-
- if MoveNegLines and (ToPurchLine.Type <> ToPurchLine.Type::" ") then begin
- ToPurchLine.Validate(Quantity, -FromPurchLineArchive.Quantity);
- OnCopyArchPurchLineOnAfterValidateQuantityMoveNegLines(ToPurchLine, FromPurchLineArchive);
- ToPurchLine."Appl.-to Item Entry" := FromPurchLineArchive."Appl.-to Item Entry"
- end;
-
- IsHandled := false;
- OnCopyArchPurchLineOnBeforeCopyArchPurchLineExtText(ToPurchHeader, ToPurchLine, FromPurchHeaderArchive, FromPurchLineArchive, NextLineNo, RecalculateLines, IsHandled, TransferOldExtLines);
- if not IsHandled then
- if not ((ToPurchHeader."Language Code" <> FromPurchHeaderArchive."Language Code") or RecalculateLines) then begin
- if FromPurchLineArchive.IsExtendedText() then
- ToPurchLine."Attached to Line No." :=
- TransferOldExtLines.TransferExtendedText(
- FromPurchLineArchive."Line No.", NextLineNo, FromPurchLineArchive."Attached to Line No.");
- end else
- if TransferExtendedText.PurchCheckIfAnyExtText(ToPurchLine, false) then begin
- TransferExtendedText.InsertPurchExtTextRetLast(ToPurchLine, LastInsertedPurchLine);
- NextLineNo := LastInsertedPurchLine."Line No.";
- end;
-
- if CopyThisLine then begin
- OnCopyArchPurchLineOnBeforeToPurchLineInsert(ToPurchLine, FromPurchLineArchive, RecalculateLines, NextLineNo, TransferOldExtLines);
- ToPurchLine.Insert();
- OnCopyArchPurchLineOnAfterToPurchLineInsert(ToPurchLine, FromPurchLineArchive, RecalculateLines);
- end else
- LinesNotCopied := LinesNotCopied + 1;
-
- exit(CopyThisLine);
- end;
-
- local procedure CopyDocLines(RecalculateAmount: Boolean; var ToPurchLine: Record "Purchase Line"; var FromPurchLine: Record "Purchase Line")
- begin
- if not RecalculateAmount then
- exit;
- if (ToPurchLine.Type <> ToPurchLine.Type::" ") and (ToPurchLine."No." <> '') then begin
- ToPurchLine.Validate("Line Discount %", FromPurchLine."Line Discount %");
- ToPurchLine.Validate(
- "Inv. Discount Amount",
- Round(FromPurchLine."Inv. Discount Amount", Currency."Amount Rounding Precision"));
- end;
- end;
-
- local procedure CheckCreditLimit(var FromSalesHeader: Record "Sales Header"; var ToSalesHeader: Record "Sales Header"; FromDocType: Enum "Sales Document Type From")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckCreditLimit(FromSalesHeader, ToSalesHeader, SkipTestCreditLimit, IsHandled, IncludeHeader, HideDialog, FromDocType);
- if IsHandled then
- exit;
-
- if SkipTestCreditLimit then
- exit;
-
- if IncludeHeader then
- CustCheckCreditLimit.SalesHeaderCheck(FromSalesHeader)
- else
- CustCheckCreditLimit.SalesHeaderCheck(ToSalesHeader);
- end;
-
- local procedure CheckUnappliedLines(IsSkippedLine: Boolean; var MissingExCostRevLink: Boolean)
- var
- IsHandled: Boolean;
-
- begin
- IsHandled := false;
- OnBeforeCheckUnappliedLines(IsSkippedLine, MissingExCostRevLink, WarningDone, IsHandled);
- if IsHandled then
- exit;
-
- if IsSkippedLine and MissingExCostRevLink then begin
- if not WarningDone then
- Message(Text030);
- MissingExCostRevLink := false;
- WarningDone := true;
- end;
- end;
-
- local procedure SetDefaultValuesToSalesLine(var ToSalesLine: Record "Sales Line"; ToSalesHeader: Record "Sales Header"; FromSalesLine: Record "Sales Line")
- var
- ShouldSetShipmentDate: Boolean;
- begin
- InitSalesLineFields(ToSalesLine);
-
- ClearSalesBlanketOrderFields(ToSalesLine, ToSalesHeader);
- ToSalesLine.InitOutstanding();
- if ToSalesLine."Document Type" in
- [ToSalesLine."Document Type"::"Return Order", ToSalesLine."Document Type"::"Credit Memo"]
- then
- ToSalesLine.InitQtyToReceive()
- else
- ToSalesLine.InitQtyToShip();
- ToSalesLine."VAT Difference" := FromSalesLine."VAT Difference";
- ToSalesLine."Shipment No." := '';
- ToSalesLine."Shipment Line No." := 0;
- ToSalesLine."Appl.-from Item Entry" := 0;
- ToSalesLine."Appl.-to Item Entry" := 0;
- ToSalesLine."Purchase Order No." := '';
- ToSalesLine."Purch. Order Line No." := 0;
- ToSalesLine."Special Order Purchase No." := '';
- ToSalesLine."Special Order Purch. Line No." := 0;
- ToSalesLine.Area := ToSalesHeader.Area;
- ToSalesLine."Exit Point" := ToSalesHeader."Exit Point";
- ToSalesLine."Transaction Specification" := ToSalesHeader."Transaction Specification";
- ToSalesLine."Transaction Type" := ToSalesHeader."Transaction Type";
- ToSalesLine."Transport Method" := ToSalesHeader."Transport Method";
-
- ShouldSetShipmentDate := (not CreateToHeader) and RecalculateLines;
- OnSetDefaultValuesToSalesLineOnBeforeSetShipmentDate(ToSalesHeader, ShouldSetShipmentDate);
- if ShouldSetShipmentDate then
- ToSalesLine."Shipment Date" := ToSalesHeader."Shipment Date";
-
- OnAfterSetDefaultValuesToSalesLine(ToSalesLine, ToSalesHeader, CreateToHeader, RecalculateLines, FromSalesLine);
- end;
-
- local procedure ClearSalesBlanketOrderFields(var ToSalesLine: Record "Sales Line"; ToSalesHeader: Record "Sales Header")
- var
- IsHandled: Boolean;
- begin
- OnBeforeClearSalesBlanketOrderFields(ToSalesLine, ToSalesHeader, IsHandled);
- if IsHandled then
- exit;
- if ToSalesLine."Document Type" in
- [ToSalesLine."Document Type"::"Blanket Order",
- ToSalesLine."Document Type"::"Return Order"]
- then begin
- ToSalesLine."Blanket Order No." := '';
- ToSalesLine."Blanket Order Line No." := 0;
- end;
- end;
-
- local procedure SetDefaultValuesToPurchLine(var ToPurchLine: Record "Purchase Line"; ToPurchHeader: Record "Purchase Header"; VATDifference: Decimal; NonDeductibleVATDifference: Decimal)
- begin
- InitPurchLineFields(ToPurchLine);
-
- ClearPurchaseBlanketOrderFields(ToPurchLine, ToPurchHeader);
- ToPurchLine.InitOutstanding();
- if ToPurchLine."Document Type" in
- [ToPurchLine."Document Type"::"Return Order", ToPurchLine."Document Type"::"Credit Memo"]
- then
- ToPurchLine.InitQtyToShip()
- else
- ToPurchLine.InitQtyToReceive();
- ToPurchLine."VAT Difference" := VATDifference;
- ToPurchLine."Non-Deductible VAT Diff." := NonDeductibleVATDifference;
- ToPurchLine."Receipt No." := '';
- ToPurchLine."Receipt Line No." := 0;
- if not CreateToHeader then
- ToPurchLine."Expected Receipt Date" := ToPurchHeader."Expected Receipt Date";
- ToPurchLine."Appl.-to Item Entry" := 0;
-
- ToPurchLine."Sales Order No." := '';
- ToPurchLine."Sales Order Line No." := 0;
- ToPurchLine."Special Order Sales No." := '';
- ToPurchLine."Special Order Sales Line No." := 0;
-
- ToPurchLine.Area := ToPurchHeader.Area;
- ToPurchLine."Entry Point" := ToPurchHeader."Entry Point";
- ToPurchLine."Transaction Specification" := ToPurchHeader."Transaction Specification";
- ToPurchLine."Transaction Type" := ToPurchHeader."Transaction Type";
- ToPurchLine."Transport Method" := ToPurchHeader."Transport Method";
-
- OnAfterSetDefaultValuesToPurchLine(ToPurchLine, ToPurchHeader, CreateToHeader, RecalculateLines);
- end;
-
- local procedure ClearPurchaseBlanketOrderFields(var ToPurchLine: Record "Purchase Line"; ToPurchHeader: Record "Purchase Header")
- var
- IsHandled: Boolean;
- begin
- OnBeforeClearPurchaseBlanketOrderFields(ToPurchLine, ToPurchHeader, IsHandled);
- if IsHandled then
- exit;
- if ToPurchLine."Document Type" in
- [ToPurchLine."Document Type"::"Blanket Order",
- ToPurchLine."Document Type"::"Return Order"]
- then begin
- ToPurchLine."Blanket Order No." := '';
- ToPurchLine."Blanket Order Line No." := 0;
- end;
- end;
-
- local procedure CopyItemTrackingEntries(SalesLine: Record "Sales Line"; var PurchLine: Record "Purchase Line"; SalesPricesIncludingVAT: Boolean; PurchPricesIncludingVAT: Boolean)
- var
- PurchasesPayablesSetup: Record "Purchases & Payables Setup";
- TempItemLedgerEntry: Record "Item Ledger Entry" temporary;
- TrackingSpecification: Record "Tracking Specification";
- ItemTrackingMgt: Codeunit "Item Tracking Management";
- MissingExCostRevLink: Boolean;
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCopyItemTrackingEntries(SalesLine, PurchLine, IsHandled);
- if IsHandled then
- exit;
-
- PurchasesPayablesSetup.Get();
- FindTrackingEntries(
- TempItemLedgerEntry, DATABASE::"Sales Line", TrackingSpecification."Source Subtype"::"5",
- SalesLine."Document No.", '', 0, SalesLine."Line No.", SalesLine."No.");
- ItemTrackingMgt.CopyItemLedgEntryTrkgToPurchLn(
- TempItemLedgerEntry, PurchLine, PurchasesPayablesSetup."Exact Cost Reversing Mandatory", MissingExCostRevLink,
- SalesPricesIncludingVAT, PurchPricesIncludingVAT, true);
- end;
-
- local procedure FindTrackingEntries(var TempItemLedgerEntry: Record "Item Ledger Entry" temporary; Type: Integer; Subtype: Integer; ID: Code[20]; BatchName: Code[10]; ProdOrderLine: Integer; RefNo: Integer; ItemNo: Code[20])
- var
- TrackingSpecification: Record "Tracking Specification";
- begin
- TrackingSpecification.SetCurrentKey("Source ID", "Source Type", "Source Subtype", "Source Batch Name",
- "Source Prod. Order Line", "Source Ref. No.");
- TrackingSpecification.SetRange("Source ID", ID);
- TrackingSpecification.SetRange("Source Ref. No.", RefNo);
- TrackingSpecification.SetRange("Source Type", Type);
- TrackingSpecification.SetRange("Source Subtype", Subtype);
- TrackingSpecification.SetRange("Source Batch Name", BatchName);
- TrackingSpecification.SetRange("Source Prod. Order Line", ProdOrderLine);
- TrackingSpecification.SetRange("Item No.", ItemNo);
- if TrackingSpecification.FindSet() then
- repeat
- AddItemLedgerEntry(TempItemLedgerEntry, TrackingSpecification);
- until TrackingSpecification.Next() = 0;
- end;
-
- local procedure AddItemLedgerEntry(var TempItemLedgerEntry: Record "Item Ledger Entry" temporary; TrackingSpecification: Record "Tracking Specification")
- var
- ItemLedgerEntry: Record "Item Ledger Entry";
- begin
- if not TrackingSpecification.TrackingExists() then
- exit;
-
- if not ItemLedgerEntry.Get(TrackingSpecification."Entry No.") then
- exit;
-
- TempItemLedgerEntry := ItemLedgerEntry;
- if TempItemLedgerEntry.Insert() then;
- end;
-
- procedure CopyFieldsFromOldSalesHeader(var ToSalesHeader: Record "Sales Header"; OldSalesHeader: Record "Sales Header")
- begin
- OnBeforeCopyFieldsFromOldSalesHeader(ToSalesHeader, OldSalesHeader);
-
- ToSalesHeader."No. Series" := OldSalesHeader."No. Series";
- ToSalesHeader."Posting Description" := OldSalesHeader."Posting Description";
- ToSalesHeader."Posting No." := OldSalesHeader."Posting No.";
- ToSalesHeader."Posting No. Series" := OldSalesHeader."Posting No. Series";
- ToSalesHeader."Shipping No." := OldSalesHeader."Shipping No.";
- ToSalesHeader."Shipping No. Series" := OldSalesHeader."Shipping No. Series";
- ToSalesHeader."Return Receipt No." := OldSalesHeader."Return Receipt No.";
- ToSalesHeader."Return Receipt No. Series" := OldSalesHeader."Return Receipt No. Series";
- ToSalesHeader."Prepayment No. Series" := OldSalesHeader."Prepayment No. Series";
- ToSalesHeader."Prepayment No." := OldSalesHeader."Prepayment No.";
- ToSalesHeader."Prepmt. Posting Description" := OldSalesHeader."Prepmt. Posting Description";
- ToSalesHeader."Prepmt. Cr. Memo No. Series" := OldSalesHeader."Prepmt. Cr. Memo No. Series";
- ToSalesHeader."Prepmt. Cr. Memo No." := OldSalesHeader."Prepmt. Cr. Memo No.";
- ToSalesHeader."Prepmt. Posting Description" := OldSalesHeader."Prepmt. Posting Description";
- SetSalespersonPurchaserCode(ToSalesHeader."Salesperson Code");
- ToSalesHeader."Area" := OldSalesHeader.Area;
- ToSalesHeader."Exit Point" := OldSalesHeader."Exit Point";
- ToSalesHeader."Transaction Type" := OldSalesHeader."Transaction Type";
- end;
-
- procedure CopyFieldsFromOldPurchHeader(var ToPurchHeader: Record "Purchase Header"; OldPurchHeader: Record "Purchase Header")
- begin
- OnBeforeCopyFieldsFromOldPurchHeader(ToPurchHeader, OldPurchHeader, IncludeHeader, MoveNegLines);
-
- ToPurchHeader."No. Series" := OldPurchHeader."No. Series";
- ToPurchHeader."Posting Description" := OldPurchHeader."Posting Description";
- ToPurchHeader."Posting No." := OldPurchHeader."Posting No.";
- ToPurchHeader."Posting No. Series" := OldPurchHeader."Posting No. Series";
- ToPurchHeader."Receiving No." := OldPurchHeader."Receiving No.";
- ToPurchHeader."Receiving No. Series" := OldPurchHeader."Receiving No. Series";
- ToPurchHeader."Return Shipment No." := OldPurchHeader."Return Shipment No.";
- ToPurchHeader."Return Shipment No. Series" := OldPurchHeader."Return Shipment No. Series";
- ToPurchHeader."Prepayment No. Series" := OldPurchHeader."Prepayment No. Series";
- ToPurchHeader."Prepayment No." := OldPurchHeader."Prepayment No.";
- ToPurchHeader."Prepmt. Posting Description" := OldPurchHeader."Prepmt. Posting Description";
- ToPurchHeader."Prepmt. Cr. Memo No. Series" := OldPurchHeader."Prepmt. Cr. Memo No. Series";
- ToPurchHeader."Prepmt. Cr. Memo No." := OldPurchHeader."Prepmt. Cr. Memo No.";
- ToPurchHeader."Prepmt. Posting Description" := OldPurchHeader."Prepmt. Posting Description";
- SetSalespersonPurchaserCode(ToPurchHeader."Purchaser Code");
- ToPurchHeader."Area" := OldPurchHeader.Area;
- ToPurchHeader."Entry Point" := OldPurchHeader."Entry Point";
-
- OnAfterCopyFieldsFromOldPurchHeaderProcedure(ToPurchHeader, OldPurchHeader);
- end;
-
- local procedure CheckFromSalesHeader(SalesHeaderFrom: Record "Sales Header"; SalesHeaderTo: Record "Sales Header")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckFromSalesHeader(SalesHeaderFrom, SalesHeaderTo, ISHandled);
- if IsHandled then
- exit;
-
- SalesHeaderFrom.TestField("Sell-to Customer No.", SalesHeaderTo."Sell-to Customer No.");
- SalesHeaderFrom.TestField("Bill-to Customer No.", SalesHeaderTo."Bill-to Customer No.");
- SalesHeaderFrom.TestField("Customer Posting Group", SalesHeaderTo."Customer Posting Group");
- SalesHeaderFrom.TestField("Gen. Bus. Posting Group", SalesHeaderTo."Gen. Bus. Posting Group");
- SalesHeaderFrom.TestField("Currency Code", SalesHeaderTo."Currency Code");
- SalesHeaderFrom.TestField("Prices Including VAT", SalesHeaderTo."Prices Including VAT");
-
- OnAfterCheckFromSalesHeader(SalesHeaderFrom, SalesHeaderTo);
- end;
-
- local procedure CheckFromSalesShptHeader(SalesShipmentHeaderFrom: Record "Sales Shipment Header"; SalesHeaderTo: Record "Sales Header")
- begin
- SalesShipmentHeaderFrom.TestField("Sell-to Customer No.", SalesHeaderTo."Sell-to Customer No.");
- SalesShipmentHeaderFrom.TestField("Bill-to Customer No.", SalesHeaderTo."Bill-to Customer No.");
- SalesShipmentHeaderFrom.TestField("Customer Posting Group", SalesHeaderTo."Customer Posting Group");
- SalesShipmentHeaderFrom.TestField("Gen. Bus. Posting Group", SalesHeaderTo."Gen. Bus. Posting Group");
- SalesShipmentHeaderFrom.TestField("Currency Code", SalesHeaderTo."Currency Code");
- SalesShipmentHeaderFrom.TestField("Prices Including VAT", SalesHeaderTo."Prices Including VAT");
-
- OnAfterCheckFromSalesShptHeader(SalesShipmentHeaderFrom, SalesHeaderTo);
- end;
-
- local procedure CheckFromSalesInvHeader(SalesInvoiceHeaderFrom: Record "Sales Invoice Header"; SalesHeaderTo: Record "Sales Header")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckFromSalesInvHeader(SalesInvoiceHeaderFrom, SalesHeaderTo, IsHandled);
- if IsHandled then
- exit;
-
- SalesInvoiceHeaderFrom.TestField("Sell-to Customer No.", SalesHeaderTo."Sell-to Customer No.");
- SalesInvoiceHeaderFrom.TestField("Bill-to Customer No.", SalesHeaderTo."Bill-to Customer No.");
- SalesInvoiceHeaderFrom.TestField("Customer Posting Group", SalesHeaderTo."Customer Posting Group");
- SalesInvoiceHeaderFrom.TestField("Gen. Bus. Posting Group", SalesHeaderTo."Gen. Bus. Posting Group");
- SalesInvoiceHeaderFrom.TestField("Currency Code", SalesHeaderTo."Currency Code");
- SalesInvoiceHeaderFrom.TestField("Prices Including VAT", SalesHeaderTo."Prices Including VAT");
-
- OnAfterCheckFromSalesInvHeader(SalesInvoiceHeaderFrom, SalesHeaderTo);
- end;
-
- local procedure CheckFromSalesReturnRcptHeader(ReturnReceiptHeaderFrom: Record "Return Receipt Header"; SalesHeaderTo: Record "Sales Header")
- begin
- ReturnReceiptHeaderFrom.TestField("Sell-to Customer No.", SalesHeaderTo."Sell-to Customer No.");
- ReturnReceiptHeaderFrom.TestField("Bill-to Customer No.", SalesHeaderTo."Bill-to Customer No.");
- ReturnReceiptHeaderFrom.TestField("Customer Posting Group", SalesHeaderTo."Customer Posting Group");
- ReturnReceiptHeaderFrom.TestField("Gen. Bus. Posting Group", SalesHeaderTo."Gen. Bus. Posting Group");
- ReturnReceiptHeaderFrom.TestField("Currency Code", SalesHeaderTo."Currency Code");
- ReturnReceiptHeaderFrom.TestField("Prices Including VAT", SalesHeaderTo."Prices Including VAT");
-
- OnAfterCheckFromSalesReturnRcptHeader(ReturnReceiptHeaderFrom, SalesHeaderTo);
- end;
-
- local procedure CheckFromSalesCrMemoHeader(SalesCrMemoHeaderFrom: Record "Sales Cr.Memo Header"; SalesHeaderTo: Record "Sales Header")
- begin
- SalesCrMemoHeaderFrom.TestField("Sell-to Customer No.", SalesHeaderTo."Sell-to Customer No.");
- SalesCrMemoHeaderFrom.TestField("Bill-to Customer No.", SalesHeaderTo."Bill-to Customer No.");
- SalesCrMemoHeaderFrom.TestField("Customer Posting Group", SalesHeaderTo."Customer Posting Group");
- SalesCrMemoHeaderFrom.TestField("Gen. Bus. Posting Group", SalesHeaderTo."Gen. Bus. Posting Group");
- SalesCrMemoHeaderFrom.TestField("Currency Code", SalesHeaderTo."Currency Code");
- SalesCrMemoHeaderFrom.TestField("Prices Including VAT", SalesHeaderTo."Prices Including VAT");
-
- OnAfterCheckFromSalesCrMemoHeader(SalesCrMemoHeaderFrom, SalesHeaderTo);
- end;
-
- local procedure CheckFromPurchaseHeader(PurchaseHeaderFrom: Record "Purchase Header"; PurchaseHeaderTo: Record "Purchase Header")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCheckFromPurchaseHeader(PurchaseHeaderFrom, PurchaseHeaderTo, IsHandled);
- if not IsHandled then begin
- PurchaseHeaderFrom.TestField("Buy-from Vendor No.", PurchaseHeaderTo."Buy-from Vendor No.");
- PurchaseHeaderFrom.TestField("Pay-to Vendor No.", PurchaseHeaderTo."Pay-to Vendor No.");
- PurchaseHeaderFrom.TestField("Vendor Posting Group", PurchaseHeaderTo."Vendor Posting Group");
- PurchaseHeaderFrom.TestField("Gen. Bus. Posting Group", PurchaseHeaderTo."Gen. Bus. Posting Group");
- PurchaseHeaderFrom.TestField("Currency Code", PurchaseHeaderTo."Currency Code");
- end;
- OnAfterCheckFromPurchaseHeader(PurchaseHeaderFrom, PurchaseHeaderTo);
- end;
-
- local procedure CheckFromPurchaseRcptHeader(PurchRcptHeaderFrom: Record "Purch. Rcpt. Header"; PurchaseHeaderTo: Record "Purchase Header")
- begin
- PurchRcptHeaderFrom.TestField("Buy-from Vendor No.", PurchaseHeaderTo."Buy-from Vendor No.");
- PurchRcptHeaderFrom.TestField("Pay-to Vendor No.", PurchaseHeaderTo."Pay-to Vendor No.");
- PurchRcptHeaderFrom.TestField("Vendor Posting Group", PurchaseHeaderTo."Vendor Posting Group");
- PurchRcptHeaderFrom.TestField("Gen. Bus. Posting Group", PurchaseHeaderTo."Gen. Bus. Posting Group");
- PurchRcptHeaderFrom.TestField("Currency Code", PurchaseHeaderTo."Currency Code");
-
- OnAfterCheckFromPurchaseRcptHeader(PurchRcptHeaderFrom, PurchaseHeaderTo);
- end;
-
- local procedure CheckFromPurchaseInvHeader(PurchInvHeaderFrom: Record "Purch. Inv. Header"; PurchaseHeaderTo: Record "Purchase Header")
- begin
- PurchInvHeaderFrom.TestField("Buy-from Vendor No.", PurchaseHeaderTo."Buy-from Vendor No.");
- PurchInvHeaderFrom.TestField("Pay-to Vendor No.", PurchaseHeaderTo."Pay-to Vendor No.");
- PurchInvHeaderFrom.TestField("Vendor Posting Group", PurchaseHeaderTo."Vendor Posting Group");
- PurchInvHeaderFrom.TestField("Gen. Bus. Posting Group", PurchaseHeaderTo."Gen. Bus. Posting Group");
- PurchInvHeaderFrom.TestField("Currency Code", PurchaseHeaderTo."Currency Code");
-
- OnAfterCheckFromPurchaseInvHeader(PurchInvHeaderFrom, PurchaseHeaderTo);
- end;
-
- local procedure CheckFromPurchaseReturnShptHeader(ReturnShipmentHeaderFrom: Record "Return Shipment Header"; PurchaseHeaderTo: Record "Purchase Header")
- begin
- ReturnShipmentHeaderFrom.TestField("Buy-from Vendor No.", PurchaseHeaderTo."Buy-from Vendor No.");
- ReturnShipmentHeaderFrom.TestField("Pay-to Vendor No.", PurchaseHeaderTo."Pay-to Vendor No.");
- ReturnShipmentHeaderFrom.TestField("Vendor Posting Group", PurchaseHeaderTo."Vendor Posting Group");
- ReturnShipmentHeaderFrom.TestField("Gen. Bus. Posting Group", PurchaseHeaderTo."Gen. Bus. Posting Group");
- ReturnShipmentHeaderFrom.TestField("Currency Code", PurchaseHeaderTo."Currency Code");
-
- OnAfterCheckFromPurchaseReturnShptHeader(ReturnShipmentHeaderFrom, PurchaseHeaderTo);
- end;
-
- local procedure CheckFromPurchaseCrMemoHeader(PurchCrMemoHdrFrom: Record "Purch. Cr. Memo Hdr."; PurchaseHeaderTo: Record "Purchase Header")
- begin
- PurchCrMemoHdrFrom.TestField("Buy-from Vendor No.", PurchaseHeaderTo."Buy-from Vendor No.");
- PurchCrMemoHdrFrom.TestField("Pay-to Vendor No.", PurchaseHeaderTo."Pay-to Vendor No.");
- PurchCrMemoHdrFrom.TestField("Vendor Posting Group", PurchaseHeaderTo."Vendor Posting Group");
- PurchCrMemoHdrFrom.TestField("Gen. Bus. Posting Group", PurchaseHeaderTo."Gen. Bus. Posting Group");
- PurchCrMemoHdrFrom.TestField("Currency Code", PurchaseHeaderTo."Currency Code");
-
- OnAfterCheckFromPurchaseCrMemoHeader(PurchCrMemoHdrFrom, PurchaseHeaderTo);
- end;
-
- local procedure CopyDeferrals(DeferralDocType: Enum "Deferral Document Type"; FromDocType: Integer;
- FromDocNo: Code[20];
- FromLineNo: Integer;
- ToDocType: Integer;
- ToDocNo: Code[20];
- ToLineNo: Integer) StartDate: Date
- var
- FromDeferralHeader: Record "Deferral Header";
- FromDeferralLine: Record "Deferral Line";
- ToDeferralHeader: Record "Deferral Header";
- ToDeferralLine: Record "Deferral Line";
- SalesCommentLine: Record "Sales Comment Line";
- begin
- StartDate := 0D;
- if FromDeferralHeader.Get(
- DeferralDocType, '', '',
- FromDocType, FromDocNo, FromLineNo)
- then begin
- RemoveDefaultDeferralCode(DeferralDocType, ToDocType, ToDocNo, ToLineNo);
- ToDeferralHeader.Init();
- ToDeferralHeader.TransferFields(FromDeferralHeader);
- ToDeferralHeader."Document Type" := ToDocType;
- ToDeferralHeader."Document No." := ToDocNo;
- ToDeferralHeader."Line No." := ToLineNo;
- ToDeferralHeader.Insert();
- FromDeferralLine.SetRange("Deferral Doc. Type", DeferralDocType);
- FromDeferralLine.SetRange("Gen. Jnl. Template Name", '');
- FromDeferralLine.SetRange("Gen. Jnl. Batch Name", '');
- FromDeferralLine.SetRange("Document Type", FromDocType);
- FromDeferralLine.SetRange("Document No.", FromDocNo);
- FromDeferralLine.SetRange("Line No.", FromLineNo);
- if FromDeferralLine.FindSet() then
- repeat
- ToDeferralLine.Init();
- ToDeferralLine.TransferFields(FromDeferralLine);
- ToDeferralLine."Document Type" := ToDocType;
- ToDeferralLine."Document No." := ToDocNo;
- ToDeferralLine."Line No." := ToLineNo;
- ToDeferralLine.Insert();
- until FromDeferralLine.Next() = 0;
- if ToDocType = SalesCommentLine."Document Type"::"Return Order".AsInteger() then
- StartDate := FromDeferralHeader."Start Date"
- end;
-
- OnAfterCopyDeferrals(DeferralDocType, FromDocType, FromDocNo, FromLineNo, ToDocType, ToDocNo, ToLineNo, StartDate);
- end;
-
- local procedure CopyPostedDeferrals(DeferralDocType: Enum "Deferral Document Type"; FromDocType: Integer;
- FromDocNo: Code[20];
- FromLineNo: Integer;
- ToDocType: Integer;
- ToDocNo: Code[20];
- ToLineNo: Integer) StartDate: Date
- var
- PostedDeferralHeader: Record "Posted Deferral Header";
- PostedDeferralLine: Record "Posted Deferral Line";
- DeferralHeader: Record "Deferral Header";
- DeferralLine: Record "Deferral Line";
- SalesCommentLine: Record "Sales Comment Line";
- InitialAmountToDefer: Decimal;
- begin
- StartDate := 0D;
- if PostedDeferralHeader.Get(DeferralDocType, '', '',
- FromDocType, FromDocNo, FromLineNo)
- then begin
- RemoveDefaultDeferralCode(DeferralDocType, ToDocType, ToDocNo, ToLineNo);
- InitialAmountToDefer := 0;
- DeferralHeader.Init();
- DeferralHeader.TransferFields(PostedDeferralHeader);
- DeferralHeader."Document Type" := ToDocType;
- DeferralHeader."Document No." := ToDocNo;
- DeferralHeader."Line No." := ToLineNo;
- OnCopyPostedDeferralsOnBeforeDeferralHeaderInsert(DeferralHeader, PostedDeferralHeader);
- DeferralHeader.Insert();
- PostedDeferralLine.SetRange("Deferral Doc. Type", DeferralDocType);
- PostedDeferralLine.SetRange("Gen. Jnl. Document No.", '');
- PostedDeferralLine.SetRange("Account No.", '');
- PostedDeferralLine.SetRange("Document Type", FromDocType);
- PostedDeferralLine.SetRange("Document No.", FromDocNo);
- PostedDeferralLine.SetRange("Line No.", FromLineNo);
- if PostedDeferralLine.FindSet() then
- repeat
- DeferralLine.Init();
- DeferralLine.TransferFields(PostedDeferralLine);
- DeferralLine."Document Type" := ToDocType;
- DeferralLine."Document No." := ToDocNo;
- DeferralLine."Line No." := ToLineNo;
- if PostedDeferralLine."Amount (LCY)" <> 0.0 then
- InitialAmountToDefer := InitialAmountToDefer + PostedDeferralLine."Amount (LCY)"
- else
- InitialAmountToDefer := InitialAmountToDefer + PostedDeferralLine.Amount;
- OnCopyPostedDeferralsOnBeforeDeferralLineInsert(DeferralLine, PostedDeferralLine);
- DeferralLine.Insert();
- until PostedDeferralLine.Next() = 0;
- if ToDocType = SalesCommentLine."Document Type"::"Return Order".AsInteger() then
- StartDate := PostedDeferralHeader."Start Date";
- if DeferralHeader.Get(DeferralDocType, '', '', ToDocType, ToDocNo, ToLineNo) then begin
- DeferralHeader."Initial Amount to Defer" := InitialAmountToDefer;
- OnCopyPostedDeferralsOnBeforeDeferralHeaderModify(DeferralHeader);
- DeferralHeader.Modify();
- end;
- end;
-
- OnAfterCopyPostedDeferrals(DeferralDocType, FromDocType, FromDocNo, FromLineNo, ToDocType, ToDocNo, ToLineNo, StartDate);
- end;
-
- local procedure IsDeferralToBeCopied(DeferralDocType: Enum "Deferral Document Type"; ToDocType: Option;
- FromCommentDocType: Option) Result: Boolean
- var
- SalesLine: Record "Sales Line";
- SalesCommentLine: Record "Sales Comment Line";
- PurchLine: Record "Purchase Line";
- PurchCommentLine: Record "Purch. Comment Line";
- DeferralHeader: Record "Deferral Header";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeIsDeferralToBeCopied(DeferralDocType, ToDocType, FromCommentDocType, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if DeferralDocType = DeferralHeader."Deferral Doc. Type"::Sales then
- case ToDocType of
- SalesLine."Document Type"::Order.AsInteger(),
- SalesLine."Document Type"::Invoice.AsInteger(),
- SalesLine."Document Type"::"Credit Memo".AsInteger(),
- SalesLine."Document Type"::"Return Order".AsInteger():
- case FromCommentDocType of
- SalesCommentLine."Document Type"::Order.AsInteger(),
- SalesCommentLine."Document Type"::Invoice.AsInteger(),
- SalesCommentLine."Document Type"::"Credit Memo".AsInteger(),
- SalesCommentLine."Document Type"::"Return Order".AsInteger(),
- SalesCommentLine."Document Type"::"Posted Invoice".AsInteger(),
- SalesCommentLine."Document Type"::"Posted Credit Memo".AsInteger():
- exit(true)
- end;
- end
- else
- if DeferralDocType = DeferralHeader."Deferral Doc. Type"::Purchase then
- case ToDocType of
- PurchLine."Document Type"::Order.AsInteger(),
- PurchLine."Document Type"::Invoice.AsInteger(),
- PurchLine."Document Type"::"Credit Memo".AsInteger(),
- PurchLine."Document Type"::"Return Order".AsInteger():
- case FromCommentDocType of
- PurchCommentLine."Document Type"::Order.AsInteger(),
- PurchCommentLine."Document Type"::Invoice.AsInteger(),
- PurchCommentLine."Document Type"::"Credit Memo".AsInteger(),
- PurchCommentLine."Document Type"::"Return Order".AsInteger(),
- PurchCommentLine."Document Type"::"Posted Invoice".AsInteger(),
- PurchCommentLine."Document Type"::"Posted Credit Memo".AsInteger():
- exit(true)
- end;
- end;
-
- exit(false);
- end;
-
- local procedure IsDeferralToBeDefaulted(DeferralDocType: Enum "Deferral Document Type"; ToDocType: Option;
- FromCommentDocType: Option) Result: Boolean
- var
- SalesLine: Record "Sales Line";
- SalesCommentLine: Record "Sales Comment Line";
- PurchLine: Record "Purchase Line";
- PurchCommentLine: Record "Purch. Comment Line";
- DeferralHeader: Record "Deferral Header";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeIsDeferralToBeDefaulted(DeferralDocType, ToDocType, FromCommentDocType, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- if DeferralDocType = DeferralHeader."Deferral Doc. Type"::Sales then
- case ToDocType of
- SalesLine."Document Type"::Order.AsInteger(),
- SalesLine."Document Type"::Invoice.AsInteger(),
- SalesLine."Document Type"::"Credit Memo".AsInteger(),
- SalesLine."Document Type"::"Return Order".AsInteger():
- case FromCommentDocType of
- SalesCommentLine."Document Type"::Quote.AsInteger(),
- SalesCommentLine."Document Type"::"Blanket Order".AsInteger(),
- SalesCommentLine."Document Type"::Shipment.AsInteger(),
- SalesCommentLine."Document Type"::"Posted Return Receipt".AsInteger():
- exit(true)
- end;
- end
- else
- if DeferralDocType = DeferralHeader."Deferral Doc. Type"::Purchase then
- case ToDocType of
- PurchLine."Document Type"::Order.AsInteger(),
- PurchLine."Document Type"::Invoice.AsInteger(),
- PurchLine."Document Type"::"Credit Memo".AsInteger(),
- PurchLine."Document Type"::"Return Order".AsInteger():
- case FromCommentDocType of
- PurchCommentLine."Document Type"::Quote.AsInteger(),
- PurchCommentLine."Document Type"::"Blanket Order".AsInteger(),
- PurchCommentLine."Document Type"::Receipt.AsInteger(),
- PurchCommentLine."Document Type"::"Posted Return Shipment".AsInteger():
- exit(true)
- end;
- end;
-
- exit(false);
- end;
-
- local procedure IsDeferralPosted(DeferralDocType: Enum "Deferral Document Type"; FromCommentDocType: Option): Boolean
- var
- SalesCommentLine: Record "Sales Comment Line";
- PurchCommentLine: Record "Purch. Comment Line";
- DeferralHeader: Record "Deferral Header";
- begin
- if DeferralDocType = DeferralHeader."Deferral Doc. Type"::Sales then
- case FromCommentDocType of
- SalesCommentLine."Document Type"::Shipment.AsInteger(),
- SalesCommentLine."Document Type"::"Posted Invoice".AsInteger(),
- SalesCommentLine."Document Type"::"Posted Credit Memo".AsInteger(),
- SalesCommentLine."Document Type"::"Posted Return Receipt".AsInteger():
- exit(true);
- end
- else
- if DeferralDocType = DeferralHeader."Deferral Doc. Type"::Purchase then
- case FromCommentDocType of
- PurchCommentLine."Document Type"::Receipt.AsInteger(),
- PurchCommentLine."Document Type"::"Posted Invoice".AsInteger(),
- PurchCommentLine."Document Type"::"Posted Credit Memo".AsInteger(),
- PurchCommentLine."Document Type"::"Posted Return Shipment".AsInteger():
- exit(true);
- end;
-
- exit(false);
- end;
-
- local procedure InitSalesDeferralCode(var ToSalesLine: Record "Sales Line")
- var
- GLAccount: Record "G/L Account";
- Item: Record Item;
- Resource: Record Resource;
- begin
- if ToSalesLine."No." = '' then
- exit;
-
- case ToSalesLine."Document Type" of
- ToSalesLine."Document Type"::Order,
- ToSalesLine."Document Type"::Invoice,
- ToSalesLine."Document Type"::"Credit Memo",
- ToSalesLine."Document Type"::"Return Order":
- case ToSalesLine.Type of
- ToSalesLine.Type::"G/L Account":
- begin
- GLAccount.Get(ToSalesLine."No.");
- ToSalesLine.Validate("Deferral Code", GLAccount."Default Deferral Template Code");
- end;
- ToSalesLine.Type::Item:
- begin
- Item.Get(ToSalesLine."No.");
- ToSalesLine.Validate("Deferral Code", Item."Default Deferral Template Code");
- end;
- ToSalesLine.Type::Resource:
- begin
- Resource.Get(ToSalesLine."No.");
- ToSalesLine.Validate("Deferral Code", Resource."Default Deferral Template Code");
- end;
- end;
- end;
- end;
-
- local procedure InitFromSalesLine(var FromSalesLine2: Record "Sales Line"; var FromSalesLineBuf: Record "Sales Line")
- begin
- // Empty buffer fields
- FromSalesLine2 := FromSalesLineBuf;
- FromSalesLine2."Shipment No." := '';
- FromSalesLine2."Shipment Line No." := 0;
- FromSalesLine2."Return Receipt No." := '';
- FromSalesLine2."Return Receipt Line No." := 0;
-
- OnAfterInitFromSalesLine(FromSalesLine2, FromSalesLineBuf);
- end;
-
- local procedure CleanSpecialOrderDropShipmentInSalesLine(var SalesLine: Record "Sales Line")
- begin
- SalesLine."Purchase Order No." := '';
- SalesLine."Purch. Order Line No." := 0;
- SalesLine."Special Order Purchase No." := '';
- SalesLine."Special Order Purch. Line No." := 0;
-
- OnAfterCleanSpecialOrderDropShipmentInSalesLine(SalesLine);
- end;
-
- local procedure CleanSpecialOrderDropShipmentInPurchLine(var PurchaseLine: Record "Purchase Line")
- begin
- PurchaseLine."Sales Order No." := '';
- PurchaseLine."Sales Order Line No." := 0;
- PurchaseLine."Special Order Sales No." := '';
- PurchaseLine."Special Order Sales Line No." := 0;
- PurchaseLine."Drop Shipment" := false;
- PurchaseLine."Special Order" := false;
- end;
-
- local procedure RemoveDefaultDeferralCode(DeferralDocType: Enum "Deferral Document Type"; DocType: Integer;
- DocNo: Code[20];
- LineNo: Integer)
- var
- DeferralHeader: Record "Deferral Header";
- DeferralLine: Record "Deferral Line";
- begin
- if DeferralHeader.Get(DeferralDocType, '', '', DocType, DocNo, LineNo) then
- DeferralHeader.Delete();
-
- DeferralLine.SetRange("Deferral Doc. Type", DeferralDocType);
- DeferralLine.SetRange("Gen. Jnl. Template Name", '');
- DeferralLine.SetRange("Gen. Jnl. Batch Name", '');
- DeferralLine.SetRange("Document Type", DocType);
- DeferralLine.SetRange("Document No.", DocNo);
- DeferralLine.SetRange("Line No.", LineNo);
- DeferralLine.DeleteAll();
- end;
-
- procedure DeferralTypeForSalesDoc(DocType: Option): Integer
- var
- SalesCommentLine: Record "Sales Comment Line";
- begin
- case DocType of
- "Sales Document Type From"::Quote.AsInteger():
- exit(SalesCommentLine."Document Type"::Quote.AsInteger());
- "Sales Document Type From"::"Blanket Order".AsInteger():
- exit(SalesCommentLine."Document Type"::"Blanket Order".AsInteger());
- "Sales Document Type From"::Order.AsInteger():
- exit(SalesCommentLine."Document Type"::Order.AsInteger());
- "Sales Document Type From"::Invoice.AsInteger():
- exit(SalesCommentLine."Document Type"::Invoice.AsInteger());
- "Sales Document Type From"::"Return Order".AsInteger():
- exit(SalesCommentLine."Document Type"::"Return Order".AsInteger());
- "Sales Document Type From"::"Credit Memo".AsInteger():
- exit(SalesCommentLine."Document Type"::"Credit Memo".AsInteger());
- "Sales Document Type From"::"Posted Shipment".AsInteger():
- exit(SalesCommentLine."Document Type"::Shipment.AsInteger());
- "Sales Document Type From"::"Posted Invoice".AsInteger():
- exit(SalesCommentLine."Document Type"::"Posted Invoice".AsInteger());
- "Sales Document Type From"::"Posted Return Receipt".AsInteger():
- exit(SalesCommentLine."Document Type"::"Posted Return Receipt".AsInteger());
- "Sales Document Type From"::"Posted Credit Memo".AsInteger():
- exit(SalesCommentLine."Document Type"::"Posted Credit Memo".AsInteger());
- end;
- end;
-
- procedure DeferralTypeForPurchDoc(DocType: Option): Integer
- var
- PurchCommentLine: Record "Purch. Comment Line";
- begin
- case DocType of
- "Purchase Document Type From"::Quote.AsInteger():
- exit(PurchCommentLine."Document Type"::Quote.AsInteger());
- "Purchase Document Type From"::"Blanket Order".AsInteger():
- exit(PurchCommentLine."Document Type"::"Blanket Order".AsInteger());
- "Purchase Document Type From"::Order.AsInteger():
- exit(PurchCommentLine."Document Type"::Order.AsInteger());
- "Purchase Document Type From"::Invoice.AsInteger():
- exit(PurchCommentLine."Document Type"::Invoice.AsInteger());
- "Purchase Document Type From"::"Return Order".AsInteger():
- exit(PurchCommentLine."Document Type"::"Return Order".AsInteger());
- "Purchase Document Type From"::"Credit Memo".AsInteger():
- exit(PurchCommentLine."Document Type"::"Credit Memo".AsInteger());
- "Purchase Document Type From"::"Posted Receipt".AsInteger():
- exit(PurchCommentLine."Document Type"::Receipt.AsInteger());
- "Purchase Document Type From"::"Posted Invoice".AsInteger():
- exit(PurchCommentLine."Document Type"::"Posted Invoice".AsInteger());
- "Purchase Document Type From"::"Posted Return Shipment".AsInteger():
- exit(PurchCommentLine."Document Type"::"Posted Return Shipment".AsInteger());
- "Purchase Document Type From"::"Posted Credit Memo".AsInteger():
- exit(PurchCommentLine."Document Type"::"Posted Credit Memo".AsInteger());
- end;
- end;
-
- local procedure InitPurchDeferralCode(var ToPurchLine: Record "Purchase Line")
- begin
- if ToPurchLine."No." = '' then
- exit;
-
- case ToPurchLine."Document Type" of
- ToPurchLine."Document Type"::Order,
- ToPurchLine."Document Type"::Invoice,
- ToPurchLine."Document Type"::"Credit Memo",
- ToPurchLine."Document Type"::"Return Order":
- ToPurchLine.InitDeferralCode();
- end;
- end;
-
- local procedure CopySalesPostedDeferrals(ToSalesLine: Record "Sales Line"; DeferralDocType: Enum "Deferral Document Type"; FromDocType: Integer;
- FromDocNo: Code[20];
- FromLineNo: Integer;
- ToDocType: Integer;
- ToDocNo: Code[20];
- ToLineNo: Integer)
- begin
- ToSalesLine."Returns Deferral Start Date" :=
- CopyPostedDeferrals(
- DeferralDocType, FromDocType, FromDocNo, FromLineNo, ToDocType, ToDocNo, ToLineNo);
- ToSalesLine.Modify();
- end;
-
- local procedure CopyPurchPostedDeferrals(ToPurchaseLine: Record "Purchase Line"; DeferralDocType: Enum "Deferral Document Type"; FromDocType: Integer;
- FromDocNo: Code[20];
- FromLineNo: Integer;
- ToDocType: Integer;
- ToDocNo: Code[20];
- ToLineNo: Integer)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCopyPurchPostedDeferrals(ToPurchaseLine, IsHandled);
- if IsHandled then
- exit;
-
- ToPurchaseLine."Returns Deferral Start Date" :=
- CopyPostedDeferrals(
- DeferralDocType, FromDocType, FromDocNo, FromLineNo, ToDocType, ToDocNo, ToLineNo);
- ToPurchaseLine.Modify();
- end;
-
- procedure CheckDateOrder(PostingNo: Code[20]; PostingNoSeries: Code[20]; OldPostingDate: Date; NewPostingDate: Date): Boolean
- var
- NoSeries: Record "No. Series";
- ConfirmManagement: Codeunit "Confirm Management";
- begin
- if IncludeHeader then
- if (PostingNo <> '') and (OldPostingDate <> NewPostingDate) then
- if NoSeries.Get(PostingNoSeries) then
- if NoSeries."Date Order" then
- exit(ConfirmManagement.GetResponseOrDefault(DiffPostDateOrderQst, true));
- exit(true)
- end;
-
- local procedure CheckSalesDocItselfCopy(FromSalesHeader: Record "Sales Header"; ToSalesHeader: Record "Sales Header")
- begin
- if (FromSalesHeader."Document Type" = ToSalesHeader."Document Type") and
- (FromSalesHeader."No." = ToSalesHeader."No.")
- then
- Error(Text001, ToSalesHeader."Document Type", ToSalesHeader."No.");
- end;
-
- local procedure CheckPurchDocItselfCopy(FromPurchHeader: Record "Purchase Header"; ToPurchHeader: Record "Purchase Header")
- begin
- if (FromPurchHeader."Document Type" = ToPurchHeader."Document Type") and
- (FromPurchHeader."No." = ToPurchHeader."No.")
- then
- Error(Text001, ToPurchHeader."Document Type", ToPurchHeader."No.");
- end;
-
- procedure UpdateCustLedgerEntry(var ToSalesHeader: Record "Sales Header"; FromDocType: Enum "Gen. Journal Document Type"; FromDocNo: Code[20])
- var
- CustLedgEntry: Record "Cust. Ledger Entry";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateCustLedgEntry(ToSalesHeader, CustLedgEntry, IsHandled, FromDocType, FromDocNo);
- if IsHandled then
- exit;
-
- CustLedgEntry.SetCurrentKey("Document No.");
- if FromDocType = "Sales Document Type From"::"Posted Invoice" then
- CustLedgEntry.SetRange("Document Type", CustLedgEntry."Document Type"::Invoice)
- else
- CustLedgEntry.SetRange("Document Type", CustLedgEntry."Document Type"::"Credit Memo");
- CustLedgEntry.SetRange("Document No.", FromDocNo);
- CustLedgEntry.SetRange("Customer No.", ToSalesHeader."Bill-to Customer No.");
- CustLedgEntry.SetRange(Open, true);
- if CustLedgEntry.FindFirst() then begin
- ToSalesHeader."Bal. Account No." := '';
- if FromDocType = "Sales Document Type From"::"Posted Invoice" then begin
- ToSalesHeader."Applies-to Doc. Type" := ToSalesHeader."Applies-to Doc. Type"::Invoice;
- ToSalesHeader."Applies-to Doc. No." := FromDocNo;
- end else begin
- ToSalesHeader."Applies-to Doc. Type" := ToSalesHeader."Applies-to Doc. Type"::"Credit Memo";
- ToSalesHeader."Applies-to Doc. No." := FromDocNo;
- end;
- CustLedgEntry.CalcFields("Remaining Amount");
- CustLedgEntry."Amount to Apply" := CustLedgEntry."Remaining Amount";
- CustLedgEntry."Accepted Payment Tolerance" := 0;
- CustLedgEntry."Accepted Pmt. Disc. Tolerance" := false;
- CODEUNIT.Run(CODEUNIT::"Cust. Entry-Edit", CustLedgEntry);
- end;
-
- OnAfterUpdateCustLedgerEntry(ToSalesHeader, FromDocType, FromDocNo, CustLedgEntry);
- end;
-
- procedure UpdateVendLedgEntry(var ToPurchHeader: Record "Purchase Header"; FromDocType: Enum "Gen. Journal Document Type"; FromDocNo: Code[20])
- var
- VendLedgEntry: Record "Vendor Ledger Entry";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateVendLedgEntry(ToPurchHeader, VendLedgEntry, IsHandled, FromDocType, FromDocNo);
- if not IsHandled then begin
- VendLedgEntry.SetCurrentKey("Document No.");
- if FromDocType = "Purchase Document Type From"::"Posted Invoice" then
- VendLedgEntry.SetRange("Document Type", VendLedgEntry."Document Type"::Invoice)
- else
- VendLedgEntry.SetRange("Document Type", VendLedgEntry."Document Type"::"Credit Memo");
- VendLedgEntry.SetRange("Document No.", FromDocNo);
- VendLedgEntry.SetRange("Vendor No.", ToPurchHeader."Pay-to Vendor No.");
- VendLedgEntry.SetRange(Open, true);
- if VendLedgEntry.FindFirst() then begin
- if FromDocType = "Purchase Document Type From"::"Posted Invoice" then begin
- ToPurchHeader."Applies-to Doc. Type" := ToPurchHeader."Applies-to Doc. Type"::Invoice;
- ToPurchHeader."Applies-to Doc. No." := FromDocNo;
- end else begin
- ToPurchHeader."Applies-to Doc. Type" := ToPurchHeader."Applies-to Doc. Type"::"Credit Memo";
- ToPurchHeader."Applies-to Doc. No." := FromDocNo;
- end;
- VendLedgEntry.CalcFields("Remaining Amount");
- VendLedgEntry."Amount to Apply" := VendLedgEntry."Remaining Amount";
- VendLedgEntry."Accepted Payment Tolerance" := 0;
- VendLedgEntry."Accepted Pmt. Disc. Tolerance" := false;
- CODEUNIT.Run(CODEUNIT::"Vend. Entry-Edit", VendLedgEntry);
- end;
- end;
-
- OnAfterUpdateVendLedgEntry(ToPurchHeader, FromDocNo, FromDocType, VendLedgEntry);
- end;
-
- local procedure UpdatePurchCreditMemoHeader(var PurchaseHeader: Record "Purchase Header")
- var
- PaymentTerms: Record "Payment Terms";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdatePurchCreditMemoHeader(PurchaseHeader, IsHandled);
- if IsHandled then
- exit;
-
- PurchaseHeader."Expected Receipt Date" := 0D;
- GLSetup.Get();
- PurchaseHeader.Correction := GLSetup."Mark Cr. Memos as Corrections";
- if (PurchaseHeader."Payment Terms Code" <> '') and (PurchaseHeader."Document Date" <> 0D) then
- PaymentTerms.Get(PurchaseHeader."Payment Terms Code")
- else
- Clear(PaymentTerms);
- if not PaymentTerms."Calc. Pmt. Disc. on Cr. Memos" then begin
- PurchaseHeader."Payment Discount %" := 0;
- PurchaseHeader."Pmt. Discount Date" := 0D;
- end;
-
- OnAfterUpdatePurchCreditMemoHeader(PurchaseHeader);
- end;
-
- local procedure UpdateSalesCreditMemoHeader(var SalesHeader: Record "Sales Header")
- var
- PaymentTerms: Record "Payment Terms";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeUpdateSalesCreditMemoHeader(SalesHeader, IsHandled);
- if IsHandled then
- exit;
-
- GLSetup.Get();
- SalesHeader.Correction := GLSetup."Mark Cr. Memos as Corrections";
-
- IsHandled := false;
- OnUpdateSalesCreditMemoHeaderOnBeforeSetShipmentDate(SalesHeader, IsHandled);
- if not IsHandled then
- SalesHeader."Shipment Date" := 0D;
-
- if (SalesHeader."Payment Terms Code" <> '') and (SalesHeader."Document Date" <> 0D) then
- PaymentTerms.Get(SalesHeader."Payment Terms Code")
- else
- Clear(PaymentTerms);
- if not PaymentTerms."Calc. Pmt. Disc. on Cr. Memos" then begin
- SalesHeader."Payment Discount %" := 0;
- SalesHeader."Pmt. Discount Date" := 0D;
- end;
- end;
-
- local procedure UpdateSalesInvoiceDiscountValue(var SalesHeader: Record "Sales Header")
- begin
- if IncludeHeader and RecalculateLines then begin
- SalesHeader.CalcFields(Amount);
- if SalesHeader."Invoice Discount Value" > SalesHeader.Amount then begin
- SalesHeader."Invoice Discount Value" := SalesHeader.Amount;
- SalesHeader.Modify();
- end;
- end;
- end;
-
- local procedure UpdatePurchaseInvoiceDiscountValue(var PurchaseHeader: Record "Purchase Header")
- begin
- if IncludeHeader and RecalculateLines then begin
- PurchaseHeader.CalcFields(Amount);
- if PurchaseHeader."Invoice Discount Value" > PurchaseHeader.Amount then begin
- PurchaseHeader."Invoice Discount Value" := PurchaseHeader.Amount;
- PurchaseHeader.Modify();
- end;
- end;
- end;
-
- local procedure ExtTxtAttachedToPosSalesLine(SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"): Boolean
- var
- AttachedToSalesLine: Record "Sales Line";
- begin
- if MoveNegLines then
- if SalesLine.IsExtendedText() then
- if AttachedToSalesLine.Get(SalesHeader."Document Type", SalesHeader."No.", SalesLine."Attached to Line No.") then
- if AttachedToSalesLine.Quantity >= 0 then
- exit(true);
-
- exit(false);
- end;
-
- local procedure ExtTxtAttachedToPosPurchLine(PurchHeader: Record "Purchase Header"; PurchLine: Record "Purchase Line"): Boolean
- var
- AttachedToPurchLine: Record "Purchase Line";
- begin
- if MoveNegLines then
- if PurchLine.IsExtendedText() then
- if AttachedToPurchLine.Get(PurchHeader."Document Type", PurchHeader."No.", PurchLine."Attached to Line No.") then
- if AttachedToPurchLine.Quantity >= 0 then
- exit(true);
-
- exit(false);
- end;
-
- local procedure SalesDocCanReceiveTracking(SalesHeader: Record "Sales Header"): Boolean
- begin
- exit(
- (SalesHeader."Document Type" <> SalesHeader."Document Type"::Quote) and
- (SalesHeader."Document Type" <> SalesHeader."Document Type"::"Blanket Order"));
- end;
-
- local procedure PurchaseDocCanReceiveTracking(PurchaseHeader: Record "Purchase Header"): Boolean
- begin
- exit(
- (PurchaseHeader."Document Type" <> PurchaseHeader."Document Type"::Quote) and
- (PurchaseHeader."Document Type" <> PurchaseHeader."Document Type"::"Blanket Order"));
- end;
-
- local procedure CheckFirstLineShipped(ToSalesHeader: Record "Sales Header"; var TempSalesLine: Record "Sales Line" temporary; var SalesCombDocLineNo: Integer; var NextLineNo: Integer; var FirstLineShipped: Boolean)
- var
- ShouldIncrementNextLineNo: Boolean;
- begin
- if (TempSalesLine."Document No." = '') and (TempSalesLine."Shipment Line No." = 0) and FirstLineShipped then begin
- FirstLineShipped := false;
- SalesCombDocLineNo := NextLineNo;
-
- ShouldIncrementNextLineNo := true;
- OnCheckFirstLineShippedOnBeforeIncrementNextLineNo(ToSalesHeader, TempSalesLine, ShouldIncrementNextLineNo, NextLineNo);
- if ShouldIncrementNextLineNo then
- NextLineNo := NextLineNo + 10000;
- end;
- end;
-
- local procedure SetTempSalesInvLine(FromSalesInvoiceLine: Record "Sales Invoice Line"; var TempSalesInvoiceLine: Record "Sales Invoice Line" temporary; var SalesInvLineCount: Integer; var NextLineNo: Integer; var FirstLineText: Boolean)
- begin
- if FromSalesInvoiceLine.Type = FromSalesInvoiceLine.Type::Item then begin
- SalesInvLineCount += 1;
- TempSalesInvoiceLine := FromSalesInvoiceLine;
- TempSalesInvoiceLine.Insert();
- if FirstLineText then begin
- NextLineNo := NextLineNo + 10000;
- FirstLineText := false;
- end;
- end else
- if FromSalesInvoiceLine.Type = FromSalesInvoiceLine.Type::" " then
- FirstLineText := true;
- end;
-
- procedure InitAndCheckSalesDocuments(FromDocType: Option; FromDocNo: Code[20]; var FromSalesHeader: Record "Sales Header"; var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesShipmentHeader: Record "Sales Shipment Header"; var FromSalesInvoiceHeader: Record "Sales Invoice Header"; var FromReturnReceiptHeader: Record "Return Receipt Header"; var FromSalesCrMemoHeader: Record "Sales Cr.Memo Header"; var FromSalesHeaderArchive: Record "Sales Header Archive") Result: Boolean
- var
- FromDocType2: Enum "Sales Document Type From";
- IsHandled: Boolean;
- SkipFromSalesHeaderArchiveCheck: Boolean;
- begin
- FromDocType2 := "Sales Document Type From".FromInteger(FromDocType);
-
- IsHandled := false;
- OnBeforeInitAndCheckSalesDocuments(FromDocType2, FromDocNo, FromDocOccurrenceNo, FromDocVersionNo, FromSalesHeader, ToSalesHeader, ToSalesLine, MoveNegLines, IncludeHeader, RecalculateLines, Result, IsHandled);
- if IsHandled then
- exit(Result);
-
- case FromDocType2 of
- "Sales Document Type From"::Quote,
- "Sales Document Type From"::"Blanket Order",
- "Sales Document Type From"::Order,
- "Sales Document Type From"::Invoice,
- "Sales Document Type From"::"Return Order",
- "Sales Document Type From"::"Credit Memo":
- begin
- FromSalesHeader.Get(GetSalesDocumentType(FromDocType2), FromDocNo);
- if not CheckDateOrder(
- ToSalesHeader."Posting No.", ToSalesHeader."Posting No. Series",
- ToSalesHeader."Posting Date", FromSalesHeader."Posting Date")
- then
- exit(false);
- if MoveNegLines then begin
- DeleteSalesLinesWithNegQty(FromSalesHeader, true);
- OnInitAndCheckSalesDocumentsOnAfterDelNegLines(ToSalesHeader, FromSalesHeader);
- end;
- CheckSalesDocItselfCopy(ToSalesHeader, FromSalesHeader);
-
- OnInitAndCheckSalesDocumentsOnAfterCheckSalesDocItselfCopy(ToSalesHeader, FromSalesHeader);
-
- if ToSalesHeader."Document Type".AsInteger() <= ToSalesHeader."Document Type"::Invoice.AsInteger() then begin
- FromSalesHeader.CalcFields("Amount Including VAT");
- ToSalesHeader."Amount Including VAT" := FromSalesHeader."Amount Including VAT";
-
- IsHandled := false;
- OnInitAndCheckSalesDocumentsOnBeforeCheckCreditLimit(FromSalesHeader, ToSalesHeader, IsHandled);
- if not IsHandled then
- CheckCreditLimit(FromSalesHeader, ToSalesHeader, FromDocType2);
- end;
- CheckCopyFromSalesHeaderAvail(FromSalesHeader, ToSalesHeader);
-
- if not IncludeHeader and not RecalculateLines then
- CheckFromSalesHeader(FromSalesHeader, ToSalesHeader);
- end;
- "Sales Document Type From"::"Posted Shipment":
- begin
- FromSalesShipmentHeader.Get(FromDocNo);
- if not CheckDateOrder(
- ToSalesHeader."Posting No.", ToSalesHeader."Posting No. Series",
- ToSalesHeader."Posting Date", FromSalesShipmentHeader."Posting Date")
- then
- exit(false);
- CheckCopyFromSalesShptAvail(FromSalesShipmentHeader, ToSalesHeader);
-
- if not IncludeHeader and not RecalculateLines then
- CheckFromSalesShptHeader(FromSalesShipmentHeader, ToSalesHeader);
- end;
- "Sales Document Type From"::"Posted Invoice":
- begin
- FromSalesInvoiceHeader.Get(FromDocNo);
- FromSalesInvoiceHeader.TestField("Prepayment Invoice", false);
- WarnSalesInvoicePmtDisc(ToSalesHeader, FromDocType2, FromDocNo);
- if not CheckDateOrder(
- ToSalesHeader."Posting No.", ToSalesHeader."Posting No. Series",
- ToSalesHeader."Posting Date", FromSalesInvoiceHeader."Posting Date")
- then
- exit(false);
- if ToSalesHeader."Document Type".AsInteger() <= ToSalesHeader."Document Type"::Invoice.AsInteger() then begin
- FromSalesInvoiceHeader.CalcFields("Amount Including VAT");
- ToSalesHeader."Amount Including VAT" := FromSalesInvoiceHeader."Amount Including VAT";
- if IncludeHeader then
- FromSalesHeader.TransferFields(FromSalesInvoiceHeader);
- CheckCreditLimit(FromSalesHeader, ToSalesHeader, FromDocType2);
- end;
- CheckCopyFromSalesInvoiceAvail(FromSalesInvoiceHeader, ToSalesHeader);
-
- if not IncludeHeader and not RecalculateLines then
- CheckFromSalesInvHeader(FromSalesInvoiceHeader, ToSalesHeader);
- end;
- "Sales Document Type From"::"Posted Return Receipt":
- begin
- FromReturnReceiptHeader.Get(FromDocNo);
- if not CheckDateOrder(
- ToSalesHeader."Posting No.", ToSalesHeader."Posting No. Series",
- ToSalesHeader."Posting Date", FromReturnReceiptHeader."Posting Date")
- then
- exit(false);
- CheckCopyFromSalesRetRcptAvail(FromReturnReceiptHeader, ToSalesHeader);
-
- if not IncludeHeader and not RecalculateLines then
- CheckFromSalesReturnRcptHeader(FromReturnReceiptHeader, ToSalesHeader);
- end;
- "Sales Document Type From"::"Posted Credit Memo":
- begin
- FromSalesCrMemoHeader.Get(FromDocNo);
- FromSalesCrMemoHeader.TestField("Prepayment Credit Memo", false);
- WarnSalesInvoicePmtDisc(ToSalesHeader, FromDocType2, FromDocNo);
- if not CheckDateOrder(
- ToSalesHeader."Posting No.", ToSalesHeader."Posting No. Series",
- ToSalesHeader."Posting Date", FromSalesCrMemoHeader."Posting Date")
- then
- exit(false);
- if ToSalesHeader."Document Type".AsInteger() <= ToSalesHeader."Document Type"::Invoice.AsInteger() then begin
- FromSalesCrMemoHeader.CalcFields("Amount Including VAT");
- ToSalesHeader."Amount Including VAT" := FromSalesCrMemoHeader."Amount Including VAT";
- if IncludeHeader then
- FromSalesHeader.TransferFields(FromSalesCrMemoHeader);
- CheckCreditLimit(FromSalesHeader, ToSalesHeader, FromDocType2);
- end;
- CheckCopyFromSalesCrMemoAvail(FromSalesCrMemoHeader, ToSalesHeader);
-
- if not IncludeHeader and not RecalculateLines then
- CheckFromSalesCrMemoHeader(FromSalesCrMemoHeader, ToSalesHeader);
- end;
- "Sales Document Type From"::"Arch. Quote",
- "Sales Document Type From"::"Arch. Order",
- "Sales Document Type From"::"Arch. Blanket Order",
- "Sales Document Type From"::"Arch. Return Order":
- begin
- FromSalesHeaderArchive.Get(GetSalesDocumentType(FromDocType2), FromDocNo, FromDocOccurrenceNo, FromDocVersionNo);
- if FromDocType2.AsInteger() <= "Sales Document Type From"::Invoice.AsInteger() then begin
- FromSalesHeaderArchive.CalcFields("Amount Including VAT");
- ToSalesHeader."Amount Including VAT" := FromSalesHeaderArchive."Amount Including VAT";
- CustCheckCreditLimit.SalesHeaderCheck(ToSalesHeader);
- end;
-
- CheckCopyFromSalesHeaderArchiveAvail(FromSalesHeaderArchive, ToSalesHeader);
-
- SkipFromSalesHeaderArchiveCheck := false;
- OnInitAndCheckSalesDocumentsOnBeforeFromSalesHeaderArchiveCheckFields(FromSalesHeaderArchive, ToSalesHeader, IncludeHeader, RecalculateLines, SkipFromSalesHeaderArchiveCheck);
- if not IncludeHeader and not RecalculateLines and not SkipFromSalesHeaderArchiveCheck then begin
- FromSalesHeaderArchive.TestField("Sell-to Customer No.", ToSalesHeader."Sell-to Customer No.");
- FromSalesHeaderArchive.TestField("Bill-to Customer No.", ToSalesHeader."Bill-to Customer No.");
- FromSalesHeaderArchive.TestField("Customer Posting Group", ToSalesHeader."Customer Posting Group");
- FromSalesHeaderArchive.TestField("Gen. Bus. Posting Group", ToSalesHeader."Gen. Bus. Posting Group");
- FromSalesHeaderArchive.TestField("Currency Code", ToSalesHeader."Currency Code");
- FromSalesHeaderArchive.TestField("Prices Including VAT", ToSalesHeader."Prices Including VAT");
- end;
- end;
- end;
-
- OnAfterInitAndCheckSalesDocuments(
- FromDocType, FromDocNo, FromDocOccurrenceNo, FromDocVersionNo,
- FromSalesHeader, ToSalesHeader, ToSalesLine,
- FromSalesShipmentHeader, FromSalesInvoiceHeader, FromReturnReceiptHeader, FromSalesCrMemoHeader, FromSalesHeaderArchive,
- IncludeHeader, RecalculateLines);
-
- exit(true);
- end;
-
- procedure InitAndCheckPurchaseDocuments(FromDocType: Option; FromDocNo: Code[20]; var FromPurchaseHeader: Record "Purchase Header"; var ToPurchaseHeader: Record "Purchase Header"; var FromPurchRcptHeader: Record "Purch. Rcpt. Header"; var FromPurchInvHeader: Record "Purch. Inv. Header"; var FromReturnShipmentHeader: Record "Return Shipment Header"; var FromPurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; var FromPurchaseHeaderArchive: Record "Purchase Header Archive"): Boolean
- var
- FromDocType2: Enum "Purchase Document Type From";
- begin
- FromDocType2 := "Purchase Document Type From".FromInteger(FromDocType);
- case FromDocType2 of
- "Purchase Document Type From"::Quote,
- "Purchase Document Type From"::"Blanket Order",
- "Purchase Document Type From"::Order,
- "Purchase Document Type From"::Invoice,
- "Purchase Document Type From"::"Return Order",
- "Purchase Document Type From"::"Credit Memo":
- begin
- FromPurchaseHeader.Get(GetPurchaseDocumentType(FromDocType2), FromDocNo);
- if not CheckDateOrder(
- ToPurchaseHeader."Posting No.", ToPurchaseHeader."Posting No. Series",
- ToPurchaseHeader."Posting Date", FromPurchaseHeader."Posting Date")
- then
- exit(false);
- if MoveNegLines then begin
- DeletePurchLinesWithNegQty(FromPurchaseHeader, true);
- OnInitAndCheckPurchaseDocumentsOnAfterDelNegLines(ToPurchaseHeader, FromPurchaseHeader);
- end;
- CheckPurchDocItselfCopy(ToPurchaseHeader, FromPurchaseHeader);
-
- OnInitAndCheckPurchaseDocumentsOnAfterCheckPurchDocItselfCopy(ToPurchaseHeader, FromPurchaseHeader);
-
- if not IncludeHeader and not RecalculateLines then
- CheckFromPurchaseHeader(FromPurchaseHeader, ToPurchaseHeader);
- end;
- "Purchase Document Type From"::"Posted Receipt":
- begin
- FromPurchRcptHeader.Get(FromDocNo);
- if not CheckDateOrder(
- ToPurchaseHeader."Posting No.", ToPurchaseHeader."Posting No. Series",
- ToPurchaseHeader."Posting Date", FromPurchRcptHeader."Posting Date")
- then
- exit(false);
- if not IncludeHeader and not RecalculateLines then
- CheckFromPurchaseRcptHeader(FromPurchRcptHeader, ToPurchaseHeader);
- end;
- "Purchase Document Type From"::"Posted Invoice":
- begin
- FromPurchInvHeader.Get(FromDocNo);
- if not CheckDateOrder(
- ToPurchaseHeader."Posting No.", ToPurchaseHeader."Posting No. Series",
- ToPurchaseHeader."Posting Date", FromPurchInvHeader."Posting Date")
- then
- exit(false);
- FromPurchInvHeader.TestField("Prepayment Invoice", false);
- WarnPurchInvoicePmtDisc(ToPurchaseHeader, FromDocType2, FromDocNo);
- if not IncludeHeader and not RecalculateLines then
- CheckFromPurchaseInvHeader(FromPurchInvHeader, ToPurchaseHeader);
- end;
- "Purchase Document Type From"::"Posted Return Shipment":
- begin
- FromReturnShipmentHeader.Get(FromDocNo);
- if not CheckDateOrder(
- ToPurchaseHeader."Posting No.", ToPurchaseHeader."Posting No. Series",
- ToPurchaseHeader."Posting Date", FromReturnShipmentHeader."Posting Date")
- then
- exit(false);
- if not IncludeHeader and not RecalculateLines then
- CheckFromPurchaseReturnShptHeader(FromReturnShipmentHeader, ToPurchaseHeader);
- end;
- "Purchase Document Type From"::"Posted Credit Memo":
- begin
- FromPurchCrMemoHdr.Get(FromDocNo);
- if not CheckDateOrder(
- ToPurchaseHeader."Posting No.", ToPurchaseHeader."Posting No. Series",
- ToPurchaseHeader."Posting Date", FromPurchCrMemoHdr."Posting Date")
- then
- exit(false);
- FromPurchCrMemoHdr.TestField("Prepayment Credit Memo", false);
- WarnPurchInvoicePmtDisc(ToPurchaseHeader, FromDocType2, FromDocNo);
- if not IncludeHeader and not RecalculateLines then
- CheckFromPurchaseCrMemoHeader(FromPurchCrMemoHdr, ToPurchaseHeader);
- end;
- "Purchase Document Type From"::"Arch. Order",
- "Purchase Document Type From"::"Arch. Quote",
- "Purchase Document Type From"::"Arch. Blanket Order",
- "Purchase Document Type From"::"Arch. Return Order":
- begin
- FromPurchaseHeaderArchive.Get(GetPurchaseDocumentType(FromDocType2), FromDocNo, FromDocOccurrenceNo, FromDocVersionNo);
- if not IncludeHeader and not RecalculateLines then begin
- FromPurchaseHeaderArchive.TestField("Buy-from Vendor No.", ToPurchaseHeader."Buy-from Vendor No.");
- FromPurchaseHeaderArchive.TestField("Pay-to Vendor No.", ToPurchaseHeader."Pay-to Vendor No.");
- FromPurchaseHeaderArchive.TestField("Vendor Posting Group", ToPurchaseHeader."Vendor Posting Group");
- FromPurchaseHeaderArchive.TestField("Gen. Bus. Posting Group", ToPurchaseHeader."Gen. Bus. Posting Group");
- FromPurchaseHeaderArchive.TestField("Currency Code", ToPurchaseHeader."Currency Code");
- end;
- end;
- end;
-
- OnAfterInitAndCheckPurchaseDocuments(
- FromDocType, FromDocNo, FromDocOccurrenceNo, FromDocVersionNo,
- FromPurchaseHeader, ToPurchaseHeader,
- FromPurchRcptHeader, FromPurchInvHeader, FromReturnShipmentHeader, FromPurchCrMemoHdr, FromPurchaseHeaderArchive,
- IncludeHeader, RecalculateLines);
-
- exit(true);
- end;
-
- procedure InitSalesLineFields(var ToSalesLine: Record "Sales Line")
- var
- IsHandled: Boolean;
- begin
- OnBeforeInitSalesLineFields(ToSalesLine);
-
- if ToSalesLine."Document Type" <> ToSalesLine."Document Type"::Order then begin
- ToSalesLine."Prepayment %" := 0;
- ToSalesLine."Prepayment VAT %" := 0;
- ToSalesLine."Prepmt. VAT Calc. Type" := "Tax Calculation Type"::"Normal VAT";
- ToSalesLine."Prepayment VAT Identifier" := '';
- ToSalesLine."Prepayment VAT %" := 0;
- ToSalesLine."Prepayment Tax Group Code" := '';
- ToSalesLine."Prepmt. Line Amount" := 0;
- ToSalesLine."Prepmt. Amt. Incl. VAT" := 0;
- end;
- ToSalesLine."Prepmt. Amt. Inv." := 0;
- ToSalesLine."Prepmt. Amount Inv. (LCY)" := 0;
- ToSalesLine."Prepayment Amount" := 0;
- ToSalesLine."Prepmt. VAT Base Amt." := 0;
- ToSalesLine."Prepmt Amt to Deduct" := 0;
- ToSalesLine."Prepmt Amt Deducted" := 0;
- ToSalesLine."Prepmt. Amount Inv. Incl. VAT" := 0;
- ToSalesLine."Prepayment VAT Difference" := 0;
- ToSalesLine."Prepmt VAT Diff. to Deduct" := 0;
- ToSalesLine."Prepmt VAT Diff. Deducted" := 0;
- ToSalesLine."Prepmt. Amt. Incl. VAT" := 0;
- ToSalesLine."Prepmt. VAT Amount Inv. (LCY)" := 0;
-
- IsHandled := false;
- OnInitSalesLineFieldsOnBeforeInitQty(ToSalesLine, IsHandled);
- if not IsHandled then begin
- ToSalesLine."Quantity Shipped" := 0;
- ToSalesLine."Qty. Shipped (Base)" := 0;
- ToSalesLine."Return Qty. Received" := 0;
- ToSalesLine."Return Qty. Received (Base)" := 0;
- ToSalesLine."Quantity Invoiced" := 0;
- ToSalesLine."Qty. Invoiced (Base)" := 0;
- end;
-
- ToSalesLine."Reserved Quantity" := 0;
- ToSalesLine."Reserved Qty. (Base)" := 0;
- ToSalesLine."Qty. to Ship" := 0;
- ToSalesLine."Qty. to Ship (Base)" := 0;
- ToSalesLine."Return Qty. to Receive" := 0;
- ToSalesLine."Return Qty. to Receive (Base)" := 0;
- ToSalesLine."Qty. to Invoice" := 0;
- ToSalesLine."Qty. to Invoice (Base)" := 0;
- ToSalesLine."Qty. Shipped Not Invoiced" := 0;
- ToSalesLine."Return Qty. Rcd. Not Invd." := 0;
- ToSalesLine."Shipped Not Invoiced" := 0;
- ToSalesLine."Return Rcd. Not Invd." := 0;
- ToSalesLine."Qty. Shipped Not Invd. (Base)" := 0;
- ToSalesLine."Ret. Qty. Rcd. Not Invd.(Base)" := 0;
- ToSalesLine."Shipped Not Invoiced (LCY)" := 0;
- ToSalesLine."Return Rcd. Not Invd. (LCY)" := 0;
- InitJobFieldsForSalesLine(ToSalesLine);
-
- OnAfterInitSalesLineFields(ToSalesLine);
- end;
-
- procedure InitJobFieldsForSalesLine(var SalesLine: Record "Sales Line")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInitJobFieldsForSalesLine(SalesLine, IsHandled);
- if IsHandled then
- exit;
-
- SalesLine."Job No." := '';
- SalesLine."Job Task No." := '';
- SalesLine."Job Contract Entry No." := 0;
- end;
-
- procedure InitPurchLineFields(var ToPurchLine: Record "Purchase Line")
- begin
- OnBeforeInitPurchLineFields(ToPurchLine);
-
- if ToPurchLine."Document Type" <> ToPurchLine."Document Type"::Order then begin
- ToPurchLine."Prepayment %" := 0;
- ToPurchLine."Prepayment VAT %" := 0;
- ToPurchLine."Prepmt. VAT Calc. Type" := "Tax Calculation Type"::"Normal VAT";
- ToPurchLine."Prepayment VAT Identifier" := '';
- ToPurchLine."Prepayment VAT %" := 0;
- ToPurchLine."Prepayment Tax Group Code" := '';
- ToPurchLine."Prepmt. Line Amount" := 0;
- ToPurchLine."Prepmt. Amt. Incl. VAT" := 0;
- end;
- ToPurchLine."Prepmt. Amt. Inv." := 0;
- ToPurchLine."Prepmt. Amount Inv. (LCY)" := 0;
- ToPurchLine."Prepayment Amount" := 0;
- ToPurchLine."Prepmt. VAT Base Amt." := 0;
- ToPurchLine."Prepmt Amt to Deduct" := 0;
- ToPurchLine."Prepmt Amt Deducted" := 0;
- ToPurchLine."Prepmt. Amount Inv. Incl. VAT" := 0;
- ToPurchLine."Prepayment VAT Difference" := 0;
- ToPurchLine."Prepmt VAT Diff. to Deduct" := 0;
- ToPurchLine."Prepmt VAT Diff. Deducted" := 0;
- ToPurchLine."Prepmt. Amt. Incl. VAT" := 0;
- ToPurchLine."Prepmt. VAT Amount Inv. (LCY)" := 0;
- ToPurchLine."Quantity Received" := 0;
- ToPurchLine."Qty. Received (Base)" := 0;
- ToPurchLine."Return Qty. Shipped" := 0;
- ToPurchLine."Return Qty. Shipped (Base)" := 0;
- ToPurchLine."Quantity Invoiced" := 0;
- ToPurchLine."Qty. Invoiced (Base)" := 0;
- ToPurchLine."Reserved Quantity" := 0;
- ToPurchLine."Reserved Qty. (Base)" := 0;
- ToPurchLine."Qty. Rcd. Not Invoiced" := 0;
- ToPurchLine."Qty. Rcd. Not Invoiced (Base)" := 0;
- ToPurchLine."Return Qty. Shipped Not Invd." := 0;
- ToPurchLine."Ret. Qty. Shpd Not Invd.(Base)" := 0;
- ToPurchLine."Qty. to Receive" := 0;
- ToPurchLine."Qty. to Receive (Base)" := 0;
- ToPurchLine."Return Qty. to Ship" := 0;
- ToPurchLine."Return Qty. to Ship (Base)" := 0;
- ToPurchLine."Qty. to Invoice" := 0;
- ToPurchLine."Qty. to Invoice (Base)" := 0;
- ToPurchLine."Amt. Rcd. Not Invoiced" := 0;
- ToPurchLine."Amt. Rcd. Not Invoiced (LCY)" := 0;
- ToPurchLine."Return Shpd. Not Invd." := 0;
- ToPurchLine."Return Shpd. Not Invd. (LCY)" := 0;
-
- OnAfterInitPurchLineFields(ToPurchLine);
- end;
-
- local procedure CopySalesJobFields(var ToSalesLine: Record "Sales Line"; ToSalesHeader: Record "Sales Header"; FromSalesLine: Record "Sales Line")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCopySalesJobFields(ToSalesLine, FromSalesLine, IsHandled);
- if IsHandled then
- exit;
-
- ToSalesLine."Job No." := FromSalesLine."Job No.";
- ToSalesLine."Job Task No." := FromSalesLine."Job Task No.";
- if (ToSalesHeader."Document Type" = ToSalesHeader."Document Type"::Invoice) and
- (FromSalesLine."Job Contract Entry No." <> 0)
- then
- ToSalesLine."Job Contract Entry No." :=
- CreateJobPlanningLine(ToSalesHeader, ToSalesLine, FromSalesLine."Job Contract Entry No.")
- else
- ToSalesLine."Job Contract Entry No." := FromSalesLine."Job Contract Entry No.";
- end;
-
- local procedure CopySalesLineExtText(ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; FromSalesHeader: Record "Sales Header"; FromSalesLine: Record "Sales Line"; DocLineNo: Integer; var NextLineNo: Integer)
- var
- LastInsertedSalesLine: Record "Sales Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCopySalesLineExtText(ToSalesHeader, ToSalesLine, FromSalesHeader, FromSalesLine, DocLineNo, NextLineNo, IsHandled, RecalculateLines, CopyExtText, TransferOldExtLines);
- if IsHandled then
- exit;
-
- if (ToSalesHeader."Language Code" <> FromSalesHeader."Language Code") or RecalculateLines or CopyExtText then
- if TransferExtendedText.SalesCheckIfAnyExtText(ToSalesLine, false) then begin
- TransferExtendedText.InsertSalesExtTextRetLast(ToSalesLine, LastInsertedSalesLine);
- NextLineNo := LastInsertedSalesLine."Line No.";
- exit;
- end;
-
- ToSalesLine."Attached to Line No." :=
- TransferOldExtLines.TransferExtendedText(DocLineNo, NextLineNo, FromSalesLine."Attached to Line No.");
-
- OnAfterCopySalesLineExtText(ToSalesHeader, ToSalesLine, FromSalesHeader, FromSalesLine, DocLineNo, NextLineNo, TransferOldExtLines, RecalculateLines);
- end;
-
- procedure CopySalesLinesToDoc(FromDocType: Option; ToSalesHeader: Record "Sales Header"; var FromSalesShipmentLine: Record "Sales Shipment Line"; var FromSalesInvoiceLine: Record "Sales Invoice Line"; var FromReturnReceiptLine: Record "Return Receipt Line"; var FromSalesCrMemoLine: Record "Sales Cr.Memo Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCopySalesLinesToDoc(
- FromDocType, ToSalesHeader, FromSalesShipmentLine, FromSalesInvoiceLine, FromReturnReceiptLine, FromSalesCrMemoLine,
- LinesNotCopied, MissingExCostRevLink, IsHandled);
- if not IsHandled then begin
- CopyExtText := true;
- case FromDocType of
- "Sales Document Type From"::"Posted Shipment".AsInteger():
- CopySalesShptLinesToDoc(ToSalesHeader, FromSalesShipmentLine, LinesNotCopied, MissingExCostRevLink);
- "Sales Document Type From"::"Posted Invoice".AsInteger():
- CopySalesInvLinesToDoc(ToSalesHeader, FromSalesInvoiceLine, LinesNotCopied, MissingExCostRevLink);
- "Sales Document Type From"::"Posted Return Receipt".AsInteger():
- CopySalesReturnRcptLinesToDoc(ToSalesHeader, FromReturnReceiptLine, LinesNotCopied, MissingExCostRevLink);
- "Sales Document Type From"::"Posted Credit Memo".AsInteger():
- CopySalesCrMemoLinesToDoc(ToSalesHeader, FromSalesCrMemoLine, LinesNotCopied, MissingExCostRevLink);
- end;
- CopyExtText := false;
- end;
- OnAfterCopySalesLinesToDoc(
- FromDocType, ToSalesHeader, FromSalesShipmentLine, FromSalesInvoiceLine, FromReturnReceiptLine, FromSalesCrMemoLine,
- LinesNotCopied, MissingExCostRevLink, RecalculateLines, IncludeHeader);
- end;
-
- local procedure CopyPurchaseJobFields(var ToPurchLine: Record "Purchase Line"; FromPurchLine: Record "Purchase Line")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCopyPurchaseJobFields(ToPurchLine, FromPurchLine, IsHandled, RecalculateLines);
- if IsHandled then
- exit;
-
- ToPurchLine.Validate("Job No.", FromPurchLine."Job No.");
- ToPurchLine.Validate("Job Task No.", FromPurchLine."Job Task No.");
- ToPurchLine.Validate("Job Planning Line No.", FromPurchLine."Job Planning Line No.");
- ToPurchLine.Validate("Job Unit Price", FromPurchLine."Job Unit Price");
- ToPurchLine.Validate("Job Total Price", FromPurchLine."Job Total Price");
- ToPurchLine.Validate("Job Line Amount", FromPurchLine."Job Line Amount");
- ToPurchLine.Validate("Job Line Discount Amount", FromPurchLine."Job Line Discount Amount");
- ToPurchLine.Validate("Job Line Discount %", FromPurchLine."Job Line Discount %");
- ToPurchLine.Validate("Job Unit Price (LCY)", FromPurchLine."Job Unit Price (LCY)");
- ToPurchLine.Validate("Job Total Price (LCY)", FromPurchLine."Job Total Price (LCY)");
- ToPurchLine.Validate("Job Line Amount (LCY)", FromPurchLine."Job Line Amount (LCY)");
- ToPurchLine.Validate("Job Line Disc. Amount (LCY)", FromPurchLine."Job Line Disc. Amount (LCY)");
- ToPurchLine.Validate("Job Currency Factor", FromPurchLine."Job Currency Factor");
- ToPurchLine.Validate("Job Currency Code", FromPurchLine."Job Currency Code");
-
- end;
-
- local procedure CopyPurchLineExtText(ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; FromPurchHeader: Record "Purchase Header"; FromPurchLine: Record "Purchase Line"; DocLineNo: Integer; var NextLineNo: Integer)
- var
- LastInsertedPurchLine: Record "Purchase Line";
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCopyPurchLineExtText(ToPurchHeader, ToPurchLine, FromPurchHeader, FromPurchLine, DocLineNo, NextLineNo, IsHandled, RecalculateLines, CopyExtText);
- if not IsHandled then begin
- if (ToPurchHeader."Language Code" <> FromPurchHeader."Language Code") or RecalculateLines or CopyExtText then
- if TransferExtendedText.PurchCheckIfAnyExtText(ToPurchLine, false) then begin
- TransferExtendedText.InsertPurchExtTextRetLast(ToPurchLine, LastInsertedPurchLine);
- NextLineNo := LastInsertedPurchLine."Line No.";
- exit;
- end;
-
- ToPurchLine."Attached to Line No." :=
- TransferOldExtLines.TransferExtendedText(DocLineNo, NextLineNo, FromPurchLine."Attached to Line No.");
- end;
- OnAfterCopyPurchLineExtText(ToPurchHeader, ToPurchLine, FromPurchHeader, FromPurchLine, DocLineNo, NextLineNo, TransferOldExtLines, RecalculateLines);
- end;
-
- procedure CopyPurchaseLinesToDoc(FromDocType: Option; ToPurchaseHeader: Record "Purchase Header"; var FromPurchRcptLine: Record "Purch. Rcpt. Line"; var FromPurchInvLine: Record "Purch. Inv. Line"; var FromReturnShipmentLine: Record "Return Shipment Line"; var FromPurchCrMemoLine: Record "Purch. Cr. Memo Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeCopyPurchaseLinesToDoc(
- FromDocType, ToPurchaseHeader, FromPurchRcptLine, FromPurchInvLine, FromReturnShipmentLine, FromPurchCrMemoLine,
- LinesNotCopied, MissingExCostRevLink, IsHandled);
- if IsHandled then
- exit;
- CopyExtText := true;
- case FromDocType of
- "Purchase Document Type From"::"Posted Receipt".AsInteger():
- CopyPurchRcptLinesToDoc(ToPurchaseHeader, FromPurchRcptLine, LinesNotCopied, MissingExCostRevLink);
- "Purchase Document Type From"::"Posted Invoice".AsInteger():
- CopyPurchInvLinesToDoc(ToPurchaseHeader, FromPurchInvLine, LinesNotCopied, MissingExCostRevLink);
- "Purchase Document Type From"::"Posted Return Shipment".AsInteger():
- CopyPurchReturnShptLinesToDoc(ToPurchaseHeader, FromReturnShipmentLine, LinesNotCopied, MissingExCostRevLink);
- "Purchase Document Type From"::"Posted Credit Memo".AsInteger():
- CopyPurchCrMemoLinesToDoc(ToPurchaseHeader, FromPurchCrMemoLine, LinesNotCopied, MissingExCostRevLink);
- end;
- CopyExtText := false;
- OnAfterCopyPurchaseLinesToDoc(
- FromDocType, ToPurchaseHeader, FromPurchRcptLine, FromPurchInvLine, FromReturnShipmentLine, FromPurchCrMemoLine,
- LinesNotCopied, MissingExCostRevLink, RecalculateLines, IncludeHeader);
- end;
-
- local procedure CopyShiptoCodeFromInvToCrMemo(var ToSalesHeader: Record "Sales Header"; FromSalesInvHeader: Record "Sales Invoice Header"; FromDocType: Enum "Sales Document Type From")
- begin
- if (FromDocType = "Sales Document Type From"::"Posted Invoice") and
- (FromSalesInvHeader."Ship-to Code" <> '') and
- (ToSalesHeader."Document Type" = ToSalesHeader."Document Type"::"Credit Memo")
- then
- ToSalesHeader."Ship-to Code" := FromSalesInvHeader."Ship-to Code";
-
- OnAfterCopyShiptoCodeFromInvToCrMemo(ToSalesHeader, FromSalesInvHeader, FromDocType);
- end;
-
- local procedure TransferFieldsFromCrMemoToInv(var ToSalesHeader: Record "Sales Header"; FromSalesCrMemoHeader: Record "Sales Cr.Memo Header")
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeTransferFieldsFromCrMemoToInv(ToSalesHeader, FromSalesCrMemoHeader, IsHandled);
- if not IsHandled then begin
- ToSalesHeader.Validate("Sell-to Customer No.", FromSalesCrMemoHeader."Sell-to Customer No.");
- if ToSalesHeader."Sell-to Customer No." <> FromSalesCrMemoHeader."Sell-to Customer No." then
- exit;
- OnTransferFieldsFromCrMemoToInvOnBeforeTransferFields(ToSalesHeader, FromSalesCrMemoHeader);
- ToSalesHeader.TransferFields(FromSalesCrMemoHeader, false);
- if (ToSalesHeader."Document Type" = ToSalesHeader."Document Type"::Invoice) and IncludeHeader then begin
- ToSalesHeader.CopySellToAddressToShipToAddress();
- ToSalesHeader.Validate("Ship-to Code", FromSalesCrMemoHeader."Ship-to Code");
- end;
- SetReceivedFromCountryCode(ToSalesHeader);
- end;
-
- OnAfterTransferFieldsFromCrMemoToInv(ToSalesHeader, FromSalesCrMemoHeader, CopyJobData);
- end;
-
- procedure CopyShippingInfoPurchOrder(var ToPurchaseHeader: Record "Purchase Header"; FromPurchaseHeader: Record "Purchase Header")
- begin
- if (ToPurchaseHeader."Document Type" = ToPurchaseHeader."Document Type"::Order) and
- (FromPurchaseHeader."Document Type" = FromPurchaseHeader."Document Type"::Order)
- then begin
- ToPurchaseHeader."Ship-to Address" := FromPurchaseHeader."Ship-to Address";
- ToPurchaseHeader."Ship-to Address 2" := FromPurchaseHeader."Ship-to Address 2";
- ToPurchaseHeader."Ship-to City" := FromPurchaseHeader."Ship-to City";
- ToPurchaseHeader."Ship-to Country/Region Code" := FromPurchaseHeader."Ship-to Country/Region Code";
- ToPurchaseHeader."Ship-to County" := FromPurchaseHeader."Ship-to County";
- ToPurchaseHeader."Ship-to Name" := FromPurchaseHeader."Ship-to Name";
- ToPurchaseHeader."Ship-to Name 2" := FromPurchaseHeader."Ship-to Name 2";
- ToPurchaseHeader."Ship-to Post Code" := FromPurchaseHeader."Ship-to Post Code";
- ToPurchaseHeader."Ship-to Phone No." := FromPurchaseHeader."Ship-to Phone No.";
- ToPurchaseHeader."Ship-to Contact" := FromPurchaseHeader."Ship-to Contact";
- ToPurchaseHeader."Inbound Whse. Handling Time" := FromPurchaseHeader."Inbound Whse. Handling Time";
- end;
- end;
-
- local procedure SetSalespersonPurchaserCode(var SalespersonPurchaserCode: Code[20])
- var
- SalespersonPurchaser: Record "Salesperson/Purchaser";
- begin
- if SalespersonPurchaserCode <> '' then
- if SalespersonPurchaser.Get(SalespersonPurchaserCode) then
- if SalespersonPurchaser.VerifySalesPersonPurchaserPrivacyBlocked(SalespersonPurchaser) then
- SalespersonPurchaserCode := ''
- end;
-
- local procedure SetReceivedFromCountryCode(FromDocType: Enum "Sales Document Type From"; var ToSalesHeader: Record "Sales Header")
- begin
- if not ToSalesHeader.IsCreditDocType() then
- ToSalesHeader."Rcvd.-from Count./Region Code" := '';
- if not (FromDocType in [FromDocType::"Credit Memo", FromDocType::"Return Order"]) then
- ToSalesHeader."Rcvd.-from Count./Region Code" := '';
- end;
-
- local procedure SetReceivedFromCountryCode(FromSalesHeaderArchive: Record "Sales Header Archive"; var ToSalesHeader: Record "Sales Header")
- begin
- if not ToSalesHeader.IsCreditDocType() then
- ToSalesHeader."Rcvd.-from Count./Region Code" := '';
- if not (FromSalesHeaderArchive."Document Type" in [FromSalesHeaderArchive."Document Type"::"Return Order"]) then
- ToSalesHeader."Rcvd.-from Count./Region Code" := '';
- end;
-
- local procedure SetReceivedFromCountryCode(FromSalesShipmentHeader: Record "Sales Shipment Header"; var ToSalesHeader: Record "Sales Header")
- begin
- if not ToSalesHeader.IsCreditDocType() then
- ToSalesHeader."Rcvd.-from Count./Region Code" := ''
- else
- ToSalesHeader."Rcvd.-from Count./Region Code" := FromSalesShipmentHeader."Ship-to Country/Region Code";
- end;
-
- local procedure SetReceivedFromCountryCode(SalesInvoiceHeader: Record "Sales Invoice Header"; var ToSalesHeader: Record "Sales Header")
- begin
- if not ToSalesHeader.IsCreditDocType() then
- ToSalesHeader."Rcvd.-from Count./Region Code" := ''
- else
- ToSalesHeader."Rcvd.-from Count./Region Code" := SalesInvoiceHeader."Ship-to Country/Region Code";
- end;
-
- local procedure UpdateShipToAddress(var ToSalesHeader: Record "Sales Header")
- begin
- if not ToSalesHeader.IsCreditDocType() then
- exit;
- ToSalesHeader.UpdateShipToAddress();
- end;
-
- local procedure SetReceivedFromCountryCode(var ToSalesHeader: Record "Sales Header")
- begin
- if not ToSalesHeader.IsCreditDocType() then
- ToSalesHeader."Rcvd.-from Count./Region Code" := '';
- end;
-
- procedure SetCopyExtendedText(CopyExtendedText: Boolean)
- begin
- CopyExtText := CopyExtendedText;
- end;
-
- ///
- /// Event triggered before starting the sales document copy process.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// before the document copy operation begins. This can be useful for implementing validations,
- /// pre-processing logic, or altering the behavior of the copy operation.
- ///
- ///
- /// The type of the sales document being copied, represented as an integer.
- ///
- ///
- /// The document number of the sales document being copied.
- ///
- ///
- /// The sales header record to which the data is being copied.
- ///
- ///
- /// A boolean variable indicating whether the default copy behavior should be bypassed.
- /// Setting this variable to true will skip the default behavior.
- ///
- [IntegrationEvent(true, false)]
- local procedure OnBeforeCopySalesDocument(FromDocumentType: Option; FromDocumentNo: Code[20]; var ToSalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyItemTrackingEntries(SalesLine: Record "Sales Line"; var PurchLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before assigning descriptions from a sales line to a purchase line.
- /// This allows developers to modify or override the default behavior of the description assignment.
- ///
- ///
- /// The purchase line record to which descriptions are being assigned.
- ///
- ///
- /// The sales line record from which descriptions are being copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeAssignDescriptionsFromSalesLine(var PurchaseLine: Record "Purchase Line"; SalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Event triggered before copying a sales line.
- /// This allows developers to modify or override the behavior of copying sales lines.
- ///
- /// The target sales header to which the sales line will be copied.
- /// The source sales header from which the sales line will be copied.
- /// The source sales line to be copied.
- /// A boolean variable indicating whether lines need to be recalculated during the copy operation.
- /// A boolean flag indicating whether the current line should be copied. Can be overridden.
- /// A boolean variable indicating whether negative lines should be moved instead of copied.
- /// The result of the copy operation. Can be overridden.
- /// A boolean variable that allows developers to handle the logic themselves and skip the default copying process if set to true.
- /// The line number of the document line being processed.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesLine(var ToSalesHeader: Record "Sales Header"; FromSalesHeader: Record "Sales Header"; FromSalesLine: Record "Sales Line"; RecalculateAmount: Boolean; var CopyThisLine: Boolean; MoveNegLines: Boolean; var Result: Boolean; var IsHandled: Boolean; DocLineNo: Integer)
- begin
- end;
-
- ///
- /// Event triggered before starting the process of copying archived sales lines from the source sales document archive to the target sales document.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// before the archived sales lines are copied. This can be useful for implementing additional logic,
- /// setting up preconditions, or filtering data during the copy process.
- ///
- ///
- /// The source sales header archive record being copied.
- ///
- ///
- /// The sales header record to which the archived sales lines are being copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesDocSalesLineArchive(FromSalesHeaderArchive: Record "Sales Header Archive"; var ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Event triggered before starting the process of copying sales lines from the source sales document to the target sales document.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// before the sales lines are copied. This can be useful for implementing additional logic,
- /// setting up preconditions, or filtering data during the copy process.
- ///
- ///
- /// The source sales header record being copied.
- ///
- ///
- /// The sales header record to which the sales lines are being copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesDocSalesLine(FromSalesHeader: Record "Sales Header"; var ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyArchSalesLine(var ToSalesHeader: Record "Sales Header"; FromSalesHeaderArchive: Record "Sales Header Archive"; FromSalesLineArchive: Record "Sales Line Archive"; RecalculateAmount: Boolean; var CopyThisLine: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before starting the process of copying a purchase document.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// before the purchase document copy process has begun. This can be useful for implementing custom logic,
- /// applying validations, or altering parameters during the copy operation.
- ///
- ///
- /// The type of the source purchase document being copied.
- ///
- ///
- /// The document number of the source purchase document being copied.
- ///
- ///
- /// The target purchase header record to which the document is being copied.
- ///
- ///
- /// A boolean variable indicating whether the default copy behavior should be bypassed.
- /// Setting this variable to true will skip the default behavior.
- ///
- [IntegrationEvent(true, false)]
- local procedure OnBeforeCopyPurchaseDocument(FromDocumentType: Option; FromDocumentNo: Code[20]; var ToPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before copying a purchase line. Allows overriding or skipping the default logic for copying the purchase line.
- ///
- /// The purchase header of the target document.
- /// The purchase header of the source document.
- /// The purchase line from the source document being processed.
- /// A boolean variable indicating if the lines should be recalculated.
- /// A boolean variable indicating whether the current line should be copied. Can be modified by subscribers.
- /// The purchase line of the target document.
- /// A boolean variable indicating if negative lines should be moved.
- /// A boolean variable indicating if a rounding line was inserted.
- /// The result of the operation, can be overridden by subscribers.
- /// A boolean variable indicating if the event is handled. If set to true, the default logic will be skipped.
- /// The type of the source purchase document.
- /// The line number of the source document line.
- /// A boolean variable indicating if recalculation of lines is required.
- /// Tracks the number of lines that were not copied.
- /// A boolean variable indicating if posted deferrals should be copied.
- /// The next line number for the target document.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyPurchLine(var ToPurchHeader: Record "Purchase Header"; FromPurchHeader: Record "Purchase Header"; FromPurchLine: Record "Purchase Line"; RecalculateAmount: Boolean; var CopyThisLine: Boolean; ToPurchLine: Record "Purchase Line"; MoveNegLines: Boolean; var RoundingLineInserted: Boolean; var Result: Boolean; var IsHandled: Boolean; FromPurchDocType: Enum "Purchase Document Type From"; DocLineNo: Integer;
- RecalculateLines: Boolean; var LinesNotCopied: Integer; var CopyPostedDeferral: Boolean; var NextLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyPurchRcptLinesToDoc(ToPurchHeader: Record "Purchase Header"; var FromPurchRcptLine: Record "Purch. Rcpt. Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyArchPurchLine(var ToPurchHeader: Record "Purchase Header"; FromPurchHeaderArchive: Record "Purchase Header Archive"; FromPurchLineArchive: Record "Purchase Line Archive"; RecalculateAmount: Boolean; var CopyThisLine: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeModifySalesHeader(var ToSalesHeader: Record "Sales Header"; FromDocType: Option; FromDocNo: Code[20]; IncludeHeader: Boolean; FromDocOccurenceNo: Integer; FromDocVersionNo: Integer; RecalculateLines: Boolean; FromSalesHeader: Record "Sales Header"; FromSalesInvoiceHeader: Record "Sales Invoice Header"; FromSalesCrMemoHeader: Record "Sales Cr.Memo Header"; OldSalesHeader: Record "Sales Header")
- begin
- end;
-
- local procedure AddSalesDocLine(var TempDocSalesLine: Record "Sales Line" temporary; BufferLineNo: Integer; DocumentNo: Code[20]; DocumentLineNo: Integer)
- begin
- OnBeforeAddSalesDocLine(TempDocSalesLine, BufferLineNo, DocumentNo, DocumentLineNo);
-
- TempDocSalesLine."Document No." := DocumentNo;
- TempDocSalesLine."Line No." := DocumentLineNo;
- TempDocSalesLine."Shipment Line No." := BufferLineNo;
- TempDocSalesLine.Insert();
- end;
-
- local procedure GetSalesLineNo(var TempDocSalesLine: Record "Sales Line" temporary; BufferLineNo: Integer): Integer
- begin
- TempDocSalesLine.SetRange("Shipment Line No.", BufferLineNo);
- if not TempDocSalesLine.FindFirst() then
- exit(0);
- exit(TempDocSalesLine."Line No.");
- end;
-
- local procedure GetSalesDocNo(var TempDocSalesLine: Record "Sales Line" temporary; BufferLineNo: Integer): Code[20]
- begin
- TempDocSalesLine.SetRange("Shipment Line No.", BufferLineNo);
- if not TempDocSalesLine.FindFirst() then
- exit('');
- exit(TempDocSalesLine."Document No.");
- end;
-
- local procedure AddPurchDocLine(var TempDocPurchaseLine: Record "Purchase Line" temporary; BufferLineNo: Integer; DocumentNo: Code[20]; DocumentLineNo: Integer)
- begin
- OnBeforeAddPurchDocLine(TempDocPurchaseLine, BufferLineNo, DocumentNo, DocumentLineNo);
-
- TempDocPurchaseLine."Document No." := DocumentNo;
- TempDocPurchaseLine."Line No." := DocumentLineNo;
- TempDocPurchaseLine."Receipt Line No." := BufferLineNo;
- TempDocPurchaseLine.Insert();
- end;
-
- local procedure GetPurchLineNo(var TempDocPurchaseLine: Record "Purchase Line" temporary; BufferLineNo: Integer): Integer
- begin
- TempDocPurchaseLine.SetRange("Receipt Line No.", BufferLineNo);
- if not TempDocPurchaseLine.FindFirst() then
- exit(0);
- exit(TempDocPurchaseLine."Line No.");
- end;
-
- local procedure GetPurchDocNo(var TempDocPurchaseLine: Record "Purchase Line" temporary; BufferLineNo: Integer): Code[20]
- begin
- TempDocPurchaseLine.SetRange("Receipt Line No.", BufferLineNo);
- if not TempDocPurchaseLine.FindFirst() then
- exit('');
- exit(TempDocPurchaseLine."Document No.");
- end;
-
- local procedure SetTrackingOnAssemblyReservation(AssemblyHeader: Record "Assembly Header"; var TempItemLedgerEntry: Record "Item Ledger Entry" temporary)
- var
- ReservationEntry: Record "Reservation Entry";
- TempReservationEntry: Record "Reservation Entry" temporary;
- TempTrackingSpecification: Record "Tracking Specification" temporary;
- ItemTrackingCode: Record "Item Tracking Code";
- ReservationEngineMgt: Codeunit "Reservation Engine Mgt.";
- QtyToAddAsBlank: Decimal;
- begin
- TempItemLedgerEntry.SetFilter("Lot No.", '<>%1', '');
- if TempItemLedgerEntry.IsEmpty() then
- exit;
-
- ReservationEntry.SetRange("Source Type", DATABASE::"Assembly Header");
- ReservationEntry.SetRange("Source Subtype", AssemblyHeader."Document Type");
- ReservationEntry.SetRange("Source ID", AssemblyHeader."No.");
- ReservationEntry.SetRange("Source Ref. No.", 0);
- ReservationEntry.SetRange("Reservation Status", ReservationEntry."Reservation Status"::Reservation);
- if ReservationEntry.FindSet() then
- repeat
- TempReservationEntry := ReservationEntry;
- TempReservationEntry.Insert();
- until ReservationEntry.Next() = 0;
-
- if TempItemLedgerEntry.FindSet() then
- repeat
- TempTrackingSpecification."Entry No." += 1;
- TempTrackingSpecification."Item No." := TempItemLedgerEntry."Item No.";
- TempTrackingSpecification."Location Code" := TempItemLedgerEntry."Location Code";
- TempTrackingSpecification."Quantity (Base)" := TempItemLedgerEntry.Quantity;
- TempTrackingSpecification.CopyTrackingFromItemledgEntry(TempItemLedgerEntry);
- TempTrackingSpecification."Warranty Date" := TempItemLedgerEntry."Warranty Date";
- TempTrackingSpecification."Expiration Date" := TempItemLedgerEntry."Expiration Date";
- OnSetTrackingOnAssemblyReservationOnBeforeTempTrackingSpecificationInsert(TempTrackingSpecification, TempItemLedgerEntry);
- TempTrackingSpecification.Insert();
- until TempItemLedgerEntry.Next() = 0;
-
- if TempTrackingSpecification.FindSet() then
- repeat
- if GetItemTrackingCode(ItemTrackingCode, TempTrackingSpecification."Item No.") then
- ReservationEngineMgt.AddItemTrackingToTempRecSet(
- TempReservationEntry, TempTrackingSpecification, TempTrackingSpecification."Quantity (Base)",
- QtyToAddAsBlank, ItemTrackingCode);
- until TempTrackingSpecification.Next() = 0;
- end;
-
- local procedure GetItemTrackingCode(var ItemTrackingCode: Record "Item Tracking Code"; ItemNo: Code[20]): Boolean
- var
- Item: Record Item;
- begin
- Item.SetLoadFields("Item Tracking Code");
-
- if not Item.Get(ItemNo) then
- exit(false);
-
- if Item."Item Tracking Code" = '' then
- exit(false);
-
- ItemTrackingCode.Get(Item."Item Tracking Code");
- exit(true);
- end;
-
- local procedure CheckSalesVATBusPostingGroup(ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line")
- var
- CheckVATBusGroup: Boolean;
- begin
- CheckVATBusGroup := (not RecalculateLines) and (ToSalesLine."No." <> '');
- OnCopySalesLineOnBeforeCheckVATBusGroup(ToSalesLine, CheckVATBusGroup);
- if CheckVATBusGroup then
- ToSalesLine.TestField("VAT Bus. Posting Group", ToSalesHeader."VAT Bus. Posting Group");
- end;
-
- local procedure CheckPurchVATBusPostingGroup(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line")
- var
- CheckVATBusGroup: Boolean;
- begin
- CheckVATBusGroup := (not RecalculateLines) and (ToPurchLine."No." <> '');
- OnCopyPurchLineOnBeforeCheckVATBusGroup(ToPurchLine, CheckVATBusGroup);
- if CheckVATBusGroup then
- ToPurchLine.TestField("VAT Bus. Posting Group", ToPurchHeader."VAT Bus. Posting Group");
- end;
-
- procedure SetPropertiesForCorrectiveCreditMemo(NewSkipCopyFromDescription: Boolean)
- begin
- SetProperties(true, false, false, false, true, true, false);
- SkipOldInvoiceDesc := NewSkipCopyFromDescription;
- end;
-
- local procedure SkipOldInvoiceDescription(RcptOrShipLineExist: Boolean)
- begin
- if SkipOldInvoiceDesc and RcptOrShipLineExist then
- SkipCopyFromDescription := true;
- end;
-
- local procedure ClearOriginalDocumentNos(var ToPurchHeader: Record "Purchase Header")
- begin
- ToPurchHeader."Vendor Order No." := '';
- ToPurchHeader."Vendor Invoice No." := '';
- ToPurchHeader."Vendor Cr. Memo No." := '';
- ToPurchHeader."Vendor Shipment No." := '';
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeAddPurchDocLine(var TempDocPurchaseLine: Record "Purchase Line" temporary; BufferLineNo: Integer; DocumentNo: Code[20]; DocumentLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeAddSalesDocLine(var TempDocSalesLine: Record "Sales Line" temporary; BufferLineNo: Integer; DocumentNo: Code[20]; DocumentLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyAsmOrderToAsmOrderProcedure(var TempFromAsmHeader: Record "Assembly Header" temporary; var TempFromAsmLine: Record "Assembly Line" temporary; ToSalesLine: Record "Sales Line"; ToAsmHeaderDocType: Option; ToAsmHeaderDocNo: Code[20]; InclAsmHeader: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyPurchLines(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyPurchInvLines(var TempDocPurchaseLine: Record "Purchase Line" temporary; var ToPurchHeader: Record "Purchase Header"; var FromPurchInvLine: Record "Purch. Inv. Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyPurchCrMemoLinesToDoc(var TempDocPurchaseLine: Record "Purchase Line" temporary; var ToPurchHeader: Record "Purchase Header"; var FromPurchCrMemoLine: Record "Purch. Cr. Memo Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyPurchaseLinesToDoc(FromDocType: Option; var ToPurchaseHeader: Record "Purchase Header"; var FromPurchRcptLine: Record "Purch. Rcpt. Line"; var FromPurchInvLine: Record "Purch. Inv. Line"; var FromReturnShipmentLine: Record "Return Shipment Line"; var FromPurchCrMemoLine: Record "Purch. Cr. Memo Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyPurchReturnShptLinesToDoc(var TempDocPurchaseLine: Record "Purchase Line" temporary; var ToPurchHeader: Record "Purchase Header"; var FromReturnShipmentLine: Record "Return Shipment Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyPurchaseJobFields(var ToPurchaseLine: Record "Purchase Line"; FromPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyPurchLineExtText(ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; FromPurchHeader: Record "Purchase Header"; FromPurchLine: Record "Purchase Line"; DocLineNo: Integer; var NextLineNo: Integer; var IsHandled: Boolean; RecalculateLines: Boolean; CopyExtText: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesShptLinesToDoc(var TempDocSalesLine: Record "Sales Line" temporary; var ToSalesHeader: Record "Sales Header"; var FromSalesShptLine: Record "Sales Shipment Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesShptLinesToBuffer(var FromSalesLine: Record "Sales Line"; var FromSalesShptLine: Record "Sales Shipment Line"; var ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Event triggered before handling zero-amount posted invoices during the sales document copy process.
- /// Subscribing to this event allows developers to override or extend the default behavior
- /// when processing invoices with zero total amount. This can be useful for implementing custom logic
- /// or skipping the default handling operation.
- ///
- ///
- /// The source sales invoice header record being processed.
- ///
- ///
- /// The target sales header record to which the data is being copied.
- ///
- ///
- /// The type of the source sales document.
- ///
- ///
- /// The document number of the source sales document.
- ///
- ///
- /// A boolean variable indicating whether the default handling behavior should be bypassed.
- /// Setting this variable to true will skip the default behavior.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeHandleZeroAmountPostedInvoices(var FromSalesInvoiceHeader: Record "Sales Invoice Header"; var ToSalesHeader: Record "Sales Header"; FromDocType: Enum "Sales Document Type From"; FromDocNo: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeHandleZeroAmountPostedPurchaseInvoices(var FromPurchInvHeader: Record "Purch. Inv. Header"; var ToPurchaseHeader: Record "Purchase Header"; FromDocType: Enum "Purchase Document Type From"; FromDocNo: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesShptLinesToDocOnAfterSplitPstdSalesLinesPerILE(var FromSalesLineBuf: Record "Sales Line" temporary; var FromSalesShptLine: Record "Sales Shipment Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchSalesLineOnAfterIncrementNextLineNo(var ToSalesLine: Record "Sales Line"; var FromSalesLineArchive: Record "Sales Line Archive"; var NextLineNo: Integer; ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchPurchLineOnAfterRecalculatePurchLine(var ToPurchaseLine: Record "Purchase Line"; var FromPurchaseLineArchive: Record "Purchase Line Archive")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchRcptLinesToDocOnBeforeCheckInsertDocNoLine(var ToPurchaseHeader: Record "Purchase Header"; FromPurchRcptLine: Record "Purch. Rcpt. Line"; FromPurchaseHeader: Record "Purchase Header"; var NextLineNo: Integer; var InsertDocNoLine: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchInvLinesToDocOnAfterCalcShouldInsertOldPurchDocNoLine(var ToPurchaseHeader: Record "Purchase Header"; FromPurchInvHeader: Record "Purch. Inv. Header"; FromPurchaseHeader: Record "Purchase Header"; var NextLineNo: Integer; var OldInvDocNo: Code[20]; var OldRcptDocNo: Code[20]; var ShouldInsertOldPurchDocNoLine: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesInvLines(var TempDocSalesLine: Record "Sales Line" temporary; var ToSalesHeader: Record "Sales Header"; var FromSalesInvLine: Record "Sales Invoice Line"; var CopyJobData: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesInvLinesToDoc(var ToSalesHeader: Record "Sales Header"; var FromSalesInvLine: Record "Sales Invoice Line"; var CopyJobData: Boolean; RecalculateLines: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitJobFieldsForSalesLine(var ToSalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesInvLinesToBuffer(var FromSalesLine: Record "Sales Line"; var FromSalesInvLine: Record "Sales Invoice Line"; var ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesCrMemoLinesToDoc(var TempDocSalesLine: Record "Sales Line" temporary; var ToSalesHeader: Record "Sales Header"; var FromSalesCrMemoLine: Record "Sales Cr.Memo Line"; var CopyJobData: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesCrMemoLinesToBuffer(var FromSalesLine: Record "Sales Line"; var FromSalesCrMemoLine: Record "Sales Cr.Memo Line"; var ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesReturnRcptLinesToDoc(var TempDocSalesLine: Record "Sales Line" temporary; var ToSalesHeader: Record "Sales Header"; var FromReturnReceiptLine: Record "Return Receipt Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesReturnRcptLinesToBuffer(var FromSalesLine: Record "Sales Line"; var FromReturnReceiptLine: Record "Return Receipt Line"; var ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Event triggered before copying data from a sales line to a purchase line.
- /// This allows developers to modify or override the default behavior when transferring fields between the sales and purchase lines.
- ///
- ///
- /// The purchase line record representing the target line being created.
- ///
- ///
- /// The sales line record from which data is being copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesToPurchDoc(var ToPurchLine: Record "Purchase Line"; var FromSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesLinesToDoc(FromDocType: Option; var ToSalesHeader: Record "Sales Header"; var FromSalesShipmentLine: Record "Sales Shipment Line"; var FromSalesInvoiceLine: Record "Sales Invoice Line"; var FromReturnReceiptLine: Record "Return Receipt Line"; var FromSalesCrMemoLine: Record "Sales Cr.Memo Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesJobFields(var ToSalesLine: Record "Sales Line"; FromSalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesLineExtText(ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; FromSalesHeader: Record "Sales Header"; FromSalesLine: Record "Sales Line"; DocLineNo: Integer; var NextLineNo: Integer; var IsHandled: Boolean; RecalculateLines: Boolean; CopyExtText: Boolean; var TransferOldExtLines: Codeunit "Transfer Old Ext. Text Lines")
- begin
- end;
-
- ///
- /// Event triggered before copying a sales document for invoice cancellation.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// prior to the document copy operation. This can be useful for implementing custom logic,
- /// validations, or pre-processing related to the invoice cancellation process.
- ///
- ///
- /// The sales header record to which the data is being copied.
- ///
- ///
- /// The document number of the sales document being copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesDocForInvoiceCancelling(var ToSalesHeader: Record "Sales Header"; FromDocNo: Code[20])
- begin
- end;
-
- ///
- /// Event triggered before copying a sales document for credit memo cancellation.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// prior to the document copy operation. This can be useful for implementing custom logic,
- /// validations, or pre-processing related to the credit memo cancellation process.
- ///
- ///
- /// The sales header record to which the data is being copied.
- ///
- ///
- /// The document number of the sales document being copied.
- ///
- ///
- /// A boolean value indicating whether job data is included during the copy operation, which can be modified by the subscriber.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesDocForCrMemoCancelling(var ToSalesHeader: Record "Sales Header"; FromDocNo: Code[20]; var CopyJobData: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before starting the process of copying a purchase document for invoice cancellation.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// before the purchase document has been copied. This can be useful for implementing additional logic,
- /// applying custom validations, or altering parameters during the copy process.
- ///
- ///
- /// The target purchase header record to which the document is being copied.
- ///
- ///
- /// The document number of the source purchase document being copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyPurchaseDocForInvoiceCancelling(var ToPurchaseHeader: Record "Purchase Header"; FromDocNo: Code[20])
- begin
- end;
-
- ///
- /// Event triggered before starting the process of copying a purchase document for credit memo cancellation.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// before the purchase document has been copied. This can be useful for implementing additional logic,
- /// applying custom validations, or altering parameters during the copy process.
- ///
- ///
- /// The target purchase header record to which the document is being copied.
- ///
- ///
- /// The document number of the source purchase document being copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyPurchaseDocForCrMemoCancelling(var ToPurchaseHeader: Record "Purchase Header"; FromDocNo: Code[20])
- begin
- end;
-
- ///
- /// Event triggered before copying data from the source purchase header to the target purchase header.
- /// Subscribing to this event allows developers to override or extend the default behavior.
- ///
- ///
- /// The document type of the source purchase document.
- ///
- ///
- /// The source purchase header record being copied.
- ///
- ///
- /// The target purchase header's state before the copying process.
- ///
- ///
- /// The target purchase header record where the data will be copied.
- ///
- ///
- /// Set to true to skip the default copying logic.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyPurchHeaderFromPurchHeader(FromDocType: Enum "Purchase Document Type From"; FromPurchHeader: Record "Purchase Header";
- OldPurchHeader: Record "Purchase Header"; var ToPurchHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeDeleteNegSalesLines(FromDocType: Option; FromDocNo: Code[20]; var ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCreateJobPlanningLine(SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; var JobContractEntryNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeIsEntityBlocked(TableNo: Integer; CreditDocType: Boolean; Type: Option; EntityNo: Code[20]; var EntityIsBlocked: Boolean; var IsHandled: Boolean; EntityCode: Code[10]);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeIsDeferralToBeCopied(DeferralDocType: Enum "Deferral Document Type"; ToDocType: Option;
- FromDocType: Option; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeIsDeferralToBeDefaulted(DeferralDocType: Enum "Deferral Document Type"; ToDocType: Option;
- FromDocType: Option; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSetShipmentDateInLine(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSplitPstdSalesLinesPerILE(ToSalesHeader: Record "Sales Header"; FromSalesHeader: Record "Sales Header"; FromSalesLine: Record "Sales Line"; var TempSalesLineBuf: Record "Sales Line" temporary; FromShptOrRcpt: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before transferring fields from a sales line to a purchase line during the copying process.
- /// This allows developers to modify or override the default behavior of the field transfer.
- ///
- ///
- /// The sales line record from which fields are being transferred.
- ///
- ///
- /// The purchase line record to which fields are being transferred.
- ///
- ///
- /// A boolean flag indicating whether the event has been handled by a subscriber.
- /// If set to true, the default behavior will be skipped.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTransfldsFromSalesToPurchLine(var FromSalesLine: Record "Sales Line"; var ToPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before the sales line has been updated during the copy process. This allows custom logic to intervene or override the default behavior.
- ///
- /// The target sales header record being updated.
- /// The target sales line record being updated.
- /// The source sales header record being copied from.
- /// The source sales line record being copied from.
- /// A boolean variable indicating whether the line should be copied.
- /// A boolean variable indicating if the amounts need to be recalculated.
- /// The document type of the source sales document.
- /// A boolean variable indicating if posted deferrals should be copied.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateSalesLine(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesHeader: Record "Sales Header"; var FromSalesLine: Record "Sales Line"; var CopyThisLine: Boolean; RecalculateAmount: Boolean; FromSalesDocType: Option; var CopyPostedDeferral: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before modifying the target purchase header.
- /// Subscribing to this event allows developers to intervene in the modification process.
- ///
- ///
- /// The target purchase header record being modified.
- ///
- ///
- /// The document type of the source purchase document.
- ///
- ///
- /// The document number of the source purchase document.
- ///
- ///
- /// Indicates whether the header is included in the process.
- ///
- ///
- /// The occurrence number of the source document, if applicable.
- ///
- ///
- /// The version number of the source document, if applicable.
- ///
- ///
- /// Indicates whether lines need to be recalculated.
- ///
- ///
- /// The source purchase header record.
- ///
- ///
- /// The source purchase invoice header, if applicable.
- ///
- ///
- /// The source purchase credit memo header, if applicable.
- ///
- ///
- /// The previous state of the target purchase header.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeModifyPurchHeader(var ToPurchHeader: Record "Purchase Header"; FromDocType: Option; FromDocNo: Code[20]; IncludeHeader: Boolean; FromDocOccurenceNo: Integer; FromDocVersionNo: Integer; RecalculateLines: Boolean; FromPurchaseHeader: Record "Purchase Header"; FromPurchInvHeader: Record "Purch. Inv. Header"; FromPurchCrMemoHeader: Record "Purch. Cr. Memo Hdr."; OldPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- ///
- /// Event triggered before recalculating the sales line. This allows custom logic to intervene or override the default behavior.
- ///
- /// The target sales header record being updated.
- /// The target sales line record being recalculated.
- /// The source sales header record being copied from.
- /// The source sales line record being copied from.
- /// A boolean variable indicating whether the line should be copied.
- /// A boolean variable indicating whether the default recalculation logic should be skipped.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeRecalculateSalesLine(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesHeader: Record "Sales Header"; var FromSalesLine: Record "Sales Line"; var CopyThisLine: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before updating a purchase line during the document copy process. Allows custom logic or intervention.
- ///
- /// The target purchase header record where the line is being copied to.
- /// The target purchase line record being updated.
- /// The source purchase header record where the line is being copied from.
- /// The source purchase line record being copied.
- /// A boolean variable indicating if the current line should be copied.
- /// A boolean variable indicating if amounts should be recalculated during the update.
- /// The type of the source purchase document.
- /// A boolean variable indicating if posted deferrals should be copied.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdatePurchLine(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; var FromPurchHeader: Record "Purchase Header"; var FromPurchLine: Record "Purchase Line"; var CopyThisLine: Boolean; RecalculateAmount: Boolean; FromPurchDocType: Option; var CopyPostedDeferral: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before updating the purchase header during a copy operation. Allows overriding or customizing the update process.
- ///
- /// The target purchase header being updated.
- /// The original purchase header being copied from.
- /// The document type of the source purchase document.
- /// A boolean variable indicating if the event is handled. If set to true, the default logic will be skipped.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdatePurchHeaderWhenCopyFromPurchHeader(var PurchaseHeader: Record "Purchase Header"; OriginalPurchaseHeader: Record "Purchase Header"; FromDocType: Enum "Purchase Document Type From"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdatePurchCreditMemoHeader(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before validating purchase line discount fields. Allows overriding or customizing the validation process.
- ///
- /// The purchase header of the source document.
- /// The purchase header of the target document.
- /// The purchase line of the target document.
- /// The invoice discount amount being validated.
- /// A boolean variable indicating if the event is handled. If set to true, the default logic will be skipped.
- /// A boolean variable indicating if the lines are being recalculated.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeValidatePurchLineDiscountFields(FromPurchHeader: Record "Purchase Header"; ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; var InvDiscountAmount: Decimal; var IsHandled: Boolean; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckFromSalesHeader(SalesHeaderFrom: Record "Sales Header"; SalesHeaderTo: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckFromSalesShptHeader(SalesShipmentHeaderFrom: Record "Sales Shipment Header"; SalesHeaderTo: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckFromSalesInvHeader(SalesInvoiceHeaderFrom: Record "Sales Invoice Header"; SalesHeaderTo: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckFromSalesCrMemoHeader(SalesCrMemoHeaderFrom: Record "Sales Cr.Memo Header"; SalesHeaderTo: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckFromSalesReturnRcptHeader(ReturnReceiptHeaderFrom: Record "Return Receipt Header"; SalesHeaderTo: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckFromPurchaseHeader(PurchaseHeaderFrom: Record "Purchase Header"; PurchaseHeaderTo: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckFromPurchaseRcptHeader(PurchRcptHeaderFrom: Record "Purch. Rcpt. Header"; PurchaseHeaderTo: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckFromPurchaseInvHeader(PurchInvHeaderFrom: Record "Purch. Inv. Header"; PurchaseHeaderTo: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckFromPurchaseCrMemoHeader(PurchCrMemoHdrFrom: Record "Purch. Cr. Memo Hdr."; PurchaseHeaderTo: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckFromPurchaseReturnShptHeader(ReturnShipmentHeaderFrom: Record "Return Shipment Header"; PurchaseHeaderTo: Record "Purchase Header")
- begin
- end;
-
- ///
- /// Event triggered after copying a sales document for invoice cancellation.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after the document copy operation. This can be useful for implementing post-processing logic,
- /// validations, or custom workflows related to the invoice cancellation process.
- ///
- ///
- /// The document number of the sales document that was copied.
- ///
- ///
- /// The sales header record to which the data was copied.
- ///
- ///
- /// A boolean value indicating whether the header was included in the copy operation.
- ///
- ///
- /// A boolean value indicating whether the lines were recalculated during the copy operation.
- ///
- ///
- /// A boolean value indicating whether negative lines were moved during the copy operation.
- ///
- ///
- /// A boolean value indicating whether a new header was created during the copy operation.
- ///
- ///
- /// A boolean value indicating whether dialogs were hidden during the copy operation.
- ///
- ///
- /// A boolean value indicating whether exact cost reversal was mandatory during the copy operation.
- ///
- ///
- /// A boolean value indicating whether the "apply fully" option was used during the copy operation.
- ///
- ///
- /// A boolean value indicating whether the credit limit test was skipped during the copy operation.
- ///
- ///
- /// A boolean value indicating whether the description was skipped during the copy operation.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesDocForInvoiceCancelling(FromDocNo: Code[20]; var ToSalesHeader: Record "Sales Header"; IncludeHeader: Boolean; RecalculateLines: Boolean; MoveNegLines: Boolean; CreateToHeader: Boolean; HideDialog: Boolean; ExactCostRevMandatory: Boolean; ApplyFully: Boolean; SkipTestCreditLimit: Boolean; SkipCopyFromDescription: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after copying a sales document for credit memo cancellation.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after the document copy operation. This can be useful for implementing post-processing logic,
- /// validations, or custom workflows related to the credit memo cancellation process.
- ///
- ///
- /// The document number of the sales document that was copied.
- ///
- ///
- /// The sales header record to which the data was copied.
- ///
- ///
- /// A boolean value indicating whether the header was included in the copy operation.
- ///
- ///
- /// A boolean value indicating whether the lines were recalculated during the copy operation.
- ///
- ///
- /// A boolean value indicating whether negative lines were moved during the copy operation.
- ///
- ///
- /// A boolean value indicating whether a new header was created during the copy operation.
- ///
- ///
- /// A boolean value indicating whether dialogs were hidden during the copy operation.
- ///
- ///
- /// A boolean value indicating whether exact cost reversal was mandatory during the copy operation.
- ///
- ///
- /// A boolean value indicating whether the "apply fully" option was used during the copy operation.
- ///
- ///
- /// A boolean value indicating whether the credit limit test was skipped during the copy operation.
- ///
- ///
- /// A boolean value indicating whether the description was skipped during the copy operation.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesDocForCrMemoCancelling(FromDocNo: Code[20]; var ToSalesHeader: Record "Sales Header"; IncludeHeader: Boolean; RecalculateLines: Boolean; MoveNegLines: Boolean; CreateToHeader: Boolean; HideDialog: Boolean; ExactCostRevMandatory: Boolean; ApplyFully: Boolean; SkipTestCreditLimit: Boolean; SkipCopyFromDescription: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchLineExtText(ToPurchaseHeader: Record "Purchase Header"; var ToPurchaseLine: Record "Purchase Line"; FromPurchaseHeader: Record "Purchase Header"; FromPurchaseLine: Record "Purchase Line"; DocLineNo: Integer; var NextLineNo: Integer; var TransferOldExtLines: Codeunit "Transfer Old Ext. Text Lines"; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchCrMemoLinesToDoc(ToPurchaseHeader: Record "Purchase Header"; var FromPurchCrMemoLine: Record "Purch. Cr. Memo Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchReturnShptLinesToDoc(ToPurchaseHeader: Record "Purchase Header"; var FromReturnShipmentLine: Record "Return Shipment Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchRcptLinesToDoc(ToPurchaseHeader: Record "Purchase Header"; var FromPurchRcptLine: Record "Purch. Rcpt. Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchInvLinesToDoc(ToPurchaseHeader: Record "Purchase Header"; var FromPurchInvLine: Record "Purch. Inv. Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after completing the sales invoice line copy process for the sales document.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after all sales invoice lines have been copied. This can be useful for implementing post-processing logic,
- /// validations, or handling specific workflows related to the copied sales invoice lines.
- ///
- ///
- /// The source sales invoice header record being copied.
- ///
- ///
- /// The sales header record to which the sales invoice lines were copied.
- ///
- ///
- /// The source sales invoice line record that was copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesDocInvLine(FromSalesInvoiceHeader: Record "Sales Invoice Header"; ToSalesHeader: Record "Sales Header"; var FromSalesInvoiceLine: Record "Sales Invoice Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesCrMemoLinesToDoc(var ToSalesHeader: Record "Sales Header"; var FromSalesCrMemoLine: Record "Sales Cr.Memo Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesInvLinesToDoc(var ToSalesHeader: Record "Sales Header"; var FromSalesInvoiceLine: Record "Sales Invoice Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesReturnRcptLinesToDoc(ToSalesHeader: Record "Sales Header"; var FromReturnReceiptLine: Record "Return Receipt Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesShptLinesToDoc(ToSalesHeader: Record "Sales Header"; var FromSalesShipmentLine: Record "Sales Shipment Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after completing the archived sales line copy process for the sales document.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after all archived sales lines have been copied. This can be useful for implementing post-processing logic,
- /// validations, or handling specific workflows related to the copied archived sales lines.
- ///
- ///
- /// The source sales header archive record being copied.
- ///
- ///
- /// The sales header record to which the archived sales lines were copied.
- ///
- ///
- /// The target sales line record to which the archived sales lines were copied.
- ///
- ///
- /// An object codeunit "Transfer Old Ext. Text Lines" handling the transfer of old extended lines, if applicable.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesDocSalesLineArchive(FromSalesHeaderArchive: Record "Sales Header Archive"; var ToSalesHeader: Record "Sales Header"; ToSalesLine: Record "Sales Line"; var TransferOldExtLines: Codeunit "Transfer Old Ext. Text Lines")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyFromPurchDocAssgntToLine(var ToPurchaseLine: Record "Purchase Line"; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyFromSalesDocAssgntToLine(var ToSalesLine: Record "Sales Line"; RecalculateLines: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after completing the copy of a single archived sales line during the sales document copy process.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after each archived sales line has been copied. This can be useful for implementing post-processing logic,
- /// validations, or handling specific workflows related to individual archived sales lines.
- ///
- ///
- /// The sales header record to which the archived sales line was copied.
- ///
- ///
- /// The target sales line record to which the archived sales line was copied.
- ///
- ///
- /// The source sales line archive record that was copied.
- ///
- ///
- /// A boolean value indicating whether the header was included in the copy operation.
- ///
- ///
- /// A boolean value indicating whether the lines were recalculated during the copy process.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyArchSalesLine(ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; FromSalesLineArchive: Record "Sales Line Archive"; IncludeHeader: Boolean; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchSalesLineOnBeforeCopyFromArchSalesDocDimToLine(ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; FromSalesHeaderArchive: Record "Sales Header Archive"; FromSalesLineArchive: Record "Sales Line Archive"; RecalculateLines: Boolean; var LinesNotCopied: Integer)
- begin
- end;
-
- ///
- /// Event triggered after a purchase line has been copied from the archived source to the target purchase document.
- /// Subscribing to this event allows developers to implement additional logic, validations,
- /// or workflows after copying each archived purchase line. This can be useful for custom handling or integrations.
- ///
- ///
- /// The target purchase header record to which the line was copied.
- ///
- ///
- /// The target purchase line record that was created.
- ///
- ///
- /// The source purchase line archive record that was copied.
- ///
- ///
- /// A boolean value indicating whether the source header data was included.
- ///
- ///
- /// A boolean value indicating whether the lines were recalculated during the copy process.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyArchPurchLine(ToPurchHeader: Record "Purchase Header"; var ToPurchaseLine: Record "Purchase Line"; FromPurchaseLineArchive: Record "Purchase Line Archive"; IncludeHeader: Boolean; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyFieldsFromOldPurchHeaderProcedure(var PurchaseHeader: Record "Purchase Header"; OldPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- ///
- /// Event triggered after copying data from a posted purchase receipt header to a purchase header.
- /// Allows developers to perform additional logic or modifications after the copying process.
- ///
- ///
- /// The target purchase header record to which data was copied.
- ///
- ///
- /// The original purchase header record before copying.
- ///
- ///
- /// The source posted purchase receipt header record.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPostedReceipt(var ToPurchaseHeader: Record "Purchase Header"; OldPurchaseHeader: Record "Purchase Header"; FromPurchRcptHeader: Record "Purch. Rcpt. Header")
- begin
- end;
-
- ///
- /// Event triggered after completing the copy of a sales shipment header to the target sales header during the copy process.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after the fields have been transferred. This can be useful for implementing additional logic,
- /// validations, or workflows based on the copied shipment data.
- ///
- ///
- /// The sales header record to which the fields were copied.
- ///
- ///
- /// The existing state of the target sales header prior to the field transfer.
- ///
- ///
- /// The source sales shipment header record that was copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPostedShipment(var ToSalesHeader: Record "Sales Header"; OldSalesHeader: Record "Sales Header"; FromSalesShipmentHeader: Record "Sales Shipment Header")
- begin
- end;
-
- ///
- /// Event triggered after copying data from a posted purchase invoice header to a purchase header.
- /// Allows developers to perform additional logic or modifications after the copying process.
- ///
- ///
- /// The target purchase header record to which data was copied.
- ///
- ///
- /// The original purchase header record before copying.
- ///
- ///
- /// The source posted purchase invoice header record.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPostedPurchInvoice(var ToPurchaseHeader: Record "Purchase Header"; OldPurchaseHeader: Record "Purchase Header"; FromPurchInvHeader: Record "Purch. Inv. Header")
- begin
- end;
-
- ///
- /// Event triggered after completing the transfer of fields from the source return receipt header to the target sales header during the copy process.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after the fields have been transferred. This can be useful for implementing additional logic,
- /// validations, or workflows based on the copied return receipt data.
- ///
- ///
- /// The sales header record to which the fields were copied.
- ///
- ///
- /// The existing state of the target sales header prior to the field transfer.
- ///
- ///
- /// The source return receipt header record that was copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPostedReturnReceipt(var ToSalesHeader: Record "Sales Header"; OldSalesHeader: Record "Sales Header"; ReturnReceiptHeader: Record "Return Receipt Header")
- begin
- end;
-
- ///
- /// Event triggered after copying data from a posted return shipment header to a purchase header.
- /// Allows developers to perform additional logic or modifications after the copying process.
- ///
- ///
- /// The target purchase header record to which data was copied.
- ///
- ///
- /// The original purchase header record before copying.
- ///
- ///
- /// The source posted return shipment header record.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPostedReturnShipment(var ToPurchaseHeader: Record "Purchase Header"; OldPurchaseHeader: Record "Purchase Header"; FromReturnShipmentHeader: Record "Return Shipment Header")
- begin
- end;
-
- ///
- /// Event triggered after completing the sales document copy process.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after the document copy operation is completed. This can be useful for implementing post-processing logic,
- /// validations, or handling specific workflows related to the copy process.
- ///
- ///
- /// The type of the sales document being copied, represented as an integer.
- ///
- ///
- /// The document number of the sales document being copied.
- ///
- ///
- /// The sales header record to which the data was copied.
- ///
- ///
- /// The occurrence number of the source document, if applicable.
- ///
- ///
- /// The version number of the source document, if applicable.
- ///
- ///
- /// A boolean value indicating whether the header was included in the copy operation.
- ///
- ///
- /// A boolean value indicating whether the lines were recalculated during the copy operation.
- ///
- ///
- /// A boolean value indicating whether negative lines were moved during the copy operation.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesDocument(FromDocumentType: Option; FromDocumentNo: Code[20]; var ToSalesHeader: Record "Sales Header"; FromDocOccurenceNo: Integer; FromDocVersionNo: Integer; IncludeHeader: Boolean; RecalculateLines: Boolean; MoveNegLines: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after completing the transfer of fields from the source sales header archive to the target sales header.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after the archive header has been fully copied. This can be useful for additional processing,
- /// validations, or workflows related to archived sales headers.
- ///
- ///
- /// The sales header record to which the fields were copied.
- ///
- ///
- /// The existing state of the target sales header prior to the field transfer.
- ///
- ///
- /// The source sales header archive record that was copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesHeaderArchive(var ToSalesHeader: Record "Sales Header"; OldSalesHeader: Record "Sales Header"; FromSalesHeaderArchive: Record "Sales Header Archive")
- begin
- end;
-
- ///
- /// Event triggered after the sales header has been processed during the sales document update process.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after the header fields have been copied. This can be useful for post-processing logic,
- /// additional validations, or implementing specific workflows.
- ///
- ///
- /// The sales header record to which the data is being copied.
- ///
- ///
- /// The existing state of the target sales header prior to the update.
- ///
- ///
- /// The source sales header record being copied.
- ///
- ///
- /// The source sales shipment header, if applicable.
- ///
- ///
- /// The source sales invoice header, if applicable.
- ///
- ///
- /// The source return receipt header, if applicable.
- ///
- ///
- /// The source sales credit memo header, if applicable.
- ///
- ///
- /// The source sales header archive, if applicable.
- ///
- ///
- /// The type of the source sales document.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesHeaderDone(var ToSalesHeader: Record "Sales Header"; OldSalesHeader: Record "Sales Header"; FromSalesHeader: Record "Sales Header"; FromSalesShipmentHeader: Record "Sales Shipment Header"; FromSalesInvoiceHeader: Record "Sales Invoice Header"; FromReturnReceiptHeader: Record "Return Receipt Header"; FromSalesCrMemoHeader: Record "Sales Cr.Memo Header"; FromSalesHeaderArchive: Record "Sales Header Archive"; FromDocType: Enum "Sales Document Type From")
- begin
- end;
-
- ///
- /// Event triggered after sales lines with negative quantities have been deleted or validated during a test.
- /// This allows developers to perform additional logic after the deletion or validation process.
- ///
- ///
- /// The sales line record that was processed during the deletion or validation.
- ///
- ///
- /// A boolean flag indicating whether the operation was a test or a real deletion.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterDeleteSalesLinesWithNegQty(FromSalesLine: Record "Sales Line"; OnlyTest: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before the sales header is processed during the sales document update process.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// before the header fields have been copied. This can be useful for pre-processing logic
- /// or validating specific conditions prior to the header update.
- ///
- ///
- /// The sales header record to which the data is being copied.
- ///
- ///
- /// The source sales header record being copied.
- ///
- ///
- /// The type of the source sales document.
- ///
- ///
- /// The existing state of the target sales header prior to the update.
- ///
- ///
- /// The source sales shipment header, if applicable.
- ///
- ///
- /// The source sales invoice header, if applicable.
- ///
- ///
- /// The source return receipt header, if applicable.
- ///
- ///
- /// The source sales credit memo header, if applicable.
- ///
- ///
- /// The source sales header archive, if applicable.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesHeaderDone(var ToSalesHeader: Record "Sales Header"; FromSalesHeader: Record "Sales Header"; FromDocType: Enum "Sales Document Type From"; OldSalesHeader: Record "Sales Header";
- FromSalesShipmentHeader: Record "Sales Shipment Header";
- FromSalesInvoiceHeader: Record "Sales Invoice Header";
- FromReturnReceiptHeader: Record "Return Receipt Header";
- FromSalesCrMemoHeader: Record "Sales Cr.Memo Header";
- FromSalesHeaderArchive: Record "Sales Header Archive")
- begin
- end;
-
- ///
- /// Event triggered before starting the process of copying fields from the source sales invoice header to the target sales header.
- /// Subscribing to this event allows developers to override or extend the default behavior
- /// before the fields have been copied. This can be useful for implementing custom logic,
- /// skipping the default copy behavior, or applying additional validations.
- ///
- ///
- /// The sales header record to which the fields are being copied.
- ///
- ///
- /// The source sales invoice header record being copied.
- ///
- ///
- /// A boolean variable indicating whether the default copy behavior should be bypassed.
- /// Setting this variable to true will skip the default behavior.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopySalesHeaderFromPostedInvoice(var ToSalesHeader: Record "Sales Header"; SalesInvoiceHeader: Record "Sales Invoice Header"; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesCrMemoLine(var TempDocSalesLine: Record "Sales Line" temporary; var ToSalesHeader: Record "Sales Header"; var FromSalesLineBuf: Record "Sales Line"; var FromSalesCrMemoLine: Record "Sales Cr.Memo Line"; FromSalesLine: Record "Sales Line"; SplitLine: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesInvLine(var TempDocSalesLine: Record "Sales Line" temporary; var ToSalesHeader: Record "Sales Header"; var FromSalesLineBuf: Record "Sales Line"; var FromSalesInvLine: Record "Sales Invoice Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesLinesToBufferFields(var TempSalesLine: Record "Sales Line" temporary; FromSalesLine: Record "Sales Line"; FromSalesLineParam: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesLinesToDoc(FromDocType: Option; var ToSalesHeader: Record "Sales Header"; var FromSalesShipmentLine: Record "Sales Shipment Line"; var FromSalesInvoiceLine: Record "Sales Invoice Line"; var FromReturnReceiptLine: Record "Return Receipt Line"; var FromSalesCrMemoLine: Record "Sales Cr.Memo Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean; var RecalculateLines: Boolean; var IncludeHeader: Boolean)
- begin
- end;
-
-
- ///
- /// Event triggered after copying data from a posted purchase credit memo header to a purchase header.
- /// Allows developers to perform additional logic or modifications after the copying process.
- ///
- ///
- /// The target purchase header record to which data was copied.
- ///
- ///
- /// The original purchase header record before copying.
- ///
- ///
- /// The source posted purchase credit memo header record.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchHeaderFromPostedCreditMemo(var ToPurchaseHeader: Record "Purchase Header"; OldPurchaseHeader: Record "Purchase Header"; FromPurchCrMemoHeader: Record "Purch. Cr. Memo Hdr.")
- begin
- end;
-
- ///
- /// Event triggered after the entire purchase document copy process has been completed.
- /// Subscribing to this event allows developers to implement additional logic,
- /// custom validations, or workflows after the purchase document has been fully copied.
- /// This can be useful for finalizing the operation or integrating with other processes.
- ///
- ///
- /// The type of the source purchase document.
- ///
- ///
- /// The document number of the source purchase document.
- ///
- ///
- /// The target purchase header record to which the document was copied.
- ///
- ///
- /// The occurrence number of the source document (if applicable).
- ///
- ///
- /// The version number of the source document (if applicable).
- ///
- ///
- /// A boolean value indicating whether the source header data was included.
- ///
- ///
- /// A boolean value indicating whether the lines were recalculated during the copy process.
- ///
- ///
- /// A boolean value indicating whether negative lines were moved during the copy process.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchaseDocument(FromDocumentType: Option; FromDocumentNo: Code[20]; var ToPurchaseHeader: Record "Purchase Header"; FromDocOccurenceNo: Integer; FromDocVersionNo: Integer; IncludeHeader: Boolean; RecalculateLines: Boolean; MoveNegLines: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after copying data from a purchase header archive to a purchase header.
- /// Allows developers to perform additional logic or modifications after the copying process.
- ///
- ///
- /// The target purchase header record to which data was copied.
- ///
- ///
- /// The original purchase header record before copying.
- ///
- ///
- /// The source purchase header archive record.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchHeaderArchive(var ToPurchaseHeader: Record "Purchase Header"; OldPurchaseHeader: Record "Purchase Header"; FromPurchaseHeaderArchive: Record "Purchase Header Archive")
- begin
- end;
-
- ///
- /// Event triggered after the purchase header has been copied from the source to the target purchase document.
- /// Subscribing to this event allows developers to extend or customize the copying logic of purchase headers,
- /// such as adding additional fields or implementing validations.
- ///
- ///
- /// The target purchase header record where the header information has been copied.
- ///
- ///
- /// The previous state of the target purchase header before the copying process.
- ///
- ///
- /// The source purchase header record from which the information was copied.
- ///
- ///
- /// The source purchase receipt header, if applicable, for additional data transfer.
- ///
- ///
- /// The source purchase invoice header, if applicable, for additional data transfer.
- ///
- ///
- /// The source return shipment header, if applicable, for additional data transfer.
- ///
- ///
- /// The source purchase credit memo header, if applicable, for additional data transfer.
- ///
- ///
- /// The source purchase header archive record, if applicable, for additional data transfer.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchHeaderDone(var ToPurchaseHeader: Record "Purchase Header"; OldPurchaseHeader: Record "Purchase Header"; FromPurchaseHeader: Record "Purchase Header"; FromPurchRcptHeader: Record "Purch. Rcpt. Header"; FromPurchInvHeader: Record "Purch. Inv. Header"; ReturnShipmentHeader: Record "Return Shipment Header"; FromPurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; FromPurchaseHeaderArchive: Record "Purchase Header Archive")
- begin
- end;
-
- ///
- /// Event triggered before finalizing the header copying process.
- /// Subscribing to this event allows developers to modify or add logic during initialization or pre-processing.
- ///
- ///
- /// The target purchase header record where the header information will be copied.
- ///
- ///
- /// The source purchase header record being copied.
- ///
- ///
- /// The document type of the source purchase document.
- ///
- ///
- /// The target purchase header's state before the copying process.
- ///
- ///
- /// The source purchase receipt header, if applicable.
- ///
- ///
- /// The source purchase invoice header, if applicable.
- ///
- ///
- /// The source return shipment header, if applicable.
- ///
- ///
- /// The source purchase credit memo header, if applicable.
- ///
- ///
- /// The source purchase header archive, if applicable.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyPurchHeaderDone(var ToPurchaseHeader: Record "Purchase Header"; FromPurchaseHeader: Record "Purchase Header"; FromDocType: Enum "Purchase Document Type From"; OldPurchaseHeader: Record "Purchase Header";
- FromPurchRcptHeader: Record "Purch. Rcpt. Header";
- FromPurchInvHeader: Record "Purch. Inv. Header";
- FromReturnShipmentHeader: Record "Return Shipment Header";
- FromPurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.";
- FromPurchaseHeaderArchive: Record "Purchase Header Archive";
- BuyFromVendor: Record Vendor;
- PayToVendor: Record Vendor)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchInvLines(var TempDocPurchaseLine: Record "Purchase Line" temporary; var ToPurchHeader: Record "Purchase Header"; var FromPurchLineBuf: Record "Purchase Line"; var FromPurchInvLine: Record "Purch. Inv. Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchInvLine(FromPurchInvLine: Record "Purch. Inv. Line"; var ToPurchaseLine: Record "Purchase Line"; ToPurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchLinesToBufferFields(var TempPurchaseLine: Record "Purchase Line" temporary; FromPurchaseLine: Record "Purchase Line"; FromPurchLine: Record "Purchase Line"; ToPurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchaseLinesToDoc(FromDocType: Option; var ToPurchaseHeader: Record "Purchase Header"; var FromPurchRcptLine: Record "Purch. Rcpt. Line"; var FromPurchInvLine: Record "Purch. Inv. Line"; var FromReturnShipmentLine: Record "Return Shipment Line"; var FromPurchCrMemoLine: Record "Purch. Cr. Memo Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean; var RecalculateLines: Boolean; var IncludeHeader: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchCrMemoLine(FromPurchCrMemoLine: Record "Purch. Cr. Memo Line"; var ToPurchaseLine: Record "Purchase Line"; ToPurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchRcptLine(FromPurchRcptLine: Record "Purch. Rcpt. Line"; var ToPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyReturnShptLine(FromReturnShipmentLine: Record "Return Shipment Line"; var ToPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitFromSalesLine(var FromSalesLine2: Record "Sales Line"; var FromSalesLineBuf: Record "Sales Line");
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitShipmentDateInLine(SalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line");
- begin
- end;
-
- ///
- /// Event triggered after handling the assembly attached to a sales line. This allows additional modifications or actions after the handling process has been completed.
- ///
- /// The sales line record that has been processed.
- [IntegrationEvent(false, false)]
- local procedure OnAfterHandleAsmAttachedToSalesLine(var ToSalesLine: Record "Sales Line");
- begin
- end;
-
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterProcessToAsmHeader(var ToAsmHeader: Record "Assembly Header"; TempFromAsmHeader: Record "Assembly Header" temporary; ToSalesLine: Record "Sales Line"; BasicAsmOrderCopy: Boolean; AvailabilityCheck: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterRecalculatePurchLine(var PurchaseLine: Record "Purchase Line"; var ToPurchHeader: Record "Purchase Header"; var FromPurchHeader: Record "Purchase Header"; var FromPurchLine: Record "Purchase Line"; var CopyThisLine: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after recalculating the sales line. This allows additional modifications or checks after the recalculation process.
- ///
- /// The target sales header record being updated.
- /// The target sales line record being recalculated.
- /// The source sales header record being copied from.
- /// The source sales line record being copied from.
- /// A boolean variable indicating whether the line was copied.
- [IntegrationEvent(false, false)]
- local procedure OnAfterRecalculateSalesLine(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesHeader: Record "Sales Header"; var FromSalesLine: Record "Sales Line"; var CopyThisLine: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetDefaultValuesToSalesLine(var ToSalesLine: Record "Sales Line"; ToSalesHeader: Record "Sales Header"; CreateToHeader: Boolean; RecalculateLines: Boolean; FromSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetDefaultValuesToPurchLine(var ToPurchaseLine: Record "Purchase Line"; ToPurchHeader: Record "Purchase Header"; CreateToHeader: Boolean; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterShouldSkipCopyFromDescription(var Result: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterTransferFieldsFromCrMemoToInv(var ToSalesHeader: Record "Sales Header"; FromSalesCrMemoHeader: Record "Sales Cr.Memo Header"; var CopyJobData: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterTransferTempAsmHeader(var TempAssemblyHeader: Record "Assembly Header" temporary; PostedAssemblyHeader: Record "Posted Assembly Header")
- begin
- end;
-
- ///
- /// Event triggered after the sales line update process has been completed. This allows additional modifications or checks after all updates have been executed.
- ///
- /// The target sales header record being updated.
- /// The target sales line record being updated.
- /// The source sales header record being copied from.
- /// The source sales line record being copied from.
- /// A boolean variable indicating whether the line was copied.
- /// A boolean variable indicating if the amounts were recalculated.
- /// The document type of the source sales document.
- /// A boolean variable indicating if posted deferrals were copied.
- /// A boolean variable indicating if exact cost reversal is mandatory.
- /// A boolean variable indicating if negative lines were moved.
- /// A boolean variable indicating if lines were recalculated.
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateSalesLine(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesHeader: Record "Sales Header"; var FromSalesLine: Record "Sales Line"; var CopyThisLine: Boolean; RecalculateAmount: Boolean; FromSalesDocType: Option; var CopyPostedDeferral: Boolean; ExactCostRevMandatory: Boolean; MoveNegLines: Boolean; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdatePurchCreditMemoHeader(var PurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- ///
- /// Event triggered after updating a purchase line during the document copy process. Allows additional processing or validation.
- ///
- /// The target purchase header record where the line was copied to.
- /// The target purchase line record that was updated.
- /// The source purchase header record where the line was copied from.
- /// The source purchase line record that was copied.
- /// A boolean variable indicating if the current line was copied.
- /// A boolean variable indicating if amounts were recalculated during the update.
- /// The type of the source purchase document.
- /// A boolean variable indicating if posted deferrals were copied.
- /// A boolean variable indicating if lines were recalculated.
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdatePurchLine(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; var FromPurchHeader: Record "Purchase Header"; var FromPurchLine: Record "Purchase Line"; var CopyThisLine: Boolean; RecalculateAmount: Boolean; FromPurchDocType: Option; var CopyPostedDeferral: Boolean; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateRevSalesLineAmount(var SalesLine: Record "Sales Line"; OrgQtyBase: Decimal; FromPricesInclVAT: Boolean; ToPricesInclVAT: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateVendLedgEntry(var PurchaseHeader: Record "Purchase Header"; FromDocumentNo: Code[20]; FromDocType: Enum "Gen. Journal Document Type"; var VendorLedgerEntry: Record "Vendor Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesLine(var ToSalesLine: Record "Sales Line"; var FromSalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Event triggered after setting the reserve property for the sales line. This allows additional customizations of the reserve logic.
- ///
- /// The target sales line record being updated.
- /// The source sales line record being copied from.
- /// The document type of the source sales document.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesLineOnAfterSetReserve(var ToSalesLine: Record "Sales Line"; FromSalesLine: Record "Sales Line"; FromSalesDocType: Enum "Sales Document Type From")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdatePurchLine(var ToPurchLine: Record "Purchase Line"; var FromPurchLine: Record "Purchase Line")
- begin
- end;
-
- ///
- /// Event triggered after determining whether to fetch the unit cost for the sales line. This allows custom logic based on the fetched unit cost.
- ///
- /// The item record associated with the sales line.
- /// A boolean variable indicating whether the unit cost should be fetched.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesLineOnAfterCalcShouldGetUnitCost(var Item: Record Item; var ShouldGetUnitCost: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocWithHeader(FromDocType: Option; FromDocNo: Code[20]; var ToSalesHeader: Record "Sales Header"; FromDocOccurenceNo: Integer; FromDocVersionNo: Integer; var FromSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPostedDeferralsOnBeforeDeferralHeaderInsert(var DeferralHeader: Record "Deferral Header"; PostedDeferralHeader: Record "Posted Deferral Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPostedDeferralsOnBeforeDeferralHeaderModify(var DeferralHeader: Record "Deferral Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPostedDeferralsOnBeforeDeferralLineInsert(var DeferralLine: Record "Deferral Line"; PostedDeferralLine: Record "Posted Deferral Line")
- begin
- end;
-
- ///
- /// Event triggered when the header is being processed for copying in a purchase document.
- /// Allows developers to implement advanced processing during header inclusion.
- ///
- ///
- /// The document type of the source purchase document.
- ///
- ///
- /// The document number of the source purchase document.
- ///
- ///
- /// The target purchase header record being processed.
- ///
- ///
- /// The occurrence number of the source document, if applicable.
- ///
- ///
- /// The version number of the source document, if applicable.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocWithHeader(FromDocType: Option; FromDocNo: Code[20]; var ToPurchHeader: Record "Purchase Header"; FromDocOccurenceNo: Integer; FromDocVersionNo: Integer)
- begin
- end;
-
- ///
- /// Event triggered after transferring fields from a sales line to a purchase line.
- /// This allows developers to apply additional logic or modifications after the field transfer process has been completed.
- ///
- ///
- /// The sales line record from which fields were transferred.
- ///
- ///
- /// The purchase line record to which fields were transferred.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterTransfldsFromSalesToPurchLine(var FromSalesLine: Record "Sales Line"; var ToPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitAndCheckSalesDocuments(FromDocType: Option; FromDocNo: Code[20]; FromDocOccurrenceNo: Integer; FromDocVersionNo: Integer; var FromSalesHeader: Record "Sales Header"; var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesShipmentHeader: Record "Sales Shipment Header"; var FromSalesInvoiceHeader: Record "Sales Invoice Header"; var FromReturnReceiptHeader: Record "Return Receipt Header"; var FromSalesCrMemoHeader: Record "Sales Cr.Memo Header"; var FromSalesHeaderArchive: Record "Sales Header Archive"; IncludeHeader: Boolean; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitAndCheckPurchaseDocuments(FromDocType: Option; FromDocNo: Code[20]; FromDocOccurrenceNo: Integer; FromDocVersionNo: Integer; var FromPurchaseHeader: Record "Purchase Header"; var ToPurchaseHeader: Record "Purchase Header"; var FromPurchRcptHeader: Record "Purch. Rcpt. Header"; var FromPurchInvHeader: Record "Purch. Inv. Header"; var FromReturnShipmentHeader: Record "Return Shipment Header"; var FromPurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; var FromPurchaseHeaderArchive: Record "Purchase Header Archive"; IncludeHeader: Boolean; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitSalesLineFields(var SalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitPurchLineFields(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitToSalesLine(var ToSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitSalesLineFields(var SalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitPurchLineFields(var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- ///
- /// Event triggered before inserting the copied sales line into the target sales document.
- /// This allows developers to modify the sales line prior to insertion.
- ///
- /// The target sales line being inserted.
- /// The source sales line being copied.
- /// The document type of the source sales document.
- /// A boolean variable indicating whether lines need to be recalculated during the copy operation.
- /// The target sales header to which the sales line will be copied.
- /// The line number of the document line being processed.
- /// The next line number to be assigned to the target sales line.
- /// A boolean variable indicating whether the amounts need to be recalculated for the copied sales line.
- /// A boolean variable that allows developers to handle the logic themselves and skip the default insertion process if set to true.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInsertToSalesLine(var ToSalesLine: Record "Sales Line"; var FromSalesLine: Record "Sales Line"; FromDocType: Option; RecalcLines: Boolean; var ToSalesHeader: Record "Sales Header"; DocLineNo: Integer; var NextLineNo: Integer; RecalculateAmount: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeInsertOldSalesDocNoLine(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; OldDocType: Option; OldDocNo: Code[20]; var NextLineNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckFromSalesInvHeader(SalesInvoiceHeaderFrom: Record "Sales Invoice Header"; SalesHeaderTo: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckCopyFromSalesHeaderArchiveAvail(FromSalesHeaderArchive: Record "Sales Header Archive"; ToSalesHeader: Record "Sales Header"; MoveNegLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckUnappliedLines(SkippedLine: Boolean; var MissingExCostRevLink: Boolean; var WarningDone: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInsertOldSalesCombDocNoLine(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; CopyFromInvoice: Boolean; OldDocNo: Code[20]; OldDocNo2: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInsertOldSalesCombDocNoLineProcedure(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; CopyFromInvoice: Boolean; OldDocNo: Code[20]; OldDocNo2: Code[20]; var NextLineNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterInitToPurchLine(var ToPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- ///
- /// Event triggered before inserting the purchase line into the target document. This allows modifications to the line before insertion.
- ///
- /// The purchase line of the target document.
- /// The purchase line from the source document being processed.
- /// The type of the source purchase document.
- /// A boolean variable indicating if the lines should be recalculated.
- /// The purchase header of the target document.
- /// The line number of the source document line.
- /// The next line number for the target document.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInsertToPurchLine(var ToPurchLine: Record "Purchase Line"; FromPurchLine: Record "Purchase Line"; FromDocType: Option; RecalcLines: Boolean; var ToPurchHeader: Record "Purchase Header"; DocLineNo: Integer; var NexLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeInsertOldPurchDocNoLine(ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; OldDocType: Option; OldDocNo: Code[20]; var NextLineNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInsertOldPurchCombDocNoLine(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; CopyFromInvoice: Boolean; OldDocNo: Code[20]; OldDocNo2: Code[20])
- begin
- end;
-
- ///
- /// Event triggered before displaying a purchase document.
- /// This allows developers to modify or override the default behavior when showing a purchase document.
- ///
- ///
- /// The purchase header record representing the document to be displayed.
- ///
- ///
- /// A variable indicating whether the default behavior should be skipped.
- /// Setting this variable to true will skip the default display logic.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowPurchDoc(var ToPurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before displaying a sales document.
- /// This allows developers to modify or override the default behavior when showing a sales document.
- ///
- ///
- /// The sales header record representing the document to be displayed.
- ///
- ///
- /// A variable indicating whether the default behavior should be skipped.
- /// Setting this variable to true will skip the default display logic.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeShowSalesDoc(var ToSalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateCustLedgEntry(var ToSalesHeader: Record "Sales Header"; var CustLedgerEntry: Record "Cust. Ledger Entry"; var IsHandled: Boolean; FromDocType: Enum "Gen. Journal Document Type"; FromDocNo: Code[20])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateVendLedgEntry(var ToPurchaseHeader: Record "Purchase Header"; VendorLedgerEntry: Record "Vendor Ledger Entry"; var IsHandled: Boolean; FromDocType: Enum "Gen. Journal Document Type"; FromDocNo: Code[20])
- begin
- end;
-
- ///
- /// Event triggered after inserting the copied sales line into the target sales document.
- /// This allows developers to perform final adjustments or actions.
- ///
- /// The target sales line that was inserted.
- /// The source sales line that was copied.
- /// A boolean variable indicating whether lines were recalculated during the copy operation.
- /// The line number of the document line being processed.
- /// The document type of the source sales document.
- /// The source sales header from which the sales line was copied.
- /// The next line number assigned to the target sales line.
- /// The target sales header to which the sales line was copied.
- [IntegrationEvent(false, false)]
- local procedure OnAfterInsertToSalesLine(var ToSalesLine: Record "Sales Line"; FromSalesLine: Record "Sales Line"; RecalculateLines: Boolean; DocLineNo: Integer; FromSalesDocType: Enum "Sales Document Type From"; FromSalesHeader: Record "Sales Header"; var NextLineNo: Integer; var ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Event triggered after copying a sales line to a purchase line during the copying process from a sales document to a purchase document.
- /// This allows developers to apply additional logic or modifications after the line has been copied.
- ///
- ///
- /// The purchase line record representing the line that was created.
- ///
- ///
- /// The sales line record from which data was copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesToPurchDoc(var ToPurchLine: Record "Purchase Line"; var FromSalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Event triggered after inserting a purchase line into the target document. Allows further processing or validation after the insertion.
- ///
- /// The purchase line of the target document.
- /// The purchase line from the source document being processed.
- /// A boolean variable indicating if the lines should be recalculated.
- /// The line number of the source document line.
- /// The type of the source purchase document.
- /// The purchase header of the target document.
- /// A boolean variable indicating if negative lines should be moved.
- /// The purchase header of the source document.
- [IntegrationEvent(true, false)]
- local procedure OnAfterInsertToPurchLine(var ToPurchLine: Record "Purchase Line"; var FromPurchLine: Record "Purchase Line"; RecalculateLines: Boolean; DocLineNo: Integer; FromPurchDocType: Enum "Purchase Document Type From"; var ToPurchHeader: Record "Purchase Header"; MoveNegLines: Boolean; FromPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- ///
- /// Event triggered after the sales header fields have been transferred from the source sales header to the target sales header during the copy process.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after the fields have transferred. This can be useful for implementing additional logic,
- /// validations, or workflows based on the copied data.
- ///
- ///
- /// The sales header record to which the fields were copied.
- ///
- ///
- /// The existing state of the target sales header prior to the field transfer.
- ///
- ///
- /// The source sales header record from which the fields were copied.
- ///
- ///
- /// The type of the source sales document.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesHeader(var ToSalesHeader: Record "Sales Header"; OldSalesHeader: Record "Sales Header"; FromSalesHeader: Record "Sales Header"; FromDocType: Enum "Sales Document Type From")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCleanSpecialOrderDropShipmentInSalesLine(var SalesLine: Record "Sales Line");
- begin
- end;
-
- ///
- /// Event triggered after copying data from the source purchase header to the target purchase header.
- /// Subscribing to this event allows developers to validate or extend the copied data.
- ///
- ///
- /// The target purchase header record after data has been copied.
- ///
- ///
- /// The target purchase header's state before the copying process.
- ///
- ///
- /// The source purchase header record being copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchaseHeader(var ToPurchaseHeader: Record "Purchase Header"; OldPurchaseHeader: Record "Purchase Header"; FromPurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesLineFromSalesDocSalesLine(ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesLine: Record "Sales Line"; IncludeHeader: Boolean; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesLineFromSalesLineBuffer(var ToSalesLine: Record "Sales Line"; FromSalesInvLine: Record "Sales Invoice Line"; IncludeHeader: Boolean; RecalculateLines: Boolean; var TempDocSalesLine: Record "Sales Line" temporary; ToSalesHeader: Record "Sales Header"; var FromSalesLineBuf: Record "Sales Line"; var FromSalesLine2: Record "Sales Line"; FromSalesLine: Record "Sales Line"; ExactCostRevMandatory: Boolean; FromSalesInvHeader: Record "Sales Invoice Header"; var LinesNotCopied: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesLineFromSalesCrMemoLineBuffer(var ToSalesLine: Record "Sales Line"; FromSalesCrMemoLine: Record "Sales Cr.Memo Line"; IncludeHeader: Boolean; RecalculateLines: Boolean; var TempDocSalesLine: Record "Sales Line" temporary; ToSalesHeader: Record "Sales Header"; FromSalesLineBuf: Record "Sales Line"; FromSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesLineFromSalesShptLineBuffer(var ToSalesLine: Record "Sales Line"; FromSalesShipmentLine: Record "Sales Shipment Line"; IncludeHeader: Boolean; RecalculateLines: Boolean; var TempDocSalesLine: Record "Sales Line" temporary; ToSalesHeader: Record "Sales Header"; FromSalesLineBuf: Record "Sales Line"; ExactCostRevMandatory: Boolean; FromSalesHeader: Record "Sales Header"; var LinesNotCopied: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesLineFromReturnRcptLineBuffer(var ToSalesLine: Record "Sales Line"; FromReturnReceiptLine: Record "Return Receipt Line"; IncludeHeader: Boolean; RecalculateLines: Boolean; var TempDocSalesLine: Record "Sales Line" temporary; ToSalesHeader: Record "Sales Header"; FromSalesLineBuf: Record "Sales Line"; CopyItemTrkg: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchLineFromPurchLineBuffer(var ToPurchLine: Record "Purchase Line"; FromPurchInvLine: Record "Purch. Inv. Line"; IncludeHeader: Boolean; RecalculateLines: Boolean; var TempDocPurchaseLine: Record "Purchase Line" temporary; ToPurchHeader: Record "Purchase Header"; FromPurchLineBuf: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchLineFromPurchCrMemoLineBuffer(var ToPurchaseLine: Record "Purchase Line"; FromPurchCrMemoLine: Record "Purch. Cr. Memo Line"; IncludeHeader: Boolean; RecalculateLines: Boolean; var TempDocPurchLine: Record "Purchase Line" temporary; ToPurchHeader: Record "Purchase Header"; FromPurchLineBuf: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchLineFromPurchRcptLineBuffer(var ToPurchaseLine: Record "Purchase Line"; FromPurchRcptLine: Record "Purch. Rcpt. Line"; IncludeHeader: Boolean; RecalculateLines: Boolean; var TempDocPurchLine: Record "Purchase Line" temporary; ToPurchHeader: Record "Purchase Header"; FromPurchLineBuf: Record "Purchase Line"; CopyItemTrkg: Boolean; NextLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchLineFromReturnShptLineBuffer(var ToPurchaseLine: Record "Purchase Line"; FromReturnShipmentLine: Record "Return Shipment Line"; IncludeHeader: Boolean; RecalculateLines: Boolean; var TempDocPurchLine: Record "Purchase Line" temporary; ToPurchHeader: Record "Purchase Header"; FromPurchLineBuf: Record "Purchase Line"; CopyItemTrkg: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after fields have been copied from the old sales header to the updated sales header during the update process.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after the fields have been copied. This can be useful for implementing additional logic or workflows
- /// based on the updated data.
- ///
- ///
- /// The sales header record being updated.
- ///
- ///
- /// The existing state of the target sales header prior to the update.
- ///
- ///
- /// A boolean value indicating whether negative lines should be moved during the copy process.
- ///
- ///
- /// A boolean value indicating whether the header was included in the copy operation.
- ///
- ///
- /// The type of the source sales document.
- ///
- ///
- /// A boolean value indicating whether the lines should be recalculated during the copy process.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyFieldsFromOldSalesHeader(var ToSalesHeader: Record "Sales Header"; OldSalesHeader: Record "Sales Header"; MoveNegLines: Boolean; IncludeHeader: Boolean; FromDocType: Enum "Sales Document Type From"; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyFieldsFromOldPurchHeader(var ToPurchHeader: Record "Purchase Header"; OldPurchHeader: Record "Purchase Header"; MoveNegLines: Boolean; IncludeHeader: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after completing the copying process from a sales document to a purchase document.
- /// This allows developers to apply additional logic or modifications after the entire process has been completed.
- ///
- ///
- /// The sales header record from which data was copied.
- ///
- ///
- /// The purchase header record representing the document that was created.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyFromSalesToPurchDoc(FromSalesHeader: Record "Sales Header"; var ToPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateRevPurchLineAmount(var PurchaseLine: Record "Purchase Line"; OrgQtyBase: Decimal; FromPricesInclVAT: Boolean; ToPricesInclVAT: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCalcReversibleQtyBaseSalesDoc(FromSalesLine: Record "Sales Line"; var ItemLedgEntry: record "Item Ledger Entry"; var ReversibleQtyBase: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckFromSalesHeader(SalesHeaderFrom: Record "Sales Header"; SalesHeaderTo: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckUpdateOldDocumentNoFromSalesShptLine(FromSalesShptLine: Record "Sales Shipment Line"; var OldDocNo: Code[20]; var InsertDocNoLine: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckUpdateOldDocumentNoFromPurchRcptLine(FromPurchRcptLine: Record "Purch. Rcpt. Line"; var OldDocNo: Code[20]; var InsertDocNoLine: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckUpdateOldDocumentNoFromReturnRcptLine(FromReturnRcptLine: Record "Return Receipt Line"; var OldDocNo: Code[20]; var InsertDocNoLine: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckUpdateOldDocumentNoFromReturnShptLine(FromReturnShptLine: Record "Return Shipment Line"; var OldDocNo: Code[20]; var InsertDocNoLine: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeClearPurchaseBlanketOrderFields(var ToPurchaseLine: Record "Purchase Line"; ToPurchHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before clearing the "Last No." fields in the purchase header. Allows overriding or customizing the clearing process.
- ///
- /// The purchase header record whose "Last No." fields are being cleared.
- /// A boolean variable indicating if the event is handled. If set to true, the default logic will be skipped.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeClearPurchLastNoSFields(var PurchaseHeader: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before clearing the "Invoice" and "Ship" fields in the target sales header during the sales document update process.
- /// Subscribing to this event allows developers to override or extend the default behavior
- /// when clearing these fields. This can be useful for applying custom logic or skipping the default clearing operation.
- ///
- ///
- /// The sales header record where the "Invoice" and "Ship" fields are to be cleared.
- ///
- ///
- /// A boolean variable indicating whether the default clearing behavior should be bypassed.
- /// Setting this variable to true will skip the default behavior.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeClearInvoiceAndShip(var ToSalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeClearSalesBlanketOrderFields(var ToSalesLine: Record "Sales Line"; ToSalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckCreditLimit(var FromSalesHeader: Record "Sales Header"; var ToSalesHeader: record "Sales Header"; var SkipTestCreditLimit: Boolean; var IsHandled: Boolean; IncludeHeader: Boolean; HideDialog: Boolean; FromDocType: Enum "Sales Document Type From")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeIsCopyItemTrkg(var ItemLedgEntry: Record "Item Ledger Entry"; var CopyItemTrkg: Boolean; var FillExactCostRevLink: Boolean; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeInitAndCheckSalesDocuments(FromDocType: enum "Sales Document Type From"; FromDocNo: Code[20];
- FromDocOccurrenceNo: Integer;
- FromDocVersionNo: Integer; var FromSalesHeader: Record "Sales Header"; var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; MoveNegLines: boolean; IncludeHeader: Boolean; var RecalculateLines: Boolean; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeIsPurchFillExactCostRevLink(ToPurchHeader: Record "Purchase Header"; FromDocType: Option "Purchase Receipt","Purchase Invoice","Purchase Return Shipment","Purchase Credit Memo"; CurrencyCode: Code[10]; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeIsSalesFillExactCostRevLink(ToSalesHeader: Record "Sales Header"; FromDocType: Option "Sales Shipment","Sales Invoice","Sales Return Receipt","Sales Credit Memo"; CurrencyCode: Code[10]; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeRecalculatePurchLine(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; var FromPurchHeader: Record "Purchase Header"; var FromPurchLine: Record "Purchase Line"; var CopyThisLine: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before recalculating the sales line amounts.
- /// This allows developers to customize or skip the recalculation logic for sales line amounts.
- ///
- /// The source sales line from which data is being copied.
- /// The target sales line to be recalculated.
- /// The currency record used for recalculating amounts.
- /// A boolean variable that allows developers to handle the recalculation logic themselves and skip the default processing if set to true.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeRecalculateSalesLineAmounts(FromSalesLine: Record "Sales Line"; var ToSalesLine: Record "Sales Line"; Currency: Record Currency; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before recalculating and applying sales line changes.
- /// This allows developers to customize or skip the recalculation logic.
- ///
- /// The target sales header associated with the sales line.
- /// The target sales line to be recalculated and applied.
- /// The source sales line from which data is being copied.
- /// The currency record used for recalculating amounts.
- /// A boolean variable indicating whether exact cost reversal is mandatory for the operation.
- /// A boolean variable indicating whether amounts should be recalculated during the operation.
- /// A boolean variable indicating whether a new header is being created during the copy operation.
- /// A boolean variable indicating whether negative lines should be moved instead of copied.
- /// A boolean variable that allows developers to handle the recalculation logic themselves and skip the default processing if set to true.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeRecalculateAndApplySalesLine(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesLine: Record "Sales Line"; Currency: Record Currency; var ExactCostRevMandatory: Boolean; var RecalculateAmount: Boolean; var CreateToHeader: Boolean; MoveNegLines: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before recalculating and applying purchase line data. Allows overriding or customizing the recalculation process.
- ///
- /// The purchase header of the target document.
- /// The purchase line of the target document.
- /// The purchase line from the source document being processed.
- /// The currency record used for rounding calculations.
- /// A boolean variable indicating if the amounts should be recalculated.
- /// A boolean variable indicating if exact cost reversal is mandatory.
- /// A boolean variable indicating if a new target header should be created.
- /// A boolean variable indicating if negative lines should be moved.
- /// A boolean variable indicating if the event is handled. If set to true, the default logic will be skipped.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeRecalculateAndApplyPurchLine(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; var FromPurchLine: Record "Purchase Line"; Currency: Record Currency; var ExactCostRevMandatory: Boolean; var RecalculateAmount: Boolean; var CreateToHeader: Boolean; MoveNegLines: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateSalesLineQtyBaseFromReversibleQtyBase(var FromSalesLine: Record "Sales Line"; var SalesLineBuffer: record "Sales Line"; ReversibleQtyBase: decimal; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before updating the sales header during a copy operation from another sales header.
- /// This allows developers to override or extend the default logic when copying sales header data.
- ///
- /// The sales header being updated.
- /// The original sales header from which data is being copied.
- /// The document type of the original sales header.
- /// A boolean variable that, when set to true, skips the default update logic.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateSalesHeaderWhenCopyFromSalesHeader(var SalesHeader: Record "Sales Header"; OriginalSalesHeader: Record "Sales Header"; FromDocType: Enum "Sales Document Type From"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckCopyFromSalesHeaderAvailOnAfterCheckItemAvailability(ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; FromSalesHeader: Record "Sales Header"; IncludeHeader: Boolean; FromSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckCopyFromSalesHeaderAvailOnAfterSetFilters(var FromSalesLine: Record "Sales Line"; FromSalesHeader: Record "Sales Header"; ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckCopyFromSalesHeaderArchiveAvailOnAfterCheckItemAvailability(ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; FromSalesHeaderArchive: Record "Sales Header Archive"; FromSalesLineArchive: Record "Sales Line Archive"; IncludeHeader: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckCopyFromSalesHeaderArchiveAvailOnAfterSetFilters(var FromSalesLineArchive: Record "Sales Line Archive"; FromSalesHeaderArchive: Record "Sales Header Archive"; ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckCopyFromSalesRetRcptAvailOnAfterCheckItemAvailability(ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; FromReturnReceiptHeader: Record "Return Receipt Header"; IncludeHeader: Boolean; FromReturnRcptLine: Record "Return Receipt Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckCopyFromSalesRetRcptAvailOnAfterSetFilters(var FromReturnReceiptLine: Record "Return Receipt Line"; FromReturnReceiptHeader: Record "Return Receipt Header"; ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckCopyFromSalesCrMemoAvailOnAfterCheckItemAvailability(ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; FromSalesCrMemoHeader: Record "Sales Cr.Memo Header"; IncludeHeader: Boolean; FromSalesCrMemoLine: Record "Sales Cr.Memo Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckCopyFromSalesCrMemoAvailOnAfterSetFilters(var FromSalesCrMemoLine: Record "Sales Cr.Memo Line"; FromSalesCrMemoHeader: Record "Sales Cr.Memo Header"; ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckCopyFromSalesCrMemoAvailOnBeforeCheckItemAvailability(var FromSalesCrMemoLine: Record "Sales Cr.Memo Line"; var ToSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckCopyFromSalesInvoiceAvailOnAfterCheckItemAvailability(ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; FromSalesInvoiceHeader: Record "Sales Invoice Header"; IncludeHeader: Boolean; FromSalesInvLine: Record "Sales Invoice Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckCopyFromSalesInvoiceAvailOnAfterSetFilters(var FromSalesInvoiceLine: Record "Sales Invoice Line"; FromSalesInvoiceHeader: Record "Sales Invoice Header"; ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckCopyFromSalesShptAvailOnAfterCheckItemAvailability(ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; FromSalesShipmentHeader: Record "Sales Shipment Header"; IncludeHeader: Boolean; FromSalesShptLine: Record "Sales Shipment Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckCopyFromSalesShptAvailOnAfterSetFilters(var FromSalesShipmentLine: Record "Sales Shipment Line"; FromSalesShipmentHeader: Record "Sales Shipment Header"; ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckItemAvailabilityOnBeforeRunSalesLineCheck(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchSalesLineOnAfterToSalesLineInsert(var ToSalesLine: Record "Sales Line"; FromSalesLineArchive: Record "Sales Line Archive"; RecalculateLines: Boolean; var NextLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchSalesLineOnBeforeToSalesLineInsert(var ToSalesLine: Record "Sales Line"; FromSalesLineArchive: Record "Sales Line Archive"; RecalculateLines: Boolean; var NextLineNo: Integer; var TransferOldExtLines: Codeunit "Transfer Old Ext. Text Lines"; ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchPurchLineOnAfterToPurchLineInsert(var ToPurchLine: Record "Purchase Line"; FromPurchLineArchive: Record "Purchase Line Archive"; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchPurchLineOnBeforeToPurchLineInsert(var ToPurchLine: Record "Purchase Line"; FromPurchLineArchive: Record "Purchase Line Archive"; RecalculateLines: Boolean; var NextLineNo: Integer; var TransferOldExtLines: Codeunit "Transfer Old Ext. Text Lines")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyFromPurchDocAssgntToLineOnAfterSetFilters(var ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyFromPurchDocAssgntToLineOnBeforeInsert(var ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; RecalculateLines: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyFromSalesDocAssgntToLineOnAfterSetFilters(var ItemChargeAssignmentSales: Record "Item Charge Assignment (Sales)"; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyFromSalesDocAssgntToLineOnBeforeInsert(var ItemChargeAssignmentSales: Record "Item Charge Assignment (Sales)"; RecalculateLines: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after calculating whether item tracking entries should be copied from a sales line to a purchase line.
- /// This allows developers to modify the logic determining whether item tracking entries should be included.
- ///
- ///
- /// The purchase line record representing the target line being created.
- ///
- ///
- /// A variable indicating whether item tracking entries should be copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyFromSalesToPurchDocOnAfterCalcShouldCopyItemTracking(ToPurchLine: Record "Purchase Line"; var ShouldCopyItemTracking: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after setting filters on the sales lines during the copying process from a sales document to a purchase document.
- /// This allows developers to add or modify the filters applied to the sales lines being processed.
- ///
- ///
- /// The sales line record being filtered.
- ///
- ///
- /// The sales header record from which data is being copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyFromSalesToPurchDocOnAfterSetFilters(var FromSalesLine: Record "Sales Line"; FromSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Event triggered before modifying a purchase header during the copying process from a sales document to a purchase document.
- /// This allows developers to apply additional modifications to the purchase header prior to saving.
- ///
- ///
- /// The purchase header record representing the document being modified.
- ///
- ///
- /// The sales header record from which data is being copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyFromSalesToPurchDocOnBeforeToPurchHeaderModify(var ToPurchHeader: Record "Purchase Header"; FromSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Event triggered before inserting a purchase header during the copying process from a sales document to a purchase document.
- /// This allows developers to modify or override the default behavior during the purchase header creation.
- ///
- ///
- /// The purchase header record representing the document being created.
- ///
- ///
- /// The sales header record from which data is being copied.
- ///
- ///
- /// The vendor number associated with the purchase document.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyFromSalesToPurchDocOnBeforePurchaseHeaderInsert(var ToPurchaseHeader: Record "Purchase Header"; FromSalesHeader: Record "Sales Header"; VendorNo: Code[20])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchLineOnBeforeCheckVATBusGroup(PurchaseLine: Record "Purchase Line"; var CheckVATBusGroup: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckItemAvailability(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var HideDialog: Boolean; var IsHandled: Boolean; RecalculateLines: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckCopyFromSalesInvoiceAvail(var FromSalesInvHeader: Record "Sales Invoice Header"; var ToSalesHeader: Record "Sales Header"; var FromSalesInvLine: Record "Sales Invoice Line"; var ToSalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchSalesLineOnAfterValidateQuantityMoveNegLines(var ToSalesLine: Record "Sales Line"; FromSalesLineArchive: Record "Sales Line Archive")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchSalesLineOnBeforeCleanSpecialOrderDropShipmentInSalesLine(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesHeader: Record "Sales Header"; var FromSalesLine: Record "Sales Line"; CreateToHeader: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchPurchLineOnAfterValidateQuantityMoveNegLines(var ToPurchLine: Record "Purchase Line"; FromPurchLineArchive: Record "Purchase Line Archive")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchPurchLineOnBeforeCleanSpecialOrderDropShipmentInPurchLine(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; var FromPurchHeader: Record "Purchase Header"; var FromPurchLine: Record "Purchase Line"; CreateToHeader: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchCrMemoLinesToDocOnAfterTransferFields(var FromPurchaseLine: Record "Purchase Line"; var FromPurchaseHeader: Record "Purchase Header"; var ToPurchaseHeader: Record "Purchase Header"; var FromPurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; var FromPurchCrMemoLine: Record "Purch. Cr. Memo Line"; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchCrMemoLinesToDocOnAfterFromPurchCrMemoLineLoop(var TempDocPurchaseLine: Record "Purchase Line" temporary; var ToPurchHeader: Record "Purchase Header"; var FromPurchLineBuf: Record "Purchase Line"; var FromPurchCrMemoLine: Record "Purch. Cr. Memo Line"; SplitLine: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before deleting sales lines with negative quantities.
- /// This allows developers to modify or override the behavior of the deletion process.
- ///
- ///
- /// The sales header record associated with the sales lines to be deleted.
- ///
- ///
- /// A boolean flag indicating whether the operation is a test (no actual deletion occurs) or a real deletion.
- ///
- ///
- /// A boolean flag that allows developers to handle the logic themselves and skip the default deletion process if set to true.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeDeleteSalesLinesWithNegQty(FromSalesHeader: Record "Sales Header"; OnlyTest: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchInvLinesToDocOnAfterTransferFields(var FromPurchaseLine: Record "Purchase Line"; var FromPurchaseHeader: Record "Purchase Header"; var ToPurchaseHeader: Record "Purchase Header"; FromPurchInvHeader: Record "Purch. Inv. Header"; var FromPurchInvLine: Record "Purch. Inv. Line"; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchRcptLinesToDocOnAfterTransferFields(var FromPurchaseLine: Record "Purchase Line"; var FromPurchaseHeader: Record "Purchase Header"; var ToPurchaseHeader: Record "Purchase Header"; var PurchRcptHeader: Record "Purch. Rcpt. Header"; var FromPurchRcptLine: Record "Purch. Rcpt. Line"; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchReturnShptLinesToDocOnAfterTransferFields(var FromPurchaseLine: Record "Purchase Line"; var FromPurchaseHeader: Record "Purchase Header"; var ToPurchaseHeader: Record "Purchase Header"; var FromReturnShipmentHeader: Record "Return Shipment Header"; var FromReturnShipmentLine: Record "Return Shipment Line"; RecalculateLines: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after the purchase document lines have been copied during the document copy process.
- /// Subscribing to this event allows developers to implement additional logic or workflows
- /// once the lines have been copied. This can be useful for extending functionality,
- /// performing validations, or integrating with other processes.
- ///
- ///
- /// The type of the source purchase document.
- ///
- ///
- /// The document number of the source purchase document.
- ///
- ///
- /// The source purchase header record from which the lines were copied.
- ///
- ///
- /// A boolean value indicating whether the source header data was included.
- ///
- ///
- /// The target purchase header record to which the lines were copied.
- ///
- ///
- /// A boolean value indicating whether negative lines should be moved during the copy process.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocOnAfterCopyPurchDocLines(FromDocType: Option; FromDocNo: Code[20]; FromPurchaseHeader: Record "Purchase Header"; IncludeHeader: Boolean; var ToPurchHeader: Record "Purchase Header"; MoveNegLines: Boolean; var ReleaseDocument: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocOnBeforeCopyPurchDocRcptLine(var FromPurchRcptHeader: Record "Purch. Rcpt. Header"; var ToPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocOnBeforeCopyPurchDocInvLine(var FromPurchInvHeader: Record "Purch. Inv. Header"; var ToPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocOnBeforeCopyPurchDocReturnShptLine(var FromReturnShipmentHeader: Record "Return Shipment Header"; var ToPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocOnBeforeCopyPurchDocCrMemoLine(var FromPurchCrMemoHdr: Record "Purch. Cr. Memo Hdr."; var ToPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocOnBeforeToPurchHeaderInsert(var ToPurchaseHeader: Record "Purchase Header"; FromPurchaseHeader: Record "Purchase Header"; MovNegLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocOnBeforeUpdatePurchInvoiceDiscountValue(var ToPurchaseHeader: Record "Purchase Header"; FromDocType: Option; FromDocNo: Code[20]; FromDocOccurrenceNo: Integer; FromDocVersionNo: Integer; RecalculateLines: Boolean; FromPurchHeader: Record "Purchase Header"; LinesNotCopied: Integer; NextLineNo: Integer; MissingExCostRevLink: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before updating vendor ledger entries.
- /// Subscribing to this event allows developers to perform validations or data transformations.
- ///
- ///
- /// The target purchase header record being processed.
- ///
- ///
- /// The document type of the source purchase document.
- ///
- ///
- /// The document number of the source purchase document.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocUpdateHeaderOnBeforeUpdateVendLedgerEntry(var ToPurchaseHeader: Record "Purchase Header"; FromDocType: Option; FromDocNo: Code[20])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocWithoutHeader(var ToPurchaseHeader: Record "Purchase Header"; FromDocType: Option; FromDocNo: Code[20]; FromOccurenceNo: Integer; FromVersionNo: Integer; FromPurchInvHeader: Record "Purch. Inv. Header"; FromPurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.")
- begin
- end;
-
- ///
- /// Event triggered before copying lines of the sales document during the copy process.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// before the lines are copied. This can be useful for filtering, altering the data,
- /// or implementing additional validations during the copy process.
- ///
- ///
- /// The source sales header record being copied.
- ///
- ///
- /// The sales header record to which the data is being copied.
- ///
- ///
- /// A boolean variable indicating whether the default line copy behavior should be bypassed.
- /// Setting this variable to true will skip the default behavior.
- ///
- ///
- /// The type of the sales document being copied.
- ///
- [IntegrationEvent(true, false)]
- local procedure OnCopySalesDocOnBeforeCopyLines(FromSalesHeader: Record "Sales Header"; var ToSalesHeader: Record "Sales Header"; var IsHandled: Boolean; FromDocType: Enum "Sales Document Type From")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocOnAfterCopySalesDocLines(FromDocType: Option; FromDocNo: Code[20]; FromDocOccurrenceNo: Integer; FromDocVersionNo: Integer; FromSalesHeader: Record "Sales Header"; IncludeHeader: Boolean; var ToSalesHeader: Record "Sales Header"; var HideDialog: Boolean; var ReleaseDocument: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocOnBeforeCopySalesDocShptLine(var FromSalesShipmentHeader: Record "Sales Shipment Header"; var ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocOnBeforeCopySalesDocInvLine(var FromSalesInvoiceHeader: Record "Sales Invoice Header"; var ToSalesHeader: Record "Sales Header"; var ShouldExit: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocOnBeforeCopySalesDocCrMemoLine(var FromSalesCrMemoHeader: Record "Sales Cr.Memo Header"; var ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocOnBeforeCopySalesDocReturnRcptLine(var FromReturnReceiptHeader: Record "Return Receipt Header"; var ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocOnBeforeToSalesHeaderInsert(var ToSalesHeader: Record "Sales Header"; FromSalesHeader: Record "Sales Header"; MoveNegLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocOnBeforeToSalesLineDeleteAll(ToSalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Event triggered before transferring fields from the source sales shipment header to the target sales header during the copy process.
- /// Subscribing to this event allows developers to modify or extend the behavior
- /// before the fields have been transferred. This can be useful for implementing custom logic,
- /// validations, or filtering data during the copy operation.
- ///
- ///
- /// The sales header record to which the fields are being copied.
- ///
- ///
- /// The source sales shipment header record being copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocOnBeforeTransferPostedShipmentFields(var ToSalesHeader: Record "Sales Header"; SalesShipmentHeader: Record "Sales Shipment Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeTransferFieldsFromCrMemoToInv(var ToSalesHeader: Record "Sales Header"; FromSalesCrMemoHeader: Record "Sales Cr.Memo Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after completing the transfer of fields from the source sales invoice header to the target sales header during the copy process.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after the fields have been transferred. This can be useful for implementing additional logic,
- /// validations, or workflows based on the copied invoice data.
- ///
- ///
- /// The sales header record to which the fields were copied.
- ///
- ///
- /// The source sales invoice header record that was copied.
- ///
- ///
- /// The existing state of the target sales header prior to the field transfer.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocOnAfterTransferPostedInvoiceFields(var ToSalesHeader: Record "Sales Header"; SalesInvoiceHeader: Record "Sales Invoice Header"; OldSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Event triggered after transferring fields from the source sales header archive to the target sales header during the copy process.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after the fields have been transferred. This can be useful for implementing additional logic,
- /// validations, or workflows based on the copied archived sales header data.
- ///
- ///
- /// The sales header record to which the fields were copied.
- ///
- ///
- /// The source sales header archive record being copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocOnAfterTransferArchSalesHeaderFields(var ToSalesHeader: Record "Sales Header"; FromSalesHeaderArchive: Record "Sales Header Archive")
- begin
- end;
-
- ///
- /// Event triggered before transferring fields from the source sales invoice header to the target sales header during the copy process.
- /// Subscribing to this event allows developers to modify or extend the behavior
- /// before the fields have been transferred. This can be useful for applying custom logic,
- /// validations, or altering the data during the transfer operation.
- ///
- ///
- /// The sales header record to which the fields are being copied.
- ///
- ///
- /// The source sales invoice header record being copied.
- ///
- ///
- /// A boolean value indicating whether job-related data should be copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocOnBeforeTransferPostedInvoiceFields(var ToSalesHeader: Record "Sales Header"; SalesInvoiceHeader: Record "Sales Invoice Header"; var CopyJobData: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before transferring fields from the source return receipt header to the target sales header during the copy process.
- /// Subscribing to this event allows developers to modify or extend the behavior
- /// before the fields have been transferred. This can be useful for implementing custom logic,
- /// validations, or altering the data during the transfer operation.
- ///
- ///
- /// The sales header record to which the fields are being copied.
- ///
- ///
- /// The source return receipt header record being copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocOnBeforeTransferPostedReturnReceiptFields(var ToSalesHeader: Record "Sales Header"; ReturnReceiptHeader: Record "Return Receipt Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocOnBeforeUpdateSalesInvoiceDiscountValue(var ToSalesHeader: Record "Sales Header"; FromDocType: Option; FromDocNo: Code[20]; FromDocOccurrenceNo: Integer; FromDocVersionNo: Integer; RecalculateLines: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after applying filters to the sales invoice lines during the sales document copy process.
- /// Subscribing to this event allows developers to modify or extend the filtering logic
- /// before the sales invoice lines have been processed further. This can be useful for ensuring specific conditions
- /// are met or additional filters are applied during the copy operation.
- ///
- ///
- /// The sales header record to which the sales invoice lines are being copied.
- ///
- ///
- /// The source sales invoice header record being copied.
- ///
- ///
- /// The source sales invoice line record with applied filters.
- ///
- ///
- /// A boolean value indicating whether the lines should be recalculated during the copy process.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocInvLineOnAfterSetFilters(var ToSalesHeader: Record "Sales Header"; var FromSalesInvoiceHeader: Record "Sales Invoice Header"; var FromSalesInvoiceLine: Record "Sales Invoice Line"; var RecalculateLines: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after applying filters to the sales credit memo lines during the sales document copy process.
- /// Subscribing to this event allows developers to modify or extend the filtering logic
- /// before the sales credit memo lines have been processed further. This can be useful for ensuring specific conditions
- /// are met or additional filters are applied during the copy operation.
- ///
- ///
- /// The sales header record to which the sales credit memo lines are being copied.
- ///
- ///
- /// The source sales credit memo header record being copied.
- ///
- ///
- /// The source sales credit memo line record with applied filters.
- ///
- ///
- /// A boolean value indicating whether the lines should be recalculated during the copy process.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocCrMemoLineOnAfterSetFilters(var ToSalesHeader: Record "Sales Header"; var FromSalesCrMemoHeader: Record "Sales Cr.Memo Header"; var FromSalesCrMemoLine: Record "Sales Cr.Memo Line"; var RecalculateLines: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after applying filters to the sales shipment lines during the sales document copy process.
- /// Subscribing to this event allows developers to modify or extend the filtering logic
- /// before the sales shipment lines have been processed further. This can be useful for ensuring specific conditions
- /// are met or additional filters are applied during the copy operation.
- ///
- ///
- /// The sales header record to which the sales shipment lines are being copied.
- ///
- ///
- /// The source sales shipment header record being copied.
- ///
- ///
- /// The source sales shipment line record with applied filters.
- ///
- ///
- /// A boolean value indicating whether the lines should be recalculated during the copy process.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocShptLineOnAfterSetFilters(var ToSalesHeader: Record "Sales Header"; var FromSalesShipmentHeader: Record "Sales Shipment Header"; var FromSalesShipmentLine: Record "Sales Shipment Line"; var RecalculateLines: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after setting filters on the source purchase receipt lines during the purchase document copy process.
- /// Subscribing to this event allows developers to extend or modify the filtering logic
- /// applied to the source receipt lines. This can be useful for custom filtering or additional checks.
- ///
- ///
- /// The target purchase header record to which the lines are being copied.
- ///
- ///
- /// The source purchase receipt header record being processed.
- ///
- ///
- /// The source purchase receipt line record being filtered.
- ///
- ///
- /// A boolean value indicating whether the lines should be recalculated during the copy process.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocRcptLineOnAfterSetFilters(var ToPurchHeader: Record "Purchase Header"; var FromPurchRcptHeader: Record "Purch. Rcpt. Header"; var FromPurchRcptLine: Record "Purch. Rcpt. Line"; var RecalculateLines: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after setting filters on the source purchase invoice lines during the purchase document copy process.
- /// Subscribing to this event allows developers to extend or modify the filtering logic
- /// applied to the source invoice lines. This can be useful for custom filtering or additional checks.
- ///
- ///
- /// The target purchase header record to which the lines are being copied.
- ///
- ///
- /// The source purchase invoice line record being filtered.
- ///
- ///
- /// An integer representing the number of lines not copied during the process.
- ///
- ///
- /// A boolean value indicating whether any external cost or revenue links are missing.
- ///
- ///
- /// A boolean value indicating whether the lines should be recalculated during the copy process.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocInvLineOnAfterSetFilters(var ToPurchHeader: Record "Purchase Header"; var FromPurchInvLine: Record "Purch. Inv. Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean; RecalculateLines: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after setting filters on the source purchase credit memo lines during the purchase document copy process.
- /// Subscribing to this event allows developers to extend or modify the filtering logic
- /// applied to the source credit memo lines. This can be useful for custom filtering or additional checks.
- ///
- ///
- /// The target purchase header record to which the lines are being copied.
- ///
- ///
- /// The source purchase credit memo line record being filtered.
- ///
- ///
- /// An integer representing the number of lines not copied during the process.
- ///
- ///
- /// A boolean value indicating whether any external cost or revenue links are missing.
- ///
- ///
- /// A boolean value indicating whether the lines should be recalculated during the copy process.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocCrMemoLineOnAfterSetFilters(var ToPurchHeader: Record "Purchase Header"; var FromPurchCrMemoLine: Record "Purch. Cr. Memo Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean; RecalculateLines: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after setting filters on the source purchase return shipment lines during the purchase document copy process.
- /// Subscribing to this event allows developers to extend or modify the filtering logic
- /// applied to the source return shipment lines. This can be useful for custom filtering or additional checks.
- ///
- ///
- /// The target purchase header record to which the lines are being copied.
- ///
- ///
- /// The source purchase return shipment line record being filtered.
- ///
- ///
- /// An integer representing the number of lines not copied during the process.
- ///
- ///
- /// A boolean value indicating whether any external cost or revenue links are missing.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocReturnShptLineOnAfterSetFilters(var ToPurchHeader: Record "Purchase Header"; var FromReturnShptLine: Record "Return Shipment Line"; var LinesNotCopied: Integer; var MissingExCostRevLink: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after setting filters on the source purchase line archive during the purchase document copy process.
- /// Subscribing to this event allows developers to extend or modify the filtering logic
- /// applied to the source archived purchase lines. This can be useful for custom filtering or additional checks.
- ///
- ///
- /// The target purchase header record to which the lines are being copied.
- ///
- ///
- /// The target purchase line record that will be created.
- ///
- ///
- /// The source purchase header archive record being processed.
- ///
- ///
- /// The source purchase line archive record being filtered.
- ///
- ///
- /// The next available line number in the target purchase document.
- ///
- ///
- /// An integer representing the number of lines not copied during the process.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocPurchLineArchiveOnAfterSetFilters(var ToPurchHeader: Record "Purchase Header"; ToPurchLine: Record "Purchase Line"; FromPurchHeaderArchive: Record "Purchase Header Archive"; var FromPurchLineArchive: Record "Purchase Line Archive"; var NextLineNo: Integer; var LinesNotCopied: Integer)
- begin
- end;
-
- ///
- /// Event triggered after applying filters to the return receipt lines during the sales document copy process.
- /// Subscribing to this event allows developers to modify or extend the filtering logic
- /// before the return receipt lines have been processed further. This can be useful for ensuring specific conditions
- /// are met or additional filters are applied during the copy operation.
- ///
- ///
- /// The sales header record to which the return receipt lines are being copied.
- ///
- ///
- /// The source return receipt header record being copied.
- ///
- ///
- /// The source return receipt line record with applied filters.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocReturnRcptLineOnAfterSetFilters(var ToSalesHeader: Record "Sales Header"; var FromReturnReceiptHeader: Record "Return Receipt Header"; var FromReturnReceiptLine: Record "Return Receipt Line")
- begin
- end;
-
- ///
- /// Event triggered after applying filters to the source sales lines during the sales document copy process.
- /// Subscribing to this event allows developers to modify or extend the filtering logic
- /// before the sales lines have been processed further. This can be useful for ensuring specific conditions
- /// are met or additional filters are applied during the copy operation.
- ///
- ///
- /// The source sales header record being copied.
- ///
- ///
- /// The source sales line record with applied filters.
- ///
- ///
- /// The sales header record to which the sales lines are being copied.
- ///
- ///
- /// A boolean value indicating whether the lines should be recalculated during the copy process.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocSalesLineOnAfterSetFilters(FromSalesHeader: Record "Sales Header"; var FromSalesLine: Record "Sales Line"; var ToSalesHeader: Record "Sales Header"; var RecalculateLines: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after determining whether a specific sales line iteration should run during the copy process.
- /// Subscribing to this event allows developers to extend or customize the iteration logic
- /// based on the current state of the sales line and headers. This can be useful for implementing
- /// additional conditions or skipping specific sales lines.
- ///
- ///
- /// The source sales header record being copied.
- ///
- ///
- /// The sales header record to which the sales lines are being copied.
- ///
- ///
- /// The current sales line record being processed.
- ///
- ///
- /// A boolean variable indicating whether the iteration should proceed for the current sales line.
- /// This can be modified by the subscriber.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocSalesLineOnAfterCalcShouldRunIteration(FromSalesHeader: Record "Sales Header"; var ToSalesHeader: Record "Sales Header"; FromSalesLine: Record "Sales Line"; var ShouldRunIteration: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after setting filters on the source purchase lines during the purchase document copy process.
- /// Subscribing to this event allows developers to extend or modify the filtering logic
- /// applied to the source purchase lines. This can be useful for custom filtering or additional checks.
- ///
- ///
- /// The source purchase header record being processed.
- ///
- ///
- /// The source purchase line record being filtered.
- ///
- ///
- /// The target purchase header record to which the lines are being copied.
- ///
- ///
- /// A boolean value indicating whether the lines should be recalculated during the copy process.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocPurchLineOnAfterSetFilters(FromPurchHeader: Record "Purchase Header"; var FromPurchLine: Record "Purchase Line"; var ToPurchHeader: Record "Purchase Header"; var RecalculateLines: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after a purchase line has been successfully copied from the source to the target during the document copy process.
- /// Subscribing to this event allows developers to implement additional logic,
- /// validations, or workflows after each line has been copied. This can be useful for custom handling or integrations.
- ///
- ///
- /// The target purchase header record to which the line was copied.
- ///
- ///
- /// The target purchase line record that was created.
- ///
- ///
- /// The source purchase header record from which the line was copied.
- ///
- ///
- /// The source purchase line record that was copied.
- ///
- ///
- /// A boolean value indicating whether the source header data was included.
- ///
- ///
- /// A boolean value indicating whether the lines were recalculated during the copy process.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocPurchLineOnAfterCopyPurchLine(ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; FromPurchHeader: Record "Purchase Header"; var FromPurchLine: Record "Purchase Line"; IncludeHeader: Boolean; RecalculateLines: Boolean);
- begin
- end;
-
- ///
- /// Event triggered after applying filters to the archived sales lines during the sales document copy process.
- /// Subscribing to this event allows developers to modify or extend the filtering logic
- /// before the archived sales lines have been processed further. This can be useful for ensuring specific conditions
- /// are met or additional filters are applied during the copy operation.
- ///
- ///
- /// The source sales header archive record being copied.
- ///
- ///
- /// The source sales line archive record with applied filters.
- ///
- ///
- /// The sales header record to which the archived sales lines are being copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocSalesLineArchiveOnAfterSetFilters(FromSalesHeaderArchive: Record "Sales Header Archive"; var FromSalesLineArchive: Record "Sales Line Archive"; var ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocUpdateHeaderOnBeforeUpdateCustLedgerEntry(var ToSalesHeader: Record "Sales Header"; FromDocType: Option; FromDocNo: Code[20]; OldSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Event triggered before validating the location code in the target sales header during the update process.
- /// Subscribing to this event allows developers to override or extend the default behavior
- /// when validating location codes. This can be useful for skipping validation or applying custom logic.
- ///
- ///
- /// The sales header record being updated.
- ///
- ///
- /// A boolean variable indicating whether the default validation behavior should be bypassed.
- /// Setting this variable to true will skip the default behavior.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocUpdateHeaderOnBeforeValidateLocationCode(var ToSalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after the sales document header status is set to "Open" during the update process.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after the status has been updated. This can be useful for implementing additional logic
- /// or validations based on the updated status.
- ///
- ///
- /// The sales header record being updated.
- ///
- ///
- /// The existing state of the target sales header prior to the update.
- ///
- ///
- /// A boolean value indicating whether dimensions and location codes should be validated.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocUpdateHeaderOnAfterSetStatusOpen(var ToSalesHeader: Record "Sales Header"; OldSalesHeader: Record "Sales Header"; var ShouldValidateDimensionsAndLocation: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocWithoutHeader(var ToSalesHeader: Record "Sales Header"; FromDocType: Option; FromDocNo: Code[20]; FromOccurenceNo: Integer; FromVersionNo: Integer; FromSalesInvoiceHeader: Record "Sales Invoice Header"; FromSalesCrMemoHeader: Record "Sales Cr.Memo Header")
- begin
- end;
-
- ///
- /// Event triggered after the sales document header has been updated during the copy process.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after the document header has been updated. This can be useful for implementing additional logic
- /// or handling specific workflows after the header update.
- ///
- ///
- /// The sales header record to which the data was copied.
- ///
- ///
- /// The source sales invoice header record being copied.
- ///
- ///
- /// The type of the sales document being copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocOnAfterCopySalesDocUpdateHeader(var ToSalesHeader: Record "Sales Header"; var FromSalesInvHeader: Record "Sales Invoice Header"; FromDocType: Enum "Sales Document Type From")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesLineOnAfterTransferFieldsToSalesLine(var ToSalesLine: Record "Sales Line"; FromSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesReturnRcptLinesToDocOnAfterFromSalesHeaderTransferFields(FromReturnRcptHeader: Record "Return Receipt Header"; var FromSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesReturnRcptLinesToDocOnBeforeFromSalesHeaderTransferFields(FromReturnRcptHeader: Record "Return Receipt Header"; var FromSalesHeader: Record "Sales Header"; ToSalesHeader: Record "Sales Header"; var FromReturnRcptLine: Record "Return Receipt Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesReturnRcptLinesToDocOnBeforeCopySalesDocLine(ToSalesHeader: Record "Sales Header"; var FromSalesLineBuf: Record "Sales Line"; var CoptItemTrkg: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesReturnRcptLinesToDocOnAfterCalcNextLineNo(var ToSalesHeader: Record "Sales Header"; FromReturnRcptLine: Record "Return Receipt Line"; FromSalesHeader: Record "Sales Header"; var NextLineNo: Integer; var InsertDocNoLine: Boolean; FromLineCounter: Integer; var FromSalesLineBuf: Record "Sales Line" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesReturnRcptLinesToDocOnAfterCopySalesDocLine(FromReturnRcptLine: Record "Return Receipt Line"; ToSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchRcptLinesToDocOnBeforeCopyPurchLine(ToPurchaseHeader: Record "Purchase Header"; var FromPurchaseLine: Record "Purchase Line"; var CopyItemTrkg: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchInvLinesToDocOnBeforeCopyPurchLine(ToPurchaseHeader: Record "Purchase Header"; var FromPurchaseLine: Record "Purchase Line"; FromPurchaseLineBuf: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchCrMemoLinesToDocOnBeforeCopyPurchLine(ToPurchaseHeader: Record "Purchase Header"; var FromPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchReturnShptLinesToDocOnBeforeCopyPurchLine(ToPurchaseHeader: Record "Purchase Header"; var FromPurchaseLine: Record "Purchase Line"; var CopyItemTrkg: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchReturnShptLinesToDocOnAfterCalcNextLineNo(var ToPurchaseHeader: Record "Purchase Header"; FromReturnShptLine: Record "Return Shipment Line"; FromPurchHeader: Record "Purchase Header"; var NextLineNo: Integer; var InsertDocNoLine: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesShptLinesToDocOnAfterFromSalesHeaderTransferFields(FromSalesShptHeader: Record "Sales Shipment Header"; var FromSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesShptLinesToDocOnBeforeFromSalesHeaderTransferFields(FromSalesShipmentHeader: Record "Sales Shipment Header"; var FromSalesHeader: Record "Sales Header"; ToSalesHeader: Record "Sales Header"; var FromSalesShptLine: Record "Sales Shipment Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesShptLinesToDocOnBeforeCopySalesLine(var ToSalesHeader: Record "Sales Header"; var FromSalesLine: Record "Sales Line"; FromSalesShptLine: Record "Sales Shipment Line"; var CopyItemTrkg: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesShptLinesToDocOnAfterCalcNextLineNo(var ToSalesHeader: Record "Sales Header"; FromSalesShptLine: Record "Sales Shipment Line"; FromSalesHeader: Record "Sales Header"; var NextLineNo: Integer; var InsertDocNoLine: Boolean; FromLineCounter: Integer; FromSalesLineBuf: Record "Sales Line" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesShptLinesToDocOnBeforeSplitPstdSalesLinesPerILE(var ItemLedgEntry: record "Item Ledger Entry"; FromSalesShptLine: record "Sales Shipment Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesShptLinesToDocOnAfterCopySalesShptLineToSalesLine(FromSalesShptLine: Record "Sales Shipment Line"; ToSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnAfterCalcShouldInsertOldSalesDocNoLine(var TempSalesLineBuf: Record "Sales Line" temporary; var ToSalesHeader: Record "Sales Header"; var ShouldInsertOldSalesDocNoLine: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnEndOfCopyLineIteration(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesInvLine: Record "Sales Invoice Line"; var TempSalesLineBuf: Record "Sales Line" temporary; var LinesNotCopied: Integer; NextLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnBeforeCopySalesLine(var ToSalesHeader: Record "Sales Header"; var FromSalesLine: Record "Sales Line"; var TempSalesLineBuf: Record "Sales Line" temporary; var ToSalesLine: Record "Sales Line"; FromSalesInvLine: Record "Sales Invoice Line"; IncludeHeader: Boolean; RecalculateLines: Boolean; var TempDocSalesLine: Record "Sales Line" temporary; var FromSalesLine1: Record "Sales Line"; ExactCostRevMandatory: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnBeforeFromSalesHeaderTransferFields(var FromSalesHeader: Record "Sales Header"; FromSalesInvoiceHeader: Record "Sales Invoice Header"; ToSalesHeader: Record "Sales Header"; var FromSalesInvoiceLine: Record "Sales Invoice Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnAfterCheckFirstLineShipped(ToSalesHeader: Record "Sales Header"; OldDocType: Integer; ShptDocNo: Code[20]; var OldShptDocNo: Code[20])
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnAfterGetFromSalesInvHeader(var ToSalesHeader: Record "Sales Header"; FromSalesInvHeader: Record "Sales Invoice Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnAfterInsertOldSalesDocNoLine(ToSalesHeader: Record "Sales Header"; var SkipCopyFromDescription: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnBeforeInsertOldSalesDocNoLine(ToSalesHeader: Record "Sales Header"; var SkipCopyFromDescription: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnAfterFromSalesHeaderTransferFields(var FromSalesHeader: Record "Sales Header"; FromSalesInvHeader: Record "Sales Invoice Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesCrMemoLinesToDocOnAfterFromSalesHeaderTransferFields(FromSalesCrMemoHeader: Record "Sales Cr.Memo Header"; var FromSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesCrMemoLinesToDocOnBeforeFromSalesHeaderTransferFields(FromSalesCrMemoHeader: Record "Sales Cr.Memo Header"; var FromSalesHeader: Record "Sales Header"; ToSalesHeader: Record "Sales Header"; var FromSalesCrMemoLine: Record "Sales Cr.Memo Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesCrMemoLinesToDocOnBeforeCopySalesLine(ToSalesHeader: Record "Sales Header"; var FromSalesLine: Record "Sales Line"; FromSalesLineBuf: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesCrMemoLinesToDocOnAfterCalcShouldCopyItemTracking(ToSalesHeader: Record "Sales Header"; var ShouldCopyItemTracking: Boolean; var ToSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesLineOnBeforeCheckVATBusGroup(SalesLine: Record "Sales Line"; var CheckVATBusGroup: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesLinesToBufferTransferFields(SalesHeader: Record "Sales Header"; SalesLine: Record "Sales Line"; var TempSalesLineBuf: Record "Sales Line" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesLineOnAfterSetDimensions(var ToSalesLine: Record "Sales Line"; FromSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchLineOnAfterSetDimensions(var ToPurchaseLine: Record "Purchase Line"; FromPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- ///
- /// Event triggered when the provided purchase document type does not match any predefined cases during conversion.
- /// Subscribing to this event allows developers to handle custom or unsupported purchase document types
- /// during the conversion process. This can be useful for extending functionality to accommodate specific business needs.
- ///
- ///
- /// The original purchase document type being converted.
- ///
- ///
- /// The resulting purchase document type after the conversion, which can be modified by the subscriber.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnGetPurchaseDocumentTypeCaseElse(FromDocType: Enum "Purchase Document Type From"; var ToDocType: Enum "Purchase Document Type")
- begin
- end;
-
- ///
- /// Event triggered when the provided sales document type does not match any predefined cases during conversion.
- /// Subscribing to this event allows developers to handle custom or unsupported sales document types
- /// during the conversion process. This can be useful for extending functionality to accommodate specific business needs.
- ///
- ///
- /// The original sales document type being converted.
- ///
- ///
- /// The resulting sales document type after the conversion, which can be modified by the subscriber.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnGetSalesDocumentTypeCaseElse(FromDocType: Enum "Sales Document Type From"; var ToDocType: Enum "Sales Document Type")
- begin
- end;
-
- ///
- /// Event triggered after setting filters for sales lines with negative quantities.
- /// This allows developers to adjust filters or perform additional logic after the filters have been applied.
- ///
- ///
- /// The sales line record with the applied filters for negative quantities.
- ///
- ///
- /// A boolean flag indicating whether the operation is a test (no actual deletion occurs) or a real deletion.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnDeleteSalesLinesWithNegQtyOnAfterSetFilters(var FromSalesLine: Record "Sales Line"; OnlyTest: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnIsSplitItemLedgEntryOnAfterItemLedgEntrySetFilters(var ItemLedgEntry: Record "Item Ledger Entry"; OrgItemLedgEntry: Record "Item Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSplitPstdSalesLinesPerILETransferFields(var FromSalesHeader: Record "Sales Header"; var FromSalesLine: Record "Sales Line"; var TempSalesLineBuf: Record "Sales Line" temporary; var ToSalesHeader: Record "Sales Header"; ItemLedgEntry: Record "Item Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSplitPstdSalesLinesPerILEOnBeforeItemLedgEntryLoop(var ItemLedgEntry: record "Item Ledger Entry"; FromSalesLine: record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSplitPstdSalesLinesPerILEOnAfterAssignShipmentLineNo(var ItemLedgerEntry: Record "Item Ledger Entry"; var TempSalesLine: Record "Sales Line" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSplitPstdPurchLinesPerILEOnBeforeCheckUnappliedLines(PurchaseHeader: Record "Purchase Header"; SkippedLine: Boolean; MissingExCostRevLink: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSplitPstdSalesLinesPerILEOnBeforeCheckUnappliedLines(SalesHeader: Record "Sales Header"; SkippedLine: Boolean; MissingExCostRevLink: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before validating the quantity field during the field transfer process from a sales line to a purchase line.
- /// This allows developers to modify or intervene in the validation process for the quantity field.
- ///
- ///
- /// The sales line record from which the quantity is being transferred.
- ///
- ///
- /// The purchase line record to which the quantity is being transferred.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnTransfldsFromSalesToPurchLineOnBeforeValidateQuantity(FromSalesLine: Record "Sales Line"; var ToPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- ///
- /// Event triggered after recalculating the sales line. This allows additional modifications or checks after the recalculation process.
- ///
- /// The target sales line record being updated.
- /// The source sales line record being copied from.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesLineOnAfterRecalculateSalesLine(var ToSalesLine: Record "Sales Line"; FromSalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Event triggered before recalculating the sales line. This allows custom logic to intervene or modify the recalculation process.
- ///
- /// The target sales line record being updated.
- /// The source sales line record being copied from.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesLineOnBeforeRecalculateSalesLine(var ToSalesLine: Record "Sales Line"; FromSalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Event triggered before clearing drop shipment and special order flags on the sales line. This allows custom handling of these flags during the update process.
- ///
- /// The target sales line record being updated.
- /// The source sales line record being copied from.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesLineOnBeforeClearDropShipmentAndSpecialOrder(var ToSalesLine: Record "Sales Line"; FromSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyFromSalesLineItemChargeAssignOnAfterValueEntryLoop(FromSalesHeader: Record "Sales Header"; ToSalesLine: Record "Sales Line"; ValueEntry: Record "Value Entry"; var TempToItemChargeAssignmentSales: Record "Item Charge Assignment (Sales)" temporary; var ToItemChargeAssignmentSales: Record "Item Charge Assignment (Sales)"; var ItemChargeAssgntNextLineNo: Integer; var SumQtyToAssign: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyFromPurchLineItemChargeAssignOnAfterValueEntryLoop(FromPurchHeader: Record "Purchase Header"; ToPurchLine: Record "Purchase Line"; ValueEntry: Record "Value Entry"; var TempToItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)" temporary; var ToItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; var ItemChargeAssgntNextLineNo: Integer; var SumQtyToAssign: Decimal)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnLinkJobPlanningLineOnAfterJobPlanningLineModify(var JobPlanningLineInvoice: Record "Job Planning Line Invoice"; var JobPlanningLine: Record "Job Planning Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSplitPstdPurchLinesPerILEOnBeforeCheckJobNo(FromPurchLine: Record "Purchase Line"; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchCrMemoLinesToDocOnAfterFilterEntryType(var FromPurchLineBuf: Record "Purchase Line" temporary; var ItemLedgEntryBuf: Record "Item Ledger Entry" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchLineOnAfterValidateQuantityMoveNegLines(var ToPurchLine: Record "Purchase Line"; FromPurchLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchLineOnBeforeValidateQuantity(var ToPurchLine: Record "Purchase Line"; RecalculateLines: Boolean; FromPurchaseLine: Record "Purchase Line"; MoveNegLines: Boolean; var ShouldRevertQuantitySign: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecalculatePurchLineOnAfterValidateQuantity(var ToPurchLine: Record "Purchase Line"; var FromPurchLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnProcessToAsmHeaderOnAfterValidateQty(var ToAsmHeader: Record "Assembly Header"; TempFromAsmHeader: Record "Assembly Header" temporary; ToSalesLine: Record "Sales Line"; BasicAsmOrderCopy: Boolean; AvailabilityCheck: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after validating the "Quantity" field on the sales line. This allows additional modifications or checks after the validation process.
- ///
- /// The target sales line record being updated.
- /// The source sales line record being copied from.
- [IntegrationEvent(false, false)]
- local procedure OnRecalculateSalesLineOnAfterValidateQuantity(var ToSalesLine: Record "Sales Line"; var FromSalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Event triggered after validating the "Line Discount Amount" field on the sales line. This allows additional adjustments or logic after the validation process.
- ///
- /// The target sales line record being updated.
- /// The source sales line record being copied from.
- [IntegrationEvent(false, false)]
- local procedure OnRecalculateSalesLineOnAfterValidateLineDiscountAmount(var ToSalesLine: Record "Sales Line"; var FromSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSplitPstdPurchLinesPerILEOnBeforeFromPurchLineBufInsert(var FromPurchHeader: Record "Purchase Header"; var FromPurchLine: Record "Purchase Line"; var FromPurchLineBuf: Record "Purchase Line"; var ToPurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSplitSalesDocLinesPerItemTrkgOnAfterCalcSignFactor(FromSalesLine: Record "Sales Line"; var SignFactor: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSplitSalesDocLinesPerItemTrkgOnAfterInitSalesLineBuf1(var SalesLineBuf1: Record "Sales Line" temporary; var ItemLedgerEntry: Record "Item Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSetTrackingOnAssemblyReservationOnBeforeTempTrackingSpecificationInsert(var TempTrackingSpecification: Record "Tracking Specification" temporary; TempItemLedgerEntry: Record "Item Ledger Entry" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCreateToAsmLinesOnBeforeToAssemblyLineModify(ToAsmHeader: Record "Assembly Header"; var ToAssemblyLine: Record "Assembly Line"; var FromAsmLine: Record "Assembly Line"; ToSalesLine: Record "Sales Line"; BasicAsmOrderCopy: Boolean; AvailabilityCheck: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCreateToAsmLinesOnAfterValidateQty(ToAsmHeader: Record "Assembly Header"; FromAsmLine: Record "Assembly Line"; var ToAssemblyLine: Record "Assembly Line"; ToSalesLine: Record "Sales Line"; BasicAsmOrderCopy: Boolean; AvailabilityCheck: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesLineExtText(ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; FromSalesHeader: Record "Sales Header"; FromSalesLine: Record "Sales Line"; DocLineNo: Integer; var NextLineNo: Integer; var TransferOldExtLines: Codeunit "Transfer Old Ext. Text Lines"; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocLineOnAfterAssignCopiedFromPostedDoc(var ToSalesLine: Record "Sales Line"; ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocLineOnAfterValidateQuantityMoveNegLines(var ToSalesLine: Record "Sales Line"; FromSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocLineOnAfterMoveNegLines(var ToSalesLine: Record "Sales Line"; FromSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnBeforeCopyItemTracking(var TempSalesLineBuf: Record "Sales Line" temporary; ToSalesHeader: Record "Sales Header"; var FromSalesInvLine: Record "Sales Invoice Line"; var ItemLedgEntryBuf: Record "Item Ledger Entry" temporary; var TempItemTrkgEntry: Record "Reservation Entry" temporary; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocLineOnBeforeCheckLocationOnWMS(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesLine: Record "Sales Line"; var IsHandled: Boolean; IncludeHeader: Boolean; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocLineOnBeforeAutoReserve(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after calculating whether to copy the current sales line.
- /// This allows developers to modify the decision to copy the line.
- ///
- /// The target sales header to which the sales line will be copied.
- /// The source sales header from which the sales line will be copied.
- /// The source sales line to be copied.
- /// A boolean variable indicating whether a rounding line was inserted during the process.
- /// A boolean flag indicating whether the current line should be copied. Can be modified.
- /// A boolean variable indicating whether lines should be recalculated during the copy operation.
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocLineOnAfterCalcCopyThisLine(var ToSalesHeader: Record "Sales Header"; var FromSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; RoundingLineInserted: Boolean; var CopyThisLine: Boolean; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnReCalcSalesLineOnBeforeCalcVAT(FromSalesHeader: Record "Sales Header"; ToSalesHeader: Record "Sales Header"; var SalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnReCalcPurchLineOnBeforeCalcVAT(FromPurchaseHeader: Record "Purchase Header"; ToPurchaseHeader: Record "Purchase Header"; var PurchaseLine: Record "Purchase Line")
- begin
- end;
-
- ///
- /// Event triggered before validating the "Ship-to Code" field when copying a return order to a sales header.
- /// This allows developers to intervene or add custom logic before the "Ship-to Code" has been validated.
- ///
- /// The sales header being updated.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesHeaderWhenCopyFromSalesHeaderOnBeforeValidateShipToCode(var SalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCheckSalesRounding(var FromSalesLine: Record "Sales Line"; var RoundingLineInserted: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnAfterCopySalesDocLine(ToSalesLine: Record "Sales Line"; FromSalesInvLine: Record "Sales Invoice Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchInvLinesToDocOnBeforeCopyItemCharges(FromPurchInvLine: Record "Purch. Inv. Line"; NextLineNo: Integer; var ToPurchaseLine: Record "Purchase Line"; TempPurchaseLineBuf: Record "Purchase Line" temporary; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocSalesLineOnBeforeCopyFromSalesDocAssgntToLine(FromSalesLine: Record "Sales Line"; ToSalesLine: Record "Sales Line"; RecalculateLines: Boolean; NextLineNo: Integer; var LinesNotCopied: Integer)
- begin
- end;
-
- ///
- /// Event triggered after completing the sales line copy process for the sales document.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after all sales lines have been copied. This can be useful for implementing post-processing logic,
- /// validations, or handling specific workflows related to the copied sales lines.
- ///
- ///
- /// The target sales line record to which the sales lines were copied.
- ///
- ///
- /// An object codeunit "Transfer Old Ext. Text Lines" handling the transfer of old extended lines, if applicable.
- ///
- ///
- /// The source sales header record being copied.
- ///
- ///
- /// The sales header record to which the sales lines were copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesDocSalesLine(var ToSalesLine: Record "Sales Line"; var TransferOldExtLines: Codeunit "Transfer Old Ext. Text Lines"; FromSalesHeader: Record "Sales Header"; var ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Event triggered after setting properties for a process or operation in the general journal.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after the properties have been initialized. This can be useful for implementing additional logic,
- /// validations, or handling specific business rules related to the configured properties.
- ///
- ///
- /// A boolean value indicating whether the header should be included.
- ///
- ///
- /// A boolean value indicating whether the lines should be recalculated.
- ///
- ///
- /// A boolean value indicating whether negative lines should be moved.
- ///
- ///
- /// A boolean value indicating whether to create to the header.
- ///
- ///
- /// A boolean value indicating whether dialogs should be hidden.
- ///
- ///
- /// A boolean value indicating whether exact cost reversal is mandatory.
- ///
- ///
- /// A boolean value indicating whether to apply fully.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterSetProperties(var IncludeHeader: Boolean; var RecalculateLines: Boolean; var MoveNegLines: Boolean; var CreateToHeader: Boolean; var HideDialog: Boolean; var ExactCostRevMandatory: Boolean; var ApplyFully: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocLineOnBeforeCopyThisLine(ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; FromSalesLine: Record "Sales Line"; FromSalesDocType: Enum "Sales Document Type From"; var RecalculateLines: Boolean; var CopyThisLine: Boolean; var LinesNotCopied: Integer; var Result: Boolean; var IsHandled: Boolean; var NextLineNo: Integer; DocLineNo: Integer; MoveNegLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure CheckCopyFromSalesInvoiceAvailOnBeforeCheckItemAvailability(var ToSalesLine: Record "Sales Line"; var FromSalesInvLine: Record "Sales Invoice Line"; var ToSalesHeader: Record "Sales Header"; var FromSalesInvHeader: Record "Sales Invoice Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocLineOnBeforeCopyThisLine(var ToPurchLine: Record "Purchase Line"; var FromPurchLine: Record "Purchase Line"; MoveNegLines: Boolean; FromPurchDocType: Enum "Purchase Document Type From"; var LinesNotCopied: Integer; var CopyThisLine: Boolean; var Result: Boolean; var IsHandled: Boolean; ToPurchaseHeader: Record "Purchase Header"; var RecalculateLines: Boolean; var NextLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocLineOnBeforeCheckLocationOnWMS(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; var FromPurchLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnAfterCopySalesPostedDeferrals(var FromSalesInvLine: Record "Sales Invoice Line"; NextLineNo: Integer; var ToSalesLine: Record "Sales Line"; var TempSalesLineBuf: Record "Sales Line" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterIsCopyItemTrkg(var ItemLedgEntry: Record "Item Ledger Entry"; FillExactCostRevLink: Boolean; var CopyItemTrkg: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterUpdateCustLedgerEntry(var ToSalesHeader: Record "Sales Header"; FromDocType: Enum "Gen. Journal Document Type"; FromDocNo: Code[20]; var CustLedgEntry: Record "Cust. Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocLineOnBeforeValidateInvDiscountAmount(var ToSalesLine: Record "Sales Line"; InvDiscountAmount: Decimal; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocLineOnBeforeValidateLineDiscountPct(var ToSalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckSalesRounding(FromSalesLine: Record "Sales Line"; var RoundingLineInserted: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyPurchPostedDeferrals(ToPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyFieldsFromOldPurchHeader(var ToPurchHeader: Record "Purchase Header"; var OldPurchHeader: Record "Purchase Header"; IncludeHeader: Boolean; MoveNegLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyFieldsFromOldSalesHeader(var ToSalesHeader: Record "Sales Header"; var OldSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchPurchLineOnAfterSetNextLineNo(var ToPurchLine: Record "Purchase Line"; var FromPurchLineArchive: Record "Purchase Line Archive"; var NextLineNo: Integer)
- begin
- end;
-
- ///
- /// Event triggered after setting the next line number for the target purchase line. This allows further adjustments to the line or its data.
- ///
- /// The purchase line of the target document.
- /// The purchase line from the source document being processed.
- /// The next line number for the target document.
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocLineOnAfterSetNextLineNo(var ToPurchLine: Record "Purchase Line"; var FromPurchLine: Record "Purchase Line"; var NextLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchPurchLineOnBeforeCopyArchPurchLineExtText(ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; FromPurchHeaderArchive: Record "Purchase Header Archive"; FromPurchLineArchive: Record "Purchase Line Archive"; var NextLineNo: Integer; RecalculateLines: Boolean; var IsHandled: Boolean; var TransferOldExtLines: Codeunit "Transfer Old Ext. Text Lines")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPurchLinesToBuffer(var TempPurchaseLine: Record "Purchase Line"; FromPurchaseLine2: Record "Purchase Line"; FromPurchaseLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyShiptoCodeFromInvToCrMemo(var ToSalesHeader: Record "Sales Header"; FromSalesInvHeader: Record "Sales Invoice Header"; FromDocType: Enum "Sales Document Type From")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesCrMemoLinesToDocOnAfterFillSalesLineBuffer(var ToSalesHeader: Record "Sales Header"; var FromSalesLineBuf: Record "Sales Line" temporary)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnAfterFillSalesLinesBuffer(ToSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchCrMemoLinesToDocOnAfterFillPurchLineBuffer(ToPurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchInvLinesToDocOnAfterFillPurchLineBuffer(ToPurchHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnBeforeTestPricesInclVAT(ToSalesHeader: Record "Sales Header"; IncludeHeader: Boolean; var RecalculateLines: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesShptLinesToDocOnBeforeTestPricesInclVAT(ToSalesHeader: Record "Sales Header"; IncludeHeader: Boolean; var RecalculateLines: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before validating the "Location Code" field on the sales line. This allows custom handling or skipping the validation process.
- ///
- /// The target sales line record being updated.
- /// A boolean variable to skip the default validation logic if set to true.
- [IntegrationEvent(false, false)]
- local procedure OnRecalculateSalesLineOnBeforeValidateLocationCode(var ToSalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecalculatePurchLineOnBeforeValidateLocationCode(var ToPurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesCreditMemoHeaderOnBeforeSetShipmentDate(SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchRcptLinesToDocOnAfterFilterPstdDocLnItemLedgEntries(FromPurchLine: Record "Purchase Line"; var ItemLedgEntry: Record "Item Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchInvLinesToDocOnAfterCalcShouldCopyItemTrackingEntries(ToPurchLine: Record "Purchase Line"; var ShouldCopyItemTrackingEntries: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchCrMemoLinesToDocOnAfterCalcShouldCopyItemTrackingEntries(ToPurchLine: Record "Purchase Line"; var ShouldCopyItemTrackingEntries: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyAsmOrderToAsmOrderOnBeforeModifySalesLine(var ToSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnSetDefaultValuesToSalesLineOnBeforeSetShipmentDate(ToSalesHeader: Record "Sales Header"; var ShouldSetShipmentDate: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocOnAfterToSalesLineDeleteAll(var ToSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchSalesLineOnBeforeTransferExtendedText(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; FromSalesHeaderArchive: Record "Sales Header Archive"; FromSalesLineArchive: Record "Sales Line Archive"; RecalculateLines: Boolean; var NextLineNo: Integer; var TransferOldExtLines: Codeunit "Transfer Old Ext. Text Lines"; var IsHandled: Boolean; MoveNegLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyPostedDeferrals(DeferralDocType: Enum "Deferral Document Type"; FromDocType: Integer; FromDocNo: Code[20]; FromLineNo: Integer; ToDocType: Integer; ToDocNo: Code[20]; ToLineNo: Integer; var StartDate: Date)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyDeferrals(DeferralDocType: Enum "Deferral Document Type"; FromDocType: Integer; FromDocNo: Code[20]; FromLineNo: Integer; ToDocType: Integer; ToDocNo: Code[20]; ToLineNo: Integer; var StartDate: Date)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInsertTempReservationEntryOnBeforeInsert(var TempReservationEntry: Record "Reservation Entry"; ItemLedgerEntry: Record "Item Ledger Entry")
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnCopySalesDocLineOnBeforeCopySalesJobFields(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesHeader: Record "Sales Header"; var FromSalesLine: Record "Sales Line"; FromSalesDocType: Enum "Sales Document Type From")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecalcSalesLineOnBeforeRoundUnitPrice(var SalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocLineOnAfterCalcShouldValidateQuantityMoveNegLines(var ToSalesLine: Record "Sales Line"; FromSalesLine: Record "Sales Line"; var ShouldValidateQuantityMoveNegLines: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before finalizing a sales line during the sales document copy process.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after a sales line has been copied but before the next iteration or completion of the process.
- /// This can be useful for implementing additional logic, validations, or post-processing for each line.
- ///
- ///
- /// The source sales header record being copied.
- ///
- ///
- /// The sales header record to which the sales lines are being copied.
- ///
- ///
- /// The target sales line record being finalized.
- ///
- ///
- /// The source sales line record being processed.
- ///
- ///
- /// A boolean value indicating whether the lines should be recalculated during the copy process.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocSalesLineOnBeforeFinishSalesDocSalesLine(FromSalesHeader: Record "Sales Header"; var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesLine: Record "Sales Line"; RecalculateLines: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesShptLinesToDocOnAfterCopySalesLine(ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesShptLine: Record "Sales Shipment Line")
- begin
- end;
-
- ///
- /// Event triggered after completing the sales credit memo line copy process for the sales document.
- /// Subscribing to this event allows developers to extend or customize the behavior
- /// after all sales credit memo lines have been copied. This can be useful for implementing post-processing logic,
- /// validations, or handling specific workflows related to the copied sales credit memo lines.
- ///
- ///
- /// The source sales credit memo header record being copied.
- ///
- ///
- /// The sales header record to which the sales credit memo lines were copied.
- ///
- ///
- /// The source sales credit memo line record that was copied.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopySalesDocCrMemoLine(var FromSalesCrMemoHeader: Record "Sales Cr.Memo Header"; var ToSalesHeader: Record "Sales Header"; var FromSalesCrMemoLine: Record "Sales Cr.Memo Line")
- begin
- end;
-
- ///
- /// Event triggered before handling the assembly attached to a sales line. This allows custom logic to override or skip the default handling.
- ///
- /// The sales line record being processed.
- /// A boolean variable to skip the default logic if set to true.
- [IntegrationEvent(false, false)]
- local procedure OnBeforeHandleAsmAttachedToSalesLine(var ToSalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitAndCheckPurchaseDocumentsOnAfterDelNegLines(var ToPurchaseHeader: Record "Purchase Header"; var FromPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitSalesLineFieldsOnBeforeInitQty(var ToSalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchSalesLineOnAfterCalcShouldRecalculateAmount(var ToSalesLine: Record "Sales Line"; FromSalesLineArchive: Record "Sales Line Archive"; var ShouldRecalculateAmount: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitAndCheckSalesDocumentsOnAfterDelNegLines(ToSalesHeader: Record "Sales Header"; FromSalesHeader: Record "Sales Header")
- begin
- end;
-
- ///
- /// Event triggered before deleting purchase lines with negative quantities.
- /// This allows developers to modify or override the behavior of the deletion process.
- ///
- ///
- /// The purchase header record associated with the purchase lines to be deleted.
- ///
- ///
- /// A boolean flag indicating whether the operation is a test (no actual deletion occurs) or a real deletion.
- ///
- ///
- /// A boolean flag that allows developers to handle the logic themselves and skip the default deletion process if set to true.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeDeletePurchLinesWithNegQty(FromPurchHeader: Record "Purchase Header"; OnlyTest: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after inserting the copied sales line into the target sales document.
- /// This allows developers to perform additional actions after the insertion.
- ///
- /// The target sales line that was inserted.
- /// The source sales line that was copied.
- /// The document type of the source sales document.
- /// A boolean variable indicating whether negative lines were moved instead of copied.
- [IntegrationEvent(true, false)]
- local procedure OnCopySalesDocLineOnAfterInsertToSalesLine(var ToSalesLine: Record "Sales Line"; var FromSalesLine: Record "Sales Line"; FromSalesDocType: Enum "Sales Document Type From"; MoveNegLines: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before validating the "Work Type Code" field on the sales line. This allows custom logic or skipping the validation process.
- ///
- /// The target sales line record being updated.
- /// The source sales line record being copied from.
- [IntegrationEvent(false, false)]
- local procedure OnRecalculateSalesLineOnBeforeValidateWorkTypeCode(var ToSalesLine: Record "Sales Line"; FromSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSplitSalesDocLinesPerItemTrkg(var ItemLedgerEntry: Record "Item Ledger Entry"; var TempReservationEntry: Record "Reservation Entry" temporary; var TempSalesLineBuf: Record "Sales Line" temporary; FromSalesLine: Record "Sales Line"; var TempDocSalesLine: Record "Sales Line" temporary; var NextLineNo: Integer; var NextItemTrkgEntryNo: Integer; var MissingExCostRevLink: Boolean; FromShptOrRcpt: Boolean; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSplitPurchDocLinesPerItemTrkg(var ItemLedgerEntry: Record "Item Ledger Entry"; var TempReservationEntry: Record "Reservation Entry" temporary; var FromPurchaseLineBuf: Record "Purchase Line"; FromPurchaseLine: Record "Purchase Line"; var TempDocPurchaseLine: Record "Purchase Line" temporary; var NextLineNo: Integer; var NextItemTrkgEntryNo: Integer; var MissingExCostRevLink: Boolean; FromShptOrRcpt: Boolean; var Result: Boolean; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitAndCheckSalesDocumentsOnAfterCheckSalesDocItselfCopy(ToSalesHeader: Record "Sales Header"; FromSalesHeader: Record "Sales Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitAndCheckPurchaseDocumentsOnAfterCheckPurchDocItselfCopy(ToPurchaseHeader: Record "Purchase Header"; FromPurchaseHeader: Record "Purchase Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchPurchLineOnBeforeCheckExactCostRevMandatory(var ToPurchLine: Record "Purchase Line"; FromPurchLineArchive: Record "Purchase Line Archive")
- begin
- end;
-
- ///
- /// Event triggered before validating the customer in the sales document copy process.
- /// Subscribing to this event allows developers to override or extend the default customer validation logic.
- /// This can be useful for applying custom rules, skipping validation, or introducing additional checks.
- ///
- ///
- /// The source sales header record being validated.
- ///
- ///
- /// The target sales header record to which the customer validation is being applied.
- ///
- ///
- /// A boolean variable indicating whether the default validation behavior should be bypassed.
- /// Setting this variable to true will skip the default behavior.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckCustomer(var FromSalesHeader: Record "Sales Header"; var ToSalesHeader: Record "Sales Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCopyFromSalesLineItemChargeAssign(FromSalesLine: Record "Sales Line"; ToSalesLine: Record "Sales Line"; FromSalesHeader: Record "Sales Header"; var ItemChargeAssgntNextLineNo: Integer; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesReturnRcptLinesToDocOnBeforeCopyLines(var ToSalesHeader: Record "Sales Header"; FromReturnRcptLine: Record "Return Receipt Line"; var FromSalesLineBuf: Record "Sales Line" temporary);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchRcptLinesToDocOnBeforeCopyItemTrkg(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; FromPurchLineBuf: Record "Purchase Line"; var RecalculateLines: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchCrMemoLinesToDocOnBeforeCopyItemCharges(var ToPurchLine: Record "Purchase Line"; var FromPurchLineBuf: Record "Purchase Line" temporary; RecalculateLines: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchReturnShptLinesToDocOnBeforeCopyItemTrkg(var ToPurchLine: Record "Purchase Line"; var FromPurchLineBuf: Record "Purchase Line" temporary; RecalculateLines: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeUpdateSalesCreditMemoHeader(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitAndCheckSalesDocumentsOnBeforeCheckCreditLimit(var FromSalesHeader: Record "Sales Header"; var ToSalesHeader: Record "Sales Header"; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnTransferFieldsFromCrMemoToInvOnBeforeTransferFields(var ToSalesHeader: Record "Sales Header"; FromSalesCrMemoHeader: Record "Sales Cr.Memo Header")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnBeforeTempSalesLineBufLoop(var ToSalesHeader: Record "Sales Header"; var TempSalesLineBuf: Record "Sales Line" temporary);
- begin
- end;
-
- ///
- /// Event triggered before transferring fields from a posted purchase receipt header to a purchase header.
- /// Allows developers to customize or modify the data before it has been transferred.
- ///
- ///
- /// The target purchase header record to which data will be transferred.
- ///
- ///
- /// The original purchase header record before copying.
- ///
- ///
- /// The source posted purchase receipt header record.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchHeaderFromPostedReceiptOnBeforeTransferFields(var ToPurchaseHeader: Record "Purchase Header"; OldPurchaseHeader: Record "Purchase Header"; FromPurchRcptHeader: Record "Purch. Rcpt. Header")
- begin
- end;
-
- ///
- /// Event triggered before transferring fields from a posted purchase invoice header to a purchase header.
- /// Allows developers to customize or modify the data before it has been transferred.
- ///
- ///
- /// The target purchase header record to which data will be transferred.
- ///
- ///
- /// The original purchase header record before copying.
- ///
- ///
- /// The source posted purchase invoice header record.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchHeaderFromPostedInvoiceOnBeforeTransferFields(var ToPurchaseHeader: Record "Purchase Header"; OldPurchaseHeader: Record "Purchase Header"; FromPurchInvHeader: Record "Purch. Inv. Header")
- begin
- end;
-
- ///
- /// Event triggered before transferring fields from a posted return shipment header to a purchase header.
- /// Allows developers to customize or modify the data before it has been transferred.
- ///
- ///
- /// The target purchase header record to which data will be transferred.
- ///
- ///
- /// The original purchase header record before copying.
- ///
- ///
- /// The source posted return shipment header record.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchHeaderFromPostedReturnShipmentOnBeforeTransferFields(var ToPurchaseHeader: Record "Purchase Header"; OldPurchaseHeader: Record "Purchase Header"; FromReturnShipmentHeader: Record "Return Shipment Header")
- begin
- end;
-
- ///
- /// Event triggered before transferring fields from a posted purchase credit memo header to a purchase header.
- /// Allows developers to customize or modify the data before it has been transferred.
- ///
- ///
- /// The target purchase header record to which data will be transferred.
- ///
- ///
- /// The original purchase header record before copying.
- ///
- ///
- /// The source posted purchase credit memo header record.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchHeaderFromPostedCreditMemoOnBeforeTransferFields(var ToPurchaseHeader: Record "Purchase Header"; OldPurchaseHeader: Record "Purchase Header"; FromPurchCrMemoHeader: Record "Purch. Cr. Memo Hdr.")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocOnBeforeConfirmDeleteLines(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var IsHandled: Boolean);
- begin
- end;
-
- ///
- /// Event triggered before inserting or updating the purchase header during the document copy process.
- /// Subscribing to this event allows developers to modify or extend the behavior
- /// before the header has been created or updated. This can be useful for applying additional logic,
- /// customizations, or altering the workflow during header processing.
- ///
- ///
- /// The target purchase header record being created or updated.
- ///
- ///
- /// The purchase line record associated with the target purchase document.
- ///
- ///
- /// A boolean value indicating whether the header will be created.
- ///
- ///
- /// A boolean value indicating whether the source header data should be included.
- ///
- ///
- /// A boolean variable indicating whether the operation should exit early.
- ///
- ///
- /// A boolean variable indicating whether the default header creation or inclusion behavior should be bypassed.
- /// Setting this variable to true will skip the default behavior.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocOnBeforeCreateOrIncludeHeader(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; CreateToHeader: Boolean; IncludeHeader: Boolean; var DoExit: Boolean; var IsHandled: Boolean);
- begin
- end;
-
- ///
- /// Event triggered after processing each purchase line in the loop during the purchase document copy process.
- /// Subscribing to this event allows developers to implement additional logic
- /// or workflows after processing each line. This can be useful for tracking progress or applying custom operations.
- ///
- ///
- /// The target purchase header record to which the lines are being copied.
- ///
- ///
- /// The current purchase line record in the target document.
- ///
- ///
- /// The current purchase line record in the source document being processed.
- ///
- ///
- /// A boolean value indicating whether the lines should be recalculated during the copy process.
- ///
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocPurchLineOnAfterProcessFromPurchLineInLoop(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; FromPurchLine: Record "Purchase Line"; RecalculateLines: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchInvLinesToDocOnBeforeInsertOldPurchLine(var ToPurchaseHeader: Record "Purchase Header"; var FromPurchLineBuf: Record "Purchase Line" temporary; var OldInvDocNo: Code[20]; var OldRcptDocNo: Code[20]; var NextLineNo: Integer; SkipCopyFromDescription: Boolean; InsertCancellationLine: Boolean; var IsHandled: Boolean);
- begin
- end;
-
- ///
- /// Event triggered before recalculating the amount on the sales line. This allows custom adjustments before the amount has been recalculated.
- ///
- /// The target sales line record being updated.
- /// The source sales line record being copied from.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesLineBeforeRecalculateAmount(var ToSalesLine: Record "Sales Line"; FromSalesLine: Record "Sales Line");
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecalculatePurchLineOnBeforeValidatePurchasingCode(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; var FromPurchHeader: Record "Purchase Header"; var FromPurchLine: Record "Purchase Line"; var CopyThisLine: Boolean; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocLineOnBeforeSetSalesHeader(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; FromSalesHeader: Record "Sales Header"; FromSalesLine: Record "Sales Line"; var NextLineNo: Integer)
- begin
- end;
-
- ///
- /// Event triggered before validating the "Unit Cost (LCY)" field on the sales line. This allows custom logic before the validation has been executed.
- ///
- /// The target sales line record being updated.
- /// The source sales line record being copied from.
- /// A boolean variable to override the default validation if set to true.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesLineOnBeforeToSalesLineValidateUnitCostLcy(var ToSalesLine: Record "Sales Line"; var FromSalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- end;
-
- ///
- /// Event triggered after updating the warehouse shipment information for the sales line. This allows custom adjustments or checks after the update.
- ///
- /// The target sales header record being updated.
- /// The target sales line record being updated.
- /// The source sales header record being copied from.
- /// The source sales line record being copied from.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesLineOnAfterUpdateWithWarehouseShip(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesHeader: Record "Sales Header"; var FromSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchDocLineOnBeforeRecalculateLines(var ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; var FromPurchHeader: Record "Purchase Header"; var FromPurchLine: Record "Purchase Line"; var NextLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnUpdatePurchLineOnAfterCopyDocLine(var ToPurchLine: Record "Purchase Line"; var FromPurchLine: Record "Purchase Line")
- begin
- end;
-
- ///
- /// Event triggered before determining if the sales line should be copied when the type is "G/L Account".
- ///
- /// The target sales line record being updated.
- /// The source sales line record being copied from.
- [IntegrationEvent(false, false)]
- local procedure OnRecalculateSalesLineOnBeforeCopyThisLine(ToSalesLine: Record "Sales Line"; var FromSalesLine: Record "Sales Line")
- begin
- end;
-
- ///
- /// Event triggered after validating the "No." field on the sales line. This allows additional logic or checks after the validation process.
- ///
- /// The target sales line record being updated.
- /// The source sales line record being copied from.
- [IntegrationEvent(false, false)]
- local procedure OnRecalculateSalesLineOnAfterValidateNo(var ToSalesLine: Record "Sales Line"; var FromSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecalculatePurchLineOnAfterCopyThisLine(var ToPurchLine: Record "Purchase Line"; var FromPurchLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecalculatePurchLineOnAfterValidateNo(var ToPurchLine: Record "Purchase Line"; var FromPurchLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnRecalculatePurchLineOnAfterValidatePurchasingCode(var ToPurchLine: Record "Purchase Line"; var FromPurchLine: Record "Purchase Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnAfterCopyItemLedgEntryTrackingToSalesLine(ToSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesCrMemoLinesToDocOnAfterCopyItemLedgEntryTrkgToSalesLn(var ToSalesLine: Record "Sales Line")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetVendor(var FromPurchLine: Record "Purchase Line"; var Vendor: Record Vendor; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeCheckFromPurchaseHeader(PurchaseHeaderFrom: Record "Purchase Header"; PurchaseHeaderTo: Record "Purchase Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesDocLineOnBeforeInitToSalesLine(var ToSalesLine: Record "Sales Line"; FromSalesLine: Record "Sales Line"; var ShouldInitToSalesLine: Boolean)
- begin
- end;
-
- ///
- /// Event triggered before validating the target sales line during the update process. This allows additional checks or modifications before validation.
- ///
- /// The target sales header record being updated.
- /// The target sales line record being updated.
- /// The source sales header record being copied from.
- /// The source sales line record being copied from.
- /// A boolean variable indicating if the sales line should be recalculated.
- [IntegrationEvent(false, false)]
- local procedure OnUpdateSalesLineOnBeforeValidateToSalesLine(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; var FromSalesHeader: Record "Sales Header"; var FromSalesLine: Record "Sales Line"; var ShouldRecalculateSalesLine: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeInsertOldSalesDocNoLineProcedure(var ToSalesHeader: Record "Sales Header"; var ToSalesLine: Record "Sales Line"; OldDocType: Option; OldDocNo: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeInsertOldPurchDocNoLineProcedure(ToPurchHeader: Record "Purchase Header"; var ToPurchLine: Record "Purchase Line"; OldDocType: Option; OldDocNo: Code[20]; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchRcptLinesToDocOnBeforeTestFieldPricesIncludingVAT(var ToPurchaseHeader: Record "Purchase Header"; IncludeHeader: Boolean; RecalculateLines: Boolean; var FromPurchRcptHeader: Record "Purch. Rcpt. Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchInvLinesToDocOnBeforeTestFieldPricesIncludingVAT(var ToPurchaseHeader: Record "Purchase Header"; IncludeHeader: Boolean; RecalculateLines: Boolean; var FromPurchInvHeader: Record "Purch. Inv. Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchCrMemoLinesToDocOnBeforeTestFieldPricesIncludingVAT(var ToPurchaseHeader: Record "Purchase Header"; IncludeHeader: Boolean; RecalculateLines: Boolean; var FromPurchCrMemoHeader: Record "Purch. Cr. Memo Hdr."; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyPurchReturnShptLinesToDocOnBeforeTestFieldPricesIncludingVAT(var ToPurchaseHeader: Record "Purchase Header"; IncludeHeader: Boolean; RecalculateLines: Boolean; var FromReturnShptHeader: Record "Return Shipment Header"; var IsHandled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInitAndCheckSalesDocumentsOnBeforeFromSalesHeaderArchiveCheckFields(var FromSalesHeaderArchive: Record "Sales Header Archive"; var ToSalesHeader: Record "Sales Header"; IncludeHeader: Boolean; RecalculateLines: Boolean; var SkipFromSalesHeaderArchiveCheck: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyFromArchSalesDocDimToLine(var ToSalesLine: Record "Sales Line"; FromSalesLineArchive: Record "Sales Line Archive")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterCopyFromArchSalesDocDimToHdr(var ToSalesHeader: Record "Sales Header"; FromSalesHeaderArchive: Record "Sales Header Archive")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnBeforeGetNextLineNo(var ToSalesHeader: Record "Sales Header"; var TempSalesLineBuf: Record "Sales Line" temporary; var ShouldGetNextLineNo: Boolean; var NextLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesInvLinesToDocOnBeforeIncrementNextLineNo(var ToSalesHeader: Record "Sales Header"; var TempSalesLineBuf: Record "Sales Line" temporary; var ShouldIncrementNextLineNo: Boolean; var NextLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopySalesCrMemoLinesToDocOnBeforeGetNextLineNo(var ToSalesHeader: Record "Sales Header"; var TempFromSalesLineBuf: Record "Sales Line" temporary; var ShouldGetNextLineNo: Boolean; var NextLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnInsertOldSalesDocNoLineOnBeforeIncrementNextLineNo(var ToSalesHeader: Record "Sales Header"; var ShouldIncrementNextLineNo: Boolean; var NextLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCheckFirstLineShippedOnBeforeIncrementNextLineNo(ToSalesHeader: Record "Sales Header"; var TempSalesLine: Record "Sales Line" temporary; var ShouldIncrementNextLineNo: Boolean; var NextLineNo: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchSalesLineOnAfterInitSalesLineFields(var ToSalesLine: Record "Sales Line"; var FromSalesLineArchive: Record "Sales Line Archive")
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCopyArchSalesLineOnBeforeIncrementLinesNotCopied(FromSalesLineArchive: Record "Sales Line Archive"; var ShouldIncrementLinesNotCopied: Boolean; var LinesNotCopied: Integer)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnCreateJobPlanningLineOnAfterInitFromJobPlanningLine(var NewJobPlanningLine: Record "Job Planning Line"; JobPlanningLine: Record "Job Planning Line"; SalesLine: Record "Sales Line")
- begin
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Utilities/DataClassEvalDataCountry.Codeunit.al b/src/Layers/NL/BaseApp/Utilities/DataClassEvalDataCountry.Codeunit.al
deleted file mode 100644
index 6f01fb2a2d..0000000000
--- a/src/Layers/NL/BaseApp/Utilities/DataClassEvalDataCountry.Codeunit.al
+++ /dev/null
@@ -1,265 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Utilities;
-
-using Microsoft.Bank.Payment;
-using Microsoft.Bank.Reconciliation;
-using Microsoft.Bank.Statement;
-using Microsoft.Finance.VAT.Reporting;
-using Microsoft.Foundation.Address;
-using Microsoft.HumanResources.Absence;
-using Microsoft.HumanResources.Employee;
-using Microsoft.HumanResources.Payables;
-using Microsoft.Sales.Archive;
-using System.Privacy;
-
-codeunit 1752 "Data Class. Eval. Data Country"
-{
-
- trigger OnRun()
- begin
- end;
-
- procedure ClassifyCountrySpecificTables()
- var
- DataClassificationEvalData: Codeunit "Data Classification Eval. Data";
- begin
- ClassifyEmployee();
- ClassifyPayableEmployeeLedgerEntry();
- ClassifyDetailedEmployeeLedgerEntry();
- ClassifyEmployeeLedgerEntry();
- ClassifyEmployeeRelative();
- ClassifyEmployeeQualification();
- ClassifyVATReportHeader();
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Alt. Employee Posting Group");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Employee Posting Group");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Cause of Absence");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"CBG Statement");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"CBG Statement Line");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Reporting ICP");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Freely Transferable Maximum");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Post Code Range");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Post Code Update Log Entry");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Elec. Tax Declaration Setup");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Elec. Tax Declaration Header");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Elec. Tax Declaration Line");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Elec. Tax Decl. VAT Category");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Elec. Tax Decl. Error Log");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Elec. Tax Decl. Response Msg.");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Proposal Line");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Payment History");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Payment History Line");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Detail Line");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Transaction Mode");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Export Protocol");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"CBG Statement Line Add. Info.");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Import Protocol");
- DataClassificationEvalData.SetTableFieldsToNormal(DATABASE::"Sales Header Archive");
- OnAfterClassifyCountrySpecificTables();
- end;
-
- local procedure ClassifyPayableEmployeeLedgerEntry()
- var
- DummyPayableEmployeeLedgerEntry: Record "Payable Employee Ledger Entry";
- DataClassificationMgt: Codeunit "Data Classification Mgt.";
- TableNo: Integer;
- begin
- TableNo := DATABASE::"Payable Employee Ledger Entry";
- DataClassificationMgt.SetTableFieldsToNormal(TableNo);
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyPayableEmployeeLedgerEntry.FieldNo(Positive));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyPayableEmployeeLedgerEntry.FieldNo("Currency Code"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyPayableEmployeeLedgerEntry.FieldNo(Amount));
- DataClassificationMgt.SetFieldToCompanyConfidential(
- TableNo, DummyPayableEmployeeLedgerEntry.FieldNo("Employee Ledg. Entry No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyPayableEmployeeLedgerEntry.FieldNo("Entry No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyPayableEmployeeLedgerEntry.FieldNo("Employee No."));
- end;
-
- local procedure ClassifyDetailedEmployeeLedgerEntry()
- var
- DummyDetailedEmployeeLedgerEntry: Record "Detailed Employee Ledger Entry";
- DataClassificationMgt: Codeunit "Data Classification Mgt.";
- TableNo: Integer;
- begin
- TableNo := DATABASE::"Detailed Employee Ledger Entry";
- DataClassificationMgt.SetTableFieldsToNormal(TableNo);
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Ledger Entry Amount"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Application No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(
- TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Unapplied by Entry No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo(Unapplied));
- DataClassificationMgt.SetFieldToCompanyConfidential(
- TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Applied Empl. Ledger Entry No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(
- TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Initial Document Type"));
- DataClassificationMgt.SetFieldToCompanyConfidential(
- TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Initial Entry Global Dim. 2"));
- DataClassificationMgt.SetFieldToCompanyConfidential(
- TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Initial Entry Global Dim. 1"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Credit Amount (LCY)"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Debit Amount (LCY)"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Credit Amount"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Debit Amount"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Reason Code"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Journal Batch Name"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Transaction No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Source Code"));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("User ID"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Currency Code"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Employee No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Amount (LCY)"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo(Amount));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Document No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Document Type"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Posting Date"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Entry Type"));
- DataClassificationMgt.SetFieldToCompanyConfidential(
- TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Employee Ledger Entry No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyDetailedEmployeeLedgerEntry.FieldNo("Entry No."));
- end;
-
- local procedure ClassifyEmployeeLedgerEntry()
- var
- DummyEmployeeLedgerEntry: Record "Employee Ledger Entry";
- DataClassificationMgt: Codeunit "Data Classification Mgt.";
- TableNo: Integer;
- begin
- TableNo := DATABASE::"Employee Ledger Entry";
- DataClassificationMgt.SetTableFieldsToNormal(TableNo);
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Applying Entry"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Amount to Apply"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Payment Method Code"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Payment Reference"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Creditor No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("No. Series"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Message to Recipient"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Closed by Amount (LCY)"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Transaction No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Bal. Account No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Bal. Account Type"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Reason Code"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Journal Batch Name"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Applies-to ID"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Closed by Amount"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Closed at Date"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Closed by Entry No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo(Positive));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo(Open));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Applies-to Doc. No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Applies-to Doc. Type"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Source Code"));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployeeLedgerEntry.FieldNo("User ID"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Salespers./Purch. Code"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Global Dimension 2 Code"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Global Dimension 1 Code"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Employee Posting Group"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Dimension Set ID"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Currency Code"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Exported to Payment File"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo(Description));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Document No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Document Type"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Posting Date"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Employee No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeLedgerEntry.FieldNo("Entry No."));
- end;
-
- local procedure ClassifyEmployeeRelative()
- var
- DummyEmployeeRelative: Record "Employee Relative";
- DataClassificationMgt: Codeunit "Data Classification Mgt.";
- TableNo: Integer;
- begin
- TableNo := DATABASE::"Employee Relative";
- DataClassificationMgt.SetTableFieldsToNormal(TableNo);
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeRelative.FieldNo("Relative's Employee No."));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployeeRelative.FieldNo("Phone No."));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployeeRelative.FieldNo("Birth Date"));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployeeRelative.FieldNo("Last Name"));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployeeRelative.FieldNo("Middle Name"));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployeeRelative.FieldNo("First Name"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeRelative.FieldNo("Relative Code"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeRelative.FieldNo("Line No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeRelative.FieldNo("Employee No."));
- end;
-
- local procedure ClassifyEmployeeQualification()
- var
- DummyEmployeeQualification: Record "Employee Qualification";
- DataClassificationMgt: Codeunit "Data Classification Mgt.";
- TableNo: Integer;
- begin
- TableNo := DATABASE::"Employee Qualification";
- DataClassificationMgt.SetTableFieldsToNormal(TableNo);
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeQualification.FieldNo("Expiration Date"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeQualification.FieldNo("Employee Status"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeQualification.FieldNo("Course Grade"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeQualification.FieldNo(Cost));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeQualification.FieldNo("Institution/Company"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeQualification.FieldNo(Description));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeQualification.FieldNo(Type));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeQualification.FieldNo("To Date"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeQualification.FieldNo("From Date"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeQualification.FieldNo("Qualification Code"));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeQualification.FieldNo("Line No."));
- DataClassificationMgt.SetFieldToCompanyConfidential(TableNo, DummyEmployeeQualification.FieldNo("Employee No."));
- end;
-
- local procedure ClassifyEmployee()
- var
- DummyEmployee: Record Employee;
- DataClassificationMgt: Codeunit "Data Classification Mgt.";
- TableNo: Integer;
- begin
- TableNo := DATABASE::Employee;
- DataClassificationMgt.SetTableFieldsToNormal(TableNo);
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo(Image));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo(IBAN));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo("Bank Account No."));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo("Bank Branch No."));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo("Company E-Mail"));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo("Fax No."));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo(Pager));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo(Extension));
- DataClassificationMgt.SetFieldToSensitive(TableNo, DummyEmployee.FieldNo("Termination Date"));
- DataClassificationMgt.SetFieldToSensitive(TableNo, DummyEmployee.FieldNo("Inactive Date"));
- DataClassificationMgt.SetFieldToSensitive(TableNo, DummyEmployee.FieldNo(Status));
- DataClassificationMgt.SetFieldToSensitive(TableNo, DummyEmployee.FieldNo("Employment Date"));
- DataClassificationMgt.SetFieldToSensitive(TableNo, DummyEmployee.FieldNo(Gender));
- DataClassificationMgt.SetFieldToSensitive(TableNo, DummyEmployee.FieldNo("Union Membership No."));
- DataClassificationMgt.SetFieldToSensitive(TableNo, DummyEmployee.FieldNo("Union Code"));
- DataClassificationMgt.SetFieldToSensitive(TableNo, DummyEmployee.FieldNo("Social Security No."));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo("Birth Date"));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo("E-Mail"));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo("Mobile Phone No."));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo("Phone No."));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo(County));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo("Post Code"));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo(City));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo("Address 2"));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo(Address));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo("Search Name"));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo("Last Name"));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo("Middle Name"));
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyEmployee.FieldNo("First Name"));
- end;
-
- local procedure ClassifyVATReportHeader()
- var
- DummyVATReportHeader: Record "VAT Report Header";
- DataClassificationMgt: Codeunit "Data Classification Mgt.";
- TableNo: Integer;
- begin
- TableNo := DATABASE::"VAT Report Header";
- DataClassificationMgt.SetTableFieldsToNormal(TableNo);
- DataClassificationMgt.SetFieldToPersonal(TableNo, DummyVATReportHeader.FieldNo("Submitted By"));
- DataClassificationMgt.SetTableFieldsToNormal(DATABASE::"VAT Return Period");
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterClassifyCountrySpecificTables()
- begin
- end;
-}
diff --git a/src/Layers/NL/BaseApp/Warehouse/RoleCenters/WarehouseManagerRoleCenter.Page.al b/src/Layers/NL/BaseApp/Warehouse/RoleCenters/WarehouseManagerRoleCenter.Page.al
deleted file mode 100644
index 0ee2026746..0000000000
--- a/src/Layers/NL/BaseApp/Warehouse/RoleCenters/WarehouseManagerRoleCenter.Page.al
+++ /dev/null
@@ -1,990 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Warehouse.RoleCenters;
-
-using Microsoft.Assembly.Document;
-using Microsoft.Assembly.History;
-using Microsoft.Assembly.Reports;
-using Microsoft.Assembly.Setup;
-using Microsoft.Foundation.Navigate;
-using Microsoft.Inventory.Analysis;
-using Microsoft.Inventory.Counting.Journal;
-using Microsoft.Inventory.Document;
-using Microsoft.Inventory.History;
-using Microsoft.Inventory.Item;
-using Microsoft.Inventory.Item.Catalog;
-using Microsoft.Inventory.Journal;
-using Microsoft.Inventory.Ledger;
-using Microsoft.Inventory.Location;
-using Microsoft.Inventory.Reports;
-using Microsoft.Inventory.Requisition;
-using Microsoft.Inventory.Setup;
-using Microsoft.Inventory.Tracking;
-using Microsoft.Inventory.Transfer;
-using Microsoft.Projects.Resources.Resource;
-using Microsoft.Purchases.Document;
-using Microsoft.Purchases.History;
-using Microsoft.Purchases.Vendor;
-using Microsoft.Sales.Customer;
-using Microsoft.Sales.Document;
-using Microsoft.Sales.History;
-using Microsoft.Sales.Reports;
-using Microsoft.Warehouse.Activity;
-using Microsoft.Warehouse.Activity.History;
-using Microsoft.Warehouse.ADCS;
-using Microsoft.Warehouse.Document;
-using Microsoft.Warehouse.History;
-using Microsoft.Warehouse.InternalDocument;
-using Microsoft.Warehouse.InventoryDocument;
-using Microsoft.Warehouse.Journal;
-using Microsoft.Warehouse.Ledger;
-using Microsoft.Warehouse.Reports;
-using Microsoft.Warehouse.Request;
-using Microsoft.Warehouse.Setup;
-using Microsoft.Warehouse.Structure;
-using Microsoft.Warehouse.Worksheet;
-
-page 8909 "Warehouse Manager Role Center"
-{
- Caption = 'Warehouse Manager Role Center';
- PageType = RoleCenter;
- actions
- {
- area(Sections)
- {
- group("Group")
- {
- Caption = 'Orders & Contacts';
- action("Vendors")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendors';
- RunObject = page "Vendor List";
- }
- action("Orders")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Purchase Orders';
- RunObject = page "Purchase Order List";
- }
- action("Return Orders")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Purchase Return Orders';
- RunObject = page "Purchase Return Order List";
- }
- action("Customers")
- {
- ApplicationArea = Warehouse;
- Caption = 'Customers';
- RunObject = page "Customer List";
- }
- action("Orders1")
- {
- ApplicationArea = Assembly, Warehouse;
- Caption = 'Sales Orders';
- RunObject = page "Sales Order List";
- }
- action("Return Orders1")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Sales Return Orders';
- RunObject = page "Sales Return Order List";
- }
- action("Transfer Orders")
- {
- ApplicationArea = Location;
- Caption = 'Transfer Orders';
- RunObject = page "Transfer Orders";
- }
- action("Assembly Orders")
- {
- ApplicationArea = Assembly;
- Caption = 'Assembly Orders';
- RunObject = page "Assembly Orders";
- }
- group("Group1")
- {
- Caption = 'Posted Documents';
- action("Posted Purchase Invoices")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posted Purchase Invoices';
- RunObject = page "Posted Purchase Invoices";
- }
- action("Posted Credit Memos")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posted Purchase Credit Memos';
- RunObject = page "Posted Purchase Credit Memos";
- }
- action("Posted Invoices")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posted Sales Invoices';
- RunObject = page "Posted Sales Invoices";
- }
- action("Posted Credit Memos1")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posted Sales Credit Memos';
- RunObject = page "Posted Sales Credit Memos";
- }
- }
- group("Group2")
- {
- Caption = 'Reports';
- action("Return Order Confirmation")
- {
- ApplicationArea = SalesReturnOrder, PurchReturnOrder;
- Caption = 'Return Order Confirmation';
- RunObject = report "Return Order Confirmation";
- }
- }
- }
- group("Group3")
- {
- Caption = 'Planning & Operations';
- action("Items")
- {
- ApplicationArea = Assembly, Warehouse;
- Caption = 'Items';
- RunObject = page "Item List";
- }
- action("Nonstock Items")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Nonstock Items';
- RunObject = page "Catalog Item List";
- }
- action("Stock keeping Units")
- {
- ApplicationArea = Warehouse;
- Caption = 'Stockkeeping Units';
- RunObject = page "Stockkeeping Unit List";
- }
- action("Bin Contents")
- {
- ApplicationArea = Warehouse;
- Caption = 'Bin Contents';
- RunObject = page "Bin Contents";
- AccessByPermission = TableData "Bin" = R;
- }
- action("Create Invt. Put-away/Pick")
- {
- ApplicationArea = Warehouse;
- Caption = 'Create Invt. Put-away/Pick';
- RunObject = report "Create Invt Put-away/Pick/Mvmt";
- AccessByPermission = TableData "Location" = R;
- }
- action("Pick Worksheets")
- {
- ApplicationArea = Warehouse;
- Caption = 'Pick Worksheets';
- RunObject = page "Pick Worksheet";
- }
- action("Put-away Worksheets")
- {
- ApplicationArea = Warehouse;
- Caption = 'Put-away Worksheets';
- RunObject = page "Put-away Worksheet";
- }
- action("Movement Worksheets")
- {
- ApplicationArea = Warehouse;
- Caption = 'Movement Worksheets';
- RunObject = page "Movement Worksheet";
- }
- action("Internal Movement List")
- {
- ApplicationArea = Warehouse;
- Caption = 'Internal Movements';
- RunObject = page "Internal Movement List";
- }
- action("Item Reclass. Journals")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Reclassification Journals';
- RunObject = page "Item Reclass. Journal";
- }
- action("Item Tracing")
- {
- ApplicationArea = ItemTracking;
- Caption = 'Item Tracing';
- RunObject = page "Item Tracing";
- }
- action("Inventory Receipts")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory Receipts';
- RunObject = page "Invt. Receipts";
- Tooltip = 'Open the Item Receipts page.';
- }
- action("Inventory Shipments")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Inventory Shipments';
- RunObject = page "Invt. Shipments";
- Tooltip = 'Open the Item Shipments page.';
- }
- group("Group4")
- {
- Caption = 'Warehouse Documents';
- action("Transfer Orders1")
- {
- ApplicationArea = Location;
- Caption = 'Transfer Orders';
- RunObject = page "Transfer Orders";
- }
- action("Receipts")
- {
- ApplicationArea = Warehouse;
- Caption = 'Warehouse Receipts';
- RunObject = page "Warehouse Receipts";
- }
- action("Shipments")
- {
- ApplicationArea = Warehouse;
- Caption = 'Warehouse Shipments';
- RunObject = page "Warehouse Shipment List";
- }
- action("Assembly Orders1")
- {
- ApplicationArea = Assembly;
- Caption = 'Assembly Orders';
- RunObject = page "Assembly Orders";
- }
- }
- group("Group5")
- {
- Caption = 'Posted Documents';
- action("Posted Purchase Receipts")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posted Purchase Receipts';
- RunObject = page "Posted Purchase Receipts";
- }
- action("Posted Return Shipments")
- {
- ApplicationArea = PurchReturnOrder;
- Caption = 'Posted Purchase Return Shipments';
- RunObject = page "Posted Return Shipments";
- }
- action("Posted Sales Shipments")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posted Sales Shipments';
- RunObject = page "Posted Sales Shipments";
- }
- action("Posted Return Receipts")
- {
- ApplicationArea = SalesReturnOrder;
- Caption = 'Posted Return Receipts';
- RunObject = page "Posted Return Receipts";
- }
- action("Posted Assembly Orders")
- {
- ApplicationArea = Assembly;
- Caption = 'Posted Assembly Orders';
- RunObject = page "Posted Assembly Orders";
- }
- action("Posted Transfer Receipts")
- {
- ApplicationArea = Location;
- Caption = 'Posted Transfer Receipts';
- RunObject = page "Posted Transfer Receipts";
- }
- action("Posted Transfer Shipments")
- {
- ApplicationArea = Location;
- Caption = 'Posted Transfer Shipments';
- RunObject = page "Posted Transfer Shipments";
- }
- action("Posted Direct Transfers")
- {
- ApplicationArea = Location;
- Caption = 'Posted Direct Transfers';
- RunObject = page "Posted Direct Transfers";
- }
- action("Posted Receipts")
- {
- ApplicationArea = Warehouse;
- Caption = 'Posted Whse. Receipts';
- RunObject = page "Posted Whse. Receipt List";
- }
- action("Posted Shipments")
- {
- ApplicationArea = Warehouse;
- Caption = 'Posted Whse. Shipments';
- RunObject = page "Posted Whse. Shipment List";
- }
- action("Posted Invt. Put-away")
- {
- ApplicationArea = Warehouse;
- Caption = 'Posted Invt. Put-away';
- RunObject = page "Posted Invt. Put-away List";
- }
- action("Posted Invt. Pick")
- {
- ApplicationArea = Warehouse;
- Caption = 'Posted Invt. Pick';
- RunObject = page "Posted Invt. Pick List";
- }
- action("Posted Invt. Receipts")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posted Inventory Receipts';
- RunObject = page "Posted Invt. Receipts";
- Tooltip = 'Open the Posted Inventory Receipts page.';
- }
- action("Posted Invt. Shipments")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Posted Inventory Shipments';
- RunObject = page "Posted Invt. Shipments";
- Tooltip = 'Open the Posted Inventory Shipments page.';
- }
- }
- group("Group6")
- {
- Caption = 'Registers/Entries';
- action("Registered Put-aways")
- {
- ApplicationArea = Warehouse;
- Caption = 'Registered Put-aways';
- RunObject = page "Registered Whse. Put-aways";
- }
- action("Registered Picks")
- {
- ApplicationArea = Warehouse;
- Caption = 'Registered Picks';
- RunObject = page "Registered Whse. Picks";
- }
- action("Registered Movement")
- {
- ApplicationArea = Warehouse;
- Caption = 'Registered Movements';
- RunObject = page "Registered Whse. Movements";
- }
- action("Registered Invt. Movement")
- {
- ApplicationArea = Warehouse;
- Caption = 'Registered Invt. Movement';
- RunObject = page "Registered Invt. Movement List";
- }
- action("Registers")
- {
- ApplicationArea = Warehouse;
- Caption = 'Warehouse Registers';
- RunObject = page "Warehouse Registers";
- }
- action("Item Registers")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Registers';
- RunObject = page "Item Registers";
- }
- action("Item Ledger Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Ledger Entries';
- RunObject = page "Item Ledger Entries";
- }
- action("Phys. Inventory Ledger Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Physical Inventory Ledger Entries';
- RunObject = page "Phys. Inventory Ledger Entries";
- }
- action("Value Entries")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Value Entries';
- RunObject = page "Value Entries";
- }
- action("Warehouse Entries")
- {
- ApplicationArea = Warehouse;
- Caption = 'Warehouse Entries';
- RunObject = page "Warehouse Entries";
- }
- action("Navi&gate")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Find entries...';
- Image = Navigate;
- RunObject = Page Navigate;
- ShortCutKey = 'Ctrl+Alt+Q';
- ToolTip = 'Find entries and documents that exist for the document number and posting date on the selected document. (Formerly this action was named Navigate.)';
- }
- }
- group("Group7")
- {
- Caption = 'Reports';
- action("Whse. Shipment Status")
- {
- ApplicationArea = Warehouse;
- Caption = 'Whse. Shipment Status';
- RunObject = report "Whse. Shipment Status";
- }
-#if not CLEAN28
- action("Customer - List")
- {
- ApplicationArea = Basic, Suite, Warehouse;
- Caption = 'Customer - List';
- RunObject = report "Customer - List";
- ObsoleteState = Pending;
- ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
- ObsoleteTag = '28.0';
- }
-#endif
- action("Inventory Picking List")
- {
- ApplicationArea = Warehouse;
- Caption = 'Inventory Picking List';
- RunObject = report "Inventory Picking List";
- AccessByPermission = TableData "Location" = R;
- }
- action("Item Expiration - Quantity")
- {
- ApplicationArea = ItemTracking;
- Caption = 'Item Expiration - Quantity';
- RunObject = report "Item Expiration - Quantity";
- }
- }
- }
- group("Group8")
- {
- Caption = 'Goods Handling';
- group("Group9")
- {
- Caption = 'Order by Order';
- action("Inventory Put-aways")
- {
- ApplicationArea = Warehouse;
- Caption = 'Inventory Put-aways';
- RunObject = page "Inventory Put-aways";
- }
- action("Inventory Picks")
- {
- ApplicationArea = Warehouse;
- Caption = 'Inventory Picks';
- RunObject = page "Inventory Picks";
- }
- action("Page9330")
- {
- ApplicationArea = Warehouse;
- Caption = 'Inventory Movements';
- RunObject = page "Inventory Movements";
- }
- }
- group("Group10")
- {
- Caption = 'Multiple Orders';
- action("Put-aways")
- {
- ApplicationArea = Warehouse;
- Caption = 'Put-aways';
- RunObject = page "Warehouse Put-aways";
- }
- action("Picks")
- {
- ApplicationArea = Warehouse;
- Caption = 'Picks';
- RunObject = page "Warehouse Picks";
- }
- action("Movements")
- {
- ApplicationArea = Warehouse;
- Caption = 'Movements';
- RunObject = page "Warehouse Movements";
- }
- action("Internal Picks")
- {
- ApplicationArea = Warehouse;
- Caption = 'Whse. Internal Picks';
- RunObject = page "Whse. Internal Pick List";
- }
- action("Internal Put-aways")
- {
- ApplicationArea = Warehouse;
- Caption = 'Whse. Internal Put-aways';
- RunObject = page "Whse. Internal Put-away List";
- }
- }
- group("Group11")
- {
- Caption = 'Bins';
- action("Bin Contents1")
- {
- ApplicationArea = Warehouse;
- Caption = 'Bin Contents';
- RunObject = page "Bin Contents";
- AccessByPermission = TableData "Bin" = R;
- }
- action("Bin Creation Worksheet")
- {
- ApplicationArea = Warehouse;
- Caption = 'Bin Creation Worksheet';
- RunObject = page "Bin Creation Worksheet";
- AccessByPermission = TableData "Bin" = R;
- }
- action("Bin Content Creation Worksheet")
- {
- ApplicationArea = Warehouse;
- Caption = 'Bin Content Creation Worksheet';
- RunObject = page "Bin Content Creation Worksheet";
- AccessByPermission = TableData "Bin" = R;
- }
- }
- group("Group12")
- {
- Caption = 'Journals';
- action("Whse. Item Journals")
- {
- ApplicationArea = Warehouse;
- Caption = 'Whse. Item Journals';
- RunObject = page "Whse. Item Journal";
- }
- action("Item Reclass. Journals1")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Reclassification Journals';
- RunObject = page "Item Reclass. Journal";
- }
- action("Whse. Reclass. Journals")
- {
- ApplicationArea = Warehouse;
- Caption = 'Whse. Reclass. Journals';
- RunObject = page "Whse. Reclassification Journal";
- }
- action("Whse. Phys. Invt. Journals")
- {
- ApplicationArea = Warehouse;
- Caption = 'Whse. Phys. Invt. Journals';
- RunObject = page "Whse. Phys. Invt. Journal";
- }
- }
- group("Group13")
- {
- Caption = 'Reports';
- action("Whse. Shipment Status1")
- {
- ApplicationArea = Warehouse;
- Caption = 'Whse. Shipment Status';
- RunObject = report "Whse. Shipment Status";
- }
-#if not CLEAN28
- action("Customer - List1")
- {
- ApplicationArea = Basic, Suite, Warehouse;
- Caption = 'Customer - List';
- RunObject = report "Customer - List";
- ObsoleteState = Pending;
- ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
- ObsoleteTag = '28.0';
- }
-#endif
- action("Customer - Labels")
- {
- ApplicationArea = Warehouse;
- Caption = 'Customer Labels';
- RunObject = report "Customer - Labels";
- }
- action("Whse. Phys. Inventory List")
- {
- ApplicationArea = Warehouse;
- Caption = 'Whse. Phys. Inventory List';
- RunObject = report "Whse. Phys. Inventory List";
- }
- action("Warehouse Register - Quantity")
- {
- ApplicationArea = Warehouse;
- Caption = 'Warehouse Register - Quantity';
- RunObject = report "Warehouse Register - Quantity";
- AccessByPermission = TableData "Location" = R;
- }
- action("Warehouse Bin List")
- {
- ApplicationArea = Warehouse;
- Caption = 'Warehouse Bin List';
- RunObject = report "Warehouse Bin List";
- }
- action("Whse. Adjustment Bin")
- {
- ApplicationArea = Warehouse;
- Caption = 'Whse. Adjustment Bin';
- RunObject = report "Whse. Adjustment Bin";
- AccessByPermission = TableData "Bin" = R;
- }
- action("Inventory Put-away List")
- {
- ApplicationArea = Warehouse;
- Caption = 'Inventory Put-away List';
- RunObject = report "Inventory Put-away List";
- AccessByPermission = TableData "Location" = R;
- }
- action("Warehouse Movement")
- {
- ApplicationArea = Warehouse;
- Caption = 'Warehouse Movement';
- RunObject = report "Movement List";
- AccessByPermission = TableData "Location" = R;
- }
- action("Whse. - Posted Receipt")
- {
- ApplicationArea = Warehouse;
- Caption = 'Whse. Posted Receipt';
- RunObject = report "Whse. - Posted Receipt";
- }
- action("Whse. - Posted Shipment")
- {
- ApplicationArea = Warehouse;
- Caption = 'Whse. Posted Shipment';
- RunObject = report "Whse. - Posted Shipment";
- }
- action("Whse. - Receipt")
- {
- ApplicationArea = Warehouse;
- Caption = 'Whse. Receipt';
- RunObject = report "Whse. - Receipt";
- }
- action("Whse. - Shipment")
- {
- ApplicationArea = Warehouse;
- Caption = 'Whse. Shipment';
- RunObject = report "Whse. - Shipment";
- }
- action("CMR - Transfer Shipment")
- {
- ApplicationArea = Warehouse;
- Caption = 'CMR - Transfer Shipment';
- RunObject = report "CMR - Transfer Shipment";
- }
- }
- }
- group("Group14")
- {
- Caption = 'Inventory';
- action("Phys. Invt. Counting Periods")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Physical Inventory Counting Periods';
- RunObject = page "Phys. Invt. Counting Periods";
- }
- action("Item Journal")
- {
- ApplicationArea = Warehouse;
- Caption = 'Item Journals';
- RunObject = page "Item Journal";
- }
- action("Item Reclass. Journals2")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Reclassification Journals';
- RunObject = page "Item Reclass. Journal";
- }
- action("Phys. Inventory Journals")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Physical Inventory Journals';
- RunObject = page "Phys. Inventory Journal";
- }
- action("Revaluation Journals")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Revaluation Journals';
- RunObject = page "Revaluation Journal";
- }
- group("Group15")
- {
- Caption = 'Setup';
- action("Inventory Setup")
- {
- ApplicationArea = Suite;
- Caption = 'Inventory Setup';
- RunObject = page "Inventory Setup";
- }
- action("Assembly Setup")
- {
- ApplicationArea = Assembly;
- Caption = 'Assembly Setup';
- RunObject = page "Assembly Setup";
- }
- action("ABC Analysis Setup")
- {
- ApplicationArea = Suite;
- Caption = 'ABC Analysis Setup';
- RunObject = page "ABC Analysis Setup";
- }
- action("Locations")
- {
- ApplicationArea = Location;
- Caption = 'Locations';
- RunObject = page "Location List";
- }
- action("Item Tracking Codes")
- {
- ApplicationArea = ItemTracking;
- Caption = 'Item Tracking Codes';
- RunObject = page "Item Tracking Codes";
- }
- action("Item Journal Templates")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Item Journal Templates';
- RunObject = page "Item Journal Templates";
- }
- action("Nonstock Item Setup")
- {
- ApplicationArea = Suite;
- Caption = 'Nonstock Item Setup';
- RunObject = page "Catalog Item Setup";
- }
- action("Transfer Routes")
- {
- ApplicationArea = Location;
- Caption = 'Transfer Routes';
- RunObject = page "Transfer Routes";
- }
- action("Create Stockkeeping Unit")
- {
- ApplicationArea = Warehouse;
- Caption = 'Create Stockkeeping Unit';
- RunObject = report "Create Stockkeeping Unit";
- }
- action("Report Selections Inventory")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Report Selections Inventory';
- RunObject = page "Report Selection - Inventory";
- }
- }
- group("Reports")
- {
- Caption = 'Reports';
- action("Inventory by Location")
- {
- ApplicationArea = InventoryAnalysis;
- Caption = 'Analyze Inventory by Location';
- RunObject = Query "Inventory by Location";
- ToolTip = 'Analyze (group, summarize, pivot) your Item Ledger Entries with related Location master data.';
- }
- }
- }
- group("Group16")
- {
- Caption = 'Assembly';
- action("Items1")
- {
- ApplicationArea = Assembly, Warehouse;
- Caption = 'Items';
- RunObject = page "Item List";
- }
- action("Resources")
- {
- ApplicationArea = Jobs;
- Caption = 'Resources';
- RunObject = page "Resource List";
- }
- action("Assembly Orders2")
- {
- ApplicationArea = Assembly;
- Caption = 'Assembly Orders';
- RunObject = page "Assembly Orders";
- }
- action("Orders3")
- {
- ApplicationArea = Assembly, Warehouse;
- Caption = 'Sales Orders';
- RunObject = page "Sales Order List";
- }
- action("Order Planning")
- {
- ApplicationArea = Planning;
- Caption = 'Order Planning';
- RunObject = page "Order Planning";
- }
- action("Planning Worksheets")
- {
- ApplicationArea = Planning;
- Caption = 'Planning Worksheets';
- RunObject = page "Planning Worksheet";
- }
- action("Assembly Setup1")
- {
- ApplicationArea = Assembly;
- Caption = 'Assembly Setup';
- RunObject = page "Assembly Setup";
- }
- group("Group17")
- {
- Caption = 'Posted Documents';
- action("Posted Assembly Orders1")
- {
- ApplicationArea = Assembly;
- Caption = 'Posted Assembly Orders';
- RunObject = page "Posted Assembly Orders";
- }
- }
- group("Group18")
- {
- Caption = 'Reports';
- action("Assemble to Order - Sales")
- {
- ApplicationArea = Assembly;
- Caption = 'Assemble to Order - Sales';
- RunObject = report "Assemble to Order - Sales";
- }
- action("Item - Able to Make (Timeline)")
- {
- ApplicationArea = Warehouse;
- Caption = 'Item - Able to Make (Timeline)';
- RunObject = report "Item - Able to Make (Timeline)";
- }
- action("BOM Cost Share Distribution")
- {
- ApplicationArea = Assembly;
- Caption = 'BOM Cost Share Distribution';
- RunObject = report "BOM Cost Share Distribution";
- }
- group("Group19")
- {
- Caption = 'Assembly BOM';
- action("Where-Used List")
- {
- ApplicationArea = Assembly;
- Caption = 'Where-Used List';
- RunObject = report "Where-Used List";
- }
- action("Assembly BOMs")
- {
- ApplicationArea = Assembly;
- Caption = 'Assembly BOMs';
- RunObject = report "Assembly BOMs";
- }
- action("Assembly BOM - Raw Materials")
- {
- ApplicationArea = Assembly;
- Caption = 'Assembly BOM - Raw Materials';
- RunObject = report "Assembly BOM - Raw Materials";
- }
- action("Assembly BOM - Sub-Assemblies")
- {
- ApplicationArea = Assembly;
- Caption = 'Assembly BOM - Subassemblies';
- RunObject = report "Assembly BOM - Subassemblies";
- }
- action("Assembly BOM - Finished Goods")
- {
- ApplicationArea = Assembly;
- Caption = 'Assembly BOM - End Items';
- RunObject = report "Assembly BOM - End Items";
- }
- }
- }
- }
- group("Group20")
- {
- Caption = 'Warehouse';
- action("Bin Types")
- {
- ApplicationArea = Warehouse;
- Caption = 'Bin Types';
- RunObject = page "Bin Types";
- AccessByPermission = TableData "Bin" = R;
- }
- action("Warehouse Classes")
- {
- ApplicationArea = Warehouse;
- Caption = 'Warehouse Classes';
- RunObject = page "Warehouse Classes";
- }
- action("Special Equipment")
- {
- ApplicationArea = Warehouse;
- Caption = 'Special Equipment';
- RunObject = page "Special Equipment";
- }
- action("Warehouse Employees")
- {
- ApplicationArea = Warehouse;
- Caption = 'Warehouse Employees';
- RunObject = page "Warehouse Employees";
- }
- action("Warehouse Setup")
- {
- ApplicationArea = Warehouse;
- Caption = 'Warehouse Setup';
- RunObject = page "Warehouse Setup";
- }
- action("Locations1")
- {
- ApplicationArea = Location;
- Caption = 'Locations';
- RunObject = page "Location List";
- }
- group("Group21")
- {
- Caption = 'Templates';
- action("Bin Templates")
- {
- ApplicationArea = Warehouse;
- Caption = 'Bin Templates';
- RunObject = page "Bin Templates";
- AccessByPermission = TableData "Bin" = R;
- }
- action("Put-away Templates")
- {
- ApplicationArea = Warehouse;
- Caption = 'Put-away Templates';
- RunObject = page "Put-away Template List";
- }
- action("Bin Creation Worksheet Templat")
- {
- ApplicationArea = Warehouse;
- Caption = 'Bin Creation Worksheet Templates';
- RunObject = page "Bin Creation Wksh. Templates";
- AccessByPermission = TableData "Bin" = R;
- }
- action("Whse. Journal Templates")
- {
- ApplicationArea = Warehouse;
- Caption = 'Whse. Journal Templates';
- RunObject = page "Whse. Journal Templates";
- }
- action("Whse. Worksheet Templates")
- {
- ApplicationArea = Warehouse;
- Caption = 'Whse. Worksheet Templates';
- RunObject = page "Whse. Worksheet Templates";
- }
- }
- group("Group22")
- {
- Caption = 'ADCS';
- action("ADCS Users")
- {
- ApplicationArea = Warehouse;
- Caption = 'ADCS Users';
- RunObject = page "ADCS Users";
- }
- action("Miniforms")
- {
- ApplicationArea = Warehouse;
- Caption = 'Miniforms';
- RunObject = page "Miniforms";
- }
- action("Miniform Functions Group")
- {
- ApplicationArea = Warehouse;
- Caption = 'Miniform Functions Group';
- RunObject = page "Functions";
- }
- }
- }
- }
- }
-}
diff --git a/src/Layers/NO/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al b/src/Layers/NO/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
index 6bcc4da187..8f76fe90d6 100644
--- a/src/Layers/NO/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
+++ b/src/Layers/NO/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
@@ -187,10 +187,10 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Sales Statistics';
RunObject = report "Sales Statistics";
- Tooltip = 'Run the Sales Statistics report.';
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
#endif
action("Team - Tasks")
@@ -263,10 +263,10 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer - List';
RunObject = report "Customer - List";
- Tooltip = 'Run the Customer - List report.';
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - List report.';
}
#endif
action("Customer - Labels")
@@ -274,12 +274,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Customer Labels';
RunObject = report "Customer - Labels";
+ Tooltip = 'Run the Customer Labels report.';
}
action("Customer - Balance to Date")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Balance to Date';
RunObject = report "Customer - Balance to Date";
+ Tooltip = 'Run the Customer - Balance to Date report.';
}
action("Customer - Order Summary")
{
@@ -300,6 +302,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Register';
RunObject = report "Customer Register";
+ Tooltip = 'Run the Customer Register report.';
}
action("Customer - Order Detail")
{
@@ -314,10 +317,10 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Top 10 List (Obsolete)';
RunObject = report "Customer - Top 10 List";
- Tooltip = 'Run the Customer Top 10 List report.';
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';
+ Tooltip = 'Run the Customer Top 10 List report.';
}
#endif
action("Customer - Trial Balance")
@@ -325,6 +328,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Trial Balance';
RunObject = report "Customer - Trial Balance";
+ Tooltip = 'Run the Customer Trial Balance report.';
}
#if not CLEAN28
action("Customer - Sales List")
@@ -332,10 +336,10 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer - Sales List';
RunObject = report "Customer - Sales List";
- Tooltip = 'Run the Customer - Sales List report.';
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
}
@@ -556,10 +560,10 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Reservation;
Caption = 'Sales Reservation Avail.';
RunObject = report "Sales Reservation Avail.";
- Tooltip = 'Run the Sales Reservation Avail. report.';
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Reservation Avail. report.';
}
action("Sales Order Picking List")
{
@@ -576,20 +580,20 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Sales Statistics';
RunObject = report "Sales Statistics";
- Tooltip = 'Run the Sales Statistics report.';
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
action("Customer - Sales List1")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Sales List';
RunObject = report "Customer - Sales List";
- Tooltip = 'Run the Customer - Sales List report.';
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
action("EC Sales List")
@@ -884,8 +888,8 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Coupled Data Synchronization Errors';
RunObject = page "CRM Skipped Records";
- Tooltip = 'Open the Coupled Data Synchronization Errors page.';
AccessByPermission = TableData "CRM Integration Record" = R;
+ Tooltip = 'Open the Coupled Data Synchronization Errors page.';
}
}
group("Group16")
diff --git a/src/Layers/NO/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al b/src/Layers/NO/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
index 4206833c67..520a8e018a 100644
--- a/src/Layers/NO/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
+++ b/src/Layers/NO/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
@@ -72,53 +72,53 @@ page 9001 "Accounting Manager Role Center"
{
area(rolecenter)
{
- part(Control1902304208; "Account Manager Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part(Control99; "Finance Performance")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control103; "Trailing Sales Orders Chart")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control106; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control100; "Cash Flow Forecast Chart")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1907692008; "My Customers")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1902476008; "My Vendors")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control108; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- systempart(Control1901377608; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
+ part(Control1902304208; "Account Manager Activities")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part("User Tasks Activities"; "User Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part(Control99; "Finance Performance")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control103; "Trailing Sales Orders Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control106; "My Job Queue")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control100; "Cash Flow Forecast Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1907692008; "My Customers")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1902476008; "My Vendors")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control108; "Report Inbox Part")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ systempart(Control1901377608; MyNotes)
+ {
+ ApplicationArea = Basic, Suite;
+ }
}
}
diff --git a/src/Layers/NO/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/NO/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index 4674630b26..9224dbf51a 100644
--- a/src/Layers/NO/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/NO/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -96,7 +96,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
diff --git a/src/Layers/NO/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al b/src/Layers/NO/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
index eef598e9f9..816be6329a 100644
--- a/src/Layers/NO/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
+++ b/src/Layers/NO/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
@@ -203,12 +203,6 @@ page 8900 "Administrator Main Role Center"
RunObject = page "Config Templates";
Tooltip = 'Open the Customer/Vendor/Item Templates page.';
}
- //action("Setup and Help Resources")
- //{
- // ApplicationArea = Basic, Suite;
- // Caption = 'Setup and Help Resources';
- // RunObject = page 1822;
- //}
action("Transformation Rules")
{
ApplicationArea = Basic, Suite;
@@ -373,12 +367,6 @@ page 8900 "Administrator Main Role Center"
RunObject = page "Code Coverage";
Tooltip = 'Open the Code Coverage page.';
}
- // action("Sessions")
- // {
- // ApplicationArea = All;
- // Caption = 'Sessions';
- // RunObject = codeunit 9500;
- // }
}
action("Feature Management")
{
@@ -467,7 +455,6 @@ page 8900 "Administrator Main Role Center"
Caption = 'Data Encryption Management';
RunObject = page "Data Encryption Management";
Tooltip = 'Open the Data Encryption Management page.';
- // AccessByPermission = 'System 5420=X';
}
action("Data Classification Worksheet")
{
@@ -648,12 +635,6 @@ page 8900 "Administrator Main Role Center"
RunObject = page "User Setup";
Tooltip = 'Open the User Setup page.';
}
- // action("Change Password")
- // {
- // ApplicationArea = Basic, Suite;
- // Caption = 'Change Password';
- // RunObject = page ;
- // }
action("User Security Status")
{
ApplicationArea = Basic, Suite;
@@ -896,12 +877,6 @@ page 8900 "Administrator Main Role Center"
RunObject = page "Web Services";
Tooltip = 'Open the Web Services page.';
}
- //action("Bank Data Conv. Service Setup")
- //{
- // ApplicationArea = Basic, Suite;
- // Caption = 'Bank Data Conv. Service Setup';
- // RunObject = page 1260;
- //}
action("Microsoft Dynamics 365 Connection Setup")
{
ApplicationArea = Suite;
diff --git a/src/Layers/NO/BaseApp/Sales/Customer/Customer.Table.al b/src/Layers/NO/BaseApp/Sales/Customer/Customer.Table.al
index 4843dc5996..c48c28e46a 100644
--- a/src/Layers/NO/BaseApp/Sales/Customer/Customer.Table.al
+++ b/src/Layers/NO/BaseApp/Sales/Customer/Customer.Table.al
@@ -2497,6 +2497,7 @@ table 18 Customer
UpdateReferencedIds();
SetLastModifiedDateTime();
if IsContactUpdateNeeded() then begin
+ OnBeforeModifyContactUpdate(Rec);
Modify();
UpdateContFromCust.OnModify(Rec);
if not Find() then begin
@@ -2506,6 +2507,11 @@ table 18 Customer
end;
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnBeforeModifyContactUpdate(var Customer: Record Customer)
+ begin
+ end;
+
trigger OnRename()
var
IsHandled: Boolean;
diff --git a/src/Layers/NO/BaseApp/Sales/Customer/CustomerTempl.Table.al b/src/Layers/NO/BaseApp/Sales/Customer/CustomerTempl.Table.al
index 9a0c56b5ab..4a7c6139ae 100644
--- a/src/Layers/NO/BaseApp/Sales/Customer/CustomerTempl.Table.al
+++ b/src/Layers/NO/BaseApp/Sales/Customer/CustomerTempl.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -920,4 +920,5 @@ table 1381 "Customer Templ."
local procedure OnCopyTemplateOnBeforeModify(SourceCustomerTempl: Record "Customer Templ."; SavedCustomerTempl: Record "Customer Templ."; var CustomerTempl: Record "Customer Templ.")
begin
end;
+
}
diff --git a/src/Layers/NO/BaseApp/Sales/Document/SalesHeader.Table.al b/src/Layers/NO/BaseApp/Sales/Document/SalesHeader.Table.al
index ae96fcb30d..4cbf820bab 100644
--- a/src/Layers/NO/BaseApp/Sales/Document/SalesHeader.Table.al
+++ b/src/Layers/NO/BaseApp/Sales/Document/SalesHeader.Table.al
@@ -332,6 +332,7 @@ table 36 "Sales Header"
Validate("Payment Terms Code");
Validate("Prepmt. Payment Terms Code");
Validate("Payment Method Code");
+ OnAfterValidateBillToCustomerPaymentFields(Rec);
Validate("Prepayment %");
if (xRec."Sell-to Customer No." = "Sell-to Customer No.") and
@@ -6543,8 +6544,7 @@ table 36 "Sales Header"
/// The number of the sales document.
/// The shipping advice for the sales document.
/// True if there is a conflict, otherwise false.
- procedure InventoryPickConflict(DocType: Enum "Sales Document Type"; DocNo: Code[20];
- ShippingAdvice: Enum "Sales Header Shipping Advice"): Boolean
+ procedure InventoryPickConflict(DocType: Enum "Sales Document Type"; DocNo: Code[20]; ShippingAdvice: Enum "Sales Header Shipping Advice"): Boolean
var
WarehouseActivityLine: Record "Warehouse Activity Line";
SalesLine2: Record "Sales Line";
@@ -6572,8 +6572,7 @@ table 36 "Sales Header"
/// The number of the sales document.
/// The shipping advice for the sales document.
/// True if there is a conflict, otherwise false.
- procedure WhseShipmentConflict(DocType: Enum "Sales Document Type"; DocNo: Code[20];
- ShippingAdvice: Enum "Sales Header Shipping Advice"): Boolean
+ procedure WhseShipmentConflict(DocType: Enum "Sales Document Type"; DocNo: Code[20]; ShippingAdvice: Enum "Sales Header Shipping Advice"): Boolean
var
WarehouseShipmentLine: Record "Warehouse Shipment Line";
begin
@@ -10447,6 +10446,11 @@ table 36 "Sales Header"
begin
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnAfterValidateBillToCustomerPaymentFields(var SalesHeader: Record "Sales Header")
+ begin
+ end;
+
///
/// Raised after extended text is transferred for sales line recreation.
///
diff --git a/src/Layers/RU/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al b/src/Layers/RU/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
index f7934ae03e..2f607b0120 100644
--- a/src/Layers/RU/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
+++ b/src/Layers/RU/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
@@ -274,12 +274,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Customer Labels';
RunObject = report "Customer - Labels";
+ Tooltip = 'Run the Customer Labels report.';
}
action("Customer - Balance to Date")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Balance to Date';
RunObject = report "Customer - Balance to Date";
+ Tooltip = 'Run the Customer - Balance to Date report.';
}
action("Customer - Order Summary")
{
@@ -300,6 +302,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Register';
RunObject = report "Customer Register";
+ Tooltip = 'Run the Customer Register report.';
}
action("Customer - Order Detail")
{
@@ -325,6 +328,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Trial Balance';
RunObject = report "Customer - Trial Balance";
+ Tooltip = 'Run the Customer Trial Balance report.';
}
#if not CLEAN28
action("Customer - Sales List")
diff --git a/src/Layers/RU/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al b/src/Layers/RU/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
index 89e6e43ef8..20f5e0f902 100644
--- a/src/Layers/RU/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
+++ b/src/Layers/RU/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
@@ -71,53 +71,53 @@ page 9001 "Accounting Manager Role Center"
{
area(rolecenter)
{
- part(Control1902304208; "Account Manager Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part(Control99; "Finance Performance")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control103; "Trailing Sales Orders Chart")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control106; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control100; "Cash Flow Forecast Chart")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1907692008; "My Customers")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1902476008; "My Vendors")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control108; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- systempart(Control1901377608; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
+ part(Control1902304208; "Account Manager Activities")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part("User Tasks Activities"; "User Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part(Control99; "Finance Performance")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control103; "Trailing Sales Orders Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control106; "My Job Queue")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control100; "Cash Flow Forecast Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1907692008; "My Customers")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1902476008; "My Vendors")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control108; "Report Inbox Part")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ systempart(Control1901377608; MyNotes)
+ {
+ ApplicationArea = Basic, Suite;
+ }
}
}
diff --git a/src/Layers/RU/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/RU/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index 047d425108..9b7a7c71ba 100644
--- a/src/Layers/RU/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/RU/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -96,7 +96,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
@@ -1480,9 +1479,9 @@ page 8901 "Finance Manager Role Center"
action("Invoices")
{
ApplicationArea = Basic, Suite;
- Caption = 'Invoices';
+ Caption = 'Sales Invoices';
RunObject = page "Sales Invoice List";
- Tooltip = 'Open the Invoices page.';
+ Tooltip = 'Open the Sales Invoices page.';
}
action("Credit Memos")
{
diff --git a/src/Layers/RU/BaseApp/HumanResources/Employee/Employee.Table.al b/src/Layers/RU/BaseApp/HumanResources/Employee/Employee.Table.al
index 9f75cfa370..d2ea24322a 100644
--- a/src/Layers/RU/BaseApp/HumanResources/Employee/Employee.Table.al
+++ b/src/Layers/RU/BaseApp/HumanResources/Employee/Employee.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -40,6 +40,7 @@ table 5200 Employee
{
Caption = 'No.';
ToolTip = 'Specifies the number of the involved entry or record, according to the specified number series.';
+
trigger OnValidate()
begin
if "No." <> xRec."No." then begin
diff --git a/src/Layers/RU/BaseApp/Purchases/Document/PurchaseQuote.Page.al b/src/Layers/RU/BaseApp/Purchases/Document/PurchaseQuote.Page.al
index 53b228da75..98432d1848 100644
--- a/src/Layers/RU/BaseApp/Purchases/Document/PurchaseQuote.Page.al
+++ b/src/Layers/RU/BaseApp/Purchases/Document/PurchaseQuote.Page.al
@@ -1628,6 +1628,13 @@ page 49 "Purchase Quote"
OnAfterActivateFields();
end;
+ local procedure SetPurchaseLinesAvailability()
+ begin
+ IsPurchaseLinesEditable := Rec.PurchaseLinesEditable();
+
+ OnAfterSetPurchaseLinesAvailability(Rec, IsPurchaseLinesEditable);
+ end;
+
local procedure ApproveCalcInvDisc()
begin
CurrPage.PurchLines.PAGE.ApproveCalcInvDisc();
@@ -1682,7 +1689,7 @@ page 49 "Purchase Quote"
WorkflowWebhookManagement.GetCanRequestAndCanCancel(Rec.RecordId, CanRequestApprovalForFlow, CanCancelApprovalForFlow);
HasIncomingDocument := Rec."Incoming Document Entry No." <> 0;
- IsPurchaseLinesEditable := Rec.PurchaseLinesEditable();
+ SetPurchaseLinesAvailability();
end;
local procedure ValidateShippingOption()
@@ -1737,6 +1744,11 @@ page 49 "Purchase Quote"
begin
end;
+ [IntegrationEvent(true, false)]
+ local procedure OnAfterSetPurchaseLinesAvailability(var PurchaseHeader: Record "Purchase Header"; var PurchaseLinesAvailable: Boolean)
+ begin
+ end;
+
[IntegrationEvent(false, false)]
local procedure OnBeforeValidateShipToOptions(var PurchaseHeader: Record "Purchase Header"; ShipToOptions: Option)
begin
diff --git a/src/Layers/RU/BaseApp/Sales/Customer/Customer.Table.al b/src/Layers/RU/BaseApp/Sales/Customer/Customer.Table.al
index 3b47a1919c..173005f584 100644
--- a/src/Layers/RU/BaseApp/Sales/Customer/Customer.Table.al
+++ b/src/Layers/RU/BaseApp/Sales/Customer/Customer.Table.al
@@ -2698,6 +2698,7 @@ table 18 Customer
UpdateReferencedIds();
SetLastModifiedDateTime();
if IsContactUpdateNeeded() then begin
+ OnBeforeModifyContactUpdate(Rec);
Modify();
UpdateContFromCust.OnModify(Rec);
if not Find() then begin
@@ -2707,6 +2708,11 @@ table 18 Customer
end;
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnBeforeModifyContactUpdate(var Customer: Record Customer)
+ begin
+ end;
+
trigger OnRename()
var
IsHandled: Boolean;
diff --git a/src/Layers/RU/BaseApp/Sales/Customer/CustomerBankAccount.Table.al b/src/Layers/RU/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
index d65f327f51..5834f4b749 100644
--- a/src/Layers/RU/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
+++ b/src/Layers/RU/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
@@ -1,4 +1,4 @@
-// ------------------------------------------------------------------------------------------------
+// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
@@ -554,4 +554,5 @@ table 287 "Customer Bank Account"
local procedure OnBeforeValidatePostCode(var CustomerBankAccount: Record "Customer Bank Account"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
begin
end;
+
}
diff --git a/src/Layers/RU/BaseApp/Sales/Document/SalesHeader.Table.al b/src/Layers/RU/BaseApp/Sales/Document/SalesHeader.Table.al
index b5f88f8f21..71ebd1a79a 100644
--- a/src/Layers/RU/BaseApp/Sales/Document/SalesHeader.Table.al
+++ b/src/Layers/RU/BaseApp/Sales/Document/SalesHeader.Table.al
@@ -339,6 +339,7 @@ table 36 "Sales Header"
Validate("Payment Terms Code");
Validate("Prepmt. Payment Terms Code");
Validate("Payment Method Code");
+ OnAfterValidateBillToCustomerPaymentFields(Rec);
Validate("Prepayment %");
if (xRec."Sell-to Customer No." = "Sell-to Customer No.") and
@@ -10875,6 +10876,11 @@ table 36 "Sales Header"
begin
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnAfterValidateBillToCustomerPaymentFields(var SalesHeader: Record "Sales Header")
+ begin
+ end;
+
///
/// Raised after extended text is transferred for sales line recreation.
///
diff --git a/src/Layers/SE/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/SE/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index 9201ca9c84..cd1fe38165 100644
--- a/src/Layers/SE/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/SE/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -96,7 +96,6 @@ using System.Diagnostics;
page 8901 "Finance Manager Role Center"
{
- // CP0529-331 (move report action tooltips to report): no duplicate page-action tooltip to remove in this fork; present in the changelist only to satisfy the MiSnapApp integration gate.
Caption = 'Finance Manager Role Center';
PageType = RoleCenter;
actions
@@ -2534,7 +2533,7 @@ page 8901 "Finance Manager Role Center"
action("General Business")
{
ApplicationArea = Basic, Suite;
- Caption = 'Gen. Business Posting Groups';
+ Caption = 'General Business Posting Groups';
RunObject = page "Gen. Business Posting Groups";
Tooltip = 'Open the Gen. Business Posting Groups page.';
}
diff --git a/src/Layers/SE/BaseApp/Sales/Document/SalesHeader.Table.al b/src/Layers/SE/BaseApp/Sales/Document/SalesHeader.Table.al
index 0a6aed9c4a..9a2811cb20 100644
--- a/src/Layers/SE/BaseApp/Sales/Document/SalesHeader.Table.al
+++ b/src/Layers/SE/BaseApp/Sales/Document/SalesHeader.Table.al
@@ -328,6 +328,7 @@ table 36 "Sales Header"
Validate("Payment Terms Code");
Validate("Prepmt. Payment Terms Code");
Validate("Payment Method Code");
+ OnAfterValidateBillToCustomerPaymentFields(Rec);
Validate("Prepayment %");
if (xRec."Sell-to Customer No." = "Sell-to Customer No.") and
@@ -10385,6 +10386,11 @@ table 36 "Sales Header"
begin
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnAfterValidateBillToCustomerPaymentFields(var SalesHeader: Record "Sales Header")
+ begin
+ end;
+
///
/// Raised after extended text is transferred for sales line recreation.
///
diff --git a/src/Layers/W1/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al b/src/Layers/W1/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
index 693539a268..2ad4139183 100644
--- a/src/Layers/W1/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
+++ b/src/Layers/W1/BaseApp/CRM/RoleCenters/SalesMarketingManagerRC.Page.al
@@ -64,36 +64,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Salespeople")
{
ApplicationArea = Suite;
Caption = 'Salespeople/Purchasers';
RunObject = page "Salespersons/Purchasers";
+ Tooltip = 'Open the Salespeople/Purchasers page.';
}
action("Teams")
{
ApplicationArea = Basic, Suite;
Caption = 'Teams';
RunObject = page "Teams";
+ Tooltip = 'Open the Teams page.';
}
action("Tasks")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Opportunities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
group("Group1")
{
@@ -103,36 +109,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesBudget;
Caption = 'Sales Budgets';
RunObject = page "Budget Names Sales";
+ Tooltip = 'Open the Sales Budgets page.';
}
action("Sales Analysis Reports")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Reports';
RunObject = page "Analysis Report Sale";
+ Tooltip = 'Open the Sales Analysis Reports page.';
}
action("Sales Analysis by Dimensions")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Item Dimensions - Detail")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Detail';
RunObject = report "Item Dimensions - Detail";
+ Tooltip = 'Run the Item Dimensions - Detail report.';
}
action("Item Dimensions - Total")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Total';
RunObject = report "Item Dimensions - Total";
+ Tooltip = 'Run the Item Dimensions - Total report.';
}
action("Opportunities Matrix")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Analysis';
RunObject = page "Opportunities";
+ Tooltip = 'Open the Opportunity Analysis page.';
}
}
group("Group2")
@@ -143,6 +155,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Deferral Summary';
RunObject = report "Deferral Summary - Sales";
+ Tooltip = 'Run the Sales Deferral Summary report.';
}
group("Group3")
{
@@ -152,18 +165,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Tasks';
RunObject = report "Salesperson - Tasks";
+ Tooltip = 'Run the Salesperson Tasks report.';
}
action("Salesperson - Commission")
{
ApplicationArea = Suite;
Caption = 'Salesperson Commission';
RunObject = report "Salesperson - Commission";
+ Tooltip = 'Run the Salesperson Commission report.';
}
action("Salesperson - Opportunities")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Opportunities';
RunObject = report "Salesperson - Opportunities";
+ Tooltip = 'Run the Salesperson Opportunities report.';
}
#if not CLEAN28
action("Sales Statistics")
@@ -174,6 +190,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
#endif
action("Team - Tasks")
@@ -181,12 +198,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Team Tasks';
RunObject = report "Team - Tasks";
+ Tooltip = 'Run the Team Tasks report.';
}
action("Salesperson - Sales Statistics")
{
ApplicationArea = Basic, Suite;
Caption = 'Salesperson Sales Statistics';
RunObject = report "Salesperson - Sales Statistics";
+ Tooltip = 'Run the Salesperson Sales Statistics report.';
}
}
group("Group4")
@@ -197,36 +216,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Contact Labels';
RunObject = report "Contact - Labels";
+ Tooltip = 'Run the Contact Labels report.';
}
action("Contact - Company Summary")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact - Company Summary';
RunObject = report "Contact - Company Summary";
+ Tooltip = 'Run the Contact - Company Summary report.';
}
action("Questionnaire - Handouts")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire - Handouts';
RunObject = report "Questionnaire - Handouts";
+ Tooltip = 'Run the Questionnaire - Handouts report.';
}
action("Contact - List")
{
ApplicationArea = Basic, Suite;
Caption = 'Contact List';
RunObject = report "Contact - List";
+ Tooltip = 'Run the Contact List report.';
}
action("Orgl. Profile Summary")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Person Summary';
RunObject = report "Contact - Person Summary";
+ Tooltip = 'Run the Contact - Person Summary report.';
}
action("Contact - Cover Sheet")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Contact - Cover Sheet';
RunObject = report "Contact - Cover Sheet";
+ Tooltip = 'Run the Contact - Cover Sheet report.';
}
}
group("Group5")
@@ -241,6 +266,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - List report.';
}
#endif
action("Customer - Labels")
@@ -248,36 +274,42 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Customer Labels';
RunObject = report "Customer - Labels";
+ Tooltip = 'Run the Customer Labels report.';
}
action("Customer - Balance to Date")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Balance to Date';
RunObject = report "Customer - Balance to Date";
+ Tooltip = 'Run the Customer - Balance to Date report.';
}
action("Customer - Order Summary")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Summary';
RunObject = report "Customer - Order Summary";
+ Tooltip = 'Run the Customer - Order Summary report.';
}
action("Customer/Item Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Item Sales';
RunObject = report "Customer/Item Sales";
+ Tooltip = 'Run the Customer/Item Sales report.';
}
action("Customer Register")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Register';
RunObject = report "Customer Register";
+ Tooltip = 'Run the Customer Register report.';
}
action("Customer - Order Detail")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Detail';
RunObject = report "Customer - Order Detail";
+ Tooltip = 'Run the Customer - Order Detail report.';
}
#if not CLEAN28
action("Customer - Top 10 List")
@@ -288,6 +320,7 @@ page 8907 "Sales & Marketing Manager RC"
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';
+ Tooltip = 'Run the Customer Top 10 List report.';
}
#endif
action("Customer - Trial Balance")
@@ -295,6 +328,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Trial Balance';
RunObject = report "Customer - Trial Balance";
+ Tooltip = 'Run the Customer Trial Balance report.';
}
#if not CLEAN28
action("Customer - Sales List")
@@ -305,6 +339,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
}
@@ -316,18 +351,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - List';
RunObject = report "Opportunity - List";
+ Tooltip = 'Run the Opportunity - List report.';
}
action("Opportunity - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity - Details';
RunObject = report "Opportunity - Details";
+ Tooltip = 'Run the Opportunity - Details report.';
}
action("Sales Cycle - Analysis")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycle - Analysis';
RunObject = report "Sales Cycle - Analysis";
+ Tooltip = 'Run the Sales Cycle - Analysis report.';
}
}
}
@@ -340,60 +378,70 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customers';
RunObject = page "Customer List";
+ Tooltip = 'Open the Customers page.';
}
action("Contacts1")
{
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Quotes")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quotes';
RunObject = page "Sales Quotes";
+ Tooltip = 'Open the Sales Quotes page.';
}
action("Orders")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Orders';
RunObject = page "Sales Order List";
+ Tooltip = 'Open the Sales Orders page.';
}
action("Blanket Orders")
{
ApplicationArea = Suite;
Caption = 'Blanket Sales Orders';
RunObject = page "Blanket Sales Orders";
+ Tooltip = 'Open the Blanket Sales Orders page.';
}
action("Return Orders")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Sales Return Orders';
RunObject = page "Sales Return Order List";
+ Tooltip = 'Open the Sales Return Orders page.';
}
action("Invoices")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Invoices';
RunObject = page "Sales Invoice List";
+ Tooltip = 'Open the Sales Invoices page.';
}
action("Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Credit Memos';
RunObject = page "Sales Credit Memos";
+ Tooltip = 'Open the Sales Credit Memos page.';
}
action("Certificates of Supply")
{
ApplicationArea = Basic, Suite;
Caption = 'Certificates of Supply';
RunObject = page "Certificates of Supply";
+ Tooltip = 'Open the Certificates of Supply page.';
}
action("Order Planning")
{
ApplicationArea = Planning;
Caption = 'Order Planning';
RunObject = page "Order Planning";
+ Tooltip = 'Open the Order Planning page.';
}
group("Group8")
{
@@ -403,24 +451,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Invoices';
RunObject = page "Posted Sales Invoices";
+ Tooltip = 'Open the Posted Sales Invoices page.';
}
action("Posted Sales Shipments")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Shipments';
RunObject = page "Posted Sales Shipments";
+ Tooltip = 'Open the Posted Sales Shipments page.';
}
action("Posted Credit Memos")
{
ApplicationArea = Basic, Suite;
Caption = 'Posted Sales Credit Memos';
RunObject = page "Posted Sales Credit Memos";
+ Tooltip = 'Open the Posted Sales Credit Memos page.';
}
action("Posted Return Receipts")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Posted Return Receipts';
RunObject = page "Posted Return Receipts";
+ Tooltip = 'Open the Posted Return Receipts page.';
}
}
group("Group9")
@@ -431,48 +483,56 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'G/L Registers';
RunObject = page "G/L Registers";
+ Tooltip = 'Open the G/L Registers page.';
}
action("Item Tracing")
{
ApplicationArea = ItemTracking;
Caption = 'Item Tracing';
RunObject = page "Item Tracing";
+ Tooltip = 'Open the Item Tracing page.';
}
action("Sales Quote Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Quote Archives';
RunObject = page "Sales Quote Archives";
+ Tooltip = 'Open the Sales Quote Archives page.';
}
action("Sales Order Archive")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Order Archives';
RunObject = page "Sales Order Archives";
+ Tooltip = 'Open the Sales Order Archives page.';
}
action("Sales Return Order Archives")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales Return Order Archives';
RunObject = page "Sales Return List Archive";
+ Tooltip = 'Open the Sales Return Order Archives page.';
}
action("Customer Ledger Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Ledger Entries';
RunObject = page "Customer Ledger Entries";
+ Tooltip = 'Open the Customer Ledger Entries page.';
}
action("Detailed Cust. Ledg. Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Detailed Customer Ledger Entries';
RunObject = page "Detailed Cust. Ledg. Entries";
+ Tooltip = 'Open the Detailed Customer Ledger Entries page.';
}
action("Value Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Value Entries';
RunObject = page "Value Entries";
+ Tooltip = 'Open the Value Entries page.';
}
action("Navigate")
{
@@ -492,6 +552,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Detail';
RunObject = report "Customer - Order Detail";
+ Tooltip = 'Run the Customer - Order Detail report.';
}
#if not CLEAN28
action("Sales Reservation Avail.")
@@ -502,6 +563,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Reservation Avail. report.';
}
#endif
#if not CLEAN28
@@ -513,6 +575,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Sales Statistics report.';
}
#endif
#if not CLEAN28
@@ -524,6 +587,7 @@ page 8907 "Sales & Marketing Manager RC"
ObsoleteState = Pending;
ObsoleteReason = 'This report is obsolete and will be removed in a future version.';
ObsoleteTag = '28.0';
+ Tooltip = 'Run the Customer - Sales List report.';
}
#endif
action("EC Sales List")
@@ -531,18 +595,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'EC Sales List';
RunObject = report "EC Sales List";
+ Tooltip = 'Run the EC Sales List report.';
}
action("Customer/Item Sales1")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Item Sales';
RunObject = report "Customer/Item Sales";
+ Tooltip = 'Run the Customer/Item Sales report.';
}
action("Customer - Order Summary1")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer - Order Summary';
RunObject = report "Customer - Order Summary";
+ Tooltip = 'Run the Customer - Order Summary report.';
}
}
}
@@ -554,42 +621,49 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Contacts';
RunObject = page "Contact List";
+ Tooltip = 'Open the Contacts page.';
}
action("Campaigns")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaigns';
RunObject = page "Campaign List";
+ Tooltip = 'Open the Campaigns page.';
}
action("Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Segments';
RunObject = page "Segment List";
+ Tooltip = 'Open the Segments page.';
}
action("Logged Segments")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Logged Segments';
RunObject = page "Logged Segments";
+ Tooltip = 'Open the Logged Segments page.';
}
action("Opportunities1")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunities';
RunObject = page "Opportunity List";
+ Tooltip = 'Open the Opportunities page.';
}
action("Tasks1")
{
ApplicationArea = Basic, Suite;
Caption = 'Tasks';
RunObject = page "Tasks";
+ Tooltip = 'Open the Tasks page.';
}
action("Campaign - Details")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign - Details';
RunObject = report "Campaign - Details";
+ Tooltip = 'Run the Campaign - Details report.';
}
group("Group12")
{
@@ -599,18 +673,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Entries';
RunObject = page "Campaign Entries";
+ Tooltip = 'Open the Campaign Entries page.';
}
action("Opportunity Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Opportunity Entries';
RunObject = page "Opportunity Entries";
+ Tooltip = 'Open the Opportunity Entries page.';
}
action("Interaction Log Entries")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Log Entries';
RunObject = page "Interaction Log Entries";
+ Tooltip = 'Open the Interaction Log Entries page.';
}
}
}
@@ -622,18 +699,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Items';
RunObject = page "Item List";
+ Tooltip = 'Open the Items page.';
}
action("Nonstock Items")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Items';
RunObject = page "Catalog Item List";
+ Tooltip = 'Open the Nonstock Items page.';
}
action("Item Attributes")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Attributes';
RunObject = page "Item Attributes";
+ Tooltip = 'Open the Item Attributes page.';
}
action("Sales Price Worksheet")
{
@@ -647,6 +727,7 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Adjust Item Costs/Prices';
RunObject = report "Adjust Item Costs/Prices";
+ Tooltip = 'Run the Adjust Item Costs/Prices report.';
}
group("Group14")
{
@@ -656,42 +737,49 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Inventory Sales Statistics';
RunObject = report "Inventory - Sales Statistics";
+ Tooltip = 'Run the Inventory Sales Statistics report.';
}
action("Inventory Cost and Price List")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Cost and Price List';
RunObject = report "Inventory Cost and Price List";
+ Tooltip = 'Run the Inventory Cost and Price List report.';
}
action("Item Charges - Specification")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Charges - Specification';
RunObject = report "Item Charges - Specification";
+ Tooltip = 'Run the Item Charges - Specification report.';
}
action("Inventory - Customer Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Customer Sales';
RunObject = report "Inventory - Customer Sales";
+ Tooltip = 'Run the Inventory Customer Sales report.';
}
action("Nonstock Item Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Sales';
RunObject = report "Catalog Item Sales";
+ Tooltip = 'Run the Nonstock Item Sales report.';
}
action("Inventory Availability")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Availability';
RunObject = report "Inventory Availability";
+ Tooltip = 'Run the Inventory Availability report.';
}
action("Inventory Order Details")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Order Details';
RunObject = report "Inventory Order Details";
+ Tooltip = 'Run the Inventory Order Details report.';
}
action("Price List")
{
@@ -705,18 +793,21 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Inventory - Sales Back Orders';
RunObject = report "Inventory - Sales Back Orders";
+ Tooltip = 'Run the Inventory - Sales Back Orders report.';
}
action("Inventory - Top 10 List")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Top 10 List';
RunObject = report "Inventory - Top 10 List";
+ Tooltip = 'Run the Inventory Top 10 List report.';
}
action("Item Substitutions")
{
ApplicationArea = Suite;
Caption = 'Item Substitutions';
RunObject = report "Item Substitutions";
+ Tooltip = 'Run the Item Substitutions report.';
}
}
}
@@ -728,54 +819,63 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Suite;
Caption = 'Sales Orders - Dynamics 365 Sales';
RunObject = page "CRM Sales Order List";
+ Tooltip = 'Open the Sales Orders - Dynamics 365 Sales page.';
}
action("Quotes - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Quotes - Dynamics 365 Sales';
RunObject = page "CRM Sales Quote List";
+ Tooltip = 'Open the Quotes - Dynamics 365 Sales page.';
}
action("Cases - Dynamics 365 for Customer Service")
{
ApplicationArea = Suite;
Caption = 'Cases - Dynamics 365 for Customer Service';
RunObject = page "CRM Case List";
+ Tooltip = 'Open the Cases - Dynamics 365 for Customer Service page.';
}
action("Opportunities - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Opportunities - Dynamics 365 Sales';
RunObject = page "CRM Opportunity List";
+ Tooltip = 'Open the Opportunities - Dynamics 365 Sales page.';
}
action("Accounts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Accounts - Dynamics 365 Sales';
RunObject = page "CRM Account List";
+ Tooltip = 'Open the Accounts - Dynamics 365 Sales page.';
}
action("Transaction Currencies - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Transaction Currencies - Dynamics 365 Sales';
RunObject = page "CRM TransactionCurrency List";
+ Tooltip = 'Open the Transaction Currencies - Dynamics 365 Sales page.';
}
action("Unit Groups - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Unit Groups - Dynamics 365 Sales';
RunObject = page "CRM UnitGroup List";
+ Tooltip = 'Open the Unit Groups - Dynamics 365 Sales page.';
}
action("Products - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Products - Dynamics 365 Sales';
RunObject = page "CRM Product List";
+ Tooltip = 'Open the Products - Dynamics 365 Sales page.';
}
action("Contacts - Dynamics 365 for Sales")
{
ApplicationArea = Suite;
Caption = 'Contacts - Dynamics 365 Sales';
RunObject = page "CRM Contact List";
+ Tooltip = 'Open the Contacts - Dynamics 365 Sales page.';
}
action("Records Skipped For Synchronization")
{
@@ -783,6 +883,7 @@ page 8907 "Sales & Marketing Manager RC"
Caption = 'Coupled Data Synchronization Errors';
RunObject = page "CRM Skipped Records";
AccessByPermission = TableData "CRM Integration Record" = R;
+ Tooltip = 'Open the Coupled Data Synchronization Errors page.';
}
}
group("Group16")
@@ -793,66 +894,77 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = OrderPromising;
Caption = 'Order Promising Setup';
RunObject = page "Order Promising Setup";
+ Tooltip = 'Open the Order Promising Setup page.';
}
action("Sales & Receivables Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Sales & Receivables Setup';
RunObject = page "Sales & Receivables Setup";
+ Tooltip = 'Open the Sales & Receivables Setup page.';
}
action("report Selection Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Sales';
RunObject = page "Report Selection - Sales";
+ Tooltip = 'Open the Report Selections Sales page.';
}
action("Standard Sales Codes")
{
ApplicationArea = Suite;
Caption = 'Standard Sales Codes';
RunObject = page "Standard Sales Codes";
+ Tooltip = 'Open the Standard Sales Codes page.';
}
action("Payment Terms")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Terms';
RunObject = page "Payment Terms";
+ Tooltip = 'Open the Payment Terms page.';
}
action("Payment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Methods';
RunObject = page "Payment Methods";
+ Tooltip = 'Open the Payment Methods page.';
}
action("Item Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Shipment Methods")
{
ApplicationArea = Basic, Suite;
Caption = 'Shipment Methods';
RunObject = page "Shipment Methods";
+ Tooltip = 'Open the Shipment Methods page.';
}
action("Shipping Agents")
{
ApplicationArea = Suite;
Caption = 'Shipping Agents';
RunObject = page "Shipping Agents";
+ Tooltip = 'Open the Shipping Agents page.';
}
action("Return Reasons")
{
ApplicationArea = SalesReturnOrder;
Caption = 'Return Reasons';
RunObject = page "Return Reasons";
+ Tooltip = 'Open the Return Reasons page.';
}
action("Customer Templates")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Customer Templates';
RunObject = page "Customer Templ. List";
+ Tooltip = 'Open the Customer Templates page.';
}
group("Group17")
{
@@ -862,24 +974,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = SalesAnalysis, PurchaseAnalysis, InventoryAnalysis;
Caption = 'Analysis Types';
RunObject = page "Analysis Types";
+ Tooltip = 'Open the Analysis Types page.';
}
action("Sales Analysis by Dimensions1")
{
ApplicationArea = Dimensions, SalesAnalysis;
Caption = 'Sales Analysis by Dimensions';
RunObject = page "Analysis View List Sales";
+ Tooltip = 'Open the Sales Analysis by Dimensions page.';
}
action("Analysis Column Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Column Templates';
RunObject = report "Run Sales Analysis Col. Temp.";
+ Tooltip = 'Run the Sales Analysis Column Templates report.';
}
action("Analysis Line Templates")
{
ApplicationArea = SalesAnalysis;
Caption = 'Sales Analysis Line Templates';
RunObject = report "Run Sales Analysis Line Templ.";
+ Tooltip = 'Run the Sales Analysis Line Templates report.';
}
}
group("Group18")
@@ -890,12 +1006,14 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Customer Price Groups';
RunObject = page "Customer Price Groups";
+ Tooltip = 'Open the Customer Price Groups page.';
}
action("Customer Disc. Groups")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer Discount Groups';
RunObject = page "Customer Disc. Groups";
+ Tooltip = 'Open the Customer Discount Groups page.';
}
}
group("Group19")
@@ -906,24 +1024,28 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite;
Caption = 'Nonstock Item Setup';
RunObject = page "Catalog Item Setup";
+ Tooltip = 'Open the Nonstock Item Setup page.';
}
action("Item Charges")
{
ApplicationArea = ItemCharges;
Caption = 'Item Charges';
RunObject = page "Item Charges";
+ Tooltip = 'Open the Item Charges page.';
}
action("Item Disc. Groups1")
{
ApplicationArea = Basic, Suite;
Caption = 'Item Discount Groups';
RunObject = page "Item Disc. Groups";
+ Tooltip = 'Open the Item Discount Groups page.';
}
action("Inventory Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory Setup';
RunObject = page "Inventory Setup";
+ Tooltip = 'Open the Inventory Setup page.';
}
}
group("Group20")
@@ -934,96 +1056,112 @@ page 8907 "Sales & Marketing Manager RC"
ApplicationArea = Basic, Suite, RelationshipMgmt;
Caption = 'Marketing Setup';
RunObject = page "Marketing Setup";
+ Tooltip = 'Open the Marketing Setup page.';
}
action("Interaction Template Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Template Setup';
RunObject = page "Interaction Template Setup";
+ Tooltip = 'Open the Interaction Template Setup page.';
}
action("Business Relations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Business Relations';
RunObject = page "Business Relations";
+ Tooltip = 'Open the Business Relations page.';
}
action("Industry Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Industry Groups';
RunObject = page "Industry Groups";
+ Tooltip = 'Open the Industry Groups page.';
}
action("Web Sources")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Web Sources';
RunObject = page "Web Sources";
+ Tooltip = 'Open the Web Sources page.';
}
action("Job Responsibilities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Job Responsibilities';
RunObject = page "Job Responsibilities";
+ Tooltip = 'Open the Job Responsibilities page.';
}
action("Organizational Levels")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Organizational Levels';
RunObject = page "Organizational Levels";
+ Tooltip = 'Open the Organizational Levels page.';
}
action("Interaction Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Groups';
RunObject = page "Interaction Groups";
+ Tooltip = 'Open the Interaction Groups page.';
}
action("Interaction Templates")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Interaction Templates';
RunObject = page "Interaction Templates";
+ Tooltip = 'Open the Interaction Templates page.';
}
action("Salutations")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Salutations';
RunObject = page "Salutations";
+ Tooltip = 'Open the Salutations page.';
}
action("Mailing Groups")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Mailing Groups';
RunObject = page "Mailing Groups";
+ Tooltip = 'Open the Mailing Groups page.';
}
action("Status")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Campaign Status';
RunObject = page "Campaign Status";
+ Tooltip = 'Open the Campaign Status page.';
}
action("Sales Cycles")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Sales Cycles';
RunObject = page "Sales Cycles";
+ Tooltip = 'Open the Sales Cycles page.';
}
action("Close Opportunity Codes")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Close Opportunity Codes';
RunObject = page "Close Opportunity Codes";
+ Tooltip = 'Open the Close Opportunity Codes page.';
}
action("Questionnaire Setup")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Questionnaire Setup';
RunObject = page "Profile Questionnaires";
+ Tooltip = 'Open the Questionnaire Setup page.';
}
action("Activities")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Activities';
RunObject = page "Activity List";
+ Tooltip = 'Open the Activities page.';
}
}
}
diff --git a/src/Layers/W1/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al b/src/Layers/W1/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
index 2656894bf8..ae523df3fb 100644
--- a/src/Layers/W1/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
+++ b/src/Layers/W1/BaseApp/Finance/RoleCenters/AccountingManagerRoleCenter.Page.al
@@ -71,53 +71,53 @@ page 9001 "Accounting Manager Role Center"
{
area(rolecenter)
{
- part(Control1902304208; "Account Manager Activities")
- {
- ApplicationArea = Basic, Suite;
- }
- part("User Tasks Activities"; "User Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
- {
- ApplicationArea = Suite;
- }
- part(Control99; "Finance Performance")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control103; "Trailing Sales Orders Chart")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control106; "My Job Queue")
- {
- ApplicationArea = Basic, Suite;
- Visible = false;
- }
- part(Control100; "Cash Flow Forecast Chart")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1907692008; "My Customers")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control1902476008; "My Vendors")
- {
- ApplicationArea = Basic, Suite;
- }
- part(Control108; "Report Inbox Part")
- {
- ApplicationArea = Basic, Suite;
- }
- systempart(Control1901377608; MyNotes)
- {
- ApplicationArea = Basic, Suite;
- }
+ part(Control1902304208; "Account Manager Activities")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part("User Tasks Activities"; "User Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part("Job Queue Tasks Activities"; "Job Queue Tasks Activities")
+ {
+ ApplicationArea = Suite;
+ }
+ part(Control99; "Finance Performance")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control103; "Trailing Sales Orders Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control106; "My Job Queue")
+ {
+ ApplicationArea = Basic, Suite;
+ Visible = false;
+ }
+ part(Control100; "Cash Flow Forecast Chart")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1907692008; "My Customers")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control1902476008; "My Vendors")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ part(Control108; "Report Inbox Part")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ systempart(Control1901377608; MyNotes)
+ {
+ ApplicationArea = Basic, Suite;
+ }
}
}
diff --git a/src/Layers/W1/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al b/src/Layers/W1/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
index 651dccd8ea..7ecc94b591 100644
--- a/src/Layers/W1/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
+++ b/src/Layers/W1/BaseApp/Finance/RoleCenters/FinanceManagerRoleCenter.Page.al
@@ -2116,18 +2116,21 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Adjust Item Costs/Prices';
RunObject = report "Adjust Item Costs/Prices";
+ Tooltip = 'Run the Adjust Item Costs/Prices report.';
}
action("Adjust Cost - Item Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Adjust Cost - Item Entries...';
RunObject = report "Adjust Cost - Item Entries";
+ Tooltip = 'Run the Adjust Cost - Item Entries report.';
}
action("Post Inventory Cost to G/L")
{
ApplicationArea = Basic, Suite;
Caption = 'Post Inventory Cost to G/L';
RunObject = report "Post Inventory Cost to G/L";
+ Tooltip = 'Run the Post Inventory Cost to G/L report.';
}
}
group("Group52")
@@ -2177,18 +2180,21 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Inventory Valuation';
RunObject = report "Inventory Valuation";
+ Tooltip = 'Run the Inventory Valuation report.';
}
action("Inventory - List")
{
ApplicationArea = Basic, Suite;
Caption = 'Inventory - List';
RunObject = report "Inventory - List";
+ Tooltip = 'Run the Inventory - List report.';
}
action("Invt. Valuation - Cost Spec.")
{
ApplicationArea = Basic, Suite;
Caption = 'Invt. Valuation - Cost Spec.';
RunObject = report "Invt. Valuation - Cost Spec.";
+ Tooltip = 'Run the Invt. Valuation - Cost Spec. report.';
}
action("Item Age Composition - Value")
{
@@ -2202,12 +2208,14 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Item Register - Value';
RunObject = report "Item Register - Value";
+ Tooltip = 'Run the Item Register - Value report.';
}
action("Physical Inventory List")
{
ApplicationArea = Warehouse;
Caption = 'Physical Inventory List';
RunObject = report "Phys. Inventory List";
+ Tooltip = 'Run the Physical Inventory List report.';
}
action("Status")
{
@@ -2221,18 +2229,21 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Item Register - Quantity';
RunObject = report "Item Register - Quantity";
+ Tooltip = 'Run the Item Register - Quantity report.';
}
action("Item Dimensions - Detail")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Detail';
RunObject = report "Item Dimensions - Detail";
+ Tooltip = 'Run the Item Dimensions - Detail report.';
}
action("Item Dimensions - Total")
{
ApplicationArea = Dimensions;
Caption = 'Item Dimensions - Total';
RunObject = report "Item Dimensions - Total";
+ Tooltip = 'Run the Item Dimensions - Total report.';
}
action("Inventory - G/L Reconciliation")
{
@@ -2307,12 +2318,14 @@ page 8901 "Finance Manager Role Center"
ApplicationArea = InventoryAnalysis;
Caption = 'Invt. Analysis Column Templates';
RunObject = report "Run Invt. Analysis Col. Temp.";
+ Tooltip = 'Run the Invt. Analysis Column Templates report.';
}
action("Analysis Line Templates")
{
ApplicationArea = InventoryAnalysis;
Caption = 'Invt. Analysis Line Templates';
RunObject = report "Run Invt. Analysis Line Temp.";
+ Tooltip = 'Run the Invt. Analysis Line Templates report.';
}
}
}
@@ -2534,7 +2547,7 @@ page 8901 "Finance Manager Role Center"
action("General Business")
{
ApplicationArea = Basic, Suite;
- Caption = 'Gen. Business Posting Groups';
+ Caption = 'General Business Posting Groups';
RunObject = page "Gen. Business Posting Groups";
Tooltip = 'Open the Gen. Business Posting Groups page.';
}
diff --git a/src/Layers/W1/BaseApp/HumanResources/Employee/Employee.Table.al b/src/Layers/W1/BaseApp/HumanResources/Employee/Employee.Table.al
index 7aa977e31a..20468333fc 100644
--- a/src/Layers/W1/BaseApp/HumanResources/Employee/Employee.Table.al
+++ b/src/Layers/W1/BaseApp/HumanResources/Employee/Employee.Table.al
@@ -452,14 +452,14 @@ table 5200 Employee
field(57; "Bank Account No."; Text[30])
{
Caption = 'Bank Account No.';
- ToolTip = 'Specifies the number used by the bank for the bank account.';
MaskType = Concealed;
+ ToolTip = 'Specifies the number used by the bank for the bank account.';
}
field(58; IBAN; Code[50])
{
Caption = 'IBAN';
- ToolTip = 'Specifies the bank account''s international bank account number.';
MaskType = Concealed;
+ ToolTip = 'Specifies the bank account''s international bank account number.';
trigger OnValidate()
var
diff --git a/src/Layers/W1/BaseApp/Purchases/Document/PurchaseQuote.Page.al b/src/Layers/W1/BaseApp/Purchases/Document/PurchaseQuote.Page.al
index 3f37c08827..da78b8e473 100644
--- a/src/Layers/W1/BaseApp/Purchases/Document/PurchaseQuote.Page.al
+++ b/src/Layers/W1/BaseApp/Purchases/Document/PurchaseQuote.Page.al
@@ -1613,6 +1613,13 @@ page 49 "Purchase Quote"
OnAfterActivateFields();
end;
+ local procedure SetPurchaseLinesAvailability()
+ begin
+ IsPurchaseLinesEditable := Rec.PurchaseLinesEditable();
+
+ OnAfterSetPurchaseLinesAvailability(Rec, IsPurchaseLinesEditable);
+ end;
+
local procedure ApproveCalcInvDisc()
begin
CurrPage.PurchLines.PAGE.ApproveCalcInvDisc();
@@ -1667,7 +1674,7 @@ page 49 "Purchase Quote"
WorkflowWebhookManagement.GetCanRequestAndCanCancel(Rec.RecordId, CanRequestApprovalForFlow, CanCancelApprovalForFlow);
HasIncomingDocument := Rec."Incoming Document Entry No." <> 0;
- IsPurchaseLinesEditable := Rec.PurchaseLinesEditable();
+ SetPurchaseLinesAvailability();
end;
local procedure ValidateShippingOption()
@@ -1722,6 +1729,11 @@ page 49 "Purchase Quote"
begin
end;
+ [IntegrationEvent(true, false)]
+ local procedure OnAfterSetPurchaseLinesAvailability(var PurchaseHeader: Record "Purchase Header"; var PurchaseLinesAvailable: Boolean)
+ begin
+ end;
+
[IntegrationEvent(false, false)]
local procedure OnBeforeValidateShipToOptions(var PurchaseHeader: Record "Purchase Header"; ShipToOptions: Option)
begin
diff --git a/src/Layers/W1/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al b/src/Layers/W1/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
index d3fb75fd9d..66ccf2810a 100644
--- a/src/Layers/W1/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
+++ b/src/Layers/W1/BaseApp/RoleCenters/AdministratorMainRoleCenter.Page.al
@@ -77,6 +77,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'System Information';
RunObject = page "Latest Error";
+ Tooltip = 'Open the System Information page.';
}
action("Table Information")
{
@@ -90,30 +91,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Extension Management';
RunObject = page "Extension Management";
+ Tooltip = 'Open the Extension Management page.';
}
action("Profiles")
{
ApplicationArea = Basic, Suite;
Caption = 'Profiles (Roles)';
RunObject = page "Profile List";
+ Tooltip = 'Open the Profiles (Roles) page.';
}
action("Devices")
{
ApplicationArea = Basic, Suite;
Caption = 'Devices';
RunObject = page "Devices";
+ Tooltip = 'Open the Devices page.';
}
action("Control Add-ins")
{
ApplicationArea = All;
Caption = 'Control Add-ins';
RunObject = page "Control Add-ins";
+ Tooltip = 'Open the Control Add-ins page.';
}
action("Get the Mobile Device App (Tablet and Phone activatation code)")
{
ApplicationArea = All;
Caption = 'Mobile device activation and app';
RunObject = page "O365 Device Setup";
+ Tooltip = 'Open the Mobile device activation and app page.';
}
action("Printer Management")
{
@@ -131,60 +137,70 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Online Map Setup';
RunObject = page "Online Map Setup";
+ Tooltip = 'Open the Online Map Setup page.';
}
action("Bank Export/Import Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Bank Export/Import Setup';
RunObject = page "Bank Export/Import Setup";
+ Tooltip = 'Open the Bank Export/Import Setup page.';
}
action("Cue Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Cue Setup';
RunObject = page "Cue Setup Administrator";
+ Tooltip = 'Open the Cue Setup page.';
}
action("Document Sending Profiles")
{
ApplicationArea = Basic, Suite;
Caption = 'Document Sending Profiles';
RunObject = page "Document Sending Profiles";
+ Tooltip = 'Open the Document Sending Profiles page.';
}
action("Printer Selections")
{
ApplicationArea = Suite;
Caption = 'Printer Selections';
RunObject = page "Printer Selections";
+ Tooltip = 'Open the Printer Selections page.';
}
action("Electronic Document Formats")
{
ApplicationArea = Suite;
Caption = 'Electronic Document Formats';
RunObject = page "Electronic Document Format";
+ Tooltip = 'Open the Electronic Document Formats page.';
}
action("Assisted Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Assisted Setup';
RunObject = page "Assisted Setup";
+ Tooltip = 'Open the Assisted Setup page.';
}
action("Application Area")
{
ApplicationArea = All;
Caption = 'Application Area';
RunObject = page "Application Area";
+ Tooltip = 'Open the Application Area page.';
}
action("Set Up Customer/Vendor/Item Templates")
{
ApplicationArea = Basic, Suite;
Caption = 'Customer/Vendor/Item Templates';
RunObject = page "Config Templates";
+ Tooltip = 'Open the Customer/Vendor/Item Templates page.';
}
action("Transformation Rules")
{
ApplicationArea = Basic, Suite;
Caption = 'Transformation Rules';
RunObject = page "Transformation Rules";
+ Tooltip = 'Open the Transformation Rules page.';
}
action("Business Setup")
{
@@ -198,6 +214,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Image Analysis Setup';
RunObject = page "Image Analysis Setup";
+ Tooltip = 'Open the Image Analysis Setup page.';
}
}
group("Group4")
@@ -208,18 +225,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Entries';
RunObject = page "Job Queue Entries";
+ Tooltip = 'Open the Job Queue Entries page.';
}
action("Job Queue Log Entries")
{
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Log Entries';
RunObject = page "Job Queue Log Entries";
+ Tooltip = 'Open the Job Queue Log Entries page.';
}
action("Job Queue Category List")
{
ApplicationArea = Basic, Suite;
Caption = 'Job Queue Category List';
RunObject = page "Job Queue Category List";
+ Tooltip = 'Open the Job Queue Category List page.';
}
action("Scheduled Tasks")
{
@@ -237,12 +257,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Change Log Setup';
RunObject = page "Change Log Setup";
+ Tooltip = 'Open the Change Log Setup page.';
}
action("Change Log")
{
ApplicationArea = Basic, Suite;
Caption = 'Change Log Entries';
RunObject = page "Change Log Entries";
+ Tooltip = 'Open the Change Log Entries page.';
}
}
group("Group6")
@@ -253,12 +275,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Layout Selection';
RunObject = page "Report Layout Selection";
+ Tooltip = 'Open the Report Layout Selection page.';
}
action("Report Configuration")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Settings';
RunObject = page "Report Settings";
+ Tooltip = 'Open the Report Settings page.';
AccessByPermission = TableData "Object Options" = IMD;
}
action("Report Inbox")
@@ -266,6 +290,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Inbox';
RunObject = page "Report Inbox";
+ Tooltip = 'Open the Report Inbox page.';
}
#if not CLEAN28
action("Custom Report Layouts")
@@ -278,6 +303,7 @@ page 8900 "Administrator Main Role Center"
#pragma warning disable AL0432
RunObject = page "Custom Report Layouts";
#pragma warning restore AL0432
+ Tooltip = 'Open the Custom Report Layouts page.';
}
#endif
action("Report Selection Purchase")
@@ -285,30 +311,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Purchase';
RunObject = page "Report Selection - Purchase";
+ Tooltip = 'Open the Report Selections Purchase page.';
}
action("Report Selection Reminder and")
{
ApplicationArea = Suite;
Caption = 'Report Selections Reminder/Fin. Charge';
RunObject = page "Report Selection - Reminder";
+ Tooltip = 'Open the Report Selections Reminder/Fin. Charge page.';
}
action("Report Selection Sales")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Sales';
RunObject = page "Report Selection - Sales";
+ Tooltip = 'Open the Report Selections Sales page.';
}
action("Report Selection - Bank Acc.")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Bank Account';
RunObject = page "Report Selection - Bank Acc.";
+ Tooltip = 'Open the Report Selections Bank Account page.';
}
action("Report Selections Inventory")
{
ApplicationArea = Basic, Suite;
Caption = 'Report Selections Inventory';
RunObject = page "Report Selection - Inventory";
+ Tooltip = 'Open the Report Selections Inventory page.';
}
}
group("Group7")
@@ -319,19 +350,15 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Test Tool';
RunObject = page "CAL Test Tool";
+ Tooltip = 'Open the Test Tool page.';
}
action("Code Coverage")
{
ApplicationArea = All;
Caption = 'Code Coverage';
RunObject = page "Code Coverage";
+ Tooltip = 'Open the Code Coverage page.';
}
- // action("Sessions")
- // {
- // ApplicationArea = All;
- // Caption = 'Sessions';
- // RunObject = codeunit 9500;
- // }
}
action("Feature Management")
{
@@ -352,54 +379,63 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Company Information';
RunObject = page "Company Information";
+ Tooltip = 'Open the Company Information page.';
}
action("Companies")
{
ApplicationArea = Basic, Suite;
Caption = 'Companies';
RunObject = page "Companies";
+ Tooltip = 'Open the Companies page.';
}
action("No. Series")
{
ApplicationArea = Basic, Suite;
Caption = 'No. Series';
RunObject = page "No. Series";
+ Tooltip = 'Open the No. Series page.';
}
action("Post Codes")
{
ApplicationArea = Basic, Suite;
Caption = 'Post Codes';
RunObject = page "Post Codes";
+ Tooltip = 'Open the Post Codes page.';
}
action("Territories")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Territories';
RunObject = page "Territories";
+ Tooltip = 'Open the Territories page.';
}
action("Languages")
{
ApplicationArea = Suite;
Caption = 'Languages';
RunObject = page "Languages";
+ Tooltip = 'Open the Languages page.';
}
action("Countries/Regions")
{
ApplicationArea = Basic, Suite;
Caption = 'Countries/Regions';
RunObject = page "Countries/Regions";
+ Tooltip = 'Open the Countries/Regions page.';
}
action("Base Calendar Entries Subform")
{
ApplicationArea = Basic, Suite;
Caption = 'Base Calendar';
RunObject = page "Base Calendar List";
+ Tooltip = 'Open the Base Calendar page.';
}
action("Responsibility Centers")
{
ApplicationArea = Basic, Suite;
Caption = 'Responsibility Centers';
RunObject = page "Responsibility Center List";
+ Tooltip = 'Open the Responsibility Centers page.';
}
}
group("Group10")
@@ -410,13 +446,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Data Encryption Management';
RunObject = page "Data Encryption Management";
- //AccessByPermission = System 5420=X;
+ Tooltip = 'Open the Data Encryption Management page.';
}
action("Data Classification Worksheet")
{
ApplicationArea = All;
Caption = 'Data Classification Worksheet';
RunObject = page "Data Classification Worksheet";
+ Tooltip = 'Open the Data Classification Worksheet page.';
AccessByPermission = TableData "Data Sensitivity" = R;
}
action("Privacy for App Integrations")
@@ -431,12 +468,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'XML Schemas';
RunObject = page "XML Schemas";
+ Tooltip = 'Open the XML Schemas page.';
}
action("SEPA Schema Viewer")
{
ApplicationArea = Basic, Suite;
Caption = 'SEPA Schema Viewer';
RunObject = page "XML Schema Viewer";
+ Tooltip = 'Open the SEPA Schema Viewer page.';
}
}
group("Group11")
@@ -447,18 +486,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Data Migration Overview';
RunObject = page "Data Migration Overview";
+ Tooltip = 'Open the Data Migration Overview page.';
}
action("Data Migration")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Migration';
RunObject = page "Data Migration Wizard";
+ Tooltip = 'Open the Data Migration page.';
}
action("Data Migration Settings")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Migration Settings';
RunObject = page "Data Migration Settings";
+ Tooltip = 'Open the Data Migration Settings page.';
AccessByPermission = TableData "Data Migration Setup" = R;
}
}
@@ -470,24 +512,28 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Import from a Data File';
RunObject = page "Import Data";
+ Tooltip = 'Open the Import from a Data File page.';
}
action("Export to a Data File")
{
ApplicationArea = Basic, Suite;
Caption = 'Export to a Data File';
RunObject = page "Export Data";
+ Tooltip = 'Open the Export to a Data File page.';
}
action("Data Exchange Types")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Exchange Types';
RunObject = page "Data Exchange Types";
+ Tooltip = 'Open the Data Exchange Types page.';
}
action("Data Exchange Definition")
{
ApplicationArea = Basic, Suite;
Caption = 'Data Exchange Definitions';
RunObject = page "Data Exch Def List";
+ Tooltip = 'Open the Data Exchange Definitions page.';
}
}
group("Group13")
@@ -501,18 +547,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Customers...';
RunObject = report "Create Conts. from Customers";
+ Tooltip = 'Run the Create Contacts from Customers report.';
}
action("Create Contacts from Vendors")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Vendors...';
RunObject = report "Create Conts. from Vendors";
+ Tooltip = 'Run the Create Contacts from Vendors report.';
}
action("Create Contacts from Bank Acco")
{
ApplicationArea = RelationshipMgmt;
Caption = 'Create Contacts from Bank Accounts...';
RunObject = report "Create Conts. from Bank Accs.";
+ Tooltip = 'Run the Create Contacts from Bank Accounts report.';
}
}
}
@@ -527,6 +576,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Date Compr. Registers';
RunObject = page "Date Compr. Registers";
+ Tooltip = 'Open the Date Compr. Registers page.';
}
}
group("Group17")
@@ -537,6 +587,7 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = All;
Caption = 'Delete Orphaned Record Links';
RunObject = codeunit "Remove Orphaned Record Links";
+ Tooltip = 'Run the Delete Orphaned Record Links codeunit.';
}
}
group("Group18")
@@ -547,12 +598,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Profile Customizations';
RunObject = page "Profile Customization List";
+ Tooltip = 'Open the Profile Customizations page.';
}
action("User Page Personalizations")
{
ApplicationArea = Basic, Suite;
Caption = 'User Page Personalizations';
RunObject = page "Personalized Pages";
+ Tooltip = 'Open the User Page Personalizations page.';
}
}
}
@@ -565,24 +618,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Users';
RunObject = page "Users";
+ Tooltip = 'Open the Users page.';
}
action("User Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'User Setup';
RunObject = page "User Setup";
+ Tooltip = 'Open the User Setup page.';
}
- // action("Change Password")
- // {
- // ApplicationArea = Basic, Suite;
- // Caption = 'Change Password';
- // RunObject = page ;
- // }
action("User Security Status")
{
ApplicationArea = Basic, Suite;
Caption = 'User Security Status';
RunObject = page "User Security Status List";
+ Tooltip = 'Open the User Security Status page.';
AccessByPermission = TableData "User" = R;
}
action("User Tasks")
@@ -590,18 +640,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'User Tasks';
RunObject = page "User Task List";
+ Tooltip = 'Open the User Tasks page.';
}
action("User Personalization")
{
ApplicationArea = Basic, Suite;
Caption = 'User Settings';
RunObject = page "User Settings List";
+ Tooltip = 'Open the User Settings page.';
}
action("User Time Registers")
{
ApplicationArea = Basic, Suite;
Caption = 'Time Registers';
RunObject = page "User Time Registers";
+ Tooltip = 'Open the Time Registers page.';
}
}
group(Permissions)
@@ -643,30 +696,35 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflows';
RunObject = page "Workflows";
+ Tooltip = 'Open the Workflows page.';
}
action("Workflow User Group")
{
ApplicationArea = Suite;
Caption = 'Workflow User Groups';
RunObject = page "Workflow User Groups";
+ Tooltip = 'Open the Workflow User Groups page.';
}
action("Approval User Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Approval User Setup';
RunObject = page "Approval User Setup";
+ Tooltip = 'View or edit information about workflow users who are involved in approval processes, such as approval amount limits for specific types of requests and substitute approvers to whom approval requests are delegated when the original approver is absent.';
}
action("Incoming Documents Setup")
{
ApplicationArea = Suite;
Caption = 'Incoming Documents Setup';
RunObject = page "Incoming Documents Setup";
+ Tooltip = 'Open the Incoming Documents Setup page.';
}
action("Send Overdue Appr. Notif.")
{
ApplicationArea = Suite;
Caption = 'Send Overdue Approval Notifications';
RunObject = report "Send Overdue Appr. Notif.";
+ Tooltip = 'Run the Send Overdue Approval Notifications report.';
}
group("Group21")
{
@@ -676,12 +734,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflow Templates';
RunObject = page "Workflow Templates";
+ Tooltip = 'Open the Workflow Templates page.';
}
action("Workflow Categories")
{
ApplicationArea = Suite;
Caption = 'Workflow Categories';
RunObject = page "Workflow Categories";
+ Tooltip = 'Open the Workflow Categories page.';
}
}
group("Group22")
@@ -692,18 +752,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Workflow Event Hierarchies';
RunObject = page "Workflow Event Hierarchies";
+ Tooltip = 'Open the Workflow Event Hierarchies page.';
}
action("WF Event/Response Combinations")
{
ApplicationArea = Suite;
Caption = 'Workflow Event/Response Combinations';
RunObject = page "WF Event/Response Combinations";
+ Tooltip = 'Open the Workflow Event/Response Combinations page.';
}
action("Workflow - Table Relations")
{
ApplicationArea = Suite;
Caption = 'Workflow - Table Relations';
RunObject = page "Workflow - Table Relations";
+ Tooltip = 'Open the Workflow - Table Relations page.';
}
}
group("Group23")
@@ -714,18 +777,21 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Notification Setup';
RunObject = page "Notification Setup";
+ Tooltip = 'Open the Notification Setup page.';
}
action("Notification Entries")
{
ApplicationArea = Suite;
Caption = 'Notification Entries';
RunObject = page "Notification Entries";
+ Tooltip = 'Open the Notification Entries page.';
}
action("Sent Notification Entries")
{
ApplicationArea = Suite;
Caption = 'Sent Notification Entries';
RunObject = page "Sent Notification Entries";
+ Tooltip = 'Open the Sent Notification Entries page.';
}
}
group("Group24")
@@ -736,36 +802,42 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Approval Entries';
RunObject = page "Approval Entries";
+ Tooltip = 'Open the Approval Entries page.';
}
action("Posted Approval Entries")
{
ApplicationArea = Suite;
Caption = 'Posted Approval Entries';
RunObject = page "Posted Approval Entries";
+ Tooltip = 'Open the Posted Approval Entries page.';
}
action("Overdue Approval Entries")
{
ApplicationArea = Suite;
Caption = 'Overdue Approval Entries';
RunObject = page "Overdue Approval Entries";
+ Tooltip = 'Open the Overdue Approval Entries page.';
}
action("Restricted Records")
{
ApplicationArea = Suite;
Caption = 'Restricted Records';
RunObject = page "Restricted Records";
+ Tooltip = 'Open the Restricted Records page.';
}
action("Workflow Step Instances")
{
ApplicationArea = Suite;
Caption = 'Workflow Step Instances';
RunObject = page "Workflow Step Instances";
+ Tooltip = 'Open the Workflow Step Instances page.';
}
action("Archived Workflow Step Instances")
{
ApplicationArea = Suite;
Caption = 'Archived Workflow Step Instances';
RunObject = page "Archived WF Step Instances";
+ Tooltip = 'Open the Archived Workflow Step Instances page.';
}
}
group("Group26")
@@ -774,14 +846,16 @@ page 8900 "Administrator Main Role Center"
action("Dynamic Request page Entities")
{
ApplicationArea = Basic, Suite;
- Caption = 'Dynamic Request page Entities';
- RunObject = page "Dynamic Request page Entities";
+ Caption = 'Dynamic Request Page Entities';
+ RunObject = page "Dynamic Request Page Entities";
+ Tooltip = 'Open the Dynamic Request Page Entities page.';
}
action("Dynamic Request page Fields")
{
ApplicationArea = Basic, Suite;
- Caption = 'Dynamic Request page Fields';
- RunObject = page "Dynamic Request page Fields";
+ Caption = 'Dynamic Request Page Fields';
+ RunObject = page "Dynamic Request Page Fields";
+ Tooltip = 'Open the Dynamic Request Page Fields page.';
}
}
}
@@ -793,12 +867,14 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'Web Services';
RunObject = page "Web Services";
+ Tooltip = 'Open the Web Services page.';
}
action("Microsoft Dynamics 365 Connection Setup")
{
ApplicationArea = Suite;
Caption = 'Microsoft Dynamics 365 Connection Setup';
RunObject = page "CRM Connection Setup";
+ Tooltip = 'Open the Microsoft Dynamics 365 Connection Setup page.';
AccessByPermission = TableData "CRM Connection Setup" = IM;
}
action("Email Account Setup")
@@ -814,72 +890,84 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Basic, Suite;
Caption = 'OCR Service Setup';
RunObject = page "OCR Service Setup";
+ Tooltip = 'Open the OCR Service Setup page.';
}
action("Currency Exchange Rate Services")
{
ApplicationArea = Suite;
Caption = 'Currency Exchange Rate Services';
RunObject = page "Curr. Exch. Rate Service List";
+ Tooltip = 'Open the Currency Exchange Rate Services page.';
}
action("Service Connections Overview")
{
ApplicationArea = Basic, Suite;
Caption = 'Service Connections';
RunObject = page "Service Connections";
+ Tooltip = 'Open the Service Connections page.';
}
action("Doc. Exch. Service Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'Document Exchange Service Setup';
RunObject = page "Doc. Exch. Service Setup";
+ Tooltip = 'Open the Document Exchange Service Setup page.';
}
action("Integration Table Mappings")
{
ApplicationArea = Suite;
Caption = 'Integration Table Mappings';
RunObject = page "Integration Table Mapping List";
+ Tooltip = 'Open the Integration Table Mappings page.';
}
action("Integration Synchronization Jobs")
{
ApplicationArea = Suite;
Caption = 'Integration Synchronization Jobs';
RunObject = page "Integration Synch. Job List";
+ Tooltip = 'Open the Integration Synchronization Jobs page.';
}
action("Integration Synchronization Errors")
{
ApplicationArea = Suite;
Caption = 'Integration Synchronization Errors';
RunObject = page "Integration Synch. Error List";
+ Tooltip = 'Open the Integration Synchronization Errors page.';
}
action("Online Payments")
{
ApplicationArea = Basic, Suite;
Caption = 'Payment Services';
RunObject = page "Payment Services";
+ Tooltip = 'Open the Payment Services page.';
}
action("VAT Registration Service (VIES) Setting")
{
ApplicationArea = Basic, Suite;
Caption = 'VAT Registration Service (VIES) Setting';
RunObject = page "VAT Registration Config";
+ Tooltip = 'Open the VAT Registration Service (VIES) Setting page.';
}
action("API Setup")
{
ApplicationArea = Basic, Suite;
Caption = 'API Setup';
RunObject = page "API Setup";
+ Tooltip = 'Open the API Setup page.';
}
action("Account Schedule KPI Web Servi")
{
ApplicationArea = Basic, Suite;
Caption = 'Account Schedule KPI Web Service Setup';
RunObject = page "Acc. Sched. KPI Web Srv. Setup";
+ Tooltip = 'Open the Account Schedule KPI Web Service Setup page.';
}
action("Acc. Sched. KPI Web Service")
{
ApplicationArea = Basic, Suite;
Caption = 'Account Schedule KPI Web Service';
RunObject = page "Acc. Sched. KPI Web Service";
+ Tooltip = 'Open the Account Schedule KPI Web Service page.';
}
}
group("Group27A")
@@ -980,48 +1068,56 @@ page 8900 "Administrator Main Role Center"
ApplicationArea = Suite;
Caption = 'Configuration Questionnaire';
RunObject = page "Config. Questionnaire";
+ Tooltip = 'Open the Configuration Questionnaire page.';
}
action("Data Migration1")
{
ApplicationArea = Suite;
Caption = 'Configuration Packages';
RunObject = page "Config. Packages";
+ Tooltip = 'Open the Configuration Packages page.';
}
action("Setup Master Templates")
{
ApplicationArea = Basic, Suite;
Caption = 'Configuration Templates';
RunObject = page "Config. Template List";
+ Tooltip = 'Open the Configuration Templates page.';
}
action("Create G/L acc. Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create G/L Acc. Journal Lines';
RunObject = report "Create G/L Acc. Journal Lines";
+ Tooltip = 'Run the Create G/L Acc. Journal Lines report.';
}
action("Create Customer Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Customer Journal Lines';
RunObject = report "Create Customer Journal Lines";
+ Tooltip = 'Run the Create Customer Journal Lines report.';
}
action("Create Vendor Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Vendor Journal Lines';
RunObject = report "Create Vendor Journal Lines";
+ Tooltip = 'Run the Create Vendor Journal Lines report.';
}
action("Create Item Journal Lines")
{
ApplicationArea = Basic, Suite;
Caption = 'Create Item Journal Lines';
RunObject = report "Create Item Journal Lines";
+ Tooltip = 'Run the Create Item Journal Lines report.';
}
action("Configuration Worksheet")
{
ApplicationArea = Suite;
Caption = 'Configuration Worksheet';
RunObject = page "Config. Worksheet";
+ Tooltip = 'Open the Configuration Worksheet page.';
}
}
}
diff --git a/src/Layers/W1/BaseApp/Sales/Customer/Customer.Table.al b/src/Layers/W1/BaseApp/Sales/Customer/Customer.Table.al
index dbe36671da..e41b2f084a 100644
--- a/src/Layers/W1/BaseApp/Sales/Customer/Customer.Table.al
+++ b/src/Layers/W1/BaseApp/Sales/Customer/Customer.Table.al
@@ -285,6 +285,7 @@ table 18 Customer
field(14; "Our Account No."; Text[20])
{
Caption = 'Our Account No.';
+ MaskType = Concealed;
OptimizeForTextSearch = true;
}
///
@@ -2469,6 +2470,7 @@ table 18 Customer
UpdateReferencedIds();
SetLastModifiedDateTime();
if IsContactUpdateNeeded() then begin
+ OnBeforeModifyContactUpdate(Rec);
Modify();
UpdateContFromCust.OnModify(Rec);
if not Find() then begin
@@ -2478,6 +2480,11 @@ table 18 Customer
end;
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnBeforeModifyContactUpdate(var Customer: Record Customer)
+ begin
+ end;
+
trigger OnRename()
var
IsHandled: Boolean;
diff --git a/src/Layers/W1/BaseApp/Sales/Customer/CustomerBankAccount.Table.al b/src/Layers/W1/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
index 1ac02f65a2..bd67754788 100644
--- a/src/Layers/W1/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
+++ b/src/Layers/W1/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
@@ -171,8 +171,8 @@ table 287 "Customer Bank Account"
field(14; "Bank Account No."; Text[30])
{
Caption = 'Bank Account No.';
- ToolTip = 'Specifies the number used by the bank for the bank account.';
MaskType = Concealed;
+ ToolTip = 'Specifies the number used by the bank for the bank account.';
trigger OnValidate()
begin
@@ -280,8 +280,8 @@ table 287 "Customer Bank Account"
field(24; IBAN; Code[50])
{
Caption = 'IBAN';
- ToolTip = 'Specifies the bank account''s international bank account number.';
MaskType = Concealed;
+ ToolTip = 'Specifies the bank account''s international bank account number.';
trigger OnValidate()
var
@@ -476,4 +476,5 @@ table 287 "Customer Bank Account"
local procedure OnBeforeValidatePostCode(var CustomerBankAccount: Record "Customer Bank Account"; var PostCodeRec: Record "Post Code"; CurrentFieldNo: Integer; var IsHandled: Boolean)
begin
end;
+
}
diff --git a/src/Layers/W1/BaseApp/Sales/Customer/CustomerTempl.Table.al b/src/Layers/W1/BaseApp/Sales/Customer/CustomerTempl.Table.al
index b7a74a0797..4e00c360f6 100644
--- a/src/Layers/W1/BaseApp/Sales/Customer/CustomerTempl.Table.al
+++ b/src/Layers/W1/BaseApp/Sales/Customer/CustomerTempl.Table.al
@@ -134,6 +134,7 @@ table 1381 "Customer Templ."
field(14; "Our Account No."; Text[20])
{
Caption = 'Our Account No.';
+ MaskType = Concealed;
}
///
/// Specifies the default territory code for customers created from this template.
@@ -893,4 +894,5 @@ table 1381 "Customer Templ."
local procedure OnCopyTemplateOnBeforeModify(SourceCustomerTempl: Record "Customer Templ."; SavedCustomerTempl: Record "Customer Templ."; var CustomerTempl: Record "Customer Templ.")
begin
end;
+
}
\ No newline at end of file
diff --git a/src/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al b/src/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al
index cb937f3980..b23e344ce6 100644
--- a/src/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al
+++ b/src/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al
@@ -328,6 +328,7 @@ table 36 "Sales Header"
Validate("Payment Terms Code");
Validate("Prepmt. Payment Terms Code");
Validate("Payment Method Code");
+ OnAfterValidateBillToCustomerPaymentFields(Rec);
Validate("Prepayment %");
if (xRec."Sell-to Customer No." = "Sell-to Customer No.") and
@@ -7581,7 +7582,7 @@ table 36 "Sales Header"
if ReplaceVATDate then
"VAT Reporting Date" := VATDateReq;
- if ReplaceDocDate and ("Document Date" <> PostingDateReq) then begin
+ if ReplacePostingDate and ReplaceDocDate and ("Document Date" <> PostingDateReq) then begin
UpdateDocumentDate := true;
Validate("Document Date", PostingDateReq);
end;
@@ -10356,6 +10357,11 @@ table 36 "Sales Header"
begin
end;
+ [IntegrationEvent(false, false)]
+ local procedure OnAfterValidateBillToCustomerPaymentFields(var SalesHeader: Record "Sales Header")
+ begin
+ end;
+
///
/// Raised after extended text is transferred for sales line recreation.
///