Skip to content

Commit

Permalink
Merge branch 'microsoft:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Roglar01 authored Nov 20, 2024
2 parents 211ab74 + 449bcbe commit 509dc9c
Show file tree
Hide file tree
Showing 1,922 changed files with 261,248 additions and 13,128 deletions.
2 changes: 1 addition & 1 deletion .github/AL-Go-Settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"runs-on": "windows-latest",
"cacheImageName": "",
"UsePsSession": false,
"artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/26.0.26183.0/base",
"artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/26.0.26951.0/base",
"country": "base",
"useProjectDependencies": true,
"repoVersion": "26.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
codeunit 11158 "Create Bank Acc Posting Grp AT"
{
SingleInstance = true;
EventSubscriberInstance = Manual;
InherentEntitlements = X;
InherentPermissions = X;

[EventSubscriber(ObjectType::Table, Database::"Bank Account Posting Group", 'OnBeforeInsertEvent', '', false, false)]
local procedure OnBeforeInsertBankAccPostingGroup(var Rec: Record "Bank Account Posting Group"; RunTrigger: Boolean)
var
CreateBankAccPostingGrp: Codeunit "Create Bank Acc. Posting Grp";
CreateATGLAccount: Codeunit "Create AT GL Account";
CreateGLAccount: Codeunit "Create G/L Account";
begin
case Rec.Code of
CreateBankAccPostingGrp.Checking():
ValidateRecordFields(Rec, CreateGLAccount.BankLcy());
CreateBankAccPostingGrp.Savings(),
CreateBankAccPostingGrp.Operating():
ValidateRecordFields(Rec, CreateGLAccount.GiroAccount());
CreateBankAccPostingGrp.Cash():
ValidateRecordFields(Rec, CreateATGLAccount.BankCurrencies());
end;
end;

local procedure ValidateRecordFields(var BankAccountPostingGroup: Record "Bank Account Posting Group"; GLAccountNo: Code[20])
begin
BankAccountPostingGroup.Validate("G/L Account No.", GLAccountNo);
end;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
codeunit 11159 "Create Bank ExpImport Setup AT"
{
InherentEntitlements = X;
InherentPermissions = X;

trigger OnRun()
var
ContosoBank: Codeunit "Contoso Bank";
begin
ContosoBank.ContosoBankExportImportSetup(SEPACTAPCT(), SEPACTAPCDescLbl, 0, Codeunit::"SEPA CT APC-Export File", Xmlport::"SEPA CT pain.001.001.03", '', false, Codeunit::"SEPA CT-Check Line");
ContosoBank.ContosoBankExportImportSetup(SEPACTAPC09(), SEPACTAPC09DescLbl, 0, Codeunit::"SEPA CT APC-Export File", Xmlport::"SEPA CT pain.001.001.09", '', false, Codeunit::"SEPA CT-Check Line");
end;

procedure SEPACTAPCT(): Code[20]
begin
exit(SEPACTAPCTok);
end;

procedure SEPACTAPC09(): Code[20]
begin
exit(SEPACTAPC09Tok);
end;



var
SEPACTAPCTok: Label 'SEPACTAPC', MaxLength = 20;
SEPACTAPC09Tok: Label 'SEPACTAPC09', MaxLength = 20;
SEPACTAPCDescLbl: Label 'SEPA Credit Transfer APC', MaxLength = 100;
SEPACTAPC09DescLbl: Label 'SEPA Credit Transfer APC 09', MaxLength = 100;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
codeunit 11160 "Create Bank Account AT"
{
SingleInstance = true;
EventSubscriberInstance = Manual;
InherentEntitlements = X;
InherentPermissions = X;

[EventSubscriber(ObjectType::Table, Database::"Bank Account", 'OnBeforeInsertEvent', '', false, false)]
local procedure OnBeforeInsertBankAccount(var Rec: Record "Bank Account")
var
ContosoCoffeDemoDataSetup: Record "Contoso Coffee Demo Data Setup";
CreateBankAccount: Codeunit "Create Bank Account";
begin
ContosoCoffeDemoDataSetup.Get();
case Rec."No." of
CreateBankAccount.Checking():
ValidateBankAccount(Rec, CityGrazLbl, -1447200, ContosoCoffeDemoDataSetup."Country/Region Code", PostcodeGrazLbl);
CreateBankAccount.Savings():
ValidateBankAccount(Rec, CityGrazLbl, 0, ContosoCoffeDemoDataSetup."Country/Region Code", PostcodeGrazLbl);
end;
end;

local procedure ValidateBankAccount(var BankAccount: Record "Bank Account"; BankAccCity: Text[30]; MinBalance: Decimal; CountryRegionCode: Code[10]; PostCode: Code[20])
begin
BankAccount.Validate("Post Code", PostCode);
BankAccount.Validate(City, BankAccCity);
BankAccount.Validate("Min. Balance", MinBalance);
BankAccount.Validate("Country/Region Code", CountryRegionCode);
end;

var
CityGrazLbl: Label 'Graz', MaxLength = 30;
PostcodeGrazLbl: Label '8010', MaxLength = 20;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
codeunit 11161 "Create Bank Acc. Reco. AT"
{
SingleInstance = true;
EventSubscriberInstance = Manual;
InherentEntitlements = X;
InherentPermissions = X;

trigger OnRun()
begin
UpdateBankAccReconciliation();
end;

local procedure UpdateBankAccReconciliation()
var
BankAccReconciliation: Record "Bank Acc. Reconciliation";
CreateBankAccount: Codeunit "Create Bank Account";
begin
if not BankAccReconciliation.Get(Enum::"Bank Acc. Rec. Stmt. Type"::"Bank Reconciliation", CreateBankAccount.Checking(), '24') then
exit;

BankAccReconciliation.Validate("Statement Ending Balance", 17924.53);
BankAccReconciliation.Modify();
end;

[EventSubscriber(ObjectType::Table, Database::"Bank Acc. Reconciliation Line", 'OnBeforeInsertEvent', '', false, false)]
local procedure OnInsertRecord(var Rec: Record "Bank Acc. Reconciliation Line"; RunTrigger: Boolean)
var
CreateBankAccount: Codeunit "Create Bank Account";
begin
if (Rec."Statement Type" = Rec."Statement Type"::"Bank Reconciliation") then begin
if (Rec."Bank Account No." = CreateBankAccount.Checking()) and (Rec."Statement No." = '24') then
case Rec."Statement Line No." of
10000:
ValidateRecordFields(Rec, Rec.Description, 2757.62);
20000:
ValidateRecordFields(Rec, Rec.Description, 4136.43);
30000:
ValidateRecordFields(Rec, DepositToAccountLbl, 11030.48);
end;
end else
if (Rec."Bank Account No." = CreateBankAccount.Checking()) and (Rec."Statement No." = 'PREC000') then
case Rec."Statement Line No." of
10000:
ValidateRecordFields(Rec, Rec.Description, -2520);
20000:
ValidateRecordFields(Rec, Rec.Description, -1828);
30000:
ValidateRecordFields(Rec, Rec.Description, -1340.1);
40000:
ValidateRecordFields(Rec, Rec.Description, 929.76);
50000:
ValidateRecordFields(Rec, Rec.Description, 10743.39);
60000:
ValidateRecordFields(Rec, Rec.Description, 3273.72);
end;
end;

local procedure ValidateRecordFields(var BankAccReconciliationLine: Record "Bank Acc. Reconciliation Line"; Description: Text[100]; Amount: Decimal)
begin
BankAccReconciliationLine.Validate(Description, Description);
BankAccReconciliationLine.Validate("Transaction Text", Description);
BankAccReconciliationLine.Validate("Statement Amount", Amount);
BankAccReconciliationLine.Validate("Applied Amount", Amount);
end;

var
DepositToAccountLbl: Label 'Deposit to Account 18.01.24', MaxLength = 100;
}
Loading

0 comments on commit 509dc9c

Please sign in to comment.