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