IO-1059 Prevent posting bills to closed jobs.
This commit is contained in:
@@ -2370,6 +2370,27 @@
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>onlycmforinvoiced</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
<description></description>
|
||||
<comment></comment>
|
||||
<default_text></default_text>
|
||||
<translations>
|
||||
<translation>
|
||||
<language>en-US</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>es-MX</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
<translation>
|
||||
<language>fr-CA</language>
|
||||
<approved>false</approved>
|
||||
</translation>
|
||||
</translations>
|
||||
</concept_node>
|
||||
<concept_node>
|
||||
<name>retailtotal</name>
|
||||
<definition_loaded>false</definition_loaded>
|
||||
|
||||
@@ -41,6 +41,7 @@ export function BillFormComponent({
|
||||
loadLines,
|
||||
billEdit,
|
||||
disableInvNumber,
|
||||
job,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const client = useApolloClient();
|
||||
@@ -89,7 +90,7 @@ export function BillFormComponent({
|
||||
<JobSearchSelect
|
||||
disabled={billEdit || disabled}
|
||||
convertedOnly
|
||||
// notExported={false}
|
||||
notExported={false}
|
||||
onBlur={() => {
|
||||
if (form.getFieldValue("jobid") !== null) {
|
||||
loadLines({ variables: { id: form.getFieldValue("jobid") } });
|
||||
@@ -187,6 +188,23 @@ export function BillFormComponent({
|
||||
label={t("bills.fields.is_credit_memo")}
|
||||
name="is_credit_memo"
|
||||
valuePropName="checked"
|
||||
dependencies={["jobid"]}
|
||||
rules={[
|
||||
({ getFieldValue }) => ({
|
||||
validator(rule, value) {
|
||||
if (
|
||||
(job.status === bodyshop.md_ro_statuses.default_invoiced ||
|
||||
job.status === bodyshop.md_ro_statuses.default_exported ||
|
||||
job.status === bodyshop.md_ro_statuses.default_void) &&
|
||||
(value === false || !value)
|
||||
) {
|
||||
return Promise.reject(t("bills.labels.onlycmforinvoiced"));
|
||||
}
|
||||
|
||||
return Promise.resolve();
|
||||
},
|
||||
}),
|
||||
]}
|
||||
>
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
|
||||
@@ -34,6 +34,7 @@ export function BillFormContainer({
|
||||
}
|
||||
loadLines={loadLines}
|
||||
lineData={lineData ? lineData.joblines : []}
|
||||
job={lineData ? lineData.jobs_by_pk : null}
|
||||
responsibilityCenters={bodyshop.md_responsibility_centers || null}
|
||||
disableInvNumber={disableInvNumber}
|
||||
/>
|
||||
|
||||
@@ -186,6 +186,10 @@ export const GET_JOB_LINES_TO_ENTER_BILL = gql`
|
||||
lbr_amt
|
||||
op_code_desc
|
||||
}
|
||||
jobs_by_pk(id: $id) {
|
||||
id
|
||||
status
|
||||
}
|
||||
}
|
||||
`;
|
||||
// oem_partno: {
|
||||
|
||||
@@ -156,6 +156,7 @@
|
||||
"markforreexport": "Mark for Re-export",
|
||||
"new": "New Bill",
|
||||
"noneselected": "No bill selected.",
|
||||
"onlycmforinvoiced": "Only credit memos can be entered for any job that has been invoiced.",
|
||||
"retailtotal": "Bills Retail Total",
|
||||
"state_tax": "Provincial/State Tax",
|
||||
"subtotal": "Subtotal",
|
||||
|
||||
@@ -156,6 +156,7 @@
|
||||
"markforreexport": "",
|
||||
"new": "",
|
||||
"noneselected": "",
|
||||
"onlycmforinvoiced": "",
|
||||
"retailtotal": "",
|
||||
"state_tax": "",
|
||||
"subtotal": "",
|
||||
|
||||
@@ -156,6 +156,7 @@
|
||||
"markforreexport": "",
|
||||
"new": "",
|
||||
"noneselected": "",
|
||||
"onlycmforinvoiced": "",
|
||||
"retailtotal": "",
|
||||
"state_tax": "",
|
||||
"subtotal": "",
|
||||
|
||||
@@ -765,7 +765,7 @@ export const TemplateList = (type, context) => {
|
||||
disabled: false,
|
||||
rangeFilter: {
|
||||
object: i18n.t("reportcenter.labels.objects.jobs"),
|
||||
field: i18n.t("jobs.fields.date_invoiced"),
|
||||
field: i18n.t("jobs.fields.date_open"),
|
||||
},
|
||||
},
|
||||
job_costing_ro_date_summary: {
|
||||
|
||||
Reference in New Issue
Block a user