Add cost settings for b/w and color pages

This commit is contained in:
Skylar Ittner 2026-02-16 20:31:21 -07:00
parent ea3442fed8
commit 70fcdda163
2 changed files with 23 additions and 1 deletions

View File

@ -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;

View File

@ -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",