<div class="box">
  <div class="box-header with-border">
    <h3 class="box-title">{{ trans('purchases.products_order')}}</h3>
  </div>
  <!-- /.box-header -->
  <div class="box-body">
    <table class="table">
      <thead>
        <tr>
          <th>{{ trans('products.sku')}}</th>
          <th>{{ trans('products.name')}}</th>
          <th>{{ trans('products.amount')}}</th>
          <th>{{ trans('products.price')}}</th>
          <th>{{ trans('invoices.total')}}</th>
        </tr>
      </thead>
      <tbody>
        <?php
          $total = 0;
         ?>
        @foreach($products as $product)
          <?php
            $total += $product->amount * $product->price_in;
           ?>
          <tr>
            <td>{{ $product->sku }}</td>
            <td>{{ $product->name}}</td>
            <td>{{ $product->amount}}</td>
            <td>{{ money($product->price_in)}}</td>
            <td>{{ money($product->amount * $product->price_in)}}</td>
          </tr>
        @endforeach

        <tr>
          <td colspan="3" rowspan="3" id="merge">
          </td>
          <td><b>Sub Total</b></td>
          <td>{{ money($total)}}</td>
        </tr>
        <tr>
          <td><b>Tax</b></td>
          <td>{{ $detail->tax }} %</td>
        </tr>
        <tr>
          <td><b>Total</b></td>
          <td>{{ money($detail->total)}}</td>
        </tr>
      </tbody>
    </table>
  </div>
</div>
