retrieve($_REQUEST['record']); $file = 'modules/EcmGroupSales/EcmGroupSale.php'; if(file_exists($file)) { $cc = array(); require_once($file); $cc = EcmGroupSale::loadSettings(); } global $app_list_strings; require_once('include/MVC/View/SugarView.php'); require_once('modules/EcmPrepaymentInvoices/views/DetailView/view.detail.php'); $detail = new EcmPrepaymentInvoicesViewDetail(); $detail->ss = new Sugar_Smarty(); $detail->module = 'EcmPrepaymentInvoices'; $detail->bean = $focus; $detail->tplFile = 'include/DetailView/DetailView.tpl'; $btn = ''; $detail->ss->assign ( "CREATE_PDF", $btn ); //get other prepaymentinvoices info $res = $GLOBALS['db']->query("SELECT id, document_no, inv_value FROM ecmprepaymentinvoices WHERE ecmsale_id='".$focus->ecmsale_id."'"); $total = 0; $other_inv = ''; while ($row = $GLOBALS['db']->fetchByAssoc($res)) { if ($row['id']==$focus->id) continue; $other_inv.=''.$row['document_no'].' '; $total+=$row['inv_value']; } $detail->ss->assign('other_ecmprepaymentinvoices',$other_inv); $detail->ss->assign('other_ecmprepayment_invoices_sum',format_number($total)); $scriptOpt = ''; echo $scriptOpt; $detail->preDisplay(); $focus->parent_name_copy = $focus->parent_name; echo $detail->display(); ?>