Skip to content

Commit

Permalink
Syncing with version 26.0.28000.0 (#27808)
Browse files Browse the repository at this point in the history
  • Loading branch information
aholstrup1 authored Dec 13, 2024
1 parent 2ac1ba8 commit 4f1d3e4
Show file tree
Hide file tree
Showing 91 changed files with 6,334 additions and 112 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.27721.0/base",
"artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/26.0.28000.0/base",
"country": "base",
"useProjectDependencies": true,
"repoVersion": "26.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ codeunit 31370 "G/L Entry Post Application CZA"
DtldGLEntryNo := 0;
end;

#if not CLEAN26
[Obsolete('The local SetAmountToApply procedure is used instead.', '26.0')]
procedure SetAmountToApply()
var
Expand All @@ -319,6 +320,7 @@ codeunit 31370 "G/L Entry Post Application CZA"
begin
SetAmountToApply(GLEntry, ApplyingAmount);
end;
#endif

local procedure SetAmountToApply(var GLEntry: Record "G/L Entry"; var ApplyingAmount: Decimal)
begin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -870,12 +870,13 @@ table 31257 "Payment Order Line CZB"
PaymentOrderCurrency.Testfield("Amount Rounding Precision");
end;
end;

#if not CLEAN25
[Obsolete('Replaced by CreateDescription function with PlaceholderValues parameter.', '25.0')]
procedure CreateDescription(DocType: Text[30]; DocNo: Text[20]; PartnerNo: Text[20]; PartnerName: Text[100]; ExtNo: Text[35]): Text[50]
begin
exit(CopyStr(StrSubstNo(BankAccount."Payment Order Line Descr. CZB", DocType, DocNo, PartnerNo, PartnerName, ExtNo), 1, 50));
end;
#endif

procedure CreateDescription(PlaceholderValues: List of [Text[100]]) Description: Text[100]
var
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
namespace Microsoft.Purchases.Document;

using Microsoft.Purchases.Posting;

codeunit 31180 "Item Charge Assgnt Handler CZL"
{
Access = Internal;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnPostItemChargeLineOnAfterPostItemCharge', '', false, false)]
local procedure ItemChargeAssgntWithAssignValuesOnPostItemChargeLineOnAfterPostItemCharge(sender: Codeunit "Purch.-Post"; var TempItemChargeAssgntPurch: Record "Item Charge Assignment (Purch)" temporary; PurchHeader: Record "Purchase Header"; PurchLine: Record "Purchase Line")
var
ItemChargeAssgntPurchCZL: Codeunit "Item Charge Assgnt. Purch. CZL";
begin
if TempItemChargeAssgntPurch."Applies-to Doc. Type" = TempItemChargeAssgntPurch."Applies-to Doc. Type"::"Item Ledger Entry Positive Adjmt. CZL" then begin
ItemChargeAssgntPurchCZL.PostItemChargePerPosAdjItem(sender, TempItemChargeAssgntPurch, PurchHeader, PurchLine);
TempItemChargeAssgntPurch.Mark(true);
end;
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Item Charge Assgnt. (Purch.)", 'OnAssignByAmountOnAfterAssignAppliesToDocLineAmount', '', false, false)]
local procedure ItemChargeAssgntWithAssignValuesOnAssignByAmountOnAfterAssignAppliesToDocLineAmount(ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; var TempItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)" temporary; PurchHeader: Record "Purchase Header")
var
ItemChargeAssgntPurchCZL: Codeunit "Item Charge Assgnt. Purch. CZL";
begin
if ItemChargeAssignmentPurch."Applies-to Doc. Type" = ItemChargeAssignmentPurch."Applies-to Doc. Type"::"Item Ledger Entry Positive Adjmt. CZL" then
ItemChargeAssgntPurchCZL.AssignByAmountItemLedgerEntryPositiveAdjmt(ItemChargeAssignmentPurch, TempItemChargeAssignmentPurch, PurchHeader);
end;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
namespace Microsoft.Purchases.Document;

using Microsoft.Finance.Currency;
using Microsoft.Finance.GeneralLedger.Setup;
using Microsoft.Inventory.Item;
using Microsoft.Inventory.Ledger;
using Microsoft.Inventory.Tracking;
using Microsoft.Purchases.Posting;

codeunit 31179 "Item Charge Assgnt. Purch. CZL"
{
procedure CreateItemEntryChargeAssgnt(var FromItemLedgerEntry: Record "Item Ledger Entry"; var FromItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)")
var
ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)";
Item: Record Item;
PurchaseAppliestoDocumentType: Enum "Purchase Applies-to Document Type";
NextLineNo: Integer;
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeCreateItemEntryChargeAssgnt(FromItemLedgerEntry, FromItemChargeAssignmentPurch, IsHandled);
if IsHandled then
exit;

if not FromItemChargeAssignmentPurch.RecordLevelLocking then
FromItemChargeAssignmentPurch.LockTable(true, true);

NextLineNo := FromItemChargeAssignmentPurch."Line No.";

ItemChargeAssignmentPurch.SetRange("Document Type", FromItemChargeAssignmentPurch."Document Type");
ItemChargeAssignmentPurch.SetRange("Document No.", FromItemChargeAssignmentPurch."Document No.");
ItemChargeAssignmentPurch.SetRange("Document Line No.", FromItemChargeAssignmentPurch."Document Line No.");
ItemChargeAssignmentPurch.SetRange("Applies-to Doc. Type", ItemChargeAssignmentPurch."Applies-to Doc. Type"::Receipt);

FromItemLedgerEntry.SetLoadFields("Document No.", "Entry No.", "Item No.", "Description");
if FromItemLedgerEntry.FindSet(true) then
repeat
ItemChargeAssignmentPurch.SetRange("Applies-to Doc. No.", FromItemLedgerEntry."Document No.");
ItemChargeAssignmentPurch.SetRange("Applies-to Doc. Line No.", FromItemLedgerEntry."Entry No.");
if FromItemLedgerEntry.Description = '' then begin
Item.Get(FromItemLedgerEntry."Item No.");
FromItemLedgerEntry.Description := Item.Description;
end;
if not ItemChargeAssignmentPurch.FindFirst() then
InsertItemChargeAssignmentWithValues(
FromItemChargeAssignmentPurch, PurchaseAppliestoDocumentType::"Item Ledger Entry Positive Adjmt. CZL",
FromItemLedgerEntry."Document No.", FromItemLedgerEntry."Entry No.",
FromItemLedgerEntry."Item No.", FromItemLedgerEntry.Description, NextLineNo);
until FromItemLedgerEntry.Next() = 0;
end;

procedure PostItemChargePerPosAdjItem(PurchPost: Codeunit "Purch.-Post"; var TempItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)" temporary; PurchaseHeader: Record "Purchase Header"; PurchaseLine: Record "Purchase Line")
var
GeneralLedgerSetup: Record "General Ledger Setup";
ItemLedgerEntry: Record "Item Ledger Entry";
DummyTrackingSpecification: Record "Tracking Specification";
CurrencyExchangeRate: Record "Currency Exchange Rate";
IsHandled: Boolean;
TextDeletedErr: Label 'Item Ledger Entry has been deleted.';
begin
IsHandled := false;
OnBeforePostItemChargePerPosAdjItem(PurchPost, TempItemChargeAssignmentPurch, PurchaseHeader, PurchaseLine, IsHandled);
if IsHandled then
exit;

GeneralLedgerSetup.Get();
if not ItemLedgerEntry.Get(TempItemChargeAssignmentPurch."Applies-to Doc. Line No.") then
Error(TextDeletedErr);

PurchaseLine."No." := TempItemChargeAssignmentPurch."Item No.";
PurchaseLine."Appl.-to Item Entry" := ItemLedgerEntry."Entry No.";
PurchaseLine.Amount := TempItemChargeAssignmentPurch."Amount to Assign";
PurchaseLine."Unit Cost" := Round(PurchaseLine.Amount / ItemLedgerEntry.Quantity, GeneralLedgerSetup."Unit-Amount Rounding Precision");
if TempItemChargeAssignmentPurch."Document Type" in [TempItemChargeAssignmentPurch."Document Type"::"Return Order", TempItemChargeAssignmentPurch."Document Type"::"Credit Memo"] then
PurchaseLine.Amount := -PurchaseLine.Amount;

if PurchaseHeader."Currency Code" <> '' then
PurchaseLine.Amount :=
CurrencyExchangeRate.ExchangeAmtFCYToLCY(
PurchaseHeader.GetUseDate(), PurchaseHeader."Currency Code", PurchaseLine.Amount, PurchaseHeader."Currency Factor");
PurchaseLine."Inv. Discount Amount" := Round(
PurchaseLine."Inv. Discount Amount" / PurchaseLine.Quantity * TempItemChargeAssignmentPurch."Qty. to Assign",
GeneralLedgerSetup."Amount Rounding Precision");

PurchaseLine.Amount := Round(PurchaseLine.Amount, GeneralLedgerSetup."Amount Rounding Precision");
PurchaseLine."Unit Cost (LCY)" := Round(PurchaseLine.Amount / ItemLedgerEntry.Quantity, GeneralLedgerSetup."Unit-Amount Rounding Precision");
PurchaseLine."Line No." := TempItemChargeAssignmentPurch."Document Line No.";

PurchPost.PostItemJnlLine(
PurchaseHeader, PurchaseLine, 0, 0,
ItemLedgerEntry.Quantity, ItemLedgerEntry.Quantity,
PurchaseLine."Appl.-to Item Entry", TempItemChargeAssignmentPurch."Item Charge No.", DummyTrackingSpecification);
end;

procedure AssignByAmountItemLedgerEntryPositiveAdjmt(ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; var TempItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)" temporary; PurchaseHeader: Record "Purchase Header")
var
ItemLedgerEntry: Record "Item Ledger Entry";
CurrencyExchangeRate: Record "Currency Exchange Rate";
begin
ItemLedgerEntry.Get(ItemChargeAssignmentPurch."Applies-to Doc. Line No.");
ItemLedgerEntry.CalcFields("Cost Amount (Actual)");

if PurchaseHeader."Currency Code" = '' then
TempItemChargeAssignmentPurch."Applies-to Doc. Line Amount" := Abs(ItemLedgerEntry."Cost Amount (Actual)")
else
TempItemChargeAssignmentPurch."Applies-to Doc. Line Amount" :=
CurrencyExchangeRate.ExchangeAmtFCYToFCY(
PurchaseHeader."Posting Date", '', PurchaseHeader."Currency Code",
Abs(ItemLedgerEntry."Cost Amount (Actual)"));
end;

local procedure InsertItemChargeAssignmentWithValues(FromItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; PurchaseAppliestoDocumentType: Enum "Purchase Applies-to Document Type";
FromApplToDocNo: Code[20]; FromApplToDocLineNo: Integer; FromItemNo: Code[20]; FromDescription: Text[100]; var NextLineNo: Integer)
var
ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)";
begin
NextLineNo := NextLineNo + 10000;

ItemChargeAssignmentPurch."Document No." := FromItemChargeAssignmentPurch."Document No.";
ItemChargeAssignmentPurch."Document Type" := FromItemChargeAssignmentPurch."Document Type";
ItemChargeAssignmentPurch."Document Line No." := FromItemChargeAssignmentPurch."Document Line No.";
ItemChargeAssignmentPurch."Item Charge No." := FromItemChargeAssignmentPurch."Item Charge No.";
ItemChargeAssignmentPurch."Line No." := NextLineNo;
ItemChargeAssignmentPurch."Applies-to Doc. No." := FromApplToDocNo;
ItemChargeAssignmentPurch."Applies-to Doc. Type" := PurchaseAppliestoDocumentType;
ItemChargeAssignmentPurch."Applies-to Doc. Line No." := FromApplToDocLineNo;
ItemChargeAssignmentPurch."Item No." := FromItemNo;
ItemChargeAssignmentPurch.Description := FromDescription;
ItemChargeAssignmentPurch."Unit Cost" := FromItemChargeAssignmentPurch."Unit Cost";

OnBeforeInsertItemChargeAssgntWithAssignValues(ItemChargeAssignmentPurch, FromItemChargeAssignmentPurch);
ItemChargeAssignmentPurch.Insert();
end;

[IntegrationEvent(false, false)]
local procedure OnBeforeCreateItemEntryChargeAssgnt(var ItemLedgerEntry: Record "Item Ledger Entry"; var ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; var IsHandled: Boolean)
begin
end;

[IntegrationEvent(false, false)]
local procedure OnBeforePostItemChargePerPosAdjItem(PurchPost: Codeunit "Purch.-Post"; var TempItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)" temporary; PurchaseHeader: Record "Purchase Header"; PurchaseLine: Record "Purchase Line"; var IsHandled: Boolean)
begin
end;

[IntegrationEvent(false, false)]
local procedure OnBeforeInsertItemChargeAssgntWithAssignValues(var ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; FromItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)")
begin
end;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Microsoft.Purchases.Document;

enumextension 11706 "Purch. Applies-to Doc.Type CZL" extends "Purchase Applies-to Document Type"
{
value(11700; "Item Ledger Entry Positive Adjmt. CZL")
{
Caption = 'Item Ledger Entry Positive Adjmt.';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
namespace Microsoft.Purchases.Document;

using Microsoft.Inventory.Ledger;

pageextension 31103 "Item Charge Asgmt. (Purch) CZL" extends "Item Charge Assignment (Purch)"
{
actions
{
addafter(SuggestItemChargeAssignment)
{
action(GetPosAdjLedgerEntriesCZL)
{
AccessByPermission = TableData "Item Ledger Entry" = R;
ApplicationArea = Basic, Suite;
Caption = 'Get Positive Adjmt. Ledger Entries';
Image = ReceiveLoaner;
ToolTip = 'Open the page for the selection of the posting item ledger entries.';

trigger OnAction()
var
ItemLedgerEntry: Record "Item Ledger Entry";
ItemChargeAssigmentPurch: Record "Item Charge Assignment (Purch)";

begin
ItemChargeAssigmentPurch.SetRange("Document Type", Rec."Document Type");
ItemChargeAssigmentPurch.SetRange("Document No.", Rec."Document No.");
ItemChargeAssigmentPurch.SetRange("Document Line No.", Rec."Document Line No.");
if not ItemChargeAssigmentPurch.FindLast() then
ItemChargeAssigmentPurch := Rec;

ItemLedgerEntry.FilterGroup(2);
ItemLedgerEntry.SetRange("Entry Type", ItemLedgerEntry."Entry Type"::"Positive Adjmt.");
ItemLedgerEntry.SetRange(Positive, true);
ItemLedgerEntry.FilterGroup(0);
OnGetPosAdjLedgerEntrieOnActionOnAfterItemChargeAssgntPurchSetFiltersCZL(Rec, ItemLedgerEntry, PurchLine);

OpenItemLedgerEntries(ItemChargeAssigmentPurch, ItemLedgerEntry);
end;
}
}
addlast(Category_Process)
{
actionref(GetPosAdjLedgerEntriesCZLPromotedCZL; GetPosAdjLedgerEntriesCZL)
{
}
}
}

local procedure OpenItemLedgerEntries(var ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; var ItemLedgerEntry: Record "Item Ledger Entry")
var
AssignItemChargeAssgntPurchCZL: Codeunit "Item Charge Assgnt. Purch. CZL";
ItemLedgerEntriesPage: Page "Item Ledger Entries";
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeOpenItemLedgerEntriesCZL(Rec, ItemChargeAssignmentPurch, IsHandled);
if IsHandled then
exit;

ItemLedgerEntriesPage.SetTableView(ItemLedgerEntry);
ItemLedgerEntriesPage.LookupMode(true);
if ItemLedgerEntriesPage.RunModal() = Action::LookupOK then begin
ItemLedgerEntriesPage.SetSelectionFilter(ItemLedgerEntry);
if not ItemLedgerEntry.IsEmpty() then begin
ItemChargeAssignmentPurch."Unit Cost" := PurchLine2."Unit Cost";
AssignItemChargeAssgntPurchCZL.CreateItemEntryChargeAssgnt(ItemLedgerEntry, ItemChargeAssignmentPurch);
end;
end;
end;

[IntegrationEvent(false, false)]
local procedure OnGetPosAdjLedgerEntrieOnActionOnAfterItemChargeAssgntPurchSetFiltersCZL(var ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; var ItemLedgerEntry: Record "Item Ledger Entry"; PurchaseLine: Record "Purchase Line")
begin
end;

[IntegrationEvent(false, false)]
local procedure OnBeforeOpenItemLedgerEntriesCZL(var RecItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; var ItemChargeAssignmentPurch: Record "Item Charge Assignment (Purch)"; var IsHandled: Boolean)
begin
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
codeunit "Invt. Document Handler CZL" = X,
codeunit "Invt. Document-Printed CZL" = X,
codeunit "Item Handler CZL" = X,
codeunit "Item Charge Assgnt Handler CZL" = X,
codeunit "Item Charge Assgnt. Purch. CZL" = X,
codeunit "Item Jnl.CheckLine Handler CZL" = X,
codeunit "Item Jnl. Template Handler CZL" = X,
codeunit "Item Journal Line Handler CZL" = X,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions Apps/DE/EDocumentFormatXRechnung/app/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"id": "fdeb586e-beff-49d8-947d-1e73ce980b34",
"name": "E-Document format for XRechnung",
"publisher": "Microsoft",
"brief": "E-Document format for XRechnung.",
"description": ": XRechnung is a customization for Germany business requirements. This app supports XRechnung 3.0.2 format for working with E-documents app.",
"version": "26.0.0.0",
"privacyStatement": "https://go.microsoft.com/fwlink/?LinkId=724009",
"EULA": "https://go.microsoft.com/fwlink/?linkid=2009120",
"help": "https://go.microsoft.com/fwlink/?LinkId=724011",
"url": "https://go.microsoft.com/fwlink/?LinkId=724011",
"logo": "ExtensionLogo.png",
"contextSensitiveHelpUrl": "https://go.microsoft.com/fwlink/?linkid=2206603",
"dependencies": [
{
"id": "e1d97edc-c239-46b4-8d84-6368bdf67c8b",
"name": "E-Document Core",
"publisher": "Microsoft",
"version": "26.0.0.0"
}
],
"screenshots": [],
"platform": "26.0.0.0",
"idRanges": [
{
"from": 13914,
"to": 13917
}
],
"resourceExposurePolicy": {
"allowDebugging": true,
"allowDownloadingSource": true,
"includeSourceInSymbolFile": true
},
"application": "26.0.0.0",
"target": "Cloud",
"features": ["TranslationFile"]
}
Loading

0 comments on commit 4f1d3e4

Please sign in to comment.