Skip to content

Commit 75574e8

Browse files
committed
Merge branch 'main' of https://github.com/blauerPCL/ALAppExtensions into SL-Migration-Vendor1099
2 parents df84280 + dd8b28a commit 75574e8

File tree

179 files changed

+2992
-1503
lines changed

Some content is hidden

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

179 files changed

+2992
-1503
lines changed

.github/AL-Go-Settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"runs-on": "windows-latest",
77
"cacheImageName": "",
88
"UsePsSession": false,
9-
"artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/28.0.40773.0/base",
9+
"artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/28.0.41461.0/base",
1010
"country": "base",
1111
"useProjectDependencies": true,
1212
"repoVersion": "28.0",
Binary file not shown.
Binary file not shown.
Binary file not shown.

Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/DataClassEvalHandlerCZA.Codeunit.al

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ codeunit 31252 "Data Class. Eval. Handler CZA"
4141
AssemblyLine: Record "Assembly Line";
4242
AssemblySetup: Record "Assembly Setup";
4343
#endif
44+
CopyItemBuffer: Record "Copy Item Buffer";
4445
CapacityLedgerEntry: Record "Capacity Ledger Entry";
4546
DataExchFieldMapping: Record "Data Exch. Field Mapping";
4647
DefaultDimension: Record "Default Dimension";
@@ -79,6 +80,7 @@ codeunit 31252 "Data Class. Eval. Handler CZA"
7980
#pragma warning restore AL0432
8081
#endif
8182
DataClassificationMgt.SetFieldToNormal(Database::"Capacity Ledger Entry", CapacityLedgerEntry.FieldNo("User ID CZA"));
83+
DataClassificationMgt.SetFieldToNormal(Database::"Copy Item Buffer", CopyItemBuffer.FieldNo("Auto Create Dimension CZA"));
8284
DataClassificationMgt.SetFieldToNormal(Database::"Data Exch. Field Mapping", DataExchFieldMapping.FieldNo("Date Formula CZA"));
8385
DataClassificationMgt.SetFieldToNormal(Database::"Default Dimension", DefaultDimension.FieldNo("Automatic Create CZA"));
8486
DataClassificationMgt.SetFieldToNormal(Database::"Default Dimension", DefaultDimension.FieldNo("Dim. Description Field ID CZA"));

Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/DefaultDimensionHandlerCZA.Codeunit.al

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,31 @@ codeunit 31392 "Default Dimension Handler CZA"
328328
until AutoDefaultDimension.Next() = 0;
329329
end;
330330

331+
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Copy Item", 'OnCopyItemOnBeforeTargetItemInsert', '', false, false)]
332+
local procedure ItemCopyOnCopyItemOnBeforeTargetItemInsert(var CopyItemBuffer: Record "Copy Item Buffer")
333+
var
334+
AutoDefaultDimension: Record "Default Dimension";
335+
begin
336+
if not CopyItemBuffer.Dimensions then
337+
exit;
338+
339+
AutoDefaultDimension.SetRange("Table ID", Database::Item);
340+
AutoDefaultDimension.SetRange("No.", '');
341+
AutoDefaultDimension.SetRange("Automatic Create CZA", true);
342+
if AutoDefaultDimension.IsEmpty() then
343+
exit;
344+
345+
CopyItemBuffer.Dimensions := false;
346+
CopyItemBuffer."Auto Create Dimension CZA" := true;
347+
end;
348+
349+
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Copy Item", 'OnAfterCopyItem', '', false, false)]
350+
local procedure ItemCopyOnAfterCopyItem(var CopyItemBuffer: Record "Copy Item Buffer"; SourceItem: Record Item; var TargetItem: Record Item)
351+
begin
352+
if CopyItemBuffer."Auto Create Dimension CZA" then
353+
CopyItemDimensions(SourceItem, TargetItem."No.");
354+
end;
355+
331356
local procedure SetRequestRunFalse(TableID: Integer)
332357
begin
333358
case TableID of
@@ -378,6 +403,23 @@ codeunit 31392 "Default Dimension Handler CZA"
378403
end;
379404
end;
380405

