diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php
index 44c2350d..f045be66 100644
--- a/api/application/controllers/Sales_PD_Controller.php
+++ b/api/application/controllers/Sales_PD_Controller.php
@@ -443,8 +443,8 @@ class Sales_PD_Controller extends REST_Controller {
$this->Sales_PD_Model->updateRecords($update_fields,SALES_PD_DATA,array('sales_pd_id' => $records['fk_sales_pd_id']));
//disable previous selfie img
- $update_fields = array('isactive' => 0);
- $this->Sales_PD_Model->updateRecords($update_fields,SALEPD_DOCS,array('img_name' => 'selfie_with_person_met' ));
+ $update_fields2 = array('isactive' => 0);
+ $this->Sales_PD_Model->updateRecords($update_fields2,SALEPD_DOCS,array('img_name' => 'selfie_with_person_met'));
}
$id = $this->Sales_PD_Model->saveRecords($records,SALEPD_DOCS);
@@ -740,8 +740,8 @@ class Sales_PD_Controller extends REST_Controller {
$question['is_repeatable'] = "";
$question['group_title'] = null;
- $question['answer_value'] = $value['img'];
- //$question['answer_value'] = "IMG";
+ $question['answer_value'] = $exist_data_value['img'];
+ $question['answer_value'] = "IMG";
$question['question'] = $photo_names [ $exist_data_value['img_name'] ];
$question['question_key'] = $exist_data_value['img_name'];
$question['type'] = 6;
@@ -815,16 +815,16 @@ class Sales_PD_Controller extends REST_Controller {
$question['api_properties'] = null;
$question['answers'] = null;
$question['onchange_properties'] = null;
- if($value['img_name'] == 'selfie_with_person_met')
+ if($photo_key == 'selfie_with_person_met')
{
$questions[] = [];
}
else
{
- $questions[ $photo_names [ $value['img_name'] ] ] ['is_repeatable'] = 1;
- $questions[ $photo_names [ $value['img_name'] ] ] ['group_title'] = $photo_value;
- $questions[ $photo_names [ $value['img_name'] ] ] ['group_type'] = 6;
- $questions[ $photo_names [ $value['img_name'] ] ] ['questions_group'][0]['questions'][] = [];
+ $questions[ $photo_key ] ['is_repeatable'] = 1;
+ $questions[ $photo_key ] ['group_title'] = $photo_value;
+ $questions[ $photo_key ] ['group_type'] = 6;
+ $questions[ $photo_key ] ['questions_group'][0]['questions'][] = [];
}
}
}
diff --git a/api/application/helpers/financialform_helper.php b/api/application/helpers/financialform_helper.php
index 787b5733..f0764c88 100644
--- a/api/application/helpers/financialform_helper.php
+++ b/api/application/helpers/financialform_helper.php
@@ -3,98 +3,122 @@
class Financialform
{
//other loan obligations
-public static function getOtherLoanDetails($values,$pdid){
+public static function getOtherLoanDetails($data,$pdid){
+ $total_tables = count($data) / 5;
+
+ $total_tables = ceil($total_tables);
+ //print_r(array_values($values));
+ // die();
+ $overall_data = array();
+ $values = array_values($data);
+
$latest_applicants_names = APPLICANTNAME_GRABBER::getLatestApplicantsName($pdid);
- $rupee_symbol = '₹';
- $first_row = '
| Loan Type | ';
- $second_row = '
| Loan Amount | ';
- // $third_row = '
| Loan Amount (Rs) | ';
- $fourth_row = '
| Availed From | ';
- $fifth_row = '
| Borrower | ';
- $sixth_row = '
| Instalment Amount | ';
- $seventh_row = '
| Instalment Frequency | ';
- $eigth_row = '
| Original Tenure (Months) | ';
- $ninth_row = '
| Elapsed Tenure (Months) | ';
- $tenth_row = '
| Balance Tenure (Months) | ';
- $total_header = 0;
- foreach($values as $key => $tag)
- {
- if(isset($tag['loan_type_master']) && $tag['loan_type_master'] != '')
- {
- $total_header++;
- $setFrequencyType='';
- switch($tag['frequency']) {
- case 1:
- $setFrequencyType = ' per '.$tag['other_frequency'];
- break;
- case 2:
- $setFrequencyType = ' per annum';
- break;
- case 3:
- $setFrequencyType = ' per halfyearly';
- break;
- case 4:
- $setFrequencyType = ' per fortnightly';
- break;
- case 5:
- $setFrequencyType = ' per daily';
- break;
- case 6:
- $setFrequencyType = ' per quarterly';
- break;
- case 7:
- $setFrequencyType = ' per month';
- break;
- default:
- $setFrequencyType = ' per';
-
- }
-
- $name_of_borrower = '';
- foreach ($tag['loan_taken_by'] as $l_key => $l_value) {
- if($l_value['id'] == 0)
- {
- $name_of_borrower .= $tag['others_loan_taken'].' ,';
- }
- else
- {
- $name_of_borrower .= $l_value['group_id'] == 1 ? $l_value['name'] . ' , ': APPLICANTNAME_GRABBER::getApplicantsNameById($l_value['id'],$latest_applicants_names).' ,';
- }
- }
- $name_of_borrower = substr_replace($name_of_borrower, '', -1);
- // if(strrpos($name_of_borrower,',')) { $name_of_borrower = substr_replace($name_of_borrower,' and ',strrpos($name_of_borrower,','),1); }
- $name_of_borrower = str_replace(',','and', $name_of_borrower);
-
-
-
-
- $first_row .= $tag['loan_type']==1 ? ''.$tag['others_loan_type'].' | ' : ''.$tag['loan_type_master'] .' | ';
-
- $second_row .= ''.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($tag['loan_amount']).' | ';
-
- //$third_row = ''.MYUTIL::customIndianNumberFormat($tag['loan_amount']).' | ';
-
- $fourth_row .= $tag['lender']==1 ? ''.$tag['others_lender'].' | ' : ''.$tag['lender_master'].' | ';
-
- $fifth_row .= ''.$name_of_borrower.' | ';
-
- $sixth_row .= ''.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($tag['emi']).' | ';
-
- $seventh_row .= $tag['frequency']==1 ? ''.$tag['other_frequency'].' | ' : ''.$tag['frequency_master'].' | ';
-
- $eigth_row .= $tag['original_tenure'] ? ''.$tag['original_tenure'].' | ' : ' Not Provided | ';
-
- $ninth_row .= $tag['elapsed_tenure'] ? ''.$tag['elapsed_tenure'].' | ' : ' Not Provided | ';
- $bal = is_numeric($tag['original_tenure']) && is_numeric($tag['elapsed_tenure']) ? ($tag['original_tenure'] - $tag['elapsed_tenure']) : 'Not Provided';
- $tenth_row .= ''.$bal.' | ';
- }
- }
- return array(
- 'first_row' => $first_row.'
','second_row' => $second_row.'','fourth_row' => $fourth_row.'','fifth_row' => $fifth_row.'','sixth_row' => $sixth_row.'','seventh_row' => $seventh_row.'','eigth_row' => $eigth_row.'', 'ninth_row' => $ninth_row.'', 'tenth_row' => $tenth_row.'','total_header' => $total_header
- );
-
- //return $values;
+
+ for($i = 1;$i<= $total_tables;$i++)
+ {
+ $rupee_symbol = '₹';
+ $first_row = '| Loan Type | ';
+ $second_row = '
| Loan Amount | ';
+ // $third_row = '
| Loan Amount (Rs) | ';
+ $fourth_row = '
| Availed From | ';
+ $fifth_row = '
| Borrower | ';
+ $sixth_row = '
| Instalment Amount | ';
+ $seventh_row = '
| Instalment Frequency | ';
+ $eigth_row = '
| Original Tenure (Months) | ';
+ $ninth_row = '
| Elapsed Tenure (Months) | ';
+ $tenth_row = '
| Balance Tenure (Months) | ';
+ $total_header = 0;
+ foreach($values as $key => $tag)
+ {
+ if(isset($tag['loan_type_master']) && $tag['loan_type_master'] != '')
+ {
+ $total_header++;
+ $setFrequencyType='';
+ switch($tag['frequency']) {
+ case 1:
+ $setFrequencyType = ' per '.$tag['other_frequency'];
+ break;
+ case 2:
+ $setFrequencyType = ' per annum';
+ break;
+ case 3:
+ $setFrequencyType = ' per halfyearly';
+ break;
+ case 4:
+ $setFrequencyType = ' per fortnightly';
+ break;
+ case 5:
+ $setFrequencyType = ' per daily';
+ break;
+ case 6:
+ $setFrequencyType = ' per quarterly';
+ break;
+ case 7:
+ $setFrequencyType = ' per month';
+ break;
+ default:
+ $setFrequencyType = ' per';
+
+ }
+
+ $name_of_borrower = '';
+ foreach ($tag['loan_taken_by'] as $l_key => $l_value) {
+ if($l_value['id'] == 0)
+ {
+ $name_of_borrower .= $tag['others_loan_taken'].' ,';
+ }
+ else
+ {
+ $name_of_borrower .= $l_value['group_id'] == 1 ? $l_value['name'] . ' , ': APPLICANTNAME_GRABBER::getApplicantsNameById($l_value['id'],$latest_applicants_names).' ,';
+ }
+ }
+ $name_of_borrower = substr_replace($name_of_borrower, '', -1);
+ // if(strrpos($name_of_borrower,',')) { $name_of_borrower = substr_replace($name_of_borrower,' and ',strrpos($name_of_borrower,','),1); }
+ $name_of_borrower = str_replace(',','and', $name_of_borrower);
+
+
+
+
+ $first_row .= $tag['loan_type']==1 ? ''.$tag['others_loan_type'].' | ' : ''.$tag['loan_type_master'] .' | ';
+
+ $second_row .= ''.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($tag['loan_amount']).' | ';
+
+ //$third_row = ''.MYUTIL::customIndianNumberFormat($tag['loan_amount']).' | ';
+
+ $fourth_row .= $tag['lender']==1 ? ''.$tag['others_lender'].' | ' : ''.$tag['lender_master'].' | ';
+
+ $fifth_row .= ''.$name_of_borrower.' | ';
+
+ $sixth_row .= ''.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($tag['emi']).' | ';
+
+ $seventh_row .= $tag['frequency']==1 ? ''.$tag['other_frequency'].' | ' : ''.$tag['frequency_master'].' | ';
+
+ $eigth_row .= $tag['original_tenure'] ? ''.$tag['original_tenure'].' | ' : ' Not Provided | ';
+
+ $ninth_row .= $tag['elapsed_tenure'] ? ''.$tag['elapsed_tenure'].' | ' : ' Not Provided | ';
+ $bal = is_numeric($tag['original_tenure']) && is_numeric($tag['elapsed_tenure']) ? ($tag['original_tenure'] - $tag['elapsed_tenure']) : 'Not Provided';
+ $tenth_row .= ''.$bal.' | ';
+
+
+ unset($values[$key]);
+ // echo count($values).' - keyy is - '.$key.'*';
+ if( $total_header == 5)
+ {
+ break;
+ }
+
+ }
+
+ }
+
+
+ $overall_data[$i] = array(
+ 'first_row' => $first_row.'
','second_row' => $second_row.'','fourth_row' => $fourth_row.'','fifth_row' => $fifth_row.'','sixth_row' => $sixth_row.'','seventh_row' => $seventh_row.'','eigth_row' => $eigth_row.'', 'ninth_row' => $ninth_row.'', 'tenth_row' => $tenth_row.'','total_header' => $total_header);
+ // echo 'TABLE VALIUES - '.count($values);
+ }
+ //print_r($overall_data);die();
+ return $overall_data;
}
// business financial details
diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php
index f02804c6..0451b38f 100644
--- a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php
+++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php
@@ -4048,32 +4048,40 @@ if($total_no_of_business > 0) {
The table below lists the details of Existing Loan Obligations of the Loan Applicants.
-
-
+
+ $single_table){
+ //print_r($single_table);die();
+ ?>
+
+
| Particulars |
- Loan $header";}?>
+ Loan $pre_loan_no"; } ?>
-
+
+
As per loan applicant he does not have any existing loan obligations.
diff --git a/api/application/views/sale_pd_templates/MWISE.php b/api/application/views/sale_pd_templates/MWISE.php
index 297e330c..342cb16e 100644
--- a/api/application/views/sale_pd_templates/MWISE.php
+++ b/api/application/views/sale_pd_templates/MWISE.php
@@ -118,7 +118,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
- | Main Applicat Name |
+ Name of Main Loan Applicant |
|