SMD PD FEED BACKS LIVE TOO

This commit is contained in:
Velz2020 2020-10-07 23:42:19 +05:30
parent e0128b7e30
commit 5be8f488f9
7 changed files with 663 additions and 609 deletions

View File

@ -132,7 +132,7 @@ else if(ENVIRONMENT == 'production')
defined('SATELLITE_IMAGE_LOCATION') OR define('SATELLITE_IMAGE_LOCATION','phantomsatellite_test');
defined('DETAILED_SCORE_CARD_IMAGE_LOCATION') OR define('DETAILED_SCORE_CARD_IMAGE_LOCATION','phantom_dsc_test');
defined('LENDER_BUCKET_NAME_PREFIX') OR define('LENDER_BUCKET_NAME_PREFIX','pdgenie-lender');
defined('PHANTOMJSSCRIPT_LOCATION') OR define('PHANTOMJSSCRIPT_LOCATION','phantomjs_test');
defined('PHANTOMJSSCRIPT_LOCATION') OR define('PHANTOMJSSCRIPT_LOCATION','phantomjs_prod');
defined('LOGTOBOT') OR define('LOGTOBOT',0);
defined('GOOGLE_STATIC_MAP_API_KEY') OR define('GOOGLE_STATIC_MAP_API_KEY','AIzaSyA3lYDYxwtn5vLSl45SOKbtK7G6cEyXGr0');
defined('FIREBASE_PUSH_NOTIFICATION_SERVER_API_KEY') OR define('FIREBASE_PUSH_NOTIFICATION_SERVER_API_KEY','AAAA0yTIWHY:APA91bGuBHAEn1NcX95Uudm847Ez2AIbqqmi5698trFPx0cIs0OTXWUNu7c5DKDJlbxPBILytBGC5cEHqEy08AQZGu_rpCE4hyvoHyCDkOjuwhA3DFNMQDpMU6XxDDJXCI1zjhHRuEQr');

View File

