Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10,421 changes: 10,421 additions & 0 deletions src/Apps/W1/EDocument/App/.resources/Template/ServiceCreditMemoWithQR.rdlc

Large diffs are not rendered by default.

10,869 changes: 10,869 additions & 0 deletions src/Apps/W1/EDocument/App/.resources/Template/ServiceInvoiceWithQR.rdlc

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
namespace Microsoft.eServices.EDocument;

using Microsoft.Sales.History;
using Microsoft.Service.History;
using System.IO;
using System.Text;
using System.Utilities;
Expand All @@ -18,12 +19,14 @@ codeunit 6197 "EDocument QR Code Management"
TempQRBuf: Record "EDoc QR Buffer" temporary;
SalesInvoiceHeader: Record "Sales Invoice Header";
SalesCrMemoHeader: Record "Sales Cr.Memo Header";
ServiceInvoiceHeader: Record "Service Invoice Header";
ServiceCrMemoHeader: Record "Service Cr.Memo Header";
SrcInStr: InStream;
DstOutStr: OutStream;
DocumentType: Text[30];
begin
case SourceTable.Number of
DATABASE::"Sales Invoice Header":
Database::"Sales Invoice Header":
begin
DocumentType := SalesInvoiceLbl;
SourceTable.SetTable(SalesInvoiceHeader);
Expand All @@ -41,7 +44,7 @@ codeunit 6197 "EDocument QR Code Management"
SalesInvoiceHeader."QR Code Base64".CreateInStream(SrcInStr);
end;

DATABASE::"Sales Cr.Memo Header":
Database::"Sales Cr.Memo Header":
begin
DocumentType := SalesCreditMemoLbl;
SourceTable.SetTable(SalesCrMemoHeader);
Expand All @@ -59,6 +62,42 @@ codeunit 6197 "EDocument QR Code Management"
SalesCrMemoHeader."QR Code Base64".CreateInStream(SrcInStr);
end;

Database::"Service Invoice Header":
begin
DocumentType := ServiceInvoiceLbl;
SourceTable.SetTable(ServiceInvoiceHeader);
ServiceInvoiceHeader.CalcFields("QR Code Base64");

if not ServiceInvoiceHeader."QR Code Base64".HasValue then begin
Message(NoQRDCodeAvailableLbl, DocumentType, ServiceInvoiceHeader."No.");
exit;
end;

TempQRBuf.Init();
TempQRBuf."Document Type" := DocumentType;
TempQRBuf."Document No." := ServiceInvoiceHeader."No.";

ServiceInvoiceHeader."QR Code Base64".CreateInStream(SrcInStr);
end;

Database::"Service Cr.Memo Header":
begin
DocumentType := ServiceCreditMemoLbl;
SourceTable.SetTable(ServiceCrMemoHeader);
ServiceCrMemoHeader.CalcFields("QR Code Base64");

if not ServiceCrMemoHeader."QR Code Base64".HasValue then begin
Message(NoQRDCodeAvailableLbl, DocumentType, ServiceCrMemoHeader."No.");
exit;
end;

TempQRBuf.Init();
TempQRBuf."Document Type" := DocumentType;
TempQRBuf."Document No." := ServiceCrMemoHeader."No.";

ServiceCrMemoHeader."QR Code Base64".CreateInStream(SrcInStr);
end;

else
Error(UnsupportedTableSourceLbl, SourceTable.Caption);
end;
Expand Down Expand Up @@ -127,4 +166,6 @@ codeunit 6197 "EDocument QR Code Management"
NoQRDCodeAvailableLbl: Label 'No QR Base64 content available for %1 %2.', Comment = '%1 the document type, %2 the document number';
SalesInvoiceLbl: Label 'Sales Invoice';
SalesCreditMemoLbl: Label 'Sales Credit Memo';
ServiceInvoiceLbl: Label 'Service Invoice';
ServiceCreditMemoLbl: Label 'Service Credit Memo';
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// ------------------------------------------------------------------------------------------------
// 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;

using Microsoft.Service.History;

