Skip to content

Commit

Permalink
Merge branch 'main' into vlkov/27706
Browse files Browse the repository at this point in the history
  • Loading branch information
VladyslavxKovalchuk committed Dec 12, 2024
2 parents d5b98e3 + 0bb636e commit b958b8a
Show file tree
Hide file tree
Showing 229 changed files with 9,901 additions and 2,270 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.27457.0/base",
"artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/26.0.27721.0/base",
"country": "base",
"useProjectDependencies": true,
"repoVersion": "26.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ codeunit 27054 "CA Contoso Localization"
Codeunit.Run(Codeunit::"Create CA General Ledger Setup");
Codeunit.Run(Codeunit::"Create CA Posting Group");
CreateCAVatPostingGroup.UpdateVATPostingSetup();
Codeunit.Run(Codeunit::"Create CA Acc. Schedule Line");
Codeunit.Run(Codeunit::"Create CA Column Layout Name");
CreateCAGLAccounts.AddCategoriesToGLAccountsForMini();
end;
Enum::"Contoso Demo Data Level"::"Master Data":
begin
Codeunit.Run(Codeunit::"Create CA Acc. Schedule Line");
Codeunit.Run(Codeunit::"Create CA Column Layout");
Codeunit.Run(Codeunit::"Create CA Tax Group");
Codeunit.Run(Codeunit::"Create CA Tax Jurisdiction");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ codeunit 11616 "Create CH VAT Posting Groups"

trigger OnRun()
begin
CreateVATProductPostingGroup();
UpdateVATProductPostingGroup();
CreateVATPostingSetup();
end;

Expand Down Expand Up @@ -43,11 +43,6 @@ codeunit 11616 "Create CH VAT Posting Groups"
procedure CreateVATProductPostingGroup()
var
ContosoPostingGroup: Codeunit "Contoso Posting Group";
CreateCHPostingGroups: Codeunit "Create CH Posting Groups";
CreateCHGLAccounts: Codeunit "Create CH GL Accounts";
CreateGLAccount: Codeunit "Create G/L Account";
CreatePostingGroup: Codeunit "Create Posting Groups";
CreateVATPostingGroups: Codeunit "Create VAT Posting Groups";
begin
ContosoPostingGroup.InsertVATProductPostingGroup(HalfNormal(), HalfStandardRateLbl);
ContosoPostingGroup.InsertVATProductPostingGroup(Hotel(), HotelsLbl);
Expand All @@ -56,7 +51,16 @@ codeunit 11616 "Create CH VAT Posting Groups"
ContosoPostingGroup.InsertVATProductPostingGroup(Normal(), NormalVATRateLbl);
ContosoPostingGroup.InsertVATProductPostingGroup(OperatingExpense(), VATOperatingExpensesLbl);
ContosoPostingGroup.InsertVATProductPostingGroup(Reduced(), ReducedRateLbl);
end;

procedure UpdateVATProductPostingGroup()
var
CreateCHPostingGroups: Codeunit "Create CH Posting Groups";
CreateCHGLAccounts: Codeunit "Create CH GL Accounts";
CreateGLAccount: Codeunit "Create G/L Account";
CreatePostingGroup: Codeunit "Create Posting Groups";
CreateVATPostingGroups: Codeunit "Create VAT Posting Groups";
begin
CreateCHPostingGroups.UpdateVATProdPostingGroup(CreatePostingGroup.RawMatPostingGroup(), Normal());
CreateCHPostingGroups.UpdateVATProdPostingGroup(CreatePostingGroup.RetailPostingGroup(), Normal());
CreateCHPostingGroups.UpdateVATProdPostingGroup(CreatePostingGroup.MiscPostingGroup(), Normal());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ codeunit 11620 "CH Contoso Localization"

