ALAppExtensions
ALAppExtensions copied to clipboard
[Event Request] Table 81 - Gen. Journal Line - OnBeforeCheckCurrencyForEmployee
Please add events to make it possible to create Employee Ledger Entry in Currency, there are several places where we cannot handle errors:
field(3; "Account Type"; Enum "Gen. Journal Account Type")
{
Caption = 'Account Type';
trigger OnValidate()
var
IsHandled: Boolean;
begin
if ("Account Type" in ["Account Type"::Customer, "Account Type"::Vendor, "Account Type"::"Fixed Asset",
"Account Type"::"IC Partner", "Account Type"::Employee]) and
("Bal. Account Type" in ["Bal. Account Type"::Customer, "Bal. Account Type"::Vendor, "Bal. Account Type"::"Fixed Asset",
"Bal. Account Type"::"IC Partner", "Bal. Account Type"::Employee])
then
Error(
Text000,
FieldCaption("Account Type"), FieldCaption("Bal. Account Type"));
// new event ++
OnValidateAccountTypeOnBeforeCheckCurrencyForEmployee(Rec, IsHandled);
if not IsHandled then
// new event --
if ("Account Type" = "Account Type"::Employee) and ("Currency Code" <> '') then
Error(OnlyLocalCurrencyForEmployeeErr);
Validate("Account No.", '');
OnValidateAccountTypeOnBeforeCheckKeepDescription(Rec, xRec, CurrFieldNo);
...
end;
}
field(12; "Currency Code"; Code[10])
{
Caption = 'Currency Code';
TableRelation = Currency;
trigger OnValidate()
var
BankAcc: Record "Bank Account";
begin
if "Bal. Account Type" = "Bal. Account Type"::"Bank Account" then begin
if BankAcc.Get("Bal. Account No.") and (BankAcc."Currency Code" <> '') then
BankAcc.TestField("Currency Code", "Currency Code");
end;
if "Account Type" = "Account Type"::"Bank Account" then begin
if BankAcc.Get("Account No.") and (BankAcc."Currency Code" <> '') then
BankAcc.TestField("Currency Code", "Currency Code");
end;
if ("Recurring Method" in
["Recurring Method"::"B Balance", "Recurring Method"::"RB Reversing Balance"]) and
("Currency Code" <> '')
then
Error(
Text001,
FieldCaption("Currency Code"), FieldCaption("Recurring Method"), "Recurring Method");
if "Currency Code" <> '' then begin
// new event ++
OnValidateCurrencyCodeOnBeforeCheckCurrencyForEmployee(Rec, IsHandled);
if not IsHandled then
// new event --
if ("Bal. Account Type" = "Bal. Account Type"::Employee) or ("Account Type" = "Account Type"::Employee) then
Error(OnlyLocalCurrencyForEmployeeErr);
GetCurrency;
if ("Currency Code" <> xRec."Currency Code") or
("Posting Date" <> xRec."Posting Date") or
(CurrFieldNo = FieldNo("Currency Code")) or
("Currency Factor" = 0)
then
"Currency Factor" :=
CurrExchRate.ExchangeRate("Posting Date", "Currency Code");
end else
"Currency Factor" := 0;
Validate("Currency Factor");
if not CustVendAccountNosModified then
if ("Currency Code" <> xRec."Currency Code") and (Amount <> 0) then
PaymentToleranceMgt.PmtTolGenJnl(Rec);
end;
}
field(63; "Bal. Account Type"; Enum "Gen. Journal Account Type")
{
Caption = 'Bal. Account Type';
trigger OnValidate()
begin
if ("Account Type" in ["Account Type"::Customer, "Account Type"::Vendor, "Account Type"::"Fixed Asset",
"Account Type"::"IC Partner", "Account Type"::Employee]) and
("Bal. Account Type" in ["Bal. Account Type"::Customer, "Bal. Account Type"::Vendor, "Bal. Account Type"::"Fixed Asset",
"Bal. Account Type"::"IC Partner", "Bal. Account Type"::Employee])
then
Error(
Text000,
FieldCaption("Account Type"), FieldCaption("Bal. Account Type"));
// new event ++
OnValidateBalAccountTypeOnBeforeCheckCurrencyForEmployee(Rec, IsHandled);
if not IsHandled then
// new event --
if ("Bal. Account Type" = "Bal. Account Type"::Employee) and ("Currency Code" <> '') then
Error(OnlyLocalCurrencyForEmployeeErr);
ReadGLSetup();
if GLSetup."Journal Templ. Name Mandatory" then
if GenJnlTemplate.Name <> "Journal Template Name" then
GenJnlTemplate.Get("Journal Template Name");
OnValidateBalAccountTypeOnBeforeSetBalAccountNo(Rec, xRec);
...
end;
}
Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.
Build ID: 47191.