Skip to content

Commit fcb9407

Browse files
authored
Merge branch 'main' into AddTranslationExport
2 parents 59ac46c + 33ead2e commit fcb9407

File tree

488 files changed

+39455
-5067
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

488 files changed

+39455
-5067
lines changed

.github/AL-Go-Settings.json

+60-60
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
11
{
2-
"type": "PTE",
3-
"templateUrl": "https://github.com/microsoft/AL-Go-PTE@preview",
4-
"bcContainerHelperVersion": "preview",
5-
"runs-on": "windows-latest",
6-
"cacheImageName": "",
7-
"UsePsSession": false,
8-
"artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/25.0.21703.0/base",
9-
"country": "base",
10-
"useProjectDependencies": true,
11-
"repoVersion": "25.0",
12-
"cleanModePreprocessorSymbols": [
13-
"CLEAN17",
14-
"CLEAN18",
15-
"CLEAN19",
16-
"CLEAN20",
17-
"CLEAN21",
18-
"CLEAN22",
19-
"CLEAN23",
20-
"CLEAN24"
21-
],
22-
"unusedALGoSystemFiles": [
23-
"AddExistingAppOrTestApp.yaml",
24-
"CreateApp.yaml",
25-
"CreateOnlineDevelopmentEnvironment.yaml",
26-
"CreatePerformanceTestApp.yaml",
27-
"CreateRelease.yaml",
28-
"CreateTestApp.yaml",
29-
"Current.yaml",
30-
"IncrementVersionNumber.yaml",
31-
"NextMajor.yaml",
32-
"NextMinor.yaml",
33-
"PublishToEnvironment.yaml",
34-
"Test Current.settings.json"
35-
],
36-
"excludeEnvironments": [
37-
"Official-Build"
38-
],
39-
"buildModes": [
40-
"Translated"
41-
],
42-
"CICDPushBranches": [
43-
"main"
44-
],
45-
"CICDPullRequestBranches": [
46-
"main"
47-
],
48-
"enableCodeCop": true,
49-
"enableAppSourceCop": true,
50-
"enablePerTenantExtensionCop": true,
51-
"enableUICop": true,
52-
"rulesetFile": "..\\..\\..\\Build\\rulesets\\app.ruleset.json",
53-
"skipUpgrade": true,
54-
"fullBuildPatterns": [
55-
"Build/*",
56-
".github/workflows/PullRequestHandler.yaml",
57-
".github/workflows/_BuildALGoProject.yaml"
58-
],
59-
"UpdateALGoSystemFilesEnvironment": "Official-Build",
60-
"PullRequestTrigger": "pull_request",
61-
"templateSha": "0476547896ebcd3ba5455b3e0e59b48c0d4a26ca"
2+
"type": "PTE",
3+
"templateUrl": "https://github.com/microsoft/AL-Go-PTE@preview",
4+
"bcContainerHelperVersion": "preview",
5+
"runs-on": "windows-latest",
6+
"cacheImageName": "",
7+
"UsePsSession": false,
8+
"artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/25.0.22684.0/base",
9+
"country": "base",
10+
"useProjectDependencies": true,
11+
"repoVersion": "25.0",
12+
"cleanModePreprocessorSymbols": [
13+
"CLEAN17",
14+
"CLEAN18",
15+
"CLEAN19",
16+
"CLEAN20",
17+
"CLEAN21",
18+
"CLEAN22",
19+
"CLEAN23",
20+
"CLEAN24"
21+
],
22+
"unusedALGoSystemFiles": [
23+
"AddExistingAppOrTestApp.yaml",
24+
"CreateApp.yaml",
25+
"CreateOnlineDevelopmentEnvironment.yaml",
26+
"CreatePerformanceTestApp.yaml",
27+
"CreateRelease.yaml",
28+
"CreateTestApp.yaml",
29+
"Current.yaml",
30+
"IncrementVersionNumber.yaml",
31+
"NextMajor.yaml",
32+
"NextMinor.yaml",
33+
"PublishToEnvironment.yaml",
34+
"Test Current.settings.json"
35+
],
36+
"excludeEnvironments": [
37+
"Official-Build"
38+
],
39+
"buildModes": [
40+
"Translated"
41+
],
42+
"CICDPushBranches": [
43+
"main"
44+
],
45+
"CICDPullRequestBranches": [
46+
"main"
47+
],
48+
"enableCodeCop": true,
49+
"enableAppSourceCop": true,
50+
"enablePerTenantExtensionCop": true,
51+
"enableUICop": true,
52+
"rulesetFile": "..\\..\\..\\Build\\rulesets\\app.ruleset.json",
53+
"skipUpgrade": true,
54+
"fullBuildPatterns": [
55+
"Build/*",
56+
".github/workflows/PullRequestHandler.yaml",
57+
".github/workflows/_BuildALGoProject.yaml"
58+
],
59+
"UpdateALGoSystemFilesEnvironment": "Official-Build",
60+
"PullRequestTrigger": "pull_request",
61+
"templateSha": "0476547896ebcd3ba5455b3e0e59b48c0d4a26ca"
6262
}

Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/CustLedgerEntryHandlerCZZ.Codeunit.al

