<table class="line-table" style="overflow: wrap" autosize="1">
    <thead>
        <tr>
            <th width="5%">No</th>
            <th class="stock-code" width="10%">Stock Code</th>
            <th class="description">Description</th>
            <th width="10%">Quantity</th>
        </tr>
    </thead>

    <tbody>
    @php
        $totalQuantity = 0;
    @endphp

    @if (!empty($po_order_transaction) && $po_order_transaction->transactionDetails)
        @foreach ($po_order_transaction->transactionDetails as $key => $transaction_detail)
            @php
                $totalQuantity += $transaction_detail->quantity;
            @endphp

            <tr>
                <td width="5%" class="center top">{{ $key + 1 }}</td>
                <td class="stock-code top" width="10%">
                    {{ $transaction_detail->product_code }}
                </td>
                <td class="description">
                    {{ $transaction_detail->product_name }}
                </td>
                <td width="10%" class="right">
                    {{ $transaction_detail->quantity }}
                </td>
            </tr>
        @endforeach
    @endif
    </tbody>

    <tfoot>
        <tr>
            <td colspan="2"></td>
            <td class="right middle"><strong>Total Quantity</strong></td>
            <td class="total right middle">
                <strong>{{ $totalQuantity }}</strong>
            </td>
        </tr>
    </tfoot>
</table>
