PD REPORT ISSUES ON 2105

This commit is contained in:
velz 2019-05-21 15:41:53 +05:30
parent e4c4198414
commit 1b618da53e
5 changed files with 51 additions and 28 deletions

View File

@ -4879,8 +4879,8 @@ class PD_Controller extends REST_Controller {
$data['pd_additional_requirements'] = $this->PD_Model->getPDAdditionalRequirements($pdid);
$data['score_questions_display'] = $this->PD_Model->getScoreableQuestionToDispaly();
$data['pd_score'] = $this->calculateScore($pdid);
// print_r($data['pd_score']);
// die();
//print_r($data['pd_score']);
//die();
$data['assessed_income_details'] = $this->getAssessedIncomeForPDReport($pdid);
// print_r($data['assessed_income_details']);
@ -4935,7 +4935,7 @@ class PD_Controller extends REST_Controller {
// print_r($this->db->last_query());
}
//die();
//print_r(json_decode($data['pd_processed_forms'][14][0]['processed_json'],true));
//print_r($data['pd_images']);die(); //print_r(json_decode($data['pd_processed_forms'][14][0]['processed_json'],true));
//die();
//echo "*******************************************";
$t = $this->load->view('report_templates/JSONTOREPORT',$data,true);

Binary file not shown.

View File

@ -235,13 +235,13 @@ class PD_Model extends SPARQ_Model {
$where_condition_array['fk_form_id'] = $form_id != null ? $form_id : null;
$where_condition_array['company_id'] = $company_id != null ? $company_id : null;
if($company_id != null){
$where_condition_array['company_id'] = $company_id ;
}
//print_r($where_condition_array);die();
$document_lists = $this->selectRecords(PDDOCUMENTS,$where_condition_array);
//print_r($document_lists);die();
// print_r($this->db->last_query());die();
if(count($document_lists))
{

View File

@ -1,3 +1,3 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed');
$general_captions = array("otp_done" => "OTP authentication done >>","person_met_is_applicant" => "Is person Met, a loan applicant >>","qualification" => "Qualification of Loan Applicants >>","comment_locality" => "Comment on Locality >>","pd_location_approach" => "Approach to PD location >>","customer_behaviour" => "Customer Behaviour >>","neibourhood_check_as_per_pd_officer" => "Neighbourhood check >>","was_the_company_name_board_sighted" => "Business Board Sighted >>","value_of_other_assets" => "Asset Value by Loan Amount% >>");$descriptions = '';$score = '';if(isset($general) && count($general)){foreach($general as $key => $d){$descriptions .= '"'.$general_captions [$key].'",'; $score .= $d['attributed_score'] != 0 && $d['max_score'] != 0 ? (($d['attributed_score']/$d['max_score']) * 100).',' : '0'.',';}}
$general_captions = array("otp_done" => "OTP authentication done >>","person_met_is_applicant" => "Is person Met, a loan applicant >>","qualification" => "Qualification of Loan Applicants >>","comment_locality" => "Comment on Locality >>","pd_location_approach" => "Approach to PD location >>","customer_behaviour" => "Customer Behaviour >>","neibourhood_check_as_per_pd_officer" => "Neighbourhood check >>","was_the_company_name_board_sighted" => "Business Board Sighted >>","value_of_other_assets" => "Asset Value by Loan Amount % >>");$descriptions = '';$score = '';if(isset($general) && count($general)){foreach($general as $key => $d){$descriptions .= '"'.$general_captions [$key].'",'; $score .= $d['attributed_score'] != 0 && $d['max_score'] != 0 ? (($d['attributed_score']/$d['max_score']) * 100).',' : '0'.',';}}
?><html><head><script src="https://cdn.zingchart.com/zingchart.min.js"></script><link href="https://fonts.googleapis.com/css?family=Merriweather" rel="stylesheet"> <script>zingchart.MODULESDIR = "https://cdn.zingchart.com/modules/";ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "ee6b7db5b51705a13dc2339db3edaf6d"];</script><style>#myChart-wrapper {margin: auto;}.zc-ref {display: none;}</style></head><body><div id="myChart"><a class="zc-ref" href="https://www.zingchart.com/">Powered by ZingChart</a></div><script>var myConfig = {"type": "hbar","font-family": "Helvetica","title": {"text": "Other PD Parameters","font-family": "Arial","background-color": "none","font-color": "#00","font-size":"18px"},"plot": {"borderRadius": 8,"hover-state": {"visible": false},},"plotarea": {"margin": "60px 70px 20px 300px"},"scale-x": {"line-color": "","values": [<?php echo $descriptions;?>],"tick": {"visible": false},"guide": {"visible": false},"item": {"font-size": "12px","padding-right": "0px","auto-align": true,"font-color": "#000"}},"scale-y": {"visible": false,"guide": {"visible": false}},"series": [ {"values": [<?php echo $score;?>],"bar-width": "25px","max-trackers": 0,"value-box": {"placement": "top","text": "%v%","decimals": 2,"font-color": "#000","font-size": "12px"},"rules": [{"rule": "%v <= 50","background-color": "#E53935"}, {"rule": "%v >= 50 && %i <= 70","background-color": "#ff9900"}, {"rule": "%v >= 70 && %i <= 80","background-color": "#99ff66"}, {"rule": "%v >= 80","background-color": "#33cc33"}]}]};zingchart.render({id: "myChart",data: myConfig,width: 800});</script></body></html>

View File

@ -655,9 +655,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$estimated_area = $pd_address['estimated_area'].' ';
$estimated_area .= $pd_address['uom_others'] != "" || $pd_address['uom_others'] != null ? $pd_address['uom_others'] : $pd_address['uom_master'];
$locality = $pd_address['locality_master'];
$locality_master_article = !strcasecmp($pd_address['locality_master'],'excellent') ? 'an' : 'a';
$locality = preg_match("/^[aeiouAEIOU]/U", $locality) ? 'an '.$locality : 'a '.$locality;
$comment_locality_master = preg_match("/^[aeiouAEIOU]/U", $pd_address['comment_locality_master']) ? 'an '.$pd_address['comment_locality_master'] : 'a '.$pd_address['comment_locality_master'];
$property_owner_type = $business_assets_details['business_assets_for_address'][0]['business_ownership_type'];
if($property_owner_type == 'rented') { $property_owner_type ='Rented (Rent Rs'.$business_assets_details['business_assets_for_address'][0]['business_monthly_rented_amt'].' Per Month)'; }else{$property_owner_type = 'Owned'; }
$yrs_being_run = $business_assets_details['business_assets_for_address'][0]['business_years'].' Years';
@ -667,7 +666,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo "The PD visit was done at ". $address_type. " of the loan applicants. ";
echo "The ".$address_type." is ".$property_owner_type." and the business has been in operation from here for the last $yrs_being_run.";
echo "<br><br>The ".$address_type." is located in ".$locality." and the estimated area of the office is ".$estimated_area." .";
echo "<br><br>The PD location was ". $pd_address['pd_location_master'].". " . "As Per PD Offcier, the ".$address_type ." is situated in $locality_master_article ".$pd_address['comment_locality_master'] ." Locality.";
echo "<br><br>The PD location was ". $pd_address['pd_location_master'].". " . "As Per PD Offcier, the ".$address_type ." is situated in ".$comment_locality_master ." Locality.";
echo "<br><br>The PD officer also made the following observations:" ;
echo "<br><ul>";
@ -1557,7 +1556,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<tbody>
<?php foreach($iterateFinance['working_capital_facilites'] as $fk => $facility){
echo '<tr> <td class="customtd">'.(++$fk) .'</td><td td class="customtd">'.$facility['name'].'</td> <td td class="customtd">'.$facility['details'].'</td></tr';
echo '<tr> <td class="customtd">'.(++$fk) .'</td><td td class="customtd">'.$facility['name'].'</td> <td td class="customtd">'.$facility['details'].'</td></tr>';
}?>
</tbody>
</table>
@ -2115,7 +2114,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '<p style="text-align:justify;">Considering the size of operations, the stock of raw materials maintained is not sufficient as per the PD Officers observations.</p>';
}
$stock_photo_count = $pd_images[11];
//echo count($stock_photo_count);
// echo count($pd_images[11]);
// die();
$stock_img_row_count = ceil(count($stock_photo_count) / 5);
//echo $stock_img_row_count;
@ -2315,27 +2315,38 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo 'Annual Purchase value:<b>'. $rupee_symbol.' '.MYUTIL::customIndianNumberFormat(($sale_month_wise['total_months_value'] )).'</b>';
}
echo '<hr>';
foreach($sale_month_wise['months'] as $sale_month_data)
$row_count = ceil(count($sale_month_wise['months']) / 5);
echo '<table>';
for($i = 1; $i <= $row_count; $i++)
{
$from = $i==1 ? $i : ($i + 4);
$to = ($from + 4);
echo '<tr>';
for($j = $from ; $j <= $to ;$j++)
{
//$sale_month_wise['months'] as $sale_month_data
//echo '<span style="display:inline;width:auto;height:auto;padding: 5px;">';
echo '<br>';
if(isset($sale_month_wise['months'][$j]))
{
echo '<td>';
echo '<table class="billwise_table">';
echo '<thead>';
if($sale_month_wise['sales_type'] == 1)
{
echo '<tr> <th colspan="2">'.$sale_month_data['month_to_dispaly'].'</th> </tr>';
echo '<tr> <th colspan="2">'.$sale_month_wise['months'][$j]['month_to_dispaly'].'</th> </tr>';
}
if($sale_month_wise['sales_type'] == 1)
{
echo '<tr> <th>Date</th> <th>Value</th></tr>';
}else if($sale_month_wise['sales_type'] == 2)
}else if($sale_month_wise['months'][$j]['sales_type'] == 2)
{
echo '<tr> <th>Frequncy</th> <th>Value</th></tr>';
}
echo '</thead>';
echo '<tbody>';
foreach($sale_month_data['month_data'] as $month)
foreach($sale_month_wise['months'][$j]['month_data'] as $month)
{
if($sale_month_wise['sales_type'] == 1)
{
@ -2349,15 +2360,19 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '</tbody>';
echo '</table>';
//echo '</span>';
echo '</td>';
}
}
echo '</tr>';
}
echo '</table>';
echo '</div>';
//}
}
}
//die();
if(isset($ai_core_details) && count($ai_core_details['business_expenses']))
{
echo '<p>Business Expenses Details :</p>';
@ -2824,14 +2839,14 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<table>
<tr>
<td >
<div id="first_div" style="<?php if($polite){ echo 'border-color:green;color:green;'; }?>">Polite</div> <div id="tick_div" style="<?php if($polite){ echo 'border-color:green;color:green;'; }?>"><?php if($polite){ echo $tick_mark; } ?></div>
<div id="first_div" style="border-color:green;color:green;">Polite</div> <div id="tick_div" style="border-color:green;color:green;"><?php if($polite){ echo $tick_mark; } ?></div>
</td>
<td style="padding-left:50px;">
<div id="first_div" style="<?php if($rude){ echo 'border-color:green;color:green;'; }?>">Rude</div> <div id="tick_div" style="<?php if($rude){ echo 'border-color:green;color:green;'; }?>"><?php if($rude){ echo $tick_mark; } ?></div>
<div id="first_div" style="border-color:red;color:red;">Rude</div> <div id="tick_div" style="border-color:red;color:red;"><?php if($rude){ echo $tick_mark; } ?></div>
</td>
<td style="padding-left:50px;">
<div id="first_div" style="<?php if($other_behaviour){ echo 'border-color:green;color:green;'; }?>">Others mentioned as below</div> <div id="tick_div_other" style="<?php if($other_behaviour){ echo 'border-color:green;color:green;'; }?>"><?php if($other_behaviour){ echo $tick_mark; } ?></div>
<div id="first_div" style="border-color:red;color:red;">Others mentioned as below</div> <div id="tick_div_other" style="border-color:red;color:red;"><?php if($other_behaviour){ echo $tick_mark; } ?></div>
</td>
</tr>
</table>
@ -2910,7 +2925,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<p>PD officer recommendation is <?php
if($positive){ $color_for_pd_offcier_recom = 'green';} else if($negative) { $color_for_pd_offcier_recom = 'red';}else{ $color_for_pd_offcier_recom = 'black';}
echo '<span style="color:'.$color_for_pd_offcier_recom.'">'.$fo_diplay.'</span>';?>. The following key points were considered while arriving at the aforementioned status.</p>
echo '<strong><span style="font-size:15px;color:'.$color_for_pd_offcier_recom.';">'.$fo_diplay.'</span></strong>';?>. The following key points were considered while arriving at the aforementioned status.</p>
<?php
//die();
if($positive){ echo "<ul>"; foreach($final_remark_data['recommendation_positive'] as $pos){ echo "<li>".$pos['reason_for_positive']."</li>";}
@ -2933,7 +2948,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php
$show_detailed_scorecard = 1;
$show_detailed_scorecard = null;
if($show_detailed_scorecard)
{
echo "<h3>Details Score Card Section</h3>" ;
@ -2990,7 +3005,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$max_span = '<span style="font-size:9px">('.$final_remark['l1_weightage'].'% * '. $final_remark['l2_weightage'].'% * '.$final_remark['max_score_band'].')</span>';
echo '<tr>'.'<td>'.$question.'</td><td>'.$final_remark['l2_weightage'].'%</td><td class="customtd">'.$final_remark['answer'].'</td><td class="customtd">'.$final_remark['score_band'].'</td><td class="customtd">'.$final_remark['attributed_score'].'<br>'.$span.'</td><td class="customtd">'.$final_remark['max_score'].'<br>'.$max_span.'</td></tr>';
echo '<tr>'.'<td>'.$question.'</td><td class="customtd">'.$final_remark['l2_weightage'].'%</td><td class="customtd">'.$final_remark['answer'].'</td><td class="customtd">'.$final_remark['score_band'].'</td><td class="customtd">'.$final_remark['attributed_score'].'<br>'.$span.'</td><td class="customtd">'.$final_remark['max_score'].'<br>'.$max_span.'</td></tr>';
}
echo '<tr> <td colspan="4">Final Remarks Section Sum of Attributed Score | Sum of Max Score </td> <td class="customtd">'.number_format($pd_score['score_summary']['final_remarks']['actual_score'],2,'.',',').'</td> <td class="customtd">'.number_format($pd_score['score_summary']['final_remarks']['max_score'],2,'.',',').'</td> </tr>';
@ -3009,15 +3024,23 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$question = MYUTIL::findQuestionByKey($score_questions_display,$key);
$span = '<span style="font-size:9px">('.$business['l1_weightage'].'% * '. $business['l2_weightage'].'% * '.$business['score_band'].')</span>';
$max_span = '<span style="font-size:9px">('.$business['l1_weightage'].'% * '. $business['l2_weightage'].'% * '.$business['max_score_band'].')</span>';
if($key != 'cerificates')
if($key != 'cerificates' || $key != 'location_suited_for_busienss')
{
echo '<tr>'.'<td>'.$question.'</td><td class="customtd">'.$business['l2_weightage'].'%</td><td class="customtd">'.$business['answer'].'</td><td class="customtd">'.$business['score_band'].'</td><td class="customtd">'.$business['attributed_score'].'<br>'.$span.'</td><td class="customtd">'.$business['max_score'].'<br>'.$max_span.'</td></tr>';
}
if($key == 'location_suited_for_busienss')
{
echo '<tr>'.'<td>'.$question.'</td><td class="customtd">'.$business['l2_weightage'].'%</td><td class="customtd">'.$address_type_remarks_caption[ $business['answer'] ].'</td><td class="customtd">'.$business['score_band'].'</td><td class="customtd">'.$business['attributed_score'].'<br>'.$span.'</td><td class="customtd">'.$business['max_score'].'<br>'.$max_span.'</td></tr>';
}
if($key == 'cerificates')
{
$certificates = $business;
echo '<tr>'.'<td> Certificates </td><td class="customtd">'.round($business['l2_weightage'],2).'%</td><td class="customtd">'.'Refer Cert Table'.'</td><td class="customtd">'.$business['score_band'].'</td><td class="customtd">'.$business['attributed_score'].'</td><td class="customtd">'.$business['max_score'].'</td></tr>';
echo '<tr>'.'<td> Certificates </td><td class="customtd">'.round($business['l2_weightage'],2).'%</td><td class="customtd">'.'Refer Cert Table'.'</td><td class="customtd">'.$business['score_band'].'</td><td class="customtd">'.$business['attributed_score'].'</td><td class="customtd">'.$business['max_score'].'</td></tr>';
}
}