Commit 7959ada6 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

01-08-2025 By Sai Srinivas

Finance Module and CRM issues
parent 14d01f4d
...@@ -883,7 +883,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -883,7 +883,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
Expanded( Expanded(
flex: 4, flex: 4,
child: Text( child: Text(
"Find Nearby Generators", "Find Nearby Leads",
style: TextStyle( style: TextStyle(
fontSize: 14, fontSize: 14,
color: AppColors.app_blue, color: AppColors.app_blue,
...@@ -1108,10 +1108,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> { ...@@ -1108,10 +1108,7 @@ class _CrmdashboardScreenState extends State<CrmdashboardScreen> {
), ),
floatingActionButtonLocation: floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat, FloatingActionButtonLocation.centerFloat,
floatingActionButton:(provider.accessPages floatingActionButton:provider.accessPages.any((element) => [8,9].contains(element.id),)? InkResponse(
.where((page) => [8, 9].contains(page.id))
.toList()
.contains([8, 9]))? InkResponse(
onTap: () async { onTap: () async {
// if (provider.accessPages // if (provider.accessPages
// .where((page) => [8, 9].contains(page.id)) // .where((page) => [8, 9].contains(page.id))
......
...@@ -14,7 +14,8 @@ import 'package:provider/provider.dart'; ...@@ -14,7 +14,8 @@ import 'package:provider/provider.dart';
class Followupupdatescreen extends StatefulWidget { class Followupupdatescreen extends StatefulWidget {
final leadID; final leadID;
final mode; final mode;
const Followupupdatescreen({super.key,required this.leadID, this.mode}); final from;
const Followupupdatescreen({super.key,required this.leadID, this.mode, this.from});
@override @override
State<Followupupdatescreen> createState() => _FollowupupdatescreenState(); State<Followupupdatescreen> createState() => _FollowupupdatescreenState();
...@@ -34,7 +35,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -34,7 +35,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
setState(() => _source = event); setState(() => _source = event);
}); });
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
final provider = Provider.of<followUpUpdateProvider>(context); final provider = Provider.of<followUpUpdateProvider>(context,listen: false);
provider.getCurrentLocation(context); provider.getCurrentLocation(context);
}); });
} }
...@@ -115,7 +116,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -115,7 +116,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
child: Column( child: Column(
children: [ children: [
Container( Container(
padding: EdgeInsets.only(left: 10), padding: EdgeInsets.only(left: 10,top: 10),
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Text( child: Text(
"Follow up Details", "Follow up Details",
...@@ -520,6 +521,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -520,6 +521,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
], ],
), ),
), ),
SizedBox(height: 25),
] else if(provider.nextAppointmentStatus == ] else if(provider.nextAppointmentStatus ==
"Next Appointment") "Next Appointment")
...[ ...[
...@@ -692,7 +694,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -692,7 +694,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
], ],
), ),
), ),
SizedBox(height: 25),
], ],
SizedBox(height: 150), SizedBox(height: 150),
], ],
...@@ -705,6 +707,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> { ...@@ -705,6 +707,7 @@ class _FollowupupdatescreenState extends State<Followupupdatescreen> {
provider.submitLoading = true; provider.submitLoading = true;
provider.crmAddFollowUpAPIFunction( provider.crmAddFollowUpAPIFunction(
context, context,
widget.from,
provider.nextAppointmentStatus, provider.nextAppointmentStatus,
provider.selectOrderStatus, provider.selectOrderStatus,
widget.leadID, widget.leadID,
......
...@@ -676,21 +676,11 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> { ...@@ -676,21 +676,11 @@ class _GeneratequotationscreenState extends State<Generatequotationscreen> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children:provider.buttonsLoading?[ children:provider.buttonsLoading?[
CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(AppColors.app_blue),
),
SizedBox(width:25),
SvgPicture.asset("assets/svg/crm/vertical_line_ic.svg"),
SizedBox(width:25), SizedBox(width:25),
CircularProgressIndicator.adaptive( CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(AppColors.app_blue), valueColor: AlwaysStoppedAnimation(AppColors.app_blue),
), ),
SizedBox(width:25), SizedBox(width:25),
SvgPicture.asset("assets/svg/crm/vertical_line_ic.svg"),
SizedBox(width:25),
CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation(AppColors.app_blue),
)
]: [ ]: [
Expanded( Expanded(
child: InkResponse( child: InkResponse(
......
...@@ -282,6 +282,7 @@ class _PendingtasksdetailsState extends State<Pendingtasksdetails> { ...@@ -282,6 +282,7 @@ class _PendingtasksdetailsState extends State<Pendingtasksdetails> {
context, context,
MaterialPageRoute(builder: (context) => Followupupdatescreen( MaterialPageRoute(builder: (context) => Followupupdatescreen(
leadID: task.leadid, leadID: task.leadid,
from:"Pending Tasks"
)), )),
); );
}, },
......
...@@ -121,13 +121,13 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -121,13 +121,13 @@ class _AllpaymentrequesitionlistsbymodesState
case 'Requested': case 'Requested':
return "R"; return "R";
case 'Level 1 Approved': case 'Level 1 Approved':
return "A"; return "L1A";
case 'Level 1 Rejected': case 'Level 1 Rejected':
return "R"; return "L1R";
case 'Level 2 Approved': case 'Level 2 Approved':
return "A"; return "L2A";
case 'Level 2 Rejected': case 'Level 2 Rejected':
return "R"; return "L2R";
case 'Processed': case 'Processed':
return "P"; return "P";
case 'Payment Rejected': case 'Payment Rejected':
...@@ -137,6 +137,28 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -137,6 +137,28 @@ class _AllpaymentrequesitionlistsbymodesState
return text; return text;
} }
double getSize(value){
var text = "A";
switch (value){
case 'Requested':
return 18.0;
case 'Level 1 Approved':
return 14.0;
case 'Level 1 Rejected':
return 14.0;
case 'Level 2 Approved':
return 14.0;
case 'Level 2 Rejected':
return 14.0;
case 'Processed':
return 18.0;
case 'Payment Rejected':
return 18.0;
}
return 18.0;
}
@override @override
void dispose() { void dispose() {
// TODO: implement dispose // TODO: implement dispose
...@@ -315,7 +337,7 @@ class _AllpaymentrequesitionlistsbymodesState ...@@ -315,7 +337,7 @@ class _AllpaymentrequesitionlistsbymodesState
getText(requestLists[index].status), getText(requestLists[index].status),
style: TextStyle( style: TextStyle(
color: getTextColor(requestLists[index].status), color: getTextColor(requestLists[index].status),
fontSize: 18, fontSize: getSize(requestLists[index].status),
fontFamily: "JakartaBold" fontFamily: "JakartaBold"
), ),
), ),
......
...@@ -79,8 +79,8 @@ class _FileviewerState extends State<Fileviewer> { ...@@ -79,8 +79,8 @@ class _FileviewerState extends State<Fileviewer> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
appBar: appbar(context, "File Viewer"), appBar: appbarNew(context, "File Viewer",0xFFFFFFFF),
body: SafeArea(child: fileWidget(context)), body: SafeArea(child: Center(child: fileWidget(context))),
); );
} }
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:dotted_line/dotted_line.dart';
import 'package:dropdown_button2/dropdown_button2.dart'; import 'package:dropdown_button2/dropdown_button2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
...@@ -64,6 +65,7 @@ class _PaymentrequestionlistdetailsState ...@@ -64,6 +65,7 @@ class _PaymentrequestionlistdetailsState
// Final decision on whether to show buttons // Final decision on whether to show buttons
bool shouldShowButtons = false; bool shouldShowButtons = false;
final numberFormat = NumberFormat.decimalPattern(); final numberFormat = NumberFormat.decimalPattern();
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
...@@ -77,7 +79,9 @@ class _PaymentrequestionlistdetailsState ...@@ -77,7 +79,9 @@ class _PaymentrequestionlistdetailsState
context, context,
listen: false, listen: false,
); );
provider.showMoreDetails = false;
provider.checkDropDownReset(); provider.checkDropDownReset();
print(widget.paymentRequestId);
provider.paymentRequesitionDetails(context, widget.paymentRequestId); provider.paymentRequesitionDetails(context, widget.paymentRequestId);
}); });
} }
...@@ -110,13 +114,76 @@ class _PaymentrequestionlistdetailsState ...@@ -110,13 +114,76 @@ class _PaymentrequestionlistdetailsState
child: SafeArea( child: SafeArea(
top: false, top: false,
bottom: true, bottom: true,
child: _scaffold(context), child: _scaffold1(context),
), ),
) )
: _scaffold(context) : _scaffold1(context)
: NoNetwork(context); : NoNetwork(context);
} }
Color getDecorationColor(value) {
var color = AppColors.approved_bg_color;
switch (value) {
case 'Requested':
return AppColors.requested_bg_color;
case 'Level 1 Approved':
return AppColors.approved_bg_color;
case 'Level 1 Rejected':
return AppColors.rejected_bg_color;
case 'Level 2 Approved':
return AppColors.approved_bg_color;
case 'Level 2 Rejected':
return AppColors.rejected_bg_color;
case 'Processed':
return AppColors.processed_bg_color;
case 'Payment Rejected':
return AppColors.rejected_bg_color;
}
return color;
}
Color getTextColor(value) {
var color = AppColors.approved_text_color;
switch (value) {
case 'Requested':
return AppColors.requested_text_color;
case 'Level 1 Approved':
return AppColors.approved_text_color;
case 'Level 1 Rejected':
return AppColors.rejected_text_color;
case 'Level 2 Approved':
return AppColors.approved_text_color;
case 'Level 2 Rejected':
return AppColors.rejected_text_color;
case 'Processed':
return AppColors.processed_text_color;
case 'Payment Rejected':
return AppColors.rejected_text_color;
}
return color;
}
getText(value) {
switch (value) {
case 'Requested':
return "Requested";
case 'Level 1 Approved':
return "L1 Approved";
case 'Level 1 Rejected':
return "L1 Rejected";
case 'Level 2 Approved':
return "L2 Approved";
case 'Level 2 Rejected':
return "L2 Rejected";
case 'Processed':
return "Processed";
case 'Payment Rejected':
return "Payment Rejected";
default:
return "Requested";
}
}
Widget _scaffold(BuildContext context) { Widget _scaffold(BuildContext context) {
return Consumer<Requesitionlidtdetailsprovider>( return Consumer<Requesitionlidtdetailsprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
...@@ -592,6 +659,584 @@ class _PaymentrequestionlistdetailsState ...@@ -592,6 +659,584 @@ class _PaymentrequestionlistdetailsState
); );
} }
Widget _scaffold1(BuildContext context) {
return Consumer<Requesitionlidtdetailsprovider>(
builder: (context, provider, child) {
var req_det = provider.requestsDetails;
var pay_det = provider.paymentsDetails;
isLevel1Finalized = [
"Level 1 Approved",
"Level 1 Rejected",
"Level 1 approved",
"Level 1 rejected",
].contains(req_det.status);
isLevel2Finalized = [
"Level 2 Approved",
"Level 2 Rejected",
"Level 2 approved",
"Level 2 rejected",
].contains(req_det.status);
if (widget.mode == "apr_lvl1") {
shouldShowButtons = !isLevel1Finalized;
} else if (widget.mode == "apr_lvl2") {
shouldShowButtons =
!isLevel2Finalized &&
[
"Requested",
"Level 1 Approved",
"Level 1 approved",
].contains(req_det.status);
} else if (widget.mode == "process") {
shouldShowButtons = [
"Level 2 Approved",
"Level 2 approved",
].contains(req_det.status);
} else if (widget.mode == "self_apr_lvl2") {
shouldShowButtons = ["Requested"].contains(req_det.status);
}
final headings2 = [
"Proposed Payment Account",
"Requesting Purpose",
"Requested Amount",
"Approved Amount",
"Requested Date",
];
final subHeadings2 = [
req_det.proposedAccount ?? "-",
req_det.requestingPurpose ?? "-",
req_det.requestedAmount ?? "-",
req_det.amount ?? "-",
req_det.date ?? "-",
];
final headings3 = [
"Account Name",
"Payment Account",
"Payment Mode",
"Employee",
"Amount",
"Payment Date",
"Attachment"
];
final subHeadings3 = [
pay_det.accountName ?? "-",
pay_det.paymentAccountName ?? "-",
pay_det.mode ?? "-",
pay_det.paymentEmployeeName ?? "-",
req_det.amount ?? "-",
req_det.date ?? "-",
"View",
];
final headings4 = [
"Bank Name",
"Account Holder Name",
"Account Number",
"Branch",
"IFSC",
"UPI ID",
];
final subHeadings4 = [
pay_det.bankName ?? "-",
pay_det.bankAccountHolderName ?? "-",
pay_det.bankAccountNumber ?? "-",
pay_det.bankBranchName ?? "-",
pay_det.bankIfscCode ?? "-",
pay_det.bankUpiId ?? "-",
];
final headings5 = [
"Level 1 Approved By",
"Level 1 Remarks",
"Level 2 Approved By",
"Level 2 Remarks",
];
final subHeadings5 = [
req_det.level1Employee ?? "-",
req_det.level1ApprovalRemarks ?? "-",
req_det.level2Employee ?? "-",
req_det.level2ApprovalRemarks ?? "-",
];
final headings6 = ["Note", "Created Employee", ];
final subHeadings6 = [
req_det.description ?? "-",
req_det.createdEmployee ?? "-",
];
var headings = [...headings2];
var subHeadings = [...subHeadings2];
var titles = ["Account Details"];
if (provider.showMoreDetails) {
headings = [...headings3, ...headings4, ...headings5, ...headings6];
subHeadings = [
...subHeadings2,
...subHeadings3,
...subHeadings4,
...subHeadings5,
...subHeadings6,
];
titles = [
"Account Details",
"Request Details",
"Bank Details",
"Approval Details",
"Other Details",
];
}
final sections = [
{
"title": "Account Details",
"headings": headings2,
"subHeadings": subHeadings2,
},
if (provider.showMoreDetails) ...[
{
"title": "Request Details",
"headings": headings3,
"subHeadings": subHeadings3,
},
{
"title": "Bank Details",
"headings": headings4,
"subHeadings": subHeadings4,
},
{
"title": "Approval Details",
"headings": headings5,
"subHeadings": subHeadings5,
},
{
"title": "Other Details",
"headings": headings6,
"subHeadings": subHeadings6,
},
],
];
return Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar2New(
context,
widget.pageName,
provider.resetAll,
SizedBox(width: 0),
0xFFFFFFFF,
),
backgroundColor: AppColors.scaffold_bg_color,
body: SingleChildScrollView(
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(30),
bottomRight: Radius.circular(30),
),
),
elevation: 2,
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(30),
bottomRight: Radius.circular(30),
),
),
// margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 45,
width: 45,
padding: EdgeInsets.all(7.5),
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
shape: BoxShape.circle,
// borderRadius: BorderRadius.circular(8),
),
child: SvgPicture.asset("assets/svg/fin_ic.svg"),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
InkResponse(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Accountslistdetails(
accountID:
provider
.requestsDetails
.accountId,
),
),
);
},
child: Padding(
padding: const EdgeInsets.only(
top: 8.0,
bottom: 4,
),
child: Text(
req_det.accountName == ""
? "-"
: req_det.accountName ?? "-",
style: TextStyle(
decoration: TextDecoration.underline,
decorationStyle:
TextDecorationStyle.dotted,
decorationColor: AppColors.grey_thick,
height: 1.2,
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
),
Text(
req_det.amount == ""
? "-"
: "₹${req_det.amount}",
style: TextStyle(
fontFamily: "JakartaRegular",
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: getDecorationColor(req_det.status ?? "-"),
),
child: Center(
child: Text(
getText(req_det.status ?? "-"),
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: getTextColor(req_det.status),
),
),
),
),
),
],
),
SizedBox(height: 10),
Column(
children: List.generate(sections.length, (sectionIndex) {
final section = sections[sectionIndex];
final title = section["title"] as String;
final headings = section["headings"] as List<String>;
final subHeadings =
section["subHeadings"] as List<String>;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 4),
child: Row(
children: [
Expanded(
flex: 3,
child: Text(
title,
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaSemiBold",
),
),
),
Expanded(
flex: 6,
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor: AppColors.grey_semi,
dashLength: 2,
lineThickness: 0.5,
),
),
],
),
),
Column(
children: List.generate(headings.length, (j) {
return Container(
padding: EdgeInsets.symmetric(vertical: 7),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: InkResponse(
onTap:
subHeadings[j] == "View"
? () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(
context,
) => Fileviewer(
fileName:
req_det
.attachmentViewFileName ??
"",
fileUrl:
req_det
.attachmentDirFilePath ??
"",
),
),
);
}
: null,
child: Text(
subHeadings[j].isEmpty
? "-"
: subHeadings[j],
style: TextStyle(
fontSize: 14,
decoration:
subHeadings[j] == "View"
? TextDecoration.underline
: TextDecoration.none,
decorationColor:
AppColors.app_blue,
color:
subHeadings[j] == "View"
? AppColors.app_blue
: Color(0xFF818181),
),
),
),
),
],
),
);
}),
),
],
);
}),
),
InkResponse(
onTap: () async {
provider.showMoreDetails = !provider.showMoreDetails;
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
provider.showMoreDetails
? "Hide Details"
: "View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
Transform.flip(
flipY: provider.showMoreDetails ? true : false,
child: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg",
height: 25,
width: 20,
color: AppColors.app_blue,
),
),
],
),
),
),
SizedBox(height: 25),
],
),
),
),
),
bottomNavigationBar:
(["admin", "self"].contains(widget.mode) || !shouldShowButtons)
? SizedBox.shrink()
: Container(
decoration: BoxDecoration(color: Colors.white),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
alignment: Alignment.bottomCenter,
height: 80,
child: Container(
margin: EdgeInsets.only(bottom: 10),
alignment: Alignment.center,
height: 45,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Expanded(
child: InkResponse(
onTap: () {
print(provider.requestsDetails.id);
_showLevelRejectionSheet(
context,
provider.requestsDetails.id,
);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFFFEFEF),
border: Border.all(
color: Color(0xFFED3424),
width: 0.5,
),
),
child: Center(
child: Text(
"Reject",
style: TextStyle(color: Color(0xFFED3424)),
),
),
),
),
),
SizedBox(width: 10),
if ([
"apr_lvl1",
"apr_lvl2",
"self_apr_lvl2",
].contains(widget.mode)) ...[
SvgPicture.asset(
"assets/svg/crm/vertical_line_ic.svg",
),
SizedBox(width: 10),
Expanded(
child: InkResponse(
onTap: () {
provider
.approveRejectPaymentRequestAPIFunction(
context,
provider.requestsDetails.id,
);
_showLevelApprovalSheet(
context,
provider.requestsDetails.id,
);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFE7FFE5),
border: Border.all(
color: Color(0xFF0D9C00),
width: 0.5,
),
),
child: Center(
child: Text(
"Approve",
style: TextStyle(
color: Color(0xFF0D9C00),
),
),
),
),
),
),
SizedBox(width: 10),
] else if (widget.mode == "process") ...[
SvgPicture.asset(
"assets/svg/crm/vertical_line_ic.svg",
),
SizedBox(width: 10),
Expanded(
child: InkResponse(
onTap: () {
provider
.approveRejectPaymentRequestAPIFunction(
context,
provider.requestsDetails.id,
);
provider.preValues();
_showAddPaymentSheet(
context,
provider.requestsDetails.id,
);
},
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8),
color: Color(0xFFE7FFE5),
border: Border.all(
color: Color(0xFF0D9C00),
width: 0.5,
),
),
child: Center(
child: Text(
"Add Payment",
style: TextStyle(
color: Color(0xFF0D9C00),
),
),
),
),
),
),
],
],
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
);
},
);
}
Future<void> _showLevelApprovalSheet(BuildContext context, paymentID) { Future<void> _showLevelApprovalSheet(BuildContext context, paymentID) {
return showModalBottomSheet( return showModalBottomSheet(
useSafeArea: true, useSafeArea: true,
...@@ -955,460 +1600,460 @@ class _PaymentrequestionlistdetailsState ...@@ -955,460 +1600,460 @@ class _PaymentrequestionlistdetailsState
); );
} }
Future<void> _showAddPaymentSheet1(BuildContext context, paymentID) { // Future<void> _showAddPaymentSheet1(BuildContext context, paymentID) {
return showModalBottomSheet( // return showModalBottomSheet(
useSafeArea: true, // useSafeArea: true,
isDismissible: true, // isDismissible: true,
isScrollControlled: true, // isScrollControlled: true,
showDragHandle: true, // showDragHandle: true,
backgroundColor: Colors.white, // backgroundColor: Colors.white,
enableDrag: true, // enableDrag: true,
context: context, // context: context,
builder: (context) { // builder: (context) {
return StatefulBuilder( // return StatefulBuilder(
builder: (context, setState) { // builder: (context, setState) {
return SafeArea( // return SafeArea(
child: Consumer<Requesitionlidtdetailsprovider>( // child: Consumer<Requesitionlidtdetailsprovider>(
builder: (context, provider, child) { // builder: (context, provider, child) {
return Scaffold( // return Scaffold(
body: Container( // body: Container(
margin: EdgeInsets.only( // margin: EdgeInsets.only(
bottom: 15, // bottom: 15,
left: 15, // left: 15,
right: 15, // right: 15,
top: 10, // top: 10,
), // ),
padding: EdgeInsets.only( // padding: EdgeInsets.only(
bottom: MediaQuery.of(context).viewInsets.bottom, // bottom: MediaQuery.of(context).viewInsets.bottom,
), // ),
//
child: Column( // child: Column(
children: [ // children: [
Row( // Row(
children: [ // children: [
Expanded( // Expanded(
child: SizedBox( // child: SizedBox(
child: Column( // child: Column(
crossAxisAlignment: // crossAxisAlignment:
CrossAxisAlignment.start, // CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, // mainAxisSize: MainAxisSize.min,
children: [ // children: [
Align( // Align(
alignment: Alignment.topLeft, // alignment: Alignment.topLeft,
child: Text( // child: Text(
"Add Approval", // "Add Approval",
style: TextStyle( // style: TextStyle(
color: AppColors.app_blue, // color: AppColors.app_blue,
fontSize: 16, // fontSize: 16,
), // ),
), // ),
), // ),
//
textControllerReadonlyWidget( // textControllerReadonlyWidget(
context, // context,
provider.proposedPaymentAccount, // provider.proposedPaymentAccount,
"Enter Proposed Payment Account", // "Enter Proposed Payment Account",
(p0) {}, // (p0) {},
), // ),
//
TextWidget(context, "Payment Account"), // TextWidget(context, "Payment Account"),
DropdownButtonHideUnderline( // DropdownButtonHideUnderline(
child: Row( // child: Row(
children: [ // children: [
Expanded( // Expanded(
child: DropdownButton2< // child: DropdownButton2<
PaymentAccounts // PaymentAccounts
>( // >(
isExpanded: true, // isExpanded: true,
hint: Text( // hint: Text(
'Select Account', // 'Select Account',
style: TextStyle( // style: TextStyle(
fontSize: 14, // fontSize: 14,
), // ),
overflow: // overflow:
TextOverflow.ellipsis, // TextOverflow.ellipsis,
), // ),
items: // items:
provider.paymentsAccounts // provider.paymentsAccounts
.map( // .map(
( // (
paymenents, // paymenents,
) => DropdownMenuItem< // ) => DropdownMenuItem<
PaymentAccounts // PaymentAccounts
>( // >(
value: paymenents, // value: paymenents,
child: Text( // child: Text(
paymenents.name ?? // paymenents.name ??
'', // '',
style: // style:
const TextStyle( // const TextStyle(
fontSize: // fontSize:
14, // 14,
), // ),
overflow: // overflow:
TextOverflow // TextOverflow
.ellipsis, // .ellipsis,
), // ),
), // ),
) // )
.toList(), // .toList(),
value: // value:
provider // provider
.selectedPaymentAccounts, // .selectedPaymentAccounts,
onChanged: ( // onChanged: (
PaymentAccounts? value, // PaymentAccounts? value,
) { // ) {
if (value != null) { // if (value != null) {
if (provider // if (provider
.paymentsAccounts // .paymentsAccounts
.isNotEmpty) { // .isNotEmpty) {
provider.selectedPaymentAccounts = // provider.selectedPaymentAccounts =
value; // value;
print( // print(
"Selected Complaint Type: ${value.name}, ID: ${value.id}", // "Selected Complaint Type: ${value.name}, ID: ${value.id}",
); // );
provider.selectedID = // provider.selectedID =
value.id!; // value.id!;
provider.selectedValue = // provider.selectedValue =
value.name!; // value.name!;
print( // print(
"hfjkshfg" + // "hfjkshfg" +
provider.selectedID // provider.selectedID
.toString(), // .toString(),
); // );
} // }
} // }
}, // },
dropdownSearchData: DropdownSearchData( // dropdownSearchData: DropdownSearchData(
searchInnerWidgetHeight: 50, // searchInnerWidgetHeight: 50,
searchController: // searchController:
provider // provider
.paymentAccountSearchController, // .paymentAccountSearchController,
searchInnerWidget: Padding( // searchInnerWidget: Padding(
padding: // padding:
const EdgeInsets.all(8), // const EdgeInsets.all(8),
child: TextFormField( // child: TextFormField(
controller: // controller:
provider // provider
.paymentAccountSearchController, // .paymentAccountSearchController,
decoration: InputDecoration( // decoration: InputDecoration(
isDense: true, // isDense: true,
contentPadding: // contentPadding:
const EdgeInsets.symmetric( // const EdgeInsets.symmetric(
horizontal: 10, // horizontal: 10,
vertical: 8, // vertical: 8,
), // ),
hintText: // hintText:
'Search account...', // 'Search account...',
border: OutlineInputBorder( // border: OutlineInputBorder(
borderRadius: // borderRadius:
BorderRadius.circular( // BorderRadius.circular(
8, // 8,
), // ),
), // ),
), // ),
), // ),
), // ),
searchMatchFn: ( // searchMatchFn: (
item, // item,
searchValue, // searchValue,
) { // ) {
return item.value?.name // return item.value?.name
?.toLowerCase() // ?.toLowerCase()
.contains( // .contains(
searchValue // searchValue
.toLowerCase(), // .toLowerCase(),
) ?? // ) ??
false; // false;
}, // },
//
// Optional: clear search text when dropdown closes // // Optional: clear search text when dropdown closes
), // ),
onMenuStateChange: (isOpen) { // onMenuStateChange: (isOpen) {
if (!isOpen) { // if (!isOpen) {
provider // provider
.paymentAccountSearchController // .paymentAccountSearchController
.clear(); // .clear();
} // }
}, // },
buttonStyleData: // buttonStyleData:
ddtheme.buttonStyleData, // ddtheme.buttonStyleData,
iconStyleData: // iconStyleData:
ddtheme.iconStyleData, // ddtheme.iconStyleData,
menuItemStyleData: // menuItemStyleData:
ddtheme.menuItemStyleData, // ddtheme.menuItemStyleData,
dropdownStyleData: // dropdownStyleData:
ddtheme.dropdownStyleData, // ddtheme.dropdownStyleData,
), // ),
), // ),
], // ],
), // ),
), // ),
//
textControllerReadonlyWidget( // textControllerReadonlyWidget(
context, // context,
provider.approvedAmountReadonly, // provider.approvedAmountReadonly,
"Approved Amount", // "Approved Amount",
(p0) {}, // (p0) {},
), // ),
//
textControllerWidget( // textControllerWidget(
context, // context,
provider.approvedAmount, // provider.approvedAmount,
"Payment Amount", // "Payment Amount",
"Enter Payment Amount", // "Enter Payment Amount",
(p0) { // (p0) {
if (numberFormat.parse( // if (numberFormat.parse(
provider // provider
.approvedAmountReadonly // .approvedAmountReadonly
.text, // .text,
) < // ) <
numberFormat.parse( // numberFormat.parse(
provider.approvedAmount.text, // provider.approvedAmount.text,
)) { // )) {
provider.proposedAmountError = // provider.proposedAmountError =
"Amount Should not be greater than Approved amount"; // "Amount Should not be greater than Approved amount";
} else { // } else {
provider.proposedAmountError = ""; // provider.proposedAmountError = "";
} // }
}, // },
TextInputType.numberWithOptions(), // TextInputType.numberWithOptions(),
false, // false,
null, // null,
), // ),
//
errorWidget( // errorWidget(
context, // context,
provider.proposedAmountError, // provider.proposedAmountError,
), // ),
//
textControllerWidget( // textControllerWidget(
context, // context,
paymentReferenceNumber, // paymentReferenceNumber,
"Payment Reference Number", // "Payment Reference Number",
"Enter Payment Reference Number", // "Enter Payment Reference Number",
(p0) {}, // (p0) {},
TextInputType.text, // TextInputType.text,
false, // false,
null, // null,
focusNodes[3], // focusNodes[3],
focusNodes[4], // focusNodes[4],
TextInputAction.next, // TextInputAction.next,
), // ),
//
textControllerWidget( // textControllerWidget(
context, // context,
remarks, // remarks,
"Remarks", // "Remarks",
"Enter Remarks", // "Enter Remarks",
(p0) {}, // (p0) {},
TextInputType.text, // TextInputType.text,
false, // false,
null, // null,
focusNodes[4], // focusNodes[4],
null, // null,
TextInputAction.done, // TextInputAction.done,
), // ),
//
InkResponse( // InkResponse(
onTap: () { // onTap: () {
_showAttachmentSheet(context); // _showAttachmentSheet(context);
}, // },
child: Container( // child: Container(
margin: EdgeInsets.symmetric( // margin: EdgeInsets.symmetric(
vertical: 10, // vertical: 10,
), // ),
height: 45, // height: 45,
width: // width:
MediaQuery.of(context).size.width, // MediaQuery.of(context).size.width,
decoration: BoxDecoration( // decoration: BoxDecoration(
color: Color(0xFFE6F6FF), // color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular( // borderRadius: BorderRadius.circular(
12, // 12,
), // ),
border: Border.all( // border: Border.all(
color: AppColors.app_blue, // color: AppColors.app_blue,
width: 0.5, // width: 0.5,
), // ),
), // ),
child: Center( // child: Center(
child: Text( // child: Text(
"Add Attachment", // "Add Attachment",
style: TextStyle( // style: TextStyle(
fontFamily: "JakartaMedium", // fontFamily: "JakartaMedium",
color: AppColors.app_blue, // color: AppColors.app_blue,
), // ),
), // ),
), // ),
), // ),
), // ),
if (provider.imagePicked == 1 && // if (provider.imagePicked == 1 &&
provider.imagePath != null) ...[ // provider.imagePath != null) ...[
Padding( // Padding(
padding: const EdgeInsets.symmetric( // padding: const EdgeInsets.symmetric(
vertical: 4.0, // vertical: 4.0,
), // ),
child: Row( // child: Row(
mainAxisAlignment: // mainAxisAlignment:
MainAxisAlignment.spaceBetween, // MainAxisAlignment.spaceBetween,
children: [ // children: [
Text( // Text(
"${provider.imagePath}", // "${provider.imagePath}",
style: TextStyle( // style: TextStyle(
color: AppColors.semi_black, // color: AppColors.semi_black,
fontSize: 11, // fontSize: 11,
fontWeight: FontWeight.w600, // fontWeight: FontWeight.w600,
), // ),
), // ),
InkResponse( // InkResponse(
onTap: () { // onTap: () {
provider.imagePicked = 0; // provider.imagePicked = 0;
provider.imagePath = null; // provider.imagePath = null;
provider.imageFilePath = null; // provider.imageFilePath = null;
}, // },
child: SvgPicture.asset( // child: SvgPicture.asset(
"assets/svg/ic_close.svg", // "assets/svg/ic_close.svg",
width: 15, // width: 15,
height: 15, // height: 15,
), // ),
), // ),
], // ],
), // ),
), // ),
], // ],
textControllerReadonlyWidget( // textControllerReadonlyWidget(
context, // context,
provider.accountName, // provider.accountName,
"Enter Account Name", // "Enter Account Name",
(p0) {}, // (p0) {},
), // ),
textControllerReadonlyWidget( // textControllerReadonlyWidget(
context, // context,
provider.branch, // provider.branch,
"Enter Branch Name", // "Enter Branch Name",
(p0) {}, // (p0) {},
), // ),
textControllerReadonlyWidget( // textControllerReadonlyWidget(
context, // context,
provider.requestingPurpose, // provider.requestingPurpose,
"Enter Requesting Purpose", // "Enter Requesting Purpose",
(p0) {}, // (p0) {},
), // ),
//
textControllerReadonlyWidget( // textControllerReadonlyWidget(
context, // context,
provider.description, // provider.description,
"Enter Description", // "Enter Description",
(p0) {}, // (p0) {},
), // ),
//
textControllerReadonlyWidget( // textControllerReadonlyWidget(
context, // context,
provider.amount, // provider.amount,
"Enter Amount", // "Enter Amount",
(p0) {}, // (p0) {},
), // ),
textControllerReadonlyWidget( // textControllerReadonlyWidget(
context, // context,
provider.paymentMode, // provider.paymentMode,
"Enter Payment Mode", // "Enter Payment Mode",
(p0) {}, // (p0) {},
), // ),
textControllerReadonlyWidget( // textControllerReadonlyWidget(
context, // context,
provider.bankHolderName, // provider.bankHolderName,
"Bank Account Holder Name", // "Bank Account Holder Name",
(p0) {}, // (p0) {},
), // ),
textControllerReadonlyWidget( // textControllerReadonlyWidget(
context, // context,
provider.bankAccountNumber, // provider.bankAccountNumber,
"Bank Account Number", // "Bank Account Number",
(p0) {}, // (p0) {},
), // ),
textControllerReadonlyWidget( // textControllerReadonlyWidget(
context, // context,
provider.bankName, // provider.bankName,
"Bank Name", // "Bank Name",
(p0) {}, // (p0) {},
), // ),
textControllerReadonlyWidget( // textControllerReadonlyWidget(
context, // context,
provider.bankBranchName, // provider.bankBranchName,
"Bank Branch Name", // "Bank Branch Name",
(p0) {}, // (p0) {},
), // ),
//
textControllerReadonlyWidget( // textControllerReadonlyWidget(
context, // context,
provider.bankIfscCode, // provider.bankIfscCode,
"Bank IFSC Code", // "Bank IFSC Code",
(p0) {}, // (p0) {},
), // ),
textControllerReadonlyWidget( // textControllerReadonlyWidget(
context, // context,
provider.bankUpiID, // provider.bankUpiID,
"Bank UPI ID", // "Bank UPI ID",
(p0) {}, // (p0) {},
), // ),
], // ],
), // ),
), // ),
), // ),
], // ],
), // ),
], // ],
), // ),
), // ),
bottomNavigationBar: Align( // bottomNavigationBar: Align(
alignment: Alignment.bottomCenter, // alignment: Alignment.bottomCenter,
child: InkWell( // child: InkWell(
onTap: () { // onTap: () {
provider.paymentrequisitionProcessSubmitAPIFunction( // provider.paymentrequisitionProcessSubmitAPIFunction(
context, // context,
widget.mode, // widget.mode,
paymentReferenceNumber.text, // paymentReferenceNumber.text,
provider.approvedAmount.text, // provider.approvedAmount.text,
paymentID, // paymentID,
provider.selectedID, // provider.selectedID,
remarks.text, // remarks.text,
provider.imagePath, // provider.imagePath,
); // );
}, // },
child: Container( // child: Container(
alignment: Alignment.bottomCenter, // alignment: Alignment.bottomCenter,
height: 45, // height: 45,
margin: EdgeInsets.only( // margin: EdgeInsets.only(
left: 5.0, // left: 5.0,
right: 5.0, // right: 5.0,
top: 5.0, // top: 5.0,
bottom: 5.0, // bottom: 5.0,
), // ),
decoration: BoxDecoration( // decoration: BoxDecoration(
color: AppColors.app_blue, //1487C9 // color: AppColors.app_blue, //1487C9
borderRadius: BorderRadius.circular(14.0), // borderRadius: BorderRadius.circular(14.0),
), // ),
child: Center( // child: Center(
child: Text( // child: Text(
"Submit", // "Submit",
//
///add payment // ///add payment
textAlign: TextAlign.center, // textAlign: TextAlign.center,
style: TextStyle(color: Colors.white), // style: TextStyle(color: Colors.white),
), // ),
), // ),
), // ),
), // ),
), // ),
); // );
}, // },
), // ),
); // );
}, // },
); // );
}, // },
); // );
} // }
Future<void> _showAddPaymentSheet(BuildContext context, paymentID) { Future<void> _showAddPaymentSheet(BuildContext context, paymentID) {
return showModalBottomSheet( return showModalBottomSheet(
...@@ -1976,3 +2621,81 @@ class _PaymentrequestionlistdetailsState ...@@ -1976,3 +2621,81 @@ class _PaymentrequestionlistdetailsState
); );
} }
} }
///
///
/// List.generate(titles.length, (h){
// return Column(
// children: [
// Container(
// padding: EdgeInsets.symmetric(
// vertical: 4,
// ),
// child: Row(
// children: [
// Expanded(
// flex: 3,
// child: Text(
// titles[h],
// style: TextStyle(
// fontSize: 14,
// fontFamily: "JakartaSemiBold",
// ),
// ),
// ),
// Expanded(
// flex: 6,
// child: DottedLine(
// dashGapLength: 4,
// dashGapColor: Colors.white,
// dashColor: AppColors.grey_semi,
// dashLength: 2,
// lineThickness: 0.5,
// ),
// ),
// ],
// ),
// ),
// ...List.generate(headings.length, (j) {
// return Container(
// padding: EdgeInsets.symmetric(
// vertical: 7,
// ),
// child: Column(
// children: [
//
// Row(
// crossAxisAlignment:
// CrossAxisAlignment.start,
// children: [
// Expanded(
// child: Text(
// headings[j],
// style: TextStyle(
// fontFamily: "JakartaRegular",
// fontSize: 14,
// color: AppColors.semi_black,
// ),
// ),
// ),
// Expanded(
// child: Text(
// subHeadings[j] == ""
// ? "-"
// : subHeadings[j],
// style: TextStyle(
// fontSize: 14,
// color: Color(0xFF818181),
// ),
// ),
// ),
// ],
// ),
// ],
// ),
// );
// }),
// ],
// );
// }),
///
...@@ -90,527 +90,533 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -90,527 +90,533 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
builder: (context, provider, child) { builder: (context, provider, child) {
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.white, backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar2( appBar: appbar2New(
context, context,
"${widget.pageTitleName}", "${widget.pageTitleName}",
provider.resetForm, provider.resetForm,
SizedBox(width: 0), SizedBox.shrink(),
0xFFFFFFFF
), ),
body: Container( body: Scrollbar(
padding: EdgeInsets.symmetric(horizontal: 10), thumbVisibility: false,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Container(
crossAxisAlignment: CrossAxisAlignment.start, padding: EdgeInsets.symmetric(horizontal: 10),
children: [ decoration: BoxDecoration(
TextWidget(context, "Account"), color: AppColors.white,
DropdownButtonHideUnderline( borderRadius: BorderRadius.circular(20),
child: Row( ),margin: EdgeInsets.only(top: 10,left: 10,right: 10),
children: [ child: Column(
Expanded( crossAxisAlignment: CrossAxisAlignment.start,
child: DropdownButton2<Accounts>( children: [
isExpanded: true, TextWidget(context, "Account"),
hint: Text( DropdownButtonHideUnderline(
'Select Account', child: Row(
style: TextStyle(fontSize: 14), children: [
overflow: TextOverflow.ellipsis, Expanded(
), child: DropdownButton2<Accounts>(
items: [ isExpanded: true,
...provider.receiptAccounts hint: Text(
.map( 'Select Account',
(accs) => DropdownMenuItem<Accounts>( style: TextStyle(fontSize: 14),
value: accs, overflow: TextOverflow.ellipsis,
child: Text( ),
accs.name ?? '', items: [
style: const TextStyle(fontSize: 14), ...provider.receiptAccounts
overflow: TextOverflow.ellipsis, .map(
(accs) => DropdownMenuItem<Accounts>(
value: accs,
child: Text(
accs.name ?? '',
style: const TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis,
),
), ),
), )
) .toList(),
.toList(), ],
], value: provider.selectreceiptAccounts,
value: provider.selectreceiptAccounts, onChanged: (Accounts? value) {
onChanged: (Accounts? value) { if (value != null) {
if (value != null) { if (provider.receiptAccounts.isNotEmpty) {
if (provider.receiptAccounts.isNotEmpty) { provider.selectreceiptAccounts = value;
provider.selectreceiptAccounts = value; print(
print( "Selected Complaint Type: ${value.name}, ID: ${value.id}",
"Selected Complaint Type: ${value.name}, ID: ${value.id}", );
); provider.receiptAccountId = value.id!;
provider.receiptAccountId = value.id!; provider.receiptAccountValue = value.name!;
provider.receiptAccountValue = value.name!; print(
print( "hfjkshfg" +
"hfjkshfg" + provider.receiptAccountId.toString(),
provider.receiptAccountId.toString(), );
); }
} }
} },
}, dropdownSearchData: DropdownSearchData(
dropdownSearchData: DropdownSearchData( searchInnerWidgetHeight: 50,
searchInnerWidgetHeight: 50, searchController:
searchController: provider.accountSearchController,
provider.accountSearchController, searchInnerWidget: Padding(
searchInnerWidget: Padding( padding: const EdgeInsets.all(8),
padding: const EdgeInsets.all(8), child: TextFormField(
child: TextFormField( controller: provider.accountSearchController,
controller: provider.accountSearchController, decoration: InputDecoration(
decoration: InputDecoration( isDense: true,
isDense: true, contentPadding: const EdgeInsets.symmetric(
contentPadding: const EdgeInsets.symmetric( horizontal: 10,
horizontal: 10, vertical: 8,
vertical: 8, ),
), hintText: 'Search account...',
hintText: 'Search account...', border: OutlineInputBorder(
border: OutlineInputBorder( borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), ),
), ),
), ),
), ),
searchMatchFn: (item, searchValue) {
return item.value?.name?.toLowerCase().contains(
searchValue.toLowerCase(),
) ??
false;
},
// Optional: clear search text when dropdown closes
), ),
searchMatchFn: (item, searchValue) { onMenuStateChange: (isOpen) {
return item.value?.name?.toLowerCase().contains( if (!isOpen) {
searchValue.toLowerCase(), provider.accountSearchController.clear();
) ?? }
false;
}, },
buttonStyleData: ddtheme.buttonStyleData,
// Optional: clear search text when dropdown closes iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
), ),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.accountSearchController.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
), ),
), ],
], ),
), ),
), errorWidget(context, provider.selectAccountError),
errorWidget(context, provider.selectAccountError), TextWidget(context, "Payment Account"),
TextWidget(context, "Payment Account"), DropdownButtonHideUnderline(
DropdownButtonHideUnderline( child: Row(
child: Row( children: [
children: [ Expanded(
Expanded( child: DropdownButton2<ReceiptAccounts>(
child: DropdownButton2<ReceiptAccounts>( isExpanded: true,
isExpanded: true, hint: Text(
hint: Text( 'Select Account',
'Select Account', style: TextStyle(fontSize: 14),
style: TextStyle(fontSize: 14), overflow: TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis, ),
), items:
items: provider.receiptPaymentAccounts
provider.receiptPaymentAccounts .map(
.map( (accs) =>
(accs) => DropdownMenuItem<ReceiptAccounts>(
DropdownMenuItem<ReceiptAccounts>( value: accs,
value: accs, child: Text(
child: Text( accs.name ?? '',
accs.name ?? '', style: const TextStyle(
style: const TextStyle( fontSize: 14,
fontSize: 14, ),
overflow: TextOverflow.ellipsis,
), ),
overflow: TextOverflow.ellipsis,
), ),
), )
) .toList(),
.toList(), value: provider.selectreceiptPaymentAccounts,
value: provider.selectreceiptPaymentAccounts, onChanged: (ReceiptAccounts? value) {
onChanged: (ReceiptAccounts? value) { if (value != null) {
if (value != null) { if (provider
if (provider .receiptPaymentAccounts
.receiptPaymentAccounts .isNotEmpty) {
.isNotEmpty) { provider.selectreceiptPaymentAccounts = value;
provider.selectreceiptPaymentAccounts = value; print(
print( "Selected Complaint Type: ${value.name}, ID: ${value.id}",
"Selected Complaint Type: ${value.name}, ID: ${value.id}", );
); provider.receiptPaymentAccountsID = value.id!;
provider.receiptPaymentAccountsID = value.id!; provider.receiptPaymentAccountsValue =
provider.receiptPaymentAccountsValue = value.name!;
value.name!; print(
print( "hfjkshfg" +
"hfjkshfg" + provider.receiptPaymentAccountsID
provider.receiptPaymentAccountsID .toString(),
.toString(), );
); }
} }
} },
}, dropdownSearchData: DropdownSearchData(
dropdownSearchData: DropdownSearchData( searchInnerWidgetHeight: 50,
searchInnerWidgetHeight: 50, searchController:
searchController: provider.paymentAccountSearchController,
provider.paymentAccountSearchController, searchInnerWidget: Padding(
searchInnerWidget: Padding( padding: const EdgeInsets.all(8),
padding: const EdgeInsets.all(8), child: TextFormField(
child: TextFormField( controller:
controller: provider.paymentAccountSearchController,
provider.paymentAccountSearchController, decoration: InputDecoration(
decoration: InputDecoration( isDense: true,
isDense: true, contentPadding: const EdgeInsets.symmetric(
contentPadding: const EdgeInsets.symmetric( horizontal: 10,
horizontal: 10, vertical: 8,
vertical: 8, ),
), hintText: 'Search account...',
hintText: 'Search account...', border: OutlineInputBorder(
border: OutlineInputBorder( borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), ),
), ),
), ),
), ),
searchMatchFn: (item, searchValue) {
return item.value?.name?.toLowerCase().contains(
searchValue.toLowerCase(),
) ??
false;
},
// Optional: clear search text when dropdown closes
), ),
searchMatchFn: (item, searchValue) { onMenuStateChange: (isOpen) {
return item.value?.name?.toLowerCase().contains( if (!isOpen) {
searchValue.toLowerCase(), provider.paymentAccountSearchController.clear();
) ?? }
false;
}, },
buttonStyleData: ddtheme.buttonStyleData,
// Optional: clear search text when dropdown closes iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
), ),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.paymentAccountSearchController.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
), ),
), ],
], ),
), ),
), errorWidget(context, provider.selectPaymentAccountError),
errorWidget(context, provider.selectPaymentAccountError),
textControllerWidget(
textControllerWidget( context,
context, provider.amountController,
provider.amountController, "Amount",
"Amount", "Enter Amount",
"Enter Amount", provider.updateAmount,
provider.updateAmount, TextInputType.numberWithOptions(),
TextInputType.numberWithOptions(), false,
false, null,
null, focusNodes[0],
focusNodes[0], focusNodes[1],
focusNodes[1], TextInputAction.next,
TextInputAction.next, ),
), errorWidget(context, provider.amountError),
errorWidget(context, provider.amountError),
///payment date toBE
///payment date toBE TextWidget(context, "Receipt Date"),
TextWidget(context, "Receipt Date"), GestureDetector(
GestureDetector( onTap: () {
onTap: () { provider.showDatePickerDialog(context);
provider.showDatePickerDialog(context); },
}, child: Row(
child: Row( crossAxisAlignment: CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, children: [
children: [ Expanded(
Expanded( child: Container(
child: Container( height: 50,
height: 50, alignment: Alignment.center,
alignment: Alignment.center, decoration: BoxDecoration(
decoration: BoxDecoration( color: AppColors.text_field_color,
color: AppColors.text_field_color, borderRadius: BorderRadius.circular(14),
borderRadius: BorderRadius.circular(14),
),
child: Padding(
padding: const EdgeInsets.fromLTRB(
10.0,
0.0,
10,
0,
), ),
child: TextFormField( child: Padding(
controller: provider.dateController, padding: const EdgeInsets.fromLTRB(
keyboardType: TextInputType.text, 10.0,
enabled: false, 0.0,
maxLines: 1, 10,
readOnly: true, 0,
onChanged: (value) {}, ),
focusNode: focusNodes[1], child: TextFormField(
onTapUpOutside: (event) { controller: provider.dateController,
if (focusNodes[1].hasFocus) { keyboardType: TextInputType.text,
enabled: false,
maxLines: 1,
readOnly: true,
onChanged: (value) {},
focusNode: focusNodes[1],
onTapUpOutside: (event) {
if (focusNodes[1].hasFocus) {
focusNodes[1].unfocus();
}
},
textInputAction: TextInputAction.done,
onEditingComplete: () {
focusNodes[1].unfocus(); focusNodes[1].unfocus();
} },
}, decoration: InputDecoration(
textInputAction: TextInputAction.done, hintText: "Enter Date",
onEditingComplete: () { hintStyle: TextStyle(
focusNodes[1].unfocus(); fontWeight: FontWeight.w400,
}, color: Color(0xFFB4BEC0),
decoration: InputDecoration( fontSize: 14,
hintText: "Enter Date", ),
hintStyle: TextStyle(
fontWeight: FontWeight.w400, enabledBorder: InputBorder.none,
color: Color(0xFFB4BEC0), disabledBorder: InputBorder.none,
fontSize: 14, focusedBorder: InputBorder.none,
), ),
enabledBorder: InputBorder.none,
disabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
), ),
), ),
), ),
), ),
), ],
], ),
), ),
), errorWidget(context, provider.dateError),
errorWidget(context, provider.dateError),
TextWidget(context, "Select Payment Mode"),
TextWidget(context, "Select Payment Mode"), DropdownButtonHideUnderline(
DropdownButtonHideUnderline( child: Row(
child: Row( children: [
children: [ Expanded(
Expanded( child: DropdownButton2<PaymentModes>(
child: DropdownButton2<PaymentModes>( isExpanded: true,
isExpanded: true, hint: Text(
hint: Text( 'Select Payment mode',
'Select Payment mode', style: TextStyle(fontSize: 14),
style: TextStyle(fontSize: 14), overflow: TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis, ),
), items:
items: provider.receiptPaymentModes
provider.receiptPaymentModes .map(
.map( (paymenents) =>
(paymenents) => DropdownMenuItem<PaymentModes>(
DropdownMenuItem<PaymentModes>( value: paymenents,
value: paymenents, child: Text(
child: Text( paymenents.name ?? '',
paymenents.name ?? '', style: const TextStyle(
style: const TextStyle( fontSize: 14,
fontSize: 14, ),
overflow: TextOverflow.ellipsis,
), ),
overflow: TextOverflow.ellipsis,
), ),
), )
) .toList(),
.toList(), value: provider.selectreceiptPaymentModes,
value: provider.selectreceiptPaymentModes, onChanged: (PaymentModes? value) {
onChanged: (PaymentModes? value) { if (value != null) {
if (value != null) { if (provider.receiptPaymentModes.isNotEmpty) {
if (provider.receiptPaymentModes.isNotEmpty) { provider.selectreceiptPaymentModes = value;
provider.selectreceiptPaymentModes = value; print(
print( "Selected Complaint Type: ${value.name}, ID: ${value.id}",
"Selected Complaint Type: ${value.name}, ID: ${value.id}", );
); provider.receiptPaymentModesID = value.id!;
provider.receiptPaymentModesID = value.id!; provider.receiptPaymentModesValues =
provider.receiptPaymentModesValues = value.name!;
value.name!; print(
print( "hfjkshfg" +
"hfjkshfg" + provider.receiptPaymentModesID
provider.receiptPaymentModesID .toString(),
.toString(), );
); }
} }
} },
}, buttonStyleData: ddtheme.buttonStyleData,
buttonStyleData: ddtheme.buttonStyleData, iconStyleData: ddtheme.iconStyleData,
iconStyleData: ddtheme.iconStyleData, menuItemStyleData: ddtheme.menuItemStyleData,
menuItemStyleData: ddtheme.menuItemStyleData, dropdownStyleData: ddtheme.dropdownStyleData,
dropdownStyleData: ddtheme.dropdownStyleData, ),
), ),
), ],
], ),
),
),
errorWidget(context, provider.paymentModeError),
if ([
"Cheque",
"RTGS",
"IMPS",
"NEFT",
].contains(provider.paymentModeValue)) ...[
textControllerWidget(
context,
provider.bankNameController,
"Bank Name",
"Enter Bank Name",
provider.updateBankName,
TextInputType.text,
false,
null,
focusNodes[2],
focusNodes[3],
TextInputAction.next,
),
errorWidget(context, provider.bankNameError),
textControllerWidget(
context,
provider.bankBranchController,
"Bank Branch",
"Enter Bank Branch",
provider.updateBankBranch,
TextInputType.text,
false,
null,
focusNodes[3],
focusNodes[4],
TextInputAction.next,
),
errorWidget(context, provider.bankBranchError),
textControllerWidget(
context,
provider.bankAccNumberController,
"Account Number",
"Enter Account Number",
provider.updateNumber,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[4],
focusNodes[5],
TextInputAction.next,
),
errorWidget(context, provider.bankNumberError),
textControllerWidget(
context,
provider.bankIfscController,
"Bank IFSC",
"Enter Bank IFSC",
provider.updateIFSC,
TextInputType.text,
false,
null,
focusNodes[5],
focusNodes[6],
TextInputAction.next,
), ),
errorWidget(context, provider.bankIFSCError), errorWidget(context, provider.paymentModeError),
if ([
"Cheque",
"RTGS",
"IMPS",
"NEFT",
].contains(provider.paymentModeValue)) ...[
textControllerWidget(
context,
provider.bankNameController,
"Bank Name",
"Enter Bank Name",
provider.updateBankName,
TextInputType.text,
false,
null,
focusNodes[2],
focusNodes[3],
TextInputAction.next,
),
errorWidget(context, provider.bankNameError),
textControllerWidget(
context,
provider.bankBranchController,
"Bank Branch",
"Enter Bank Branch",
provider.updateBankBranch,
TextInputType.text,
false,
null,
focusNodes[3],
focusNodes[4],
TextInputAction.next,
),
errorWidget(context, provider.bankBranchError),
textControllerWidget(
context,
provider.bankAccNumberController,
"Account Number",
"Enter Account Number",
provider.updateNumber,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[4],
focusNodes[5],
TextInputAction.next,
),
errorWidget(context, provider.bankNumberError),
textControllerWidget(
context,
provider.bankIfscController,
"Bank IFSC",
"Enter Bank IFSC",
provider.updateIFSC,
TextInputType.text,
false,
null,
focusNodes[5],
focusNodes[6],
TextInputAction.next,
),
errorWidget(context, provider.bankIFSCError),
textControllerWidget(
context,
provider.bankAcHolderController,
"Bank Account Holder Name",
"Enter Bank Account Holder Name",
provider.updateHolder,
TextInputType.text,
false,
null,
focusNodes[6],
focusNodes[8],
TextInputAction.next,
),
errorWidget(context, provider.bankHolderError),
] else if (provider.paymentModeValue == "UPI") ...[
textControllerWidget(
context,
provider.bankUpiController,
"UPI ID",
"Enter UPI ID",
provider.updateUPI,
TextInputType.text,
false,
null,
focusNodes[7],
focusNodes[8],
TextInputAction.next,
),
errorWidget(context, provider.UPIError),
],
textControllerWidget( textControllerWidget(
context, context,
provider.bankAcHolderController, provider.paymentReferenceController,
"Bank Account Holder Name", "Payment Reference Number",
"Enter Bank Account Holder Name", "Enter Payment Reference Number",
provider.updateHolder, provider.updatereference,
TextInputType.text, TextInputType.text,
false, false,
null, null,
focusNodes[6],
focusNodes[8], focusNodes[8],
focusNodes[9],
TextInputAction.next, TextInputAction.next,
), ),
errorWidget(context, provider.bankHolderError), errorWidget(context, provider.paymentreferenceError),
] else if (provider.paymentModeValue == "UPI") ...[
textControllerWidget( textControllerWidget(
context, context,
provider.bankUpiController, provider.descController,
"UPI ID", "Description",
"Enter UPI ID", "Enter Description",
provider.updateUPI, provider.updateDescription,
TextInputType.text, TextInputType.text,
false, false,
null, null,
focusNodes[7], focusNodes[9],
focusNodes[8], focusNodes[10],
TextInputAction.next, TextInputAction.done,
), ),
errorWidget(context, provider.UPIError), errorWidget(context, provider.descriptionError),
], InkResponse(
textControllerWidget( onTap: () {
context, _showAttachmentSheet(context);
provider.paymentReferenceController, },
"Payment Reference Number", child: Container(
"Enter Payment Reference Number", margin: EdgeInsets.symmetric(vertical: 10),
provider.updatereference, height: 45,
TextInputType.text, width: MediaQuery.of(context).size.width,
false, decoration: BoxDecoration(
null, color: Color(0xFFE6F6FF),
focusNodes[8], borderRadius: BorderRadius.circular(12),
focusNodes[9], border: Border.all(
TextInputAction.next,
),
errorWidget(context, provider.paymentreferenceError),
textControllerWidget(
context,
provider.descController,
"Description",
"Enter Description",
provider.updateDescription,
TextInputType.text,
false,
null,
focusNodes[9],
focusNodes[10],
TextInputAction.done,
),
errorWidget(context, provider.descriptionError),
InkResponse(
onTap: () {
_showAttachmentSheet(context);
},
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 45,
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: AppColors.app_blue,
width: 0.5,
),
),
child: Center(
child: Text(
"File Attachment",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.app_blue, color: AppColors.app_blue,
width: 0.5,
),
),
child: Center(
child: Text(
"File Attachment",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.app_blue,
),
), ),
), ),
), ),
), ),
), if (provider.imagePicked == 1 &&
if (provider.imagePicked == 1 && provider.imagePath != null) ...[
provider.imagePath != null) ...[ Padding(
Padding( padding: const EdgeInsets.symmetric(vertical: 4.0),
padding: const EdgeInsets.symmetric(vertical: 4.0), child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
children: [ Expanded(
Expanded( flex: 5,
flex: 5, child: Text(
child: Text( "${provider.imagePath}",
"${provider.imagePath}", maxLines: 2,
style: TextStyle( overflow: TextOverflow.ellipsis,
color: AppColors.semi_black, style: TextStyle(
fontSize: 11, color: AppColors.semi_black,
fontWeight: FontWeight.w600, fontSize: 11,
fontWeight: FontWeight.w600,
),
), ),
), ),
), Expanded(
Expanded( flex: 1,
flex: 1, child: InkResponse(
child: InkResponse( onTap: () {
onTap: () { provider.imagePicked = 0;
provider.imagePicked = 0; provider.imagePath = null;
provider.imagePath = null; provider.imageFilePath = null;
provider.imageFilePath = null; },
}, child: SvgPicture.asset(
child: SvgPicture.asset( "assets/svg/ic_close.svg",
"assets/svg/ic_close.svg", width: 15,
width: 15, height: 15,
height: 15, ),
), ),
), ),
), ],
], ),
), ),
), ],
SizedBox(height: 75),
], ],
SizedBox(height: 75), ),
],
), ),
), ),
), ),
...@@ -630,7 +636,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> { ...@@ -630,7 +636,7 @@ class _AddpaymentreceiptlistState extends State<Addpaymentreceiptlist> {
child: Container( child: Container(
height: 45, height: 45,
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.symmetric(horizontal: 10, vertical: 0), margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10),
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5), padding: EdgeInsets.symmetric(horizontal: 10, vertical: 5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.app_blue, color: AppColors.app_blue,
......
...@@ -95,522 +95,529 @@ class _DirectpaymentrequesitionlistState ...@@ -95,522 +95,529 @@ class _DirectpaymentrequesitionlistState
builder: (context, provider, child) { builder: (context, provider, child) {
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.white, backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "${widget.pageTitleName}"), appBar: appbarNew(context, "${widget.pageTitleName}",0xFFFFFFFF),
body: Container( body: Scrollbar(
padding: EdgeInsets.symmetric(horizontal: 10), thumbVisibility: false,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
),
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column( child: Container(
crossAxisAlignment: CrossAxisAlignment.start, padding: EdgeInsets.symmetric(horizontal: 10),
children: [ margin: EdgeInsets.only(top: 10,left: 10,right: 10),
TextWidget(context, "Account"), decoration: BoxDecoration(
DropdownButtonHideUnderline( color: Colors.white,
child: Row( borderRadius: BorderRadius.circular(20),
children: [ ),
Expanded( child: Column(
child: DropdownButton2<DirectAccounts>( crossAxisAlignment: CrossAxisAlignment.start,
isExpanded: true, children: [
hint: Text( TextWidget(context, "Account"),
'Select Account', DropdownButtonHideUnderline(
style: TextStyle(fontSize: 14), child: Row(
overflow: TextOverflow.ellipsis, children: [
), Expanded(
items: child: DropdownButton2<DirectAccounts>(
provider.directAccounts isExpanded: true,
.map( hint: Text(
(accs) => 'Select Account',
DropdownMenuItem<DirectAccounts>( style: TextStyle(fontSize: 14),
value: accs, overflow: TextOverflow.ellipsis,
child: Text( ),
accs.name ?? '', items:
style: const TextStyle( provider.directAccounts
fontSize: 14, .map(
(accs) =>
DropdownMenuItem<DirectAccounts>(
value: accs,
child: Text(
accs.name ?? '',
style: const TextStyle(
fontSize: 14,
),
overflow: TextOverflow.ellipsis,
), ),
overflow: TextOverflow.ellipsis,
), ),
), )
) .toList(),
.toList(), value: provider.selectDirectAccounts,
value: provider.selectDirectAccounts, onChanged: (DirectAccounts? value) {
onChanged: (DirectAccounts? value) { if (value != null) {
if (value != null) { if (provider.directAccounts.isNotEmpty) {
if (provider.directAccounts.isNotEmpty) { provider.selectDirectAccounts = value;
provider.selectDirectAccounts = value; print(
print( "Selected Complaint Type: ${value.name}, ID: ${value.id}",
"Selected Complaint Type: ${value.name}, ID: ${value.id}", );
); provider.directAccountId = value.id!;
provider.directAccountId = value.id!; provider.directAccountValue = value.name!;
provider.directAccountValue = value.name!; print(
print( "hfjkshfg" +
"hfjkshfg" + provider.directAccountId.toString(),
provider.directAccountId.toString(), );
); }
} }
} },
}, dropdownSearchData: DropdownSearchData(
dropdownSearchData: DropdownSearchData( searchInnerWidgetHeight: 50,
searchInnerWidgetHeight: 50, searchController:
searchController: provider.accountSearchController,
provider.accountSearchController, searchInnerWidget: Padding(
searchInnerWidget: Padding( padding: const EdgeInsets.all(8),
padding: const EdgeInsets.all(8), child: TextFormField(
child: TextFormField( controller: provider.accountSearchController,
controller: provider.accountSearchController, decoration: InputDecoration(
decoration: InputDecoration( isDense: true,
isDense: true, contentPadding: const EdgeInsets.symmetric(
contentPadding: const EdgeInsets.symmetric( horizontal: 10,
horizontal: 10, vertical: 8,
vertical: 8, ),
), hintText: 'Search account...',
hintText: 'Search account...', border: OutlineInputBorder(
border: OutlineInputBorder( borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), ),
), ),
), ),
), ),
searchMatchFn: (item, searchValue) {
return item.value?.name?.toLowerCase().contains(
searchValue.toLowerCase(),
) ??
false;
},
// Optional: clear search text when dropdown closes
), ),
searchMatchFn: (item, searchValue) { onMenuStateChange: (isOpen) {
return item.value?.name?.toLowerCase().contains( if (!isOpen) {
searchValue.toLowerCase(), provider.accountSearchController.clear();
) ?? }
false;
}, },
buttonStyleData: ddtheme.buttonStyleData,
// Optional: clear search text when dropdown closes iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
), ),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.accountSearchController.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
), ),
), ],
], ),
), ),
),
errorWidget(context, provider.selectDirectAccountError), errorWidget(context, provider.selectDirectAccountError),
TextWidget(context, "Payment Account"), TextWidget(context, "Payment Account"),
DropdownButtonHideUnderline( DropdownButtonHideUnderline(
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: DropdownButton2<DirectPaymentAccounts>( child: DropdownButton2<DirectPaymentAccounts>(
isExpanded: true, isExpanded: true,
hint: Text( hint: Text(
'Select Account Type', 'Select Account Type',
style: TextStyle(fontSize: 14), style: TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
), ),
items: items:
provider.directPaymentAccounts provider.directPaymentAccounts
.map( .map(
(accs) => DropdownMenuItem< (accs) => DropdownMenuItem<
DirectPaymentAccounts DirectPaymentAccounts
>( >(
value: accs, value: accs,
child: Text( child: Text(
accs.name ?? '', accs.name ?? '',
style: const TextStyle(fontSize: 14), style: const TextStyle(fontSize: 14),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
),
), ),
), )
) .toList(),
.toList(), value: provider.selectDirectPaymentAccounts,
value: provider.selectDirectPaymentAccounts, onChanged: (DirectPaymentAccounts? value) {
onChanged: (DirectPaymentAccounts? value) { if (value != null) {
if (value != null) { if (provider.directPaymentAccounts.isNotEmpty) {
if (provider.directPaymentAccounts.isNotEmpty) { provider.selectDirectPaymentAccounts = value;
provider.selectDirectPaymentAccounts = value; print(
print( "Selected Complaint Type: ${value.name}, ID: ${value.id}",
"Selected Complaint Type: ${value.name}, ID: ${value.id}", );
); provider.directPaymentAccountsID = value.id!;
provider.directPaymentAccountsID = value.id!; provider.directPaymentAccountsValue =
provider.directPaymentAccountsValue = value.name!;
value.name!; print(
print( "hfjkshfg" +
"hfjkshfg" + provider.directPaymentAccountsID
provider.directPaymentAccountsID .toString(),
.toString(), );
); }
} }
} },
}, dropdownSearchData: DropdownSearchData(
dropdownSearchData: DropdownSearchData( searchInnerWidgetHeight: 50,
searchInnerWidgetHeight: 50, searchController:
searchController: provider.paymentAccountSearchController,
provider.paymentAccountSearchController, searchInnerWidget: Padding(
searchInnerWidget: Padding( padding: const EdgeInsets.all(8),
padding: const EdgeInsets.all(8), child: TextFormField(
child: TextFormField( controller:
controller: provider.paymentAccountSearchController,
provider.paymentAccountSearchController, decoration: InputDecoration(
decoration: InputDecoration( isDense: true,
isDense: true, contentPadding: const EdgeInsets.symmetric(
contentPadding: const EdgeInsets.symmetric( horizontal: 10,
horizontal: 10, vertical: 8,
vertical: 8, ),
), hintText: 'Search account...',
hintText: 'Search account...', border: OutlineInputBorder(
border: OutlineInputBorder( borderRadius: BorderRadius.circular(8),
borderRadius: BorderRadius.circular(8), ),
), ),
), ),
), ),
searchMatchFn: (item, searchValue) {
return item.value?.name?.toLowerCase().contains(
searchValue.toLowerCase(),
) ??
false;
},
// Optional: clear search text when dropdown closes
), ),
searchMatchFn: (item, searchValue) { onMenuStateChange: (isOpen) {
return item.value?.name?.toLowerCase().contains( if (!isOpen) {
searchValue.toLowerCase(), provider.paymentAccountSearchController.clear();
) ?? }
false;
}, },
buttonStyleData: ddtheme.buttonStyleData,
// Optional: clear search text when dropdown closes iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
), ),
onMenuStateChange: (isOpen) {
if (!isOpen) {
provider.paymentAccountSearchController.clear();
}
},
buttonStyleData: ddtheme.buttonStyleData,
iconStyleData: ddtheme.iconStyleData,
menuItemStyleData: ddtheme.menuItemStyleData,
dropdownStyleData: ddtheme.dropdownStyleData,
), ),
), ],
], ),
),
errorWidget(
context,
provider.selectDirectPaymentAccountError,
),
textControllerWidget(
context,
provider.amountController,
"Amount",
"Enter Amount",
provider.updateAmount,
TextInputType.numberWithOptions(),
false,
null,
focusNodes[0],
focusNodes[1],
TextInputAction.next,
), ),
), errorWidget(context, provider.amountError),
errorWidget(
context,
provider.selectDirectPaymentAccountError,
),
textControllerWidget(
context,
provider.amountController,
"Amount",
"Enter Amount",
provider.updateAmount,
TextInputType.numberWithOptions(),
false,
null,
focusNodes[0],
focusNodes[1],
TextInputAction.next,
),
errorWidget(context, provider.amountError),
///payment date toBE ///payment date toBE
TextWidget(context, "Enter Date"), TextWidget(context, "Enter Date"),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
provider.showDatePickerDialog(context); provider.showDatePickerDialog(context);
}, },
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
height: 50, height: 50,
alignment: Alignment.center, alignment: Alignment.center,
decoration: BoxDecoration( decoration: BoxDecoration(
color: AppColors.text_field_color, color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(14), borderRadius: BorderRadius.circular(14),
),
child: Padding(
padding: const EdgeInsets.fromLTRB(
10.0,
0.0,
10,
0,
), ),
child: TextFormField( child: Padding(
controller: provider.dateController, padding: const EdgeInsets.fromLTRB(
keyboardType: TextInputType.text, 10.0,
enabled: false, 0.0,
maxLines: 1, 10,
readOnly: true, 0,
onChanged: (value) {}, ),
focusNode: focusNodes[1], child: TextFormField(
onTapUpOutside: (event) { controller: provider.dateController,
if (focusNodes[1].hasFocus) { keyboardType: TextInputType.text,
enabled: false,
maxLines: 1,
readOnly: true,
onChanged: (value) {},
focusNode: focusNodes[1],
onTapUpOutside: (event) {
if (focusNodes[1].hasFocus) {
focusNodes[1].unfocus();
}
},
textInputAction: TextInputAction.done,
onEditingComplete: () {
focusNodes[1].unfocus(); focusNodes[1].unfocus();
} },
}, decoration: InputDecoration(
textInputAction: TextInputAction.done, hintText: "Enter Date",
onEditingComplete: () { hintStyle: TextStyle(
focusNodes[1].unfocus(); fontWeight: FontWeight.w400,
}, color: Color(0xFFB4BEC0),
decoration: InputDecoration( fontSize: 14,
hintText: "Enter Date", ),
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0),
fontSize: 14,
),
enabledBorder: InputBorder.none, enabledBorder: InputBorder.none,
disabledBorder: InputBorder.none, disabledBorder: InputBorder.none,
focusedBorder: InputBorder.none, focusedBorder: InputBorder.none,
),
), ),
), ),
), ),
), ),
), ],
], ),
), ),
), errorWidget(context, provider.dateError),
errorWidget(context, provider.dateError), TextWidget(context, "Select Payment Mode"),
TextWidget(context, "Select Payment Mode"), DropdownButtonHideUnderline(
DropdownButtonHideUnderline( child: Row(
child: Row( children: [
children: [ Expanded(
Expanded( child: DropdownButton2<DirectPaymentModes>(
child: DropdownButton2<DirectPaymentModes>( isExpanded: true,
isExpanded: true, hint: Text(
hint: Text( 'Select Payment mode',
'Select Payment mode', style: TextStyle(fontSize: 14),
style: TextStyle(fontSize: 14), overflow: TextOverflow.ellipsis,
overflow: TextOverflow.ellipsis, ),
), items:
items: provider.directPaymentModes
provider.directPaymentModes .map(
.map( (paymenents) =>
(paymenents) => DropdownMenuItem<DirectPaymentModes>(
DropdownMenuItem<DirectPaymentModes>( value: paymenents,
value: paymenents, child: Text(
child: Text( paymenents.name ?? '',
paymenents.name ?? '', style: const TextStyle(
style: const TextStyle( fontSize: 14,
fontSize: 14, ),
overflow: TextOverflow.ellipsis,
), ),
overflow: TextOverflow.ellipsis,
), ),
), )
) .toList(),
.toList(), value: provider.selectDirectPaymentModes,
value: provider.selectDirectPaymentModes, onChanged: (DirectPaymentModes? value) {
onChanged: (DirectPaymentModes? value) { if (value != null) {
if (value != null) { if (provider.directPaymentModes.isNotEmpty) {
if (provider.directPaymentModes.isNotEmpty) { provider.selectDirectPaymentModes = value;
provider.selectDirectPaymentModes = value; print(
print( "Selected Complaint Type: ${value.name}, ID: ${value.id}",
"Selected Complaint Type: ${value.name}, ID: ${value.id}", );
); provider.directPaymentModesID = value.id!;
provider.directPaymentModesID = value.id!; provider.directPaymentModesValues =
provider.directPaymentModesValues = value.name!;
value.name!; print(
print( "hfjkshfg" +
"hfjkshfg" + provider.directPaymentModesID
provider.directPaymentModesID .toString(),
.toString(), );
); }
} }
} },
}, buttonStyleData: ddtheme.buttonStyleData,
buttonStyleData: ddtheme.buttonStyleData, iconStyleData: ddtheme.iconStyleData,
iconStyleData: ddtheme.iconStyleData, menuItemStyleData: ddtheme.menuItemStyleData,
menuItemStyleData: ddtheme.menuItemStyleData, dropdownStyleData: ddtheme.dropdownStyleData,
dropdownStyleData: ddtheme.dropdownStyleData, ),
), ),
), ],
], ),
),
),
errorWidget(context, provider.selectDirectPaymentError),
if ([
"Cheque",
"RTGS",
"IMPS",
"NEFT",
].contains(provider.directPaymentModesValues)) ...[
textControllerWidget(
context,
provider.bankNameController,
"Bank Name",
"Enter Bank Name",
provider.updateBankName,
TextInputType.text,
false,
null,
focusNodes[2],
focusNodes[3],
TextInputAction.next,
),
errorWidget(context, provider.bankNameError),
textControllerWidget(
context,
provider.bankBranchController,
"Bank Branch",
"Enter Bank Branch",
provider.updateBankBranch,
TextInputType.text,
false,
null,
focusNodes[3],
focusNodes[4],
TextInputAction.next,
),
errorWidget(context, provider.bankBranchError),
textControllerWidget(
context,
provider.bankAccNumberController,
"Account Number",
"Enter Account Number",
provider.updateNumber,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[4],
focusNodes[5],
TextInputAction.next,
),
errorWidget(context, provider.bankNumberError),
textControllerWidget(
context,
provider.bankIfscController,
"Bank IFSC",
"Enter Bank IFSC",
provider.updateIFSC,
TextInputType.text,
false,
null,
focusNodes[5],
focusNodes[6],
TextInputAction.next,
), ),
errorWidget(context, provider.bankIFSCError), errorWidget(context, provider.selectDirectPaymentError),
if ([
"Cheque",
"RTGS",
"IMPS",
"NEFT",
].contains(provider.directPaymentModesValues)) ...[
textControllerWidget(
context,
provider.bankNameController,
"Bank Name",
"Enter Bank Name",
provider.updateBankName,
TextInputType.text,
false,
null,
focusNodes[2],
focusNodes[3],
TextInputAction.next,
),
errorWidget(context, provider.bankNameError),
textControllerWidget(
context,
provider.bankBranchController,
"Bank Branch",
"Enter Bank Branch",
provider.updateBankBranch,
TextInputType.text,
false,
null,
focusNodes[3],
focusNodes[4],
TextInputAction.next,
),
errorWidget(context, provider.bankBranchError),
textControllerWidget(
context,
provider.bankAccNumberController,
"Account Number",
"Enter Account Number",
provider.updateNumber,
TextInputType.number,
false,
FilteringTextInputFormatter.digitsOnly,
focusNodes[4],
focusNodes[5],
TextInputAction.next,
),
errorWidget(context, provider.bankNumberError),
textControllerWidget(
context,
provider.bankIfscController,
"Bank IFSC",
"Enter Bank IFSC",
provider.updateIFSC,
TextInputType.text,
false,
null,
focusNodes[5],
focusNodes[6],
TextInputAction.next,
),
errorWidget(context, provider.bankIFSCError),
textControllerWidget(
context,
provider.bankAcHolderController,
"Bank Account Holder Name",
"Enter Bank Account Holder Name",
provider.updateHolder,
TextInputType.text,
false,
null,
focusNodes[6],
focusNodes[8],
TextInputAction.next,
),
errorWidget(context, provider.bankHolderError),
] else if (provider.directPaymentModesValues == "UPI") ...[
textControllerWidget(
context,
provider.bankUpiController,
"UPI ID",
"Enter UPI ID",
provider.updateUPI,
TextInputType.text,
false,
null,
focusNodes[7],
focusNodes[8],
TextInputAction.next,
),
errorWidget(context, provider.UPIError),
],
textControllerWidget( textControllerWidget(
context, context,
provider.bankAcHolderController, provider.paymentReferenceController,
"Bank Account Holder Name", "Payment Reference Number",
"Enter Bank Account Holder Name", "Enter Payment Reference Number",
provider.updateHolder, provider.updateReference,
TextInputType.text, TextInputType.text,
false, false,
null, null,
focusNodes[6],
focusNodes[8], focusNodes[8],
focusNodes[9],
TextInputAction.next, TextInputAction.next,
), ),
errorWidget(context, provider.bankHolderError), errorWidget(context, provider.paymentreferenceerror),
] else if (provider.directPaymentModesValues == "UPI") ...[
textControllerWidget( textControllerWidget(
context, context,
provider.bankUpiController, provider.descController,
"UPI ID", "Description",
"Enter UPI ID", "Enter Description",
provider.updateUPI, provider.updateDescription,
TextInputType.text, TextInputType.text,
false, false,
null, null,
focusNodes[7], focusNodes[9],
focusNodes[8], focusNodes[10],
TextInputAction.next, TextInputAction.done,
), ),
errorWidget(context, provider.UPIError), errorWidget(context, provider.descriptionError),
], InkResponse(
textControllerWidget( onTap: () {
context, _showAttachmentSheet(context);
provider.paymentReferenceController, },
"Payment Reference Number", child: Container(
"Enter Payment Reference Number", margin: EdgeInsets.symmetric(vertical: 10),
provider.updateReference, height: 45,
TextInputType.text, width: MediaQuery.of(context).size.width,
false, decoration: BoxDecoration(
null, color: Color(0xFFE6F6FF),
focusNodes[8], borderRadius: BorderRadius.circular(12),
focusNodes[9], border: Border.all(
TextInputAction.next,
),
errorWidget(context, provider.paymentreferenceerror),
textControllerWidget(
context,
provider.descController,
"Description",
"Enter Description",
provider.updateDescription,
TextInputType.text,
false,
null,
focusNodes[9],
focusNodes[10],
TextInputAction.done,
),
errorWidget(context, provider.descriptionError),
InkResponse(
onTap: () {
_showAttachmentSheet(context);
},
child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
height: 45,
width: MediaQuery.of(context).size.width,
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
borderRadius: BorderRadius.circular(12),
border: Border.all(
color: AppColors.app_blue,
width: 0.5,
),
),
child: Center(
child: Text(
"File Attachment",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.app_blue, color: AppColors.app_blue,
width: 0.5,
),
),
child: Center(
child: Text(
"File Attachment",
style: TextStyle(
fontFamily: "JakartaMedium",
color: AppColors.app_blue,
),
), ),
), ),
), ),
), ),
), if (provider.imagePicked == 1 &&
if (provider.imagePicked == 1 && provider.imagePath != null) ...[
provider.imagePath != null) ...[ Padding(
Padding( padding: const EdgeInsets.symmetric(vertical: 4.0),
padding: const EdgeInsets.symmetric(vertical: 4.0), child: Row(
child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
children: [ Flexible(
Flexible( flex: 4,
flex: 4, child: Text(
child: Text( "${provider.imagePath}",
"${provider.imagePath}", maxLines: 2,
style: TextStyle( overflow: TextOverflow.ellipsis,
color: AppColors.semi_black, style: TextStyle(
fontSize: 11, color: AppColors.semi_black,
fontWeight: FontWeight.w600, fontSize: 11,
fontWeight: FontWeight.w600,
),
), ),
), ),
), Expanded(
Expanded( flex: 1,
flex: 1, child: InkResponse(
child: InkResponse( onTap: () {
onTap: () { provider.imagePicked = 0;
provider.imagePicked = 0; provider.imagePath = null;
provider.imagePath = null; provider.imageFilePath = null;
provider.imageFilePath = null; },
}, child: SvgPicture.asset(
child: SvgPicture.asset( "assets/svg/ic_close.svg",
"assets/svg/ic_close.svg", width: 15,
width: 15, height: 15,
height: 15, ),
), ),
), ),
), ],
], ),
), ),
), ],
SizedBox(height: 20,)
], ],
], ),
), ),
), ),
), ),
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:dotted_line/dotted_line.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/Utils/app_colors.dart'; import 'package:generp/Utils/app_colors.dart';
...@@ -9,6 +10,7 @@ import 'package:provider/provider.dart'; ...@@ -9,6 +10,7 @@ import 'package:provider/provider.dart';
import '../../Notifiers/financeProvider/paymentRequisitionPaymentsListProvider.dart'; import '../../Notifiers/financeProvider/paymentRequisitionPaymentsListProvider.dart';
import '../../Utils/commonServices.dart'; import '../../Utils/commonServices.dart';
import '../commom/accountsListDetails.dart';
import 'FileViewer.dart'; import 'FileViewer.dart';
class Paymentdetailspaymentrequisition extends StatefulWidget { class Paymentdetailspaymentrequisition extends StatefulWidget {
...@@ -45,6 +47,7 @@ class _PaymentdetailspaymentrequisitionState ...@@ -45,6 +47,7 @@ class _PaymentdetailspaymentrequisitionState
listen: false, listen: false,
); );
provider.paymentsListDetailsAPI(context, widget.paymentRequestId); provider.paymentsListDetailsAPI(context, widget.paymentRequestId);
provider.showMoreDetails = false;
}); });
} }
...@@ -83,6 +86,388 @@ class _PaymentdetailspaymentrequisitionState ...@@ -83,6 +86,388 @@ class _PaymentdetailspaymentrequisitionState
} }
Widget _scaffold(BuildContext context) { Widget _scaffold(BuildContext context) {
return Consumer<Paymentrequisitionpaymentslistprovider>(
builder: (context, provider, child) {
var payment_det = provider.paymentDetails;
final headings1 = ["From Account", "Created Employee"];
final subHeadings1 = [
payment_det.paymentAccountName ?? "-",
payment_det.paymentEmployeeName ?? "-",
];
final headings2 = [
"Bank Name",
"Account Holder Name",
"Account Number",
"Branch",
"IFSC",
"UPI ID",
];
final subHeadings2 = [
payment_det.bankName ?? "-",
payment_det.bankAccountHolderName ?? "-",
payment_det.bankAccountNumber ?? "-",
payment_det.bankBranchName ?? "-",
payment_det.bankIfscCode ?? "-",
payment_det.bankUpiId ?? "-",
];
final headings3 = [
"Payment Mode",
"Payment Reference",
"Attachment",
"Payment Date",
];
final subHeadings3 = [
payment_det.mode ?? "-",
payment_det.paymentReferenceNumber ?? "-",
"View",
payment_det.paymentDate ?? "-",
];
final sections = [
{
"title": "Account Details",
"headings": headings1,
"subHeadings": subHeadings1,
},
if (provider.showMoreDetails) ...[
{
"title": "Bank Details",
"headings": headings2,
"subHeadings": subHeadings2,
},
{
"title": "Payment Details",
"headings": headings3,
"subHeadings": subHeadings3,
},
],
];
var clickable = sections.any(
(element) => [
"From Account",
"Created Employee",
"Attachment",
].contains(element["headings"]),
);
return Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, widget.pageName),
backgroundColor: AppColors.scaffold_bg_color,
body: SizedBox(
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
),
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 45,
width: 45,
padding: EdgeInsets.all(7.5),
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
shape: BoxShape.circle,
// borderRadius: BorderRadius.circular(8),
),
child: SvgPicture.asset("assets/svg/fin_ic.svg"),
),
),
SizedBox(width: 10),
Expanded(
flex: 4,
child: SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
InkResponse(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Accountslistdetails(
accountID: payment_det.accountId,
),
),
);
},
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 6,
),
child: Text(
payment_det.accountName ?? "-",
style: TextStyle(
decoration: TextDecoration.underline,
decorationColor: AppColors.grey_thick,
decorationStyle:
TextDecorationStyle.dotted,
height: 1.5,
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
),
Text(
"₹${payment_det.amount}",
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.grey_semi,
),
),
],
),
),
),
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(
payment_det.refType ?? "-",
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: Color(0xFF0D9C00),
),
),
),
),
),
],
),
SizedBox(height: 10),
Column(
children: List.generate(sections.length, (sectionIndex) {
final section = sections[sectionIndex];
final title = section["title"] as String;
final headings = section["headings"] as List<String>;
final subHeadings =
section["subHeadings"] as List<String>;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 4),
child: Row(
children: [
Expanded(
flex: 3,
child: Text(
title,
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaSemiBold",
),
),
),
Expanded(
flex: 6,
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor: AppColors.grey_semi,
dashLength: 2,
lineThickness: 0.5,
),
),
],
),
),
Column(
children: List.generate(headings.length, (j) {
return Container(
padding: EdgeInsets.symmetric(vertical: 7),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: InkResponse(
onTap: [
"Attachment",
"From Account",
"Created Employee",
].contains(headings[j]) ? () {
switch(headings[j]){
case "Attachment":
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Fileviewer(
fileName:
payment_det
.attachmentViewFileName!,
fileUrl:
payment_det
.attachmentDirFilePath!,
),
),
);
break;
case "From Account":
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Accountslistdetails(
accountID: payment_det.paymentAccountId,
),
),
);
break;
case "Created Employee":
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Accountslistdetails(
accountID: payment_det.createdEmployeeId,
),
),
);
break;
}
} : null,
child: Padding(
padding: EdgeInsets.only(
top: 2.5,
bottom: 2.5,
),
child: Text(
subHeadings[j].isEmpty
? "-"
: subHeadings[j],
style: TextStyle(
decoration:
[
"Attachment",
"From Account",
"Created Employee",
].contains(headings[j])
? TextDecoration
.underline
: TextDecoration.none,
decorationStyle:
[
"From Account",
"Created Employee",
].contains(headings[j])
? TextDecorationStyle
.dotted
: subHeadings[j] ==
"View"
? TextDecorationStyle
.solid
: TextDecorationStyle
.solid,
decorationColor: [
"From Account",
"Created Employee",
].contains(headings[j])
? AppColors.grey_thick
: subHeadings[j] ==
"View"
? AppColors.app_blue
: AppColors.app_blue,
fontSize: 14,
color:
subHeadings[j] == "View"
? AppColors.app_blue
: Color(0xFF818181),
),
),
),
),
),
],
),
);
}),
),
],
);
}),
),
InkResponse(
onTap: () async {
provider.showMoreDetails = !provider.showMoreDetails;
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
provider.showMoreDetails
? "Hide Details"
: "View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
Transform.flip(
flipY: provider.showMoreDetails ? true : false,
child: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg",
height: 25,
width: 20,
color: AppColors.app_blue,
),
),
],
),
),
),
],
),
),
),
),
);
},
);
}
Widget _scaffold1(BuildContext context) {
return Consumer<Paymentrequisitionpaymentslistprovider>( return Consumer<Paymentrequisitionpaymentslistprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
var payment_det = provider.paymentDetails; var payment_det = provider.paymentDetails;
......
import 'dart:io'; import 'dart:io';
import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:dotted_line/dotted_line.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:generp/Utils/app_colors.dart'; import 'package:generp/Utils/app_colors.dart';
import 'package:generp/Utils/commonWidgets.dart'; import 'package:generp/Utils/commonWidgets.dart';
import 'package:generp/screens/commom/accountsListDetails.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../Notifiers/financeProvider/paymentReceiptsProvider.dart'; import '../../Notifiers/financeProvider/paymentReceiptsProvider.dart';
import '../../Utils/commonServices.dart'; import '../../Utils/commonServices.dart';
...@@ -41,6 +43,7 @@ class _PaymentreceiptdetailsState extends State<Paymentreceiptdetails> { ...@@ -41,6 +43,7 @@ class _PaymentreceiptdetailsState extends State<Paymentreceiptdetails> {
context, context,
listen: false, listen: false,
); );
provider.showMoreDetails = false;
provider.paymentsListDetailsAPI(context, widget.paymentRequestId); provider.paymentsListDetailsAPI(context, widget.paymentRequestId);
}); });
} }
...@@ -80,6 +83,272 @@ class _PaymentreceiptdetailsState extends State<Paymentreceiptdetails> { ...@@ -80,6 +83,272 @@ class _PaymentreceiptdetailsState extends State<Paymentreceiptdetails> {
} }
Widget _scaffold(BuildContext context) { Widget _scaffold(BuildContext context) {
return Consumer<Paymentreceiptsprovider>(
builder: (context, provider, child) {
var payment_det = provider.receiptDetails;
final headings1 = ["Payment Mode", "Receipt Date"];
final subHeadings1 = [
payment_det.requestMode ?? "-",
payment_det.receiptDate ?? "-",
];
final headings2 = [
"Bank Name",
"Account Holder Name",
"Account Number",
"Branch",
"IFSC",
"UPI ID",
];
final subHeadings2 = [
payment_det.bankName ?? "-",
payment_det.bankAccountHolderName ?? "-",
payment_det.bankAccountNumber ?? "-",
payment_det.bankBranchName ?? "-",
payment_det.bankIfscCode ?? "-",
payment_det.bankUpiId ?? "-",
];
final headings3 = ["Note", "Created Employee"];
final subHeadings3 = [
payment_det.description ?? "-",
payment_det.createdEmployee ?? "-",
];
final sections = [
{
"title": "Receipt Details",
"headings": headings1,
"subHeadings": subHeadings1,
},
if (provider.showMoreDetails) ...[
{
"title": "Bank Details",
"headings": headings2,
"subHeadings": subHeadings2,
},
{
"title": "Other Details",
"headings": headings3,
"subHeadings": subHeadings3,
},
],
];
return Scaffold(
resizeToAvoidBottomInset: true,
//widget.pageName
appBar: appbarNew(context, "Payment Receipt Details", 0xFFFFFFFF),
backgroundColor: AppColors.scaffold_bg_color,
body: SingleChildScrollView(
child: Card(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(30),
bottomRight: Radius.circular(30),
),
),
elevation: 2,
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(30),
bottomRight: Radius.circular(30),
),
),
// margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
child: Column(
children: [
Row(
children: [
Expanded(
flex: 1,
child: Container(
height: 45,
width: 45,
padding: EdgeInsets.all(7.5),
decoration: BoxDecoration(
color: Color(0xFFE6F6FF),
shape: BoxShape.circle,
// borderRadius: BorderRadius.circular(8),
),
child: SvgPicture.asset("assets/svg/fin_ic.svg"),
),
),
SizedBox(width: 10),
Expanded(
flex: 8,
child: SizedBox(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
InkResponse(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder:
(context) => Accountslistdetails(
accountID: provider.receiptDetails.accountId,
),
),
);
},
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 6,
),
child: Text(
payment_det.receipientAccount ?? "-",
style: TextStyle(
decoration: TextDecoration.underline,
decorationColor: AppColors.grey_thick,
decorationStyle:
TextDecorationStyle.dotted,
height: 1.5,
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
),
Text(
"₹${payment_det.amount}",
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.grey_semi,
),
),
],
),
),
),
],
),
Column(
children: List.generate(sections.length, (sectionIndex) {
final section = sections[sectionIndex];
final title = section["title"] as String;
final headings = section["headings"] as List<String>;
final subHeadings =
section["subHeadings"] as List<String>;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 4),
child: Row(
children: [
Expanded(
flex: 3,
child: Text(
title,
style: TextStyle(
fontSize: 14,
fontFamily: "JakartaSemiBold",
),
),
),
Expanded(
flex: 6,
child: DottedLine(
dashGapLength: 4,
dashGapColor: Colors.white,
dashColor: AppColors.grey_semi,
dashLength: 2,
lineThickness: 0.5,
),
),
],
),
),
Column(
children: List.generate(headings.length, (j) {
return Container(
padding: EdgeInsets.symmetric(vertical: 7),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
headings[j],
style: TextStyle(
fontFamily: "JakartaRegular",
fontSize: 14,
color: AppColors.semi_black,
),
),
),
Expanded(
child: Text(
subHeadings[j].isEmpty
? "-"
: subHeadings[j],
style: TextStyle(
fontSize: 14,
color: Color(0xFF818181),
),
),
),
],
),
);
}),
),
],
);
}),
),
InkResponse(
onTap: () async {
provider.showMoreDetails = !provider.showMoreDetails;
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
provider.showMoreDetails
? "Hide Details"
: "View Details",
style: TextStyle(
fontFamily: "JakartaMedium",
fontSize: 14,
color: AppColors.app_blue,
),
),
Transform.flip(
flipY: provider.showMoreDetails ? true : false,
child: SvgPicture.asset(
"assets/svg/arrow_dropdown.svg",
height: 25,
width: 20,
color: AppColors.app_blue,
),
),
],
),
),
),
],
),
),
),
),
);
},
);
}
Widget _scaffold1(BuildContext context) {
return Consumer<Paymentreceiptsprovider>( return Consumer<Paymentreceiptsprovider>(
builder: (context, provider, child) { builder: (context, provider, child) {
var payment_det = provider.receiptDetails; var payment_det = provider.receiptDetails;
......
...@@ -175,15 +175,17 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -175,15 +175,17 @@ class _SubmitpaymentrequestionlistsbymodeState
builder: (context, provider, child) { builder: (context, provider, child) {
return Scaffold( return Scaffold(
resizeToAvoidBottomInset: true, resizeToAvoidBottomInset: true,
backgroundColor: AppColors.white, backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar2( appBar: appbar2New(
context, context,
"${widget.pageTitleName}", "${widget.pageTitleName}",
provider.resetForm, provider.resetForm,
SizedBox(width: 0), SizedBox(width: 0),
0xFFFFFFFF
), ),
body: Container( body: Container(
padding: EdgeInsets.symmetric(horizontal: 10), padding: EdgeInsets.symmetric(horizontal: 10),
margin: EdgeInsets.only(top: 10,left: 10,right: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.circular(20), borderRadius: BorderRadius.circular(20),
...@@ -607,6 +609,8 @@ class _SubmitpaymentrequestionlistsbymodeState ...@@ -607,6 +609,8 @@ class _SubmitpaymentrequestionlistsbymodeState
flex: 4, flex: 4,
child: Text( child: Text(
"${provider.imagePath}", "${provider.imagePath}",
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle( style: TextStyle(
color: AppColors.semi_black, color: AppColors.semi_black,
fontSize: 11, fontSize: 11,
......
...@@ -354,13 +354,7 @@ class _SplashState extends State<Splash> { ...@@ -354,13 +354,7 @@ class _SplashState extends State<Splash> {
default: default:
connection = 'Offline'; connection = 'Offline';
} }
if (connection == 'Online') {
print("camer here");
Provider.of<SplashVersionNotifier>(
context,
listen: false,
).handleVersionCheck(context);
}
return (connection == 'Online') return (connection == 'Online')
? SafeArea( ? SafeArea(
top: false, top: false,
......
...@@ -17,6 +17,7 @@ import 'package:generp/Models/crmModels/ProspectListViewResponse.dart'; ...@@ -17,6 +17,7 @@ import 'package:generp/Models/crmModels/ProspectListViewResponse.dart';
import 'package:generp/Models/crmModels/SubmitLeadListFilterResponse.dart'; import 'package:generp/Models/crmModels/SubmitLeadListFilterResponse.dart';
import 'package:generp/Models/crmModels/crmDownloadGenQuoteResponse.dart'; import 'package:generp/Models/crmModels/crmDownloadGenQuoteResponse.dart';
import 'package:generp/Models/crmModels/crmLeadDetailsGenerateQuotationSubmitResponse.dart'; import 'package:generp/Models/crmModels/crmLeadDetailsGenerateQuotationSubmitResponse.dart';
import 'package:generp/Models/crmModels/crmNewLeadsProspectsSubmitResponse.dart';
import 'package:generp/Models/crmModels/crmNewLeadsProspectsViewResponse.dart'; import 'package:generp/Models/crmModels/crmNewLeadsProspectsViewResponse.dart';
import 'package:generp/Models/crmModels/crmProspectDetailsAddFollowUpAppointmentResponse.dart'; import 'package:generp/Models/crmModels/crmProspectDetailsAddFollowUpAppointmentResponse.dart';
import 'package:generp/Models/crmModels/crmProspectDetailsAddLeadsResponse.dart'; import 'package:generp/Models/crmModels/crmProspectDetailsAddLeadsResponse.dart';
...@@ -3345,7 +3346,7 @@ class ApiCalling { ...@@ -3345,7 +3346,7 @@ class ApiCalling {
} }
} }
static Future<CommonResponse?> crmNewLeadsProspectsSubmitAPI( static Future<crmNewLeadsProspectsSubmitResponse?> crmNewLeadsProspectsSubmitAPI(
session_id, session_id,
emp_id, emp_id,
mode, mode,
...@@ -3398,7 +3399,7 @@ class ApiCalling { ...@@ -3398,7 +3399,7 @@ class ApiCalling {
if (res != null) { if (res != null) {
print(data); print(data);
debugPrint("Submit New Leads ${res.body}"); debugPrint("Submit New Leads ${res.body}");
return CommonResponse.fromJson(jsonDecode(res.body)); return crmNewLeadsProspectsSubmitResponse.fromJson(jsonDecode(res.body));
} else { } else {
debugPrint("Null Response"); debugPrint("Null Response");
return null; return null;
......
...@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev ...@@ -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 # 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 # 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. # of the product and file versions while build-number is used as the build suffix.
version: 1.0.95+99 version: 1.0.95+101
environment: environment:
sdk: ^3.7.2 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