Fix dashoard issues #85
@@ -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)} />
|
||||
|
||||
@@ -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 }>
|
||||
|
||||
@@ -1045,6 +1045,7 @@ export interface InvoiceResponse {
|
||||
finalizedAt: string | null
|
||||
finalizedBy: string | null
|
||||
totalAmount: number
|
||||
discountAmount: number
|
||||
paidAmount: number
|
||||
isActive: boolean
|
||||
createdAt: string
|
||||
|
||||
Reference in New Issue
Block a user