



<?php $__env->startSection('title', 'Inventory Dashboard'); ?>


<?php $__env->startSection('internal-js'); ?>
    <script>
        $(document).ready(function () {

        });

        window.onload = function () {
            var chart = new CanvasJS.Chart("chartContainer", {
                animationEnabled: true,
                exportEnabled: true,
                theme: "light2",
                title: {
                    text: "<?php echo e($year); ?> Monthly Inventory Report"
                },
                axisX: {
                    valueFormatString: "MMM"
                },
                axisY: {
                    prefix: "<?php echo e($currency->abbr ?? ''); ?> ",
                    labelFormatter: addSymbols
                },
                toolTip: {
                    shared: true
                },
                legend: {
                    cursor: "pointer",
                    itemclick: toggleDataSeries
                },
                data: [
                    {
                        type: "column",
                        name: "Total Purchases",
                        showInLegend: true,
                        xValueFormatString: "MMMM YYYY",
                        yValueFormatString: "<?php echo e($currency->abbr ?? ''); ?> #,##0",
                        dataPoints: [
                            { x: new Date(<?php echo e($year); ?>, 0), y: <?php echo e($janData['purchases']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 1), y: <?php echo e($febData['purchases']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 2), y: <?php echo e($marData['purchases']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 3), y: <?php echo e($aprData['purchases']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 4), y: <?php echo e($mayData['purchases']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 5), y: <?php echo e($junData['purchases']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 6), y: <?php echo e($julData['purchases']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 7), y: <?php echo e($augData['purchases']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 8), y: <?php echo e($sepData['purchases']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 9), y:  <?php echo e($octData['purchases']); ?>},
                            { x: new Date(<?php echo e($year); ?>, 10), y: <?php echo e($novData['purchases']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 11), y: <?php echo e($decData['purchases']); ?> }
                        ]
                    },
                    {
                        type: "line",
                        name: "Total Sales",
                        showInLegend: true,
                        yValueFormatString: "<?php echo e($currency->abbr ?? ''); ?> #,##0",
                        dataPoints: [
                            { x: new Date(<?php echo e($year); ?>, 0), y: <?php echo e($janData['sales']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 1), y: <?php echo e($febData['sales']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 2), y: <?php echo e($marData['sales']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 3), y: <?php echo e($aprData['sales']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 4), y: <?php echo e($mayData['sales']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 5), y: <?php echo e($junData['sales']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 6), y: <?php echo e($julData['sales']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 7), y: <?php echo e($augData['sales']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 8), y: <?php echo e($sepData['sales']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 9), y:  <?php echo e($octData['sales']); ?>},
                            { x: new Date(<?php echo e($year); ?>, 10), y: <?php echo e($novData['sales']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 11), y: <?php echo e($decData['sales']); ?> }
                        ]
                    },
                    {
                        type: "area",
                        name: "Profit on Sold Items",
                        markerBorderColor: "white",
                        markerBorderThickness: 2,
                        showInLegend: true,
                        yValueFormatString: "<?php echo e($currency->abbr ?? ''); ?> #,##0",
                        dataPoints: [
                            { x: new Date(<?php echo e($year); ?>, 0), y: <?php echo e($janData['profit']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 1), y: <?php echo e($febData['profit']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 2), y: <?php echo e($marData['profit']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 3), y: <?php echo e($aprData['profit']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 4), y: <?php echo e($mayData['profit']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 5), y: <?php echo e($junData['profit']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 6), y: <?php echo e($julData['profit']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 7), y: <?php echo e($augData['profit']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 8), y: <?php echo e($sepData['profit']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 9), y:  <?php echo e($octData['profit']); ?>},
                            { x: new Date(<?php echo e($year); ?>, 10), y: <?php echo e($novData['profit']); ?> },
                            { x: new Date(<?php echo e($year); ?>, 11), y: <?php echo e($decData['profit']); ?> }
                        ]
                    }]
            });
            chart.render();

            function addSymbols(e) {
                var suffixes = ["", "K", "M", "B"];
                var order = Math.max(Math.floor(Math.log(e.value) / Math.log(1000)), 0);

                if(order > suffixes.length - 1)
                    order = suffixes.length - 1;

                var suffix = suffixes[order];
                return CanvasJS.formatNumber(e.value / Math.pow(1000, order)) + suffix;
            }

            function toggleDataSeries(e) {
                if (typeof (e.dataSeries.visible) === "undefined" || e.dataSeries.visible) {
                    e.dataSeries.visible = false;
                } else {
                    e.dataSeries.visible = true;
                }
                e.chart.render();
            }
        }
    </script>

<?php $__env->stopSection(); ?>


<?php $__env->startSection('internal-css'); ?>

<?php $__env->stopSection(); ?>


<?php $__env->startSection('headers'); ?>
    <?php echo $__env->make('headers.inventory-header', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>


<?php $__env->startSection('heading', 'Inventory Dashboard'); ?>
<?php $__env->startSection('done-by', ''); ?>


<?php $__env->startSection('content'); ?>

    <div id="chartContainer" style="height: 300px; width: 100%;"></div>
    <div class="guestDetails_inputDivider"></div><br>

<?php $__env->stopSection(); ?>



<?php $__env->startSection('modal_heading'); ?>
    <h1>Inventory Dashboard</h1>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('modal_title'); ?>
    <h3><u>Dashboard Functionalities</u></h3>
    <ol><b>
            <li>View Inventory Report per Month</li>
            <li>Manage Inventory</li>
        </b>
    </ol>
<?php $__env->stopSection(); ?>





<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/zedarroot/public_html/edwulp/resources/views/modules/stock-dash.blade.php ENDPATH**/ ?>