Resolved contracts list not showing correct entries based on dates. BOD-313. Added changes not saved indicator to shop info BOD-325
This commit is contained in:
@@ -4300,6 +4300,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>vehicle</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>
|
<concept_node>
|
||||||
<name>waitingforscan</name>
|
<name>waitingforscan</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -6240,6 +6261,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>user_email</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>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
<folder_node>
|
<folder_node>
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export default function ContractsList({ loading, contracts, refetch, total }) {
|
|||||||
`${record.driver_fn || ""} ${record.driver_ln || ""}`,
|
`${record.driver_fn || ""} ${record.driver_ln || ""}`,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("contracts.fields.vehicle"),
|
title: t("contracts.labels.vehicle"),
|
||||||
dataIndex: "vehicle",
|
dataIndex: "vehicle",
|
||||||
key: "vehicle",
|
key: "vehicle",
|
||||||
//sorter: (a, b) => alphaSort(a.status, b.status),
|
//sorter: (a, b) => alphaSort(a.status, b.status),
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
|||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
|
import FormsFieldChanged from "../form-fields-changed-alert/form-fields-changed-alert.component";
|
||||||
|
|
||||||
export default function ShopInfoContainer() {
|
export default function ShopInfoContainer() {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
@@ -40,15 +41,17 @@ export default function ShopInfoContainer() {
|
|||||||
if (data) form.resetFields();
|
if (data) form.resetFields();
|
||||||
}, [form, data]);
|
}, [form, data]);
|
||||||
|
|
||||||
if (error) return <AlertComponent message={error.message} type='error' />;
|
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||||
if (loading) return <LoadingSpinner />;
|
if (loading) return <LoadingSpinner />;
|
||||||
return (
|
return (
|
||||||
<Form
|
<Form
|
||||||
form={form}
|
form={form}
|
||||||
layout='vertical'
|
layout="vertical"
|
||||||
autoComplete='new-password'
|
autoComplete="new-password"
|
||||||
onFinish={handleFinish}
|
onFinish={handleFinish}
|
||||||
initialValues={data ? data.bodyshops[0] : null}>
|
initialValues={data ? data.bodyshops[0] : null}
|
||||||
|
>
|
||||||
|
<FormsFieldChanged form={form} />
|
||||||
<ShopInfoComponent form={form} saveLoading={saveLoading} />
|
<ShopInfoComponent form={form} saveLoading={saveLoading} />
|
||||||
</Form>
|
</Form>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -136,7 +136,13 @@ export const QUERY_ACTIVE_CONTRACTS_PAGINATED = gql`
|
|||||||
offset: $offset
|
offset: $offset
|
||||||
limit: $limit
|
limit: $limit
|
||||||
order_by: $order
|
order_by: $order
|
||||||
where: { actualreturn: { _lte: $end }, start: { _gte: $start } }
|
where: {
|
||||||
|
_or: [
|
||||||
|
{ actualreturn: { _lte: $end } }
|
||||||
|
{ actualreturn: { _is_null: true } }
|
||||||
|
]
|
||||||
|
start: { _gte: $start }
|
||||||
|
}
|
||||||
) {
|
) {
|
||||||
agreementnumber
|
agreementnumber
|
||||||
courtesycarid
|
courtesycarid
|
||||||
|
|||||||
@@ -18,14 +18,17 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
export function ContractsPageContainer({ setBreadcrumbs }) {
|
export function ContractsPageContainer({ setBreadcrumbs }) {
|
||||||
const searchParams = queryString.parse(useLocation().search);
|
const searchParams = queryString.parse(useLocation().search);
|
||||||
const { page, sortcolumn, sortorder, start, end } = searchParams;
|
const { page, sortcolumn, sortorder, start, end } = searchParams;
|
||||||
|
console.log("ContractsPageContainer -> searchParams", searchParams);
|
||||||
|
|
||||||
const { loading, error, data, refetch } = useQuery(
|
const { loading, error, data, refetch } = useQuery(
|
||||||
QUERY_ACTIVE_CONTRACTS_PAGINATED,
|
QUERY_ACTIVE_CONTRACTS_PAGINATED,
|
||||||
{
|
{
|
||||||
variables: {
|
variables: {
|
||||||
//search: search || "",
|
//search: search || "",
|
||||||
start: start ? moment(start) : null,
|
start: start
|
||||||
end: end ? moment(end) : null,
|
? moment(start)
|
||||||
|
: moment().startOf("week").subtract(7, "days"),
|
||||||
|
end: end ? moment(end) : moment().endOf("week"),
|
||||||
offset: page ? (page - 1) * 25 : 0,
|
offset: page ? (page - 1) * 25 : 0,
|
||||||
limit: 25,
|
limit: 25,
|
||||||
order: [
|
order: [
|
||||||
|
|||||||
@@ -262,6 +262,7 @@
|
|||||||
},
|
},
|
||||||
"correctdataonform": "Please review the information above. If any of it is not correct, you can fix it later.",
|
"correctdataonform": "Please review the information above. If any of it is not correct, you can fix it later.",
|
||||||
"noteconvertedfrom": "R.O. created from converted Courtesy Car Contract {{agreementnumber}}.",
|
"noteconvertedfrom": "R.O. created from converted Courtesy Car Contract {{agreementnumber}}.",
|
||||||
|
"vehicle": "Vehicle",
|
||||||
"waitingforscan": "Please scan driver's license barcode..."
|
"waitingforscan": "Please scan driver's license barcode..."
|
||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
@@ -408,7 +409,8 @@
|
|||||||
"flat_rate": "Flat Rate (Disabled is Straight Time)",
|
"flat_rate": "Flat Rate (Disabled is Straight Time)",
|
||||||
"hire_date": "Hire Date",
|
"hire_date": "Hire Date",
|
||||||
"last_name": "Last Name",
|
"last_name": "Last Name",
|
||||||
"termination_date": "Termination Date"
|
"termination_date": "Termination Date",
|
||||||
|
"user_email": "User Email"
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"actions": "Actions"
|
"actions": "Actions"
|
||||||
|
|||||||
@@ -262,6 +262,7 @@
|
|||||||
},
|
},
|
||||||
"correctdataonform": "",
|
"correctdataonform": "",
|
||||||
"noteconvertedfrom": "",
|
"noteconvertedfrom": "",
|
||||||
|
"vehicle": "",
|
||||||
"waitingforscan": ""
|
"waitingforscan": ""
|
||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
@@ -408,7 +409,8 @@
|
|||||||
"flat_rate": "Tarifa plana (deshabilitado es tiempo recto)",
|
"flat_rate": "Tarifa plana (deshabilitado es tiempo recto)",
|
||||||
"hire_date": "Fecha de contratación",
|
"hire_date": "Fecha de contratación",
|
||||||
"last_name": "Apellido",
|
"last_name": "Apellido",
|
||||||
"termination_date": "Fecha de conclusión"
|
"termination_date": "Fecha de conclusión",
|
||||||
|
"user_email": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"actions": ""
|
"actions": ""
|
||||||
|
|||||||
@@ -262,6 +262,7 @@
|
|||||||
},
|
},
|
||||||
"correctdataonform": "",
|
"correctdataonform": "",
|
||||||
"noteconvertedfrom": "",
|
"noteconvertedfrom": "",
|
||||||
|
"vehicle": "",
|
||||||
"waitingforscan": ""
|
"waitingforscan": ""
|
||||||
},
|
},
|
||||||
"status": {
|
"status": {
|
||||||
@@ -408,7 +409,8 @@
|
|||||||
"flat_rate": "Taux fixe (désactivé est le temps normal)",
|
"flat_rate": "Taux fixe (désactivé est le temps normal)",
|
||||||
"hire_date": "Date d'embauche",
|
"hire_date": "Date d'embauche",
|
||||||
"last_name": "Nom de famille",
|
"last_name": "Nom de famille",
|
||||||
"termination_date": "Date de résiliation"
|
"termination_date": "Date de résiliation",
|
||||||
|
"user_email": ""
|
||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"actions": ""
|
"actions": ""
|
||||||
|
|||||||
Reference in New Issue
Block a user