diff --git a/api/application/config/config.php b/api/application/config/config.php index 72176740..3e25a817 100644 --- a/api/application/config/config.php +++ b/api/application/config/config.php @@ -271,7 +271,7 @@ $config['log_file_permissions'] = 0644; | codes to set your own date formatting | */ -$config['log_date_format'] = 'Y-m-d H:i:s'; +$config['log_date_format'] = 'Y-m-d h:i:s A'; /* |-------------------------------------------------------------------------- diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index e2a75633..92f30bb4 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -5121,8 +5121,8 @@ class PD_Controller extends REST_Controller { //echo "*******************************************"; $t = $this->load->view('report_templates/JSONTOREPORT',$data,true); //$t = $this->load->view('temp_html.html',null,true); - // echo $t; - // die(); + echo $t; + //die(); $total_replaces = substr_count($t,''); //echo $total_replaces; @@ -6535,9 +6535,10 @@ class PD_Controller extends REST_Controller { $client_form = isset($form_data[2][0]['processed_json'])?(json_decode($form_data[2][0]['processed_json'],true)):array(); $client_count = 0; + //print_r($client_form);die(); if(count($client_form)) { - if($client_form['client_info_available'] == 1) + if( isset($client_form['client_info_available']) && $client_form['client_info_available'] == 1) { if(array_key_exists('manufacturing_details',$client_form)) diff --git a/api/application/docs/sample.pdf b/api/application/docs/sample.pdf index 4bbdd459..25f36d7c 100644 Binary files a/api/application/docs/sample.pdf and b/api/application/docs/sample.pdf differ diff --git a/api/application/helpers/assessedincome_helper.php b/api/application/helpers/assessedincome_helper.php index 1aaf0f1e..a7ecb758 100644 --- a/api/application/helpers/assessedincome_helper.php +++ b/api/application/helpers/assessedincome_helper.php @@ -219,6 +219,7 @@ class AssessedIncome $temp['frequency'] = $itemwise['frequency_name']; $temp['annual_sale_value'] = $itemwise['annual_sale_value']; $temp['rate_per_unit'] = $itemwise['rate_per_unit']; + $temp['other_sales_item'] = $itemwise['other_sales_item']; if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2) { diff --git a/api/application/helpers/assetsform_helper.php b/api/application/helpers/assetsform_helper.php index f0d7e659..9a34d3eb 100644 --- a/api/application/helpers/assetsform_helper.php +++ b/api/application/helpers/assetsform_helper.php @@ -5,12 +5,38 @@ class Assetsform // other asset details public static function getOthersAssetsDetails($values){ $mergeResult=array(); + // print_r($values);die(); foreach($values as $key => $fetchVal){ $storeValue=array(); if(isset($fetchVal['assets_mode_master']) && ($fetchVal['assets_mode_master'] != '' || $fetchVal['assets_mode_master'] != null)) { + $assest_owners_name = ''; + foreach ( $fetchVal['name_of_the_owner'] as $o_key => $owner) { + if($owner['id'] == 0) + { + $assest_owners_name .= $fetchVal['other_owner']; + } + else + { + $assest_owners_name .= $owner['name']. ' , '; + } + + } + //echo $assest_owners_name.'-'; + if(strrpos($assest_owners_name,',') && count($fetchVal['name_of_the_owner']) >=2) + { + $assest_owners_name = substr_replace($assest_owners_name, 'and', strrpos($assest_owners_name,','),1) ; + } + else if(strrpos($assest_owners_name,',')) + { + $assest_owners_name = substr_replace($assest_owners_name, '', strrpos($assest_owners_name,','),1) ; + } + //echo $assest_owners_name.'-'; + // if(!strcasecmp(substr($assest_owners_name, 0,3),'and')) {$assest_owners_name = substr_replace($assest_owners_name,'',0,'and',3);} + + // echo $assest_owners_name.'-';die(); $storeValue['assets_mode'] = $fetchVal['assets_mode_master']; - $storeValue['name_of_the_owner'] = $fetchVal['name_of_the_owner'][0]['id']==0 ? $fetchVal['other_owner'] : $fetchVal['name_of_the_owner'][0]['name']; + $storeValue['name_of_the_owner'] = $assest_owners_name; $storeValue['purchase_year'] = $fetchVal['vintage_personal']; $storeValue['emi'] = (!strcasecmp($fetchVal['emi'],'yes')); // this is for investments type @@ -172,8 +198,8 @@ public static function getOthersAssetsDetails($values){ $sec_row .= ''.($fetchVal['business_details'][0]['equipment_manufacturing_description']).' purchased at '.$fetchVal['business_purchase_year'] .''; $third_row .= ''. ucfirst($ownership_type) .''; $fourth_row .= ''.$owners_list.''; - $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.$fetchVal['business_approximate_market_value'] : 'NA').''; - $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $fetchVal['business_monthly_rented_amt'] : 'NA').''; + $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_approximate_market_value']) : 'NA').''; + $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_monthly_rented_amt']) : 'NA').''; $seventh_row .= ''.($fetchVal['business_vintage'] != "" ? $fetchVal['business_vintage'] : 'NA').''; $eighth_row .= ''.($fetchVal['business_emi'] != "" ? ucfirst($fetchVal['business_emi']) : 'NA').''; @@ -185,8 +211,8 @@ public static function getOthersAssetsDetails($values){ $sec_row .= ''.($fetchVal['business_details'][0]['manufacturer_model_vehicle']).' purchased at '.$fetchVal['business_purchase_year'].''; $third_row .= ''. ucfirst($ownership_type) .''; $fourth_row .= ''.$owners_list.''; - $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.$fetchVal['business_approximate_market_value'] : 'NA').''; - $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? MYUTIL::customIndianNumberFormat($fetchVal['business_monthly_rented_amt']) : 'NA').''; + $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_approximate_market_value']) : 'NA').''; + $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_monthly_rented_amt']) : 'NA').''; $seventh_row .= ''.($fetchVal['business_vintage'] != "" ? $fetchVal['business_vintage'] : 'NA').''; $eighth_row .= ''.($fetchVal['business_emi'] != "" ? ucfirst($fetchVal['business_emi']) : 'NA').''; } @@ -200,8 +226,8 @@ public static function getOthersAssetsDetails($values){ $sec_row .= ''.($fetchVal['business_details'][0]['property_type']==1 ? $fetchVal['business_details'][0]['other_property_type']:$fetchVal['business_details'][0]['property_type_master']).''; $third_row .= ''. ucfirst($ownership_type) .''; $fourth_row .= ''.$owners_list.''; - $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.$fetchVal['business_approximate_market_value'] : 'NA').''; - $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? MYUTIL::customIndianNumberFormat($fetchVal['business_monthly_rented_amt']) : 'NA').''; + $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_approximate_market_value']) : 'NA').''; + $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_monthly_rented_amt']) : 'NA').''; $seventh_row .= ''.($fetchVal['business_vintage'] != "" ? $fetchVal['business_vintage'] : 'NA').''; $eighth_row .= ''.($fetchVal['business_emi'] != "" ? ucfirst($fetchVal['business_emi']) : 'NA').''; } @@ -212,8 +238,8 @@ public static function getOthersAssetsDetails($values){ $sec_row .= ''.$fetchVal['business_details'][0]['any_other_assets'].''; $third_row .= ''. ucfirst($ownership_type) .''; $fourth_row .= ''.$owners_list.''; - $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.$fetchVal['business_approximate_market_value'] : 'NA').''; - $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $fetchVal['business_monthly_rented_amt'] : 'NA').''; + $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_approximate_market_value']) : 'NA').''; + $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($fetchVal['business_monthly_rented_amt']) : 'NA').''; $seventh_row .= ''.($fetchVal['business_vintage'] != "" ? $fetchVal['business_vintage'] : 'NA').''; $eighth_row .= ''.($fetchVal['business_emi'] != "" ? ucfirst($fetchVal['business_emi']) : 'NA').''; } diff --git a/api/application/language/english/message_lang.php b/api/application/language/english/message_lang.php index 67c94a57..383812f9 100644 --- a/api/application/language/english/message_lang.php +++ b/api/application/language/english/message_lang.php @@ -1,2 +1,4 @@ \ No newline at end of file diff --git a/api/application/views/js/phantomchart.js b/api/application/views/js/phantomchart.js index 2f02843b..231de98f 100644 --- a/api/application/views/js/phantomchart.js +++ b/api/application/views/js/phantomchart.js @@ -1 +1 @@ -var page = require('webpage').create();page.viewportSize = { width: 600, height: 350 };page.clipRect = { top: 0, left: 0, width: 600, height: 350 };var score = 45.6;var url = 'http://localhost/AWSEC2/sparqapi/api?'+score;var image_url = 'C:/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/chart.png' ;page.open(url,function() {setTimeout(function() {page.render(image_url);phantom.exit();}, 500);}); \ No newline at end of file +var page = require('webpage').create();page.viewportSize = { width: 600, height: 350 };page.clipRect = { top: 0, left: 0, width: 600, height: 350 };var score = 76.3;var url = 'http://localhost/AWSEC2/sparqapi/api?'+score;var image_url = 'C:/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/chart.png' ;page.open(url,function() {setTimeout(function() {page.render(image_url);phantom.exit();}, 500);}); \ No newline at end of file diff --git a/api/application/views/report_templates/JSONTOREPORT.php b/api/application/views/report_templates/JSONTOREPORT.php index 20e1b44d..f8a2e814 100644 --- a/api/application/views/report_templates/JSONTOREPORT.php +++ b/api/application/views/report_templates/JSONTOREPORT.php @@ -1072,6 +1072,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo 'During the PD visit, '.$main_applicant_name.', provided the following information about loan applied for:'; $is_current_product_bl = $pd_master_details[0]['product_abbr'] == "BL" ? true: false; + $is_current_product_lab = $pd_master_details[0]['product_abbr'] == "LAP" ? true: false; + // echo $pd_master_details[0]['product_abbr']; + // echo '-bl-'. $is_current_product_bl; + // echo '-lap-'.$is_current_product_lab; + // die(); $loan_table_dispaly_rows = array(); $loan_table_dispaly_rows[] = array('particulars' => 'Total Loan Amount applied for','details' => ""." ".$loan_amount.' ('.MYUTIL::numtowords($loan_form['loan_amount']).')'); @@ -1088,7 +1093,13 @@ defined('BASEPATH') OR exit('No direct script access allowed'); if(strpos(strval($enduse), 'Others') === false) { $end_use.= $enduse.' and ';}else{ $end_use.=$loan_form['end_use_other'].' and'; } } $end_use = substr_replace($end_use, '', strrpos($end_use, 'and'),strlen($end_use)); - $end_use = 'For '.$end_use; + //echo substr($end_use,0,3); + if(strcasecmp(substr($end_use,0,3),'for')) + { + $end_use = 'For '.$end_use; + } + + $loan_table_dispaly_rows[] = array('particulars' => 'Loan Purpose','details' => $end_use); if(strcasecmp($loan_form['is_transfer'],'no')) @@ -1105,8 +1116,8 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } else{ - - if(!$is_current_product_bl) + //echo 'sdn-'.((!$is_current_product_bl) && !$is_current_product_lab); + if((!$is_current_product_bl) && !$is_current_product_lab) { $loan_table_dispaly_rows[] = array('particulars' => 'Amount of Own Contribution','details' =>""." ".MYUTIL::customIndianNumberFormat($loan_form['own_contribution']).' ('.MYUTIL::numtowords($loan_form['own_contribution']).')' ); $source_of_own_contribution = null; @@ -1657,7 +1668,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); //} if(!strcasecmp($fetchRow['applicant_use_pos_machines'],'yes')) { - echo '

The applicant has using the following POS machines:

'; + echo '

The applicant has the following POS machines:

'; echo ''; echo ''; foreach($fetchRow['pos_machines_details'] as $pos) @@ -2937,17 +2948,17 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo ''; echo '
Name of the Financial Insitution TID Number of POS machine
'; - echo '
'; - echo ''; - echo ''; - echo ''; - echo ''; - echo ''; - echo $ai_summary_details_processed['considered_sales_revenue_row']; - echo $ai_summary_details_processed['considered_net_profit_row']; - echo $ai_summary_details_processed['considered_net_margint_row']; - echo ''; - echo '
Particulars Details
'; + // echo '
'; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo ''; + // echo $ai_summary_details_processed['considered_sales_revenue_row']; + // echo $ai_summary_details_processed['considered_net_profit_row']; + // echo $ai_summary_details_processed['considered_net_margint_row']; + // echo ''; + // echo '
Particulars Details
'; array_shift($order_dipaly_array); } @@ -3072,12 +3083,15 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo $ai_core_details_processed['sales_calculated_by_itemwise_header']; echo ''; echo ''; + foreach($ai_core_details_processed['sales_item_wise_to_diaplay'] as $sid) { + + echo ''; - echo ''.$sid['sale_item'].''.$sid['sales_qty'].''.$sid['uom'].''.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($sid['rate_per_unit']).''.$sid['frequency'].''.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($sid['annual_sale_value']).''; - if(isset($sid['margin_per'])){echo ''.$sid['margin_per'].''; } - if(isset($sid['margin_per_uom'])){echo ''.$sid['margin_per_uom'].''; } + echo ''.($sid['other_sales_item'] != '' ? $sid['other_sales_item'] :$sid['sale_item']).''.$sid['sales_qty'].''.$sid['uom'].''.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($sid['rate_per_unit']).''.$sid['frequency'].''.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($sid['annual_sale_value']).''; + if(isset($sid['margin_per'])){echo ''.($sid['margin_per'] != 0 ? $sid['margin_per'] : '-').''; } + if(isset($sid['margin_per_uom'])){echo ''.($sid['margin_per_uom'] != 0? $sid['margin_per_uom'] : '-').''; } if(isset($sid['margin_final_value'])){echo ''.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($sid['margin_final_value']).''; } echo ''; @@ -3100,7 +3114,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } else if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2) { - echo '

As per person met, Purchase details were not shared, income calculated by Net magin percentage.

'; + echo '

As per person met, Purchase details were not shared, income calculated by Net margin percentage.

'; } @@ -3274,7 +3288,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');

Personal Assets

0){ ?> @@ -3782,14 +3796,15 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ?> -
+ 0) { for($business_count = 0;$business_count < $total_no_of_business; $business_count++) { - if(is_array($assessed_income_details) && count($assessed_income_details) && isset($assessed_income_details[ ($business_count+1) ] )) + if(is_array($assessed_income_details) && count($assessed_income_details) && isset($assessed_income_details[ ($business_count+1) ] ) && count($ai_core_details['sales_items_by_monthwise'])) { + echo '
'; echo '

Annexure A

'; if(isset($ai_core_details) && count($ai_core_details['sales_items_by_monthwise'])) { @@ -3887,12 +3902,14 @@ defined('BASEPATH') OR exit('No direct script access allowed'); -
+ '; echo "

Detailed Score Card Section

" ; // *** General Section Questions Score Table echo '
';