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

19-06-2025 By Sai Srinivas

Finance Module Test cases & Safe Area
parent 4807bee4
......@@ -186,64 +186,82 @@ class Requesitionlidtdetailsprovider extends ChangeNotifier {
_paymentDetails =
data.paymentDetails ??
PaymentDetails(
accountId: "",
accountName: "",
amount: "",
attachmentDirFilePath: "",
attachmentViewFileName: "",
bankAccountHolderName: "",
bankAccountNumber: "",
bankBranchName: "",
bankIfscCode: "",
bankName: "",
bankUpiId: "",
createdDatetime: "",
createdEmployeeId: "",
description: "",
id: "",
isExists: "",
mode: "",
paymentAccountId: "",
paymentAccountName: "",
paymentDate: "",
paymentEmployeeName: "",
paymentModeId: "",
paymentReferenceNumber: "",
paymentRemarks: "",
refId: "",
refType: "",
updatedDatetime: "",
accountId: "-",
accountName: "-",
amount: "-",
attachmentDirFilePath: "-",
attachmentViewFileName: "-",
bankAccountHolderName: "-",
bankAccountNumber: "-",
bankBranchName: "-",
bankIfscCode: "-",
bankName: "-",
bankUpiId: "-",
createdDatetime: "-",
createdEmployeeId: "-",
description: "-",
id: "-",
isExists: "-",
mode: "-",
paymentAccountId: "-",
paymentAccountName: "-",
paymentDate: "-",
paymentEmployeeName: "-",
paymentModeId: "-",
paymentReferenceNumber: "-",
paymentRemarks: "-",
refId: "-",
refType: "-",
updatedDatetime: "-",
);
_requestDetails =
data.requestDetails ??
RequestDetails(
updatedDatetime: "",
id: "",
description: "",
createdDatetime: "",
attachmentViewFileName: "",
attachmentDirFilePath: "",
amount: "",
accountName: "",
accountId: "",
branch: "",
createdEmployee: "",
date: "",
isProcessedPaymentRequest: "",
level1ApprovalRemarks: "",
level1Employee: "",
level2ApprovalRemarks: "",
level2Employee: "",
proposedAccount: "",
proposedAccountId: "",
requestedAmount: "",
requestingPurpose: "",
requestMode: "",
status: "",
transDis: "",
updatedDatetime: "-",
id: "-",
description: "-",
createdDatetime: "-",
attachmentViewFileName: "-",
attachmentDirFilePath: "-",
amount: "-",
accountName: "-",
accountId: "-",
branch: "-",
createdEmployee: "-",
date: "-",
isProcessedPaymentRequest: "-",
level1ApprovalRemarks: "-",
level1Employee: "-",
level2ApprovalRemarks: "-",
level2Employee: "-",
proposedAccount: "-",
proposedAccountId: "-",
requestedAmount: "-",
requestingPurpose: "-",
requestMode: "-",
status: "-",
transDis: "-",
);
_subHeadings = [
_requestDetails.accountName ?? "-",
_requestDetails.proposedAccount ?? "-",
_requestDetails.branch ?? "-",
_requestDetails.requestingPurpose ?? "-",
_requestDetails.requestMode ?? "-",
_requestDetails.createdEmployee ?? "-",
_requestDetails.attachmentViewFileName ?? "-",
_requestDetails.date ?? "-",
_requestDetails.description ?? "-",
_requestDetails.level1ApprovalRemarks ?? "-",
_requestDetails.level1Employee ?? "-",
_requestDetails.level2ApprovalRemarks ?? "-",
_requestDetails.level2Employee ?? "-",
_requestDetails.createdDatetime ?? "-",
_requestDetails.updatedDatetime ?? "-",
];
print("here 2121");
preValues();
notifyListeners();
......
......@@ -359,17 +359,8 @@ class Requestionlistprovider extends ChangeNotifier {
_paymentModes = data.paymentModes!;
_requestingPurposes = data.requestingPurposes!;
if (_selectedAccounts != null &&
!_accounts.contains(_selectedAccounts)) {
_selectedAccounts = null;
_accountId = "";
}
if (_selectedPayment != null &&
!_paymentModes.contains(_selectedPayment)) {
_selectedPayment = null;
_paymentModeId = "";
}
checkDropdownselected();
notifyListeners();
} else {}
}
} catch (e, s) {}
......@@ -434,26 +425,8 @@ class Requestionlistprovider extends ChangeNotifier {
_directPaymentAccounts = data.paymentAccounts!;
_directPaymentModes = data.paymentModes!;
_directAccounts = data.accounts!;
checkdirectPaymentDropDownsSlected();
if (_selectedDirectAccounts != null &&
!_directAccounts.contains(_selectedDirectAccounts)) {
_selectedDirectAccounts = null;
_directAccountID = "";
_directAccountValue = "";
}
if (_selectDirectPaymentModes != null &&
!_directPaymentModes.contains(_selectDirectPaymentModes)) {
_selectDirectPaymentModes = null;
_directPaymentModesID = "";
_directPaymentModesValues = "";
}
if (_selectDirectPaymentAccounts != null &&
!_directPaymentAccounts.contains(_selectDirectPaymentAccounts)) {
_selectDirectPaymentAccounts = null;
_directPaymentAccountsID = "";
_directPaymentAccountsValue = "";
}
notifyListeners();
} else {}
}
......@@ -890,9 +863,48 @@ class Requestionlistprovider extends ChangeNotifier {
UPIError = null;
FileError = null;
buttonEnabled = false;
checkDropdownselected();
checkdirectPaymentDropDownsSlected();
notifyListeners();
}
void checkdirectPaymentDropDownsSlected(){
if (_selectedDirectAccounts != null &&
!_directAccounts.contains(_selectedDirectAccounts)) {
_selectedDirectAccounts = null;
_directAccountID = "";
_directAccountValue = "";
}
if (_selectDirectPaymentModes != null &&
!_directPaymentModes.contains(_selectDirectPaymentModes)) {
_selectDirectPaymentModes = null;
_directPaymentModesID = "";
_directPaymentModesValues = "";
}
if (_selectDirectPaymentAccounts != null &&
!_directPaymentAccounts.contains(_selectDirectPaymentAccounts)) {
_selectDirectPaymentAccounts = null;
_directPaymentAccountsID = "";
_directPaymentAccountsValue = "";
}
}
void checkDropdownselected() {
if (_selectedAccounts != null &&
!_accounts.contains(_selectedAccounts)) {
_selectedAccounts = null;
_accountId = "";
}
if (_selectedPayment != null &&
!_paymentModes.contains(_selectedPayment)) {
_selectedPayment = null;
_paymentModeId = "";
}
if (_selectReqPurpose != null &&
!_requestingPurposes.contains(_selectReqPurpose)) {
_selectReqPurpose = null;
}
}
bool validateForm(BuildContext context, String mode) {
// Reset all errors
......
......@@ -441,28 +441,8 @@ class Paymentreceiptsprovider extends ChangeNotifier {
_receiptPaymentAccounts = data.receiptAccounts!;
_receiptPaymentModes = data.paymentModes!;
_receiptAccounts = data.accounts!;
checkDropDownSelected();
if (_selectedreceiptAccounts != null &&
!_receiptAccounts.contains(_selectedreceiptAccounts)) {
_selectedreceiptAccounts = null;
_receiptAccountID = "";
_receiptAccountValue = "";
}
if (_selectreceiptPaymentModes != null &&
!_receiptPaymentModes.contains(_selectreceiptPaymentModes)) {
_selectreceiptPaymentModes = null;
_receiptPaymentModesID = "";
_receiptPaymentModesValues = "";
}
if (_selectreceiptPaymentAccounts != null &&
!_receiptPaymentAccounts.contains(
_selectreceiptPaymentAccounts,
)) {
_selectreceiptPaymentAccounts = null;
_receiptPaymentAccountsID = "";
_receiptPaymentAccountsValue = "";
}
notifyListeners();
} else {}
}
......@@ -751,9 +731,32 @@ class Paymentreceiptsprovider extends ChangeNotifier {
FileError = null;
buttonEnabled = false;
dateError = null;
checkDropDownSelected();
notifyListeners();
}
void checkDropDownSelected(){
if (_selectedreceiptAccounts != null &&
!_receiptAccounts.contains(_selectedreceiptAccounts)) {
_selectedreceiptAccounts = null;
_receiptAccountID = "";
_receiptAccountValue = "";
}
if (_selectreceiptPaymentModes != null &&
!_receiptPaymentModes.contains(_selectreceiptPaymentModes)) {
_selectreceiptPaymentModes = null;
_receiptPaymentModesID = "";
_receiptPaymentModesValues = "";
}
if (_selectreceiptPaymentAccounts != null &&
!_receiptPaymentAccounts.contains(
_selectreceiptPaymentAccounts,
)) {
_selectreceiptPaymentAccounts = null;
_receiptPaymentAccountsID = "";
_receiptPaymentAccountsValue = "";
}
}
bool validatereceiptForm(BuildContext context) {
selectAccountError = null;
......
......@@ -58,7 +58,18 @@ class Paymentrequisitionpaymentslistprovider extends ChangeNotifier{
final data = await ApiCalling.paymentRequisitionPaymentDetailsAPI(prov.empId, prov.session,paymentId);
if(data!=null){
if(data.error=="0"){
_paymentDetails = data.paymentDetails!;
_paymentDetails = data.paymentDetails??PaymentDetails(
accountId: "-",
accountName: "-",
amount: "-",
attachmentDirFilePath: "-",
attachmentViewFileName: "-",
createdDatetime: "-",
description: "-",
id: "-",
updatedDatetime: "-",
refType: "-",refId: "-",paymentRemarks: "-",paymentReferenceNumber: "-",paymentModeId: "-",paymentEmployeeName: "-",paymentDate: "-",paymentAccountName: "-",paymentAccountId: "-",mode: "-",isExists: "-",createdEmployeeId: "-",bankUpiId: "-",bankName: "-",bankIfscCode:"-",bankBranchName: "-",bankAccountNumber: "-",bankAccountHolderName:"-" ,
);
_headings = [
"From Account",
"Payment Mode",
......
......@@ -6,6 +6,7 @@ import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:flutter_ringtone_player/flutter_ringtone_player.dart';
import 'package:generp/Utils/app_colors.dart';
import 'screens/notifierExports.dart';
import 'package:generp/Utils/SharedpreferencesService.dart';
import 'package:generp/screens/splash.dart';
......@@ -262,6 +263,13 @@ class MyApp extends StatelessWidget {
colorScheme: const ColorScheme.light(
background: Colors.white,
).copyWith(background: Colors.white),
scrollbarTheme: ScrollbarThemeData(
minThumbLength: 20,
interactive: true,
radius: Radius.circular(6),
thickness: WidgetStatePropertyAll(10),
thumbColor: WidgetStateProperty.all(AppColors.grey_semi.withOpacity(0.6))
)
),
home: const Splash(),
);
......
......@@ -105,7 +105,8 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Attendance"),
body: Container(
body: SafeArea(
child: Container(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -653,6 +654,7 @@ class _AttendanceScreenState extends State<AttendanceScreen> {
),
),
),
),
floatingActionButton:
attendance.attendanceStatus == 0 ||
attendance.attendanceStatus == 1
......
......@@ -39,7 +39,8 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, widget.getAttendanceStatus==0? "Check In":"Check Out"),
body:Container(
body:SafeArea(
child: Container(
child: SafeArea(
child: Column(
children: [
......@@ -227,6 +228,7 @@ class _CheckInOutScreenState extends State<CheckInOutScreen> {
),
),
),
),
);
},
);
......
......@@ -169,7 +169,8 @@ class _MyHomePageState extends State<MyHomePage> {
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
body: SafeArea(
child: Container(
child: Column(
children: [
Expanded(
......@@ -509,6 +510,7 @@ class _MyHomePageState extends State<MyHomePage> {
),
),
),
),
);
},
);
......
......@@ -160,7 +160,8 @@ class _LoginScreenState extends State<LoginScreen>
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
body: KeyboardVisibilityProvider(
body: SafeArea(
child: KeyboardVisibilityProvider(
controller: _keyboardVisibilityController,
child: Stack(
alignment: Alignment.center,
......@@ -688,6 +689,7 @@ class _LoginScreenState extends State<LoginScreen>
],
),
),
),
// bottomNavigationBar: ,
),
);
......
......@@ -24,7 +24,8 @@ class _ScannerloginState extends State<Scannerlogin> {
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "QR Login"),
body: Container(
body: SafeArea(
child: Container(
decoration: BoxDecoration(color: Colors.black),
child: Column(
children: [
......@@ -69,6 +70,7 @@ class _ScannerloginState extends State<Scannerlogin> {
),
),
),
),
);
},
);
......
......@@ -19,7 +19,8 @@ class UpdatePassword extends StatelessWidget {
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Update Password"),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
body: SafeArea(
child: Container(
child: Column(
children: [
Expanded(
......@@ -140,6 +141,7 @@ class UpdatePassword extends StatelessWidget {
),
),
),
),
);
}
......
......@@ -87,7 +87,8 @@ class _WebERPIOSState extends State<WebERPIOS> {
},
child: Scaffold(
appBar: appbar(context, "Web ERP"),
body: Container(
body: SafeArea(
child: Container(
child: Column(
children: <Widget>[
Expanded(
......@@ -274,6 +275,7 @@ class _WebERPIOSState extends State<WebERPIOS> {
),
),
),
),
);
}
}
......@@ -117,7 +117,8 @@ class _WebErpScreenState extends State<WebErpScreen> {
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Web ERP"),
body: Container(
body: SafeArea(
child: Container(
child: Column(
children: <Widget>[
Expanded(
......@@ -445,6 +446,7 @@ class _WebErpScreenState extends State<WebErpScreen> {
),
),
),
),
);
}
......
......@@ -80,7 +80,8 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
child: Scaffold(
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Whizzdom"),
body: Container(
body: SafeArea(
child: Container(
child: Column(children: <Widget>[
Expanded(
child: Stack(
......@@ -184,6 +185,7 @@ class _WebWhizzdomScreenState extends State<WebWhizzdomScreen> {
))
])),
),
),
);
}
}
......@@ -94,11 +94,11 @@ class _AccountledgerState extends State<Accountledger> {
),
),
backgroundColor: AppColors.scaffold_bg_color,
body: provider.isLoading
body: SafeArea(child: provider.isLoading
? Center(child: CircularProgressIndicator.adaptive(
valueColor: AlwaysStoppedAnimation<Color>(
AppColors.app_blue)
)):Container(
)):SizedBox(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -427,7 +427,7 @@ class _AccountledgerState extends State<Accountledger> {
],
),
),
),
)),
),
onWillPop: () {
return _onBackPressed(context);
......
......@@ -53,7 +53,7 @@ class _AccountslistState extends State<Accountslist> {
),
),),
backgroundColor: AppColors.scaffold_bg_color,
body:accountList.isNotEmpty? Container(
body:SafeArea(child: accountList.isNotEmpty? SizedBox(
child: SingleChildScrollView(
controller: scrollController,
child: Column(
......@@ -232,7 +232,7 @@ class _AccountslistState extends State<Accountslist> {
],
),
),
):Emptywidget(context),
):Emptywidget(context),)
),
onWillPop: () {
provider.pageNum = 1;
......
......@@ -68,7 +68,8 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
)),
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
body: SafeArea(
child: SizedBox(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -479,6 +480,7 @@ class _AccountslistdetailsState extends State<Accountslistdetails> {
),
),
),
),
onWillPop: () {
return _onBackPressed(context);
},
......
......@@ -39,7 +39,8 @@ class _AddcommonpaymentState extends State<Addcommonpayment> {
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Add Common Account"),
backgroundColor: AppColors.white,
body: Container(
body: SafeArea(
child: SizedBox(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -593,6 +594,7 @@ class _AddcommonpaymentState extends State<Addcommonpayment> {
),
),
),
),
floatingActionButtonLocation:
FloatingActionButtonLocation.centerFloat,
bottomNavigationBar: InkResponse(
......
......@@ -39,7 +39,8 @@ class _CommondashboardState extends State<Commondashboard> {
resizeToAvoidBottomInset: true,
backgroundColor: AppColors.scaffold_bg_color,
appBar: appbar(context, "Common"),
body: GridView.builder(
body: SafeArea(
child: GridView.builder(
padding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
itemCount: gridPages.length,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
......@@ -88,6 +89,7 @@ class _CommondashboardState extends State<Commondashboard> {
);
},
),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
floatingActionButton:provider.accessPages
.any((page) => page.id==292)? InkResponse(
......
......@@ -38,7 +38,8 @@ class _TransactiondetailsState extends State<Transactiondetails> {
resizeToAvoidBottomInset: true,
appBar: appbar(context, "Details"),
backgroundColor: AppColors.scaffold_bg_color,
body: Container(
body: SafeArea(
child: Container(
margin: EdgeInsets.symmetric(vertical: 10,horizontal: 10),
child: SingleChildScrollView(
child: Container(
......@@ -174,6 +175,7 @@ class _TransactiondetailsState extends State<Transactiondetails> {
),
),
),
),
);
},
);
......
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