Skip to content

Commit

Permalink
Syncing with version 25.0.20074.0 (#26546)
Browse files Browse the repository at this point in the history
  • Loading branch information
JesperSchulz and aholstrup1 authored May 28, 2024
1 parent 72f4f07 commit b462305
Show file tree
Hide file tree
Showing 164 changed files with 15,125 additions and 2,539 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/25.0.19547.0/base",
"artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/25.0.20074.0/base",
"country": "base",
"useProjectDependencies": true,
"repoVersion": "25.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ codeunit 31390 "Match Bank Payment Handler CZZ"
SalesAdvLetterHeaderCZZ: Record "Sales Adv. Letter Header CZZ";
CustomerBankAccount: Record "Customer Bank Account";
begin
OnBeforeFillMatchBankPaymentBufferSalesAdvance(SalesAdvLetterHeaderCZZ, SearchRuleLineCZB, TempMatchBankPaymentBufferCZB, GenJournalLine);
SalesAdvLetterHeaderCZZ.SetRange(Status, SalesAdvLetterHeaderCZZ.Status::"To Pay");
if (GenJournalLine."Account Type" = GenJournalLine."Account Type"::Customer) and
(GenJournalLine."Account No." <> '')
Expand Down Expand Up @@ -96,6 +97,7 @@ codeunit 31390 "Match Bank Payment Handler CZZ"
PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ";
VendorBankAccount: Record "Vendor Bank Account";
begin
OnBeforeFillMatchBankPaymentBufferPurchaseAdvance(PurchAdvLetterHeaderCZZ, SearchRuleLineCZB, TempMatchBankPaymentBufferCZB, GenJournalLine);
PurchAdvLetterHeaderCZZ.SetRange(Status, PurchAdvLetterHeaderCZZ.Status::"To Pay");
if (GenJournalLine."Account Type" = GenJournalLine."Account Type"::Vendor) and
(GenJournalLine."Account No." <> '')
Expand Down Expand Up @@ -181,4 +183,15 @@ codeunit 31390 "Match Bank Payment Handler CZZ"
AdvanceSearchRuleLineCZB.Validate("Search Scope", AdvanceSearchRuleLineCZB."Search Scope"::"Advance CZZ");
AdvanceSearchRuleLineCZB.Insert(true);
end;

[IntegrationEvent(false, false)]
local procedure OnBeforeFillMatchBankPaymentBufferPurchaseAdvance(var PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ"; SearchRuleLineCZB: Record "Search Rule Line CZB"; TempMatchBankPaymentBufferCZB: Record "Match Bank Payment Buffer CZB"; GenJournalLine: Record "Gen. Journal Line")
begin
end;

[IntegrationEvent(false, false)]
local procedure OnBeforeFillMatchBankPaymentBufferSalesAdvance(var SalesAdvLetterHeaderCZZ: Record "Sales Adv. Letter Header CZZ"; SearchRuleLineCZB: Record "Search Rule Line CZB"; TempMatchBankPaymentBufferCZB: Record "Match Bank Payment Buffer CZB"; GenJournalLine: Record "Gen. Journal Line")
begin
end;

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Finance.GeneralLedger.Posting;

using Microsoft.Sales.Customer;
using Microsoft.Finance.GeneralLedger.Journal;
using Microsoft.Finance.GeneralLedger.Ledger;
using Microsoft.Finance.GeneralLedger.Setup;
Expand Down Expand Up @@ -375,6 +376,29 @@ codeunit 31315 "Gen.Jnl. Post Line Handler CZL"
IsHandled := PersistConfirmResponseCZL.GetPersistentResponse();
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Gen. Jnl.-Post Line", 'OnBeforePostDtldCVLedgEntry', '', false, false)]
local procedure OnBeforePostDtldCVLedgEntry(sender: Codeunit "Gen. Jnl.-Post Line"; var GenJournalLine: Record "Gen. Journal Line"; var DetailedCVLedgEntryBuffer: Record "Detailed CV Ledg. Entry Buffer"; var AccNo: Code[20]; var IsHandled: Boolean; AddCurrencyCode: Code[10]; MultiplePostingGroups: Boolean)
var
CustomerPostingGroup: Record "Customer Posting Group";
OldCorrection: Boolean;
begin
if IsHandled then
exit;

if MultiplePostingGroups and
(DetailedCVLedgEntryBuffer."Entry Type" = DetailedCVLedgEntryBuffer."Entry Type"::Application)
then begin
CustomerPostingGroup.Get(GenJournalLine."Posting Group");
if AccNo = CustomerPostingGroup.GetReceivablesAccount() then begin
OldCorrection := GenJournalLine.Correction;
GenJournalLine.Correction := true;
sender.CreateGLEntry(GenJournalLine, AccNo, DetailedCVLedgEntryBuffer."Amount (LCY)", 0, DetailedCVLedgEntryBuffer."Currency Code" = AddCurrencyCode);
GenJournalLine.Correction := OldCorrection;
IsHandled := true;
end;
end;
end;

[IntegrationEvent(false, false)]
local procedure OnBeforeUpdateVATAmountOnAfterInitVAT(var GenJournalLine: Record "Gen. Journal Line"; var GLEntry: Record "G/L Entry"; var IsHandled: Boolean)
begin
Expand Down
12 changes: 0 additions & 12 deletions Apps/CZ/CoreLocalizationPack/app/Src/Reports/PurchaseOrder.rdl
Original file line number Diff line number Diff line change
Expand Up @@ -4376,9 +4376,6 @@ End Function</Code>
<Field Name="UoMLbl">
<DataField>UoMLbl</DataField>
</Field>
<Field Name="CreatorLbl">
<DataField>CreatorLbl</DataField>
</Field>
<Field Name="SubtotalLbl">
<DataField>SubtotalLbl</DataField>
</Field>
Expand Down Expand Up @@ -4619,15 +4616,6 @@ End Function</Code>
<Field Name="InvDiscountAmount_PurchaseLineFormat">
<DataField>InvDiscountAmount_PurchaseLineFormat</DataField>
</Field>
<Field Name="FullName_Employee">
<DataField>FullName_Employee</DataField>
</Field>
<Field Name="PhoneNo_Employee">
<DataField>PhoneNo_Employee</DataField>
</Field>
<Field Name="CompanyEMail_Employee">
<DataField>CompanyEMail_Employee</DataField>
</Field>
</Fields>
<Query>
<DataSourceName>DataSource</DataSourceName>
Expand Down
Binary file not shown.
9 changes: 0 additions & 9 deletions Apps/CZ/CoreLocalizationPack/app/Src/Reports/SalesInvoice.rdl
Original file line number Diff line number Diff line change
Expand Up @@ -5714,15 +5714,6 @@ End Function</Code>
<Field Name="VATLbl">
<DataField>VATLbl</DataField>
</Field>
<Field Name="PrepayedLbl">
<DataField>PrepayedLbl</DataField>
</Field>
<Field Name="TotalAfterPrepayedLbl">
<DataField>TotalAfterPrepayedLbl</DataField>
</Field>
<Field Name="PaymentsLbl">
<DataField>PaymentsLbl</DataField>
</Field>
<Field Name="DisplayAdditionalFeeNote">
<DataField>DisplayAdditionalFeeNote</DataField>
</Field>
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions Apps/FR/IntrastatFR/app/AppResources/FR_DataExchDefMap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
</DataExchLineDef>
<DataExchLineDef LineType="1" Code="2-SENDER" ColumnCount="0" DataLineTag="/INSTAT/Envelope" ParentCode="1-HEADER">
<DataExchColumnDef ColumnNo="1" Name="Party" Show="false" DataType="0" Path="/Party[@partyType=&quot;PSI&quot; and @partyRole=&quot;sender&quot;]" TextPaddingRequired="false" Justification="0" UseNodeNameAsValue="false" BlankZero="false" ExportIfNotBlank="false" />
<DataExchColumnDef ColumnNo="2" Name="partyType" Show="false" DataType="0" Path="/Party[@partyType]" TextPaddingRequired="false" Justification="0" UseNodeNameAsValue="false" BlankZero="false" ExportIfNotBlank="false" />
<DataExchColumnDef ColumnNo="3" Name="partyRole" Show="false" DataType="0" Path="/Party[@partyRole]" TextPaddingRequired="false" Justification="0" UseNodeNameAsValue="false" BlankZero="false" ExportIfNotBlank="false" />
<DataExchColumnDef ColumnNo="2" Name="partyType" Show="false" DataType="0" Path="/Party[@partyType]" TextPaddingRequired="false" Justification="0" UseNodeNameAsValue="false" BlankZero="false" ExportIfNotBlank="true" />
<DataExchColumnDef ColumnNo="3" Name="partyRole" Show="false" DataType="0" Path="/Party[@partyRole]" TextPaddingRequired="false" Justification="0" UseNodeNameAsValue="false" BlankZero="false" ExportIfNotBlank="true" />
<DataExchColumnDef ColumnNo="4" Name="partyId" Show="false" DataType="0" Path="/Party/partyId" TextPaddingRequired="false" Justification="0" UseNodeNameAsValue="false" BlankZero="false" ExportIfNotBlank="false" />
<DataExchColumnDef ColumnNo="5" Name="partyName" Show="false" DataType="0" Path="/Party/partyName" TextPaddingRequired="false" Justification="0" UseNodeNameAsValue="false" BlankZero="false" ExportIfNotBlank="false" />
<DataExchMapping TableId="79" Name="" MappingCodeunit="1269">
Expand Down
33 changes: 33 additions & 0 deletions Apps/FR/IntrastatFR/app/src/IntrastatReportFRUpgrade.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ codeunit 10857 IntrastatReportFRUpgrade
trigger OnUpgradePerCompany()
begin
UpdateLinesType();
UpdateColumnsDataExchangeDef();
end;

local procedure UpdateLinesType()
Expand All @@ -28,8 +29,40 @@ codeunit 10857 IntrastatReportFRUpgrade
UpgradeTag.SetUpgradeTag(GetIntrastatTypeUpdateTag());
end;

local procedure UpdateColumnsDataExchangeDef()
var
DataExchColumnDef: Record "Data Exch. Column Def";
UpgradeTag: Codeunit "Upgrade Tag";
begin
//Set "Export If Not Blank" = true for partyType and partyRole columns
if UpgradeTag.HasUpgradeTag(GetUpdateColumnsDataExchangeDefTag()) then
exit;

DataExchColumnDef.SetRange("Data Exch. Def Code", 'INTRA-2022-FR');
DataExchColumnDef.SetRange("Data Exch. Line Def Code", '2-SENDER');
DataExchColumnDef.SetFilter(Path, '%1|%2', '/Party[@partyType]', '/Party[@partyRole]');
if DataExchColumnDef.IsEmpty() then
exit;

DataExchColumnDef.ModifyAll("Export If Not Blank", true);

UpgradeTag.SetUpgradeTag(GetUpdateColumnsDataExchangeDefTag());
end;

internal procedure GetIntrastatTypeUpdateTag(): Code[250]
begin
exit('MS-481518-IntrastatTypeUpdateFR-20230818');
end;

internal procedure GetUpdateColumnsDataExchangeDefTag(): Code[250]
begin
exit('MS-527324-UpdateColumnsDataExchangeDef-20240522');
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Upgrade Tag", 'OnGetPerCompanyUpgradeTags', '', false, false)]
local procedure RegisterPerCompanyTags(var PerCompanyUpgradeTags: List of [Code[250]])
begin
PerCompanyUpgradeTags.Add(GetUpdateColumnsDataExchangeDefTag());
end;

}
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ codeunit 18001 "GST Base Validation"
SignFactor := Getsign(DocTypeEnum, TransTypeEnum);
end;

OnAfterUpdateGSTLedgerEntrySignFactor(Rec, SignFactor, DocTypeEnum, TransTypeEnum);

if Rec."Transaction Type" = Rec."Transaction Type"::Sales then begin
Rec."GST Base Amount" := (Rec."GST Base Amount") * SignFactor;
Rec."GST Amount" := (Rec."GST Amount") * SignFactor;
Expand Down Expand Up @@ -294,6 +296,8 @@ codeunit 18001 "GST Base Validation"
SignFactor := Getsign(DocTypeEnum, TransTypeEnum);
end;

OnAfterUpdateDetailedGSTLedgerEntrySignFactor(Rec, SignFactor, DocTypeEnum, TransTypeEnum);

if Rec."Transaction Type" = Rec."Transaction Type"::Sales then begin
Rec."GST Base Amount" := (Rec."GST Base Amount") * SignFactor;
Rec."GST Amount" := (Rec."GST Amount") * SignFactor;
Expand Down Expand Up @@ -321,6 +325,8 @@ codeunit 18001 "GST Base Validation"
if (Rec."Amount Loaded on Item" <> Rec."GST Amount") and (Rec."Amount Loaded on Item" <> 0) and (Rec."GST Credit" = Rec."GST Credit"::"Non-Availment") then
Rec."Amount Loaded on Item" := Rec."GST Amount";

OnAfterUpdateDetailedGstLedgerEntryAmountsField(Rec, SignFactor);

if (Rec."Transaction Type" = Rec."Transaction Type"::Sales) and (Rec."GST Place of Supply" = Rec."GST Place of Supply"::" ") then
Rec."GST Place of Supply" := SalesReceivablesSetup."GST Dependency Type";

Expand Down Expand Up @@ -1421,4 +1427,20 @@ codeunit 18001 "GST Base Validation"
local procedure OnAfterUpdateDetailedGstLedgerEntryOnafterInsertEventOnBeforeModify(var DetailedGSTLedgerEntry: Record "Detailed GST Ledger Entry"; GSTRegistrationNos: Record "GST Registration Nos."; var DetailedGSTLedgerEntryInfo: Record "Detailed GST Ledger Entry Info")
begin
end;

[IntegrationEvent(false, false)]
local procedure OnAfterUpdateDetailedGstLedgerEntryAmountsField(var DetailedGSTLedgerEntry: Record "Detailed GST Ledger Entry"; SignFactor: Integer)
begin
end;

[IntegrationEvent(false, false)]
local procedure OnAfterUpdateDetailedGSTLedgerEntrySignFactor(var DetailedGSTLedgerEntry: Record "Detailed GST Ledger Entry"; var SignFactor: Integer; DocTypeEnum: Enum Microsoft.Finance.GST.Base."Document Type Enum"; TransTypeEnum: Enum Microsoft.Finance.GST.Base."Transaction Type Enum")
begin
end;

[IntegrationEvent(false, false)]
local procedure OnAfterUpdateGSTLedgerEntrySignFactor(var GSTLedgerEntry: Record "GST Ledger Entry"; var SignFactor: Integer; DocTypeEnum: Enum Microsoft.Finance.GST.Base."Document Type Enum"; TransTypeEnum: Enum Microsoft.Finance.GST.Base."Transaction Type Enum")
begin
end;

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace Microsoft.Purchases.Document;
using Microsoft.Finance.GST.Base;
using Microsoft.Finance.GST.Purchase;
using Microsoft.Finance.GST.Subcontracting;
using Microsoft.Foundation.UOM;
using Microsoft.Manufacturing.Document;
using Microsoft.Purchases.History;

Expand Down Expand Up @@ -312,8 +313,8 @@ tableextension 18083 "GST Purchase Line Ext" extends "Purchase Line"
SubOrderCompList.SetRange("Document Line No.", "Line No.");
if SubOrderCompList.FindSet() then
repeat
SubOrderCompList.Validate("Quantity To Send", ("Deliver Comp. For" * SubOrderCompList."Quantity per"));
if SubOrderCompList."Scrap %" <> 0 Then
SubOrderCompList.Validate("Quantity To Send", GetQuantityToSendForSubOrderCompList(SubOrderCompList, "Deliver Comp. For"));
if SubOrderCompList."Scrap %" <> 0 then
SubOrderCompList."Quantity To Send" :=
SubOrderCompList."Quantity To Send" + (SubOrderCompList."Quantity To Send" / 100) * SubOrderCompList."Scrap %";

Expand All @@ -327,11 +328,11 @@ tableextension 18083 "GST Purchase Line Ext" extends "Purchase Line"
SubOrderCompListVend.SetRange("Document Line No.", "Line No.");
if SubOrderCompListVend.FindSet() then
repeat
SubOrderCompListVend.Validate("Qty. to Consume", "Qty. to Receive" * SubOrderCompListVend."Quantity per" * SubOrderCompListVend."Qty. per Unit of Measure");
SubOrderCompListVend.Validate("Qty. to Consume", GetQtytoConsumeForSubOrderCompListVend(SubOrderCompListVend, "Qty. to Receive"));
SubOrderCompListVend.Validate("Qty. to Return (C.E.)", "Qty. to Reject (C.E.)" * SubOrderCompListVend."Quantity per");
SubOrderCompListVend.Validate("Qty. To Return (V.E.)", (SubOrderCompListVend."Quantity per" * "Qty. to Reject (V.E.)"));
SubOrderCompListVend.Validate("Posting Date", "Posting Date");
if SubOrderCompListVend."Scrap %" <> 0 Then begin
if SubOrderCompListVend."Scrap %" <> 0 then begin
SubOrderCompListVend."Qty. to Consume" += (SubOrderCompListVend."Qty. to Consume" / 100) * SubOrderCompListVend."Scrap %";
SubOrderCompListVend."Qty. to Return (C.E.)" +=
(SubOrderCompListVend."Qty. to Return (C.E.)" / 100) * SubOrderCompListVend."Scrap %";
Expand Down Expand Up @@ -402,6 +403,68 @@ tableextension 18083 "GST Purchase Line Ext" extends "Purchase Line"
Error(ProdOrdReopenErr, "Prod. Order No.");
end;

procedure GetQuantityToSendForSubOrderCompList(SubOrderCompList: Record "Sub Order Component List"; DeliverCompFor: Decimal): Decimal
var
ProdOrderComponent: Record "Prod. Order Component";
UOMMgt: Codeunit "Unit of Measure Management";
CalculatedQuantity: Decimal;
begin
Clear(CalculatedQuantity);
ProdOrderComponent.Get(ProdOrderComponent.Status::Released, SubOrderCompList."Production Order No.", SubOrderCompList."Production Order Line No.", SubOrderCompList."Line No.");
case ProdOrderComponent."Calculation Formula" of
ProdOrderComponent."Calculation Formula"::" ":
CalculatedQuantity := ProdOrderComponent."Quantity per";
ProdOrderComponent."Calculation Formula"::Length:
CalculatedQuantity := Round(ProdOrderComponent.Length * ProdOrderComponent."Quantity per", UOMMgt.QtyRndPrecision());
ProdOrderComponent."Calculation Formula"::"Length * Width":
CalculatedQuantity := Round(ProdOrderComponent.Length * ProdOrderComponent.Width * ProdOrderComponent."Quantity per", UOMMgt.QtyRndPrecision());
ProdOrderComponent."Calculation Formula"::"Length * Width * Depth":
CalculatedQuantity := Round(ProdOrderComponent.Length * ProdOrderComponent.Width * ProdOrderComponent.Depth * ProdOrderComponent."Quantity per", UOMMgt.QtyRndPrecision());
ProdOrderComponent."Calculation Formula"::Weight:
CalculatedQuantity := Round(ProdOrderComponent.Weight * ProdOrderComponent."Quantity per", UOMMgt.QtyRndPrecision());
ProdOrderComponent."Calculation Formula"::"Fixed Quantity":
CalculatedQuantity := ProdOrderComponent."Quantity per";
else
CalculatedQuantity := ProdOrderComponent.Quantity;
end;

if ProdOrderComponent."Calculation Formula" = ProdOrderComponent."Calculation Formula"::"Fixed Quantity" then
exit(CalculatedQuantity)
else
exit(CalculatedQuantity * DeliverCompFor);
end;

procedure GetQtytoConsumeForSubOrderCompListVend(SubOrderCompListVend: Record "Sub Order Comp. List Vend"; QtytoReceive: Decimal): Decimal
var
ProdOrderComponent: Record "Prod. Order Component";
UOMMgt: Codeunit "Unit of Measure Management";
CalculatedQuantity: Decimal;
begin
Clear(CalculatedQuantity);
ProdOrderComponent.Get(ProdOrderComponent.Status::Released, SubOrderCompListVend."Production Order No.", SubOrderCompListVend."Production Order Line No.", SubOrderCompListVend."Line No.");
case ProdOrderComponent."Calculation Formula" of
ProdOrderComponent."Calculation Formula"::" ":
CalculatedQuantity := ProdOrderComponent."Quantity per";
ProdOrderComponent."Calculation Formula"::Length:
CalculatedQuantity := Round(ProdOrderComponent.Length * ProdOrderComponent."Quantity per", UOMMgt.QtyRndPrecision());
ProdOrderComponent."Calculation Formula"::"Length * Width":
CalculatedQuantity := Round(ProdOrderComponent.Length * ProdOrderComponent.Width * ProdOrderComponent."Quantity per", UOMMgt.QtyRndPrecision());
ProdOrderComponent."Calculation Formula"::"Length * Width * Depth":
CalculatedQuantity := Round(ProdOrderComponent.Length * ProdOrderComponent.Width * ProdOrderComponent.Depth * ProdOrderComponent."Quantity per", UOMMgt.QtyRndPrecision());
ProdOrderComponent."Calculation Formula"::Weight:
CalculatedQuantity := Round(ProdOrderComponent.Weight * ProdOrderComponent."Quantity per", UOMMgt.QtyRndPrecision());
ProdOrderComponent."Calculation Formula"::"Fixed Quantity":
CalculatedQuantity := ProdOrderComponent."Quantity per";
else
CalculatedQuantity := ProdOrderComponent.Quantity;
end;

if ProdOrderComponent."Calculation Formula" = ProdOrderComponent."Calculation Formula"::"Fixed Quantity" then
exit(CalculatedQuantity)
else
exit(CalculatedQuantity * QtytoReceive * ProdOrderComponent."Qty. per Unit of Measure");
end;

var
ClosedStatusErr: Label 'No Transaction allowed; Status is Closed.';
InvalidQtyErr: label 'Quantity should be less than or equal to outstanding quantity.';
Expand Down
Loading

0 comments on commit b462305

Please sign in to comment.