From 700b2ad1c75accc0402e6912d6232b517ae5230c Mon Sep 17 00:00:00 2001 From: Sanjeev Date: Sat, 20 Mar 2021 18:55:58 +0530 Subject: [PATCH] cfpl lender's report changes : ps --- api/application/config/autoload.php | 2 +- api/application/controllers/PD_Controller.php | 13 ++- api/application/helpers/loanform_helper.php | 85 +++++++++++++++++++ .../report_templates/JSONTOREPORT_DI_AI.php | 69 +++++++++++++-- .../JSONTOREPORT_DI_AI_SMARTPD.php | 63 +++++++++++++- .../JSONTOREPORT_DI_AI_TELE_PD.php | 63 +++++++++++++- 6 files changed, 277 insertions(+), 18 deletions(-) create mode 100644 api/application/helpers/loanform_helper.php diff --git a/api/application/config/autoload.php b/api/application/config/autoload.php index 10e276c3..24025f75 100644 --- a/api/application/config/autoload.php +++ b/api/application/config/autoload.php @@ -89,7 +89,7 @@ $autoload['drivers'] = array(); | | $autoload['helper'] = array('url', 'file'); */ -$autoload['helper'] = array('url','file','form', 'jwt', 'authorization', 'date','mylog','myocr','mydb','pdalerts','myutil','myhttpclient','pdscore','businessform','otherincomeform','financialform','neighbourreferencecheckform', 'otherfamilyform', 'assetsform','stockform', 'bankingform','sms_gupshup','assessedincome','rentalform','external_dir_check','applicantname_grabber','vendor_form','custom_encryption','readexceldata'); +$autoload['helper'] = array('url','file','form', 'jwt', 'authorization', 'date','mylog','myocr','mydb','pdalerts','myutil','myhttpclient','pdscore','businessform','otherincomeform','financialform','neighbourreferencecheckform', 'otherfamilyform', 'assetsform','stockform', 'bankingform','sms_gupshup','assessedincome','rentalform','external_dir_check','applicantname_grabber','vendor_form','custom_encryption','readexceldata','loanform'); /* | ------------------------------------------------------------------- diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 24685713..09a53d64 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -6079,6 +6079,8 @@ public function getPDFormDetailsJSON_post() public function codeigniterViewTest_post() { + // echo "i am here"; + // exit(); // $host = getenv('DB_HOST'); // echo $this->config->item('new_db_variable'); // echo MY_CONSTANT; @@ -6139,7 +6141,8 @@ public function getPDFormDetailsJSON_post() { mkdir($this->external_path.'/pd_reports/'.$pdid,0761); } - + // echo "finally"; +// exit(); // $this->load->helper('DIFFCHECK'); // $old_version = $this->external_path.'/pd_reports/'.$pdid.'/a.html'; @@ -6231,7 +6234,7 @@ public function getPDFormDetailsJSON_post() $data['pd_master_details'] = $this->PD_Model->getPDMasterDetails($pdid); $data['applicants_details'] = $this->PD_Model->getApplicantsDetails($pdid); - print_r($data['pd_master_details']);die(); + // print_r($data['pd_master_details']);die(); //$data['satellite_path'] = $this->external_path.'/pd_reports/'. $pdid .'/satellite.png'; // $data['pd_master_details'][0]['lender_short_name'] = 'CLIXH'; // $data['pd_master_details'][0]['product_abbr'] = 'HL'; @@ -8415,9 +8418,13 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() function getLatestPDReportHTMLFile($pdid,$random_string,$return_type = false) { + // echo "now i am in child function "; + // exit(); if(($pdid != null || $pdid != "")) //&& (strlen($pdid) == 16) &&(is_string($pdid))) { $pd_data = $this->PD_Model->selectCustomRecords(array('pd_id','pd_report_html_filename'),array('random_string' => $random_string,'pd_id' => $pdid),PDTRIGGER); + + // print_r($pd_data);exit(); if(count($pd_data)) { @@ -8431,6 +8438,8 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() } file_put_contents($temp_file_path,$report_data); $view_name = 'pd_reports/'. $pd_data[0]['pd_id'] .'/temp.html'; + // echo $view_name; + // die(); return $this->load->view($view_name,array(),$return_type); diff --git a/api/application/helpers/loanform_helper.php b/api/application/helpers/loanform_helper.php new file mode 100644 index 00000000..8ab4eeb1 --- /dev/null +++ b/api/application/helpers/loanform_helper.php @@ -0,0 +1,85 @@ + 'Bill Wise','open_account' => 'Open Account'); + $sales_low_months=SELF::getMonths($loan_form['sales_low_months']); + + // if($loan_form['vintage_anchor_year'] > 1 ){ $yr = $loan_form['vintage_anchor_year']."Yrs";} + // else if($loan_form['vintage_anchor_year'] == 1 ){ $yr = $loan_form['vintage_anchor_year']."Yr"; } + // else{ $yr = ''; } + + // if($loan_form['vintage_anchor_month'] > 1 ){ $mnt = $loan_form['vintage_anchor_month']."Months";} + // else if($loan_form['vintage_anchor_month'] == 1 ){ $mnt = $loan_form['vintage_anchor_month']."Month"; } + // else{ $mnt = ''; } + + // if($mnt != '' && $yr != '' ){ $yrandmnt = $yr.' and '.$mnt; } + // else if($mnt == '' && $yr != ''){ $yrandmnt = $yr; } + // else if($mnt != '' && $yr == ''){ $yrandmnt = $mnt; } + // else{ $yrandmnt = '-';} + + $anchor_details_display[] = array('particulars' => "Facility Amount Applied For (₹)",'details' => ""." ".$facility_amt.' ('.MYUTIL::numtowords($loan_form['facility_amount']).')'); + $anchor_details_display[] = array('particulars' => "Name of Anchor",'details' => $loan_form['anchor_name']); + $anchor_details_display[] = array('particulars' => "Applicant's association vintage with the Anchor Year",'details' => $loan_form['vintage_anchor_year']); + $anchor_details_display[] = array('particulars' => "Applicant's association vintage with the Anchor Month",'details' => $loan_form['vintage_anchor_month']); + // $anchor_details_display[] = array('particulars' => "Applicant's association vintage with the Anchor Year and Month",'details' => $yrandmnt ); + $anchor_details_display[] = array('particulars' => "Monthly business (sale/purchase) with the Anchor (₹)",'details' => ""." ".$monthly_business_anchor_amt.' ('.MYUTIL::numtowords($loan_form['monthly_business_anchor']).')'); + $anchor_details_display[] = array('particulars' => "Business concentration with Anchor",'details' => $loan_form['business_concentration'].' %'); + $anchor_details_display[] = array('particulars' => "Credit period with the Anchor (Days)",'details' => $loan_form['credit_period_days']); + $anchor_details_display[] = array('particulars' => "Payment Mechanism", + 'details' => $payment_mechanism_arr[$loan_form['payment_mechanism']]); + $anchor_details_display[] = array('particulars' => "Average Invoice Value (₹)",'details' => ""." ".$average_invoicevalue_amt.' ('.MYUTIL::numtowords($loan_form['average_invoicevalue']).')'); + $anchor_details_display[] = array('particulars' => "Are there peak seasons for the business with Anchor",'details' => ucfirst($loan_form['peakseasons_anchor'])); + if($loan_form['peakseasons_anchor']=='yes') + { + $anchor_details_display[] = array('particulars' => "Months in which sales/service is low?",'details' => $sales_low_months ); + $anchor_details_display[] = array('particulars' => "Comments",'details' => $loan_form['peak_season_comment'] ); + } + $anchor_details_display[] = array('particulars' => "Are there debit/credit notes being issued to/by Anchor",'details' => ucfirst($loan_form['anchor_notes'])); + if($loan_form['anchor_notes']=='yes'){ + $anchor_details_display[] = array('particulars' => "Reason for such debit/credit notes",'details' => ucfirst($loan_form['debitcredit_notes']) ); + } + $anchor_details_display[] = array('particulars' => "Value of stock related to Anchor (₹)",'details' => ""." ".$stock_related_amt.' ('.MYUTIL::numtowords($loan_form['stock_related_anchor']).')'); + $anchor_details_display[] = array('particulars' => "Observations on Sample Invoices",'details' => $loan_form['sample_invoices'] ); + return $anchor_details_display; + // print_r($anchor_details_display); +} + + public static function getMonths($details) { + foreach($details as $key=>$value){ + $getRow=$getRow; + $getRow .= ($key==0) ? "":($key==count($details)-1 ? ' and ' : ","); + switch($value) { + case 1:$getRow .='January';break; + case 2:$getRow .='February';break; + case 3:$getRow .='March';break; + case 4:$getRow .='April';break; + case 5:$getRow .='May';break; + case 6:$getRow .='June';break; + case 7:$getRow .='July';break; + case 8:$getRow .='August';break; + case 9:$getRow .='September';break; + case 10:$getRow .='October';break; + case 11:$getRow .='November';break; + case 12:$getRow .='December';break; + } + } + return $getRow; + } + + +} +?> \ No newline at end of file diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php index 764242ae..7ec30459 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php @@ -1371,6 +1371,23 @@ if ( isset($pdf) ) { // echo "

