<?xml version="1.0" encoding="UTF-8"?>
<a:screen xmlns:a="http://www.leaf-framework.org/application" customizationEnabled="true" dynamiccreateenabled="true"
          trace="true">
    <a:init-procedure/>
    <a:view>

        <a:link id="con_contract_get_layout_code_link_id" model="cont.CON500.con_contract_get_layout_code"
                modelaction="update"/>
        <a:link id="business_write_detail_link" model="cont.CON3100N.business_write_detail_report"
                modelaction="execute"/>
        <script src="${/request/@context_path}/javascripts/hap/dynamicStopAutoQuery.js" type="text/javascript"/>
        <script type="text/javascript"><![CDATA[


        window['${/parameter/@bp_seq}${/parameter/@layout_code}_on_layout_dynamic_update'] = function(ds, record, name, value, old_value, bp_seq) {
           if(name=='transaction_date_from' &&value){
               if(!record.get('transaction_date_to')){
                   record.set('transaction_date_to',value)
               }
           }else if(name=='journal_date_from' && value){
               if(!record.get('journal_date_to')){
                   record.set('journal_date_to',value)

               }
           }
        };

        /*window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
            var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_cashflow');
             var form_ds_id = '${/parameter/@layout_code}_F_QUERY__ds';

            Leaf.Masker.mask(Ext.getBody(), '${l:HLS.EXECUTING}');
            Leaf.request({
                url: $('business_write_detail_link').getUrl(),
                para: {},
                success: function() {
                    $(ds_id).setQueryUrl('${/request/@context_path}/autocrud/cont.CON3100N.business_write_detail_report/query');
                    $(ds_id).setQueryDataSet($(form_ds_id));
                    Leaf.Masker.unmask(Ext.getBody());
                    $(ds_id).query();
                },
                failure: function() {
                    Leaf.Masker.unmask(detail_mask);
                },
                error: function() {
                    Leaf.Masker.unmask(detail_mask);
                },
                scope: this
            });
        }*/


        window['${/parameter/@layout_code}_user_button1_layout_dynamic_click'] = function() {
            var ds_id = get_dsid_by_basetable(window['${/parameter/@layout_code}_layoutDataSetList'], 'con_contract_cashflow');
            var form_ds_id = '${/parameter/@layout_code}_F_QUERY__ds';
            $(ds_id).setQueryUrl('${/request/@context_path}/autocrud/cont.CON3100N.csh_write_detail_report/query');
            $(ds_id).setQueryDataSet($(form_ds_id));
            Leaf.Masker.unmask(Ext.getBody());
            $(ds_id).query();
        };

       // stopDymanicAutoQuery('${/parameter/@layout_code}', 'F_WRITE_OFF_LIST', 'con_contract_cashflow');

        ]]></script>
        <a:screen-include screen="modules/cont/CON500/con_contract_get_layout_code.lview"/>
    </a:view>
</a:screen>
