-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Syncing with version 26.0.28000.0 (#27808)
Fixes [AB#420000](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/420000)
- Loading branch information
1 parent
2ac1ba8
commit 4f1d3e4
Showing
91 changed files
with
6,334 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/ItemChargeAssgntHandlerCZL.Codeunit.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
149 changes: 149 additions & 0 deletions
149
Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/ItemChargeAssgntPurchCZL.Codeunit.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
9 changes: 9 additions & 0 deletions
9
Apps/CZ/CoreLocalizationPack/app/Src/EnumExtensions/PurchAppliestoDocTypeCZL.EnumExt.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.'; | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ItemChargeAsgmtPurchCZL.PageExt.al
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} |
Oops, something went wrong.