IO-912 Reformat payment modal

This commit is contained in:
Patrick Fic
2021-04-26 15:04:45 -07:00
parent 1993b8101f
commit e8db267a18
3 changed files with 164 additions and 153 deletions

View File

@@ -18,7 +18,7 @@ export default function PaymentFormTotalPayments({ jobid }) {
if (loading) return <LoadingSpinner />;
if (error) return <AlertComponent message={error.message} type="error" />;
if (!data) return <div>Select a job</div>;
if (!data) return <></>;
const totalPayments = data.jobs_by_pk.payments.reduce((acc, val) => {
return acc.add(Dinero({ amount: (val.amount || 0) * 100 }));
}, Dinero());