diff --git a/src/api/config.ts b/src/api/config.ts index 037fa06..8fd9172 100644 --- a/src/api/config.ts +++ b/src/api/config.ts @@ -197,16 +197,17 @@ export const SALES_REPORT_ROUTES = [ 'West-4' ]; -export const SALES_REPORT_DISTRIBUTORS = [ - 'Banashree Multi Millet Flour', - 'Shiva nandi Enterprises', - 'BPK & Co', - 'Gaviranga', - 'Bhagwan Enterprises', - 'Shreshtaa Trading Co', - 'Rajarajeshwari Enterprises', - 'Byraveshwara Trading Co' -]; +export const ROUTE_WISE_DISTRIBUTORS: Record = { + "Krishna": ["Banashree Multi Millet Flour"], + "East-1": ["Shiva nandi Enterprises"], + "East-2": ["BPK & Co"], + "East-3": ["BPK & Co"], + "East-4": ["Gaviranga "], + "West-1": ["Bhagwan Enterprises"], + "West-2": ["Shreshtaa Trading Co "], + "West-3": ["Rajarajeshwari Enterprises "], + "West-4": ["Byraveshwara Trading Co"], +}; export const SALES_REPORT_SO_NAMES = [ 'Surya C' diff --git a/src/components/buttons/Button.tsx b/src/components/buttons/Button.tsx index 44b5df6..6e7a0d7 100644 --- a/src/components/buttons/Button.tsx +++ b/src/components/buttons/Button.tsx @@ -29,7 +29,7 @@ const VARIANTS: Record = { secondary: 'bg-card text-strong border border-border-default shadow-xs', ghost: 'bg-transparent text-body border border-transparent', danger: 'bg-ruby-600 text-white border border-transparent shadow-sm', - outline: 'z-btn-outline' + outline: 'z-btn-outline border-rounded-full' }; /** diff --git a/src/components/buttons/style.css b/src/components/buttons/style.css index 9af2bfc..0ef3aaf 100644 --- a/src/components/buttons/style.css +++ b/src/components/buttons/style.css @@ -4,7 +4,7 @@ justify-content: center; gap: 6px; padding: 8px 16px; - border-radius: var(--z-border-radius-md); + border-radius: var(--z-border-radius-pill); font-size: var(--z-font-sm); font-weight: 500; font-family: inherit; diff --git a/src/components/dv/CallDetail.tsx b/src/components/dv/CallDetail.tsx index 2f57b2f..72bdc81 100644 --- a/src/components/dv/CallDetail.tsx +++ b/src/components/dv/CallDetail.tsx @@ -79,7 +79,7 @@ export function CallDetail({ if (error) { return ( -
+
); @@ -87,7 +87,7 @@ export function CallDetail({ if (loading) { return ( -
+
); @@ -353,7 +353,7 @@ export function CallDetail({
{/* 1. Primary Summary & Status Banner */} -
+
{/* Title & Badges */} @@ -436,7 +436,7 @@ export function CallDetail({ ✓
) : ( -
+
)} @@ -455,7 +455,7 @@ export function CallDetail({ ✓
) : ( -
+
)} @@ -474,7 +474,7 @@ export function CallDetail({ ✓
) : ( -
+
)} @@ -493,7 +493,7 @@ export function CallDetail({ ✓
) : ( -
+
)} @@ -517,7 +517,7 @@ export function CallDetail({ {/* Order Details Card */} {currentStateName.toLowerCase() !== 'no order' && ( -
+
@@ -617,7 +617,7 @@ export function CallDetail({ {/* Call Potential Card (Below Orders) */} {callPotentialList.length > 0 && ( -
+
@@ -697,7 +697,7 @@ export function CallDetail({ {/* Visit Log Card */} -
+
@@ -769,7 +769,7 @@ export function CallDetail({
{/* Store Banner Image Card */} -
+
{storeImages.length > 0 ? (
) : (
-
+
{storeName} @@ -792,7 +792,7 @@ export function CallDetail({
{/* Store Info Card */} -
+
@@ -857,7 +857,7 @@ export function CallDetail({ {/* Store Potential Card */} {storePotentialList.length > 0 && ( -
+
@@ -890,7 +890,7 @@ export function CallDetail({ )} {/* Distributor Card */} -
+

Distributor

@@ -921,7 +921,7 @@ export function CallDetail({
{/* Performed By Card */} -
+

Performed by

diff --git a/src/components/dv/DailyLogDetail.tsx b/src/components/dv/DailyLogDetail.tsx index 54fb45a..d8ebc78 100644 --- a/src/components/dv/DailyLogDetail.tsx +++ b/src/components/dv/DailyLogDetail.tsx @@ -128,7 +128,7 @@ export function DailyLogDetail({ instanceId, refreshKey, onPunchOut, onBack }: D
{/* Top Header Card */} -
+
{onBack && ( @@ -219,7 +219,7 @@ export function DailyLogDetail({ instanceId, refreshKey, onPunchOut, onBack }: D {/* Left Column */}
{/* Timeline */} -
+
Day Timeline
@@ -227,7 +227,7 @@ export function DailyLogDetail({ instanceId, refreshKey, onPunchOut, onBack }: D
{/* Punched In */}
-
+
@@ -238,8 +238,8 @@ export function DailyLogDetail({ instanceId, refreshKey, onPunchOut, onBack }: D {/* Day Plan */}
-
-
+
+
Day Plan Recorded
{String(dayPlanNotes)}
@@ -247,7 +247,7 @@ export function DailyLogDetail({ instanceId, refreshKey, onPunchOut, onBack }: D {/* EOD Submitted */}
-
+
@@ -262,14 +262,14 @@ export function DailyLogDetail({ instanceId, refreshKey, onPunchOut, onBack }: D {/* Notes Row */}
-
+
Day Plan Notes
{String(dayPlanNotes)}
{!isPunchedIn && ( -
+
EOD Remarks
@@ -279,7 +279,7 @@ export function DailyLogDetail({ instanceId, refreshKey, onPunchOut, onBack }: D
{/* Route Assignment */} -
+
Route Assignment
@@ -299,7 +299,7 @@ export function DailyLogDetail({ instanceId, refreshKey, onPunchOut, onBack }: D {/* Right Column */}
{/* Store Image */} -
+
Store Image
@@ -322,7 +322,7 @@ export function DailyLogDetail({ instanceId, refreshKey, onPunchOut, onBack }: D
{/* SO Card */} -
+
Sales Officer
@@ -359,7 +359,7 @@ export function DailyLogDetail({ instanceId, refreshKey, onPunchOut, onBack }: D
{/* Meta Card */} -
+
Meta
diff --git a/src/components/dv/DetailView.tsx b/src/components/dv/DetailView.tsx index e503912..13d8080 100644 --- a/src/components/dv/DetailView.tsx +++ b/src/components/dv/DetailView.tsx @@ -115,7 +115,7 @@ export function DetailView({ client, dvUid, instanceId, title, fields, columns = {key.replace(/_/g, ' ')}
- +
{headers.map(h => ( diff --git a/src/components/dv/GridTable.tsx b/src/components/dv/GridTable.tsx index dddec3b..b81226f 100644 --- a/src/components/dv/GridTable.tsx +++ b/src/components/dv/GridTable.tsx @@ -10,7 +10,7 @@ export interface GridTableProps { export function GridTable({ data, columns, onEdit, onDelete }: GridTableProps) { return ( -
+
@@ -24,7 +24,7 @@ export function GridTable({ data, columns, onEdit, onDelete }: GridTableProps) { {data.map((row, rowIdx) => ( - + {columns.map((col, colIdx) => { const val = row[col.id]; let displayVal = String(val ?? '-'); diff --git a/src/components/dv/OrderDetail.tsx b/src/components/dv/OrderDetail.tsx index 448e14e..e4e99d9 100644 --- a/src/components/dv/OrderDetail.tsx +++ b/src/components/dv/OrderDetail.tsx @@ -116,9 +116,9 @@ export function OrderDetail({ instanceId }: WiredDetailViewProps) { const totalKgs = extract('total_kgs_3', remainingData) || 0; return ( -
+
{/* Top Section */} -
+
Order ID
{String(orderId)}
@@ -143,19 +143,19 @@ export function OrderDetail({ instanceId }: WiredDetailViewProps) { {/* Middle Stats Section */}
-
+
Total Bags
{String(totalBags)}
-
+
Total Kilograms
{Number(totalKgs).toLocaleString()}
-
+
Line Items
@@ -166,7 +166,7 @@ export function OrderDetail({ instanceId }: WiredDetailViewProps) { {/* Bottom Section */}
{/* Left Table */} -
+
Order Items @@ -217,7 +217,7 @@ export function OrderDetail({ instanceId }: WiredDetailViewProps) { {/* Right Sidebar */}
{/* SO Card */} -
+
Sales Officer
@@ -253,7 +253,7 @@ export function OrderDetail({ instanceId }: WiredDetailViewProps) {
{/* Order Meta */} -
+
Order Meta
diff --git a/src/components/dv/PotentialMiningTable.tsx b/src/components/dv/PotentialMiningTable.tsx index d42b3c1..49b4c23 100644 --- a/src/components/dv/PotentialMiningTable.tsx +++ b/src/components/dv/PotentialMiningTable.tsx @@ -22,7 +22,7 @@ export interface PotentialMiningTableProps { export function PotentialMiningTable({ data, onEdit, onDelete, hideOrderDetails }: PotentialMiningTableProps) { return ( -
+
@@ -46,7 +46,7 @@ export function PotentialMiningTable({ data, onEdit, onDelete, hideOrderDetails const absDiff = Math.abs(difference); return ( - +
{item.productName} diff --git a/src/components/dv/StoreDetail.tsx b/src/components/dv/StoreDetail.tsx index e4a5e9c..646a0e1 100644 --- a/src/components/dv/StoreDetail.tsx +++ b/src/components/dv/StoreDetail.tsx @@ -183,7 +183,7 @@ export function StoreDetail({ instanceId, onBack, onEdit }: StoreDetailProps) {
{/* Hero Card */} -
+
{/* Image Section */} {imageUrl ? (
@@ -248,11 +248,11 @@ export function StoreDetail({ instanceId, onBack, onEdit }: StoreDetailProps) { {/* Contact Card */} -
+

Contact

-
+
@@ -296,11 +296,11 @@ export function StoreDetail({ instanceId, onBack, onEdit }: StoreDetailProps) { {/* Route Assignment Card */} -
+

Route Assignment

-
+
Route
{routeName ? String(routeName) : '-'}
@@ -321,11 +321,11 @@ export function StoreDetail({ instanceId, onBack, onEdit }: StoreDetailProps) { {/* Order Potential Card */} {Array.isArray(potential) && potential.length > 0 && ( -
+

Order Potential

-
+
@@ -355,18 +355,18 @@ export function StoreDetail({ instanceId, onBack, onEdit }: StoreDetailProps) { {/* Distributor Card */} -
+

Distributor

-
+
{distributorName ? String(distributorName) : '-'}
Owner · {distributorOwnerName ? String(distributorOwnerName) : '-'}
-
+
@@ -375,7 +375,7 @@ export function StoreDetail({ instanceId, onBack, onEdit }: StoreDetailProps) {
-
+
@@ -395,7 +395,7 @@ export function StoreDetail({ instanceId, onBack, onEdit }: StoreDetailProps) { {/* Location Map */} -
+

Location

@@ -412,7 +412,7 @@ export function StoreDetail({ instanceId, onBack, onEdit }: StoreDetailProps) { src={`https://maps.google.com/maps?q=${lat},${lng}&hl=en&z=15&output=embed`} >
window.open(`https://maps.google.com/maps?q=${lat},${lng}`, '_blank')} > @@ -426,7 +426,7 @@ export function StoreDetail({ instanceId, onBack, onEdit }: StoreDetailProps) { )}
{lat && lng && ( -
+
Tap map icon to open in Google Maps.
)} @@ -434,11 +434,11 @@ export function StoreDetail({ instanceId, onBack, onEdit }: StoreDetailProps) { {/* Meta */} -
+

Meta

-
+
Store Code {String(storeCode)} diff --git a/src/components/forms/fields/OrderGrid.tsx b/src/components/forms/fields/OrderGrid.tsx index 3822870..95639b7 100644 --- a/src/components/forms/fields/OrderGrid.tsx +++ b/src/components/forms/fields/OrderGrid.tsx @@ -296,7 +296,7 @@ export function OrderGrid({ const displayTotalKgs = totalKgsValue !== undefined ? totalKgsValue : calculatedKgs; return ( -
+

{label || 'Order details'} diff --git a/src/components/forms/fields/PotentialMiningGrid.tsx b/src/components/forms/fields/PotentialMiningGrid.tsx index 2985f65..68ee2ab 100644 --- a/src/components/forms/fields/PotentialMiningGrid.tsx +++ b/src/components/forms/fields/PotentialMiningGrid.tsx @@ -73,7 +73,7 @@ export function PotentialMiningGrid({ }, [rows, columns, onChange]); return ( -

+

{label || 'Potential Mining'} @@ -172,6 +172,7 @@ export function PotentialMiningGrid({ disabled={isReadOnly} value={String(row[fieldId] ?? '')} onChange={(e) => updateRowField(rowIdx, fieldId, e.target.value)} + placeholder={col.name ? `Enter ${col.name.toLowerCase()}...` : 'Enter details...'} className="w-full" /> ); diff --git a/src/components/forms/fields/StorePotentialGrid.tsx b/src/components/forms/fields/StorePotentialGrid.tsx index a9045da..fa8f47f 100644 --- a/src/components/forms/fields/StorePotentialGrid.tsx +++ b/src/components/forms/fields/StorePotentialGrid.tsx @@ -139,7 +139,7 @@ export function StorePotentialGrid({ }, [rows, columns, onChange]); return ( -

+

{label || 'Store Potential'} diff --git a/src/components/reusable/AnalyticsChart.tsx b/src/components/reusable/AnalyticsChart.tsx index 812da64..ef5ab64 100644 --- a/src/components/reusable/AnalyticsChart.tsx +++ b/src/components/reusable/AnalyticsChart.tsx @@ -93,6 +93,16 @@ export function AnalyticsChart({ data }: AnalyticsChartProps) { const renderChartContent = () => { return ( <> + + + + + + + + + + ); } else { + const barFill = i === 0 ? `url(#barGradient-${idx}-0)` : (i === 1 ? `url(#barGradient-${idx}-1)` : color); return ( @@ -159,7 +170,7 @@ export function AnalyticsChart({ data }: AnalyticsChartProps) { }; return ( - +

{chartType === 5 ? (
diff --git a/src/components/reusable/Pagination.tsx b/src/components/reusable/Pagination.tsx index 7891cd4..1ef58c6 100644 --- a/src/components/reusable/Pagination.tsx +++ b/src/components/reusable/Pagination.tsx @@ -74,14 +74,14 @@ export function Pagination({ page, pageSize, total, onPage, onPageSizeChange }:
- {safePage} / {totalPages} - diff --git a/src/components/reusable/StatsTiles.tsx b/src/components/reusable/StatsTiles.tsx index e0f9f1b..d1c2301 100644 --- a/src/components/reusable/StatsTiles.tsx +++ b/src/components/reusable/StatsTiles.tsx @@ -1,4 +1,4 @@ -import { Phone, TrendingUp, Activity, BarChart2, ShoppingCart, ShoppingBag, Scale } from 'lucide-react'; +import { Phone, TrendingUp, Activity, BarChart2, ShoppingCart, ShoppingBag, Scale } from 'lucide-react'; import type { TileItem } from "../../api/types"; export interface StatsTilesProps { @@ -49,12 +49,11 @@ export function StatsTiles({ tiles }: StatsTilesProps) { return (
- + {displayLabel}
@@ -62,9 +61,8 @@ export function StatsTiles({ tiles }: StatsTilesProps) {
-

+

{(tile.value as React.ReactNode) ?? "-"}

diff --git a/src/components/rv/RecordView.tsx b/src/components/rv/RecordView.tsx index 1476101..e3f50a3 100644 --- a/src/components/rv/RecordView.tsx +++ b/src/components/rv/RecordView.tsx @@ -161,6 +161,7 @@ export function RecordView({ title={title} action={headerActions} pad={false} + className="!bg-[var(--z-rv-table-header)]" >
@@ -241,13 +242,13 @@ export function RecordView({ {fields.map((f) => (
))} {rowActions && ( - )} diff --git a/src/screens/ConsoleLayout.tsx b/src/screens/ConsoleLayout.tsx index 6700e14..6e53bbb 100644 --- a/src/screens/ConsoleLayout.tsx +++ b/src/screens/ConsoleLayout.tsx @@ -29,12 +29,12 @@ export function ConsoleLayout() { if (!authed) return ; return ( -
+
Krishna Sales
-
{f.output_label} + Actions