diff --git a/api/application/config/routes.php b/api/application/config/routes.php index 2507b561..f9cb4c86 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -317,4 +317,5 @@ $route['getSMCPDImgSectionData'] = 'SMC_Credit_PD_Controller/getSMCPDImgSectionD $route['smcCreditPDReport'] = 'SMC_Credit_PD_Controller/smcCreditPDReport'; $route['getCMUsers'] = 'SMC_Credit_PD_Controller/getCMUsers'; $route['smcCreditPDMisReport'] = 'SMC_Credit_PD_Controller/smcCreditPDMisReport'; +$route['getCompanyListForSMCList'] = 'SMC_Credit_PD_Controller/getCompanyListForSMCList'; diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index 8be01e04..90592d14 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -1347,7 +1347,7 @@ public function filterSalesPDList_post() { $pd_master_data = $this->PD_Model->getPDMasterDetails($records['pd_id'],$records['random_string']); // $cur_section_data = array(); $cur_section_data = $this->loadDataFromExcelBusiProcess($pd_master_data,(isset($records['form_id']) && $records['form_id'] ? $records['form_id'] : null)); - // print_r($pd_master_data);die(); + // print_r($pd_master_data);die(); // echo $records['form_id'];die(); //check excel file in local, otherwise get it from s3 and store locallly @@ -1681,6 +1681,41 @@ public function filterSalesPDList_post() { // print_r($this->db->last_query()); } + + function getCompanyListForSMCList_post() + { + $records = $this->post('records'); + $pd_master_data = $this->PD_Model->getPDMasterDetails($records['pd_id'],$records['random_string']); + + $filename = ($pd_master_data[0]['re_uploaded'] ? XLPATH.'/tmp/'.$pd_master_data[0]['re_uploaded_file_name'] : XLPATH.'/tmp/'.$pd_master_data[0]['modified_fname']); + // $filename = '/home/VenbaLap08/Downloads/Test Demo17_dev.xlsx'; + + if(!file_exists($filename)) + { + $bucket_name = LENDER_BUCKET_NAME_PREFIX.$pd_master_data[0]['fk_lender_id']; + $key = 'tmp/'. ($pd_master_data[0]['re_uploaded'] ? $pd_master_data[0]['re_uploaded_file_name'] : $pd_master_data[0]['modified_fname']); + $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$key,'+5 minutes'); + + $sucess = file_put_contents($filename, file_get_contents($singed_uri)); + } + $cur_section_data = readexceldata::getCompanyListForSMCList($filename,$pd_master_data[0]['pd_id']); + + if(count($cur_section_data)) + { + $data['dataStatus'] = true; + $data['status'] = REST_Controller::HTTP_OK; + $data['records'] = $cur_section_data; + $this->response($data,REST_Controller::HTTP_OK); + } + else + { + $data['dataStatus'] = false; + $data['status'] = REST_Controller::HTTP_NOT_FOUND; + $data['msg'] = 'No Data Available!'; + $this->response($data,REST_Controller::HTTP_OK); + } + + } } diff --git a/api/application/helpers/loanform_helper.php b/api/application/helpers/loanform_helper.php index a92ed141..e70597cf 100644 --- a/api/application/helpers/loanform_helper.php +++ b/api/application/helpers/loanform_helper.php @@ -52,7 +52,13 @@ public static function getanchordetails($loan_form){ $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 (".$rupee_symbol.")",'details' => $rupee_symbol." ".$stock_related_amt.' ('.MYUTIL::numtowords($loan_form['stock_related_anchor']).')'); - $anchor_details_display[] = array('particulars' => "Observations on Sample Invoices",'details' => $loan_form['sample_invoices'] ); + $anchor_details_display[] = array('particulars' => "Observations on Sample Invoices",'details' => ucfirst($loan_form['sample_invoices']) ); + if($loan_form['sample_invoices']=='yes'){ + $anchor_details_display[] = array('particulars' => "Observations on Invoice and lorry receipts",'details' => ucfirst($loan_form['sampleinvoices_yes']) ); + } + if($loan_form['sample_invoices']=='no'){ + $anchor_details_display[] = array('particulars' => "Reason for no sample invoices",'details' => ucfirst($loan_form['sampleinvoices_no']) ); + } return $anchor_details_display; // print_r($anchor_details_display); } diff --git a/api/application/helpers/readexceldata_helper.php b/api/application/helpers/readexceldata_helper.php index 8dfa3e28..42ca54c1 100644 --- a/api/application/helpers/readexceldata_helper.php +++ b/api/application/helpers/readexceldata_helper.php @@ -445,5 +445,66 @@ class readexceldata // return date('m/d/Y',mktime(0,0,0,1,($excel_date-1),1900)); //gmdate("d-m-Y H:i:s", $UNIX_DATE); } + + public static function getCompanyListForSMCList($file_path_withname,$pd_id = null,$excel_file_id = null) + { + $CI =&get_instance(); + $CI->load->library('myspreadsheet'); + $CI->load->model('PD_Model'); + $section_id = 1; + SELF::$current_section_id = $section_id; + SELF::$current_excel_file_id = $excel_file_id; + + $spreadsheet_io_fact = $CI->myspreadsheet->getIOFactory($file_path_withname); + + $spreadsheet_io_fact->setActiveSheetIndex(0); + + $sheetData = $spreadsheet_io_fact->getActiveSheet()->toArray(null, true, false, true); + + $where_condition_array = array('isactive' => 1,'section_id' => $section_id); + + $section_ref_data = $CI->PD_Model->selectCustomRecords(array('*'),$where_condition_array,EXCEL_COLUMN_REF_NAME); + + $return_data = array(); + + $keys = array(); + + $company = array(); + + foreach ($sheetData as $key => $value) + { + $tmp = SELF::returnMatchedData($section_ref_data,$value);//print_r($tmp); + if(is_array($tmp)) + { + if(isset($tmp['parent_key'])) + { + $trimedData = SELF::trimExcelEmptyCells($value); + $temp[$tmp['parent_key']][$tmp['key_name']] = SELF::getMultipleCellValues($trimedData,$tmp['key_name']); + $keys[$tmp['parent_key']][] = $tmp['key_name']; + $return_data = $temp; + } + else + { + $temp[$tmp['key_name']] = $value['C']; + $return_data = $temp; + } + } + } + $return_data = SELF::transformRowColumsForMultipleData($return_data,$keys); + + + if(!empty($return_data['borrower_details'])){ + $cid=0;//for company ID + for($i=0;$i \ 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 2b95d152..16d1e4d8 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php @@ -1358,6 +1358,7 @@ if ( isset($pdf) ) { $loan_table_dispaly_rows[] = array('particulars' => 'Address of the property','details' => $address_of_owner_seller_property ); } //print_r($loan_table_dispaly_rows); + if($pd_master_details[0]['lender_short_name'] != 'CFPL'){ ?>

