mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-11 17:29:48 +02:00
Improve data display and correct date filtering in sales registry
Adds photo debug information and fixes date range filtering in the sales query using timestamps in `SaleDetailsModal.tsx` and `server/storage.ts`. Replit-Commit-Author: Agent Replit-Commit-Session-Id: dec54137-d5a2-4406-8ad4-5f2f9fb110bf Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/584bf76b-cd3a-45fb-a667-85c62de7fd5e.jpg
This commit is contained in:
1 parent
bfdb9cf1fa
commit
181945d6f5
2 files changed
+16
-2
No files matched your search
@@ -86,6 +86,16 @@ export default function SaleDetailsModal({ isOpen, sale, onClose }: SaleDetailsM
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Photos - Debug */}
|
||||
<div className="mobile-form-section border-l-4 border-red-500 pl-4 mb-4">
|
||||
<h4 className="responsive-subtitle text-gray-900 mb-3">Debug Photos</h4>
|
||||
<div className="text-xs">
|
||||
<div>photo_recto: {sale.photo_recto ? 'EXISTE' : 'NULL'}</div>
|
||||
<div>photo_verso: {sale.photo_verso ? 'EXISTE' : 'NULL'}</div>
|
||||
<div>photo_ticket: {sale.photo_ticket ? 'EXISTE' : 'NULL'}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Photos */}
|
||||
{(sale.photo_recto || sale.photo_verso || sale.photo_ticket) && (
|
||||
<div className="mobile-form-section border-l-4 border-purple-500 pl-4">
|
||||
|
||||
+6
-2
@@ -148,11 +148,15 @@ export class DatabaseStorage implements IStorage {
|
||||
let query = db.select().from(sales).where(eq(sales.storeId, storeId));
|
||||
|
||||
if (startDate && endDate) {
|
||||
// Convert dates to timestamp format for comparison
|
||||
const startTimestamp = new Date(startDate + 'T00:00:00').toISOString();
|
||||
const endTimestamp = new Date(endDate + 'T23:59:59').toISOString();
|
||||
|
||||
query = db.select().from(sales).where(
|
||||
and(
|
||||
eq(sales.storeId, storeId),
|
||||
gte(sales.dateVente, startDate),
|
||||
lte(sales.dateVente, endDate)
|
||||
gte(sales.timestamp, startTimestamp),
|
||||
lte(sales.timestamp, endTimestamp)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user