Extensions to job totals calculation.

This commit is contained in:
Patrick Fic
2021-03-03 17:25:54 -08:00
parent 4ee71c69d8
commit 5be34a445d
11 changed files with 364 additions and 66 deletions

View File

@@ -4,7 +4,7 @@ import React, { useState } from "react";
import { useMutation } from "@apollo/client";
import { useTranslation } from "react-i18next";
import { UPDATE_JOB } from "../../graphql/jobs.queries";
import Dinero from "dinero.js";
export default function JobCalculateTotals({ job, disabled }) {
const { t } = useTranslation();
const [loading, setLoading] = useState(false);
@@ -25,6 +25,10 @@ export default function JobCalculateTotals({ job, disabled }) {
jobId: job.id,
job: {
job_totals: newTotals,
clm_total: Dinero(newTotals.totals.total_repairs).toFormat("0.00"),
owner_owing: Dinero(newTotals.totals.custPayable.total).toFormat(
"0.00"
),
},
},
});