<div id="tabvalidasi_bb_added_c" style="height:100%; margin:0px; padding:0px;overflow:'hidden'; border: 0px solid #cd0a0a">
	<div id="tabvalidasi_bb_added" style="height:100%;margin:0px; padding:0px;">
		<ul> 
			<li><a id="tab_validasi_bb_added1" href="#div_tab_validasi_bb_added1">MASTER MATERIAL ADDED</a></li>
			<li><a id="tab_validasi_bb_added2" href="#div_tab_validasi_bb_added2">ADJUSTMENT & STO</a></li>
			<li><a id="tab_validasi_bb_added3" href="#div_tab_validasi_bb_added3">MUTASI</a></li>
		
		</ul>
		<div id="div_tab_validasi_bb_added1" >
			<div class="pane-header ui-state-active" id="div_tab_validasi_bb_added_b1" >  
				<button id="btn_bb_added_inland" >Inland Coeff</button> 
				<button id="btn_bb_added_price" >Price</button> 
				<button id="btn_bb_added_upload_master" >Master Proses</button> 
				
			</div>
			<table id="tbl_validasi_bb_added_master"></table> <div id="ptbl_validasi_bb_added_master"></div>
		</div>
		<div id="div_tab_validasi_bb_added2" >
			<div class="pane-header ui-state-active" id="div_tab_validasi_bb_added_b2" >    
				<button id="btn_bb_added_proses_adjustment_daily" >Daily Adjustment</button> 
				<button id="btn_bb_added_proses_adjustment_sto" >STO Adjustment</button>
				<button id="btn_bb_added_proses_sto" > STO </button>
				PERIODE :
				<input type="text" id="tglawalbb_added_adjustment" size=15 value='<?php echo date("Y-m-d", strtotime( date( "Y-m-d", strtotime( date("Y-m-d") ) ) . "-1 month" ) ); ?>' readonly="readonly"/> S.D <input type="text" id="tglakhirbb_added_adjustment" size=15 value='<?php echo date('Y-m-d'); ?>' readonly="readonly"/> 
				<button id="printlaporanbb">Search</button>
				
			</div>
			<table id="grdlaporanmutasibahanbakudanbahanpenolong"></table> <div id="pgrdlaporanmutasibahanbakudanbahanpenolong"> </div>  
			
			
		</div>
		<div id="div_tab_validasi_bb_added3" >
			<div class="pane-header ui-state-active" id="div_tab_validasi_bb_added_b3" >  
				<button id="btn_bb_added_req_15month" >Requirement 1.5 Month</button> 	
				PERIODE :
				<!-- <input type="text" id="tglawalbb_added_mutasi" size=15 value='<?php echo date("Y-m-d", strtotime( date( "Y-m-d", strtotime( date("Y-m-d") ) ) . "-1 month" ) ); ?>' readonly="readonly"/> S.D <input type="text" id="tglakhirbb_added_mutasi" size=15 value='<?php echo date('Y-m-d'); ?>' readonly="readonly"/> -->
				<input type="text" id="tglawalbb_added_mutasi" size=15 value='<?php echo date("Y-m-d", strtotime( date( "Y-m-d", strtotime( date("Y-m-d") ) ) . "-1 month" ) ); ?>' /> S.D <input type="text" id="tglakhirbb_added_mutasi" size=15 value='<?php echo date('Y-m-d'); ?>' /> 
				<button id="printlaporanbb_added_mutasi">Search</button>	
				<button id="printlaporanbb_added_excel">XLS</button>	
						
				
				
				
			</div>
			<table id="grdlaporanmutasibahanbakudanbahanpenolong_mutasi"></table> <div id="pgrdlaporanmutasibahanbakudanbahanpenolong_mutasi"> </div>  
		</div>
	</div>
