From d2ba78ecb5cdb7f09a70b1ac9729b609ab604cce Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Thu, 9 Jun 2022 19:29:25 +0530 Subject: [PATCH] flyhi : ps --- api/application/controllers/Flyhi_Controller.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/api/application/controllers/Flyhi_Controller.php b/api/application/controllers/Flyhi_Controller.php index 6ae7ffde..a79f6ad7 100644 --- a/api/application/controllers/Flyhi_Controller.php +++ b/api/application/controllers/Flyhi_Controller.php @@ -156,16 +156,18 @@ class Flyhi_Controller extends REST_Controller { } $count = $this->Flyhi_Model->selectCustomRecords(array('count(*) as count'),array('lender_id' => $lender_id,'isactive' => 1),SALES_PD_DATA); $lender_short_name = $this->Flyhi_Model->selectCustomRecords(array('short_name'),array('entity_id' => $lender_id),ENTITY); - $salepd_serial_no = 'FHFSL-'.(++$count[0]['count']); - + $flyhipd_serial_no = $lender_short_name.'-'.(++$count[0]['count']); + $FLYHI_PD['applicant_name'] = $applicant_name; $FLYHI_PD['applicant_id'] = $applicant_id; $FLYHI_PD['city_id']=$city; - $FLYHI_PD['sales_pd_sno'] = $salepd_serial_no; + $FLYHI_PD['sales_pd_sno'] = $flyhipd_serial_no; $FLYHI_PD['loan_amount'] = $loan_amount; $FLYHI_PD['lender_sales_person'] = $lender_sales_person ; $FLYHI_PD['lender_credit_person'] = $lender_credit_person ; $FLYHI_PD['pd_branch_id'] = $pd_branch_id; $FLYHI_PD['lender_id'] = $lender_id; + $FLYHI_PD['createdby'] = $fk_createdby; + $FLYHI_PD['rand_string'] = $randomString; $flyhi_pd_id = $this->Flyhi_Model->saveRecords($FLYHI_PD,SALES_PD_DATA); $section_data = json_encode($records); $this->Sales_PD_Model->updateRecords(array('isactive' => 0),SALESPD_SECTION_DATA,array('sales_pd_id' =>$flyhi_pd_id,'section_id' => 1 )); @@ -237,7 +239,7 @@ class Flyhi_Controller extends REST_Controller { $FLYHI_PD['lender_credit_person'] = $lender_credit_person ; $FLYHI_PD['pd_branch_id'] = $pd_branch_id; $FLYHI_PD['lender_id'] = $lender_id; - $flyhi_pd_id = $this->Flyhi_Model->updateRecords($FLYHI_PD,SALES_PD_DATA,array('sales_pd_id' => $records['sales_pd_id'])); + $flyhi_pd_id = $this->Flyhi_Model->updateRecords($FLYHI_PD,SALES_PD_DATA,array('sales_pd_id' => $flyhi_pd_id)); $status = $records['is_complete']; $fields = array('sales_pd_id' => $flyhi_pd_id, 'section_id' => 1, 'status' =>$status ,'section_data' => $section_data,'createdby' => $fk_createdby); $is_entry_done = $this->Sales_PD_Model->saveRecords($fields,SALESPD_SECTION_DATA); @@ -262,7 +264,7 @@ class Flyhi_Controller extends REST_Controller { public function getFlyhiPD_get() { - $Flyhi_pdid = $this->get('sales_pd_id'); + $Flyhi_pdid = $this->get('pd_id'); $section_data = array(); if(isset($Flyhi_pdid) || $Flyhi_pdid != "" || $Flyhi_pdid != null) {