Merged in release/2025-01-31 (pull request #2084)
Release/2025 01 31 into test-AIO - IO-3108 IO-2676
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Button, Form, Input, Popover, Select, Space, Switch } from "antd";
|
import { Button, Form, Input, Popover, Select, Space, Switch } from "antd";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import React, { useState } from "react";
|
import { some } from "lodash";
|
||||||
|
import React, { useCallback, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
@@ -19,7 +20,14 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
jobRO: selectJobReadOnly
|
jobRO: selectJobReadOnly
|
||||||
});
|
});
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
insertAuditTrail: ({ jobid, operation, type }) => dispatch(insertAuditTrail({ jobid, operation, type }))
|
insertAuditTrail: ({ jobid, operation, type }) =>
|
||||||
|
dispatch(
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid,
|
||||||
|
operation,
|
||||||
|
type
|
||||||
|
})
|
||||||
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTrail, parentFormIsFieldsTouched }) {
|
export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTrail, parentFormIsFieldsTouched }) {
|
||||||
@@ -29,6 +37,7 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const notification = useNotification();
|
const notification = useNotification();
|
||||||
|
const allFormValues = Form.useWatch([], form);
|
||||||
|
|
||||||
const handleConvert = async ({ employee_csr, category, ...values }) => {
|
const handleConvert = async ({ employee_csr, category, ...values }) => {
|
||||||
if (parentFormIsFieldsTouched()) {
|
if (parentFormIsFieldsTouched()) {
|
||||||
@@ -71,6 +80,8 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
|
|||||||
setLoading(false);
|
setLoading(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const submitDisabled = useCallback(() => some(allFormValues, (v) => v === undefined), [allFormValues]);
|
||||||
|
|
||||||
const popMenu = (
|
const popMenu = (
|
||||||
<div>
|
<div>
|
||||||
<Form
|
<Form
|
||||||
@@ -79,9 +90,12 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
|
|||||||
onFinish={handleConvert}
|
onFinish={handleConvert}
|
||||||
initialValues={{
|
initialValues={{
|
||||||
driveable: true,
|
driveable: true,
|
||||||
towin: false,
|
towin: job.towin,
|
||||||
|
ca_gst_registrant: job.ca_gst_registrant,
|
||||||
employee_csr: job.employee_csr,
|
employee_csr: job.employee_csr,
|
||||||
category: job.category
|
category: job.category,
|
||||||
|
referral_source: job.referral_source,
|
||||||
|
referral_source_extra: job.referral_source_extra ?? ""
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
@@ -211,7 +225,7 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
|
|||||||
<Switch />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
<Button type="primary" danger onClick={() => form.submit()} loading={loading}>
|
<Button disabled={submitDisabled()} type="primary" danger onClick={() => form.submit()} loading={loading}>
|
||||||
{t("jobs.actions.convert")}
|
{t("jobs.actions.convert")}
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={() => setOpen(false)}>{t("general.actions.close")}</Button>
|
<Button onClick={() => setOpen(false)}>{t("general.actions.close")}</Button>
|
||||||
@@ -233,11 +247,6 @@ export function JobsConvertButton({ bodyshop, job, refetch, jobRO, insertAuditTr
|
|||||||
loading={loading}
|
loading={loading}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setOpen(true);
|
setOpen(true);
|
||||||
form.setFieldsValue({
|
|
||||||
driveable: true,
|
|
||||||
towin: false,
|
|
||||||
employee_csr: job.employee_csr
|
|
||||||
});
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{t("jobs.actions.convert")}
|
{t("jobs.actions.convert")}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useMutation, useQuery } from "@apollo/client";
|
import { useMutation, useQuery } from "@apollo/client";
|
||||||
import { Form, Modal } from "antd";
|
import { Form, Modal } from "antd";
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useMemo, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
@@ -255,9 +255,13 @@ export function TaskUpsertModalContainer({ bodyshop, currentUser, taskUpsert, to
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const taskTitle = useMemo(() => {
|
||||||
|
return existingTask ? t("tasks.actions.edit") : t("tasks.actions.new");
|
||||||
|
}, [existingTask, t]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
title={existingTask ? t("tasks.actions.edit") : t("tasks.actions.new")}
|
title={<span id="task-upsert-modal-title">{taskTitle}</span>}
|
||||||
open={open}
|
open={open}
|
||||||
okText={t("general.actions.save")}
|
okText={t("general.actions.save")}
|
||||||
width="50%"
|
width="50%"
|
||||||
|
|||||||
@@ -380,11 +380,11 @@
|
|||||||
"md_parts_order_comment": "Parts Orders Comments",
|
"md_parts_order_comment": "Parts Orders Comments",
|
||||||
"md_parts_scan": {
|
"md_parts_scan": {
|
||||||
"caseInsensitive": "Case Insensitive",
|
"caseInsensitive": "Case Insensitive",
|
||||||
"expression": "",
|
"expression": "",
|
||||||
"field": "Field",
|
"field": "Field",
|
||||||
"flags": "",
|
"flags": "",
|
||||||
"operation": "Operation",
|
"operation": "Operation",
|
||||||
"value": "Value"
|
"value": "Value"
|
||||||
},
|
},
|
||||||
"md_payment_types": "Payment Types",
|
"md_payment_types": "Payment Types",
|
||||||
"md_referral_sources": "Referral Sources",
|
"md_referral_sources": "Referral Sources",
|
||||||
@@ -715,15 +715,15 @@
|
|||||||
"workingdays": "Working Days"
|
"workingdays": "Working Days"
|
||||||
},
|
},
|
||||||
"operations": {
|
"operations": {
|
||||||
"contains": "Contains",
|
"contains": "Contains",
|
||||||
"ends_with": "Ends With",
|
"ends_with": "Ends With",
|
||||||
"equals": "Equals",
|
"equals": "Equals",
|
||||||
"greater_than": "Greater Than",
|
"greater_than": "Greater Than",
|
||||||
"less_than": "Less Than",
|
"less_than": "Less Than",
|
||||||
"not_equals": "Not Equals",
|
"not_equals": "Not Equals",
|
||||||
"starts_with": "Starts With"
|
"starts_with": "Starts With"
|
||||||
},
|
},
|
||||||
"successes": {
|
"successes": {
|
||||||
"areyousure": "Are you sure you want to continue?",
|
"areyousure": "Are you sure you want to continue?",
|
||||||
"defaultviewcreated": "Default view created successfully.",
|
"defaultviewcreated": "Default view created successfully.",
|
||||||
"save": "Shop configuration saved successfully. ",
|
"save": "Shop configuration saved successfully. ",
|
||||||
@@ -1437,13 +1437,13 @@
|
|||||||
"adjustment": "Adjustment",
|
"adjustment": "Adjustment",
|
||||||
"ah_detail_line": "Mark as Detail Labor Line (Autohouse Only)",
|
"ah_detail_line": "Mark as Detail Labor Line (Autohouse Only)",
|
||||||
"alt_partno": "Alt Part #",
|
"alt_partno": "Alt Part #",
|
||||||
"amount": "Amount",
|
"amount": "Amount",
|
||||||
"assigned_team": "Team",
|
"assigned_team": "Team",
|
||||||
"assigned_team_name": "Team {{name}}",
|
"assigned_team_name": "Team {{name}}",
|
||||||
"create_ppc": "Create PPC?",
|
"create_ppc": "Create PPC?",
|
||||||
"db_price": "List Price",
|
"db_price": "List Price",
|
||||||
"include_in_part_cnt": "Include in Parts Status Count",
|
"include_in_part_cnt": "Include in Parts Status Count",
|
||||||
"lbr_types": {
|
"lbr_types": {
|
||||||
"LA1": "LA1",
|
"LA1": "LA1",
|
||||||
"LA2": "LA2",
|
"LA2": "LA2",
|
||||||
"LA3": "LA3",
|
"LA3": "LA3",
|
||||||
@@ -3071,7 +3071,7 @@
|
|||||||
"production_by_repair_status": "Production by Status",
|
"production_by_repair_status": "Production by Status",
|
||||||
"production_by_repair_status_one": "Production filtered by Status",
|
"production_by_repair_status_one": "Production filtered by Status",
|
||||||
"production_by_ro": "Production by RO",
|
"production_by_ro": "Production by RO",
|
||||||
"production_by_target_date": "Production by Target Date",
|
"production_by_target_date": "Production by Scheduled Completion",
|
||||||
"production_by_technician": "Production by Technician",
|
"production_by_technician": "Production by Technician",
|
||||||
"production_by_technician_one": "Production filtered by Technician",
|
"production_by_technician_one": "Production filtered by Technician",
|
||||||
"production_not_production_status": "Production not in Production Status",
|
"production_not_production_status": "Production not in Production Status",
|
||||||
@@ -3081,7 +3081,8 @@
|
|||||||
"purchase_return_ratio_grouped_by_vendor_detail": "Purchase & Return Ratio by Vendor (Detail)",
|
"purchase_return_ratio_grouped_by_vendor_detail": "Purchase & Return Ratio by Vendor (Detail)",
|
||||||
"purchase_return_ratio_grouped_by_vendor_summary": "Purchase & Return Ratio by Vendor (Summary)",
|
"purchase_return_ratio_grouped_by_vendor_summary": "Purchase & Return Ratio by Vendor (Summary)",
|
||||||
"purchases_by_cost_center_detail": "Purchases by Cost Center (Detail)",
|
"purchases_by_cost_center_detail": "Purchases by Cost Center (Detail)",
|
||||||
"purchases_by_cost_center_summary": "Purchases by Cost Center (Summary)","purchases_by_date_excel": "Purchases by Date - Excel",
|
"purchases_by_cost_center_summary": "Purchases by Cost Center (Summary)",
|
||||||
|
"purchases_by_date_excel": "Purchases by Date - Excel",
|
||||||
"purchases_by_date_range_detail": "Purchases by Date - Detail",
|
"purchases_by_date_range_detail": "Purchases by Date - Detail",
|
||||||
"purchases_by_date_range_summary": "Purchases by Date - Summary",
|
"purchases_by_date_range_summary": "Purchases by Date - Summary",
|
||||||
"purchases_by_ro_detail_date": "Purchases by RO - Detail",
|
"purchases_by_ro_detail_date": "Purchases by RO - Detail",
|
||||||
|
|||||||
@@ -380,11 +380,11 @@
|
|||||||
"md_parts_order_comment": "",
|
"md_parts_order_comment": "",
|
||||||
"md_parts_scan": {
|
"md_parts_scan": {
|
||||||
"caseInsensitive": "",
|
"caseInsensitive": "",
|
||||||
"expression": "",
|
"expression": "",
|
||||||
"field": "",
|
"field": "",
|
||||||
"flags": "",
|
"flags": "",
|
||||||
"operation": "",
|
"operation": "",
|
||||||
"value": ""
|
"value": ""
|
||||||
},
|
},
|
||||||
"md_payment_types": "",
|
"md_payment_types": "",
|
||||||
"md_referral_sources": "",
|
"md_referral_sources": "",
|
||||||
@@ -715,15 +715,15 @@
|
|||||||
"workingdays": ""
|
"workingdays": ""
|
||||||
},
|
},
|
||||||
"operations": {
|
"operations": {
|
||||||
"contains": "",
|
"contains": "",
|
||||||
"ends_with": "",
|
"ends_with": "",
|
||||||
"equals": "",
|
"equals": "",
|
||||||
"greater_than": "",
|
"greater_than": "",
|
||||||
"less_than": "",
|
"less_than": "",
|
||||||
"not_equals": "",
|
"not_equals": "",
|
||||||
"starts_with": ""
|
"starts_with": ""
|
||||||
},
|
},
|
||||||
"successes": {
|
"successes": {
|
||||||
"areyousure": "",
|
"areyousure": "",
|
||||||
"defaultviewcreated": "",
|
"defaultviewcreated": "",
|
||||||
"save": "",
|
"save": "",
|
||||||
@@ -1437,13 +1437,13 @@
|
|||||||
"adjustment": "",
|
"adjustment": "",
|
||||||
"ah_detail_line": "",
|
"ah_detail_line": "",
|
||||||
"alt_partno": "",
|
"alt_partno": "",
|
||||||
"amount": "",
|
"amount": "",
|
||||||
"assigned_team": "",
|
"assigned_team": "",
|
||||||
"assigned_team_name": "",
|
"assigned_team_name": "",
|
||||||
"create_ppc": "",
|
"create_ppc": "",
|
||||||
"db_price": "Precio de base de datos",
|
"db_price": "Precio de base de datos",
|
||||||
"include_in_part_cnt": "",
|
"include_in_part_cnt": "",
|
||||||
"lbr_types": {
|
"lbr_types": {
|
||||||
"LA1": "",
|
"LA1": "",
|
||||||
"LA2": "",
|
"LA2": "",
|
||||||
"LA3": "",
|
"LA3": "",
|
||||||
@@ -3082,7 +3082,7 @@
|
|||||||
"purchase_return_ratio_grouped_by_vendor_summary": "",
|
"purchase_return_ratio_grouped_by_vendor_summary": "",
|
||||||
"purchases_by_cost_center_detail": "",
|
"purchases_by_cost_center_detail": "",
|
||||||
"purchases_by_cost_center_summary": "",
|
"purchases_by_cost_center_summary": "",
|
||||||
"purchases_by_date_excel": "",
|
"purchases_by_date_excel": "",
|
||||||
"purchases_by_date_range_detail": "",
|
"purchases_by_date_range_detail": "",
|
||||||
"purchases_by_date_range_summary": "",
|
"purchases_by_date_range_summary": "",
|
||||||
"purchases_by_ro_detail_date": "",
|
"purchases_by_ro_detail_date": "",
|
||||||
|
|||||||
@@ -380,11 +380,11 @@
|
|||||||
"md_parts_order_comment": "",
|
"md_parts_order_comment": "",
|
||||||
"md_parts_scan": {
|
"md_parts_scan": {
|
||||||
"caseInsensitive": "",
|
"caseInsensitive": "",
|
||||||
"expression": "",
|
"expression": "",
|
||||||
"field": "",
|
"field": "",
|
||||||
"flags": "",
|
"flags": "",
|
||||||
"operation": "",
|
"operation": "",
|
||||||
"value": ""
|
"value": ""
|
||||||
},
|
},
|
||||||
"md_payment_types": "",
|
"md_payment_types": "",
|
||||||
"md_referral_sources": "",
|
"md_referral_sources": "",
|
||||||
@@ -715,15 +715,15 @@
|
|||||||
"workingdays": ""
|
"workingdays": ""
|
||||||
},
|
},
|
||||||
"operations": {
|
"operations": {
|
||||||
"contains": "",
|
"contains": "",
|
||||||
"ends_with": "",
|
"ends_with": "",
|
||||||
"equals": "",
|
"equals": "",
|
||||||
"greater_than": "",
|
"greater_than": "",
|
||||||
"less_than": "",
|
"less_than": "",
|
||||||
"not_equals": "",
|
"not_equals": "",
|
||||||
"starts_with": ""
|
"starts_with": ""
|
||||||
},
|
},
|
||||||
"successes": {
|
"successes": {
|
||||||
"areyousure": "",
|
"areyousure": "",
|
||||||
"defaultviewcreated": "",
|
"defaultviewcreated": "",
|
||||||
"save": "",
|
"save": "",
|
||||||
@@ -1437,13 +1437,13 @@
|
|||||||
"adjustment": "",
|
"adjustment": "",
|
||||||
"ah_detail_line": "",
|
"ah_detail_line": "",
|
||||||
"alt_partno": "",
|
"alt_partno": "",
|
||||||
"amount": "",
|
"amount": "",
|
||||||
"assigned_team": "",
|
"assigned_team": "",
|
||||||
"assigned_team_name": "",
|
"assigned_team_name": "",
|
||||||
"create_ppc": "",
|
"create_ppc": "",
|
||||||
"db_price": "Prix de la base de données",
|
"db_price": "Prix de la base de données",
|
||||||
"include_in_part_cnt": "",
|
"include_in_part_cnt": "",
|
||||||
"lbr_types": {
|
"lbr_types": {
|
||||||
"LA1": "",
|
"LA1": "",
|
||||||
"LA2": "",
|
"LA2": "",
|
||||||
"LA3": "",
|
"LA3": "",
|
||||||
@@ -3082,7 +3082,7 @@
|
|||||||
"purchase_return_ratio_grouped_by_vendor_summary": "",
|
"purchase_return_ratio_grouped_by_vendor_summary": "",
|
||||||
"purchases_by_cost_center_detail": "",
|
"purchases_by_cost_center_detail": "",
|
||||||
"purchases_by_cost_center_summary": "",
|
"purchases_by_cost_center_summary": "",
|
||||||
"purchases_by_date_excel": "",
|
"purchases_by_date_excel": "",
|
||||||
"purchases_by_date_range_detail": "",
|
"purchases_by_date_range_detail": "",
|
||||||
"purchases_by_date_range_summary": "",
|
"purchases_by_date_range_summary": "",
|
||||||
"purchases_by_ro_detail_date": "",
|
"purchases_by_ro_detail_date": "",
|
||||||
|
|||||||
@@ -818,6 +818,7 @@ function CalculateTaxesTotals(job, otherTotals) {
|
|||||||
PAG: Dinero(),
|
PAG: Dinero(),
|
||||||
PAO: Dinero(),
|
PAO: Dinero(),
|
||||||
PAS: Dinero(),
|
PAS: Dinero(),
|
||||||
|
PASL: Dinero(),
|
||||||
PAP: Dinero(),
|
PAP: Dinero(),
|
||||||
PAM: Dinero(),
|
PAM: Dinero(),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user