Skip to content

Commit

Permalink
Uptake latest changes and add missing E-Document changes (#25263)
Browse files Browse the repository at this point in the history
Uptake latest changes and add missing E-Document changes. Those changes
were missing because of the .gitignore file
  • Loading branch information
aholstrup1 authored Nov 21, 2023
1 parent f960cfd commit c8e7bbf
Show file tree
Hide file tree
Showing 21 changed files with 1,518 additions and 28 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": "bcartifacts//23.1/base/latest",
"artifact": "bcartifacts//23.1.13431.14020/base",
"country": "base",
"useProjectDependencies": true,
"repoVersion": "23.1",
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
/[Ll]og/
[Oo]ut/

# Visual Studio 2015 cache/options directory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ codeunit 18017 "GST Tax Configuration"
UseCases.Add('{75F37BC7-AA5D-483D-A8A0-653E94AD6B8D}', 3);
UseCases.Add('{04F944A1-EF9C-440F-A89B-654782D13EAA}', 2);
UseCases.Add('{2AB850AD-528A-498A-9E23-65E396AC61A8}', 2);
UseCases.Add('{F7C5C8B6-2EB3-478E-AE6B-66BEEB6A3861}', 7);
UseCases.Add('{F7C5C8B6-2EB3-478E-AE6B-66BEEB6A3861}', 8);
UseCases.Add('{21957E13-9751-40A2-B591-67ADE93573E7}', 5);
UseCases.Add('{1988B611-ABD4-44C4-9CB5-67BB88E0002C}', 1);
UseCases.Add('{E5053EEB-44D1-4552-8084-67D72A90CECB}', 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ codeunit 18318 "GST Settlement"
else
GSTLiabilityBuffer[1]."GST Base Amount" := DetailedGSTLedgerEntry[1]."GST Base Amount";

GSTLiabilityBuffer[1]."GST Amount" := GSTBaseValidation.RoundGSTPrecision(DetailedGSTLedgerEntry[1]."GST Amount" * CurrencyFactor);
GSTLiabilityBuffer[1]."GST Amount" := GSTBaseValidation.RoundGSTPrecisionThroughTaxComponent(DetailedGSTLedgerEntry[1]."GST Component Code", DetailedGSTLedgerEntry[1]."GST Amount" * CurrencyFactor);

if (DetailedGSTLedgerEntry[1]."Cr. & Liab. Adjustment Type" =
DetailedGSTLedgerEntry[1]."Cr. & Liab. Adjustment Type"::Generate) and
Expand All @@ -540,7 +540,7 @@ codeunit 18318 "GST Settlement"
else
GSTLiabilityBuffer[1]."GST Base Amount" := DetailedGSTLedgerEntry[1]."Remaining Base Amount";

GSTLiabilityBuffer[1]."GST Amount" := GSTBaseValidation.RoundGSTPrecision(DetailedGSTLedgerEntry[1]."Remaining GST Amount" * CurrencyFactor);
GSTLiabilityBuffer[1]."GST Amount" := GSTBaseValidation.RoundGSTPrecisionThroughTaxComponent(DetailedGSTLedgerEntry[1]."GST Component Code", DetailedGSTLedgerEntry[1]."Remaining GST Amount" * CurrencyFactor);
end;

if NatureOfAdj = NatureOfAdj::Reverse then begin
Expand All @@ -549,7 +549,7 @@ codeunit 18318 "GST Settlement"
else
GSTLiabilityBuffer[1]."Applied Base Amount" := DetailedGSTLedgerEntry[1]."AdjustmentBase Amount";

GSTLiabilityBuffer[1]."Applied Amount" := GSTBaseValidation.RoundGSTPrecision(DetailedGSTLedgerEntry[1]."Adjustment Amount" * CurrencyFactor);
GSTLiabilityBuffer[1]."Applied Amount" := GSTBaseValidation.RoundGSTPrecisionThroughTaxComponent(DetailedGSTLedgerEntry[1]."GST Component Code", DetailedGSTLedgerEntry[1]."Adjustment Amount" * CurrencyFactor);
if DetailedGSTLedgerEntry[1]."GST Credit" = DetailedGSTLedgerEntry[1]."GST Credit"::Availment then
GSTLiabilityBuffer[1]."Credit Amount" := GSTLiabilityBuffer[1]."Applied Amount";
end;
Expand Down Expand Up @@ -1847,8 +1847,8 @@ codeunit 18318 "GST Settlement"
TempGSTPostingBuffer1[1]."GST Group Code" := '';
TempGSTPostingBuffer1[1].Availment := DetailedGSTLedgerEntry."GST Credit" = DetailedGSTLedgerEntry."GST Credit"::Availment;
TempGSTPostingBuffer1[1]."GST Group Type" := TempGSTPostingBuffer1[1]."GST Group Type"::Service;
TempGSTPostingBuffer1[1]."GST Base Amount" := GSTBaseValidation.RoundGSTPrecision(AppliedBaseAmount);
TempGSTPostingBuffer1[1]."GST Amount" := GSTBaseValidation.RoundGSTPrecision(AppliedAmount);
TempGSTPostingBuffer1[1]."GST Base Amount" := GSTBaseValidation.RoundGSTPrecisionThroughTaxComponent(DetailedGSTLedgerEntry."GST Component Code", AppliedBaseAmount);
TempGSTPostingBuffer1[1]."GST Amount" := GSTBaseValidation.RoundGSTPrecisionThroughTaxComponent(DetailedGSTLedgerEntry."GST Component Code", AppliedAmount);
TempGSTPostingBuffer1[1]."GST %" := DetailedGSTLedgerEntry."GST %";
TempGSTPostingBuffer1[1]."Normal Payment" := DetailedGSTLedgerEntry."Payment Type" = "Payment Type"::Normal;
TempGSTPostingBuffer1[1]."Dimension Set ID" := DimensionSetID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,7 @@ codeunit 18147 "e-Invoice Json Handler"
SalesInvoiceLine."HSN/SAC Code",
GstRate, SalesInvoiceLine.Quantity,
CopyStr(SalesInvoiceLine."Unit of Measure Code", 1, 3),
SalesInvoiceLine."Unit Price",
Round(SalesInvoiceLine."Unit Price", 0.001, '='),
SalesInvoiceLine."Line Amount" + SalesInvoiceLine."Line Discount Amount",
SalesInvoiceLine."Line Discount Amount", 0,
AssessableAmount, CGSTValue, SGSTValue, IGSTValue, CessRate, CesNonAdval,
Expand Down Expand Up @@ -1274,7 +1274,7 @@ codeunit 18147 "e-Invoice Json Handler"
SalesCrMemoLine."HSN/SAC Code", GstRate,
SalesCrMemoLine.Quantity,
CopyStr(SalesCrMemoLine."Unit of Measure Code", 1, 3),
SalesCrMemoLine."Unit Price",
Round(SalesCrMemoLine."Unit Price", 0.001, '='),
SalesCrMemoLine."Line Amount" + SalesCrMemoLine."Line Discount Amount",
SalesCrMemoLine."Line Discount Amount", 0,
AssessableAmount, CGSTValue, SGSTValue, IGSTValue, CessRate, CesNonAdval,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1274,8 +1274,10 @@ codeunit 18466 "Subcontracting Post"
if (ItemLedgerEntry."Lot No." = '') and (ItemLedgerEntry."Serial No." = '') then
ItemJnlLine.Validate("Applies-to Entry", ItemLedgerEntry."Entry No.");

ItemJnlLine."Location Code" := SubOrderCompListVendLocal."Vendor Location";
ItemJnlLine."New Location Code" := SubOrderCompListVendLocal."Company Location";
ItemJnlLine.Validate("Location Code", SubOrderCompListVendLocal."Vendor Location");
ItemJnlLine.Validate("New Location Code", SubOrderCompListVendLocal."Company Location");
if SubOrderCompListVendLocal."Bin Code" <> '' then
ItemJnlLine.Validate("New Bin Code", SubOrderCompListVendLocal."Bin Code");
ItemJnlLine."Variant Code" := SubOrderCompListVendLocal."Variant Code";
ItemJnlLine."Gen. Prod. Posting Group" := CompItem."Gen. Prod. Posting Group";
ItemJnlLine."Item Category Code" := CompItem."Item Category Code";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ page 18495 "Sub Order Comp. List Vend"
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the company location code for the document.';
}
field("Bin Code"; Rec."Bin Code")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the company bin code for the document.';
}
field("Vendor Location"; Rec."Vendor Location")
{
ApplicationArea = Basic, Suite;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ using Microsoft.Inventory.Ledger;
using Microsoft.Inventory.Location;
using Microsoft.Manufacturing.Document;
using Microsoft.Purchases.Document;
using Microsoft.Warehouse.Structure;

table 18478 "Sub Order Comp. List Vend"
{
Expand Down Expand Up @@ -348,6 +349,12 @@ table 18478 "Sub Order Comp. List Vend"
Caption = 'SSI';
DataClassification = EndUserIdentifiableInformation;
}
field(71; "Bin Code"; Code[20])
{
Caption = 'Bin Code';
TableRelation = if ("Qty. To Receive" = filter(> 0)) "Bin Content"."Bin Code" where("Location Code" = field("Company Location"), "Item No." = field("Item No."), "Variant Code" = field("Variant Code"));
DataClassification = EndUserIdentifiableInformation;
}
field(89; "Qty. per Unit of Measure"; Decimal)
{
Caption = 'Qty. per Unit of Measure';
Expand Down
2 changes: 1 addition & 1 deletion Apps/IN/INGST/app/Translations/India GST.en-GB.xlf

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Apps/IN/INGST/app/Translations/India GST.en-US.xlf

Large diffs are not rendered by default.

16 changes: 2 additions & 14 deletions Apps/W1/BankAccRecWithAI/app/src/BankAccRecAIInstall.Codeunit.al
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
namespace Microsoft.Bank.Reconciliation;

using System.AI;
using System.Environment;

codeunit 7252 "Bank Acc. Rec. AI Install"
{
Subtype = Install;
InherentPermissions = X;
InherentEntitlements = X;

trigger OnInstallAppPerDatabase()
begin
RegisterCapability();
end;

local procedure RegisterCapability()
var
CopilotCapability: Codeunit "Copilot Capability";
EnvironmentInformation: Codeunit "Environment Information";
LearnMoreUrlTxt: Label 'https://go.microsoft.com/fwlink/?linkid=2248547', Locked = true;
BankRecAIMatchingImpl: Codeunit "Bank Rec. AI Matching Impl.";
begin
if EnvironmentInformation.IsSaaSInfrastructure() then
if not CopilotCapability.IsCapabilityRegistered(Enum::"Copilot Capability"::"Bank Account Reconciliation") then
CopilotCapability.RegisterCapability(Enum::"Copilot Capability"::"Bank Account Reconciliation", LearnMoreUrlTxt);
BankRecAIMatchingImpl.RegisterCapability();
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ pageextension 7253 BankAccReconciliationExt extends "Bank Acc. Reconciliation"
TransToGLAccAIProposal: Page "Trans. To GL Acc. AI Proposal";
LineNoFilter: Text;
begin
BankRecAIMatchingImpl.RegisterCapability();

if not AzureOpenAI.IsEnabled(Enum::"Copilot Capability"::"Bank Account Reconciliation") then
exit;

Expand Down Expand Up @@ -100,6 +102,8 @@ pageextension 7253 BankAccReconciliationExt extends "Bank Acc. Reconciliation"
BankRecAIMatchingImpl: Codeunit "Bank Rec. AI Matching Impl.";
AzureOpenAI: Codeunit "Azure OpenAI";
begin
BankRecAIMatchingImpl.RegisterCapability();

if not AzureOpenAI.IsEnabled(Enum::"Copilot Capability"::"Bank Account Reconciliation") then
exit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ pageextension 7254 BankAccReconciliationListExt extends "Bank Acc. Reconciliatio
AzureOpenAI: Codeunit "Azure OpenAI";
BankAccRecAIProposal: Page "Bank Acc. Rec. AI Proposal";
begin
BankRecAIMatchingImpl.RegisterCapability();

if not AzureOpenAI.IsEnabled(Enum::"Copilot Capability"::"Bank Account Reconciliation") then
exit;

Expand Down
29 changes: 29 additions & 0 deletions Apps/W1/BankAccRecWithAI/app/src/BankRecAIMatchingImpl.Codeunit.al
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
namespace Microsoft.Bank.Reconciliation;

using Microsoft.Bank.Ledger;
using Microsoft.Upgrade;
using System.AI;
using System.Azure.KeyVault;
using System.Environment;
using System.Telemetry;
using System.Upgrade;

codeunit 7250 "Bank Rec. AI Matching Impl."
{
Expand Down Expand Up @@ -553,6 +556,31 @@ codeunit 7250 "Bank Rec. AI Matching Impl."
exit('Bank Account Reconciliation with AI');
end;

[EventSubscriber(ObjectType::Page, Page::"Copilot AI Capabilities", 'OnRegisterCopilotCapability', '', false, false)]
local procedure HandleOnRegisterCopilotCapability()
begin
RegisterCapability();
end;

procedure RegisterCapability()
var
CopilotCapability: Codeunit "Copilot Capability";
EnvironmentInformation: Codeunit "Environment Information";
UpgradeTag: Codeunit "Upgrade Tag";
UpgradeTagDefinitions: Codeunit "Upgrade Tag Definitions";
begin
if not EnvironmentInformation.IsSaaSInfrastructure() then
exit;

if UpgradeTag.HasUpgradeTag(UpgradeTagDefinitions.GetRegisterBankAccRecCopilotCapabilityUpgradeTag()) then
exit;

if not CopilotCapability.IsCapabilityRegistered(Enum::"Copilot Capability"::"Bank Account Reconciliation") then
CopilotCapability.RegisterCapability(Enum::"Copilot Capability"::"Bank Account Reconciliation", LearnMoreUrlTxt);

UpgradeTag.SetUpgradeTag(UpgradeTagDefinitions.GetRegisterBankAccRecCopilotCapabilityUpgradeTag());
end;

#if not CLEAN21
#pragma warning disable AL0432
#endif
Expand Down Expand Up @@ -598,4 +626,5 @@ codeunit 7250 "Bank Rec. AI Matching Impl."
TelemetryConstructingPromptFailedErr: label 'There was an error with constructing the chat completion prompt from the Key Vault.', Locked = true;
TelemetryApproximateTokenCountExceedsLimitTxt: label 'The approximate token count for the Copilot request exceeded the limit. Sending request in chunks.', Locked = true;
TelemetryChatCompletionErr: label 'Chat completion request was unsuccessful. Response code: %1', Locked = true;
LearnMoreUrlTxt: Label 'https://go.microsoft.com/fwlink/?linkid=2248547', Locked = true;
}
36 changes: 36 additions & 0 deletions Apps/W1/EDocument/app/src/Log/EDocDataStorage.Table.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace Microsoft.eServices.EDocument;

table 6125 "E-Doc. Data Storage"
{
DataClassification = CustomerContent;

fields
{
field(1; "Entry No."; Integer)
{
Caption = 'Entry No.';
AutoIncrement = true;
}
field(2; "Data Storage"; Blob)
{
Caption = 'Data Storage';
}

field(3; "Data Storage Size"; Integer)
{
Caption = 'Data Storage Size';
}
}

keys
{
key(Key1; "Entry No.")
{
Clustered = true;
}
}
}
90 changes: 90 additions & 0 deletions Apps/W1/EDocument/app/src/Log/EDocumentIntegrationLog.Table.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace Microsoft.eServices.EDocument;

table 6127 "E-Document Integration Log"
{
DataClassification = CustomerContent;

fields
{
field(1; "Entry No."; Integer)
{
AutoIncrement = true;
Caption = 'Entry No';
DataClassification = SystemMetadata;
}
field(2; "E-Doc. Entry No"; Integer)
{
Caption = 'E-Doc. Entry No';
TableRelation = "E-Document";
}
field(3; "Service Code"; Code[20])
{
Caption = 'Service Code';
TableRelation = "E-Document Service";
}
field(4; "Request Blob"; BLOB)
{
Caption = 'Request Blob';
}
field(5; "Response Blob"; BLOB)
{
Caption = 'Response Blob';
}
field(6; "Response Status"; Integer)
{
Caption = 'Response Status';
}
field(7; URL; Text[250])
{
Caption = 'URL';
}
field(8; Method; Text[10])
{
Caption = 'Method';
}
}

keys
{
key(Key1; "Entry No.")
{
Clustered = true;
}
}

var
EDcoumentRequestBlobTxt: Label 'E-Document_RequestMessage_%1.txt', Locked = true;
EDcoumentResponseBlobTxt: Label 'E-Document_ResponseMessage_%1.txt', Locked = true;

internal procedure ExportRequestMessage()
var
InStr: InStream;
FileName: Text;
begin
Rec.CalcFields("Request Blob");
if not Rec."Request Blob".HasValue() then
exit;

Rec."Request Blob".CreateInStream(InStr);
FileName := StrSubstNo(EDcoumentRequestBlobTxt, "E-Doc. Entry No");
DownloadFromStream(InStr, '', '', '', FileName);
end;

internal procedure ExportResponseMessage()
var
InStr: InStream;
FileName: Text;
begin
Rec.CalcFields("Response Blob");
if not Rec."Response Blob".HasValue() then
exit;

Rec."Response Blob".CreateInStream(InStr);
FileName := StrSubstNo(EDcoumentResponseBlobTxt, "E-Doc. Entry No");
DownloadFromStream(InStr, '', '', '', FileName);
end;
}
Loading

0 comments on commit c8e7bbf

Please sign in to comment.