Further work to refactor job costing + qb posting. BOD-383

This commit is contained in:
Patrick Fic
2020-09-14 16:57:40 -07:00
parent eff49e3d25
commit 379c12c7bb
13 changed files with 239 additions and 96 deletions

View File

@@ -153,19 +153,20 @@ export default function AccountingPayablesTableComponent({
loading={loading}
title={() => {
return (
<div>
<div className="imex-table-header">
<PaymentsExportAllButton
paymentIds={selectedPayments}
disabled={transInProgress || selectedPayments.length === 0}
loadingCallback={setTransInProgress}
completedCallback={setSelectedPayments}
/>
<Input
className="imex-table-header__search"
value={state.search}
onChange={handleSearch}
placeholder={t("general.labels.search")}
allowClear
/>
<PaymentsExportAllButton
paymentIds={selectedPayments}
disabled={transInProgress}
loadingCallback={setTransInProgress}
completedCallback={setSelectedPayments}
/>
</div>
);
}}

View File

@@ -38,6 +38,7 @@ function JobLinesUpsertModalContainer({
.then((r) => {
if (jobLineEditModal.actions.refetch)
jobLineEditModal.actions.refetch();
//Need to recalcuate totals.
toggleModalVisible();
notification["success"]({
message: t("joblines.successes.created"),

View File

@@ -80,27 +80,32 @@ export function JobsCloseExportButton({ bodyshop, jobId, disabled }) {
})
);
} else {
const jobUpdateResponse = await updateJob({
variables: {
jobId: jobId,
job: {
status: bodyshop.md_ro_statuses.default_exported || "Exported*",
date_exported: new Date(),
},
},
});
if (!!!jobUpdateResponse.errors) {
notification["success"]({
message: t("jobs.successes.exported"),
});
} else {
notification["error"]({
message: t("jobs.errors.exporting", {
error: JSON.stringify(jobUpdateResponse.error),
}),
});
}
// const jobUpdateResponse = await updateJob({
// variables: {
// jobId: jobId,
// job: {
// status: bodyshop.md_ro_statuses.default_exported || "Exported*",
// date_exported: new Date(),
// },
// },
// });
// if (!!!jobUpdateResponse.errors) {
// notification["success"]({
// message: t("jobs.successes.exported"),
// });
// } else {
// notification["error"]({
// message: t("jobs.errors.exporting", {
// error: JSON.stringify(jobUpdateResponse.error),
// }),
// });
// }
}
setLoading(false);

View File

@@ -73,14 +73,21 @@ export function JobsCloseLines({ bodyshop, joblines }) {
name={[field.name, "profitcenter_part"]}
rules={[
{
required:
!!joblines[index].part_type &&
!!joblines[index].act_price,
required: !!joblines[index].act_price,
message: t("general.validation.required"),
},
]}
>
<Select allowClear>
<Select
allowClear
optionFilterProp="children"
showSearch
filterOption={(input, option) =>
option.children
.toLowerCase()
.indexOf(input.toLowerCase()) >= 0
}
>
{bodyshop.md_responsibility_centers.profits.map((p) => (
<Select.Option key={p.name} value={p.name}>
{p.name}
@@ -99,7 +106,16 @@ export function JobsCloseLines({ bodyshop, joblines }) {
},
]}
>
<Select allowClear>
<Select
allowClear
optionFilterProp="children"
showSearch
filterOption={(input, option) =>
option.children
.toLowerCase()
.indexOf(input.toLowerCase()) >= 0
}
>
{bodyshop.md_responsibility_centers.profits.map((p) => (
<Select.Option key={p.name} value={p.name}>
{p.name}