pageextension 6172 "Posted Service CrMemo with QR" extends "Posted Service Credit Memo"
{
actions
{
addafter("E-Document")
{
action(ViewQRCode)
{
ApplicationArea = All;
Caption = 'View QR Code';
Image = Picture;
ToolTip = 'View the QR code assigned by the authority';
Visible = ShowQRCodeAction;

trigger OnAction()
var
EDocQRCodeMgr: Codeunit "EDocument QR Code Management";
begin
EDocQRCodeMgr.InitializeAndRunQRCodeViewer(Rec);
end;
}
}
}

var
ShowQRCodeAction: Boolean;

trigger OnAfterGetRecord()
begin
ShowQRCodeAction := Rec."QR Code Image".Count > 0;
end;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// ------------------------------------------------------------------------------------------------
// 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;

using Microsoft.Service.History;

reportextension 6172 "PostedServiceCrMemoWithQR" extends "Service - Credit Memo"
{
dataset
{
add("Service Cr.Memo Header")
{
column(QR_Code_Image; "QR Code Image")
{
}
column(QR_Code_Image_Lbl; FieldCaption("QR Code Image"))
{
}
}
}

rendering
{
layout("ServiceCreditMemoWithQR.rdlc")
{
Type = RDLC;
LayoutFile = './.resources/Template/ServiceCreditMemoWithQR.rdlc';
Caption = 'Service Credit Memo - E-Document (RDLC)';
Summary = 'The Service Credit Memo - E-Document (RDLC) provides the layout including E-Document QR code support.';
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// ------------------------------------------------------------------------------------------------
// 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;

using Microsoft.Service.History;

tableextension 6171 "Posted Service CrMemo with QR" extends "Service Cr.Memo Header"
{
fields
{
field(6165; "QR Code Image"; MediaSet)
{
Caption = 'QR Code Image';
DataClassification = CustomerContent;
}

field(6166; "QR Code Base64"; Blob)
{
Caption = 'QR Code Base64';
DataClassification = CustomerContent;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// ------------------------------------------------------------------------------------------------
// 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;

using Microsoft.Service.History;

pageextension 6170 "Posted Service Invoice with QR" extends "Posted Service Invoice"
{
actions
{
addafter("E-Document")
{
action(ViewQRCode)
{
ApplicationArea = All;
Caption = 'View QR Code';
Image = Picture;
ToolTip = 'View the QR code assigned by the authority';
Visible = ShowQRCodeAction;

trigger OnAction()
var
EDocQRCodeMgr: Codeunit "EDocument QR Code Management";
begin
EDocQRCodeMgr.InitializeAndRunQRCodeViewer(Rec);
end;
}
}
}

var
ShowQRCodeAction: Boolean;

trigger OnAfterGetRecord()
begin
ShowQRCodeAction := Rec."QR Code Image".Count > 0;
end;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// ------------------------------------------------------------------------------------------------
// 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;

using Microsoft.Service.History;

reportextension 6170 "PostedServiceInvoiceWithQR" extends "Service - Invoice"
{
dataset
{
add("Service Invoice Header")
{
column(QR_Code_Image; "QR Code Image")
{
}
column(QR_Code_Image_Lbl; FieldCaption("QR Code Image"))
{
}
}
}

rendering
{
layout("ServiceInvoiceWithQR.rdlc")
{
Type = RDLC;
LayoutFile = './.resources/Template/ServiceInvoiceWithQR.rdlc';
Caption = 'Service Invoice - E-Document (RDLC)';
Summary = 'The Service Invoice - E-Document (RDLC) provides the layout including E-Document QR code support.';
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// ------------------------------------------------------------------------------------------------
// 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;

using Microsoft.Service.History;

tableextension 6170 "Posted Service Invoice with QR" extends "Service Invoice Header"
{
fields
{
field(6165; "QR Code Image"; MediaSet)
{
Caption = 'QR Code Image';
DataClassification = CustomerContent;
}

field(6166; "QR Code Base64"; Blob)
{
Caption = 'QR Code Base64';
DataClassification = CustomerContent;
}
}
}
13 changes: 10 additions & 3 deletions src/Apps/W1/EDocument/App/src/Document/EDocument.Page.al
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ page 6121 "E-Document"
trigger OnAfterGetRecord()
begin
ShowClearanceInfo := Rec."Last Clearance Request Time" <> 0DT;
SubmitClearanceVisible := Rec."Document Type" = Enum::"E-Document Type"::"Sales Invoice";
SubmitClearanceVisible := GetClearanceVisibility();
IsProcessed := Rec.Status = Rec.Status::Processed;
IsIncomingDoc := Rec.Direction = Rec.Direction::Incoming;

Expand All @@ -530,13 +530,20 @@ page 6121 "E-Document"
ClearErrorsAndWarnings();

SetStyle();
ResetActionVisiability();
ResetActionVisibility();
SetIncomingDocActions();
FillLineBuffer();

EDocImport.V1_ProcessEDocPendingOrderMatch(Rec);
end;

local procedure GetClearanceVisibility(): Boolean
begin
exit(Rec."Document Type" in
[Enum::"E-Document Type"::"Sales Invoice", Enum::"E-Document Type"::"Sales Order", Enum::"E-Document Type"::"Service Invoice", Enum::"E-Document Type"::"Sales Credit Memo",
Enum::"E-Document Type"::"Service Credit Memo", Enum::"E-Document Type"::"Service Order"]);
end;

local procedure SetStyle()
begin
case Rec.Status of
Expand Down Expand Up @@ -611,7 +618,7 @@ page 6121 "E-Document"
end;
end;

local procedure ResetActionVisiability()
local procedure ResetActionVisibility()
begin
ShowMapToOrder := false;
ShowRelink := false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ using Microsoft.eServices.EDocument;

tableextension 6169 "E-Doc. Purchase Header" extends "Purchase Header"
{

fields
{
field(6100; "E-Document Link"; Guid)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#pragma warning disable AA0247
tableextension 6168 "E-Doc. Purchase Line" extends "Purchase Line"
{

fields
{
modify("Amount Including VAT")
Expand Down
Loading