<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head th:replace="_fragments :: head('Home Page')"></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"  th:fragment="cardFragment">
      <div th:replace="_notices :: page-notices"></div>
      <form th:action="@{ ${purchaseOrderCTP.id} ? ('/purchase-order/edit/' + ${purchaseOrderCTP.id}) : '/purchase-order/edit' }"
            method="POST"
            th:object="${purchaseOrderCTP}"
            id="purchaseOrderApp">
        <input hidden="hidden" th:field="*{id}">
        <input hidden="hidden" th:field="*{order}">
        <div class="bg-light p-3 mb-3">
          <h6 class="mb-3">Info</h6>
          <div class="form-row">
            <div class="col-sm-3 form-group">
              <label>Job Order</label>
              <input type="number" class="form-control" th:field="*{jobOrderId}" required>
            </div>
          </div>
        </div>

        <div>
          <button class="btn btn-secondary" type="submit" name="user" value="draft" v-bind:disabled="hasEmptyItems()">Save Draft</button>
          <button class="btn btn-primary" type="submit" name="user" value="post"  v-bind:disabled="hasEmptyItems()">Post</button>
          <a th:href="@{/job-cards}" class="btn btn-light">Cancel</a>
        </div>
      </form>

    </div>
  </main>
</div>
<div th:replace="_fragments :: page-footer-scripts"></div>
</body>
</html>