Fix dashoard issues #85

Merged
DeepnaPooja merged 9 commits from dev into production 2026-10-22 10:55:42 +05:30
3 changed files with 11 additions and 0 deletions
Showing only changes of commit 2c39b34c5f - Show all commits
@@ -179,6 +179,7 @@ export default function InvoiceViewPage() {
<div className="grid grid-cols-2 gap-4 rounded-2xl border p-4 sm:grid-cols-4">
<Stat label="Total" value={fmtAmount(invoice.totalAmount)} />
{invoice.discountAmount > 0 && <Stat label="Scheme discount (included)" value={fmtAmount(invoice.discountAmount)} />}
<Stat label="Paid" value={fmtAmount(paidAmount)} />
<Stat label="Balance" value={fmtAmount(balance)} />
<Stat label="Created" value={fmtDateTime(invoice.createdAt)} />
+9
View File
@@ -163,6 +163,7 @@ export const productReports = {
export interface SalesKpis {
grossSales: number
returnValue: number
discounts: number
netSales: number
orders: number
averageOrderValue: number
@@ -170,11 +171,19 @@ export interface SalesKpis {
grossProfitMarginPercent: number | null
}
export interface CashKpis {
collected: number
outstanding: number
overdue: number
collectionRatePercent: number | null
}
export interface DashboardSalesSummary {
from: string
to: string
granularity: 'day' | 'month'
kpis: { current: SalesKpis; previous: SalesKpis; previousFrom: string; previousTo: string }
cash: { current: CashKpis; previous: CashKpis }
trend: Array<{ period: string; sales: number; returns: number }>
byCategory: Array<{ id: string | null; name: string; amount: number }>
byRegion: Array<{ id: string | null; name: string; amount: number }>
+1
View File
@@ -1045,6 +1045,7 @@ export interface InvoiceResponse {
finalizedAt: string | null
finalizedBy: string | null
totalAmount: number
discountAmount: number
paidAmount: number
isActive: boolean
createdAt: string