receipts_details_write.lview 8.69 KB
Newer Older
Spencer Chang's avatar
Spencer Chang 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
<?xml version="1.0" encoding="UTF-8"?>

<a:screen xmlns:a="http://www.leaf-framework.org/application" trace="true">
    <a:init-procedure>
        <a:model-query fetchAll="true" model="cont.CON1240.con_get_period" rootPath="sys_default_time"/>
    </a:init-procedure>
    <a:view>
        <script type="text/javascript"><![CDATA[
        function receipts_details_query() {
            $('receipts_details_grid_ds').query();
        }

        function receipts_details_reset(){
            $('receipts_details_form_ds').reset();
        }

        function receipts_details_export() {
            $('source_to_grid')._export(null,'收款明细查询(二)');
        }
        function aut_authority_list_validate_query(ds, qpara) {
            qpara['authority_flag'] = 'Y';
            qpara['contract_ref_content_flag'] = 'Y';
            qpara['trx_category'] = 'CONTRACT';
            qpara['trx_id'] = 't1.contract_id';

        }

        function summaryRenderer(datas, name) {
            var sum = 0;
            var sum1 = 0;
            var sum2 = 0;
            var sum3 = 0;
            if (name == "write_off_classification_n") {
                return '<font color="red">合计:</font>';
            }
            if (name == "write_off_due_amount") {
                for (var i = 0; i < datas.length; i++) {
                    var record = datas[i];
                    var payment_amount_vl = record.get("write_off_due_amount");
                    var payment_amount = parseFloat(payment_amount_vl);
                    if (!isNaN(payment_amount)) {
                        sum += payment_amount;
                    }
                }
                return '<font color="red">' + Leaf.formatNumber(sum, 2) + '</font>';
            }
            if (name == "write_off_principal") {
                for (var i = 0; i < datas.length; i++) {
                    var record = datas[i];
                    var payment_amount_vl = record.get("write_off_principal");
                    var payment_amount = parseFloat(payment_amount_vl);
                    if (!isNaN(payment_amount)) {
                        sum += payment_amount;
                    }
                }
                return '<font color="red">' + Leaf.formatNumber(sum, 2) + '</font>';
            }
            if (name == "write_off_interest") {
                for (var j = 0; j < datas.length; j++) {
                    var record1 = datas[j];
                    var payment_amount_vl1 = record1.get("write_off_interest");
                    var payment_amount1 = parseFloat(payment_amount_vl1);
                    if (!isNaN(payment_amount1)) {
                        sum1 += payment_amount1;
                    }
                }
                return '<font color="red">' + Leaf.formatNumber(sum1, 2) + '</font>';
            }
        }

        ]]></script>

        <a:dataSets>
            <a:dataSet id="receipts_details_form_ds">
                <a:fields>
                    <a:field name="bp_name" autoComplete="true" lovGridHeight="350" lovHeight="500" lovService="cont.CON1250.con_bp_query" lovWidth="500" title="HLS.BP_TITLE">
                        <a:mapping>
                            <a:map from="bp_name" to="bp_name"/>
                            <a:map from="bp_code" to="bp_code"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="contract_number" lovGridHeight="400" lovHeight="500" lovLabelWidth="100" lovService="cont.CON1250.receipts_details_contract" lovWidth="500"  title="合同编号">
                        <a:mapping>
                            <a:map from="contract_number" to="contract_number"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_agent_name" lovGridHeight="330" lovHeight="470" lovLabelWidth="120" lovService="cont.CON1250.con_bp_agent_query" lovWidth="700" title="代理商">
                        <a:mapping>
                            <a:map from="bp_agent_name" to="bp_agent_name"/>
                        </a:mapping>
                    </a:field>
                    <a:field name="bp_code"/>
                    <a:field name="journal_date_from" defaultValue="${/model/sys_default_time/record/@month_first_day}"/>
                    <a:field name="journal_date_to" defaultValue="${/model/sys_default_time/record/@now_date}"/>
                    <a:field name="__async__"  defaultValue="Y" prompt="异步导出"/>
                </a:fields>
            </a:dataSet>
            <a:dataSet id="receipts_details_grid_ds" autoQuery="false"
                       model="cont.CON1250.receipts_detail_write"
                       queryDataSet="receipts_details_form_ds" selectable="true" selectionModel="single" autoPageSize="false" pageSize="100">
                <a:events>
                    <a:event  name="query" handler="aut_authority_list_validate_query"/>
                </a:events>
            </a:dataSet>
        </a:dataSets>

        <a:screenBody>
            <a:screenTopToolbar>
                <a:screenTitle/>
                <a:gridButton click="receipts_details_query" text="查询"/>
                <a:gridButton click="receipts_details_reset" text="重置"/>
                <a:gridButton click="receipts_details_export" text="导出"/>
            </a:screenTopToolbar>
            <a:form column="4" marginWidth="100" title="查询条件">
                <a:lov name="contract_number" bindTarget="receipts_details_form_ds" prompt="合同编号" />
                <a:lov name="bp_name" bindTarget="receipts_details_form_ds" prompt="客户名称" />
                <a:lov name="bp_agent_name" bindTarget="receipts_details_form_ds" prompt="代理商名称" />
                <a:textField name="transaction_num" bindTarget="receipts_details_form_ds" prompt="现金事务编号" />
                <a:datePicker name="transaction_date_from" bindTarget="receipts_details_form_ds" prompt="收款日期从" />
                <a:datePicker name="transaction_date_to" bindTarget="receipts_details_form_ds" prompt="收款日期到" />
                <a:datePicker name="due_date_from" bindTarget="receipts_details_form_ds" prompt="应收日期从" />
                <a:datePicker name="due_date_to" bindTarget="receipts_details_form_ds" prompt="应收日期到" />
                <a:datePicker name="journal_date_from" bindTarget="receipts_details_form_ds" prompt="核销日期从" />
                <a:datePicker name="journal_date_to" bindTarget="receipts_details_form_ds" prompt="核销日期到" />
                <a:numberField name="csh_write_off_amount_sum_from" bindTarget="receipts_details_form_ds" prompt="总核销金额从"/>
                <a:numberField name="csh_write_off_amount_sum_to" bindTarget="receipts_details_form_ds" prompt="总核销金额到"/>
            </a:form>
            <a:grid id="source_to_grid" bindTarget="receipts_details_grid_ds" navBar="true" height="400" marginWidth="100">
                <a:columns>
                    <a:column name="contract_number" prompt="合同编号" width="120"/>
                    <a:column name="bp_name" prompt="合同客户名" width="120"/>
                    <a:column name="bp_agent_name" prompt="合同代理商" width="120"/>
                    <a:column name="transaction_date"  prompt="收款日期" width="100" renderer="Leaf.formatDate"/>
                    <a:column name="cf_item_n" prompt="核销现金流" />
                    <a:column name="times" prompt="核销期数" width="80"/>
