This commit is contained in:
Dave
2026-03-20 14:55:08 -04:00
parent 8af8c8039c
commit 0622696650
4 changed files with 33 additions and 18 deletions

View File

@@ -368,8 +368,9 @@ const buildRogogFromAllocations = (allocations, { opCode, payType = "Cust", roNo
*
* We still keep a 1:1 mapping with GOG ops: each op gets a corresponding
* OpCodeLaborInfo entry using the same JobNo and the same tax flag as its
* GOG line. Labor-specific details (hrs/rate) remain zeroed out, and the
* DMS can ignore non-labor ops by virtue of the zero hours/amounts.
* GOG line. Labor-specific hours/rate remain zeroed out, but actual labor
* sale amounts are mirrored into ROLABOR for labor segments so RR receives
* the expected labor pricing on updates. Non-labor ops remain zeroed.
*
* @param {Object} rogg - result of buildRogogFromAllocations
* @param {Object} opts
@@ -388,6 +389,8 @@ const buildRolaborFromRogog = (rogg, { payType = "Cust" } = {}) => {
const txFlag = firstLine.custTxblNtxblFlag ?? "N";
const linePayType = firstLine.custPayTypeFlag || "C";
const isLaborSegment = op.segmentKind === "laborTaxable" || op.segmentKind === "laborNonTaxable";
const laborAmount = isLaborSegment ? String(firstLine?.amount?.custPrice ?? "0") : "0";
return {
opCode: op.opCode,
@@ -403,8 +406,8 @@ const buildRolaborFromRogog = (rogg, { payType = "Cust" } = {}) => {
amount: {
payType,
amtType: "Job",
custPrice: "0",
totalAmt: "0"
custPrice: laborAmount,
totalAmt: laborAmount
}
};
});