+21
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,27 @@ codeunit 31004 "Cust. Ledger Entry Handler CZZ"
4343
IsHandled := true;
4444
end;
4545

46+
[EventSubscriber(ObjectType::Report, Report::"Open Cust. Entries to Date CZL", 'OnBeforeGetReceivablesAccountNo', '', false, false)]
47+
local procedure GetReceivablesAccountNoForOpenCustEntriesToDate(CustLedgerEntry: Record "Cust. Ledger Entry"; var GLAccountNo: Code[20]; var IsHandled: Boolean)
48+
var
49+
AdvanceLetterTemplateCZZ: Record "Advance Letter Template CZZ";
50+
begin
51+
if IsHandled then
52+
exit;
53+
54+
if CustLedgerEntry."Advance Letter No. CZZ" = '' then
55+
exit;
56+
57+
if CustLedgerEntry."Adv. Letter Template Code CZZ" <> '' then begin
58+
AdvanceLetterTemplateCZZ.Get(CustLedgerEntry."Adv. Letter Template Code CZZ");
59+
GLAccountNo := AdvanceLetterTemplateCZZ."Advance Letter G/L Account";
60+
IsHandled := true;
61+
end else begin
62+
GLAccountNo := CustLedgerEntry.GetReceivablesAccNoCZL();
63+
IsHandled := true;
64+
end;
65+
end;
66+
4667
[EventSubscriber(ObjectType::Codeunit, Codeunit::"CustEntry-Apply Posted Entries", 'OnApplyCustEntryFormEntryOnAfterCheckEntryOpen', '', false, false)]
4768
local procedure CheckAdvanceOnApplyCustEntryFormEntryOnAfterCheckEntryOpen(ApplyingCustLedgEntry: Record "Cust. Ledger Entry")
4869
begin

Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/InstallApplicationCZZ.Codeunit.al

