retrieve($_REQUEST['record']); require_once('include/MVC/View/SugarView.php'); if(file_exists('modules/EcmTransactions/views/view.detail.php')) { require_once('modules/EcmTransactions/views/view.detail.php'); $detail = new EcmTransaction(); } else{ require_once('include/MVC/View/views/view.detail.php'); $detail = new ViewDetail(); $detail->ss = new Sugar_Smarty(); $detail->module = 'EcmTransactions'; } global $app_list_strings; $db = $GLOBALS['db']; //get assigned doc $ff = $db->fetchByAssoc($db->query("SELECT * FROM ecmtransactions WHERE id='".$focus->id."'")); if ($ff['record_id'] && $ff['record_id']!='') { $doc = $db->fetchByAssoc($db->query("SELECT id, document_no FROM ".strtolower($ff['record_type'])." WHERE id ='".$ff['record_id']."'")); $detail->ss->assign('ASSIGNED_DOCUMENT', ''.$doc['document_no'].''); } $can_edit = true; //get transactions $res = $db->query(" select t.id, t.name, rel.value from ecmtransactions_rel as rel inner join ecmtransactions as t on t.id = rel.ecmtransaction_a_id where rel.ecmtransaction_b_id='$focus->id'"); $trans = ''; while ($row = $db->fetchByAssoc($res)) { $can_edit = false; $row['value'] = format_number($row['value']); $trans.=''.$row['name'].''; $trans.=''; $trans.=''; } $res = $db->query(" select t.id, t.name, rel.value from ecmtransactions_rel as rel inner join ecmtransactions as t on t.id = rel.ecmtransaction_b_id where rel.ecmtransaction_a_id='$focus->id'"); while ($row = $db->fetchByAssoc($res)) { $can_edit = false; $row['value'] = format_number($row['value']); $trans.=''; $trans.=''; $trans.=''; $trans.=''; } $trans.='
'.$row['value'].'
'.$row['name'].''.$row['value'].'
'; $detail->ss->assign('RELATED_TRANSACTIONS', $trans); $detail->ss->assign('CAN_EDIT', $can_edit); $detail->bean = $focus; $detail->preDisplay(); echo $detail->display(); echo '
'; require_once('subpanels.php'); echo '
'; ?>