Enum::"Contoso Demo Data Module"::Finance:
begin
CreateCHVATPostingGroups.CreateVATProductPostingGroup();
BindSubscription(CreateCHAccScheduleLine);
BindSubscription(CreateCHColumnLayout);
BindSubscription(CreateCHCurrency);
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ codeunit 31379 "Gen. Jnl.-Apply Handler CZA"
local procedure ApplyGLEntryCZA(var GenJournalLine: Record "Gen. Journal Line"; AccNo: Code[20]; AccBalance: Boolean)
var
GLEntry: Record "G/L Entry";
TempGLEntry: Record "G/L Entry" temporary;
ApplyGenLedgerEntriesCZA: Page "Apply Gen. Ledger Entries CZA";
PreviousAppliesToID: Code[50];
EntrySelected: Boolean;
Expand Down Expand Up @@ -86,25 +87,23 @@ codeunit 31379 "Gen. Jnl.-Apply Handler CZA"
ApplyGenLedgerEntriesCZA.SetGenJournalLine(GenJournalLine);
ApplyGenLedgerEntriesCZA.LookupMode(true);
EntrySelected := ApplyGenLedgerEntriesCZA.RunModal() = Action::LookupOK;
Clear(ApplyGenLedgerEntriesCZA);
if not EntrySelected then begin
GenJournalLine."Applies-to ID" := PreviousAppliesToID;
exit;
end;
ApplyGenLedgerEntriesCZA.CopyEntry(TempGLEntry);

GLEntry.Reset();
GLEntry.SetCurrentKey("G/L Account No.", "Applies-to ID CZA");
GLEntry.SetRange("G/L Account No.", AccNo);
GLEntry.SetRange("Closed CZA", false);
GLEntry.SetRange("Applies-to ID CZA", GenJournalLine."Applies-to ID");
if GLEntry.FindSet() then begin
TempGLEntry.Reset();
TempGLEntry.SetRange("Closed CZA", false);
TempGLEntry.SetRange("Applies-to ID CZA", GenJournalLine."Applies-to ID");
if TempGLEntry.FindSet() then begin
if GenJournalLine.Amount = 0 then begin
repeat
if Abs(GLEntry."Amount to Apply CZA") >= Abs(GLEntry.RemainingAmountCZA()) then
GenJournalLine.Amount := GenJournalLine.Amount - GLEntry.RemainingAmountCZA()
if Abs(TempGLEntry."Amount to Apply CZA") >= Abs(TempGLEntry.RemainingAmountCZA()) then
GenJournalLine.Amount := GenJournalLine.Amount - TempGLEntry.RemainingAmountCZA()
else
GenJournalLine.Amount := GenJournalLine.Amount - GLEntry."Amount to Apply CZA";
until GLEntry.Next() = 0;
GenJournalLine.Amount := GenJournalLine.Amount - TempGLEntry."Amount to Apply CZA";
until TempGLEntry.Next() = 0;
if GenJournalLine."Account Type" <> GenJournalLine."Bal. Account Type"::"G/L Account" then
GenJournalLine.Amount := -GenJournalLine.Amount;
GenJournalLine.Validate(Amount);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,12 @@ page 31287 "Apply Gen. Ledger Entries CZA"
until NewGLEntry.Next() = 0;
end;

internal procedure CopyEntry(var TempGLEntry: Record "G/L Entry" temporary)
begin
Rec.Reset();
TempGLEntry.Copy(Rec, true);
end;

local procedure FindApplyingGLEntry()
begin
AppliesToID := Rec.GetDefaultAppliesToID();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ report 31132 "G/L Entry Applying CZA"

if Apply then begin
OriginalEntry."Applies-to ID CZA" := OriginalEntry."Document No.";
OriginalEntry."Amount to Apply CZA" := OriginalEntry.Amount - OriginalEntry."Applied Amount CZA";
OriginalEntry."Amount to Apply CZA" := -TotalAmount;
OriginalEntry.Modify();
Clear(GLEntryPostApplicationCZA);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ tableextension 31265 "G/L Entry CZA" extends "G/L Entry"
field(11788; "Applied Amount CZA"; Decimal)
{

CalcFormula = - Sum("Detailed G/L Entry CZA".Amount where("G/L Entry No." = field("Entry No."),
CalcFormula = - sum("Detailed G/L Entry CZA".Amount where("G/L Entry No." = field("Entry No."),
"Posting Date" = field("Date Filter CZA")));
Caption = 'Applied Amount';
Editable = false;
Expand All @@ -62,7 +62,6 @@ tableextension 31265 "G/L Entry CZA" extends "G/L Entry"
{
key(AppliestoIDKeyCZA; "Applies-to ID CZA", "Applying Entry CZA")
{
SumIndexFields = "Amount to Apply CZA";
}
}

Expand Down
Loading

0 comments on commit b958b8a

Please sign in to comment.