You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Requesting a new event publisher on Report 1307 "Standard Sales - Credit Memo"
Event
OnBeforeVATAmountLineInsertLine(var VATAmountLine: Record "VAT Amount Line"; SalesInvoiceLine: Record "Sales Invoice Line"; var IsHandled: Boolean)
In Report 1306 "Standard Sales - Invoice" this is already done and avilable:
begin
InitializeShipmentLine();
if Type = Type::"G/L Account" then
"No." := '';
OnBeforeLineOnAfterGetRecord(Header, Line);
if "Line Discount %" = 0 then
LineDiscountPctText := ''
else
LineDiscountPctText := StrSubstNo('%1%', -Round("Line Discount %", 0.1));
This procedure call is added!
InsertVATAmountLine(VATAmountLine, Line);
TransHeaderAmount += PrevLineAmount;
PrevLineAmount := "Line Amount";
TotalSubTotal += "Line Amount";
TotalInvDiscAmount -= "Inv. Discount Amount";
TotalAmount += Amount;
TotalAmountVAT += "Amount Including VAT" - Amount;
TotalAmountInclVAT += "Amount Including VAT";
TotalPaymentDiscOnVAT += -("Line Amount" - "Inv. Discount Amount" - "Amount Including VAT");
if FormatDocument.HideDocumentLine(HideLinesWithZeroQuantity, Line, FieldNo(Quantity)) then
CurrReport.Skip();
if FirstLineHasBeenOutput then
Clear(DummyCompanyInfo.Picture);
FirstLineHasBeenOutput := true;
JobNo := "Job No.";
JobTaskNo := "Job Task No.";
if JobTaskNo <> '' then begin
JobTaskNoLbl := JobTaskNoLbl2;
JobTaskDescription := GetJobTaskDescription(JobNo, JobTaskNo);
end else begin
JobTaskDescription := '';
JobTaskNoLbl := '';
end;
if JobNo <> '' then
JobNoLbl := JobNoLbl2
else
JobNoLbl := '';
FormatLineValues(Line);
end;
The Below defined procedure and Integration event can be copied from Report 1306 "Standard Sales - Invoice"
local procedure InsertVATAmountLine(var VATAmountLine2: Record "VAT Amount Line"; SalesInvoiceLine: Record "Sales Invoice Line")
var
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeVATAmountLineInsertLine(VATAmountLine2, SalesInvoiceLine, IsHandled);
if IsHandled then
exit;
VATAmountLine2.Init();
VATAmountLine2."VAT Identifier" := SalesInvoiceLine."VAT Identifier";
VATAmountLine2."VAT Calculation Type" := SalesInvoiceLine."VAT Calculation Type";
VATAmountLine2."Tax Group Code" := SalesInvoiceLine."Tax Group Code";
VATAmountLine2."VAT %" := SalesInvoiceLine."VAT %";
VATAmountLine2."VAT Base" := SalesInvoiceLine.Amount;
VATAmountLine2."Amount Including VAT" := SalesInvoiceLine."Amount Including VAT";
VATAmountLine2."Line Amount" := SalesInvoiceLine."Line Amount";
if SalesInvoiceLine."Allow Invoice Disc." then
VATAmountLine2."Inv. Disc. Base Amount" := SalesInvoiceLine."Line Amount";
VATAmountLine2."Invoice Discount Amount" := SalesInvoiceLine."Inv. Discount Amount";
VATAmountLine2."VAT Clause Code" := SalesInvoiceLine."VAT Clause Code";
VATAmountLine2.InsertLine();
end;
And Integration Event:
[IntegrationEvent(false, false)]
local procedure OnBeforeVATAmountLineInsertLine(var VATAmountLine: Record "VAT Amount Line"; SalesInvoiceLine: Record "Sales Invoice Line"; var IsHandled: Boolean)
begin
end;
The Above defined integration event we also need in Report 1307 "Standard Sales - Credit Memo
So in Report report 1307 "Standard Sales - Credit Memo" the code is now as shown below:
trigger OnAfterGetRecord()
begin
InitializeSalesShipmentLine();
if Type = Type::"G/L Account" then
"No." := '';
OnLineOnAfterGetRecordOnBeforeCheckLineDiscount(Line, Header);
if "Line Discount %" = 0 then
LineDiscountPctText := ''
else
LineDiscountPctText := StrSubstNo('%1%', -Round("Line Discount %", 0.1));
Copy below written code to new to add procedure InsertVATAmountLine(VATAmountLine, Line)
VATAmountLine.Init();
VATAmountLine."VAT Identifier" := "VAT Identifier";
VATAmountLine."VAT Calculation Type" := "VAT Calculation Type";
VATAmountLine."Tax Group Code" := "Tax Group Code";
VATAmountLine."VAT %" := "VAT %";
VATAmountLine."VAT Base" := Amount;
VATAmountLine."Amount Including VAT" := "Amount Including VAT";
VATAmountLine."Line Amount" := "Line Amount";
if "Allow Invoice Disc." then
VATAmountLine."Inv. Disc. Base Amount" := "Line Amount";
VATAmountLine."Invoice Discount Amount" := "Inv. Discount Amount";
VATAmountLine."VAT Clause Code" := "VAT Clause Code";
VATAmountLine.InsertLine();
Rest of Code
Additional context
Please make the handling of writing VATAmountLines consistent between de Sales Reports 1306 and 1307. We now encounter the issue that a VATAmountLine is inserted also for Text Lines in Report 1307 "Standard Sales - Credit Memo". With the above mentioned change we can subscribe and skip the creation of VATAmountLines for Text Sales Credit Memo Lines.
The text was updated successfully, but these errors were encountered:
Describe the request
Requesting a new event publisher on Report 1307 "Standard Sales - Credit Memo"
Event
OnBeforeVATAmountLineInsertLine(var VATAmountLine: Record "VAT Amount Line"; SalesInvoiceLine: Record "Sales Invoice Line"; var IsHandled: Boolean)
In Report 1306 "Standard Sales - Invoice" this is already done and avilable:
Code
OnAfterGetRecord() ("Sales Invoice Line" Data-item)
This procedure call is added!
The Below defined procedure and Integration event can be copied from Report 1306 "Standard Sales - Invoice"
And Integration Event:
The Above defined integration event we also need in Report 1307 "Standard Sales - Credit Memo
So in Report report 1307 "Standard Sales - Credit Memo" the code is now as shown below:
Copy below written code to new to add procedure InsertVATAmountLine(VATAmountLine, Line)
Rest of Code
Additional context
Please make the handling of writing VATAmountLines consistent between de Sales Reports 1306 and 1307. We now encounter the issue that a VATAmountLine is inserted also for Text Lines in Report 1307 "Standard Sales - Credit Memo". With the above mentioned change we can subscribe and skip the creation of VATAmountLines for Text Sales Credit Memo Lines.
The text was updated successfully, but these errors were encountered: