END USE LOAN API
This commit is contained in:
parent
b81561e85b
commit
1708c92211
@ -352,7 +352,7 @@ class PD_Controller extends REST_Controller {
|
|||||||
//* SENP/SEP - (DI)
|
//* SENP/SEP - (DI)
|
||||||
$pd_details['fk_pd_template_id'] = 3;
|
$pd_details['fk_pd_template_id'] = 3;
|
||||||
}
|
}
|
||||||
else if($res_array[0]['fk_customer_segment'] == 8)
|
else if($pd_details['fk_customer_segment'] == 8)
|
||||||
{
|
{
|
||||||
//* SENP/SEP - (RI)
|
//* SENP/SEP - (RI)
|
||||||
$pd_details['fk_pd_template_id'] = 4;
|
$pd_details['fk_pd_template_id'] = 4;
|
||||||
@ -2316,6 +2316,11 @@ class PD_Controller extends REST_Controller {
|
|||||||
$records = $this->saveCoApplicantsFromGeneralInfoForm($records);
|
$records = $this->saveCoApplicantsFromGeneralInfoForm($records);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($formid == 10)
|
||||||
|
{
|
||||||
|
$this->updateSubProductFromLoanDetailsForm($records);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$fields = array('isactive' => 0);
|
$fields = array('isactive' => 0);
|
||||||
$where_condition_array = array('fk_form_id'=>$formid,'fk_pd_id'=>$pdid);
|
$where_condition_array = array('fk_form_id'=>$formid,'fk_pd_id'=>$pdid);
|
||||||
@ -3331,8 +3336,8 @@ class PD_Controller extends REST_Controller {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$temp_grossprofit = $temp_netprofit - $overall_business_expenses_total;
|
$temp_grossprofit = $temp_netprofit + $overall_business_expenses_total;
|
||||||
$temp_purchases = $temp_grossprofit - $total_sales_itemwise;
|
$temp_purchases = $total_sales_itemwise - $temp_grossprofit;
|
||||||
$temp_netmargin = ($temp_netprofit/$total_sales_itemwise) * 100;
|
$temp_netmargin = ($temp_netprofit/$total_sales_itemwise) * 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3390,8 +3395,8 @@ class PD_Controller extends REST_Controller {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$temp_grossprofit = $temp_netprofit - $overall_business_expenses_total;
|
$temp_grossprofit = $temp_netprofit + $overall_business_expenses_total;
|
||||||
$temp_purchases = $temp_grossprofit - $total_sales_monthwise;
|
$temp_purchases = $total_sales_monthwise - $temp_grossprofit;
|
||||||
$temp_netmargin = ($temp_netprofit/$total_sales_monthwise) * 100;
|
$temp_netmargin = ($temp_netprofit/$total_sales_monthwise) * 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3427,8 +3432,8 @@ class PD_Controller extends REST_Controller {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$temp_grossprofit = $temp_netprofit - $overall_business_expenses_total;
|
$temp_grossprofit = $temp_netprofit + $overall_business_expenses_total;
|
||||||
$temp_purchases = $temp_grossprofit - $total_sales_declared_by_customer;
|
$temp_purchases = $total_sales_declared_by_customer - $temp_grossprofit;
|
||||||
$temp_netmargin = ($temp_netprofit/$total_sales_declared_by_customer) * 100;
|
$temp_netmargin = ($temp_netprofit/$total_sales_declared_by_customer) * 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4274,17 +4279,19 @@ class PD_Controller extends REST_Controller {
|
|||||||
|
|
||||||
public function codeigniterViewTest_post()
|
public function codeigniterViewTest_post()
|
||||||
{
|
{
|
||||||
|
echo "fisrt";
|
||||||
|
$ch = curl_init();
|
||||||
|
$timeout = 5;
|
||||||
|
$url = 'http://enterprise.smsgupshup.com/GatewayAPI/rest?method=SendMessage&send_to=919791811189&msg=WelcometoMSGAPI&msg_type=TEXT&userid=2000185290&auth_scheme=plain&password=wRfAwb&v=1.1&format=text';
|
||||||
|
|
||||||
// $t = $this->load->view('report_templates/SALCASH',$data = array(),true);
|
curl_setopt($ch,CURLOPT_URL,$url);
|
||||||
// //echo $t;die();
|
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
|
||||||
// //PDF Gen using DOM PDF
|
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
|
||||||
// $pdf_doc = $this->pdfgenerator->generate($t, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait");
|
$tinyurl = curl_exec($ch);
|
||||||
// //End of PDF Gen using DOM PDF
|
curl_close($ch);
|
||||||
// $output_file2 = APPPATH."/docs/sample.pdf";
|
echo $tinyurl;
|
||||||
// $ti = file_put_contents($output_file2, $pdf_doc);
|
echo 'done';
|
||||||
// echo $ti;
|
die();
|
||||||
|
|
||||||
// die();
|
|
||||||
$records = $this->post('records');
|
$records = $this->post('records');
|
||||||
$pdid = $records['pd_id'];
|
$pdid = $records['pd_id'];
|
||||||
$fk_createdby = $records['fk_createdby'];
|
$fk_createdby = $records['fk_createdby'];
|
||||||
@ -4619,43 +4626,68 @@ class PD_Controller extends REST_Controller {
|
|||||||
{
|
{
|
||||||
$records = $this->post('records');
|
$records = $this->post('records');
|
||||||
$pdid = $records['pd_id'];
|
$pdid = $records['pd_id'];
|
||||||
|
$sub_product_id = null;
|
||||||
|
if(isset($records['sub_product_id'])){ $sub_product_id = $records['sub_product_id']; }
|
||||||
|
|
||||||
$pd_master_details = $this->PD_Model->getPDMasterDetails($pdid);
|
if($sub_product_id != null)
|
||||||
|
|
||||||
if($pd_master_details[0]['fk_subproduct_id'] != "" || $pd_master_details[0]['fk_subproduct_id'] != null)
|
|
||||||
{
|
{
|
||||||
|
$fields = array('*');
|
||||||
$fields = array('*');
|
$where_condition_array = array('isactive' => 1,'fk_subproduct_id' => $sub_product_id);
|
||||||
$where_condition_array = array('isactive' => 1,'fk_subproduct_id' => $pd_master_details[0]['fk_subproduct_id']);
|
$result_data = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,ENDUSEOFLOAN);
|
||||||
$result_data = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,ENDUSEOFLOAN);
|
if(count($result_data))
|
||||||
if(count($result_data))
|
{
|
||||||
{
|
$data['dataStatus'] = true;
|
||||||
$data['dataStatus'] = true;
|
$data['status'] = REST_Controller::HTTP_OK;
|
||||||
$data['status'] = REST_Controller::HTTP_OK;
|
$data['records'] = $result_data;
|
||||||
$data['records'] = $result_data;
|
$this->response($data,REST_Controller::HTTP_OK);
|
||||||
$this->response($data,REST_Controller::HTTP_OK);
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
$data['dataStatus'] = false;
|
||||||
$data['dataStatus'] = false;
|
$data['status'] = REST_Controller::HTTP_NO_CONTENT;
|
||||||
$data['status'] = REST_Controller::HTTP_NO_CONTENT;
|
$data['msg'] = 'No Data Found for Selected Sub Product!';
|
||||||
$data['msg'] = 'No Data Found for End Use Of Loan!';
|
$this->response($data,REST_Controller::HTTP_OK);
|
||||||
$this->response($data,REST_Controller::HTTP_OK);
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$pd_master_details = $this->PD_Model->getPDMasterDetails($pdid);
|
||||||
|
|
||||||
$fields = array('*');
|
if($pd_master_details[0]['fk_subproduct_id'] != "" || $pd_master_details[0]['fk_subproduct_id'] != null)
|
||||||
$where_condition_array = array('isactive' => 1,'fk_subproduct_id' => null);
|
{
|
||||||
$result_data = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,ENDUSEOFLOAN);
|
|
||||||
|
|
||||||
$data['dataStatus'] = false;
|
$fields = array('*');
|
||||||
$data['status'] = REST_Controller::HTTP_NO_CONTENT;
|
$where_condition_array = array('isactive' => 1,'fk_subproduct_id' => $pd_master_details[0]['fk_subproduct_id']);
|
||||||
$data['records'] = $result_data;
|
$result_data = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,ENDUSEOFLOAN);
|
||||||
$data['msg'] = 'Sub Product Not Applicable for this PD!';
|
if(count($result_data))
|
||||||
$this->response($data,REST_Controller::HTTP_OK);
|
{
|
||||||
|
$data['dataStatus'] = true;
|
||||||
|
$data['status'] = REST_Controller::HTTP_OK;
|
||||||
|
$data['records'] = $result_data;
|
||||||
|
$this->response($data,REST_Controller::HTTP_OK);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$data['dataStatus'] = false;
|
||||||
|
$data['status'] = REST_Controller::HTTP_NO_CONTENT;
|
||||||
|
$data['msg'] = 'No Data Found for Selected Sub Product!';
|
||||||
|
$this->response($data,REST_Controller::HTTP_OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
$fields = array('*');
|
||||||
|
$where_condition_array = array('isactive' => 1,'fk_subproduct_id' => null);
|
||||||
|
$result_data = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,ENDUSEOFLOAN);
|
||||||
|
|
||||||
|
$data['dataStatus'] = false;
|
||||||
|
$data['status'] = REST_Controller::HTTP_NO_CONTENT;
|
||||||
|
$data['records'] = $result_data;
|
||||||
|
$data['msg'] = 'Sub Product Not Applicable for this PD!';
|
||||||
|
$this->response($data,REST_Controller::HTTP_OK);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -5613,5 +5645,22 @@ class PD_Controller extends REST_Controller {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updateSubProductFromLoanDetailsForm($records)
|
||||||
|
{
|
||||||
|
$pd_master_details = $this->PD_Model->getPDMasterDetails($records['pdid']);
|
||||||
|
|
||||||
|
$new_sub_product = $records['sub_product'];
|
||||||
|
$old_sub_product = $pd_master_details[0]['fk_subproduct_id'];
|
||||||
|
|
||||||
|
if($new_sub_product != $old_sub_product)
|
||||||
|
{
|
||||||
|
$where_condition_array = array('pd_id' => $records['pdid']);
|
||||||
|
$temp = array('fk_subproduct_id' => $new_sub_product,'fk_updatedby' => $records['fk_createdby']);
|
||||||
|
$pk_id = $this->PD_Model->updateRecords($temp,PDTRIGGER,$where_condition_array);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user