Addded parts order modal updates & translations

This commit is contained in:
Patrick Fic
2020-12-09 15:53:17 -08:00
parent 5a502c4d1b
commit 1ca2e16e73
8 changed files with 139 additions and 3 deletions

View File

@@ -130,6 +130,7 @@ export function PartsOrderModalContainer({
actual_price: 0,
actual_cost: 0,
line_desc: p.line_desc,
line_remarks: p.line_remarks,
quantity: p.quantity || 1,
cost_center:
bodyshop.md_responsibility_centers.defaults.PAO || "Other*",
@@ -147,10 +148,15 @@ export function PartsOrderModalContainer({
toggleModalVisible();
if (sendType === "e") {
const matchingVendor = data.vendors.filter(
(item) => item.id === values.vendorid
)[0];
setEmailOptions({
messageOptions: {
to: [data.vendors.filter((item) => item.id === values.id)[0]] || null,
to: matchingVendor ? [matchingVendor.email] : null,
replyTo: bodyshop.email,
subject: TemplateList("job", bodyshop.shopname)
.parts_order_confirmation.subject,
},
template: {
name: isReturn

View File

@@ -47,7 +47,11 @@ function VendorsFormContainer({ refetch, bodyshop }) {
message: t("vendors.successes.deleted"),
});
//TODO Better way to reset the field decorators?
if (refetch) refetch().then((r) => form.resetFields());
if (refetch)
refetch().then((r) => {
form.resetFields();
form.resetFields();
});
setFormLoading(false);
})
.catch((error) => {
@@ -71,7 +75,11 @@ function VendorsFormContainer({ refetch, bodyshop }) {
message: t("vendors.successes.saved"),
});
//TODO Better way to reset the field decorators?
if (refetch) refetch().form.resetFields();
if (refetch)
refetch().then(() => {
form.resetFields();
form.resetFields();
});
setFormLoading(false);
})
.catch((error) => {