Add profit analysis modal and cost tracking for products
Introduces a Profit Analysis modal for products, allowing users to view profit, margin, and markup calculations based on cost per unit and pricing tiers. Adds cost per unit input to the product modal, updates product types, and integrates the analysis modal into the products page and product table. This enhances product management with profit tracking and analysis features.
This commit is contained in:
@@ -307,6 +307,32 @@ const ProductBasicInfo: React.FC<{
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="bg-background rounded-lg border border-border p-4">
|
||||
<h3 className="text-sm font-medium mb-4">💰 Cost & Profit Tracking</h3>
|
||||
<p className="text-xs text-muted-foreground mb-4">
|
||||
Track your costs to automatically calculate profit margins and markup percentages.
|
||||
</p>
|
||||
|
||||
<div>
|
||||
<label htmlFor="costPerUnit" className="text-sm font-medium">
|
||||
Cost Per Unit (Optional)
|
||||
</label>
|
||||
<p className="text-xs text-muted-foreground mb-2">
|
||||
How much you paid for each unit of this product
|
||||
</p>
|
||||
<Input
|
||||
id="costPerUnit"
|
||||
name="costPerUnit"
|
||||
type="number"
|
||||
min="0"
|
||||
step="0.01"
|
||||
value={productData.costPerUnit || ''}
|
||||
onChange={handleChange}
|
||||
placeholder="0.00"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label className="text-sm font-medium">Category</label>
|
||||
|
||||
Reference in New Issue
Block a user