Skip to content

Commit c3949be

Browse files
committed
#4107 simplify subtotal comp
1 parent 59b8f79 commit c3949be

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/backend/src/services/boms.services.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,8 +670,8 @@ export default class BillOfMaterialsService {
670670
}
671671

672672
// recalculate subtotal on edits
673-
const finalPrice = price !== undefined ? price : (material.price ?? undefined);
674-
const finalQuantity = quantity !== undefined ? quantity : (material.quantity ?? undefined);
673+
const finalPrice = price ?? material.price ?? undefined;
674+
const finalQuantity = quantity ?? material.quantity ?? undefined;
675675
const computedSubtotal =
676676
finalPrice !== undefined && finalQuantity !== undefined ? Math.round(finalPrice * Number(finalQuantity)) : undefined;
677677

0 commit comments

Comments
 (0)