diff --git a/api/application/config/config.php b/api/application/config/config.php index 7be1deb4..26e1b6ed 100644 --- a/api/application/config/config.php +++ b/api/application/config/config.php @@ -223,7 +223,7 @@ $config['allow_get_array'] = TRUE; | your log files will fill up very fast. | */ -$config['log_threshold'] = 1; +$config['log_threshold'] = array(1,2); /* |-------------------------------------------------------------------------- @@ -235,6 +235,8 @@ $config['log_threshold'] = 1; | */ $config['external_data_path'] = $_SERVER['DOCUMENT_ROOT'].'/ssa_external_data/'.ENVIRONMENT; +$config['full_server_name'] = (substr_count($_SERVER['HTTP_HOST'],'localhost') == 1 ? 'http://localhost':$_SERVER['HTTP_HOST']); + $config['log_path'] = $config['external_data_path'].'/ci_logs/'; /* diff --git a/api/application/config/constants.php b/api/application/config/constants.php index f1f26fc8..2ea4372e 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -88,6 +88,7 @@ defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest auto //defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(getPDReportHTML/:any)'); // no errors defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'getPDOfficerCurrentLocation'); // no errors defined('ROUTE_LOGIN_X') OR define('ROUTE_LOGIN_X', '(getPDReportHTML/:any/:any)'); // no errors +defined('ROUTE_LOGIN_Y') OR define('ROUTE_LOGIN_Y', '(getPDReportPDFpreview/:any/:any)'); // no errors //defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN','getFullPDDetails'); // no errors /*********************AWS resources Constants*************************************************/ diff --git a/api/application/config/routes.php b/api/application/config/routes.php index 25dd5608..ff9c6d03 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -204,6 +204,7 @@ $route['getPDCompleteDetails'] = 'PD_Controller/getPDCompleteDetails'; $route['getStateCityNamesAndPincode'] = 'PD_Controller/getStateCityNamesAndPincode'; $route['saveHTMLReport'] = 'PD_Controller/saveHTMLReport'; $route['(getPDReportHTML/:any/:any)'] = 'PD_Controller/getPDReportHTML'; +$route['(getPDReportPDFpreview/:any/:any)'] = 'PD_Controller/getPDReportPDFpreview'; $route['convertBase64'] = 'PD_Controller/convertImgUrlToBase64'; $route['updateNotificationToken'] = 'PD_Controller/updateNotificationToken'; $route['getPDScore'] = 'PD_Controller/getPDScoreForDisplay'; diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 7b3ebcce..932f165f 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -3306,10 +3306,11 @@ class PD_Controller extends REST_Controller { public function saveAssessedIncomeMonthwiseItems_post()//SALESITEMMONTHWISECHILD { $records = $this->post('records'); + $count = 0; foreach($records as $key => $record) { - + //$record['sales_type'] $child_data = array(); if(array_key_exists('child',$record)) { @@ -3319,6 +3320,7 @@ class PD_Controller extends REST_Controller { $id = ""; if($record['sim_id'] != null || $record['sim_id'] != "" ) { + die(); $where_condition_array = array('sim_id'=>$record['sim_id']); $id = $this->PD_Model->updateRecords($record,SALESITEMMONTHWISE,$where_condition_array); if($id != "" || $id != null) @@ -3333,7 +3335,7 @@ class PD_Controller extends REST_Controller { } else { - if($child['sales_date'] != null || $child['sales_date'] != "") + if(($child['frequency_value'] != null || $child['frequency_value'] != "") || ($child['sales_date'] != null || $child['sales_date'] != "")) { $child['fk_sim_id'] = $record['sim_id']; $child_id = $this->PD_Model->saveRecords($child,SALESITEMMONTHWISECHILD); @@ -3345,9 +3347,6 @@ class PD_Controller extends REST_Controller { } else { - //print_r($child_data);die(); - - $id = $this->PD_Model->saveRecords($record,SALESITEMMONTHWISE); if($id != "" || $id != null) @@ -3356,7 +3355,7 @@ class PD_Controller extends REST_Controller { foreach($child_data as $ckey => $child) { - if($child['sales_date'] != null || $child['sales_date'] != "") + if(($child['frequency_value'] != null || $child['frequency_value'] != "") || ($child['sales_date'] != null || $child['sales_date'] != "")) { //echo 'true'; $child['fk_sim_id'] = $id; @@ -3822,16 +3821,18 @@ class PD_Controller extends REST_Controller { //print_r($sales_monthwise);die(); foreach($sales_monthwise as $sale) { - //print_r($sale); - $annual_multuplier = 12 / $sale['no_of_months']; - if($sale['sales_type'] == 1) - { - $total_sales_monthwise = $total_sales_monthwise + ($sale['total'] * $annual_multuplier); - } - else if($sale['sales_type'] == 2) - { - $total_sales_monthwise = $total_sales_monthwise + $sale['total']; - } + + + $annual_multuplier = 12 / ( $sale['no_of_months'] ? $sale['no_of_months'] : 1); + + if($sale['sales_type'] == 1) + { + $total_sales_monthwise = $total_sales_monthwise + ($sale['total'] * $annual_multuplier); + } + else if($sale['sales_type'] == 2) + { + $total_sales_monthwise = $total_sales_monthwise + $sale['total']; + } } //calculation part @@ -3841,14 +3842,15 @@ class PD_Controller extends REST_Controller { $temp_purchases = $overall_purchase_total; $temp_grossprofit = $total_sales_monthwise - $temp_purchases; $temp_netprofit = $temp_grossprofit - $overall_business_expenses_total; - $temp_netmargin = ($temp_netprofit/$total_sales_monthwise) * 100; + $temp_netmargin = ($temp_netprofit/ ($total_sales_monthwise?$total_sales_monthwise:1) ) * 100; } else { $temp_grossprofit = $temp_netprofit ;//+ $overall_business_expenses_total; $temp_purchases = $total_sales_monthwise - $temp_grossprofit; $temp_netprofit = $temp_grossprofit - $overall_business_expenses_total; - $temp_netmargin = ($temp_netprofit/$total_sales_monthwise) * 100; + //echo $temp_netprofit.'-'.$total_sales_monthwise;die(); + $temp_netmargin = ($temp_netprofit/ ($total_sales_monthwise?$total_sales_monthwise:1) ) * 100; } $overall_summary_report['sales_calculated_by_monthwise']['sales_revenue'] = round($total_sales_monthwise); @@ -5178,10 +5180,10 @@ class PD_Controller extends REST_Controller { // MYLOG::logFunction(null,$pdid)->info($pd_string,array('data' => 'Test LOg info')); // MYLOG::logFunction()->warning($pd_string,array('data' => 'Test LOg warn')); // MYLOG::logFunction()->error($pd_string,array('data' => 'Test LOg error')); - // $this->load->helper('push_notification'); - // PUSH_NOTIFICATION::notifyWeb('fbm57p_E5xc:APA91bENk6ZH7J2kj03liCy0FzrtsYUgVjvoYnPBi4bu4UtGjqixn0Z_cUDHjCHeBWNcXlVozoo_uUKr8gwufcOQMfdRK19_sWN9jA5U1hRuwJTpIQKows6wYSHFH7kI4EnnUaj0FtK_','EST','test mesg from server',1); - //PDALERTS::pdnotification($pdid); - //die(); + // $this->load->helper('push_notification'); + // PUSH_NOTIFICATION::notifyWeb('eT3F2YlSOsU:APA91bEoK7w-_yaoWK8NUYsYwL1gAfIShm70K5t8IrHjiZAw-oNKOOL09bfgfthBoA4EFoVot17Y9ZOhWxO-B3oKVoQdYxUq6JsAdrOwmPTO-9-mJ61zBcifg34EiiUmdnrAQDt7E90t','Test Msg from test api',array()); + // PDALERTS::pdnotification($pdid); + // die(); //$this->demo(5); // $this->demo(0); @@ -7021,12 +7023,15 @@ class PD_Controller extends REST_Controller { { $pdid = $this->uri->segment(3); $random_string = $this->uri->segment(2); + $this->getLatestPDReportHTMLFile($pdid,$random_string); - //date_default_timezone_set("Asia/Kolkata"); - //echo date('Y-m-d h:i:s');die(); + } + + function getLatestPDReportHTMLFile($pdid,$random_string,$return_type = false) + { if(($pdid != null || $pdid != "")) //&& (strlen($pdid) == 16) &&(is_string($pdid))) { - $pd_data = $this->PD_Model->selectCustomRecords(array('pd_id','pd_report_html_filename'),array('random_string' => $random_string,'pd_id' => $pdid),PDTRIGGER); + $pd_data = $this->PD_Model->selectCustomRecords(array('pd_id','pd_report_html_filename'),array('random_string' => $random_string,'pd_id' => $pdid),PDTRIGGER); if(count($pd_data)) { @@ -7040,7 +7045,7 @@ class PD_Controller extends REST_Controller { } file_put_contents($temp_file_path,$report_data); $view_name = 'pd_reports/'. $pd_data[0]['pd_id'] .'/temp.html'; - $this->load->view($view_name); + return $this->load->view($view_name,array(),$return_type); } @@ -7054,6 +7059,41 @@ class PD_Controller extends REST_Controller { echo "
Disclaimer: The information contained in this report (a) is provided for the benefit of Clix Capital Services Private Limited (hereinafter referred to as Clix) only, and is not for the benefit of any other parties; (b) has been compiled by Sineedge Consulting Private Limited (Hereinafter referred as SCPL) in accordance with the instructions given, by Clix; (c) has been obtained during the visit done at premises as instructed by Clix. Some of the information in this report, by the very nature of it, might have been obtained through informal sources. SCPL wishes to mention that all due care has been exercised by SCPL in collecting information and putting together this report. However, given the nature of some of these verifications, SCPL cannot be held liable for any financial or other loss to Clix on account of any errors or omissions in the report. SCPL does not guarantee absolute accuracy of information contained herein. SCPL does not take any responsibility for any action(s) that the client may take based on the contents of this report.
'; - echo 'Registered / Corporate Office: SineEdge Consulting Private Limited. A-211, Pioneer Urban Square, Golf Course Extension Road, Sector 62, Gurgaon, Haryana - 122002
'; + echo 'Registered / Corporate Office: SineEdge Consulting Private Limited. A-211, Pioneer Urban Square, Golf Course Extension Road, Sector 62, Gurgaon, Haryana - 122002
'; } @@ -742,7 +742,12 @@ defined('BASEPATH') OR exit('No direct script access allowed'); { $business_entity_type_master = array(1 => 'Others', 2 => 'Public Ltd Company', 3 => 'Sole proprietorship', 4 => 'HUF (Hindu Undivided Family)', 5 => 'Partnership',6 => 'Cooperative',7 => 'Limited Liability Partnership(LLP)',8 => 'OPC (One Person Company)',9 => 'Society',10 => 'Trust',11 => 'Private Limited Company'); foreach ($general_form['companies'] as $comp_key => $ind_company) { + if($ind_company['is_company_applicant'] != null) + { + echo '