Files
LogiFlow/attached_assets/Pasted--ordersCount-32-deliveriesCount-37-pendingOrdersCount-24-averageDelivery-1757343526354_1757343526354.txt
T
michaelschal 731eb145dd Fix issues with the credits module by improving client-side debugging and database schema
Add client-side debugging scripts for JavaScript errors and unhandled promise rejections to aid in troubleshooting the credits module. Correct the production database schema for the 'avoirs' table by making 'invoice_reference' and 'amount' columns nullable, and include a test insertion to verify the fix.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869
Replit-Commit-Checkpoint-Type: intermediate_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/9fcf4b21-eb0c-4e53-a567-e2ce4a6ad869/mpVybiP
2025-09-08 14:59:42 +00:00

202 lines
3.8 KiB
Plaintext

ordersCount: 32,
deliveriesCount: 37,
pendingOrdersCount: 24,
averageDeliveryTime: '5.7272727272727275 jours (commande → livraison, livraisons avec commande liée uniquement)',
totalPalettes: 3009,
totalPackages: 11
}
📋 PUBLICITIES RETURNED: { count: 29 }
GET /api/stats/monthly 304 in 571ms
GET /api/publicities 304 in 60ms
🔍 [PRODUCTION] Raw messages from DB: 2 items: [
{
id: 16,
title: 'Mise à jour Prix',
content: 'Merci de mettre vos prix a jour tous les matins, certain magasin ne le font pas.',
type: 'success',
storeId: null,
createdBy: 'admin',
createdAt: 2025-08-18T10:45:08.585Z
},
{
id: 8,
title: 'Bon de Livraison',
content: 'Lorsque vous rentrez un numéro de bon de livraison, faite le a l identique, même les majuscules. Pour My candy Shop, prendre le numéro de commande.',
type: 'info',
storeId: null,
createdBy: 'admin_local',
createdAt: 2025-08-07T11:04:38.123Z
}
]
🔍 [PRODUCTION] Looking for user with username: admin
🔍 [PRODUCTION] Looking for user with username: admin_local
🔍 [PRODUCTION] User search result: Not found
❌ [PRODUCTION] User not found with username: admin_local
🔍 [PRODUCTION] User search result: Found
🎯 [PRODUCTION] Found announcements: 2
GET /api/announcements 304 in 97ms
GET /api/user 304 in 11ms
Deliveries API called with: {
startDate: undefined,
endDate: undefined,
storeId: '1',
withBL: undefined,
userRole: 'admin'
}
🔍 Admin deliveries filtering by store: { storeId: '1', groupIds: [ 1 ], role: 'admin' }
Fetching all deliveries
Orders API called with: {
startDate: undefined,
endDate: undefined,
storeId: '1',
userRole: 'admin'
}
🔍 Admin orders filtering by store: { storeId: '1', groupIds: [ 1 ], role: 'admin' }
Fetching all orders
📢 [SERVER] Fetching announcements for user: admin_local environment: production
📢 [SERVER] User found: { username: 'admin', role: 'admin' }
🎯 [PRODUCTION] Using PostgreSQL DASHBOARD_MESSAGES table
🔍 [PRODUCTION] Raw messages from DB: 2 items: [
{
id: 16,
title: 'Mise à jour Prix',
content: 'Merci de mettre vos prix a jour tous les matins, certain magasin ne le font pas.',
type: 'success',
storeId: null,
createdBy: 'admin',
createdAt: 2025-08-18T10:45:08.585Z
},
{
id: 8,
title: 'Bon de Livraison',
content: 'Lorsque vous rentrez un numéro de bon de livraison, faite le a l identique, même les majuscules. Pour My candy Shop, prendre le numéro de commande.',
type: 'info',
storeId: null,
createdBy: 'admin_local',
createdAt: 2025-08-07T11:04:38.123Z
}
]
🔍 [PRODUCTION] Looking for user with username: admin
🔍 [PRODUCTION] Looking for user with username: admin_local
Customer Orders API called with: { groupIds: [ 1 ], userRole: 'admin' }
🔍 [PRODUCTION] User search result: Found
🔍 [PRODUCTION] User search result: Not found
❌ [PRODUCTION] User not found with username: admin_local
🎯 [PRODUCTION] Found announcements: 2
GET /api/announcements 304 in 18ms
Customer Orders returned: 11 items
GET /api/customer-orders 304 in 25ms
🔗 PRODUCTION: getDeliveries() récupéré 82 livraisons avec relations
Deliveries returned: 82 items
GET /api/deliveries 304 in 161ms
GET /api/groups 304 in 103ms
🔗 PRODUCTION: getOrders() récupéré 64 commandes avec relations
Orders returned: 64 items
GET /api/orders 304 in 217ms
GET /api/user 304 in 5ms
🔍 Avoirs API called with: { groupIds: undefined, userRole: 'admin' }
GET /api/suppliers 304 in 8ms
📋 Avoirs returned: 1 items
GET /api/avoirs 304 in 14ms