From 70fcdda163ac2d95a3be9102d7df26410731cbf4 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Mon, 16 Feb 2026 20:31:21 -0700 Subject: [PATCH] Add cost settings for b/w and color pages --- PrintScanTool/page.f7 | 10 +++++++++- PrintScanTool/plugin.js | 14 ++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/PrintScanTool/page.f7 b/PrintScanTool/page.f7 index d0fb8be..dd2f112 100644 --- a/PrintScanTool/page.f7 +++ b/PrintScanTool/page.f7 @@ -231,6 +231,14 @@ var mode = getMode(); var taxRate = await global.apis.storage.getDB(`${plugin.id}.${mode.t}_taxrate`, 0) * 1.0; var merchCategory = await global.apis.storage.getDB(`${plugin.id}.merchcategory`, "Print/Scan/Fax"); + var costEach = 0; + if (mode.t == "print") { + let costid = "bw"; + if (mode.m.includes("color")) { + costid = "color"; + } + costEach = (await global.apis.storage.getDB(`${plugin.id}.print_${costid}_cost`, "0")) * 1; + } var pt = getPriceTotal(copies); var jobInfo = document.getElementById("notesInput").value ?? null; @@ -240,7 +248,7 @@ jobInfo ?? null, global.apis.i18n.moneyToFixed(pt / (copies * 1)) * 1.0, copies * 1, - 0, + costEach, taxRate / 100.0 ); receiptItem.merch = true; diff --git a/PrintScanTool/plugin.js b/PrintScanTool/plugin.js index b5e8c32..0e1a889 100644 --- a/PrintScanTool/plugin.js +++ b/PrintScanTool/plugin.js @@ -155,6 +155,20 @@ exports.config = [ label: "Scan/Fax Tax Rate %", placeholder: "0" }, + { + type: "text", + key: pluginID + ".print_bw_cost", + defaultVal: "0", + label: "Actual cost of printing black/white page", + placeholder: "0" + }, + { + type: "text", + key: pluginID + ".print_color_cost", + defaultVal: "0", + label: "Actual cost of printing color page", + placeholder: "0" + }, { type: "text", key: pluginID + ".merchcategory",