Resolved courtsey contract creation issues IO-455
This commit is contained in:
@@ -14,6 +14,7 @@ export default function ContractCarsContainer({ selectedCarState, form }) {
|
||||
form.setFieldsValue({
|
||||
kmstart: record.mileage,
|
||||
dailyrate: record.dailycost,
|
||||
fuelout: record.fuel,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import InputPhone, {
|
||||
} from "../form-items-formatted/phone-form-item.component";
|
||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||
import InputNumberCalculator from "../form-input-number-calculator/form-input-number-calculator.component";
|
||||
import CourtesyCarFuelSlider from "../courtesy-car-fuel-select/courtesy-car-fuel-select.component";
|
||||
|
||||
export default function ContractFormComponent({ form, create = false }) {
|
||||
const { t } = useTranslation();
|
||||
@@ -86,6 +87,25 @@ export default function ContractFormComponent({ form, create = false }) {
|
||||
</Form.Item>
|
||||
)}
|
||||
</LayoutFormRow>
|
||||
<LayoutFormRow grow>
|
||||
<Form.Item
|
||||
label={t("contracts.fields.fuelout")}
|
||||
name="fuelout"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<CourtesyCarFuelSlider />
|
||||
</Form.Item>
|
||||
{create ? null : (
|
||||
<Form.Item label={t("contracts.fields.fuelin")} name="fuelin">
|
||||
<CourtesyCarFuelSlider />
|
||||
</Form.Item>
|
||||
)}
|
||||
</LayoutFormRow>
|
||||
<LayoutFormRow>
|
||||
<Form.Item
|
||||
label={t("contracts.fields.driver_dlnumber")}
|
||||
@@ -229,44 +249,6 @@ export default function ContractFormComponent({ form, create = false }) {
|
||||
</Form.Item>
|
||||
</LayoutFormRow>
|
||||
|
||||
<LayoutFormRow>
|
||||
<Form.Item
|
||||
label={t("contracts.fields.cc_num")}
|
||||
name="cc_num"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("contracts.fields.cc_expiry")}
|
||||
name="cc_expiry"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("contracts.fields.cc_cardholder")}
|
||||
name="cc_cardholder"
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
</LayoutFormRow>
|
||||
<LayoutFormRow>
|
||||
<Form.Item label={t("contracts.fields.dailyrate")} name="dailyrate">
|
||||
<InputNumber precision={2} />
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Form, InputNumber } from "antd";
|
||||
import React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import CourtesyCarFuelSlider from "../courtesy-car-fuel-select/courtesy-car-fuel-select.component";
|
||||
import FormDatePicker from '../form-date-picker/form-date-picker.component';
|
||||
import FormDatePicker from "../form-date-picker/form-date-picker.component";
|
||||
|
||||
export default function CourtesyCarReturnModalComponent() {
|
||||
const { t } = useTranslation();
|
||||
@@ -15,8 +15,8 @@ export default function CourtesyCarReturnModalComponent() {
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required")
|
||||
}
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<FormDatePicker />
|
||||
@@ -27,20 +27,20 @@ export default function CourtesyCarReturnModalComponent() {
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required")
|
||||
}
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<InputNumber />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label={t("courtesycars.fields.fuel")}
|
||||
name={["courtesycar", "data", "fuel"]}
|
||||
label={t("courtesycars.fields.fuelin")}
|
||||
name={"fuelin"}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: t("general.validation.required")
|
||||
}
|
||||
message: t("general.validation.required"),
|
||||
},
|
||||
]}
|
||||
>
|
||||
<CourtesyCarFuelSlider />
|
||||
|
||||
@@ -39,11 +39,12 @@ export function BillEnterModalContainer({
|
||||
kmend: values.kmend,
|
||||
actualreturn: values.actualreturn,
|
||||
status: "contracts.status.returned",
|
||||
fuelin: values.fuelin,
|
||||
},
|
||||
courtesycarid: context.courtesyCarId,
|
||||
courtesycar: {
|
||||
status: "courtesycars.status.in",
|
||||
fuel: values.fuel,
|
||||
fuel: values.fuelin,
|
||||
mileage: values.kmend,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -60,9 +60,6 @@ export const QUERY_CONTRACT_BY_PK = gql`
|
||||
cccontracts_by_pk(id: $id) {
|
||||
actualreturn
|
||||
agreementnumber
|
||||
cc_cardholder
|
||||
cc_expiry
|
||||
cc_num
|
||||
courtesycarid
|
||||
driver_addr1
|
||||
driver_city
|
||||
@@ -89,6 +86,8 @@ export const QUERY_CONTRACT_BY_PK = gql`
|
||||
statetax
|
||||
localtax
|
||||
coverage
|
||||
fuelin
|
||||
fuelout
|
||||
job {
|
||||
id
|
||||
est_number
|
||||
|
||||
@@ -12,15 +12,21 @@ export default function ContractCreatePageComponent({
|
||||
loading,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const CreateButton = (
|
||||
<Button type="primary" onClick={() => form.submit()} loading={loading}>
|
||||
{t("general.actions.create")}
|
||||
</Button>
|
||||
);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Button type="primary" onClick={() => form.submit()} loading={loading}>
|
||||
{t("general.actions.create")}
|
||||
</Button>
|
||||
{CreateButton}
|
||||
<ContractJobsContainer selectedJobState={selectedJobState} />
|
||||
<ContractCarsContainer selectedCarState={selectedCarState} form={form} />
|
||||
<ContractLicenseDecodeButton form={form} />
|
||||
<ContractFormComponent create form={form} />
|
||||
{CreateButton}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ export function ContractCreatePageContainer({
|
||||
message: t("contracts.successes.saved"),
|
||||
});
|
||||
form.resetFields();
|
||||
form.resetFields();
|
||||
history.push(
|
||||
`/manage/courtesycars/contracts/${response.data.insert_cccontracts.returning[0].id}`
|
||||
);
|
||||
@@ -99,6 +100,7 @@ export function ContractCreatePageContainer({
|
||||
layout="vertical"
|
||||
autoComplete="no"
|
||||
onFinish={handleFinish}
|
||||
initialValues={{ fuelout: 100 }}
|
||||
>
|
||||
<ContractCreatePageComponent
|
||||
loading={loading}
|
||||
|
||||
@@ -433,6 +433,8 @@
|
||||
"driver_zip": "Driver's Postal/ZIP Code",
|
||||
"excesskmrate": "Excess Mileage",
|
||||
"federaltax": "Federal Taxes",
|
||||
"fuelin": "Fuel In",
|
||||
"fuelout": "Fuel Out",
|
||||
"kmend": "Mileage End",
|
||||
"kmstart": "Mileage Start",
|
||||
"localtax": "Local Taxes",
|
||||
|
||||
@@ -433,6 +433,8 @@
|
||||
"driver_zip": "",
|
||||
"excesskmrate": "",
|
||||
"federaltax": "",
|
||||
"fuelin": "",
|
||||
"fuelout": "",
|
||||
"kmend": "",
|
||||
"kmstart": "",
|
||||
"localtax": "",
|
||||
|
||||
@@ -433,6 +433,8 @@
|
||||
"driver_zip": "",
|
||||
"excesskmrate": "",
|
||||
"federaltax": "",
|
||||
"fuelin": "",
|
||||
"fuelout": "",
|
||||
"kmend": "",
|
||||
"kmstart": "",
|
||||
"localtax": "",
|
||||
|
||||
Reference in New Issue
Block a user