PD REPORT AI

This commit is contained in:
velz 2019-05-15 02:21:54 +05:30
parent cf95d4a350
commit 78b01749f8
14 changed files with 654 additions and 29 deletions

View File

@ -89,7 +89,7 @@ $autoload['drivers'] = array();
|
| $autoload['helper'] = array('url', 'file');
*/
$autoload['helper'] = array('url','file','form', 'jwt', 'authorization', 'date','mylog','myocr','mydb','pdalerts','myutil','myhttpclient','pdscore','businessform','otherincomeform','financialform','neighbourreferencecheckform', 'otherfamilyform', 'assetsform','stockform', 'bankingform','sms_gupshup');
$autoload['helper'] = array('url','file','form', 'jwt', 'authorization', 'date','mylog','myocr','mydb','pdalerts','myutil','myhttpclient','pdscore','businessform','otherincomeform','financialform','neighbourreferencecheckform', 'otherfamilyform', 'assetsform','stockform', 'bankingform','sms_gupshup','assessedincome');
/*
| -------------------------------------------------------------------

View File

@ -710,7 +710,7 @@ class PD_Controller extends REST_Controller {
$pd_details['random_string'] = $randomString;
$url = 'https://ssa.sineedge.com/ot/#/officertracking/'.$randomString;
$url = 'https://ssa.sineedge.com/officertracking/#/officertracking/'.$randomString;
/* $ch = curl_init();
$timeout = 5;
$url = 'https://ssa.sineedge.com/ot/#/officertracking/'.$randomString;
@ -785,9 +785,9 @@ class PD_Controller extends REST_Controller {
}
print_r($pd_details);
//print_r($pd_details);
}
die();
//die();
if(isset($pd_details['pd_status']) && ($pd_details['pd_status'] == TRIGGERED || $pd_details['pd_status'] == INITIATED))
{
@ -3932,6 +3932,7 @@ class PD_Controller extends REST_Controller {
$data['score_questions_display'] = $this->PD_Model->getScoreableQuestionToDispaly($pdid);
$data['pd_score'] = $this->calculateScore($pdid);
$data['dsc_cards'] = $this->getDetailedScoreCardChart( $data['pd_score'] );
$data['assessed_income_details'] = $this->getAssessedIncomeForPDReport($pdid);
$score_for_chart = $data['pd_score']['score_summary']['overall_score']['final_score'] ? round($data['pd_score']['score_summary']['overall_score']['final_score'],2) : 0;
//echo $score_for_chart;
@ -4698,26 +4699,31 @@ class PD_Controller extends REST_Controller {
function getSatelliteImage($pd_id)
{
$pdid = $pd_id;
$logger = MYLOG::logFunction();
$pdmas = $this->PD_Model->getPDMasterDetails($pdid);
print_r($pdmas);
//print_r($pdmas);
//load satellite script from db
$satellite_script_from_db = $this->PD_Model->selectCustomRecords(array('*'),array('script_name' => 'phantomsatellite_local'),SCRIPTS);
//$satellite_script_from_db = $this->PD_Model->selectCustomRecords(array('*'),array('script_name' => SATELLITE_IMAGE_LOCATION),SCRIPTS);
//$satellite_script_from_db = $this->PD_Model->selectCustomRecords(array('*'),array('script_name' => 'phantomsatellite_local'),SCRIPTS);
$satellite_script_from_db = $this->PD_Model->selectCustomRecords(array('*'),array('script_name' => SATELLITE_IMAGE_LOCATION),SCRIPTS);
$satellite_script = $satellite_script_from_db[0]['script_content'];
//Get Address Data
echo $pdmas[0]['addressline1'];
$address = $pdmas[0]['addressline1'].','.$pdmas[0]['city_name'].','.$pdmas[0]['state_name'];
echo $address;
$address = preg_replace("/[\n\r]/","",$pdmas[0]['addressline1']);
$address = $address.','.$pdmas[0]['city_name'].','.$pdmas[0]['state_name'];
//Replacing space with + symbol
$address =str_replace(' ','+',$address);
$address =str_replace('\n','+',$address);
$address =str_replace('\n','',$address);
$address =str_replace('\r','',$address);
$address =str_replace('\n\r','',$address);
$address =str_replace(PHP_EOL,'',$address);
$geo_location = $pdmas[0]['start_location'];
$google_map_static_api_key = GOOGLE_STATIC_MAP_API_KEY;
echo "*****";
echo $address;
//Replacing Place holders
@ -4725,7 +4731,7 @@ class PD_Controller extends REST_Controller {
$satellite_script = str_replace('{{GEOLOCATION}}',$geo_location,$satellite_script);
$satellite_script = str_replace('{{API_KEY}}',$google_map_static_api_key,$satellite_script);
echo $satellite_script;die();
file_put_contents(APPPATH.'/views/js/phantomsatellite.js',$satellite_script);
//call& execute phantom script
@ -4740,6 +4746,8 @@ class PD_Controller extends REST_Controller {
$satellite_img_content = file_get_contents($satellite_image_png_path);
$base64_pdscore_chart_url = 'data:image/' . $type . ';base64,' . base64_encode($satellite_img_content);
//generate log
$logger->info("Generate Satellite Called in (".ENVIRONMENT.")",array('Address' => $address,'script' => $satellite_script,'script_output' => $ou));
return $base64_pdscore_chart_url;
}
@ -4798,6 +4806,28 @@ class PD_Controller extends REST_Controller {
}
function getAssessedIncomeForPDReport($pdid)
{
$assessed_config_details = $this->PD_Model->selectCustomRecords(array('*'),array('fk_pd_id' => $pdid),PDASSESSEDINCOMEESTIMATIONOFGROSSPROFITTYPE);
$data = array();
if(count($assessed_config_details))
{
foreach($assessed_config_details as $ai)
{
$data[ $ai['company_id'] ]['core_details'] = $this->PD_Model->getAssessedIncome($pdid,$ai['company_id']);
$data[ $ai['company_id'] ]['summary_details'] = $this->calculateAssessedIncome($pdid,$ai['company_id']);
}
return $data;
}
else
{
return null;
}
}
public function codeigniterViewTest_post()
{
@ -4815,12 +4845,17 @@ 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();
$data['assessed_income_details'] = $this->getAssessedIncomeForPDReport($pdid);
$data['dsc_cards'] = $this->getDetailedScoreCardChart( $data['pd_score'] );
// print_r($data['assessed_income_details']);
// echo "**************************";
$data['dsc_cards'] = $this->getDetailedScoreCardChart( $data['pd_score'] );
$score_for_chart = $data['pd_score']['score_summary']['overall_score']['final_score'] ? round($data['pd_score']['score_summary']['overall_score']['final_score'],2) : 0;
//$score_for_chart = $data['pd_score']['score_summary']['overall_score']['final_score'] ? round($data['pd_score']['score_summary']['overall_score']['final_score'],2) : 0;
//echo $score_for_chart;
$chart = 1;
$chart = null;
if($chart)
{
//GET phantom script from DB

Binary file not shown.

View File

@ -0,0 +1,285 @@
<?php
class AssessedIncome
{
public static function getSummaryTable($ai_summary_details){
//echo "getSummaryTable";
//print_r($ai_summary_details);
$ai_table_header_row = '<tr> <th>Summary</th>';
$sale_revenue_row = '<tr> <td>a. Sales / Revenue </td>';
$purchase_row = '<tr> <td>b. Purchases </td>';
$gross_profit_loss_row = '<tr> <td>c. Gross Profit / Loss(a-b)</td>';
$business_expense_row = '<tr> <td>d. Business Expenses </td>';
$net_profit_loss_row = '<tr> <td>e. Net Profit / Loss(c-d) </td>';
$house_hold_expense_row = '<tr> <td>f. Household Expenses </td>';
$disposable_income_row = '<tr> <td>g. Disposable Income</td>';
$net_margin_row = '<tr> <td>h. Net Margin % </td>';
$considered_sales_revenue_row = '<tr> <td>Considered Sales / Revenue </td>';
$considered_net_profit_row = '<tr> <td>Considered Net Profit </td>';
$considered_net_margint_row = '<tr> <td>Considered Net Margin %</td>';
if(isset($ai_summary_details['sales_declared_by_customer']) && count($ai_summary_details['sales_declared_by_customer']))
{
$ai_table_header_row .= '<th>Declared by Customer</th>';
$sale_revenue_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_declared_by_customer']['sales_revenue']).'</td>';
$purchase_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_declared_by_customer']['purchases']).'</td>';
$gross_profit_loss_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_declared_by_customer']['grossprofit']).'</td>';
$business_expense_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_declared_by_customer']['business_expenses']).'</td>';
$net_profit_loss_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_declared_by_customer']['netprofit']).'</td>';
$house_hold_expense_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_declared_by_customer']['house_hold_expenses']).'</td>';
$disposable_income_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_declared_by_customer']['disposable_income']).'</td>';
$net_margin_row .= '<td>'.($ai_summary_details['sales_declared_by_customer']['netmargin']).'%</td>';
}
if(isset($ai_summary_details['sales_calculated_by_itemwise']) && count($ai_summary_details['sales_calculated_by_itemwise']))
{
$ai_table_header_row .= '<th>As Derived from Item Wise Sales</th>';
$sale_revenue_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_itemwise']['sales_revenue']).'</td>';
$purchase_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_itemwise']['purchases']).'</td>';
$gross_profit_loss_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_itemwise']['grossprofit']).'</td>';
$business_expense_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_itemwise']['business_expenses']).'</td>';
$net_profit_loss_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_itemwise']['netprofit']).'</td>';
$house_hold_expense_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_itemwise']['house_hold_expenses']).'</td>';
$disposable_income_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_itemwise']['disposable_income']).'</td>';
$net_margin_row .= '<td>'.($ai_summary_details['sales_calculated_by_itemwise']['netmargin']).'%</td>';
}
if(isset($ai_summary_details['sales_calculated_by_monthwise']) && count($ai_summary_details['sales_calculated_by_monthwise']))
{
$ai_table_header_row .= '<th>As Derived from Kuchha Sales Book/Bills</th>';
$sale_revenue_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_monthwise']['sales_revenue']).'</td>';
$purchase_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_monthwise']['purchases']).'</td>';
$gross_profit_loss_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_monthwise']['grossprofit']).'</td>';
$business_expense_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_monthwise']['business_expenses']).'</td>';
$net_profit_loss_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_monthwise']['netprofit']).'</td>';
$house_hold_expense_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_monthwise']['house_hold_expenses']).'</td>';
$disposable_income_row .= '<td>'.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_monthwise']['disposable_income']).'</td>';
$net_margin_row .= '<td>'.($ai_summary_details['sales_calculated_by_monthwise']['netmargin']).'%</td>';
}
if(isset($ai_summary_details['consolidated_report']) && count($ai_summary_details['consolidated_report']))
{
$considered_sales_revenue_row .= '<td colsapn="3">'.MYUTIL::customIndianNumberFormat($ai_summary_details['consolidated_report']['consolidated_sales_revenue']).'</td>';
$considered_net_profit_row .= '<td colsapn="3">'.MYUTIL::customIndianNumberFormat($ai_summary_details['consolidated_report']['consolidated_nerprofit']).'</td>';
$considered_net_margint_row .= '<td colsapn="3">'.$ai_summary_details['consolidated_report']['consolidated_nermagin'].'%</td>';
}
$ai_table_header_row .= '</tr>';
$sale_revenue_row .= '</tr>';
$purchase_row .= '</tr>';
$gross_profit_loss_row .= '</tr>';
$business_expense_row .= '</tr>';
$net_profit_loss_row .= '</tr>';
$house_hold_expense_row .= '</tr>';
$disposable_income_row .= '</tr>';
$net_margin_row .= '</tr>';
$considered_sales_revenue_row .= '</tr>';
$considered_net_profit_row .= '</tr>';
$considered_net_margint_row .= '</tr>';
// echo $ai_table_header_row;
// echo $sale_revenue_row;
// echo $purchase_row;
// echo $gross_profit_loss_row;
// echo $business_expense_row;
// echo $net_profit_loss_row;
// echo $house_hold_expense_row;
// echo $disposable_income_row;
// echo $net_margin_row;
// echo $considered_sales_revenue_row;
// echo $considered_net_profit_row;
// echo $considered_net_margint_row;
return array('ai_table_header_row' => $ai_table_header_row,'sale_revenue_row' => $sale_revenue_row,'purchase_row' => $purchase_row,'gross_profit_loss_row' => $gross_profit_loss_row,'business_expense_row' => $business_expense_row,'net_profit_loss_row' => $net_profit_loss_row,'house_hold_expense_row' => $house_hold_expense_row,'disposable_income_row'=>$disposable_income_row,'net_margin_row' => $net_margin_row,'considered_sales_revenue_row' => $considered_sales_revenue_row,'considered_net_profit_row' => $considered_net_profit_row,'considered_net_margint_row' =>$considered_net_margint_row);
}
public static function getCoreDetails($ai_core_details){
$purchase_to_display = array();
$sales_item_wise_to_diaplay = array();
$business_expenses_to_diaplay = array();
$household_expenses_to_diaplay = array();
$sales_item_wise_header_row = '';
// Get Purchase Informations
if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 1)
{
if($ai_core_details['gross_profit_calculation_type'][0]['purchase_type'] == 1)
{
foreach($ai_core_details['purchase_details'] as $pk => $purchase)
{
$temp['material_name'] = strcasecmp($purchase['purchase_item'],'others') ? $purchase['purchase_item'] : $purchase['other_purchase_item'];
$temp['qty'] = $purchase['purchase_qty'] != 0 ? $purchase['purchase_qty'] : '-';
$temp['uom'] = $purchase['uom_name'] != "" ? $purchase['uom_name'] : '-';
$temp['rate'] = $purchase['rate_per_unit'];
$temp['frequency'] = $purchase['frequency_name'];
$temp['annual_value'] = $purchase['annual_purchase_value'];
array_push($purchase_to_display,$temp);
}
}
else if($ai_core_details['gross_profit_calculation_type'][0]['purchase_type'] == 2)
{
foreach($ai_core_details['purchase_billwise'] as $pbk => $purchase)
{
$temp['month_count'] = count($purchase['items']);
$temp['annual_purchase_value'] = $purchase['annual_purchase_value'];
$temp['item_name'] = strcasecmp($purchase['purchase_item'],'others') ? $purchase['purchase_item'] : $purchase['other_purchase_item'];
$temp['months'] = array();
foreach($purchase['items'] as $item_key => $month_item)
{
foreach($month_item as $key => $data)
{
$t['month_to_dispaly'] = $key;
$t['month_data'] = array();
foreach($data as $singe_data)
{
array_push($t['month_data'],array('date' => date_format(date_create($singe_data['purchase_date']),'d-m-Y'),'value' => $singe_data['purchase_value']));
}
array_push($temp['months'],$t);
}
}
array_push($purchase_to_display,$temp);
}
}
}
else
{
//return $purchase_to_display;
}
// Get Sales Itemwise
if(count($ai_core_details['sales_calculated_by_itemwise']))
{
$sales_item_wise_to_diaplay = array();
$sales_item_wise_header_row = "<tr> <th>Product/Services</th> <th>Sale Quantitys</th> <th>UOM</th> <th>Rate/Unit or Value of Sale</th> <th>Frequency</th> <th>Annual Sales (Rs)</th>";
if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2)
{
$sales_item_wise_header_row .= "<th>Gross Margin %</th><th>Margin Amount</th><th>Gross Profit</th>";
}
foreach($ai_core_details['sales_calculated_by_itemwise'] as $itemwise)
{
$temp['sale_item'] = $itemwise['sales_item'];
$temp['sales_qty'] = $itemwise['sales_qty'] != 0 ? $itemwise['sales_qty']: '-';
$temp['uom'] = $itemwise['uom_name'] ? $itemwise['uom_name'] : '-';
$temp['frequency'] = $itemwise['frequency_name'];
$temp['annual_sale_value'] = $itemwise['annual_sale_value'];
$temp['rate_per_unit'] = $itemwise['rate_per_unit'];
if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2)
{
$temp['margin_per'] = $itemwise['margin_per'];
$temp['margin_per_uom'] = $itemwise['margin_per_uom'];
$temp['margin_final_value'] = $itemwise['margin_final_value'];
}
array_push($sales_item_wise_to_diaplay,$temp);
}
$sales_item_wise_header_row .= "</tr>";
}
if(count($ai_core_details['sales_items_by_monthwise']))
{
$sales_month_wise_to_display = array();
foreach($ai_core_details['sales_items_by_monthwise'] as $simwk => $sale_item)
{
$x['month_count'] = count($sale_item['items']);
$x['margin_value'] =$sale_item['margin_value'];
$x['margin_per'] =$sale_item['margin_per'];
$x['sales_item'] = strcasecmp($sale_item['sales_item'],'others') ? $sale_item['sales_item'] : $sale_item['other_sales_item'];
$x['sales_type'] = $sale_item['sales_type'];
$x['months'] = array();
if($sale_item['sales_type'] == 1)
{
$total_month_value = 0;
foreach($sale_item['items'] as $item_key => $month_item)
{
$z['month_to_dispaly'] = $item_key;
$z['month_data'] = array();
foreach($month_item as $item)
{
$total_month_value += $item['sales_value'];
array_push($z['month_data'],array('date' => date_format(date_create($item['sales_date']),'d-m-Y'),'value' => $item['sales_value']));
}
array_push($x['months'],$z);
}
$x['total_months_value'] = $total_month_value;
array_push($sales_month_wise_to_display,$x);
}else
{
//print_r($sale_item);
$total_month_value = 0;
$multiple_factor = 0;
foreach($sale_item['items'] as $item_key => $month_item)
{
$t['month_to_dispaly'] = $item_key;
$t['month_data'] = array();
foreach($month_item as $item)
{
$total_month_value += $item['sales_value'];
$multiple_factor = $item['mutiple_factor'];
array_push($t['month_data'],array('frequency_value' => $item['frequency_value'],'value' => $item['sales_value'],'frequency_name' => $item['frequency_name'],'multiple_factor'=> $item['mutiple_factor']));
}
array_push($x['months'],$t);
}
$x['total_months_value'] = $total_month_value;
$x['annual_sale_value'] = ($total_month_value * $multiple_factor);
array_push($sales_month_wise_to_display,$x);
}
}
}
if(count($ai_core_details['business_expenses']))
{
foreach($ai_core_details['business_expenses'] as $business_expense)
{
$bs_temp['expense_item'] = $business_expense['expense_item'];
$bs_temp['frequency_name'] = $business_expense['frequency_name'];
$bs_temp['expense_value'] = $business_expense['expense_value'];
$bs_temp['annual_expenses_value'] = $business_expense['annual_expenses_value'];
array_push($business_expenses_to_diaplay,$bs_temp);
}
}
if(count($ai_core_details['house_hold_expenses']))
{
foreach($ai_core_details['house_hold_expenses'] as $house_hold_expense)
{
$hhs_temp['expense_item'] = $house_hold_expense['expense_item'];
$hhs_temp['frequency_name'] = $house_hold_expense['frequency_name'];
$hhs_temp['expense_value'] = $house_hold_expense['expense_value'];
$hhs_temp['annual_expense_value'] = $house_hold_expense['annual_expense_value'];
array_push($household_expenses_to_diaplay,$hhs_temp);
}
}
//print_r($sales_month_wise_to_display);
//die();
return array('purchase_to_display' => $purchase_to_display,'sales_item_wise_to_diaplay' => $sales_item_wise_to_diaplay,'sales_calculated_by_itemwise_header' => $sales_item_wise_header_row,'sales_month_wise_to_display' => $sales_month_wise_to_display,'business_expenses_to_diaplay' => $business_expenses_to_diaplay,'household_expenses_to_diaplay' => $household_expenses_to_diaplay);
}
}
?>

View File

@ -1496,7 +1496,7 @@ class PD_Model extends SPARQ_Model {
foreach($sales_items_by_month as $month_key => $month)
{
$this->db->SELECT('simc_id,sales_date,sales_value,fk_frequency_id,frequency_value,FREQUENCY.name as frequency_name');
$this->db->SELECT('simc_id,sales_date,sales_value,fk_frequency_id,frequency_value,FREQUENCY.name as frequency_name,FREQUENCY.mutiple_factor');
$this->db->FROM(SALESITEMMONTHWISECHILD.' as SALESITEMMONTHWISECHILD');
$this->db->WHERE('SALESITEMMONTHWISECHILD.fk_sim_id',$item['sim_id']);
$this->db->JOIN(FREQUENCY.' as FREQUENCY','SALESITEMMONTHWISECHILD.fk_frequency_id = FREQUENCY.frequency_id','LEFT');

View File

@ -1,3 +1,3 @@
<?php defined('BASEPATH') OR exit('No direct script access allowed');
$business_captions = array("no_of_years_business_run" => "Business Vintage >>", "location_suited_for_busienss" => "Business Location suitability >>", "business_seasonality" => "Seasonality >>", "employees_total" => "Employee Strength >>", "cerificates" => "Business Certifications Sighted >>","owned_property" => "Business Premise Ownership >>", "owned_vechile" => "Vehicle Ownership >>", "business_activity_has_seen" => "Business Activity Observed >>", "minimum_supplier_info" => "Supplier Information Shared >>", "minimum_client_info" => "Client Information Shared >>","stock_raw_material_enough" => "Sufficiency of RM Stock Observed >>", "stock_finished_goods_enough" => "Sufficiency of Finished / Traded Stock Observed >>", "vintage_of_business_account" => "Main Business Banking Account Vintage >>");$descriptions = '';$score = '';if(isset($business) && count($business)){;foreach($business as $key => $d){$descriptions .= '"'.$business_captions [$key].'",'; $score .= ($d['attributed_score'] * 100).',';}}
?><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": "Detailed PD Score","font-family": "Arial","background-color": "none","font-color": "#A4A4A4","font-size":"14px"},"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": "10px","padding-right": "20px","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>
?><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": "Business PD Score","font-family": "Arial","background-color": "none","font-color": "#A4A4A4","font-size":"14px"},"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": "10px","padding-right": "20px","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

@ -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, one of the loan applicants? >>","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" => "Name Board of the Business Seen >>","value_of_other_assets" => "Value of Assets as a % of Loan Amount >>");$descriptions = '';$score = '';if(isset($general) && count($general)){;foreach($general as $key => $d){$descriptions .= '"'.$general_captions [$key].'",'; $score .= ($d['attributed_score'] * 100).',';}}
?><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": "Detailed PD Score","font-family": "Arial","background-color": "none","font-color": "#A4A4A4","font-size":"14px"},"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": "10px","padding-right": "20px","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>
?><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": "Others PD Score","font-family": "Arial","background-color": "none","font-color": "#A4A4A4","font-size":"14px"},"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": "10px","padding-right": "20px","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

@ -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 = 50.94;var url = 'http://localhost:9999/AWSEC2/sparqapi/api?'+score;var image_url = 'C:/5.6/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/chart.png' ;page.open(url,function() {setTimeout(function() {page.render(image_url);phantom.exit();}, 500);});
var page = require('webpage').create();page.viewportSize = { width: 600, height: 350 };page.clipRect = { top: 0, left: 0, width: 600, height: 350 };var score = ;var url = 'http://localhost:9999/AWSEC2/sparqapi/api?'+score;var image_url = 'C:/5.6/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/chart.png' ;page.open(url,function() {setTimeout(function() {page.render(image_url);phantom.exit();}, 500);});

View File

@ -1 +1 @@
var wpage = require('webpage').create();var Content = '<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": "Detailed PD Score","font-family": "Arial","background-color": "none","font-color": "#A4A4A4","font-size":"14px"},"plot": {"borderRadius": 8,"hover-state": {"visible": false},},"plotarea": {"margin": "60px 70px 20px 300px"},"scale-x": {"line-color": "","values": ["OTP authentication done >>","Is person Met, one of the loan applicants? >>","Qualification of Loan Applicants >>","Comment on Locality >>","Approach to PD location >>","Customer Behaviour >>","Neighbourhood check >>","Name Board of the Business Seen >>","Value of Assets as a % of Loan Amount >>",],"tick": {"visible": false},"guide": {"visible": false},"item": {"font-size": "10px","padding-right": "20px","auto-align": true,"font-color": "#000"}},"scale-y": {"visible": false,"guide": {"visible": false}},"series": [ {"values": [27.777777777778,41.666666666667,16.666666666667,19.444444444444,19.444444444444,0,0,27.777777777778,41.666666666667,],"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>';var pageurl = 'C:/5.6/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/dsc.html'; wpage.viewportSize = { width: 810, height: 250 };wpage.setContent(Content, pageurl); wpage.onLoadFinished = function(status){wpage.render('C:/5.6/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/dsc_general.png'); phantom.exit();};
var wpage = require('webpage').create();var Content = '<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": "Others PD Score","font-family": "Arial","background-color": "none","font-color": "#A4A4A4","font-size":"14px"},"plot": {"borderRadius": 8,"hover-state": {"visible": false},},"plotarea": {"margin": "60px 70px 20px 300px"},"scale-x": {"line-color": "","values": ["OTP authentication done >>","Is person Met, one of the loan applicants? >>","Qualification of Loan Applicants >>","Comment on Locality >>","Approach to PD location >>","Customer Behaviour >>","Neighbourhood check >>","Name Board of the Business Seen >>","Value of Assets as a % of Loan Amount >>",],"tick": {"visible": false},"guide": {"visible": false},"item": {"font-size": "10px","padding-right": "20px","auto-align": true,"font-color": "#000"}},"scale-y": {"visible": false,"guide": {"visible": false}},"series": [ {"values": [27.777777777778,41.666666666667,16.666666666667,19.444444444444,19.444444444444,0,0,27.777777777778,41.666666666667,],"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>';var pageurl = 'C:/5.6/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/dsc.html'; wpage.viewportSize = { width: 810, height: 250 };wpage.setContent(Content, pageurl); wpage.onLoadFinished = function(status){wpage.render('C:/5.6/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/dsc_general.png'); phantom.exit();};

View File

@ -1,2 +1 @@
var page = require('webpage').create();page.viewportSize = { width: 650, height: 250 };page.clipRect = { top: 0, left: 0, width: 500, height: 250 };var score = 78;var url = 'https://maps.googleapis.com/maps/api/staticmap?center=25,+NORTH+STREET,
MAMBALAM,Erode,Tamil+Nadu,IND&zoom=14&markers=color:red|12.9202935,80.1685205&size=800x300&maptype=roadmap&key=AIzaSyCXsHTus6hyIB8jYvt9ZEIbZve-2vWeQRg';var image_url ='C:/5.6/xampp/htdocs/AWSEC2/sparqapi/api/application/views/report_templates/satellite.png';page.open(url,function() {setTimeout(function() {page.render(image_url);phantom.exit();}, 500);});
var page = require('webpage').create();page.viewportSize = { width: 650, height: 250 };page.clipRect = { top: 0, left: 0, width: 500, height: 250 };var score = 78;var url = 'https://maps.googleapis.com/maps/api/staticmap?center=NO.1,+NEHRU+NAGAR,+3RD+STREET,+ACHRAPAKKAM,KANCHIPURAM,Acharapakkam,Tamil+Nadu,IND&zoom=14&markers=color:red|&size=800x300&maptype=roadmap&key=AIzaSyCXsHTus6hyIB8jYvt9ZEIbZve-2vWeQRg';var image_url ='/opt/lampp/htdocs/sparqtest/api/application/views/report_templates/satellite.png';page.open(url,function() {setTimeout(function() {page.render(image_url);phantom.exit();}, 500);});

View File

@ -93,10 +93,45 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
.customth { width: 10%; }
/* #########Score Card Table Styles######### */
/* #########billwise Table Styles######### */
.customtd { text-align:center; }
.customtd_leftalign { text-align:left; }
.customtd_rightalign { text-align:right; }
.customtd_rightalign { text-align:right; }
.billwise_table {
/* font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
/*font-family: Merriweather;*/
border-collapse: collapse;
width: auto;
//display:inline;
}
.billwise_table td, .billwise_table th {
border: 1px solid #000;
padding: 4px;
}
.billwise_table tr:nth-child(even){background-color: #f2f2f2;}
.billwise_table tr:hover {background-color: #ddd;}
.billwise_table th {
padding-top: 4px;
padding-bottom: 4px;
text-align: center;
background-color: #0191ed;
color: white;
}
/* #########billwise Table Styles######### */
.customtd { text-align:center; }
.customtd_leftalign { text-align:left; }
.customtd_rightalign { text-align:right; }
#boxstyle1 {
box-sizing: border-box;
width: 60px;
@ -118,6 +153,19 @@ defined('BASEPATH') OR exit('No direct script access allowed');
padding: 5px;
border: 2px outset black;
}
#billwise {
box-sizing: content-box;
disply:inline;
width: 100%;
height: auto;
padding: 10px;
border: 1px solid #0191ed;
}
#customhr {
}
</style>
@ -545,8 +593,10 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php if($total_no_of_business > 0) {
for($business_count = 0;$business_count < $total_no_of_business; $business_count++)
{
// $temp_show = null;
// if($temp_show == null)
// {
?>
<div class='page_break'></div>
<?php
@ -1840,9 +1890,265 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<?php }
else {?>
<!-- <p> Stock details is not available.</p> -->
<?php } ?>
<?php }
//} for stop cell map error, un commet when lot of form data not available but have to test PDF
?>
<!-- #################end stock section #################-->
<?php }
<!-- #################Start of AI #################-->
<?php
//echo "AI*******************##############@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@";
if(count($assessed_income_details) && isset($assessed_income_details[ ($business_count+1) ] ))
{
$ai_core_details = ($assessed_income_details[ ($business_count+1) ]['core_details']);
//print_r($ai_core_details);
$ai_core_details_processed = ASSESSEDINCOME::getCoreDetails($ai_core_details);
// echo "######################################";
// print_r($ai_core_details_processed);
// die();
$ai_summary_details = ($assessed_income_details[ ($business_count+1) ]['summary_details']);
$ai_summary_details_processed = ASSESSEDINCOME::getSummaryTable($ai_summary_details);
echo "<h2>Assessed Income - ".MYUTIL::findCompanyName($all_company_details,($business_count+1),1)."</h2>";
if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 1)
{
echo '<br><p>As per person met, the following Purchase details were shared:</p><br>';
}
else if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2)
{
echo '<br><p>As per person met, Purchase details were not shared, income calculated by Net magin percentage.</p><br>';
}
if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 1 && $ai_core_details['gross_profit_calculation_type'][0]['purchase_type'] == 1)
{
echo '<p>Itemwise Purchase Details :</p>';
echo '<table class="scorecard_table">';
echo '<thead>';
echo '<tr> <th>Raw Material/Trading Item </th> <th class="customtd">Purchase Quantity</th> <th class="customtd">UOM</th> <th class="customtd">Rate/Unit of Purchase</th> <th>Frequency</th> <th>Annual Purchase(Rs)</th> </tr>';
echo '</thead>';
echo '<tbody>';
foreach($ai_core_details_processed['purchase_to_display'] as $dat)
{
echo '<tr> <td>'.$dat['material_name'] .'</td> <td>'.$dat['qty'] .'</td> <td>'.$dat['uom'] .'</td> <td>'.$dat['rate'] .'</td> <td>'.$dat['frequency'] .'</td> <td>'.$dat['annual_value'] .'</td> </tr>';
}
echo '</tbody>';
echo '</table>';
}
else if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 1 &&$ai_core_details['gross_profit_calculation_type'][0]['purchase_type'] == 2)
{
echo '<p>Billwise Purchase Details :</p>';
foreach($ai_core_details_processed['purchase_to_display'] as $billwise)
{
echo '<div id="billwise">';
echo 'Item name : <b>' . $billwise['item_name'].'</b><br>';
echo '<b>'.$billwise['month_count'].'</b> month(s) purchase value : <b>'.MYUTIL::customIndianNumberFormat($billwise['annual_purchase_value']).'</b> Annual Purchase value:<b>'. MYUTIL::customIndianNumberFormat($billwise['annual_purchase_value'] * (12 / $billwise['month_count']) ).'</b>';
echo '<hr>';
foreach($billwise['months'] as $month_data)
{
//echo '<span style="display:inline;width:auto;height:auto;padding: 5px;">';
echo '<br>';
echo '<table class="billwise_table">';
echo '<thead>';
echo '<tr> <th colspan="2">'.$month_data['month_to_dispaly'].'</th> </tr>';
echo '<tr> <th>Date</th> <th>Value</th></tr>';
echo '</thead>';
echo '<tbody>';
foreach($month_data['month_data'] as $month)
{
echo '<tr> <td>'.$month['date'] .'</td> <td>'.$month['value'] .'</td> </tr>';
}
echo '</tbody>';
echo '</table>';
//echo '</span>';
}
echo '</div>';
}
}
}
echo "<br>";
if(isset($ai_core_details) && count($ai_core_details['sales_declared_by_customer']))
{
$str = 'As per person met, Rs. '.$ai_core_details['sales_declared_by_customer'][0]['sales_declared_by_customer'].' declared as annual sale value.';
if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2)
{
$str .= 'Also Rs. '.$ai_core_details['sales_declared_by_customer'][0]['margin_value'].' ('.$ai_core_details['sales_declared_by_customer'][0]['margin_per'].'%) as net margin amount';
}
echo $str;
echo '<br><br>';
}
if(isset($ai_core_details) && count($ai_core_details['sales_calculated_by_itemwise']))
{
echo '<p>Sales Itemwise : </p>';
echo '<table class="scorecard_table">';
echo '<thead>';
echo $ai_core_details_processed['sales_calculated_by_itemwise_header'];
echo '</thead>';
echo '<tbody>';
foreach($ai_core_details_processed['sales_item_wise_to_diaplay'] as $sid)
{
echo '<tr>';
echo '<td>'.$sid['sale_item'].'</td><td class="customtd">'.$sid['sales_qty'].'</td><td class="customtd">'.$sid['uom'].'</td><td>'.$sid['rate_per_unit'].'</td><td>'.$sid['frequency'].'</td><td>'.$sid['annual_sale_value'].'</td>';
if(isset($sid['margin_per'])){echo '<td>'.$sid['margin_per'].'</td>'; }
if(isset($sid['margin_per_uom'])){echo '<td>'.$sid['margin_per_uom'].'</td>'; }
if(isset($sid['margin_final_value'])){echo '<td>'.$sid['margin_final_value'].'</td>'; }
echo '</tr>';
}
echo '</tbody>';
echo '</table>';
}
if(isset($ai_core_details) && count($ai_core_details['sales_items_by_monthwise']))
{
echo "<br>";
echo "<p>Kuchha Sales Book/Bills : </p>";
foreach($ai_core_details_processed['sales_month_wise_to_display'] as $sale_month_wise)
{
// if($sale_month_wise['sales_type'] == 1)
// {
echo '<div id="billwise">';
echo 'Item name : <b>' . $sale_month_wise['sales_item'].'</b><br>';
if($sale_month_wise['sales_type'] == 1)
{
echo '<b>'.$sale_month_wise['month_count'].'</b> month purchase value : <b>'.MYUTIL::customIndianNumberFormat($sale_month_wise['total_months_value']).'</b> Annual Purchase value:<b>'. MYUTIL::customIndianNumberFormat(($sale_month_wise['total_months_value'] * (12 / $sale_month_wise['month_count']) )).'</b>';
}
else
{
echo 'Annual Purchase value:<b>'. MYUTIL::customIndianNumberFormat(($sale_month_wise['total_months_value'] )).'</b>';
}
echo '<hr>';
foreach($sale_month_wise['months'] as $sale_month_data)
{
//echo '<span style="display:inline;width:auto;height:auto;padding: 5px;">';
echo '<br>';
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>';
}
if($sale_month_wise['sales_type'] == 1)
{
echo '<tr> <th>Date</th> <th>Value</th></tr>';
}else if($sale_month_wise['sales_type'] == 2)
{
echo '<tr> <th>Frequncy</th> <th>Value</th></tr>';
}
echo '</thead>';
echo '<tbody>';
foreach($sale_month_data['month_data'] as $month)
{
if($sale_month_wise['sales_type'] == 1)
{
echo '<tr> <td>'.$month['date'] .'</td> <td>'.$month['value'] .'</td> </tr>';
}
else if($sale_month_wise['sales_type'] == 2)
{
echo '<tr> <td>'.$month['frequency_name'] .'</td> <td>'.$month['frequency_value'] .'</td> </tr>';
}
}
echo '</tbody>';
echo '</table>';
//echo '</span>';
}
echo '</div>';
//}
}
}
if(isset($ai_core_details) && count($ai_core_details['business_expenses']))
{
echo '<p>Business Expenses Details :</p>';
echo '<table class="scorecard_table">';
echo '<thead>';
echo '<tr> <th>Business Expense </th> <th>Amount (Rs) </th> <th>Frequency </th> <th>Annual Expenses(Rs)</th></tr>';
echo '</thead>';
echo '<tbody>';
foreach($ai_core_details_processed['business_expenses_to_diaplay'] as $b_exp)
{
echo '<tr> <td>'.$b_exp['expense_item'] .'</td> <td>'.$b_exp['expense_value'] .'</td> <td>'.$b_exp['frequency_name'] .'</td> <td>'.$b_exp['annual_expenses_value'] .'</td></tr>';
}
echo '</tbody>';
echo '</table>';
}
if(isset($ai_core_details) && count($ai_core_details['house_hold_expenses']))
{
echo '<p>Household Expenses Details :</p>';
echo '<table class="scorecard_table">';
echo '<thead>';
echo '<tr> <th>Expense Particulars </th> <th>Amount (Rs) </th> <th>Frequency </th> <th>Annual Expenses(Rs)</th></tr>';
echo '</thead>';
echo '<tbody>';
foreach($ai_core_details_processed['household_expenses_to_diaplay'] as $h_exp)
{
echo '<tr> <td>'.$h_exp['expense_item'] .'</td> <td>'.$h_exp['expense_value'] .'</td> <td>'.$h_exp['frequency_name'] .'</td> <td>'.$h_exp['annual_expense_value'] .'</td></tr>';
}
echo '</tbody>';
echo '</table>';
}
if(isset($ai_core_details) && count($ai_summary_details_processed))
{
echo '<p>The Summary of Income :</p>';
echo '<table class="scorecard_table">';
echo '<thead>';
echo $ai_summary_details_processed['ai_table_header_row'];
echo '</thead>';
echo '<tbody>';
echo $ai_summary_details_processed['sale_revenue_row'];
echo $ai_summary_details_processed['purchase_row'];
echo $ai_summary_details_processed['gross_profit_loss_row'];
echo $ai_summary_details_processed['business_expense_row'];
echo $ai_summary_details_processed['net_profit_loss_row'];
echo $ai_summary_details_processed['house_hold_expense_row'];
echo $ai_summary_details_processed['disposable_income_row'];
echo $ai_summary_details_processed['net_margin_row'];
echo '</tbody>';
echo '</table>';
echo '<br>';
echo '<table class="scorecard_table">';
echo '<thead>';
echo '<tr> <th>Particulars</th> <th>Details</th> </tr>';
echo '</thead>';
echo '<tbody>';
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 '</tbody>';
echo '</table>';
}
echo "<div class='page_break'></div>";
//die();
?>
<!-- #################End of AI #################-->
<?php } // end of total_no_of_business for loop
} // end of total_no_of_business count if condition ?>
<!-- ######################END OF OVERALL BUSINESS SECTION ########################-->

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 KiB

After

Width:  |  Height:  |  Size: 185 KiB