From 7f913b746169c20dc343362cb5ab4dbb7df3dfae Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Sat, 6 Mar 2021 14:33:50 +0530 Subject: [PATCH 1/3] SMC REPORT MINOR ISSUE --- api/application/config/customconfig_one.php | 6 +++--- .../views/smc_creditpd_reports/MWISE.php | 15 +++++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/api/application/config/customconfig_one.php b/api/application/config/customconfig_one.php index e2091f2d..3270ee99 100644 --- a/api/application/config/customconfig_one.php +++ b/api/application/config/customconfig_one.php @@ -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'; diff --git a/api/application/views/smc_creditpd_reports/MWISE.php b/api/application/views/smc_creditpd_reports/MWISE.php index 91bfcebd..fceac734 100644 --- a/api/application/views/smc_creditpd_reports/MWISE.php +++ b/api/application/views/smc_creditpd_reports/MWISE.php @@ -1025,8 +1025,15 @@ $business_pd_visited_remark = (isset($pd_section_data[8]['business_pd_visited_re - '?> - '?> + + + '. + ' + + + + '?> + '?> - '?> - '?> + '?> + '?> From 2a1407899f4be793e99a38fc3a3edb3c460cf9bf Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Mon, 8 Mar 2021 17:45:16 +0530 Subject: [PATCH 2/3] SMC AFTER LIVE FEDBCKS --- api/application/config/api_user_auth_config.php | 2 +- api/application/controllers/PD_Controller.php | 2 +- api/application/views/smc_creditpd_reports/MWISE.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/api/application/config/api_user_auth_config.php b/api/application/config/api_user_auth_config.php index d1ccf2f3..105a7a34 100644 --- a/api/application/config/api_user_auth_config.php +++ b/api/application/config/api_user_auth_config.php @@ -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), diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 3702c152..876d0670 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -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'); diff --git a/api/application/views/smc_creditpd_reports/MWISE.php b/api/application/views/smc_creditpd_reports/MWISE.php index fceac734..abd1108d 100644 --- a/api/application/views/smc_creditpd_reports/MWISE.php +++ b/api/application/views/smc_creditpd_reports/MWISE.php @@ -284,12 +284,12 @@ defined('BASEPATH') OR exit('No direct script access allowed'); - + $value1) { - echo ''; + echo ''; } ?> From 914785f10257126e5f92bea1430ba46767b2a0b4 Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Tue, 9 Mar 2021 13:49:02 +0530 Subject: [PATCH 3/3] SMC MIS REPORT --- api/application/config/routes.php | 1 + .../controllers/SMC_Credit_PD_Controller.php | 30 +++++++++---------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/api/application/config/routes.php b/api/application/config/routes.php index c4bbd5d4..de062273 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -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'; diff --git a/api/application/controllers/SMC_Credit_PD_Controller.php b/api/application/controllers/SMC_Credit_PD_Controller.php index f361d9e2..7fffda91 100644 --- a/api/application/controllers/SMC_Credit_PD_Controller.php +++ b/api/application/controllers/SMC_Credit_PD_Controller.php @@ -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))
Debtor Days '.(isset($pd_section_data[10]['debtor_days_cm']) ? $pd_section_data[10]['debtor_days_cm'] : '-').'Creditor Days '.( isset($pd_section_data[10]['creditor_days_cm']) ? $pd_section_data[10]['creditor_days_cm'] : '-').' Stock Days '.(isset($pd_section_data[10]['inventory_days_cm']) ? $pd_section_data[10]['inventory_days_cm'] : '-').'
Does the business have any working capital facility from any lender other than Moneywise? (Yes / No) '.(isset($pd_section_data[10]['is_any_other_working_captial_facility']) ? $pd_section_data[10]['is_any_other_working_captial_facility'] : '-').'
Debtor Days'.(isset($pd_section_data[10]['debtor_days_cm']) ? $pd_section_data[10]['debtor_days_cm'] : '-').'Creditor Days'.( isset($pd_section_data[10]['creditor_days_cm']) ? $pd_section_data[10]['creditor_days_cm'] : '-').'Stock Days'.(isset($pd_section_data[10]['inventory_days_cm']) ? $pd_section_data[10]['inventory_days_cm'] : '-').'
Does the business have any working capital facility from any lender other than Moneywise? (Yes / No) '.(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'] : '-').'
Broken Period starting from '.$pd_section_data[10]['broken_period_from_month'].'Broken Period starting to '.$pd_section_data[10]['broken_period_to_month'].' No of Months '.$pd_section_data[10]['broken_period_no_of_months'].'
Turn Over for Broken Period in CY '.$rupee_symbol.''. MYUTIL::customIndianNumberFormat($pd_section_data[10]['broken_period_turnover_cy']).'Turn Over for Broken Period in PY '.$rupee_symbol.''.MYUTIL::customIndianNumberFormat($pd_section_data[10]['broken_period_turnover_py']).' ('.$uparrow.'/'. $downarrow.')in Turnover for Broken Period '.$pd_section_data[10]['broken_period_turnover_percent'].'%
Broken Period starting from '.$pd_section_data[10]['broken_period_from_month'].'Broken Period starting to '.$pd_section_data[10]['broken_period_to_month'].' No of Months '.$pd_section_data[10]['broken_period_no_of_months'].'
Turn Over for Broken Period in CY '.$rupee_symbol.''. MYUTIL::customIndianNumberFormat($pd_section_data[10]['broken_period_turnover_cy']).'Turn Over for Broken Period in PY '.$rupee_symbol.''.MYUTIL::customIndianNumberFormat($pd_section_data[10]['broken_period_turnover_py']).' ('.$uparrow.'/'. $downarrow.')in Turnover for Broken Period '.$pd_section_data[10]['broken_period_turnover_percent'].'%
Borrower`s Details
Borrower
Type
NameEntity TypeDesignationRelationRealtion toAgeBorrower's vintage in
the business(Yrs)
Borrower
Type
NameEntity TypeDesignationRelationRealtion toAge/
Business vintage
Borrower's vintage in
the business(Yrs)
'.$value1['borrower_type'].' '.$value1['borrower_name'].(isset($value1['mobile_numbers']) && $value1['mobile_numbers'] != '' ? ('
('. $value1['mobile_numbers'] .')'): '').'
'.$value1['entity_type'].' '.$value1['designation'].' '.$value1['relationship'].' '.$value1['relationship_to'].' '.(isset($value1['borrower_age']) && !empty($value1['borrower_age']) ? $value1['borrower_age'] : 'NA').' '.(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').'
'.$value1['borrower_type'].' '.$value1['borrower_name'].(isset($value1['mobile_numbers']) && $value1['mobile_numbers'] != '' ? ('
('. $value1['mobile_numbers'] .')'): '').'
'.$value1['entity_type'].' '.$value1['designation'].' '.$value1['relationship'].' '.$value1['relationship_to'].' '.(isset($value1['borrower_age']) && !empty($value1['borrower_age']) ? $value1['borrower_age'] : ( (strcasecmp($value1['entity_type'],'Individual')) ? $value1['numbers_of_years_business_running'] : 'NA')).' '.(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').'