Added error handling if job totals have not been calculated
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import Dinero from "dinero.js";
|
||||
|
||||
export function CalculateJob(job, shoprates) {
|
||||
let ret = {
|
||||
parts: CalculatePartsTotals(job.joblines),
|
||||
|
||||
Reference in New Issue
Block a user