Loan Type'; $second_row = 'Loan Amount (Rs)'; // $third_row = 'Loan Amount (Rs)'; $fourth_row = 'Availed From'; $fifth_row = 'Borrower'; $sixth_row = 'Instalment Amount (Rs)'; $seventh_row = 'Instalment Frequency'; $eigth_row = 'Original Tenure (Months)'; $ninth_row = 'Elapsed Tenure (Months)'; $tenth_row = 'Balance Tenure (Months)'; foreach($values as $key => $tag) { $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'; } $loanTaken=$tag['loan_taken_by']; $first_row .= $tag['loan_type']==1 ? ''.$tag['others_loan_type'].'' : ''.$tag['loan_type_master'] .''; $second_row .= ''.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 .= $loanTaken['id']==0 ? ''.$tag['others_loan_taken'].'' : ''.$loanTaken['name'].''; $sixth_row .= ''.MYUTIL::customIndianNumberFormat($tag['emi']).''; $seventh_row .= $tag['frequency']==1 ? ''.$tag['other_frequency'].'' : ''.$tag['frequency_master'].''; $eigth_row .= ''.$tag['original_tenure'].''; $ninth_row .= ''.$tag['elapsed_tenure'].''; $tenth_row .= ''.($tag['original_tenure'] - $tag['elapsed_tenure']).''; } 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.'' ); //return $values; } // business financial details public static function getBusinessFinancialDetails($values){ $values = array_map(function($tag) { return array( 'financial_year' => $tag['financial_year'], 'financial_sales_revenue' => 'Rs.'.$tag['financial_annual_sale'], 'financial_net_profit_mode' => $tag['finanical_profit_or_loss']==1 ? 1 : 0, 'financial_net_profit' => $tag['finanical_profit_or_loss']==1 ? 'Rs.'.$tag['financial_net_profit'] : '', 'financial_net_loss' => $tag['finanical_profit_or_loss']!=1 ? 'Rs.'.$tag['financial_net_loss'] : '', 'financial_margin_of_profit' => $tag['finanical_profit_or_loss']==1 ? $tag['financial_margin_of_profit'] : '', 'financial_margin_of_loss' => $tag['finanical_profit_or_loss']!=1 ? $tag['financial_margin_of_loss'] : '', 'profit_variation' => $tag['financial_variation'], 'sale_variation' => $tag['financial_annualsales_variation'],'financial_profit_to_sale_variation' => $tag['financial_profit_to_sale_variation'] ); }, $values); return $values; } // get customer financial public static function getBusinessCustomerFinancialDetails($values) { $values = array_map(function($tag) { if($tag['estimate_profit_or_loss']==1){ return array( 'estimate_profit_or_loss' => $tag['estimate_profit_or_loss'], 'estimate_sales_average' => $tag['estimate_sales_average'], 'estimate_sales_from' => $tag['estimate_sales_from'], 'estimate_sales_to' => $tag['estimate_sales_to'], 'estimate_net_margin_availablity' => $tag['estimate_net_margin_availablity'], //'estimate_net_margin' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ?$tag['estimate_profit_margin'] : $tag['estimate_net_profit'], 'net_profit_loss_sales_per_from' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_profit_range_from']: $tag['estimate_net_profit_from'], 'net_profit_loss_sales_per_to' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_profit_range_to']: $tag['estimate_net_profit_to'], 'net_profit_loss_sales_final_per' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_profit_margin_percent']:$tag['estimate_profit_margin'], //$tag['estimate_net_profit_percent'], 'net_profit_loss_sales_final_rs' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_profit_margin']: $tag['estimate_profit_margin_percent'],//$tag['estimate_net_profit'], //'estimate_net_margin_from' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_profit_from']: '', //'estimate_net_margin_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_profit_to']:'', //'estimate_net_margin_range' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_profit_percent'] : $tag['estimate_profit_margin_percent'], //'estimate_net_margin_range_from' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '' : $tag['estimate_profit_range_from'], // 'estimate_net_margin_range_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '' : '( '.$tag['estimate_profit_range_from'].', '.$tag['estimate_profit_range_to'].')', ); } else if($tag['estimate_profit_or_loss']==2){ return array( 'estimate_profit_or_loss' => $tag['estimate_profit_or_loss'], 'estimate_sales_average' => 'Rs.'.$tag['estimate_sales_average'], 'estimate_sales_from' =>$tag['estimate_sales_from'], 'estimate_sales_to' => $tag['estimate_sales_to'], 'estimate_net_margin_availablity' => $tag['estimate_net_margin_availablity'], 'net_profit_loss_sales_per_from' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_loss_range_from']: $tag['estimate_net_profit_from'], 'net_profit_loss_sales_per_to' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_loss_range_to']: $tag['estimate_net_loss_to'], 'net_profit_loss_sales_final_per' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_loss_margin_percent']: $tag['estimate_loss_margin'],//$tag['estimate_net_loss_percent'], 'net_profit_loss_sales_final_rs' => strtoupper($tag['estimate_net_margin_availablity'])=='YES' ? $tag['estimate_loss_margin']: $tag['estimate_loss_margin_percent']//$tag['estimate_net_loss'], //'estimate_net_margin' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? 'Rs.'.$tag['estimate_net_loss'] : 'Rs.'.$tag['estimate_loss_margin'], //'estimate_net_margin_from_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '(Rs.'.$tag['estimate_net_loss_from'].', Rs.'.$tag['estimate_net_loss_to'].')' : '', //'estimate_net_margin_range' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? $tag['estimate_net_loss_percent'] : $tag['estimate_loss_margin_percent'], //'estimate_net_margin_range_from_to' => strtoupper($tag['estimate_net_margin_availablity'])=='NO' ? '' : '('.$tag['estimate_loss_range_from'].', '.$tag['estimate_loss_range_to'].')', ); } }, $values); return $values; } // get customer header public static function getBusinessCustomerHeader($values){ if(count($values)>0 && $values[0]['estimate_profit_or_loss']==1){ return array("Sales","Net Profit","Net Margin %"); } else if(count($values)>0 && $values[0]['estimate_profit_or_loss']==2){ return array("Sales","Net Loss","Net Margin %"); } else { return array(); } } public static function getAvailableFacilities($arr) { echo "@@@@@@@@@@@@@@"; print_r($arr); die(); $word_array = array('1' => 'Others', '2' => 'Bank Guarantee', '3' => 'Cash Credit Limit','4' => 'Factoring', '5' => 'Forfaiting', '6' => 'Letter of Credit'); if(is_array($array)) { //$array = array_map(function($arr){ },$array); } return $array; } } ?>