IO-1914 Inventory bugfixes.

This commit is contained in:
Patrick Fic
2022-06-07 11:41:27 -07:00
parent 9bf3974ba0
commit fe5e2a247a
8 changed files with 74 additions and 25 deletions

View File

@@ -64,9 +64,9 @@ export function BilllineAddInventory({
cost_center: billline.cost_center,
deductedfromlbr: billline.deductedfromlbr,
applicable_taxes: {
local: false, //billline.applicable_taxes.local,
state: false, //billline.applicable_taxes.state,
federal: false, // billline.applicable_taxes.federal,
local: billline.applicable_taxes.local,
state: billline.applicable_taxes.state,
federal: billline.applicable_taxes.federal,
},
},
],
@@ -76,7 +76,9 @@ export function BilllineAddInventory({
const insertResult = await insertInventoryLine({
variables: {
joblineId: billline.joblineid,
joblineId:
billline.joblineid === "noline" ? billline.id : billline.joblineid, //This will return null as there will be no jobline that has the id of the bill line.
//Unfortunately, we can't send null as the GQL syntax validation fails.
joblineStatus: bodyshop.md_order_statuses.default_returned,
inv: {
shopid: bodyshop.id,
@@ -99,8 +101,9 @@ export function BilllineAddInventory({
act_price: billline.actual_price,
cost: billline.actual_cost,
quantity: billline.quantity,
job_line_id: billline.joblineid,
part_type: billline.jobline.part_type,
job_line_id:
billline.joblineid === "noline" ? null : billline.joblineid,
part_type: billline.jobline && billline.jobline.part_type,
cm_received: true,
},
],