Added error handling if job totals have not been calculated

This commit is contained in:
Patrick Fic
2020-04-28 17:19:37 -07:00
parent c6a29ba417
commit a9bd0a5ccb
10 changed files with 69 additions and 41 deletions

View File

@@ -1,10 +1,11 @@
import { Col, Descriptions, Row, Statistic } from "antd";
import { Col, Descriptions, Row, Statistic, Result } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
export default function JobsTotalsTableComponent({ totals }) {
const { t } = useTranslation();
if (!!!totals) return null;
if (!!!totals)
return <Result status='warning' title={t("jobs.errors.nofinancial")} />;
return (
<div>

View File

@@ -1,3 +1,5 @@
import Dinero from "dinero.js";
export function CalculateJob(job, shoprates) {
let ret = {
parts: CalculatePartsTotals(job.joblines),