Change the code in the CalcLineTotal2C function in the VAT Statement report (12) as follows:
Existing code...
IF VATStmtLine2."Amount Type" = VATStmtLine2."Amount Type"::"Amount+Base" THEN BEGIN
VATEntry.CALCSUMS(Amount,Base,"Additional-Currency Amount","Additional-Currency Base");
Amount := ConditionalAdd(0,VATEntry.Amount,VATEntry."Additional-Currency Amount");
// Delete the following line.
Base := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
END;
CalculateTotalAmount(VATStmtLine2);
END;
...
Replacement code...
IF VATStmtLine2."Amount Type" = VATStmtLine2."Amount Type"::"Amount+Base" THEN BEGIN
VATEntry.CALCSUMS(Amount,Base,"Additional-Currency Amount","Additional-Currency Base");
Amount := ConditionalAdd(0,VATEntry.Amount,VATEntry."Additional-Currency Amount");
// Add the following lines.
IF VATEntry."VAT Calculation Type" = VATEntry."VAT Calculation Type"::"Full VAT" THEN
Base := ConditionalAdd(0,CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry.Amount,UseAmtsInAddCurr),
CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry."Additional-Currency Amount",UseAmtsInAddCurr))
ELSE
Base := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
// End of the lines.
END;
CalculateTotalAmount(VATStmtLine2);
END;
...
Change the code in the CalcLineTotal function in the VAT Statement report (12) as follows:
Existing code 1...
BEGIN
VATEntry.CALCSUMS(Base,Amount,"Additional-Currency Base");
Amount := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
END;
VATStmtLine2."Amount Type"::"Unrealized Amount":
BEGIN
...
Replacement code 1...
BEGIN
VATEntry.CALCSUMS(Base,Amount,"Additional-Currency Base");
Amount := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
// Add the following lines.
IF VATEntry."VAT Calculation Type" = VATEntry."VAT Calculation Type"::"Full VAT" THEN BEGIN
Base := ConditionalAdd(0,CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry.Amount,UseAmtsInAddCurr),
CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry."Additional-Currency Amount",UseAmtsInAddCurr));
Amount := Amount + Base;
END;
// End of the lines.
END;
VATStmtLine2."Amount Type"::"Unrealized Amount":
BEGIN
...
Existing code 2...
END;
VATStmtLine2."Amount Type"::"Amount+Base":
BEGIN
// Delete the following lines.
VATEntry.CALCSUMS(Amount,Base,VATEntry."Additional-Currency Amount",VATEntry."Additional-Currency Base");
IF VATPostSetup.GET(VATEntry."VAT Bus. Posting Group",VATEntry."VAT Prod. Posting Group") THEN BEGIN
IF VATPostSetup."VAT+EC %" <> 0 THEN BEGIN
VATAmount := (VATEntry.Amount / VATPostSetup."VAT+EC %") * VATEntry."VAT %";
VATAmountAC := (VATEntry."Additional-Currency Amount" / VATPostSetup."VAT+EC %")* VATEntry."VAT %";
END;
Amount := ConditionalAdd(0,VATAmount,VATAmountAC);
END;
Base := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
Amount := Amount + Base;
// End of the lines.
END;
END;
...
Replacement code 2...
END;
VATStmtLine2."Amount Type"::"Amount+Base":
BEGIN
// Add the following lines.
VATEntry.CALCSUMS(Amount,Base,VATEntry."Additional-Currency Amount",VATEntry."Additional-Currency Base");
Amount := ConditionalAdd(0,VATEntry.Amount,VATEntry."Additional-Currency Amount");
IF VATEntry."VAT Calculation Type" = VATEntry."VAT Calculation Type"::"Full VAT" THEN
Base := ConditionalAdd(0,CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry.Amount,UseAmtsInAddCurr),
CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry."Additional-Currency Amount",UseAmtsInAddCurr))
ELSE
Base := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
Amount := Amount + Base;
// End of the lines.
END;
END;
...
Existing code 3...
BEGIN
VATEntry.CALCSUMS(Base,"Additional-Currency Base");
Amount := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
END;
VATStmtLine2."Amount Type"::"Unrealized Amount":
BEGIN
...
Replacement code 3...
BEGIN
VATEntry.CALCSUMS(Base,"Additional-Currency Base");
Amount := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
// Add the following lines.
IF VATEntry."VAT Calculation Type" = VATEntry."VAT Calculation Type"::"Full VAT" THEN BEGIN
Base := ConditionalAdd(0,CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry.Amount,UseAmtsInAddCurr),
CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry."Additional-Currency Amount",UseAmtsInAddCurr));
Amount := Amount + Base;
END;
// End of the lines.
END;
VATStmtLine2."Amount Type"::"Unrealized Amount":
BEGIN
...
Existing code 4...
END;
VATStmtLine2."Amount Type"::"Amount+Base":
BEGIN
// Delete the following lines.
VATEntry.CALCSUMS(Amount,Base,VATEntry."Additional-Currency Amount",VATEntry."Additional-Currency Base");
IF VATPostSetup.GET(VATEntry."VAT Bus. Posting Group",VATEntry."VAT Prod. Posting Group") THEN BEGIN
IF VATPostSetup."VAT+EC %" <> 0 THEN BEGIN
VATAmount := (VATEntry.Amount / VATPostSetup."VAT+EC %") * VATEntry."EC %";
VATAmountAC := (VATEntry."Additional-Currency Amount" / VATPostSetup."VAT+EC %")* VATEntry."EC %";
END;
Amount := ConditionalAdd(0,VATAmount,VATAmountAC);
END;
Base := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
Amount := Amount + Base;
END;
// End of the lines.
END;
...
Replacement code 4...
END;
VATStmtLine2."Amount Type"::"Amount+Base":
BEGIN
// Add the following lines.
VATEntry.CALCSUMS(Amount,Base,VATEntry."Additional-Currency Amount",VATEntry."Additional-Currency Base");
Amount := ConditionalAdd(0,VATEntry.Amount,VATEntry."Additional-Currency Amount");
IF VATEntry."VAT Calculation Type" = VATEntry."VAT Calculation Type"::"Full VAT" THEN
Base := ConditionalAdd(0,CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry.Amount,FALSE),
CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry."Additional-Currency Amount",FALSE))
ELSE
Base := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
Amount := Amount + Base;
END
// End of the lines.
END;
...
Change the code in the CalcTotLine function in the Telematic VAT Declaration report (10715) as follows:
Existing code 1...
BEGIN
VATEntry.CALCSUMS(Base,"Additional-Currency Base");
Amount := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
END;
VATStatementLine2."Amount Type"::"Unrealized Amount":
BEGIN
...
Replacement code 1...
BEGIN
VATEntry.CALCSUMS(Base,"Additional-Currency Base");
Amount := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
// Add the following lines.
IF VATEntry."VAT Calculation Type" = VATEntry."VAT Calculation Type"::"Full VAT" THEN BEGIN
Base := ConditionalAdd(0,CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry.Amount,PrintAmtInAddCurr),
CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry."Additional-Currency Amount",PrintAmtInAddCurr));
Amount := Amount + Base;
END;
// End of the lines.
END;
VATStatementLine2."Amount Type"::"Unrealized Amount":
BEGIN
...
Existing code 2...
BEGIN
VATEntry.CALCSUMS(Amount,Base,"Additional-Currency Amount","Additional-Currency Base");
Amount := ConditionalAdd(0,VATEntry.Amount,VATEntry."Additional-Currency Amount");
// Delete the following line.
Base := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
END;
END;
CalcTotAmount(VATStatementLine2,TotalAmount);
...
Replacement code 2...
BEGIN
VATEntry.CALCSUMS(Amount,Base,"Additional-Currency Amount","Additional-Currency Base");
Amount := ConditionalAdd(0,VATEntry.Amount,VATEntry."Additional-Currency Amount");
// Add the following lines.
IF VATEntry."VAT Calculation Type" = VATEntry."VAT Calculation Type"::"Full VAT" THEN
Base := ConditionalAdd(0,CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry.Amount,PrintAmtInAddCurr),
CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry."Additional-Currency Amount",PrintAmtInAddCurr))
ELSE
Base := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
Amount := Amount + Base;
// End of the lines.
END;
END;
CalcTotAmount(VATStatementLine2,TotalAmount);
...
Existing code 3...
BEGIN
VATEntry.CALCSUMS(Base,"Additional-Currency Base");
Amount := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
END;
VATStatementLine2."Amount Type"::"Unrealized Amount":
BEGIN
...
Replacement code 3...
BEGIN
VATEntry.CALCSUMS(Base,"Additional-Currency Base");
Amount := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
// Add the following lines.
IF VATEntry."VAT Calculation Type" = VATEntry."VAT Calculation Type"::"Full VAT" THEN BEGIN
Base := ConditionalAdd(0,CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry.Amount,PrintAmtInAddCurr),
CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry."Additional-Currency Amount",PrintAmtInAddCurr));
Amount := Amount + Base;
END;
// End of the lines.
END;
VATStatementLine2."Amount Type"::"Unrealized Amount":
BEGIN
...
Existing code 4...
BEGIN
VATEntry.CALCSUMS(Amount,Base,"Additional-Currency Amount","Additional-Currency Base");
Amount := ConditionalAdd(0,VATEntry.Amount,VATEntry."Additional-Currency Amount");
// Delete the following line.
Base := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
END;
END;
CalcTotAmount(VATStatementLine2,TotalAmount);
...
Replacement code 4...
BEGIN
VATEntry.CALCSUMS(Amount,Base,"Additional-Currency Amount","Additional-Currency Base");
Amount := ConditionalAdd(0,VATEntry.Amount,VATEntry."Additional-Currency Amount");
// Add the following lines.
IF VATEntry."VAT Calculation Type" = VATEntry."VAT Calculation Type"::"Full VAT" THEN
Base := ConditionalAdd(0,CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry.Amount,PrintAmtInAddCurr),
CalcTotalVATBase(VATEntry."VAT %",VATEntry."EC %",VATEntry."Additional-Currency Amount",PrintAmtInAddCurr))
ELSE
Base := ConditionalAdd(0,VATEntry.Base,VATEntry."Additional-Currency Base");
Amount := Amount + Base;
// End of the lines.
END;
END;
CalcTotAmount(VATStatementLine2,TotalAmount);
...