Merge remote-tracking branch 'origin/master'

This commit is contained in:
Velz2020 2021-04-20 16:40:17 +05:30
commit 55cf957221
7 changed files with 140 additions and 35 deletions

View File

@ -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';

View File

@ -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);
}
}
}

View File

@ -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);
}

View File

@ -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<count($return_data['borrower_details']);$i++){
$entity_type = $return_data['borrower_details'][$i]['entity_type'];;
if($entity_type != "Individual"){
$cid++;//for company ID
$return_data['borrower_details'][$i]['company_id'] = $cid;
array_push($company,$return_data['borrower_details'][$i]);
}
}
}
return $company;
}
}
?>

View File

@ -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'){
?>
<br><br>
<table class="scorecard_table_resonal_assest">
@ -1371,11 +1372,8 @@ if ( isset($pdf) ) {
?>
</tbody>
</table>
<?php
//
echo "<br><br>".$loan_form['loandetails_remarks'];
?>
<?php if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
<?php }
if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
$anchor_details_display = array();
$anchor_details_display=Loanform::getanchordetails($loan_form);
?>
@ -1391,7 +1389,10 @@ if ( isset($pdf) ) {
?>
</tbody>
</table>
<?php } ?>
<?php }
//
echo "<br><br>".$loan_form['loandetails_remarks'];
?>
<!-- ####################### End of Loan Details Details Section ############################-->
@ -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) {
<h3 contenteditable="true">Financial Information</h3>
<?php foreach($businessFinancialResult as $iterateFinance){
if($pd_master_details[0]['lender_short_name'] != 'CFPL'){
if($iterateFinance['is_statement'])
{
if(count($iterateFinance['statements'])>0){
@ -2474,7 +2475,7 @@ if($total_no_of_business > 0) {
<?php
//echo $iterateFinance['working_capital_receive'].$iterateFinance['working_capital_pay'].$iterateFinance['working_capital_unsold_stock'];
} ?>
} }?>
<?php
if(count($financial_kuccha_info))

View File

@ -1352,7 +1352,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'){ ?>
<br><br>
<table class="scorecard_table_resonal_assest">
<tr> <th style="text-align:center;">S.No</th> <th><?php echo $loan_word;?> Particulars</th> <th><?php echo $loan_word;?> Particular Details</th> </tr>
@ -1365,11 +1365,8 @@ if ( isset($pdf) ) {
?>
</tbody>
</table>
<?php
//
echo "<br><br>".$loan_form['loandetails_remarks'];
?>
<?php if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
<?php }
if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
$anchor_details_display = array();
$anchor_details_display=Loanform::getanchordetails($loan_form);
?>
@ -1385,7 +1382,9 @@ if ( isset($pdf) ) {
?>
</tbody>
</table>
<?php } ?>
<?php }
echo "<br><br>".$loan_form['loandetails_remarks'];
?>
<!-- ####################### End of Loan Details Details Section ############################-->
@ -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) {
<h3 contenteditable="true">Financial Information</h3>
<?php foreach($businessFinancialResult as $iterateFinance){
if($pd_master_details[0]['lender_short_name'] != 'CFPL'){
if($iterateFinance['is_statement'])
{
@ -2468,7 +2468,7 @@ if($total_no_of_business > 0) {
<?php
//echo $iterateFinance['working_capital_receive'].$iterateFinance['working_capital_pay'].$iterateFinance['working_capital_unsold_stock'];
} ?>
} }?>
<?php
if(count($financial_kuccha_info))

View File

@ -1355,6 +1355,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'){
?>
<br><br>
<table class="scorecard_table_resonal_assest">
@ -1368,11 +1369,8 @@ if ( isset($pdf) ) {
?>
</tbody>
</table>
<?php
//
echo "<br><br>".$loan_form['loandetails_remarks'];
?>
<?php if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
<?php }
if($pd_master_details[0]['lender_short_name'] == 'CFPL'){
$anchor_details_display = array();
$anchor_details_display=Loanform::getanchordetails($loan_form);
?>
@ -1388,7 +1386,10 @@ if ( isset($pdf) ) {
?>
</tbody>
</table>
<?php } ?>
<?php }
//
echo "<br><br>".$loan_form['loandetails_remarks'];
?>
<!-- ####################### End of Loan Details Details Section ############################-->
@ -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) {
<h3 contenteditable="true">Financial Information</h3>
<?php foreach($businessFinancialResult as $iterateFinance){
if($pd_master_details[0]['lender_short_name'] != 'CFPL'){
if($iterateFinance['is_statement'])
{
if(count($iterateFinance['statements'])>0){
@ -2472,7 +2473,7 @@ if($total_no_of_business > 0) {
<?php
//echo $iterateFinance['working_capital_receive'].$iterateFinance['working_capital_pay'].$iterateFinance['working_capital_unsold_stock'];
} ?>
} }?>
<?php
if(count($financial_kuccha_info))