Darming's avatar
Darming committed
136
<!--                    <a:column name="write_off_classification_n"  prompt="核销分类" width="100" footerRenderer="summaryRenderer"/>-->
Spencer Chang's avatar
Spencer Chang committed
137 138 139 140 141 142 143 144 145 146 147 148 149
                    <a:column name="write_off_due_amount"  prompt="核销金额" width="100" renderer="Leaf.formatMoney" footerRenderer="summaryRenderer"/>
                    <a:column name="write_off_principal"  prompt="核销本金" width="100" renderer="Leaf.formatMoney" footerRenderer="summaryRenderer"/>
                    <a:column name="write_off_interest"  prompt="核销利息" width="100" renderer="Leaf.formatMoney" footerRenderer="summaryRenderer"/>
                    <a:column name="due_date"  prompt="应收日期" width="100" renderer="Leaf.formatDate"/>
                    <a:column name="journal_date"  prompt="核销基准日期" width="100" renderer="Leaf.formatDate"/>
                    <a:column name="write_off_date"  prompt="核销日期" width="100" renderer="Leaf.formatDate"/>
                    <a:column name="transaction_num"  prompt="现金事务编号" width="100"/>
                    <a:column name="csh_write_off_amount_sum"  prompt="总核销金额" width="100" renderer="Leaf.formatMoney" footerRenderer="summaryRenderer"/>
                </a:columns>
            </a:grid>
        </a:screenBody>
    </a:view>
</a:screen>