@include('admin::layouts.header')
<?php
use App\Models\Categories;
use App\Models\Supliers;
use App\Models\Products;
?>
<main id="main-container">
        <!-- Hero -->
        <div class="bg-body-light">
          <div class="content content-full">
            <div class="d-flex flex-column flex-sm-row justify-content-sm-between align-items-sm-center">
              <h1 class="flex-grow-1 fs-3 fw-semibold my-2 my-sm-3">Returns</h1>
              <nav class="flex-shrink-0 my-2 my-sm-0 ms-sm-3" aria-label="breadcrumb">
                <ol class="breadcrumb">
                  <li class="breadcrumb-item">Dashboard</li>
                  <li class="breadcrumb-item">GRN</li>
                  <li class="breadcrumb-item active" aria-current="page">Returns</li>
                </ol>
              </nav>
            </div>
          </div>
        </div>
        <!-- END Hero -->

        <!-- Page Content -->
        <div class="content">
          <!-- Your Block -->
          <div class="block block-rounded">
            <div class="block-header block-header-default">
              <h3 class="block-title">Returns</h3>
            </div>
            <div class="block-content">
            @if(Session::has('success')) <div class="alert alert-success mt-2 mb-2">{{ Session::get('success') }}</div>@endif
            @if(Session::has('fail')) <div class="alert alert-danger mt-2 mb-2">{{ Session::get('fail') }}</div>@endif
            <table  id="example" class="custom-datatable-no-export display responsive nowrap" style="width:100%">
                <thead>
                  <tr>
                  <th>GRN Number</th>
                  <th>Quantity</th>
                  <th>Return Reason</th>
                  <th>Return Date</th>
                  <th>Authorized By</th>
                  <th>Actions</th>
                  </tr>
                </thead>
                <tbody>
                <?php foreach($returns as $return) {

                ?>
                  <tr>

                    <td class="fw-semibold">
                    {{ $return->grn_number}}
                    </td>
                    <td class="fw-semibold">
                    {{ $return->quantity}}
                    </td>
                    <td class="fw-semibold">
                    {{$return->return_reason}}
                    </td>
                    <td class="fw-semibold">
                    {{$return->return_date}}
                    </td>
                    <td class="fw-semibold">
                    {{$return->authorized_by}}
                    </td>
                    <td class="text-center">
                        <div class="btn-group">
                        <a href="{{ url('admin/edit-return/'.$return->id.'') }}" ><button type="button" class="btn btn-sm btn-alt-primary js-bs-tooltip-enabled" data-bs-toggle="tooltip" aria-label="Edit" data-bs-original-title="Edit">
                            <i class="fa fa-pencil-alt"></i>
                          </button></a>
                        </div>
                      </td>
                  </tr>
                <?php } ?>
                </tbody>
              </table>
            </div>
          </div>
          <!-- END Your Block -->
        </div>
        <!-- END Page Content -->
</main>
<!-- END Main Container -->
@include('admin::layouts.footer')