<div id="tabvalidasi_ar_c" style="height:100%; margin:0px; padding:0px;overflow:'hidden'; border: 0px solid #cd0a0a">
	<div id="tabvalidasi_ar" style="height:100%;margin:0px; padding:0px;">
		<ul> 
			<li><a id="tab_validasi_ar_b1" href="#div_tab_validasi_ar_b1">VALIDASI B1</a></li>
			<li><a id="tab_validasi_ar_b2" href="#div_tab_validasi_ar_b2">VALIDASI B2</a></li>
			<li><a id="tab_validasi_ar_b3" href="#div_tab_validasi_ar_b3">VALIDASI B3</a></li>
		</ul>
		<div id="div_tab_validasi_ar_b1" >
			<div class="pane-header ui-state-active" id="div_tab_validasi_ar_bar_b1" >  
				
				PERIODE: <select id="validasi_ar_wh_month_periode_b1" style="height:20px" >
						<option value="01">JAN</option>
						<option value="02">FEB</option>
						<option value="03">MAR</option>
						<option value="04">APR</option>
						<option value="05">MEI</option>
						<option value="06">JUN</option>
						<option value="07">JUL</option>
						<option value="08">AGS</option>
						<option value="09">SEP</option>
						<option value="10">OKT</option>
						<option value="11">NOV</option>
						<option value="12">DES</option>
					</select>
					<select id="validasi_ar_wh_year_periode_b1" style="height:20px" >
						<?php   
							for($index=date('Y');$index > date('Y')-10;$index-=1) {	
						?>
							<option value="<?php echo $index;  ?>"><?php echo $index;  ?></option>
						
						<?php
							}
						?>
					</select>
					<button type="button" id="search_validasi_ar_wh_periode_b1">Search</button> 
				<button type="button" id="search_validasi_ar_wh_get_data_b1">GET Ceisa</button> 
				
				
			</div>
			<table id="tbl_validasi_ap_b1"></table> <div id="ptbl_validasi_ap_b1"></div>
		</div>
		<div id="div_tab_validasi_ar_b2" >
			<div class="pane-header ui-state-active" id="div_tab_validasi_ar_bar_b2" >    
				PERIODE: <select id="bulan_period_coa" style="height:15px" >
							<option value="01">JAN</option>
							<option value="02">FEB</option>
							<option value="03">MAR</option>
							<option value="04">APR</option>
							<option value="05">MEI</option>
							<option value="06">JUN</option>
							<option value="07">JUL</option>
							<option value="08">AGS</option>
							<option value="09">SEP</option>
							<option value="10">OKT</option>
							<option value="11">NOV</option>
							<option value="12">DES</option>
						</select>
				<select id="tahun_period_coa" style="height:15px" >
					<?php   
						for($index=date('Y');$index > date('Y')-10;$index-=1) {	
					?>
						<option value="<?php echo $index;  ?>"><?php echo $index;  ?></option>
					
					<?php
						}
					?>
				</select>
				<button id="search_validasi_ar_wh_periode_b2" >Search</button> 
			</div>
			<table id="tbl_validasi_ap_b2"></table> <div id="ptbl_validasi_ap_b2"></div>
			
		</div>
		<div id="div_tab_validasi_ar_b3" >
			<div class="pane-header ui-state-active" id="div_tab_validasi_ar_bar_b3" >    
				PERIODE: <select id="bulan_period_coa" style="height:15px" >
							<option value="01">JAN</option>
							<option value="02">FEB</option>
							<option value="03">MAR</option>
							<option value="04">APR</option>
							<option value="05">MEI</option>
							<option value="06">JUN</option>
							<option value="07">JUL</option>
							<option value="08">AGS</option>
							<option value="09">SEP</option>
							<option value="10">OKT</option>
							<option value="11">NOV</option>
							<option value="12">DES</option>
						</select>
				<select id="tahun_period_coa" style="height:15px" >
					<?php   
						for($index=date('Y');$index > date('Y')-10;$index-=1) {	
					?>
						<option value="<?php echo $index;  ?>"><?php echo $index;  ?></option>
					
					<?php
						}
					?>
				</select>
				<button id="search_validasi_ar_wh_periode_b3" >Search</button> 
			</div>
			<table id="tbl_validasi_ap_b3"></table> <div id="ptbl_validasi_ap_b3"></div>
			
		</div>
	</div>
