modules updates

This commit is contained in:
2026-03-16 14:22:01 -05:00
parent 865c4a954c
commit 229b4b1486
2 changed files with 10 additions and 8 deletions
+5 -3
View File
@@ -65,10 +65,12 @@ const ModifierRow: Component<ModifierRowProps> = (props) => {
value={props.modifier.value}
onUpdate={(val) => props.onUpdate(props.modifier.id, { value: val })}
class="w-20 text-right text-sm border-b border-dashed border-border focus:border-primary outline-none bg-transparent text-primary font-medium"
placeholder="0.00"
placeholder={props.modifier.moduleId === 'man-hours' ? "Factor" : "0.00"}
/>
<Show when={props.modifier.valueType === 'unit' && props.modifier.unitLabel}>
<span class="text-[10px] font-bold text-primary/60">{props.modifier.unitLabel}</span>
<Show when={(props.modifier.valueType === 'unit' && props.modifier.unitLabel) || props.modifier.moduleId === 'man-hours'}>
<span class="text-[10px] font-bold text-primary/60">
{props.modifier.moduleId === 'man-hours' ? 'factor' : props.modifier.unitLabel}
</span>
</Show>
</div>
+5 -5
View File
@@ -28,15 +28,15 @@ const TaxModule: ModifierModule = {
const ManHoursModule: ModifierModule = {
id: 'man-hours',
name: 'Man-Hours',
description: 'Calculates estimated labor hours. Does not affect monetary total.',
description: 'Calculates labor hours by dividing the sub-scope subtotal by a production factor.',
defaultLabel: 'Estimated Hours',
defaultValue: 0,
defaultValue: 30,
defaultValueType: 'unit',
defaultUnitLabel: 'hrs',
defaultUnitLabel: 'factor',
calculate: () => 0,
calculateDisplay: (m, base) => {
if (m.valueType === 'percent') return base * (m.value / 100);
return m.value;
const factor = m.value || 1;
return base / factor;
}
};