</div>
<script type="text/javascript">
    $(document).ready(function(){ 
		var tabvalidasi_bb_added_bctive_tab=0;
		setTimeout(function(){
			setGridHight($("#tbl_validasi_bb_added_master"),$("#tabvalidasi_bb_added"),$("#div_tab_validasi_bb_added_b1"),$("#tabvalidasi_bb_added.ui-tabs-nav").height()+50);  
			
		},20); 
		
		$("#tabvalidasi_bb_added" ).tabs({                                                                  
            select:function(event,ui){    
			
				tabvalidasi_bb_added_bctive_tab=ui.index;   
				
				
		 		if (tabvalidasi_bb_added_bctive_tab==0){
					setTimeout(function(){
						setGridHight($("#tbl_validasi_bb_added_master"),$("#tabvalidasi_bb_added"),$("#div_tab_validasi_bb_added_b1"),$("#tabvalidasi_bb_added.ui-tabs-nav").height()+50);  
					},20); 
				}else if (tabvalidasi_bb_added_bctive_tab==1){
					setTimeout(function(){
						setGridHight($("#tbl_validasi_ar_b2"),$("#tabvalidasi_bb_added"),$("#div_tab_validasi_bb_added_b2"),$("#tabvalidasi_bb_added.ui-tabs-nav").height()+50); 
					},20); 
				}else if (tabvalidasi_bb_added_bctive_tab==2){
					setTimeout(function(){
						setGridHight($("#tbl_validasi_ar_b3"),$("#tabvalidasi_bb_added"),$("#div_tab_validasi_bb_added_b3"),$("#tabvalidasi_bb_added.ui-tabs-nav").height()+50); 
					},20); 
				}
			}                                                                          
         });   		
			 
			 
		$(window).bind('resize', function() {  
				if (tabvalidasi_bb_added_bctive_tab==0){
					setTimeout(function(){
						setGridHight($("#tbl_validasi_bb_added_master"),$("#tabvalidasi_bb_added"),$("#div_tab_validasi_bb_added_b1"),$("#tabvalidasi_bb_added.ui-tabs-nav").height()+50);  
					},100); 
				}else if (tabvalidasi_bb_added_bctive_tab==1){
					setTimeout(function(){
						setGridHight($("#tbl_validasi_ar_b2"),$("#tabvalidasi_bb_added"),$("#div_tab_validasi_bb_added_b2"),$("#tabvalidasi_bb_added.ui-tabs-nav").height()+50); 
					},100); 
				}else if (tabvalidasi_bb_added_bctive_tab==1){
					setTimeout(function(){
						setGridHight($("#tbl_validasi_ar_b3"),$("#tabvalidasi_bb_added"),$("#div_tab_validasi_bb_added_b3"),$("#tabvalidasi_bb_added.ui-tabs-nav").height()+50); 
					},100); 
				}
		});
		
		
		var currentDate = new Date(); 
		var datesetopt = {
			showOn: "button",
			buttonImageOnly: true,
			buttonImage: "<?php echo base_url()."assets/images/icons/16x16/timespan.png"  ?>",
			buttonText: "Tanggalan",
			dateFormat: 'yy-mm-dd'
		};
		
		$("#tglawalbb_added_adjustment").datepicker(datesetopt);
		$("#tglakhirbb_added_adjustment").datepicker(datesetopt); 
		
		jQuery("#tbl_validasi_bb_added_master").jqGrid({
			url:'<?php echo base_url().'settings/ct_barangbahanbaku_added/loadData'; ?>',
			mtype : "post",
			postData:{'q':'1'},
			datatype: "json",
			colNames:['id', 'part no','part name', 'part name customs', 'part_name_added',
			'hs code','part_no_sap', 'currency',  'order_number', 'newpart', 'shipment_term', 'supplier',
			'bm','cek price', 'part no2', 'kodebarang','kod supplier', 'uom'],
			colModel:[
				{name:'id',index:'id', width:60, hidden:true},
				{name:'part_no',index:'part_no', width:179},
				{name:'part_name',index:'part_name', width:186},
				{name:'part_name_customs',index:'part_name_customs', width:185, hidden:false},
				{name:'part_name_added',index:'part_name_added', width:186},
				{name:'hs_code',index:'hs_code', width:84,hidden:false},
				{name:'part_no_sap',index:'part_no_sap', width:147},
				{name:'currency',index:'currency', width:107},
				{name:'order_number',index:'order_number', width:147},
				{name:'new_part',index:'new_part', width:147},
				{name:'shipment_term',index:'shipment_term', width:107},
				{name:'supplier',index:'supplier', width:217},
				{name:'bm',index:'bm', width:39, hidden:false, align:"right"},
				{name:'cek_price',index:'cek_price', width:72, align:"right"},
				{name:'part_no2',index:'part_no2', width:147},
				{name:'kode_barang',index:'kode_barang', width:147},
				{name:'supplier_kode',index:'supplier_kode', width:84,hidden:false},
				{name:'uom',index:'uom', width:84,hidden:false},
				
				],
			rowNum:15,
			rowList:[15,25,35,50,100],
			pager: '#ptbl_validasi_bb_added_master',
			sortname: 'id',
			viewrecords: true,
			sortorder: "asc",
			width: '',
			height:330,
			jsonReader: { repeatitems : false },
			caption:"Data Part HS",
			rownumbers: true,
			shrinkToFit: false,
			afterInsertRow: function(){
				
				
			},			
			gridComplete: function(){
				
			},
		}); 
			
                        
		jQuery("#tbl_validasi_bb_added_master").jqGrid('navGrid','#ptbl_validasi_bb_added_master',{del:false,add:false,edit:false},{},{},{},{multipleSearch:false});
		jQuery("#tbl_validasi_bb_added_master").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : true, defaultSearch: 'cn', ignoreCase: true});
		
		
		
		$("#btn_bb_added_inland").button().click(function(){
			$("#bb_added_inland_dataindlg").load('<?php echo base_url().'settings/ct_barangbahanbaku_added/view_bahanbaku_added_inland_master'; ?>',  {parmeter:'parameter'}, function() {
				$("#bb_added_inland_dataindlg").dialog({
					modal:true,
					width : 900,
					height : 530,
					buttons: {
                        "Close": function() {  
							$(".ui-dialog-titlebar-close").trigger('click');  
							
						}
                    },
					close : function(){
						$('#bb_added_inland_dataindlg').dialog("destroy"); 
					    $(".bb_added_inland_dataindlg_cl").remove(); 
					    $("body").append('<div id="bb_added_inland_dataindlg" title="DATA IN MESIN DAN PERALATAN KANTOR" class="bb_added_inland_dataindlg_cl"></div>'); 
						
					},
					open: function(){
						$("body").unblock();
						
					}
				});
			});	
			
			
		});	
		$("#btn_bb_added_price").button().click(function(){
			var form_data = {
				bulan : $("#validasi_ap_wh_month_periode_bb_added").val(),
				tahun : $("#validasi_ap_wh_year_periode_bb_added").val(),
				tipe : 'a1'
				
			}
			
			$("#frm_upload_bb_added_pricedlg").load('<?php echo base_url().'settings/ct_barangbahanbaku_added/view_bahanbaku_added_upload_price'; ?>',  form_data, function() {
				$("#frm_upload_bb_added_pricedlg").dialog({
					modal:true,
					width : 900,
					height : 530,
					buttons: {
                        "Close": function() {  
							$(".ui-dialog-titlebar-close").trigger('click');  
							
						}
                    },
					close : function(){
						$('#frm_upload_bb_added_pricedlg').dialog("destroy"); 
					    $(".frm_upload_bb_added_pricedlg_cl").remove(); 
					    $("body").append('<div id="frm_upload_bb_added_pricedlg" title="PRICE UPDATE" class="frm_upload_bb_added_pricedlg_cl"></div>'); 
						$('#tbl_validasi_ap_a1').trigger('reloadGrid');
	
					},
					open: function(){
						$("body").unblock();
						
					}
				});
			});
			
			
			
		});	
		$("#btn_bb_added_upload_master").button().click(function(){
			var form_data = {
				bulan : $("#validasi_ap_wh_month_periode_bb_added").val(),
				tahun : $("#validasi_ap_wh_year_periode_bb_added").val(),
				tipe : 'a1'
				
			}
			
			$("#frm_upload_bb_added_masterdlg").load('<?php echo base_url().'settings/ct_barangbahanbaku_added/view_bahanbaku_added_upload_master'; ?>',  form_data, function() {
				$("#frm_upload_bb_added_masterdlg").dialog({
					modal:true,
					width : 900,
					height : 530,
					buttons: {
                        "Close": function() {  
							$(".ui-dialog-titlebar-close").trigger('click');  
							
						}
                    },
					close : function(){
						$('#frm_upload_bb_added_masterdlg').dialog("destroy"); 
					    $(".frm_upload_bb_added_masterdlg_cl").remove(); 
					    $("body").append('<div id="frm_upload_bb_added_masterdlg" title="MASTER UPDATE" class="frm_upload_bb_added_masterdlg_cl"></div>'); 
						$('#tbl_validasi_ap_a1').trigger('reloadGrid');
	
					},
					open: function(){
						$("body").unblock();
						
					}
				});
			});
			
			
		});		
		
		$("#btn_bb_added_req_15month").button().click(function(){
			var form_data = {
				//bulan : $("#validasi_ap_wh_month_periode_bb_added").val(),
				//tahun : $("#validasi_ap_wh_year_periode_bb_added").val(),
				tipe : 'REQUIREMENT'
				
			}
			
			$("#frm_upload_bb_added_requirement15dlg").load('<?php echo base_url().'settings/ct_barangbahanbaku_added/view_bahanbaku_added_upload_requirement'; ?>',  form_data, function() {
				$("#frm_upload_bb_added_requirement15dlg").dialog({
					modal:true,
					width : 900,
					height : 530,
					buttons: {
                        "Close": function() {  
							$(".ui-dialog-titlebar-close").trigger('click');  
							
						}
                    },
					close : function(){
						$('#frm_upload_bb_added_requirement15dlg').dialog("destroy"); 
					    $(".frm_upload_bb_added_requirement15dlg_cl").remove(); 
					    $("body").append('<div id="frm_upload_bb_added_requirement15dlg" title="REQUIREMENT UPDATE" class="frm_upload_bb_added_requirement15dlg_cl"></div>'); 
						$('#tbldata_bb_added_adjustment_daily').trigger('reloadGrid');
	
					},
					open: function(){
						$("body").unblock();
						
					}
				});
			});
			
			
		});
		
		$("#btn_bb_added_proses_adjustment_daily").button().click(function(){
			var form_data = {
				//bulan : $("#validasi_ap_wh_month_periode_bb_added").val(),
				//tahun : $("#validasi_ap_wh_year_periode_bb_added").val(),
				tipe : 'ADJUSTMENT_DAILY'
				
			}
			
			$("#frm_upload_bb_added_adjustment_dailydlg").load('<?php echo base_url().'settings/ct_barangbahanbaku_added/view_bahanbaku_added_upload_adjustment_daily'; ?>',  form_data, function() {
				$("#frm_upload_bb_added_adjustment_dailydlg").dialog({
					modal:true,
					width : 900,
					height : 530,
					buttons: {
                        "Close": function() {  
							$(".ui-dialog-titlebar-close").trigger('click');  
							
						}
                    },
					close : function(){
						$('#frm_upload_bb_added_adjustment_dailydlg').dialog("destroy"); 
					    $(".frm_upload_bb_added_adjustment_dailydlg_cl").remove(); 
					    $("body").append('<div id="frm_upload_bb_added_adjustment_dailydlg" title="ADJUSTMENT_DAILY UPDATE" class="frm_upload_bb_added_adjustment_dailydlg_cl"></div>'); 
						$('#tbldata_bb_added_adjustment_daily').trigger('reloadGrid');
	
					},
					open: function(){
						$("body").unblock();
						
					}
				});
			});
			
			
			
			
		});
		
		
		jQuery("#grdlaporanmutasibahanbakudanbahanpenolong").jqGrid({
		        
				url:'<?php echo base_url().'settings/ct_barangbahanbaku_added/data_reportcustomsmutasibahanbakudanbahanpenolong'; ?>',
				datatype: "json",
				mtype: 'POST',
				postData:{'q':'1','caritanggal':'ya', 'tglawalbb':$("#tglawalbb_added_adjustment").val(),'tglakhirbb':$("#tglakhirbb_added_adjustment").val()},
				colNames:[
				'No'
				,'part no'
				,'part no2'
				,'partno sap'
				,'part name'
				,'part name2'
				,'new part'
				,'ship term'
				,'supplier'
				,'supp kode'
				,'qty in daily adjustment'
				,'amount in daily adjustment'
				,'qty out daily adjustment'
				,'amount out daily adjustment'
				,'qty adjustment sto'
				,'amount adjustment sto'
				], 
				colModel:[
					{name:'no',index:'no', width:34},
					{name:'part_no',index:'part_no', width:103,  align:"left"},
					{name:'part_no2',index:'part_no2', width:103, align:"left"},
					{name:'part_no_sap',index:'part_no_sap', width:103, align:"left"},
					{name:'part_name',index:'part_name', width:153, align:"left"},
					{name:'part_name2',index:'part_name2', width:153, align:"left"},
					{name:'new_part',index:'new_part', width:96, align:"left"},
					{name:'shipment_term',index:'shipment_term', width:96, align:"left"},
					{name:'supplier',index:'supplier', width:193, align:"left"},
					{name:'supplier_kode',index:'supplier_kode', width:96, align:"left"},
					{name:'qty_in_daily_adjustment',index:'qty_in_daily_adjustment', width:96, align:"right"},
					{name:'amount_in_daily_adjustment',index:'amount_in_daily_adjustment', width:96, align:"right"},
					{name:'qty_out_daily_adjustment',index:'qty_out_daily_adjustment', width:96, align:"right"},
					{name:'amount_out_daily_adjustment',index:'amount_out_daily_adjustment', width:96, align:"right"},
					{name:'qty_adjustment_sto',index:'qty_adjustment_sto', width:96, align:"right"},
					{name:'amount_adjustment_sto',index:'amount_adjustment_sto', width:96, align:"right"}
					
				],  
				rowNum:30,
				rowList:[30,100,300],
				pager: '#pgrdlaporanmutasibahanbakudanbahanpenolong',
				sortname: 'part_no',
				viewrecords: true,
				sortorder: "asc",
				width: 1080,
				height:280,
				shrinkToFit: false,
				jsonReader: { repeatitems : false },
			    caption:"MUTASI MATERIAL",
			//	rownumbers: true,
			
		}); 
		
		jQuery("#grdlaporanmutasibahanbakudanbahanpenolong").jqGrid('navGrid','#pgrdlaporanmutasibahanbakudanbahanpenolong',{edit:false,add:false,del:false,view:true});
		jQuery("#grdlaporanmutasibahanbakudanbahanpenolong").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : true, defaultSearch: 'cn', ignoreCase: true});
		
			
		 $( "#printlaporanbb" ).button().click(function(){
		 
			var form_data = {
				'q':'1',
				'caritanggal':'ya',
				'tglawalbb':$("#tglawalbb_added_adjustment").val(),
				'tglakhirbb':$("#tglakhirbb_added_adjustment").val()
			};
			jQuery("#grdlaporanmutasibahanbakudanbahanpenolong").jqGrid('setGridParam', { postData:form_data });
			$("#grdlaporanmutasibahanbakudanbahanpenolong").trigger("reloadGrid");
		 
		 }); 	
		
		$("#btn_bb_added_proses_adjustment_sto").button().click(function(){
			var form_data = {
				//bulan : $("#validasi_ap_wh_month_periode_bb_added").val(),
				//tahun : $("#validasi_ap_wh_year_periode_bb_added").val(),
				tipe : 'ADJUSTMENT_STO'
				
			}
			
			$("#frm_upload_bb_added_adjustment_stodlg").load('<?php echo base_url().'settings/ct_barangbahanbaku_added/view_bahanbaku_added_upload_adjustment_sto'; ?>',  form_data, function() {
				$("#frm_upload_bb_added_adjustment_stodlg").dialog({
					modal:true,
					width : 900,
					height : 530,
					buttons: {
                        "Close": function() {  
							$(".ui-dialog-titlebar-close").trigger('click');  
							
						}
                    },
					close : function(){
						$('#frm_upload_bb_added_adjustment_stodlg').dialog("destroy"); 
					    $(".frm_upload_bb_added_adjustment_stodlg_cl").remove(); 
					    $("body").append('<div id="frm_upload_bb_added_adjustment_stodlg" title="ADJUSTMENT_STO UPDATE" class="frm_upload_bb_added_adjustment_stodlg_cl"></div>'); 
						$('#tbldata_bb_added_adjustment_sto').trigger('reloadGrid');
	
					},
					open: function(){
						$("body").unblock();
						
					}
				});
			});
			
			
		});
		
		
		jQuery("#grdlaporanmutasibahanbakudanbahanpenolong_mutasi").jqGrid({
		        
				url:'<?php echo base_url().'settings/ct_barangbahanbaku_added/data_reportcustomsmutasibahanbakudanbahanpenolong'; ?>',
				datatype: "json",
				mtype: 'POST',
				postData:{'q':'1','caritanggal':'ya', 'tglawalbb':$("#tglawalbb_added_mutasi").val(),'tglakhirbb':$("#tglakhirbb_added_mutasi").val()},
				colNames:[
				'No'
				,'part no'
				,'part no2'
				,'partno sap'
				,'part name'
				,'part name2'
				,'new part'
				,'ship term'
				,'supplier'
				,'supp kode'
				
				,'inland koefisien'
				,'purchase price'
				,'purchase price usd'
				,'purchase price eur'
				,'purchase price idr'
				,'costing price usd'
				,'currency part number'
				,'uom'
				,'begin balance qty'
				,'begin balance usd'
				,'price adjustment'
				,'in qty'
				,'in usd'
				,'out qty'
				,'out usd'
				,'end system qty'
				,'end system usd'
				,'end sto qty'
				,'end sto usd'

				,'qty in daily adjustment'
				,'amount in daily adjustment'
				,'qty out daily adjustment'
				,'amount out daily adjustment'
				,'qty adjustment sto'
				,'amount adjustment sto'
				], 
				colModel:[
					{name:'no',index:'no', width:34},
					{name:'part_no',index:'part_no', width:103,  align:"left"},
					{name:'part_no2',index:'part_no2', width:103, align:"left"},
					{name:'part_no_sap',index:'part_no_sap', width:103, align:"left"},
					{name:'part_name',index:'part_name', width:153, align:"left"},
					{name:'part_name2',index:'part_name2', width:153, align:"left"},
					{name:'new_part',index:'new_part', width:96, align:"left"},
					{name:'shipment_term',index:'shipment_term', width:96, align:"left"},
					{name:'supplier',index:'supplier', width:193, align:"left"},
					{name:'supplier_kode',index:'supplier_kode', width:96, align:"left"},
					
					{name:'inland_koefisien',index:'inland_koefisien', width:96, align:"right"},
					{name:'purchase_price_usd_amount',index:'purchase_price_usd_amount', width:96, align:"right"},
					{name:'purchase_price_usd',index:'purchase_price_usd', width:96, align:"right"},
					{name:'purchase_price_eur',index:'purchase_price_eur', width:96, align:"right"},
					{name:'purchase_price_idr',index:'purchase_price_idr', width:96, align:"right"},
					{name:'costing_price_usd',index:'costing_price_usd', width:96, align:"right"},
					{name:'currency_part_number',index:'currency_part_number', width:96},
					{name:'uom',index:'uom', width:96},
					{name:'begin_balance_qty',index:'begin_balance_qty', width:96, align:"right"},
					{name:'begin_balance_usd',index:'begin_balance_usd', width:96, align:"right"},
					{name:'price_adjustment',index:'price_adjustment', width:96, align:"right"},
					{name:'in_qty',index:'in_qty', width:96, align:"right"},
					{name:'in_usd',index:'in_usd', width:96, align:"right"},
					{name:'out_qty',index:'out_qty', width:96, align:"right"},
					{name:'out_usd',index:'out_usd', width:96, align:"right"},
					{name:'end_system_qty',index:'end_system_qty', width:96, align:"right"},
					{name:'end_system_usd',index:'end_system_usd', width:96, align:"right"},
					{name:'end_sto_qty',index:'end_sto_qty', width:96, align:"right"},
					{name:'end_sto_usd',index:'end_sto_usd', width:96, align:"right"},
					
					{name:'qty_in_daily_adjustment',index:'qty_in_daily_adjustment', width:96, align:"right"},
					{name:'amount_in_daily_adjustment',index:'amount_in_daily_adjustment', width:96, align:"right"},
					{name:'qty_out_daily_adjustment',index:'qty_out_daily_adjustment', width:96, align:"right"},
					{name:'amount_out_daily_adjustment',index:'amount_out_daily_adjustment', width:96, align:"right"},
					{name:'qty_adjustment_sto',index:'qty_adjustment_sto', width:96, align:"right"},
					{name:'amount_adjustment_sto',index:'amount_adjustment_sto', width:96, align:"right"}
					
				],  
				rowNum:30,
				rowList:[30,100,300],
				pager: '#pgrdlaporanmutasibahanbakudanbahanpenolong_mutasi',
				sortname: 'part_no',
				viewrecords: true,
				sortorder: "asc",
				width: 1080,
				height:280,
				shrinkToFit: false,
				jsonReader: { repeatitems : false },
			    caption:"MUTASI MATERIAL",
			//	rownumbers: true,
			
		}); 
		
		jQuery("#grdlaporanmutasibahanbakudanbahanpenolong_mutasi").jqGrid('navGrid','#pgrdlaporanmutasibahanbakudanbahanpenolong_mutasi',{edit:false,add:false,del:false,view:true});
		jQuery("#grdlaporanmutasibahanbakudanbahanpenolong_mutasi").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : true, defaultSearch: 'cn', ignoreCase: true});
		
		
		$("#btn_bb_added_proses_sto").button().click(function(){
			var form_data = {
				//bulan : $("#validasi_ap_wh_month_periode_bb_added").val(),
				//tahun : $("#validasi_ap_wh_year_periode_bb_added").val(),
				tipe : 'STO'
				
			}
			
			$("#frm_upload_bb_added_stodlg").load('<?php echo base_url().'settings/ct_barangbahanbaku_added/view_bahanbaku_added_upload_sto'; ?>',  form_data, function() {
				$("#frm_upload_bb_added_stodlg").dialog({
					modal:true,
					width : 900,
					height : 530,
					buttons: {
                        "Close": function() {  
							$(".ui-dialog-titlebar-close").trigger('click');  
							
						}
                    },
					close : function(){
						$('#frm_upload_bb_added_stodlg').dialog("destroy"); 
					    $(".frm_upload_bb_added_stodlg_cl").remove(); 
					    $("body").append('<div id="frm_upload_bb_added_stodlg" title="STO UPDATE" class="frm_upload_bb_added_stodlg_cl"></div>'); 
						$('#tbldata_bb_added_adjustment_sto').trigger('reloadGrid');
	
					},
					open: function(){
						$("body").unblock();
						
					}
				});
			});
			
			
		});
		
		$("#printlaporanbb_added_mutasi").button().click(function(){
			
			var form_data = {
				'q':'1',
				'caritanggal':'ya',
				'tglawalbb':$("#tglawalbb_added_mutasi").val(),
				'tglakhirbb':$("#tglawalbb_added_mutasi").val()
			};
			jQuery("#grdlaporanmutasibahanbakudanbahanpenolong_mutasi").jqGrid('setGridParam', { postData:form_data });
			$("#grdlaporanmutasibahanbakudanbahanpenolong_mutasi").trigger("reloadGrid");	
			
			
		});
		
		
		$("#printlaporanbb_added_excel").button().click(function(){
			
			document.location.href = '<?php echo base_url().'settings/ct_barangbahanbaku_added/material_report_excel'; ?>'+'?tglawalbb='+$("#tglawalbb_added_mutasi").val()+'&tglakhirbb='+$("#tglkhirbb_added_mutasi").val()
			
		});
		
		
	});	
		  	
</script>
<div id="frm_upload_bb_added_masterdlg" title="MASTER UPDATE" class="frm_upload_bb_added_masterdlg_cl"></div>
<div id="bb_added_inland_dataindlg" title="MASTER KOEFISIEN" class="bb_added_inland_dataindlg_cl"></div>
<div id="frm_upload_bb_added_pricedlg" title="PRICE UPDATE" class="frm_upload_bb_added_pricedlg_cl"></div>
<div id="frm_upload_bb_added_adjustment_dailydlg" title="ADJUSTMENT_DAILY UPDATE" class="frm_upload_bb_added_adjustment_dailydlg_cl"></div>
<div id="frm_upload_bb_added_adjustment_stodlg" title="ADJUSTMENT_STO UPDATE" class="frm_upload_bb_added_adjustment_stodlg_cl"></div>
<div id="frm_upload_bb_added_requirement15dlg" title="REQUIREMENT 1.5" class="frm_upload_bb_added_requirement15dlg_cl"></div>
<div id="frm_upload_bb_added_stodlg" title="STO UPDATE" class="frm_upload_bb_added_stodlg_cl"></div>