retrieve($_REQUEST['record']); $focus->format_all_fields(); if(isset($_REQUEST['status']) && $_REQUEST['status'] != '' ) { $focus->doNotAccepted(); } $focus->position_list = str_replace('"','\"',$focus->getPositionList()); $OPT['status'] = $focus->status; } else { $OPT['new_number'] = true; $datef = $current_user->getPreference('datef'); if($datef != '') $sugar_config['datef']; $focus->register_date = date($datef); $focus->payment_date = date($datef,mktime()+30*24*60*60); $focus->sell_date = date($datef); } //if access 'Delete' is avaible for user than he is Manager and he can confirm Quotes. $OPT['user']['access']['send_email'] = $focus->ACLAccess("send_email"); if(isset($_REQUEST['send_email']) && $_REQUEST['send_email'] == '1') $OPT['setTab'] = 'EMAIL'; $tmp = $current_user->getPreference('num_grp_sep'); if(!isset($tmp) || $tmp == '' || $tmp == NULL) $tmp = $sugar_config['default_number_grouping_seperator']; $OPT['sep_1000'] = $tmp; $tmp = $current_user->getPreference('dec_sep'); if(!isset($tmp) || $tmp == '' || $tmp == NULL) $tmp = $sugar_config['default_decimal_seperator']; $OPT['dec_sep'] = $tmp; $tmp = $current_user->getPreference('default_currency_significant_digits'); if(!isset($tmp) || $tmp == '' || $tmp == NULL) $tmp = $sugar_config['default_currency_significant_digits']; $OPT['dec_len'] = $tmp; $OPT['default_unit'] = "1"; $OPT['default_vat'] = "19.00"; $OPT['default_category'] = ""; $OPT['type'] = $focus->type; $OPT['to_is_vat_free'] = $focus->to_is_vat_free; if ((is_null($focus->kind)) || ($focus->kind==' ')) $OPT['kind'] = 'other'; else $OPT['kind'] = $focus->kind; $cq = $current_user->getPreference('confirm_quotes'); $OPT['user']['confirm_quotes'] = ((isset($cq) && $cq)?1:0); $json = getJSONobj(); $w=$GLOBALS['db']->query("select name,id,value from ecmvats where deleted='0' order by name"); $nvats=$w->num_rows; while($r=$GLOBALS['db']->fetchByAssoc($w)){ $VAT[$r['id']]=array( "id"=>$r['id'], "name"=>$r['name'], "value"=>$r['value'] ); } $show_pdf=$current_user->getPreference('show_pdf_in_div'); if(!isset($show_pdf)){ require_once('modules/EcmGroupSales/EcmGroupSale.php'); $cc = EcmGroupSale::loadSettings(); $show_pdf=$cc['show_pdf_in_div_global']; } $scriptOpt = ''; echo $scriptOpt; require_once('include/MVC/View/SugarView.php'); require_once('modules/EcmStockDocIns/views/DetailView/view.detail.my.php'); $edit = new ViewDetailMy(); $edit->ss = new Sugar_Smarty(); $edit->module = 'EcmStockDocIns'; $edit->bean = $focus; $edit->tplFile = 'include/ECM/EcmViews/DetailView/Tabs/DetailView.tpl'; $edit->bean->total = unformat_number($edit->bean->total); $edit->preDisplay(); //$edit->bean->subtotal = unformat_number($edit->bean->subtotal); //echo '
'.$edit->bean->subtotal; $cnt=mysql_num_rows($GLOBALS['db']->query("select id from ecmstockdocins where correct_id='".$focus->id."'")); $r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select type from ecmstockdocins where id='".$focus->id."'")); if($cnt>0)$hasCorrect=1; else $hasCorrect=0; $edit->ss->assign("hasCorrect", $hasCorrect); $arr_template = $focus->getTemplateList(); if(isset($focus->template_id)) $edit->ss->assign("DOCUMENT_TEMPLATES_OPTIONS", get_select_options_with_id($arr_template, $focus->template_id)); else $edit->ss->assign("DOCUMENT_TEMPLATES_OPTIONS", get_select_options_with_id($arr_template, '')); $edit->ss->assign("POSITION_LIST", $focus->position_list); $edit->ss->assign("EMAIL_LINK",$focus->createSendEmailLink()); $edit->ss->assign("OPT", $OPT); error_reporting(E_ALL); $edit->ss->assign("SEND_EMAIL_LINK",$focus->createSendEmailLink()); $email_link_tab = ''; $edit->ss->assign("EMAIL_LINK_TAB",$email_link_tab); if ($focus->kind=='import') { $edit->ss->assign("KIND_TITLE","Szczegóły - Import"); $kind_table='
'.$mod_strings['LBL_FOREIGN_TRANSPORT_VAL'].' '.format_number($focus->foreign_transport_val).' '.$mod_strings['LBL_FOREIGN_TRANSPORT_CUR_ID'].' '.$app_list_strings['currency_dom'][$focus->foreign_transport_cur_id].' '.format_number($focus->foreign_transport_cur_val).'
'.$mod_strings['LBL_COUNTRY_TRANSPORT_VAL'].' '.format_number($focus->country_transport_val).' '.$mod_strings['LBL_COUNTRY_TRANSPORT_CUR_ID'].' '.$app_list_strings['currency_dom'][$focus->country_transport_cur_id].' '.format_number($focus->country_transport_cur_val).'
'.$mod_strings['LBL_ADDITION_COST_VAL'].' '.format_number($focus->addition_cost_val).' '.$mod_strings['LBL_ADDITION_COST_CUR_ID'].' '.$app_list_strings['currency_dom'][$focus->addition_cost_cur_id].' '.format_number($focus->addition_cost_cur_val).'
'.$mod_strings['LBL_CURRENCY_ID'].' '.$app_list_strings['currency_dom'][$focus->currency_id].' '.$mod_strings['LBL_CURRENCY_VALUE'].' '.format_number($focus->currency_value,4,4).' '.$mod_strings['LBL_CURRENCY_SAD_VALUE'].' '.format_number($focus->currency_sad_value,4,4).'
'; } if (isset($kind_table)) $edit->ss->assign("KIND_TABLE",$kind_table); echo $edit->display(); require_once('include/SubPanel/SubPanelTiles.php'); $subpanel = new SubPanelTiles($focus, 'EcmStockDocIns'); echo $subpanel->display(); ?>