fix: selfpayMode state vars + monolith.sh TPV port + closures report
- Add missing selfpayMode/closePin state vars in admin POS page - Add selfpayMode/closeSessionRequiresPin/closeSessionPin to PosTerminal interface - Fix ClosedSession type in reporting/closures to match cash-close endpoint - Add smtpReportEmail to admin StoreSettings interface - monolith.sh: add TPV service (port 3002), reorder ports: API 3000, ADMIN 3001, TPV 3002, FRONTEND 3003, STOREFRONT 3004 - Add apps/pos to install_dependencies in monolith.sh
This commit is contained in:
@@ -3,6 +3,16 @@
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { api } from '@/lib/api-client';
|
||||
|
||||
interface SalesSummary {
|
||||
totalCount: number;
|
||||
completedCount: number;
|
||||
completedTotalCents: number;
|
||||
pendingCount: number;
|
||||
refundedCount: number;
|
||||
refundedTotalCents: number;
|
||||
byState: Record<string, { count: number; totalCents: number }>;
|
||||
}
|
||||
|
||||
interface ClosedSession {
|
||||
id: string;
|
||||
openedAt: string;
|
||||
@@ -13,12 +23,9 @@ interface ClosedSession {
|
||||
closingCashCents: number | null;
|
||||
actualCashCents: number | null;
|
||||
differenceCents: number | null;
|
||||
salesCount: number;
|
||||
salesTotalCents: number;
|
||||
salesByState: Record<string, { count: number; totalCents: number }>;
|
||||
sales: SalesSummary;
|
||||
paymentsByMethod: Array<{ methodCode: string; methodName: string; totalCents: number; count: number }>;
|
||||
itemsSold: number;
|
||||
uniqueProductsSold: number;
|
||||
items: { soldCount: number; uniqueProducts: number };
|
||||
}
|
||||
|
||||
function fmt(cents: number): string {
|
||||
@@ -240,11 +247,11 @@ export default function ReportingClosuresPage() {
|
||||
))}
|
||||
<div>
|
||||
<p className="text-xs text-gray-500">Artículos vendidos</p>
|
||||
<p className="text-lg font-bold text-gray-900">{report.itemsSold}</p>
|
||||
<p className="text-lg font-bold text-gray-900">{report.items.soldCount}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p className="text-xs text-gray-500">Productos únicos</p>
|
||||
<p className="text-lg font-bold text-gray-900">{report.uniqueProductsSold}</p>
|
||||
<p className="text-lg font-bold text-gray-900">{report.items.uniqueProducts}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user