File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export const getAllDue = async (backend, id) => {
3636 let previousTotal = previousTotals . reduce ( ( acc , total ) => acc + total , 0 ) ;
3737
3838 const currentTotal = await backend . get ( `/invoices/total/${ id } ` ) ;
39- previousTotal = currentTotal . data . total ;
39+ previousTotal + = currentTotal . data . total ;
4040
4141 const paidTotals = await Promise . all (
4242 previousInvoices . map ( async ( invoice ) => {
@@ -47,7 +47,7 @@ export const getAllDue = async (backend, id) => {
4747 let paidTotal = paidTotals . reduce ( ( acc , paid ) => acc + paid , 0 ) ;
4848
4949 const currentPaid = await backend . get ( `/invoices/paid/${ id } ` ) ;
50- paidTotal = currentPaid . data . total ;
50+ paidTotal + = currentPaid . data . total ;
5151
5252 const pastDue = ( previousTotal - paidTotal ) > 0 ? ( previousTotal - paidTotal ) : 0 ;
5353 return pastDue ;
You can’t perform that action at this time.
0 commit comments