<script type="text/javascript">

Highcharts.chart('container3', {
    chart: {
        type: 'column'
    },
    title: {
        text: 'Rekapitulasi Dokumen Bea Cukai'
    },
    subtitle: {
        text: ''
    },
    credits: {
          enabled: false
    },
    xAxis: {
        type: 'category'
    },
    yAxis: {
        title: {
            text: 'Total Dokumen'
        }

    },
    legend: {
        enabled: false
    },
    plotOptions: {
        series: {
            borderWidth: 0,
            dataLabels: {
                enabled: true,
                format: '{point.y}'
            }
        }
    },

    tooltip: {
        headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
        pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y}</b> of total<br/>'
    },

    series: [
        {
            name: "Bea Cukai",
            colorByPoint: true,
            data: [
                {
                    name: "BC 2.3",
                    y: <?php echo $bc[0]->BC23?>
                },
                {
                    name: "BC 3.0",
                    y: <?php echo $bc[0]->BC30?>
                },
                {
                    name: "BC 2.7 In",
                    y: <?php echo $bc[0]->BC27In?>
                },
                {
                    name: "BC 2.7 Out",
                    y: <?php echo $bc[0]->BC27Out?>
                },
                {
                    name: "BC 2.6.1",
                    y: <?php echo $bc[0]->BC261?>
                },
                {
                    name: "BC 2.6.2",
                    y: <?php echo $bc[0]->BC262?>
                },
                {
                    name: "BC 2.4",
                    y: <?php echo $bc[0]->BC24?>
                },
                {
                    name: "BC 2.5",
                    y: <?php echo $bc[0]->BC25?>
                },
                {
                    name: "BC 4.0",
                    y: <?php echo $bc[0]->BC40?>
                },
                {
                    name: "BC 4.1",
                    y: <?php echo $bc[0]->BC41?>
                },
               
            ]
        }
    ]
});
$(document).ready(function() {
    $('#company').on('click',function(){
         document.title = $(this).attr('id');
    });
});

	$('#dg_gridpo').datagrid({
		title:'PENDING PURCHASE ORDER',
		width:'100%',
		height:200,
		style:{margin:-1,padding:10},
		fitColumns:true,
		rownumbers:true,
		striped:true,
		singleSelect:true,
		columns:[[
			{field:'po_no',title:'NO.PURCHASE ORDER',width:80,align:'center'},
			{field:'Supplier',title:'SUPPLIER',width:80,align:'center'},
			{field:'po_date',title:'ISSUE DATE',width:80,align:'center'},
			{field:'due_date',title:'DUE DATE',width:80,align:'center'}
		]],
        url: '<?=site_url('main/datagridpo'); ?>'
	});

	$('#dg_gridso').datagrid({
		title:'PENDING SALES ORDER',
		width:'100%',
		height:200,
		style:{margin:-1,padding:10},
		fitColumns:true,
		rownumbers:true,
		striped:true,
		singleSelect:true,
		columns:[[
			{field:'po_no',title:'NO.SALES ORDER',width:80,align:'center'},
			{field:'Customer',title:'CUSTOMER',width:80,align:'center'},
			{field:'po_date',title:'ISSUE DATE',width:80,align:'center'},
			{field:'due_date',title:'DUE DATE',width:80,align:'center'}
		]],
        url: '<?=site_url('main/datagridso'); ?>'
	});

	$('#dg_gridbc').datagrid({
		title:'PENDING BEA CUKAI',
		width:'100%',
		height:200,
		style:{margin:-1,padding:10},
		fitColumns:true,
		rownumbers:true,
		striped:true,
		singleSelect:true,
		columns:[[
			{field:'Dok_no',title:'NO.DOC',width:80,align:'center'},
			{field:'Perusahaan',title:'PERUSAHAN',width:80,align:'center'},
            {field:'matin_date',title:'ISSUE DATE',width:80,align:'center'},
            {field:'dokumen',title:'DOKUMEN',width:80,align:'center'}
		]],
        url: '<?=site_url('main/datagridbc'); ?>'
	});

	Highcharts.chart('pendingpo', {
    chart: {
        type: 'column'
    },
    title: {
        text: 'ALL PENDING'
    },
    subtitle: {
        text: ''
    },
    credits: {
          enabled: false
    },
    xAxis: {
        type: 'category'
    },
    yAxis: {
        title: {
            text: 'Total'
        }

    },
    legend: {
        enabled: false
    },
    plotOptions: {
        series: {
            borderWidth: 0,
            pointWidth: 20,
            dataLabels: {
                enabled: true,
                format: '{point.y}'
            }
        }
    },

    tooltip: {
        headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
        pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y}</b> of total<br/>'
    },

    series: [
        {
            name: "ALL PENDING",
            colorByPoint: true,
            data: [
                {
                    name: "Pending PO",
                    y: <?php echo $po[0]->PendingPo?>
                },
				{
                    name: "Pending SO",
                    y: <?php echo $so[0]->PendingSo?>
                },
				{
                    name: "Incoming",
                    y: <?php echo $ig[0]->Incoming?>
                },
                {
                    name: "Outgoing",
                    y: <?php echo $og[0]->Outgoing?>
                }
            ]
        }
    ]
});
</script>