Add cost settings for b/w and color pages
This commit is contained in:
parent
ea3442fed8
commit
70fcdda163
@ -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;
|
||||
|
||||
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user