def computeLaborSaleTotal() if #quantity does not exist hide the closest
to labor_sale_total then hide the closest to material_sale_total else if #quantity.value is 0 or #labor_unit.value is 0 or #labor_min.value is 0 or #labor_sale.value is 0 then put "$ 0.00" into #labor_sale_total else set total to Math.ceil(#quantity.value / #labor_min.value) * #labor_min.value * (#labor_sale.value / #labor_unit.value) then put "$ " + total.toFixed(2) into #labor_sale_total end end def computeMaterialSaleTotal() if #quantity does not exist hide the closest to #labor_sale_total then hide the closest to #material_sale_total then hide the closest to #material_quantity else if #quantity is 0 or #material_unit.value is 0 or #material_min.value is 0 or #material_sale.value is 0 then put "$ 0.00" into #material_sale_total then put "0" into #material_quantity else set mat_quant to Math.ceil(#quantity.value / #material_min.value) set total to mat_quant * #material_min.value * (#material_sale.value / #material_unit.value) then put "$ " + total.toFixed(2) into #material_sale_total then put mat_quant.toFixed(0) into #material_quantity end end def validateEditSowItem() set isValid to true if #new_room_checkbox.checked and no #new_room_name.value set isValid to false end if #new_price_checkbox.checked and no #new_price_desc.value set isValid to false end if isValid remove @disabled from #submit if #new_room_checkbox.checked show #new_room_notice end if #new_price_checkbox.checked show #new_price_notice end else hide #new_price_notice hide #new_room_notice add @disabled to #submit end end def updatePriceInfo() set pname to #new_price_desc.value + ' - ' + #new_price_unit.value if no #new_price_desc.value and no #new_price_unit.value set pname to 'None' end put pname into #price_info put pname into <#new_price_notice span/> end def updateRoomInfo() set rname to #new_room_name.value + ' - ' + #new_room_length.value + ' L x ' + #new_room_width.value + ' W x ' + #new_room_height.value + ' H' if no #new_room_name.value and no #new_room_length.value and no #new_room_width.value and no #new_room_height.value set rname to 'None' end put rname into #room_info put rname into <#new_room_notice span/> end