Skip to content

Commit 72ecb67

Browse files
committed
Bend hit included in bend cost
1 parent dac4804 commit 72ecb67

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

ui/custom/assembly_quoting_widget.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,7 @@ def create_file_layout(file_types: list[str]) -> tuple[QWidget, QHBoxLayout]:
698698
table_widget_item_bend_cost = QTableWidgetItem(f"${laser_cut_part.prices.bend_cost:,.2f}")
699699
table_widget_item_bend_cost.setFont(self.tables_font)
700700
table_widget_item_bend_cost.setTextAlignment(Qt.AlignmentFlag.AlignCenter | Qt.AlignmentFlag.AlignVCenter)
701+
table_widget_item_bend_cost.setToolTip(f"Cost for bending: ${laser_cut_part.prices.bend_cost:,.2f}\nBend hits: {laser_cut_part.meta_data.bend_hits}")
701702
self.laser_cut_parts_table.setItem(
702703
current_row,
703704
LaserCutTableColumns.BEND_COST.value,
@@ -780,6 +781,7 @@ def update_laser_cut_parts_table_prices(self):
780781
table_data["cost_of_goods"].setText(f"${cost_of_goods:,.2f}")
781782
table_data["labor_cost"].setText(f"${laser_cut_part.prices.labor_cost:,.2f}")
782783
table_data["bend_cost"].setText(f"${laser_cut_part.prices.bend_cost:,.2f}")
784+
table_data["bend_cost"].setToolTip(f"Cost for bending: ${laser_cut_part.prices.bend_cost:,.2f}\nBend hits: {laser_cut_part.meta_data.bend_hits}")
783785
table_data["unit_price"].setText(f"${unit_price:,.2f}")
784786
table_data["price"].setText(f"${(unit_price * laser_cut_part.inventory_data.quantity * self.assembly.meta_data.quantity):,.2f}")
785787
self.laser_cut_parts_table.blockSignals(False)

utils/workspace/job_price_calculator.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ def get_laser_cut_parts_cost(self, laser_cut_parts: list[LaserCutPart]) -> float
105105
total += self.get_laser_cut_part_cost(laser_cut_part) * laser_cut_part.inventory_data.quantity
106106
return total
107107

108+
def get_laser_cut_part_cost_of_bending(self, laser_cut_part: LaserCutPart) -> float:
109+
return laser_cut_part.meta_data.bend_hits * laser_cut_part.prices.bend_cost
110+
108111
def get_laser_cut_part_cost_of_goods(self, laser_cut_part: LaserCutPart) -> float:
109112
if self.match_item_cogs_to_sheet:
110113
return laser_cut_part.prices.matched_to_sheet_cost_price
@@ -136,7 +139,7 @@ def get_laser_cut_part_cost(self, laser_cut_part: LaserCutPart) -> float:
136139
self.get_laser_cut_part_cost_of_goods(laser_cut_part),
137140
)
138141
+ self.calculate_laser_cut_part_overhead(
139-
laser_cut_part.prices.bend_cost,
142+
self.get_laser_cut_part_cost_of_bending(laser_cut_part),
140143
)
141144
+ self.calculate_laser_cut_part_overhead(
142145
laser_cut_part.prices.labor_cost,

0 commit comments

Comments
 (0)