From 63e51d8c5f1ca7c110263d740d2af951283a4f7f Mon Sep 17 00:00:00 2001 From: venba-Inspriron-3558 Date: Fri, 27 Jun 2025 13:01:23 +0530 Subject: [PATCH] minor issues fixes 8 --- lib/Screens/allTrips/list_all_plans.dart | 116 +++++- lib/Screens/approvals/approval_list.dart | 345 ++++++++++++++++-- lib/Screens/plans/list_plans.dart | 117 +++++- lib/Screens/reports/advancePurchase.dart | 20 +- lib/Screens/reports/guestHouse.dart | 22 +- lib/Screens/reports/misAir.dart | 20 +- lib/Screens/reports/misForex.dart | 6 +- lib/Screens/reports/misHotel.dart | 20 +- lib/Screens/reports/servicesAnalysis.dart | 8 +- .../listTravelAgent.dart | 4 + lib/Screens/userManagement/user_List.dart | 76 +++- lib/widgets/popup_travelAgentList_action.dart | 38 +- lib/widgets/popup_userList_action.dart | 38 +- 13 files changed, 684 insertions(+), 146 deletions(-) diff --git a/lib/Screens/allTrips/list_all_plans.dart b/lib/Screens/allTrips/list_all_plans.dart index 75c0342..b5418a4 100644 --- a/lib/Screens/allTrips/list_all_plans.dart +++ b/lib/Screens/allTrips/list_all_plans.dart @@ -46,6 +46,7 @@ class _ListAllPlansState extends State { List allPlans = []; List filteredPlans = []; TextEditingController searchController = TextEditingController(); + late bool _listDialogShown = false; @override void initState() { @@ -289,6 +290,109 @@ class _ListAllPlansState extends State { } } + Future _showDetails(id) async { + _listDialogShown = true; + final String apiUrldata = '$apiUrl/api/plans/get_plan_approval_status?plan_id=$id'; + final String? token = await getToken(); + String label = ""; + List> approverData = []; + + if (token == null) { + print('Token not found. Please log in.'); + label = "Error - Token not found"; + } else { + try { + final response = await http.get( + Uri.parse(apiUrldata), + headers: { + 'Authorization': 'Bearer $token', + 'Content-Type': 'application/json', + }, + ); + + if (response.statusCode == 200) { + final data = json.decode(response.body); + label = data['data']['model_heading'] ?? ""; + approverData = List>.from(data['data']['approver_data'] ?? []); + } else { + print('Failed to load'); + label = "Error - Failed to load data"; + } + } catch (e) { + print('Exception occurred: $e'); + label = "Error - Something went wrong"; + } + } + + showDialog( + context: context, + builder: (context) => AlertDialog( + title: Text( + label, + style: GoogleFonts.poppins( + fontSize: 18, + fontWeight: FontWeight.w600, + color: Colors.black, + ), + overflow: TextOverflow.ellipsis, + ), + content: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + if (approverData.isNotEmpty) + SizedBox( + height: 250, + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: SingleChildScrollView( + scrollDirection: Axis.vertical, + child: DataTable( + columns: [ + // DataColumn(label: Text('S.No', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))), + // DataColumn(label: Text('Approver ID', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))), + DataColumn(label: Text('Status', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))), + ], + rows: approverData.asMap().entries.map((entry) { + final index = entry.key + 1; + final item = entry.value; + + final approverIdKey = item.keys.firstWhere((k) => k.endsWith('_id'), orElse: () => ''); + final statusKey = item.keys.firstWhere((k) => k.endsWith('_status'), orElse: () => ''); + + final approverId = item[approverIdKey]?.toString() ?? '-'; + final statusText = item[statusKey]?.toString() ?? 'Unknown'; + + return DataRow( + cells: [ + // DataCell(Text('$index')), + // DataCell(SizedBox(width: 120, child: Text(approverId, overflow: TextOverflow.ellipsis))), + DataCell(SizedBox(child: Text(statusText, overflow: TextOverflow.ellipsis))), + ], + ); + }).toList(), + ), + ), + ), + ) + else + Text("-- no data. --", style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w300)), + ], + ), + ), + actions: [ + TextButton( + onPressed: () { + Navigator.pop(context); + _listDialogShown = false; + }, + child: Text("Close"), + ), + ], + ), + ); + } + Widget build(BuildContext context) { return ResponsiveBuilder( builder: (context, sizingInfo) { @@ -830,7 +934,9 @@ class _ListAllPlansState extends State { ), ), ), - DataCell( + DataCell(GestureDetector( + onTap: () => _showDetails(plan.planId), + child: Container( width: double @@ -857,7 +963,7 @@ class _ListAllPlansState extends State { fontWeight: FontWeight.w400, ), ), - ), + ),), ), DataCell( Row( @@ -1050,7 +1156,9 @@ class _ListAllPlansState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [GestureDetector( + onTap: () => _showDetails(plan.planId), + child: Container( padding: EdgeInsets.symmetric( horizontal: 8, @@ -1074,7 +1182,7 @@ class _ListAllPlansState extends State { fontWeight: FontWeight.w600, ), ), - ), + ),), ], ), Column( diff --git a/lib/Screens/approvals/approval_list.dart b/lib/Screens/approvals/approval_list.dart index dfe2ec1..f780837 100644 --- a/lib/Screens/approvals/approval_list.dart +++ b/lib/Screens/approvals/approval_list.dart @@ -43,6 +43,9 @@ class _ApprovalListState extends State { List filteredPlans = []; TextEditingController searchController = TextEditingController(); + late bool _dialogShown = false; + Map successList = {}; + @override void initState() { super.initState(); @@ -374,6 +377,242 @@ class _ApprovalListState extends State { print("filteredPlans: $filteredPlans"); } + // Future _showDetails(Id) async { + // _dialogShown = true; + // final String apiUrldata = '$apiUrl/api/plans/get_plan_approval_status?plan_id=$Id'; + // final String? token = await getToken(); + // + // if (token == null) { + // print('Token not found. Please log in.'); + // successList = { + // "model_heading": "Error - Token not found", + // "approver_data": [], + // }; + // } else { + // try { + // final response = await http.get( + // Uri.parse(apiUrldata), + // headers: { + // 'Authorization': 'Bearer $token', + // 'Content-Type': 'application/json', + // }, + // ); + // + // if (response.statusCode == 200) { + // final data = json.decode(response.body); + // print(data['data']); + // successList = data['data']; + // } else { + // print('Failed to load'); + // successList = { + // "model_heading": "Error - Failed to load data", + // "approver_data": [], + // }; + // } + // } catch (e) { + // print('Exception occurred: $e'); + // successList = { + // "model_heading": "Error - Something went wrong", + // "approver_data": [], + // }; + // } + // } + // + // showDialog( + // context: context, + // builder: (context) => AlertDialog( + // title: Text( + // successList["model_heading"] ?? '', + // style: GoogleFonts.poppins( + // fontSize: 18, + // fontWeight: FontWeight.w600, + // color: Colors.black, + // ), + // overflow: TextOverflow.ellipsis, + // ), + // content: SingleChildScrollView( + // child: Column( + // mainAxisSize: MainAxisSize.min, + // children: [ + // // Text( + // // successList["Trip Title"] ?? '', + // // style: TextStyle(fontWeight: FontWeight.bold), + // // ), + // const SizedBox(height: 8), + // (successList["approver_data"] != null && successList["approver_data"].isNotEmpty) + // ? SizedBox( + // height: 250, + // child: SingleChildScrollView( + // scrollDirection: Axis.horizontal, + // child: SingleChildScrollView( + // scrollDirection: Axis.vertical, + // child: DataTable( + // columns: [ + // DataColumn(label: Text('S.No', style: GoogleFonts.poppins( + // fontSize: 14, fontWeight: FontWeight.w600, color: Colors.black, + // ))), + // DataColumn(label: Text('ID', style: GoogleFonts.poppins( + // fontSize: 14, fontWeight: FontWeight.w600, color: Colors.black, + // ))), + // DataColumn(label: Text('Reason', style: GoogleFonts.poppins( + // fontSize: 14, fontWeight: FontWeight.w600, color: Colors.black, + // ))), + // ], + // rows: successList["approver_data"].asMap().entries.map((entry) { + // final index = entry.key + 1; + // final rawData = entry.value['a1_id']; + // final data = (rawData == null || rawData.toString().trim().isEmpty) ? '-' : rawData.toString(); + // final reason = entry.value['a1_status'] ?? 'Unknown'; + // + // return DataRow( + // cells: [ + // DataCell(Text('$index', style: GoogleFonts.poppins( + // fontSize: 14, fontWeight: FontWeight.w400, color: Colors.black, + // ))), + // DataCell(SizedBox( + // width: 180, + // child: Text(data, style: GoogleFonts.poppins( + // fontSize: 14, fontWeight: FontWeight.w400, color: Colors.black, + // ), overflow: TextOverflow.ellipsis), + // )), + // DataCell(SizedBox( + // width: 280, + // child: Text(reason, style: GoogleFonts.poppins( + // fontSize: 14, fontWeight: FontWeight.w400, color: Colors.black, + // ), overflow: TextOverflow.ellipsis), + // )), + // ], + // ); + // }).toList(), + // ), + // ), + // ), + // ) + // : Text("-- no data. --", style: GoogleFonts.poppins( + // fontSize: 14, fontWeight: FontWeight.w200, color: Colors.black, + // )), + // ], + // ), + // ), + // actions: [ + // TextButton( + // onPressed: () { + // Navigator.pop(context); + // _dialogShown = false; + // }, + // child: Text("Close"), + // ), + // ], + // ), + // ); + // } + + Future _showDetails(id) async { + _dialogShown = true; + final String apiUrldata = '$apiUrl/api/plans/get_plan_approval_status?plan_id=$id'; + final String? token = await getToken(); + String label = ""; + List> approverData = []; + + if (token == null) { + print('Token not found. Please log in.'); + label = "Error - Token not found"; + } else { + try { + final response = await http.get( + Uri.parse(apiUrldata), + headers: { + 'Authorization': 'Bearer $token', + 'Content-Type': 'application/json', + }, + ); + + if (response.statusCode == 200) { + final data = json.decode(response.body); + label = data['data']['model_heading'] ?? ""; + approverData = List>.from(data['data']['approver_data'] ?? []); + } else { + print('Failed to load'); + label = "Error - Failed to load data"; + } + } catch (e) { + print('Exception occurred: $e'); + label = "Error - Something went wrong"; + } + } + + showDialog( + context: context, + builder: (context) => AlertDialog( + title: Text( + label, + style: GoogleFonts.poppins( + fontSize: 18, + fontWeight: FontWeight.w600, + color: Colors.black, + ), + overflow: TextOverflow.ellipsis, + ), + content: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + if (approverData.isNotEmpty) + SizedBox( + height: 250, + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: SingleChildScrollView( + scrollDirection: Axis.vertical, + child: DataTable( + columns: [ + // DataColumn(label: Text('S.No', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))), + // DataColumn(label: Text('Approver ID', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))), + DataColumn(label: Text('Status', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))), + ], + rows: approverData.asMap().entries.map((entry) { + final index = entry.key + 1; + final item = entry.value; + + final approverIdKey = item.keys.firstWhere((k) => k.endsWith('_id'), orElse: () => ''); + final statusKey = item.keys.firstWhere((k) => k.endsWith('_status'), orElse: () => ''); + + final approverId = item[approverIdKey]?.toString() ?? '-'; + final statusText = item[statusKey]?.toString() ?? 'Unknown'; + + return DataRow( + cells: [ + // DataCell(Text('$index')), + // DataCell(SizedBox(width: 120, child: Text(approverId, overflow: TextOverflow.ellipsis))), + DataCell(SizedBox(child: Text(statusText, overflow: TextOverflow.ellipsis))), + ], + ); + }).toList(), + ), + ), + ), + ) + else + Text("-- no data. --", style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w300)), + ], + ), + ), + actions: [ + TextButton( + onPressed: () { + Navigator.pop(context); + _dialogShown = false; + }, + child: Text("Close"), + ), + ], + ), + ); + } + + + + Widget build(BuildContext context) { return ResponsiveBuilder( builder: (context, sizingInfo) { @@ -864,37 +1103,60 @@ class _ApprovalListState extends State { ), ), ), + // DataCell( + // Container( + // width: + // double + // .infinity, // Set your desired fixed size (equal width and height) + // height: 25, + // alignment: Alignment.center, + // decoration: BoxDecoration( + // color: getStatusColor( + // plan.statusValue, + // ), + // borderRadius: BorderRadius.circular( + // 8, + // ), + // ), + // + // child: Text( + // plan.statusValue, + // textAlign: TextAlign.center, + // style: TextStyle( + // color: getStatusTextColor( + // plan.statusValue, + // ), + // fontSize: 12, + // fontFamily: "Inter", + // fontWeight: FontWeight.w400, + // ), + // ), + // ), + // ), DataCell( - Container( - width: - double - .infinity, // Set your desired fixed size (equal width and height) - height: 25, - alignment: Alignment.center, - decoration: BoxDecoration( - color: getStatusColor( + GestureDetector( + onTap: () => _showDetails(plan.planId), + child: Container( + width: double.infinity, + height: 25, + alignment: Alignment.center, + decoration: BoxDecoration( + color: getStatusColor(plan.statusValue), + borderRadius: BorderRadius.circular(8), + ), + child: Text( plan.statusValue, - ), - borderRadius: BorderRadius.circular( - 8, - ), - ), - - child: Text( - plan.statusValue, - textAlign: TextAlign.center, - style: TextStyle( - color: getStatusTextColor( - plan.statusValue, + textAlign: TextAlign.center, + style: TextStyle( + color: getStatusTextColor(plan.statusValue), + fontSize: 12, + fontFamily: "Inter", + fontWeight: FontWeight.w400, ), - fontSize: 12, - fontFamily: "Inter", - fontWeight: FontWeight.w400, ), ), ), ), - DataCell( Row( children: [ @@ -1145,23 +1407,26 @@ class _ApprovalListState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - padding: EdgeInsets.symmetric( - horizontal: 8, - vertical: 4, - ), - decoration: BoxDecoration( - color: getStatusColor(plan.statusValue), - borderRadius: BorderRadius.circular(8), - ), - child: Text( - plan.statusValue, - style: TextStyle( - color: getStatusTextColor( - plan.statusValue, + GestureDetector( + onTap: () => _showDetails(plan.planId), + child: Container( + padding: EdgeInsets.symmetric( + horizontal: 8, + vertical: 4, + ), + decoration: BoxDecoration( + color: getStatusColor(plan.statusValue), + borderRadius: BorderRadius.circular(8), + ), + child: Text( + plan.statusValue, + style: TextStyle( + color: getStatusTextColor( + plan.statusValue, + ), + fontSize: 10, + fontWeight: FontWeight.w600, ), - fontSize: 10, - fontWeight: FontWeight.w600, ), ), ), diff --git a/lib/Screens/plans/list_plans.dart b/lib/Screens/plans/list_plans.dart index f0b38e1..839be5c 100644 --- a/lib/Screens/plans/list_plans.dart +++ b/lib/Screens/plans/list_plans.dart @@ -52,6 +52,7 @@ class _ListPlansState extends State { String? location; late bool _dialogShown = false; + late bool _listDialogShown = false; late StreamSubscription _popStateListener; @override @@ -421,6 +422,109 @@ class _ListPlansState extends State { } } + Future _showDetails(id) async { + _listDialogShown = true; + final String apiUrldata = '$apiUrl/api/plans/get_plan_approval_status?plan_id=$id'; + final String? token = await getToken(); + String label = ""; + List> approverData = []; + + if (token == null) { + print('Token not found. Please log in.'); + label = "Error - Token not found"; + } else { + try { + final response = await http.get( + Uri.parse(apiUrldata), + headers: { + 'Authorization': 'Bearer $token', + 'Content-Type': 'application/json', + }, + ); + + if (response.statusCode == 200) { + final data = json.decode(response.body); + label = data['data']['model_heading'] ?? ""; + approverData = List>.from(data['data']['approver_data'] ?? []); + } else { + print('Failed to load'); + label = "Error - Failed to load data"; + } + } catch (e) { + print('Exception occurred: $e'); + label = "Error - Something went wrong"; + } + } + + showDialog( + context: context, + builder: (context) => AlertDialog( + title: Text( + label, + style: GoogleFonts.poppins( + fontSize: 18, + fontWeight: FontWeight.w600, + color: Colors.black, + ), + overflow: TextOverflow.ellipsis, + ), + content: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + if (approverData.isNotEmpty) + SizedBox( + height: 250, + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: SingleChildScrollView( + scrollDirection: Axis.vertical, + child: DataTable( + columns: [ + // DataColumn(label: Text('S.No', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))), + // DataColumn(label: Text('Approver ID', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))), + DataColumn(label: Text('Status', style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w600))), + ], + rows: approverData.asMap().entries.map((entry) { + final index = entry.key + 1; + final item = entry.value; + + final approverIdKey = item.keys.firstWhere((k) => k.endsWith('_id'), orElse: () => ''); + final statusKey = item.keys.firstWhere((k) => k.endsWith('_status'), orElse: () => ''); + + final approverId = item[approverIdKey]?.toString() ?? '-'; + final statusText = item[statusKey]?.toString() ?? 'Unknown'; + + return DataRow( + cells: [ + // DataCell(Text('$index')), + // DataCell(SizedBox(width: 120, child: Text(approverId, overflow: TextOverflow.ellipsis))), + DataCell(SizedBox(child: Text(statusText, overflow: TextOverflow.ellipsis))), + ], + ); + }).toList(), + ), + ), + ), + ) + else + Text("-- no data. --", style: GoogleFonts.poppins(fontSize: 14, fontWeight: FontWeight.w300)), + ], + ), + ), + actions: [ + TextButton( + onPressed: () { + Navigator.pop(context); + _listDialogShown = false; + }, + child: Text("Close"), + ), + ], + ), + ); + } + Widget build(BuildContext context) { return ResponsiveBuilder( builder: (context, sizingInfo) { @@ -962,7 +1066,10 @@ class _ListPlansState extends State { ), ), DataCell( - Container( + GestureDetector( + onTap: () => _showDetails(plan.planId), + child: + Container( width: double .infinity, // Set your desired fixed size (equal width and height) @@ -1006,7 +1113,7 @@ class _ListPlansState extends State { fontWeight: FontWeight.w400, ), ), - ), + ),), ), DataCell( Row( @@ -1242,7 +1349,9 @@ class _ListPlansState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ + children: [GestureDetector( + onTap: () => _showDetails(plan.planId), + child: Container( padding: EdgeInsets.symmetric( horizontal: 8, @@ -1262,7 +1371,7 @@ class _ListPlansState extends State { fontWeight: FontWeight.w600, ), ), - ), + ),), // PlanPopupMenu( // plan: plan, // deletePlan: deletePlan, diff --git a/lib/Screens/reports/advancePurchase.dart b/lib/Screens/reports/advancePurchase.dart index 0ee36fc..2004d10 100644 --- a/lib/Screens/reports/advancePurchase.dart +++ b/lib/Screens/reports/advancePurchase.dart @@ -441,7 +441,7 @@ class _AdvancePurchaseState extends State false) || (object['so_number']?.toLowerCase().contains(lowerQuery) ?? false) || - (object['functional_department']?.toLowerCase().contains( + (object['cost_center']?.toLowerCase().contains( lowerQuery, ) ?? false) || @@ -497,7 +497,7 @@ class _AdvancePurchaseState extends State false) || (object['so_number']?.toLowerCase().contains(lowerQuery) ?? false) || - (object['functional_department']?.toLowerCase().contains( + (object['cost_center']?.toLowerCase().contains( lowerQuery, ) ?? false) || @@ -837,7 +837,7 @@ class _AdvancePurchaseState extends State // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), - // DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), + // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Service', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('AdvPurch', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), @@ -847,7 +847,7 @@ class _AdvancePurchaseState extends State // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), - // DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), + // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['Service']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['AdvPurch']}', style: GoogleFonts.poppins(fontSize: 12))), @@ -985,7 +985,7 @@ class _AdvancePurchaseState extends State ), DataColumn( label: Text( - 'Department', + 'Cost Center', style: GoogleFonts.poppins( fontSize: 12, @@ -1107,7 +1107,7 @@ class _AdvancePurchaseState extends State ), DataCell( Text( - '${entry['functional_department']}', + '${entry['cost_center']}', style: GoogleFonts.poppins( fontSize: 12, @@ -1333,7 +1333,7 @@ class _AdvancePurchaseState extends State // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), - // DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), + // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Service', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('AdvPurch', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), @@ -1343,7 +1343,7 @@ class _AdvancePurchaseState extends State // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), - // DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), + // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['Service']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['AdvPurch']}', style: GoogleFonts.poppins(fontSize: 12))), @@ -1563,7 +1563,7 @@ class _AdvancePurchaseState extends State ), DataColumn( label: Text( - 'Department', + 'Cost Center', style: GoogleFonts.poppins( fontSize: 12, @@ -1685,7 +1685,7 @@ class _AdvancePurchaseState extends State ), DataCell( Text( - '${entry['functional_department']}', + '${entry['cost_center']}', style: GoogleFonts.poppins( fontSize: 12, diff --git a/lib/Screens/reports/guestHouse.dart b/lib/Screens/reports/guestHouse.dart index d4af939..e85d609 100644 --- a/lib/Screens/reports/guestHouse.dart +++ b/lib/Screens/reports/guestHouse.dart @@ -385,7 +385,7 @@ class _GuestHouseState extends State false) || (object['so_number']?.toLowerCase().contains(lowerQuery) ?? false) || - (object['functional_department']?.toLowerCase().contains( + (object['cost_center']?.toLowerCase().contains( lowerQuery, ) ?? false) || @@ -433,7 +433,7 @@ class _GuestHouseState extends State false) || (object['so_number']?.toLowerCase().contains(lowerQuery) ?? false) || - (object['functional_department']?.toLowerCase().contains( + (object['cost_center']?.toLowerCase().contains( lowerQuery, ) ?? false) || @@ -777,7 +777,7 @@ class _GuestHouseState extends State // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), - // DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), + // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), @@ -787,7 +787,7 @@ class _GuestHouseState extends State // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), - // DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), + // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))), @@ -925,7 +925,7 @@ class _GuestHouseState extends State ), DataColumn( label: Text( - 'Department', + 'Cost Center', style: GoogleFonts.poppins( fontSize: 12, @@ -1039,7 +1039,7 @@ class _GuestHouseState extends State ), DataCell( Text( - '${entry['functional_department']}', + '${entry['cost_center']}', style: GoogleFonts.poppins( fontSize: 12, @@ -1263,7 +1263,7 @@ class _GuestHouseState extends State // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), - // DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), + // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), @@ -1273,7 +1273,7 @@ class _GuestHouseState extends State // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), - // DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), + // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))), @@ -1459,7 +1459,7 @@ class _GuestHouseState extends State // "employee_code": "TS_004", // "customer_name": "sangeetha E", // "so_number": "12345", - // "functional_department": "HR", + // "cost_center": "HR", // "flight_trip_type": "Roundtrip", // "plan_trip_type": "international", // "sector": "Rajiv Gandhi International (Hyderabad) - Canadian Rockies Intl (Cranbrook)", @@ -1503,7 +1503,7 @@ class _GuestHouseState extends State ), DataColumn( label: Text( - 'Department', + 'Cost Center', style: GoogleFonts.poppins( fontSize: 12, @@ -1617,7 +1617,7 @@ class _GuestHouseState extends State ), DataCell( Text( - '${entry['functional_department']}', + '${entry['cost_center']}', style: GoogleFonts.poppins( fontSize: 12, diff --git a/lib/Screens/reports/misAir.dart b/lib/Screens/reports/misAir.dart index 49909dc..7d10c97 100644 --- a/lib/Screens/reports/misAir.dart +++ b/lib/Screens/reports/misAir.dart @@ -408,7 +408,7 @@ class _MISairState extends State with SingleTickerProviderStateMixin { false) || (object['so_number']?.toLowerCase().contains(lowerQuery) ?? false) || - (object['functional_department']?.toLowerCase().contains( + (object['cost_center']?.toLowerCase().contains( lowerQuery, ) ?? false) || @@ -457,7 +457,7 @@ class _MISairState extends State with SingleTickerProviderStateMixin { false) || (object['so_number']?.toLowerCase().contains(lowerQuery) ?? false) || - (object['functional_department']?.toLowerCase().contains( + (object['cost_center']?.toLowerCase().contains( lowerQuery, ) ?? false) || @@ -801,7 +801,7 @@ class _MISairState extends State with SingleTickerProviderStateMixin { // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), - // DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), + // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), @@ -811,7 +811,7 @@ class _MISairState extends State with SingleTickerProviderStateMixin { // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), - // DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), + // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))), @@ -949,7 +949,7 @@ class _MISairState extends State with SingleTickerProviderStateMixin { ), DataColumn( label: Text( - 'Department', + 'Cost Center', style: GoogleFonts.poppins( fontSize: 12, @@ -1063,7 +1063,7 @@ class _MISairState extends State with SingleTickerProviderStateMixin { ), DataCell( Text( - '${entry['functional_department']}', + '${entry['cost_center']}', style: GoogleFonts.poppins( fontSize: 12, @@ -1266,7 +1266,7 @@ class _MISairState extends State with SingleTickerProviderStateMixin { // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), - // DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), + // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), @@ -1276,7 +1276,7 @@ class _MISairState extends State with SingleTickerProviderStateMixin { // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), - // DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), + // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))), @@ -1469,7 +1469,7 @@ class _MISairState extends State with SingleTickerProviderStateMixin { ), DataColumn( label: Text( - 'Department', + 'Cost Center', style: GoogleFonts.poppins( fontSize: 12, @@ -1583,7 +1583,7 @@ class _MISairState extends State with SingleTickerProviderStateMixin { ), DataCell( Text( - '${entry['functional_department']}', + '${entry['cost_center']}', style: GoogleFonts.poppins( fontSize: 12, diff --git a/lib/Screens/reports/misForex.dart b/lib/Screens/reports/misForex.dart index c6ecf6f..df14b23 100644 --- a/lib/Screens/reports/misForex.dart +++ b/lib/Screens/reports/misForex.dart @@ -367,7 +367,7 @@ class _MISforexState extends State false) || (object['so_number']?.toLowerCase().contains(lowerQuery) ?? false) || - (object['functional_department']?.toLowerCase().contains( + (object['cost_center']?.toLowerCase().contains( lowerQuery, ) ?? false) || @@ -759,7 +759,7 @@ class _MISforexState extends State ), DataColumn( label: Text( - 'Department', + 'Cost Center', style: GoogleFonts.poppins( fontSize: 12, @@ -882,7 +882,7 @@ class _MISforexState extends State ), DataCell( Text( - '${entry['functional_department']}', + '${entry['cost_center']}', style: GoogleFonts.poppins( fontSize: diff --git a/lib/Screens/reports/misHotel.dart b/lib/Screens/reports/misHotel.dart index 41f315b..afd58e4 100644 --- a/lib/Screens/reports/misHotel.dart +++ b/lib/Screens/reports/misHotel.dart @@ -421,7 +421,7 @@ class _MIShotelState extends State false) || (object['so_number']?.toLowerCase().contains(lowerQuery) ?? false) || - (object['functional_department']?.toLowerCase().contains( + (object['cost_center']?.toLowerCase().contains( lowerQuery, ) ?? false) || @@ -479,7 +479,7 @@ class _MIShotelState extends State false) || (object['so_number']?.toLowerCase().contains(lowerQuery) ?? false) || - (object['functional_department']?.toLowerCase().contains( + (object['cost_center']?.toLowerCase().contains( lowerQuery, ) ?? false) || @@ -819,7 +819,7 @@ class _MIShotelState extends State // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), - // DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), + // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), @@ -829,7 +829,7 @@ class _MIShotelState extends State // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), - // DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), + // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))), @@ -980,7 +980,7 @@ class _MIShotelState extends State ), DataColumn( label: Text( - 'Department', + 'Cost Center', style: GoogleFonts.poppins( fontSize: 12, @@ -1124,7 +1124,7 @@ class _MIShotelState extends State ), DataCell( Text( - '${entry['functional_department']}', + '${entry['cost_center']}', style: GoogleFonts.poppins( fontSize: 12, @@ -1357,7 +1357,7 @@ class _MIShotelState extends State // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), - // DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), + // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), @@ -1367,7 +1367,7 @@ class _MIShotelState extends State // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), - // DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), + // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))), @@ -1600,7 +1600,7 @@ class _MIShotelState extends State ), DataColumn( label: Text( - 'Department', + 'Cost Center', style: GoogleFonts.poppins( fontSize: 12, @@ -1743,7 +1743,7 @@ class _MIShotelState extends State ), DataCell( Text( - '${entry['functional_department']}', + '${entry['cost_center']}', style: GoogleFonts.poppins( fontSize: 12, diff --git a/lib/Screens/reports/servicesAnalysis.dart b/lib/Screens/reports/servicesAnalysis.dart index 1f80455..788f963 100644 --- a/lib/Screens/reports/servicesAnalysis.dart +++ b/lib/Screens/reports/servicesAnalysis.dart @@ -742,7 +742,7 @@ class _ServicesAnalysisState extends State // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), - // DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), + // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), @@ -752,7 +752,7 @@ class _ServicesAnalysisState extends State // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), - // DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), + // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))), @@ -1094,7 +1094,7 @@ class _ServicesAnalysisState extends State // DataColumn(label: Text('Plan Id', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Employee Code', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('SO Number', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), - // DataColumn(label: Text('Department', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), + // DataColumn(label: Text('Cost Center', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Flight Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Plan Trip Type', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), // DataColumn(label: Text('Sector', style: GoogleFonts.poppins(fontSize: 12, fontWeight: FontWeight.w600))), @@ -1104,7 +1104,7 @@ class _ServicesAnalysisState extends State // DataCell(Text('${entry['plan_id']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['employee_code']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['so_number']}', style: GoogleFonts.poppins(fontSize: 12))), - // DataCell(Text('${entry['functional_department']}', style: GoogleFonts.poppins(fontSize: 12))), + // DataCell(Text('${entry['cost_center']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['flight_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['plan_trip_type']}', style: GoogleFonts.poppins(fontSize: 12))), // DataCell(Text('${entry['sector']}', style: GoogleFonts.poppins(fontSize: 12))), diff --git a/lib/Screens/userManagement/create_traveller_agent/listTravelAgent.dart b/lib/Screens/userManagement/create_traveller_agent/listTravelAgent.dart index 7f814b1..137226d 100644 --- a/lib/Screens/userManagement/create_traveller_agent/listTravelAgent.dart +++ b/lib/Screens/userManagement/create_traveller_agent/listTravelAgent.dart @@ -150,6 +150,8 @@ class _TravelAgentListScreenState extends State { print("TOEKRWE: $token"); if (token == null) { + print('Token not found. Please log in.'); + return []; throw Exception('Token not found. Please log in.'); } @@ -165,6 +167,8 @@ class _TravelAgentListScreenState extends State { final data = json.decode(response.body); return data['data']; // Returning raw JSON list } else { + print('Failed to load users'); + return []; throw Exception('Failed to load users'); } } diff --git a/lib/Screens/userManagement/user_List.dart b/lib/Screens/userManagement/user_List.dart index b976a0a..455329c 100644 --- a/lib/Screens/userManagement/user_List.dart +++ b/lib/Screens/userManagement/user_List.dart @@ -19,7 +19,7 @@ import '../../routes/custom_drawer.dart'; import '../../services/apiService.dart'; import '../../utils/pagination.dart'; import '../../widgets/custom_popup.dart'; -import '../../widgets/popup_userList_action.dart'; +// import '../../widgets/popup_userList_action.dart'; class UserListScreen extends StatefulWidget { @override @@ -1275,12 +1275,40 @@ class _UserListScreenState extends State { ), ), DataCell( - UserActionsMenu( - user: user, - getUserDetails: - (id) => - apiService.getSingleUser(id), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + GestureDetector( + child: Tooltip( + message: 'Edit User Details', + child: Image.asset( + 'assets/images/IconsImg/edit.png', + width: 20, + height: 15, + ), + ), + onTap: () async { + // Navigator.pop(context); // Close the menu + // final userId = user['user_id']; + final userId = int.parse(user['user_id'].toString()); + final usersData = await apiService.getSingleUser(userId); + context.go("/CreateUserDetails", extra: { + "selectedUser": usersData, + "isViewMode": true, + }); + }, + ), + ], ), + ), + // DataCell( + // UserActionsMenu( + // user: user, + // getUserDetails: + // (id) => + // apiService.getSingleUser(id), + // ), // PopupMenuButton( // color: Colors.white, // padding: EdgeInsets.zero, @@ -1456,7 +1484,7 @@ class _UserListScreenState extends State { // // ), // ], // ), - ), + // ), ], ); }).toList(), @@ -1498,12 +1526,36 @@ class _UserListScreenState extends State { fontWeight: FontWeight.w700, ), ), - - UserActionsMenu( - user: user, - getUserDetails: - (id) => apiService.getSingleUser(id), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + GestureDetector( + child: Tooltip( + message: 'Edit User Details', + child: Image.asset( + 'assets/images/IconsImg/edit.png', + width: 20, + height: 15, + ), + ), + onTap: () async { + Navigator.pop(context); // Close the menu + final userId = int.parse(user['user_id'].toString()); + final usersData = await apiService.getSingleUser(userId); + context.go("/CreateUserDetails", extra: { + "selectedUser": usersData, + "isViewMode": true, + }); + }, + ), + ], ), + // UserActionsMenu( + // user: user, + // getUserDetails: + // (id) => apiService.getSingleUser(id), + // ), // PopupMenuButton( // color: Colors.white, // padding: EdgeInsets.zero, diff --git a/lib/widgets/popup_travelAgentList_action.dart b/lib/widgets/popup_travelAgentList_action.dart index e928223..671384f 100644 --- a/lib/widgets/popup_travelAgentList_action.dart +++ b/lib/widgets/popup_travelAgentList_action.dart @@ -40,25 +40,25 @@ class UserActionsMenu extends StatelessWidget { mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ - // GestureDetector( - // child: Tooltip( - // message: 'View Details', - // child: Icon(Icons.remove_red_eye, - // color: Color(0xFF475569), size: 18) - // ), - // // child: Icon(Icons.remove_red_eye, - // // color: Color(0xFF475569), size: 18,), - // onTap: () async { - // Navigator.pop(context); // Close the menu - // final userId = getUserId(user['user_id']); - // final usersData = await getUserDetails(userId); - // context.go("/CreateTravelAgent", extra: { - // "selectedUser": usersData, - // "isViewMode": true, - // }); - // }, - // ), - // SizedBox(width: 8), + GestureDetector( + child: Tooltip( + message: 'View Details', + child: Icon(Icons.remove_red_eye, + color: Color(0xFF475569), size: 18) + ), + // child: Icon(Icons.remove_red_eye, + // color: Color(0xFF475569), size: 18,), + onTap: () async { + Navigator.pop(context); // Close the menu + final userId = getUserId(user['user_id']); + final usersData = await getUserDetails(userId); + context.go("/CreateTravelAgent", extra: { + "selectedUser": usersData, + "isViewMode": true, + }); + }, + ), + SizedBox(width: 8), GestureDetector( child: Tooltip( message: 'Edit Details', diff --git a/lib/widgets/popup_userList_action.dart b/lib/widgets/popup_userList_action.dart index 45c5a2a..5ff7a85 100644 --- a/lib/widgets/popup_userList_action.dart +++ b/lib/widgets/popup_userList_action.dart @@ -40,25 +40,25 @@ class UserActionsMenu extends StatelessWidget { mainAxisSize: MainAxisSize.min, mainAxisAlignment: MainAxisAlignment.center, children: [ - // GestureDetector( - // child: Tooltip( - // message: 'View Details', - // child: Icon(Icons.remove_red_eye, - // color: Color(0xFF475569), size: 18) - // ), - // // child: Icon(Icons.remove_red_eye, - // // color: Color(0xFF475569), size: 18,), - // onTap: () async { - // Navigator.pop(context); // Close the menu - // final userId = getUserId(user['user_id']); - // final usersData = await getUserDetails(userId); - // context.go("/CreateUserDetails", extra: { - // "selectedUser": usersData, - // "isViewMode": true, - // }); - // }, - // ), - // SizedBox(width: 8), + GestureDetector( + child: Tooltip( + message: 'View Details', + child: Icon(Icons.remove_red_eye, + color: Color(0xFF475569), size: 18) + ), + // child: Icon(Icons.remove_red_eye, + // color: Color(0xFF475569), size: 18,), + onTap: () async { + Navigator.pop(context); // Close the menu + final userId = getUserId(user['user_id']); + final usersData = await getUserDetails(userId); + context.go("/CreateUserDetails", extra: { + "selectedUser": usersData, + "isViewMode": true, + }); + }, + ), + SizedBox(width: 8), GestureDetector( child: Tooltip( message: 'Edit Details',