</div>
<script type="text/javascript">
    
    $(document).ready(function(){ 
		var tabvalidasi_ar_active_tab=0;
		setTimeout(function(){
			setGridHight($("#tbl_validasi_ap_b1"),$("#tabvalidasi_ar"),$("#div_tab_validasi_ar_bar_b1"),$("#tabvalidasi_ar.ui-tabs-nav").height()+70);  
			
		},20); 
		
		$("#tabvalidasi_ar" ).tabs({                                                                  
            select:function(event,ui){    
			
				tabvalidasi_ar_active_tab=ui.index;   
				
				
		 		if (tabvalidasi_ar_active_tab==0){
					setTimeout(function(){
						setGridHight($("#tbl_validasi_ap_b1"),$("#tabvalidasi_ar"),$("#div_tab_validasi_ar_bar_b1"),$("#tabvalidasi_ar.ui-tabs-nav").height()+70);  
					},20); 
				}else if (tabvalidasi_ar_active_tab==1){
					setTimeout(function(){
						setGridHight($("#tbl_validasi_ap_b2"),$("#tabvalidasi_ar"),$("#div_tab_validasi_ar_bar_b2"),$("#tabvalidasi_ar.ui-tabs-nav").height()+70); 
					},20); 
				}
			}                                                                          
         });   		
			 
			 
		$(window).bind('resize', function() {  
				if (tabvalidasi_ar_active_tab==0){
					setTimeout(function(){
						setGridHight($("#tbl_validasi_ap_b1"),$("#tabvalidasi_ar"),$("#div_tab_validasi_ar_bar_b1"),$("#tabvalidasi_ar.ui-tabs-nav").height()+70);  
					},100); 
				}else if (tabvalidasi_ar_active_tab==1){
					setTimeout(function(){
						setGridHight($("#tbl_validasi_ap_b2"),$("#tabvalidasi_ar"),$("#div_tab_validasi_ar_bar_b2"),$("#tabvalidasi_ar.ui-tabs-nav").height()+70); 
					},100); 
				}
		});
		
		
		jQuery("#tbl_validasi_ap_b1").jqGrid({
			url:'<?php echo base_url().'accounting_report/ct_accounting_report/data_validasi_tax_ar'; ?>',
			mtype : "post",
			postData:{'q':'1','tipe_pajak':'B1'},
			datatype: "json",
			colNames:
			[
			'id_b123',
			'BKP/KJP',
			'NPWP',
			'NOMOE/KD SERI',
			'TGL',
			'DPP',
			'PPN',
			'PPN BM',
			'CAR',
			'NOBC',
			'TGL BC',
			'TYPE BC',
			'TYPE PAJAK'
			
			],
			colModel:[
				{name:'id_b123',index:'id_b123', width:60, hidden:true},
				{name:'pemberi_jkp',index:'pemberi_jkp', width:60},
				{name:'npwp',index:'npwp', width:160},
				{name:'kode_no_seri',index:'kode_no_seri', width:230, hidden:false},
				{name:'tgl',index:'tgl', tgl:96,hidden:false},
				{name:'dpp',index:'dpp', width:120,hidden:false, align:'right', formatter:'number',hidden:false},
				{name:'ppn',index:'ppn', width:120,hidden:false, align:'right', formatter:'number',hidden:false},
				{name:'ppnbm',index:'ppnbm', width:120,hidden:false, align:'right', formatter:'number',hidden:false},
				{name:'car',index:'car', width:150,hidden:false},
				{name:'nobc',index:'nobc', width:105,hidden:false},
				{name:'tglbc',index:'tglbc', width:96,hidden:false},
				{name:'tipe_bc',index:'tipe_bc', width:84,hidden:false},
				{name:'tipe_pajak',index:'tipe_pajak' , width:100, hidden:false}
				
				],
			rowNum:20,
			rowList:[20,50,100],
			pager: '#ptbl_validasi_ap_b1',
			sortname: 'tgl',
			viewrecords: true,
			sortorder: "desc",
			width: '',
			height:300,
			jsonReader: { repeatitems : false },
			caption:"DATA VALIDASI B1",
			rownumbers: true,
			shrinkToFit: false,
			afterInsertRow: function(){
				
				
			},			
			gridComplete: function(){
				var rowIDs = jQuery("#tbl_validasi_ap_b1").getDataIDs(); 
				var rowData = $("#tbl_validasi_ap_b1").getRowData();
			
				for (var i = 0; i < rowData.length; i++) 
				{
				   var trElement = jQuery("#"+ rowIDs[i],jQuery('#tbl_validasi_ap_b1'));
				   
					switch (rowData[i].status_data) {
						
						case 'PROSESEXIM':
						   trElement.css({"color":"green"});
						break;
						case 'PROCESSEDBC':
						   trElement.css({"color":"blue"});
						break;
						
						
					}
				}
			},
			//footerrow: true, // set a footer row
			//userDataOnFooter: true,
		}); 
			
                        
		jQuery("#tbl_validasi_ap_b1").jqGrid('navGrid','#ptbl_validasi_ap_b1',{del:false,add:false,edit:false},{},{},{},{multipleSearch:false});
		jQuery("#tbl_validasi_ap_b1").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : true, defaultSearch: 'cn', ignoreCase: true});
		
		
		jQuery("#tbl_validasi_ap_b2").jqGrid({
			url:'<?php echo base_url().'accounting_report/ct_accounting_report/data_v_acc_ar_inv'; ?>',
			mtype : "post",
			postData:{'q':'1'},
			datatype: "json",
			colNames:
			[
			
			'INVNO',
			'INVDATE',
			'GL_ACC',
			'PERIOD',
			'DEBIT',
			'CREDIT',
			'BALANCE',
			'DEBIT_USD',
			'CREDIT_USD',
			'BALANCE_USD',
			
			'CAR',
			'NODAFT',
			'TGDAFT',
			'typedok'
			],
			colModel:[
				
				{name:'INVNO',index:'INVNO', width:160},
				{name:'INVDATE',index:'INVDATE', width:100, hidden:false},
				{name:'GL_ACC',index:'GL_ACC', width:100,hidden:false},
				{name:'PERIOD',index:'PERIOD', width:120,hidden:false},
				{name:'DEBIT',index:'DEBIT', width:184,hidden:false, align:'right', formatter:'number'},
				{name:'CREDIT',index:'CREDIT', width:184,hidden:false, align:'right', formatter:'number'},
				{name:'BALANCE',index:'BALANCE', width:184,hidden:false, align:'right', formatter:'number'},
				{name:'DEBIT_USD',index:'DEBIT_USD', width:184,hidden:false, align:'right', formatter:'number'},
				{name:'CREDIT_USD',index:'CREDIT_USD', width:184,hidden:false, align:'right', formatter:'number'},
				{name:'BALANCE_USD',index:'BALANCE_USD', width:184,hidden:false, align:'right', formatter:'number'},
				
				{name:'CAR',index:'CAR', width:120,hidden:false},
				{name:'NODAFT',index:'NODAFT', width:120,hidden:false},
				{name:'TGDAFT',index:'TGDAFT', width:120,hidden:false},
				{name:'typedok',index:'typedok', width:120,hidden:false},
				
				
				],
			rowNum:20,
			rowList:[20,50,100],
			pager: '#ptbl_validasi_ap_b2',
			sortname: 'INVDATE',
			viewrecords: true,
			sortorder: "desc",
			width: '',
			height:300,
			jsonReader: { repeatitems : false },
			caption:"DATA KAS OUT",
			rownumbers: true,
			shrinkToFit: false,
			afterInsertRow: function(){
				
				
			},			
			gridComplete: function(){
				var rowIDs = jQuery("#tbl_validasi_ap_b2").getDataIDs(); 
				var rowData = $("#tbl_validasi_ap_b2").getRowData();
			
				for (var i = 0; i < rowData.length; i++) 
				{
				   var trElement = jQuery("#"+ rowIDs[i],jQuery('#tbl_validasi_ap_b2'));
				   
					switch (rowData[i].status_data) {
						
						case 'PROSESEXIM':
						   trElement.css({"color":"green"});
						break;
						case 'PROCESSEDBC':
						   trElement.css({"color":"blue"});
						break;
						
						
					}
				}
			},
		}); 
			
                        
		jQuery("#tbl_validasi_ap_b2").jqGrid('navGrid','#ptbl_validasi_ap_b2',{del:false,add:false,edit:false},{},{},{},{multipleSearch:false});
		jQuery("#tbl_validasi_ap_b2").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : true, defaultSearch: 'cn', ignoreCase: true});
		
		
		
		
		
		$("#search_validasi_ar_wh_periode_b1").button().click(function(){
			var form_data = {
				periode:$("#validasi_ar_wh_year_periode_b1").val()+$("#validasi_ar_wh_month_periode_b1").val()
			};
			jQuery("#tbl_validasi_ap_b1").jqGrid('setGridParam', { postData:form_data });
			$('#tbl_validasi_ap_b1').trigger('reloadGrid');
			
			
		});
		
		$("#search_validasi_ar_wh_get_data_b1").button().click(function(){
			
			var form_data = {
				bulan : $("#validasi_ar_wh_month_periode_b1").val(),
				tahun : $("#validasi_ar_wh_year_periode_b1").val(),
				
			}
			
			$("#frmvalidasi_ceisa_ardlg").load('<?php echo base_url().'accounting_report/ct_accounting_report/view_validasi_ceisa_ar'; ?>',  form_data, function() {
				$("#frmvalidasi_ceisa_ardlg").dialog({
					modal:true,
					width : 1000,
					height : 520,
					buttons: {
                        "Close": function() {  
							$(".ui-dialog-titlebar-close").trigger('click');  
							
						}
                    },
					close : function(){
						$('#frmvalidasi_ceisa_ardlg').dialog("destroy"); 
					    $(".frmvalidasi_ceisa_ardlg_cl").remove(); 
					    $("body").append('<div id="frmvalidasi_ceisa_ardlg" title="MATCHING DATA CEISA" class="frmvalidasi_ceisa_ardlg_cl"></div>'); 
						$('#tbl_validasi_ap_b1').trigger('reloadGrid');
	
					},
					open: function(){
						$("body").unblock();
						
					}
				});
			});
			
			
		});	
		
		$("#search_validasi_ar_wh_periode_b2").button().click(function(){
			var form_data = {
				periode:$("#validasi_ar_wh_year_periode_b2").val()+$("#validasi_ar_wh_month_periode_b2").val()
			};
			jQuery("#tbl_validasi_ap_b2").jqGrid('setGridParam', { postData:form_data });
			$('#tbl_validasi_ap_b2').trigger('reloadGrid');
			
			
		});
		
		
	});
		  	
</script>
<div id="frmvalidasi_ceisa_ardlg" title="MATCHING DATA CEISA" class="frmvalidasi_ceisa_ardlg_cl"></div>

