This article applies to Microsoft Dynamics NAV for the following countries and language locales.
- Slovak (sk)
- Czech (cz)
Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.
View products that this article applies to.
...
"VAT Difference" :=
"VAT Amount" -
ROUND(
// Delete the following lines.
Amount * "VAT %" / (100 + "VAT %"),
Currency."Amount Rounding Precision",Currency.VATRoundingDirection);
// End of the lines.
GLSetup.GET;
GLSetup.GetRoundingParamentersLCY(Currency,RoundingPrecisionLCY,RoundingDirectionLCY);
...
...
"VAT Difference" :=
"VAT Amount" -
ROUND(
// Add the following lines.
Amount - ROUND(Amount / (1 + "VAT %" / 100),
Currency."Amount Rounding Precision",Currency.VATRoundingDirection));
//End of the lines.
GLSetup.GET;
GLSetup.GetRoundingParamentersLCY(Currency,RoundingPrecisionLCY,RoundingDirectionLCY);
...
...
CASE "VAT Calculation Type" OF
"VAT Calculation Type"::"Normal VAT",
"VAT Calculation Type"::"Reverse Charge VAT":
// Delete the following lines.
BEGIN
GLSetup.GET;
IF GLSetup."Round VAT Coeff." THEN BEGIN
GLSetup.GetRoundingParamenters(Currency,RoundingPrecision,RoundingDirection);
"VAT Amount" :=
ROUND(
Amount * ROUND("VAT %" / (100 + "VAT %"),GLSetup."VAT Coeff. Rounding Precision"),
RoundingPrecision,
RoundingDirection);
"VAT Base Amount" := Amount - "VAT Amount";
END ELSE BEGIN
"VAT Base Amount" :=
ROUND(Amount / (1 + "VAT %" / 100),Currency."Amount Rounding Precision");
"VAT Amount" :=
ROUND(Amount - "VAT Base Amount",Currency."Amount Rounding Precision",Currency.VATRoundingDirection);
END;
END;
// End of the lines.
"VAT Calculation Type"::"Full VAT":
BEGIN
IF ("Prepayment Type" = "Prepayment Type"::Advance) AND NOT "System-Created Entry" AND
...
...
CASE "VAT Calculation Type" OF
"VAT Calculation Type"::"Normal VAT",
"VAT Calculation Type"::"Reverse Charge VAT":
// Add the following line.
CalcVATAmount(Amount,"VAT Amount","VAT Base Amount","VAT %");
"VAT Calculation Type"::"Full VAT":
BEGIN
IF ("Prepayment Type" = "Prepayment Type"::Advance) AND NOT "System-Created Entry" AND
...
...
CASE "Bal. VAT Calculation Type" OF
"Bal. VAT Calculation Type"::"Normal VAT",
"Bal. VAT Calculation Type"::"Reverse Charge VAT":
// Delete the following lines.
BEGIN
GLSetup.GET;
IF GLSetup."Round VAT Coeff." THEN BEGIN
GLSetup.GetRoundingParamenters(Currency,RoundingPrecision,RoundingDirection);
"Bal. VAT Amount" :=
ROUND(
-Amount * ROUND("Bal. VAT %" / (100 + "Bal. VAT %"),GLSetup."VAT Coeff. Rounding Precision"),
RoundingPrecision,
RoundingDirection);
"Bal. VAT Base Amount" := -Amount - "Bal. VAT Amount";
END ELSE BEGIN
"Bal. VAT Base Amount" :=
ROUND(-Amount / (1 + "Bal. VAT %" / 100),Currency."Amount Rounding Precision");
"Bal. VAT Amount" :=
ROUND(-Amount - "Bal. VAT Base Amount",Currency."Amount Rounding Precision",Currency.VATRoundingDirection);
END;
END;
// End of the lines.
"Bal. VAT Calculation Type"::"Full VAT":
"Bal. VAT Amount" := -Amount;
"Bal. VAT Calculation Type"::"Sales Tax":
...
...
CASE "Bal. VAT Calculation Type" OF
"Bal. VAT Calculation Type"::"Normal VAT",
"Bal. VAT Calculation Type"::"Reverse Charge VAT":
// Add the following line
CalcVATAmount(-Amount,"Bal. VAT Amount","Bal. VAT Base Amount","Bal. VAT %");
"Bal. VAT Calculation Type"::"Full VAT":
"Bal. VAT Amount" := -Amount;
"Bal. VAT Calculation Type"::"Sales Tax":
...
LOCAL PROCEDURE CalcVATAmount@1220000(Amount@1220000 : Decimal;VAR VATAmount@1220001 : Decimal;VAR VATBase@1220002 : Decimal;VATPercent@1220003 : Decimal);
VAR
RoundingPrecision@1220004 : Decimal;
RoundingDirection@1220005 : Text[1];
BEGIN
GLSetup.GET;
IF GLSetup."Round VAT Coeff." THEN BEGIN
GLSetup.GetRoundingParamenters(Currency,RoundingPrecision,RoundingDirection);
VATAmount :=
ROUND(
Amount * ROUND(VATPercent / (100 + VATPercent),GLSetup."VAT Coeff. Rounding Precision"),
RoundingPrecision,
RoundingDirection);
VATBase := Amount - VATAmount;
END ELSE BEGIN
VATBase :=
ROUND(
Amount / (1 + VATPercent / 100),
Currency."Amount Rounding Precision",
Currency.VATRoundingDirection);
VATAmount := Amount - VATBase;
END;
END;
...
GenJnlLine."VAT Amount LCY (Non Deduct.)";
GLEntry."VAT Amount" := "Amount (LCY)" - GLEntry.Amount;
// Delete the following lines.
GLSetup.GET;
GLSetup.GetRoundingParamentersLCY(Currency,RoundingPrecisionLCY,RoundingDirectionLCY);
IF GLSetup."Round VAT Coeff." THEN
CalculatedVATAmtLCY :=
ROUND(
"Amount (LCY)" * ROUND("VAT %" / (100 + "VAT %"),GLSetup."VAT Coeff. Rounding Precision"),
RoundingPrecisionLCY,
RoundingDirectionLCY)
ELSE
CalculatedVATAmtLCY :=
ROUND(
"Amount (LCY)" - ROUND("Amount (LCY)" / (1 + "VAT %" / 100),RoundingPrecisionLCY),
RoundingPrecisionLCY,
RoundingDirectionLCY);
IF ("VAT Amount (LCY)" <> CalculatedVATAmtLCY) AND
("Currency Code" <> '')
THEN BEGIN
// End of the lines.
GLEntry.Amount := "VAT Base Amount (LCY)";
GLEntry."VAT Amount" := "VAT Amount (LCY)";
END;
...
...
GenJnlLine."VAT Amount LCY (Non Deduct.)";
GLEntry."VAT Amount" := "Amount (LCY)" - GLEntry.Amount;
// Add the following lines.
VATAmtLCY := CalculatedVATAmountLCY;
IF ("VAT Amount (LCY)" <> VATAmtLCY) AND ("Currency Code" <> '') THEN BEGIN
//End of the lines.
GLEntry.Amount := "VAT Base Amount (LCY)";
GLEntry."VAT Amount" := "VAT Amount (LCY)";
// Add the following lines.
END ELSE
IF GLSetup."Round VAT Coeff." THEN BEGIN
GLEntry."VAT Amount" := VATAmtLCY - "VAT Amount LCY (Non Deduct.)";
GLEntry.Amount := "Amount (LCY)" - GLEntry."VAT Amount";
//End of the lines.
END;
...
...
"Posting Date","Currency Code","VAT Difference",
CurrExchRate.ExchangeRate("Posting Date","Currency Code")));
// Delete the following lines.
GLSetup.GET;
GLSetup.GetRoundingParamentersLCY(Currency,RoundingPrecisionLCY,RoundingDirectionLCY);
IF GLSetup."Round VAT Coeff." THEN
CalculatedVATAmtLCY :=
ROUND(
"Amount (LCY)" * ROUND("VAT %" / (100 + "VAT %"),GLSetup."VAT Coeff. Rounding Precision"),
RoundingPrecisionLCY,
RoundingDirectionLCY)
ELSE
CalculatedVATAmtLCY :=
ROUND(
"Amount (LCY)" - ROUND("Amount (LCY)" / (1 + "VAT %" / 100),RoundingPrecisionLCY),
RoundingPrecisionLCY,
RoundingDirectionLCY);
IF ("VAT Amount (LCY)" <> CalculatedVATAmtLCY) AND
("Currency Code" <> '')
THEN
VATDifferenceLCY := "VAT Amount (LCY)" - CalculatedVATAmtLCY;
// End of the lines.
IF "VAT Calculation Type" = "VAT Calculation Type"::"Sales Tax" THEN BEGIN
IF TaxJurisdiction.Code <> TaxDetail."Tax Jurisdiction Code" THEN
...
...
"Posting Date","Currency Code","VAT Difference",
CurrExchRate.ExchangeRate("Posting Date","Currency Code")));
// Add the following lines.
IF "VAT Amount (LCY)" <> CalculatedVATAmountLCY THEN
VATDifferenceLCY := "VAT Amount (LCY)" - CalculatedVATAmountLCY;
//End of the lines.
IF "VAT Calculation Type" = "VAT Calculation Type"::"Sales Tax" THEN BEGIN
IF TaxJurisdiction.Code <> TaxDetail."Tax Jurisdiction Code" THEN
...
LOCAL PROCEDURE CalculatedVATAmountLCY@1220009() : Decimal;
VAR
CalculatedVATAmtLCY@1220002 : Decimal;
RoundingPrecisionLCY@1220001 : Decimal;
RoundingDirectionLCY@1220000 : Text[1];
BEGIN
WITH GenJnlLine DO BEGIN
IF "Currency Code" = '' THEN
EXIT("VAT Amount (LCY)");
GLSetup.GET;
GLSetup.GetRoundingParamentersLCY(Currency,RoundingPrecisionLCY,RoundingDirectionLCY);
IF GLSetup."Round VAT Coeff." THEN
CalculatedVATAmtLCY :=
ROUND(
"Amount (LCY)" * ROUND("VAT %" / (100 + "VAT %"),GLSetup."VAT Coeff. Rounding Precision"),
RoundingPrecisionLCY,
RoundingDirectionLCY)
ELSE
CalculatedVATAmtLCY :=
ROUND(
"Amount (LCY)" - ROUND("Amount (LCY)" / (1 + "VAT %" / 100),RoundingPrecisionLCY),
RoundingPrecisionLCY,
RoundingDirectionLCY);
EXIT(CalculatedVATAmtLCY);
END;
END;
Keywords: kbqfe, kbmbsquickpub, kbmbspartner, kbmbsmigrate, kbsurveynew, kbnoloc, kbmbscodefix, kb