BOD-26 Added totals calculation for job reconciliation.
This commit is contained in:
@@ -5,19 +5,23 @@ import { setModalContext } from "../../redux/modals/modals.actions";
|
||||
import AlertComponent from "../alert/alert.component";
|
||||
import InvoicesListTableComponent from "../invoices-list-table/invoices-list-table.component";
|
||||
import JobInvoicesTotalsComponent from "../job-invoices-total/job-invoices-total.component";
|
||||
|
||||
import { useTranslation } from "react-i18next";
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
setInvoiceEnterContext: (context) =>
|
||||
dispatch(setModalContext({ context: context, modal: "invoiceEnter" })),
|
||||
setReconciliationContext: (context) =>
|
||||
dispatch(setModalContext({ context: context, modal: "reconciliation" })),
|
||||
});
|
||||
|
||||
export function JobsDetailPliComponent({
|
||||
setInvoiceEnterContext,
|
||||
setReconciliationContext,
|
||||
job,
|
||||
invoicesQuery,
|
||||
handleOnRowClick,
|
||||
selectedInvoice,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<div>
|
||||
<Button
|
||||
@@ -29,8 +33,21 @@ export function JobsDetailPliComponent({
|
||||
},
|
||||
});
|
||||
}}>
|
||||
Enter Invoice
|
||||
{t("jobs.actions.postInvoices")}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
setReconciliationContext({
|
||||
actions: { refetch: invoicesQuery.refetch },
|
||||
context: {
|
||||
job,
|
||||
invoices: invoicesQuery.data && invoicesQuery.data.invoices,
|
||||
},
|
||||
});
|
||||
}}>
|
||||
{t("jobs.actions.reconcile")}
|
||||
</Button>
|
||||
|
||||
{invoicesQuery.error ? (
|
||||
<AlertComponent message={invoicesQuery.error.message} type='error' />
|
||||
) : null}
|
||||
|
||||
Reference in New Issue
Block a user