RO into IO merge as of 02/05/2024.
This commit is contained in:
@@ -10,6 +10,8 @@ import {onlyUnique} from "../../utils/arrayHelper";
|
||||
import {alphaSort} from "../../utils/sorters";
|
||||
import {TemplateList} from "../../utils/TemplateConstants";
|
||||
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
|
||||
import Dinero from "dinero.js";
|
||||
import InstanceRenderManager from "../../utils/instanceRenderMgr";
|
||||
|
||||
const mapStateToProps = createStructuredSelector({
|
||||
bodyshop: selectBodyshop,
|
||||
@@ -130,6 +132,16 @@ const JobRelatedTicketsTable = ({
|
||||
return acc;
|
||||
}, 0);
|
||||
|
||||
const pay = item.tickets
|
||||
.filter((ticket) => ticket.cost_center === costCenter)
|
||||
.reduce((acc, val) => {
|
||||
return acc.add(
|
||||
Dinero({amount: Math.round(val.rate * 100)}).multiply(
|
||||
val.flat_rate ? val.productivehrs : val.actualhrs
|
||||
)
|
||||
);
|
||||
}, Dinero());
|
||||
|
||||
return {
|
||||
id: `${item.jobKey}${costCenter}`,
|
||||
costCenter,
|
||||
@@ -137,6 +149,8 @@ const JobRelatedTicketsTable = ({
|
||||
actHrs: actHrs.toFixed(1),
|
||||
prodHrs: prodHrs.toFixed(1),
|
||||
clockHrs,
|
||||
...InstanceRenderManager({rome: {pay}})
|
||||
|
||||
};
|
||||
});
|
||||
})
|
||||
@@ -196,6 +210,16 @@ const JobRelatedTicketsTable = ({
|
||||
state.sortedInfo.columnKey === "clockHrs" && state.sortedInfo.order,
|
||||
render: (text, record) => record.clockHrs.toFixed(2),
|
||||
},
|
||||
...InstanceRenderManager({rome:{
|
||||
title: "Pay",
|
||||
dataIndex: "Pay",
|
||||
key: "Pay",
|
||||
sorter: (a, b) => a.clockHrs - b.clockHrs,
|
||||
sortOrder:
|
||||
state.sortedInfo.columnKey === "clockHrs" && state.sortedInfo.order,
|
||||
render: (text, record) => record.pay.toFormat("$0.00"),
|
||||
}})
|
||||
,
|
||||
{
|
||||
title: t("general.labels.actions"),
|
||||
dataIndex: "actions",
|
||||
|
||||
Reference in New Issue
Block a user