Commit 185e0896 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

changes by mohit

parent ee5b7a8e
......@@ -57,31 +57,48 @@ class _AllpaymentrequesitionlistsbymodesState
bool shouldShowButtons = false;
final numberFormat = NumberFormat.decimalPattern();
final ScrollController _scrollController = ScrollController();
@override
void initState() {
// TODO: implement initState
super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
cf = Commondaterangefilter();
var provider = Provider.of<Requestionlistprovider>(
context,
listen: false,
);
final now = DateTime.now();
final range = DateTimeRange(
start: DateTime(now.year, now.month, now.day),
end: DateTime(now.year, now.month, now.day),
);
final dateRange = cf.getFormattedDateRange(range);
// print(dateRange);
provider.paymentRequestionListsAPIFunction(context, widget.mode, "", "");
_scrollController.addListener(() {
if (_scrollController.position.pixels >=
_scrollController.position.maxScrollExtent - 200 &&
!provider.isLoadingMore &&
provider.hasMoreData) {
provider.paymentRequestionListsAPIFunction(
context,
widget.mode,
"",
"",
append: true,
);
}
});
});
}
@override
void dispose() {
_scrollController.dispose();
_connectivity.disposeStream();
super.dispose();
}
//'Requested',
// 'Level 1 Approved',
// 'Level 2 Approved',
......@@ -174,12 +191,12 @@ class _AllpaymentrequesitionlistsbymodesState
return 18.0;
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_connectivity.disposeStream();
}
// @override
// void dispose() {
// // TODO: implement dispose
// super.dispose();
// _connectivity.disposeStream();
// }
@override
Widget build(BuildContext context) {
......@@ -320,387 +337,316 @@ class _AllpaymentrequesitionlistsbymodesState
0xFFFFFFFF,
),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(
child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
body: provider.isLoading && requestLists.isEmpty
? Center(
child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(AppColors.app_blue),
),
)
: requestLists.isNotEmpty
? RefreshIndicator(
onRefresh: () async {
provider.resetPagination();
await provider.paymentRequestionListsAPIFunction(
context,
widget.mode,
"",
"",
);
},
child: Scrollbar(
controller: _scrollController, // attach here
thumbVisibility: false,
child: ListView.builder(
controller: _scrollController,
physics: const AlwaysScrollableScrollPhysics(),
itemCount:
requestLists.length + (provider.hasMoreData ? 1 : 0),
itemBuilder: (context, index) {
// loader row for pagination
if (index == requestLists.length) {
return provider.isLoadingMore
? const Padding(
padding: EdgeInsets.all(16),
child: Center(
child: CircularProgressIndicator(),
),
),
)
: requestLists.isNotEmpty
? SizedBox(
child: Scrollbar(
thumbVisibility: false,
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
shouldShowSwipeButtons(requestLists[index].status);
if (requestLists.isEmpty) {
return SizedBox(
child: Center(child: Text("No Data Available")),
);
}
return InkResponse(
onTap: () async {
HapticFeedback.selectionClick();
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Paymentrequestionlistdetails(
pageName: widget.pageTitleName,
mode: widget.mode,
paymentRequestId:
requestLists[index].id,
),
settings: RouteSettings(
name: "Paymentrequestionlistdetails",
)
: const SizedBox.shrink();
}
// Your swipe logic untouched
final request = requestLists[index];
shouldShowSwipeButtons(request.status);
return InkResponse(
onTap: () async {
HapticFeedback.selectionClick();
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Paymentrequestionlistdetails(
pageName: widget.pageTitleName,
mode: widget.mode,
paymentRequestId:
requestLists[index].id,
),
settings: RouteSettings(
name: "Paymentrequestionlistdetails",
),
),
);
if (routeSettingName ==
"Paymentrequestionlistdetails") {
print("croos refresh");
provider.paymentRequestionListsAPIFunction(
context,
widget.mode,
"",
"",
);
}
},
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(20),
child: Slidable(
startActionPane:
shouldShowButtons
? ActionPane(
motion: const ScrollMotion(),
dragDismissible: false,
// dismissible: DismissiblePane(onDismissed: () {}),
children: [
if (shouldShowButtons &&
![
"admin",
"self",
].contains(widget.mode)) ...[
SlidableAction(
onPressed: (context) {
_showLevelRejectionSheet(
context,
requestLists[index].id,
);
},
backgroundColor: Color(
0xFFFFE5E5,
),
foregroundColor: Color(
0xFFEF3739,
),
icon: Icons.clear,
label: 'Reject',
),
);
if (routeSettingName ==
"Paymentrequestionlistdetails") {
print("croos refresh");
provider.paymentRequestionListsAPIFunction(
context,
widget.mode,
"",
"",
);
}
},
child: Container(
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(20),
child: Slidable(
startActionPane:
shouldShowButtons
? ActionPane(
motion: const ScrollMotion(),
dragDismissible: false,
// dismissible: DismissiblePane(onDismissed: () {}),
children: [
if (shouldShowButtons &&
![
"admin",
"self",
].contains(widget.mode)) ...[
SlidableAction(
onPressed: (context) {
_showLevelRejectionSheet(
context,
requestLists[index].id,
);
},
backgroundColor: Color(
0xFFFFE5E5,
),
foregroundColor: Color(
0xFFEF3739,
),
icon: Icons.clear,
label: 'Reject',
),
],
],
if (widget.mode == "process") ...[
SlidableAction(
onPressed: (context) {
detailsProvider
.approveRejectPaymentRequestAPIFunction(
context,
requestLists[index]
.id,
);
detailsProvider.preValues();
_showAddPaymentSheet(
context,
requestLists[index].id,
);
},
backgroundColor: Color(
0xFFFFF8E5,
),
foregroundColor: Color(
0xFFFFB600,
),
icon: Icons.add,
label: 'Add Payment',
),
],
],
)
: null,
endActionPane:
shouldShowButtons
? ActionPane(
motion: const ScrollMotion(),
key: ValueKey(
requestLists[index].id,
),
dragDismissible: false,
if (widget.mode == "process") ...[
SlidableAction(
onPressed: (context) {
detailsProvider
.approveRejectPaymentRequestAPIFunction(
context,
requestLists[index]
.id,
);
detailsProvider.preValues();
_showAddPaymentSheet(
context,
requestLists[index].id,
);
},
backgroundColor: Color(
0xFFFFF8E5,
),
foregroundColor: Color(
0xFFFFB600,
),
icon: Icons.add,
label: 'Add Payment',
),
],
],
)
: null,
endActionPane:
shouldShowButtons
? ActionPane(
motion: const ScrollMotion(),
key: ValueKey(
requestLists[index].id,
),
dragDismissible: false,
// dismissible: DismissiblePane(
//
// onDismissed: () {},
// closeOnCancel: true,
// resizeDuration: Duration(milliseconds: 300),),
children: [
if ([
"apr_lvl1",
"apr_lvl2",
"self_apr_lvl2",
].contains(widget.mode)) ...[
SlidableAction(
onPressed: (context) {
detailsProvider
.paymentRequesitionDetails(
context,
requestLists[index]
.id,
);
detailsProvider.preValues();
detailsProvider
.approveRejectPaymentRequestAPIFunction(
context,
requestLists[index]
.id,
);
_showLevelApprovalSheet(
context,
requestLists[index].id,
);
},
backgroundColor: Color(
0xFFE9FFE8,
),
foregroundColor: Color(
0xFF4CB443,
),
icon: Icons.check,
label: 'Approve',
),
],
],
)
: null,
// dismissible: DismissiblePane(
//
// onDismissed: () {},
// closeOnCancel: true,
// resizeDuration: Duration(milliseconds: 300),),
children: [
if ([
"apr_lvl1",
"apr_lvl2",
"self_apr_lvl2",
].contains(widget.mode)) ...[
SlidableAction(
onPressed: (context) {
detailsProvider
.paymentRequesitionDetails(
context,
requestLists[index]
.id,
);
detailsProvider.preValues();
detailsProvider
.approveRejectPaymentRequestAPIFunction(
context,
requestLists[index]
.id,
);
_showLevelApprovalSheet(
context,
requestLists[index].id,
);
},
backgroundColor: Color(
0xFFE9FFE8,
),
foregroundColor: Color(
0xFF4CB443,
),
icon: Icons.check,
label: 'Approve',
),
],
],
)
: null,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 50,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: getDecorationColor(
requestLists[index].status,
),
shape: BoxShape.circle,
),
child: Center(
child: Text(
getText(
requestLists[index]
.status,
),
style: TextStyle(
color: getTextColor(
requestLists[index]
.status,
),
fontSize: getSize(
requestLists[index]
.status,
),
fontFamily: "JakartaBold",
),
),
),
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 50,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: getDecorationColor(
requestLists[index].status,
),
shape: BoxShape.circle,
),
child: Center(
child: Text(
getText(
requestLists[index]
.status,
),
style: TextStyle(
color: getTextColor(
requestLists[index]
.status,
),
fontSize: getSize(
requestLists[index]
.status,
),
fontFamily: "JakartaBold",
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
requestLists[index]
.accountName!,
maxLines: 1,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color:
AppColors
.semi_black,
),
),
Text(
"${requestLists[index].date}",
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color:
AppColors.app_blue,
),
),
],
),
),
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
requestLists[index]
.accountName!,
maxLines: 1,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color:
AppColors
.semi_black,
),
),
Expanded(
flex: 3,
child: Text(
maxLines: 1,
"₹ ${requestLists[index].amount!}",
textAlign: TextAlign.right,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
Text(
"${requestLists[index].date}",
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color:
AppColors.app_blue,
),
),
],
),
],
),
),
),
Expanded(
flex: 3,
child: Text(
maxLines: 1,
"₹ ${requestLists[index].amount!}",
textAlign: TextAlign.right,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
],
),
),
],
),
);
},
),
),
)
: Emptywidget(context),
);
},
);
}
Future<void> _showOptionsSheet(BuildContext context) {
return showModalBottomSheet(
useSafeArea: true,
isDismissible: true,
isScrollControlled: true,
showDragHandle: true,
backgroundColor: Colors.white,
enableDrag: true,
context: context,
builder: (context) {
return StatefulBuilder(
builder: (context, setState) {
return SafeArea(
child: Consumer<Requestionlistprovider>(
builder: (context, provider, child) {
return Container(
margin: EdgeInsets.only(
bottom: 15,
left: 15,
right: 15,
top: 10,
),
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom,
),
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(height: 15),
...List.generate(5, (index) {
final assetnames = [
"se_locate_customer",
"se_locate_customer",
"se_update_complaint",
"se_payment_details",
"se_payment_details",
];
final Headingnames = [
"Copy to Clipboard",
"Download CSV",
"Download XLSX",
"Download PDF",
"Print Data",
];
return ListTile(
onTap: () {
HapticFeedback.selectionClick();
switch (index) {
case 0:
provider.copyToClipboard(context);
break;
case 1:
provider.downloadCSV(context);
break;
case 2:
provider.downloadXLS(context);
break;
case 3:
provider.downloadPDF(context);
break;
case 4:
provider.printData(context);
break;
}
},
leading: SvgPicture.asset(
"assets/svg/${assetnames[index]}.svg",
),
title: Text(
Headingnames[index],
style: TextStyle(fontFamily: "JakartaMedium"),
),
trailing: SvgPicture.asset(
"assets/svg/arrow_right_new.svg",
),
);
}),
],
),
),
),
),
);
},
),
);
},
),
)
: Emptywidget(context),
);
},
);
}
Future<void> _showLevelApprovalSheet(BuildContext context, paymentID) {
return showModalBottomSheet(
useSafeArea: true,
......
......@@ -28,41 +28,45 @@ class Paymentlistpaymentrequisition extends StatefulWidget {
class _PaymentlistpaymentrequisitionState
extends State<Paymentlistpaymentrequisition> {
late Commondaterangefilter cf;
final ScrollController _scrollController = ScrollController();
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
@override
void initState() {
// TODO: implement initState
super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
cf = Commondaterangefilter();
var provider = Provider.of<Paymentrequisitionpaymentslistprovider>(
context,
listen: false,
);
final now = DateTime.now();
final range = DateTimeRange(
start: DateTime(now.year, now.month, now.day),
end: DateTime(now.year, now.month, now.day),
);
final dateRange = cf.getFormattedDateRange(range);
provider.resetPagination();
provider.paymentsListAPI(context, '', '');
_scrollController.addListener(() {
if (_scrollController.position.pixels >=
_scrollController.position.maxScrollExtent - 200) {
provider.loadMore(context, '', '');
}
});
});
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_scrollController.dispose();
_connectivity.disposeStream();
super.dispose();
}
@override
Widget build(BuildContext context) {
switch (_source.keys.toList()[0]) {
......@@ -145,144 +149,152 @@ class _PaymentlistpaymentrequisitionState
0xFFFFFFFF
),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(
child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
),
),
body: provider.isLoading
? Center(
child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
),
),
)
: requestLists.isNotEmpty
? Scrollbar(
controller: _scrollController,
thumbVisibility: false,
child: ListView.builder(
controller: _scrollController,
itemCount: requestLists.length +
(provider.hasMoreData ? 1 : 0),
itemBuilder: (context, index) {
if (index == requestLists.length) {
return provider.isLoadingMore
? const Padding(
padding: EdgeInsets.all(16),
child: Center(
child: CircularProgressIndicator()),
)
: requestLists.isNotEmpty
? SizedBox(
child: Scrollbar(
thumbVisibility: false,
: const SizedBox.shrink();
}
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
return InkResponse(
onTap: () async {
HapticFeedback.selectionClick();
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Paymentdetailspaymentrequisition(
pageName:
widget.pageTitleName,
paymentRequestId:
requestLists[index].id,
),
settings: RouteSettings(
name:
"Paymentdetailspaymentrequisition",
),
),
);
if (routeSettingName ==
"Paymentdetailspaymentrequisition") {
print("pld");
final payment = requestLists[index];
return InkResponse(
onTap: () async {
HapticFeedback.selectionClick();
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Paymentdetailspaymentrequisition(
pageName:
widget.pageTitleName,
paymentRequestId:
requestLists[index].id,
),
settings: RouteSettings(
name:
"Paymentdetailspaymentrequisition",
),
),
);
if (routeSettingName ==
"Paymentdetailspaymentrequisition") {
print("pld");
provider.paymentsListAPI(context, '', '');
}
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
provider.paymentsListAPI(context, '', '');
}
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 50,
padding: EdgeInsets.all(3.0),
decoration: BoxDecoration(
color: AppColors.requested_bg_color,
shape: BoxShape.circle
),
child: SvgPicture.asset(
"assets/svg/finance/rupee_ic.svg",
fit: BoxFit.scaleDown,
),
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 50,
padding: EdgeInsets.all(3.0),
decoration: BoxDecoration(
color: AppColors.requested_bg_color,
shape: BoxShape.circle
),
child: SvgPicture.asset(
"assets/svg/finance/rupee_ic.svg",
fit: BoxFit.scaleDown,
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
requestLists[index]
.receipientAccount!,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
"${requestLists[index].paymentDate}",
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
requestLists[index]
.receipientAccount!,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
SizedBox(width: 10),
Expanded(
flex: 3,
child: Text(
"₹${requestLists[index].amount}",
maxLines: 1,
textAlign: TextAlign.right,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
Text(
"${requestLists[index].paymentDate}",
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
),
),
),
SizedBox(width: 10),
Expanded(
flex: 3,
child: Text(
"₹${requestLists[index].amount}",
maxLines: 1,
textAlign: TextAlign.right,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
],
),
],
),
],
),
),
);
},
),
],
),
)
: Emptywidget(context),
),
);
},
),
)
: Emptywidget(context),
);
},
);
......
......@@ -29,24 +29,41 @@ class Paymentreceiptlist extends StatefulWidget {
class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
final ScrollController _scrollController = ScrollController();
@override
void initState() {
// TODO: implement initState
super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
WidgetsBinding.instance.addPostFrameCallback((_) {
var provider = Provider.of<Paymentreceiptsprovider>(
context,
listen: false,
);
provider.resetPagination();
provider.paymentsListAPI(context, '', '');
_scrollController.addListener(() {
if (_scrollController.position.pixels >=
_scrollController.position.maxScrollExtent - 200) {
provider.loadMore(context, '', '');
}
});
});
}
@override
void dispose() {
_scrollController.dispose();
_connectivity.disposeStream();
super.dispose();
}
@override
Widget build(BuildContext context) {
switch (_source.keys.toList()[0]) {
......@@ -77,6 +94,7 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
Widget _scaffold(BuildContext context) {
return Consumer<Paymentreceiptsprovider>(
builder: (context, provider, child) {
final receipts = provider.receiptsList;
final requestLists = provider.receiptsList;
return Scaffold(
resizeToAvoidBottomInset: true,
......@@ -129,137 +147,146 @@ class _PaymentreceiptlistState extends State<Paymentreceiptlist> {
0xFFFFFFFF,
),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(
child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
body: provider.isLoading
? Center(
child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
),
),
)
: receipts.isNotEmpty
? Scrollbar(
controller: _scrollController,
child: ListView.builder(
controller: _scrollController,
itemCount:
receipts.length + (provider.hasMoreData ? 1 : 0),
itemBuilder: (context, index) {
if (index == receipts.length) {
return provider.isLoadingMore
? const Padding(
padding: EdgeInsets.all(16),
child: Center(
child: CircularProgressIndicator()),
)
: const SizedBox.shrink();
}
final receipt = receipts[index];
return InkResponse(
onTap: () async {
HapticFeedback.selectionClick();
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Paymentreceiptdetails(
pageName: widget.pageTitleName,
paymentRequestId:
requestLists[index].id,
),
settings: RouteSettings(
name: "Paymentreceiptdetails",
),
),
);
if (routeSettingName == "Paymentreceiptdetails") {
debugPrint("prd");
provider.paymentsListAPI(context, '', '');
}
// if (res == true) {
// provider.paymentsListAPI(context, '', '');
// }
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
)
: requestLists.isNotEmpty
? SizedBox(
child: Scrollbar(
child: ListView.builder(
itemCount: requestLists.length,
shrinkWrap: true,
physics: AlwaysScrollableScrollPhysics(),
itemBuilder: (context, index) {
return InkResponse(
onTap: () async {
HapticFeedback.selectionClick();
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Paymentreceiptdetails(
pageName: widget.pageTitleName,
paymentRequestId:
requestLists[index].id,
),
settings: RouteSettings(
name: "Paymentreceiptdetails",
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 50,
padding: EdgeInsets.all(3.0),
decoration: BoxDecoration(
color: AppColors.requested_bg_color,
shape: BoxShape.circle,
),
child: SvgPicture.asset(
"assets/svg/finance/rupee_ic.svg",
fit: BoxFit.scaleDown,
),
);
if (routeSettingName == "Paymentreceiptdetails") {
debugPrint("prd");
provider.paymentsListAPI(context, '', '');
}
// if (res == true) {
// provider.paymentsListAPI(context, '', '');
// }
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 50,
padding: EdgeInsets.all(3.0),
decoration: BoxDecoration(
color: AppColors.requested_bg_color,
shape: BoxShape.circle,
),
child: SvgPicture.asset(
"assets/svg/finance/rupee_ic.svg",
fit: BoxFit.scaleDown,
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
requestLists[index]
.receipientAccount!,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
"${requestLists[index].receiptDate}",
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.grey_semi,
),
),
],
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
requestLists[index]
.receipientAccount!,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
SizedBox(width: 10),
Expanded(
flex: 3,
child: Text(
"₹${requestLists[index].amount}",
textAlign: TextAlign.right,
maxLines: 1,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
Text(
"${requestLists[index].receiptDate}",
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.grey_semi,
),
],
),
],
),
],
),
),
),
);
},
),
SizedBox(width: 10),
Expanded(
flex: 3,
child: Text(
"₹${requestLists[index].amount}",
textAlign: TextAlign.right,
maxLines: 1,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
],
),
],
),
)
: Emptywidget(context),
),
);
},
),
)
: Emptywidget(context),
);
},
);
......
......@@ -66,7 +66,7 @@ class _HrmdashboardScreenState extends State<HrmdashboardScreen> {
],
),
),
backgroundColor: const Color(0xffF6F6F8),
backgroundColor: AppColors.scaffold_bg_color,
body: SingleChildScrollView(
child: Column(
children: [
......
......@@ -2,24 +2,27 @@ import 'package:dotted_line/dotted_line.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../Notifiers/hrmProvider/leaveApplicationDetailsProvider.dart';
import '../../Notifiers/HomeScreenNotifier.dart';
import '../../Utils/app_colors.dart';
import '../finance/FileViewer.dart';
/// Screen for leave application details
class LeaveApplicationDetailScreen extends StatefulWidget {
final String leaveRequestId;
final String mode;
const LeaveApplicationDetailScreen({super.key, required this.leaveRequestId, required this.mode});
const LeaveApplicationDetailScreen({
super.key,
required this.leaveRequestId,
required this.mode,
});
@override
State<LeaveApplicationDetailScreen> createState() => _LeaveApplicationDetailScreenState();
State<LeaveApplicationDetailScreen> createState() =>
_LeaveApplicationDetailScreenState();
}
class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScreen> {
class _LeaveApplicationDetailScreenState
extends State<LeaveApplicationDetailScreen> {
bool _actionSubmitted = false;
@override
......@@ -30,12 +33,19 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
// Scale factors based on screen size
final scaleFactor = screenWidth / 360; // Base width for scaling
final textScaleFactor = MediaQuery.of(context).textScaleFactor.clamp(1.0, 1.2);
final textScaleFactor = MediaQuery.of(
context,
).textScaleFactor.clamp(1.0, 1.2);
return SafeArea(
top: false,
child: ChangeNotifierProvider(
create: (_) => LeaveApplicationDetailsProvider()..fetchLeaveApplicationDetails(context, widget.leaveRequestId),
create:
(_) =>
LeaveApplicationDetailsProvider()..fetchLeaveApplicationDetails(
context,
widget.leaveRequestId,
),
child: Consumer<LeaveApplicationDetailsProvider>(
builder: (context, provider, child) {
return Scaffold(
......@@ -74,7 +84,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
body: Builder(
builder: (context) {
if (provider.isLoading) {
return const Center(child: CircularProgressIndicator(color: Colors.blue));
return const Center(
child: CircularProgressIndicator(color: Colors.blue),
);
}
if (provider.response?.requestDetails == null) {
return const Center(child: Text("No details found"));
......@@ -89,7 +101,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
children: [
Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16 * scaleFactor),
borderRadius: BorderRadius.circular(
16 * scaleFactor,
),
),
elevation: 0,
child: Padding(
......@@ -99,14 +113,18 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
children: [
/// Header with status
Container(
margin: EdgeInsets.only(bottom: 0.5 * scaleFactor),
margin: EdgeInsets.only(
bottom: 0.5 * scaleFactor,
),
padding: EdgeInsets.symmetric(
horizontal: 2.5 * scaleFactor,
vertical: 12 * scaleFactor,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12 * scaleFactor),
borderRadius: BorderRadius.circular(
12 * scaleFactor,
),
),
child: Row(
children: [
......@@ -132,14 +150,18 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
/// Middle text
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
details.leaveType ?? "-",
style: TextStyle(
decoration: TextDecoration.underline,
decorationStyle: TextDecorationStyle.dotted,
decorationColor: AppColors.grey_thick,
decoration:
TextDecoration.underline,
decorationStyle:
TextDecorationStyle.dotted,
decorationColor:
AppColors.grey_thick,
height: 1.2,
fontFamily: "JakartaRegular",
fontSize: 14,
......@@ -166,8 +188,12 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
horizontal: 12 * scaleFactor,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6 * scaleFactor),
color: _getStatusBackgroundColor(details.status),
borderRadius: BorderRadius.circular(
6 * scaleFactor,
),
color: _getStatusBackgroundColor(
details.status,
),
),
child: Center(
child: Text(
......@@ -175,7 +201,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.w600,
color: _getStatusTextColor(details.status),
color: _getStatusTextColor(
details.status,
),
),
),
),
......@@ -189,26 +217,89 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
padding: EdgeInsets.all(8.0 * scaleFactor),
child: Column(
children: [
_buildSectionHeader("Leave Details", scaleFactor),
_buildDetailTile("Application ID", details.id, scaleFactor),
_buildDetailTile("Applied Date", details.appliedDate, scaleFactor),
_buildDetailTile("Leave Type", details.leaveType, scaleFactor),
_buildDateRangeTile("Leave Period", details.fromDate, details.toDate, scaleFactor),
_buildTimeRangeTile("Time Period", details.fromTime, details.toTime, scaleFactor),
_buildDetailTile("Reason", details.reason, scaleFactor),
_buildSectionHeader(
"Leave Details",
scaleFactor,
),
_buildDetailTile(
"Application ID",
details.id,
scaleFactor,
),
_buildDetailTile(
"Applied Date",
details.appliedDate,
scaleFactor,
),
_buildDetailTile(
"Leave Type",
details.leaveType,
scaleFactor,
),
_buildDateRangeTile(
"Leave Period",
details.fromDate,
details.toDate,
scaleFactor,
),
_buildTimeRangeTile(
"Time Period",
details.fromTime,
details.toTime,
scaleFactor,
),
_buildDetailTile(
"Reason",
details.reason,
scaleFactor,
),
/// Approval Details
_buildSectionHeader("Approval Details", scaleFactor),
_buildDetailTile("Requested To", details.requestedTo, scaleFactor),
_buildDetailTile("Approved By", details.approvedBy, scaleFactor),
_buildDetailTile("Approved Date", details.approvedDate, scaleFactor),
_buildDetailTile("Approval Remarks", details.approvalRemarks, scaleFactor),
_buildSectionHeader(
"Approval Details",
scaleFactor,
),
_buildDetailTile(
"Requested To",
details.requestedTo,
scaleFactor,
),
_buildDetailTile(
"Approved By",
details.approvedBy,
scaleFactor,
),
_buildDetailTile(
"Approved Date",
details.approvedDate,
scaleFactor,
),
_buildDetailTile(
"Approval Remarks",
details.approvalRemarks,
scaleFactor,
),
/// Additional Information
_buildSectionHeader("Additional Information", scaleFactor),
_buildDetailTile("Status", details.status, scaleFactor),
_buildDetailTile("From Time", details.fromTime, scaleFactor),
_buildDetailTile("To Time", details.toTime, scaleFactor),
_buildSectionHeader(
"Additional Information",
scaleFactor,
),
_buildDetailTile(
"Status",
details.status,
scaleFactor,
),
_buildDetailTile(
"From Time",
details.fromTime,
scaleFactor,
),
_buildDetailTile(
"To Time",
details.toTime,
scaleFactor,
),
],
),
),
......@@ -222,129 +313,158 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
);
},
),
bottomNavigationBar: (widget.mode == "teamleader"
&& !_actionSubmitted
&& provider.response?.requestDetails?.status != "Approved"
&& provider.response?.requestDetails?.status != "Rejected")
? Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xffFFFFFF),
Color(0x00FFFFFF),
],
),
),
padding: EdgeInsets.symmetric(horizontal: 10 * scaleFactor, vertical: 6 * scaleFactor),
height: 61 * scaleFactor,
child: Column(
children: [
Row(
children: [
/// Reject Button
Expanded(
child: InkWell(
onTap: () {
showRemarkSheet(
context: context,
actionType: "Reject",
onSubmit: (remark) {
provider.leaveRequestRejectApprove(
context,
mode: widget.mode,
type: "Rejected",
remarks: remark,
id: provider.response!.requestDetails!.id!,
);
},
).then((_) {
provider.fetchLeaveApplicationDetails(context, widget.leaveRequestId);
});
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8 * scaleFactor),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset("assets/svg/finance/level_reject_ic.svg"),
SizedBox(width: 6 * scaleFactor),
Text(
"Reject",
style: TextStyle(
color: Colors.black87,
fontSize: 14 * scaleFactor,
fontFamily: "JakartaMedium",
),
),
],
),
),
bottomNavigationBar:
(widget.mode == "teamleader" &&
!_actionSubmitted &&
provider.response?.requestDetails?.status !=
"Approved" &&
provider.response?.requestDetails?.status !=
"Rejected")
? Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [Color(0xffFFFFFF), Color(0x00FFFFFF)],
),
),
/// Vertical Divider
Container(
width: 1,
height: 45 * scaleFactor,
color: Colors.grey.shade300,
padding: EdgeInsets.symmetric(
horizontal: 10 * scaleFactor,
vertical: 6 * scaleFactor,
),
height: 61 * scaleFactor,
child: Column(
children: [
Row(
children: [
/// Reject Button
Expanded(
child: InkWell(
onTap: () {
showRemarkSheet(
context: context,
actionType: "Reject",
onSubmit: (remark) {
provider.leaveRequestRejectApprove(
context,
mode: widget.mode,
type: "Rejected",
remarks: remark,
id:
provider
.response!
.requestDetails!
.id!,
);
},
).then((_) {
provider.fetchLeaveApplicationDetails(
context,
widget.leaveRequestId,
);
});
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
8 * scaleFactor,
),
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
SvgPicture.asset(
"assets/svg/finance/level_reject_ic.svg",
),
SizedBox(width: 6 * scaleFactor),
Text(
"Reject",
style: TextStyle(
color: Colors.black87,
fontSize: 14 * scaleFactor,
fontFamily: "JakartaMedium",
),
),
],
),
),
),
),
/// Approve Button
Expanded(
child: InkWell(
onTap: () {
showRemarkSheet(
context: context,
actionType: "Approve",
onSubmit: (remark) async {
await provider.leaveRequestRejectApprove(
context,
mode: widget.mode,
type: "Approved",
remarks: remark,
id: provider.response!.requestDetails!.id!,
);
},
).then((_) {
provider.fetchLeaveApplicationDetails(context, widget.leaveRequestId);
});
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8 * scaleFactor),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset("assets/svg/finance/level_approve_ic.svg"),
SizedBox(width: 6 * scaleFactor),
Text(
"Approve",
style: TextStyle(
color: Colors.black87,
fontSize: 14 * scaleFactor,
fontFamily: "JakartaMedium",
/// Vertical Divider
Container(
width: 1,
height: 45 * scaleFactor,
color: Colors.grey.shade300,
),
/// Approve Button
Expanded(
child: InkWell(
onTap: () {
showRemarkSheet(
context: context,
actionType: "Approve",
onSubmit: (remark) async {
await provider
.leaveRequestRejectApprove(
context,
mode: widget.mode,
type: "Approved",
remarks: remark,
id:
provider
.response!
.requestDetails!
.id!,
);
},
).then((_) {
provider.fetchLeaveApplicationDetails(
context,
widget.leaveRequestId,
);
});
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
8 * scaleFactor,
),
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
SvgPicture.asset(
"assets/svg/finance/level_approve_ic.svg",
),
SizedBox(width: 6 * scaleFactor),
Text(
"Approve",
style: TextStyle(
color: Colors.black87,
fontSize: 14 * scaleFactor,
fontFamily: "JakartaMedium",
),
),
],
),
),
),
],
),
),
],
),
),
SizedBox(height: 2 * scaleFactor),
],
),
],
),
SizedBox(height: 2 * scaleFactor)
],
),
)
: const SizedBox.shrink(),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
)
: const SizedBox.shrink(),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerDocked,
);
},
),
......@@ -380,7 +500,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
bool validateFields() {
String? newRemarkError =
remarkController.text.trim().isEmpty ? "Remark required" : null;
remarkController.text.trim().isEmpty
? "Remark required"
: null;
if (remarkError != newRemarkError) {
updateState(() {
......@@ -390,23 +512,30 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
return newRemarkError == null;
}
Widget errorText(String? msg) => msg == null
? const SizedBox()
: Padding(
padding: EdgeInsets.only(top: 4 * scaleFactor, left: 4 * scaleFactor),
child: Text(
msg,
style: TextStyle(
color: Colors.red,
fontSize: 12 * scaleFactor,
fontFamily: "JakartaMedium",
),
),
);
Widget errorText(String? msg) =>
msg == null
? const SizedBox()
: Padding(
padding: EdgeInsets.only(
top: 4 * scaleFactor,
left: 4 * scaleFactor,
),
child: Text(
msg,
style: TextStyle(
color: Colors.red,
fontSize: 12 * scaleFactor,
fontFamily: "JakartaMedium",
),
),
);
return SafeArea(
child: Container(
margin: EdgeInsets.symmetric(horizontal: 15 * scaleFactor, vertical: 10 * scaleFactor),
margin: EdgeInsets.symmetric(
horizontal: 15 * scaleFactor,
vertical: 10 * scaleFactor,
),
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom,
),
......@@ -461,8 +590,8 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
),
border: InputBorder.none,
contentPadding: EdgeInsets.symmetric(
horizontal: 12 * scaleFactor,
vertical: 12 * scaleFactor
horizontal: 12 * scaleFactor,
vertical: 12 * scaleFactor,
),
),
),
......@@ -480,7 +609,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
height: 45 * scaleFactor,
decoration: BoxDecoration(
color: Color(0x12AAAAAA),
borderRadius: BorderRadius.circular(12 * scaleFactor),
borderRadius: BorderRadius.circular(
12 * scaleFactor,
),
),
child: Center(
child: Text(
......@@ -510,7 +641,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
}
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text("Request submitted successfully"),
content: Text(
"Request submitted successfully",
),
backgroundColor: Colors.green,
behavior: SnackBarBehavior.floating,
),
......@@ -521,7 +654,9 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
height: 45 * scaleFactor,
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(12 * scaleFactor),
borderRadius: BorderRadius.circular(
12 * scaleFactor,
),
),
child: Center(
child: Text(
......@@ -538,7 +673,7 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
),
],
),
SizedBox(height: 2 * scaleFactor)
SizedBox(height: 2 * scaleFactor),
],
),
),
......@@ -591,7 +726,12 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
}
/// For date range display
Widget _buildDateRangeTile(String label, String? fromDate, String? toDate, double scaleFactor) {
Widget _buildDateRangeTile(
String label,
String? fromDate,
String? toDate,
double scaleFactor,
) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 6 * scaleFactor),
child: Row(
......@@ -631,8 +771,14 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
}
/// For time range display
Widget _buildTimeRangeTile(String label, String? fromTime, String? toTime, double scaleFactor) {
if ((fromTime == null || fromTime.isEmpty) && (toTime == null || toTime.isEmpty)) {
Widget _buildTimeRangeTile(
String label,
String? fromTime,
String? toTime,
double scaleFactor,
) {
if ((fromTime == null || fromTime.isEmpty) &&
(toTime == null || toTime.isEmpty)) {
return const SizedBox.shrink();
}
......@@ -684,10 +830,7 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
children: [
Text(
title,
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaSemiBold",
),
style: TextStyle(fontSize: 14, fontFamily: "JakartaSemiBold"),
),
SizedBox(width: 10 * scaleFactor),
Expanded(
......@@ -729,4 +872,4 @@ class _LeaveApplicationDetailScreenState extends State<LeaveApplicationDetailScr
return AppColors.requested_text_color;
}
}
}
\ No newline at end of file
}
......@@ -16,222 +16,286 @@ class TourExpensesListScreen extends StatefulWidget {
}
class _TourExpensesListScreenState extends State<TourExpensesListScreen> {
final ScrollController _scrollController = ScrollController();
int _currentPage = 1;
bool _isLoadingMore = false;
bool _hasMoreItems = true;
@override
void initState() {
super.initState();
_scrollController.addListener(_scrollListener);
// fetch first page only once
Future.microtask(() {
final provider =
Provider.of<TourExpensesProvider>(context, listen: false);
provider.fetchTourExpenses(context, "1");
});
}
@override
void dispose() {
_scrollController.removeListener(_scrollListener);
_scrollController.dispose();
super.dispose();
}
void _scrollListener() {
if (_scrollController.position.pixels ==
_scrollController.position.maxScrollExtent) {
_loadMoreItems(context);
}
}
void _loadMoreItems(BuildContext context) {
if (_isLoadingMore || !_hasMoreItems) return;
final provider = Provider.of<TourExpensesProvider>(context, listen: false);
setState(() {
_isLoadingMore = true;
_currentPage++;
});
provider
.fetchTourExpenses(context, _currentPage.toString(), append: true)
.then((_) {
setState(() {
_isLoadingMore = false;
final newItems = provider.response?.tourList ?? [];
if (newItems.length < _currentPage * 10) {
// assuming API gives 10 items per page
_hasMoreItems = false;
}
});
}).catchError((_) {
setState(() {
_isLoadingMore = false;
_currentPage--; // rollback
});
});
}
void _refreshList(BuildContext context) {
final provider = Provider.of<TourExpensesProvider>(context, listen: false);
setState(() {
_currentPage = 1;
_hasMoreItems = true;
_isLoadingMore = false;
});
provider.fetchTourExpenses(context, "1");
}
@override
Widget build(BuildContext context) {
return SafeArea(
top: false,
child: ChangeNotifierProvider(
create: (_) => TourExpensesProvider()..fetchTourExpenses(context, "1"),
child: Consumer<TourExpensesProvider>(
builder: (context, provider, child) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: Colors.white,
title: Row(
children: [
InkResponse(
onTap: () => Navigator.pop(context, true),
child: SvgPicture.asset(
"assets/svg/appbar_back_button.svg",
height: 25,
),
child: Consumer<TourExpensesProvider>(
builder: (context, provider, child) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
backgroundColor: Colors.white,
title: Row(
children: [
InkResponse(
onTap: () => Navigator.pop(context, true),
child: SvgPicture.asset(
"assets/svg/appbar_back_button.svg",
height: 25,
),
const SizedBox(width: 10),
const Text(
"Tour Expenses",
style: TextStyle(
fontSize: 18,
fontFamily: "Plus Jakarta Sans",
fontWeight: FontWeight.w600,
color: Colors.black87,
),
),
const SizedBox(width: 10),
const Text(
"Tour Expenses",
style: TextStyle(
fontSize: 18,
fontFamily: "Plus Jakarta Sans",
fontWeight: FontWeight.w600,
color: Colors.black87,
),
],
),
),
],
),
),
backgroundColor: const Color(0xFFF6F6F8),
body: _buildBody(provider),
bottomNavigationBar: _buildBottomBar(context),
);
},
),
);
}
backgroundColor: const Color(0xFFF6F6F8),
body: Column(
children: [
Expanded(
child: Builder(
builder: (context) {
if (provider.isLoading) {
return const Center(
child: CircularProgressIndicator(color: Colors.blue));
}
if (provider.errorMessage != null) {
return Center(child: Text(provider.errorMessage!));
}
if (provider.response?.tourList == null ||
provider.response!.tourList!.isEmpty) {
return const Center(child: Text("No Tour Expenses Found"));
}
final list = provider.response!.tourList!;
return ListView.builder(
padding: const EdgeInsets.all(12),
itemCount: list.length,
itemBuilder: (context, index) {
final TourList item = list[index];
Widget _buildBody(TourExpensesProvider provider) {
if (provider.isLoading && _currentPage == 1) {
return const Center(
child: CircularProgressIndicator(color: Colors.blue));
}
if (provider.errorMessage != null) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(provider.errorMessage!),
const SizedBox(height: 16),
ElevatedButton(
onPressed: () => _refreshList(context),
child: const Text("Retry"),
),
],
),
);
}
if (provider.response?.tourList == null ||
provider.response!.tourList!.isEmpty) {
return const Center(child: Text("No Tour Expenses Found"));
}
return InkWell(
onTap: () {
/// navigation flow
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => TourExpensesDetailsScreen(
tourBillId: item.id.toString(),
),
),
);
},
child: Container(
margin: const EdgeInsets.symmetric(vertical: 6),
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Row(
children: [
/// Left Avatar Circle
Container(
height: 46,
width: 46,
decoration: BoxDecoration(
color: _getAvatarColor(item.approvalStatus),
shape: BoxShape.circle,
),
child: Center(
child: Text(
getText(item.approvalStatus),
style: TextStyle(
fontSize: 15,
fontFamily: "Plus Jakarta Sans",
fontWeight: FontWeight.w500,
color: _getAvatarTxtColor(item.approvalStatus),
),
),
),
),
const SizedBox(width: 12),
final list = provider.response!.tourList!;
return RefreshIndicator(
onRefresh: () async {
_refreshList(context);
},
child: ListView.builder(
controller: _scrollController,
padding: const EdgeInsets.all(12),
itemCount: list.length + (_hasMoreItems ? 1 : 0),
itemBuilder: (context, index) {
if (index >= list.length) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 16),
child: Center(
child: _isLoadingMore
? const CircularProgressIndicator(color: Colors.blue)
: !_hasMoreItems
? const Text("No more items to load")
: const SizedBox.shrink(),
),
);
}
/// Middle Section
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
item.placeOfVisit ?? "-",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
item.appliedDate ?? "-",
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.grey_semi,
),
),
],
),
),
final TourList item = list[index];
return _buildItem(context, item);
},
),
);
}
/// Right Section (Applied Amount)
Text(
"₹${item.appliedAmount ?? '0'}",
style: const TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xff1487c9),
)
),
],
),
),
);
},
);
},
),
Widget _buildItem(BuildContext context, TourList item) {
return InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
TourExpensesDetailsScreen(tourBillId: item.id.toString()),
),
);
},
child: Container(
margin: const EdgeInsets.symmetric(vertical: 6),
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 12),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Row(
children: [
Container(
height: 46,
width: 46,
decoration: BoxDecoration(
color: _getAvatarColor(item.approvalStatus),
shape: BoxShape.circle,
),
child: Center(
child: Text(
getText(item.approvalStatus),
style: TextStyle(
fontSize: 15,
fontFamily: "Plus Jakarta Sans",
fontWeight: FontWeight.w500,
color: _getAvatarTxtColor(item.approvalStatus),
),
],
),
),
bottomNavigationBar: Container(
padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 10),
color: Colors.white,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xff1487c9), // App blue
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
const SizedBox(width: 12),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
item.placeOfVisit ?? "-",
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
padding: const EdgeInsets.symmetric(vertical: 14),
elevation: 0, // Optional: remove shadow
),
onPressed: () {
HapticFeedback.selectionClick();
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => const AddBillScreen(pageTitleName: "Add Bill"),
settings: const RouteSettings(name: 'AddTourExpBillScreen'),
),
).then((_) {
provider.fetchTourExpenses(context, "1");
});
},
child: const Text(
"Add Bill",
Text(
item.appliedDate ?? "-",
style: TextStyle(
fontSize: 16,
fontFamily: "JakartaMedium",
fontWeight: FontWeight.w500,
color: Colors.white,
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.grey_semi,
),
),
),
],
),
),
Text(
"₹${item.appliedAmount ?? '0'}",
style: const TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xff1487c9),
),
),
],
),
),
);
}
// /// Bottom Add Bill Button
// bottomNavigationBar: Container(
// padding: const EdgeInsets.all(18),
// color: Colors.white,
// child: ElevatedButton(
// style: ElevatedButton.styleFrom(
// backgroundColor: Color(0xff1487c9),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(15),
// ),
// padding: const EdgeInsets.symmetric(vertical: 14),
// ),
// onPressed: () {
// // to work
// },
// child: const Text(
// "Add Bill",
// style: TextStyle(
// fontSize: 16,
// fontFamily: "Plus Jakarta Sans",
// fontWeight: FontWeight.w500,
// color: Colors.white,
// ),
// ),
// ),
// ),
);
},
Widget _buildBottomBar(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 18, vertical: 10),
color: Colors.white,
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: const Color(0xff1487c9),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
),
padding: const EdgeInsets.symmetric(vertical: 14),
elevation: 0,
),
onPressed: () {
HapticFeedback.selectionClick();
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
const AddBillScreen(pageTitleName: "Add Bill"),
settings: const RouteSettings(name: 'AddTourExpBillScreen'),
),
).then((_) {
_refreshList(context);
});
},
child: const Text(
"Add Bill",
style: TextStyle(
fontSize: 16,
fontFamily: "JakartaMedium",
fontWeight: FontWeight.w500,
color: Colors.white,
),
),
),
);
......@@ -260,11 +324,11 @@ class _TourExpensesListScreenState extends State<TourExpensesListScreen> {
return AppColors.rejected_text_color;
case 'Expired at TL':
return AppColors.rejected_text_color;
}
return color;
}
getText(value) {
String getText(value) {
switch (value) {
case 'HR Approved':
return "A";
......@@ -278,5 +342,4 @@ class _TourExpensesListScreenState extends State<TourExpensesListScreen> {
return "R";
}
}
}
}
\ No newline at end of file
......@@ -36,29 +36,37 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
final ScrollController _scrollController = ScrollController();
@override
void initState() {
// TODO: implement initState
super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var provider = Provider.of<Pagesdashboardprovider>(
context,
listen: false,
);
WidgetsBinding.instance.addPostFrameCallback((_) {
final provider = Provider.of<Pagesdashboardprovider>(context, listen: false);
provider.resetPagination();
provider.ordersListByModeFilterAPIFunction(context, widget.mode);
provider.ordersListByModeAPIFunction(context, widget.mode, "", "");
});
_scrollController.addListener(() {
if (_scrollController.position.pixels >=
_scrollController.position.maxScrollExtent - 200) {
final provider = Provider.of<Pagesdashboardprovider>(context, listen: false);
provider.loadMore(context, widget.mode, "", "");
}
});
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_scrollController.dispose();
_connectivity.disposeStream();
super.dispose();
}
Color getDecorationColor(value) {
......@@ -212,467 +220,183 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
0xFFFFFFFF,
),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(
child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
body: provider.isLoading && ordersList.isEmpty
? Center(
child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(AppColors.app_blue),
),
)
: ordersList.isNotEmpty
? RefreshIndicator(
onRefresh: () async {
provider.resetPagination();
await provider.ordersListByModeAPIFunction(
context,
widget.mode,
"",
"",
);
},
child: ListView.builder(
controller: _scrollController,
itemCount: ordersList.length + (provider.hasMoreData ? 1 : 0),
itemBuilder: (context, ol) {
if (ol == ordersList.length) {
return provider.isLoadingMore
? const Padding(
padding: EdgeInsets.all(16),
child: Center(child: CircularProgressIndicator()),
)
: const SizedBox.shrink();
}
final order = ordersList[ol];
return InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Ordersdetailsbymodes(
pageTitleName: widget.pageTitleName,
orderId: ordersList[ol].orderId,
mode: widget.mode,
),
settings: RouteSettings(name: "Ordersdetailsbymodes")
),
);
if (routeSettingName == "Ordersdetailsbymodes") {
provider.ordersListByModeFilterAPIFunction(
context,
widget.mode,
);
provider.ordersListByModeAPIFunction(
context,
widget.mode,
"",
"",
);
}
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 7.5,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
)
: ordersList.isNotEmpty
? SingleChildScrollView(
child: Column(
children: [
ListView.builder(
itemCount: ordersList.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, ol) {
if (ordersList.isEmpty) {
return SizedBox(
child: Center(child: Text("No Data Available")),
);
}
return InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Ordersdetailsbymodes(
pageTitleName: widget.pageTitleName,
orderId: ordersList[ol].orderId,
mode: widget.mode,
),
settings: RouteSettings(name: "Ordersdetailsbymodes")
),
);
if (routeSettingName == "Ordersdetailsbymodes") {
provider.ordersListByModeFilterAPIFunction(
context,
widget.mode,
);
provider.ordersListByModeAPIFunction(
context,
widget.mode,
"",
"",
);
}
},
Row(
children: [
Expanded(
flex: 1,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 7.5,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
height: 50,
width: 50,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
color: getDecorationColor(
ordersList[ol].status,
),
shape: BoxShape.circle,
),
child: Column(
children: [
Row(
children: [
// Expanded(
// flex: 1,
// child: Container(
// height: 50,
// width: 35,
// padding: EdgeInsets.all(8.0),
// decoration: BoxDecoration(
// color: Color(0xFFFFF3CE),
// borderRadius: BorderRadius.circular(
// 8,
// ),
// ),
// child: SvgPicture.asset(
// "assets/svg/fin_ic.svg",
// ),
// ),
// ),
Expanded(
flex: 1,
child: Container(
height: 50,
width: 50,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: getDecorationColor(
ordersList[ol].status,
),
shape: BoxShape.circle,
),
child: Center(
child: Text(
getText(
ordersList[ol].status,
),
style: TextStyle(
color: getTextColor(
ordersList[ol].status,
),
fontSize: getSize(
ordersList[ol].status,
),
fontFamily: "JakartaBold",
),
),
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
ordersList[ol]
.accountName!,
maxLines: 1,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
ordersList[ol]
.orderNumber!,
style: TextStyle(
fontSize: 14,
color: AppColors.grey_semi,
fontFamily:
"JakartaRegular",
decoration:
TextDecoration.none,
decorationColor:
AppColors.white,
),
),
],
),
),
),
SizedBox(width: 10),
Expanded(
flex: 2,
child: Container(
child: Text(
"₹"
"${ordersList[ol].balanceAmount}",
textAlign: TextAlign.right,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
),
],
child: Center(
child: Text(
getText(
ordersList[ol].status,
),
],
),
),
);
},
),
],
),
)
: Emptywidget(context),
);
},
);
}
Widget _scaffold1(BuildContext context) {
return Consumer<Pagesdashboardprovider>(
builder: (context, provider, child) {
final ordersList = provider.ordersList;
return Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2(
context,
widget.pageTitleName,
provider.resetAll,
Row(
children: [
// InkResponse(
// onTap: () {
// _showOptionsSheet(context);
// },
// child: SvgPicture.asset("assets/svg/ic_download.svg"),
// ),
InkResponse(
onTap: () async {
_showFilterSheet(context);
},
child: SvgPicture.asset(
"assets/svg/filter_ic.svg",
height: 25,
),
),
],
),
),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(
child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue,
),
),
)
: ordersList.isNotEmpty
? SingleChildScrollView(
child: Column(
children: [
ListView.builder(
itemCount: ordersList.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (ordersList.isEmpty) {
return SizedBox(
child: Center(child: Text("No Data Available")),
);
}
return Container(
padding: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 10,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Color(0xFFFFF3CE),
borderRadius: BorderRadius.circular(
8,
),
),
child: SvgPicture.asset(
"assets/svg/fin_ic.svg",
),
),
style: TextStyle(
color: getTextColor(
ordersList[ol].status,
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
ordersList[index].accountName!,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
Text(
"₹"
"${ordersList[index].balanceAmount}",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
],
),
),
),
Expanded(
flex: 2,
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 5,
vertical: 10,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(
8,
),
color: Color(0xFFE3FFE0),
),
child: Center(
child: Text(
ordersList[index].status!,
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xFF0D9C00),
),
),
),
),
fontSize: getSize(
ordersList[ol].status,
),
],
),
Divider(
thickness: 0.5,
color: Color(0xFFD7D7D7),
fontFamily: "JakartaBold",
),
),
...List.generate(5, (j) {
final headings = [
"Order Number",
"Entered Employee",
"Sales Person",
// "Date",
"Paid Amount",
"Balance Amount",
];
final subHeadings = [
ordersList[index].orderNumber,
ordersList[index].enteredEmpName,
ordersList[index].salesPersonEmpName,
// ordersList[index].createdDatetime,
ordersList[index].paidAmount,
ordersList[index].balanceAmount,
];
return Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: InkResponse(
child: Text(
subHeadings[j]!,
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
decoration:
TextDecoration.none,
decorationColor:
AppColors.white,
),
),
),
),
],
),
);
}),
InkResponse(
onTap: () async {
var res = await Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Ordersdetailsbymodes(
pageTitleName:
widget.pageTitleName,
orderId:
ordersList[index].orderId,
mode: widget.mode,
),
),
);
if (res == true) {
provider
.ordersListByModeFilterAPIFunction(
context,
widget.mode,
);
provider.ordersListByModeAPIFunction(
context,
widget.mode,
"",
"",
);
}
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5,
),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
ordersList[ol]
.accountName!,
maxLines: 1,
overflow:
TextOverflow.ellipsis,
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.start,
children: [
Text(
"View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
SizedBox(width: 5),
SvgPicture.asset(
"assets/svg/next_button.svg",
),
],
),
Text(
ordersList[ol]
.orderNumber!,
style: TextStyle(
fontSize: 14,
color: AppColors.grey_semi,
fontFamily:
"JakartaRegular",
decoration:
TextDecoration.none,
decorationColor:
AppColors.white,
),
),
],
),
),
),
SizedBox(width: 10),
Expanded(
flex: 3,
child: Container(
child: Text(
"₹"
"${ordersList[ol].balanceAmount}",
textAlign: TextAlign.right,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
],
),
),
);
},
),
],
),
],
),
)
: Emptywidget(context),
),
);
},
),
)
: Emptywidget(context),
);
},
);
}
Future<void> _showOptionsSheet(BuildContext context) {
return showModalBottomSheet(
useSafeArea: true,
......@@ -943,8 +667,8 @@ class _OrderslistbyModesState extends State<OrderslistbyModes> {
provider.ordersListByModeAPIFunction(
context,
widget.mode,
provider.selectedEmpID,
provider.selectedLeadType,
provider.selectedEmpID.toString(),
provider.selectedLeadType.toString(),
);
},
child: Container(
......
......@@ -117,30 +117,37 @@ class _PaymentlistsbymodeState extends State<Paymentlistsbymode> {
}
return 18.0;
}
final ScrollController _scrollController = ScrollController();
@override
void initState() {
// TODO: implement initState
super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var provider = Provider.of<Paymentsprovider>(
context,
listen: false,
);
WidgetsBinding.instance.addPostFrameCallback((_) {
final provider = Provider.of<Paymentsprovider>(context, listen: false);
provider.resetPagination();
provider.paymentsListsByModeFilterAPIFunction(context, widget.mode);
provider.paymentsListsByModeAPIFunction(context, widget.mode, "",);
provider.paymentsListsByModeAPIFunction(context, widget.mode, "");
});
_scrollController.addListener(() {
if (_scrollController.position.pixels >=
_scrollController.position.maxScrollExtent - 200) {
final provider = Provider.of<Paymentsprovider>(context, listen: false);
provider.loadMore(context, widget.mode, "");
}
});
}
@override
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_scrollController.dispose();
_connectivity.disposeStream();
super.dispose();
}
@override
......@@ -207,169 +214,162 @@ class _PaymentlistsbymodeState extends State<Paymentlistsbymode> {
0xFFFFFFFF
),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
))
: paymentLists.isNotEmpty ? SingleChildScrollView(
child: Column(
children: [
ListView.builder(
itemCount: paymentLists.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (paymentLists.isEmpty) {
return SizedBox(
child: Center(
child: Text("No Data Available"),
),
);
}
return InkResponse(
onTap: () async {
Navigator.push(context, MaterialPageRoute(
builder: (context) =>
Paymentdetailsbymode(mode: widget.mode,
pageTitleName: widget.pageTitleName,
paymentId: paymentLists[index].paymentId,
),));
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 7.5,
vertical: 5,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
body: provider.isLoading && paymentLists.isEmpty
? Center(
child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(AppColors.app_blue),
),
)
: paymentLists.isNotEmpty
? RefreshIndicator(
onRefresh: () async {
provider.resetPagination();
await provider.paymentsListsByModeAPIFunction(
context,
widget.mode,
"",
);
},
child: ListView.builder(
controller: _scrollController,
itemCount: paymentLists.length + (provider.hasMoreData ? 1 : 0),
itemBuilder: (context, index) {
if (index == paymentLists.length) {
return provider.isLoadingMore
? const Padding(
padding: EdgeInsets.all(16),
child: Center(child: CircularProgressIndicator()),
)
: const SizedBox.shrink();
}
final payment = paymentLists[index];
return InkResponse(
onTap: () async {
Navigator.push(context, MaterialPageRoute(
builder: (context) =>
Paymentdetailsbymode(mode: widget.mode,
pageTitleName: widget.pageTitleName,
paymentId: paymentLists[index].paymentId,
),));
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 7.5,
vertical: 5,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
Row(
children: [
// Expanded(
// flex: 1,
// child: Container(
// height: 50,
// width: 35,
// padding: EdgeInsets.all(8.0),
// decoration: BoxDecoration(
// color: Color(0xFFFFF3CE),
// borderRadius:
// BorderRadius.circular(8),
// ),
// child: SvgPicture.asset(
// "assets/svg/fin_ic.svg",
// ),
// ),
// ),
Expanded(
flex: 1,
child: Container(
height: 50,
width: 50,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: getDecorationColor(
Expanded(
flex: 1,
child: Container(
height: 50,
width: 50,
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: getDecorationColor(
paymentLists[index].status,
),
shape: BoxShape.circle,
),
child: Center(
child: Text(
getText(
paymentLists[index].status,
),
style: TextStyle(
color: getTextColor(
paymentLists[index].status,
),
shape: BoxShape.circle,
),
child: Center(
child: Text(
getText(
paymentLists[index].status,
),
style: TextStyle(
color: getTextColor(
paymentLists[index].status,
),
fontSize: getSize(
paymentLists[index].status,
),
fontFamily: "JakartaBold",
),
fontSize: getSize(
paymentLists[index].status,
),
fontFamily: "JakartaBold",
),
),
),
SizedBox(width: 10),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
paymentLists[index].ename!,
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color:
AppColors.semi_black,
),
),
Text(
paymentLists[index]
.orderNumber??"-",
style: TextStyle(
fontSize: 14,
color: AppColors.grey_semi,
fontFamily:
"JakartaRegular",
decoration:
TextDecoration.none,
decorationColor:
AppColors.white,
),
),
],
),
),
SizedBox(width: 10),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
paymentLists[index].ename!,
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color:
AppColors.semi_black,
),
),
),
),
Expanded(
flex: 2,
child: Container(
child: Center(
child: Text(
"₹"
"${paymentLists[index].amount}",
textAlign: TextAlign.right,
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
Text(
paymentLists[index]
.orderNumber??"-",
style: TextStyle(
fontSize: 14,
color: AppColors.grey_semi,
fontFamily:
"JakartaRegular",
decoration:
TextDecoration.none,
decorationColor:
AppColors.white,
),
),
),
],
),
],
),
),
Expanded(
flex: 2,
child: Container(
child: Center(
child: Text(
"₹"
"${paymentLists[index].amount}",
textAlign: TextAlign.right,
style: TextStyle(
fontFamily:
"JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
),
),
),
],
),
),
);
},
),
],
],
),
),
);
},
),
) : Emptywidget(context),
)
: Emptywidget(context),
);
},
);
......@@ -844,7 +844,7 @@ class _PaymentlistsbymodeState extends State<Paymentlistsbymode> {
onTap: () {
Navigator.pop(context);
provider.paymentsListsByModeAPIFunction(
context, widget.mode, provider.selectedEmpID);
context, widget.mode, provider.selectedEmpID.toString());
},
child: Container(
height: 45,
......
......@@ -27,31 +27,38 @@ class _TpcagentissuelistState extends State<Tpcagentissuelist> {
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
final ScrollController _scrollController = ScrollController();
@override
void initState() {
// TODO: implement initState
super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var provider = Provider.of<Tpcagentsprovider>(
context,
listen: false,
);
WidgetsBinding.instance.addPostFrameCallback((_) {
final provider = Provider.of<Tpcagentsprovider>(context, listen: false);
provider.resetPagination(); // clear before first load
provider.TPCAgentsIssueListAPIFunction(context);
});
_scrollController.addListener(() {
if (_scrollController.position.pixels >=
_scrollController.position.maxScrollExtent - 200) {
final provider = Provider.of<Tpcagentsprovider>(context, listen: false);
provider.loadMoreIssues(context);
}
});
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_scrollController.dispose();
_connectivity.disposeStream();
super.dispose();
}
@override
Widget build(BuildContext context) {
switch (_source.keys.toList()[0]) {
......@@ -108,134 +115,141 @@ class _TpcagentissuelistState extends State<Tpcagentissuelist> {
0xFFFFFFFF
),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
))
: tpcAgentsIssueList.isNotEmpty ? SingleChildScrollView(
child: Column(
children: [
ListView.builder(
itemCount: tpcAgentsIssueList.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (tpcAgentsIssueList.isEmpty) {
return SizedBox(
child: Center(
child: Text("No Data Available"),
),
);
}
return InkResponse(
onTap: () async {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Tpcagentissuelistdetails(
pageTitleName: "CRM Order Details",
mode: widget.mode,
orderId: tpcAgentsIssueList[index].orderId,
),
),
);
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 7.5,
vertical: 5,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
body: provider.isLoading && tpcAgentsIssueList.isEmpty
? Center(
child: CircularProgressIndicator.adaptive(
valueColor:
AlwaysStoppedAnimation<Color>(AppColors.app_blue),
),
)
: tpcAgentsIssueList.isNotEmpty
? RefreshIndicator(
onRefresh: () async {
provider.resetPagination();
await provider.TPCAgentsIssueListAPIFunction(context);
},
child: ListView.builder(
controller: _scrollController,
itemCount: tpcAgentsIssueList.length +
(provider.hasMoreData ? 1 : 0),
itemBuilder: (context, index) {
if (index == tpcAgentsIssueList.length) {
return provider.isLoadingMore
? const Padding(
padding: EdgeInsets.all(16),
child: Center(
child: CircularProgressIndicator()),
)
: const SizedBox.shrink();
}
final issue = tpcAgentsIssueList[index];
return InkResponse(
onTap: () async {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) =>
Tpcagentissuelistdetails(
pageTitleName: "CRM Order Details",
mode: widget.mode,
orderId: tpcAgentsIssueList[index].orderId,
),
),
);
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 7.5,
vertical: 5,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
child: SvgPicture.asset(
"assets/svg/order/tpc_list_ic.svg",
),
),
child: SvgPicture.asset(
"assets/svg/order/tpc_list_ic.svg",
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
tpcAgentsIssueList[index].name!,
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color:
AppColors.semi_black,
),
),
Text(
"${tpcAgentsIssueList[index].aname}",
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color: AppColors.grey_semi,
),
),
],
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
tpcAgentsIssueList[index].name!,
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color:
AppColors.semi_black,
),
),
),
),
SizedBox(width: 10),
Expanded(
flex: 1,
child: InkResponse(
onTap: () {
launch(
'tel://${tpcAgentsIssueList[index]
.mobileNumber}',
);
},
child: SizedBox(
height: 35,
width: 35,
child: SvgPicture.asset(
"assets/svg/crm/lead_list_call_ic.svg",
Text(
"${tpcAgentsIssueList[index].aname}",
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color: AppColors.grey_semi,
),
),
],
),
),
),
SizedBox(width: 10),
Expanded(
flex: 1,
child: InkResponse(
onTap: () {
launch(
'tel://${tpcAgentsIssueList[index]
.mobileNumber}',
);
},
child: SizedBox(
height: 35,
width: 35,
child: SvgPicture.asset(
"assets/svg/crm/lead_list_call_ic.svg",
),
),
],
),
),
],
),
),
);
},
),
],
],
),
),
);
},
),
) : Emptywidget(context),
)
: Emptywidget(context),
);
},
);
......
......@@ -27,30 +27,36 @@ class Tpcagentlistbymode extends StatefulWidget {
class _TpcagentlistbymodeState extends State<Tpcagentlistbymode> {
Map _source = {ConnectivityResult.mobile: true};
final MyConnectivity _connectivity = MyConnectivity.instance;
final ScrollController _scrollController = ScrollController();
@override
void initState() {
// TODO: implement initState
super.initState();
_connectivity.initialise();
_connectivity.myStream.listen((source) {
setState(() => _source = source);
});
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
var provider = Provider.of<Tpcagentsprovider>(
context,
listen: false,
);
WidgetsBinding.instance.addPostFrameCallback((_) {
final provider = Provider.of<Tpcagentsprovider>(context, listen: false);
provider.resetPagination();
provider.TPCAgentsListAPIFunction(context, widget.mode);
});
_scrollController.addListener(() {
if (_scrollController.position.pixels >=
_scrollController.position.maxScrollExtent - 200) {
final provider = Provider.of<Tpcagentsprovider>(context, listen: false);
provider.loadMore(context, widget.mode);
}
});
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
_scrollController.dispose();
_connectivity.disposeStream();
super.dispose();
}
......@@ -110,138 +116,148 @@ class _TpcagentlistbymodeState extends State<Tpcagentlistbymode> {
0xFFFFFFFF
),
backgroundColor: AppColors.scaffold_bg_color,
body:
provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
))
: tpcAgentsLists.isNotEmpty ? SingleChildScrollView(
child: Column(
children: [
ListView.builder(
itemCount: tpcAgentsLists.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemBuilder: (context, index) {
if (tpcAgentsLists.isEmpty) {
return SizedBox(
child: Center(
child: Text("No Data Available"),
),
);
}
return InkResponse(
onTap: () async {
Navigator.push(context, MaterialPageRoute(
builder: (context) =>
Tpcagentdetailsbymode(mode: widget.mode,
pageTitleName: widget.pageTitleName,
tpcAgentId: tpcAgentsLists[index]
.tpcAgentId,
),));
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 7.5,
vertical: 5,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
body: provider.isLoading && tpcAgentsLists.isEmpty
? Center(
child: CircularProgressIndicator.adaptive(
valueColor:
AlwaysStoppedAnimation<Color>(AppColors.app_blue),
),
)
: tpcAgentsLists.isNotEmpty
? RefreshIndicator(
onRefresh: () async {
provider.resetPagination();
await provider.TPCAgentsListAPIFunction(
context,
widget.mode,
);
},
child: ListView.builder(
controller: _scrollController,
itemCount: tpcAgentsLists.length +
(provider.hasMoreData ? 1 : 0),
itemBuilder: (context, index) {
if (index == tpcAgentsLists.length) {
return provider.isLoadingMore
? const Padding(
padding: EdgeInsets.all(16),
child: Center(
child: CircularProgressIndicator()),
)
: const SizedBox.shrink();
}
final agent = tpcAgentsLists[index];
return InkResponse(
onTap: () async {
Navigator.push(context, MaterialPageRoute(
builder: (context) =>
Tpcagentdetailsbymode(mode: widget.mode,
pageTitleName: widget.pageTitleName,
tpcAgentId: tpcAgentsLists[index]
.tpcAgentId,
),));
},
child: Container(
padding: EdgeInsets.symmetric(
horizontal: 7.5,
vertical: 5,
),
margin: EdgeInsets.symmetric(
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Row(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
// decoration: BoxDecoration(
// color: Color(0xFFEAF7FF),
// borderRadius:
// BorderRadius.circular(8),
// ),
child: SvgPicture.asset(
"assets/svg/order/tpc_list_ic.svg",
),
),
Expanded(
flex: 1,
child: Container(
height: 50,
width: 35,
// decoration: BoxDecoration(
// color: Color(0xFFEAF7FF),
// borderRadius:
// BorderRadius.circular(8),
// ),
child: SvgPicture.asset(
"assets/svg/order/tpc_list_ic.svg",
),
SizedBox(width: 10),
Expanded(
flex: 5,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
tpcAgentsLists[index].name!,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color:
AppColors.semi_black,
),
),
Text(
"${tpcAgentsLists[index]
.mobileNumber}",
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color: AppColors.grey_semi,
),
),
],
),
),
SizedBox(width: 10),
Expanded(
flex: 5,
child: SizedBox(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Text(
tpcAgentsLists[index].name!,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color:
AppColors.semi_black,
),
),
),
),
SizedBox(width: 10),
Expanded(
flex: 1,
child: InkResponse(
onTap: () {
launch(
'tel://${tpcAgentsLists[index]
.mobileNumber}',
);
},
child: SizedBox(
height: 35,
width: 35,
child: SvgPicture.asset(
"assets/svg/crm/lead_list_call_ic.svg",
Text(
"${tpcAgentsLists[index]
.mobileNumber}",
style: TextStyle(
fontFamily:
"JakartaRegular",
fontSize: 14,
color: AppColors.grey_semi,
),
),
],
),
),
),
SizedBox(width: 10),
Expanded(
flex: 1,
child: InkResponse(
onTap: () {
launch(
'tel://${tpcAgentsLists[index]
.mobileNumber}',
);
},
child: SizedBox(
height: 35,
width: 35,
child: SvgPicture.asset(
"assets/svg/crm/lead_list_call_ic.svg",
),
),
],
),
),
],
),
),
);
},
),
],
],
),
),
);
},
),
) : Emptywidget(context),
)
: Emptywidget(context),
);
},
);
......
......@@ -143,19 +143,19 @@ class ApiCalling {
var directory = "";
if (Platform.isAndroid) {
directory = "/storage/emulated/0/Download";
var _directory = Directory(directory);
if (!_directory.existsSync()) {
var directory0 = Directory(directory);
if (!directory0.existsSync()) {
// If the directory does not exist, create it
_directory.createSync(recursive: true);
debugPrint('Directory created: $_directory');
directory0.createSync(recursive: true);
debugPrint('Directory created: $directory0');
} else {
debugPrint('Directory already exists: $_directory');
debugPrint('Directory already exists: $directory0');
}
// final androiddirectory = await getDownloadsDirectory();
// directory = androiddirectory!.path;
} else if (Platform.isIOS) {
final iosDirectory = await getApplicationSupportDirectory();
directory = iosDirectory!.path;
directory = iosDirectory.path;
}
final contentDisposition = res.headers['content-disposition'];
......@@ -175,7 +175,7 @@ class ApiCalling {
await file.writeAsBytes(bytes);
toast(
cntxt,
"File saved to your downloads as ${filename} to ${directory}, Successfully",
"File saved to your downloads as $filename to $directory, Successfully",
);
debugPrint('File saved successfully');
return jsonDecode(res.body);
......@@ -193,12 +193,12 @@ class ApiCalling {
try {
final response = await post({}, getAppVersionUrl, {});
if (response != null) {
print("${response.body}");
print(response.body);
return VersionsResponse.fromJson(jsonDecode(response.body));
} else {
return null;
}
} catch (e, s) {
} catch (e) {
return null;
}
}
......@@ -258,19 +258,19 @@ class ApiCalling {
empId,
session,
password,
conf_password,
confPassword,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'password': (password).toString(),
'confirm_password': (conf_password).toString(),
'confirm_password': (confPassword).toString(),
};
final res = await post(data, updatePasswordUrl, {});
if (res != null) {
debugPrint("update password ${res.body}");
debugPrint("update password ${data}");
debugPrint("update password $data");
return UpdatePasswordResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
......@@ -376,7 +376,7 @@ class ApiCalling {
sessioId,
location,
latlngs,
check_in_pic,
checkInPic,
) async {
try {
Map<String, String> data = {
......@@ -387,7 +387,7 @@ class ApiCalling {
};
var res;
// if (check_in_pic != null) {
res = await postImage(data, employeeChekInUrl, {}, check_in_pic);
res = await postImage(data, employeeChekInUrl, {}, checkInPic);
res = jsonDecode(res);
// } else {
// // res = await post(data, employeeChekInUrl, {});
......@@ -410,7 +410,7 @@ class ApiCalling {
sessioId,
location,
latlngs,
check_out_pic,
checkOutPic,
) async {
try {
Map<String, String> data = {
......@@ -438,7 +438,7 @@ class ApiCalling {
data,
{},
employeeCheckOutUrl,
check_out_pic,
checkOutPic,
'check_out_pic',
);
if (res != null) {
......@@ -529,13 +529,13 @@ class ApiCalling {
static Future<loadGeneratorDetailsResponse?> LoadGeneratorDetailsAPI(
empId,
session,
gen_hash_id,
genHashId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'gen_hash_id': (gen_hash_id).toString(),
'gen_hash_id': (genHashId).toString(),
};
final res = await post(data, genTrackerGeneratorDetailsUrl, {});
if (res != null) {
......@@ -554,15 +554,15 @@ class ApiCalling {
static Future<generatorComplaintResponse?> LoadGeneratorComplaintListAPI(
empId,
session,
gen_id,
open_status,
genId,
openStatus,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'gen_id': (gen_id).toString(),
'open_status': (open_status).toString(),
'gen_id': (genId).toString(),
'open_status': (openStatus).toString(),
};
final res = await post(data, genTrackerGeneratorComplaintsUrl, {});
if (res != null) {
......@@ -581,7 +581,7 @@ class ApiCalling {
static Future<TagLocationResponse?> TagLocationAPI(
empId,
session,
gen_hash_id,
genHashId,
location,
attachment,
) async {
......@@ -589,10 +589,10 @@ class ApiCalling {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'gen_hash_id': (gen_hash_id).toString(),
'gen_hash_id': (genHashId).toString(),
'location': (location).toString(),
};
print("Tag Loation: ${data}");
print("Tag Loation: $data");
var res;
if (attachment != null) {
res = await postImageNew(
......@@ -623,15 +623,15 @@ class ApiCalling {
static Future<TagGeneratorResponse?> TagGeneratorAPI(
empId,
session,
gen_hash_id,
engine_no,
genHashId,
engineNo,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'gen_hash_id': (gen_hash_id).toString(),
'engine_no': (engine_no).toString(),
'gen_hash_id': (genHashId).toString(),
'engine_no': (engineNo).toString(),
};
final res = await post(data, genTrackerTagGeneratorUrl, {});
if (res != null) {
......@@ -650,13 +650,13 @@ class ApiCalling {
static Future<TagGeneratorResponse?> TagGeneratorCheckAPI(
empId,
session,
gen_hash_id,
genHashId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'gen_hash_id': (gen_hash_id).toString(),
'gen_hash_id': (genHashId).toString(),
};
final res = await post(data, genTrackerCheckTagGeneratorUrl, {});
if (res != null) {
......@@ -675,23 +675,23 @@ class ApiCalling {
static Future<SubmitComplaintResponse?> SubmitGeneratorComplaintAPI(
empId,
session,
complaint_type_id,
complaint_category_id,
complaint_desc_id,
running_hrs,
gen_id,
complaint_note,
complaintTypeId,
complaintCategoryId,
complaintDescId,
runningHrs,
genId,
complaintNote,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'complaint_type_id': (complaint_type_id).toString(),
'complaint_category_id': (complaint_category_id).toString(),
'complaint_desc_id': (complaint_desc_id).toString(),
'running_hrs': (running_hrs).toString(),
'gen_id': (gen_id).toString(),
'complaint_note': (complaint_note).toString(),
'complaint_type_id': (complaintTypeId).toString(),
'complaint_category_id': (complaintCategoryId).toString(),
'complaint_desc_id': (complaintDescId).toString(),
'running_hrs': (runningHrs).toString(),
'gen_id': (genId).toString(),
'complaint_note': (complaintNote).toString(),
};
final res = await post(data, genTrackerRegisterComplaint, {});
if (res != null) {
......@@ -710,13 +710,13 @@ class ApiCalling {
static Future<ComplaintsSelectionResponse?> ComplaintSelectionAPI(
empId,
session,
gen_hash_id,
genHashId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'gen_hash_id': (gen_hash_id).toString(),
'gen_hash_id': (genHashId).toString(),
};
final res = await post(data, complaintsSelectionUrl, {});
if (res != null) {
......@@ -737,13 +737,13 @@ class ApiCalling {
static Future<Inventory_Part_details_response?> LoadPartDetailsAPI(
empId,
session,
part_id,
partId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'part_id': (part_id).toString(),
'part_id': (partId).toString(),
};
final res = await post(data, inventoryPartDetailsUrl, {});
if (res != null) {
......@@ -764,8 +764,8 @@ class ApiCalling {
session,
qty,
descr,
part_id,
tran_type,
partId,
tranType,
) async {
try {
Map<String, String> data = {
......@@ -773,8 +773,8 @@ class ApiCalling {
'session_id': (session).toString(),
'qty': (qty).toString(),
'descr': (descr).toString(),
'product_id': (part_id).toString(),
'tran_type': (tran_type).toString(),
'product_id': (partId).toString(),
'tran_type': (tranType).toString(),
};
final res = await post(data, inventoryStockUpdateUrl, {});
if (res != null) {
......@@ -793,17 +793,17 @@ class ApiCalling {
///technician
static Future<loadGeneratorDetailsResponse?>
LoadTechnicianGeneratorDetailsAPI(empId, session, gen_id) async {
LoadTechnicianGeneratorDetailsAPI(empId, session, genId) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'gen_id': (gen_id).toString(),
'gen_id': (genId).toString(),
};
final res = await post(data, technicianGeneratorDetailsUrl, {});
if (res != null) {
print("genderrails:${jsonDecode(res!.body)}");
print("genderrails:${jsonDecode(res.body)}");
return loadGeneratorDetailsResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
......@@ -887,7 +887,7 @@ class ApiCalling {
static Future<NearbyGeneratorsResponse?> loadNearbyGeneratorsAPI(
empId,
session,
tech_loc,
techLoc,
radius,
status,
) async {
......@@ -895,7 +895,7 @@ class ApiCalling {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'tech_loc': (tech_loc).toString(),
'tech_loc': (techLoc).toString(),
'radius': (radius).toString(),
'status': (status).toString(),
};
......@@ -917,13 +917,13 @@ class ApiCalling {
static Future<AccountSuggestionResonse?> AccountSuggestionAPI(
empId,
session,
search_string,
searchString,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'search_string': (search_string).toString(),
'search_string': (searchString).toString(),
};
final res = await post(data, technicianAccountSearchUrl, {});
if (res != null) {
......@@ -966,16 +966,16 @@ class ApiCalling {
empId,
session,
type,
gen_id,
account_id,
genId,
accountId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'type': (type).toString(),
'gen_id': (gen_id).toString(),
'account_id': (account_id).toString(),
'gen_id': (genId).toString(),
'account_id': (accountId).toString(),
};
print(data);
final res = await post(data, technicianAddPaymentUrl, {});
......@@ -996,26 +996,26 @@ class ApiCalling {
TechnicianUpdatepaymentAPI(
empId,
session,
ref_type,
ref_id,
payment_mode_id,
payment_ref_no,
refType,
refId,
paymentModeId,
paymentRefNo,
amount,
otp_validated_name,
otp_validated_mobile_number,
payment_proof,
otpValidatedName,
otpValidatedMobileNumber,
paymentProof,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'ref_type': (ref_type).toString(),
'ref_id': (ref_id).toString(),
'payment_mode_id': (payment_mode_id).toString(),
'payment_ref_no': (payment_ref_no).toString(),
'ref_type': (refType).toString(),
'ref_id': (refId).toString(),
'payment_mode_id': (paymentModeId).toString(),
'payment_ref_no': (paymentRefNo).toString(),
'amount': (amount).toString(),
'otp_validated_name': (otp_validated_name).toString(),
'otp_validated_mobile_number': (otp_validated_mobile_number).toString(),
'otp_validated_name': (otpValidatedName).toString(),
'otp_validated_mobile_number': (otpValidatedMobileNumber).toString(),
};
var res;
// if (payment_proof != null) {
......@@ -1036,13 +1036,13 @@ class ApiCalling {
// debugPrint("Null Response");
// return null;
// }
print("send otp:${data}");
if (payment_proof != null) {
print("send otp:$data");
if (paymentProof != null) {
res = await postImageNew(
data,
{},
technicianAddPaymentCollectionUrl,
payment_proof,
paymentProof,
'payment_proof',
);
......@@ -1065,14 +1065,14 @@ class ApiCalling {
TechnicianPaymentOTPValidateAPI(
empId,
session,
payment_collection_id,
paymentCollectionId,
otp,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'payment_collection_id': (payment_collection_id).toString(),
'payment_collection_id': (paymentCollectionId).toString(),
'otp': (otp).toString(),
};
final res = await post(data, technicianPaymentCollectionOtpUrl, {});
......@@ -1092,12 +1092,12 @@ class ApiCalling {
}
static Future<Technicianaddpaymentresendotpresponse?>
TechnicianPaymentOTPResendAPI(empId, session, payment_collection_id) async {
TechnicianPaymentOTPResendAPI(empId, session, paymentCollectionId) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'payment_collection_id': (payment_collection_id).toString(),
'payment_collection_id': (paymentCollectionId).toString(),
};
final res = await post(data, technicianAddPaymentResendOTPUrl, {});
if (res != null) {
......@@ -1164,13 +1164,13 @@ class ApiCalling {
static Future<ViewVisitDetailsResponseNew?> loadVisitDetailsAPI(
empId,
session,
comp_id,
compId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'comp_id': (comp_id).toString(),
'comp_id': (compId).toString(),
};
final res = await post(data, technicianComplaintDetailsUrl, {});
if (res != null) {
......@@ -1189,13 +1189,13 @@ class ApiCalling {
static Future<FollowupListResponse?> loadFollowupListAPI(
empId,
session,
comp_id,
compId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'comp_id': (comp_id).toString(),
'comp_id': (compId).toString(),
};
final res = await post(data, technicianComplaintFollowUpUrl, {});
if (res != null) {
......@@ -1214,7 +1214,7 @@ class ApiCalling {
static Future<AddContactResponse?> AddContactAPI(
empId,
session,
gen_id,
genId,
name,
designation,
mob1,
......@@ -1222,13 +1222,13 @@ class ApiCalling {
tel,
mail,
type,
account_id,
accountId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'gen_id': (gen_id).toString(),
'gen_id': (genId).toString(),
'name': (name).toString(),
'designation': (designation).toString(),
'mob1': (mob1).toString(),
......@@ -1236,7 +1236,7 @@ class ApiCalling {
'tel': (tel).toString(),
'mail': (mail).toString(),
'type': (type).toString(),
'account_id': (account_id).toString(),
'account_id': (accountId).toString(),
};
print("add: $data");
final res = await post(data, technicianAddContactUrl, {});
......@@ -1256,34 +1256,34 @@ class ApiCalling {
static Future<UpdateComplaintResponse?> UpdateComplaintAPI(
empId,
session,
complaint_id,
in_time,
complaintId,
inTime,
feedback,
fsr_no,
running_hrs,
complaint_status,
fsr_file,
fsrNo,
runningHrs,
complaintStatus,
fsrFile,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'complaint_id': (complaint_id).toString(),
'in_time': (in_time).toString(),
'complaint_id': (complaintId).toString(),
'in_time': (inTime).toString(),
'feedback': (feedback).toString(),
'fsr_no': (fsr_no).toString(),
'running_hrs': (running_hrs).toString(),
'complaint_status': (complaint_status).toString(),
'fsr_no': (fsrNo).toString(),
'running_hrs': (runningHrs).toString(),
'complaint_status': (complaintStatus).toString(),
};
// print(data);
// print(fsr_file);
var res;
if (fsr_file != null) {
if (fsrFile != null) {
res = await postImageNew(
data,
{},
technicianUpdateVisitUrl,
fsr_file,
fsrFile,
'fsr_file',
);
res = jsonDecode(res);
......@@ -1426,40 +1426,40 @@ class ApiCalling {
}
static Future<CommonResponse?> addPaymentRequestionSubmitAPI(
emp_id,
session_id,
empId,
sessionId,
type,
account_id,
requesting_purpose,
accountId,
requestingPurpose,
description,
amount,
payment_mode_id,
bank_name,
bank_branch_name,
bank_acc_number,
bank_ifsc_code,
acc_holder_name,
bank_upi_id,
approval_assignee_emp_id,
paymentModeId,
bankName,
bankBranchName,
bankAccNumber,
bankIfscCode,
accHolderName,
bankUpiId,
approvalAssigneeEmpId,
attachment,
) async {
try {
Map<String, String> data = {
'emp_id': emp_id.toString(),
'session_id': session_id.toString(),
'emp_id': empId.toString(),
'session_id': sessionId.toString(),
'type': type.toString(),
'account_id': account_id.toString(),
'requesting_purpose': requesting_purpose.toString(),
'account_id': accountId.toString(),
'requesting_purpose': requestingPurpose.toString(),
'description': description.toString(),
'amount': amount.toString(),
'payment_mode_id': payment_mode_id.toString(),
'bank_name': bank_name.toString(),
'bank_branch_name': bank_branch_name.toString(),
'bank_acc_number': bank_acc_number.toString(),
'bank_ifsc_code': bank_ifsc_code.toString(),
'acc_holder_name': acc_holder_name.toString(),
'bank_upi_id': bank_upi_id.toString(),
'approval_assignee_emp_id': approval_assignee_emp_id.toString(),
'payment_mode_id': paymentModeId.toString(),
'bank_name': bankName.toString(),
'bank_branch_name': bankBranchName.toString(),
'bank_acc_number': bankAccNumber.toString(),
'bank_ifsc_code': bankIfscCode.toString(),
'acc_holder_name': accHolderName.toString(),
'bank_upi_id': bankUpiId.toString(),
'approval_assignee_emp_id': approvalAssigneeEmpId.toString(),
};
var res;
......@@ -1486,40 +1486,40 @@ class ApiCalling {
}
static Future<addDirectPaymentResponse?> addDirectPaymentRequestionSubmitAPI(
emp_id,
session_id,
from_account_id,
to_account_id,
empId,
sessionId,
fromAccountId,
toAccountId,
description,
payment_mode_id,
paymentModeId,
amount,
payment_date,
payment_reference_number,
bank_name,
bank_branch_name,
bank_acc_number,
bank_ifsc_code,
acc_holder_name,
bank_upi_id,
paymentDate,
paymentReferenceNumber,
bankName,
bankBranchName,
bankAccNumber,
bankIfscCode,
accHolderName,
bankUpiId,
attachment,
) async {
try {
Map<String, String> data = {
'emp_id': emp_id.toString(),
'session_id': session_id.toString(),
'from_account_id': from_account_id.toString(),
'to_account_id': to_account_id.toString(),
'emp_id': empId.toString(),
'session_id': sessionId.toString(),
'from_account_id': fromAccountId.toString(),
'to_account_id': toAccountId.toString(),
'description': description.toString(),
'payment_mode_id': payment_mode_id.toString(),
'payment_mode_id': paymentModeId.toString(),
'amount': amount.toString(),
'payment_date': payment_date.toString(),
'payment_reference_number': payment_reference_number.toString(),
'bank_name': bank_name.toString(),
'bank_branch_name': bank_branch_name.toString(),
'bank_acc_number': bank_acc_number.toString(),
'bank_ifsc_code': bank_ifsc_code.toString(),
'acc_holder_name': acc_holder_name.toString(),
'bank_upi_id': bank_upi_id.toString(),
'payment_date': paymentDate.toString(),
'payment_reference_number': paymentReferenceNumber.toString(),
'bank_name': bankName.toString(),
'bank_branch_name': bankBranchName.toString(),
'bank_acc_number': bankAccNumber.toString(),
'bank_ifsc_code': bankIfscCode.toString(),
'acc_holder_name': accHolderName.toString(),
'bank_upi_id': bankUpiId.toString(),
};
print(data);
print(attachment);
......@@ -1554,40 +1554,40 @@ class ApiCalling {
static Future<addReceiptPaymentResponse?>
addReceiptPaymentRequestionSubmitAPI(
emp_id,
session_id,
from_account_id,
to_account_id,
empId,
sessionId,
fromAccountId,
toAccountId,
description,
payment_mode_id,
paymentModeId,
amount,
receipt_date,
payment_reference_number,
bank_name,
bank_branch_name,
bank_acc_number,
bank_ifsc_code,
acc_holder_name,
bank_upi_id,
receiptDate,
paymentReferenceNumber,
bankName,
bankBranchName,
bankAccNumber,
bankIfscCode,
accHolderName,
bankUpiId,
attachment,
) async {
try {
Map<String, String> data = {
'emp_id': emp_id.toString(),
'session_id': session_id.toString(),
'from_account_id': from_account_id.toString(),
'to_account_id': to_account_id.toString(),
'emp_id': empId.toString(),
'session_id': sessionId.toString(),
'from_account_id': fromAccountId.toString(),
'to_account_id': toAccountId.toString(),
'description': description.toString(),
'payment_mode_id': payment_mode_id.toString(),
'payment_mode_id': paymentModeId.toString(),
'amount': amount.toString(),
'receipt_date': receipt_date.toString(),
'payment_reference_number': payment_reference_number.toString(),
'bank_name': bank_name.toString(),
'bank_branch_name': bank_branch_name.toString(),
'bank_acc_number': bank_acc_number.toString(),
'bank_ifsc_code': bank_ifsc_code.toString(),
'acc_holder_name': acc_holder_name.toString(),
'bank_upi_id': bank_upi_id.toString(),
'receipt_date': receiptDate.toString(),
'payment_reference_number': paymentReferenceNumber.toString(),
'bank_name': bankName.toString(),
'bank_branch_name': bankBranchName.toString(),
'bank_acc_number': bankAccNumber.toString(),
'bank_ifsc_code': bankIfscCode.toString(),
'acc_holder_name': accHolderName.toString(),
'bank_upi_id': bankUpiId.toString(),
};
var res;
......@@ -1616,16 +1616,18 @@ class ApiCalling {
empId,
session,
mode,
from_date,
to_date,
fromDate,
toDate,
pageNumber,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'mode': (mode).toString(),
'from': from_date.toString(),
'to': to_date.toString(),
'from': fromDate.toString(),
'to': toDate.toString(),
'page_number': pageNumber.toString(),
};
print(data);
final res = await post(data, paymentRequestionListUrl, {});
......@@ -1645,13 +1647,13 @@ class ApiCalling {
static Future<paymentRequisitionDetailsResponse?> paymentRequestionDetailsAPI(
empId,
session,
payment_request_id,
paymentRequestId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'payment_request_id': (payment_request_id).toString(),
'payment_request_id': (paymentRequestId).toString(),
};
final res = await post(data, paymentRequestionDetailsUrl, {});
if (res != null) {
......@@ -1668,16 +1670,16 @@ class ApiCalling {
}
static Future<paymentRequestionBankDetailsResponse?>
paymentRequestionBankDetailsAPI(empId, session, account_id) async {
paymentRequestionBankDetailsAPI(empId, session, accountId) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': (account_id).toString(),
'account_id': (accountId).toString(),
};
final res = await post(data, paymentRequestBankDetailsUrl, {});
if (res != null) {
print("Bank Detaols ${data}");
print("Bank Detaols $data");
debugPrint(res.body);
return paymentRequestionBankDetailsResponse.fromJson(
jsonDecode(res.body),
......@@ -1693,16 +1695,16 @@ class ApiCalling {
}
static Future<approveRejectPaymentRequestResponse?>
approveRejectPaymentRequestAPI(empId, session, payment_request_id) async {
approveRejectPaymentRequestAPI(empId, session, paymentRequestId) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'payment_request_id': (payment_request_id).toString(),
'payment_request_id': (paymentRequestId).toString(),
};
final res = await post(data, approveRejectPaymentRequestUrl, {});
if (res != null) {
print("add payment:${data}");
print("add payment:$data");
debugPrint(res.body);
return approveRejectPaymentRequestResponse.fromJson(
jsonDecode(res.body),
......@@ -1722,8 +1724,8 @@ class ApiCalling {
empId,
session,
mode,
payment_request_id,
approve_remarks,
paymentRequestId,
approveRemarks,
) async {
try {
Map<String, String> data = {
......@@ -1731,8 +1733,8 @@ class ApiCalling {
'session_id': (session).toString(),
'type': 'reject',
'mode': mode.toString(),
'payment_request_id': (payment_request_id).toString(),
'approve_remarks': approve_remarks,
'payment_request_id': (paymentRequestId).toString(),
'approve_remarks': approveRemarks,
};
final res = await post(data, approveRejectPaymentRequestSubmitUrl, {});
if (res != null) {
......@@ -1756,10 +1758,10 @@ class ApiCalling {
empId,
session,
mode,
payment_request_id,
approved_amount,
approve_remarks,
proposed_payment_account_id,
paymentRequestId,
approvedAmount,
approveRemarks,
proposedPaymentAccountId,
) async {
try {
Map<String, String> data = {
......@@ -1767,10 +1769,10 @@ class ApiCalling {
'session_id': (session).toString(),
'type': 'approve',
'mode': mode.toString(),
'payment_request_id': (payment_request_id).toString(),
'approve_remarks': approve_remarks,
'approved_amount': approved_amount,
'proposed_payment_account_id': proposed_payment_account_id,
'payment_request_id': (paymentRequestId).toString(),
'approve_remarks': approveRemarks,
'approved_amount': approvedAmount,
'proposed_payment_account_id': proposedPaymentAccountId,
};
// print(data);
final res = await post(data, approveRejectPaymentRequestSubmitUrl, {});
......@@ -1794,11 +1796,11 @@ class ApiCalling {
empId,
session,
mode,
payment_reference_number,
payment_amount,
payment_request_id,
payment_account_id,
processing_remarks,
paymentReferenceNumber,
paymentAmount,
paymentRequestId,
paymentAccountId,
processingRemarks,
attachment,
) async {
try {
......@@ -1807,14 +1809,14 @@ class ApiCalling {
'session_id': (session).toString(),
'type': 'approve'.toString(),
'mode': mode.toString(),
'payment_reference_number': payment_reference_number.toString(),
'payment_amount': payment_amount.toString(),
'payment_request_id': (payment_request_id).toString(),
'payment_account_id': payment_account_id.toString(),
'processing_remarks': processing_remarks.toString(),
'payment_reference_number': paymentReferenceNumber.toString(),
'payment_amount': paymentAmount.toString(),
'payment_request_id': (paymentRequestId).toString(),
'payment_account_id': paymentAccountId.toString(),
'processing_remarks': processingRemarks.toString(),
};
var res;
print("Process:${data}");
print("Process:$data");
if (attachment != null) {
res = await postImageNew(
data,
......@@ -1823,7 +1825,7 @@ class ApiCalling {
attachment,
"attachment",
);
print("Process:${data}");
print("Process:$data");
res = jsonDecode(res);
print(data);
return CommonResponse.fromJson(res);
......@@ -1839,13 +1841,14 @@ class ApiCalling {
}
static Future<paymentRequisitionPaymentsListResponse?>
paymentRequisitionPaymentListAPI(empId, session, from, to) async {
paymentRequisitionPaymentListAPI(empId, session, from, to, pageNumber) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'from': (from).toString(),
'to': (to).toString(),
'page_number': (pageNumber).toString(),
};
final res = await post(data, paymentRequesitionPaymentsListUrl, {});
if (res != null) {
......@@ -1866,13 +1869,20 @@ class ApiCalling {
}
static Future<paymentRequisitionPaymentsReceiptsListResponse?>
paymentRequisitionPaymentReceiptListAPI(empId, session, from, to) async {
paymentRequisitionPaymentReceiptListAPI(
empId,
session,
from,
to,
pageNumber,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'from': (from).toString(),
'to': (to).toString(),
'page_number': (pageNumber).toString(),
};
final res = await post(
data,
......@@ -1895,12 +1905,12 @@ class ApiCalling {
}
static Future<paymentRequisitionPaymentsDetailsResponse?>
paymentRequisitionPaymentDetailsAPI(empId, session, payment_id) async {
paymentRequisitionPaymentDetailsAPI(empId, session, paymentId) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'payment_id': (payment_id).toString(),
'payment_id': (paymentId).toString(),
};
final res = await post(data, paymentRequesitionPaymentsDetailsUrl, {});
if (res != null) {
......@@ -1919,12 +1929,12 @@ class ApiCalling {
}
static Future<paymentRequisitionPaymentsReceiptsDetailsResponse?>
paymentRequisitionPaymentReceiptDetailsAPI(empId, session, payment_id) async {
paymentRequisitionPaymentReceiptDetailsAPI(empId, session, paymentId) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'payment_receipt_id': (payment_id).toString(),
'payment_receipt_id': (paymentId).toString(),
};
final res = await post(
data,
......@@ -1945,24 +1955,23 @@ class ApiCalling {
return null;
}
}
static Future<CommonResponse?> editProcessedRequestAmountAPI(
empId,
session,
process_payment_id,
approval_amount,
) async {
empId,
session,
processPaymentId,
approvalAmount,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'process_payment_id': process_payment_id.toString(),
'approval_amount': approval_amount.toString(),
'process_payment_id': processPaymentId.toString(),
'approval_amount': approvalAmount.toString(),
};
print("Process EDIT:${data}");
print("Process EDIT:$data");
var res = await post(data, paymentRequesitionEditProcessedPaymentUrl, {});
if (res != null) {
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
......@@ -2024,13 +2033,13 @@ class ApiCalling {
static Future<DistrictsResponse?> commonAddAccountViewDistrictAPI(
empId,
session,
state_id,
stateId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'state_id': state_id.toString(),
'state_id': stateId.toString(),
};
final res = await post(data, commonAddAccountViewgetDistrictUrl, {});
if (res != null) {
......@@ -2049,13 +2058,13 @@ class ApiCalling {
static Future<SubLocationsResponse?> commonAddAccountViewSubLocationAPI(
empId,
session,
district_id,
districtId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'district_id': district_id.toString(),
'district_id': districtId.toString(),
};
final res = await post(data, commonAddAccountViewgetSubLocationUrl, {});
if (res != null) {
......@@ -2075,14 +2084,14 @@ class ApiCalling {
empId,
session,
type,
type_value,
typeValue,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'type': (type).toString(),
'type_value': (type_value).toString(),
'type_value': (typeValue).toString(),
};
final res = await post(data, commonAddAccountCheckInputsUrl, {});
if (res != null) {
......@@ -2111,13 +2120,13 @@ class ApiCalling {
address,
state,
district,
sub_locality,
bank_name,
bank_branch_name,
bank_ifsc_code,
bank_account_holder_name,
bank_account_number,
bank_upi_id,
subLocality,
bankName,
bankBranchName,
bankIfscCode,
bankAccountHolderName,
bankAccountNumber,
bankUpiId,
) async {
try {
Map<String, String> data = {
......@@ -2133,13 +2142,13 @@ class ApiCalling {
'address': address.toString(),
'state': state.toString(),
'district': district.toString(),
'sub_locality': sub_locality.toString(),
'bank_name': bank_name.toString(),
'bank_branch_name': bank_branch_name.toString(),
'bank_ifsc_code': bank_ifsc_code.toString(),
'bank_account_holder_name': bank_account_holder_name.toString(),
'bank_account_number': bank_account_number.toString(),
'bank_upi_id': bank_upi_id.toString(),
'sub_locality': subLocality.toString(),
'bank_name': bankName.toString(),
'bank_branch_name': bankBranchName.toString(),
'bank_ifsc_code': bankIfscCode.toString(),
'bank_account_holder_name': bankAccountHolderName.toString(),
'bank_account_number': bankAccountNumber.toString(),
'bank_upi_id': bankUpiId.toString(),
};
final res = await post(data, commonAddAccountSubmit, {});
if (res != null) {
......@@ -2159,17 +2168,17 @@ class ApiCalling {
static Future<commonAccountlistResponse?> commonAccountListAPI(
empId,
session,
page_number,
company_name,
mobile_number,
pageNumber,
companyName,
mobileNumber,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'page_number': page_number.toString(),
'company_name': company_name.toString(),
'mobile_number': mobile_number.toString(),
'page_number': pageNumber.toString(),
'company_name': companyName.toString(),
'mobile_number': mobileNumber.toString(),
};
final res = await post(data, commonAccountListUrl, {});
if (res != null) {
......@@ -2188,13 +2197,13 @@ class ApiCalling {
static Future<commonAccountdetailsResponse?> commonAccountDetailsAPI(
empId,
session,
account_id,
accountId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': account_id.toString(),
'account_id': accountId.toString(),
};
final res = await post(data, commonAccountLedgerAccountDetails, {});
if (res != null) {
......@@ -2234,13 +2243,13 @@ class ApiCalling {
static Future<commonAccountLedgerResponse?> commonAccountLedgerListAPI(
empId,
session,
account_id,
accountId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': account_id.toString(),
'account_id': accountId.toString(),
};
print(data);
final res = await post(data, commonAccountLedgerListWithFilterUrl, {});
......@@ -2281,7 +2290,6 @@ class ApiCalling {
}
}
static Future<ordersAccessiblePagesResponse?> ordersAccesibleAddPagesAPI(
empId,
session,
......@@ -2387,13 +2395,13 @@ class ApiCalling {
static Future<addOrderAccontDetailsResponse?> addOrderAccountDetailsAPI(
empId,
session,
account_id,
accountId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': (account_id).toString(),
'account_id': (accountId).toString(),
};
final res = await post(data, ordersAddOrderAccountDetailsUrl, {});
if (res != null) {
......@@ -2440,38 +2448,38 @@ class ApiCalling {
empId,
session,
mode,
sales_person_emp_id,
selected_acc_id,
dispatch_state_id,
dispatch_district_id,
dispatch_sub_location_id,
dispatch_pincode,
dispatch_address,
basic_amount,
cgst_amount,
sgst_amount,
igst_amount,
total_amount,
order_received_date,
salesPersonEmpId,
selectedAccId,
dispatchStateId,
dispatchDistrictId,
dispatchSubLocationId,
dispatchPincode,
dispatchAddress,
basicAmount,
cgstAmount,
sgstAmount,
igstAmount,
totalAmount,
orderReceivedDate,
note,
unloading,
freight,
erection,
tpc_applicable,
billing_name,
billing_gst_no,
billing_pincode,
billing_address,
billing_state,
billing_district,
billing_sub_locality,
order_products,
lead_id,
tpcApplicable,
billingName,
billingGstNo,
billingPincode,
billingAddress,
billingState,
billingDistrict,
billingSubLocality,
orderProducts,
leadId,
feedback,
in_time,
inTime,
loc,
requested_tpc_amount,
tpc_agent_id,
requestedTpcAmount,
tpcAgentId,
po,
) async {
try {
......@@ -2479,41 +2487,41 @@ class ApiCalling {
'emp_id': empId.toString(),
'session_id': session.toString(),
'mode': mode.toString(),
'sales_person_emp_id': sales_person_emp_id.toString(),
'selected_acc_id': selected_acc_id.toString(),
'dispatch_state_id': dispatch_state_id.toString(),
'dispatch_district_id': dispatch_district_id.toString(),
'dispatch_sub_location_id': dispatch_sub_location_id.toString(),
'dispatch_pincode': dispatch_pincode.toString(),
'dispatch_address': dispatch_address.toString(),
'basic_amount': basic_amount.toString(),
'cgst_amount': cgst_amount.toString(),
'sgst_amount': sgst_amount.toString(),
'igst_amount': igst_amount.toString(),
'total_amount': total_amount.toString(),
'order_received_date': order_received_date.toString(),
'sales_person_emp_id': salesPersonEmpId.toString(),
'selected_acc_id': selectedAccId.toString(),
'dispatch_state_id': dispatchStateId.toString(),
'dispatch_district_id': dispatchDistrictId.toString(),
'dispatch_sub_location_id': dispatchSubLocationId.toString(),
'dispatch_pincode': dispatchPincode.toString(),
'dispatch_address': dispatchAddress.toString(),
'basic_amount': basicAmount.toString(),
'cgst_amount': cgstAmount.toString(),
'sgst_amount': sgstAmount.toString(),
'igst_amount': igstAmount.toString(),
'total_amount': totalAmount.toString(),
'order_received_date': orderReceivedDate.toString(),
'note': note.toString(),
'unloading': unloading.toString(),
'freight': freight.toString(),
'erection': erection.toString(),
'tpc_applicable': tpc_applicable.toString(),
'billing_name': billing_name.toString(),
'billing_gst_no': billing_gst_no.toString(),
'billing_pincode': billing_pincode.toString(),
'billing_address': billing_address.toString(),
'billing_state': billing_state.toString(),
'billing_district': billing_district.toString(),
'billing_sub_locality': billing_sub_locality.toString(),
'order_products': (order_products).toString(),
'lead_id': lead_id.toString(),
'tpc_applicable': tpcApplicable.toString(),
'billing_name': billingName.toString(),
'billing_gst_no': billingGstNo.toString(),
'billing_pincode': billingPincode.toString(),
'billing_address': billingAddress.toString(),
'billing_state': billingState.toString(),
'billing_district': billingDistrict.toString(),
'billing_sub_locality': billingSubLocality.toString(),
'order_products': (orderProducts).toString(),
'lead_id': leadId.toString(),
'feedback': feedback.toString(),
'in_time': in_time.toString(),
'in_time': inTime.toString(),
'loc': loc.toString(),
'requested_tpc_amount': requested_tpc_amount.toString(),
'tpc_agent_id': tpc_agent_id.toString(),
'requested_tpc_amount': requestedTpcAmount.toString(),
'tpc_agent_id': tpcAgentId.toString(),
};
var res;
print("add order:${data}");
print("add order:$data");
if (po != null) {
res = await postImageNew(data, {}, ordersAddOrderSubmitUrl, po, "po");
res = jsonDecode(res);
......@@ -2559,6 +2567,7 @@ class ApiCalling {
mode,
teamemployee,
status,
pageNumber,
) async {
try {
Map<String, String> data = {
......@@ -2567,6 +2576,7 @@ class ApiCalling {
'mode': (mode).toString(),
'teamemployee': (teamemployee).toString(),
'status': (status).toString(),
'page_number': (pageNumber).toString(),
};
final res = await post(data, ordersOrderListFilterUrl, {});
if (res != null) {
......@@ -2586,17 +2596,17 @@ class ApiCalling {
static Future<ordersDetailsByModeResponse?> ordersDetailsByModeAPI(
empId,
session,
order_id,
orderId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'order_id': (order_id).toString(),
'order_id': (orderId).toString(),
};
final res = await post(data, ordersOrderDetailsUrl, {});
if (res != null) {
print("Order Details ${data}");
print("Order Details $data");
print("Order Details ${res.body}");
return ordersDetailsByModeResponse.fromJson(jsonDecode(res.body));
} else {
......@@ -2612,26 +2622,26 @@ class ApiCalling {
static Future<CommonResponse?> ordersDetailsFeedbackSubmissionAPI(
empId,
session,
order_id,
orderId,
feedback,
status,
attachment_file,
attachmentFile,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'order_id': order_id.toString(),
'order_id': orderId.toString(),
'feedback': (feedback).toString(),
'status': status,
};
var res;
if (attachment_file != null) {
if (attachmentFile != null) {
res = await postImageNew(
data,
{},
ordersOrderDetailsFeedbackSubmitUrl,
attachment_file,
attachmentFile,
"attachment_file",
);
res = jsonDecode(res);
......@@ -2647,12 +2657,12 @@ class ApiCalling {
}
static Future<ordersDetailsEditOrderViewResponse?>
ordersDetailsEditOrderViewAPI(empId, session, order_id) async {
ordersDetailsEditOrderViewAPI(empId, session, orderId) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'order_id': order_id.toString(),
'order_id': orderId.toString(),
};
var res = await post(data, ordersOrderDetailsEditOrderUrl, {});
......@@ -2667,18 +2677,19 @@ class ApiCalling {
debugPrint('hello bev=bug $e ');
return null;
}
return null;
}
static Future<CommonResponse?> ordersDetailsEditOrderSubmitAPI(
empId,
session,
order_id,
attachment_file,
dispatch_state_id,
orderId,
attachmentFile,
dispatchStateId,
district,
sub_locality,
dispatch_pincode,
dispatch_address,
subLocality,
dispatchPincode,
dispatchAddress,
unloading,
freight,
erection,
......@@ -2688,12 +2699,12 @@ class ApiCalling {
Map<String, String> data = {
'emp_id': empId.toString(),
'session_id': session.toString(),
'order_id': order_id.toString(),
'dispatch_state_id': dispatch_state_id.toString(),
'order_id': orderId.toString(),
'dispatch_state_id': dispatchStateId.toString(),
'district': district.toString(),
'sub_locality': sub_locality.toString(),
'dispatch_pincode': dispatch_pincode.toString(),
'dispatch_address': dispatch_address.toString(),
'sub_locality': subLocality.toString(),
'dispatch_pincode': dispatchPincode.toString(),
'dispatch_address': dispatchAddress.toString(),
'unloading': unloading.toString(),
'freight': freight.toString(),
'erection': erection.toString(),
......@@ -2701,12 +2712,12 @@ class ApiCalling {
};
var res;
print("Edit Order:$data");
if (attachment_file != null) {
if (attachmentFile != null) {
res = await postImageNew(
data,
{},
ordersOrderDetailsEditOrderSubmitUrl,
attachment_file,
attachmentFile,
"attachment_file",
);
res = jsonDecode(res);
......@@ -2722,12 +2733,12 @@ class ApiCalling {
}
static Future<ordersDetailsDispatchOrderViewResponse?>
ordersDetailsDispatchOrderViewAPI(empId, session, order_id) async {
ordersDetailsDispatchOrderViewAPI(empId, session, orderId) async {
try {
Map<String, String> data = {
'emp_id': empId.toString(),
'session_id': session.toString(),
'order_id': order_id.toString(),
'order_id': orderId.toString(),
};
final res = await post(data, ordersOrderDetailsDispatchProductsUrl, {});
......@@ -2742,18 +2753,19 @@ class ApiCalling {
debugPrint('hello bev=bug $e ');
return null;
}
return null;
}
static Future<ordersPdiIdByEngNumberResponse?> ordersPdiIdByEngNumberUrlAPI(
empId,
session,
engine_number,
engineNumber,
) async {
try {
Map<String, String> data = {
'emp_id': empId.toString(),
'session_id': session.toString(),
'engine_number': engine_number.toString(),
'engine_number': engineNumber.toString(),
};
final res = await post(data, ordersPdiIdByEngNumberUrl, {});
......@@ -2766,6 +2778,7 @@ class ApiCalling {
debugPrint('hello bev=bug $e ');
return null;
}
return null;
}
static Future<CommonResponse?> ordersDetailsApproveRejectAPI(
......@@ -2773,17 +2786,17 @@ class ApiCalling {
session,
status,
type,
order_id,
orderId,
feedback,
tpc_applicable,
tpc_approved_amount,
sale_order_number,
edit_company_name,
invoice_number,
vehicle_number,
driver_name,
driver_mobile_no,
crm_order_p_id,
tpcApplicable,
tpcApprovedAmount,
saleOrderNumber,
editCompanyName,
invoiceNumber,
vehicleNumber,
driverName,
driverMobileNo,
crmOrderPId,
) async {
try {
Map<String, String> data = {
......@@ -2791,17 +2804,17 @@ class ApiCalling {
'session_id': (session).toString(),
"status": status.toString(),
"type": type.toString(),
"order_id": order_id.toString(),
"order_id": orderId.toString(),
"feedback": feedback.toString(),
"tpc_applicable": tpc_applicable.toString(),
"tpc_approved_amount": tpc_approved_amount.toString(),
"sale_order_number": sale_order_number.toString(),
"edit_company_name": edit_company_name.toString(),
"invoice_number": invoice_number.toString(),
"vehicle_number": vehicle_number.toString(),
"driver_name": driver_name.toString(),
"driver_mobile_no": driver_mobile_no.toString(),
"crm_order_p_id": crm_order_p_id.toString(),
"tpc_applicable": tpcApplicable.toString(),
"tpc_approved_amount": tpcApprovedAmount.toString(),
"sale_order_number": saleOrderNumber.toString(),
"edit_company_name": editCompanyName.toString(),
"invoice_number": invoiceNumber.toString(),
"vehicle_number": vehicleNumber.toString(),
"driver_name": driverName.toString(),
"driver_mobile_no": driverMobileNo.toString(),
"crm_order_p_id": crmOrderPId.toString(),
};
final res = await post(data, ordersOrderApproveRejectUrl, {});
if (res != null) {
......@@ -2821,14 +2834,14 @@ class ApiCalling {
static Future<CommonResponse?> ordersDetailsDeleteAPI(
empId,
session,
order_id,
orderId,
feedback,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
"order_id": order_id.toString(),
"order_id": orderId.toString(),
"feedback": feedback.toString(),
};
final res = await post(data, ordersOrderLDeleteUrl, {});
......@@ -2872,29 +2885,29 @@ class ApiCalling {
static Future<CommonResponse?> addOrderpaymentListSubmitAPI(
empId,
session,
account_id,
accountId,
description,
selected_orders,
payment_amount,
payment_date,
payment_type,
ref_no,
selectedOrders,
paymentAmount,
paymentDate,
paymentType,
refNo,
attachment,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': account_id.toString(),
'account_id': accountId.toString(),
'description': description.toString(),
'selected_orders': jsonEncode(selected_orders).toString(),
'payment_amount': payment_amount.toString(),
'payment_date': payment_date.toString(),
'payment_type': payment_type.toString(),
'ref_no': ref_no.toString(),
'selected_orders': jsonEncode(selectedOrders).toString(),
'payment_amount': paymentAmount.toString(),
'payment_date': paymentDate.toString(),
'payment_type': paymentType.toString(),
'ref_no': refNo.toString(),
};
var res;
print("Add Payment: ${data}");
print("Add Payment: $data");
if (attachment != null) {
res = await postImageNew(
data,
......@@ -2919,22 +2932,22 @@ class ApiCalling {
static Future<CommonResponse?> ordersEditPaymentDetailsAPI(
empId,
session,
payment_id,
paymentId,
description,
payment_type,
ref_no,
payment_date,
paymentType,
refNo,
paymentDate,
amount,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'payment_id': payment_id.toString(),
'payment_id': paymentId.toString(),
'description': description.toString(),
'payment_type': payment_type.toString(),
'payment_date': payment_date.toString(),
'ref_no': ref_no.toString(),
'payment_type': paymentType.toString(),
'payment_date': paymentDate.toString(),
'ref_no': refNo.toString(),
'amount': amount.toString(),
};
......@@ -2948,19 +2961,20 @@ class ApiCalling {
debugPrint('hello bev=bug $e ');
return null;
}
return null;
}
static Future<EditPaymentDetailsAdjustedOrdersViewResponse?>
ordersEditPaymentDetailsAdjustedOrdersViewAPI(
empId,
session,
payment_id,
paymentId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'payment_id': payment_id.toString(),
'payment_id': paymentId.toString(),
};
var res = await post(
......@@ -2980,23 +2994,24 @@ class ApiCalling {
debugPrint('hello bev=bug $e ');
return null;
}
return null;
}
static Future<EditPaymentDetailsAdjustedOrdersViewResponse?>
ordersEditPaymentDetailsAdjustedOrdersUpdateAPI(
empId,
session,
payment_id,
update_amounts,
insert_amounts,
paymentId,
updateAmounts,
insertAmounts,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'payment_id': payment_id.toString(),
'update_amounts': jsonEncode(update_amounts).toString(),
'insert_amounts': jsonEncode(insert_amounts).toString(),
'payment_id': paymentId.toString(),
'update_amounts': jsonEncode(updateAmounts).toString(),
'insert_amounts': jsonEncode(insertAmounts).toString(),
};
var res = await post(data, ordersEditPaymentDetailsAdjustedOrdersUrl, {});
......@@ -3011,16 +3026,17 @@ class ApiCalling {
debugPrint('hello bev=bug $e ');
return null;
}
return null;
}
static Future<AddOrderPaymentSelectAccountResponse?>
AddOrderPaymentSelectAccountAPI(empId, session, mode, search_term) async {
AddOrderPaymentSelectAccountAPI(empId, session, mode, searchTerm) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'mode': mode.toString(),
'search_term': search_term.toString(),
'search_term': searchTerm.toString(),
};
final res = await post(
data,
......@@ -3044,12 +3060,12 @@ class ApiCalling {
}
static Future<AddOrderPaymentSelectOrderResponse?>
AddOrderPaymentSelectOrderAPI(empId, session, account_id) async {
AddOrderPaymentSelectOrderAPI(empId, session, accountId) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': account_id.toString(),
'account_id': accountId.toString(),
};
final res = await post(data, ordersAddPaymentSelectOrderUrl, {});
if (res != null) {
......@@ -3098,6 +3114,7 @@ class ApiCalling {
session,
mode,
teamemployee,
pageNumber,
) async {
try {
Map<String, String> data = {
......@@ -3105,6 +3122,7 @@ class ApiCalling {
'session_id': (session).toString(),
'mode': (mode).toString(),
'teamemployee': (teamemployee).toString(),
'page_number': (pageNumber).toString(),
};
final res = await post(data, ordersPaymentListByModeUrl, {});
if (res != null) {
......@@ -3124,7 +3142,7 @@ class ApiCalling {
static Future<CommonResponse?> paymentOrderApproveRejectAPI(
empId,
session,
payment_id,
paymentId,
type,
remarks,
) async {
......@@ -3132,7 +3150,7 @@ class ApiCalling {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
"payment_id": payment_id.toString(),
"payment_id": paymentId.toString(),
"type": type.toString(),
"remarks": remarks.toString(),
};
......@@ -3151,18 +3169,17 @@ class ApiCalling {
}
}
static Future<CommonResponse?> verifyOrderAPI(
empId,
session,
order_id,
otp,
orderId,
otp,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
"order_id": order_id.toString(),
"order_id": orderId.toString(),
"otp": otp.toString(),
};
final res = await post(data, ordersVerifyOtpUrl, {});
......@@ -3183,13 +3200,13 @@ class ApiCalling {
static Future<CommonResponse?> resendOTPOrderAPI(
empId,
session,
order_id,
orderId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
"order_id": order_id.toString(),
"order_id": orderId.toString(),
};
final res = await post(data, ordersResendOtpUrl, {});
if (res != null) {
......@@ -3209,13 +3226,13 @@ class ApiCalling {
static Future<CommonResponse?> paymentOrderDeleteAPI(
empId,
session,
payment_id,
paymentId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
"payment_id": payment_id.toString(),
"payment_id": paymentId.toString(),
};
final res = await post(data, ordersPaymentListDeleteUrl, {});
if (res != null) {
......@@ -3235,13 +3252,13 @@ class ApiCalling {
static Future<paymentDetailsByModeFilterResponse?> paymentsDetailsByModeAPI(
empId,
session,
payment_id,
paymentId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'payment_id': (payment_id).toString(),
'payment_id': (paymentId).toString(),
};
final res = await post(data, ordersPaymentDetailsUrl, {});
if (res != null) {
......@@ -3263,26 +3280,23 @@ class ApiCalling {
static Future<CommonResponse?> paymentsDetailsAddAdjustedOrderAPI(
empId,
session,
payment_id,
selected_order_id,
amount,
paymentId,
selectedOrderId,
amount,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'payment_id': (payment_id).toString(),
'selected_order_id': (selected_order_id).toString(),
'payment_id': (paymentId).toString(),
'selected_order_id': (selectedOrderId).toString(),
'amount': (amount).toString(),
};
final res = await post(data, ordersPaymentDetailsAddOrderUrl, {});
if (res != null) {
print("paymentsDetailsAddAdjusted: $data");
debugPrint(res.body);
return CommonResponse.fromJson(
jsonDecode(res.body),
);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
......@@ -3296,25 +3310,23 @@ class ApiCalling {
static Future<CommonResponse?> paymentsDetailsEditAdjustedOrderAPI(
empId,
session,
selected_order_id,
amount,
order_payment_id,
selectedOrderId,
amount,
orderPaymentId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'selected_order_id': (selected_order_id).toString(),
'selected_order_id': (selectedOrderId).toString(),
'amount': (amount).toString(),
'order_payment_id': (order_payment_id).toString(),
'order_payment_id': (orderPaymentId).toString(),
};
final res = await post(data, ordersPaymentDetailsEditOrderUrl, {});
if (res != null) {
print("paymentsDetailsEditAdjusted $data");
debugPrint(res.body);
return CommonResponse.fromJson(
jsonDecode(res.body),
);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
......@@ -3328,35 +3340,35 @@ class ApiCalling {
static Future<CommonResponse?> ordersAddTPCAgentAPI(
empId,
session,
agent_name,
mobile_number,
bank_name,
bank_account_no,
bank_ifsc_code,
bank_beneficiary_name,
agentName,
mobileNumber,
bankName,
bankAccountNo,
bankIfscCode,
bankBeneficiaryName,
note,
id_proof,
idProof,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'agent_name': agent_name.toString(),
'mobile_number': mobile_number.toString(),
'bank_name': bank_name.toString(),
'bank_account_no': bank_account_no.toString(),
'bank_ifsc_code': bank_ifsc_code.toString(),
'bank_beneficiary_name': bank_beneficiary_name.toString(),
'agent_name': agentName.toString(),
'mobile_number': mobileNumber.toString(),
'bank_name': bankName.toString(),
'bank_account_no': bankAccountNo.toString(),
'bank_ifsc_code': bankIfscCode.toString(),
'bank_beneficiary_name': bankBeneficiaryName.toString(),
'note': note.toString(),
};
var res;
print("add TPC: $data");
if (id_proof != null) {
if (idProof != null) {
res = await postImageNew(
data,
{},
ordersAddTPCAgentUrl,
id_proof,
idProof,
"id_proof",
);
res = jsonDecode(res);
......@@ -3365,7 +3377,7 @@ class ApiCalling {
res = jsonDecode(res.body);
// return CommonResponse.fromJson(res);
}
print("Add TPC: ${res}");
print("Add TPC: $res");
return CommonResponse.fromJson(res);
} catch (e) {
debugPrint('hello bev=bug $e ');
......@@ -3373,12 +3385,18 @@ class ApiCalling {
}
}
static Future<TPCListResponse?> TPCAgentListAPI(empId, session, mode) async {
static Future<TPCListResponse?> TPCAgentListAPI(
empId,
session,
mode,
pageNumber,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'mode': (mode).toString(),
'page_number': (pageNumber).toString(),
};
final res = await post(data, ordersTPCAgentListUrl, {});
if (res != null) {
......@@ -3398,13 +3416,13 @@ class ApiCalling {
static Future<TPCAgentDetailsResponse?> TPCAgentDetailsAPI(
empId,
session,
tpc_agent_id,
tpcAgentId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'tpc_agent_id': (tpc_agent_id).toString(),
'tpc_agent_id': (tpcAgentId).toString(),
};
final res = await post(data, ordersTPCAgentDetailsUrl, {});
if (res != null) {
......@@ -3424,11 +3442,13 @@ class ApiCalling {
static Future<PendingTPCAgentListResponse?> pendingTPCAgentIssueListAPI(
empId,
session,
pageNumber,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'page_number': (pageNumber).toString(),
};
final res = await post(data, ordersPendingTPCIssueListUrl, {});
if (res != null) {
......@@ -3448,28 +3468,28 @@ class ApiCalling {
static Future<CommonResponse?> TpcIssueListApprovalAPI(
empId,
session,
tpc_payment_mode,
tpc_payment_reference_no,
order_id,
order_tpc_feedback,
tpc_paym_attachment,
tpcPaymentMode,
tpcPaymentReferenceNo,
orderId,
orderTpcFeedback,
tpcPaymAttachment,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'tpc_payment_mode': tpc_payment_mode.toString(),
'tpc_payment_reference_no': tpc_payment_reference_no.toString(),
'order_id': order_id.toString(),
'order_tpc_feedback': order_tpc_feedback.toString(),
'tpc_payment_mode': tpcPaymentMode.toString(),
'tpc_payment_reference_no': tpcPaymentReferenceNo.toString(),
'order_id': orderId.toString(),
'order_tpc_feedback': orderTpcFeedback.toString(),
};
var res;
if (tpc_paym_attachment != null) {
if (tpcPaymAttachment != null) {
res = await postImageNew(
data,
{},
ordersApprovePendingTPCIssueListUrl,
tpc_paym_attachment,
tpcPaymAttachment,
"tpc_paym_attachment",
);
res = jsonDecode(res);
......@@ -3534,14 +3554,15 @@ class ApiCalling {
}
}
static Future<crmNewLeadsProspectsSubmitResponse?> crmNewLeadsProspectsSubmitAPI(
session_id,
emp_id,
static Future<crmNewLeadsProspectsSubmitResponse?>
crmNewLeadsProspectsSubmitAPI(
sessionId,
empId,
mode,
acc_manager_id,
salutation_name,
accManagerId,
salutationName,
name,
contact_name,
contactName,
district,
state,
address,
......@@ -3549,24 +3570,24 @@ class ApiCalling {
source,
reference,
team,
sub_locality,
subLocality,
mob1,
mob2,
tel,
email,
designation,
lead_status,
leadStatus,
products,
) async {
try {
Map<String, String> data = {
'session_id': session_id.toString(),
'emp_id': emp_id.toString(),
'session_id': sessionId.toString(),
'emp_id': empId.toString(),
'mode': mode.toString(),
'acc_manager_id': acc_manager_id.toString(),
'salutation_name': salutation_name.toString(),
'acc_manager_id': accManagerId.toString(),
'salutation_name': salutationName.toString(),
'name': name.toString(),
'contact_name': contact_name.toString(),
'contact_name': contactName.toString(),
'district': district.toString(),
'state': state.toString(),
'address': address.toString(),
......@@ -3574,20 +3595,22 @@ class ApiCalling {
'source': source.toString(),
'reference': reference.toString(),
'team': team.toString(),
'sub_locality': sub_locality.toString(),
'sub_locality': subLocality.toString(),
'mob1': mob1.toString(),
'mob2': mob2.toString(),
'tel': tel.toString(),
'email': email.toString(),
'designation': designation.toString(),
'lead_status': lead_status.toString(),
'lead_status': leadStatus.toString(),
'products': products.toString(),
};
final res = await post(data, crmNewProspectLeadSubmitUrl, {});
if (res != null) {
print(data);
debugPrint("Submit New Leads ${res.body}");
return crmNewLeadsProspectsSubmitResponse.fromJson(jsonDecode(res.body));
return crmNewLeadsProspectsSubmitResponse.fromJson(
jsonDecode(res.body),
);
} else {
debugPrint("Null Response");
return null;
......@@ -3601,13 +3624,13 @@ class ApiCalling {
static Future<crmDashboardResponse?> crmDashboardAPI(
empId,
session,
emp_loc,
empLoc,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'emp_loc': emp_loc.toString(),
'emp_loc': empLoc.toString(),
};
final res = await post(data, crmDashboardUrl, {});
if (res != null) {
......@@ -3705,7 +3728,7 @@ class ApiCalling {
session,
mode,
status,
open_status,
openStatus,
mob,
com,
source,
......@@ -3713,6 +3736,7 @@ class ApiCalling {
team,
segment,
alphabet,
pageNumber,
) async {
try {
Map<String, String> data = {
......@@ -3720,7 +3744,7 @@ class ApiCalling {
'session_id': (session).toString(),
'mode': (mode).toString(),
'status': status.toString(),
'open_status': open_status.toString(),
'open_status': openStatus.toString(),
'mob': mob.toString(),
'com': com.toString(),
'source': source.toString(),
......@@ -3728,10 +3752,11 @@ class ApiCalling {
'team': team.toString(),
'segment': segment.toString(),
'alphabet': alphabet.toString(),
'page_number': pageNumber.toString(),
};
final res = await post(data, crmLeadListFilterSubmitUrl, {});
if (res != null) {
print("Lead Filter:${data}");
print("Lead Filter:$data");
debugPrint(res.body);
return SubmitLeadListFilterResponse.fromJson(jsonDecode(res.body));
} else {
......@@ -3747,13 +3772,13 @@ class ApiCalling {
static Future<GetSourceOnReferenceResponse?> crmLeadListSourceOnReferenceAPI(
empId,
session,
source_id,
sourceId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'source_id': (source_id).toString(),
'source_id': (sourceId).toString(),
};
final res = await post(data, crmLeadListSourceOnReferenceUrl, {});
if (res != null) {
......@@ -3773,13 +3798,13 @@ class ApiCalling {
static Future<GetSegmentOnTeamResponse?> crmLeadListSegmentOnTeamAPI(
empId,
session,
team_id,
teamId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'team_id': (team_id).toString(),
'team_id': (teamId).toString(),
};
final res = await post(data, crmLeadListSegmentOnTeamUrl, {});
if (res != null) {
......@@ -3799,13 +3824,13 @@ class ApiCalling {
static Future<GetDistrictOnStateResponse?> crmDistrictsOnStateAPI(
empId,
session,
state_id,
stateId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'state_id': (state_id).toString(),
'state_id': (stateId).toString(),
};
final res = await post(data, crmLeadListDistrictOnStateUrl, {});
if (res != null) {
......@@ -3825,13 +3850,13 @@ class ApiCalling {
static Future<GetSubLocOnDistrictResponse?> crmSubLocOnDistrictAPI(
empId,
session,
district_id,
districtId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'district_id': (district_id).toString(),
'district_id': (districtId).toString(),
};
final res = await post(data, crmLeadListSubLocOnDistrictUrl, {});
if (res != null) {
......@@ -3851,13 +3876,13 @@ class ApiCalling {
static Future<LeadListContactPopUpResponse?> crmLeadListContactPopUpAPI(
empId,
session,
account_id,
accountId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': (account_id).toString(),
'account_id': (accountId).toString(),
};
final res = await post(data, crmLeadListContactPopUpUrl, {});
if (res != null) {
......@@ -3877,14 +3902,14 @@ class ApiCalling {
static Future<LeadDetailsResponse?> crmLeadDetailsAPI(
empId,
session,
lead_id,
leadId,
mode,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'lead_id': (lead_id).toString(),
'lead_id': (leadId).toString(),
'mode': (mode).toString(),
};
final res = await post(data, crmLeadDetailsUrl, {});
......@@ -3905,10 +3930,10 @@ class ApiCalling {
static Future<CommonResponse?> crmLeadDetailsAddEditProductsAPI(
empId,
session,
lead_id,
leadId,
type,
lead_product_id,
product_id,
leadProductId,
productId,
qty,
amount,
) async {
......@@ -3916,10 +3941,10 @@ class ApiCalling {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'lead_id': (lead_id).toString(),
'lead_id': (leadId).toString(),
'type': (type).toString(),
'lead_product_id': (lead_product_id).toString(),
'product_id': (product_id).toString(),
'lead_product_id': (leadProductId).toString(),
'product_id': (productId).toString(),
'qty': (qty).toString(),
'amount': (amount).toString(),
};
......@@ -3939,41 +3964,41 @@ class ApiCalling {
}
static Future<crmAddFollowUpResponse?> crmLeadDetailsAddFollowUpAPI(
session_id,
emp_id,
sessionId,
empId,
nextapp,
orderstatus,
lead_id,
followup_feedback,
followup_type,
leadId,
followupFeedback,
followupType,
followupintime,
loc,
competitor,
reason,
followup_status,
next_appointment_date,
appointment_type,
followupStatus,
nextAppointmentDate,
appointmentType,
sms,
app_note,
appNote,
) async {
try {
Map<String, String> data = {
'session_id': session_id.toString(),
'emp_id': emp_id.toString(),
'session_id': sessionId.toString(),
'emp_id': empId.toString(),
'nextapp': nextapp.toString(),
'orderstatus': orderstatus.toString(),
'lead_id': lead_id.toString(),
'followup_feedback': followup_feedback.toString(),
'followup_type': followup_type.toString(),
'lead_id': leadId.toString(),
'followup_feedback': followupFeedback.toString(),
'followup_type': followupType.toString(),
'followupintime': followupintime.toString(),
'loc': loc.toString(),
'competitor': competitor.toString(),
'reason': reason.toString(),
'followup_status': followup_status.toString(),
'next_appointment_date': next_appointment_date.toString(),
'appointment_type': appointment_type.toString(),
'followup_status': followupStatus.toString(),
'next_appointment_date': nextAppointmentDate.toString(),
'appointment_type': appointmentType.toString(),
'sms': sms.toString(),
'app_note': app_note.toString(),
'app_note': appNote.toString(),
};
final res = await post(data, crmLeadDetailsAddFollowUpUrl, {});
......@@ -3992,12 +4017,12 @@ class ApiCalling {
}
static Future<crmLeadDetailsEditAccountViewResponse?>
crmLeadDetailsEditAccountViewAPI(empId, session, lead_id, mode) async {
crmLeadDetailsEditAccountViewAPI(empId, session, leadId, mode) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'lead_id': (lead_id).toString(),
'lead_id': (leadId).toString(),
'mode': (mode).toString(),
};
final res = await post(data, crmLeadDetailsEditAccountViewUrl, {});
......@@ -4020,19 +4045,19 @@ class ApiCalling {
static Future<CommonResponse?> crmLeadDetailsEditAccountSubmitAPI(
empId,
session,
account_id,
segment_id,
team_id,
account_name,
accountId,
segmentId,
teamId,
accountName,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': (account_id).toString(),
'segment_id': (segment_id).toString(),
'team_id': (team_id).toString(),
'account_name': (account_name).toString(),
'account_id': (accountId).toString(),
'segment_id': (segmentId).toString(),
'team_id': (teamId).toString(),
'account_name': (accountName).toString(),
};
final res = await post(data, crmLeadDetailsEditAccountUrl, {});
if (res != null) {
......@@ -4050,17 +4075,19 @@ class ApiCalling {
}
static Future<crmLeadDetailsEditProductsViewResponse?>
crmLeadDetailsEditProductsViewAPI(empId, session, lead_id) async {
crmLeadDetailsEditProductsViewAPI(empId, session, leadId) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'lead_id': (lead_id).toString(),
'lead_id': (leadId).toString(),
};
final res = await post(data, crmLeadDetailsEditProductsViewUrl, {});
if (res != null) {
print(data);
print("crmLeadDetailsEditProductsViewAPI: ${jsonDecode(res.body)['lead_products']}");
print(
"crmLeadDetailsEditProductsViewAPI: ${jsonDecode(res.body)['lead_products']}",
);
debugPrint(res.body);
return crmLeadDetailsEditProductsViewResponse.fromJson(
jsonDecode(res.body),
......@@ -4079,14 +4106,14 @@ class ApiCalling {
empId,
session,
products,
lead_id,
leadId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'products': jsonEncode(products).toString(),
'lead_id': (lead_id).toString(),
'lead_id': (leadId).toString(),
};
final res = await post(data, crmLeadDetailsEditProductsUrl, {});
if (res != null) {
......@@ -4106,7 +4133,7 @@ class ApiCalling {
static Future<CommonResponse?> crmLeadDetailsAddContactAPI(
empId,
session,
acc_id,
accId,
name,
mob1,
designation,
......@@ -4118,7 +4145,7 @@ class ApiCalling {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'acc_id': (acc_id).toString(),
'acc_id': (accId).toString(),
'name': (name).toString(),
'mob1': (mob1).toString(),
'designation': (designation).toString(),
......@@ -4144,7 +4171,7 @@ class ApiCalling {
static Future<CommonResponse?> crmLeadDetailsEditContactAPI(
empId,
session,
contact_id,
contactId,
name,
mob1,
designation,
......@@ -4156,7 +4183,7 @@ class ApiCalling {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'contact_id': (contact_id).toString(),
'contact_id': (contactId).toString(),
'name': (name).toString(),
'mob1': (mob1).toString(),
'designation': (designation).toString(),
......@@ -4182,8 +4209,8 @@ class ApiCalling {
static Future<CommonResponse?> crmLeadDetailsAddAppointmentAPI(
empId,
session,
lead_id,
appointment_date,
leadId,
appointmentDate,
type,
note,
) async {
......@@ -4191,8 +4218,8 @@ class ApiCalling {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'lead_id': (lead_id).toString(),
'appointment_date': (appointment_date).toString(),
'lead_id': (leadId).toString(),
'appointment_date': (appointmentDate).toString(),
'type': (type).toString(),
'note': (note).toString(),
};
......@@ -4212,12 +4239,12 @@ class ApiCalling {
}
static Future<crmLeadDetailsGenerateQuotationViewResponse?>
crmLeadDetailsGenerateQuotationViewAPI(empId, session, lead_id) async {
crmLeadDetailsGenerateQuotationViewAPI(empId, session, leadId) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'lead_id': (lead_id).toString(),
'lead_id': (leadId).toString(),
};
final res = await post(data, crmLeadDetailsGenerateQuotationViewUrl, {});
if (res != null) {
......@@ -4238,33 +4265,33 @@ class ApiCalling {
static Future<crmLeadDetailsGenerateQuotationSubmitResponse?>
crmLeadDetailsGenerateQuotationSubmitAPI(
emp_id,
session_id,
lead_id,
empId,
sessionId,
leadId,
quotemno,
quotesubject,
taxes,
quotenote,
quotefor,
quotep_terms,
quotepTerms,
quotemail,
quote_products,
quotation_type,
quoteProducts,
quotationType,
) async {
try {
Map<String, String> data = {
'emp_id': emp_id.toString(),
'session_id': session_id.toString(),
'lead_id': lead_id.toString(),
'emp_id': empId.toString(),
'session_id': sessionId.toString(),
'lead_id': leadId.toString(),
'quotemno': quotemno.toString(),
'quotesubject': quotesubject.toString(),
'taxes': taxes.toString(),
'quotenote': quotenote.toString(),
'quotefor': quotefor.toString(),
'quotep_terms': quotep_terms.toString(),
'quotep_terms': quotepTerms.toString(),
'quotemail': quotemail.toString(),
'quote_products': jsonEncode(quote_products).toString(),
'quotation_type': quotation_type.toString(),
'quote_products': jsonEncode(quoteProducts).toString(),
'quotation_type': quotationType.toString(),
};
final res = await post(
data,
......@@ -4272,7 +4299,7 @@ class ApiCalling {
{},
);
if (res != null) {
print("Filter: ${data}");
print("Filter: $data");
debugPrint(res.body);
return crmLeadDetailsGenerateQuotationSubmitResponse.fromJson(
jsonDecode(res.body),
......@@ -4287,35 +4314,26 @@ class ApiCalling {
}
}
static Future<crmDownloadGenQuoteResponse?>
crmDownloadGenQuoteAPI(
emp_id,
session_id,
lead_id,
quote_id,
quotation_type,
static Future<crmDownloadGenQuoteResponse?> crmDownloadGenQuoteAPI(
empId,
sessionId,
leadId,
quoteId,
quotationType,
) async {
try {
Map<String, String> data = {
'emp_id': emp_id.toString(),
'session_id': session_id.toString(),
'lead_id': lead_id.toString(),
'quote_id': quote_id.toString(),
'quotation_type': quotation_type.toString(),
'emp_id': empId.toString(),
'session_id': sessionId.toString(),
'lead_id': leadId.toString(),
'quote_id': quoteId.toString(),
'quotation_type': quotationType.toString(),
};
final res = await post(
data,
crmDownloadGeneratedQuotationUrl,
{},
);
final res = await post(data, crmDownloadGeneratedQuotationUrl, {});
if (res != null) {
print("Filter: ${data}");
print("Filter: $data");
debugPrint(res.body);
return crmDownloadGenQuoteResponse.fromJson(
jsonDecode(res.body),
);
return crmDownloadGenQuoteResponse.fromJson(jsonDecode(res.body));
} else {
debugPrint("Null Response");
return null;
......@@ -4359,7 +4377,8 @@ class ApiCalling {
mode,
teamemployee,
mob,
company_name,
companyName,
pageNumber,
) async {
try {
Map<String, String> data = {
......@@ -4368,11 +4387,12 @@ class ApiCalling {
'mode': (mode).toString(),
'teamemployee': teamemployee.toString(),
'mob': mob.toString(),
'company_name': company_name.toString(),
'company_name': companyName.toString(),
'page_number': pageNumber.toString(),
};
final res = await post(data, crmProspectListFilterSubmitUrl, {});
if (res != null) {
print("Filter:${data}");
print("Filter:$data");
debugPrint(res.body);
return SubmitProspectListFilterResponse.fromJson(jsonDecode(res.body));
} else {
......@@ -4388,17 +4408,17 @@ class ApiCalling {
static Future<crmProspectDetailsResponse?> crmProspectDetailsAPI(
empId,
session,
account_id,
accountId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': (account_id).toString(),
'account_id': (accountId).toString(),
};
final res = await post(data, crmProspectDetailsUrl, {});
if (res != null) {
print("Filter:${data}");
print("Filter:$data");
debugPrint(res.body);
return crmProspectDetailsResponse.fromJson(jsonDecode(res.body));
} else {
......@@ -4414,19 +4434,19 @@ class ApiCalling {
static Future<CommonResponse?> crmProspectDetailsTransferAccountAPI(
empId,
session,
account_id,
tranemp_id,
accountId,
tranempId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': (account_id).toString(),
'tranemp_id': (tranemp_id).toString(),
'account_id': (accountId).toString(),
'tranemp_id': (tranempId).toString(),
};
final res = await post(data, crmProspectDetailsTransferAccountUrl, {});
if (res != null) {
print("Filter:${data}");
print("Filter:$data");
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
......@@ -4440,16 +4460,16 @@ class ApiCalling {
}
static Future<crmProspectDetailsEditAccountViewResponse?>
crmProspectDetailsEditAccountViewAPI(empId, session, account_id) async {
crmProspectDetailsEditAccountViewAPI(empId, session, accountId) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': (account_id).toString(),
'account_id': (accountId).toString(),
};
final res = await post(data, crmProspectDetailsEditAccountViewUrl, {});
if (res != null) {
print("Filter:${data}");
print("Filter:$data");
print("Stetets:${jsonDecode(res.body)['states']}");
return crmProspectDetailsEditAccountViewResponse.fromJson(
jsonDecode(res.body),
......@@ -4467,12 +4487,12 @@ class ApiCalling {
static Future<CommonResponse?> crmProspectDetailsEditAccountSubmitAPI(
empId,
session,
account_id,
edit_company_name,
edit_salutation_name,
state_id,
accountId,
editCompanyName,
editSalutationName,
stateId,
district,
sub_locality,
subLocality,
pincode,
address,
) async {
......@@ -4480,18 +4500,18 @@ class ApiCalling {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': (account_id).toString(),
'edit_company_name': edit_company_name.toString(),
'edit_salutation_name': edit_salutation_name.toString(),
'state_id': state_id.toString(),
'account_id': (accountId).toString(),
'edit_company_name': editCompanyName.toString(),
'edit_salutation_name': editSalutationName.toString(),
'state_id': stateId.toString(),
'district': district.toString(),
'sub_locality': sub_locality.toString(),
'sub_locality': subLocality.toString(),
'pincode': pincode.toString(),
'address': address.toString(),
};
final res = await post(data, crmProspectDetailsEditAccountSubmitUrl, {});
if (res != null) {
print("Filter:${data}");
print("Filter:$data");
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
......@@ -4514,7 +4534,7 @@ class ApiCalling {
};
final res = await post(data, crmProspectDetailsAddLeadViewUrl, {});
if (res != null) {
print("Filter:${data}");
print("Filter:$data");
debugPrint(res.body);
return crmProspectDetailsAddLeadsResponse.fromJson(
jsonDecode(res.body),
......@@ -4533,24 +4553,24 @@ class ApiCalling {
empId,
session,
mode,
account_id,
acc_manager_id,
accountId,
accManagerId,
products,
lead_status,
leadStatus,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'mode': (mode).toString(),
'account_id': account_id.toString(),
'acc_manager_id': acc_manager_id.toString(),
'account_id': accountId.toString(),
'acc_manager_id': accManagerId.toString(),
'products': jsonEncode(products).toString(),
'lead_status': lead_status.toString(),
'lead_status': leadStatus.toString(),
};
final res = await post(data, crmProspectDetailsAddLeadSubmitUrl, {});
if (res != null) {
print("Filter:${data}");
print("Filter:$data");
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
......@@ -4566,25 +4586,25 @@ class ApiCalling {
static Future<CommonResponse?> crmProspectDetailsAddLeadAPI(
empId,
session,
account_id,
product_id,
accountId,
productId,
quantity,
amount,
lead_status,
leadStatus,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'account_id': account_id.toString(),
'product_id': product_id.toString(),
'account_id': accountId.toString(),
'product_id': productId.toString(),
'quantity': quantity.toString(),
'amount': amount.toString(),
'lead_status': lead_status.toString(),
'lead_status': leadStatus.toString(),
};
final res = await post(data, crmProspectDetailsAddLeadUrl, {});
if (res != null) {
print("crmProspectDetailsAddLead:${data}");
print("crmProspectDetailsAddLead:$data");
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
......@@ -4601,7 +4621,7 @@ class ApiCalling {
empId,
session,
name,
acc_id,
accId,
mob1,
designation,
email,
......@@ -4613,7 +4633,7 @@ class ApiCalling {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'name': name.toString(),
'acc_id': acc_id.toString(),
'acc_id': accId.toString(),
'mob1': mob1.toString(),
'designation': designation.toString(),
'email': email.toString(),
......@@ -4622,7 +4642,7 @@ class ApiCalling {
};
final res = await post(data, crmProspectDetailsAddAccountUrl, {});
if (res != null) {
print("crmProspectDetailsAddAccountAPI:${data}");
print("crmProspectDetailsAddAccountAPI:$data");
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
......@@ -4638,9 +4658,9 @@ class ApiCalling {
static Future<CommonResponse?> crmProspectDetailsEditContactAPI(
empId,
session,
contact_id,
contactId,
name,
acc_id,
accId,
mob1,
mob2,
tel,
......@@ -4651,9 +4671,9 @@ class ApiCalling {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'contact_id': (contact_id).toString(),
'contact_id': (contactId).toString(),
'name': name.toString(),
'acc_id': acc_id.toString(),
'acc_id': accId.toString(),
'mob1': mob1.toString(),
'mob2': mob2.toString(),
'tel': tel.toString(),
......@@ -4662,7 +4682,7 @@ class ApiCalling {
};
final res = await post(data, crmProspectDetailsEditContactUrl, {});
if (res != null) {
print("Filter:${data}");
print("Filter:$data");
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
......@@ -4681,12 +4701,12 @@ class ApiCalling {
session,
nextapp,
orderstatus,
lead_id,
followup_feedback,
followup_type,
leadId,
followupFeedback,
followupType,
followupintime,
loc,
followup_status,
followupStatus,
) async {
try {
Map<String, String> data = {
......@@ -4694,12 +4714,12 @@ class ApiCalling {
'session_id': (session).toString(),
'nextapp': nextapp.toString(),
'orderstatus': orderstatus.toString(),
'lead_id': lead_id.toString(),
'followup_feedback': followup_feedback.toString(),
'followup_type': followup_type.toString(),
'lead_id': leadId.toString(),
'followup_feedback': followupFeedback.toString(),
'followup_type': followupType.toString(),
'followupintime': followupintime.toString(),
'loc': loc.toString(),
'followup_status': followup_status.toString(),
'followup_status': followupStatus.toString(),
};
final res = await post(
data,
......@@ -4707,7 +4727,7 @@ class ApiCalling {
{},
);
if (res != null) {
print("Filter:${data}");
print("Filter:$data");
debugPrint(res.body);
return crmProspectDetailsAddFollowUpAppointmentResponse.fromJson(
jsonDecode(res.body),
......@@ -4725,19 +4745,19 @@ class ApiCalling {
static Future<appointmentCalendarResponse?> crmAppointmentCalendarAPI(
empId,
session,
appointment_date,
appointmentDate,
type,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'appointment_date': (appointment_date).toString(),
'appointment_date': (appointmentDate).toString(),
'type': (type).toString(),
};
final res = await post(data, crmAppointmentCalendarUrl, {});
if (res != null) {
print("appointmentCalendar: ${data}");
print("appointmentCalendar: $data");
debugPrint(res.body);
return appointmentCalendarResponse.fromJson(jsonDecode(res.body));
} else {
......@@ -4750,20 +4770,17 @@ class ApiCalling {
}
}
static Future<crmSelectedProductDetailsResponse?> crmSelectedProductDetailsApi(
empId,
session,
product_id,
) async {
static Future<crmSelectedProductDetailsResponse?>
crmSelectedProductDetailsApi(empId, session, productId) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'product_id': (product_id).toString(),
'product_id': (productId).toString(),
};
final res = await post(data, crmSelectedProductDetailsUrl, {});
if (res != null) {
print("crmSelectedProductDetailsApi: ${data}");
print("crmSelectedProductDetailsApi: $data");
debugPrint(res.body);
return crmSelectedProductDetailsResponse.fromJson(jsonDecode(res.body));
} else {
......@@ -4776,24 +4793,22 @@ class ApiCalling {
}
}
static Future<CommonResponse?> crmCheckAccountFieldsApi(
empId,
session,
type_value,
type,
typeValue,
type,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'type_value': (type_value).toString(),
'type_value': (typeValue).toString(),
'type': (type).toString(),
};
final res = await post(data, crmCheckAccountFieldsUrl, {});
if (res != null) {
print("crmCheckAccountFieldsApi: ${data}");
print("crmCheckAccountFieldsApi: $data");
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
......@@ -4812,17 +4827,17 @@ class ApiCalling {
session,
nextapp,
orderstatus,
lead_id,
followup_feedback,
followup_type,
leadId,
followupFeedback,
followupType,
followupintime,
loc,
followup_status,
followupStatus,
appointmentset,
app_date,
appDate,
sms,
app_note,
in_t,
appNote,
inT,
) async {
try {
Map<String, String> data = {
......@@ -4830,17 +4845,17 @@ class ApiCalling {
'session_id': (session).toString(),
'nextapp': nextapp.toString(),
'orderstatus': orderstatus.toString(),
'lead_id': lead_id.toString(),
'followup_feedback': followup_feedback.toString(),
'followup_type': followup_type.toString(),
'lead_id': leadId.toString(),
'followup_feedback': followupFeedback.toString(),
'followup_type': followupType.toString(),
'followupintime': followupintime.toString(),
'loc': loc.toString(),
'followup_status': followup_status.toString(),
'followup_status': followupStatus.toString(),
'appointmentset': appointmentset.toString(),
'app_date': app_date.toString(),
'app_date': appDate.toString(),
'sms': sms.toString(),
'app_note': app_note.toString(),
'in_t': in_t.toString(),
'app_note': appNote.toString(),
'in_t': inT.toString(),
};
final res = await post(
data,
......@@ -4848,7 +4863,7 @@ class ApiCalling {
{},
);
if (res != null) {
print("Filter:${data}");
print("Filter:$data");
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
......@@ -4864,14 +4879,14 @@ class ApiCalling {
static Future<NearbyOpenLeadsResponse?> loadNearbyOpenLeadsAPI(
empId,
session,
emp_loc,
empLoc,
radius,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
'session_id': (session).toString(),
'emp_loc': (emp_loc).toString(),
'emp_loc': (empLoc).toString(),
'radius': radius.toString(),
};
final res = await post(data, crmNearbyOpenLeadsUrl, {});
......@@ -4892,7 +4907,7 @@ class ApiCalling {
static Future<crmDashboardFollowUpResponse?> crmDashboardFollowUpAPI(
empId,
session,
type,
type,
) async {
try {
Map<String, String> data = {
......@@ -4916,9 +4931,9 @@ class ApiCalling {
}
static Future<crmDashboardQuotationResponse?> crmDashboardQuotationsAPI(
empId,
session,
) async {
empId,
session,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
......@@ -4939,14 +4954,11 @@ class ApiCalling {
}
}
///hrm modules
///hrm modules
///
///
static Future<ogresponse?> ogChartAPI(
empId,
session,
) async {
static Future<ogresponse?> ogChartAPI(empId, session) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
......@@ -4967,10 +4979,7 @@ class ApiCalling {
}
}
static Future<jobDescriptionResponse?> jobDescriptAPI(
empId,
session,
) async {
static Future<jobDescriptionResponse?> jobDescriptAPI(empId, session) async {
try {
Map<String, String> data = {
'session_id': (session).toString(),
......@@ -4992,9 +5001,9 @@ class ApiCalling {
}
static Future<hrmAccessiblePagesResponse?> hrmAccessiblePagesAPI(
empId,
session,
) async {
empId,
session,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
......@@ -5016,13 +5025,13 @@ class ApiCalling {
}
static Future<attendanceRequestListResponse?> attendanceRequestListAPI(
empId,
session,
type,
from,
to,
mode
) async {
empId,
session,
type,
from,
to,
mode,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
......@@ -5047,12 +5056,11 @@ class ApiCalling {
}
}
static Future<attendanceRequestDetailsResponse?> attendanceRequestDetailAPI(
empId,
session,
attendanceRequestId,
) async {
empId,
session,
attendanceRequestId,
) async {
try {
Map<String, String> data = {
'emp_id': (empId).toString(),
......@@ -5075,13 +5083,13 @@ class ApiCalling {
}
static Future<CommonResponse?> attendanceRequestApproveRejectAPI(
session,
empId,
mode,
type,
remarks,
id,
) async {
session,
empId,
mode,
type,
remarks,
id,
) async {
try {
Map<String, String> data = {
'session_id': (session).toString(),
......@@ -5093,7 +5101,7 @@ class ApiCalling {
};
final res = await post(data, AttendanceRequestRejectUrl, {});
if (res != null) {
print("Attendance App Reje:${data}");
print("Attendance App Reje:$data");
debugPrint(res.body);
return CommonResponse.fromJson(jsonDecode(res.body));
} else {
......@@ -5122,7 +5130,10 @@ class ApiCalling {
String? note,
}) async {
try {
var request = http.MultipartRequest('POST', Uri.parse(AddAttendanceRequestUrl));
var request = http.MultipartRequest(
'POST',
Uri.parse(AddAttendanceRequestUrl),
);
// Add basic fields that are always required
Map<String, String> fields = {
......@@ -5141,7 +5152,12 @@ class ApiCalling {
fields["check_in_loc"] = checkInLoc ?? "";
if (checkInProof != null) {
request.files.add(await http.MultipartFile.fromPath("check_in_proof", checkInProof.path));
request.files.add(
await http.MultipartFile.fromPath(
"check_in_proof",
checkInProof.path,
),
);
}
}
......@@ -5151,7 +5167,12 @@ class ApiCalling {
fields["check_out_loc"] = checkOutLoc ?? "";
if (checkOutProof != null) {
request.files.add(await http.MultipartFile.fromPath("check_out_proof", checkOutProof.path));
request.files.add(
await http.MultipartFile.fromPath(
"check_out_proof",
checkOutProof.path,
),
);
}
}
......@@ -5161,7 +5182,9 @@ class ApiCalling {
// Log the actual fields being sent
debugPrint("addAttendanceRequestAPI - Type: $type");
debugPrint("addAttendanceRequestAPI - Fields: $fields");
debugPrint("addAttendanceRequestAPI - Files: ${request.files.map((f) => f.filename).toList()}");
debugPrint(
"addAttendanceRequestAPI - Files: ${request.files.map((f) => f.filename).toList()}",
);
var response = await request.send();
var resBody = await response.stream.bytesToString();
......@@ -5179,14 +5202,8 @@ class ApiCalling {
}
}
//reward list
static Future<rewardListResponse?> rewardListAPI(
empId,
session,
) async {
static Future<rewardListResponse?> rewardListAPI(empId, session) async {
try {
Map<String, String> data = {
'session_id': (session).toString(),
......@@ -5209,10 +5226,10 @@ class ApiCalling {
//tour exp
static Future<tourExpensesListResponse?> tourExpensesListAPI(
empId,
session,
pageNumber,
) async {
empId,
session,
pageNumber,
) async {
try {
Map<String, String> data = {
'session_id': (session).toString(),
......@@ -5235,10 +5252,10 @@ class ApiCalling {
}
static Future<tourExpensesDetailsResponse?> tourExpensesDetailAPI(
session,
empId,
tourBillId,
) async {
session,
empId,
tourBillId,
) async {
try {
Map<String, String> data = {
'session_id': (session).toString(),
......@@ -5261,10 +5278,10 @@ class ApiCalling {
}
static Future<tourExpensesAddViewResponse?> tourExpensesAddViewAPI(
empId,
session,
tourBillId,
) async {
empId,
session,
tourBillId,
) async {
try {
Map<String, String> data = {
'session_id': (session).toString(),
......@@ -5285,6 +5302,7 @@ class ApiCalling {
return null;
}
}
static Future<CommonResponse?> addTourBillAPI({
required String sessionId,
required String empId,
......@@ -5300,7 +5318,10 @@ class ApiCalling {
List<File>? otherImages,
}) async {
try {
var request = http.MultipartRequest("POST", Uri.parse(AddTourExpensesUrl));
var request = http.MultipartRequest(
"POST",
Uri.parse(AddTourExpensesUrl),
);
/// Add text fields
request.fields['session_id'] = sessionId;
......@@ -5320,10 +5341,7 @@ class ApiCalling {
for (var file in hotelImages) {
if (file.path.isNotEmpty) {
request.files.add(
await http.MultipartFile.fromPath(
"hotel_image[]",
file.path,
),
await http.MultipartFile.fromPath("hotel_image[]", file.path),
);
}
}
......@@ -5334,10 +5352,7 @@ class ApiCalling {
for (var file in travelImages) {
if (file.path.isNotEmpty) {
request.files.add(
await http.MultipartFile.fromPath(
"travel_image[]",
file.path,
),
await http.MultipartFile.fromPath("travel_image[]", file.path),
);
}
}
......@@ -5348,14 +5363,12 @@ class ApiCalling {
for (var file in otherImages) {
if (file.path.isNotEmpty) {
request.files.add(
await http.MultipartFile.fromPath(
"other_image[]",
file.path,
),
await http.MultipartFile.fromPath("other_image[]", file.path),
);
}
}
}
/// Send request
var response = await request.send();
var resBody = await response.stream.bytesToString();
......@@ -5375,18 +5388,15 @@ class ApiCalling {
}
}
// Leave Application api
// Leave Application api
static Future<leaveApplicationLIstResponse?> leaveApplicationListAPI(
session,
empId,
dateFrom,
dateTo,
mode
) async {
session,
empId,
dateFrom,
dateTo,
mode,
) async {
try {
Map<String, String> data = {
'session_id': (session).toString(),
......@@ -5394,7 +5404,6 @@ class ApiCalling {
'requested_date_from': (dateFrom),
'requested_date_to': (dateTo),
'mode': (mode),
};
final res = await post(data, LeaveApplicationListUrl, {});
if (res != null) {
......@@ -5412,10 +5421,10 @@ class ApiCalling {
}
static Future<leaveApplicationDetailsResponse?> leaveApplicationDetailAPI(
session,
empId,
leaveRequestId,
) async {
session,
empId,
leaveRequestId,
) async {
try {
Map<String, String> data = {
'session_id': (session).toString(),
......@@ -5436,17 +5445,18 @@ class ApiCalling {
return null;
}
}
//add leave request
static Future<CommonResponse?> leaveRequestAddAPI(
session,
empId,
fromDate,
fromTime,
toDate,
toTime,
leaveType,
reason
) async {
session,
empId,
fromDate,
fromTime,
toDate,
toTime,
leaveType,
reason,
) async {
try {
Map<String, String> data = {
'session_id': (session).toString(),
......@@ -5474,13 +5484,13 @@ class ApiCalling {
}
static Future<CommonResponse?> leaveRequestRejectApproveAPI(
session,
empId,
mode,
type,
remarks,
id,
) async {
session,
empId,
mode,
type,
remarks,
id,
) async {
try {
Map<String, String> data = {
'session_id': (session).toString(),
......@@ -5505,7 +5515,6 @@ class ApiCalling {
}
}
// static Future<CommonResponse?> TpcIssueListApprovalAPI(
// empId,
// session,
......
......@@ -63,14 +63,14 @@ const addPaymentReceiptViewUrl = "${baseUrl_test}add_payment_receipt_view";
const addPaymentRequestionSubmitUrl = "${baseUrl_test}add_payment_requsition_submit";
const addDirectPaymentRequestionSubmitUrl = "${baseUrl_test}add_direct_payment_submit";
const addPaymentReceiptSubmitUrl = "${baseUrl_test}add_payment_receipt_submit";
const paymentRequestionListUrl = "${baseUrl_test}payment_requsition_list";
const paymentRequestionListUrl = "${baseUrl_test}payment_requsition_list_v2";
const paymentRequestionDetailsUrl = "${baseUrl_test}payment_requisition_details";
const paymentRequestBankDetailsUrl = "${baseUrl_test}get_account_bank_details";
const approveRejectPaymentRequestUrl = "${baseUrl_test}approve_reject_payment_request_view";
const approveRejectPaymentRequestSubmitUrl = "${baseUrl_test}approve_reject_payment_request_submit";
const paymentRequesitionPaymentsListUrl = "${baseUrl_test}payment_requistion_payments_list";
const paymentRequesitionPaymentsListUrl = "${baseUrl_test}payment_requistion_payments_list_v2";
const paymentRequesitionPaymentsDetailsUrl = "${baseUrl_test}payment_requisition_payment_details";
const paymentRequesitionPaymentsReceiptsListUrl = "${baseUrl_test}payment_receipts_list";
const paymentRequesitionPaymentsReceiptsListUrl = "${baseUrl_test}payment_receipts_list_v2";
const paymentRequesitionPaymentsReceiptsDetailsUrl = "${baseUrl_test}payment_receipt_details";
const paymentRequesitionEditProcessedPaymentUrl = "${baseUrl_test}edit_processes_payment";
......@@ -82,9 +82,9 @@ const commonAddAccountViewgetDistrictUrl = "${baseUrl_test}get_district_on_state
const commonAddAccountViewgetSubLocationUrl = "${baseUrl_test}get_sublocation_on_district";
const commonAddAccountCheckInputsUrl = "${baseUrl_test}check_common_add_account_fields";
const commonAddAccountSubmit = "${baseUrl_test}common_add_account_submit";
const commonAccountListUrl = "${baseUrl_test}common_account_list";
const commonAccountListUrl = "${baseUrl_test}common_account_list_v2";
const commonAccountLedgerDropDownUrl = "${baseUrl_test}common_account_ledger_list_view";
const commonAccountLedgerListWithFilterUrl = "${baseUrl_test}common_account_ledger_list_submit_filter";
const commonAccountLedgerListWithFilterUrl = "${baseUrl_test}common_account_ledger_list_submit_filter_v2";
const commonAccountLedgerAccountDetails = "${baseUrl_test}common_account_details";
///order Module
......@@ -93,7 +93,7 @@ const ordersAccessibleAddPagesUrl = "${baseUrl_test}crm_add_order_accessible_pag
const ordersDashboardUrl = "${baseUrl_test}order_dashboard";
const ordersPendingTasksListUrl = "${baseUrl_test}pending_tasks_list";
const ordersOrderListByModeUrl = "${baseUrl_test}crm_order_list_view";
const ordersOrderListFilterUrl = "${baseUrl_test}crm_order_list_filter_submit";
const ordersOrderListFilterUrl = "${baseUrl_test}crm_order_list_filter_submit_v2";
const ordersOrderApproveRejectUrl = "${baseUrl_test}approve_reject_crm_order";
const ordersOrderLDeleteUrl = "${baseUrl_test}delete_crm_order";
const ordersOrderDetailsUrl = "${baseUrl_test}crm_order_details";
......@@ -115,7 +115,7 @@ const ordersEditPaymentDetailsAdjustedOrdersUrl ="${baseUrl_test}crm_payment_upd
const ordersAddPaymentSelectAccountForOrderUrl ="${baseUrl_test}select_account_for_order_payment";
const ordersAddPaymentSelectOrderUrl ="${baseUrl_test}select_order_for_order_payment";
const ordersPaymentListFilterUrl = "${baseUrl_test}crm_payments_list_view";
const ordersPaymentListByModeUrl = "${baseUrl_test}crm_payments_list_filter_submit";
const ordersPaymentListByModeUrl = "${baseUrl_test}crm_payments_list_filter_submit_v2";
const ordersPaymentListDeleteUrl = "${baseUrl_test}delete_crm_order_payment";
const ordersVerifyOtpUrl = "${baseUrl_test}verify_otp_add_order";
const ordersResendOtpUrl = "${baseUrl_test}resend_otp_add_order";
......@@ -124,9 +124,9 @@ const ordersPaymentDetailsUrl = "${baseUrl_test}crm_payment_details";
const ordersPaymentDetailsAddOrderUrl = "${baseUrl_test}crm_payment_add_adjusted_orders";
const ordersPaymentDetailsEditOrderUrl = "${baseUrl_test}crm_payment_edit_adjusted_orders";
const ordersAddTPCAgentUrl = "${baseUrl_test}add_tpc_agent_submit";
const ordersTPCAgentListUrl = "${baseUrl_test}tpc_agent_list";
const ordersTPCAgentListUrl = "${baseUrl_test}tpc_agent_list_v2";
const ordersTPCAgentDetailsUrl = "${baseUrl_test}tpc_agent_details";
const ordersPendingTPCIssueListUrl = "${baseUrl_test}pending_tpc_issue_list";
const ordersPendingTPCIssueListUrl = "${baseUrl_test}pending_tpc_issue_list_v2";
const ordersApprovePendingTPCIssueListUrl = "${baseUrl_test}update_pending_tpc_issue_list";
......@@ -156,7 +156,7 @@ const crmLeadDetailsGenerateQuotationViewUrl = "${baseUrl_test}crm_lead_details_
const crmLeadDetailsGenerateQuotationSubmitUrl = "${baseUrl_test}crm_lead_details_generate_quotation_submit";
const crmDownloadGeneratedQuotationUrl = "${baseUrl_test}download_generated_quotation_file";
const crmProspectListViewUrl = "${baseUrl_test}crm_prospect_list_view";
const crmProspectListFilterSubmitUrl = "${baseUrl_test}crm_prospect_list_filter_submit";
const crmProspectListFilterSubmitUrl = "${baseUrl_test}crm_prospect_list_filter_submit_v2";
const crmProspectDetailsUrl = "${baseUrl_test}crm_prospect_details";
const crmProspectDetailsTransferAccountUrl = "${baseUrl_test}crm_prospect_details_transfer_account_submit";
const crmProspectDetailsEditAccountViewUrl = "${baseUrl_test}crm_prospect_details_edit_account_view";
......
......@@ -5,16 +5,12 @@ import 'package:http/http.dart' as http;
Future<http.Response?> post(
Map<String, dynamic> Body,
api_url,
apiUrl,
Map<String, String> Headers,
) async {
http.Response? response;
try {
response = await http.post(
Uri.parse(api_url),
headers: Headers,
body: Body,
);
response = await http.post(Uri.parse(apiUrl), headers: Headers, body: Body);
return response;
} on Exception catch (e, s) {
print(e);
......@@ -23,10 +19,10 @@ Future<http.Response?> post(
return response;
}
Future<http.Response?> get(api_url, Map<String, String> Headers) async {
Future<http.Response?> get(apiUrl, Map<String, String> Headers) async {
http.Response? response;
try {
response = await http.get(Uri.parse(api_url), headers: Headers);
response = await http.get(Uri.parse(apiUrl), headers: Headers);
return response;
} on Exception catch (e, s) {
print(e);
......@@ -158,13 +154,13 @@ Future<String?> postImageNew(
Map<String, String> headers,
String urlLink,
File image,
req_field
reqField,
) async {
try {
var req = http.MultipartRequest('POST', Uri.parse(urlLink));
req.headers.addAll(headers?? {});
req.files.add(await http.MultipartFile.fromPath(req_field, image.path));
req.fields.addAll(body?? {});
req.headers.addAll(headers ?? {});
req.files.add(await http.MultipartFile.fromPath(reqField, image.path));
req.fields.addAll(body ?? {});
var res = await req.send();
final resBody = await res.stream.bytesToString();
......@@ -185,16 +181,14 @@ Future<String?> postImageNew(
//hotel_image
//other_image
Future<String?> PostMultipleImagesNew(
Map<String, String> body,
String urlLink,
Map<String, String> headers,
List<http.MultipartFile> newList,
List<http.MultipartFile> newList1,
List<http.MultipartFile> newList2,
) async {
Map<String, String> body,
String urlLink,
Map<String, String> headers,
List<http.MultipartFile> newList,
List<http.MultipartFile> newList1,
List<http.MultipartFile> newList2,
) async {
try {
var req = http.MultipartRequest('POST', Uri.parse(urlLink));
req.headers.addAll(headers);
......@@ -220,12 +214,12 @@ Future<String?> PostMultipleImagesNew(
}
Future<String?> PostMultipleImagesNew2(
Map<String, String> body,
String urlLink,
Map<String, String> headers,
List<http.MultipartFile> newList,
List<http.MultipartFile> newList1,
) async {
Map<String, String> body,
String urlLink,
Map<String, String> headers,
List<http.MultipartFile> newList,
List<http.MultipartFile> newList1,
) async {
try {
var req = http.MultipartRequest('POST', Uri.parse(urlLink));
req.headers.addAll(headers);
......@@ -249,9 +243,6 @@ Future<String?> PostMultipleImagesNew2(
}
}
Future<String?> PostMultipleImages(
Map<String, String> body,
String urlLink,
......
......@@ -61,10 +61,10 @@ packages:
dependency: transitive
description:
name: async
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
url: "https://pub.dev"
source: hosted
version: "2.13.0"
version: "2.12.0"
auto_size_text:
dependency: "direct main"
description:
......@@ -445,10 +445,10 @@ packages:
dependency: transitive
description:
name: fake_async
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
url: "https://pub.dev"
source: hosted
version: "1.3.3"
version: "1.3.2"
ffi:
dependency: transitive
description:
......@@ -1180,26 +1180,26 @@ packages:
dependency: transitive
description:
name: leak_tracker
sha256: "8dcda04c3fc16c14f48a7bb586d4be1f0d1572731b6d81d51772ef47c02081e0"
sha256: c35baad643ba394b40aac41080300150a4f08fd0fd6a10378f8f7c6bc161acec
url: "https://pub.dev"
source: hosted
version: "11.0.1"
version: "10.0.8"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: "1dbc140bb5a23c75ea9c4811222756104fbcd1a27173f0c34ca01e16bea473c1"
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
url: "https://pub.dev"
source: hosted
version: "3.0.10"
version: "3.0.9"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "8d5a2d49f4a66b49744b23b018848400d23e54caf9463f4eb20df3eb8acb2eb1"
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
version: "3.0.1"
lints:
dependency: transitive
description:
......@@ -2017,10 +2017,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
url: "https://pub.dev"
source: hosted
version: "15.0.0"
version: "14.3.1"
watcher:
dependency: transitive
description:
......
......@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.103+111
version: 1.0.104+112
environment:
sdk: ^3.7.2
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment