Changed RO Search Select to use RO searching and possible provided job value for options IMEX-129 IMEX-327

This commit is contained in:
Patrick Fic
2020-08-26 16:15:17 -07:00
parent 69f2b66e56
commit 721c938e8a
20 changed files with 193 additions and 109 deletions

View File

@@ -32,15 +32,15 @@ export default function JobsClosePartsAllocation({
<td>{t(`jobs.fields.${alloc.toLowerCase()}`)}</td>
<td>
{partsAllocations[alloc].total &&
partsAllocations[alloc].total.toFormat()}
Dinero(partsAllocations[alloc].total).toFormat()}
</td>
<td>
{partsAllocations[alloc].total
{Dinero(partsAllocations[alloc].total)
.subtract(
Dinero({
amount: partsAllocations[alloc].allocations.reduce(
(acc, val) => {
return acc + val.amount.getAmount();
return acc + Dinero(val.amount).getAmount();
},
0
),
@@ -52,12 +52,12 @@ export default function JobsClosePartsAllocation({
<AllocationButton
allocationKey={alloc}
invoiced={invoiced}
remainingAmount={partsAllocations[alloc].total
remainingAmount={Dinero(partsAllocations[alloc].total)
.subtract(
Dinero({
amount: partsAllocations[alloc].allocations.reduce(
(acc, val) => {
return acc + val.amount.getAmount();
return acc + Dinero(val.amount).getAmount();
},
0
),
@@ -70,7 +70,7 @@ export default function JobsClosePartsAllocation({
</td>
<td>
<AllocationTags
invoiced={invoiced}
invoiced={invoiced}
allocationKey={alloc}
allocation={partsAllocations[alloc]}
setAllocations={setPartsAllocations}
@@ -85,7 +85,7 @@ export default function JobsClosePartsAllocation({
{Dinero({
amount: Object.keys(partsAllocations).reduce((acc, val) => {
return (acc =
acc + partsAllocations[val].total.getAmount());
acc + Dinero(partsAllocations[val].total).getAmount());
}, 0),
}).toFormat()}
</td>