SUP FORM SAVE MODIFIED
This commit is contained in:
parent
2f9cee28f1
commit
444b3cc4dd
@ -1756,12 +1756,31 @@ class PD_Controller extends REST_Controller {
|
|||||||
$this->saveCoApplicantsFromGeneralInfoForm($records);
|
$this->saveCoApplicantsFromGeneralInfoForm($records);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($records['formid'] == 1)// If formis supplier 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']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Deactivate Old rec
|
//Deactivate Old rec
|
||||||
$where_condition_array = array('fk_pd_id' => $pd_id,"fk_form_id"=>$pd_form_id);
|
$where_condition_array = array('fk_pd_id' => $pd_id,"fk_form_id"=>$pd_form_id);
|
||||||
$array = array('isactive'=>0);
|
$array = array('isactive'=>0);
|
||||||
$pd_id_modified = $this->PD_Model->updateRecords($array,PDFORMDETAILS,$where_condition_array);
|
$pd_id_modified = $this->PD_Model->updateRecords($array,PDFORMDETAILS,$where_condition_array);
|
||||||
|
|
||||||
|
|
||||||
foreach($records as $rec_key => $record)
|
foreach($records as $rec_key => $record)
|
||||||
{
|
{
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user