feature/IO-3647-Reynolds-Integration-Phase-2 - Enhance early RO with meaningful amounts.
This commit is contained in:
@@ -64,7 +64,7 @@ function normalizeJobAllocations(ack) {
|
||||
* RR-specific DMS Allocations Summary
|
||||
* Focused on what we actually send to RR:
|
||||
* - ROGOG (split by taxable / non-taxable segments)
|
||||
* - ROLABOR shell
|
||||
* - ROLABOR labor rows with bill hours / rates
|
||||
*
|
||||
* The heavy lifting (ROGOG/ROLABOR split, cost allocation, tax flags)
|
||||
* is now done on the backend via buildRogogFromAllocations/buildRolaborFromRogog.
|
||||
@@ -181,21 +181,30 @@ export function RrAllocationsSummary({ socket, bodyshop, jobId, title, onAllocat
|
||||
const rolaborRows = useMemo(() => {
|
||||
if (!rolaborPreview || !Array.isArray(rolaborPreview.ops)) return [];
|
||||
|
||||
return rolaborPreview.ops.map((op, idx) => {
|
||||
const rowOpCode = opCode || op.opCode;
|
||||
return rolaborPreview.ops
|
||||
.filter((op) =>
|
||||
[op.bill?.jobTotalHrs, op.bill?.billTime, op.bill?.billRate, op.amount?.custPrice, op.amount?.totalAmt]
|
||||
.map((value) => Number.parseFloat(value ?? "0"))
|
||||
.some((value) => !Number.isNaN(value) && value !== 0)
|
||||
)
|
||||
.map((op, idx) => {
|
||||
const rowOpCode = opCode || op.opCode;
|
||||
|
||||
return {
|
||||
key: `${op.jobNo}-${idx}`,
|
||||
opCode: rowOpCode,
|
||||
jobNo: op.jobNo,
|
||||
custPayTypeFlag: op.custPayTypeFlag,
|
||||
custTxblNtxblFlag: op.custTxblNtxblFlag,
|
||||
payType: op.bill?.payType,
|
||||
amtType: op.amount?.amtType,
|
||||
custPrice: op.amount?.custPrice,
|
||||
totalAmt: op.amount?.totalAmt
|
||||
};
|
||||
});
|
||||
return {
|
||||
key: `${op.jobNo}-${idx}`,
|
||||
opCode: rowOpCode,
|
||||
jobNo: op.jobNo,
|
||||
custPayTypeFlag: op.custPayTypeFlag,
|
||||
custTxblNtxblFlag: op.custTxblNtxblFlag,
|
||||
payType: op.bill?.payType,
|
||||
jobTotalHrs: op.bill?.jobTotalHrs,
|
||||
billTime: op.bill?.billTime,
|
||||
billRate: op.bill?.billRate,
|
||||
amtType: op.amount?.amtType,
|
||||
custPrice: op.amount?.custPrice,
|
||||
totalAmt: op.amount?.totalAmt
|
||||
};
|
||||
});
|
||||
}, [rolaborPreview, opCode]);
|
||||
|
||||
// Totals for ROGOG (sum custPrice + dlrCost over all lines)
|
||||
@@ -245,6 +254,9 @@ export function RrAllocationsSummary({ socket, bodyshop, jobId, title, onAllocat
|
||||
{ title: "CustPayType", dataIndex: "custPayTypeFlag", key: "custPayTypeFlag" },
|
||||
{ title: "CustTxblFlag", dataIndex: "custTxblNtxblFlag", key: "custTxblNtxblFlag" },
|
||||
{ title: "PayType", dataIndex: "payType", key: "payType" },
|
||||
{ title: "JobTotalHrs", dataIndex: "jobTotalHrs", key: "jobTotalHrs" },
|
||||
{ title: "BillTime", dataIndex: "billTime", key: "billTime" },
|
||||
{ title: "BillRate", dataIndex: "billRate", key: "billRate" },
|
||||
{ title: "AmtType", dataIndex: "amtType", key: "amtType" },
|
||||
{ title: "CustPrice", dataIndex: "custPrice", key: "custPrice" },
|
||||
{ title: "TotalAmt", dataIndex: "totalAmt", key: "totalAmt" }
|
||||
@@ -317,12 +329,13 @@ export function RrAllocationsSummary({ socket, bodyshop, jobId, title, onAllocat
|
||||
children: (
|
||||
<>
|
||||
<Typography.Paragraph type="secondary" style={{ marginBottom: 8 }}>
|
||||
This mirrors the shell that would be sent for ROLABOR when all financials are carried in GOG.
|
||||
This mirrors the labor rows RR will receive, including weighted bill hours and rates derived from the
|
||||
job's labor lines.
|
||||
</Typography.Paragraph>
|
||||
<ResponsiveTable
|
||||
pagination={false}
|
||||
columns={rolaborColumns}
|
||||
mobileColumnKeys={["jobNo", "opCode", "breakOut", "itemType"]}
|
||||
mobileColumnKeys={["jobNo", "opCode", "billRate", "custPrice"]}
|
||||
rowKey="key"
|
||||
dataSource={rolaborRows}
|
||||
locale={{ emptyText: "No ROLABOR lines would be generated." }}
|
||||
|
||||
Reference in New Issue
Block a user