-
Notifications
You must be signed in to change notification settings - Fork 685
Open
Labels
FinanceGitHub request for Finance areaGitHub request for Finance areaevent-requestRequest for adding an eventRequest for adding an event
Description
Why do you need this change?
Can you add OnBeforeAddServiceLine, OnAfterAddServiceLine, OnAddServiceLineOnAfterTempSalesTaxAmountLineSetFilters and OnAddServiceLineOnAfterSetSalesTaxAmountLineFilter events to the AddServcieLine procedure just like codeunit 398 "Sales Tax Calculate" AddSalesLine procedure ?
Describe the request
We needs to add extra filter to the Sales Tax Amount Line before it insert or modify.
procedure AddServiceLine(ServiceLine: Record "Service Line")
var
TaxArea: Record "Tax Area";
TaxAreaLine: Record "Tax Area Line";
TaxJurisdiction: Record "Tax Jurisdiction";
begin
OnBeforeAddServiceLine(ServiceLine);
if not ServHeaderRead then begin
ServiceHeader.Get(ServiceLine."Document Type", ServiceLine."Document No.");
ServHeaderRead := true;
......
TempSalesTaxAmountLine.SetRange("Tax Group Code", ServiceLine."Tax Group Code");
TaxAreaLine.SetCurrentKey("Tax Area", "Calculation Order");
TaxAreaLine.SetRange("Tax Area", ServiceLine."Tax Area Code");
OnAddServiceLineOnAfterTempSalesTaxAmountLineSetFilters(TempSalesTaxAmountLine);
if TaxAreaLine.FindSet() then
repeat
TempSalesTaxAmountLine.SetRange("Tax Jurisdiction Code", TaxAreaLine."Tax Jurisdiction Code");
TempSalesTaxAmountLine."Tax Jurisdiction Code" := TaxAreaLine."Tax Jurisdiction Code";
OnAddServiceLineOnAfterSetSalesTaxAmountLineFilter (TempSalesTaxAmountLine, ServiceLine, TaxAreaLine);
if not TempSalesTaxAmountLine.FindFirst() then begin
......
until TaxAreaLine.Next() = 0;
SalesTaxCalculate.SetSalesTaxAmountLineTable(TempSalesTaxAmountLine);
OnAfterAddServiceLine(TempSalesTaxAmountLine, ServiceLine)
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeAddServiceLine(var ServiceLine: Record "Service Line");
begin
end;
[IntegrationEvent(false, false)]
local procedure OnAddServiceLineOnAfterTempSalesTaxAmountLineSetFilters(var TempSalesTaxAmountLine: Record "Sales Tax Amount Line" temporary)
begin
end;
[IntegrationEvent(false, false)]
local procedure OnAddServiceLineOnAfterSetSalesTaxAmountLineFilter(var TempSalesTaxAmountLine: Record "Sales Tax Amount Line" temporary; ServiceLine: Record "Service Line"; TaxAreaLine: Record "Tax Area Line");
begin
end;
[IntegrationEvent(false, false)]
local procedure OnAfterAddServiceLine(TempSalesTaxLine: Record "Sales Tax Amount Line" temporary; ServiceLine: Record "Service Line")
begin
end;
Internal work item: AB#615906
Metadata
Metadata
Assignees
Labels
FinanceGitHub request for Finance areaGitHub request for Finance areaevent-requestRequest for adding an eventRequest for adding an event