Merge branches 'master' and 'master' of https://bitbucket.org/venbaittech/sparqapi

This commit is contained in:
Sanjeev 2021-03-11 12:03:24 +05:30
commit 4891658b60
6 changed files with 34 additions and 26 deletions

View File

@ -36,7 +36,7 @@ $config['api_user_auth_info'] = array(
//'updatePDMaster' => array(1,2,3,10,11,12,13,1,15,16,17,18,19,20),
'updatePDDocs' => array(1,2,3,10,11,12,13,1,15,16,17,18,19,20),
//'updatePDApplicants' => array(1,2,3,10,11,12,13,1,15,16,17,18,19,20),
'allocatePD' => array(2,3,4,5,10,21,22,25,26,20,27),
//'allocatePD' => array(2,3,4,5,10,21,22,25,26,20,27),
'schdulePD' => array(2,3,4,5,21,10,22,21),
'generatePDReport' => array(3,6,7,10),
'savePDPhotos' => array(3,4,5,6,7,10,21,22),

View File

@ -63,9 +63,9 @@ $config['cognito_resource_secret'] = getenv('TEST.COGNITO_RESOURCE_SECRET');
else if(ENVIRONMENT == 'production')
{
$config['sine_egde_pool_id'] = getenv('TEST.SINE_EGDE_POOL_ID');
$config['lender_pool_id'] = getenv('TEST.LENDER_POOL_ID');
$config['vendor_pool_id'] = getenv('TEST.VENDOR_POOL_ID');
$config['sine_egde_pool_id'] = getenv('PROD.SINE_EGDE_POOL_ID');
$config['lender_pool_id'] = getenv('PROD.LENDER_POOL_ID');
$config['vendor_pool_id'] = getenv('PROD.VENDOR_POOL_ID');
$config['authorization_key'] = 'TnAwuc64pVpcB9xf';

View File

@ -314,4 +314,5 @@ $route['loadDataFromExcel'] = 'SMC_Credit_PD_Controller/loadDataFromExcel';
$route['getSMCPDImgSectionData'] = 'SMC_Credit_PD_Controller/getSMCPDImgSectionData';
$route['smcCreditPDReport'] = 'SMC_Credit_PD_Controller/smcCreditPDReport';
$route['getCMUsers'] = 'SMC_Credit_PD_Controller/getCMUsers';
$route['smcCreditPDMisReport'] = 'SMC_Credit_PD_Controller/smcCreditPDMisReport';

View File

@ -2208,7 +2208,7 @@ public function assignPDTempalate($data)
if($pd_lender)
{
$smc_lender_id = ENVIRONMENT == 'production' ? 7 : 35; //pk id of SMC in live and demo
if($pd_lender = $smc_lender_id)
if($pd_lender == $smc_lender_id)
{
$createdby = '';
// $this->load->model('User_Management_Model');

View File

@ -1001,7 +1001,7 @@ class SMC_Credit_PD_Controller extends REST_Controller {
// file_put_contents('test.jpg', file_get_contents($url));
}
public function salesPDMisReport_post()
public function smcCreditPDMisReport_post()
{
//$lender_id = $this->uri->segment(2);
$officer_name = $this->post('officer_name');
@ -1009,38 +1009,38 @@ class SMC_Credit_PD_Controller extends REST_Controller {
$to_date = $this->post('to_date');
$columns = array('SMC_CREDIT_PD.smc_credit_pd','SMC_CREDIT_PD.sales_pd_sno','SMC_CREDIT_PD.applicant_name','concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as officer_name','SMC_CREDIT_PD.applicant_id','SMC_CREDIT_PD.lender_id','SMC_CREDIT_PD.product_id','SMC_CREDIT_PD.is_pdf','SMC_CREDIT_PD.is_edited','ENTITY.short_name','PRODUCT.abbr','SMC_CREDIT_PD.createdon','SMC_CREDIT_PD.status','SMC_CREDIT_PD.mail_status','SMC_CREDIT_PD.sales_pd_type','IF(SMC_CREDIT_PD.sales_pd_type = 1 ,"physical pd","tele pd") as sales_pd_type_name');
$table = SMC_CREDIT_PD.' as SMC_CREDIT_PD';
$columns = array('PDTRIGGER.pd_id','PDTRIGGER.pd_sno','PDTRIGGER.lender_applicant_id','PDTRIGGER.fk_product_id','PRODUCT.abbr','PDTRIGGER.pd_status','PDTRIGGER.pd_status as officer_name','PDAPPLICANTSDETAILS.applicant_name','COMMONMASTER.createdon',('(SELECT createdon FROM h_common_masters where PDTRIGGER.pd_id = primary_key AND field_name = "pd_status" order by log_id DESC limit 1) as updatedon'));
$table = PDTRIGGER.' as PDTRIGGER';
$joins = array(
array('table' => ENTITY. ' as ENTITY',
'condition' =>'SMC_CREDIT_PD.lender_id = ENTITY.entity_id',
'jointype' => 'INNER'),
array('table' => PRODUCTS. ' as PRODUCT',
'condition' =>'SMC_CREDIT_PD.product_id = PRODUCT.product_id',
'condition' =>'PDTRIGGER.fk_product_id = PRODUCT.product_id',
'jointype' => 'INNER'),
array('table' => USERPROFILE. ' as USERPROFILE',
'condition' =>'SMC_CREDIT_PD.createdby = USERPROFILE.userid',
'jointype' => 'LEFT')
array('table' => PDAPPLICANTSDETAILS. ' as PDAPPLICANTSDETAILS',
'condition' =>'PDTRIGGER.pd_id = PDAPPLICANTSDETAILS.fk_pd_id and applicant_type = 1',
'jointype' => 'LEFT'),
array('table' => COMMONMASTER. ' as COMMONMASTER',
'condition' =>'PDTRIGGER.pd_id = COMMONMASTER.primary_key and COMMONMASTER.table_name = "'.PDTRIGGER.'" and COMMONMASTER.field_name = "pd_status" and COMMONMASTER.new_value = "COMPLETED"',
'jointype' => 'LEFT'),
);
$where_condition_array = array();
$where_condition_array = array('PDTRIGGER.pd_status' => 'COMPLETED');
if($officer_name)
{
//$where_condition_array[] = array('SMC_CREDIT_PD.officer_name like' => '%'.$officer_name.'%');
$where_condition_array['SMC_CREDIT_PD.officer_name like'] = '%'.$officer_name.'%';
//$where_condition_array['PDTRIGGER.officer_name like'] = '%'.$officer_name.'%';
}
if($from_date)
{
$where_condition_array['date(SMC_CREDIT_PD.createdon) >='] = $from_date;
$where_condition_array['date(PDTRIGGER.createdon) >='] = $from_date;
}
if($to_date)
{
$where_condition_array['date(SMC_CREDIT_PD.createdon) <='] = $to_date;
$where_condition_array['date(PDTRIGGER.createdon) <='] = $to_date;
}
$order_by = 'SMC_CREDIT_PD.smc_credit_pd';
$order_by = 'PDTRIGGER.pd_id';
$SMC_CREDIT_PD = $this->SMC_Credit_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array,$order_by,'DESC');
//print_r($this->db->last_query());
if(count($SMC_CREDIT_PD))

View File

@ -284,12 +284,12 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<th class="thlargefont" colspan="8">Borrower`s Details</th>
</tr>
<tr>
<th colspan="1">Borrower<br> Type</th><th colspan="1">Name</th><th colspan="1">Entity Type</th><th colspan="1">Designation</th><th colspan="1">Relation</th><th colspan="1">Realtion to</th><th colspan="1">Age</th><th colspan="1">Borrower's vintage in<br>the business(Yrs)</th>
<th colspan="1">Borrower<br> Type</th><th colspan="1">Name</th><th colspan="1">Entity Type</th><th colspan="1">Designation</th><th colspan="1">Relation</th><th colspan="1">Realtion to</th><th colspan="1">Age/<br>Business vintage</th><th colspan="1">Borrower's vintage in<br>the business(Yrs)</th>
</tr>
<?php
foreach ($pd_section_data[1]['borrower_details'] as $key1 => $value1)
{
echo '<tr><td colspan="1" class = "tdcenteralign">'.$value1['borrower_type'].'</td> <td colspan="1" class = "tdcenteralign">'.$value1['borrower_name'].(isset($value1['mobile_numbers']) && $value1['mobile_numbers'] != '' ? ('<br>('. $value1['mobile_numbers'] .')'): '').'</td> <td colspan="1" class = "tdcenteralign">'.$value1['entity_type'].'</td> <td colspan="1" class = "tdcenteralign">'.$value1['designation'].'</td> <td colspan="1" class = "tdcenteralign">'.$value1['relationship'].'</td> <td colspan="1" class = "tdcenteralign">'.$value1['relationship_to'].'</td> <td colspan="1" class = "tdcenteralign">'.(isset($value1['borrower_age']) && !empty($value1['borrower_age']) ? $value1['borrower_age'] : 'NA').'</td> <td colspan="1" class = "tdcenteralign">'.(isset($value1['numbers_of_years_business_running']) && !empty($value1['numbers_of_years_business_running']) && (!strcasecmp($value1['entity_type'],'Individual'))? $value1['numbers_of_years_business_running'] : 'NA').'</td></tr>';
echo '<tr><td colspan="1" class = "tdcenteralign">'.$value1['borrower_type'].'</td> <td colspan="1" class = "tdcenteralign">'.$value1['borrower_name'].(isset($value1['mobile_numbers']) && $value1['mobile_numbers'] != '' ? ('<br>('. $value1['mobile_numbers'] .')'): '').'</td> <td colspan="1" class = "tdcenteralign">'.$value1['entity_type'].'</td> <td colspan="1" class = "tdcenteralign">'.$value1['designation'].'</td> <td colspan="1" class = "tdcenteralign">'.$value1['relationship'].'</td> <td colspan="1" class = "tdcenteralign">'.$value1['relationship_to'].'</td> <td colspan="1" class = "tdcenteralign">'.(isset($value1['borrower_age']) && !empty($value1['borrower_age']) ? $value1['borrower_age'] : ( (strcasecmp($value1['entity_type'],'Individual')) ? $value1['numbers_of_years_business_running'] : 'NA')).'</td> <td colspan="1" class = "tdcenteralign">'.(isset($value1['numbers_of_years_business_running']) && !empty($value1['numbers_of_years_business_running']) && (!strcasecmp($value1['entity_type'],'Individual'))? $value1['numbers_of_years_business_running'] : 'NA').'</td></tr>';
}
?>
@ -1025,8 +1025,15 @@ $business_pd_visited_remark = (isset($pd_section_data[8]['business_pd_visited_re
</table>
<table class="scorecard_table">
<tbody>
<?php echo '<tr> <td class="tdcenteralign" colspan="2">Debtor Days</td> <td colspan="2" class="tdcenteralign"</td>'.(isset($pd_section_data[10]['debtor_days_cm']) ? $pd_section_data[10]['debtor_days_cm'] : '-').'<td colspan="2" class="tdcenteralign">Creditor Days</td> <td colspan="2" class="tdcenteralign">'.( isset($pd_section_data[10]['creditor_days_cm']) ? $pd_section_data[10]['creditor_days_cm'] : '-').'</td> <td colspan="2" class="tdcenteralign">Stock Days</td> <td colspan="2" class="tdcenteralign">'.(isset($pd_section_data[10]['inventory_days_cm']) ? $pd_section_data[10]['inventory_days_cm'] : '-').'</td> </tr>'?>
<?php echo '<tr> <td colspan="8" class="tdcenteralign">Does the business have any working capital facility from any lender other than Moneywise? (Yes / No)</td> <td colspan="4" class="tdcenteralign">'.(isset($pd_section_data[10]['is_any_other_working_captial_facility']) ? $pd_section_data[10]['is_any_other_working_captial_facility'] : '-').'</td></tr>'?>
<?php echo '<tr>
<td class="tdcenteralign" colspan="2">Debtor Days</td>
<td colspan="2" class="tdcenteralign">'.(isset($pd_section_data[10]['debtor_days_cm']) ? $pd_section_data[10]['debtor_days_cm'] : '-').'</td>'.
'<td colspan="2" class="tdcenteralign">Creditor Days</td>
<td colspan="2" class="tdcenteralign">'.( isset($pd_section_data[10]['creditor_days_cm']) ? $pd_section_data[10]['creditor_days_cm'] : '-').'</td>
<td colspan="2" class="tdcenteralign">Stock Days</td>
<td colspan="2" class="tdcenteralign">'.(isset($pd_section_data[10]['inventory_days_cm']) ? $pd_section_data[10]['inventory_days_cm'] : '-').'</td>
</tr>'?>
<?php echo '<tr> <td colspan="8" class="tdcenteralign">Does the business have any working capital facility from any lender other than Moneywise? (Yes / No)</td> <td colspan="4" class="tdcenteralign">'.(isset($pd_section_data[10]['is_any_other_working_captial_facility'] ) && $pd_section_data[10]['is_any_other_working_captial_facility'] != '' ? $pd_section_data[10]['is_any_other_working_captial_facility'] : '-').'</td></tr>'?>
<?php
if(isset($pd_section_data[10]['facility_details_specify']))
{
@ -1034,8 +1041,8 @@ $business_pd_visited_remark = (isset($pd_section_data[8]['business_pd_visited_re
}
?>
<?php echo '<tr> <td class="tdcenteralign" colspan="2">Broken Period starting from</td> <td colspan="2" class="tdcenteralign"</td>'.$pd_section_data[10]['broken_period_from_month'].'<td colspan="2" class="tdcenteralign">Broken Period starting to</td> <td colspan="2" class="tdcenteralign">'.$pd_section_data[10]['broken_period_to_month'].'</td> <td colspan="2" class="tdcenteralign">No of Months</td> <td colspan="2" class="tdcenteralign">'.$pd_section_data[10]['broken_period_no_of_months'].'</td> </tr>'?>
<?php echo '<tr> <td class="tdcenteralign" colspan="2">Turn Over for Broken Period in CY</td> <td colspan="2" class="tdcenteralign"</td>'.$rupee_symbol.''. MYUTIL::customIndianNumberFormat($pd_section_data[10]['broken_period_turnover_cy']).'<td colspan="2" class="tdcenteralign">Turn Over for Broken Period in PY</td> <td colspan="2" class="tdcenteralign">'.$rupee_symbol.''.MYUTIL::customIndianNumberFormat($pd_section_data[10]['broken_period_turnover_py']).'</td> <td colspan="2" class="tdcenteralign">('.$uparrow.'/'. $downarrow.')in Turnover for Broken Period</td> <td colspan="2" class="tdcenteralign">'.$pd_section_data[10]['broken_period_turnover_percent'].'%</td> </tr>'?>
<?php echo '<tr> <td class="tdcenteralign" colspan="2">Broken Period starting from</td> <td colspan="2" class="tdcenteralign">'.$pd_section_data[10]['broken_period_from_month'].'</td><td colspan="2" class="tdcenteralign">Broken Period starting to</td> <td colspan="2" class="tdcenteralign">'.$pd_section_data[10]['broken_period_to_month'].'</td> <td colspan="2" class="tdcenteralign">No of Months</td> <td colspan="2" class="tdcenteralign">'.$pd_section_data[10]['broken_period_no_of_months'].'</td> </tr>'?>
<?php echo '<tr> <td class="tdcenteralign" colspan="2">Turn Over for Broken Period in CY</td> <td colspan="2" class="tdcenteralign">'.$rupee_symbol.''. MYUTIL::customIndianNumberFormat($pd_section_data[10]['broken_period_turnover_cy']).'</td><td colspan="2" class="tdcenteralign">Turn Over for Broken Period in PY</td> <td colspan="2" class="tdcenteralign">'.$rupee_symbol.''.MYUTIL::customIndianNumberFormat($pd_section_data[10]['broken_period_turnover_py']).'</td> <td colspan="2" class="tdcenteralign">('.$uparrow.'/'. $downarrow.')in Turnover for Broken Period</td> <td colspan="2" class="tdcenteralign">'.$pd_section_data[10]['broken_period_turnover_percent'].'%</td> </tr>'?>