diff --git a/app/src/main/java/com/nivesh/production/niveshfd/ui/fragment/StepFourNiveshFDFragment.kt b/app/src/main/java/com/nivesh/production/niveshfd/ui/fragment/StepFourNiveshFDFragment.kt index d03000e..48a6013 100644 --- a/app/src/main/java/com/nivesh/production/niveshfd/ui/fragment/StepFourNiveshFDFragment.kt +++ b/app/src/main/java/com/nivesh/production/niveshfd/ui/fragment/StepFourNiveshFDFragment.kt @@ -98,20 +98,20 @@ class StepFourNiveshFDFragment : Fragment() { } private fun validated(): Boolean { - if (selectedList.isEmpty()) { + return if (selectedList.isEmpty()) { showDialogValidation( activity as NiveshFdMainActivity, getString(R.string.validTermsCondition) ) - return false + false } else if (!binding.checkBox.isChecked) { showDialogValidation( activity as NiveshFdMainActivity, resources.getString(R.string.validTermsConditions) ) - return false + false } else { - return true + true } } diff --git a/app/src/main/java/com/nivesh/production/niveshfd/ui/fragment/StepOneNiveshFDFragment.kt b/app/src/main/java/com/nivesh/production/niveshfd/ui/fragment/StepOneNiveshFDFragment.kt index 712c92f..b88d492 100644 --- a/app/src/main/java/com/nivesh/production/niveshfd/ui/fragment/StepOneNiveshFDFragment.kt +++ b/app/src/main/java/com/nivesh/production/niveshfd/ui/fragment/StepOneNiveshFDFragment.kt @@ -258,11 +258,9 @@ class StepOneNiveshFDFragment : Fragment() { when (code) { 200 -> { listOfMinAmount = getCodeResponse.Response.GetCodesList - if (listOfMinAmount.isNotEmpty()) { - binding.txtMinAmount.text = getString(R.string.minAmount).plus( - listOfMinAmount[0].Value - ) - } +// if (listOfMinAmount.isNotEmpty()) { +// binding.txtMinAmount.text = getString(R.string.minAmount).plus(listOfMinAmount[0].Value) +// } maxAmountApi() } 650 -> "" @@ -438,7 +436,13 @@ class StepOneNiveshFDFragment : Fragment() { binding.tlDepositAmount, getString(R.string.validMinAmount) ) - } else if (binding.edtAmount.text.toString() + } else if (binding.edtAmount.text.toString().toInt() % 1000 != 0) { + commonErrorMethod( + binding.edtAmount, + binding.tlDepositAmount, + getString(R.string.validMultipleAmount) + ) + }else if (binding.edtAmount.text.toString() .toDouble() > listOfMaxAmount[0].Value.toDouble() ) { commonErrorMethod( diff --git a/app/src/main/java/com/nivesh/production/niveshfd/ui/fragment/StepTwoNiveshFDFragment.kt b/app/src/main/java/com/nivesh/production/niveshfd/ui/fragment/StepTwoNiveshFDFragment.kt index d7e418d..b1df440 100644 --- a/app/src/main/java/com/nivesh/production/niveshfd/ui/fragment/StepTwoNiveshFDFragment.kt +++ b/app/src/main/java/com/nivesh/production/niveshfd/ui/fragment/StepTwoNiveshFDFragment.kt @@ -39,6 +39,7 @@ import com.nivesh.production.niveshfd.util.Common.Companion.getDate import com.nivesh.production.niveshfd.util.Common.Companion.isIndianMobileNo import com.nivesh.production.niveshfd.util.Common.Companion.isMinor import com.nivesh.production.niveshfd.util.Common.Companion.isValidEmail +import com.nivesh.production.niveshfd.util.Common.Companion.isValidIndividualPan import com.nivesh.production.niveshfd.util.Common.Companion.isValidName import com.nivesh.production.niveshfd.util.Common.Companion.isValidPan import com.nivesh.production.niveshfd.util.Common.Companion.removeError @@ -564,10 +565,10 @@ class StepTwoNiveshFDFragment : Fragment() { } } binding.tvBankDetails.setOnClickListener { - if (binding.llBankDetails.visibility == View.VISIBLE) { - binding.llBankDetails.visibility = View.GONE + if (binding.llBank.visibility == View.VISIBLE) { + binding.llBank.visibility = View.GONE } else { - binding.llBankDetails.visibility = View.VISIBLE + binding.llBank.visibility = View.VISIBLE } } @@ -1487,10 +1488,22 @@ class StepTwoNiveshFDFragment : Fragment() { listOfOccupation ) binding.spOccupation.setAdapter(adapter) - binding.spOccupation.setText( - adapter.getItem(0)?.Label, - false - ) + + val occupationCode = (activity as NiveshFdMainActivity).getClientDetailsResponse.ObjectResponse?.clientDetails?.clientMasterMFD?.CLIENT_OCCUPATION_CODE + if (occupationCode.isNullOrEmpty()) { + + binding.spOccupation.setText( + adapter.getItem(0)?.Label, + false + ) + }else{ + for (title in listOfOccupation) { + if (title.Value == occupationCode) { + binding.spOccupation.setText(title.Label, false) + break + } + } + } } } // 650 -> refreshToken() @@ -1823,7 +1836,10 @@ class StepTwoNiveshFDFragment : Fragment() { ) } else if (binding.edtDOB.text.toString().isEmpty()) { // EditText commonErrorMethod(binding.edtDOB, binding.tlDOB, getString(R.string.emptyDOB)) - } else if (binding.edtPANNumber.text.toString().isEmpty()) { // EditText + }else if (isMinor(binding.edtDOB.text.toString())) { // EditText + commonErrorMethod(binding.edtDOB, binding.tlDOB, getString(R.string.minorApplicant)) + } + else if (binding.edtPANNumber.text.toString().isEmpty()) { // EditText commonErrorMethod( binding.edtPANNumber, binding.tlPanNumber, @@ -1835,6 +1851,12 @@ class StepTwoNiveshFDFragment : Fragment() { binding.tlPanNumber, getString(R.string.invalidPAN) ) + } else if (!isValidIndividualPan(binding.edtPANNumber.text.toString())) { // EditText + commonErrorMethod( + binding.edtPANNumber, + binding.tlPanNumber, + getString(R.string.invalidIndividualPAN) + ) } else if (binding.spTitle.text.isEmpty()) { // Spinner commonSpinnerErrorMethod( binding.spTitle, diff --git a/app/src/main/java/com/nivesh/production/niveshfd/util/Common.kt b/app/src/main/java/com/nivesh/production/niveshfd/util/Common.kt index f575ad7..f1ca97b 100644 --- a/app/src/main/java/com/nivesh/production/niveshfd/util/Common.kt +++ b/app/src/main/java/com/nivesh/production/niveshfd/util/Common.kt @@ -97,6 +97,12 @@ class Common { return mMatcher.matches() } + fun isValidIndividualPan(pan: String?): Boolean { + val mPattern = Pattern.compile("[A-Z]{3}[P][A-Z][0-9]{4}[A-Z]") + val mMatcher = mPattern.matcher(pan.toString()) + return mMatcher.matches() + } + //is Indian mobile Number fun isIndianMobileNo(mobileNumber: String?): Boolean { //(0/91): number starts with (0/91) diff --git a/app/src/main/res/layout/fragment_niveshfd_step_four.xml b/app/src/main/res/layout/fragment_niveshfd_step_four.xml index 50dc3fe..3c5a6d5 100644 --- a/app/src/main/res/layout/fragment_niveshfd_step_four.xml +++ b/app/src/main/res/layout/fragment_niveshfd_step_four.xml @@ -221,11 +221,7 @@ android:id="@+id/rvTerms" android:layout_width="match_parent" android:layout_height="match_parent" - tools:listitem="@layout/item_customer_list_preview" - - - /> - + tools:listitem="@layout/item_customer_list_preview" /> @@ -186,7 +188,7 @@ - - + + + android:orientation="horizontal" /> - - + + + Please enter amount first Entered amount should be greater than minimum amount - Entered amount should be less than 5 Cr. + Entered amount should be up to 5 Cr only + Entered Amount should be multiples of 1000 Please select Interest Payout Please select Investment Tenure @@ -139,9 +140,12 @@ Mobile number should have at least 10 digits Mobile number should start with 6,7,8 and 9 Please select date of birth + Primary Applicant should not be minor Please enter PAN number - Invalid PAN + Please enter valid PAN number + PAN Applicants should be individual + Account Verified diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b4507f2..8c085ba 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -18,7 +18,7 @@ Select Investment Tenure Up to 0.25% p.a for Up to 0.25% p.a for Senior Citizens, 60+ - Maturity Instructions: + Maturity Instructions Automatically credit to my bank account Automatically renew principal amount Automatically renew both principal and interest amount @@ -52,7 +52,8 @@ Please enter amount first Entered amount should be greater than minimum amount - Entered amount should be less than 5 Cr. + Entered amount should be up to 5 Cr only + Entered Amount should be multiples of 1000 Please select Interest Payout Please select Investment Tenure @@ -139,9 +140,12 @@ Mobile number should have at least 10 digits Mobile number should start with 6,7,8 and 9 Please select date of birth + Primary Applicant should not be minor Please enter PAN number - Invalid PAN + Please enter valid PAN number + PAN Applicants should be individual + Account Verified diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index cfa2984..a11320e 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -16,10 +16,10 @@