$sql = 'SELECT * FROM quote_configuration';
$res = $GLOBALS['db']->query($sql);
$row = $GLOBALS['db']->fetchByAssoc($res);
$result_quo_arr = $row;
$final_quotation_arr = array();
$quotation_part_conf_arr = array();
$lineitem_part_conf_arr = array();
$quotation_configuration_label_arr = array("","Quote_No","Prefix","Suffix","Revised","No_Reset","No_Reset_Yearly","Discount_Apply","Discount_Type","Tax_Apply","Read_Only_Tnc","Read_Only_Payment_Terms","Show_Part_No","Show_Type","Show_Category","Show_Manufacturer","Show_Description","Show_Tnc","Show_Min_Price","Show_Max_Price","RO_Part_No","RO_Description","RO_Tnc","Allow_Product","Prevent_Price_Range");
$qc = 0;
$firstElement = true;
foreach ($result_quo_arr as $key => $value) {
// $GLOBALS['log']->fatal('Begin:->quotation_configuration',$qc."-->".$key);
if($firstElement) {
$firstElement = false;
} else {
if($qc<12){
$quotation_part_conf_arr['quotation'][$quotation_configuration_label_arr[$qc]] = $value;
}else{
if($quotation_configuration_label_arr[$qc] != null){
$lineitem_part_conf_arr['line_item'][$quotation_configuration_label_arr[$qc]] = $value;
}
}
}
$qc++;
}
$final_quotation_arr = array_merge($quotation_part_conf_arr,$lineitem_part_conf_arr);
//New Code Start NRT-LKS
$response_arr['outmails_license'] = (($sugar_config['enjay_outmails']['sg_license'] == "")) ? "" : $sugar_config['enjay_outmails']['sg_license'];
$response_arr["quotation_configuration"] = $final_quotation_arr;
// Get Quotation PDF Type
$pdf_type = json_decode($sugar_config['quotation_pdf_type'], true);
// echo "";
// print_r($pdf_type);
$quotation_pdf_type_value_arr = array("Standard","Invoice","Standard2","Invoice2","Standard3","Invoice3");
$final_pdf_type_arr = array();
foreach ($pdf_type as $key => $value) {
$final_pdf_type_arr[$quotation_pdf_type_value_arr[$key]] = $value;
}
// echo "";
// print_r($final_pdf_type_arr);
$response_arr["quotation_pdf_type"] = $final_pdf_type_arr;