diff --git a/client/src/components/invoice-detail-edit/invoice-detail-edit.container.jsx b/client/src/components/invoice-detail-edit/invoice-detail-edit.container.jsx index d6165216c..46a047b1f 100644 --- a/client/src/components/invoice-detail-edit/invoice-detail-edit.container.jsx +++ b/client/src/components/invoice-detail-edit/invoice-detail-edit.container.jsx @@ -16,6 +16,8 @@ import AlertComponent from "../alert/alert.component"; import InvoiceFormContainer from "../invoice-form/invoice-form.container"; import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component"; import { UPDATE_INVOICE_LINE } from "../../graphql/invoice-lines.queries"; +import JobDocumentsGallery from "../jobs-documents-gallery/jobs-documents-gallery.container"; + const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, }); @@ -27,7 +29,7 @@ export function InvoiceDetailEditContainer({ bodyshop }) { const [updateInvoice] = useMutation(UPDATE_INVOICE); const [updateInvoiceLine] = useMutation(UPDATE_INVOICE_LINE); - const { loading, error, data } = useQuery(QUERY_INVOICE_BY_PK, { + const { loading, error, data, refetch } = useQuery(QUERY_INVOICE_BY_PK, { variables: { invoiceid: search.invoiceid }, skip: !!!search.invoiceid, }); @@ -100,7 +102,13 @@ export function InvoiceDetailEditContainer({ bodyshop }) { - + + ); diff --git a/client/src/components/invoice-form/invoice-form.component.jsx b/client/src/components/invoice-form/invoice-form.component.jsx index 97d3576d6..4ecf41c24 100644 --- a/client/src/components/invoice-form/invoice-form.component.jsx +++ b/client/src/components/invoice-form/invoice-form.component.jsx @@ -23,7 +23,7 @@ export default function InvoiceFormComponent({ lineData, responsibilityCenters, loadLines, - hideVendor, + invoiceEdit, }) { const { t } = useTranslation(); @@ -61,6 +61,7 @@ export default function InvoiceFormComponent({ > { if (form.getFieldValue("jobid") !== null) { loadLines({ variables: { id: form.getFieldValue("jobid") } }); @@ -71,7 +72,7 @@ export default function InvoiceFormComponent({ { console.log("Upload event:", e); @@ -239,10 +241,6 @@ export default function InvoiceFormComponent({ return null; }} - - ); } diff --git a/client/src/components/invoice-form/invoice-form.container.jsx b/client/src/components/invoice-form/invoice-form.container.jsx index 67a0944b4..88006cf08 100644 --- a/client/src/components/invoice-form/invoice-form.container.jsx +++ b/client/src/components/invoice-form/invoice-form.container.jsx @@ -12,7 +12,7 @@ const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, }); -export function InvoiceFormContainer({ bodyshop, form, hideVendor }) { +export function InvoiceFormContainer({ bodyshop, form, invoiceEdit }) { const { data: RoAutoCompleteData } = useQuery(ACTIVE_JOBS_FOR_AUTOCOMPLETE, { variables: { statuses: bodyshop.md_ro_statuses.open_statuses || ["Open"] }, }); @@ -27,7 +27,7 @@ export function InvoiceFormContainer({ bodyshop, form, hideVendor }) {
{ } }); - const invoiceTotal = Dinero({ amount: (parseFloat(total) || 0) * 100 }); + const invoiceTotal = Dinero({ amount: Math.round((total || 0) * 100) }); const enteredTotal = subtotal.add(federalTax).add(stateTax).add(localTax); const discrepancy = enteredTotal.subtract(invoiceTotal); diff --git a/client/src/components/job-search-select/job-search-select.component.jsx b/client/src/components/job-search-select/job-search-select.component.jsx index a3801f15e..4dd32393d 100644 --- a/client/src/components/job-search-select/job-search-select.component.jsx +++ b/client/src/components/job-search-select/job-search-select.component.jsx @@ -4,7 +4,7 @@ const { Option } = Select; //To be used as a form element only. -const JobSearchSelect = ({ value, onChange, options, onBlur }) => { +const JobSearchSelect = ({ value, onChange, options, onBlur, disabled }) => { const [option, setOption] = useState(value); useEffect(() => { @@ -15,22 +15,25 @@ const JobSearchSelect = ({ value, onChange, options, onBlur }) => { return (