Table 5993 Service Invoice Line, source in 29
Source29
src/Layers/W1/BaseApp/Service/History/ServiceInvoiceLine.Table.al906 lines, Copyright (c) Microsoft Corporation. MIT
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Service.History;
using Microsoft.Finance.Dimension;
using Microsoft.Finance.GeneralLedger.Account;
using Microsoft.Finance.GeneralLedger.Setup;
using Microsoft.Finance.SalesTax;
using Microsoft.Finance.VAT.Calculation;
using Microsoft.Finance.VAT.Clause;
using Microsoft.Finance.VAT.Setup;
using Microsoft.Foundation.AuditCodes;
using Microsoft.Foundation.Enums;
using Microsoft.Foundation.UOM;
using Microsoft.Inventory.Intrastat;
using Microsoft.Inventory.Item;
using Microsoft.Inventory.Item.Catalog;
using Microsoft.Inventory.Ledger;
using Microsoft.Inventory.Location;
using Microsoft.Inventory.Tracking;
using Microsoft.Pricing.Calculation;
using Microsoft.Projects.Project.Job;
using Microsoft.Projects.Resources.Resource;
using Microsoft.Sales.Customer;
using Microsoft.Sales.Pricing;
using Microsoft.Service.Contract;
using Microsoft.Service.Document;
using Microsoft.Service.Item;
using Microsoft.Service.Maintenance;
using Microsoft.Service.Pricing;
using Microsoft.Utilities;
using Microsoft.Warehouse.Structure;
using System.Reflection;
using System.Security.User;
table 5993 "Service Invoice Line"
{
Caption = 'Service Invoice Line';
DrillDownPageID = "Posted Service Invoice Lines";
LookupPageID = "Posted Service Invoice Lines";
PasteIsValid = false;
DataClassification = CustomerContent;
fields
{
field(2; "Customer No."; Code[20])
{
Caption = 'Customer No.';
ToolTip = 'Specifies the number of the customer who has received the service on the invoice.';
Editable = false;
TableRelation = Customer;
}
field(3; "Document No."; Code[20])
{
Caption = 'Document No.';
TableRelation = "Service Invoice Header";
ToolTip = 'Specifies the number of the invoice.';
}
field(4; "Line No."; Integer)
{
Caption = 'Line No.';
}
field(5; Type; Enum "Service Line Type")
{
Caption = 'Type';
ToolTip = 'Specifies the type of this invoice line.';
}
field(6; "No."; Code[20])
{
Caption = 'No.';
ToolTip = 'Specifies the number of the involved entry or record, according to the specified number series.';
TableRelation = if (Type = const(" ")) "Standard Text"
else
if (Type = const(Item)) Item
else
if (Type = const(Resource)) Resource
else
if (Type = const(Cost)) "Service Cost"
else
if (Type = const("G/L Account")) "G/L Account";
}
field(7; "Location Code"; Code[10])
{
Caption = 'Location Code';
ToolTip = 'Specifies the location, such as warehouse or distribution center, in which the invoice line was registered.';
TableRelation = Location;
}
field(8; "Posting Group"; Code[20])
{
Caption = 'Posting Group';
TableRelation = if (Type = const(Item)) "Inventory Posting Group";
}
field(11; Description; Text[100])
{
Caption = 'Description';
ToolTip = 'Specifies the name of an item, resource, cost, general ledger account description, or some descriptive text on the service invoice line.';
}
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 name of the item or resource''s unit of measure, such as piece or hour.';
}
field(15; Quantity; Decimal)
{
AutoFormatType = 0;
Caption = 'Quantity';
ToolTip = 'Specifies the number of item units, resource hours, general ledger account payments, or cost specified on the invoice line.';
DecimalPlaces = 0 : 5;
}
field(22; "Unit Price"; Decimal)
{
AutoFormatExpression = GetCurrencyCode();
AutoFormatType = 2;
CaptionClass = GetCaptionClass(FieldNo("Unit Price"));
Caption = 'Unit Price';
ToolTip = 'Specifies the price 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.';
Editable = true;
}
field(23; "Unit Cost (LCY)"; Decimal)
{
AutoFormatExpression = '';
AutoFormatType = 2;
Caption = 'Unit Cost (LCY)';
}
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;
}
field(28; "Line Discount Amount"; Decimal)
{
AutoFormatExpression = GetCurrencyCode();
AutoFormatType = 1;
Caption = 'Line Discount Amount';
ToolTip = 'Specifies the discount amount that is granted for the item on the line.';
Editable = false;
}
field(29; Amount; Decimal)
{
AutoFormatExpression = GetCurrencyCode();
AutoFormatType = 1;
Caption = 'Amount';
ToolTip = 'Specifies the total net amount on the service line.';
Editable = false;
}
field(30; "Amount Including VAT"; Decimal)
{
AutoFormatExpression = GetCurrencyCode();
AutoFormatType = 1;
Caption = 'Amount Including VAT';
ToolTip = 'Specifies the net amount, including VAT, for this line.';
Editable = false;
}
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;
}
field(34; "Gross Weight"; Decimal)
{
AutoFormatType = 0;
Caption = 'Gross Weight';
DecimalPlaces = 0 : 5;
}
field(35; "Net Weight"; Decimal)
{
AutoFormatType = 0;
Caption = 'Net Weight';
DecimalPlaces = 0 : 5;
}
field(36; "Units per Parcel"; Decimal)
{
AutoFormatType = 0;
Caption = 'Units per Parcel';
DecimalPlaces = 0 : 5;
}
field(37; "Unit Volume"; Decimal)
{
AutoFormatType = 0;
Caption = 'Unit Volume';
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.';
}
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));
}
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));
}
field(42; "Customer Price Group"; Code[10])
{
Caption = 'Customer Price Group';
Editable = false;
TableRelation = "Customer Price Group";
}
field(45; "Job No."; Code[20])
{
Caption = 'Project No.';
TableRelation = Job;
}
field(46; "Job Task No."; Code[20])
{
Caption = 'Project Task No.';
TableRelation = "Job Task"."Job Task No." where("Job No." = field("Job No."));
}
field(52; "Work Type Code"; Code[10])
{
Caption = 'Work Type Code';
TableRelation = "Work Type";
}
field(63; "Shipment No."; Code[20])
{
Caption = 'Shipment No.';
ToolTip = 'Specifies the number of the posted shipment for the invoice line.';
Editable = false;
}
field(64; "Shipment Line No."; Integer)
{
Caption = 'Shipment Line No.';
Editable = false;
}
field(65; "Order No."; Code[20])
{
Caption = 'Order No.';
}
field(68; "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.';
Editable = false;
TableRelation = Customer;
}
field(69; "Inv. Discount Amount"; Decimal)
{
AutoFormatExpression = GetCurrencyCode();
AutoFormatType = 1;
Caption = 'Inv. Discount Amount';
ToolTip = 'Specifies the total calculated invoice discount amount for the line.';
}
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";
}
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";
}
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.';
Editable = false;
TableRelation = "Service Invoice Line"."Line No." where("Document No." = field("Document No."));
}
field(81; "Exit Point"; Code[10])
{
Caption = 'Exit 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";
}
field(86; "Tax Liable"; Boolean)
{
Caption = 'Tax Liable';
ToolTip = 'Specifies that the bill-to customer is liable for sales tax. If the field is blank, the program does not calculate the sales tax.';
}
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";
}
field(88; "VAT Clause Code"; Code[20])
{
Caption = 'VAT Clause Code';
TableRelation = "VAT Clause";
}
field(89; "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(90; "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";
}
field(99; "VAT Base Amount"; Decimal)
{
AutoFormatExpression = GetCurrencyCode();
AutoFormatType = 1;
Caption = 'VAT Base Amount';
}
field(101; "System-Created Entry"; Boolean)
{
Caption = 'System-Created Entry';
Editable = false;
}
field(103; "Line Amount"; Decimal)
{
AutoFormatExpression = GetCurrencyCode();
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.';
}
field(104; "VAT Difference"; Decimal)
{
AutoFormatExpression = GetCurrencyCode();
AutoFormatType = 1;
Caption = 'VAT Difference';
Editable = false;
}
field(106; "VAT Identifier"; Code[20])
{
Caption = 'VAT Identifier';
Editable = false;
}
field(145; "Pmt. Discount Amount"; Decimal)
{
AutoFormatExpression = GetCurrencyCode();
AutoFormatType = 1;
Caption = 'Pmt. Discount Amount';
}
field(480; "Dimension Set ID"; Integer)
{
Caption = 'Dimension Set ID';
Editable = false;
TableRelation = "Dimension Set Entry";
trigger OnLookup()
begin
Rec.ShowDimensions();
end;
}
field(1019; "Job Planning Line No."; Integer)
{
AccessByPermission = TableData Job = R;
BlankZero = true;
Caption = 'Project Planning Line No.';
}
field(5402; "Variant Code"; Code[10])
{
Caption = 'Variant Code';
ToolTip = 'Specifies the variant of the item on the line.';
TableRelation = if (Type = const(Item)) "Item Variant".Code where("Item No." = field("No."));
}
field(5403; "Bin Code"; Code[20])
{
Caption = 'Bin Code';
ToolTip = 'Specifies the bin where the items are picked or put away.';
TableRelation = Bin.Code where("Location Code" = field("Location Code"));
}
field(5404; "Qty. per Unit of Measure"; Decimal)
{
AutoFormatType = 0;
Caption = 'Qty. per Unit of Measure';
DecimalPlaces = 0 : 5;
Editable = false;
InitValue = 1;
}
field(5407; "Unit of Measure Code"; Code[10])
{
Caption = 'Unit of Measure Code';
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.';
TableRelation = if (Type = const(Item)) "Item Unit of Measure".Code where("Item No." = field("No."))
else
"Unit of Measure";
}
field(5415; "Quantity (Base)"; Decimal)
{
AutoFormatType = 0;
Caption = 'Quantity (Base)';
DecimalPlaces = 0 : 5;
}
field(5700; "Responsibility Center"; Code[10])
{
Caption = 'Responsibility Center';
Editable = false;
TableRelation = "Responsibility Center";
}
field(5702; "Substitution Available"; Boolean)
{
Caption = 'Substitution Available';
Editable = false;
}
field(5709; "Item Category Code"; Code[20])
{
Caption = 'Item Category Code';
TableRelation = "Item Category".Code;
}
field(5710; Nonstock; Boolean)
{
Caption = 'Catalog';
ToolTip = 'Specifies that the item on the invoice line is a catalog item.';
Editable = false;
}
field(5725; "Item Reference No."; Code[50])
{
AccessByPermission = TableData "Item Reference" = R;
Caption = 'Item Reference No.';
ToolTip = 'Specifies the referenced item number.';
}
field(5726; "Item Reference Unit of Measure"; Code[10])
{
Caption = 'Unit of Measure (Item Ref.)';
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(5902; "Service Item No."; Code[20])
{
Caption = 'Service Item No.';
ToolTip = 'Specifies the number of the service item to which this invoice line is linked.';
TableRelation = "Service Item"."No.";
}
field(5903; "Appl.-to Service Entry"; Integer)
{
AccessByPermission = TableData Item = R;
Caption = 'Appl.-to Service Entry';
ToolTip = 'Specifies the number of the service ledger entry that the program applies this service invoice line to.';
Editable = false;
}
field(5904; "Service Item Line No."; Integer)
{
Caption = 'Service Item Line No.';
}
field(5905; "Service Item Serial No."; Code[50])
{
Caption = 'Service Item Serial No.';
ToolTip = 'Specifies the serial number of the service item to which this invoice line is linked.';
}
field(5906; "Service Item Line Description"; Text[100])
{
Caption = 'Service Item Line Description';
Editable = false;
}
field(5907; "Serv. Price Adjmt. Gr. Code"; Code[10])
{
Caption = 'Serv. Price Adjmt. Gr. Code';
ToolTip = 'Specifies the service price adjustment group code that applies to the invoice line.';
Editable = false;
TableRelation = "Service Price Adjustment Group";
}
field(5908; "Posting Date"; Date)
{
Caption = 'Posting Date';
}
field(5910; "Needed by Date"; Date)
{
Caption = 'Needed by Date';
}
field(5916; "Ship-to Code"; Code[10])
{
Caption = 'Ship-to Code';
Editable = false;
TableRelation = "Ship-to Address".Code where("Customer No." = field("Customer No."));
}
field(5918; "Quantity Consumed"; Decimal)
{
AutoFormatType = 0;
Caption = 'Quantity Consumed';
DecimalPlaces = 0 : 5;
Editable = false;
}
field(5920; "Qty. Consumed (Base)"; Decimal)
{
AutoFormatType = 0;
Caption = 'Qty. Consumed (Base)';
DecimalPlaces = 0 : 5;
Editable = false;
}
field(5928; "Service Price Group Code"; Code[10])
{
Caption = 'Service Price Group Code';
TableRelation = "Service Price Group";
}
field(5929; "Fault Area Code"; Code[10])
{
Caption = 'Fault Area Code';
TableRelation = "Fault Area";
}
field(5930; "Symptom Code"; Code[10])
{
Caption = 'Symptom Code';
TableRelation = "Symptom Code";
}
field(5931; "Fault Code"; Code[10])
{
Caption = 'Fault Code';
TableRelation = "Fault Code".Code where("Fault Area Code" = field("Fault Area Code"),
"Symptom Code" = field("Symptom Code"));
}
field(5932; "Resolution Code"; Code[10])
{
Caption = 'Resolution Code';
TableRelation = "Resolution Code";
}
field(5933; "Exclude Warranty"; Boolean)
{
Caption = 'Exclude Warranty';
Editable = true;
}
field(5934; Warranty; Boolean)
{
Caption = 'Warranty';
Editable = false;
}
field(5936; "Contract No."; Code[20])
{
Caption = 'Contract No.';
ToolTip = 'Specifies the number of the contract associated with the posted service invoice.';
Editable = false;
TableRelation = "Service Contract Header"."Contract No." where("Contract Type" = const(Contract));
}
field(5938; "Contract Disc. %"; Decimal)
{
AutoFormatType = 0;
Caption = 'Contract Disc. %';
DecimalPlaces = 0 : 5;
Editable = false;
MaxValue = 100;
MinValue = 0;
}
field(5939; "Warranty Disc. %"; Decimal)
{
AutoFormatType = 0;
Caption = 'Warranty Disc. %';
DecimalPlaces = 0 : 5;
Editable = false;
MaxValue = 100;
MinValue = 0;
}
field(5965; "Component Line No."; Integer)
{
Caption = 'Component Line No.';
}
field(5966; "Spare Part Action"; Option)
{
Caption = 'Spare Part Action';
OptionCaption = ' ,Permanent,Temporary,Component Replaced,Component Installed';
OptionMembers = " ",Permanent,"Temporary","Component Replaced","Component Installed";
}
field(5967; "Fault Reason Code"; Code[10])
{
Caption = 'Fault Reason Code';
TableRelation = "Fault Reason Code";
}
field(5968; "Replaced Item No."; Code[20])
{
Caption = 'Replaced Item No.';
TableRelation = if ("Replaced Item Type" = const("Service Item")) "Service Item"
else
if ("Replaced Item Type" = const(Item)) Item;
}
field(5969; "Exclude Contract Discount"; Boolean)
{
Caption = 'Exclude Contract Discount';
Editable = true;
}
field(5970; "Replaced Item Type"; Option)
{
Caption = 'Replaced Item Type';
OptionCaption = ' ,Service Item,Item';
OptionMembers = " ","Service Item",Item;
}
field(5994; "Price Adjmt. Status"; Option)
{
Caption = 'Price Adjmt. Status';
Editable = false;
OptionCaption = ' ,Adjusted,Modified';
OptionMembers = " ",Adjusted,Modified;
}
field(5997; "Line Discount Type"; Option)
{
Caption = 'Line Discount Type';
Editable = false;
OptionCaption = ' ,Warranty Disc.,Contract Disc.,Line Disc.,Manual';
OptionMembers = " ","Warranty Disc.","Contract Disc.","Line Disc.",Manual;
}
field(5999; "Copy Components From"; Option)
{
Caption = 'Copy Components From';
OptionCaption = 'None,Item BOM,Old Service Item,Old Serv.Item w/o Serial No.';
OptionMembers = "None","Item BOM","Old Service Item","Old Serv.Item w/o Serial No.";
}
field(6608; "Return Reason Code"; Code[10])
{
Caption = 'Return Reason Code';
ToolTip = 'Specifies the code explaining why the item was returned.';
TableRelation = "Return Reason";
}
field(7000; "Price Calculation Method"; Enum "Price Calculation Method")
{
Caption = 'Price Calculation Method';
}
field(7001; "Allow Line Disc."; Boolean)
{
Caption = 'Allow Line Disc.';
}
field(7002; "Customer Disc. Group"; Code[20])
{
Caption = 'Customer Disc. Group';
TableRelation = "Customer Discount Group";
}
}
keys
{
key(Key1; "Document No.", "Line No.")
{
Clustered = true;
}
key(Key2; Type, "No.")
{
}
key(Key3; "Service Item No.", Type, "Posting Date")
{
}
key(Key4; "Document No.", "Service Item No.")
{
}
key(Key5; "Document No.", "Service Item Line No.", "Serv. Price Adjmt. Gr. Code")
{
SumIndexFields = Amount;
}
key(Key6; "Document No.", "Service Item Line No.", Type, "No.")
{
}
key(Key7; Type, "No.", "Variant Code", "Location Code", "Posting Date", "Shortcut Dimension 1 Code", "Shortcut Dimension 2 Code")
{
SumIndexFields = "Quantity (Base)";
}
key(Key8; "Appl.-to Service Entry")
{
}
key(Key9; "Document No.", "Service Item Line No.", "Component Line No.")
{
}
key(Key10; "Fault Reason Code")
{
}
key(Key11; "Customer No.")
{
}
key(Key12; "Document No.", Type)
{
MaintainSqlIndex = false;
SumIndexFields = Amount;
}
}
fieldgroups
{
}
var
DimMgt: Codeunit DimensionManagement;
procedure ShowItemTrackingLines()
var
ItemTrackingDocMgt: Codeunit "Item Tracking Doc. Management";
begin
ItemTrackingDocMgt.ShowItemTrackingForInvoiceLine(RowID1());
end;
procedure CalcVATAmountLines(ServInvHeader: Record "Service Invoice Header"; var TempVATAmountLine: Record "VAT Amount Line" temporary)
begin
TempVATAmountLine.DeleteAll();
SetRange("Document No.", ServInvHeader."No.");
if Find('-') then
repeat
TempVATAmountLine.Init();
Rec.CopyToVATAmountLine(TempVATAmountLine);
OnCalcVATAmountLinesOnBeforeInsertLine(ServInvHeader, TempVATAmountLine);
TempVATAmountLine.InsertLine();
until Next() = 0;
end;
procedure CopyToVATAmountLine(var VATAmountLine: Record "VAT Amount Line")
begin
VATAmountLine."VAT Identifier" := Rec."VAT Identifier";
VATAmountLine."VAT Calculation Type" := Rec."VAT Calculation Type";
VATAmountLine."VAT Clause Code" := Rec."VAT Clause Code";
VATAmountLine."Tax Group Code" := Rec."Tax Group Code";
VATAmountLine."VAT %" := Rec."VAT %";
VATAmountLine."VAT Base" := Rec.Amount;
VATAmountLine."VAT Amount" := Rec."Amount Including VAT" - Rec.Amount;
VATAmountLine."Amount Including VAT" := Rec."Amount Including VAT";
VATAmountLine."Line Amount" := Rec."Line Amount";
if Rec."Allow Invoice Disc." then
VATAmountLine."Inv. Disc. Base Amount" := Rec."Line Amount";
VATAmountLine."Invoice Discount Amount" := Rec."Inv. Discount Amount";
VATAmountLine.Quantity := Rec."Quantity (Base)";
VATAmountLine."Calculated VAT Amount" := Rec."Amount Including VAT" - Rec.Amount - Rec."VAT Difference";
VATAmountLine."VAT Difference" := Rec."VAT Difference";
OnAfterCopyToVATAmountLine(Rec, VATAmountLine);
end;
procedure RowID1(): Text[250]
var
ItemTrackingMgt: Codeunit "Item Tracking Management";
begin
exit(ItemTrackingMgt.ComposeRowID(DATABASE::"Service Invoice Line", 0, "Document No.", '', 0, "Line No."));
end;
procedure GetCaptionClass(FieldNumber: Integer): Text[80]
var
ServiceInvHeader: Record "Service Invoice Header";
begin
if not ServiceInvHeader.Get("Document No.") then
ServiceInvHeader.Init();
if ServiceInvHeader."Prices Including VAT" then
exit('2,1,' + GetFieldCaption(FieldNumber));
exit('2,0,' + GetFieldCaption(FieldNumber));
end;
local procedure GetFieldCaption(FieldNumber: Integer): Text[100]
var
"Field": Record "Field";
begin
Field.Get(DATABASE::"Service Invoice Line", FieldNumber);
exit(Field."Field Caption");
end;
procedure ShowDimensions()
begin
DimMgt.ShowDimensionSet("Dimension Set ID",
StrSubstNo('%1 %2 %3', TableCaption(), "Document No.", "Line No."));
end;
procedure ShowShortcutDimCode(var ShortcutDimCode: array[8] of Code[20])
begin
DimMgt.GetShortcutDimensions(Rec."Dimension Set ID", ShortcutDimCode);
end;
procedure GetCurrencyCode(): Code[10]
var
ServiceInvHeader: Record "Service Invoice Header";
begin
if "Document No." = ServiceInvHeader."No." then
exit(ServiceInvHeader."Currency Code");
if ServiceInvHeader.Get("Document No.") then
exit(ServiceInvHeader."Currency Code");
exit('');
end;
local procedure GetServShptLines(var TempServiceShipmentLine: Record "Service Shipment Line" temporary)
var
ServiceShipmentLine: Record "Service Shipment Line";
ValueItemLedgerEntries: Query "Value Item Ledger Entries";
begin
TempServiceShipmentLine.Reset();
TempServiceShipmentLine.DeleteAll();
if Type <> Type::Item then
exit;
ValueItemLedgerEntries.SetRange(Value_Entry_Doc_No, "Document No.");
ValueItemLedgerEntries.SetRange(Value_Entry_Doc_Type, Enum::"Item Ledger Document Type"::"Service Invoice");
ValueItemLedgerEntries.SetRange(Value_Entry_Doc_Line_No, "Line No.");
ValueItemLedgerEntries.SetRange(Item_Ledg_Document_Type, Enum::"Item Ledger Document Type"::"Service Shipment");
ValueItemLedgerEntries.Open();
while ValueItemLedgerEntries.Read() do
if ServiceShipmentLine.Get(ValueItemLedgerEntries.Item_Ledg_Document_No, ValueItemLedgerEntries.Item_Ledg_Document_Line_No) then begin
TempServiceShipmentLine.Init();
TempServiceShipmentLine := ServiceShipmentLine;
if TempServiceShipmentLine.Insert() then;
end;
end;
procedure FilterPstdDocLineValueEntries(var ValueEntry: Record "Value Entry")
begin
ValueEntry.Reset();
ValueEntry.SetCurrentKey("Document No.");
ValueEntry.SetRange("Document No.", "Document No.");
ValueEntry.SetRange("Document Type", ValueEntry."Document Type"::"Service Invoice");
ValueEntry.SetRange("Document Line No.", "Line No.");
end;
procedure ShowItemShipmentLines()
var
TempServShptLine: Record "Service Shipment Line" temporary;
begin
if Type = Type::Item then begin
GetServShptLines(TempServShptLine);
PAGE.RunModal(0, TempServShptLine);
end;
end;
procedure SetSecurityFilterOnRespCenter()
var
UserSetupMgt: Codeunit "User Setup Management";
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeSetSecurityFilterOnRespCenter(Rec, IsHandled);
if IsHandled then
exit;
if UserSetupMgt.GetServiceFilter() <> '' then begin
FilterGroup(2);
SetRange("Responsibility Center", UserSetupMgt.GetServiceFilter());
FilterGroup(0);
end;
end;
internal procedure GetVATPct() VATPct: Decimal
begin
VATPct := "VAT %";
OnAfterGetVATPct(Rec, VATPct);
end;
[IntegrationEvent(false, false)]
local procedure OnCalcVATAmountLinesOnBeforeInsertLine(ServInvHeader: Record "Service Invoice Header"; var TempVATAmountLine: Record "VAT Amount Line" temporary)
begin
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeSetSecurityFilterOnRespCenter(var ServiceInvoiceLine: Record "Service Invoice Line"; var IsHandled: Boolean)
begin
end;
[IntegrationEvent(false, false)]
local procedure OnAfterCopyToVATAmountLine(ServiceInvoiceLine: Record "Service Invoice Line"; var VATAmountLine: Record "VAT Amount Line")
begin
end;
[IntegrationEvent(false, false)]
local procedure OnAfterGetVATPct(var ServiceInvoiceLine: Record "Service Invoice Line"; var VATPct: Decimal)
begin
end;
}