Hello from MCP server

List Files | Just Commands | Repo | Logs

← back |
/* TNFR Legacy Pricing Formula with discount */

export default () => {
  return {
    vars: {
      materialCostBase: 0,
      timeCostBase: 0,
      hourlyFee: 5.262,
      standardDiscount: 0.5,
      offerModifier: 1,
      salesTax: 1,
      serviceCallFee: 0,
      saDiscount: 1,
      multiplier: 1,
      extraCostMultiplier: 1,
      markupScale: [
        [6.571805718, 1.65],
        [3.943083431, 1.75],
        [2.628722287, 2],
        [1.577233372, 2.25],
        [1.051488915, 2.5],
        [0.5257444574, 2.75],
        [0.2628722287, 3],
        [0.1314361144, 3.5],
        [0, 4],
      ],
    },
    derivedVars: {
      materialWithTax: 0,
      materialMarkup: 2.75,
      materialFee: 0,
      timeFee: 0,
      combinedFee: 0,
      feeWithTrip: 0,
      tierPrice: 0,
      leveledPrice: 0,
      finalPrice: 0,
    },
    operations: [
      {
        op: "mult",
        in1: "materialCostBase",
        in2: "salesTax",
        out: "materialWithTax",
      },
      {
        op: "scale",
        in1: "markupScale",
        in2: "materialWithTax",
        out: "materialMarkup",
      },
      {
        op: "mult",
        in1: "materialMarkup",
        in2: "materialWithTax",
        out: "materialFee",
      },
      {
        op: "mult",
        in1: "timeCostBase",
        in2: "hourlyFee",
        out: "timeFee",
      },
      {
        op: "add",
        in1: "timeFee",
        in2: "materialFee",
        out: "combinedFee",
      },
      {
        op: "add",
        in1: "combinedFee",
        in2: "serviceCallFee",
        out: "feeWithTrip",
      },
      {
        op: "mult",
        in1: "feeWithTrip",
        in2: "multiplier",
        out: "tierPrice",
      },
      {
        op: "mult",
        in1: "tierPrice",
        in2: "extraCostMultiplier",
        out: "leveledPrice",
      },
      {
        op: "mult",
        in1: "leveledPrice",
        in2: "saDiscount",
        out: "finalPrice",
      },
    ],
  };
};