QC MAIL LOG REMOVED AI ISSUE FIXED

This commit is contained in:
Velz2020 2019-08-04 23:02:18 +05:30
parent 41b54f0378
commit 23b08dbc42
10 changed files with 88 additions and 37 deletions

View File

@ -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/';
/*

View File

@ -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*************************************************/

View File

@ -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';

View File

@ -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 "<h1> Not Found</h1>";
}
}
public function getPDReportPDFpreview_post()
{
//echo json_encode(array('link'=>'https://demo.pdgenie.com/ssa_external_data/testing/pd_reports/1135/sample.pdf'));die();
$pdid = $this->uri->segment(3);
log_message('DEBUG',"getPDReportPDFpreview_post called ");//die();
$random_string = $this->uri->segment(2);
EXTERNAL_DIR_CHECK::checkExternalDirectory($pdid);
$records = $this->post('myData');
$report_data = '';
if($records)
{
$report_data = $records;
}
else
{
$report_data = $this->getLatestPDReportHTMLFile($pdid,$random_string,true);
}
$pdf_doc = $this->pdfgenerator->generate($report_data, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait");
//End of PDF Gen using DOM PDF
$output_file2 = $this->external_path ."/pd_reports/" . $pdid . "/sample.pdf";
$link = 'https://'. $this->config->item('full_server_name').'/ssa_external_data/'. ENVIRONMENT.'/pd_reports/'. $pdid . "/sample.pdf";
file_put_contents($output_file2, $pdf_doc);
//header("Access-Control-Allow-Methods: GET, OPTIONS");
header('Access-Control-Allow-Origin: *');
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
echo json_encode(array('link'=>$link));
}
@ -7746,7 +7786,7 @@ class PD_Controller extends REST_Controller {
if( $total_stock_observed != 0 && !(count($pd_images[11])))//&& !count($pd_images[11][0])) )
{
$incomplete_details[] = 'Stock Section - Images not sufficient. Available Images';// - '.(count($pd_images[11]) ? count($pd_images[11]) : 0);
$incomplete_details[] = 'Stock Section - Images not sufficient';//. Available Images';// - '.(count($pd_images[11]) ? count($pd_images[11]) : 0);
}
//}
}

View File

@ -21,7 +21,7 @@ class AssessedIncome
$net_profit_loss_row = '<tr> <td>f. Net Profit / Loss(c-e) </td>';
$house_hold_expense_row = '<tr> <td>g. Household Expenses </td>';
$disposable_income_row = '<tr> <td>h. Disposable Income</td>';
$net_margin_row = '<tr> <td>h. Net Margin % </td>';
$net_margin_row = '<tr> <td>i. Net Margin % </td>';
$considered_sales_revenue_row = '<tr> <td>a) Considered Sales / Revenue ( Average) </td>';
$considered_net_profit_row = '<tr> <td>b) Considered Net Profit ( Average)</td>';
$considered_net_margint_row = '<tr> <td>c) Considered Net Margin % ((b/a) * 100 )</td>';

View File

@ -69,7 +69,7 @@ class AUTHORIZATION
// print_r($role_permission_array);
// die();
if( $routingName == ROUTE_LOGIN_X)
if( $routingName == ROUTE_LOGIN_X || $routingName == ROUTE_LOGIN_Y)
{
return true;
}

View File

@ -35,7 +35,7 @@ class EXTERNAL_DIR_CHECK
$pd_folder = $array[3].'/'.$pd_id;
if(!file_exists($pd_folder))
{
mkdir($pd_folder,0761);
mkdir($pd_folder,0777);
}
}

View File

@ -389,7 +389,7 @@ class PDALERTS
$mail->IsSMTP(); // Telling the class to use SMTP
$mail->SMTPAuth = true;
$mail->SMTPDebug = 1;
$mail->SMTPDebug = 0;
$mail->SMTPSecure = "ssl";
$mail->Host = 'bh-in-16.webhostbox.net'; // SMTP server
$mail->Username = "noreply@ssa.sineedge.com"; // "The account"

