{
	"auto_complete":
	{
		"selected_items":
		[
			[
				"arra",
				"array_diff"
			],
			[
				"panel-",
				"panel-body"
			],
			[
				"DB",
				"DB::insert\tRun an insert statement against the database."
			],
			[
				"check",
				"crack_check"
			],
			[
				"month",
				"MONTH"
			]
		]
	},
	"buffers":
	[
		{
			"contents": "<?php\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: SAMITY ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewSamity/', 'microfin\\samity\\MfnSamityController@index');  \n\t\tRoute::get('addSamity/', 'microfin\\samity\\MfnSamityController@addSamity'); \n\t\tRoute::post('reqWorkingAreaOptions/', 'microfin\\samity\\MfnSamityController@loadWorkingAreaOptions');\n\t\tRoute::post('addSamityItem/', 'microfin\\samity\\MfnSamityController@addItem'); \n\t\tRoute::post('detailsSamity/', 'microfin\\samity\\MfnSamityController@detailsSamity');\n\t\tRoute::post('updateSamityItem/', 'microfin\\samity\\MfnSamityController@updateItem'); \n\t\tRoute::post('reqMemberExistance/', 'microfin\\samity\\MfnSamityController@checkMemberExistance'); \n\t\tRoute::post('deleteSamityItem/', 'microfin\\samity\\MfnSamityController@deleteItem');\n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: SAMITY TRANSFER ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewSamityTransfer/', 'microfin\\samity\\MfnSamityTransferController@index');  \n\t\tRoute::get('addSamityTransfer/', 'microfin\\samity\\MfnSamityTransferController@addSamityTransfer'); \n\t\tRoute::post('addSamityTransferItem/', 'microfin\\samity\\MfnSamityTransferController@addItem'); \n\t\tRoute::get('loadSamityListByBranch/', 'microfin\\samity\\MfnSamityTransferController@loadSamityListByBranch');\n\t\tRoute::post('singleSamityDetailsForTransfer/', 'microfin\\samity\\MfnSamityTransferController@singleSamityDetailsForTransfer'); \n\t\tRoute::post('deleteSamityTransferItem/', 'microfin\\samity\\MfnSamityTransferController@deleteItem');  \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: SAMITY CLOSING ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewSamityClosing/', 'microfin\\samity\\MfnSamityClosingController@index');  \n\t\tRoute::get('addSamityClosing/', 'microfin\\samity\\MfnSamityClosingController@addSamityClosing'); \n\t\tRoute::post('addSamityClosingItem/', 'microfin\\samity\\MfnSamityClosingController@addItem');\n\t\tRoute::post('updateSamityClosingItem/', 'microfin\\samity\\MfnSamityClosingController@updateItem');  \n\t\tRoute::post('deleteSamityClosingItem/', 'microfin\\samity\\MfnSamityClosingController@deleteItem');\n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: SAMITY FIELD OFFICER CHANGE ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewSamityFieldOfficerChange/', 'microfin\\samity\\MfnSamityFieldOfficerChangeController@index');\n\t\tRoute::get('addSamityFieldOfficerChange/', 'microfin\\samity\\MfnSamityFieldOfficerChangeController@addSamityFieldOfficerChange'); \n\t\tRoute::post('reqCurFieldOfficer/', 'microfin\\samity\\MfnSamityFieldOfficerChangeController@getCurFieldOfficer');\t\n\t\tRoute::post('addSamityFieldOfficerChangeItem/', 'microfin\\samity\\MfnSamityFieldOfficerChangeController@addItem');\n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: SAMITY DAY CHANGE ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewSamityDayChange/', 'microfin\\samity\\MfnSamityDayChangeController@index');  \n\t\tRoute::get('addSamityDayChange/', 'microfin\\samity\\MfnSamityDayChangeController@addSamityDayChange'); \n\t\tRoute::post('reqCurrentSamityDay/', 'microfin\\samity\\MfnSamityDayChangeController@getCurrentSamityDay');\n\t\tRoute::post('reqSamityDayList/', 'microfin\\samity\\MfnSamityDayChangeController@getSamitydDayType');\n\t\tRoute::post('addSamityDayChangeItem/', 'microfin\\samity\\MfnSamityDayChangeController@addItem');\n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: EMPLOYEE ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewEmployee/', 'microfin\\employee\\MfnEmployeeController@index');  \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: MEMBER INFORMATION ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewMember/', 'microfin\\member\\MfnMemberInformationController@index');  \n\t\tRoute::get('addMember/', 'microfin\\member\\MfnMemberInformationController@addMember'); \n\t\tRoute::post('addMemberItem/', 'microfin\\member\\MfnMemberInformationController@addItem');\n\t\tRoute::get('detailsMember/{id}', 'microfin\\member\\MfnMemberInformationController@detailsMember');\n\t\tRoute::get('updateMember/{id}', 'microfin\\member\\MfnMemberInformationController@updateMember'); \n\t\tRoute::post('updateMemberItem/', 'microfin\\member\\MfnMemberInformationController@updateItem');\n\t\tRoute::post('reqMemberCode/', 'microfin\\member\\MfnMemberInformationController@loadMemberCode');\n\t\tRoute::post('reqCheckAdmissionDate/', 'microfin\\member\\MfnMemberInformationController@checkAdmissionDate');\n\t\tRoute::post('reqMemberAge/', 'microfin\\member\\MfnMemberInformationController@loadMemberAge');\n\t\tRoute::post('reqMandatorySavingsDetails/', 'microfin\\member\\MfnMemberInformationController@loadMandatorySavingsDetails');\n\t\tRoute::post('reqMandatoryTransactionDetails/', 'microfin\\member\\MfnMemberInformationController@mandatorySavingsDetails');\n\t\tRoute::post('reqNIDDuplicacyCheck/', 'microfin\\member\\MfnMemberInformationController@nIDDuplicacyCheck');\n\t\tRoute::post('reqBirthRegNoDuplicacyCheck/', 'microfin\\member\\MfnMemberInformationController@birthRegNoDuplicacyCheck');\n\t\tRoute::post('reqPassportNoDuplicacyCheck/', 'microfin\\member\\MfnMemberInformationController@passportNoDuplicacyCheck');\n\t\tRoute::post('reqMobileNoDuplicacyCheck/', 'microfin\\member\\MfnMemberInformationController@mobileNoDuplicacyCheck');\n\t\tRoute::post('reqSamityAndPrimaryProductOptionsForMember/', 'microfin\\member\\MfnMemberInformationController@loadSamityAndPrimaryProductOptions');\n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: OPENING BALANCE FOR MEMBER INFORMATION ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth',/*'hasAccess'*/]], function() {\n\n\t\tRoute::get('addOpeningBalanceMember/', 'microfin\\configuration\\openingBalance\\member\\MfnMemberOpeningBalanceController@addOpeningBalanceMember'); \n\t\tRoute::post('addOpeningBalanceMemberItem/', 'microfin\\configuration\\openingBalance\\member\\MfnMemberOpeningBalanceController@addItem'); \n\t\tRoute::post('reqOpeningBalanceMemberCode/', 'microfin\\configuration\\openingBalance\\member\\MfnMemberOpeningBalanceController@loadMemberCode');\n\t\tRoute::post('reqOpeningBalanceMemberAge/', 'microfin\\configuration\\openingBalance\\member\\MfnMemberOpeningBalanceController@loadMemberAge');\n\t\tRoute::post('reqOpeningBalanceNIDDuplicacyCheck/', 'microfin\\configuration\\openingBalance\\member\\MfnMemberOpeningBalanceController@nIDDuplicacyCheck');\n\t\tRoute::post('reqOpeningBalanceBirthRegNoDuplicacyCheck/', 'microfin\\configuration\\openingBalance\\member\\MfnMemberOpeningBalanceController@birthRegNoDuplicacyCheck');\n\t\tRoute::post('reqOpeningBalancePassportNoDuplicacyCheck/', 'microfin\\configuration\\openingBalance\\member\\MfnMemberOpeningBalanceController@passportNoDuplicacyCheck');\n\t\tRoute::post('reqOpeningBalanceMobileNoDuplicacyCheck/', 'microfin\\configuration\\openingBalance\\member\\MfnMemberOpeningBalanceController@mobileNoDuplicacyCheck');\n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: MEMBER SAMITY TRANSFER ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewMemberSamityTransfer/', 'microfin\\member\\MfnMemberSamityTransferController@index');  \n\t\tRoute::get('addMemberSamityTransfer/', 'microfin\\member\\MfnMemberSamityTransferController@addMemberSamityTransfer'); \n\t\tRoute::post('addMemberSamityTransferItem/', 'microfin\\member\\MfnMemberSamityTransferController@addItem'); \n\t\tRoute::post('reqLoanAndSavingsSummary/', 'microfin\\member\\MfnMemberSamityTransferController@loadLoanAndSavingsSummary');\n\t\tRoute::post('reqNewMemberCode/', 'microfin\\member\\MfnMemberSamityTransferController@loadNewMemberCode'); \n\t\tRoute::post('reqPreventProductTransfer/', 'microfin\\member\\MfnMemberSamityTransferController@preventProductTransfer'); \n\t\t//Route::post('deleteSamityTransferItem/', 'microfin\\samity\\MfnSamityTransferController@deleteItem');  \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: MEMBER PRIMARY PRODUCT TRANSFER ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewMemberPrimaryProductTransfer/', 'microfin\\member\\MfnMemberPrimaryProductTransferController@index');  \n\t\tRoute::get('addMemberPrimaryProductTransfer/', 'microfin\\member\\MfnMemberPrimaryProductTransferController@addMemberPrimaryProductTransfer'); \n\t\tRoute::post('reqPrimaryPrductOptions/', 'microfin\\member\\MfnMemberPrimaryProductTransferController@loadPrimaryPrduct');\n\t\tRoute::post('addMemberPrimaryProductTransferItem/', 'microfin\\member\\MfnMemberPrimaryProductTransferController@addItem');\n\t\tRoute::get('detailsMemberPrimaryProductTransfer/{id}', 'microfin\\member\\MfnMemberPrimaryProductTransferController@detailsMemberPrimaryProductTransfer');\n\t\tRoute::get('updateMemberPrimaryProductTransfer/{id}', 'microfin\\member\\MfnMemberPrimaryProductTransferController@updateMemberPrimaryProductTransfer');\n\t\tRoute::post('updateMemberPrimaryProductTransferItem/', 'microfin\\member\\MfnMemberPrimaryProductTransferController@updateItem');\n\t\tRoute::post('deleteMemberPrimaryProductTransfer/', 'microfin\\member\\MfnMemberPrimaryProductTransferController@deleteItem'); \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: MEMBER CLOSING ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewMemberClosing/', 'microfin\\member\\MfnMemberClosingController@index');  \n\t\tRoute::get('addMemberClosing/', 'microfin\\member\\MfnMemberClosingController@addMemberClosing'); \n\t\tRoute::post('reqLoanAndSavingsSummaryForMemberClosing/', 'microfin\\member\\MfnMemberClosingController@loadLoanAndSavingsSummaryForMemberClosing');\n\t\tRoute::post('addMemberClosingItem/', 'microfin\\member\\MfnMemberClosingController@addItem');\n\t\t//Route::get('detailsMemberPrimaryProductTransfer/{id}', 'microfin\\member\\MfnMemberPrimaryProductTransferController@detailsMemberPrimaryProductTransfer');\n\t\tRoute::post('reqSamityAndPrimaryProductOptionsForMemberClosing/', 'microfin\\member\\MfnMemberClosingController@loadSamityAndPrimaryProductOptions');\n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: MEMBER TYPE ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewMemberType/', 'microfin\\member\\MfnMemberTypeController@index');\n\t\tRoute::get('addMemberTypeForm/', 'microfin\\member\\MfnMemberTypeController@addMemberTypeForm');\n\t\tRoute::post('storeMemberType/', 'microfin\\member\\MfnMemberTypeController@addItem'); \n\t\tRoute::post('deleteMemberTypeItem/', 'microfin\\member\\MfnMemberTypeController@deleteItem');\n\t\tRoute::post('getMemberTypeInfo/', 'microfin\\member\\MfnMemberTypeController@getMemberTypeInfo'); \n\t\tRoute::post('updateMemberTypeItem/', 'microfin\\member\\MfnMemberTypeController@updateItem');   \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: PRIMARY PRODUCT ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewPrimaryProduct/', 'microfin\\settings\\MfnPrimaryProductController@index');\n\t\tRoute::get('addPrimaryProductForm/', 'microfin\\settings\\MfnPrimaryProductController@addPrimaryProductForm');\n\t\tRoute::post('storePrimaryProduct/', 'microfin\\settings\\MfnPrimaryProductController@addItem'); \n\t\tRoute::post('deletePrimaryProductItem/', 'microfin\\settings\\MfnPrimaryProductController@deleteItem');\n\t\tRoute::post('getPrimaryProductInfo/', 'microfin\\settings\\MfnPrimaryProductController@getPrimaryProductInfo'); \n\t\tRoute::post('updatePrimaryProductItem/', 'microfin\\settings\\MfnPrimaryProductController@updateItem');   \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: MARITAL STATUS ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewMaritalStatus/', 'microfin\\settings\\MfnMaritalStatusController@index');\n\t\tRoute::get('addMaritalStatusForm/', 'microfin\\settings\\MfnMaritalStatusController@addMaritalStatusForm');\n\t\tRoute::post('storeMatitalStatus/', 'microfin\\settings\\MfnMaritalStatusController@addItem'); \n\t\tRoute::post('deleteMaritalStatus/', 'microfin\\settings\\MfnMaritalStatusController@deleteItem');\n\t\tRoute::post('getMaritalStatusInfo/', 'microfin\\settings\\MfnMaritalStatusController@getMaritalStatusInfo'); \n\t\tRoute::post('updateMaritalStatusItem/', 'microfin\\settings\\MfnMaritalStatusController@updateItem');   \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: RELATIONSHIP ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewRelationship/', 'microfin\\settings\\MfnRelationshipController@index');\n\t\tRoute::get('addRelationshipForm/', 'microfin\\settings\\MfnRelationshipController@addRelationshipForm');\n\t\tRoute::post('storeRelationship/', 'microfin\\settings\\MfnRelationshipController@addItem'); \n\t\tRoute::post('deleteRelationship/', 'microfin\\settings\\MfnRelationshipController@deleteItem');\n\t\tRoute::post('getRelationshipInfo/', 'microfin\\settings\\MfnRelationshipController@getRelationshipInfo'); \n\t\tRoute::post('updateRelationshipItem/', 'microfin\\settings\\MfnRelationshipController@updateItem');   \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: LOANS PRODUCT CATEGORY ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewLoanProductCategory/', 'microfin\\loan\\MfnProductCategoryController@index');\n\t\tRoute::get('addLoanProductCategory/', 'microfin\\loan\\MfnProductCategoryController@addLoanProductCategory');\n\t\tRoute::post('addLoanProductCategoryItem/', 'microfin\\loan\\MfnProductCategoryController@addItem'); \n\t\tRoute::post('reqProductCategoryUpdate/', 'microfin\\loan\\MfnProductCategoryController@updateRequest'); \n\t\tRoute::post('updatePurposeCategoryItem/', 'microfin\\loan\\MfnProductCategoryController@updateItem'); \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: LOANS PRODUCT ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewLoanProduct/', 'microfin\\loan\\MfnProductController@index');\n\t\tRoute::get('addLoanProduct/', 'microfin\\loan\\MfnProductController@addProduct');\n\t\tRoute::post('addLoanProductItem/', 'microfin\\loan\\MfnProductController@addItem'); \n\t\tRoute::get('detailsProduct/{id}', 'microfin\\loan\\MfnProductController@detailsProduct');\n\t\tRoute::post('reqLoanProductType/', 'microfin\\loan\\MfnProductController@loadLoanProductType'); \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: LOANS PURPOSE CATEGORY ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewLoanPurposeCategory/', 'microfin\\loan\\MfnPurposeCategoryController@index');\n\t\tRoute::get('addLoanPurposeCategory/', 'microfin\\loan\\MfnPurposeCategoryController@addPurposeCategory');\n\t\tRoute::post('addLoanPurposeCategoryItem/', 'microfin\\loan\\MfnPurposeCategoryController@addItem'); \n\t\tRoute::post('reqpurposeCategoryUpdate/', 'microfin\\loan\\MfnPurposeCategoryController@updateRequest'); \n\t\tRoute::post('updatepurposeCategoryItem/', 'microfin\\loan\\MfnPurposeCategoryController@updateItem'); \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: LOANS PURPOSE ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewLoanPurpose/', 'microfin\\loan\\MfnPurposeController@index');\n\t\tRoute::get('addLoanPurpose/', 'microfin\\loan\\MfnPurposeController@addPurpose');\n\t\tRoute::post('addLoanPurposeItem/', 'microfin\\loan\\MfnPurposeController@addItem'); \n\t\tRoute::post('reqLoanPurposeUpdate/', 'microfin\\loan\\MfnPurposeController@updateRequest'); \n\t\tRoute::post('updateLoanPurposeItem/', 'microfin\\loan\\MfnPurposeController@updateItem'); \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: LOANS SUB PURPOSE ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewLoanSubPurpose/', 'microfin\\loan\\MfnSubPurposeController@index');\n\t\tRoute::get('addLoanSubPurpose/', 'microfin\\loan\\MfnSubPurposeController@addSubPurpose');\n\t\tRoute::post('addLoanSubPurposeItem/', 'microfin\\loan\\MfnSubPurposeController@addItem'); \n\t\tRoute::post('reqLoanSubPurposeUpdate/', 'microfin\\loan\\MfnSubPurposeController@updateRequest'); \n\t\tRoute::post('updateLoanSubPurposeItem/', 'microfin\\loan\\MfnSubPurposeController@updateItem'); \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: SETTINGS CATEGORY TYPE ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewSettingsCategoryType/', 'microfin\\settings\\MfnCategoryTypeController@index');\n\t\tRoute::get('addSettingsCategoryType/', 'microfin\\settings\\MfnCategoryTypeController@addSettingsCategoryType');\n\t\tRoute::post('addSettingsCategoryTypeItem/', 'microfin\\settings\\MfnCategoryTypeController@addItem'); \n\t\tRoute::post('reqCategoryTypeUpdate/', 'microfin\\settings\\MfnCategoryTypeController@updateRequest'); \n\t\tRoute::post('updateCategoryTypeItem/', 'microfin\\settings\\MfnCategoryTypeController@updateItem'); \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: LOANS PRODUCT INTEREST RATE ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('addLoanInterestRate/{id}/', 'microfin\\settings\\MfnLoanProductInterestRateController@addInterestRate');\n\t\tRoute::post('addLoanInterestRateItem/', 'microfin\\settings\\MfnLoanProductInterestRateController@addInterestRateItem'); \n\t\t//Route::post('updateLoanProductItem/', 'microfin\\loan\\MfnProductController@updateItem'); \n\t\t//Route::post('deleteLoanProductItem/', 'microfin\\loan\\MfnProductController@deleteItem'); \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: LOAN INTEREST CALCULATION METHOD ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewLoanInterestCalculationMethod/', 'microfin\\loan\\MfnInterestCalculationMethodController@index');\n\t\tRoute::get('addLoanInterestCalculationMethod/', 'microfin\\loan\\MfnInterestCalculationMethodController@addLoanInterestCalculationMethod');\n\t\tRoute::post('addInterestCalculationMethodItem/', 'microfin\\loan\\MfnInterestCalculationMethodController@addItem'); \n\t\tRoute::post('reqInterestCalculationUpdate/', 'microfin\\loan\\MfnInterestCalculationMethodController@updateRequest'); \n\t\tRoute::post('updateInterestCalculationItem/', 'microfin\\loan\\MfnInterestCalculationMethodController@updateItem'); \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: REGULAR LOAN ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewRegularLoan/', 'microfin\\loan\\MfnRegularLoanController@index');  \n\t\tRoute::get('addRegularLoan/', 'microfin\\loan\\MfnRegularLoanController@addRegularLoan'); \n\t\tRoute::post('reqRegularLoanProductOptions/', 'microfin\\loan\\MfnRegularLoanController@loadLoanProductList');\n\t\tRoute::post('reqRegularLoanData/', 'microfin\\loan\\MfnRegularLoanController@loadRegularLoanSupportData');\n\t\tRoute::post('addRegularLoanItem/', 'microfin\\loan\\MfnRegularLoanController@addItem');\n\t\tRoute::get('updateRegularLoan/{id}', 'microfin\\loan\\MfnRegularLoanController@updateRegularLoan'); \n\t\tRoute::post('updateRegularLoanItem/', 'microfin\\loan\\MfnRegularLoanController@updateItem'); \n\t\tRoute::get('detailsRegularLoan/{id}', 'microfin\\loan\\MfnRegularLoanController@detailsRegularLoan');\n\t\tRoute::post('reqNoOfRepaymentOption/', 'microfin\\loan\\MfnRegularLoanController@loadRegularLoanNoOfRepaymentOption');\n\t\tRoute::post('reqRegularLoanDataRepaymentWise/', 'microfin\\loan\\MfnRegularLoanController@loadRegularLoanSupportDataRepaymentWise');\n\t\tRoute::post('deleteRegularLoan/', 'microfin\\loan\\MfnRegularLoanController@deleteItem'); \n\t\t//Route::post('reqMemberCode/', 'microfin\\member\\MfnMemberInformationController@loadMemberCode');\n\t\t//Route::post('reqMandatorySavingsDetails/', 'microfin\\member\\MfnMemberInformationController@loadMandatorySavingsDetails');\n\t\t//Route::post('reqMandatoryTransactionDetails/', 'microfin\\member\\MfnMemberInformationController@mandatorySavingsDetails');\n\t\tRoute::post('reqSamityAndPrimaryProductOptionsForRegularLoan/', 'microfin\\member\\MfnMemberInformationController@loadSamityAndPrimaryProductOptions');\n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: OPENING BALANCE FOR REGULAR LOAN ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth',/*'hasAccess'*/]], function() {\n\n\t\tRoute::get('addOpeningBalanceLoan/', 'microfin\\configuration\\openingBalance\\loan\\MfnLoanOpeningBalanceController@addOpeningBalanceLoan'); \n\t\tRoute::post('loadLoanCodeLoanCycleWise/', 'microfin\\configuration\\openingBalance\\loan\\MfnLoanOpeningBalanceController@generateLoanCodeLoanCycleWise'); \n\t\tRoute::post('addOpeningBalanceLoanItem/', 'microfin\\configuration\\openingBalance\\loan\\MfnLoanOpeningBalanceController@addItem'); \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: ONE TIME LOAN ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewOneTimeLoan/', 'microfin\\loan\\MfnOneTimeLoanController@index');  \n\t\tRoute::get('addOneTimeLoan/', 'microfin\\loan\\MfnOneTimeLoanController@addOneTimeLoan'); \n\t\tRoute::post('reqOneTimeLoanProductOptions/', 'microfin\\loan\\MfnOneTimeLoanController@loadLoanProductList');\n\t\tRoute::post('reqOneTimeLoanData/', 'microfin\\loan\\MfnOneTimeLoanController@loadOneTimeLoanSupportData');\n\t\t//Route::post('reqLoanRepayDate/', 'microfin\\loan\\MfnOneTimeLoanController@loadLoanRepayDate');\n\t\tRoute::post('reqOneLoanDataRepayPeriodWise/', 'microfin\\loan\\MfnOneTimeLoanController@loadOneLoanSupportDataRepayPeriodWise');\n\t\tRoute::post('addOneTimeLoanItem/', 'microfin\\loan\\MfnOneTimeLoanController@addItem');\n\t\tRoute::get('detailsOneTimeLoan/{id}', 'microfin\\loan\\MfnOneTimeLoanController@detailsOneTimeLoan');\n\t\tRoute::post('deleteOneTimeLoan/', 'microfin\\loan\\MfnOneTimeLoanController@deleteItem'); \n\t\t//Route::post('reqMemberCode/', 'microfin\\member\\MfnMemberInformationController@loadMemberCode');\n\t\t//Route::post('reqMandatorySavingsDetails/', 'microfin\\member\\MfnMemberInformationController@loadMandatorySavingsDetails');\n\t\t//Route::post('reqMandatoryTransactionDetails/', 'microfin\\member\\MfnMemberInformationController@mandatorySavingsDetails');\n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: LOAN RESCHEDULE ROUTES\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewLoanSchedule/', 'microfin\\loan\\MfnLoanRescheduleController@index'); \n\t\tRoute::get('regularLoanReschedule/{id}/{installmentSl}', 'microfin\\loan\\MfnLoanRescheduleController@addReschedule');\n\t\tRoute::post('reqRescheduleGenerate/', 'microfin\\loan\\MfnLoanRescheduleController@rescheduleGenerate'); \n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: BRANCH PRODUCT ASSIGN\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('viewBranchProduct/', 'microfin\\configuration\\MfnBranchProductController@index');  \n\t\tRoute::get('addBranchProduct/', 'microfin\\configuration\\MfnBranchProductController@addBranchProduct');\n\t\tRoute::post('addBranchProductItem/', 'microfin\\configuration\\MfnBranchProductController@addItem');\n\t\tRoute::post('reqBranchProductEditSupportData/', 'microfin\\configuration\\MfnBranchProductController@loadBranchProductEditSupportData');\n\t\tRoute::post('updateBranchProduct/', 'microfin\\configuration\\MfnBranchProductController@updateItem');\n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: EMPLOYEE LIST BY KHORSHED\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\t\t\n\t\tRoute::get('posHrEmployeeList/', 'microfin\\employee\\PosHrEmployeeController@index');\n\t\tRoute::get('posAddHrEmployee/', 'microfin\\employee\\PosHrEmployeeController@posAddHrEmployee');\n\t\tRoute::post('preDistricFiltering/', 'microfin\\employee\\PosHrEmployeeController@preDistricFiltering');\n\t\tRoute::post('preUpzillaDataFiltering/', 'microfin\\employee\\PosHrEmployeeController@preUpzillaDataFiltering');\n\t\tRoute::post('preUnionDataFiltering/', 'microfin\\employee\\PosHrEmployeeController@preUnionDataFiltering');\n\t\tRoute::post('projectTypeFiltering/', 'microfin\\employee\\PosHrEmployeeController@projectTypeFiltering');\n\t\tRoute::post('storeEmployeeItem/', 'microfin\\employee\\PosHrEmployeeController@addItem');\n\t\tRoute::post('employeeGetInfo/', 'microfin\\employee\\PosHrEmployeeController@employeeGetInfo');\n\t\tRoute::post('updateHrEployeeInfo/', 'microfin\\employee\\PosHrEmployeeController@updateHrEployeeInfo');\n\t\tRoute::post('hrDeleteEmployee/', 'microfin\\employee\\PosHrEmployeeController@hrDeleteEmployee');\n\t\tRoute::get('hrDetailsEmployee/{employeeId}', 'microfin\\employee\\PosHrEmployeeController@hrDetailsEmployee');\n\t\tRoute::post('branchFilteringByProject/', 'microfin\\employee\\PosHrEmployeeController@branchFilteringByProject');\n\t});\n\n\t/*\n\t|--------------------------------------------------------------------------\n\t| MICRO FINANCE: REPORT\n\t|--------------------------------------------------------------------------\n\t*/\n\tRoute::group(['middleware' => ['auth','hasAccess']], function() {\n\n\t\tRoute::get('dailyRecoverableReportMemberWise/', 'microfin\\reports\\dailyRecoverableReportMemberWise\\dailyRecoverableReportMemberWiseController@index');  \n\t\tRoute::post('reqFieldOfficerOption/', 'microfin\\reports\\dailyRecoverableReportMemberWise\\dailyRecoverableReportMemberWiseController@loadFieldOfficerOption');  \n\t\tRoute::post('reqSamityOption/', 'microfin\\reports\\dailyRecoverableReportMemberWise\\dailyRecoverableReportMemberWiseController@loadSamityOption');  \n\t\tRoute::post('reqPrimaryProductOption/', 'microfin\\reports\\dailyRecoverableReportMemberWise\\dailyRecoverableReportMemberWiseController@loadPrimaryProductOption');  \n\t\tRoute::get('reqReport/', 'microfin\\reports\\dailyRecoverableReportMemberWise\\dailyRecoverableReportMemberWiseController@loadReport');  \n\t});\n\n\ninclude 'mfn_savings.php';\ninclude 'mfn_setting_holiday.php';\ninclude 'mfn_process.php';\ninclude 'mfn_mizan.php';\ninclude 'mfnReport.php';\ninclude 'mfnPksfPomisReport.php';\ninclude 'mraReport.php';\ninclude 'mfn_searching.php';\n",
			"file": "//120.50.0.141/erp/routes/microfin.php",
			"file_size": 29507,
			"file_write_time": 131690198742841017,
			"settings":
			{
				"buffer_size": 29506,
				"line_ending": "Unix"
			}
		},
		{
			"contents": "<?php\n\n\tnamespace App\\Http\\Controllers\\microfin\\loan;\n\n\tuse Illuminate\\Http\\Request;\n\tuse App\\Http\\Requests;\n\tuse App\\microfin\\loan\\MfnLoan;\n\tuse App\\microfin\\loan\\MfnProduct;\n\tuse App\\microfin\\loan\\MfnLoanSchedule;\n\tuse App\\microfin\\loan\\MfnLoanReschedule;\n\tuse App\\microfin\\loan\\MfnGracePeriod;\n\tuse App\\microfin\\loan\\MfnFees;\n\tuse App\\microfin\\settings\\MfnLoanProductInterestRate;\n\tuse App\\microfin\\configuration\\openingBalance\\MfnloanOpeningBalance;\n\tuse Session;\n\tuse Validator;\n\tuse Response;\n\tuse DB;\n\t\tuse Carbon\\Carbon;\n\tuse Illuminate\\Support\\Facades\\Input;\n\tuse Illuminate\\Support\\Facades\\Hash;\n\tuse Illuminate\\Support\\Facades\\Auth;\n\tuse App\\Http\\Controllers\\Controller;\n\tuse App\\Traits\\GetSoftwareDate;\n\tuse App\\Http\\Controllers\\microfin\\MicroFinance;\n\n\tclass MfnRegularLoanController extends Controller {\n\n\t\tprotected $MicroFinance;\n\t\t\n\t\tuse GetSoftwareDate;\n\n\t\tpublic function __construct() {\n\n\t\t\t$this->MicroFinance = New MicroFinance;\n\n\t\t\t$this->TCN = array(\n\t\t\t\tarray('SL No.', 50), \n\t\t\t\tarray('Loan Code', 0),\n\t\t\t\tarray('Member Code', 100),\n\t\t\t\tarray('Member Name', 0),\n\t\t\t\tarray('Loan Amount', 80),\n\t\t\t\tarray('Total Repay Amount', 100),\n\t\t\t\tarray('Int. Rate', 80),\n\t\t\t\tarray('Disburse Date', 90),\n\t\t\t\tarray('First Repay Date', 100),\n\t\t\t\tarray('NOI', 50),\n\t\t\t\tarray('Auth. Status', 70),\n\t\t\t\tarray('Loan Status', 70),\n\t\t\t\tarray('Entry By', 0),\n\t\t\t\tarray('Action', 80)\n\t\t\t);\t\n\t\t}\n\n\t\t/*\n\t\t|--------------------------------------------------------------------------\n\t\t| MICRO FINANCE: LIST OF REGULAR LOAN.\n\t\t|--------------------------------------------------------------------------\n\t\t*/\n\t\tpublic function index(Request $req) {\n\n\t\t\t$PAGE_SIZE = 20;\n\t\t\t\n\n\t\t\tif(Auth::user()->branchId==1):\n\t\t\t\t$samity = [];\n\t\t\t\t$primaryProduct = $this->MicroFinance->getLoanProductsOption();\n\t\t\t\t$loan = MfnLoan::active()->regularLoan();\n\t\t\telse:\n\t\t\t\t$samity = $this->MicroFinance->getBranchWiseSamityOptions(Auth::user()->branchId);\n\t\t\t\t$primaryProduct = $this->MicroFinance->getBranchWiseActiveLoanPrimaryProductOptions(Auth::user()->branchId); \n\t\t\t\t$loan = MfnLoan::active()->branchWise()->regularLoan();\n\t\t\tendif;\n\t\t\t\n\t\t\tif($req->has('branchId')) {\n\t\t\t    $loan->where('branchIdFk', $req->get('branchId'));\n\t\t\t\t$samity = $this->MicroFinance->getBranchWiseSamityOptions($req->get('branchId'));\n\t\t\t\t$primaryProduct = $this->MicroFinance->getBranchWiseActiveLoanPrimaryProductOptions($req->get('branchId')); \n\t\t\t}\n\n\t\t\tif($req->has('samityId'))\n\t\t\t    $loan->where('samityIdFk', $req->get('samityId'));\n\t\t\t\n\t\t\tif($req->has('primaryProductId'))\n\t\t\t    $loan->where('productIdFk', $req->get('primaryProductId'));\n\t\t\t\n\t\t\tif($req->has('dateFrom'))\n\t\t\t    $loan->where('disbursementDate', '>=', $this->MicroFinance->getDBDateFormat($req->get('dateFrom')));\n\t\t\t\n\t\t\tif($req->has('dateTo'))\n\t\t\t\t$loan->where('disbursementDate', '<=', $this->MicroFinance->getDBDateFormat($req->get('dateTo')));\n\n\t\t\tif($req->has('loanFrom'))\n\t\t\t    $loan->where('loanAmount', '>=', $req->get('loanFrom'));\n\t\t\t\n\t\t\tif($req->has('loanTo'))\n\t\t\t\t$loan->where('loanAmount', '<=', $req->get('loanTo'));\n\n\t\t\tif($req->has('noi'))\n\t\t\t\t$loan->where('repaymentNo', '=', $req->get('noi'));\n\n\t\t\tif($req->has('loanCode'))\n\t\t\t\t$loan->where('loanCode', 'LIKE', '%' . $req->get('loanCode') . '%');\n\n\t\t\tif($req->has('page'))\n\t\t\t\t$SL = $req->get('page') * $PAGE_SIZE - $PAGE_SIZE;\n\n\t\t\tif($req->has('branchId') || $req->has('samityId') || $req->has('primaryProductId') || $req->has('name') || $req->has('dateFrom') || $req->has('dateTo') || $req->has('loanFrom') || $req->has('loanTo') || $req->has('noi') || $req->has('loanCode')) {\n\t\t\t\t$loan = $loan->get();\n\t\t\t\t$isSearch = 1;\n\t\t\t} else {\n\t\t\t\t$loan = $loan->paginate($PAGE_SIZE);\n\t\t\t\t$isSearch = 0;\n\t\t\t}\n\t\t\t\n\t\t\t//$loan = $loan->paginate($PAGE_SIZE);\n\n\t\t\t$damageData = array(\n\t\t\t\t'TCN'               =>  $this->TCN,\n\t\t\t\t'SL' \t   \t\t    =>  $req->has('page')?$SL:0,\n\t\t\t\t'isSearch'          =>  $isSearch,\n\t\t\t\t'branch'  \t\t    =>  $this->MicroFinance->getAllBranchOptions(),\n\t\t\t\t'samity'\t\t    =>  $samity,\n\t\t\t\t'primaryProduct'    =>  $primaryProduct,\n\t\t\t\t'regularLoans'      =>  $loan,\n\t\t\t\t'dataNotAvailable'\t=>\t$this->MicroFinance->dataNotAvailable(),\n\t\t\t\t'MicroFinance'      =>  $this->MicroFinance\n\t\t\t);\n\n\t\t\treturn view('microfin.loan.regularLoan.viewRegularLoan', ['damageData' => $damageData]);\n\t\t}\n\n\t\t/*\n\t\t|--------------------------------------------------------------------------\n\t\t| MICRO FINANCE: SHOW REGULAR LOAN FORM.\n\t\t|--------------------------------------------------------------------------\n\t\t*/\n\t\tpublic function addRegularLoan() {\n\n\t\t\t$damageData = array(\n\t\t\t\t'member'  \t\t\t  =>  $this->MicroFinance->getMemberOptionsForLoan(Auth::user()->branchId),\n\t\t\t\t//'disbursementDate'    =>  Carbon::parse('2017-12-27')->toDateString(),\n\t\t\t\t//'disbursementDate'    =>  Carbon::today()->toDateString(),\n\t\t\t\t'disbursementDate'    =>  GetSoftwareDate::getSoftwareDate(),\n\t\t\t\t'paymentType'         =>  $this->MicroFinance->getPaymentType(),\n\t\t\t\t'loanPurpose'         =>  $this->MicroFinance->getLoanPurpose(),\n\t\t\t\t'boolean'  \t\t\t  =>  $this->MicroFinance->getBooleanOptions(),\n\t\t\t\t\n\t\t\t);\n\n\t\t\treturn view('microfin.loan.regularLoan.addRegularLoan', ['damageData' => $damageData]);\n\t\t}\n\n\t\tpublic function loadLoanProductList(Request $req) {\n\n\t\t\t$totalRegularLoanOfMember = MfnLoan::where('memberIdFk', $req->memberId)->regularLoan()->count();\n\t\t\t$checkRegularLoanCompleted = MfnLoan::where('memberIdFk', $req->memberId)->regularLoan()->loanCompleted()->count();\n\t\t\t$newRegularLoan = MfnLoan::where('memberIdFk', $req->memberId)->regularLoan()->count();\n\n\t\t\tif(($totalRegularLoanOfMember==$checkRegularLoanCompleted) || $newRegularLoan==0):\n\t\t\t\t$loanProduct = $this->MicroFinance->getActiveLoanPrimaryProductOptionsMemberWise($req->memberId);\n\t\t\telse:\n\t\t\t\t$loanProduct = array();\n\t\t\tendif;\n\n\t\t\t//\tGET MEMBER ADMISSION DATE.\n\t\t\t$memberOB = DB::table('mfn_member_information')->where('id', $req->memberId)->select('admissionDate')->first();\n\n\t\t\t$data = array(\n\t\t\t\t'loanProduct'  \t\t   =>  $loanProduct,\n\t\t\t\t'memberAdmissionDate'  =>  $memberOB->admissionDate,\n\t\t\t\t'softwareDate' \t\t   =>  GetSoftwareDate::getSoftwareDate()\n\t\t\t);\n\t\t\t\n\t\t\treturn response::json($data); \n\t\t}\n\n\t\tpublic function loadRegularLoanSupportData(Request $req) {\n\n\t\t\t$getMemberCode = $this->MicroFinance->getSingleValueForId($table='mfn_member_information', $req->memberId, 'code');\n\t\t\t$regularLoanShortName = $this->MicroFinance->getSingleValueForId($table='mfn_loans_product', $req->id, 'shortName');\n\t\t\t$regularLoanSLNum = $this->MicroFinance->getRegularLoanSLNum($req->memberId, $req->id);\n\t\t\t$newLoanCycle = $this->MicroFinance->getNewRegularLloanCycle($req->memberId, $req->id);\n\n\t\t\t//\tGENERATE LOAN CODE.\n\t\t\t//$loanCode = $regularLoanShortName . '.' . $getMemberCode . '.' . $regularLoanSLNum;\n\t\t\t$loanCode = $regularLoanShortName . '.' . $getMemberCode . '.' . $newLoanCycle;\n\t\t\t\n\t\t\t//\tGET SAMITY DAY ID OF THE SAMITY OF THE MEMBER.\n\t\t\t$samityDayIdOB = DB::table('mfn_member_information')\n\t\t\t\t\t\t\t   ->join('mfn_samity', 'mfn_member_information.samityId', '=', 'mfn_samity.id')\n\t\t\t\t\t\t\t   ->where('mfn_member_information.id', $req->memberId)\n\t\t\t\t\t\t\t   ->select('mfn_samity.samityDayId AS samityDayId')\n\t\t\t\t\t\t\t   ->first();\n\n\t\t\t$samityDayId = $samityDayIdOB->samityDayId;\n\n\t\t\t$loanProductOB = MfnProduct::where('id', $req->id)\n\t\t\t                           ->select('avgLoanAmount',\n\t\t\t                           \t\t\t'maxLoanAmount',\n\t\t\t                           \t\t\t'minLoanAmount', \n                                                'installmentNum', \n                                                'eligibleRepaymentFrequencyId', \n                                                'additionalFee', \n                                                'formFee', \n                                                'principalAmountOfLoan'\n                                               )\n\t\t\t                           ->first();\n\n\t\t\t//\tGET ELIGIBLE REPAYMENT FREQUENCY ARRAY.\n\t\t\t$eligibleRepaymentFrequencyArr = $this->MicroFinance->getRepaymentFrequencyArr($table='mfn_repayment_frequency', $loanProductOB->eligibleRepaymentFrequencyId);\n\n\t\t\t//\tGET LOAN REPAY PERIOD OPTIONS.\n\t\t\t$loanRepayPeriodOption = $this->MicroFinance->getLoanRepayPeriod();\n\n\t\t\t//\tLOAN REPAY PERIOD FOR WEEKLY REPAYMENT FREQUENCY.\n\t\t\t$loanRepayPeriod = [];\n\t\t\t\n\t\t\tforeach($loanRepayPeriodOption as $key => $val):\n\t\t\t\t//\tFOR WEEKLY REPAYMENT FREQUENCY.\n\t\t\t\tif($eligibleRepaymentFrequencyArr[0]==1):\n\t\t\t\t\tif($key==1):\n\t\t\t\t\t\t$loanRepayPeriod[$key] = $val;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tendif;\n\t\t\t\tendif;\n\n\t\t\t\t//\tFOR MONTHLY REPAYMENT FREQUENCY.\n\t\t\t\tif($eligibleRepaymentFrequencyArr[0]==2):\n\t\t\t\t\tif($key>=1 && $key<=3):\n\t\t\t\t\t\t$loanRepayPeriod[$key] = $val;\n\t\t\t\t\tendif;\n\t\t\t\tendif;\n\n\t\t\t\tif($key==1):\n\t\t\t\t\t$loanRepayPeriod[$key] = $val;\n\t\t\t\tendif;\n\t\t\tendforeach;\n\n\t\t\t//\tFIRST REPAYMENT DATE CALCULATION.\n\t\t\t$gracePeriodArr = $this->MicroFinance->getArrayForSecondMultipleId($table='mfn_grace_period', $loanProductOB->eligibleRepaymentFrequencyId, 'inDays');                           \n\t\t\t\n\t\t\t//\tGET DISBURSEMENT DATE.\n\t\t\t$dt = Carbon::parse($req->disbursementDate);\n\t\t\t\n\t\t\t//\tGET NEXT SAMITY DATE FROM THE DISBURSEMENT DATE.\n\t\t\t$nextSamityDate = $this->MicroFinance->getNextSamityDate($dt->toDateString(), $samityDayId);\n\n\t\t\t//\tGET FIRST REPAY DATE.\n\t\t\t$NSD = Carbon::parse($nextSamityDate);\n\t\t\t$firstRepayDate = $NSD->addDays($gracePeriodArr[$eligibleRepaymentFrequencyArr[0]])->toDateString();\n\t\t\t//$firstRepayDate = $NSD->toDateString();\n\n\t\t\t//\tMANUFACTURING NO OF REPAYMENT OPTIONS.\n\t\t\t$repaymentNo = explode(',', $loanProductOB->installmentNum);\n\n\t\t\t$repaymentNoOptions = [];\n\n\t\t\tforeach($repaymentNo as $key => $val):\n\t\t\t\t$repaymentNoOptions[$val] = $val;\n\t\t\tendforeach;\n\n\t\t\t//\tMANUFACTURING NO OF PAYMENT OPTIONS FOR WEEKLY FREQUENCY.\n\t\t\t//\tBUT FOR MONTHLY FREQUENCY THE BELOW LINE WILL ACTIVE.\n\t\t\tif($eligibleRepaymentFrequencyArr[0]!=2):\n\t\t\t\tunset($repaymentNoOptions[12]);\n\t\t\tendif;\n\t\t\t\n\t\t\tunset($repaymentNoOptions[24]);\n\t\t\tunset($repaymentNoOptions[36]);\n\n\t\t\t//\tSTART FIND INTEREST RATE INDEX OF THE REPAYMENT NO.\n\t\t\t$i = 0;\n\t\t\tforeach($repaymentNoOptions as $key => $val):\n\t\t\t\tif($i==0)\n\t\t\t\t\t$installmentNum = $val;\n\t\t\t\t$i++;\n\t\t\tendforeach;\n\n\t\t\t$supportData = $this->MicroFinance->regularLoanSupportDataRepaymentNumberWise($req->id, $loanProductOB->avgLoanAmount, $installmentNum, $eligibleRepaymentFrequencyArr[0]);\n\n\t\t\t$data = array(\n\t\t\t\t'loanProduct' \t \t\t\t=>  $this->MicroFinance->getActiveLoanPrimaryProductOptions(),\n\t\t\t\t'repaymentFrequencyOption'  =>  $this->MicroFinance->getRepaymentFrequencyOptionsProductWise($table='mfn_repayment_frequency', $loanProductOB->eligibleRepaymentFrequencyId),\n\t\t\t\t'repaymentFrequency'   \t\t=>  $eligibleRepaymentFrequencyArr[0],\n\t\t\t\t'loanCode'    \t \t\t\t=>  $loanCode,\n\t\t\t\t'loanRepayPeriod'\t\t \t=>  $loanRepayPeriod,\n\t\t\t\t//'loanCycle'   \t \t\t\t=>  $regularLoanSLNum,\n\t\t\t\t'loanCycle'   \t \t\t\t=>  $newLoanCycle,\n\t\t\t\t'firstRepayDate'   \t \t\t=>  $firstRepayDate,\n\t\t\t\t'loanAmount'   \t \t\t\t=>  sprintf(\"%.2f\", $loanProductOB->avgLoanAmount),\n\t\t\t\t'maxLoanAmount'   \t \t\t=>  sprintf(\"%.2f\", $loanProductOB->maxLoanAmount),\n\t\t\t\t'minLoanAmount'   \t \t\t=>  sprintf(\"%.2f\", $loanProductOB->minLoanAmount),\n\t\t\t\t'repaymentNo'   \t \t\t=>  $repaymentNoOptions, \n\t\t\t\t'additionalFee'  \t\t\t=>  sprintf(\"%.2f\", $loanProductOB->additionalFee),\n\t\t\t\t'formFee'  \t\t\t \t\t=>  sprintf(\"%.2f\", $loanProductOB->formFee),\n\t\t\t\t'nextSamityDate'\t\t\t=>  $nextSamityDate,\n\t\t\t\t'principalAmountOfLoan'     =>  $loanProductOB->principalAmountOfLoan,\n\t\t\t\t'gracePeriodArr'\t\t\t=>  $gracePeriodArr,\n\t\t\t\t'supportData'  \t\t\t\t=>  $supportData,\n\t\t\t);\n\t\t\t\n\t\t\treturn response::json($data); \n\t\t}\n\n\t\tpublic function loadRegularLoanNoOfRepaymentOption(Request $req) {\n\n\t\t\t$noOfRepaymentOB = MfnProduct::where('id', $req->productId)->select('installmentNum')->first();\n\t\t\t$noOfRepaymentArr = explode(',', $noOfRepaymentOB->installmentNum);\n\n\t\t\t$noOfRepayment = [];\n\n\t\t\tforeach($noOfRepaymentArr as $key => $val):\n\t\t\t\t$noOfRepayment[$val] = $val;\n\t\t\tendforeach;\n\n\t\t\t//\tMANUFACTURING NO OF PAYMENT OPTIONS FOR WEEKLY FREQUENCY.\n\t\t\tif($req->repaymentFrequencyId==1):\n\t\t\t\tunset($noOfRepayment[12]);\n\t\t\t\tunset($noOfRepayment[24]);\n\t\t\t\tunset($noOfRepayment[36]);\n\t\t\tendif;\n\n\t\t\t//\tMANUFACTURING NO OF PAYMENT OPTIONS FOR MONTHLY FREQUENCY.\n\t\t\tif($req->repaymentFrequencyId==2):\n\t\t\t\t$noOfRepayment = []; \n\t\t\tendif;\n\n\t\t\t//\tGET FIRST REPAY DATE.\n\t\t\t$firstRepayDate = $this->MicroFinance->getRegularLoanFirstRepayDate($req->memberId, $req->disbursementDate, $req->productId, $req->repaymentFrequencyId);\n\t\t\t\n\t\t\t//\tGET LOAN REPAY PERIOD OPTIONS.\n\t\t\t$loanRepayPeriodOption = $this->MicroFinance->getLoanRepayPeriod();\n\n\t\t\t//\tLOAN REPAY PERIOD.\n\t\t\t$loanRepayPeriod = [];\n\t\t\t\n\t\t\t//\tLOAN REPAY PERIOD FOR WEEKLY REPAYMENT FREQUENCY.\n\t\t\tif($req->repaymentFrequencyId==1):\n\t\t\t\tforeach($loanRepayPeriodOption as $key => $val):\n\t\t\t\t\tif($key==1):\n\t\t\t\t\t\t$loanRepayPeriod[$key] = $val;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tendif;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\n\t\t\t//\tLOAN REPAY PERIOD FOR MONTHLY REPAYMENT FREQUENCY.\n\t\t\tif($req->repaymentFrequencyId==2):\n\t\t\t\tforeach($loanRepayPeriodOption as $key => $val):\n\t\t\t\t\tif($key>=1 && $key<=3):\n\t\t\t\t\t\t$loanRepayPeriod[$key] = $val;\n\t\t\t\t\tendif;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\t\t\t\n\t\t\t$data = array(\n\t\t\t\t'loanRepayPeriod'  =>  $loanRepayPeriod,\n\t\t\t\t'firstRepayDate'   =>  $firstRepayDate,\n\t\t\t\t'noOfRepayment'    =>  $noOfRepayment\n\t\t\t);\n\n\t\t\treturn response::json($data); \n\t\t}\n\n\t\tpublic function loadRegularLoanSupportDataRepaymentWise(Request $req) {\n\n\t\t\t$noOfRepaymentOB = MfnProduct::where('id', $req->productId)->select('installmentNum')->first();\n\t\t\t$noOfRepaymentArr = explode(',', $noOfRepaymentOB->installmentNum);\n\n\t\t\t$noOfRepayment = [];\n\n\t\t\t//\tLOAN REPAY PERIOD IN MONTH.\n\t\t\t$loanRepayPeriod = [\n\t\t\t\t1  =>  12,\n\t\t\t\t2  =>  24,\n\t\t\t\t3  =>  36\n\t\t\t];\n\n\t\t\t//\tGET NO. OF REPAYMENT FOR WEEKLY REPAYMENT FREQUENCY.\n\t\t\tif($req->repaymentFrequencyId==1):\n\t\t\t\t$noOfRepayment[$req->repaymentNo] = $req->repaymentNo;\n\t\t\tendif;\n\t\t\t\n\t\t\t//\tGET NO. OF REPAYMENT FOR MONTHLY REPAYMENT FREQUENCY.\n\t\t\tif($req->repaymentFrequencyId==2):\n\t\t\t\t$noOfRepayment[$loanRepayPeriod[$req->loanRepayPeriodId]] = $loanRepayPeriod[$req->loanRepayPeriodId];\n\t\t\t\t$req->repaymentNo = $loanRepayPeriod[$req->loanRepayPeriodId];\n\t\t\tendif;\n\n\t\t\t$supportData = $this->MicroFinance->regularLoanSupportDataRepaymentNumberWise($req->productId, $req->loanAmount, $req->repaymentNo, $req->repaymentFrequencyId);\n\n\t\t\tif(is_object($supportData)):\n\t\t\t\t$data = array(\n\t\t\t\t\t'repaymentNo'  =>  $noOfRepayment,\n\t\t\t\t\t'supportData'  =>  $supportData,\n\t\t\t\t);\n\t\t\telse:\n\t\t\t\t$data = array(\n\t\t\t\t\t'msgStatus'      =>  1, \n\t\t\t\t\t'responseTitle'  =>  MicroFinance::getMessage('msgWarning'),\n\t\t\t\t\t'responseText'   =>  MicroFinance::getMessage('productInterestRateWarning'), \n\t\t\t\t);\n\t\t\tendif;\n\n\t\t\treturn response::json($data); \n\t\t}\n\n\t\t/*\n\t\t|--------------------------------------------------------------------------\n\t\t| MICRO FINANCE: ADD REGULAR LOAN.\n\t\t|--------------------------------------------------------------------------\n\t\t*/\n\t\tpublic function addItem(Request $req) {\n\n\t\t\t$rules = array(\n\t\t\t\t'memberIdFk'  \t\t\t\t =>  'required', \n\t\t\t\t'disbursementDate'  \t\t =>  'required', \n\t\t\t\t'productIdFk' \t \t\t\t =>  'required', \n\t\t\t\t'loanCode'\t\t   \t\t\t =>  'required|unique:mfn_loan,loanCode', \n\t\t\t\t'repaymentFrequencyIdFk'  \t =>  'required', \n\t\t\t\t'loanRepayPeriodIdFk'  \t  \t =>  'required', \n\t\t\t\t'firstRepayDate'  \t\t  \t =>  'required', \n\t\t\t\t'loanAmount'  \t\t\t  \t =>  'required', \n\t\t\t\t'repaymentNo'  \t\t\t  \t =>  'required', \n\t\t\t\t'loanSubPurposeIdFk'  \t\t =>  'required',  \n\t\t\t\t'interestMode'  \t\t     =>  'required', \n\t\t\t\t'interestCalculationMethod'  =>  'required', \n\t\t\t\t'interestRate'  \t\t\t =>  'required',    \n\t\t\t\t'totalRepayAmount'  \t\t =>  'required', \n\t\t\t\t'installmentAmount'  \t\t =>  'required', \n\t\t\t);\n\n\t\t\t$attributesNames = array(\n\t\t\t\t'loanCode'  =>\t'loan code',\n\t\t\t);\n\n\t\t\t$validator = Validator::make(Input::all(), $rules);\n\t\t\t$validator->setAttributeNames($attributesNames);\n\n\t\t\tif($validator->fails()) \n\t\t\t\treturn response::json(array('errors' => $validator->getMessageBag()->toArray()));\n\t\t\telse {\n\t\t\t\t$now = Carbon::now();\n\t\t\t\t$req->request->add(['createdDate' => $now]);\n\t\t\t\t$req->request->add(['entryBy' => Auth::user()->emp_id_fk]);\n\n\t\t\t\t//\tFOR REGULAR LOAN loanTypeId = 1\n\t\t\t\t$req->request->add(['loanTypeId' => 1]);\n\n\t\t\t\t//\tWHEN PAYMENT TYPE IS CASH, THEN SET CASH IN HAND LEDGER ID.\n\t\t\t\tif($req->paymentTypeIdFk=='Cash'):\n\t\t\t\t\t$cashLedgerId = DB::table('acc_account_ledger')->where('accountTypeId', 4)->where('isGroupHead', 0)->select('id')->first();\n\t\t\t\t\t$req->request->add(['ledgerId' => $cashLedgerId->id]);\n\t\t\t\tendif;\n\t\t\t\t\t\n\t\t\t\t//\tGET SAMITY ID OF THE MEMBER.\n\t\t\t\t$samityIdOB = DB::table('mfn_member_information')->where('id', $req->memberIdFk)->select('samityId', 'primaryProductId')->first();\n\t\t\t\t$req->request->add(['samityIdFk' => $samityIdOB->samityId]);\n\t\t\t\t$req->request->add(['primaryProductIdFk' => $samityIdOB->primaryProductId]);\n\t\t\t\t\n\t\t\t\t//  GET INTEREST RATE INDEX.\n\t\t\t\t$interestRateIndexOB = MfnLoanProductInterestRate::where('loanProductId', $req->productIdFk)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ->where('installmentNum', $req->repaymentNo)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ->select('interestRateIndex')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ->first();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t$req->request->add(['interestRateIndex' => $interestRateIndexOB->interestRateIndex]);\n\n\t\t\t\t//\tGET INSURANCE AMOUNT PERCENTAGE OF LOAN AMOUNT.\n\t\t\t\t$loanProductOB = MfnProduct::where('id', $req->productIdFk)\n\t\t\t\t                           ->select('principalAmountOfLoan')\n\t\t\t\t                           ->first();\n\n\t\t\t\t$req->request->add(['insuranceAmount' => $req->loanAmount * ($loanProductOB->principalAmountOfLoan / 100)]);\n\t\t\t\t$req->request->add(['branchIdFk' => Auth::user()->branchId]);\n\t\t\t\t$create = MfnLoan::create($req->all());\n\n\t\t\t\t$repaymentFrequencyWiseRepayDate = [\n\t\t\t\t\t'1'\t =>  7,\n\t\t\t\t\t'2'  =>  30\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\t//\tGET HOLIDAY.\n\t\t\t\t$globalGovtHoliday = $this->MicroFinance->getGlobalGovtHoliday();\n\t\t\t\t$organizationHoliday = $this->MicroFinance->getOrganizationHoliday(1);\n\t\t\t\t$branchHoliday = $this->MicroFinance->getBranchHoliday();\n\t\t\t\t$samityHoliday = $this->MicroFinance->getSamityHoliday($req->memberIdFk);\n\t\t\t\t$holiday = array_unique(array_merge($globalGovtHoliday, $organizationHoliday, $branchHoliday, $samityHoliday));\n\t\t\t\t\n\t\t\t\t$holidayFound = 0;\n\t\t\t\t$scheduleDateArr = [];\n\t\t\t\t$test = [];\n\n\t\t\t\t//for($i=0;$i<$req->repaymentNo;$i++):\n\t\t\t\tfor($i=0;$i<1000;$i++):\n\t\t\t\t\t$dayDiff = ($repaymentFrequencyWiseRepayDate[$req->repaymentFrequencyIdFk] * $i) . 'days'; \n\t\t\t\t\t$date = date_create($req->firstRepayDate);\n\t\t\t\t\tdate_add($date, date_interval_create_from_date_string($dayDiff));\n\t\t\t\t\t\n\t\t\t\t\t//\tPROPAGATE SCHEDULE DATE FOR WEEKLY FREQUENCY.\n\t\t\t\t\tif($req->repaymentFrequencyIdFk==1):\n\t\t\t\t\t\t//\tCHECK IF A DATE IS MATCHES TO HOLIDAY.\n\t\t\t\t\t\tforeach($holiday as $key => $val):\n\t\t\t\t\t\t\tif(date_create($val)>=$date):\n\t\t\t\t\t\t\t\tif(date_create($val)==$date):\n\t\t\t\t\t\t\t\t\t$holidayFound = 1;\n\t\t\t\t\t\t\t\t\t$test[] = $val;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\tendforeach;\n\n\t\t\t\t\t\tif($holidayFound==0)\n\t\t\t\t\t\t\t$scheduleDateArr[] = date_format($date, \"Y-m-d\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t$holidayFound = 0;\n\t\t\t\t\tendif;\n\t\t\t\t\t\n\t\t\t\t\t//\tPROPAGATE SCHEDULE DATE FOR MONTHLY FREQUENCY.\n\t\t\t\t\tif($req->repaymentFrequencyIdFk==2):\n\t\t\t\t\t\t$dayDiff = ($repaymentFrequencyWiseRepayDate[$req->repaymentFrequencyIdFk] * $i) . 'days'; \n\t\t\t\t\t\t$date = date_create($req->firstRepayDate);\n\t\t\t\t\t\tdate_add($date, date_interval_create_from_date_string($dayDiff));\n\t\t\t\t\t\t$disbursementDate = date_create($req->disbursementDate);\n\t\t\t\t\t\tdate_add($disbursementDate, date_interval_create_from_date_string($dayDiff));\n\n\t\t\t\t\t\t$tos = Carbon::parse($req->firstRepayDate);\n\t\t\t\t\t\t$sot = $tos->addMonths($i)->toDateString();\n\n\t\t\t\t\t\tif($i==0)\n\t\t\t\t\t\t\t$targetDate = date_format($date, \"Y-m-d\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$targetDate = $this->MicroFinance->getMonthlyLoanScheduleDateFilter($sot, $req->memberIdFk);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$originalMD = Carbon::parse($targetDate);\n\t\t\t\t\t\t$MD = Carbon::parse($targetDate);\n\t\t\t\t\t\t$targetDate = $MD->toDateString();\n\n\t\t\t\t\t\t//\tCHECK IF A DATE IS MATCHES TO HOLIDAY, THEN SAMITY DATE SET TO NEXT WEEK.\n\t\t\t\t\t\tfor($j=0;$j<100;$j++):\n\t\t\t\t\t\t\tif(in_array($targetDate, $holiday)):\n\t\t\t\t\t\t\t\t$targetDate = $MD->addDays(7)->toDateString();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($targetDate>$originalMD->endOfMonth()):\n\t\t\t\t\t\t\t\t\t$targetDate = $MD->subDays(14)->toDateString();\n\t\t\t\t\t\t\t\telse:\n\t\t\t\t\t\t\t\t\tif(in_array($targetDate, $holiday)):\n\t\t\t\t\t\t\t\t\t\t$targetDate = $MD->addDays(7)->toDateString();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif($targetDate>$originalMD->endOfMonth()):\n\t\t\t\t\t\t\t\t\t\t\t$targetDate = $MD->subDays(21)->toDateString();\n\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\telse:\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\telse:\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\tendfor;\n\n\t\t\t\t\t\t$scheduleDateArr[] = $targetDate;\n\t\t\t\t\tendif;\n\n\t\t\t\t\tif(count($scheduleDateArr)==$req->repaymentNo)\n\t\t\t\t\t\tbreak;\n\t\t\t\tendfor;\n\n\t\t\t\t//\tCALCULATING PRINCIPAL AMOUNT AND INTEREST AMOUNT.\n\t\t\t\t$principalAmount = $req->installmentAmount / $interestRateIndexOB->interestRateIndex;\n\t\t\t\t$interestAmount = $req->installmentAmount - $principalAmount;\n\t\t\t\t\n\t\t\t\t//\tGET LOAN ID.\n\t\t\t\t$loanIdOB = DB::table('mfn_loan')->where('loanCode', $req->loanCode)->select('id')->first();\n\n\t\t\t\t//\tGENERATE LOAN SCHEDULE.\n\t\t\t\tfor($i=0;$i<$req->repaymentNo;$i++):\n\t\n\t\t\t\t\t$req->request->add(['loanIdFk' => $loanIdOB->id]);\n\t\t\t\t\t$req->request->add(['installmentSl' => $i+1]);\n\n\t\t\t\t\tif($i==$req->repaymentNo-1):\n\t\t\t\t\t\t//\tCALCULATING PRINCIPAL AMOUNT AND INTEREST AMOUNT FOR LAST INSTALLMENT.\n\t\t\t\t\t\t$installmentAmount = $req->totalRepayAmount-($req->installmentAmount*($req->repaymentNo-1));\n\t\t\t\t\t\t$principalAmount = $installmentAmount / $interestRateIndexOB->interestRateIndex;\n\t\t\t\t\t\t$interestAmount = $installmentAmount - $principalAmount;\n\t\t\t\t\t\t$req->request->add(['installmentAmount' => sprintf(\"%.2f\", $installmentAmount)]);\n\t\t\t\t\t\t$req->request->add(['actualInstallmentAmount' => sprintf(\"%.2f\", 0)]);\n\t\t\t\t\t\t$req->request->add(['extraInstallmentAmount' => sprintf(\"%.2f\", 0)]);\n\t\t\t\t\tendif;\n\n\t\t\t\t\t$req->request->add(['principalAmount' => sprintf(\"%.2f\", $principalAmount)]);\t\n\t\t\t\t\t$req->request->add(['interestAmount' => sprintf(\"%.2f\", $interestAmount)]);\n\t\t\t\t\t$req->request->add(['scheduleDate' => $scheduleDateArr[$i]]);\n\t\t\t\t\t$create = MfnLoanSchedule::create($req->all());\n\t\t\t\tendfor;\n\n\t\t\t\t// UPDATE LAST INSTALLMENT DATE IN LOAN TABLE.\n\t\t\t\tMfnLoan::where('id', $loanIdOB->id)->update(['lastInstallmentDate' => end($scheduleDateArr)]);\n\n\t\t\t\t//\tGENERATE ALL LOAN FEES. \n\t\t\t\t$req->request->add(['createdDate' => $now]);\n\t\t\t\t$req->request->add(['name' => 'loan']);\n\t\t\t\t$req->request->add(['loanIdFk' => $loanIdOB->id]);\n\t\t\t\t$req->request->add(['loanAdditionalFee' => $req->additionalFee]);\n\t\t\t\t$req->request->add(['loanFormFee' => $req->loanFormFee]);\n\t\t\t\t$create = MfnFees::create($req->all());\n\n\t\t\t\t$data = array(\n\t\t\t\t\t'responseTitle' =>  MicroFinance::getMessage('msgSuccess'),\n\t\t\t\t\t'responseText'  =>  MicroFinance::getMessage('regularLoanCreateSuccess'),\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\treturn response::json($data);\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t|--------------------------------------------------------------------------\n\t\t| MICRO FINANCE: SHOW EDIT REGULAR LOAN FORM.\n\t\t|--------------------------------------------------------------------------\n\t\t*/\n\t\tpublic function updateRegularLoan($regularLoanId) {\n\n\t\t\t//\tGET ALL THE DETAILS OF THE LOAN.\n\t\t\t$regularLoanDetails = $this->MicroFinance->getLoanDetails($regularLoanId);\n\n\t\t\t//\tGET THE DETAILS OF THE PRODUCT OF THE LOAN.\n\t\t\t$loanProductOB = MfnProduct::where('id', $regularLoanDetails->productIdFk)\n\t\t\t                           ->select('avgLoanAmount',\n\t\t\t                           \t\t\t'maxLoanAmount',\n\t\t\t                           \t\t\t'minLoanAmount', \n                                                'installmentNum', \n                                                'eligibleRepaymentFrequencyId', \n                                                'principalAmountOfLoan'\n                                               )\n\t\t\t                           ->first();\n\n\t\t\t//\tGET LOAN REPAY PERIOD OPTIONS.\n\t\t\t$loanRepayPeriodOption = $this->MicroFinance->getLoanRepayPeriod();\n\n\t\t\t//\tLOAN REPAY PERIOD.\n\t\t\t$loanRepayPeriod = [];\n\t\t\t\n\t\t\t//\tLOAN REPAY PERIOD FOR WEEKLY REPAYMENT FREQUENCY.\n\t\t\tif($regularLoanDetails->repaymentFrequencyIdFk==1):\n\t\t\t\tforeach($loanRepayPeriodOption as $key => $val):\n\t\t\t\t\tif($key==1):\n\t\t\t\t\t\t$loanRepayPeriod[$key] = $val;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tendif;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\n\t\t\t//\tLOAN REPAY PERIOD FOR MONTHLY REPAYMENT FREQUENCY.\n\t\t\tif($regularLoanDetails->repaymentFrequencyIdFk==2):\n\t\t\t\tforeach($loanRepayPeriodOption as $key => $val):\n\t\t\t\t\tif($key>=1 && $key<=3):\n\t\t\t\t\t\t$loanRepayPeriod[$key] = $val;\n\t\t\t\t\tendif;\n\t\t\t\tendforeach;\n\t\t\tendif;\n\n\t\t\t//\tMANUFACTURING NO OF REPAYMENT OPTIONS.\n\t\t\t$repaymentNo = explode(',', $loanProductOB->installmentNum);\n\n\t\t\t$repaymentNoOptions = [];\n\n\t\t\tforeach($repaymentNo as $key => $val):\n\t\t\t\t$repaymentNoOptions[$val] = $val;\n\t\t\tendforeach;\n\n\t\t\tif($regularLoanDetails->repaymentFrequencyIdFk==1):\n\t\t\t\tunset($repaymentNoOptions[12]);\n\t\t\t\tunset($repaymentNoOptions[24]);\n\t\t\t\tunset($repaymentNoOptions[36]);\n\t\t\telse:\n\t\t\t\tunset($repaymentNoOptions[46]);\n\t\t\tendif;\n\n\t\t\t//\tFOR REPAYMENT FREQUENCY OPTION.\n\t\t\t$repaymentFrequencyOption = $this->MicroFinance->getRepaymentFrequencyOptionsProductWise($table='mfn_repayment_frequency', $loanProductOB->eligibleRepaymentFrequencyId);\n\t\t\n\t\t\t//\tLOCK LOAN AMOUNT FIELD FOR UPDATE.\n\t\t\t$lockField = $this->MicroFinance->getRegularLoanCollectionStatus($regularLoanId);\n\t\t\t$rescheduleExists = $this->MicroFinance->getRegularLoanRescheduleExists($regularLoanId);\n\n\t\t\tif($lockField==1 || $rescheduleExists==1):\n\t\t\t\t//\tGET CURRENT LOAN INFORMATION.\n\t\t\t\t$curLoanOB = MfnLoan::where('id', $regularLoanId)->select('repaymentFrequencyIdFk', 'loanRepayPeriodIdFk', 'repaymentNo')->first();\n\n\t\t\t\t$repaymentFrequencyOption = $this->MicroFinance->getArrayCutOff($repaymentFrequencyOption, (int) $curLoanOB->repaymentFrequencyIdFk);\n\t\t\t\t$loanRepayPeriod = $this->MicroFinance->getArrayCutOff($loanRepayPeriod, (int) $curLoanOB->loanRepayPeriodIdFk);\n\t\t\t\t$repaymentNoOptions = $this->MicroFinance->getArrayCutOff($repaymentNoOptions, (int) $curLoanOB->repaymentNo);\n\t\t\tendif;\n\t\t\t\n\t\t\t$damageData = array(\n\t\t\t\t'loanId'\t\t\t\t\t=>  $regularLoanId,\n\t\t\t\t'regularLoanDetails'  \t\t=>  $regularLoanDetails,\n\t\t\t\t'member'  \t\t\t  \t\t=>  $this->MicroFinance->getMemberOptionsSingle($regularLoanDetails->memberIdFk),\n\t\t\t\t'product'\t\t\t  \t\t=>  $this->MicroFinance->getLoanProductsOptionSingle($regularLoanDetails->productIdFk),\n\t\t\t\t'productDetails'\t\t\t=>  $loanProductOB,\n\t\t\t\t'repaymentFrequencyOption'  =>  $repaymentFrequencyOption,\n\t\t\t\t'loanRepayPeriod'  \t\t\t=>  $loanRepayPeriod,\n\t\t\t\t'repaymentNo'   \t \t\t=>  $repaymentNoOptions, \n\t\t\t\t'paymentType'         \t\t=>  $this->MicroFinance->getPaymentType(),\n\t\t\t\t'loanPurpose'         \t\t=>  $this->MicroFinance->getLoanPurpose(),\n\t\t\t\t'boolean'  \t\t\t  \t\t=>  $this->MicroFinance->getBooleanOptions(),\n\t\t\t\t'lockField'       \t\t    =>  $lockField==0?0:1,\n\t\t\t\t'rescheduleExists'          =>  $rescheduleExists==0?0:1\n\t\t\t);\n\n\t\t\treturn view('microfin.loan.regularLoan.editRegularLoan', $damageData);\n\t\t}\n\n\t\tpublic function updateItem(Request $req) {\n\n\t\t\t//\tGET CURRENT LOAN INFORMATION.\n\t\t\t$curLoanOB = MfnLoan::where('id', $req->loanId)->select('repaymentFrequencyIdFk', 'repaymentNo')->first();\n\n\t\t\t//\tUPDATE LOAN.\n\t\t\t$loan = MfnLoan::find($req->loanId);\n\t\t\t\n\t\t\t//\tMEMBER AND LOAN DETAILS.\n\t\t\t$loan->memberIdFk = $req->memberIdFk;\n\t\t\t$loan->disbursementDate = $req->disbursementDate;\n\t\t\t$loan->productIdFk = $req->productIdFk;\n\t\t\t$loan->loanCode = $req->loanCode;\n\n\t\t\t//\tLOAN CONFIGURATION.\n\t\t\t$loan->loanApplicationNo = $req->loanApplicationNo;\n\t\t\t$loan->repaymentFrequencyIdFk = $req->repaymentFrequencyIdFk;\n\t\t\t$loan->loanRepayPeriodIdFk = $req->loanRepayPeriodIdFk;\n\t\t\t$loan->firstRepayDate = $req->firstRepayDate;\n\t\t\t$loan->loanCycle = $req->loanCycle;\n\t\t\t$loan->loanAmount = $req->loanAmount;\n\t\t\t$loan->repaymentNo = $req->repaymentNo;\n\t\t\t$loan->insuranceAmount = $req->insuranceAmount;\n\t\t\t$loan->loanSubPurposeIdFk = $req->loanSubPurposeIdFk;\n\t\t\t$loan->folioNum = $req->folioNum;\n\n\t\t\t//\tINTEREST CALCULATION.\n\t\t\t$loan->interestMode = $req->interestMode;\n\t\t\t$loan->interestCalculationMethod = $req->interestCalculationMethod;\n\t\t\t$loan->interestRate = $req->interestRate;\n\t\t\t$loan->interestDiscountAmount = $req->interestDiscountAmount;\n\n\t\t\t//\tPAYMENTS.\n\t\t\t$loan->totalRepayAmount = $req->totalRepayAmount;\n\t\t\t$loan->interestAmount = $req->interestAmount;\n\t\t\t$loan->installmentAmount = $req->installmentAmount;\n\t\t\t$loan->paymentTypeIdFk = $req->paymentTypeIdFk;\n\n\t\t\t//\tEXTRA LOAN INFORMATION.\n\t\t\t$loan->extraInstallmentAmount = $req->extraInstallmentAmount;\n\t\t\t$loan->actualInstallmentAmount = $req->actualInstallmentAmount;\n\t\t\t$loan->lastInstallmentAmount = $req->lastInstallmentAmount;\n\t\t\t$loan->actualNumberOfInstallment = $req->actualNumberOfInstallment;\n\t\t\t$loan->additionalFee = $req->additionalFee;\n\t\t\t$loan->loanFormFee = $req->loanFormFee;\n\t\t\t$loan->note = $req->note;\n\n\t\t\t//\tGUARANTOR'S DETAILS.\n\t\t\t$loan->firstGuarantorName = $req->firstGuarantorName;\n\t\t\t$loan->firstGuarantorRelation = $req->firstGuarantorRelation;\n\t\t\t$loan->firstGuarantorAddress = $req->firstGuarantorAddress;\n\t\t\t$loan->firstGuarantorContact = $req->firstGuarantorContact;\n\t\t\t$loan->secondGuarantorName = $req->secondGuarantorName;\n\t\t\t$loan->secondGuarantorRelation = $req->secondGuarantorRelation;\n\t\t\t$loan->secondGuarantorAddress = $req->secondGuarantorAddress;\n\t\t\t$loan->secondGuarantorContact = $req->secondGuarantorContact;\n\t\t\t\n\t\t\t//\tEMPLOYMENT RELATED INFORMATION.\n\t\t\t$loan->isSelfEmployment = $req->isSelfEmployment;\n\t\t\t$loan->FEFullTimeMale = $req->FEFullTimeMale;\n\t\t\t$loan->FEFullTimeFemale = $req->FEFullTimeFemale;\n\t\t\t$loan->OFEFullTimeMale = $req->OFEFullTimeMale;\n\t\t\t$loan->OFEFullTimeFemale = $req->OFEFullTimeFemale;\n\t\t\t$loan->FEPartTimeMale = $req->FEPartTimeMale;\n\t\t\t$loan->FEPartTimeFemale = $req->FEPartTimeFemale;\n\t\t\t$loan->OFEPartTimeMale = $req->OFEPartTimeMale;\n\t\t\t$loan->OFEPartTimeFemale = $req->OFEPartTimeFemale;\n\t\t\t$loan->FEFullTimeMaleWage = $req->FEFullTimeMaleWage;\n\t\t\t$loan->FEFullTimeFemaleWage = $req->FEFullTimeFemaleWage;\n\t\t\t$loan->OFEPartTimeMaleWage = $req->OFEPartTimeMaleWage;\n\t\t\t$loan->OFEPartTimeFemaleWage = $req->OFEPartTimeFemaleWage;\n\t\t\t$loan->businessName = $req->businessName;\n\t\t\t$loan->businessLocation = $req->businessLocation;\n\t\t\t$loan->businessType = $req->businessType;\n\t\t\t$loan->save();\n\n\t\t\t//  GET INTEREST RATE INDEX.\n\t\t\t$interestRateIndexOB = MfnLoanProductInterestRate::where('loanProductId', $req->productIdFk)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ->where('installmentNum', $req->repaymentNo)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ->select('interestRateIndex')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ->first();\n\n\t\t\t//\tCALCULATING PRINCIPAL AMOUNT AND INTEREST AMOUNT.\n\t\t\t$principalAmount = $req->installmentAmount / $interestRateIndexOB->interestRateIndex;\n\t\t\t$interestAmount = $req->installmentAmount - $principalAmount;\n\n\t\t\t$installmentAmount = sprintf(\"%.2f\", $req->installmentAmount);\n\t\t\t$actualInstallmentAmount = sprintf(\"%.2f\", $req->actualInstallmentAmount);\n\t\t\t$extraInstallmentAmount = sprintf(\"%.2f\", $req->extraInstallmentAmount);\n\n\t\t\t$repaymentNo = (int) $req->repaymentNo;\n\t\t\t$loanId = (int) $req->loanId;\n\n\t\t\tif($curLoanOB->repaymentFrequencyIdFk==(int) $req->repaymentFrequencyIdFk && $curLoanOB->repaymentNo==(int) $req->repaymentNo):\n\t\t\t\t//\tUPDATE LOAN SCHEDULE.\n\t\t\t\tfor($i=0;$i<$repaymentNo;$i++):\n\t\t\t\t\tif($i==$repaymentNo-1):\n\t\t\t\t\t\t//\tCALCULATING PRINCIPAL AMOUNT AND INTEREST AMOUNT FOR LAST INSTALLMENT.\n\t\t\t\t\t\t$installmentAmount = $req->totalRepayAmount - ($req->installmentAmount * ($repaymentNo - 1));\n\t\t\t\t\t\t$principalAmount = $installmentAmount / $interestRateIndexOB->interestRateIndex;\n\t\t\t\t\t\t$interestAmount = $installmentAmount - $principalAmount;\n\t\t\t\t\t\t$installmentAmount = sprintf(\"%.2f\", $installmentAmount);\n\t\t\t\t\t\t$actualInstallmentAmount = sprintf(\"%.2f\", 0);\n\t\t\t\t\t\t$extraInstallmentAmount = sprintf(\"%.2f\", 0);\n\t\t\t\t\tendif;\n\n\t\t\t\t\tMfnLoanSchedule::where('loanIdFk', $loanId)\n\t\t\t\t\t\t\t\t   ->where('installmentSl', $i+1)\n\t\t\t\t\t\t\t\t   ->update(['installmentAmount' \t   => sprintf(\"%.2f\", $installmentAmount),\n\t\t\t\t\t\t\t\t   \t\t\t 'actualInstallmentAmount' => sprintf(\"%.2f\", $actualInstallmentAmount),\n\t\t\t\t\t\t\t\t   \t\t\t 'extraInstallmentAmount'  => sprintf(\"%.2f\", $extraInstallmentAmount),\n\t\t\t\t\t\t\t\t   \t\t\t 'principalAmount' \t\t   => sprintf(\"%.2f\", $principalAmount),\n\t\t\t\t\t\t\t\t   \t\t\t 'interestAmount' \t\t   => sprintf(\"%.2f\", $interestAmount)\n\t\t\t\t\t\t\t\t   \t\t\t]);\n\t\t\t\tendfor;\n\t\t\telse:\n\t\t\t\t//\tDELETE PREVIOUS LOAN SCHEDULE.\n\t\t\t\tMfnLoanSchedule::where('loanIdFk', $loanId)->delete(); \n\t\t\t\t\n\t\t\t\t//\tGENERATE NEW SCHEDULED DATE.\n\t\t\t\t$repaymentFrequencyWiseRepayDate = [\n\t\t\t\t\t'1'\t =>  7,\n\t\t\t\t\t'2'  =>  30\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\t//\tGET HOLIDAY.\n\t\t\t\t$globalGovtHoliday = $this->MicroFinance->getGlobalGovtHoliday();\n\t\t\t\t$organizationHoliday = $this->MicroFinance->getOrganizationHoliday(1);\n\t\t\t\t$branchHoliday = $this->MicroFinance->getBranchHoliday();\n\t\t\t\t$samityHoliday = $this->MicroFinance->getSamityHoliday($req->memberIdFk);\n\t\t\t\t$holiday = array_unique(array_merge($globalGovtHoliday, $organizationHoliday, $branchHoliday, $samityHoliday));\n\t\t\t\t\n\t\t\t\t$holidayFound = 0;\n\t\t\t\t$scheduleDateArr = [];\n\n\t\t\t\tfor($i=0;$i<1000;$i++):\n\t\t\t\t\t$dayDiff = ($repaymentFrequencyWiseRepayDate[$req->repaymentFrequencyIdFk] * $i) . 'days'; \n\t\t\t\t\t$date = date_create($req->firstRepayDate);\n\t\t\t\t\tdate_add($date, date_interval_create_from_date_string($dayDiff));\n\t\t\t\t\t\n\t\t\t\t\t//\tPROPAGATE SCHEDULE DATE FOR WEEKLY FREQUENCY.\n\t\t\t\t\tif($req->repaymentFrequencyIdFk==1):\n\t\t\t\t\t\t//\tCHECK IF A DATE IS MATCHES TO HOLIDAY.\n\t\t\t\t\t\tforeach($holiday as $key => $val):\n\t\t\t\t\t\t\tif(date_create($val)>=$date):\n\t\t\t\t\t\t\t\tif(date_create($val)==$date):\n\t\t\t\t\t\t\t\t\t$holidayFound = 1;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\tendforeach;\n\n\t\t\t\t\t\tif($holidayFound==0)\n\t\t\t\t\t\t\t$scheduleDateArr[] = date_format($date, \"Y-m-d\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t$holidayFound = 0;\n\t\t\t\t\tendif;\n\t\t\t\t\t\n\t\t\t\t\t//\tPROPAGATE SCHEDULE DATE FOR MONTHLY FREQUENCY.\n\t\t\t\t\tif($req->repaymentFrequencyIdFk==2):\n\t\t\t\t\t\t$dayDiff = ($repaymentFrequencyWiseRepayDate[$req->repaymentFrequencyIdFk] * $i) . 'days'; \n\t\t\t\t\t\t$date = date_create($req->firstRepayDate);\n\t\t\t\t\t\tdate_add($date, date_interval_create_from_date_string($dayDiff));\n\t\t\t\t\t\t$disbursementDate = date_create($req->disbursementDate);\n\t\t\t\t\t\tdate_add($disbursementDate, date_interval_create_from_date_string($dayDiff));\n\n\t\t\t\t\t\t$tos = Carbon::parse($req->firstRepayDate);\n\t\t\t\t\t\t$sot = $tos->addMonths($i)->toDateString();\n\n\t\t\t\t\t\tif($i==0)\n\t\t\t\t\t\t\t$targetDate = date_format($date, \"Y-m-d\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t$targetDate = $this->MicroFinance->getMonthlyLoanScheduleDateFilter($sot, $req->memberIdFk);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$originalMD = Carbon::parse($targetDate);\n\t\t\t\t\t\t$MD = Carbon::parse($targetDate);\n\t\t\t\t\t\t$targetDate = $MD->toDateString();\n\n\t\t\t\t\t\t//\tCHECK IF A DATE IS MATCHES TO HOLIDAY, THEN SAMITY DATE SET TO NEXT WEEK.\n\t\t\t\t\t\tfor($j=0;$j<100;$j++):\n\t\t\t\t\t\t\tif(in_array($targetDate, $holiday)):\n\t\t\t\t\t\t\t\t$targetDate = $MD->addDays(7)->toDateString();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($targetDate>$originalMD->endOfMonth()):\n\t\t\t\t\t\t\t\t\t$targetDate = $MD->subDays(14)->toDateString();\n\t\t\t\t\t\t\t\telse:\n\t\t\t\t\t\t\t\t\tif(in_array($targetDate, $holiday)):\n\t\t\t\t\t\t\t\t\t\t$targetDate = $MD->addDays(7)->toDateString();\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif($targetDate>$originalMD->endOfMonth()):\n\t\t\t\t\t\t\t\t\t\t\t$targetDate = $MD->subDays(21)->toDateString();\n\t\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\telse:\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\telse:\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\tendfor;\n\n\t\t\t\t\t\t$scheduleDateArr[] = $targetDate;\n\t\t\t\t\tendif;\n\n\t\t\t\t\tif(count($scheduleDateArr)==$repaymentNo)\n\t\t\t\t\t\tbreak;\n\t\t\t\tendfor;\n\n\t\t\t\t//\tNEWLY GENERATE LOAN SCHEDULE.\n\t\t\t\tfor($i=0;$i<$repaymentNo;$i++):\n\t\n\t\t\t\t\t$req->request->add(['loanIdFk' => $loanId]);\n\t\t\t\t\t$req->request->add(['installmentSl' => $i+1]);\n\t\t\t\t\t\n\t\t\t\t\t//\tFOR REGULAR LOAN loanTypeId = 1\n\t\t\t\t\t$req->request->add(['loanTypeId' => 1]);\n\t\t\t\t\t\n\t\t\t\t\tif($i==$repaymentNo-1):\n\t\t\t\t\t\t//\tCALCULATING PRINCIPAL AMOUNT AND INTEREST AMOUNT FOR LAST INSTALLMENT.\n\t\t\t\t\t\t$installmentAmount = $req->totalRepayAmount-($req->installmentAmount*($repaymentNo-1));\n\t\t\t\t\t\t$principalAmount = $installmentAmount / $interestRateIndexOB->interestRateIndex;\n\t\t\t\t\t\t$interestAmount = $installmentAmount - $principalAmount;\n\t\t\t\t\t\t$req->request->add(['installmentAmount' => sprintf(\"%.2f\", $installmentAmount)]);\n\t\t\t\t\t\t$req->request->add(['actualInstallmentAmount' => sprintf(\"%.2f\", 0)]);\n\t\t\t\t\t\t$req->request->add(['extraInstallmentAmount' => sprintf(\"%.2f\", 0)]);\n\t\t\t\t\tendif;\n\n\t\t\t\t\t$req->request->add(['principalAmount' => sprintf(\"%.2f\", $principalAmount)]);\t\n\t\t\t\t\t$req->request->add(['interestAmount' => sprintf(\"%.2f\", $interestAmount)]);\n\t\t\t\t\t$req->request->add(['scheduleDate' => $scheduleDateArr[$i]]);\n\t\t\t\t\t$create = MfnLoanSchedule::create($req->all());\n\t\t\t\tendfor;\n\n\t\t\t\t// UPDATE LAST INSTALLMENT DATE IN LOAN TABLE.\n\t\t\t\tMfnLoan::where('id', $loanId)->update(['lastInstallmentDate' => end($scheduleDateArr)]);\n\t\t\tendif;\n\n\t\t\t$data = array(\n\t\t\t\t'responseTitle'  \t\t   =>  MicroFinance::getMessage('msgSuccess'),\n\t\t\t\t'responseText'   \t\t   =>  MicroFinance::getMessage('regularLoanUpdateSuccess'),\n\t\t\t\t'loanId'                   =>  (int) $req->loanId,\n\t\t\t\t'installmentAmount'        =>  $installmentAmount,\n\t\t\t\t'actualInstallmentAmount'  =>  $actualInstallmentAmount,\n\t\t\t\t'extraInstallmentAmount'   =>  $extraInstallmentAmount,\n\t\t\t\t'principalAmount'          =>  $principalAmount,\n\t\t\t\t'interestAmount'           =>  $interestAmount,\n\t\t\t);\n\n\t\t\treturn response()->json($data);\n\t\t}\n\n\t\t/*\n\t\t|--------------------------------------------------------------------------\n\t\t| MICRO FINANCE: DETAILS OF REGULAR LOAN.\n\t\t|--------------------------------------------------------------------------\n\t\t*/\n\t\tpublic function detailsRegularLoan($regularLoanId) {\n\n\t\t\t$loanDetailsTCN = [\n\t\t\t\t'loanId'\t\t\t\t\t   =>  'Loan ID:',\n\t\t\t\t'product'\t\t\t\t\t   =>  'Product:',\n\t\t\t\t'memberName'\t\t\t\t   =>  'Member Name:',\n\t\t\t\t'loanCycle'\t\t\t\t\t   =>  'Loan Cycle:',\n\t\t\t\t'fatherSpouseName'\t\t\t   =>  'Father\\'s/Spouse Name:',\n\t\t\t\t'paymentMode'\t\t\t\t   =>  'Mode of payment:',\n\t\t\t\t'age'\t\t\t\t\t\t   =>  'Age:',\n\t\t\t\t'mobileNo'\t\t\t\t\t   =>  'Mobile No:',\n\t\t\t\t'samity'\t\t\t\t\t   =>  'Samity:',\n\t\t\t\t'transferDate'\t\t\t\t   =>  'Transfer In Date:',\n\t\t\t\t'disbursementDate'\t\t\t   =>  'Disbursement Date:',\n\t\t\t\t'dueAmount'\t\t\t\t       =>  'Due Amount:',\n\t\t\t\t'firstRepayDate'\t\t\t   =>  'First Repay Date:',\n\t\t\t\t'advanceAmount'\t\t\t\t   =>  'Advance Amount:',\n\t\t\t\t'interestRate'\t\t\t\t   =>  'Interest Rate:',\n\t\t\t\t'recoveryAmount'\t\t\t   =>  'Recovery Amount:',\n\t\t\t\t'extraInstallmentAmount'\t   =>  'Extra Installment Amount:',\n\t\t\t\t'openingLoanOutstanding'\t   =>  'Opening Loan Outstanding:',\n\t\t\t\t'currentStatus'\t\t  \t\t   =>  'Current Status:',\n\t\t\t\t'rebate'\t\t\t\t  \t   =>  'Rebate:',\n\t\t\t\t'repaymentFrequency'\t\t   =>  'Repayment Frequency:',\n\t\t\t\t'loanOutstanding'\t\t\t   =>  'Loan Outstanding:',\n\t\t\t\t'interestMode'\t\t\t\t   =>  'Mode of interest:',\n\t\t\t\t'loanPurpose'\t\t\t\t   =>  'Loan Purpose:',\n\t\t\t\t'loanAmount'\t\t\t\t   =>  'Loan Amount:',\n\t\t\t\t'loanSubPurpose'\t\t\t   =>  'Loan Sub Purpose:',\n\t\t\t\t'interestAmount'\t\t\t   =>  'Interest Amount:',\n\t\t\t\t'guarantorNameFirst'\t\t   =>  'Guarantor\\'s Name #1:',\n\t\t\t\t'totalRepayAmount'\t  \t\t   =>  'Total Repay Amount: ',\n\t\t\t\t'guarantorRelationshipFirst'   =>  'Guarantor\\'s Relationship #1:',\n\t\t\t\t'installmentNum'  \t\t\t   =>  'Number of Installment:',\n\t\t\t\t'guarantorAddressFirst'\t\t   =>  'Guarantor\\'s Address #1:',\n\t\t\t\t'loanPeriodInMonth'\t\t\t   =>  'Loan Period in Month:',\n\t\t\t\t'guarantorNameSecond'\t\t   =>  'Guarantor\\'s Name #2:',\n\t\t\t\t'loanApplicationNo'\t\t\t   =>  'Loan Application No:',\n\t\t\t\t'guarantorRelationshipSecond'  =>  'Guarantor\\'s Relationship #2:',\n\t\t\t\t'insuranceGuarantorAmount'\t   =>  'Insurance/Guarantor\\'s Amount:',\n\t\t\t\t'guarantorAddressSecond'\t   =>  'Guarantor\\'s Address #2:',\n\t\t\t\t'loanClosingDate'\t\t\t   =>  'Loan Closing Date:',\n\t\t\t\t'transferOutDate'\t\t\t   =>  'Transfer Out Date:',\n\t\t\t\t'installmentAmount'\t\t\t   =>  'Installment Amount:',\n\t\t\t\t'folioNumber'\t\t\t\t   =>  'Folio Number:',\n\t\t\t\t'additionalFee'\t\t\t\t   =>  'Additional Fee:',\n\t\t\t\t'loanFormFee'\t\t\t\t   =>  'Loan Form Fee:',\n\t\t\t\t'payment'\t\t\t\t       =>  'Payment:',\n\t\t\t\t'employment'\t\t\t\t   =>  'Employment:',\n\t\t\t];\n\n\t\t\t$loanScheduleTCN = array(\n\t\t\t\tarray('Date.', 70), \n\t\t\t\tarray('Installment Amount', 0),\n\t\t\t\tarray('Actual Installment Amount', 100),\n\t\t\t\tarray('Extra Installment Amount', 0),\n\t\t\t\tarray('Principal Amount', 0),\n\t\t\t\tarray('Interest Amount', 0),\n\t\t\t\tarray('Transaction Amount', 80),\n\t\t\t\tarray('Status', 80)\n\t\t\t);\t\n\n\t\t\t$regularLoanDetails = $this->MicroFinance->getLoanDetails($regularLoanId);\n\t\t\t$loanPurposeOB = DB::table('mfn_loans_sub_purpose')->where('id', $regularLoanDetails->loanSubPurposeIdFk)->select('purposeIdFK')->first();\n\t\t\t$samityInfoOB = $this->MicroFinance->getMultipleValueForId($table='mfn_samity', $regularLoanDetails->samityIdFk, ['name', 'code', 'samityDayId', 'fixedDate']);\n\n\t\t\t$damageData = array(\n\t\t\t\t'loanDetailsTCN'      =>  $loanDetailsTCN,\n\t\t\t\t'loanScheduleTCN'     =>  $loanScheduleTCN,\n\t\t\t\t'regularLoanDetails'  =>  $regularLoanDetails,\n\t\t\t\t'regularLoanDetail'   =>  array(\n\t\t\t\t\t'loanCode'\t\t\t\t\t=>  $regularLoanDetails->loanCode,\n\t\t\t\t\t'loanCycle'\t\t\t\t\t=>  $regularLoanDetails->loanCycle,\n\t\t\t\t\t'paymentTypeIdFk'\t\t\t=>  $regularLoanDetails->paymentTypeIdFk,\n\t\t\t\t\t'disbursementDate'\t\t\t=>  $regularLoanDetails->disbursementDate,\n\t\t\t\t\t'firstRepayDate'\t\t\t=>  $regularLoanDetails->firstRepayDate,\n\t\t\t\t\t'loanApplicationNo'\t\t\t=>  $regularLoanDetails->loanApplicationNo,\n\t\t\t\t\t'interestRate'\t\t\t    =>  $regularLoanDetails->interestRate,\n\t\t\t\t\t'interestRateIndex'\t\t\t=>  $regularLoanDetails->interestRateIndex,\n\t\t\t\t\t'interestCalculationMethod'\t=>  $regularLoanDetails->interestCalculationMethod,\n\t\t\t\t\t'extraInstallmentAmount'\t=>  $regularLoanDetails->extraInstallmentAmount,\n\t\t\t\t\t'totalRepayAmount'\t\t\t=>  $regularLoanDetails->totalRepayAmount,\n\t\t\t\t\t'interestMode'\t\t\t\t=>  $regularLoanDetails->interestMode,\n\t\t\t\t\t'loanAmount'\t\t\t\t=>  $regularLoanDetails->loanAmount,\n\t\t\t\t\t'interestAmount'\t\t\t=>  $regularLoanDetails->interestAmount,\n\t\t\t\t\t'repaymentNo'\t\t\t\t=>  $regularLoanDetails->repaymentNo,\n\t\t\t\t\t'installmentAmount'\t\t\t=>  $regularLoanDetails->installmentAmount,\n\t\t\t\t\t'actualInstallmentAmount'\t=>  $regularLoanDetails->actualInstallmentAmount,\n\t\t\t\t\t'extraInstallmentAmount'\t=>  $regularLoanDetails->extraInstallmentAmount,\n\t\t\t\t\t'folioNum'\t\t\t\t\t=>  $regularLoanDetails->folioNum,\n\t\t\t\t\t'additionalFee'\t\t\t\t=>  $regularLoanDetails->additionalFee,\n\t\t\t\t\t'loanFormFee'\t\t\t\t=>  $regularLoanDetails->loanFormFee,\n\t\t\t\t\t'firstGuarantorName'\t\t=>  $regularLoanDetails->firstGuarantorName,\n\t\t\t\t\t'firstGuarantorRelation'\t=>  $regularLoanDetails->firstGuarantorRelation,\n\t\t\t\t\t'firstGuarantorAddress'\t\t=>  $regularLoanDetails->firstGuarantorAddress,\n\t\t\t\t\t'secondGuarantorName'\t\t=>  $regularLoanDetails->secondGuarantorName,\n\t\t\t\t\t'secondGuarantorRelation'\t=>  $regularLoanDetails->secondGuarantorRelation,\n\t\t\t\t\t'secondGuarantorAddress'\t=>  $regularLoanDetails->secondGuarantorAddress,\n\t\t\t\t\t'isSelfEmployment'\t\t\t=>  $regularLoanDetails->isSelfEmployment,\n\t\t\t\t\t'isLoanCompleted'\t\t\t=>  $regularLoanDetails->isLoanCompleted,\n\t\t\t\t\t'productIdFk'\t \t\t\t=>  $this->MicroFinance->getNameValueForId($table='mfn_loans_product', $regularLoanDetails->productIdFk),\n\t\t\t\t\t'memberInfoOB'\t\t\t    =>  $this->MicroFinance->getMultipleValueForId($table='mfn_member_information', $regularLoanDetails->memberIdFk, ['name', 'code', 'age', 'spouseFatherSonName', 'mobileNo']),\n\t\t\t\t\t'samityName'\t\t\t    =>  $samityInfoOB->name,\n\t\t\t\t\t'samityCode'\t\t\t    =>  $samityInfoOB->code,\n\t\t\t\t\t'samityDay'\t\t\t\t    =>  $this->MicroFinance->getSamityDayName($samityInfoOB->samityDayId, $samityInfoOB->fixedDate),\n\t\t\t\t\t'repaymentFrequencyIdFk'\t=>  $this->MicroFinance->getNameValueForId($table='mfn_repayment_frequency', $regularLoanDetails->repaymentFrequencyIdFk),\n\t\t\t\t\t'loanRepayPeriodIdFk'\t\t=>  $this->MicroFinance->getSingleValueForId($table='mfn_loan_repay_period', $regularLoanDetails->loanRepayPeriodIdFk, 'inMonths'),\n\t\t\t\t\t'loanPurpose'\t\t\t\t=>  $this->MicroFinance->getNameValueForId($table='mfn_loans_purpose', $loanPurposeOB->purposeIdFK),\n\t\t\t\t\t'loanSubPurposeIdFk'\t\t=>  $this->MicroFinance->getNameValueForId($table='mfn_loans_sub_purpose', $regularLoanDetails->loanSubPurposeIdFk),\n\t\t\t\t),\t\n\t\t\t\t'loanSchedules'       =>  $this->MicroFinance->getLoanSchedule($regularLoanDetails->id, $regularLoanDetails->loanTypeId),\n\t\t\t\t'MicroFinance'        =>  $this->MicroFinance\n\t\t\t);\n\n\t\t\treturn view('microfin.loan.regularLoan.detailsRegularLoan', ['damageData' => $damageData]);\n\t\t}\n\n\t\t/*\n\t\t|--------------------------------------------------------------------------\n\t\t| MICRO FINANCE: DELETE REGULAR LOAN.\n\t\t|--------------------------------------------------------------------------\n\t\t*/\n\t\tpublic function deleteItem(Request $req) {\n\t\t\t\n\t\t\t//\tCHECK IF THERE IS ANY LOAN COLLECTION OR LOAN RESCHEDULE EXISTS AGAINST THE LOAN ID.\n\t\t\t$loanCollectionExists = $this->MicroFinance->getRegularLoanCollectionStatus($req->id);\n\t\t\t$rescheduleExists = $this->MicroFinance->getRegularLoanRescheduleExists($req->id);\n\n\t\t\tif($loanCollectionExists==1 || $rescheduleExists==1)\n\t\t\t\t$lockDelete = 1;\n\t\t\telse\n\t\t\t\t$lockDelete = 0;\n\n\t\t\tif($lockDelete==0):\n\t\t\t\tMfnLoan::find($req->id)->delete();\n\t\t\t\tMfnLoanSchedule::where('loanIdFk', $req->id)->delete();\n\t\t\t\tMfnFees::where('loanIdFk', $req->id)->delete();\n\t\t\t\tMfnLoanReschedule::where('loanIdFk', $req->id)->delete(); \n\t\t\t\tMfnloanOpeningBalance::where('loanIdFk', $req->id)->delete();\n\t\t\tendif;   \n\t\t\t\n\t\t\t$data = array(\n\t\t\t\t'responseTitle'  =>  $lockDelete==0?MicroFinance::getMessage('msgSuccess'):MicroFinance::getMessage('msgWarning'),\n\t\t\t\t'responseText'   =>  $lockDelete==0?MicroFinance::getMessage('regularLoanDelSuccess'):MicroFinance::getMessage('regularLoanDelFailed'),\n\t\t\t);\n\n\t\t\treturn response()->json($data);\n\t\t}\n\n\t\t/*\n\t\t|--------------------------------------------------------------------------\n\t\t| MICRO FINANCE: SEARCHING PARAMETERS FUNCTIONS FOR REGULAR LOAN.\n\t\t|--------------------------------------------------------------------------\n\t\t*/\n\t\tpublic function loadSamityAndPrimaryProductOptions(Request $req) {\n\n\t\t\t$data = array(\n\t\t\t\t'samity'  \t\t  =>  $this->MicroFinance->getBranchWiseSamityOptions($req->branchId),\n\t\t\t\t'primaryProduct'  =>  $this->MicroFinance->getBranchWiseActiveLoanPrimaryProductOptions($req->branchId),\n\t\t\t);\n\t\t\t\n\t\t\treturn response::json($data); \n\t\t}\n\t\t\n\t}",
			"file": "//120.50.0.141/erp/app/Http/Controllers/microfin/loan/MfnRegularLoanController.php",
			"file_size": 46318,
			"file_write_time": 131701656091794736,
			"settings":
			{
				"buffer_size": 46329,
				"line_ending": "Unix"
			}
		},
		{
			"contents": "@extends('layouts/microfin_layout')\n@section('title', '| Add Regular Loan')\n@section('content')\n\t<style type=\"text/css\">\n\t\t.selectize-dropdown-content {\n\t\t\twidth: 260px !important;\n\t\t\tbackground: olive;\n\t\t\tcolor: #000;\n\t\t\tleft: -11px !important;\n\t\t\tposition: relative !important;\n\t\t\t_top: -6px !important;\n\t\t\ttop: 0 !important;\n\t\t}\n\t\t.selectize-dropdown, \n\t\t.selectize-input, \n\t\t.selectize-input input {\n\t\t\theight: 18px !important;\n\t\t    font-size: 11px !important;\n\t\t}\n\t\t#rootwizard .panel-body .row {\n\t\t\tmargin-bottom: 10px;\n\t\t}\n\t\t#rootwizard, \n\t\t#rootwizard .form-control {\n\t\t\tfont-size: 11px !important;\n\t\t\tpadding: 5px !important;\n\t\t}\n\t\t#rootwizard input[type='text'],\n\t\t#rootwizard select {\n\t\t\theight: 28px;\n\t\t}\n\t\t#rootwizard label {\n\t\t\tmargin-bottom: 0 !important;\n\t\t\tcolor: #555;\n\t\t\tfont-size: 9px;\n\t\t\ttext-transform: uppercase;\n\t\t}\n\t\t.validate-has-error,\n\t\t#loanAmount-error {\n\t\t\tcolor: #FF0000 !important;\n\t\t}\n\t\t#loanAmount-error {\n\t\t\tfont-size: 11px !important;\n\t\t\ttext-transform: none !important;\n\t\t}\n\t\t#profileImagePreview {\n\t\t\twidth: 150px;\n\t\t    height: 200px;\n\t\t    border: 1px solid #bebebe;\n\t\t    padding: 3px;\n\t\t    margin: 5px 5px 5px 0;\n\t\t}\n\t\t#regularSignatureImagePreview,\n\t\t#nIDSignatureImagePreview {\n\t\t\twidth: 200px;\n\t\t    height: 100px;\n\t\t    border: 1px solid #bebebe;\n\t\t    padding: 3px;\n\t\t    margin: 5px 5px 5px 0;\n\t\t}\n\t\t.profileImage,\n\t\t.signature {\n\t\t\tmargin-top: 5px;\n\t\t}\n\t</style>\n\t<div class=\"row add-data-form\">\n\t\t<div class=\"col-md-12\">\n            <div class=\"col-md-10 col-md-offset-1 fullbody\">\n            \t<div class=\"viewTitle\" style=\"border-bottom:1px solid white;\">\n                    <a href=\"{{ url('viewRegularLoan/') }}\" class=\"btn btn-info pull-right addViewBtn\">\n                    \t<i class=\"glyphicon glyphicon-th-list viewIcon\"></i>\n                    \tRegular Loan Lists\n                    </a>\n                </div>             \n                \n                <div class=\"panel panel-default panel-border\">\n                \t<div class=\"panel-heading\">\n                        <div class=\"panel-title\">New Regular Loan</div>\n                        <?php\n                        \t/*echo '<pre>';\n                        \t\tprint_r($damageData['option']);\n                        \techo '</pre>';\n\n                        \techo '<pre>';\n                        \t\tprint_r($damageData['member']);\n                        \techo '</pre>';\n\n                        \techo json_encode($damageData['option']);*/\n                        \n                        ?>\n                    </div>\n                    <div class=\"panel-body\">\n                    \t<div class=\"row\">\n\t\t\t\t\t\t\t{!! Form::open(array('name' => 'memberForm', 'url' => '', 'role' => 'form', 'id' => 'rootwizard', 'files' => 'true', 'class' => 'form-wizard validate', 'novalidate' => '')) !!}\n\t\t\t\t\t\t\t\t<div class=\"panel panel-default\" style=\"padding:0!important;\">\n\t\t\t\t\t\t\t\t\t<div class=\"panel-heading\" style=\"padding:5px 10px;background:#708090;color:#FFF;border-bottom:none!important\">Member and Loan Details</div>\n\t\t\t\t\t\t\t\t\t<div class=\"panel-body\" style=\"padding:5px 10px;\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('member', 'Member:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::select('memberIdFk', array('' => 'Select'), null, array('class'=>'form-control', 'id' => 'select-to', 'data-validate' => 'required')) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('disbursement date', 'Disbursement Date:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('disbursementDate', $value = $damageData['disbursementDate'], ['class' => 'form-control', 'id' => 'disbursementDate', 'type' => 'text', 'readonly' => 'readonly', 'data-validate' => 'required, minlength[5]']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('product', 'Product:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::select('productIdFk', array('' => 'Select'), null, array('class'=>'form-control', 'id' => 'productIdFk', 'data-validate' => 'required')) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('loan code', 'Loan Code:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('loanCode', $value = null, ['class' => 'form-control', 'id' => 'loanCode', 'type' => 'text', 'readonly' => 'readonly', 'data-validate' => 'required']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"panel panel-default\" style=\"padding:0!important;\">\n\t\t\t\t\t\t\t\t\t<div class=\"panel-heading\" style=\"padding:5px 10px;background:#708090;color:#FFF;border-bottom:none!important\">Loan Configuration</div>\n\t\t\t\t\t\t\t\t\t<div class=\"panel-body\" style=\"padding:5px 10px;\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('loan application no', 'Loan Application No:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('loanApplicationNo', $value = null, ['class' => 'form-control', 'id' => 'loanApplicationNo', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('repayment frequency', 'Repayment Frequency:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::select('repaymentFrequencyIdFk', array('' => 'Select'), null, array('class'=>'form-control', 'id' => 'repaymentFrequencyIdFk', 'data-validate' => 'required')) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('loan repay period', 'Loan Repay Period:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::select('loanRepayPeriodIdFk', array('' => 'Select'), null, array('class'=>'form-control', 'id' => 'loanRepayPeriodIdFk', 'data-validate' => 'required')) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('first repay date', 'First Repay Date:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('firstRepayDate', $value = null, ['class' => 'form-control', 'id' => 'firstRepayDate', 'type' => 'text', 'readonly' => 'readonly', 'data-validate' => 'required']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('loan cycle', 'Loan Cycle:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('loanCycle', $value = null, ['class' => 'form-control', 'id' => 'loanCycle', 'type' => 'text', 'readonly' => 'readonly', 'data-validate' => 'required']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('loan amount', 'Loan Amount:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('loanAmount', $value = null, ['class' => 'form-control', 'id' => 'loanAmount', 'type' => 'text', 'autocomplete' => 'off', 'data-validate' => 'required']) !!}\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('', $value = null, ['class' => 'form-control hidden', 'id' => 'backupLoanAmount', 'type' => 'hidden']) !!}\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('', $value = null, ['class' => 'form-control hidden', 'id' => 'maxLoanAmount', 'type' => 'hidden']) !!}\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('', $value = null, ['class' => 'form-control hidden', 'id' => 'minLoanAmount', 'type' => 'hidden']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('no of repayment', 'No of Repayment:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::select('repaymentNo', array('' => 'Select'), null, array('class'=>'form-control', 'id' => 'repaymentNo', 'data-validate' => 'required')) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('insurance amount', 'Insurance Amount:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('insuranceAmount', $value = null, ['class' => 'form-control', 'id' => 'insuranceAmount', 'type' => 'text', 'readonly' => 'readonly']) !!}\n\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('', $value = null, ['class' => 'form-control hidden', 'id' => 'principalAmountOfLoan', 'type' => 'hidden']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('loan purpose', 'Loan Purpose:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::select('loanSubPurposeIdFk', ($damageData['loanPurpose']), null, array('class'=>'form-control', 'id' => 'loanSubPurposeIdFk', 'data-validate' => 'required')) !!}\n\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('folio number', 'Folio Number:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('folioNum', $value = null, ['class' => 'form-control', 'id' => 'folioNum', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"panel panel-default\" style=\"padding:0!important;\">\n\t\t\t\t\t\t\t\t\t<div class=\"panel-heading\" style=\"padding:5px 10px;background:#708090;color:#FFF;border-bottom:none!important\">Interest Calculation</div>\n\t\t\t\t\t\t\t\t\t<div class=\"panel-body\" style=\"padding:5px 10px;\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('mode of interest', 'Mode of Interest:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('interestMode', $value = null, ['class' => 'form-control', 'id' => 'interestMode', 'type' => 'text', 'readonly' => 'readonly', 'data-validate' => 'required, minlength[1]']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('interest calculation method', 'Interest Calculation Method:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('interestCalculationMethod', $value = null, ['class' => 'form-control', 'id' => 'interestCalculationMethod', 'type' => 'text', 'readonly' => 'readonly', 'data-validate' => 'required, minlength[1]']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('interest rate', 'Interest Rate:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('interestRate', $value = null, ['class' => 'form-control', 'id' => 'interestRate', 'type' => 'text', 'readonly' => 'readonly', 'data-validate' => 'required, minlength[1]']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('interest discount amount', 'Interest Discount Amount:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('interestDiscountAmount', $value = null, ['class' => 'form-control', 'id' => 'interestDiscountAmount', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"panel panel-default\" style=\"padding:0!important;\">\n\t\t\t\t\t\t\t\t\t<div class=\"panel-heading\" style=\"padding:5px 10px;background:#708090;color:#FFF;border-bottom:none!important\">Payments</div>\n\t\t\t\t\t\t\t\t\t<div class=\"panel-body\" style=\"padding:5px 10px;\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('total repay amount', 'Total Repay Amount:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('totalRepayAmount', $value = null, ['class' => 'form-control', 'id' => 'totalRepayAmount', 'type' => 'text', 'readonly' => 'readonly', 'data-validate' => 'required']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('interest amount', 'Interest Amount:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('interestAmount', $value = null, ['class' => 'form-control', 'id' => 'interestAmount', 'type' => 'text', 'readonly' => 'readonly']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('installment amount', 'Installment Amount:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('installmentAmount', $value = null, ['class' => 'form-control', 'id' => 'installmentAmount', 'type' => 'text', 'data-validate' => 'required', 'readonly' => 'readonly']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('payment type', 'Payment Type:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::select('paymentTypeIdFk', ($damageData['paymentType']), null, array('class'=>'form-control', 'id' => 'paymentTypeIdFk', 'data-validate' => 'required')) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3 hidden\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('bank name', 'Bank Name:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::select('ledgerId', array('' => 'Select'), null, array('class'=>'form-control', 'id' => 'ledgerId', 'data-validate' => 'required')) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3 hidden\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('cheque no', 'Cheque No:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('chequeNo', $value = null, ['class' => 'form-control', 'id' => 'chequeNo', 'type' => 'text', 'data-validate' => 'required, minlength[10]']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3 hidden\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('cheque date', 'Cheque Date:*', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('chequeDate', $value = null, ['class' => 'form-control datepicker', 'id' => 'chequeDate', 'type' => 'text', 'readonly' => 'readonly', 'data-validate' => 'required']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"panel panel-default\" style=\"padding:0!important;\">\n\t\t\t\t\t\t\t\t\t<div class=\"panel-heading\" style=\"padding:5px 10px;background:#708090;color:#FFF;border-bottom:none!important\">Extra Loan Information</div>\n\t\t\t\t\t\t\t\t\t<div class=\"panel-body\" style=\"padding:5px 10px;\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('extra installment amount', 'Extra Installment Amount:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('extraInstallmentAmount', $value = null, ['class' => 'form-control', 'id' => 'extraInstallmentAmount', 'type' => 'text', 'readonly' => 'readonly']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('actual installment amount', 'Actual Installment Amount:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('actualInstallmentAmount', $value = null, ['class' => 'form-control', 'id' => 'actualInstallmentAmount', 'type' => 'text', 'readonly' => 'readonly']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('last installment amount', 'Last Installment Amount:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('lastInstallmentAmount', $value = null, ['class' => 'form-control', 'id' => 'lastInstallmentAmount', 'type' => 'text', 'readonly' => 'readonly']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('actual number of installment', 'Actual Number of installment:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('actualNumberOfInstallment', $value = null, ['class' => 'form-control', 'id' => 'actualNumberOfInstallment', 'type' => 'text', 'readonly' => 'readonly']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('additional fee', 'Additional Fee:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('additionalFee', $value = null, ['class' => 'form-control', 'id' => 'additionalFee', 'type' => 'text', 'readonly' => 'readonly']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('loan form fee', 'Loan Form Fee:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('loanFormFee', $value = null, ['class' => 'form-control', 'id' => 'loanFormFee', 'type' => 'text', 'readonly' => 'readonly']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('note', 'Note:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::textarea('note', $value = null, ['class' => 'form-control', 'id' => 'note', 'type' => 'textarea', 'rows' => '5', 'cols' => '50']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"panel panel-default\" style=\"padding:0!important;\">\n\t\t\t\t\t\t\t\t\t<div class=\"panel-heading\" style=\"padding:5px 10px;background:#708090;color:#FFF;border-bottom:none!important\">Guarantor's Details</div>\n\t\t\t\t\t\t\t\t\t<div class=\"panel-body\" style=\"padding:5px 10px;\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('guarantor#1 name', 'Guarantor#1 Name:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('firstGuarantorName', $value = null, ['class' => 'form-control', 'id' => 'firstGuarantorName', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('relation', 'Relation:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('firstGuarantorRelation', $value = null, ['class' => 'form-control', 'id' => 'firstGuarantorRelation', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('address', 'Address:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('firstGuarantorAddress', $value = null, ['class' => 'form-control', 'id' => 'firstGuarantorAddress', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('contact', 'Contact:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('firstGuarantorContact', $value = null, ['class' => 'form-control', 'id' => 'firstGuarantorContact', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('guarantor#2 name', 'Guarantor#2 Name:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('secondGuarantorName', $value = null, ['class' => 'form-control', 'id' => 'secondGuarantorName', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('relation', 'Relation:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('secondGuarantorRelation', $value = null, ['class' => 'form-control', 'id' => 'secondGuarantorRelation', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('address', 'Address:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('secondGuarantorAddress', $value = null, ['class' => 'form-control', 'id' => 'secondGuarantorAddress', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('contact', 'Contact:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('secondGuarantorContact', $value = null, ['class' => 'form-control', 'id' => 'secondGuarantorContact', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"panel panel-default\" style=\"padding:0!important;\">\n\t\t\t\t\t\t\t\t\t<div class=\"panel-heading\" style=\"padding:5px 10px;background:#708090;color:#FFF;border-bottom:none!important\">Employment related Information</div>\n\t\t\t\t\t\t\t\t\t<div class=\"panel-body\" style=\"padding:5px 10px;\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('self employment', 'Self Employment:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::select('isSelfEmployment', ($damageData['boolean']), null, array('class'=>'form-control', 'id' => 'isSelfEmployment', 'data-validate' => 'required')) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-6\">\n\t\t\t\t\t\t\t\t\t\t\t\t<h6 style=\"border-bottom:1px solid #dedede;padding-bottom:3px;\">Family Employment</h6>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-6\">\n\t\t\t\t\t\t\t\t\t\t\t\t<h6 style=\"border-bottom:1px solid #dedede;padding-bottom:3px;\">Outside Family Employment</h6>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('full time male', 'Full Time Male:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('FEFullTimeMale', $value = null, ['class' => 'form-control', 'id' => 'FEFullTimeMale', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('full time female', 'Full Time Female:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('FEFullTimeFemale', $value = null, ['class' => 'form-control', 'id' => 'FEFullTimeFemale', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('full time male', 'Full Time Male:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('OFEFullTimeMale', $value = null, ['class' => 'form-control', 'id' => 'OFEFullTimeMale', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('full time female', 'Full Time Female:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('OFEFullTimeFemale', $value = null, ['class' => 'form-control', 'id' => 'OFEFullTimeFemale', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('part time male', 'Part Time Male:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('FEPartTimeMale', $value = null, ['class' => 'form-control', 'id' => 'FEPartTimeMale', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('part time female', 'Part Time Female:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('FEPartTimeFemale', $value = null, ['class' => 'form-control', 'id' => 'FEPartTimeFemale', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('part time male', 'Part Time Male:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('OFEPartTimeMale', $value = null, ['class' => 'form-control', 'id' => 'OFEPartTimeMale', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('part time female', 'Part Time Female:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('OFEPartTimeFemale', $value = null, ['class' => 'form-control', 'id' => 'OFEPartTimeFemale', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('full time male wage', 'Full Time Male Wage:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('FEFullTimeMaleWage', $value = null, ['class' => 'form-control', 'id' => 'FEFullTimeMaleWage', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('full time female wage', 'Full Time Female Wage:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('FEFullTimeFemaleWage', $value = null, ['class' => 'form-control', 'id' => 'FEFullTimeFemaleWage', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('part time male wage', 'Part Time Male Wage:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('OFEPartTimeMaleWage', $value = null, ['class' => 'form-control', 'id' => 'OFEPartTimeMaleWage', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('part time female wage', 'Part Time Female Wage:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('OFEPartTimeFemaleWage', $value = null, ['class' => 'form-control', 'id' => 'OFEPartTimeFemaleWage', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('business name', 'Business Name:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('businessName', $value = null, ['class' => 'form-control', 'id' => 'businessName', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('business location', 'Business Location:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('businessLocation', $value = null, ['class' => 'form-control', 'id' => 'businessLocation', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"col-xs-3\">\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::label('business type', 'Business Type:', ['class' => 'control-label']) !!} <br/>\n\t\t\t\t\t\t\t\t\t\t\t\t{!! Form::text('businessType', $value = null, ['class' => 'form-control', 'id' => 'businessType', 'type' => 'text']) !!}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t\t\t\t<div class=\"col-xs-6 col-xs-offset-5\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"form-group\">\n\t\t\t\t\t\t\t\t\t\t\t{!! Form::submit('Submit', ['id' => 'submit', 'class' => 'btn btn-info']) !!}\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"{{ url('viewRegularLoan/') }}\" class=\"btn btn-danger closeBtn\">Close</a>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t{!! Form::close() !!}\n                        </div>\n                    </div>\n                </div>\n            </div>\n\t\t</div>\n\t</div>\n\t<link rel=\"stylesheet\" href=\"{{ asset('css/selection.css') }}\">\n\t<link rel=\"stylesheet\" href=\"{{ asset('css/selectize.default.css') }}\">\n\t<script src=\"{{ asset('js/selectize.js') }}\"></script>\n\t<script src=\"https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js\"></script>\n\t<script src=\"https://cdn.jsdelivr.net/jquery.validation/1.16.0/additional-methods.min.js\"></script>\t\n\t<script>\n\t\t$(document).on('change', '#select-to', function() {\n\n        \tif($('#select-to').val()=='')\n        \t\treturn false;\n        \t\n        \t$('#productIdFk').empty().append('<option value=\"\">Select</option>');\n        \t$('#loanCode').val('');\n        \t$('#loanCycle').val('');\n        \t$('#repaymentNo').empty().append('<option value=\"\">Select</option>');\n\n        \t$.ajax({\n\t\t        type: 'post',\n\t\t        url: './reqRegularLoanProductOptions',\n\t\t        dataType: 'json',\n\t\t        data: {\n\t\t        \t'memberId': $('#select-to').val()\n\t\t       \t}, \n\t\t        success: function(_response) {\n                    if(_response.errors) {\n                        alert(_response.errors);\n                    } else {\n                   \t\tif(_response.memberAdmissionDate>_response.softwareDate) {\n                   \t\t\talert('Your selected member admission date is greater than loan disbursement date.');\n                   \t\t\t$('#samityId').val('');\n                   \t\t}\n\n                   \t\tif(_response.memberAdmissionDate<=_response.softwareDate) {\n\t                   \t\t$.each(_response.loanProduct, function(index, value) {\n\t\t                        $('#productIdFk').append('<option value=\"'+ index +'\">' + value + '</option>');\n\t\t                    });\n\t\t                }\n                    }\n                },\n                error: function(_response) {\n                    alert(_response.errors);\n                }\n\t\t    });\n\t\t});\n\n\t\tvar formatName = function(item) {\n\t\t\treturn $.trim((item.memberName || '') + ' - ' + (item.memberCode || ''));\n\t\t};\n\n\t\t$('#select-to').selectize({\n\t\t\tpersist: false,\n\t\t\tmaxItems: 1,\n\t\t\tvalueField: 'id',\n\t\t\tlabelField: 'name',\n\t\t\tsearchField: ['memberName', 'samityName', 'memberCode', 'workingArea'],\n\t\t\tsortField: [\n\t\t\t\t{field: 'memberName', direction: 'asc'}\n\t\t\t],\n\t\t\toptions: <?php echo json_encode($damageData['member']) ?>, \n\t\t\t\n\t\t\trender: {\n\t\t\t\titem: function(item, escape) {\n\t\t\t\t\tvar name = formatName(item);\n\t\t\t\t\t\n\t\t\t\t\treturn '<div>' +\n\t\t\t\t\t\t(name ? '<span class=\"name\">' + escape(name) + '</span>' : '') +\n\t\t\t\t\t'</div>';\n\t\t\t\t},\n\t\t\t\toption: function(item, escape) {\n\t\t\t\t\tvar name = formatName(item);\n\t\t\t\t\tvar label = name || item.samityName;\n\t\t\t\t\tvar branch = name ? item.branchName : null;\n\t\t\t\t\tvar samity = name ? item.samityName : null;\n\t\t\t\t\tvar workingArea = name ? item.workingArea : null;\n\t\t\t\t\t\n\t\t\t\t\treturn '<div>' +\n\t\t\t\t\t\t'<span class=\"label\">' + escape(label) + '</span>' +\n\t\t\t\t\t\t(branch ? '<span class=\"caption\">' + escape('Branch: ' + branch) + '</span>' : '') +\n\t\t\t\t\t\t(samity ? '<span class=\"caption\">' + escape('Samity: ' + samity) + '</span>' : '') +\n\t\t\t\t\t\t(workingArea ? '<span class=\"caption\">' + escape('Working Area: ' + workingArea) + '</span>' : '') +\n\t\t\t\t\t'</div>';\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t</script>\n\t<script type=\"text/javascript\">\t\n\t\t$(document).ready(function(){\n\t        $(\".datepicker\").datepicker({\n\t            changeMonth: true,\n\t            changeYear: true,\n\t            dateFormat: 'yy-mm-dd'\n\t        });\n\n\t        $(document).on('change', '#productIdFk', function() {\n\t        \tif($('#productIdFk').val()=='') {\n\t\t\t\t\ttoastr.success('Please select a product first.', 'Warning!', opts);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t        \t$('#loanRepayPeriodIdFk').empty();\n\t        \t$('#repaymentFrequencyIdFk').empty();\n\t        \t$('#repaymentNo').empty();\n\t        \t\n\t        \t$.ajax({\n\t\t\t        type: 'post',\n\t\t\t        url: './reqRegularLoanData',\n\t\t\t        dataType: 'json',\n\t\t\t        data: {\n\t\t\t        \t'id': $('#productIdFk').val(),\n\t\t\t        \t'memberId': $('#select-to').val(),\n\t\t\t        \t'disbursementDate': $('#disbursementDate').val()\n\t\t\t       \t}, \n\t\t\t        success: function(_response) {\n                        if(_response.errors) {\n                            alert(_response.errors);\n                        } else {\n                       \t\t$('#loanCode').val(_response.loanCode); \n\n                       \t\t$.each(_response.loanRepayPeriod, function(index, value) {\n\t\t                        $('#loanRepayPeriodIdFk').append('<option value=\"'+ index +'\">' + value + '</option>');\n\t\t                    });\n\n                       \t\t$('#loanCycle').val(_response.loanCycle); \n                       \t\t$('#firstRepayDate').val(_response.firstRepayDate); \n                       \t\t$('#loanAmount').val(_response.loanAmount);  \n                       \t\t$('#backupLoanAmount').val(_response.loanAmount);\n                       \t\t$('#maxLoanAmount').val(_response.maxLoanAmount); \n                       \t\t$('#minLoanAmount').val(_response.minLoanAmount); \n\n                       \t\t$.each(_response.repaymentNo, function(index, value) {\n\t\t                        $('#repaymentNo').append('<option value=\"'+ index +'\">' + value + '</option>');\n\t\t                    });\n\n\t\t                    $.each(_response.repaymentFrequencyOption, function(index, value) {\n\t\t                        $('#repaymentFrequencyIdFk').append('<option value=\"'+ index +'\">' + value + '</option>');\n\t\t                    });\n\n\t\t                    $('#repaymentFrequencyIdFk').val(_response.repaymentFrequency);\n                       \t\t\n                       \t\t$('#principalAmountOfLoan').val(_response.principalAmountOfLoan);\n                       \t\t$('#additionalFee').val(_response.additionalFee);\n                       \t\t$('#loanFormFee').val(_response.formFee);\n                       \t\t\n                       \t\t$('#actualNumberOfInstallment').val(_response.supportData.installmentNum);\n                       \t\t$('#insuranceAmount').val(_response.supportData.insuranceAmount); \n                       \t\t$('#interestMode').val(_response.supportData.interestMode + ' (Yearly)'); \n                       \t\t$('#interestCalculationMethod').val(_response.supportData.interestCalculationMethodShortName);\n                       \t\t$('#interestRate').val(_response.supportData.interestRate);\t\n                       \t\t$('#totalRepayAmount').val(_response.supportData.totalRepayAmount);\n                       \t\t$('#interestAmount').val(_response.supportData.interestAmount);\n                       \t\t$('#actualInstallmentAmount').val(_response.supportData.actualInstallmentAmount);\n                       \t\t$('#installmentAmount').val(_response.supportData.installmentAmount);\n                       \t\t$('#extraInstallmentAmount').val(_response.supportData.extraInstallmentAmount);\n                       \t\t$('#lastInstallmentAmount').val(_response.supportData.lastInstallmentAmount);\n                        }\n                    },\n                    error: function(_response) {\n                        alert(_response.errors);\n                    }\n\t\t\t    });\n\t        });\n\n\t\t\t$(document).on('change', '#repaymentFrequencyIdFk', function() {\n\t\t\t\tif($('#repaymentFrequencyIdFk').val()==1)\n\t\t\t\t\t$('#loanRepayPeriodIdFk').empty();\n\t\t\t\tif($('#repaymentFrequencyIdFk').val()==2)\n\t\t\t\t\t$('#loanRepayPeriodIdFk').empty().append('<option value=\"\">Select</option>');\n\t\t\t\t\n\t\t\t\t$('#repaymentNo').empty().append('<option value=\"\">Select</option>');\n\n\t\t\t\t$.ajax({\n\t\t\t        type: 'post',\n\t\t\t        url: './reqNoOfRepaymentOption',\n\t\t\t        dataType: 'json',\n\t\t\t        data: {\n\t\t\t        \t'memberId': $('#select-to').val(),\n\t\t\t        \t'disbursementDate' : $('#disbursementDate').val(),\n\t\t\t        \t'productId' : $('#productIdFk').val(),\n\t\t\t        \t'repaymentFrequencyId': $('#repaymentFrequencyIdFk').val()\n\t\t\t       \t}, \n\t\t\t        success: function(_response) {\n                        if(_response.errors) {\n                            alert(_response.errors);\n                        } else {\n                       \t\t$.each(_response.loanRepayPeriod, function(index, value) {\n\t\t                        $('#loanRepayPeriodIdFk').append('<option value=\"'+ index +'\">' + value + '</option>');\n\t\t                    });\n\n                       \t\t$('#firstRepayDate').val(_response.firstRepayDate);\n\n                       \t\t$.each(_response.noOfRepayment, function(index, value) {\n\t\t                        $('#repaymentNo').append('<option value=\"'+ index +'\">' + value + '</option>');\n\t\t                    });\n                        }\n                    },\n                    error: function(_response) {\n                        alert(_response.errors);\n                    }\n\t\t\t    });\n\t\t\t});\n\n\t\t\t$(document).on('keyup', '#loanAmount', function() {\n\t\t\t\t\n\t\t\t\tvar loanAmount = parseFloat($('#loanAmount').val());\n\t\t\t\tvar maxLoanAmount = parseFloat($('#maxLoanAmount').val());\n\t\t\t\tvar minLoanAmount = parseFloat($('#minLoanAmount').val());\n\n\t\t\t\tif(minLoanAmount>loanAmount) {\n\t\t\t\t\tif($('label#loanAmount-error').length==false)\n\t\t\t\t\t\t$('<label id=\"loanAmount-error\" class=\"error\" for=\"loanAmount\"></label>').insertAfter('#loanAmount');\n\t\t\t\t\t\n\t\t\t\t\t$('label#loanAmount-error').text('Please enter a value greater than or equal to ' + minLoanAmount);\n\t\t\t\t\t\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\t$('label#loanAmount-error').empty();\n\t\t\t\t}\n\n\t\t\t\tif(maxLoanAmount<loanAmount) {\n\t\t\t\t\tif($('label#loanAmount-error').length==false)\n\t\t\t\t\t\t$('<label id=\"loanAmount-error\" class=\"error\" for=\"loanAmount\"></label>').insertAfter('#loanAmount');\n\t\t\t\t\t\n\t\t\t\t\t$('label#loanAmount-error').text('Please enter a value less than or equal to ' + maxLoanAmount);\n\t\t\t\t\t\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\t$('label#loanAmount-error').empty();\n\t\t\t\t}\n\n\t\t\t\tif($('#loanAmount').val()=='') {\n\t\t\t\t\talert(\"Please enter a loan amount.\");\n\t\t\t\t\t\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t$.ajax({\n\t\t\t        type: 'post',\n\t\t\t        url: './reqRegularLoanDataRepaymentWise',\n\t\t\t        dataType: 'json',\n\t\t\t        data: {\n\t\t\t        \t'productId' : $('#productIdFk').val(),\n\t\t\t        \t'loanAmount' : $('#loanAmount').val(),\n\t\t\t        \t'repaymentFrequencyId': $('#repaymentFrequencyIdFk').val(),\n\t\t\t        \t'loanRepayPeriodId' : $('#loanRepayPeriodIdFk').val(),\n\t\t\t        \t'repaymentNo': $('#repaymentNo').val()\n\t\t\t       \t}, \n\t\t\t        success: function(_response) {\n                        if(_response.errors) {\n                            alert(_response.errors);\n                        } else {\n                       \t\t$('#totalRepayAmount').val(_response.supportData.totalRepayAmount);\n                       \t\t$('#insuranceAmount').val(_response.supportData.insuranceAmount); \n                       \t\t$('#interestAmount').val(_response.supportData.interestAmount);\n                       \t\t$('#actualInstallmentAmount').val(_response.supportData.actualInstallmentAmount);\n                       \t\t$('#installmentAmount').val(_response.supportData.installmentAmount);\n                       \t\t$('#extraInstallmentAmount').val(_response.supportData.extraInstallmentAmount);\n                       \t\t$('#lastInstallmentAmount').val(_response.supportData.lastInstallmentAmount);\n                        }\n                    },\n                    error: function(_response) {\n                        alert(_response.errors);\n                    }\n\t\t\t    });\n\t\t\t});\n\n\t\t\t$(document).on('change', '#loanRepayPeriodIdFk', function() {\n\t\t\t\t$('#repaymentNo').empty();\n\n\t\t\t\t$.ajax({\n\t\t\t        type: 'post',\n\t\t\t        url: './reqRegularLoanDataRepaymentWise',\n\t\t\t        dataType: 'json',\n\t\t\t        data: {\n\t\t\t        \t'productId' : $('#productIdFk').val(),\n\t\t\t        \t'loanAmount' : $('#loanAmount').val(),\n\t\t\t        \t'repaymentFrequencyId': $('#repaymentFrequencyIdFk').val(),\n\t\t\t        \t'loanRepayPeriodId': $('#loanRepayPeriodIdFk').val(),\n\t\t\t        \t'repaymentNo': $('#repaymentNo').val()\n\t\t\t       \t}, \n\t\t\t        success: function(_response) {\n                        if(_response.errors) {\n                            alert(_response.errors);\n                        } else {\n                       \t\tif(_response.msgStatus==1) {\n                       \t\t\t$('#repaymentNo').empty().append('<option value=\"\">Select</option>');\n                       \t\t\t\n                       \t\t\ttoastr.success(_response.responseText, _response.responseTitle, opts);\n                       \t\t}\n                       \t\t\n                       \t\t$.each(_response.repaymentNo, function(index, value) {\n\t\t                        $('#repaymentNo').append('<option value=\"'+ index +'\">' + value + '</option>');\n\t\t                    });\n\t\t                    \n                       \t\t$('#interestRate').val(_response.supportData.interestRate);\t\n                       \t\t$('#totalRepayAmount').val(_response.supportData.totalRepayAmount);\n                       \t\t$('#interestAmount').val(_response.supportData.interestAmount);\n                       \t\t$('#actualInstallmentAmount').val(_response.supportData.actualInstallmentAmount);\n                       \t\t$('#installmentAmount').val(_response.supportData.installmentAmount);\n                       \t\t$('#extraInstallmentAmount').val(_response.supportData.extraInstallmentAmount);\n                       \t\t$('#lastInstallmentAmount').val(_response.supportData.lastInstallmentAmount);\n                       \t\t$('#actualNumberOfInstallment').val(_response.supportData.installmentNum);\n                        }\n                    },\n                    error: function(_response) {\n                        alert(_response.errors);\n                    }\n\t\t\t    });\n\t\t\t});\n\n\t\t\t$(document).on('change', '#repaymentNo', function() {\n\n\t\t\t\tif($('#repaymentNo').val()=='') {\n\t\t\t\t\talert('Please select number of repayment.');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t$.ajax({\n\t\t\t        type: 'post',\n\t\t\t        url: './reqRegularLoanDataRepaymentWise',\n\t\t\t        dataType: 'json',\n\t\t\t        data: {\n\t\t\t        \t'productId' : $('#productIdFk').val(),\n\t\t\t        \t'loanAmount' : $('#loanAmount').val(),\n\t\t\t        \t'repaymentFrequencyId': $('#repaymentFrequencyIdFk').val(),\n\t\t\t        \t'loanRepayPeriodId': $('#loanRepayPeriodIdFk').val(),\n\t\t\t        \t'repaymentNo': $('#repaymentNo').val()\n\t\t\t       \t}, \n\t\t\t        success: function(_response) {\n                        if(_response.errors) {\n                            alert(_response.errors);\n                        } else {\n                       \t\t$('#interestRate').val(_response.supportData.interestRate);\t\n                       \t\t$('#totalRepayAmount').val(_response.supportData.totalRepayAmount);\n                       \t\t$('#interestAmount').val(_response.supportData.interestAmount);\n                       \t\t$('#actualInstallmentAmount').val(_response.supportData.actualInstallmentAmount);\n                       \t\t$('#installmentAmount').val(_response.supportData.installmentAmount);\n                       \t\t$('#extraInstallmentAmount').val(_response.supportData.extraInstallmentAmount);\n                       \t\t$('#lastInstallmentAmount').val(_response.supportData.lastInstallmentAmount);\n                       \t\t$('#actualNumberOfInstallment').val(_response.supportData.installmentNum);\n                        }\n                    },\n                    error: function(_response) {\n                        alert(_response.errors);\n                    }\n\t\t\t    });\n\t\t\t});\n\n\t\t\t$(document).on('change', '#paymentTypeIdFk', function() {\n\t\t\t\t\n\t\t\t\tif($('#paymentTypeIdFk').val()=='Bank') {\n\t\t\t\t\t$('#ledgerId').parent().removeClass('hidden');\n\t\t\t\t\t$('#chequeNo').parent().removeClass('hidden');\n\t\t\t\t\t$('#chequeDate').parent().removeClass('hidden');\n\n\t\t\t\t\t$.ajax({\n\t\t\t\t        type: 'post',\n\t\t\t\t        url: './getLedgersOptionByBranch',\n\t\t\t\t        dataType: 'json',\n\t\t\t\t        data: {\n\t\t\t\t        \t'projectId' : <?php echo Auth::user()->project_id_fk; ?>, \n\t\t\t\t        \t'branchId' : <?php echo Auth::user()->branchId; ?>\n\t\t\t\t       \t}, \n\t\t\t\t        success: function(_response) {\n\t                        if(_response.errors) {\n\t                            alert(_response.errors);\n\t                        } else {\n\t                       \t\t$('#ledgerId').empty();\n\t                       \t\t$('#ledgerId').append(\"<option value='' selected='selected'>Select</option>\");\n\t                       \t\t\n\t                       \t\t$.each(_response.ledgerOfBanksOptions, function(index, value){\n\t\t\t\t                    $('#ledgerId').append(\"<option value='\" + value.id + \"'>\" + value.code + \" - \" + value.name + \"</option>\");\n\t\t\t\t                });\n\t                        }\n\t                    },\n\t                    error: function(_response) {\n\t                        alert(_response.errors);\n\t                    }\n\t\t\t\t    });\n\t\t\t\t} else if($('#paymentTypeIdFk').val()=='Cash') {\n\t\t\t\t\t$('#ledgerId').parent().addClass('hidden');\n\t\t\t\t\t$('#chequeNo').parent().addClass('hidden');\n\t\t\t\t\t$('#chequeDate').parent().addClass('hidden');\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t$('form').submit(function(event){\n                event.preventDefault();\n\n                if(parseFloat($('#minLoanAmount').val())>parseFloat($('#loanAmount').val())) {\n\t\t\t\t\t$('html, body').animate({\n\t\t\t\t\t    scrollTop: $(\"#loanAmount\").offset()\n\t\t\t\t\t}, 100);\n\t\t\t\t\t\n\t\t\t\t\treturn false;\n                }\n                \n\t\t\t\tif(parseFloat($('#maxLoanAmount').val())<parseFloat($('#loanAmount').val())) {\n\t\t\t\t\t$('html, body').animate({\n\t\t\t\t\t    scrollTop: $(\"#loanAmount\").offset()\n\t\t\t\t\t}, 100);\n\t\t\t\t\t\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n                $.ajax({\n                    type: 'post',\n                    url: './addRegularLoanItem',\n                    data: $('form').serialize(),\n                    dataType: 'json',\n                    success: function(_response) {\n                        if(_response.errors) {\n                            alert(_response.errors);\n                        } else {\n                            $(\"#submit\").prop(\"disabled\", true);\n                            toastr.success(_response.responseText, _response.responseTitle, opts);\n                            \n                            setTimeout(function(){\n                                window.location.href = '{{ url('viewRegularLoan/') }}';\n                            }, 3000);\n                        }\n                    },\n                    error: function(_response) {\n                        alert(_response.errors);\n                    }\n                });\n            });\n\t    });\n\t</script>\n@endsection",
			"file": "//120.50.0.141/erp/resources/views/microfin/loan/regularLoan/addRegularLoan.blade.php",
			"file_size": 43541,
			"file_write_time": 131672078624165155,
			"settings":
			{
				"buffer_size": 43585,
				"line_ending": "Unix"
			}
		}
	],
	"build_system": "",
	"build_system_choices":
	[
	],
	"build_varint": "",
	"command_palette":
	{
		"height": 490.0,
		"last_filter": "",
		"selected_items":
		[
			[
				"Package Control: ",
				"Package Control: List Packages"
			],
			[
				"Package Control: i",
				"Package Control: Install Package"
			],
			[
				"extra",
				"Extract: Move selection to blade view ..."
			],
			[
				"Package Control: in",
				"Package Control: Install Package"
			]
		],
		"width": 1255.0
	},
	"console":
	{
		"height": 171.0,
		"history":
		[
		]
	},
	"distraction_free":
	{
		"menu_visible": true,
		"show_minimap": false,
		"show_open_files": false,
		"show_tabs": false,
		"side_bar_visible": false,
		"status_bar_visible": false
	},
	"file_history":
	[
		"/C/Users/user/AppData/Roaming/Sublime Text 3/Packages/PHP Companion/PHP Companion.sublime-settings"
	],
	"find":
	{
		"height": 0.0
	},
	"find_in_files":
	{
		"height": 0.0,
		"where_history":
		[
		]
	},
	"find_state":
	{
		"case_sensitive": false,
		"find_history":
		[
		],
		"highlight": true,
		"in_selection": false,
		"preserve_case": false,
		"regex": false,
		"replace_history":
		[
		],
		"reverse": false,
		"show_context": true,
		"use_buffer2": true,
		"whole_word": false,
		"wrap": true
	},
	"groups":
	[
		{
			"selected": 1,
			"sheets":
			[
				{
					"buffer": 0,
					"file": "//120.50.0.141/erp/routes/microfin.php",
					"semi_transient": false,
					"settings":
					{
						"buffer_size": 29506,
						"regions":
						{
						},
						"selection":
						[
							[
								1784,
								1784
							]
						],
						"settings":
						{
							"syntax": "Packages/PHP/PHP.sublime-syntax",
							"translate_tabs_to_spaces": false
						},
						"translation.x": 0.0,
						"translation.y": 0.0,
						"zoom_level": 1.0
					},
					"stack_index": 2,
					"type": "text"
				},
				{
					"buffer": 1,
					"file": "//120.50.0.141/erp/app/Http/Controllers/microfin/loan/MfnRegularLoanController.php",
					"semi_transient": false,
					"settings":
					{
						"buffer_size": 46329,
						"regions":
						{
						},
						"selection":
						[
							[
								5342,
								5342
							]
						],
						"settings":
						{
							"syntax": "Packages/PHP/PHP.sublime-syntax",
							"translate_tabs_to_spaces": false
						},
						"translation.x": 0.0,
						"translation.y": 2910.0,
						"zoom_level": 1.0
					},
					"stack_index": 0,
					"type": "text"
				},
				{
					"buffer": 2,
					"file": "//120.50.0.141/erp/resources/views/microfin/loan/regularLoan/addRegularLoan.blade.php",
					"semi_transient": false,
					"settings":
					{
						"buffer_size": 43585,
						"regions":
						{
						},
						"selection":
						[
							[
								465,
								465
							]
						],
						"settings":
						{
							"syntax": "Packages/Laravel Blade Highlighter/blade.sublime-syntax",
							"translate_tabs_to_spaces": false
						},
						"translation.x": 0.0,
						"translation.y": 0.0,
						"zoom_level": 1.0
					},
					"stack_index": 1,
					"type": "text"
				}
			]
		}
	],
	"incremental_find":
	{
		"height": 0.0
	},
	"input":
	{
		"height": 39.0
	},
	"layout":
	{
		"cells":
		[
			[
				0,
				0,
				1,
				1
			]
		],
		"cols":
		[
			0.0,
			1.0
		],
		"rows":
		[
			0.0,
			1.0
		]
	},
	"menu_visible": true,
	"output.find_results":
	{
		"height": 0.0
	},
	"pinned_build_system": "",
	"project": "abc.sublime-project",
	"replace":
	{
		"height": 0.0
	},
	"save_all_on_build": true,
	"select_file":
	{
		"height": 0.0,
		"last_filter": "",
		"selected_items":
		[
		],
		"width": 0.0
	},
	"select_project":
	{
		"height": 0.0,
		"last_filter": "",
		"selected_items":
		[
		],
		"width": 0.0
	},
	"select_symbol":
	{
		"height": 0.0,
		"last_filter": "",
		"selected_items":
		[
		],
		"width": 0.0
	},
	"selected_group": 0,
	"settings":
	{
	},
	"show_minimap": true,
	"show_open_files": false,
	"show_tabs": true,
	"side_bar_visible": true,
	"side_bar_width": 338.0,
	"status_bar_visible": true,
	"template_settings":
	{
	}
}
