SALES PD CLIX PROD ISSUES

This commit is contained in:
Velz2020 2019-11-23 18:07:39 +05:30
parent fd160998c6
commit 628aa60b5e
5 changed files with 119 additions and 32 deletions

View File

@ -9083,14 +9083,30 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
}
public function deactiveFormData_get()
public function deactiveFormData_post()
{
//$records = $this->post('records');
$pd_form_detail_json_id = $this->get('jid');
if(is_numeric($pd_form_detail_json_id))
$records = $this->post('records');
$fk_pd_id = $records['fk_pd_id'];
$fk_form_id = $records['fk_form_id'];
$company_id = $records['company_id'];
$fk_createdby = $records['fk_createdby'];
$rental_count_id = $records['rental_count_id'];
$fields = array('isactive' => 0,'fk_updatedby' => $fk_createdby);
$where_condition_array = array('fk_pd_id' => $fk_pd_id,'fk_form_id' => $fk_form_id);
if($company_id)
{
$id = $this->PD_Model->updateRecords(array('isactive' => 0),PDFORMDETAILSJSON,array('pd_form_detail_json_id' => $pd_form_detail_json_id));
$where_condition_array['company_id'] = $company_id;
}
if($rental_count_id)
{
$where_condition_array['rental_count_id'] = $rental_count_id;
}
//print_r($where_condition_array);die();
$id = $this->PD_Model->updateRecords($fields,PDFORMDETAILSJSON,$where_condition_array);
//print_r($this->db->last_query());
if($id)
{
$data['dataStatus'] = true;
@ -9104,15 +9120,15 @@ public function getCompaniesListsFromGeneralFormRawJSON_post()
$data['status'] = REST_Controller::HTTP_NOT_MODIFIED;
$data['msg'] = 'Something went wrong..! Try Later...!';
$this->response($data,REST_Controller::HTTP_OK);
}
}
else
{
$data['dataStatus'] = false;
$data['status'] = REST_Controller::HTTP_NOT_FOUND;
$data['msg'] = 'Wrong Call...!';
$this->response($data,REST_Controller::HTTP_OK);
}
}
// }
// else
// {
// $data['dataStatus'] = false;
// $data['status'] = REST_Controller::HTTP_NOT_FOUND;
// $data['msg'] = 'Wrong Call...!';
// $this->response($data,REST_Controller::HTTP_OK);
// }
}
}

View File

@ -162,6 +162,7 @@ class Sales_PD_Controller extends REST_Controller {
}
$view_data['section9'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id),SALEPD_DOCS);
$view_data['product_id'] = $sales_pd_data[0]['product_id'];
//print_r($this->db->last_query());die();
//$view_name = $sales_pd_data[0]['short_name'].'_'.$sales_pd_data[0]['abbr'];
$view_name = $sales_pd_data[0]['short_name'];

View File

