Commit d2939607 authored by Sai Srinivas's avatar Sai Srinivas
Browse files

Correction and changes

parent a5ccb211
......@@ -338,6 +338,7 @@ class _PaymentdetailspaymentrequisitionState
fileUrl:
paymentDet
.attachmentDirFilePath!,
downloadEnable: true,
),
),
);
......@@ -604,6 +605,7 @@ class _PaymentdetailspaymentrequisitionState
fileUrl:
paymentDet
.attachmentDirFilePath!,
downloadEnable: true,
),
),
);
......
......@@ -452,6 +452,7 @@ class _PaymentreceiptdetailsState extends State<Paymentreceiptdetails> {
fileUrl:
paymentDet
.attachmentDirFilePath!,
downloadEnable: true,
),
),
);
......
import 'package:dotted_line/dotted_line.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
import 'package:generp/Utils/custom_snackbar.dart';
import 'package:geocoding/geocoding.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
......@@ -246,12 +247,14 @@ class _AttendanceRequestDetailScreenState
"Check In/Out Details",
scaleFactor,
),
if (details.type == "Check In" || details.type == "Check In/Out")
_buildDate_TimeTile(
"Check In Date & Time",
details.date,
details.checkInTime,
scaleFactor,
),
if (details.type == "Check Out" || details.type == "Check In/Out")
_buildDate_TimeTile(
"Check Out Date & Time",
details.date,
......@@ -259,22 +262,28 @@ class _AttendanceRequestDetailScreenState
scaleFactor,
),
if (details.type == "Check In" || details.type == "Check In/Out")
_buildDetailTile(
"Original Check In",
checkInTime,
scaleFactor,
),
if (details.type == "Check Out" || details.type == "Check In/Out")
_buildDetailTile(
"Original Check Out",
"--",
scaleFactor,
),
if (details.type == "Check In" || details.type == "Check In/Out")
_buildDetailTile(
"Original Check In Location",
details.checkInLocation,
scaleFactor,
),
if (details.type == "Check Out" || details.type == "Check In/Out")
_buildDetailTile(
"Original Check Out Location",
details.checkOutLocation,
......@@ -687,15 +696,11 @@ class _AttendanceRequestDetailScreenState
await onSubmit(remark);
// SnackBar here
Navigator.pop(context);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
"Request submitted successfully",
),
backgroundColor: Colors.green,
behavior: SnackBarBehavior.floating,
),
CustomSnackBar.showSuccess(
context: context,
message: "Request submitted successfully"
);
}
},
child: Container(
......@@ -967,6 +972,7 @@ class _AttendanceRequestDetailScreenState
(context) => Fileviewer(
fileName: filePath ?? "",
fileUrl: filePath ?? "",
downloadEnable: false,
),
),
);
......
......@@ -242,6 +242,7 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen> {
(context) => Fileviewer(
fileName: t.imageDirFilePath ?? "",
fileUrl: t.imageDirFilePath ?? "",
downloadEnable: false,
),
),
);
......@@ -301,6 +302,7 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen> {
(context) => Fileviewer(
fileName: h.imageDirFilePath ?? "",
fileUrl: h.imageDirFilePath ?? "",
downloadEnable: false,
),
),
);
......@@ -359,6 +361,7 @@ class _TourExpensesDetailsScreenState extends State<TourExpensesDetailsScreen> {
(context) => Fileviewer(
fileName: o.imageDirFilePath ?? "",
fileUrl: o.imageDirFilePath ?? "",
downloadEnable: false,
),
),
);
......
......@@ -986,6 +986,7 @@ class _GeneratorPartDetailsScreenState
provider
.partData
.imageDirFilePath!,
downloadEnable: false,
),
),
);
......
......@@ -328,6 +328,7 @@ class _AllpaymentrequesitionlistsbymodesoldState
fileUrl:
requestLists[index]
.attachmentDirFilePath!,
downloadEnable: false,
),
),
);
......
......@@ -316,6 +316,7 @@ class _PaymentlistpaymentrequisitionOldState
fileUrl:
requestLists[index]
.attachmentDirFilePath!,
downloadEnable: false,
),
),
);
......
......@@ -271,6 +271,7 @@ class _PaymentreceiptlistOldState extends State<PaymentreceiptlistOld> {
fileUrl:
requestLists[index]
.attachmentDirFilePath!,
downloadEnable: false,
),
),
);
......
......@@ -1035,6 +1035,7 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
fileUrl:
feedbackHistory[lp]
.attachmentDirFilePath!,
downloadEnable: false,
),
),
);
......@@ -1146,6 +1147,7 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
fileUrl:
feedbackHistory[lp]
.attachmentDirFilePath!,
downloadEnable: false,
),
),
);
......@@ -1439,6 +1441,7 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
fileUrl:
feedbackHistory[lp]
.attachmentDirFilePath!,
downloadEnable: false,
),
),
);
......@@ -2280,6 +2283,7 @@ class _OrdersdetailsbymodesState extends State<Ordersdetailsbymodes> {
fileUrl:
orderDetails
.tpcPaymentAttachmentDirFilePath!,
downloadEnable: false,
),
),
);
......
......@@ -1170,6 +1170,7 @@ class _PaymentdetailsbymodeState extends State<Paymentdetailsbymode> {
fileUrl:
paymentDetails
.attachmentDirFilePath!,
downloadEnable: false,
),
),
);
......
......@@ -329,6 +329,7 @@ class _TpcagentdetailsbymodeState extends State<Tpcagentdetailsbymode> {
fileUrl:
tpcAgentDetails.idProofDirFilePath ??
"",
downloadEnable: false,
),
),
);
......@@ -805,6 +806,7 @@ class _TpcagentdetailsbymodeState extends State<Tpcagentdetailsbymode> {
fileUrl:
tpcAgentDetails
.idProofDirFilePath!,
downloadEnable: false,
),
),
);
......
......@@ -851,6 +851,7 @@ class _TpcagentissuelistdetailsState extends State<Tpcagentissuelistdetails> {
fileUrl:
feedbackHistory[lp]
.attachmentDirFilePath!,
downloadEnable: false,
),
),
);
......@@ -965,6 +966,7 @@ class _TpcagentissuelistdetailsState extends State<Tpcagentissuelistdetails> {
fileUrl:
feedbackHistory[lp]
.attachmentDirFilePath!,
downloadEnable: false,
),
),
);
......@@ -1263,6 +1265,7 @@ class _TpcagentissuelistdetailsState extends State<Tpcagentissuelistdetails> {
fileUrl:
feedbackHistory[lp]
.attachmentDirFilePath!,
downloadEnable: false,
),
),
);
......@@ -1878,6 +1881,7 @@ class _TpcagentissuelistdetailsState extends State<Tpcagentissuelistdetails> {
fileUrl:
orderDetails
.tpcPaymentAttachmentDirFilePath!,
downloadEnable: false,
),
),
);
......
......@@ -442,6 +442,7 @@ class _TpcagentlistbymodeState extends State<Tpcagentlistbymode> {
tpcAgentsLists[index]
.idProofDirFilePath ??
"-",
downloadEnable: false,
),
),
);
......
......@@ -102,6 +102,7 @@ class _FollowupdetailsState extends State<Followupdetails> {
(context) => Fileviewer(
fileName: followups[index].fsrExt!,
fileUrl: "https://erp.gengroup.in/files_genservices/tech_fsr_report/${followups[index].fsrExt!}",
downloadEnable: false,
),
),
);
......
......@@ -12,10 +12,12 @@ import 'package:pin_code_fields/pin_code_fields.dart';
import 'package:provider/provider.dart';
import '../../Models/TechnicianLoadNumbersResponse.dart';
import '../../Notifiers/HomeScreenNotifier.dart';
import '../../Utils/dropdownTheme.dart';
import 'RazorpayQrScreen.dart';
class Paymentdetails extends StatefulWidget {
final accountName, referenceID, name, genId;
final accountName, referenceID, name, genId, complaintType;
const Paymentdetails({
super.key,
......@@ -23,6 +25,7 @@ class Paymentdetails extends StatefulWidget {
required this.name,
required this.genId,
required this.referenceID,
this.complaintType,
});
@override
......@@ -43,6 +46,7 @@ class _PaymentdetailsState extends State<Paymentdetails> {
context,
listen: false,
);
provider.resetErrors();
provider.LoadNumbersAPI(
context,
widget.accountName,
......@@ -267,7 +271,7 @@ class _PaymentdetailsState extends State<Paymentdetails> {
),
],
),
items:
items:// here i have payment option
provider.paymentModeDropDown
.map(
(paymentMode) => DropdownMenuItem<
......@@ -358,39 +362,33 @@ class _PaymentdetailsState extends State<Paymentdetails> {
),
errorWidget(context, provider.selectAmountError),
SizedBox(height: 10),
if (provider.selectPaymentMode?.name?.toLowerCase() != 'upi') ...[
Padding(
padding: const EdgeInsets.only(bottom: 5.0),
child: Text("Reference Number"),
),
Container(
height: 50,
alignment: Alignment.center,
decoration: BoxDecoration(
color: AppColors.text_field_color,
borderRadius: BorderRadius.circular(14),
),
child: Padding(
padding: const EdgeInsets.fromLTRB(
10.0,
0.0,
10,
0,
),
padding: const EdgeInsets.fromLTRB(10.0, 0.0, 10, 0),
child: TextFormField(
controller: provider.Referencecontroller,
keyboardType: TextInputType.text,
onChanged: (value) {
provider.ReferenceError = null;
},
decoration: InputDecoration(
decoration: const InputDecoration(
hintText: "Enter Reference Number",
hintStyle: TextStyle(
fontWeight: FontWeight.w400,
color: Color(0xFFB4BEC0),
fontSize: 14,
),
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
),
......@@ -398,6 +396,9 @@ class _PaymentdetailsState extends State<Paymentdetails> {
),
),
errorWidget(context, provider.ReferenceError),
],
// errorWidget(context, provider.ReferenceError),
SizedBox(height: 10),
InkResponse(
onTap: () {
......@@ -479,11 +480,65 @@ class _PaymentdetailsState extends State<Paymentdetails> {
? null
: () {
HapticFeedback.selectionClick();
// 🧩 Common validation
if (provider.selectContact == null) {
provider.selectContactError = "Please select phone number";
provider.notifyListeners();
return;
}
if (provider.Amountcontroller.text.isEmpty) {
provider.selectAmountError = "Please enter amount";
provider.notifyListeners();
return;
}
// 🧩 For UPI payment
if (provider.selectPaymentMode?.name?.toLowerCase() == 'upi') {
if (provider.imagePicked == 0 || provider.imagePath == null) {
provider.imageError = "Please upload reference document";
provider.notifyListeners();
return;
}
// All validations passed ✅
var homeProvider = Provider.of<HomescreenNotifier>(
context,
listen: false,
);
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => RazorpayQrScreen(
sessionId: homeProvider.session,
empId: homeProvider.empId,
amount: provider.Amountcontroller.text,
refType: widget.complaintType,
refId: widget.referenceID,
),
),
);
} else {
// 🧩 For non-UPI payments
if (provider.Referencecontroller.text.isEmpty) {
provider.ReferenceError = "Please enter reference number";
provider.notifyListeners();
return;
}
if (provider.imagePicked == 0 || provider.imagePath == null) {
provider.imageError = "Please upload reference document";
provider.notifyListeners();
return;
}
provider.PaymentUpdateAPI(
context,
provider.Referencecontroller.text,
provider.Amountcontroller.text,
);
}
},
child: Container(
alignment: Alignment.center,
......@@ -505,10 +560,12 @@ class _PaymentdetailsState extends State<Paymentdetails> {
valueColor: AlwaysStoppedAnimation<Color>(Colors.white),
),
)
: const Text(
"Send OTP",
: Text(
provider.selectPaymentMode?.name?.toLowerCase() == 'upi'
? "Show QR"
: "Send OTP",
textAlign: TextAlign.center,
style: TextStyle(
style: const TextStyle(
fontSize: 15,
fontFamily: "JakartaMedium",
color: Colors.white,
......@@ -516,7 +573,9 @@ class _PaymentdetailsState extends State<Paymentdetails> {
),
),
),
)
),
),
),
),
......
This diff is collapsed.
......@@ -942,6 +942,7 @@ class _VisitdetailsState extends State<Visitdetails> {
.fsrExt!,
fileUrl:
"https://erp.gengroup.in/files_genservices/tech_fsr_report/${followups[lp].fsrExt!}",
downloadEnable: false,
),
),
);
......@@ -1022,6 +1023,7 @@ class _VisitdetailsState extends State<Visitdetails> {
provider
.complaintDetailsNew
.complaintId,
complaintType: provider.complaintDetailsNew.complaintType,
),
),
);
......
......@@ -244,7 +244,7 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
child: Container(
padding: EdgeInsets.only(
left: 10,
top: 10,
top: 9,
bottom: 10,
right: 10,
),
......@@ -272,7 +272,7 @@ class _ServiceengineerdashboardState extends State<Serviceengineerdashboard> {
child: Text(
"${numbers[index].toString()}",
style: TextStyle(
fontSize: 20,
fontSize: 18,
color: Color(textColorCodes[index]),
),
),
......
This diff is collapsed.
......@@ -74,7 +74,8 @@ const paymentRequesitionPaymentsDetailsUrl = "${baseUrl_test}payment_requisition
const paymentRequesitionPaymentsReceiptsListUrl = "${baseUrl_test}payment_receipts_list_v2";
const paymentRequesitionPaymentsReceiptsDetailsUrl = "${baseUrl_test}payment_receipt_details";
const paymentRequesitionEditProcessedPaymentUrl = "${baseUrl_test}edit_processes_payment";
const validateGstNumberUrl = "${baseUrl_test}validate_gst_number";
const validateBankAccountDetailsUrl = "${baseUrl_test}validate_bank_account_details";
///common Module
const commonAccessiblePagesUrl = "${baseUrl_test}common_accessible_pages";
......@@ -208,5 +209,6 @@ const CasuaLeaveHistoryUrl ="${baseUrl_test}casual_leave_history";
const EmployeeContactListUrl ="${baseUrl_test}employee_contact_list";
const AdvanceListUrl ="${baseUrl_test}advance_list";
const createRazorpayUpiQrUrl ="${baseUrl_test}create_razorpay_upi_qr";
const fetchRazorpayUpiQrStatusUrl ="${baseUrl_test}fetch_razorpay_upi_qr_status";
\ No newline at end of file
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