From fb069743d245764622262bf6b3fcaeaf1d87d69b Mon Sep 17 00:00:00 2001
From: Velz2020 ';
- if(isset($ai_core_details) && count($ai_core_details['sales_items_by_monthwise']))
- {
- echo " '.$order_dipaly_array[0].') Kuchha Sales Book/Bills : '.$order_dipaly_array[0].') Kuchha Sales Book/Bills : '.$order_dipaly_array[0].') Sales Declared By Customer As per person met, the following Purchase details were shared: As per person met, Purchase details were not shared, income calculated by Net margin percentage. As per person met, the following Purchase details were shared: As per person met, Purchase details were not shared, income calculated by Net margin percentage. As per person met, the following Purchase details were shared: As per person met, Purchase details were not shared, income calculated by Net margin percentage. '.$order_dipaly_array[0].') Purchase Declared By CustomerGross Margin % Margin Amount Gross Profit ";
$sales_item_wise_header_row .= "Gross Margin % Gross Profit ";
}
+
foreach($ai_core_details['sales_calculated_by_itemwise'] as $itemwise)
{
- $temp['sale_item'] = $itemwise['sales_item'];
+ $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_name'] ? $itemwise['uom_name'] : '-';
- $temp['frequency'] = $itemwise['frequency_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'];
-
- if($ai_core_details['gross_profit_calculation_type'][0]['mode'] == 2)
+ $temp['sales_type'] = $itemwise['sales_type'];
+ if($itemwise['sales_type'] == 3)// || $itemwise['sales_type'] == 2)
{
- $temp['margin_per'] = $itemwise['margin_per'];
- $temp['margin_per_uom'] = $itemwise['margin_per_uom'];
- $temp['margin_final_value'] = $itemwise['margin_final_value'];
- }
-
- array_push($sales_item_wise_to_diaplay,$temp);
- }
- $sales_item_wise_header_row .= "";
-
- }
-
- 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)
+ //$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($sale_item['items'] as $item_key => $month_item)
+ foreach($itemwise['items'] as $item_key => $month_item)
{
$z['month_to_dispaly'] = $item_key;
$z['month_data'] = array();
@@ -261,39 +252,133 @@ class AssessedIncome
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);
+ array_push($temp['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();
+ $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']));
+ // 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);
- }
+ // }
+ // 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 .= "";
+
}
+ // 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);
+ // }
+
+ // }
+
+ // }
+
if(count($ai_core_details['business_expenses']))
{
@@ -320,11 +405,11 @@ class AssessedIncome
}
- //print_r($sales_month_wise_to_display);
- //die();
+ // 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,'sales_month_wise_to_display' => $sales_month_wise_to_display,'business_expenses_to_diaplay' => $business_expenses_to_diaplay,'household_expenses_to_diaplay' => $household_expenses_to_diaplay);
+ 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);
}
}
?>
\ No newline at end of file
diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php
index 270f6fa8..2c85fa0d 100644
--- a/api/application/models/PD_Model.php
+++ b/api/application/models/PD_Model.php
@@ -870,6 +870,15 @@ class PD_Model extends SPARQ_Model {
$this->db->WHERE('fk_pd_id',$pdid);
return $this->db->GET()->result_array();
}
+
+ public function getDocsToBeCollected($pdid)
+ {
+ $this->db->SELECT('pd_doc_to_be_collect_id, doc_name, isactive, fk_pd_id');
+ $this->db->FROM(PDDOCSTOBECOLLECTED);
+ $this->db->WHERE('isactive',1);
+ $this->db->WHERE('fk_pd_id',$pdid);
+ return $this->db->GET()->result_array();
+ }
public function getTemplateForPD($pdid,$client,$random_string)
{
diff --git a/api/application/views/report_templates/JSONTOREPORT.php b/api/application/views/report_templates/JSONTOREPORT.php
index 0aea4228..b86b8823 100644
--- a/api/application/views/report_templates/JSONTOREPORT.php
+++ b/api/application/views/report_templates/JSONTOREPORT.php
@@ -3165,28 +3165,28 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '
";
- echo '
';
- echo 'Item name : ' . $sale_month_wise['sales_item'].'
';
- if($sale_month_wise['sales_type'] == 1)
- {
- echo ''.$sale_month_wise['month_count'].' month sales value : '.$rupee_symbol.''.MYUTIL::customIndianNumberFormat($sale_month_wise['total_months_value']).' Annual Sales value:'.$rupee_symbol.'' .MYUTIL::customIndianNumberFormat(($sale_month_wise['total_months_value'] * (12 / $sale_month_wise['month_count']) )).'';
- }
- else
- {
- echo 'Annual Sales value:'. $rupee_symbol.' '.MYUTIL::customIndianNumberFormat(($sale_month_wise['total_months_value'] )).'';
- }
- }
- array_shift($order_dipaly_array);
- echo '
Detail Available on Annexure A';
- }
+ // if(isset($ai_core_details) && count($ai_core_details['sales_items_by_monthwise']))
+ // {
+ // echo "
";
+ // echo '
';
+ // echo 'Item name : ' . $sale_month_wise['sales_item'].'
';
+ // if($sale_month_wise['sales_type'] == 1)
+ // {
+ // echo ''.$sale_month_wise['month_count'].' month sales value : '.$rupee_symbol.''.MYUTIL::customIndianNumberFormat($sale_month_wise['total_months_value']).' Annual Sales value:'.$rupee_symbol.'' .MYUTIL::customIndianNumberFormat(($sale_month_wise['total_months_value'] * (12 / $sale_month_wise['month_count']) )).'';
+ // }
+ // else
+ // {
+ // echo 'Annual Sales value:'. $rupee_symbol.' '.MYUTIL::customIndianNumberFormat(($sale_month_wise['total_months_value'] )).'';
+ // }
+ // }
+ // array_shift($order_dipaly_array);
+ // echo '
Detail Available on Annexure A';
+ // }
// if(isset($ai_core_details) && count($ai_core_details['sales_items_by_monthwise']))
@@ -3285,13 +3285,13 @@ defined('BASEPATH') OR exit('No direct script access allowed');
foreach($ai_core_details_processed['sales_item_wise_to_diaplay'] as $sid)
{
-
-
+ //print_r($sid);
+ $rate_per_unit = ($sid['rate_per_unit'] != 0 && $sid['rate_per_unit'] != '' ? $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($sid['rate_per_unit']) : '-');
echo '';
- echo ' ';
}
@@ -3299,7 +3299,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '';
array_shift($order_dipaly_array);
}
-
+ echo ''.($sid['other_sales_item'] != '' ? $sid['other_sales_item'] :$sid['sale_item']).' '.$sid['sales_qty'].' '.$sid['uom'].' '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($sid['rate_per_unit']).' '.$sid['frequency'].' '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($sid['annual_sale_value']).' ';
+ echo ''.($sid['other_sales_item'] != '' ? $sid['other_sales_item'] :$sid['sale_item']).' '.$sid['sales_qty'].' '.$sid['uom'].' '. $rate_per_unit .' '.$sid['frequency'].' '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($sid['annual_sale_value']).($sid['sales_type'] == 3 ? ' *' : '').' ';
if(isset($sid['margin_per'])){echo ''.($sid['margin_per'] != 0 ? $sid['margin_per'] : '-').' '; }
// if(isset($sid['margin_per_uom'])){echo ''.($sid['margin_per_uom'] != 0? $sid['margin_per_uom'] : '-').' '; }
- if(isset($sid['margin_final_value'])){echo ''.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($sid['margin_final_value']).' '; }
+ if(isset($sid['margin_final_value'])){ echo ''.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($sid['margin_final_value']).' '; }
echo '
* Assessed From Kuchha Records, Details Available in Annexure A';
if(isset($ai_core_details) && count($ai_core_details['sales_declared_by_customer']))
@@ -3307,14 +3307,14 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '
';
+ if(isset($ai_core_details) && count($ai_core_details['purchase_declared_by_customer']))
+ {
+
+ echo '
and '.$rupee_symbol.' '.MYUTIL::customIndianNumberFormat($ai_core_details['sales_declared_by_customer'][0]['margin_value']).' ( '.MYUTIL::numtowords( $ai_core_details['sales_declared_by_customer'][0]['margin_value']).' )'.'( '.$ai_core_details['sales_declared_by_customer'][0]['margin_per'].'% sales declared ) as net margin amount.';
+ // }
+
+ echo $str;
+ echo '
Annexure A
'; - if(isset($ai_core_details) && count($ai_core_details['sales_items_by_monthwise'])) + if(isset($ai_core_details) && count($ai_core_details['sales_calculated_by_itemwise'])) { //echo "Kuchha Sales Book/Bills Details:
'; - //print_r($ai_core_details_processed['sales_month_wise_to_display']);die(); - foreach($ai_core_details_processed['sales_month_wise_to_display'] as $sale_month_wise) + //print_r($ai_core_details_processed['sales_item_wise_to_diaplay']);//die(); + foreach($ai_core_details_processed['sales_item_wise_to_diaplay'] as $sale_month_wise) { //echo '| '.$sale_month_wise['months'][$j]['month_to_dispaly'].' | |
|---|---|
| Date | Value |
| '.$month['date'] .' | '.$month['value'] .' |
| '.$month['frequency_name'] .' | '.$month['frequency_value'] .' |
| Total | '. MYUTIL::customIndianNumberFormat ( $month_sub_total ) .' |