@ -1260,20 +1260,20 @@ defined('BASEPATH') OR exit('No direct script access allowed');
//echo 'sdn-'.((!$is_current_product_bl) && !$is_current_product_lab); die();
if((!$is_current_product_bl) && !$is_current_product_lab && !$is_current_product_laep)
{
$loan_table_dispaly_rows[] = array('particulars' => 'Amount of Own Contribution','details' =>"<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>"." ".MYUTIL::customIndianNumberFormat($loan_form['own_contribution']).' ('.MYUTIL::numtowords($loan_form['own_contribution']).')' );
$loan_table_dispaly_rows[] = array('particulars' => 'Amount of Own Contribution','details' =>is_numeric($loan_form['own_contribution']) && $loan_form['own_contribution'] != 0 ? ("<span style='font-family: DejaVu Sans; sans-serif;font-size:10px'>₹</span>"." ".MYUTIL::customIndianNumberFormat($loan_form['own_contribution']).' ('.MYUTIL::numtowords($loan_form['own_contribution']).')') : 'Not Provided' );
$source_of_own_contribution = null;
foreach($loan_form['source_of_own_contribution_master'] as $own_source)
{
if(strpos(strval($own_source), 'Others') === false) { $source_of_own_contribution.= $own_source.' and ';}else{ $source_of_own_contribution.=$loan_form['other_source'].' and '; }
if(strpos(strval($own_source), 'Others') === false) { $source_of_own_contribution_mastertribution.= $own_source.' and ';}else{ $source_of_own_contribution.=$loan_form['other_source'].' and '; }
}
$source_of_own_contribution = substr_replace($source_of_own_contribution, '', strrpos($source_of_own_contribution, ' and '),strlen($source_of_own_contribution));
$loan_table_dispaly_rows[] = array('particulars' => 'Source of Own Contribution','details' => $source_of_own_contribution);
$loan_table_dispaly_rows[] = array('particulars' => 'Source of Own Contribution','details' => $source_of_own_contribution );
}
}
$loan_table_dispaly_rows[] = array('particulars' => 'EMI Comfortable Paying','details' => $rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emi_level']).' ('.MYUTIL::numtowords($loan_form['emi_level']).')' );
$loan_table_dispaly_rows[] = array('particulars' => 'EMI Comfortable Paying','details' => is_numeric($loan_form['emi_level']) && $loan_form['emi_level'] != 0? ($rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emi_level']).' ('.MYUTIL::numtowords($loan_form['emi_level']).')') : "Not Provided" );
if(!$is_current_product_bl && !$is_current_product_laep)
{
@ -2489,7 +2489,7 @@ if($total_no_of_business > 0) {
$client_sixth_row = '';
$client_seventh_row = '';
$to_no_of_clients = 0;
$done_on_credit = 0;
$done_on_credit = array();
$name_of_the_company = '';
$is_client_details_available = null;
if(isset($pd_processed_forms[2][$business_count]))
@ -2519,7 +2519,7 @@ if($total_no_of_business > 0) {
// this is for manufacturing
if(array_key_exists('manufacturing_details',$clientRow)){
$done_on_credit += $clientRow['manufacturing_details'][0]['main_raw_materials_total_payments_percent_on_credit'];
$clientRow['manufacturing_details'][0]['main_raw_materials_total_payments_percent_on_credit'] ? $done_on_credit['manufacturing prodcuts'] = $clientRow['manufacturing_details'][0]['main_raw_materials_total_payments_percent_on_credit'] : '';
foreach($clientRow['manufacturing_details'] as $manuRow){
@ -2565,7 +2565,7 @@ if($total_no_of_business > 0) {
// this is for trading
if(array_key_exists('trade_details',$clientRow)){
$done_on_credit += $clientRow['trade_details'][0]['trading_products_total_payments_percent_on_credit'];
$clientRow['trade_details'][0]['trading_products_total_payments_percent_on_credit'] ? $done_on_credit['trading products'] = $clientRow['trade_details'][0]['trading_products_total_payments_percent_on_credit'] : '';
foreach($clientRow['trade_details'] as $tradeRow){
if(isset($tradeRow['trading_products'])){
@ -2610,7 +2610,7 @@ if($total_no_of_business > 0) {
//this is for service
if(array_key_exists('service_provider_details',$clientRow)){
$done_on_credit += $clientRow['service_provider_details'][0]['service_products_total_payments_percent_on_credit'];
$clientRow['service_provider_details'][0]['service_products_total_payments_percent_on_credit'] ? $done_on_credit['service providing'] = $clientRow['service_provider_details'][0]['service_products_total_payments_percent_on_credit'] : '';
foreach($clientRow['service_provider_details'] as $serviceRow){
@ -2700,7 +2700,42 @@ if($total_no_of_business > 0) {
</table>
<?php if($done_on_credit != 0) { echo "<p> Out of total sales done by ".$name_of_the_company .", ".$done_on_credit."% is done on credit.</p>"; }
<?php //$done_on_credit['test products'] = 96;
if(count($done_on_credit)) {
//print_r($done_on_credit);
$vals = array_values($done_on_credit);$temp = array();$all_same = false;
foreach ($vals as $key => $value)
{
if(count($temp))
{
foreach ($temp as $tk => $tvalue)
{
$value == $tvalue ? $all_same = true : $all_same = false ;array_push($temp, $value);
}
}
else
{
array_push($temp, $value);
}
}
if($all_same)
{ echo "<p> Out of total sales done by ".$name_of_the_company .", ".$vals[0]."% is done on credit.</p>"; }
else
{
$activities = '';
foreach ($done_on_credit as $dkey => $dvalue)
{
$activities .= $dkey.' '.$dvalue.'%, ';
}
$activities = substr_replace($activities,' ', -2);
$activities = substr_replace($activities,' and ',strripos($activities,','),2);
echo "<p> Out of total sales done by ".$name_of_the_company .", ".$activities."are done on credit.</p>";
}
}
//CLient Photo Section
@ -2742,7 +2777,6 @@ if($total_no_of_business > 0) {
// //echo '</tbody>';
// echo '</table>';
// }
//End of CLient Photo Section
?>
<?php }
echo '<p>'.$client_form_remarks.'</p>';

View File

@ -1529,11 +1529,11 @@ defined('BASEPATH') OR exit('No direct script access allowed');
}
$source_of_own_contribution = substr_replace($source_of_own_contribution, '', strrpos($source_of_own_contribution, ' and '),strlen($source_of_own_contribution));
$loan_table_dispaly_rows[] = array('particulars' => 'Source of Own Contribution','details' => $source_of_own_contribution);
$loan_table_dispaly_rows[] = array('particulars' => 'Source of Own Contribution','details' => is_numeric($source_of_own_contribution) && $source_of_own_contribution != 0 ? $source_of_own_contribution : 'Not Provided');
}
}
$loan_table_dispaly_rows[] = array('particulars' => 'EMI Comfortable Paying','details' => $rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emi_level']).' ('.MYUTIL::numtowords($loan_form['emi_level']).')' );
$loan_table_dispaly_rows[] = array('particulars' => 'EMI Comfortable Paying','details' => is_numeric($loan_form['emi_level']) && $loan_form['emi_level'] != 0? ($rupee_symbol." ".MYUTIL::customIndianNumberFormat($loan_form['emi_level']).' ('.MYUTIL::numtowords($loan_form['emi_level']).')') : "Not Provided" );
if(!$is_current_product_bl && !$is_current_product_laep)
{
@ -2734,7 +2734,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$client_sixth_row = '';
$client_seventh_row = '';
$to_no_of_clients = 0;
$done_on_credit = 0;
$done_on_credit = array();
$name_of_the_company = '';
$is_client_details_available = null;
if(isset($pd_processed_forms[2][$business_count]))
@ -2764,7 +2764,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
// this is for manufacturing
if(array_key_exists('manufacturing_details',$clientRow)){
$done_on_credit += $clientRow['manufacturing_details'][0]['main_raw_materials_total_payments_percent_on_credit'];
$clientRow['manufacturing_details'][0]['main_raw_materials_total_payments_percent_on_credit'] ? $done_on_credit['manufacturing prodcuts'] = $clientRow['manufacturing_details'][0]['main_raw_materials_total_payments_percent_on_credit'] : '';
foreach($clientRow['manufacturing_details'] as $manuRow){
@ -2810,7 +2810,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
// this is for trading
if(array_key_exists('trade_details',$clientRow)){
$done_on_credit += $clientRow['trade_details'][0]['trading_products_total_payments_percent_on_credit'];
$clientRow['trade_details'][0]['trading_products_total_payments_percent_on_credit'] ? $done_on_credit['trading products'] = $clientRow['trade_details'][0]['trading_products_total_payments_percent_on_credit'] : '';
foreach($clientRow['trade_details'] as $tradeRow){
if(isset($tradeRow['trading_products'])){
@ -2855,7 +2855,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
//this is for service
if(array_key_exists('service_provider_details',$clientRow)){
$done_on_credit += $clientRow['service_provider_details'][0]['service_products_total_payments_percent_on_credit'];
$clientRow['service_provider_details'][0]['service_products_total_payments_percent_on_credit'] ? $done_on_credit['service providing'] = $clientRow['service_provider_details'][0]['service_products_total_payments_percent_on_credit'] : '';
foreach($clientRow['service_provider_details'] as $serviceRow){
@ -2945,7 +2945,42 @@ defined('BASEPATH') OR exit('No direct script access allowed');
</table>
<?php if($done_on_credit != 0) { echo "<p> Out of total sales done by ".$name_of_the_company .", ".$done_on_credit."% is done on credit.</p>"; }
<?php
if(count($done_on_credit)) {
//print_r($done_on_credit);
$vals = array_values($done_on_credit);$temp = array();$all_same = false;
foreach ($vals as $key => $value)
{
if(count($temp))
{
foreach ($temp as $tk => $tvalue)
{
$value == $tvalue ? $all_same = true : $all_same = false ;array_push($temp, $value);
}
}
else
{
array_push($temp, $value);
}
}
if($all_same)
{ echo "<p> Out of total sales done by ".$name_of_the_company .", ".$vals[0]."% is done on credit.</p>"; }
else
{
$activities = '';
foreach ($done_on_credit as $dkey => $dvalue)
{
$activities .= $dkey.' '.$dvalue.'%, ';
}
$activities = substr_replace($activities,' ', -2);
$activities = substr_replace($activities,' and ',strripos($activities,','),2);
echo "<p> Out of total sales done by ".$name_of_the_company .", ".$activities."are done on credit.</p>";
}
}
//CLient Photo Section

View File

@ -4,6 +4,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
$uparrow = '<span style="color:green;">↑</span>';
$downarrow = '<span style="color:red;">↓</span>';
$dash = '<span style="color:black;"> </span>';
$product_name = $product_id == 8 ? 'LFMP' : 'BL';
?><!DOCTYPE html>
<html lang="en">
<head>
@ -105,7 +106,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
<tbody>
<tr>
<th colspan="10" >Personal Discussion Sheet - LFMP (For Sales Team)</th>
<th colspan="10" >Personal Discussion Sheet - <?php echo $product_name; ?> (For Sales Team)</th>
</tr>
<tr>
<td colspan="3"> Application ID</td>