".$loan_form['loandetails_remarks']; ?> + +

Anchor Details Section:

+ + + + $row) + { + echo '"; + } + ?> + +
S.No Particulars Particular Details
'.($row_key + 1)." ".$row['particulars']." ".$row['details'] ."
+ @@ -2217,6 +2234,18 @@ if($total_no_of_business > 0) { case 7: $businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['od_limit']; break; + case 8 : $businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['lender_name']; + break; + case 9 : $businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_amount']; + break; + case 10 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_type']; + break; + case 11 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_tenor']; + break; + case 12 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_start_date']; + break; + case 13 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['monthly_emi']; + break; } } } @@ -2225,8 +2254,14 @@ if($total_no_of_business > 0) { $bindBusinessFinancial['estimate_posmachine_or_cc_annual_sales'] = isset($businessFinancialRow['estimated_value'][0]['estimate_posmachine_or_cc_annual_sales']) ? $businessFinancialRow['estimated_value'][0]['estimate_posmachine_or_cc_annual_sales'] : null; //print_r($bindBusinessFinancial['select_working_capital_facilities_availed']); //FINANCIALFORM::getAvailableFacilities($businessFinancialRow[-'"working_capital_facilities_availed']); - - array_push($businessFinancialResult,$bindBusinessFinancial); + if($pd_master_details[0]['lender_short_name'] == 'CFPL'){ + $bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Turnover in last completed Year",'details' => isset($businessFinancialRow['turnover_lastcomplete_year'])?$businessFinancialRow['turnover_lastcomplete_year']: null ); + $bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "YTD turnover (till last month)",'details' => isset($businessFinancialRow['ytd_turnover'])?$businessFinancialRow['ytd_turnover']: null ); + $bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall debtor collection period",'details' => isset($businessFinancialRow['deptor_collection_period'])?$businessFinancialRow['deptor_collection_period']: null ); + $bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall Inventory holding period",'details' => isset($businessFinancialRow['inventory_holding_period'])?$businessFinancialRow['inventory_holding_period']: null ); + $bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall creditor payment period",'details' => isset($businessFinancialRow['creditor_payment_period'])?$businessFinancialRow['creditor_payment_period']: null ); + } + array_push($businessFinancialResult,$bindBusinessFinancial); ?> @@ -2300,13 +2335,13 @@ if($total_no_of_business > 0) { } else { if($pd_master_details[0]['fk_pd_type'] == 1) { echo "

Financial statements not provided by ".$loan_word." Applicants to PD officer.

";} } + // if($pd_master_details[0]['lender_short_name'] != 'CFPL' ) {} ?>

0){ @@ -2463,7 +2498,27 @@ if($total_no_of_business > 0) { echo '
Orders in Hand to be executed in Current FY : '. $current_business_info['orders_hand_FY']; } ?> -

Working Capital Cycle:

+ + + + + + $facility){ + echo ''; + }?> + +
S.No Particulars Details
'.(++$fk) .''.$facility['name'].' '.$facility['details'].'
+ + +

@@ -2475,18 +2530,18 @@ if($total_no_of_business > 0) { -

Working Capital Facilities:

+

S.No Particulars Days
$facility){ - + echo ''; }?>
S.No Facility Type Facility Details
'.(++$fk) .''.$facility['name'].' '.$facility['details'].'
- The Loan Applicants have not availed any Working Capital Facilities from any financial institution.

";} + The Loan Applicants have not availed any ".$business_fin_sub_title2." from any financial institution.

";} } ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI_SMARTPD.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI_SMARTPD.php index 8e6a9bcb..c09caf9e 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI_SMARTPD.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI_SMARTPD.php @@ -1368,6 +1368,23 @@ if ( isset($pdf) ) { // echo "

".$loan_form['loandetails_remarks']; ?> + +

Anchor Details Section:

+ + + + $row) + { + echo '"; + } + ?> + +
S.No Particulars Particular Details
'.($row_key + 1)." ".$row['particulars']." ".$row['details'] ."
+ @@ -2214,6 +2231,18 @@ if($total_no_of_business > 0) { case 7: $businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['od_limit']; break; + case 8 : $businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['lender_name']; + break; + case 9 : $businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_amount']; + break; + case 10 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_type']; + break; + case 11 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_tenor']; + break; + case 12 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_start_date']; + break; + case 13 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['monthly_emi']; + break; } } } @@ -2222,7 +2251,13 @@ if($total_no_of_business > 0) { $bindBusinessFinancial['estimate_posmachine_or_cc_annual_sales'] = isset($businessFinancialRow['estimated_value'][0]['estimate_posmachine_or_cc_annual_sales']) ? $businessFinancialRow['estimated_value'][0]['estimate_posmachine_or_cc_annual_sales'] : null; //print_r($bindBusinessFinancial['select_working_capital_facilities_availed']); //FINANCIALFORM::getAvailableFacilities($businessFinancialRow[-'"working_capital_facilities_availed']); - + if($pd_master_details[0]['lender_short_name'] == 'CFPL'){ + $bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Turnover in last completed Year",'details' => isset($businessFinancialRow['turnover_lastcomplete_year'])?$businessFinancialRow['turnover_lastcomplete_year']: null ); + $bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "YTD turnover (till last month)",'details' => isset($businessFinancialRow['ytd_turnover'])?$businessFinancialRow['ytd_turnover']: null ); + $bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall debtor collection period",'details' => isset($businessFinancialRow['deptor_collection_period'])?$businessFinancialRow['deptor_collection_period']: null ); + $bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall Inventory holding period",'details' => isset($businessFinancialRow['inventory_holding_period'])?$businessFinancialRow['inventory_holding_period']: null ); + $bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall creditor payment period",'details' => isset($businessFinancialRow['creditor_payment_period'])?$businessFinancialRow['creditor_payment_period']: null ); + } array_push($businessFinancialResult,$bindBusinessFinancial); ?> @@ -2460,7 +2495,27 @@ if($total_no_of_business > 0) { echo '
Orders in Hand to be executed in Current FY : '. $current_business_info['orders_hand_FY']; } ?> -

Working Capital Cycle:

+ + + + + + $facility){ + echo ''; + }?> + +
S.No Particulars Details
'.(++$fk) .''.$facility['name'].' '.$facility['details'].'
+ + +