@@ -1371,11 +1372,8 @@ if ( isset($pdf) ) { ?>
-
".$loan_form['loandetails_remarks']; - ?> - @@ -1391,7 +1389,10 @@ if ( isset($pdf) ) { ?> - +
".$loan_form['loandetails_remarks']; + ?> @@ -2261,9 +2262,9 @@ if($total_no_of_business > 0) { 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 ); + // $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); @@ -2278,7 +2279,7 @@ if($total_no_of_business > 0) {

Financial Information

0){ @@ -2474,7 +2475,7 @@ if($total_no_of_business > 0) { + } }?> 'Address of the property','details' => $address_of_owner_seller_property ); } //print_r($loan_table_dispaly_rows); - ?> + if($pd_master_details[0]['lender_short_name'] != 'CFPL'){ ?>

@@ -1365,11 +1365,8 @@ if ( isset($pdf) ) { ?>
S.No Particulars Particular Details
-
".$loan_form['loandetails_remarks']; - ?> - @@ -1385,7 +1382,9 @@ if ( isset($pdf) ) { ?> - +
".$loan_form['loandetails_remarks']; + ?> @@ -2255,9 +2254,9 @@ if($total_no_of_business > 0) { 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 ); + // $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); @@ -2272,6 +2271,7 @@ if($total_no_of_business > 0) {

Financial Information

0) { + } }?> 'Address of the property','details' => $address_of_owner_seller_property ); } //print_r($loan_table_dispaly_rows); + if($pd_master_details[0]['lender_short_name'] != 'CFPL'){ ?>

@@ -1368,11 +1369,8 @@ if ( isset($pdf) ) { ?>
-
".$loan_form['loandetails_remarks']; - ?> - @@ -1388,7 +1386,10 @@ if ( isset($pdf) ) { ?> - +
".$loan_form['loandetails_remarks']; + ?> @@ -2259,9 +2260,9 @@ if($total_no_of_business > 0) { 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 ); + // $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); @@ -2276,7 +2277,7 @@ if($total_no_of_business > 0) {

Financial Information

0){ @@ -2472,7 +2473,7 @@ if($total_no_of_business > 0) { + } }?>