This commit is contained in:
velz 2018-12-20 19:23:31 +05:30
parent ba64da2433
commit a3e3d5ca6b
2 changed files with 57 additions and 1 deletions

View File

@ -1737,6 +1737,7 @@ class PD_Controller extends REST_Controller {
{
$records = $this->post('records');
//print_r($records);echo '****************************';
$pd_id = $records['pdid'];
//print_r($records);die();
//Get Pd masters etails usng PD ID
@ -1777,6 +1778,61 @@ class PD_Controller extends REST_Controller {
unset($records['trade_details']);
}
}
if($records['formid'] == 2)// If formis client then omit parent level array keys
{
if(array_key_exists('manufacturing_details',$records))
{
$records['main_raw_materials'] = $records['manufacturing_details'][0]['main_raw_materials'];
$records['main_raw_materials_total_payments_percent_on_credit'] = $records['manufacturing_details'][0]['main_raw_materials_total_payments_percent_on_credit'];
unset($records['manufacturing_details']);
}
if(array_key_exists('trade_details',$records))
{
$records['trading_products'] = $records['trade_details'][0]['trading_products'];
$records['trading_products_total_payments_percent_on_credit'] = $records['trade_details'][0]['trading_products_total_payments_percent_on_credit'];
unset($records['trade_details']);
}
// if(array_key_exists('service_provider_details',$records))
// {
// $records['trading_products'] = $records['trade_details'][0]['trading_products'];
// $records['trading_products_total_payments_percent_on_credit'] = $records['trade_details'][0]['trading_products_total_payments_percent_on_credit'];
// unset($records['trade_details']);
// }
}
if($records['formid'] == 11)// If formis supplier then omit parent level array keys
{
if(array_key_exists('manufacturing_details',$records))
{
$records['manufacturing_raw_materials'] = $records['manufacturing_details'][0]['manufacturing_raw_materials'];
$records['manufacturing_finished_goods'] = $records['manufacturing_details'][0]['manufacturing_finished_goods'];
$records['manufacturing_traded_goods'] = $records['manufacturing_details'][0]['manufacturing_traded_goods'];
// $records['main_raw_materials_total_payments_percent_on_credit'] = $records['manufacturing_details'][0]['main_raw_materials_total_payments_percent_on_credit'];
unset($records['manufacturing_details']);
}
if(array_key_exists('trade_details',$records))
{
$records['trading_finished_goods'] = $records['trade_details'][0]['trading_finished_goods'];
$records['trading_traded_goods'] = $records['trade_details'][0]['trading_traded_goods'];
// $records['trading_products_total_payments_percent_on_credit'] = $records['trade_details'][0]['trading_products_total_payments_percent_on_credit'];
unset($records['trade_details']);
}
if(array_key_exists('retail_details',$records))
{
$records['retail_finished_goods'] = $records['retail_details'][0]['retail_finished_goods'];
$records['retail_traded_goods'] = $records['retail_details'][0]['retail_traded_goods'];
// $records['trading_products_total_payments_percent_on_credit'] = $records['trade_details'][0]['trading_products_total_payments_percent_on_credit'];
unset($records['retail_details']);
}
}
//print_r($records);

View File

@ -419,7 +419,7 @@ class GETPDFORMDETAILS
$final_data = array_merge($final_data,$group);
}
//print_r($final_data);
//print_r($final_data);die();
// echo "\n";
// Merge subgroup into main group for all forms except rendtal form (id = 17)