Merged in feature/america (pull request #1001)
Add error handling when unable to caclulate job totals.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { Collapse, Form, Input, InputNumber, Switch } from "antd";
|
import { Collapse, Form, InputNumber, Switch } from "antd";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -563,13 +563,6 @@ export function JobsDetailRatesParts({
|
|||||||
>
|
>
|
||||||
<Switch />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
|
||||||
style={{ display: "none" }}
|
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_tx_ty1")}
|
|
||||||
name={["parts_tax_rates", "PAN", "prt_tx_ty1"]}
|
|
||||||
>
|
|
||||||
<Input />
|
|
||||||
</Form.Item>
|
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("joblines.fields.part_types.PAO")}>
|
<LayoutFormRow header={t("joblines.fields.part_types.PAO")}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
|
|||||||
@@ -75,12 +75,12 @@ function TaxFormItems({
|
|||||||
typeNum,
|
typeNum,
|
||||||
typeNumIterator,
|
typeNumIterator,
|
||||||
})}
|
})}
|
||||||
rules={[
|
// rules={[
|
||||||
{
|
// {
|
||||||
required: true,
|
// required: true,
|
||||||
//message: t("general.validation.required"),
|
// //message: t("general.validation.required"),
|
||||||
},
|
// },
|
||||||
]}
|
// ]}
|
||||||
name={["cieca_pft", `tax_type${typeNum}`]}
|
name={["cieca_pft", `tax_type${typeNum}`]}
|
||||||
>
|
>
|
||||||
<Input disabled={jobRO} />
|
<Input disabled={jobRO} />
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ export function JobsDetailPage({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
try {
|
||||||
const newTotals = await Axios.post("/job/totalsssu", {
|
const newTotals = await Axios.post("/job/totalsssu", {
|
||||||
id: job.id,
|
id: job.id,
|
||||||
});
|
});
|
||||||
@@ -212,7 +212,13 @@ export function JobsDetailPage({
|
|||||||
form.setFieldsValue(transormJobToForm(job));
|
form.setFieldsValue(transormJobToForm(job));
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
}
|
}
|
||||||
|
} catch (error) {
|
||||||
|
notification["error"]({
|
||||||
|
message: t("jobs.errors.totalscalc"),
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const menuExtra = (
|
const menuExtra = (
|
||||||
|
|||||||
Reference in New Issue
Block a user