@ -1173,7 +1173,19 @@ class Common_Masters_Controller extends REST_Controller {
public function checkAppVersion_get()
{
$client = $this->get('client');
$version_data = $this->Common_Masters_Model-> getAppVersion($client);
$headersData = getallheaders();
$td = jwt::decode($headersData['Token']);
$version_data = array();
//print_r($d);die();
$td = (array)($td);
if($td['aud'] == '5dvpr90r2na4te5k0qrint0m5i' || $td['aud'] == '5kv697clegac0bcmd49o9di2t2' && ($td['custom:role_id'] == 21 || $td['custom:role_id'] == 22))
{
$version_data = array("version_info_id" => "1","version" => "0.0.4","release_notes" => "Filed Visit");
}
else
{
$version_data = $this->Common_Masters_Model-> getAppVersion($client);
}
if($version_data)
{

View File

@ -6762,6 +6762,11 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
// print_r($company_list);die();
if(count($company_list))
{
if($pd_master_details[0]['fk_pd_type'] == 2)
{
$vendor_form_status = $this->PD_Model->getVendorFormStatus($pd_id);
$company_list[0]['vendor_form_status'] = $vendor_form_status;
}
$data['dataStatus'] = true;
$data['status'] = REST_Controller::HTTP_OK;
$data['records'] = $company_list;

View File

@ -93,23 +93,23 @@ class pdcompletenesscheck
}
//check that all pd genie forms get fetched with vendor answers
// if($vendor_done_status == 0)
// {
// $smart_pd_forms = array('18' => 'General Information','5' => 'Address Details','13' => 'Business Information' ,'19' => 'Neighbourhood / Reference','20' => 'Final Remarks Form','24' => 'Credit Manager Queries','22' => 'Business Assets','12' => 'Employment Information','11' => 'Stock Details');
// $unfetched_forms = '';
// $vendor_form_status = $CI->PD_Model->getVendorFormStatus($pdid);
// //print_r($vendor_form_status);die();
// foreach ($vendor_form_status as $key => $value)
// {
// if(!$value['form_status']){ $unfetched_forms .= $smart_pd_forms [ $value['fk_form_id'] ].', ' ; }
// }
// if($unfetched_forms)
// {
// $unfetched_forms = substr_replace($unfetched_forms,'', -2) ;
// $incomplete_details[] = 'The following vendor section answers not fetched with PG Genie Form - '.$unfetched_forms;
// };
// //echo $unfetched_forms;
// }
if($vendor_done_status == 1)
{
$smart_pd_forms = array('18' => 'General Information','5' => 'Address Details','13' => 'Business Information' ,'19' => 'Neighbourhood / Reference','20' => 'Final Remarks Form','24' => 'Credit Manager Queries','22' => 'Business Assets','12' => 'Employment Information','11' => 'Stock Details');
$unfetched_forms = '';
$vendor_form_status = $CI->PD_Model->getVendorFormStatus($pdid);
//print_r($vendor_form_status);die();
foreach ($vendor_form_status as $key => $value)
{
if(!$value['form_status']){ $unfetched_forms .= $smart_pd_forms [ $value['fk_form_id'] ].', ' ; }
}
if($unfetched_forms)
{
$unfetched_forms = substr_replace($unfetched_forms,'', -2) ;
$incomplete_details[] = 'The following vendor section answers not fetched with PG Genie Form - '.$unfetched_forms;
}
//echo $unfetched_forms;
}
//die();
@ -312,14 +312,16 @@ class pdcompletenesscheck
}
#####End of Finance Form Questions########
// $business_assest_form = (json_decode($form_data[22][0]['json'],true));
// $businees_assest_images_count = isset($pd_images[22]) ? count($pd_images[22]) : 0;
// print_r($business_assest_form);//die();
#####Business Assets Form Questions########
$business_assest_form = (json_decode($form_data[22][0]['json'],true));
$businees_assest_images_count = isset($pd_images[22]) ? count($pd_images[22]) : 0;
if( $client != 'WEB')// if API came from web then ignore this check
{
$business_assest_form = (json_decode($form_data[22][0]['json'],true));
$businees_assest_images_count = isset($pd_images[22]) ? count($pd_images[22]) : 0;
//print_r($business_assest_form);die();
if(array_key_exists('business_assets_details',$business_assest_form))
{
@ -333,6 +335,34 @@ class pdcompletenesscheck
}
}
}
if( $client == 'WEB')// if API came from web then ignore this check
{
if(array_key_exists('business_assets_for_address',$business_assest_form))
{
if(count($business_assest_form['business_assets_for_address']))
{
$overall_not_filled_questions = '';
if($business_assest_form['business_assets_for_address'][0]['business_years'])
{
$overall_not_filled_questions .= 'Business Operating Duration';
}
if(!$business_assest_form['business_assets_for_address'][0]['business_ownership_type'])
{
$overall_not_filled_questions .= ' Onwership Type';
}
if($overall_not_filled_questions)
{
$incomplete_details[] = 'Business Assets Section - '.$overall_not_filled_questions;
}
}
else
{
$incomplete_details[] = 'Business Assets Section - Business Operating Duration and ownership type';
}
}
}
#####End of Business Assets Form Questions########
$business_bank_form = isset($form_data[21][0]['json'])?(json_decode($form_data[21][0]['json'],true)):array();

File diff suppressed because it is too large Load Diff

View File

@ -100,7 +100,7 @@ class PD_Model extends SPARQ_Model {
{
$this->db->WHERE('PDTRIGGER.pd_agency_id',$pdagencyid);
//$this->db->WHERE('PDTRIGGER.vendor_status',TRIGGERED);
$this->db->WHERE("if(vendor_status = 'TRIGGERED', if( pd_status in ('SCHEDULED','ALLOCATED','INPROGRESS','COMPLETED'),1,0),0)=0");
$this->db->WHERE("if(vendor_status = 'TRIGGERED', if( pd_status in ('ALLOCATED'),1,0),0)=0");
}
if($status != "" || $status != null)
{
@ -270,7 +270,7 @@ class PD_Model extends SPARQ_Model {
if($pd_agency_id != "" || $pd_agency_id != null )
{
$this->db->LIKE('PDTRIGGER.pd_agency_id',$pd_agency_id);
$this->db->WHERE("if(vendor_status = 'TRIGGERED', if( pd_status in ('SCHEDULED','ALLOCATED','INPROGRESS','COMPLETED'),1,0),0)=0");
$this->db->WHERE("if(vendor_status = 'TRIGGERED', if( pd_status in ('ALLOCATED'),1,0),0)=0");
}
if($pd_officer_id != "" || $pd_officer_id != null )
{
@ -744,7 +744,7 @@ class PD_Model extends SPARQ_Model {
break;
case 'pincode':
//echo "pincode";
//echo "pincode_ide";
if($log['old_pincode'] != null || $log['old_pincode'] != "")
{
if(is_numeric($log['new_pincode']) && is_numeric($log['old_pincode']))

View File

@ -2078,7 +2078,7 @@ font-weight: bolder;;
if(isset($vendor_employer_info['docs_sighted']))
{
//print_r($vendor_employer_info['docs_sighted']['sal_reg_seen'] == 'yes' ? 'Salary Register': '');die();
echo '<p><b>Documents Sighted of applicant employment During Field:</b></p>';
echo '<h2>Documents Sighted of applicant employment During Field:</h2>';
$document_name = '';
$document_name .= ($vendor_employer_info['docs_sighted']['sal_reg_seen'] == 'yes' ? 'Salary Register, ': '');
$document_name .= ($vendor_employer_info['docs_sighted']['attendance_seen'] == 'yes' ? 'Attendance Register, ' : '');