To implement this hotfix, you must have a developer license.
You do not have to have rights to the data stores unless you have to perform data repair.
...
END;
PROCEDURE GetUnRealizedVATPart@2(SettledAmount@1003 : Decimal;Paid@1005 : Decimal;Full@1001 : Decimal;TotalUnrealVATAmountFirst@1006 : Decimal;TotalUnrealVATAmountLast@1007 : Decimal;OriginalAmtLCY@1480000 : Decimal;OriginalCurrFactor@1020000 : Decimal) : Decimal;
VAR
UnrealizedVatType@1000 : ' ,Percentage,First,Last,First (Fully Paid),Last (Fully Paid),Cash Basis';
BEGIN
IF (Type <> 0) AND
(Amount = 0) AND
(Base = 0)
THEN BEGIN
...
...
END;
PROCEDURE GetUnRealizedVATPart@2(SettledAmount@1003 : Decimal;Paid@1005 : Decimal;Full@1001 : Decimal;TotalUnrealVATAmountFirst@1006 : Decimal;TotalUnrealVATAmountLast@1007 : Decimal;OriginalAmtLCY@1480000 : Decimal;OriginalCurrFactor@1020000 : Decimal) : Decimal;
VAR
UnrealizedVatType@1000 : ' ,Percentage,First,Last,First (Fully Paid),Last (Fully Paid),Cash Basis';
// Add the following lines.
CustLedgEntry@1170000000 : Record 21;
VendLedgEntry@1310001 : Record 25;
// End of the lines.
BEGIN
IF (Type <> 0) AND
(Amount = 0) AND
(Base = 0)
THEN BEGIN
...
...
UnrealizedVatType::"Cash Basis":
BEGIN
IF OriginalAmtLCY = 0 THEN
EXIT(1)
ELSE
// Delete the following lines.
IF GetCurrencyCode() = '' THEN
EXIT(-SettledAmount / OriginalAmtLCY)
ELSE
EXIT((-SettledAmount / OriginalCurrFactor) / OriginalAmtLCY);
// End of the lines.
END;
END;
END ELSE
EXIT(0);
...
...
UnrealizedVatType::"Cash Basis":
BEGIN
IF OriginalAmtLCY = 0 THEN
EXIT(1)
ELSE
// Add the following lines.
CASE Type OF
Type::Sale:
BEGIN
CustLedgEntry.SETCURRENTKEY("Transaction No.");
CustLedgEntry.SETRANGE("Transaction No.","Transaction No.");
CustLedgEntry.SETRANGE("Document No.","Document No.");
IF CustLedgEntry.FINDFIRST THEN
IF CustLedgEntry."Original Currency Factor" <> CustLedgEntry."Adjusted Currency Factor" THEN
Paid := ROUND((Paid / CustLedgEntry."Original Currency Factor") * CustLedgEntry."Adjusted Currency Factor");
END;
Type::Purchase:
BEGIN
VendLedgEntry.SETCURRENTKEY("Transaction No.");
VendLedgEntry.SETRANGE("Transaction No.","Transaction No.");
VendLedgEntry.SETRANGE("Document No.","Document No.");
IF VendLedgEntry.FINDFIRST THEN
IF VendLedgEntry."Original Currency Factor" <> VendLedgEntry."Adjusted Currency Factor" THEN
Paid := ROUND((Paid / VendLedgEntry."Original Currency Factor") * VendLedgEntry."Adjusted Currency Factor");
END;
END;
EXIT(ABS(-SettledAmount) / (ABS(OriginalAmtLCY) - ABS(Paid) + ABS(SettledAmount)))
// End of the lines.
END;
END;
END ELSE
EXIT(0);
...