<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:ctp="http://www.w3.org/1999/xhtml">
    <head th:replace="_fragments :: head('View Finish Item')"></head>
    <body>
        <div class="container-fluid">
            <header class="row page-header" th:replace="_fragments :: page-header"></header>
            <main class="row page-main">
                <div class="col-sm">
                    <table class="table table-bordered w-auto" th:object="${bundle}">
                        <thead class="thead-dark">
                            <tr>
                                <th colspan="2" class="text-center">
                                    <span th:text="*{ 'BUNDLE-' + id}"></span>
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td width="200"><i>Item ID</i></td>
                                <td th:text="*{itemId}"></td>
                            </tr>
                            <tr>
                                <td><i>Sku</i></td>
                                <td th:text="*{sku}"></td>
                            </tr>
                            <tr>
                                <td><i>Type</i></td>
                                <td th:text="*{type}"></td>
                            </tr>
                            <tr>
                                <td><i>Wrap Quantity</i></td>
                                <td th:text="*{wrapQuantity}"></td>
                            </tr>
                            <tr>
                                <td><i>Barcode</i></td>
                                <td th:text="*{barcode}"></td>
                            </tr>
                            <tr>
                                <td><i>Created By</i></td>
                                <td th:text="*{createdBy}"></td>
                            </tr>
                            <tr>
                                <td><i>Created At</i></td>
                                <td ctp:formatdatetime="*{createdAt}"></td>
                            </tr>
                            <tr th:if="*{masterBundleId != 0 and masterBundle != null}">
                                <td><i>Master Bundle</i></td>
                                <td class="p-0">
                                    <table>
                                        <thead>
                                            <tr>
                                                <th>ID</th>
                                                <th>Item ID</th>
                                                <th>Sku</th>
                                                <th>Job Card ID</th>
                                                <th>Generated By</th>
                                                <th>Stitching Status</th>
                                                <th>Production</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td th:text="*{masterBundle.id}"></td>
                                                <td th:text="*{masterBundle.itemId}"></td>
                                                <td th:text="*{masterBundle.sku}"></td>
                                                <td th:text="*{masterBundle.jobCardId}"></td>
                                                <td><span th:text="*{masterBundle.createdBy}"></span> @ <span
                                                        ctp:formatdatetime="*{masterBundle.createdAt}"></span></td>
                                                <td>
                                                    <span th:if="*{ not masterBundle.isReceived}" class="badge badge-danger">NOT RECEIVED</span>
                                                    <div th:if="*{masterBundle.isReceived}">
                                                        <span class="badge badge-APPROVED">RECEIVED</span>
                                                    </div>
                                                </td>
                                                <td><span th:text="*{masterBundle.totalProduction}"></span> out of <span th:text="*{masterBundle.expectedProduction}"></span></td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </main>
        </div>
    </body>
</html>