View File

@ -80,7 +80,8 @@ class PUSH_NOTIFICATION
$result = curl_exec($ch );
curl_close( $ch );
$CI =&get_instance();
//print_r($result);
// print_r($result);
// die();
MYLOG::logFunction(null,$additional_data['pd_id'])->info("PUSH NOTIFICATION ",array('firebase_result' => $result,'additional_data' => $additional_data,'token_type' => ($type == 1? 'WEB' : 'MOB'),'token' => $token));
}
}

View File

@ -508,7 +508,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
{
echo '<p align="justify"><i><strong>Disclaimer:</strong> 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.</i></p>';
echo '<p align="justify"><i><strong>Registered / Corporate Office:</strong> SineEdge Consulting Private Limited. A-211, Pioneer Urban Square, Golf Course Extension Road, Sector 62, Gurgaon, Haryana - 122002<i></p>';
echo '<p align="justify"><i><strong>Registered / Corporate Office:</strong> SineEdge Consulting Private Limited. A-211, Pioneer Urban Square, Golf Course Extension Road, Sector 62, Gurgaon, Haryana - 122002</i></p>';
}
@ -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 '<tr><td class="customtd">'. $ind_company['company_name'] .'</td><td class="customtd">'. $ind_company['business_years']. (isset($ind_company['business_month']) ? ' . ' . $ind_company['business_month']: null) .'</td><td class="customtd">'. ( $ind_company['business_entity_type'] == 1 ? $ind_company['business_entity_type_other'] : $business_entity_type_master[ $ind_company['business_entity_type'] ] ).'</td><td class="customtd"> Not Applicable </td></tr>';
}
}
}
?>
@ -2228,6 +2233,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$bbRow = $pd_processed_forms[21][$business_count] ;
$businessBankRow = json_decode($bbRow['processed_json'],true);
$business_banking_common_remarks = $businessBankRow['banking_form_remark'];
//print_r($businessBankRow);die();
if(isset($businessBankRow['bank_info_available']) && $businessBankRow['bank_info_available'] == 1)
{
$is_business_banking_available = 1;
@ -2372,7 +2378,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$client_fourth_row .= $main_raw_material['person_stdcode'] && $main_raw_material['person_landline'] ? '<td class="customtd">'. $main_raw_material['person_stdcode'].' '.$main_raw_material['person_landline'].'</td>' : '<td class="customtd">'.'Not Provided'.'</td>';
$client_fifth_row .= $main_raw_material['manufacturing_payment_type_master'] ? '<td class="customtd">'. $main_raw_material['manufacturing_payment_type_master'] .'</td>' : '<td class="customtd">NA</td>';
$client_fifth_row .= isset($main_raw_material['manufacturing_payment_type_master']) && $main_raw_material['manufacturing_payment_type_master'] ? '<td class="customtd">'. $main_raw_material['manufacturing_payment_type_master'] .'</td>' : '<td class="customtd">NA</td>';
$client_sixth_row .= $main_raw_material['manufacturing_payment_mode'] ? '<td class="customtd">'. $main_raw_material['manufacturing_payment_mode'] .'</td>' : '<td class="customtd">NA</td>';;
@ -3525,7 +3531,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$ind_banking_common_remarks = $individualBankRow['banking_form_remark'];
if(isset($individualBankRow['bank_info_available']) && $individualBankRow['bank_info_available'] == 1)
{
$is_personal_banking_available = 1;
if(count($individualBankRow['banking_details'])>0){
$getIndividualEachValues=BANKINGFORM::getIndividualBankingDetails($individualBankRow['banking_details']);
$bankingResult = array_merge($bankingResult,$getIndividualEachValues);
@ -3797,7 +3803,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
?>
<h3>Neighbourhood / Reference Check</h3>
<h3 contenteditable="true">Neighbourhood / Reference Check</h3>
<?php
//echo $pd_offiecer_status_about_neighbor;