diff --git a/api/application/docs/sample.pdf b/api/application/docs/sample.pdf index f5cf48e8..d3a9f539 100644 Binary files a/api/application/docs/sample.pdf and b/api/application/docs/sample.pdf differ diff --git a/api/application/helpers/assetsform_helper.php b/api/application/helpers/assetsform_helper.php index fc9aa048..7ba28ba1 100644 --- a/api/application/helpers/assetsform_helper.php +++ b/api/application/helpers/assetsform_helper.php @@ -112,139 +112,120 @@ public static function getOthersAssetsDetails($values){ return $mergeResult; } -// business asset details -public static function getBusinessAssetsDetails($values){ - $mergeResult=array(); - foreach($values as $fetchVal){ - // echo "helper"; - // print_r($fetchVal); - $storeValue=array(); - if($fetchVal['business_assets_mode'] != ""){ - $storeValue['business_assets_mode'] = $fetchVal['business_assets_mode']; - + // business asset details + public static function getBusinessAssetsDetails($business_assets){ + + + $header_row = 'Particulars'; + $first_row = 'Asset Type'; + $sec_row = 'Asset Description'; + $third_row = 'Ownership'; + $fourth_row = 'Owned by'; + $fifth_row = 'Market Value'; + $sixth_row = 'Monthly Rent'; + $seventh_row = 'Age of Asset'; + $eighth_row = 'Loan (Y/N)'; + $rupee_symbol = ""; + $rental_flag = 0; + $owned_flag = 0; + + foreach($business_assets as $bsk => $fetchVal){ - if($fetchVal['business_assets_mode']==4){ - switch(strtoupper($fetchVal['business_ownership_type'])) { - case 'RENTED': - $storeValue['business_assets_mode_master'] = $fetchVal['business_assets_mode_master']; - $storeValue['ownership'] = 'RENTED'; - $storeValue['business_approximate_market_value'] = 'NA'; - $storeValue['rent_amount'] = $fetchVal['business_monthly_rented_amt']; + $owners_list = null; - $storeValue['business_name_of_the_owner'] = ''; - $storeValue['about_business_assets'] = $fetchVal['business_details'][0]['equipment_manufacturing_description']; - //.' rented at Rs.'.$fetchVal['business_monthly_rented_amt']; - $storeValue['business_approximate_market_value'] = ''; - break; - case 'OWNED': - $storeValue['ownership'] = 'OWNED'; - $storeValue['rent_amount'] = 'NA'; - $storeValue['business_assets_mode_master'] = $fetchVal['business_assets_mode_master']; - $storeValue['business_name_of_the_owner'] = $fetchVal['business_name_of_the_owner'][0]['id']==0 ? $fetchVal['business_name_of_the_other_owner'] : $fetchVal['business_name_of_the_owner'][0]['name']; - - $storeValue['about_business_assets'] = $fetchVal['business_details'][0]['equipment_manufacturing_description']; - //.' purchased in '.$fetchVal['business_purchase_year']; - - - $storeValue['business_approximate_market_value'] = 'Rs.'.$fetchVal['business_approximate_market_value']; - break; - default: - $storeValue['business_name_of_the_owner'] = ''; - $storeValue['about_business_assets'] = ''; - $storeValue['business_approximate_market_value'] = ''; - } - } + + if(isset($fetchVal['business_name_of_the_owner']) && (is_array($fetchVal['business_name_of_the_owner'])) && count($fetchVal['business_name_of_the_owner'])) + { + foreach($fetchVal['business_name_of_the_owner'] as $owner) + { + $owners_list.= ($owner['id'] != 0 ? $owner['name'].', ' : $fetchVal['business_name_of_the_other_owner'].', '); + } + } + //print_r($owners_list); + $owners_list = substr_replace($owners_list, '', strrpos($owners_list, ','),1); + + $owners_list = $owners_list != "" || $owners_list != null ? $owners_list : 'NA'; + $ownership_type = 'NA'; + + if(!strcasecmp($fetchVal['business_ownership_type'],'owned')) + { + $ownership_type = strtoupper($fetchVal['business_ownership_type']); + $owned_flag++; + }else if(!strcasecmp($fetchVal['business_ownership_type'],'rented')) + { + $ownership_type = strtoupper($fetchVal['business_ownership_type']); + $rental_flag++; + } + + if($fetchVal['business_assets_mode']==4){ + + $header_row .= 'Asset '.($bsk+1).''; + $first_row .= ''.$fetchVal['business_assets_mode_master'].''; + $sec_row .= ''.($fetchVal['business_details'][0]['equipment_manufacturing_description']).''; + $third_row .= ''. $ownership_type .''; + $fourth_row .= ''.$owners_list.''; + $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.$fetchVal['business_approximate_market_value'] : 'NA').''; + $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $fetchVal['business_monthly_rented_amt'] : 'NA').''; + $seventh_row .= ''.($fetchVal['business_vintage'] != "" ? $fetchVal['business_vintage'] : 'NA').''; + $eighth_row .= ''.($fetchVal['business_emi'] != "" ? $fetchVal['business_emi'] : 'NA').''; + + } // this is for vehicle else if($fetchVal['business_assets_mode']==3){ - switch(strtoupper($fetchVal['business_ownership_type'])) { - case 'RENTED': - $storeValue['business_assets_mode_master'] = $fetchVal['business_assets_mode_master']; - $storeValue['ownership'] = 'RENTED'; - $storeValue['business_approximate_market_value'] = 'NA'; - $storeValue['rent_amount'] = $fetchVal['business_monthly_rented_amt']; - $storeValue['about_business_assets'] = $fetchVal['business_details'][0]['manufacturer_model_vehicle']; - //.' rented at Rs.'.$fetchVal['business_monthly_rented_amt']; - - break; - case 'OWNED': - //print_r($fetchVal['business_name_of_the_owner']);die(); - $storeValue['ownership'] = 'OWNED'; - $storeValue['rent_amount'] = 'NA'; - $storeValue['business_assets_mode_master'] = $fetchVal['business_assets_mode_master']; - $storeValue['business_name_of_the_owner'] = $fetchVal['business_name_of_the_owner'][0]['id']==0 ? $fetchVal['business_name_of_the_other_owner'] : $fetchVal['business_name_of_the_owner'][0]['name']; - $storeValue['about_business_assets'] = $fetchVal['business_details'][0]['manufacturer_model_vehicle']; - //.' purchased in '. $fetchVal['business_purchase_year']; - $storeValue['business_approximate_market_value'] = 'Rs.'.$fetchVal['business_approximate_market_value']; - break; - default: - $storeValue['business_name_of_the_owner'] = ''; - $storeValue['about_business_assets'] = ''; - $storeValue['business_approximate_market_value'] = ''; - } + $header_row .= 'Asset '.($bsk+1).''; + $first_row .= ''.$fetchVal['business_assets_mode_master'].''; + $sec_row .= ''.($fetchVal['business_details'][0]['manufacturer_model_vehicle']).''; + $third_row .= ''. $ownership_type .''; + $fourth_row .= ''.$owners_list.''; + $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.$fetchVal['business_approximate_market_value'] : 'NA').''; + $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $fetchVal['business_monthly_rented_amt'] : 'NA').''; + $seventh_row .= ''.($fetchVal['business_vintage'] != "" ? $fetchVal['business_vintage'] : 'NA').''; + $eighth_row .= ''.($fetchVal['business_emi'] != "" ? $fetchVal['business_emi'] : 'NA').''; } // this property else if($fetchVal['business_assets_mode']==2){ - switch(strtoupper($fetchVal['business_ownership_type'])) { - case 'RENTED': - $storeValue['business_assets_mode_master'] = $fetchVal['business_assets_mode_master']; - $storeValue['ownership'] = 'RENTED'; - $storeValue['business_approximate_market_value'] = 'NA'; - $storeValue['rent_amount'] = $fetchVal['business_monthly_rented_amt']; - $storeValue['about_business_assets'] = $fetchVal['business_details'][0]['property_type']==1 ? $fetchVal['business_details'][0]['other_property_type']:$fetchVal['business_details'][0]['property_type_master']; - //.' rented at Rs.'. $fetchVal['business_monthly_rented_amt'] : $fetchVal['business_details'][0]['property_type'].' rented at Rs.'. $fetchVal['business_monthly_rented_amt']; - - break; - case 'OWNED': - $storeValue['ownership'] = 'OWNED'; - $storeValue['rent_amount'] = 'NA'; - $storeValue['business_assets_mode_master'] = $fetchVal['business_assets_mode_master']; - $storeValue['business_name_of_the_owner'] = $fetchVal['business_name_of_the_owner'][0]['id']==0 ? $fetchVal['business_name_of_the_other_owner'] : $fetchVal['business_name_of_the_owner'][0]['name']; - - $storeValue['about_business_assets'] = $fetchVal['business_details'][0]['property_type']==1 ? $fetchVal['business_details'][0]['other_property_type']:$fetchVal['business_details'][0]['property_type_master']; - //.' purchased in '. $fetchVal['business_purchase_year'] : $fetchVal['business_details'][0]['property_type'].' purchased in '. $fetchVal['business_purchase_year']; - $storeValue['business_approximate_market_value'] = 'Rs.'.$fetchVal['business_approximate_market_value']; - break; - default: - $storeValue['business_name_of_the_owner'] = ''; - $storeValue['about_business_assets'] = ''; - $storeValue['business_approximate_market_value'] = ''; - } + // switch(strtoupper($fetchVal['business_ownership_type'])) { + + $header_row .= 'Asset '.($bsk+1).''; + $first_row .= ''.$fetchVal['business_assets_mode_master'].''; + $sec_row .= ''.($fetchVal['business_details'][0]['property_type']==1 ? $fetchVal['business_details'][0]['other_property_type']:$fetchVal['business_details'][0]['property_type_master']).''; + $third_row .= ''. $ownership_type .''; + $fourth_row .= ''.$owners_list.''; + $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.$fetchVal['business_approximate_market_value'] : 'NA').''; + $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $fetchVal['business_monthly_rented_amt'] : 'NA').''; + $seventh_row .= ''.($fetchVal['business_vintage'] != "" ? $fetchVal['business_vintage'] : 'NA').''; + $eighth_row .= ''.($fetchVal['business_emi'] != "" ? $fetchVal['business_emi'] : 'NA').''; } //this is for other else if($fetchVal['business_assets_mode']==1){ - switch(strtoupper($fetchVal['business_ownership_type'])) { - case 'RENTED': - $storeValue['business_assets_mode_master'] = $fetchVal['business_assets_mode_master']; - $storeValue['ownership'] = 'RENTED'; - $storeValue['business_approximate_market_value'] = 'NA'; - $storeValue['business_name_of_the_owner'] = ''; - $storeValue['rent_amount'] = $fetchVal['business_monthly_rented_amt']; - $storeValue['about_business_assets'] = $fetchVal['business_details'][0]['any_other_assets']; - //.' rented at Rs.'. $fetchVal['business_monthly_rented_amt']; - - break; - case 'OWNED': - - $storeValue['ownership'] = 'OWNED'; - $storeValue['business_assets_mode_master'] = $fetchVal['business_assets_mode_master']; - $storeValue['rent_amount'] = 'NA'; - $storeValue['business_name_of_the_owner'] = $fetchVal['business_name_of_the_owner'][0]['id']==0 ? $fetchVal['business_name_of_the_other_owner'] : $fetchVal['business_name_of_the_owner'][0]['name']; - $storeValue['about_business_assets'] = $fetchVal['business_details'][0]['any_other_assets']; - //.' purchased in '. $fetchVal['business_purchase_year'].' at Rs.'.$fetchVal['business_details'][0]['any_other_asset_value']; - $storeValue['business_approximate_market_value'] = 'Rs.'.$fetchVal['business_approximate_market_value']; - break; - default: - $storeValue['business_name_of_the_owner'] = ''; - $storeValue['about_business_assets'] = ''; - $storeValue['business_approximate_market_value'] = ''; - } + $header_row .= 'Asset '.($bsk+1).''; + $first_row .= ''.$fetchVal['business_assets_mode_master'].''; + $sec_row .= ''.$fetchVal['business_details'][0]['any_other_assets'].''; + $third_row .= ''. $ownership_type .''; + $fourth_row .= ''.$owners_list.''; + $fifth_row .= ''.($fetchVal['business_approximate_market_value'] != "" && $fetchVal['business_approximate_market_value'] != null ? $rupee_symbol.' '.$fetchVal['business_approximate_market_value'] : 'NA').''; + $sixth_row .= ''.(($fetchVal['business_monthly_rented_amt'] != "") ? $fetchVal['business_monthly_rented_amt'] : 'NA').''; + $seventh_row .= ''.($fetchVal['business_vintage'] != "" ? $fetchVal['business_vintage'] : 'NA').''; + $eighth_row .= ''.($fetchVal['business_emi'] != "" ? strtoupper($fetchVal['business_emi']) : 'NA').''; } - } - - array_push($mergeResult,$storeValue); - } - return $mergeResult; -} + } + + $header_row .= ''; + $first_row .= ''; + $sec_row .= ''; + $third_row .= ''; + $fourth_row .= ''; + $fourth_row = $owned_flag != 0 ? $fourth_row : ''; + $fifth_row .= ''; + $fifth_row = $owned_flag != 0 ? $fifth_row : ''; + $sixth_row .= ''; + $sixth_row = $owned_flag != 0 ? $sixth_row : ''; + $seventh_row .= ''; + $eighth_row .= ''; + $eighth_row = $owned_flag != 0 ? $eighth_row : ''; + + return array('header_row' => $header_row, 'first_row' => $first_row,'sec_row'=> $sec_row,'third_row' =>$third_row,'fourth_row'=>$fourth_row,'fifth_row'=>$fifth_row,'sixth_row'=>$sixth_row,'seventh_row'=>$seventh_row,'eighth_row'=>$eighth_row); + } } ?> \ No newline at end of file diff --git a/api/application/views/report_templates/JSONTOREPORT.php b/api/application/views/report_templates/JSONTOREPORT.php index 4e555759..f9bcf514 100644 --- a/api/application/views/report_templates/JSONTOREPORT.php +++ b/api/application/views/report_templates/JSONTOREPORT.php @@ -80,15 +80,17 @@ defined('BASEPATH') OR exit('No direct script access allowed'); /*font-family: Merriweather;*/ border-collapse: collapse; width: 100%; + page-break-inside: avoid; } .scorecard_table td, .scorecard_table th { border: 1px solid #000; padding: 8px; + page-break-inside: avoid; } -.scorecard_table tr:nth-child(even){background-color: #f2f2f2;} +.scorecard_table tr:nth-child(even){background-color: #f2f2f2;page-break-inside: avoid;} .scorecard_table tr:hover {background-color: #ddd;} @@ -98,6 +100,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); text-align: center; background-color: #0191ed; color: white; + page-break-inside: avoid; } .customth { width: 10%; } @@ -1336,7 +1339,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $baRow = $pd_processed_forms[22][$business_count]; $businessAssetRow = json_decode($baRow['processed_json'],true); - //print_r($businessAssetRow);echo "*************"; + //print_r($businessAssetRow);die(); $bindBusinessAsset["company_name"] ='Assets used for '; $bindBusinessAsset["company_name"] .=MYUTIL::findCompanyName($all_company_details,$businessAssetRow['company_id'],1); $bindBusinessAsset["company_name"] .=' Business :'; @@ -1346,11 +1349,11 @@ defined('BASEPATH') OR exit('No direct script access allowed'); array_push($businessAssetResult,$bindBusinessAsset); - // print_r($businessAssetResult);die(); + // print_r($businessAssetResult);die(); ?> 0){ ?>

@@ -1358,41 +1361,24 @@ defined('BASEPATH') OR exit('No direct script access allowed');

- - - - - - - - - + '; + echo '
S.NoAsset TypeAsset DescriptionOwnershipMonthly Rent
'; + - foreach($iterateAsset['details'] as $business_asset_key => $baRow){ - if(isset($baRow['business_assets_mode_master'])) - { - $rent_amount = isset($baRow['rent_amount']) ? $rupee_symbol." ".MYUTIL::customIndianNumberFormat((double)$baRow['rent_amount']): '0.00'; - ?> - - - - - - - - - - - - ?> - - -

Business asset is not available.

-