diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php
index e2741124..6704b9ee 100644
--- a/api/application/controllers/PD_Controller.php
+++ b/api/application/controllers/PD_Controller.php
@@ -4836,7 +4836,7 @@ public function getPDFormDetailsJSON_post()
{
- $all_pd_images = $this->PD_Model->getSignedPDDocsURL($pdid);
+ $all_pd_images = $this->PD_Model->getSignedPDDocsURL($pdid,null,null,null,null,'report');
$all_form_names = $this->PD_Model->selectCustomRecords(array('pd_form_id','pd_form_name'),array(),PDFORMS);
$form_name = array();
@@ -7740,13 +7740,19 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
if(count($business_expenses))
{
//echo "Update";
- $where_condition_array = array('pd_expense_id' => $business_expenses[0]['pd_expense_id']);
- $this->PD_Model->updateRecords($temp_array,$table,$where_condition_array);
+ if($annual_emp_salary != 0)
+ {
+ $where_condition_array = array('pd_expense_id' => $business_expenses[0]['pd_expense_id']);
+ $this->PD_Model->updateRecords($temp_array,$table,$where_condition_array);
+ }
}
else
{
//echo "insert";
- $this->PD_Model->saveRecords($temp_array,PDBUSINESSEXPENSES);
+ if($annual_emp_salary != 0)
+ {
+ $this->PD_Model->saveRecords($temp_array,PDBUSINESSEXPENSES);
+ }
}
@@ -7804,13 +7810,19 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
if(count($business_expenses))
{
//echo "Update";
- $where_condition_array = array('pd_expense_id' => $business_expenses[0]['pd_expense_id']);
- $this->PD_Model->updateRecords($temp_array,$table,$where_condition_array);
+ if($over_all_rent_amt != 0)
+ {
+ $where_condition_array = array('pd_expense_id' => $business_expenses[0]['pd_expense_id']);
+ $this->PD_Model->updateRecords($temp_array,$table,$where_condition_array);
+ }
}
else
{
//echo "insert";
- $this->PD_Model->saveRecords($temp_array,PDBUSINESSEXPENSES);
+ if($over_all_rent_amt != 0)
+ {
+ $this->PD_Model->saveRecords($temp_array,PDBUSINESSEXPENSES);
+ }
}
diff --git a/api/application/helpers/assessedincome_helper.php b/api/application/helpers/assessedincome_helper.php
index 81078db4..e8c43838 100644
--- a/api/application/helpers/assessedincome_helper.php
+++ b/api/application/helpers/assessedincome_helper.php
@@ -21,7 +21,7 @@ class AssessedIncome
$net_profit_loss_row = '
| f. Net Profit / Loss(c-e) | ';
$house_hold_expense_row = '
| g. Household Expenses | ';
$disposable_income_row = '
| h. Disposable Income | ';
- $net_margin_row = '
| i. Net Margin % | ';
+ $net_margin_row = '
| i. Net Margin % | ';
$considered_sales_revenue_row = '
| a) Considered Sales / Revenue ( Average) | ';
$considered_net_profit_row = '
| b) Considered Net Profit ( Average) | ';
$considered_net_margint_row = '
| c) Considered Net Margin % ((b/a) * 100 ) | ';
@@ -136,7 +136,7 @@ class AssessedIncome
// echo $considered_net_profit_row;
// echo $considered_net_margint_row;
if($house_hold_expense_count != 0){ $house_hold_expense_row = '';$disposable_income_row = '';
- $net_margin_row = substr_replace($net_margin_row,'f.',strpos($net_margin_row, 'h.'));
+ $net_margin_row = substr_replace($net_margin_row,'g.',8,2);
}
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,'gross_profit_loss_per_row' => $gross_profit_loss_per_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);
diff --git a/api/application/helpers/neighbourreferencecheckform_helper.php b/api/application/helpers/neighbourreferencecheckform_helper.php
index dc89f4e3..c15b554c 100644
--- a/api/application/helpers/neighbourreferencecheckform_helper.php
+++ b/api/application/helpers/neighbourreferencecheckform_helper.php
@@ -19,12 +19,12 @@ public static function getNeighbourhoodDetails($company_name,$values,$pdMasterVa
$neighbourhood_do_know = $tag['neighbourhood_name']." did not know about the applicant or their business.";
}
- if($tag['how_long_do_know_in_year'])
+ if($tag['how_long_do_know_in_year'] || $tag['how_long_do_know_in_month'])
{
$neighbourhood_business_running_yr = $tag['neighbourhood_name']." confirmed that the business has been in operation for ";
$neighbourhood_business_running_yr .= ($tag['how_long_do_know_in_year'] == 1) ? $tag['how_long_do_know_in_year']." year" : (($tag['how_long_do_know_in_year'] > 1) ? $tag['how_long_do_know_in_year']." years" : "");
-
- $neighbourhood_business_running_yr .= ($tag['how_long_do_know_in_month'] == 1) ? ' and '.$tag['how_long_do_know_in_month']." month" : (($tag['how_long_do_know_in_month'] > 1) ? ' and '.$tag['how_long_do_know_in_month']." months" : "");
+ $tag['how_long_do_know_in_year'] && $tag['how_long_do_know_in_month'] ? $neighbourhood_business_running_yr .= 'and':'';
+ $neighbourhood_business_running_yr .= ($tag['how_long_do_know_in_month'] == 1) ? $tag['how_long_do_know_in_month']." month" : (($tag['how_long_do_know_in_month'] > 1) ? $tag['how_long_do_know_in_month']." months" : "");
$neighbourhood_business_running_yr .= '.';
}
else
@@ -70,6 +70,7 @@ public static function getNeighbourhoodDetails($company_name,$values,$pdMasterVa
return array('neighbourhood_name_only' => $neighbourhood_name_only,'neighbourhood_name' => $neighbourhood_name,'neighbourhood_do_know' => $neighbourhood_do_know,'neighbourhood_business_running_yr' => $neighbourhood_business_running_yr,'ownership' => $ownership);
}, $values);
+ //print_r($values);die();
return $values;
}
diff --git a/api/application/models/Dash_Board_Model.php b/api/application/models/Dash_Board_Model.php
index c5566905..30ecce71 100644
--- a/api/application/models/Dash_Board_Model.php
+++ b/api/application/models/Dash_Board_Model.php
@@ -235,8 +235,8 @@ class Dash_Board_Model extends SPARQ_Model {
public function pdTATreport($applicant_id = null,$from_date = null,$to_date = null,$city = null,$branch = null,$lender_short_name = null)
{
- $this->db->SELECT('*,TIMEDIFF(triggered,draft) as draft_to_triggered,TIMEDIFF(allocated,triggered) as triggered_to_allocated,TIMEDIFF(accepted,allocated) as allocated_to_accepted,TIMEDIFF(scheduled,accepted) as accepted_to_scheduled,TIMEDIFF(initiated,scheduled) as scheduled_to_initiated,TIMEDIFF(started,initiated) as initiated_to_started,TIMEDIFF(inprogress,started) as started_to_inprogress,TIMEDIFF(completed,inprogress) as inprogress_to_completed,TIMEDIFF(qc_complete,completed) as completed_to_qc_completed,
- IF(qc_complete is not null ,TIMEDIFF(qc_complete, triggered),IF(completed is not null,TIMEDIFF(completed, triggered),IF(inprogress is not null,TIMEDIFF(inprogress, triggered),IF(started is not null,TIMEDIFF(started, triggered),IF(initiated is not null,TIMEDIFF(initiated, triggered),IF(scheduled is not null,TIMEDIFF(scheduled, triggered),IF(allocated is not null,TIMEDIFF(allocated, triggered),TIMEDIFF(allocated, triggered)))))))) as total_tat');
+ $this->db->SELECT('created_on, pd_sno, applicant, application_id, sineedge_ref, lender, lender_contact, branch, city, state, pincode, is_outside_city_limit, pd_agency, product, sub_product, pd_type, cust_seg, loan_amount, pd_officer, remarks, current_status, draft, triggered, allocated, bounced, if(strcmp(current_status,"BOUNCED"),accepted,null) as accepted, if(strcmp(current_status,"BOUNCED"),scheduled,null) as scheduled, if(strcmp(current_status,"BOUNCED"),initiated,null) as initiated, if(strcmp(current_status,"BOUNCED"),started,null) as started, if(strcmp(current_status,"BOUNCED"),inprogress,null) as inprogress, if(strcmp(current_status,"BOUNCED"),completed,null) as completed, if(strcmp(current_status,"BOUNCED"),qc_complete,null) as qc_complete, TIMEDIFF(triggered,draft) as draft_to_triggered,TIMEDIFF(allocated,triggered) as triggered_to_allocated,TIMEDIFF(bounced,allocated) as allocated_to_bounced,if(strcmp(current_status,"BOUNCED"),TIMEDIFF(accepted,allocated),null) as allocated_to_accepted,if(strcmp(current_status,"BOUNCED"),TIMEDIFF(scheduled,accepted),null) as accepted_to_scheduled,if(strcmp(current_status,"BOUNCED"),TIMEDIFF(initiated,scheduled),null) as scheduled_to_initiated,if(strcmp(current_status,"BOUNCED"),TIMEDIFF(started,initiated),null) as initiated_to_started,if(strcmp(current_status,"BOUNCED"),TIMEDIFF(inprogress,started),null) as started_to_inprogress,if(strcmp(current_status,"BOUNCED"),TIMEDIFF(completed,inprogress),null) as inprogress_to_completed,if(strcmp(current_status,"BOUNCED"),TIMEDIFF(qc_complete,completed),null) as completed_to_qc_completed,
+ IF(strcmp(current_status,"BOUNCED"),IF(qc_complete is not null ,TIMEDIFF(qc_complete, triggered),IF(completed is not null,TIMEDIFF(completed, triggered),IF(inprogress is not null,TIMEDIFF(inprogress, triggered),IF(started is not null,TIMEDIFF(started, triggered),IF(initiated is not null,TIMEDIFF(initiated, triggered),IF(scheduled is not null,TIMEDIFF(scheduled, triggered),IF(allocated is not null,TIMEDIFF(allocated, triggered),TIMEDIFF(allocated, triggered)))))))),null) as total_tat');
$this->db->FROM(PDMIS);
//$this->db->LIMIT(1,0);
if($applicant_id != null)
diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php
index c8173016..9ff3b7c9 100644
--- a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php
+++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php
@@ -2419,6 +2419,10 @@ if($total_no_of_business > 0) {
As per person met, Applicant does not have any current account.';
+ }
if($business_banking_common_remarks != ""){ echo ''.$business_banking_common_remarks.'
'; }
@@ -3300,7 +3304,7 @@ if($total_no_of_business > 0) {
$order_dipaly_array = array('A','B','C','D','E','F','G','H','I','J');
$ai_summary_details = ($assessed_income_details[ ($business_count+1) ]['summary_details']);
$ai_summary_details_processed = ASSESSEDINCOME::getSummaryTable($ai_summary_details,$ai_core_details);
- //print_r($ai_summary_details_processed);//die();
+ //print_r($ai_summary_details_processed);die();
echo "Assessed Income - ".MYUTIL::findCompanyName($all_company_details,($business_count+1),1)."
";
if(isset($ai_core_details) && count($ai_summary_details_processed))
@@ -3450,7 +3454,7 @@ if($total_no_of_business > 0) {
// }
- $is_kuccha_records_available = null;
+ $GLOBALS['is_kuccha_records_available'] = null;
if(isset($ai_core_details) && count($ai_core_details['sales_calculated_by_itemwise']))
{
echo ''.$order_dipaly_array[0].') Sales Itemwise :
';
@@ -3463,7 +3467,7 @@ if($total_no_of_business > 0) {
foreach($ai_core_details_processed['sales_item_wise_to_diaplay'] as $sid)
{
//print_r($sid);
- if($sid['sales_type'] == 3){ $is_kuccha_records_available = true; }
+ if($sid['sales_type'] == 3){ $GLOBALS['is_kuccha_records_available'] = true; }
$rate_per_unit = ($sid['rate_per_unit'] != 0 && $sid['rate_per_unit'] != '' ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($sid['rate_per_unit']) : '-');
echo '
';
echo '| '.($sid['other_sales_item'] != '' ? $sid['other_sales_item'] :$sid['sale_item']).' | '.$sid['sales_qty'].' | '.$sid['uom'].' | '. $rate_per_unit .' | '.$sid['frequency'].' | '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($sid['annual_sale_value']).($sid['sales_type'] == 3 ? ' *' : '').' | ';
@@ -3478,7 +3482,7 @@ if($total_no_of_business > 0) {
array_shift($order_dipaly_array);
}
- if($is_kuccha_records_available)
+ if($GLOBALS['is_kuccha_records_available'])
{
echo '
* Assessed From Kuchha Records, Details Available in Annexure A';
}