diff --git a/client/src/components/allocations-assignment/allocations-assignment.component.jsx b/client/src/components/allocations-assignment/allocations-assignment.component.jsx index f3f3a0a8a..b02f09bc2 100644 --- a/client/src/components/allocations-assignment/allocations-assignment.component.jsx +++ b/client/src/components/allocations-assignment/allocations-assignment.component.jsx @@ -23,7 +23,6 @@ export default connect( const { t } = useTranslation(); const onChange = e => { - console.log("e", e); setAssignment({ ...assignment, employeeid: e }); }; diff --git a/client/src/components/email-overlay/email-overlay.container.jsx b/client/src/components/email-overlay/email-overlay.container.jsx index 1730176e4..ae595207a 100644 --- a/client/src/components/email-overlay/email-overlay.container.jsx +++ b/client/src/components/email-overlay/email-overlay.container.jsx @@ -1,4 +1,4 @@ -import { Button, Modal, notification } from "antd"; +import { Modal, notification } from "antd"; import axios from "axios"; import React, { useEffect, useState } from "react"; import { useLazyQuery } from "react-apollo"; @@ -7,10 +7,7 @@ import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; import { createStructuredSelector } from "reselect"; import { toggleEmailOverlayVisible } from "../../redux/email/email.actions"; -import { - selectEmailConfig, - selectEmailVisible -} from "../../redux/email/email.selectors.js"; +import { selectEmailConfig, selectEmailVisible } from "../../redux/email/email.selectors.js"; import LoadingSpinner from "../loading-spinner/loading-spinner.component"; import EmailOverlayComponent from "./email-overlay.component"; @@ -89,24 +86,20 @@ export default connect( }; return ( -
- toggleEmailOverlayVisible()} - > - - - - - - -
+ toggleEmailOverlayVisible()} + > + + + + ); }); diff --git a/client/src/components/form-items-formatted/currency-form-item.component.jsx b/client/src/components/form-items-formatted/currency-form-item.component.jsx new file mode 100644 index 000000000..85c82e8e0 --- /dev/null +++ b/client/src/components/form-items-formatted/currency-form-item.component.jsx @@ -0,0 +1,15 @@ +import { InputNumber } from "antd"; +import React, { forwardRef } from "react"; +function FormItemCurrency(props, ref) { + return ( + `$ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ",")} + parser={value => value.replace(/\$\s?|(,*)/g, "")} + precision={2} + + /> + ); +} + +export default forwardRef(FormItemCurrency); diff --git a/client/src/components/invoice-enter-modal/invoice-enter-modal.component.jsx b/client/src/components/invoice-enter-modal/invoice-enter-modal.component.jsx index 125486e30..8df927ca9 100644 --- a/client/src/components/invoice-enter-modal/invoice-enter-modal.component.jsx +++ b/client/src/components/invoice-enter-modal/invoice-enter-modal.component.jsx @@ -1,5 +1,5 @@ import { - AutoComplete, + Select, Button, DatePicker, Form, @@ -20,10 +20,9 @@ export default function InvoiceEnterModalComponent({ handleCancel, handleFinish, - handleRoAutoComplete, handleRoSelect, roAutoCompleteOptions, - handleVendorAutoComplete, + handleVendorSelect, vendorAutoCompleteOptions, lineData, @@ -48,7 +47,7 @@ export default function InvoiceEnterModalComponent({ width={"90%"} visible={visible} okText={t("general.labels.save")} - onOk={handleFinish} + onOk={() => form.submit()} okButtonProps={{ htmlType: "submit" }} onCancel={handleCancel} > @@ -59,21 +58,31 @@ export default function InvoiceEnterModalComponent({ rules={[ { required: true, - pattern: new RegExp( - "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" - ), - message: t("invoices.errors.invalidro") + message: t("general.validation.required") } ]} > - + > + {roAutoCompleteOptions + ? roAutoCompleteOptions.map(o => ( + + {`${ + o.ro_number ? o.ro_number : o.est_number + } | ${o.ownr_ln || ""} ${o.ownr_fn || ""} | ${o.vehicle + .v_model_yr || ""} ${o.vehicle.v_make_desc || ""} ${o + .vehicle.v_model_desc || ""}`} + + )) + : null} + - + > + {vendorAutoCompleteOptions + ? vendorAutoCompleteOptions.map(o => ( + + {o.name} + + )) + : null} +