diff --git a/JobTicket Split Signatures/JobTicket_SplitSignatures.CodeUnit.al b/JobTicket Split Signatures/JobTicket_SplitSignatures.CodeUnit.al new file mode 100644 index 0000000..6295d07 --- /dev/null +++ b/JobTicket Split Signatures/JobTicket_SplitSignatures.CodeUnit.al @@ -0,0 +1,38 @@ +codeunit 80422 "Jobticket Split Signatures" +{ + + [EventSubscriber(ObjectType::Codeunit, Codeunit::"PVS JobTicket Management", 'OnAfterGetReportBuffer', '', true, true)] + local procedure OnAfterGetReportBuffer(var in_JobRec: Record "PVS Job"; var in_VERSION_COUNTER: Integer; var Out_BufferRecTmp: Record "PVS Sorting Buffer" temporary; var Result: Boolean) + var + i, Set : Integer; + New_BufferRecTmp: Record "PVS Sorting Buffer" temporary; + begin + Out_BufferRecTmp.setrange("Report Section", 52); + if Out_BufferRecTmp.findset then + repeat + if Out_BufferRecTmp.Decimal1 > 1 then begin + New_BufferRecTmp := Out_BufferRecTmp; + New_BufferRecTmp.insert; + end; + until Out_BufferRecTmp.next = 0; + Out_BufferRecTmp.reset; + + if new_BufferRecTmp.findset then + repeat + if Out_BufferRecTmp.Get(New_BufferRecTmp.PK1_Integer1, New_BufferRecTmp.PK1_Integer2, New_BufferRecTmp.PK1_Integer3, New_BufferRecTmp.PK1_Integer4, + New_BufferRecTmp.PK2_Code1, New_BufferRecTmp.PK2_Code2, New_BufferRecTmp.PK2_Code3, New_BufferRecTmp.PK2_Code4, + New_BufferRecTmp.PK3_Integer1, New_BufferRecTmp.PK3_Integer2, New_BufferRecTmp.PK3_Integer3, New_BufferRecTmp.PK3_Integer4) then begin + Set := round(Out_BufferRecTmp.Decimal1, 1); + Out_BufferRecTmp.Decimal1 := 1; + Out_BufferRecTmp.Decimal4 := Out_BufferRecTmp.Decimal4 DIV Set; + Out_BufferRecTmp.Decimal5 := Out_BufferRecTmp.Decimal4 DIV Set; + Out_BufferRecTmp.Decimal6 := Out_BufferRecTmp.Decimal4 DIV Set; + Out_BufferRecTmp.modify; + for i := 2 to Set do begin + Out_BufferRecTmp.PK1_Integer2 := i; + Out_BufferRecTmp.insert; + end; + end; + until New_BufferRecTmp.next = 0; + end; +} \ No newline at end of file diff --git a/JobTicket Split Signatures/README.md b/JobTicket Split Signatures/README.md new file mode 100644 index 0000000..0ee589f --- /dev/null +++ b/JobTicket Split Signatures/README.md @@ -0,0 +1,43 @@ +# JobTicket Split Signatures + +This extension adds functionality to the PrintVis job ticket generation process. In standard behavior, press section lines in the job ticket can contain a quantity of signatures greater than 1 on a single line. For companies that want each signature shown as an individual line, this extension modifies the generated dataset before the report is rendered. + +When a line in the press section has multiple signatures, the extension splits that line into separate lines with one signature per line and adjusts the related decimal values so each inserted line represents a single signature. This improves readability and makes press output easier to review and process. + +## What this extension includes + +- Codeunit 80422 "Jobticket Split Signatures" +- Event subscriber on `PVS JobTicket Management`, event `OnAfterGetReportBuffer` + +## How it works + +The codeunit subscribes to the `OnAfterGetReportBuffer` event in `PVS JobTicket Management`. When job ticket data is prepared: + +1. It filters the report buffer to the press section (`Report Section = 52`). +2. It identifies lines where `Decimal1 > 1` (multiple signatures). +3. For each matching line, it: + - Sets the signature quantity to 1 on the original line. + - Adjusts decimal values based on the number of signatures. + - Inserts additional lines so each signature is represented as its own line. + +The result is that multi-signature press lines are expanded into individual lines in the final job ticket dataset. + +## How to configure + +Step 1 Install the extension in your Business Central environment. + +Step 2 Run the standard PrintVis job ticket process. + +Step 3 No extra setup is required. The split logic runs automatically during dataset preparation. + +## Prerequisites to run the functionality + +- PrintVis dependency available (minimum version 26.0.0.0). +- Business Central application compatible with version 26.0.0.0. + +## What you will need to do for this extension to work + +- Install the .app extension in your environment. +- Ensure the PrintVis app is installed and meets the dependency version. +- Use the standard PrintVis job ticket generation flow (the subscriber runs automatically). + diff --git a/JobTicket Split Signatures/app.json b/JobTicket Split Signatures/app.json new file mode 100644 index 0000000..a58dc07 --- /dev/null +++ b/JobTicket Split Signatures/app.json @@ -0,0 +1,39 @@ +{ + "id": "b455cc6f-d5af-4933-81d2-152498b6aa98", + "name": "JobTicketSplit", + "publisher": "PrintVis A/S", + "version": "28.0.0.0", + "brief": "", + "description": "", + "privacyStatement": "", + "EULA": "", + "help": "", + "url": "", + "logo": "", + "dependencies": [ + { + "id": "5452f323-059e-499a-9753-5d2c07eef904", + "name": "PrintVis", + "publisher": "NovaVision Software A/S", + "version": "26.0.0.0" + } + ], + "screenshots": [], + "platform": "1.0.0.0", + "application": "26.0.0.0", + "idRanges": [ + { + "from": 80422, + "to": 80422 + } + ], + "resourceExposurePolicy": { + "allowDebugging": true, + "allowDownloadingSource": true, + "includeSourceInSymbolFile": true + }, + "runtime": "15.0", + "features": [ + "NoImplicitWith" + ] +} \ No newline at end of file