<?php

use App\Http\Controllers\MainAcontroller;
use App\Http\Controllers\BillRenderController;
 
?>

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title></title>

    <style>
        * {
            box-sizing: border-box;
        }

        /* Create three equal columns that floats next to each other */
        .column {

            float: left;
            width: 33.33%;
            padding-top: 10px;
            padding-bottom: 10px;
            height: 130px;
            /* Should be removed. Only for demonstration */
        }

        /* Clear floats after the columns */
        .row:after {
            content: "";
            display: table;
            clear: both;
        }

        .pTextIng {
            font-size: 10px;
            margin: 0;
            padding: 0;
            width: 80px;
            display: inline-block;
        }

        .pTextIngRight {
            font-size: 10px;
            margin: 0;
            padding: 0;
            width: 50px;
            display: inline-block;
        }

        .pTextPor {
            font-size: 10px;
            width: 80px;
            height: auto;
            display: inline-block;
        }

        .pTextPorTime {
            font-size: 10px;
            height: auto;
            width: 150px;
            display: inline-block;
        }

        .center {
            text-align: center;
        }

        .centerimg {
            display: block;
            margin-left: auto;
            margin-right: auto;
            width: 50%;
        }

        th {
            border-left: 1px solid black;
            border-right: 1px solid black;

            font-style: normal;
            font-size: 10px;
            color: white;
            background-color: black;
        }

        td {
            padding-left: 2px;
            padding-left: 2px;
            border-left: 1px solid grey;
            border-right: 1px solid grey;

            font-style: normal;
            font-size: 10px;
            color: black;

        }

        td1 {
            border: 1px solid black;

            font-style: normal;
            font-size: 10px;
            color: black;

        }

        table {
            border-collapse: collapse;
            width: 100%;
        }

        p {
            font-size: 10px;
            margin: 0;
            padding: 0;
            width: 80px;
            display: inline-block;
        }

        p1 {
            font-size: 10px;
            margin: 0;
            padding: 0;
            width: 120px;
            display: inline-block;
        }

        p2 {
            font-size: 10px;
            margin: 0;
            padding: 0;

            display: inline-block;
        }
    </style>

</head>

<body>


    <div style="border: 1px solid; border-color: black ;" class="row">

        <!-- https://api.digitronicsindia.com/aswas/public/uploads/billlogo/50/ACP.png -->




        <div style="padding-left: 10px;" class="column">

        

        </div>

        <div class="column">

            <div style="text-align: center;">

                <h4> STOCK REPORT </h4>
                <label>{{ $client }}</label>
                <label style="font-size: 13px;">{{ $area }} , {{ $location }}</label>
                <label style="font-size: 13px;">{{ $phone }}</label>
               
            </div>

        </div>

        <div style="padding-left: 15px;" class="column">
           
        </div>



    </div>

    <table style="table-layout: auto; width: 100%;" border="1" frame="below above columns">

        <thead>

            <tr>
                <th align="center" style="width:5%; column-rule: 4px double white;" scope="col">SL NO</th>

                <th align="center" style="width:40%" scope="col">Product Name</th>

                <th align="center" style="width:5%" scope="col">Manufacturer</th>

                <th align="center" style="width:5%" scope="col">Batch</th>
                
                <th align="center" style="width:5%" scope="col">Stock</th>
                
                <th align="center" style="width:5%" scope="col">Pack</th>
                
                <th align="center" style="width:5%" scope="col">Expiry</th>
                
                <th align="center" style="width:5%" scope="col">P.R</th>
                
                <th align="center" style="width:5%" scope="col">P.R.T</th>
                
                <th align="center" style="width:5%" scope="col">MRP</th>
                
                <th align="center" style="width:5%" scope="col">MRP/P</th>

                <th align="center" style="width:5%" scope="col">S.R.T</th>

                <th align="center" style="width:5%" scope="col">GST</th>

            </tr>

        </thead>

        <tbody>
            <?php $num = 1; ?>
            @foreach( $items as $item )
            <tr>
                <td align="center">{{ $num }}</td>

                <td align="left">{{ $item->Product_Name }} </td>
                
                <td align="center">{{ $item->manufacturer }}</td>

                <td align="center"> {{ $item->Batch }} </td>
                
                <td align="center"> {{ $item->Purchase_quantity - $item->Sales_quantity }}  </td>
                
                <td align="center"> {{ $item->uPack }} </td>
                
                <td align="center"> <?php echo MainAcontroller::convertDatetoExpiry($item->Expiry)?> </td>
                
                <td align="center">{{ $item->Unit_Rate }}</td>
                
                <td align="center">{{ $item->Unit_Rate  * ($item->Purchase_quantity - $item->Sales_quantity) }}</td>
                
                <td align="center">{{ $item->MRP }}</td>
                
                <td align="center">{{ $item->MRP * $item->uPack }}</td>

                <td align="center">{{ $item->Sales_Rate  * ($item->Purchase_quantity - $item->Sales_quantity) }}</td>

                <td align="center">{{ $item->GST }}</td>

            </tr>
            <?php $num++; ?>
            @endforeach
        </tbody>

    </table>
</body>
</html>