diff --git a/Copy Price Method/app.json b/Copy Price Method/app.json new file mode 100644 index 0000000..3d0bef0 --- /dev/null +++ b/Copy Price Method/app.json @@ -0,0 +1,39 @@ +{ + "id": "44dedef3-c153-4c67-a6a5-66e2ebe14f47", + "name": "CopyPriceMethod", + "publisher": "PrintVis Open Source", + "version": "27.0.0.0", + "brief": "", + "description": "", + "privacyStatement": "", + "EULA": "", + "help": "", + "url": "", + "logo": "", + "dependencies": [ + { + "id": "5452f323-059e-499a-9753-5d2c07eef904", + "name": "PrintVis", + "publisher": "PrintVis A/S", + "version": "26.4.1.1" + } + ], + "screenshots": [], + "platform": "1.0.0.0", + "application": "26.0.0.0", + "idRanges": [ + { + "from": 80279, + "to": 80279 + } + ], + "resourceExposurePolicy": { + "allowDebugging": true, + "allowDownloadingSource": true, + "includeSourceInSymbolFile": true + }, + "runtime": "15.0", + "features": [ + "NoImplicitWith" + ] +} \ No newline at end of file diff --git a/Copy Price Method/readme.md b/Copy Price Method/readme.md new file mode 100644 index 0000000..bbd610b --- /dev/null +++ b/Copy Price Method/readme.md @@ -0,0 +1,9 @@ +# Copy Price Method + +PrintVis Copy-To and Copy-From functionality makes an exact copy of the case / job being copied. + +This code adjusts this functionality so that the job line price method is automatically set back to Calculated when the copy is completed. + +## What this extension includes: + +- An event subscriber (codeunit 80279) that extends the normal procedure by changing the price method to calculated after the copy is complete. diff --git a/Copy Price Method/src/OSCopyPriceMethod.Codeunit.al b/Copy Price Method/src/OSCopyPriceMethod.Codeunit.al new file mode 100644 index 0000000..c87d1d3 --- /dev/null +++ b/Copy Price Method/src/OSCopyPriceMethod.Codeunit.al @@ -0,0 +1,9 @@ +codeunit 80279 "OS Copy Price Method" +{ + [EventSubscriber(ObjectType::Codeunit, Codeunit::"PVS Copy Management", 'OnAfterCopyCompleteJob', '', true, true)] + local procedure OnAfterCopyCompleteJob(var in_From_JobRec: Record "PVS Job"; var in_To_JobRec: Record "PVS Job"; in_Is_Template_Copy: Boolean) + begin + in_To_JobRec.Validate("Price Method", in_To_JobRec."Price Method"::Calculated); + in_To_JobRec.Modify(true); + end; +} \ No newline at end of file