42 lines
1.4 KiB
Plaintext
42 lines
1.4 KiB
Plaintext
{{ template "base" . }}
|
|
{{ define "title" }}
|
|
{{ index .StringMap "title" }}
|
|
{{ end }}
|
|
{{ define "content" }}
|
|
<h2 class="mt-5">Sale</h2>
|
|
<span id="refunded" class="badge bg-danger d-none">{{index .StringMap "refund-badge"}}</span>
|
|
<span id="charged" class="badge bg-success d-none">Charged</span>
|
|
<hr>
|
|
<div class="alert alert-danger text-center d-none" id="messages"></div>
|
|
<div>
|
|
<strong>Order No:</strong> <span id="order-no"></span>
|
|
<br>
|
|
<strong>Customer:</strong> <span id="customer"></span>
|
|
<br>
|
|
<strong>Product:</strong> <span id="product"></span>
|
|
<br>
|
|
<strong>Quantity:</strong> <span id="quantity"></span>
|
|
<br>
|
|
<strong>Total Sale:</strong> <span id="amount"></span>
|
|
<br>
|
|
</div>
|
|
<hr>
|
|
<a href='{{ index .StringMap "cancel" }}' class="btn btn-info">Cancel</a>
|
|
<a id="refund-btn" href="#!" class="btn btn-warning d-none">{{index .StringMap "refund-btn"}}</a>
|
|
<input type="hidden" id="pi" value="">
|
|
<input type="hidden" id="charge-amount" value="">
|
|
<input type="hidden" id="currency" value="">
|
|
{{ end }}
|
|
{{ define "js" }}
|
|
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
|
<script type="module">
|
|
import {showInfo, refund} from "/static/js/sale.js"
|
|
showInfo({{.API}});
|
|
|
|
const api = {{.API}} + {{index .StringMap "refund-url"}}
|
|
document.getElementById("refund-btn").addEventListener("click", function(event) {
|
|
refund(api, {{index .IntMap "is-refund"}});
|
|
});
|
|
</script>
|
|
{{ end }}
|