Browse Source

client

28062025_02
Stephane 4 months ago
parent
commit
13296529c3
  1. 22
      lib/Services/stock_managementDatabase.dart
  2. 1510
      lib/Views/historique.dart
  3. 2
      lib/config/DatabaseConfig.dart

22
lib/Services/stock_managementDatabase.dart

@ -806,24 +806,12 @@ class AppDatabase {
Future<List<Commande>> getCommandes() async {
final db = await database;
final result = await db.query('''
SELECT
c.*,
cl.nom as clientNom,
cl.prenom as clientPrenom,
cl.email as clientEmail,
u.nom as commandeurNom,
u.prenom as commandeurPrenom,
pdv.nom as pointDeVenteNom,
pdv.id as pointDeVenteId
FROM commandes c
LEFT JOIN clients cl ON c.clientId = cl.id
LEFT JOIN users u ON c.commandeurId = u.id
LEFT JOIN points_de_vente pdv ON u.point_de_vente_id = pdv.id
ORDER BY c.dateCommande DESC
''');
SELECT c.*, cl.nom as clientNom, cl.prenom as clientPrenom, cl.email as clientEmail
FROM commandes c
LEFT JOIN clients cl ON c.clientId = cl.id
ORDER BY c.dateCommande DESC
''');
return result.map((row) => Commande.fromMap(row.fields)).toList();
}

1510
lib/Views/historique.dart

File diff suppressed because it is too large

2
lib/config/DatabaseConfig.dart

@ -11,7 +11,7 @@ class DatabaseConfig {
static const String localDatabase = 'guycom';
// Production (public) MySQL settings
static const String prodHost = '185.70.105.157';
static const String prodHost = '102.17.52.31';
static const String prodUsername = 'guycom';
static const String prodPassword = '3iV59wjRdbuXAPR';
static const String prodDatabase = 'guycom';

Loading…
Cancel
Save