From cb53596dadbae34d6dc6d3c9fbdab3f1c35b0cdd Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Thu, 26 Nov 2020 19:11:02 +0530 Subject: [PATCH] SMC REPORT 3 --- .../helpers/applicantname_grabber_helper.php | 2 +- .../helpers/readexceldata_helper.php | 7 +- .../helpers/smc_creditpd_helper.php | 34 ++-- .../views/smc_creditpd_reports/MWISE.php | 155 ++++++++++++------ 4 files changed, 137 insertions(+), 61 deletions(-) diff --git a/api/application/helpers/applicantname_grabber_helper.php b/api/application/helpers/applicantname_grabber_helper.php index 8a5c87f2..a388b344 100644 --- a/api/application/helpers/applicantname_grabber_helper.php +++ b/api/application/helpers/applicantname_grabber_helper.php @@ -14,7 +14,7 @@ class applicantname_grabber $joins = array( array('table' => TITLES. ' as TITLES', 'condition' =>"PDAPPLICANTSDETAILS.applicant_title_name = TITLES.title_id AND PDAPPLICANTSDETAILS.fk_pd_id = $pd_id", - 'jointype' => 'INNER') + 'jointype' => 'LEFT') ); return ( $CI->PD_Model->getJoinRecords($columns,$table,$joins)); diff --git a/api/application/helpers/readexceldata_helper.php b/api/application/helpers/readexceldata_helper.php index 1e0b671e..2e694217 100644 --- a/api/application/helpers/readexceldata_helper.php +++ b/api/application/helpers/readexceldata_helper.php @@ -97,6 +97,7 @@ class readexceldata if(isset($tmp['parent_key'])) { $trimedData = SELF::trimExcelEmptyCells($value); + // $trimedData = ($value); $temp[$tmp['parent_key']][$tmp['key_name']] = SELF::getMultipleCellValues($trimedData,$tmp['key_name']); $keys[$tmp['parent_key']][] = $tmp['key_name']; $return_data = $temp; @@ -117,9 +118,9 @@ class readexceldata $return_data['financial_info'] = array_reverse($return_data['financial_info']); $return_data['broken_period_turnover_percent'] = SELF::getNumFormat($return_data['broken_period_turnover_percent'],'per'); - $return_data['net_profit_to_sales_percent'] = SELF::getNumFormat($return_data['net_profit_to_sales_percent'],'per'); - $return_data['net_profit_rs'] = SELF::getNumFormat($return_data['net_profit_rs']); - $return_data['sales_amount'] = SELF::getNumFormat($return_data['net_profit_rs']); + // $return_data['net_profit_to_sales_percent'] = SELF::getNumFormat($return_data['net_profit_to_sales_percent'],'per'); + // $return_data['net_profit_rs'] = SELF::getNumFormat($return_data['net_profit_rs']); + // $return_data['sales_amount'] = SELF::getNumFormat($return_data['sales_amount']); $return_data['broken_period_turnover_cy'] = SELF::getNumFormat($return_data['broken_period_turnover_cy']); $return_data['broken_period_turnover_py'] = SELF::getNumFormat($return_data['broken_period_turnover_py']); diff --git a/api/application/helpers/smc_creditpd_helper.php b/api/application/helpers/smc_creditpd_helper.php index 6efd5ded..661c446b 100644 --- a/api/application/helpers/smc_creditpd_helper.php +++ b/api/application/helpers/smc_creditpd_helper.php @@ -166,6 +166,7 @@ class smc_creditpd $five_row = ''.' Payment Terms '; $siz_row = ''.' Payment Mode '; $seven_row = ''.' No of days credit '; + $eigth_row = ''.'Total purchase done on credit '; if(isset($json['supplier_details']) && is_array($json['supplier_details']) && count($json['supplier_details'])) { foreach ($json['supplier_details'] as $key => $value) @@ -174,12 +175,13 @@ class smc_creditpd $header_row .= 'Supplier '.$value['supplier_name'].''; $first_row .= ''. $value['provider_name'] .''; $second_row .= ''. $value['contact_person_name'] .''; - $third_row .= ' '. $value['contact_person_mobile_no'] .' '; + $third_row .= ' '. (empty($value['contact_person_mobile_no']) ? '-':$value['contact_person_mobile_no']) .' '; // $business_name_of_the_owner = (isset($value['business_name_of_the_owner']) ? (applicantname_grabber::getApplicantsNameById($value['business_name_of_the_owner'],$applicant_details)): 'NA'); $fourth_row .= ' '. $value['person_stdcode'].' - '.$value['person_landline'] .' '; $five_row .= ' '. (isset($value['payment_type']) ? $payment_term [ $value['payment_type'] ]: 'NA') .' '; $siz_row .= ' '. (isset($value['payment_mode']) ? $value['payment_mode'] : 'NA') .' '; $seven_row .= ' '. (isset($value['credit_period_no']) ? $value['credit_period_no'] : 'NA') .' '; + $eigth_row .= ' '. (isset($value['credit_total_purchase']) ? $value['credit_total_purchase'].'%' : 'NA') .' '; } $header_row .= ''; $first_row .= ''; @@ -189,8 +191,9 @@ class smc_creditpd $five_row .= ''; $siz_row .= ''; $seven_row .= ''; + $eigth_row .= ''; - $json['display_data'] = array('header_row' => $header_row,'first_row' => $first_row,'second_row' => $second_row,'third_row' => $third_row,'fourth_row' => $fourth_row,'five_row' => $five_row,'siz_row' => $siz_row,'seven_row' => $seven_row); + $json['display_data'] = array('header_row' => $header_row,'first_row' => $first_row,'second_row' => $second_row,'third_row' => $third_row,'fourth_row' => $fourth_row,'five_row' => $five_row,'siz_row' => $siz_row,'seven_row' => $seven_row,'eigth_row' => $eigth_row); } return $json; } @@ -211,6 +214,7 @@ class smc_creditpd $five_row = ''.' Payment Terms '; $siz_row = ''.' Payment Mode '; $seven_row = ''.' No of days credit '; + $eight_row = ''.'Total sales done on credit'; foreach ($json['client_details'] as $key => $value) { @@ -218,12 +222,14 @@ class smc_creditpd $header_row .= 'Client '.$value['client_name'].''; $first_row .= ''. $value['provider_name'] .''; $second_row .= ''. $value['contact_person_name'] .''; - $third_row .= ' '. $value['contact_person_mobile_no'] .' '; + $third_row .= ' '. (empty($value['contact_person_mobile_no']) ? '-':$value['contact_person_mobile_no']) .' '; // $business_name_of_the_owner = (isset($value['business_name_of_the_owner']) ? (applicantname_grabber::getApplicantsNameById($value['business_name_of_the_owner'],$applicant_details)): 'NA'); $fourth_row .= ' '. $value['person_stdcode'].' - '.$value['person_landline'] .' '; $five_row .= ' '. (isset($value['payment_type']) ? $payment_term [ $value['payment_type'] ]: 'NA') .' '; $siz_row .= ' '. (isset($value['payment_mode']) ? $value['payment_mode'] : 'NA') .' '; $seven_row .= ' '. (isset($value['credit_period_no']) ? $value['credit_period_no'] : 'NA') .' '; + $eight_row .= ' '. (isset($value['credit_total_purchase']) ? $value['credit_total_purchase'].'%' : 'NA') .' '; + } $header_row .= ''; @@ -234,8 +240,9 @@ class smc_creditpd $five_row .= ''; $siz_row .= ''; $seven_row .= ''; + $eight_row .= ''; - $json['display_data'] = array('header_row' => $header_row,'first_row' => $first_row,'second_row' => $second_row,'third_row' => $third_row,'fourth_row' => $fourth_row,'five_row' => $five_row,'siz_row' => $siz_row,'seven_row' => $seven_row); + $json['display_data'] = array('header_row' => $header_row,'first_row' => $first_row,'second_row' => $second_row,'third_row' => $third_row,'fourth_row' => $fourth_row,'five_row' => $five_row,'siz_row' => $siz_row,'seven_row' => $seven_row,'eight_row' => $eight_row); } return $json; } @@ -317,6 +324,7 @@ class smc_creditpd static function getNeibourSectionData($section) { $json = json_decode($section['json'],true); + $applicant_details = applicantname_grabber::getLatestApplicantsName(SELF::$current_pd_id); $payment_term = array('1' => 'Supply against advance payment','2' => 'Payment on Receipt of goods / service','3' => 'Payment after Credit Period provided'); // print_r($json);die(); // $header_row = ''.' Particulars '; @@ -324,6 +332,7 @@ class smc_creditpd $second_row = ''.' Does the person met
know who operates this business? (Yes / NO) '; $third_row = ''.' As per person met, how long has the applicants`
business been running from this location '; + $owner_row = ''.' As per person met, how long has the applicants`
business been running from this location '; $fourth_row = ''.' Any other remarks '; $five_row = ''.' Neighbourhood Check
Positive / Negative / Could not verify '; // $siz_row = ''.' Payment Mode '; @@ -338,6 +347,8 @@ class smc_creditpd $time = isset($value['how_long_do_know_in_year']) ? $value['how_long_do_know_in_year'].'Yr(s)' : '';$time .= (isset($value['how_long_do_know_in_month']) && $value['how_long_do_know_in_month'] != 0 ? (' & '.$value['how_long_do_know_in_month'].' Mnt(s)'): ''); $time = empty($time) ? '-' : $time; $third_row .= ' '. $time .' '; + $owner_name = isset($value['organisation_owner']) ? applicantname_grabber::getMultipleApplicantsNameById($value['organisation_owner'],$applicant_details) : ''; + $owner_row .= ''.($owner_name != '' ? $owner_name : '-').''; $colspan++; // $business_name_of_the_owner = (isset($value['business_name_of_the_owner']) ? (applicantname_grabber::getApplicantsNameById($value['business_name_of_the_owner'],$applicant_details)): 'NA'); // $fourth_row .= ' '. $value['how_long_do_know_in_year'].' - '.$value['how_long_do_know_in_month'] .' '; @@ -355,7 +366,7 @@ class smc_creditpd // $siz_row .= ''; // $seven_row .= ''; - $json['display_data'] = array('first_row' => $first_row,'second_row' => $second_row,'third_row' => $third_row,'fourth_row' => $fourth_row,'five_row' => $five_row); + $json['display_data'] = array('first_row' => $first_row,'second_row' => $second_row,'third_row' => $third_row,'fourth_row' => $fourth_row,'five_row' => $five_row,'owner_row' => $owner_row); return $json; } @@ -365,8 +376,8 @@ class smc_creditpd $json = json_decode($section['json'],true); // print_r($json);//die(); - $json['address_type'] = SELF::getDBvalue(ADDRESSTYPE,ADDRESSTYPEID,$json['address_type']); - $json['pd_locality'] = SELF::getDBvalue(LOCALITY,LOCALITYID,$json['pd_locality']); + $json['address_type'] = isset($json['address_type_others']) && ($json['address_type'] == 1) ? (array('address_type' => $json['address_type_others'])):SELF::getDBvalue(ADDRESSTYPE,ADDRESSTYPEID,$json['address_type']); + $json['pd_locality'] = isset($json['locality_other']) && $json['pd_locality'] == 1 ? (array('locality_name' => $json['locality_other'])) : SELF::getDBvalue(LOCALITY,LOCALITYID,$json['pd_locality']); $json['pd_location'] = SELF::getDBvalue(PDLOCATIONAPPROACH,PDLOCATIONAPPROACHID,$json['pd_location']); $json['comment_locality'] = SELF::getDBvalue(COMMENTSONLOCALITY,COMMENTSONLOCALITYID,$json['comment_locality']); @@ -417,15 +428,18 @@ class smc_creditpd $applicant_details = applicantname_grabber::getLatestApplicantsName(SELF::$current_pd_id); // print_r($json);die(); - $json['owner_name'] = applicantname_grabber::getMultipleApplicantsNameById($json['owner_name'],$applicant_details); + $json['owner_name'] = isset($json['owner_name']) ? applicantname_grabber::getMultipleApplicantsNameById($json['owner_name'],$applicant_details) : ''; if(isset($json['lender'])) { $json['lender'] = SELF::getDBvalue(BTLENDERLIST,BTLENDERLISTID,$json['lender']); } - $json['state'] = SELF::getDBvalue(STATE,STATEID,$json['state']); - $json['city'] = SELF::getDBvalue(CITY,CITYID,$json['city']); + $json['state'] = isset($json['state']) ? SELF::getDBvalue(STATE,STATEID,$json['state']) : ''; + $json['city'] = isset($json['city']) ? SELF::getDBvalue(CITY,CITYID,$json['city']) : ''; + if(isset($json['pincode'])) + { $pin = $json['pincode'] != 1 ? SELF::getDBvalue(PINCODE,PINCODEID,$json['pincode']) : $json['pincode_others']; $json['pincode'] = is_array($pin) ? $pin['pincode'] : $pin; + } // print_r($json);die(); return $json; diff --git a/api/application/views/smc_creditpd_reports/MWISE.php b/api/application/views/smc_creditpd_reports/MWISE.php index 1a9554f3..4d2265d7 100644 --- a/api/application/views/smc_creditpd_reports/MWISE.php +++ b/api/application/views/smc_creditpd_reports/MWISE.php @@ -155,7 +155,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); Name of the Company/Firm - + @@ -208,7 +208,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $value1) { - echo ''.$value1['borrower_type'].' '.$value1['borrower_name'].' '.$value1['entity_type'].' '.$value1['designation'].' '.$value1['relationship'].' '.$value1['relationship_to'].' '.(isset($value1['borrower_age']) ? : 'NA').' '.(isset($value1['numbers_of_years_business_running']) ? $value1['numbers_of_years_business_running'] : 'NA').''; + echo ''.$value1['borrower_type'].' '.$value1['borrower_name'].' '.$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']) ? $value1['numbers_of_years_business_running'] : 'NA').''; } ?> @@ -223,9 +223,9 @@ defined('BASEPATH') OR exit('No direct script access allowed'); Fund Requirement - Loan Amount Applied for (Rs) + Loan Amount Applied for () - Total Fund Requirement (Rs) + Total Fund Requirement () @@ -235,6 +235,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); + Loan tenure + + + + Is There any Balance Transfer @@ -277,6 +282,13 @@ defined('BASEPATH') OR exit('No direct script access allowed'); Structure type + + + + Remarks + + +
@@ -347,7 +359,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } } - if(isset($pd_section_data[16]['common_remarks'])) + if(isset($pd_section_data[16]['common_remarks']) && !empty($pd_section_data[16]['common_remarks'])) { echo 'Remarks'.$pd_section_data[16]['common_remarks'] .''; } @@ -387,7 +399,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); // { // echo 'Remarks'.$pd_section_data[6]['business_process'] .''; // } - if(isset($pd_section_data[6]['common_remarks'])) + if(isset($pd_section_data[6]['common_remarks']) && !empty($pd_section_data[6]['common_remarks'])) { echo 'Remarks'.$pd_section_data[6]['common_remarks'] .''; } @@ -415,7 +427,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); No of Employees as per person met No fo Employees Sighted during the Visit - Approx Salary Paid per month (Rs) + Approx Salary Paid per month () @@ -479,8 +491,37 @@ defined('BASEPATH') OR exit('No direct script access allowed');
+ - + + + + + + + + + + + + + + + + + + + +
Business Assets
Business Asset
Business asset address
business operating duration
in visited premises
Business activities seen
Business ownership type
Asset approximate market value
Age of asset
Owner(s) Name
Loan Existing against asset
+ + +
+
+ +
Other Business Assets
@@ -499,14 +540,14 @@ defined('BASEPATH') OR exit('No direct script access allowed'); '; + echo ''; } ?>
There is no Business asset
There is no other business asset available
-
Business Assets Remarks - '.$pd_section_data[8]['common_remarks'].'
'; }?> @@ -520,7 +561,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); Name of the Company / Firm whose financials are noted - + @@ -549,7 +590,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); - + $fy_value) @@ -562,7 +603,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ?> - + $fy_value) @@ -719,9 +760,9 @@ defined('BASEPATH') OR exit('No direct script access allowed');
Sales / Revenue (Rs) Sales / Revenue ()
Net Profit / (Net Loss) (Rs) Net Profit / (Net Loss) ()
- '?> + '?> '?> - '?> + '?>
Sales / Revenue (Rs) '.$rupee_symbol.' '. MYUTIL::customIndianNumberFormat($pd_section_data[10]['sales_amount']) .'
Sales / Revenue ('.$rupee_symbol.') '.$rupee_symbol.' '. MYUTIL::customIndianNumberFormat($pd_section_data[10]['sales_amount']) .'
Net Profit or (Net Loss) to Sales % '. $pd_section_data[10]['net_profit_to_sales_percent'] .'
Net Profit / (Net Loss) (Rs) '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($pd_section_data[10]['net_profit_rs']) .'
Net Profit / (Net Loss) ('.$rupee_symbol.') '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($pd_section_data[10]['net_profit_rs']) .'