@@ -2472,7 +2527,7 @@ if($total_no_of_business > 0) { -

Working Capital Facilities:

+

S.No Particulars Days
@@ -2483,7 +2538,7 @@ if($total_no_of_business > 0) { }?>
S.No Facility Type Facility Details
- The Loan Applicants have not availed any Working Capital Facilities from any financial institution.

";} + The Loan Applicants have not availed any ".$business_fin_sub_title2." from any financial institution.

";} } ?> diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI_TELE_PD.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI_TELE_PD.php index a9218d9d..88ad07df 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI_TELE_PD.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI_TELE_PD.php @@ -1372,6 +1372,23 @@ if ( isset($pdf) ) { // echo "

".$loan_form['loandetails_remarks']; ?> + +

Anchor Details Section:

+ + + + $row) + { + echo '"; + } + ?> + +
S.No Particulars Particular Details
'.($row_key + 1)." ".$row['particulars']." ".$row['details'] ."
+ @@ -2219,6 +2236,18 @@ if($total_no_of_business > 0) { case 7: $businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['od_limit']; break; + case 8 : $businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['lender_name']; + break; + case 9 : $businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_amount']; + break; + case 10 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_type']; + break; + case 11 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_tenor']; + break; + case 12 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['loan_start_date']; + break; + case 13 :$businessFinancialRow['select_working_capital_facilities_availed'][$k]['details'] = $businessFinancialRow['monthly_emi']; + break; } } } @@ -2227,7 +2256,13 @@ if($total_no_of_business > 0) { $bindBusinessFinancial['estimate_posmachine_or_cc_annual_sales'] = isset($businessFinancialRow['estimated_value'][0]['estimate_posmachine_or_cc_annual_sales']) ? $businessFinancialRow['estimated_value'][0]['estimate_posmachine_or_cc_annual_sales'] : null; //print_r($bindBusinessFinancial['select_working_capital_facilities_availed']); //FINANCIALFORM::getAvailableFacilities($businessFinancialRow[-'"working_capital_facilities_availed']); - + if($pd_master_details[0]['lender_short_name'] == 'CFPL'){ + $bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Turnover in last completed Year",'details' => isset($businessFinancialRow['turnover_lastcomplete_year'])?$businessFinancialRow['turnover_lastcomplete_year']: null ); + $bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "YTD turnover (till last month)",'details' => isset($businessFinancialRow['ytd_turnover'])?$businessFinancialRow['ytd_turnover']: null ); + $bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall debtor collection period",'details' => isset($businessFinancialRow['deptor_collection_period'])?$businessFinancialRow['deptor_collection_period']: null ); + $bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall Inventory holding period",'details' => isset($businessFinancialRow['inventory_holding_period'])?$businessFinancialRow['inventory_holding_period']: null ); + $bindBusinessFinancial['cfpl_lender_details'][] = array('name' => "Overall creditor payment period",'details' => isset($businessFinancialRow['creditor_payment_period'])?$businessFinancialRow['creditor_payment_period']: null ); + } array_push($businessFinancialResult,$bindBusinessFinancial); ?> @@ -2462,7 +2497,27 @@ if($total_no_of_business > 0) { echo '
Orders in Hand to be executed in Current FY : '. $current_business_info['orders_hand_FY']; } ?> -

Working Capital Cycle:

+ + + + + + $facility){ + echo ''; + }?> + +
S.No Particulars Details
'.(++$fk) .''.$facility['name'].' '.$facility['details'].'
+ + +

@@ -2474,7 +2529,7 @@ if($total_no_of_business > 0) { -

Working Capital Facilities:

+

S.No Particulars Days
@@ -2485,7 +2540,7 @@ if($total_no_of_business > 0) { }?>
S.No Facility Type Facility Details
- The Loan Applicants have not availed any Working Capital Facilities from any financial institution.

";} + The Loan Applicants have not availed any ".$business_fin_sub_title2." from any financial institution.

";} } ?>