406+
local procedure CopyItemDimensions(FromItem: Record Item; ToItemNo: Code[20])
407+
var
408+
DefaultDimension: Record "Default Dimension";
409+
NewDefaultDimension: Record "Default Dimension";
410+
begin
411+
DefaultDimension.SetRange("Table ID", Database::Item);
412+
DefaultDimension.SetRange("No.", FromItem."No.");
413+
if DefaultDimension.FindSet() then
414+
repeat
415+
if not NewDefaultDimension.Get(Database::Item, ToItemNo, DefaultDimension."Dimension Code") then begin
416+
NewDefaultDimension.TransferFields(DefaultDimension);
417+
NewDefaultDimension."No." := ToItemNo;
418+
NewDefaultDimension.Insert();
419+
end;
420+
until DefaultDimension.Next() = 0;
421+
end;
422+
381423
var
382424
DimensionAutoUpdateMgtCZA: Codeunit "Dimension Auto.Update Mgt. CZA";
383425
}

Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/GLEntryPostApplicationCZA.Codeunit.al

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,9 @@ codeunit 31370 "G/L Entry Post Application CZA"
416416
local procedure IsAppliedEntry(GLEntry: Record "G/L Entry"; ApplyingGLEntry: Record "G/L Entry") IsOk: Boolean
417417
begin
418418
IsOk :=
419+
(GLEntry."Entry No." <> ApplyingGLEntry."Entry No.") and
419420
(GLEntry."G/L Account No." = ApplyingGLEntry."G/L Account No.") and
420-
((GLEntry.Amount <> 0) and ((GLEntry.Amount * ApplyingGLEntry.Amount) < 0)) or
421-
(GLEntry.Amount = 0);
421+
((GLEntry.Amount * ApplyingGLEntry.Amount) <= 0);
422422
OnAfterIsAppliedEntry(GLEntry, ApplyingGLEntry, IsOk);
423423
end;
424424

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
namespace Microsoft.Inventory.Item;
2+
3+
tableextension 31073 "Copy Item Buffer CZA" extends "Copy Item Buffer"
4+
{
5+
fields
6+
{
7+
field(31238; "Auto Create Dimension CZA"; Boolean)
8+
{
9+
Caption = 'Auto Create Dimension';
10+
DataClassification = SystemMetadata;
11+
}
12+
}
13+
}

Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/MatchBankPaymentCZB.Codeunit.al

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ codeunit 31362 "Match Bank Payment CZB"
3636
SummaryGenJournalLine: Record "Gen. Journal Line";
3737
BankAccountNo: Code[20];
3838
MinAmount, MaxAmount : Decimal;
39+
AppliesToIDTok: Label '%1%2', Locked = true, MaxLength = 50;
3940

4041
local procedure Code()
4142
begin
@@ -205,7 +206,8 @@ codeunit 31362 "Match Bank Payment CZB"
205206
GenJournalLine.Validate("Applies-to Doc. Type", TempMatchBankPaymentBufferCZB."Document Type");
206207
GenJournalLine.SetSuppressCommit(true);
207208
GenJournalLine.Validate("Applies-to Doc. No.", TempMatchBankPaymentBufferCZB."Document No.");
208-
end;
209+
end else
210+
GenJournalLine.Validate("Applies-to ID", BuildAppliesToID(GenJournalLine));
209211
if BankAccount."Dimension from Apply Entry CZB" then
210212
GenJournalLine.Validate("Dimension Set ID", TempMatchBankPaymentBufferCZB."Dimension Set ID");
211213
if GenJournalLine."Currency Code" <> OriginalGenJournalLine."Currency Code" then
@@ -488,6 +490,11 @@ codeunit 31362 "Match Bank Payment CZB"
488490
MaxAmount := Round(MaxAmount);
489491
end;
490492

493+
local procedure BuildAppliesToID(GenJournalLine: Record "Gen. Journal Line"): Code[50]
494+
begin
495+
exit(CopyStr(StrSubstNo(AppliesToIDTok, GenJournalLine."Document No.", Format(GenJournalLine."Line No.")), 1, MaxStrLen(GenJournalLine."Applies-to ID")));
496+
end;
497+
491498
[IntegrationEvent(false, false)]
492499
local procedure OnAfterFillMatchBankPaymentBuffer(var TempMatchBankPaymentBufferCZB: Record "Match Bank Payment Buffer CZB"; SearchRuleLineCZB: Record "Search Rule Line CZB"; var GenJournalLine: Record "Gen. Journal Line"; MinAmount: Decimal; MaxAmount: Decimal)
493500
begin

Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/BankOperationsFunctionsCZL.Codeunit.al

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,10 @@ codeunit 31037 "Bank Operations Functions CZL"
2525
IdentificationIncorrectChecksumErr: Label 'Bank account identification has incorrect checksum.';
2626
FirstHyphenErr: Label 'Bank account no. must not start with character "-".';
2727

28-
procedure CreateVariableSymbol(Input: Code[35]): Code[10]
28+
procedure CreateVariableSymbol(Input: Code[35]) VariableSymbol: Code[10]
2929
begin
30-
if Input = '' then
31-
exit('');
32-
exit(CopyStr(TrimLeft(NumbersOnly(Input), '0'), 1, 10));
30+
VariableSymbol := CopyStr(TrimLeft(NumbersOnly(Input), '0'), 1, 10);
31+
OnCreateVariableSymbol(Input, VariableSymbol);
3332
end;
3433

3534
local procedure NumbersOnly(Input: Text): Text
@@ -223,4 +222,9 @@ codeunit 31037 "Bank Operations Functions CZL"
223222

224223
exit(OutputSum mod 11);
225224
end;
225+
226+
[IntegrationEvent(false, false)]
227+
local procedure OnCreateVariableSymbol(Input: Code[35]; var VariableSymbol: Code[10])
228+
begin
229+
end;
226230
}

0 commit comments

Comments
 (0)