management and delivery improvements
This commit is contained in:
@@ -312,21 +312,63 @@ const ScopeCard: Component<ScopeCardProps> = (props) => {
|
||||
<Percent class="w-3 h-3" />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => props.onUpdateScope(props.scope.id, { useManagementLogic: 'simple' })}
|
||||
onClick={() => props.onUpdateScope(props.scope.id, {
|
||||
useManagementLogic: 'simple',
|
||||
managementFee: (props.scope.managementFeeQuantity || 0) * (props.scope.managementFeeRate || 0)
|
||||
})}
|
||||
class={`p-1 rounded-md transition-colors ${props.scope.useManagementLogic === 'simple' ? 'bg-primary/10 text-primary' : 'hover:bg-muted'}`}
|
||||
>
|
||||
<DollarSign class="w-3 h-3" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<div class="flex items-center gap-4">
|
||||
{props.scope.useManagementLogic === 'percent' ? (
|
||||
<NumericInput
|
||||
value={props.scope.managementFee}
|
||||
onUpdate={(val) => props.onUpdateScope(props.scope.id, { managementFee: val })}
|
||||
class="w-20 text-right text-sm border-b border-dashed border-border focus:border-primary outline-none bg-transparent"
|
||||
/>
|
||||
<span class="w-28 text-right text-foreground font-medium">${formatNumber(totals().mgmtTotal)}</span>
|
||||
</div>
|
||||
) : (
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="flex flex-col items-end gap-0.5 text-[9px] font-black tracking-[0.3em] text-muted-foreground uppercase">
|
||||
<span>Qty</span>
|
||||
<NumericInput
|
||||
value={props.scope.managementFeeQuantity}
|
||||
onUpdate={(val) => {
|
||||
const qty = val;
|
||||
const rate = props.scope.managementFeeRate || 0;
|
||||
props.onUpdateScope(props.scope.id, {
|
||||
managementFeeQuantity: qty,
|
||||
managementFee: qty * rate
|
||||
});
|
||||
}}
|
||||
class="w-16 text-right text-sm border-b border-dashed border-border focus:border-primary outline-none bg-transparent"
|
||||
/>
|
||||
</div>
|
||||
<span class="text-xs font-black text-muted-foreground/70">×</span>
|
||||
<div class="flex flex-col items-end gap-0.5 text-[9px] font-black tracking-[0.3em] text-muted-foreground uppercase">
|
||||
<span>Rate</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<span class="text-[10px] font-black text-muted-foreground">$</span>
|
||||
<NumericInput
|
||||
value={props.scope.managementFeeRate}
|
||||
onUpdate={(val) => {
|
||||
const rate = val;
|
||||
const qty = props.scope.managementFeeQuantity || 0;
|
||||
props.onUpdateScope(props.scope.id, {
|
||||
managementFeeRate: rate,
|
||||
managementFee: qty * rate
|
||||
});
|
||||
}}
|
||||
class="w-20 text-right text-sm border-b border-dashed border-border focus:border-primary outline-none bg-transparent"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<span class="w-28 text-right text-foreground font-medium">${formatNumber(totals().mgmtTotal)}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Delivery Fee */}
|
||||
@@ -341,21 +383,63 @@ const ScopeCard: Component<ScopeCardProps> = (props) => {
|
||||
<Percent class="w-3 h-3" />
|
||||
</button>
|
||||
<button
|
||||
onClick={() => props.onUpdateScope(props.scope.id, { useDeliveryLogic: 'simple' })}
|
||||
onClick={() => props.onUpdateScope(props.scope.id, {
|
||||
useDeliveryLogic: 'simple',
|
||||
deliveryFee: (props.scope.deliveryFeeQuantity || 0) * (props.scope.deliveryFeeRate || 0)
|
||||
})}
|
||||
class={`p-1 rounded-md transition-colors ${props.scope.useDeliveryLogic === 'simple' ? 'bg-primary/10 text-primary' : 'hover:bg-muted'}`}
|
||||
>
|
||||
<DollarSign class="w-3 h-3" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center gap-4">
|
||||
<div class="flex items-center gap-4">
|
||||
{props.scope.useDeliveryLogic === 'percent' ? (
|
||||
<NumericInput
|
||||
value={props.scope.deliveryFee}
|
||||
onUpdate={(val) => props.onUpdateScope(props.scope.id, { deliveryFee: val })}
|
||||
class="w-20 text-right text-sm border-b border-dashed border-border focus:border-primary outline-none bg-transparent"
|
||||
/>
|
||||
<span class="w-28 text-right text-foreground font-medium">${formatNumber(totals().deliveryTotal)}</span>
|
||||
</div>
|
||||
) : (
|
||||
<div class="flex items-center gap-3">
|
||||
<div class="flex flex-col items-end gap-0.5 text-[9px] font-black tracking-[0.3em] text-muted-foreground uppercase">
|
||||
<span>Qty</span>
|
||||
<NumericInput
|
||||
value={props.scope.deliveryFeeQuantity}
|
||||
onUpdate={(val) => {
|
||||
const qty = val;
|
||||
const rate = props.scope.deliveryFeeRate || 0;
|
||||
props.onUpdateScope(props.scope.id, {
|
||||
deliveryFeeQuantity: qty,
|
||||
deliveryFee: qty * rate
|
||||
});
|
||||
}}
|
||||
class="w-16 text-right text-sm border-b border-dashed border-border focus:border-primary outline-none bg-transparent"
|
||||
/>
|
||||
</div>
|
||||
<span class="text-xs font-black text-muted-foreground/70">×</span>
|
||||
<div class="flex flex-col items-end gap-0.5 text-[9px] font-black tracking-[0.3em] text-muted-foreground uppercase">
|
||||
<span>Rate</span>
|
||||
<div class="flex items-center gap-1">
|
||||
<span class="text-[10px] font-black text-muted-foreground">$</span>
|
||||
<NumericInput
|
||||
value={props.scope.deliveryFeeRate}
|
||||
onUpdate={(val) => {
|
||||
const rate = val;
|
||||
const qty = props.scope.deliveryFeeQuantity || 0;
|
||||
props.onUpdateScope(props.scope.id, {
|
||||
deliveryFeeRate: rate,
|
||||
deliveryFee: qty * rate
|
||||
});
|
||||
}}
|
||||
class="w-20 text-right text-sm border-b border-dashed border-border focus:border-primary outline-none bg-transparent"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<span class="w-28 text-right text-foreground font-medium">${formatNumber(totals().deliveryTotal)}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Scope Notes Section */}
|
||||
|
||||
Reference in New Issue
Block a user