@@ -732,8 +773,9 @@ defined('BASEPATH') OR exit('No direct script access allowed'); '?> - '?> - '?> + '?> + + ';}?>
Debtor Days '.$pd_section_data[10]['debtor_days_cm'].'Creditor Days '.$pd_section_data[10]['creditor_days_cm'].' Stock Days '.$pd_section_data[10]['inventory_days_cm'].'
Does the business have any working capital facility from any lender other than Moneywise? (Yes / No) '.$pd_section_data[10]['is_any_other_working_captial_facility'].' If Yes, then details of the same to be captured '.$pd_section_data[10]['facility_details_specify'].'
('.(isset($pd_section_data[10]['facility_details_other']) ? $pd_section_data[10]['facility_details_other'] : $pd_section_data[10]['facility_details_other_lender']).')'.'
Remarks on Financials >> '.$pd_section_data[10]['common_remarks'].'
Does the business have any working capital facility from any lender other than Moneywise? (Yes / No) '.$pd_section_data[10]['is_any_other_working_captial_facility'].' If Yes, then details of the same to be captured '.(isset($pd_section_data[10]['facility_details_specify']) ? $pd_section_data[10]['facility_details_specify'] : '').'
('.(isset($pd_section_data[10]['facility_details_other']) ? $pd_section_data[10]['facility_details_other'] : $pd_section_data[10]['facility_details_other_lender']).')'.'
Remarks on Financials >> '.$pd_section_data[10]['common_remarks'].'
@@ -757,13 +799,14 @@ defined('BASEPATH') OR exit('No direct script access allowed'); + Supplier Information Not available. Reason - '.$pd_section_data[11]['supplier_not_available_reason'] .'';} -if(isset($pd_section_data[11]['common_remarks'])){ +if(isset($pd_section_data[11]['common_remarks']) && !empty($pd_section_data[11]['common_remarks'])){ echo 'Remarks - '.$pd_section_data[11]['common_remarks'] .'';} ?> @@ -790,12 +833,13 @@ if(isset($pd_section_data[11]['common_remarks'])){ + Client Information Not available. Reason - '.$pd_section_data[12]['client_not_available_reason'] .'';} -if(isset($pd_section_data[12]['common_remarks'])){ +if(isset($pd_section_data[12]['common_remarks']) && !empty($pd_section_data[12]['common_remarks'])){ echo 'Remarks - '.$pd_section_data[12]['common_remarks'] .'';} ?> @@ -813,7 +857,7 @@ if(isset($pd_section_data[12]['common_remarks'])){ Sr. No. Type of Stock (RM / FG) Stock Item - Approx Stock Value (Rs) + Approx Stock Value () Approx Stock Quantity Stock Information Not available. Reason - '.$pd_section_data[13]['stock_not_available_reason'] .''; } - if(isset($pd_section_data[13]['common_remarks'])){ + if(isset($pd_section_data[13]['common_remarks']) && !empty($pd_section_data[13]['common_remarks'])){ echo 'Remarks - '.$pd_section_data[13]['common_remarks'] .'';} @@ -860,6 +904,12 @@ if(isset($pd_section_data[12]['common_remarks'])){ Succession Plan for business Brief of other group concerns/ Business run by the applicant +Remarks'.$pd_section_data[14]['common_remarks'].''; + } +?> @@ -891,7 +941,7 @@ Business run by the applicant'.(isset($section9_value['bank_name']) ? $section9_value['bank_name'] : 'NA').''. ''.(isset($section9_value['account_type']) ? $section9_value['account_type'] : 'NA').''. // ''.(isset($section14_value['estimated_quantity']) ? $section14_value['estimated_quantity'].' '.$section14_value['estimated_uom'] : 'NA').''. - ''.(isset($section9_value['cc_limit']) ? $section9_value['cc_limit'] : '-').''.''; + ''.(isset($section9_value['cc_limit']) ? ($rupee_symbol.''.MYUTIL::customIndianNumberFormat($section9_value['cc_limit'])) : '-').''.''; } @@ -935,27 +985,29 @@ Business run by the applicant --> - +
- - - - - - - - - - - + + + + + + + + + + + + + @@ -988,6 +1040,7 @@ Business run by the applicant
Sr. No.Loan
Type
Loan Amount Availed From Borrower`s Name Instalment Amount (Rs) Instalment Frequency (Rs) Original Tenure (Mnts) Elapsed Tenure (Mnts) Balance Tenure (Mnts)Existing Loan Obligations
Sr. No.Loan
Type
Loan Amount Availed From Borrower`s Name Instalment Amount () Instalment Frequency () Original Tenure (Mnts) Elapsed Tenure (Mnts) Balance Tenure (Mnts)
+
Date of PD Visit