+6
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,9 @@ codeunit 31087 "Install Application CZZ"
507507
AmtToDeduct: Decimal;
508508
Continue: Boolean;
509509
begin
510+
if PurchAdvLetterHeaderCZZ.Status = PurchAdvLetterHeaderCZZ.Status::Closed then
511+
exit;
512+
510513
AdvanceLetterLineRelation.SetRange(Type, AdvanceLetterLineRelation.Type::Purchase);
511514
AdvanceLetterLineRelation.SetRange("Letter No.", PurchAdvLetterHeaderCZZ."No.");
512515
if AdvanceLetterLineRelation.FindSet() then begin
@@ -857,6 +860,9 @@ codeunit 31087 "Install Application CZZ"
857860
AmtToDeduct: Decimal;
858861
Continue: Boolean;
859862
begin
863+
if SalesAdvLetterHeaderCZZ.Status = SalesAdvLetterHeaderCZZ.Status::Closed then
864+
exit;
865+
860866
AdvanceLetterLineRelation.SetRange(Type, AdvanceLetterLineRelation.Type::Sale);
861867
AdvanceLetterLineRelation.SetRange("Letter No.", SalesAdvLetterHeaderCZZ."No.");
862868
if AdvanceLetterLineRelation.FindSet() then begin
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// ------------------------------------------------------------------------------------------------
2+
// Copyright (c) Microsoft Corporation. All rights reserved.
3+
// Licensed under the MIT License. See License.txt in the project root for license information.
4+
// ------------------------------------------------------------------------------------------------
5+
namespace Microsoft.Finance.AdvancePayments;
6+
7+
using Microsoft.Finance.Currency;
8+
using Microsoft.Finance.GeneralLedger.Journal;
9+
using Microsoft.Finance.VAT.Calculation;
10+
using Microsoft.Finance.VAT.Setup;
11+
using Microsoft.Foundation.Enums;
12+
13+
codeunit 31157 "Non-Deductible VAT CZZ"
14+
{
15+
var
16+
NonDeductibleVAT: Codeunit "Non-Deductible VAT";
17+
NonDeductibleVATCZL: Codeunit "Non-Deductible VAT CZL";
18+
19+
procedure IsNonDeductibleVATEnabled(): Boolean
20+
var
21+
VATSetup: Record "VAT Setup";
22+
begin
23+
if not NonDeductibleVAT.IsNonDeductibleVATEnabled() then
24+
exit(false);
25+
VATSetup.Get();
26+
exit(VATSetup."Use For Advances CZZ");
27+
end;
28+
29+
internal procedure GetNonDeductibleVATPct(AdvancePostingBuffer: Record "Advance Posting Buffer CZZ"; ToDate: Date): Decimal
30+
begin
31+
exit(GetNonDeductibleVATPct(
32+
AdvancePostingBuffer."VAT Bus. Posting Group",
33+
AdvancePostingBuffer."VAT Prod. Posting Group",
34+
"General Posting Type"::Purchase, ToDate));
35+
end;
36+
37+
procedure GetNonDeductibleVATPct(VATBusPostGroupCode: Code[20]; VATProdPostGroupCode: Code[20]; GeneralPostingType: Enum "General Posting Type"; ToDate: Date): Decimal
38+
begin
39+
if not IsNonDeductibleVATEnabled() then
40+
exit(0);
41+
exit(NonDeductibleVATCZL.GetNonDeductibleVATPct(VATBusPostGroupCode, VATProdPostGroupCode, GeneralPostingType, ToDate));
42+
end;
43+
44+
internal procedure Calculate(var AdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ")
45+
var
46+
Currency: Record Currency;
47+
begin
48+
if not IsNonDeductibleVATEnabled() then
49+
exit;
50+
Currency.InitRoundingPrecision();
51+
UpdateNonDeductibleAmounts(
52+
AdvancePostingBufferCZZ."Non-Deductible VAT Base", AdvancePostingBufferCZZ."Non-Deductible VAT Amount",
53+
AdvancePostingBufferCZZ."VAT Base Amount", AdvancePostingBufferCZZ."VAT Amount",
54+
AdvancePostingBufferCZZ."Non-Deductible VAT %", Currency."Amount Rounding Precision");
55+
UpdateNonDeductibleAmounts(
56+
AdvancePostingBufferCZZ."Non-Deductible VAT Base ACY", AdvancePostingBufferCZZ."Non-Deductible VAT Amount ACY",
57+
AdvancePostingBufferCZZ."VAT Base Amount (ACY)", AdvancePostingBufferCZZ."VAT Amount (ACY)",
58+
AdvancePostingBufferCZZ."Non-Deductible VAT %", Currency."Amount Rounding Precision");
59+
end;
60+
61+
local procedure UpdateNonDeductibleAmounts(var NonDeductibleBase: Decimal; var NonDeductibleAmount: Decimal; VATBase: Decimal; VATAmount: Decimal; NonDeductibleVATPct: Decimal; AmountRoundingPrecision: Decimal)
62+
begin
63+
if not IsNonDeductibleVATEnabled() then begin
64+
NonDeductibleBase := 0;
65+
NonDeductibleAmount := 0;
66+
exit;
67+
end;
68+
NonDeductibleBase :=
69+
Round(VATBase * NonDeductibleVATPct / 100, AmountRoundingPrecision);
70+
NonDeductibleAmount :=
71+
Round(VATAmount * NonDeductibleVATPct / 100, AmountRoundingPrecision);
72+
end;
73+
74+
internal procedure Copy(var GenJournalLine: Record "Gen. Journal Line"; AdvancePostingBufferCZZ: Record "Advance Posting Buffer CZZ")
75+
begin
76+
GenJournalLine."Non-Deductible VAT %" := AdvancePostingBufferCZZ."Non-Deductible VAT %";
77+
GenJournalLine."Non-Deductible VAT Base" := AdvancePostingBufferCZZ."Non-Deductible VAT Base";
78+
GenJournalLine."Non-Deductible VAT Amount" := AdvancePostingBufferCZZ."Non-Deductible VAT Amount";
79+
GenJournalLine."Non-Deductible VAT Base LCY" := AdvancePostingBufferCZZ."Non-Deductible VAT Base ACY";
80+
GenJournalLine."Non-Deductible VAT Amount LCY" := AdvancePostingBufferCZZ."Non-Deductible VAT Amount ACY";
81+
end;
82+
}

0 commit comments

Comments
 (0)