acr_invoice_claim_confirm.lview 17.6 KB
Newer Older
1 2 3 4 5 6
<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true">
    <a:init-procedure>

    </a:init-procedure>
    <a:view>
7 8
        <a:link id="bmLink_acr_invoice_return" model="acr.ACR605.acr_invoice_claim_return" modelaction="update"/>
        <a:link id="bmLink_acr_invoice_claim_confirm" model="acr.ACR605.acr_invoice_claim_confirm" modelaction="update"/>
9
        <a:link id="acr_invoice_refuse_link_id" model="acr.ACR605.acr_invoice_claim_return" modelaction="batch_update"/>
10 11
        <a:link id="con_contract_modify_link" url="${/request/@context_path}/modules/cont/CON505/con_contract_modify.lview"/>
        <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code" modelaction="update"/>
12
        <a:link id="acr517_invoice_send_to_email_link" url="${/request/@context_path}/modules/acr/ACR516/import_invoice_to_email.lsc"/>
13

14
        <script type="text/javascript"><![CDATA[
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32

        function document_number_render(value,record,name)
        {
            if (name == 'document_number' && value) {
                return '<a href="javascript:open_document_win(\'' + record.ds.id + '\',\'' + record.id + '\')">' + value + '</a>';
            }
            return value;
        }
        function open_document_win(ds_id, record_id) {
            var record = $(ds_id).findById(record_id);
            var param = record.data;
            param['function_code'] = 'ACR513';
            param['function_usage'] = 'QUERY';
            param['maintain_type'] = 'UPDATE';
            param['url_title'] = '${l:ACR.INVOICE_DETAIL}';
            hls_doc_get_layout_code('con_contract_get_layout_code_link_id', param, 'con_contract_modify_link', ds_id);
        }

33 34 35 36 37 38 39 40 41
        function acr517_invoice_query() {
            $('acr517_invoice_result_ds').query();
        }

        function acr517_invoice_reset() {
            $('acr517_invoice_query_ds').reset();
        }

        function acr517_invoice_confirm() {
42 43
          //  var records = $('acr517_invoice_result_ds').getSelected();

stone's avatar
stone committed
44 45
            // $('acr517_invoice_result_ds').setSubmitUrl('${/request/@context_path}/autocrud/acr.ACR605.acr_invoice_claim_confirm_new/batch_update');
            var records=$('acr517_invoice_result_ds').getSelected();
46
            debugger;
stone's avatar
stone committed
47
            var datas = [];
48
            var r_map = new Map();
stone's avatar
stone committed
49 50 51 52 53
            for (var i = 0;i < records.length;i++) {
                datas.push({
                    'invoice_hd_id':records[i].get('invoice_hd_id'),
                    '_status': 'update'
                })
54
                //if(records[i].get('division') == '70'){
55 56 57
                    //if(!r_map.has(records[i].get('bp_id_agent_level1'))){
                        //var arr = new Array();
                        //arr.add(records[i].get('invoice_hd_id'));
58
                       // r_map.set(records[i].get('bp_id_agent_level1'),arr);
59 60 61 62 63 64
                   //}else{
                       //r_map.get(records[i].get('bp_id_agent_level1')).add(records[i].get('invoice_hd_id'));
                   //}
                //} else if(records[i].get('invoice_type') == 'ECT'){
				//} else 
				if(records[i].get('invoice_kind_type') == 'ELECTRONIC_GENERAL'||records[i].get('invoice_kind_type') == 'ELECTRONIC_SPECIAL'){
65 66 67 68 69 70 71
                    if(!r_map.has(records[i].get('invoice_bp_id'))){
                        var arr = new Array();
                        arr.add(records[i].get('invoice_hd_id'));
                        r_map.set(records[i].get('invoice_bp_id'),arr);
                    }else{
                        r_map.get(records[i].get('invoice_bp_id')).add(records[i].get('invoice_hd_id'));
                    }
72
                }
stone's avatar
stone committed
73
            }
74
            var result_map = MapTOJson(r_map);
stone's avatar
stone committed
75 76 77 78 79
            $L.showConfirm("提示",'确认执行该操作?',function(){
                Leaf.request({
                    url: '${/request/@context_path}/autocrud/acr.ACR605.acr_invoice_claim_confirm_new/batch_update',
                    para: datas,
                    success: function () {
80 81 82 83 84 85
                        Leaf.request({
                            url: $('acr517_invoice_send_to_email_link').getUrl(),
                            para: {
                                result_map : result_map
                            }
                        });
stone's avatar
stone committed
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
                        Leaf.SideBar.show({
                            msg: '操作成功',
                            duration: 2000
                        });
                        $('acr517_invoice_result_ds').query();
                    },
                    failure: function () {
                        Leaf.showWarningMessage('', '${l:PRJ509.DATA_NOT_BACK}', null, 200, 100);
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    error: function () {
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    scope: this
                });
101 102
            })

103 104
            // alert(record.get('invoice_hd_id'));
            // debugger;
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
           // var invoice_hd_id = record.get('invoice_hd_id');
            // Leaf.request({
            //     url: $("bmLink_acr_invoice_claim_confirm").getUrl(),
            //     para: {
            //         invoice_hd_id:invoice_hd_id
            //     },
            //     success:function(){
            //         $('acr517_invoice_result_ds').query();
            //         Leaf.SideBar.show({
            //             msg: '操作成功',
            //             duration: 2000
            //         });
            //     },
            //     sync:true,
            //     scope: this
            // });
121 122
        }

123
        function acr517_invoice_return() {
stone's avatar
stone committed
124 125 126 127 128 129 130
            var records=$('acr517_invoice_result_ds').getSelected();
            var datas = [];
            for (var i = 0;i < records.length;i++) {
                datas.push({
                    'invoice_hd_id':records[i].get('invoice_hd_id'),
                    '_status': 'update'
                })
131

stone's avatar
stone committed
132 133
            }
            $L.showConfirm("提示",'确认执行该操作?',function(){
134
                Leaf.Masker.mask(Ext.getBody(),'正在操作...');
stone's avatar
stone committed
135 136 137 138
                Leaf.request({
                    url: '${/request/@context_path}/autocrud/acr.ACR605.acr_invoice_claim_return/batch_update',
                    para: datas,
                    success: function () {
139
                        Leaf.Masker.unmask(Ext.getBody());
stone's avatar
stone committed
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
                        Leaf.SideBar.show({
                            msg: '操作成功',
                            duration: 2000
                        });
                        $('acr517_invoice_result_ds').query();
                    },
                    failure: function () {
                        Leaf.showWarningMessage('', '${l:PRJ509.DATA_NOT_BACK}', null, 200, 100);
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    error: function () {
                        Leaf.Masker.unmask(Ext.getBody());
                    },
                    scope: this
                });
155
            })
stone's avatar
stone committed
156

157
        }
158 159 160
      function submit_success_btn(){
         $('acr517_invoice_result_ds').query();
      }
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
        function MapTOJson(m) {
            var str = '{';
            var i = 1;
            m.forEach(function (item, key, mapObj) {
                if (mapObj.size == i) {
                    str += '"' + key + '":"' + item + '"';
                } else {
                    str += '"' + key + '":"' + item + '",';
                }
                i++;
            });
            str += '}';
            //console.log(str);
            return str;
        }
176 177 178
        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
        <a:dataSets>
179 180
<!--            <a:dataSet id="acr517_invoice_kind_ds" lookupCode="ACR510_INVOICE_KIND"/>-->
            <a:dataSet id="acr517_invoice_kind_ds" lookupCode="ACR512_INVOICE_KIND_TYPE"/>
181
			<a:dataSet id="overdue_status_ds" lookupCode="YES_NO"/>
182 183 184 185 186
            <a:dataSet id="acr517_invoice_statu_ds" lookupCode="ACR510_AR_INVOICE_STATUS"/>
            <a:dataSet id="acr517_claim_status_ds" lookupCode="CLAIM_STATUS"/>
            <a:dataSet id="cf_item_options">
                <a:datas dataSource="/model/hls_cashflow_item_list"/>
            </a:dataSet>
187
<!--            <a:dataSet id="claim_status_ds" loadData="true" lookupCode="CLAIM_STATUS"/>-->
188 189 190 191 192 193 194
            <a:dataSet id="csh_transaction_flag_ds">
                <a:datas>
                    <a:record code_value="NOT" code_value_name="未收款"/>
                    <a:record code_value="FULL" code_value_name="完全收款"/>
                    <a:record code_value="PARTIAL" code_value_name="部分收款"/>
                </a:datas>
            </a:dataSet>
195 196 197

            <a:dataSet id="acr517_invoice_query_ds" autoCreate="true">
                <a:fields>
198
                    <a:field name="document_number"/>
199
                    <a:field name="invoice_apply_num"/>
200
                    <a:field name="bp_id_agent_level1"/>
201 202 203 204 205
<!--                    <a:field name="invoice_kind_desc" displayField="code_value_name" options="acr517_invoice_kind_ds"
                             returnField="invoice_kind" valueField="code_value"/>-->
                    <a:field name="invoice_kind_type"/>
                    <a:field name="invoice_kind_type_n" displayField="code_value_name" options="acr517_invoice_kind_ds"
                             returnField="invoice_kind_type" valueField="code_value"/>
206 207 208
					<a:field name="full_elec_invoice_flag"/>
                    <a:field name="full_elec_invoice_flag_n" displayField="code_value_name" options="overdue_status_ds"
                            returnField="full_elec_invoice_flag" valueField="code_value"/>
209 210
                    <a:field name="invoice_status_desc" displayField="code_value_name" options="acr517_invoice_statu_ds" returnField="invoice_status" valueField="code_value"/>
                    <a:field name="total_amount"/>
211 212
                    <a:field name="csh_transaction_flag"/>
                    <a:field name="csh_transaction_flag_desc" options="csh_transaction_flag_ds"
213
                             displayField="code_value_name" returnField="csh_transaction_flag" valueField="code_value"/>
214 215
                    <a:field name="cf_item"/>
                    <a:field name="cf_item_n" options="cf_item_options" displayField="description" returnField="cf_item" valueField="cf_item"/>
216
<!--                    <a:field name="claim_status" options="claim_status_ds" displayField="code_value_name" valueField="code_value" returnField="claim_status"/>-->
217 218 219 220 221 222
                    <a:field name="cf_item_desc" autoComplete="true" lovGridHeight="350" lovHeight="500" lovLabelWidth="100" lovService="csh.CSH518.hls_cashflow_item_v_lov?cf_direction=INFLOW" lovWidth="520" title="现金流项目">
                        <a:mapping>
                            <a:map from="cf_item" to="cf_item"/>
                            <a:map from="cf_item_desc" to="cf_item_desc"/>
                        </a:mapping>
                    </a:field>
223
                    <a:field name="claim_status_n" displayField="code_value_name" options="acr517_claim_status_ds"
224 225 226
                             returnField="claim_status" valueField="code_value"/>
                </a:fields>
            </a:dataSet>
227
            <a:dataSet id="acr517_invoice_result_ds" autoQuery="true" fetchAll="false" autoPageSize="true"
228 229 230 231
                       model="acr.ACR605.acr_invoice_claim_confirm_new" queryDataSet="acr517_invoice_query_ds" selectable="true">
              <a:events>
                  <a:event name="submitsuccess" handler="submit_success_btn"/>
              </a:events>
232 233 234 235 236 237 238
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:toolbarButton click="acr517_invoice_query" text="HLS.QUERY"/>
                <a:toolbarButton click="acr517_invoice_reset" text="HLS.RESET"/>
239
                <a:toolbarButton click="acr517_invoice_confirm" text="确认"/>
stone's avatar
stone committed
240
                <a:toolbarButton click="acr517_invoice_return" text="退回"/>
241 242
            </a:screenTopToolbar>
            <a:form marginWidth="30" padding="0" title="查询条件" column="4">
243 244 245
                <a:textField name="document_number" bindTarget="acr517_invoice_query_ds" prompt="单据编号" width="120"/>
                <a:textField name="contract_number" bindTarget="acr517_invoice_query_ds" prompt="合同编号" width="120"/>
                <a:textField name="contract_name" bindTarget="acr517_invoice_query_ds" prompt="合同名称" width="120"/>
246
<!--                <a:lov name="cf_item_desc" bindTarget="acr517_invoice_query_ds" prompt="现金流项目" width="135"/>-->
247 248 249
                <a:numberField name="total_amount_f" allowFormat="true" bindTarget="acr517_invoice_query_ds" prompt="开票金额含税额从" width="120"/>
                <a:numberField name="total_amount_t" allowFormat="true" bindTarget="acr517_invoice_query_ds" prompt="开票金额含税额到" width="120"/>
                <a:textField name="invoice_title" bindTarget="acr517_invoice_query_ds" prompt="发票抬头" width="120"/>
250 251
<!--                <a:comboBox name="invoice_kind_desc" bindTarget="acr517_invoice_query_ds" prompt="ACR.INVOICE_KIND" width="120"/>-->
                <a:comboBox name="invoice_kind_type_n" bindTarget="acr517_invoice_query_ds" prompt="发票种类" width="120"/>
stone's avatar
stone committed
252
<!--                <a:comboBox name="invoice_status_desc" bindTarget="acr517_invoice_query_ds" prompt="发票状态" width="135"/>-->
253 254 255
                <a:textField name="vat_invoice_code" bindTarget="acr517_invoice_query_ds" prompt="发票代码" width="120"/>
                <a:textField name="invoice_number" bindTarget="acr517_invoice_query_ds" prompt="发票号码" width="120"/>
                <a:comboBox name="claim_status_n" bindTarget="acr517_invoice_query_ds" prompt="认领状态" width="120"/>
256
                <a:comboBox name="csh_transaction_flag_desc" bindTarget="acr517_invoice_query_ds" prompt="收款标记"
257
                            width="120"/>
258 259 260
                <a:textField name="invoice_apply_num" bindTarget="acr517_invoice_query_ds" prompt="申请编号" width="120"/>
                <a:datePicker name="invoice_date_from" bindTarget="acr517_invoice_query_ds" prompt="发票日期从" width="120"/>
                <a:datePicker name="invoice_date_to" bindTarget="acr517_invoice_query_ds" prompt="发票日期到" width="120"/>
261 262
				<a:comboBox name="full_elec_invoice_flag_n" bindTarget="acr517_invoice_query_ds" prompt="是否全电发票"
                            width="120"/>
263 264 265
            </a:form>
            <a:grid id="acr516_invoice_grid_id" bindTarget="acr517_invoice_result_ds" marginHeight="225" marginWidth="30" navBar="true">
                <a:columns>
266
                    <a:column name="document_number" lock="true" prompt="HLS.DOCUMENT_NUMBER" width="120" renderer="document_number_render"/>
267 268 269
                    <a:column name="contract_number" autoAdjust="false" prompt="HLS.CONTRACT_NUMBER" showTitle="true" width="150"/>
                    <a:column name="contract_name" width="150" prompt="合同名称"/>
                    <a:column name="bp_agent_name" prompt="代理商" width="100"/>
270 271
<!--                    <a:column name="invoice_kind_desc" prompt="发票种类" width="100"/>-->
                    <a:column name="invoice_kind_type_n" prompt="发票种类" width="200"/>
272 273 274 275
                    <a:column name="invoice_number" width="120" prompt="发票号码"/>
                    <a:column name="vat_invoice_code" width="120" prompt="发票代码"/>
                    <a:column name="invoice_date" renderer="Leaf.formatDate" prompt="发票日期" width="100"/>
                    <a:column name="invoice_bp_code" prompt="开票客户编号" width="100"/>
276
<!--                    <a:column name="invoice_bp_name" autoAdjust="false" showTitle="true" prompt="开票客户名称" width="150"/>-->
277 278 279 280
                    <a:column name="invoice_title" autoAdjust="false" showTitle="true" prompt="发票抬头" width="150"/>
                    <a:column name="total_amount" align="right" renderer="Leaf.formatMoney"  prompt="发票金额" width="100"/>
                    <a:column name="tax_amount" align="right" renderer="Leaf.formatMoney" prompt="税额" width="100"/>
                    <a:column name="net_amount" align="right" renderer="Leaf.formatMoney" prompt="不含税金额" width="100"/>
281
<!--                    <a:column name="currency" prompt="币种" width="80"/>-->
282
                    <a:column name="created_by_name" autoAdjust="false" showTitle="true" prompt="创建人" width="150"/>
283 284
<!--                    <a:column name="invoice_status_desc" prompt="发票状态" width="100"/>-->
<!--                    <a:column name="vat_interface_status_desc"  prompt="金税状态" width="100"/>-->
285
                    <a:column name="accounting_date" renderer="Leaf.formatDate" prompt="期间序号" width="100"/>
286
<!--                    <a:column name="create_je_flag" prompt="凭证标志" width="60"/>-->
287
                    <a:column name="bp_tax_registry_num" prompt="纳税人识别号"/>
288 289
<!--                    <a:column name="ele_invoice_status_desc" prompt="电子发票状态"/>-->
<!--                    <a:column name="swno" prompt="电子发票流水号" width="100"/>-->
290
                    <a:column name="claim_status_n" prompt="认领状态" width="100"/>
291 292
                    <a:column name="invoice_apply_num" prompt="申请编号" width="120"/>
                    <a:column name="csh_transaction_flag_desc" prompt="收款标记" width="80"/>
293
					<a:column name="full_elec_invoice_flag_n" prompt="是否全电发票" width="80"/>
294 295 296 297 298
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>