REG:PD REPORT

This commit is contained in:
velz 2019-05-07 11:16:59 +05:30
parent 17502b821b
commit 5efb3f606e
14 changed files with 1120 additions and 499 deletions

View File

@ -101,7 +101,7 @@ else if(ENVIRONMENT == 'testing')
{
defined('LENDER_BUCKET_NAME_PREFIX') OR define('LENDER_BUCKET_NAME_PREFIX','len');
defined('PHANTOMJSSCRIPT_LOCATION') OR define('PHANTOMJSSCRIPT_LOCATION','phantomjs_test');
defined('LOGTOBOT') OR define('LOGTOBOT',1);
defined('LOGTOBOT') OR define('LOGTOBOT',0);
}
/*********************END of AWS resources Constants*************************************************/

View File

@ -794,7 +794,7 @@ class PD_Controller extends REST_Controller {
$dataToBot = array('ENV'=>ENVIRONMENT,'Task Name'=>'PD Template Assign','Template ID'=>$choosed_template_id[0]['fk_template_id'] ,'PDID'=> $pd_details['pd_id'],'Method' => 'UpdatePDMaster','Pre-Status' => $exist_pd_details[0]['pd_status'],'Current_status' => $pd_details['pd_status']);
$dataToBot = array('ENV'=>ENVIRONMENT,'Task Name'=>'PD Template Assign','Template ID'=>$pd_details['fk_pd_template_id'] ,'PDID'=> $pd_details['pd_id'],'Method' => 'UpdatePDMaster','Pre-Status' => $exist_pd_details[0]['pd_status'],'Current_status' => $pd_details['pd_status']);
MYHTTPCLIENT::sendPOST($dataToBot);
}
@ -894,9 +894,15 @@ class PD_Controller extends REST_Controller {
{
//update Applicant details
$fields = array('additional_pd_id' => $pd_id);
$where_condition_array = array('pd_co_applicant_id'=>$pd_details['pd_co_applicant_id'],'mobile_no' => $pd_details['mobile_no']);
$this->PD_MODEL->updateRecords($fields,PDAPPLICANTSDETAILS,$where_condition_array);
$fields = array('pd_co_applicant_id'=>$pd_details['pd_co_applicant_id'],'mobile_no' => $pd_details['mobile_no']);
$where_condition_array = array('additional_pd_id' => $pd_id);
$this->PD_Model->updateRecords($fields,PDAPPLICANTSDETAILS,$where_condition_array);
//update Assiged PD to Address Table
$where_condition_array = array('pd_address_id' => $newpd['fk_address_id']);
$temp_data = array('assigned_pd' => $pd_id);
$id = $this->PD_Model->updateRecords($temp_data,PDADDRESS,$where_condition_array);
$logger = MYLOG::logFunction();
$logger->info("TEMPLATE ASSIGN FUNCTIONALTIY CALLED AND TEMPLATED ID - ".$newpd['fk_pd_template_id']." CHOOSED",array('ENV'=>ENVIRONMENT,'Parent-PDID' => $newpd['parent_pd_id'],'Addresss ID'=>$newpd['fk_address_id'] ,'PDID' => $pd_id,'PD Type' => "Addtional PD",'Current_status' => $newpd['pd_status']));
@ -905,10 +911,7 @@ class PD_Controller extends REST_Controller {
MYHTTPCLIENT::sendPOST($dataToBot);
//update Assiged PD to Address Table
$where_condition_array = array('pd_address_id' => $newpd['fk_address_id']);
$temp_data = array('assigned_pd' => $pd_id);
$id = $this->PD_Model->updateRecords($temp_data,PDADDRESS,$where_condition_array);
//PDALERTS::pdnotification($newpd['pd_id']);
@ -958,7 +961,7 @@ class PD_Controller extends REST_Controller {
$pdid = $records['pd_id'];
$pd_master_detials = $this->PD_Model->getPDMasterDetails($pdid);
$address_count = $this->db->SELECT('count(*) as count')->FROM(PDADDRESS.' as PDADDRESS')->WHERE('PDADDRESS.fk_pd_id',$pd_master_detials[0]['parent_pd_id'])->WHERE('assigned_pd is null')->GET()->result_array();
$address_count = $this->db->SELECT('count(*) as count')->FROM(PDADDRESS.' as PDADDRESS')->WHERE('PDADDRESS.fk_pd_id',$pd_master_detials[0]['parent_pd_id'])->WHERE('assigned_pd is null')->WHERE('PDADDRESS.isactive',1)->GET()->result_array();
$data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK;
@ -4690,6 +4693,7 @@ class PD_Controller extends REST_Controller {
// PDALERTS::pdnotification(600);
// die();
$records = $this->post('records');
$pdid = $records['pd_id'];
$is_regenerate = 0;
@ -4702,7 +4706,7 @@ class PD_Controller extends REST_Controller {
$data['applicants_details'] = $this->PD_Model->getApplicantsDetails($pdid);
// $data['pd_additional_requirements'] = $this->PD_Model->getPDAdditionalRequirements($pdid);
// $data['score_questions_display'] = $this->PD_Model->getScoreableQuestionToDispaly();
$data['pd_score'] = $this->calculateScore($pdid);
//$data['pd_score'] = $this->calculateScore($pdid);
//print_r($data['pd_score']);
// die();
//$score_for_chart = $data['pd_score']['score_summary']['overall_score']['final_score'] ? round($data['pd_score']['score_summary']['overall_score']['final_score'],2) : 0;
@ -4745,8 +4749,9 @@ class PD_Controller extends REST_Controller {
$data['pd_processed_forms'][$i] = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDFORMDETAILSJSON,array(),'','company_id','ASC');
}
//print_r(json_decode($data['pd_processed_forms'][20][0]['processed_json'],true));
//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);
//echo $t; die();
//PDF Gen using DOM PDF

Binary file not shown.

View File

@ -106,19 +106,31 @@ public static function getBusinessAssetsDetails($values){
// echo "helper";
// print_r($fetchVal);
$storeValue=array();
$storeValue['business_assets_mode'] = $fetchVal['business_assets_mode'];
// this is machinaries
if($fetchVal['business_assets_mode'] != ""){
$storeValue['business_assets_mode'] = $fetchVal['business_assets_mode'];
if($fetchVal['business_assets_mode']==4){
switch(strtoupper($fetchVal['business_ownership_type'])) {
case 'RENTED':
$storeValue['business_name_of_the_owner'] = '';
$storeValue['about_business_assets'] = $fetchVal['business_details'][0]['equipment_manufacturing_description'].' rented at Rs.'.$fetchVal['business_monthly_rented_amt'];
$storeValue['business_assets_mode_master'] = $fetchVal['business_assets_mode_master'];
$storeValue['ownership'] = 'RENTED';
$storeValue['business_approximate_market_value'] = 'NA';
$storeValue['rent_amount'] = $fetchVal['business_monthly_rented_amt'];
$storeValue['business_name_of_the_owner'] = '';
$storeValue['about_business_assets'] = $fetchVal['business_details'][0]['equipment_manufacturing_description'];
//.' rented at Rs.'.$fetchVal['business_monthly_rented_amt'];
$storeValue['business_approximate_market_value'] = '';
break;
case 'OWNED':
$storeValue['ownership'] = 'OWNED';
$storeValue['rent_amount'] = 'NA';
$storeValue['business_assets_mode_master'] = $fetchVal['business_assets_mode_master'];
$storeValue['business_name_of_the_owner'] = $fetchVal['business_name_of_the_owner'][0]['id']==0 ? $fetchVal['business_name_of_the_other_owner'] : $fetchVal['business_name_of_the_owner'][0]['name'];
$storeValue['about_business_assets'] = $fetchVal['business_details'][0]['equipment_manufacturing_description'].' purchased in '.$fetchVal['business_purchase_year'];
$storeValue['about_business_assets'] = $fetchVal['business_details'][0]['equipment_manufacturing_description'];
//.' purchased in '.$fetchVal['business_purchase_year'];
$storeValue['business_approximate_market_value'] = 'Rs.'.$fetchVal['business_approximate_market_value'];
@ -133,14 +145,22 @@ public static function getBusinessAssetsDetails($values){
else if($fetchVal['business_assets_mode']==3){
switch(strtoupper($fetchVal['business_ownership_type'])) {
case 'RENTED':
$storeValue['business_name_of_the_owner'] = '';
$storeValue['about_business_assets'] = $fetchVal['business_details'][0]['manufacturer_model_vehicle'].' rented at Rs.'.$fetchVal['business_monthly_rented_amt'];
$storeValue['business_approximate_market_value'] = '';
$storeValue['business_assets_mode_master'] = $fetchVal['business_assets_mode_master'];
$storeValue['ownership'] = 'RENTED';
$storeValue['business_approximate_market_value'] = 'NA';
$storeValue['rent_amount'] = $fetchVal['business_monthly_rented_amt'];
$storeValue['about_business_assets'] = $fetchVal['business_details'][0]['manufacturer_model_vehicle'];
//.' rented at Rs.'.$fetchVal['business_monthly_rented_amt'];
break;
case 'OWNED':
//print_r($fetchVal['business_name_of_the_owner']);die();
$storeValue['ownership'] = 'OWNED';
$storeValue['rent_amount'] = 'NA';
$storeValue['business_assets_mode_master'] = $fetchVal['business_assets_mode_master'];
$storeValue['business_name_of_the_owner'] = $fetchVal['business_name_of_the_owner'][0]['id']==0 ? $fetchVal['business_name_of_the_other_owner'] : $fetchVal['business_name_of_the_owner'][0]['name'];
$storeValue['about_business_assets'] = $fetchVal['business_details'][0]['manufacturer_model_vehicle'].' purchased in '. $fetchVal['business_purchase_year'];
$storeValue['about_business_assets'] = $fetchVal['business_details'][0]['manufacturer_model_vehicle'];
//.' purchased in '. $fetchVal['business_purchase_year'];
$storeValue['business_approximate_market_value'] = 'Rs.'.$fetchVal['business_approximate_market_value'];
break;
default:
@ -154,13 +174,22 @@ public static function getBusinessAssetsDetails($values){
else if($fetchVal['business_assets_mode']==2){
switch(strtoupper($fetchVal['business_ownership_type'])) {
case 'RENTED':
$storeValue['business_name_of_the_owner'] = '';
$storeValue['about_business_assets'] = $fetchVal['business_details'][0]['property_type']==1 ? $fetchVal['business_details'][0]['other_property_type'].' rented at Rs.'. $fetchVal['business_monthly_rented_amt'] : $fetchVal['business_details'][0]['property_type'].' rented at Rs.'. $fetchVal['business_monthly_rented_amt'];
$storeValue['business_approximate_market_value'] = '';
$storeValue['business_assets_mode_master'] = $fetchVal['business_assets_mode_master'];
$storeValue['ownership'] = 'RENTED';
$storeValue['business_approximate_market_value'] = 'NA';
$storeValue['rent_amount'] = $fetchVal['business_monthly_rented_amt'];
$storeValue['about_business_assets'] = $fetchVal['business_details'][0]['property_type']==1 ? $fetchVal['business_details'][0]['other_property_type']:$fetchVal['business_details'][0]['property_type_master'];
//.' rented at Rs.'. $fetchVal['business_monthly_rented_amt'] : $fetchVal['business_details'][0]['property_type'].' rented at Rs.'. $fetchVal['business_monthly_rented_amt'];
break;
case 'OWNED':
$storeValue['ownership'] = 'OWNED';
$storeValue['rent_amount'] = 'NA';
$storeValue['business_assets_mode_master'] = $fetchVal['business_assets_mode_master'];
$storeValue['business_name_of_the_owner'] = $fetchVal['business_name_of_the_owner'][0]['id']==0 ? $fetchVal['business_name_of_the_other_owner'] : $fetchVal['business_name_of_the_owner'][0]['name'];
$storeValue['about_business_assets'] = $fetchVal['business_details'][0]['property_type']==1 ? $fetchVal['business_details'][0]['other_property_type'].' purchased in '. $fetchVal['business_purchase_year'] : $fetchVal['business_details'][0]['property_type'].' purchased in '. $fetchVal['business_purchase_year'];
$storeValue['about_business_assets'] = $fetchVal['business_details'][0]['property_type']==1 ? $fetchVal['business_details'][0]['other_property_type']:$fetchVal['business_details'][0]['property_type_master'];
//.' purchased in '. $fetchVal['business_purchase_year'] : $fetchVal['business_details'][0]['property_type'].' purchased in '. $fetchVal['business_purchase_year'];
$storeValue['business_approximate_market_value'] = 'Rs.'.$fetchVal['business_approximate_market_value'];
break;
default:
@ -173,13 +202,22 @@ public static function getBusinessAssetsDetails($values){
else if($fetchVal['business_assets_mode']==1){
switch(strtoupper($fetchVal['business_ownership_type'])) {
case 'RENTED':
$storeValue['business_name_of_the_owner'] = '';
$storeValue['about_business_assets'] = $fetchVal['business_details'][0]['any_other_assets'].' rented at Rs.'. $fetchVal['business_monthly_rented_amt'];
$storeValue['business_approximate_market_value'] = 'Rs.'.$fetchVal['business_details'][0]['any_other_asset_value'];
$storeValue['business_assets_mode_master'] = $fetchVal['business_assets_mode_master'];
$storeValue['ownership'] = 'RENTED';
$storeValue['business_approximate_market_value'] = 'NA';
$storeValue['business_name_of_the_owner'] = '';
$storeValue['rent_amount'] = $fetchVal['business_monthly_rented_amt'];
$storeValue['about_business_assets'] = $fetchVal['business_details'][0]['any_other_assets'];
//.' rented at Rs.'. $fetchVal['business_monthly_rented_amt'];
break;
case 'OWNED':
$storeValue['ownership'] = 'OWNED';
$storeValue['business_assets_mode_master'] = $fetchVal['business_assets_mode_master'];
$storeValue['rent_amount'] = 'NA';
$storeValue['business_name_of_the_owner'] = $fetchVal['business_name_of_the_owner']['id']==0 ? $fetchVal['business_name_of_the_other_owner'] : $fetchVal['business_name_of_the_owner']['name'];
$storeValue['about_business_assets'] = $fetchVal['business_details'][0]['any_other_assets'].' purchased in '. $fetchVal['business_purchase_year'].' at Rs.'.$fetchVal['business_details'][0]['any_other_asset_value'];
$storeValue['about_business_assets'] = $fetchVal['business_details'][0]['any_other_assets'];
//.' purchased in '. $fetchVal['business_purchase_year'].' at Rs.'.$fetchVal['business_details'][0]['any_other_asset_value'];
$storeValue['business_approximate_market_value'] = 'Rs.'.$fetchVal['business_approximate_market_value'];
break;
default:
@ -187,6 +225,7 @@ public static function getBusinessAssetsDetails($values){
$storeValue['about_business_assets'] = '';
$storeValue['business_approximate_market_value'] = '';
}
}
}
array_push($mergeResult,$storeValue);

View File

@ -4,19 +4,20 @@ class Bankingform
{
//get business Banking
public static function getBusinessBankingDetails($values){
if(count($values)>0){
// print_r($values);die();
if(count($values)>0){
$values = array_map(function($tag) {
$count_vintage = $tag['vintage_year'] >0 ? $tag['vintage_year'] :"";
$count_vintage .= ($tag['vintage_year'] == 1) ? " Year" : (($tag['vintage_year'] > 1) ? " Years" : "");
$count_vintage.=' ';
$count_vintage .=$tag['vintage_month'] >0 ? $tag['vintage_month'] : "";
$count_vintage .=$tag['vintage_month'] >0 ? ' and ' . $tag['vintage_month'] : "";
$count_vintage .=($tag['vintage_month'] == 1) ? " Month" : (($tag['vintage_month'] > 1) ? " Months" : "");
return array(
'account_name' => $tag['applicant_name']['id']==0 ? $tag['other_applicant'] : $tag['applicant_name']['name'],
'bank_name' => $tag['bank_name'] ==1 ? $tag['other_bank'] : $tag['bank_name'],
'account_type' => $tag['account_type'],
'bank_name' => $tag['bank_name'] ==1 ? $tag['other_bank'] : $tag['bank_name_master'],
'account_type' => $tag['account_type_master'],
'main_business' => $tag['salary'],
'od_cc_limit' => ($tag['account_type']==3) ? $tag['limit'] : (($tag['account_type']==4) ? $tag['limit'] : ''),
'od_cc_limit' => ($tag['account_type']==3) ? $tag['limit'] : (($tag['account_type']==4) ? $tag['limit'] : 'NA'),
'vintage' => $count_vintage,
);
}, $values);

View File

@ -8,13 +8,14 @@ public static function getPartnerDetails($values){
foreach($values as $parRow){
$getPartner = array_map(function($tag) {
$con_business_run = $tag['current_business_experiance_year'] >0 ? $tag['current_business_experiance_year'] :"";
$con_business_run .= ($tag['current_business_experiance_year'] == 1) ? "Year" : (($tag['current_business_experiance_year'] > 1) ? "Years" : "");
$con_business_run .= ($tag['current_business_experiance_year'] == 1) ? " Year" : (($tag['current_business_experiance_year'] > 1) ? " Years" : "");
$con_business_run.=' ';
$con_business_run .=$tag['current_business_experiance_month'] >0 ? $tag['current_business_experiance_month'] : "";
$con_business_run .=($tag['current_business_experiance_month'] == 1) ? "Month" : (($tag['current_business_experiance_month'] > 1) ? "Months" : "");
$con_business_run .=$tag['current_business_experiance_month'] >0 ? 'and ' . $tag['current_business_experiance_month'] : "";
$con_business_run .=($tag['current_business_experiance_month'] == 1) ? " Month" : (($tag['current_business_experiance_month'] > 1) ? " Months" : "");
return array(
'name' => array_key_exists('partner_other_name',$tag) ? $tag['partner_other_name'] : $tag['partner_name_master'],
'share_holding' => $tag['shareholding'].'%',
'started_business' => $tag['started_business'] ? $tag['started_business'] : 'No',
'no_years_business' => $con_business_run,
'total_experience' => $tag['total_business_experiance'],
'previous_experience' => array_key_exists('total_business_previous_experience',$tag) ? $tag['total_business_previous_experience'] : 'NIL',
@ -32,8 +33,9 @@ public static function getFamilyMemberDetails($values){
$getFamilyMembers = array_map(function($tag) {
return array(
'name' => $tag['family_member_salutation_master'].' '.$tag['family_member_name'],
'relation' => $tag['other_family_relationship_id_master'] .' of '.$tag['relation_to_id_master'],
'designation' => $tag['relationship_with_company_id_master'],
'individual_relation' => $tag['other_family_relationship_id_master'] .' of ',
'relation_to' => $tag['relation_to_id_master'],
'relation_to_company' => substr($tag['relationship_with_company_id_master'],0,-2),
'started_business' => $tag['started_business'],
);
@ -48,6 +50,7 @@ public static function getActivityDetails($values,$type){
foreach($values as $busManuRowkey=>$busManuRow){
$getEachProducts=array();
$getEachProducts['products']=$busManuRow['main_products'];
$getEachProducts['description']=$busManuRow['description'];
$getEachProducts['area_of_sale']=$busManuRow['area_of_sale'];
// check area of sales
@ -207,6 +210,7 @@ public static function getActivityDetails($values,$type){
foreach($values as $busManuRowkey=>$busManuRow){
$getEachProducts=array();
$getEachProducts['products']=$busManuRow['main_products'];
$getEachProducts['description']=$busManuRow['description'];
$getEachProducts['area_of_sale']=$busManuRow['area_of_sale'];
// check area of sales
@ -366,6 +370,7 @@ public static function getActivityDetails($values,$type){
foreach($values as $busManuRowkey=>$busManuRow){
$getEachProducts=array();
$getEachProducts['products']=$busManuRow['others_details'];
$getEachProducts['description']=$busManuRow['description'];
array_push($getRow,$getEachProducts);
}

View File

@ -51,15 +51,17 @@ public static function getOtherLoanDetails($values){
// business financial details
public static function getBusinessFinancialDetails($values){
$values = array_map(function($tag) {
return array(
return array(
'financial_year' => $tag['financial_year'],
'financial_annual_sale' => 'Rs.'.$tag['financial_annual_sale'],
'financial_sales_revenue' => 'Rs.'.$tag['financial_annual_sale'],
'financial_net_profit_mode' => $tag['finanical_profit_or_loss']==1 ? 1 : 0,
'financial_net_profit' => $tag['finanical_profit_or_loss']==1 ? 'Rs.'.$tag['financial_net_profit'] : '',
'financial_net_loss' => $tag['finanical_profit_or_loss']!=1 ? 'Rs.'.$tag['financial_net_loss'] : '',
'financial_margin_of_profit' => $tag['finanical_profit_or_loss']==1 ? $tag['financial_margin_of_profit'] : '',
'financial_net_loss' => $tag['finanical_profit_or_loss']!=1 ? 'Rs.'.$tag['financial_net_loss'] : '',
'financial_margin_of_loss' => $tag['finanical_profit_or_loss']!=1 ? $tag['financial_margin_of_loss'] : '',
'profit_variation' => $tag['financial_variation'],
'sale_variation' => $tag['financial_profit_to_sale_variation'],
'sale_variation' => $tag['financial_annualsales_variation'],'financial_profit_to_sale_variation' => $tag['financial_profit_to_sale_variation']
);
}, $values);
return $values;
@ -70,26 +72,54 @@ public static function getBusinessCustomerFinancialDetails($values) {
if($tag['estimate_profit_or_loss']==1){
return array(
'estimate_profit_or_loss' => $tag['estimate_profit_or_loss'],
'estimate_sales_average' => 'Rs.'.$tag['estimate_sales_average'],
'estimate_sales_from_to' => '(Rs.'.$tag['estimate_sales_from'].', Rs.'.$tag['estimate_sales_to'].')',
'estimate_sales_to' => 'Rs.'.$tag['estimate_sales_to'],
'estimate_sales_average' => $tag['estimate_sales_average'],
'estimate_sales_from' => $tag['estimate_sales_from'],
'estimate_sales_to' => $tag['estimate_sales_to'],
'estimate_net_margin_availablity' => $tag['estimate_net_margin_availablity'],
'estimate_net_margin' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? 'Rs.'.$tag['estimate_profit_margin'] : 'Rs.'.$tag['estimate_net_profit'],
'estimate_net_margin_from_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '(Rs.'.$tag['estimate_net_profit_from'].', Rs.'.$tag['estimate_net_profit_to'].')' : '',
'estimate_net_margin_range' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_profit_percent'] : $tag['estimate_profit_margin_percent'],
'estimate_net_margin_range_from_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '' : '( '.$tag['estimate_profit_range_from'].', '.$tag['estimate_profit_range_to'].')',
//'estimate_net_margin' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ?$tag['estimate_profit_margin'] : $tag['estimate_net_profit'],
'net_profit_loss_sales_per_from' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_profit_range_from']: $tag['estimate_net_profit_from'],
'net_profit_loss_sales_per_to' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_profit_range_to']: $tag['estimate_net_profit_to'],
'net_profit_loss_sales_final_per' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_profit_margin_percent']:$tag['estimate_profit_margin'], //$tag['estimate_net_profit_percent'],
'net_profit_loss_sales_final_rs' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_profit_margin']: $tag['estimate_profit_margin_percent'],//$tag['estimate_net_profit'],
//'estimate_net_margin_from' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_profit_from']: '',
//'estimate_net_margin_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_profit_to']:'',
//'estimate_net_margin_range' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_profit_percent'] : $tag['estimate_profit_margin_percent'],
//'estimate_net_margin_range_from' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '' : $tag['estimate_profit_range_from'],
// 'estimate_net_margin_range_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '' : '( '.$tag['estimate_profit_range_from'].', '.$tag['estimate_profit_range_to'].')',
);
}
else if($tag['estimate_profit_or_loss']==2){
return array(
'estimate_profit_or_loss' => $tag['estimate_profit_or_loss'],
'estimate_sales_average' => 'Rs.'.$tag['estimate_sales_average'],
'estimate_sales_from_to' => '(Rs.'.$tag['estimate_sales_from'].', Rs.'.$tag['estimate_sales_to'].')',
'estimate_sales_from' =>$tag['estimate_sales_from'],
'estimate_sales_to' => $tag['estimate_sales_to'],
'estimate_net_margin_availablity' => $tag['estimate_net_margin_availablity'],
'estimate_net_margin' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? 'Rs.'.$tag['estimate_net_loss'] : 'Rs.'.$tag['estimate_loss_margin'],
'estimate_net_margin_from_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '(Rs.'.$tag['estimate_net_loss_from'].', Rs.'.$tag['estimate_net_loss_to'].')' : '',
'estimate_net_margin_range' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_loss_percent'] : $tag['estimate_loss_margin_percent'],
'estimate_net_margin_range_from_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '' : '('.$tag['estimate_loss_range_from'].', '.$tag['estimate_loss_range_to'].')',
'net_profit_loss_sales_per_from' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_loss_range_from']: $tag['estimate_net_profit_from'],
'net_profit_loss_sales_per_to' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_loss_range_to']: $tag['estimate_net_loss_to'],
'net_profit_loss_sales_final_per' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_loss_margin_percent']: $tag['estimate_loss_margin'],//$tag['estimate_net_loss_percent'],
'net_profit_loss_sales_final_rs' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_loss_margin']: $tag['estimate_loss_margin_percent']//$tag['estimate_net_loss'],
//'estimate_net_margin' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? 'Rs.'.$tag['estimate_net_loss'] : 'Rs.'.$tag['estimate_loss_margin'],
//'estimate_net_margin_from_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '(Rs.'.$tag['estimate_net_loss_from'].', Rs.'.$tag['estimate_net_loss_to'].')' : '',
//'estimate_net_margin_range' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_loss_percent'] : $tag['estimate_loss_margin_percent'],
//'estimate_net_margin_range_from_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '' : '('.$tag['estimate_loss_range_from'].', '.$tag['estimate_loss_range_to'].')',
);
}
@ -109,5 +139,16 @@ public static function getBusinessCustomerHeader($values){
return array();
}
}
public static function getAvailableFacilities($array)
{
$word_array = array('1' => 'Others', '2' => 'Bank Guarantee', '3' => 'Cash Credit Limit','4' => 'Factoring', '5' => 'Forfaiting', '6' => 'Letter of Credit');
if(is_array($array))
{
//$array = array_map(function($arr){ },$array);
}
return $array;
}
}
?>

View File

@ -1960,6 +1960,67 @@ class GETPROCESSEDJSON
}
}
if(array_key_exists('state',$address))
{
//print_r($address);
$CI->db->SELECT( $master_tables_field_names['STATE'] );
$CI->db->FROM(STATE);
$CI->db->WHERE('isactive',1);
$CI->db->WHERE($master_tables_pkid['STATE'] ,$address['state']);
$adress_type_name= $CI->db->GET()->result_array();
//print_r($CI->db->last_query());
if(count($adress_type_name))
{
$raw_json['addresses'][$raw_json_key]['state_master'] = $adress_type_name[0][$master_tables_field_names['STATE']];
}
}
if(array_key_exists('city',$address))
{
//print_r($address);
$CI->db->SELECT( $master_tables_field_names['CITY'] );
$CI->db->FROM(CITY);
$CI->db->WHERE('isactive',1);
$CI->db->WHERE($master_tables_pkid['CITY'] ,$address['city']);
$city= $CI->db->GET()->result_array();
//print_r($CI->db->last_query());
if(count($city))
{
$raw_json['addresses'][$raw_json_key]['city_master'] = $city[0][$master_tables_field_names['CITY']];
}
}
if(array_key_exists('pincode',$address))
{
//print_r($address);
$CI->db->SELECT( $master_tables_field_names['PINCODE'] );
$CI->db->FROM(PINCODE);
$CI->db->WHERE('isactive',1);
$CI->db->WHERE($master_tables_pkid['PINCODE'] ,$address['pincode']);
$pincode= $CI->db->GET()->result_array();
//print_r($CI->db->last_query());
if(count($pincode))
{
$raw_json['addresses'][$raw_json_key]['pincode_master'] = $pincode[0][$master_tables_field_names['PINCODE']];
}
}
if(array_key_exists('uom',$address))
{
//print_r($address);
$CI->db->SELECT( $master_tables_field_names['UOM'] );
$CI->db->FROM(UOM);
$CI->db->WHERE('isactive',1);
$CI->db->WHERE($master_tables_pkid['UOM'] ,$address['uom']);
$uom= $CI->db->GET()->result_array();
//print_r($CI->db->last_query());
if(count($uom))
{
$raw_json['addresses'][$raw_json_key]['uom_master'] = $uom[0][$master_tables_field_names['UOM']];
}
}
}
return ($raw_json);

View File

@ -15,7 +15,7 @@ class MYUTIL
$digits_1 = strlen($no);
$i = 0;
$str = array();
$words = array('0' => '', '1' => 'One', '2' => 'Two',
$words = array('0' => 'zero', '1' => 'One', '2' => 'Two',
'3' => 'Three', '4' => 'Four', '5' => 'Five', '6' => 'Six',
'7' => 'Seven', '8' => 'Eight', '9' => 'Nine',
'10' => 'Ten', '11' => 'Eleven', '12' => 'Twelve',
@ -47,12 +47,12 @@ class MYUTIL
$points = ($point) ?
"." . $words[$point / 10] . " " .
$words[$point = $point % 10] : '';
$res = $result . "Rupees " ;
$res = $result;
if($points != "")
{
$res.=$points . " Paise";
}
return $res;
return $result.' Only';
}
@ -78,18 +78,47 @@ class MYUTIL
// die();
if($companyid == $value['company_order_id'])
{
$getSentense = $value['company_name'];
$getSentense .=' is a ';
$getSentense .=$value['business_entity_type']==1 ? $value['business_entity_type_other'] : $value['business_entity_type_master'];
$getSentense .=' formed on ';
$data['company_name'] = $value['company_name'];
//$getSentense .=' is a ';
$data['type_of_activity'] = $value['business_entity_type']==1 ? $value['business_entity_type_other'] : $value['business_entity_type_master'];
//$getSentense .=' formed on ';
//echo $data['type_of_activity'];
switch($value['business_entity_type'])
{
case 1:
case 6:
case 9:
$data['partners_title_name'] = "Member Details";
break;
case 2:
$data['partners_title_name'] = "Director / Shareholder Details";
break;
case 3:
//echo '3';
$data['partners_title_name'] = "Proprietor Details";
break;
case 4:
$data['partners_title_name'] = "Karta Details";
break;
case 5:
case 7:
$data['partners_title_name'] = "Partner Details";
break;
case 8:
case 11:
$data['partners_title_name'] = "Director Details";
break;
case 10:
$data['partners_title_name'] = "Trustee Details";
break;
}
$data['year_and_month']= $value['business_years'] . ' Years';
$data['year_and_month'] .= isset($value['business_month']) ? ' and '.$value['business_month'] . ' Months': '';
$year_and_month = $value['business_years'] . ' Years';
$year_and_month .= isset($value['business_month']) ? $value['business_month'] . ' months ago': ' ago';
$getSentense .=$value['business_date_object'] ? date("d-m-Y", strtotime($value['business_date_object'])) : $year_and_month;
$data['formed_on'] = $value['business_date_object'] ? date("d-m-Y", strtotime($value['business_date_object'])) : null;
$getSentense .='.';
return $getSentense;
return $data;
//return $value['company_name'].' is a '.$value['business_entity_type']==1 ? $value['business_entity_type_other'] : $value['business_entity_type_master'] .' formed on '.date("d-m-Y", strtotime($value['business_date_object']));
}
}

View File

@ -307,7 +307,7 @@ class PDALERTS
$logger->error("Mailer Error:" ,array($mail->ErrorInfo));
} else {
$logger->info("Mailer Send:" ,array('mail ID' => $lender_email,'Status' => 'SEND'));
$logger->info("Mailer Send:" ,array('mail_ID' => $lender_email,'Status' => 'SEND'));
}
}

View File

@ -18,7 +18,7 @@ public static function getStockManufacturingDetails($rawMaterial,$goods){
'name' => $tag['raw_name'],
'quantity' => strtoupper($tag['stock_observed'])=='YES' ? $tag['raw_quantity'] : '',
'uom' => strtoupper($tag['stock_observed'])=='YES' ? $getUom : '',
'value' => strtoupper($tag['stock_observed'])=='YES' ? 'Rs.'.$tag['raw_value'] : '',
'value' => strtoupper($tag['stock_observed'])=='YES' ? $tag['raw_value'] : '',
);
}, $rawMaterial);
@ -33,7 +33,7 @@ public static function getStockManufacturingDetails($rawMaterial,$goods){
'name' => $tag['goods_name'],
'quantity' => strtoupper($tag['goods_observed'])=='YES' ? $tag['goods_quantity'] : '',
'uom' => strtoupper($tag['goods_observed'])=='YES' ? $getGUom : '',
'value' => strtoupper($tag['goods_observed'])=='YES' ? 'Rs.'.$tag['goods_value'] : '',
'value' => strtoupper($tag['goods_observed'])=='YES' ? $tag['goods_value'] : '',
);
}, $goods);
@ -52,7 +52,7 @@ public static function getStockRetailDetails($goods){
'name' => $tag['traded_goods_name'],
'quantity' => strtoupper($tag['traded_goods_observed'])=='YES' ? $tag['traded_goods_quantity'] : '',
'uom' => strtoupper($tag['traded_goods_observed'])=='YES' ? $getUom : '',
'value' => strtoupper($tag['traded_goods_observed'])=='YES' ? 'Rs.'.$tag['estimated_traded_goods_value'] : '',
'value' => strtoupper($tag['traded_goods_observed'])=='YES' ? $tag['estimated_traded_goods_value'] : '',
'is_sufficiant' => (strtoupper($tag['traded_goods_observed'])=='YES') ? $getSufficient : ((strtoupper($tag['traded_goods_observed'])=='NO') ? $getSufficient : ''),
);
}, $goods);
@ -71,7 +71,7 @@ public static function getStockWholesaleDetails($goods){
'name' => $tag['traded_goods_name'],
'quantity' => strtoupper($tag['traded_goods_observed'])=='YES' ? $tag['traded_goods_quantity'] : '',
'uom' => strtoupper($tag['traded_goods_observed'])=='YES' ? $getUom : '',
'value' => strtoupper($tag['traded_goods_observed'])=='YES' ? 'Rs.'.$tag['estimated_traded_goods_value'] : '',
'value' => strtoupper($tag['traded_goods_observed'])=='YES' ? $tag['estimated_traded_goods_value'] : '',
'is_sufficiant' => (strtoupper($tag['traded_goods_observed'])=='YES') ? $getSufficient : ((strtoupper($tag['traded_goods_observed'])=='NO') ? $getSufficient : ''),
);
}, $goods);

View File

@ -21,7 +21,7 @@ class Pdfgenerator
public function generate($html, $filename='', $stream=TRUE, $paper = 'A4', $orientation = "portrait")
{
// echo 'stream'.$html.'tttt';
$dompdf = new Dompdf(array('enable_remote' => true,'DOMPDF_ENABLE_PHP'=>true));
$dompdf = new Dompdf(array('enable_remote' => true,'DOMPDF_ENABLE_PHP'=>true,'DOMPDF_UNICODE_ENABLED' => true));
$dompdf->load_html($html);
$dompdf->set_paper($paper, $orientation);

View File

@ -744,7 +744,7 @@ class PD_Model extends SPARQ_Model {
*/
public function getPDMasterDetails($pdid)
{
$this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.fk_lender_id,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation,DATE_FORMAT(PDTRIGGER.pd_report_generated_date,"%d/%m/%Y") as pd_report_generated_date,PDTRIGGER.pd_date_of_initiation as pd_date_of_initiation_sqlformat, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %H:%i %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.full_name as agency_name, PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done,PDTRIGGER.encrypted_url,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id');
$this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.fk_lender_id,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation,DATE_FORMAT(PDTRIGGER.pd_report_generated_date,"%d/%m/%Y") as pd_report_generated_date,PDTRIGGER.pd_date_of_initiation as pd_date_of_initiation_sqlformat, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %H:%i %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.full_name as agency_name, PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done,PDTRIGGER.encrypted_url,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id,PDTRIGGER.start_location');
$this->db->FROM(PDTRIGGER.' as PDTRIGGER');
$this->db->JOIN(ENTITY.' as ENTITY','PDTRIGGER.fk_lender_id = ENTITY.entity_id ','LEFT');
$this->db->JOIN(ENTITYBILLING.' as ENTITYBILLING','PDTRIGGER.fk_entity_billing_id = ENTITYBILLING.entity_billing_id','LEFT');

File diff suppressed because it is too large Load Diff