<?xml version="1.0" encoding="UTF-8"?> <!-- $Author: LR $Date: 2013-7-15 下午04:39:15 $Revision: 1.0 $Purpose: --> <a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true"> <a:view> <a:link id="acr_invoice_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/> <a:link id="acr610_invoice_detail_link" url="${/request/@context_path}/modules/acr/ACR610/acr_invoice_detail_readonly.lview"/> <a:link id="acr610_detail_submit_link" model="acr.ACR610.acr_invoice_apply_detail" modelaction="update"/> <a:link id="attachment_uploadFile_id" url="${/request/@context_path}/uploadFile.lview"/> <a:link id="attachment_downloadFile_id" url="${/request/@context_path}/downloadFile.lview"/> <a:link id="${/parameter/@layout_code}_con_cashflow_wirte_off_detail_link" url="${/request/@context_path}/modules/acr/ACR610/con_cashflow_wirte_off_detail.lview"/> <script><![CDATA[ function lock_current_detail_window() { Leaf.Masker.mask($('${/parameter/@winId}').wrap, '${l:HLS.EXECUTING}'); } function unlock_current_detail_window() { Leaf.Masker.unmask($('${/parameter/@winId}').wrap); } function acr610_invoice_detail_exit() { $('${/parameter/@winId}').close(); } function acr610_invoice_detail_query() { $('acr610_invoice_detail_result_ds').query(); } function acr610_invoice_detail_reset() { $('acr610_invoice_detail_query_ds').reset(); } function acr610_invoice_detail_submit() { Leaf.showConfirm('提示', '您确认提交吗', function () { lock_current_detail_window(); Leaf.request({ url: $('acr610_detail_submit_link').getUrl(), para: { invoice_apply_id: '${/parameter/@invoice_apply_id}' }, success: function () { Leaf.SideBar.show({ msg: '提交成功', duration: 3000 }); unlock_current_detail_window(); acr610_invoice_detail_exit(); }, failure: function () { unlock_current_detail_window(); }, error: function () { unlock_current_detail_window(); }, scope: this }); }); } function acr610_detail_grid_readonly(record_id, invoice_hd_wfl_id) { var currency_reocrd = $('acr610_invoice_detail_result_ds').findById(record_id); var param = currency_reocrd.data; param['winid'] = 'confirm_invoice_detail_win'; param['document_id'] = invoice_hd_wfl_id; param['url_title'] = '${l:ACR.INVOICE_DETAIL}'; param['function_code'] = 'ACR610R'; param['function_usage'] = 'QUERY'; param['maintain_type'] = 'READONLY'; hls_doc_get_layout_code('acr_invoice_get_layout_code_link_id', param, 'acr610_invoice_detail_link'); } function acr610_detail_upload_window(file_id) { if (file_id) { var url = $('attachment_uploadFile_id').getUrl() + '?table_name=ACR_INVOICE_APPLY&header_id=' + file_id; var win = new Leaf.Window({ url: url, title: '${l:HLS.SUPPORTING_DOCUMENT}', id: 'acr_apply_cdd_attachtment_upload_id', width: 850, height: 400 }); } else { Leaf.showMessage('${l:HLS.PROMPT}', '无法上传,请联系管理员!'); } } function acr610_detail_renderer(value, record, name) { debugger; if (name == 'document_number') { return '<a href="javascript:acr610_detail_grid_readonly(' + record.id + ',' + record.get('invoice_hd_wfl_id') + ');">' + value + '</a>'; } if (name == 'attachment') { if (record.get('invoice_kind') == '0') { if (record.get('paid_byother_flag') == 'T') { if (record.get('guarantor_name_duty') != 'Y' || record.get('guarantor_name_duty') == 'NULL') { return '<a href="javascript:acr610_detail_upload_window(' + record.get('file_id') + ')">附件</a>'; } } } else if (record.get('invoice_kind') == '2') { if (record.get('paid_byother_sum_flag') > 0) { var current_record = $('acr610_invoice_detail_result_ds').getAt(0); if (current_record.id == record.id) { return '<a href="javascript:acr610_detail_upload_window(' + record.get('file_id') + ')">附件</a>'; } } } } if (name == 'received_amount') { debugger; if ((!Leaf.isEmpty(value) && value > 0)&&record.get('cf_item') != '9') { return '<a href="javascript:csh_write_off_detail(' + record.id + ',' + record.get('invoice_hd_id') + ');">' + Leaf.formatMoney(value) + '</a>'; } else { return Leaf.formatMoney(value); } } } function acr610_detail_formatMoney(value, record, name) { return Leaf.formatMoney(value); } function sumFunction_foot(data, name) { if (name == 'journal_month') { return '<font color=red>' + '合计' + '</font>'; } else if (name == 'total_amount' || name == 'net_amount' || name == 'tax_amount' || name == 'received_amount') { return colum_caculateTotal(data, name); } } function colum_caculateTotal(data, name) { var total = 0; var length = data.length; var value = 0; for (var i = 0; i < length; i++) { if (Ext.isEmpty(data[i].get(name))) { value = 0; } else { value = data[i].get(name); } total = plus(total, value); } return '<font color=red>' + Leaf.formatMoney(total) + '</font>'; } function csh_write_off_detail(record_id, invoice_hd_id) { var url = $('${/parameter/@layout_code}_con_cashflow_wirte_off_detail_link').getUrl(); var record = $('acr610_invoice_detail_result_ds').findById(record_id); if (record) { var win = new Leaf.Window({ id: 'acr610WFL_con_cashflow_wirte_off_detail_window', url: url, params: { cashflow_id: record.get('cashflow_id'), invoice_hd_id: invoice_hd_id, winid: 'acr610WFL_con_cashflow_wirte_off_detail_window' }, draggable: true, fullScreen: true }); } } ]]></script> <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/> <a:dataSets> <a:dataSet id="acr610_ipaid_byother_flag_ds" lookupCode="PAID_BYOTHER_FLAG"/> <a:dataSet id="acr610_invoice_apply_basic_ds" autoQuery="true" fetchAll="true" model="acr.ACR610.acr_invoice_apply_query" queryUrl="${/request/@context_path}/autocrud/acr.ACR610.acr_invoice_apply_query/query?invoice_apply_id=${/parameter/@invoice_apply_id}"> <a:fields> <a:field name="invoice_apply_num"/> <a:field name="invoice_apply_user_n"/> <a:field name="invoice_apply_date"/> </a:fields> </a:dataSet> <a:dataSet id="acr610_invoice_detail_query_ds"> <a:fields> <a:field name="contract_number"/> <a:field name="bp_code"/> <a:field name="journal_month"/> <a:field name="paid_byother_flag_n" displayField="code_value_name" options="acr610_ipaid_byother_flag_ds" returnField="paid_byother_flag" valueField="code_value"/> </a:fields> </a:dataSet> <a:dataSet id="acr610_invoice_detail_result_ds" autoQuery="true" fetchAll="true" model="acr.ACR610.acr_invoice_apply_detail" queryUrl="${/request/@context_path}/autocrud/acr.ACR610.acr_invoice_apply_detail/query?invoice_apply_id=${/parameter/@invoice_apply_id}" queryDataSet="acr610_invoice_detail_query_ds" selectable="false"/> </a:dataSets> <a:screenBody> <a:screenTopToolbar> <a:screenTitle/> <a:toolbarButton click="acr610_invoice_detail_exit" text="HLS.EXIT"/> <a:toolbarButton click="acr610_invoice_detail_query" text="HLS.QUERY"/> <a:toolbarButton click="acr610_invoice_detail_reset" text="HLS.RESET"/> <a:toolbarButton click="acr610_invoice_detail_submit" text="HLS.SUBMIT"/> </a:screenTopToolbar> <a:form marginWidth="200" padding="0" title="查询条件"> <a:hBox labelSeparator=" "> <a:textField name="contract_number" bindTarget="acr610_invoice_detail_query_ds" prompt="合同编号" width="135"/> <a:textField name="bp_code" bindTarget="acr610_invoice_detail_query_ds" prompt="客户编号" width="135"/> <a:textField name="journal_month" bindTarget="acr610_invoice_detail_query_ds" prompt="税款所属期" width="135" emptyText="YYYY-MM"/> <a:comboBox name="paid_byother_flag_n" bindTarget="acr610_invoice_detail_query_ds" prompt="担保支付" width="135"/> </a:hBox> </a:form> <a:form marginWidth="200" padding="0" title="基本信息"> <a:hBox labelSeparator=" "> <a:textField name="invoice_apply_num" bindTarget="acr610_invoice_apply_basic_ds" prompt="申请编号" width="135" readOnly="true"/> <a:textField name="invoice_apply_user_n" bindTarget="acr610_invoice_apply_basic_ds" prompt="申请人" width="135" readOnly="true"/> <a:textField name="invoice_apply_date" bindTarget="acr610_invoice_apply_basic_ds" prompt="申请时间" width="135" readOnly="true"/> </a:hBox> </a:form> <a:grid id="acr610_invoice_detail_grid_ds" bindTarget="acr610_invoice_detail_result_ds" marginHeight="250" marginWidth="30" navBar="true"> <a:columns> <a:column name="document_number" lock="true" prompt="单据编号" align="center" renderer="acr610_detail_renderer" width="120"/> <a:column name="contract_number" prompt="合同编号" align="center" width="100"/> <a:column name="bp_code" prompt="客户编号" align="center" width="100"/> <a:column name="bp_name" prompt="客户名称" align="center" width="100"/> <a:column name="times" prompt="租期" align="center" width="60"/> <a:column name="journal_month" prompt="税款所属期" align="center" width="120" footerRenderer="sumFunction_foot"/> <a:column name="tax_type_rate" prompt="税率" align="right" width="60"/> <a:column name="total_amount" prompt="开票金额" footerRenderer="sumFunction_foot" renderer="acr610_detail_formatMoney" align="right" width="100"/> <a:column name="net_amount" prompt="不含税金额" footerRenderer="sumFunction_foot" renderer="acr610_detail_formatMoney" align="right" width="100"/> <a:column name="tax_amount" prompt="税额" footerRenderer="sumFunction_foot" renderer="acr610_detail_formatMoney" align="right" width="100"/> <a:column name="paid_byother_flag_n" prompt="担保支付" align="center" width="100"/> <a:column name="received_amount" prompt="核销金额" footerRenderer="sumFunction_foot" renderer="acr610_detail_renderer" align="right" width="100"/> <a:column name="write_off_max_date" prompt="核销日期" align="center" width="90"/> <a:column name="journal_num" prompt="增值税凭证号" align="center" width="100"/> <a:column name="guarantor_name_duty" prompt="担保人履行担保义务" hidden="true"/> <a:column name="attachment" prompt="担保代付协议" align="center" width="100" renderer="acr610_detail_renderer"/> </a:columns> </a:grid> </a:screenBody> </a:view> </a:screen>