417 lines
21 KiB
PHP
417 lines
21 KiB
PHP
<?php
|
|
|
|
class AssessedIncome
|
|
{
|
|
|
|
public static function getSummaryTable($ai_summary_details,$ai_core_details){
|
|
//echo "getSummaryTable";
|
|
//print_r($ai_summary_details);
|
|
|
|
$rupee_symbol = "<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>";
|
|
$ai_table_header_row = '<tr> <th>Summary</th>';
|
|
$sale_revenue_row = '<tr> <td>a. Sales / Revenue </td>';
|
|
$purchase_row = '<tr> <td>b. Purchases </td>';
|
|
if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2)
|
|
{
|
|
$purchase_row = '<tr> <td>b. Cost of goods sold </td>';
|
|
}
|
|
$gross_profit_loss_row = '<tr> <td>c. Gross Profit / Loss(a-b)</td>';
|
|
$gross_profit_loss_per_row = '<tr> <td>d. Gross Profit / Loss %</td>';
|
|
$business_expense_row = '<tr> <td>e. Business Expenses </td>';
|
|
$net_profit_loss_row = '<tr> <td>f. Net Profit / Loss(c-e) </td>';
|
|
$house_hold_expense_row = '<tr> <td>g. Household Expenses </td>';
|
|
$disposable_income_row = '<tr> <td>h. Disposable Income</td>';
|
|
$net_margin_row = '<tr><td>i. Net Margin % </td>';
|
|
$considered_sales_revenue_row = '<tr> <td>a) Considered Sales / Revenue ( Average) </td>';
|
|
$considered_net_profit_row = '<tr> <td>b) Considered Net Profit ( Average)</td>';
|
|
$considered_net_margint_row = '<tr> <td>c) Considered Net Margin % ((b/a) * 100 )</td>';
|
|
$house_hold_expense_count = 0;
|
|
|
|
if(isset($ai_summary_details['sales_declared_by_customer']) && count($ai_summary_details['sales_declared_by_customer']))
|
|
{
|
|
$house_hold_expense_count = $ai_summary_details['sales_declared_by_customer']['house_hold_expenses'] != 0 ? $house_hold_expense_count : ++$house_hold_expense_count;
|
|
|
|
$ai_table_header_row .= '<th>Declared by Customer</th>';
|
|
|
|
$sale_revenue_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_declared_by_customer']['sales_revenue']).'</td>';
|
|
if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 1)
|
|
{
|
|
$purchase_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_declared_by_customer']['purchases']).'</td>';
|
|
}else if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2)
|
|
{
|
|
$purchase_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_declared_by_customer']['cost_of_goods_sold']).'</td>';
|
|
}
|
|
|
|
|
|
$gross_profit_loss_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_declared_by_customer']['grossprofit']).'</td>';
|
|
$gross_profit_loss_per_row.= '<td class="customtd">'.(round((($ai_summary_details['sales_declared_by_customer']['grossprofit'] / $ai_summary_details['sales_declared_by_customer']['sales_revenue']) * 100),2)).' %</td>';
|
|
$business_expense_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_declared_by_customer']['business_expenses']).'</td>';
|
|
$net_profit_loss_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_declared_by_customer']['netprofit']).'</td>';
|
|
$house_hold_expense_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_declared_by_customer']['house_hold_expenses']).'</td>';
|
|
$disposable_income_row .= '<td class="customtd">'.$rupee_symbol.'' .MYUTIL::customIndianNumberFormat($ai_summary_details['sales_declared_by_customer']['disposable_income']).'</td>';
|
|
$net_margin_row .= '<td class="customtd">'.($ai_summary_details['sales_declared_by_customer']['netmargin']).'%</td>';
|
|
|
|
}
|
|
|
|
if(isset($ai_summary_details['sales_calculated_by_itemwise']) && count($ai_summary_details['sales_calculated_by_itemwise']))
|
|
{
|
|
|
|
$house_hold_expense_count = $ai_summary_details['sales_calculated_by_itemwise']['house_hold_expenses'] != 0 ? $house_hold_expense_count : ++$house_hold_expense_count;
|
|
|
|
$ai_table_header_row .= '<th>As Derived from Item Wise Sales</th>';
|
|
|
|
$sale_revenue_row .= '<td class="customtd">'.$rupee_symbol.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_itemwise']['sales_revenue']).'</td>';
|
|
if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 1)
|
|
{
|
|
$purchase_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_itemwise']['purchases']).'</td>';
|
|
}else if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2)
|
|
{
|
|
$purchase_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_itemwise']['cost_of_goods_sold']).'</td>';
|
|
}
|
|
$gross_profit_loss_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_itemwise']['grossprofit']).'</td>';
|
|
$gross_profit_loss_per_row.= '<td class="customtd">'.(round((($ai_summary_details['sales_calculated_by_itemwise']['grossprofit'] / $ai_summary_details['sales_calculated_by_itemwise']['sales_revenue']) * 100),2)).' %</td>';
|
|
$business_expense_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_itemwise']['business_expenses']).'</td>';
|
|
$net_profit_loss_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_itemwise']['netprofit']).'</td>';
|
|
$house_hold_expense_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_itemwise']['house_hold_expenses']).'</td>';
|
|
$disposable_income_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_itemwise']['disposable_income']).'</td>';
|
|
$net_margin_row .= '<td class="customtd">'.($ai_summary_details['sales_calculated_by_itemwise']['netmargin']).'%</td>';
|
|
}
|
|
|
|
if(isset($ai_summary_details['sales_calculated_by_monthwise']) && count($ai_summary_details['sales_calculated_by_monthwise']))
|
|
{
|
|
|
|
$house_hold_expense_count = $ai_summary_details['sales_calculated_by_monthwise']['house_hold_expenses'] != 0 ? $house_hold_expense_count : ++$house_hold_expense_count;
|
|
|
|
$ai_table_header_row .= '<th>As Derived from Kuchha Sales Book/Bills</th>';
|
|
|
|
$sale_revenue_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_monthwise']['sales_revenue']).'</td>';
|
|
if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 1)
|
|
{
|
|
$purchase_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_monthwise']['purchases']).'</td>';
|
|
}
|
|
else if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2)
|
|
{
|
|
$purchase_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_monthwise']['cost_of_goods_sold']).'</td>';
|
|
}
|
|
$gross_profit_loss_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_monthwise']['grossprofit']).'</td>';
|
|
$gross_profit_loss_per_row.= '<td class="customtd">'.(round((($ai_summary_details['sales_calculated_by_monthwise']['grossprofit'] / $ai_summary_details['sales_calculated_by_monthwise']['sales_revenue']) * 100),2)).' %</td>';
|
|
$business_expense_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_monthwise']['business_expenses']).'</td>';
|
|
$net_profit_loss_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_monthwise']['netprofit']).'</td>';
|
|
$house_hold_expense_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_monthwise']['house_hold_expenses']).'</td>';
|
|
$disposable_income_row .= '<td class="customtd">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['sales_calculated_by_monthwise']['disposable_income']).'</td>';
|
|
$net_margin_row .= '<td class="customtd">'.($ai_summary_details['sales_calculated_by_monthwise']['netmargin']).'%</td>';
|
|
}
|
|
|
|
if(isset($ai_summary_details['consolidated_report']) && count($ai_summary_details['consolidated_report']))
|
|
{
|
|
$considered_sales_revenue_row .= '<td class="customtd" colsapn="3">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['consolidated_report']['consolidated_sales_revenue']).'</td>';
|
|
$considered_net_profit_row .= '<td class="customtd" colsapn="3">'.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_summary_details['consolidated_report']['consolidated_nerprofit']).'</td>';
|
|
$considered_net_margint_row .= '<td class="customtd" colsapn="3">'.$ai_summary_details['consolidated_report']['consolidated_nermagin'].'%</td>';
|
|
|
|
}
|
|
$ai_table_header_row .= '</tr>';
|
|
$sale_revenue_row .= '</tr>';
|
|
$purchase_row .= '</tr>';
|
|
$gross_profit_loss_row .= '</tr>';
|
|
$gross_profit_loss_per_row .= '</tr>';
|
|
$business_expense_row .= '</tr>';
|
|
$net_profit_loss_row .= '</tr>';
|
|
$house_hold_expense_row .= '</tr>';
|
|
$disposable_income_row .= '</tr>';
|
|
$net_margin_row .= '</tr>';
|
|
$considered_sales_revenue_row .= '</tr>';
|
|
$considered_net_profit_row .= '</tr>';
|
|
$considered_net_margint_row .= '</tr>';
|
|
|
|
// echo $ai_table_header_row;
|
|
// echo $sale_revenue_row;
|
|
// echo $purchase_row;
|
|
// echo $gross_profit_loss_row;
|
|
// echo $business_expense_row;
|
|
// echo $net_profit_loss_row;
|
|
// echo $house_hold_expense_row;
|
|
// echo $disposable_income_row;
|
|
// echo $net_margin_row;
|
|
// echo $considered_sales_revenue_row;
|
|
// echo $considered_net_profit_row;
|
|
// echo $considered_net_margint_row;
|
|
if($house_hold_expense_count != 0){ $house_hold_expense_row = '';$disposable_income_row = '';
|
|
$net_margin_row = substr_replace($net_margin_row,'g.',8,2);
|
|
}
|
|
return array('ai_table_header_row' => $ai_table_header_row,'sale_revenue_row' => $sale_revenue_row,'purchase_row' => $purchase_row,'gross_profit_loss_row' => $gross_profit_loss_row,'business_expense_row' => $business_expense_row,'gross_profit_loss_per_row' => $gross_profit_loss_per_row,'net_profit_loss_row' => $net_profit_loss_row,'house_hold_expense_row' => $house_hold_expense_row,'disposable_income_row'=>$disposable_income_row,'net_margin_row' => $net_margin_row,'considered_sales_revenue_row' => $considered_sales_revenue_row,'considered_net_profit_row' => $considered_net_profit_row,'considered_net_margint_row' =>$considered_net_margint_row);
|
|
|
|
|
|
|
|
}
|
|
|
|
public static function getCoreDetails($ai_core_details){
|
|
|
|
$purchase_to_display = array();
|
|
$sales_item_wise_to_diaplay = array();
|
|
$business_expenses_to_diaplay = array();
|
|
$household_expenses_to_diaplay = array();
|
|
$sales_month_wise_to_display = array();
|
|
$sales_item_wise_header_row = '';
|
|
// Get Purchase Informations
|
|
if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 1)
|
|
{
|
|
if($ai_core_details['gross_profit_calculation_type'][0]['purchase_type'] == 1)
|
|
{
|
|
foreach($ai_core_details['purchase_details'] as $pk => $purchase)
|
|
{
|
|
$temp['material_name'] = strcasecmp($purchase['purchase_item'],'others') ? $purchase['purchase_item'] : $purchase['other_purchase_item'];
|
|
|
|
$temp['qty'] = $purchase['purchase_qty'] != 0 ? $purchase['purchase_qty'] : '-';
|
|
$temp['uom'] = $purchase['uom_name'] != "" ? $purchase['uom_name'] : '-';
|
|
$temp['rate'] = $purchase['rate_per_unit'];
|
|
$temp['frequency'] = $purchase['frequency_name'] ? $purchase['frequency_name'] : '-';
|
|
$temp['annual_value'] = $purchase['annual_purchase_value'];
|
|
array_push($purchase_to_display,$temp);
|
|
|
|
}
|
|
}
|
|
else if($ai_core_details['gross_profit_calculation_type'][0]['purchase_type'] == 2)
|
|
{
|
|
|
|
foreach($ai_core_details['purchase_billwise'] as $pbk => $purchase)
|
|
{
|
|
$temp['month_count'] = count($purchase['items']);
|
|
$temp['annual_purchase_value'] = $purchase['annual_purchase_value'];
|
|
$temp['item_name'] = strcasecmp($purchase['purchase_item'],'others') ? $purchase['purchase_item'] : $purchase['other_purchase_item'];
|
|
$temp['months'] = array();
|
|
foreach($purchase['items'] as $item_key => $month_item)
|
|
{
|
|
foreach($month_item as $key => $data)
|
|
{
|
|
$t['month_to_dispaly'] = $key;
|
|
$t['month_data'] = array();
|
|
foreach($data as $singe_data)
|
|
{
|
|
array_push($t['month_data'],array('date' => date_format(date_create($singe_data['purchase_date']),'d-m-Y'),'value' => $singe_data['purchase_value']));
|
|
}
|
|
array_push($temp['months'],$t);
|
|
}
|
|
|
|
}
|
|
|
|
array_push($purchase_to_display,$temp);
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
//return $purchase_to_display;
|
|
}
|
|
|
|
|
|
//print_r($ai_core_details['sales_calculated_by_itemwise']);die();
|
|
// Get Sales Itemwise
|
|
if(count($ai_core_details['sales_calculated_by_itemwise']))
|
|
{
|
|
$sales_item_wise_to_diaplay = array();
|
|
$sales_item_wise_header_row = "<tr> <th>Product/Services</th> <th>Sale Qty</th> <th>UOM</th> <th>Rate/Unit or Value of Sale</th> <th>Frequency</th> <th>Annual Sales</th>";
|
|
if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2)
|
|
{
|
|
//$sales_item_wise_header_row .= "<th>Gross Margin %</th><th>Margin Amount</th><th>Gross Profit</th>";
|
|
$sales_item_wise_header_row .= "<th>Gross Margin %</th><th>Gross Profit</th>";
|
|
}
|
|
|
|
//print_r($ai_core_details['sales_calculated_by_itemwise']);die();
|
|
foreach($ai_core_details['sales_calculated_by_itemwise'] as $itemwise)
|
|
{
|
|
$temp['sale_item'] = strcasecmp($itemwise['sales_item'],'others') ? $itemwise['sales_item'] : $itemwise['other_sales_item'];
|
|
$temp['sales_qty'] = $itemwise['sales_qty'] != 0 ? $itemwise['sales_qty']: '-';
|
|
$temp['uom'] = $itemwise['uom_other'] ? $itemwise['uom_other'] : ($itemwise['uom_name'] ? $itemwise['uom_name'] : '-');
|
|
$temp['frequency'] = $itemwise['frequency_name'] ? $itemwise['frequency_name'] : '-';
|
|
$temp['annual_sale_value'] = $itemwise['annual_sale_value'];
|
|
$temp['rate_per_unit'] = $itemwise['rate_per_unit'];
|
|
$temp['other_sales_item'] = $itemwise['other_sales_item'];
|
|
$temp['sales_type'] = $itemwise['sales_type'];
|
|
if($itemwise['sales_type'] == 3)// || $itemwise['sales_type'] == 2)
|
|
{
|
|
//$temp['month_items'] = $itemwise['items'];
|
|
|
|
$temp['month_count'] = count($itemwise['items']);
|
|
if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2)
|
|
{
|
|
$temp['margin_value'] =$itemwise['margin_value'];
|
|
$temp['margin_per'] =$itemwise['margin_per'];
|
|
}
|
|
|
|
$temp['sales_type'] = $itemwise['sales_type'];
|
|
$temp['months'] = array();
|
|
// if($itemwise['sales_type'] == 3)
|
|
// {
|
|
$total_month_value = 0;
|
|
foreach($itemwise['items'] as $item_key => $month_item)
|
|
{
|
|
$z['month_to_dispaly'] = $item_key;
|
|
$z['month_data'] = array();
|
|
|
|
foreach($month_item as $item)
|
|
{
|
|
$total_month_value += $item['sales_value'];
|
|
array_push($z['month_data'],array('date' => date_format(date_create($item['sales_date']),'d-m-Y'),'value' => $item['sales_value']));
|
|
|
|
}
|
|
array_push($temp['months'],$z);
|
|
}
|
|
$temp['total_months_value'] = $total_month_value;
|
|
//array_push($temp,$x);
|
|
//}
|
|
//else
|
|
// {
|
|
// //print_r($sale_item);
|
|
// //echo "AAAAA";die();
|
|
// $total_month_value = 0;
|
|
// $multiple_factor = 0;
|
|
// foreach($sale_item['items'] as $item_key => $month_item)
|
|
// {
|
|
// $t['month_to_dispaly'] = $item_key;
|
|
// $t['month_data'] = array();
|
|
|
|
// foreach($month_item as $item)
|
|
// {
|
|
// $total_month_value += $item['sales_value'];
|
|
// $multiple_factor = $item['mutiple_factor'];
|
|
// array_push($t['month_data'],array('frequency_value' => $item['frequency_value'],'value' => $item['sales_value'],'frequency_name' => $item['frequency_name'],'multiple_factor'=> $item['mutiple_factor']));
|
|
|
|
// }
|
|
// array_push($x['months'],$t);
|
|
// }
|
|
// $x['total_months_value'] = $total_month_value;
|
|
// $x['annual_sale_value'] = ($total_month_value * $multiple_factor);
|
|
// array_push($temp,$x);
|
|
// }
|
|
|
|
|
|
}
|
|
else if($itemwise['sales_type'] == 2)
|
|
{
|
|
|
|
//print_r($itemwise);die();
|
|
//$temp['month_count'] = count($itemwise['items']);
|
|
// $temp['margin_value'] = $itemwise['margin_value'];
|
|
// $temp['margin_per'] = $itemwise['margin_per'];
|
|
//$temp['sales_item'] = strcasecmp($itemwise['sales_item'],'others') ? $sale_item['sales_item'] : $sale_item['other_sales_item'];
|
|
$temp['sales_type'] = $itemwise['sales_type'];
|
|
$temp['months'] = array();
|
|
$z['month_data'] = array();
|
|
|
|
|
|
$total_month_value = $itemwise['annual_sale_value'];
|
|
array_push($z['month_data'],array('frequency_name' => $itemwise['frequency_name'],'frequency_value' => $itemwise['rate_per_unit']));
|
|
|
|
|
|
array_push($temp['months'],$z);
|
|
|
|
$temp['total_months_value'] = $total_month_value;
|
|
//array_push($temp,$x);
|
|
}
|
|
|
|
if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2)
|
|
{
|
|
$temp['margin_per'] = $itemwise['margin_per'] ? $itemwise['margin_per'] : '-';
|
|
$temp['margin_per_uom'] = $itemwise['margin_per_uom'] ? $itemwise['margin_per_uom'] : '-';
|
|
$temp['margin_final_value'] = $itemwise['margin_final_value'] ? $itemwise['margin_final_value'] : '-';
|
|
}
|
|
|
|
array_push($sales_item_wise_to_diaplay,$temp);
|
|
}
|
|
$sales_item_wise_header_row .= "</tr>";
|
|
|
|
}
|
|
|
|
// if(count($ai_core_details['sales_items_by_monthwise']))
|
|
// {
|
|
|
|
|
|
// foreach($ai_core_details['sales_items_by_monthwise'] as $simwk => $sale_item)
|
|
// {
|
|
// $x['month_count'] = count($sale_item['items']);
|
|
// $x['margin_value'] =$sale_item['margin_value'];
|
|
// $x['margin_per'] =$sale_item['margin_per'];
|
|
// $x['sales_item'] = strcasecmp($sale_item['sales_item'],'others') ? $sale_item['sales_item'] : $sale_item['other_sales_item'];
|
|
// $x['sales_type'] = $sale_item['sales_type'];
|
|
// $x['months'] = array();
|
|
// if($sale_item['sales_type'] == 1)
|
|
// {
|
|
// $total_month_value = 0;
|
|
// foreach($sale_item['items'] as $item_key => $month_item)
|
|
// {
|
|
// $z['month_to_dispaly'] = $item_key;
|
|
// $z['month_data'] = array();
|
|
|
|
// foreach($month_item as $item)
|
|
// {
|
|
// $total_month_value += $item['sales_value'];
|
|
// array_push($z['month_data'],array('date' => date_format(date_create($item['sales_date']),'d-m-Y'),'value' => $item['sales_value']));
|
|
|
|
// }
|
|
// array_push($x['months'],$z);
|
|
// }
|
|
// $x['total_months_value'] = $total_month_value;
|
|
// array_push($sales_month_wise_to_display,$x);
|
|
// }else
|
|
// {
|
|
// //print_r($sale_item);
|
|
|
|
// $total_month_value = 0;
|
|
// $multiple_factor = 0;
|
|
// foreach($sale_item['items'] as $item_key => $month_item)
|
|
// {
|
|
// $t['month_to_dispaly'] = $item_key;
|
|
// $t['month_data'] = array();
|
|
|
|
// foreach($month_item as $item)
|
|
// {
|
|
// $total_month_value += $item['sales_value'];
|
|
// $multiple_factor = $item['mutiple_factor'];
|
|
// array_push($t['month_data'],array('frequency_value' => $item['frequency_value'],'value' => $item['sales_value'],'frequency_name' => $item['frequency_name'],'multiple_factor'=> $item['mutiple_factor']));
|
|
|
|
// }
|
|
// array_push($x['months'],$t);
|
|
// }
|
|
// $x['total_months_value'] = $total_month_value;
|
|
// $x['annual_sale_value'] = ($total_month_value * $multiple_factor);
|
|
// array_push($sales_month_wise_to_display,$x);
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
//print_r($ai_core_details['business_expenses']);die();
|
|
if(count($ai_core_details['business_expenses']))
|
|
{
|
|
foreach($ai_core_details['business_expenses'] as $business_expense)
|
|
{
|
|
$bs_temp['expense_item'] = !strcasecmp($business_expense['expense_item'],'others') ? $business_expense['other_expense_item'] : $business_expense['expense_item'];
|
|
$bs_temp['frequency_name'] = $business_expense['frequency_name'];
|
|
$bs_temp['expense_value'] = $business_expense['expense_value'];
|
|
$bs_temp['annual_expenses_value'] = $business_expense['annual_expenses_value'];
|
|
array_push($business_expenses_to_diaplay,$bs_temp);
|
|
}
|
|
}
|
|
|
|
if(count($ai_core_details['house_hold_expenses']))
|
|
{
|
|
foreach($ai_core_details['house_hold_expenses'] as $house_hold_expense)
|
|
{
|
|
$hhs_temp['expense_item'] = $house_hold_expense['expense_item'];
|
|
$hhs_temp['frequency_name'] = $house_hold_expense['frequency_name'];
|
|
$hhs_temp['expense_value'] = $house_hold_expense['expense_value'];
|
|
$hhs_temp['annual_expense_value'] = $house_hold_expense['annual_expense_value'];
|
|
array_push($household_expenses_to_diaplay,$hhs_temp);
|
|
}
|
|
}
|
|
|
|
|
|
// print_r($sales_month_wise_to_display);
|
|
// die();
|
|
|
|
|
|
return array('purchase_to_display' => $purchase_to_display,'sales_item_wise_to_diaplay' => $sales_item_wise_to_diaplay,'sales_calculated_by_itemwise_header' => $sales_item_wise_header_row,'business_expenses_to_diaplay' => $business_expenses_to_diaplay,'household_expenses_to_diaplay' => $household_expenses_to_diaplay);
|
|
}
|
|
}
|
|
?>
|