acr_invoice_create_invoice.lviewbak 10.5 KB
Newer Older
lijingjing's avatar
lijingjing committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198
<?xml version="1.0" encoding="UTF-8"?>
<!--
	&author:DJ
	$date:2013/05/08
	$purpose:发票创建
-->
<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <a:model-query model="basic.sys_session_info" rootPath="default_value_record"/>
<!--        <a:model-query model="acr.ACR510.acr_invoice_group_billing_method" rootPath="group_billing_method_list"/>-->
    </a:init-procedure>
    <a:view>
        <a:link id="svcLink_create_invoice" url="${/request/@context_path}/modules/acr/ACR510/acr_invoice_create.lsc"/>
        <!-- <a:screen-include screen="modules/hls/hls_common_javascript.lview"/>-->
        <script type="text/javascript"><![CDATA[

        function createScreen_close() {
            var win = $('acr_invoice_create_invoice');
            win.close();
        }

        function createScreen_create() {
            var win = $('acr_invoice_create_invoice');

            winMask(win);

            var ds = $('headDs');
            if (!ds.validate(true)) {
                f_hls.winNoMask(win);
                return;
            }
            debugger
            var datas = ds.getJsonData();

            winNoMask(win);

            Leaf.showConfirm('${l:HLS.PROMPT}', '是否确认开票?', function () {
                winMask(win);
                Leaf.request({
                    url: $('svcLink_create_invoice').getUrl(),
                    para: datas,
                    success: function (res) {
                        winNoMask(win);
                        createScreen_close();
                        contractDs_grid_query();
                    },
                    failure: function () {
                        winNoMask(win);
                    },
                    error: function () {
                        winNoMask(win);
                    },
                    scope: this
                });
            }, function () {
                winNoMask(win);
            });

        }

        function unSelect_selectedDs(ds, record) {
            record.dirty = false;
        }

        function onSelect_selectedDs(ds, record) {
            record.dirty = true;
        }

        function onLoad_selectedDs(ds) {
            ds.selectAll.defer(5, ds);
            var records = ds.getAll();
            for (var i = 0; i < records.length; i++) {
                if ( records[i].get('cf_item') && records[i].get('cf_item') == '51') {
                    records[i].set('product_name', '保证金');
                    records[i].set('invoice_kind', 'RECEIPT');
                    records[i].set('invoice_kind_desc', '收据');
                }

            }
        }


        function winNoMask() {
            Leaf.Masker.unmask(Ext.getBody());

        }

        function winMask() {
            Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
        }
        ]]></script>
        <style><![CDATA[
			.item-radio-option {
            margin-right: 50px;
        }
        ]]></style>
        <a:dataSets>
            <a:dataSet id="invoiceKindDs" lookupCode="ACR510_INVOICE_KIND"/>
            <a:dataSet id="headDs" autoCreate="true">
                <a:fields>
                    <a:field name="company_id" defaultValue="${/parameter/@company_id}"/>
                    <a:field name="group_billing_method" defaultValue="GROUP_BY_CONTRACT"/>
                    <a:field name="accounting_date" defaultValue="${/model/default_value_record/record/@today}"
                             required="true"/>
                    <a:field name="invoice_date" defaultValue="${/model/default_value_record/record/@today}"
                             required="true"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="selectedDs" autoQuery="true" bindName="line_info" bindTarget="headDs" fetchAll="true"
                       model="acr.ACR510.acr_invoice_create" selectable="true">
                <a:fields>
                    <a:field name="product_name" lovGridHeight="360" lovHeight="540" lovService="acr.ACR510.acr_invoice_create_lov" lovWidth="680" required="true" title="货物及应税劳务名称">
                        <a:mapping>
                            <a:map from="code_value_name" to="product_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="billing_amount" required="true"/>
                    <a:field name="invoice_kind"/>
                    <a:field name="invoice_kind_desc" displayField="code_value_name" options="invoiceKindDs"
                             required="true" returnField="invoice_kind" valueField="code_value"/>
                    <a:field name="billing_object"/>
                    <a:field name="invoice_bp_tax_registry_num" prompt="纳税人识别号"/>
                </a:fields>
                <a:events>
                    <a:event name="load" handler="onLoad_selectedDs"/>
                    <a:event name="select" handler="onSelect_selectedDs"/>
                    <a:event name="unselect" handler="unSelect_selectedDs"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>
        <a:screenBody>
            <a:screenTopToolbar>
                <a:gridButton click="createScreen_close" text="HLS.CLOSE"/>
                <a:gridButton click="createScreen_create" text="HLS.CREATE"/>
            </a:screenTopToolbar>
            <a:form column="3">
                <a:datePicker name="invoice_date" bindTarget="headDs" prompt="ACR.INVOICE_DATE"/>
                <a:datePicker name="accounting_date" bindTarget="headDs" prompt="HLS.ACCOUNT_DATE"/>
            </a:form>
            <a:tabPanel marginHeight="220" marginWidth="30">
                <a:tabs>
                    <a:tab prompt="ACR510.TAB.BILLING_INFO" width="100">
                        <a:grid id="selectedDs_grid" bindTarget="selectedDs" marginHeight="270" marginWidth="60">
                            <a:columns>
                                <a:column name="contract_number" lock="true" width="150" prompt="合同编号" readOnly="true"/>
                                <a:column name="contract_name" lock="true" width="150" prompt="合同名称" readOnly="true"/>
                                <a:column name="bp_name" prompt="承租人名称" readOnly="true"/>
                                <a:column name="times" align="right" lock="true" width="40" prompt="期数" readOnly="true"/>
                                <a:column name="cf_item_desc" prompt="应收项目" readOnly="true"/>
                                <a:column name="product_name" width="150" prompt="货物及应税劳务名称" editor="acr_invoice_create_lov"/>
                                <a:column name="invoice_kind_desc" prompt="发票类型" editor="selectedDs_grid_editor_comb"/>
                                <a:column name="currency" prompt="币种" readOnly="true"/>
                                <a:column name="due_amount" align="right" renderer="Leaf.formatMoney" prompt="应收金额" readOnly="true"/>
                                <a:column name="received_amount" align="right" renderer="Leaf.formatMoney" prompt="已收金额" readOnly="true"/>
                                <a:column name="cf_billing_amount" align="right" renderer="Leaf.formatMoney" prompt="已开票金额" readOnly="true"/>
                                <a:column name="billing_amount" align="right" prompt="本次开票金额" renderer="Leaf.formatMoney"
                                          editor="selectedDs_grid_editor_tf"/>
                            </a:columns>
                            <a:editors>
                                <a:comboBox id="selectedDs_grid_editor_comb"/>
                                <a:textField id="selectedDs_grid_editor_tf"/>
                                <a:lov id="acr_invoice_create_lov"/>
                            </a:editors>
                        </a:grid>
                    </a:tab>
                    <a:tab prompt="ACR510.TAB.ASSIST_INFO" width="100">
                        <a:grid id="selectedDs_grid_2" bindTarget="selectedDs" marginHeight="270" marginWidth="60">
                            <a:columns>
                                <a:column name="contract_number" lock="true" width="150" prompt="合同编号" readOnly="true"/>
                                <a:column name="contract_name" lock="true" width="150" prompt="合同名称" readOnly="true"/>
                                <a:column name="bp_name" prompt="承租人名称" readOnly="true"/>
                                <a:column name="times" align="right" lock="true" width="40" prompt="期数" readOnly="true"/>
                                <a:column name="billing_method" prompt="开票规则" readOnly="true"/>
                                <a:column name="billing_way_n" prompt="开票方式" width="80" readOnly="true"/>
                                <a:column name="billing_frequency_n" prompt="开票频率" width="80" readOnly="true"/>
                                <a:column name="billing_object_name" prompt="开票对象" autoAdjust="false"
                                          showTitle="true" width="200" readOnly="true"/>
                                <a:column name="invoice_title" prompt="发票抬头" autoAdjust="false" editor=""
                                          showTitle="true" width="200" readOnly="true"/>
                                <a:column name="object_taxpayer_type" prompt="纳税人类型" readOnly="true"/>
                                <a:column name="invoice_bp_tax_registry_num" prompt="纳税人识别号" width="150" readOnly="true"/>
                                <a:column name="invoice_bp_address_phone_num" prompt="开票地址电话" autoAdjust="false"
                                          showTitle="true" width="200" readOnly="true"/>
                                <a:column name="invoice_bp_bank_account" prompt="开户行及账号" autoAdjust="false"
                                          showTitle="true" width="150" readOnly="true"/>
                            </a:columns>
                        </a:grid>
                    </a:tab>
                </a:tabs>
            </a:tabPanel>
<!--            <a:fieldSet title="ACR.GROUP_BILLING_METHOD">-->
<!--                <a:radio name="group_billing_method" bindTarget="headDs" labelField="code_value_name"-->
<!--                         options="/model/group_billing_method_list" prompt="" radioSeparator="" valueField="code_value"-->
<!--                         width="600"/>-->
<!--            </a:fieldSet>-->
        </a:screenBody>
    </a:view>
</a:screen>