Skip to content
This repository was archived by the owner on Nov 12, 2026. It is now read-only.
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"version": "0.2.0",
"configurations": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"al.codeAnalyzers": [
"${PerTenantExtensionCop}",
"${CodeCop}",
"${UICop}"
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
namespace PrintVis.SpencerMetrics.Permissions;

using PrintVis.SpencerMetrics.CounterManagement;
using PrintVis.SpencerMetrics.Configuration;
using PrintVis.SpencerMetrics.Services;
using PrintVis.SpencerMetrics;
using PrintVis.SpencerMetrics.API;

permissionset 80290 "PVS SM FULL"
{
Assignable = true;
Caption = 'SpencerMetrics Full';
Permissions = table "PVS SM Cost Center Setup" = X,
tabledata "PVS SM Cost Center Setup" = RIMD,
table "PVS SM Setup" = X,
tabledata "PVS SM Setup" = RIMD,
table "PVS SM Counter Entry" = X,
tabledata "PVS SM Counter Entry" = RIMD,
table "PVS SM Count Summary Buffer" = X,
tabledata "PVS SM Count Summary Buffer" = RIMD,
table "PVS SM Session Parameter" = X,
tabledata "PVS SM Session Parameter" = RIMD,
table "PVS SM Session Log" = X,
tabledata "PVS SM Session Log" = RIMD,
codeunit "PVS SM Api Client" = X,
codeunit "PVS SM Counter Worker" = X,
codeunit "PVS SM Event Handler" = X,
codeunit "PVS SM Events" = X,
codeunit "PVS SM Session Manager" = X,
page "PVS SM Assign To Job Costing" = X,
page "PVS SM Cost Center Setup" = X,
page "PVS SM Counter Entries" = X,
page "PVS SM Count FactBox" = X,
page "PVS SM Order Sheet API" = X,
query "PVS SM Counts Sum By UOM" = X;
}
44 changes: 44 additions & 0 deletions Apps/SpencerMetrics/PrintVis SpencerMetrics/app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"id": "b43efe82-3cf5-4267-b39c-eae529da92df",
"name": "PrintVis Spencer Metrics Integration",
"publisher": "PrintVis A/S",
"version": "28.0.0.0",
"brief": "PrintVis SpencerMetrics",
"description": "PrintVis SpencerMetrics",
"privacyStatement": "http://www.printvis.com",
"EULA": "http://www.printvis.com",
"help": "https://support365.printvis.com/",
"url": "http://www.printvis.com",
"logo": "Logo/PV_logo_240x240px.png",
"contextSensitiveHelpUrl": "https://learn.printvis.com/",
"dependencies": [
{
"id": "5452f323-059e-499a-9753-5d2c07eef904",
"name": "PrintVis",
"publisher": "PrintVis A/S",
"version": "28.0.0.0"
}
],
"screenshots": [],
"platform": "28.0.0.0",
"application": "28.0.0.0",
"idRanges": [
{
"from": 80290,
"to": 80300
}
],
"features": [
"NoImplicitWith",
"TranslationFile"
],
"supportedLocales": [
"en-US"
],
"resourceExposurePolicy": {
"allowDebugging": true,
"allowDownloadingSource": false,
"includeSourceInSymbolFile": false
},
"runtime": "16.0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
namespace PrintVis.SpencerMetrics.API;

page 80290 "PVS SM Order Sheet API"
{
APIGroup = 'spencerMetrics';
APIPublisher = 'printvis';
APIVersion = 'v1.0';
Editable = false;
EntityName = 'orderSheet';
EntitySetName = 'orderSheets';
ODataKeyFields = "PVS SM Key";
PageType = API;
SourceTable = "PVS Job Sheet";

layout
{
area(content)
{
field(smKey; Rec."PVS SM Key") { Caption = 'smKey', Locked = true; }
field(active; Rec.Active) { Caption = 'active', Locked = true; }
field(jobStatus; Rec."Job Status") { Caption = 'jobStatus', Locked = true; }
field(orderNo; Rec."Order No.") { Caption = 'orderNo', Locked = true; }
field(sheetNo; Rec."Sheet No.") { Caption = 'sheetNo', Locked = true; }
field(paperItemNo; Rec."Paper Item No.") { Caption = 'paperItemNo', Locked = true; }
field(paperWeight; Rec.Weight) { Caption = 'paperWeight', Locked = true; }
field(paperWeightUnit; Rec."Weight Unit") { Caption = 'paperWeightUnit', Locked = true; }
field(paperQuality; Rec."Paper Quality") { Caption = 'paperQuality', Locked = true; }
field(sizeWidth; Rec."Full Sheet Format 1") { Caption = 'sizeWidth', Locked = true; }
field(sizeLength; Rec."Full Sheet Format 2") { Caption = 'sizeLength', Locked = true; }
field(grossQty; Rec."Gross Printed Sheets") { Caption = 'grossPrintedSheets', Locked = true; }
field(netQty; Rec."End Qty.") { Caption = 'netPrintedSheets', Locked = true; }
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
namespace PrintVis.SpencerMetrics.Configuration;

using PrintVis.SpencerMetrics.CounterManagement;

page 80291 "PVS SM Cost Center Setup"
{
ApplicationArea = All;
Caption = 'SpencerMetrics Cost Center Setup';
PageType = List;
SourceTable = "PVS SM Cost Center Setup";
UsageCategory = Administration;

layout
{
area(Content)
{
repeater(repeater)
{
field("Cost Center"; Rec."Cost Center") { }
field("API Key"; Rec."API Key") { }
field(Enabled; Rec."Enabled") { }
field("Interval (ms)"; Rec."Interval (ms)") { }
field("Session ID"; Rec."Session Id")
{
Editable = false;
}
field("Job Queue Entry ID"; Rec."Job Queue Entry ID")
{
Editable = false;
Visible = false;
}
field("Last Heartbeat"; Rec."Last Heartbeat")
{
Editable = false;
}
field("Session Error"; Rec."Last Error")
{
Editable = false;
}
}
}
}

actions
{
area(Processing)
{
action(Counts)
{
Caption = 'Counts';
Image = NumberGroup;
RunObject = page "PVS SM Counter Entries";
ToolTip = 'Open the counts page for the selected cost center';
}

action("Delete All Records")
{
Caption = 'Delete All Records';
Image = Delete;
ToolTip = 'Delete all count records for the selected cost center';

trigger OnAction()
var
CounterEntry: Record "PVS SM Counter Entry";
Confirmed: Boolean;
ConfirmQst: Label 'Are you sure you want to delete all count records for %1?', Comment = '%1 = Cost Center Code';
begin
Confirmed := Dialog.Confirm(ConfirmQst, false, Rec."Cost Center");
if Confirmed then begin
CounterEntry.Reset();
CounterEntry.SetRange("Cost Center Code", Rec."Cost Center");
if (CounterEntry.Count() > 0) then
CounterEntry.DeleteAll();
end;
end;
}

action("Session Log")
{
Caption = 'Session Log';
Image = Log;
RunObject = page "PVS SM Session Log";
RunPageLink = "Cost Center" = field("Cost Center");
ToolTip = 'View session start/stop history for this cost center';
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
namespace PrintVis.SpencerMetrics.Configuration;

table 80290 "PVS SM Cost Center Setup"
{
Caption = 'SpencerMetrics Cost Center Setup';
DataClassification = CustomerContent;

fields
{
field(1; "Cost Center"; Code[20])
{
Caption = 'Cost Center';
NotBlank = true;
TableRelation = "PVS Cost Center".Code;
ToolTip = 'The Cost Center code for SpencerMetrics connection';
}
field(2; "API Key"; Text[50])
{
Caption = 'API Key';
ExtendedDatatype = Masked;
ToolTip = 'The SpencerMetrics API Key for this cost center';
}
field(3; Enabled; Boolean)
{
Caption = 'Enabled';
Editable = false;
InitValue = false;
ToolTip = 'Set SpencerMetrics Timer On';
}
field(4; "Interval (ms)"; Integer)
{
Caption = 'Interval (ms)';
InitValue = 15000;
MinValue = 5000;
ToolTip = 'The interval for the timer to check SpencerMetrics for new counts. It is not recommended to set this less than 15000 (15 seconds)';
}
field(5; "Session Id"; Integer)
{
Caption = 'Session Id';
ToolTip = 'The session ID that is running the SpencerMetrics timer';
}
field(6; "Login Key"; Text[100])
{
Caption = 'Login Key';
ExtendedDatatype = Masked;
}
field(7; "Last Heartbeat"; DateTime)
{
Caption = 'Last Heartbeat';
ToolTip = 'The last heartbeat for the session running the SpencerMetrics timer';
}
field(8; "Last Error"; Text[2048])
{
Caption = 'Last Error';
ToolTip = 'The last error for the session running the SpencerMetrics timer';
}
field(9; "Job Queue Entry ID"; Guid)
{
Caption = 'Job Queue Entry ID';
ToolTip = 'The Job Queue Entry ID for the session running the SpencerMetrics timer';
}
}

keys { key(Key1; "Cost Center") { Clustered = true; } }

internal procedure SetLastHeartbeat()
begin
"Last Heartbeat" := CurrentDateTime();
end;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace PrintVis.SpencerMetrics.Configuration;

enum 80290 "PVS SM Session Event Type"
{
Caption = 'Session Event Type';
Access = Internal;

value(0; Start)
{
Caption = 'Start';
}
value(1; Stop)
{
Caption = 'Stop';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
namespace PrintVis.SpencerMetrics.Configuration;

page 80292 "PVS SM Session Log"
{
ApplicationArea = All;
Caption = 'SpencerMetrics Session Log';
Editable = false;
InsertAllowed = false;
ModifyAllowed = false;
DeleteAllowed = false;
PageType = List;
SourceTable = "PVS SM Session Log";
SourceTableView = sorting("Entry No.") order(descending);
UsageCategory = None;
Extensible = false;

layout
{
area(Content)
{
repeater(repeater)
{
field("Entry No."; Rec."Entry No.") { }
field("Cost Center"; Rec."Cost Center") { }
field("Job Queue Entry ID"; Rec."Job Queue Entry ID") { }
field("Event Type"; Rec."Event Type") { }
field("Event DateTime"; Rec."Event DateTime") { }
field("Expected End DateTime"; Rec."Expected End DateTime") { }
field("User ID"; Rec."User ID") { }
field(Success; Rec.Success)
{
StyleExpr = SuccessStyle;
}
field("Error Message"; Rec."Error Message")
{
Visible = false;
}
}
}
}

var
SuccessStyle: Text;

trigger OnAfterGetRecord()
begin
if Rec.Success then
SuccessStyle := 'Favorable'
else
SuccessStyle := 'Unfavorable';
end;
}
Loading
Loading