first commit
This commit is contained in:
220
admininistrator/view/template/sale/order.twig
Normal file
220
admininistrator/view/template/sale/order.twig
Normal file
@ -0,0 +1,220 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="button" data-bs-toggle="tooltip" title="{{ button_filter }}" onclick="$('#filter-order').toggleClass('d-none');" class="btn btn-light d-lg-none"><i class="fa-solid fa-filter"></i></button>
|
||||
<button type="submit" id="button-invoice" form="form-order" formaction="{{ invoice }}" formtarget="_blank" data-bs-toggle="tooltip" title="{{ button_invoice_print }}" class="btn btn-info"><i class="fa-solid fa-print"></i></button>
|
||||
<button type="submit" id="button-shipping" form="form-order" formaction="{{ shipping }}" formtarget="_blank" data-bs-toggle="tooltip" title="{{ button_shipping_print }}" class="btn btn-info"><i class="fa-solid fa-truck"></i></button>
|
||||
<a href="{{ add }}" data-bs-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa-solid fa-plus"></i></a>
|
||||
<button type="button" id="button-delete" data-bs-toggle="tooltip" title="{{ button_delete }}" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div id="filter-order" class="col-lg-3 col-md-12 order-lg-last d-none d-lg-block mb-3">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-filter"></i> {{ text_filter }}</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label for="input-order-id" class="form-label">{{ entry_order_id }}</label>
|
||||
<input type="text" name="filter_order_id" value="{{ filter_order_id }}" placeholder="{{ entry_order_id }}" id="input-order-id" class="form-control"/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{{ entry_customer }}</label>
|
||||
<input type="text" name="filter_customer" value="{{ filter_customer }}" placeholder="{{ entry_customer }}" id="input-customer" data-oc-target="autocomplete-customer" class="form-control" autocomplete="off"/>
|
||||
<ul id="autocomplete-customer" class="dropdown-menu"></ul>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-store" class="form-label">{{ entry_store }}</label>
|
||||
<select name="filter_store_id" id="input-store" class="form-select">
|
||||
<option value=""></option>
|
||||
{% for store in stores %}
|
||||
<option value="{{ store.store_id }}"{% if store.store_id == filter_store_id %} selected{% endif %}>{{ store.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-order-status" class="form-label">{{ entry_order_status }}</label>
|
||||
<select name="filter_order_status_id" id="input-order-status" class="form-select">
|
||||
<option value=""></option>
|
||||
<option value="0"{% if filter_order_status_id == '0' %} selected{% endif %}>{{ text_missing }}</option>
|
||||
{% for order_status in order_statuses %}
|
||||
<option value="{{ order_status.order_status_id }}"{% if order_status.order_status_id == filter_order_status_id %} selected{% endif %}>{{ order_status.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-total" class="form-label">{{ entry_total }}</label> <input type="text" name="filter_total" value="{{ filter_total }}" placeholder="{{ entry_total }}" id="input-total" class="form-control"/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-date-from" class="form-label">{{ entry_date_from }}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="filter_date_from" value="{{ filter_date_from }}" placeholder="{{ entry_date_from }}" id="input-date-from" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-date-to" class="form-label">{{ entry_date_to }}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="filter_date_to" value="{{ filter_date_to }}" placeholder="{{ entry_date_to }}" id="input-date-to" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="button" id="button-filter" class="btn btn-light"><i class="fa-solid fa-filter"></i> {{ button_filter }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_list }}</div>
|
||||
<div id="order" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#order').on('click', 'thead a, .pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#order').load(this.href);
|
||||
});
|
||||
|
||||
$('#button-filter').on('click', function () {
|
||||
url = '';
|
||||
|
||||
var filter_order_id = $('#input-order-id').val();
|
||||
|
||||
if (filter_order_id) {
|
||||
url += '&filter_order_id=' + filter_order_id;
|
||||
}
|
||||
|
||||
var filter_customer = $('#input-customer').val();
|
||||
|
||||
if (filter_customer) {
|
||||
url += '&filter_customer=' + encodeURIComponent(filter_customer);
|
||||
}
|
||||
|
||||
var filter_store_id = $('#input-store').val();
|
||||
|
||||
if (filter_store_id !== '') {
|
||||
url += '&filter_store_id=' + filter_store_id;
|
||||
}
|
||||
|
||||
var filter_order_status_id = $('#input-order-status').val();
|
||||
|
||||
if (filter_order_status_id !== '') {
|
||||
url += '&filter_order_status_id=' + filter_order_status_id;
|
||||
}
|
||||
|
||||
var filter_total = $('#input-total').val();
|
||||
|
||||
if (filter_total) {
|
||||
url += '&filter_total=' + encodeURIComponent(filter_total);
|
||||
}
|
||||
|
||||
var filter_date_from = $('#input-date-from').val();
|
||||
|
||||
if (filter_date_from) {
|
||||
url += '&filter_date_from=' + encodeURIComponent(filter_date_from);
|
||||
}
|
||||
|
||||
var filter_date_to = $('#input-date-to').val();
|
||||
|
||||
if (filter_date_to) {
|
||||
url += '&filter_date_to=' + encodeURIComponent(filter_date_to);
|
||||
}
|
||||
|
||||
window.history.pushState({}, null, 'index.php?route=sale/order&user_token={{ user_token }}' + url);
|
||||
|
||||
$('#order').load('index.php?route=sale/order.list&user_token={{ user_token }}' + url);
|
||||
});
|
||||
|
||||
$('#input-customer').autocomplete({
|
||||
'source': function (request, response) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=customer/customer.autocomplete&user_token={{ user_token }}&filter_name=' + encodeURIComponent(request),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
response($.map(json, function (item) {
|
||||
return {
|
||||
label: item['name'],
|
||||
value: item['customer_id']
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
'select': function (item) {
|
||||
$('#input-customer').val(item['label']);
|
||||
}
|
||||
});
|
||||
|
||||
$('input[name^=\'selected\']').on('change', function () {
|
||||
$('#button-shipping, #button-invoice').prop('disabled', true);
|
||||
|
||||
var selected = $('input[name^=\'selected\']:checked');
|
||||
|
||||
if (selected.length) {
|
||||
$('#button-invoice').prop('disabled', false);
|
||||
}
|
||||
|
||||
for (i = 0; i < selected.length; i++) {
|
||||
if ($(selected[i]).parent().find('input[name^=\'shipping_method\']').val()) {
|
||||
$('#button-shipping').prop('disabled', false);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#button-shipping, #button-invoice').prop('disabled', true);
|
||||
|
||||
$('#button-delete').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var element = this;
|
||||
|
||||
if (confirm('{{ text_confirm }}')) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=sale/order.call&user_token={{ user_token }}&action=sale/order.delete',
|
||||
type: 'post',
|
||||
data: $('#form-order').serialize(),
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$('#order').load($('#form-order').attr('data-load'));
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
32
admininistrator/view/template/sale/order_history.twig
Normal file
32
admininistrator/view/template/sale/order_history.twig
Normal file
@ -0,0 +1,32 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-start">{{ column_date_added }}</td>
|
||||
<td class="text-start">{{ column_comment }}</td>
|
||||
<td class="text-start">{{ column_status }}</td>
|
||||
<td class="text-start">{{ column_notify }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if histories %}
|
||||
{% for history in histories %}
|
||||
<tr>
|
||||
<td class="text-start">{{ history.date_added }}</td>
|
||||
<td class="text-start">{{ history.comment }}</td>
|
||||
<td class="text-start">{{ history.status }}</td>
|
||||
<td class="text-start">{{ history.notify }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="4">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
2900
admininistrator/view/template/sale/order_info.twig
Normal file
2900
admininistrator/view/template/sale/order_info.twig
Normal file
File diff suppressed because it is too large
Load Diff
192
admininistrator/view/template/sale/order_invoice.twig
Normal file
192
admininistrator/view/template/sale/order_invoice.twig
Normal file
@ -0,0 +1,192 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="{{ direction }}" lang="{{ lang }}">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>{{ title }}</title>
|
||||
<base href="{{ base }}"/>
|
||||
<link href="{{ bootstrap_css }}" type="text/css" rel="stylesheet"/>
|
||||
<link href="{{ icons }}" type="text/css" rel="stylesheet"/>
|
||||
<script src="{{ jquery }}" type="text/javascript"></script>
|
||||
<script src="{{ bootstrap_js }}" type="text/javascript"></script>
|
||||
<link href="{{ stylesheet }}" type="text/css" rel="stylesheet"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
{% for order in orders %}
|
||||
<div style="page-break-after: always;">
|
||||
<h1>{{ text_invoice }} #{{ order.order_id }}</h1>
|
||||
<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-xl-4">
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_invoice }}</strong>
|
||||
<br/>
|
||||
{% if order.invoice_no %}
|
||||
{{ order.invoice_no }}
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_order_id }}</strong>
|
||||
<br/>
|
||||
{{ order.order_id }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_date_added }}</strong>
|
||||
<br/>
|
||||
{{ order.date_added }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_store }}</strong>
|
||||
<br/>
|
||||
{{ order.store_name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_store_address }}</strong>
|
||||
<br/>
|
||||
{{ order.store_address }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_store_telephone }}</strong>
|
||||
<br/>
|
||||
{{ order.store_telephone }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_store_email }}</strong>
|
||||
<br/>
|
||||
{{ order.store_email }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_payment_method }}</strong>
|
||||
<br/>
|
||||
{{ order.payment_method }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if order.shipping_method %}
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_shipping_method }}</strong>
|
||||
<br/>
|
||||
{{ order.shipping_method }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
{% if order.payment_address %}
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_payment_address }}</strong>
|
||||
<br/>
|
||||
{{ order.payment_address }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if order.shipping_address %}
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_shipping_address }}</strong>
|
||||
<br/>
|
||||
{{ order.shipping_address }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><b>{{ column_product }}</b></td>
|
||||
<td><b>{{ column_model }}</b></td>
|
||||
<td class="text-end"><b>{{ column_quantity }}</b></td>
|
||||
<td class="text-end"><b>{{ column_price }}</b></td>
|
||||
<td class="text-end"><b>{{ column_total }}</b></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for product in order.product %}
|
||||
<tr>
|
||||
<td>{{ product.name }}
|
||||
{% for option in product.option %}
|
||||
<br/>
|
||||
<small> - {{ option.name }}: {{ option.value }}</small>
|
||||
{% endfor %}
|
||||
|
||||
{% if product.reward %}
|
||||
<br/>
|
||||
<small> - {{ text_points }}: {{ product.reward }}</small>
|
||||
{% endif %}
|
||||
|
||||
{% if product.subscription %}
|
||||
<br/>
|
||||
<small> - {{ text_subscription }}: {{ product.subscription }} </small>
|
||||
{% endif %}
|
||||
|
||||
</td>
|
||||
<td>{{ product.model }}</td>
|
||||
<td class="text-end">{{ product.quantity }}</td>
|
||||
<td class="text-end">{{ product.price }}</td>
|
||||
<td class="text-end">{{ product.total }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% for voucher in order.voucher %}
|
||||
<tr>
|
||||
<td>{{ voucher.description }}</td>
|
||||
<td></td>
|
||||
<td class="text-end">1</td>
|
||||
<td class="text-end">{{ voucher.amount }}</td>
|
||||
<td class="text-end">{{ voucher.amount }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% for total in order.total %}
|
||||
<tr>
|
||||
<td class="text-end" colspan="4"><b>{{ total.title }}</b></td>
|
||||
<td class="text-end">{{ total.text }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% if order.comment %}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_comment }}</strong>
|
||||
<br/>
|
||||
{{ order.comment }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
45
admininistrator/view/template/sale/order_list.twig
Normal file
45
admininistrator/view/template/sale/order_list.twig
Normal file
@ -0,0 +1,45 @@
|
||||
<form id="form-order" method="post" enctype="application/x-www-form-urlencoded" data-load="{{ action }}">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center" style="width: 1px;"><input type="checkbox" onclick="$('input[name*=\'selected\']').trigger('click');" class="form-check-input"/></td>
|
||||
<td class="text-end"><a href="{{ sort_order }}"{% if sort == 'o.order_id' %} class="{{ order|lower }}"{% endif %}>{{ column_order_id }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_store_name }}"{% if sort == 'o.store_name' %} class="{{ order|lower }}"{% endif %}>{{ column_store }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_customer }}"{% if sort == 'customer' %} class="{{ order|lower }}"{% endif %}>{{ column_customer }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_status }}"{% if sort == 'order_status' %} class="{{ order|lower }}"{% endif %}>{{ column_status }}</a></td>
|
||||
<td class="text-end d-none d-lg-table-cell"><a href="{{ sort_total }}"{% if sort == 'o.total' %} class="{{ order|lower }}"{% endif %}>{{ column_total }}</a></td>
|
||||
<td class="text-start d-none d-lg-table-cell"><a href="{{ sort_date_added }}"{% if sort == 'o.date_added' %} class="{{ order|lower }}"{% endif %}>{{ column_date_added }}</a></td>
|
||||
<td class="text-start d-none d-xl-table-cell"><a href="{{ sort_date_modified }}"{% if sort == 'o.date_modified' %} class="{{ order|lower }}"{% endif %}>{{ column_date_modified }}</a></td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if orders %}
|
||||
{% for order in orders %}
|
||||
<tr>
|
||||
<td class="text-center"><input type="checkbox" name="selected[]" value="{{ order.order_id }}" class="form-check-input"/>
|
||||
<input type="hidden" name="shipping_method[]" value="{% if order.shipping_method %}1{{ else }}0{% endif %}"/></td>
|
||||
<td class="text-end">{{ order.order_id }}</td>
|
||||
<td class="text-start">{{ order.store_name }}</td>
|
||||
<td class="text-start">{{ order.customer }}</td>
|
||||
<td class="text-start"><label>{{ order.order_status }}</label></td>
|
||||
<td class="text-end d-none d-lg-table-cell">{{ order.total }}</td>
|
||||
<td class="text-start d-none d-lg-table-cell">{{ order.date_added }}</td>
|
||||
<td class="text-start d-none d-xl-table-cell">{{ order.date_modified }}</td>
|
||||
<td class="text-end"><a href="{{ order.view }}" data-bs-toggle="tooltip" title="{{ button_view }}" class="btn btn-primary"><i class="fa-solid fa-eye"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="9">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
</form>
|
237
admininistrator/view/template/sale/order_shipping.twig
Normal file
237
admininistrator/view/template/sale/order_shipping.twig
Normal file
@ -0,0 +1,237 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="{{ direction }}" lang="{{ lang }}">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<title>{{ title }}</title>
|
||||
<base href="{{ base }}"/>
|
||||
<link href="{{ bootstrap_css }}" type="text/css" rel="stylesheet"/>
|
||||
<link href="{{ icons }}" type="text/css" rel="stylesheet"/>
|
||||
<script src="{{ jquery }}" type="text/javascript"></script>
|
||||
<script src="{{ bootstrap_js }}" type="text/javascript"></script>
|
||||
<link href="{{ stylesheet }}" type="text/css" rel="stylesheet"/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
{% for order in orders %}
|
||||
<div style="page-break-after: always;">
|
||||
<h1>{{ text_picklist }} #{{ order.order_id }}</h1>
|
||||
|
||||
<div class="row row-cols-1 row-cols-sm-2 row-cols-md-3 row-cols-xl-4">
|
||||
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_invoice }}</strong>
|
||||
<br/>
|
||||
{% if order.invoice_no %}
|
||||
{{ order.invoice_no }}
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_order_id }}</strong>
|
||||
<br/>
|
||||
{{ order.order_id }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_date_added }}</strong>
|
||||
<br/>
|
||||
{{ order.date_added }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_store }}</strong>
|
||||
<br/>
|
||||
{{ order.store_name }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_store_telephone }}</strong>
|
||||
<br/>
|
||||
{{ order.store_telephone }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_store_email }}</strong>
|
||||
<br/>
|
||||
{{ order.store_email }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_website }}</strong>
|
||||
<br/>
|
||||
{{ order.store_url }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_shipping_method }}</strong>
|
||||
<br/>
|
||||
{{ order.shipping_method }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_customer_email }}</strong>
|
||||
<br/>
|
||||
{% if order.email %}
|
||||
{{ order.email }}
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if order.telephone %}
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_customer_telephone }}</strong>
|
||||
<br/>
|
||||
{% if order.telephone %}
|
||||
{{ order.telephone }}
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row row-cols-1 row-cols-sm-2">
|
||||
<div class="col">
|
||||
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_shipping_address }}</strong>
|
||||
<br/>
|
||||
{% if order.shipping_address %}
|
||||
{{ order.shipping_address }}
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="form-control-plaintext p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_store_address }}</strong>
|
||||
<br/>
|
||||
{{ order.store_address }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><b>{{ column_location }}</b></td>
|
||||
<td><b>{{ column_reference }}</b></td>
|
||||
<td><b>{{ column_product }}</b></td>
|
||||
<td><b>{{ column_weight }}</b></td>
|
||||
<td><b>{{ column_model }}</b></td>
|
||||
<td class="text-end"><b>{{ column_quantity }}</b></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for product in order.product %}
|
||||
<tr>
|
||||
<td>{{ product.location }}</td>
|
||||
<td>
|
||||
{% if product.sku %}
|
||||
{{ text_sku }} {{ product.sku }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
|
||||
{% if product.upc %}
|
||||
{{ text_upc }} {{ product.upc }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
|
||||
{% if product.ean %}
|
||||
{{ text_ean }} {{ product.ean }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
|
||||
{% if product.jan %}
|
||||
{{ text_jan }} {{ product.jan }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
|
||||
{% if product.isbn %}
|
||||
{{ text_isbn }} {{ product.isbn }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
|
||||
{% if product.mpn %}
|
||||
{{ text_mpn }}{{ product.mpn }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ product.name }}
|
||||
|
||||
{% for option in product.option %}
|
||||
<br/>
|
||||
<small> - {{ option.name }}: {{ option.value }}</small>
|
||||
{% endfor %}
|
||||
|
||||
{% if product.reward %}
|
||||
<br/>
|
||||
<small> - {{ text_points }} {{ product.reward }}</small>
|
||||
{% endif %}
|
||||
|
||||
</td>
|
||||
<td>{{ product.weight }}</td>
|
||||
<td>{{ product.model }}</td>
|
||||
<td class="text-end">{{ product.quantity }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% if order.comment %}
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><b>{{ text_comment }}</b></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ order.comment }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
205
admininistrator/view/template/sale/returns.twig
Normal file
205
admininistrator/view/template/sale/returns.twig
Normal file
@ -0,0 +1,205 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="button" data-bs-toggle="tooltip" title="{{ button_filter }}" onclick="$('#filter-return').toggleClass('d-none');" class="btn btn-light d-md-none"><i class="fa-solid fa-filter"></i></button>
|
||||
<a href="{{ add }}" data-bs-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa-solid fa-plus"></i></a>
|
||||
<button type="submit" form="form-return" formaction="{{ delete }}" data-bs-toggle="tooltip" title="{{ button_delete }}" onclick="return confirm('{{ text_confirm }}');" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div id="filter-return" class="col-lg-3 col-md-12 order-lg-last d-none d-lg-block mb-3">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-filter"></i> {{ text_filter }}</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label for="input-return-id" class="form-label">{{ entry_return_id }}</label> <input type="text" name="filter_return_id" value="{{ filter_return_id }}" placeholder="{{ entry_return_id }}" id="input-return-id" class="form-control"/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-order-id" class="form-label">{{ entry_order_id }}</label> <input type="text" name="filter_order_id" value="{{ filter_order_id }}" placeholder="{{ entry_order_id }}" id="input-order-id" class="form-control"/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{{ entry_customer }}</label>
|
||||
<input type="text" name="filter_customer" value="{{ filter_customer }}" placeholder="{{ entry_customer }}" id="input-customer" data-oc-target="autocomplete-customer" class="form-control" autocomplete="off"/>
|
||||
<ul id="autocomplete-customer" class="dropdown-menu"></ul>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{{ entry_product }}</label>
|
||||
<input type="text" name="filter_product" value="{{ filter_product }}" placeholder="{{ entry_product }}" id="input-product" data-oc-target="autocomplete-product" class="form-control" autocomplete="off"/>
|
||||
<ul id="autocomplete-product" class="dropdown-menu"></ul>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{{ entry_model }}</label>
|
||||
<input type="text" name="filter_model" value="{{ filter_model }}" placeholder="{{ entry_model }}" id="input-model" data-oc-target="autocomplete-model" class="form-control" autocomplete="off"/>
|
||||
<ul id="autocomplete-model" class="dropdown-menu"></ul>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-return-status" class="form-label">{{ entry_return_status }}</label> <select name="filter_return_status_id" id="input-return-status" class="form-select">
|
||||
<option value=""></option>
|
||||
{% for return_status in return_statuses %}
|
||||
<option value="{{ return_status.return_status_id }}"{% if return_status.return_status_id == filter_return_status_id %} selected{% endif %}>{{ return_status.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-date-from" class="form-label">{{ entry_date_from }}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="filter_date_from" value="{{ filter_date_from }}" placeholder="{{ entry_date_from }}" id="input-date-from" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-date-to" class="form-label">{{ entry_date_to }}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="filter_date_to" value="{{ filter_date_to }}" placeholder="{{ entry_date_to }}" id="input-date-to" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="button" id="button-filter" class="btn btn-light"><i class="fa-solid fa-filter"></i> {{ button_filter }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_list }}</div>
|
||||
<div id="return" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#return').on('click', 'thead a, .pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#return').load(this.href);
|
||||
});
|
||||
|
||||
$('#button-filter').on('click', function () {
|
||||
url = '';
|
||||
|
||||
var filter_return_id = $('#input-return-id').val();
|
||||
|
||||
if (filter_return_id) {
|
||||
url += '&filter_return_id=' + filter_return_id;
|
||||
}
|
||||
|
||||
var filter_order_id = $('#input-order-id').val();
|
||||
|
||||
if (filter_order_id) {
|
||||
url += '&filter_order_id=' + filter_order_id;
|
||||
}
|
||||
|
||||
var filter_customer = $('#input-customer').val();
|
||||
|
||||
if (filter_customer) {
|
||||
url += '&filter_customer=' + encodeURIComponent(filter_customer);
|
||||
}
|
||||
|
||||
var filter_product = $('#input-product').val();
|
||||
|
||||
if (filter_product) {
|
||||
url += '&filter_product=' + encodeURIComponent(filter_product);
|
||||
}
|
||||
|
||||
var filter_model = $('#input-model').val();
|
||||
|
||||
if (filter_model) {
|
||||
url += '&filter_model=' + encodeURIComponent(filter_model);
|
||||
}
|
||||
|
||||
var filter_return_status_id = $('#input-return-status').val();
|
||||
|
||||
if (filter_return_status_id !== '') {
|
||||
url += '&filter_return_status_id=' + filter_return_status_id;
|
||||
}
|
||||
|
||||
var filter_date_from = $('#input-date-from').val();
|
||||
|
||||
if (filter_date_from) {
|
||||
url += '&filter_date_from=' + encodeURIComponent(filter_date_from);
|
||||
}
|
||||
|
||||
var filter_date_to = $('#input-date-to').val();
|
||||
|
||||
if (filter_date_to) {
|
||||
url += '&filter_date_to=' + encodeURIComponent(filter_date_to);
|
||||
}
|
||||
|
||||
window.history.pushState({}, null, 'index.php?route=sale/returns&user_token={{ user_token }}' + url);
|
||||
|
||||
$('#return').load('index.php?route=sale/returns.list&user_token={{ user_token }}' + url);
|
||||
});
|
||||
|
||||
$('#input-customer').autocomplete({
|
||||
'source': function (request, response) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=customer/customer.autocomplete&user_token={{ user_token }}&filter_name=' + encodeURIComponent(request),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
response($.map(json, function (item) {
|
||||
return {
|
||||
label: item['name'],
|
||||
value: item['customer_id']
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
'select': function (item) {
|
||||
$('#input-customer').val(item['label']);
|
||||
}
|
||||
});
|
||||
|
||||
$('#input-product').autocomplete({
|
||||
'source': function (request, response) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=catalog/product.autocomplete&user_token={{ user_token }}&filter_name=' + encodeURIComponent(request),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
response($.map(json, function (item) {
|
||||
return {
|
||||
label: item['name'],
|
||||
value: item['product_id']
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
'select': function (item) {
|
||||
$('#input-product').val(item['label']);
|
||||
}
|
||||
});
|
||||
|
||||
$('#input-model').autocomplete({
|
||||
'source': function (request, response) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=catalog/product.autocomplete&user_token={{ user_token }}&filter_model=' + encodeURIComponent(request),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
response($.map(json, function (item) {
|
||||
return {
|
||||
label: item['model'],
|
||||
value: item['product_id']
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
'select': function (item) {
|
||||
$('#input-model').val(item['label']);
|
||||
}
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
293
admininistrator/view/template/sale/returns_form.twig
Normal file
293
admininistrator/view/template/sale/returns_form.twig
Normal file
@ -0,0 +1,293 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="submit" form="form-return" formaction="{{ save }}" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i></button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-pencil"></i> {{ text_form }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-return" action="{{ save }}" method="post" data-oc-toggle="ajax">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item"><a href="#tab-general" data-bs-toggle="tab" class="nav-link active">{{ tab_general }}</a></li>
|
||||
<li class="nav-item"><a href="#tab-history" data-bs-toggle="tab" class="nav-link">{{ tab_history }}</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="tab-general" class="tab-pane active">
|
||||
<fieldset>
|
||||
<legend>{{ text_order }}</legend>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-order-id" class="col-sm-2 col-form-label">{{ entry_order_id }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="order_id" value="{{ order_id }}" placeholder="{{ entry_order_id }}" id="input-order-id" class="form-control"/>
|
||||
<div id="error-order-id" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-date-ordered" class="col-sm-2 col-form-label">{{ entry_date_ordered }}</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<div class="input-group">
|
||||
<input type="text" name="date_ordered" value="{{ date_ordered }}" placeholder="{{ entry_date_ordered }}" id="input-date-ordered" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_customer }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="customer" value="{{ customer }}" placeholder="{{ entry_customer }}" id="input-customer" data-oc-target="autocomplete-customer" class="form-control" autocomplete="off"/>
|
||||
<ul id="autocomplete-customer" class="dropdown-menu"></ul>
|
||||
<input type="hidden" name="customer_id" value="{{ customer_id }}"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-firstname" class="col-sm-2 col-form-label">{{ entry_firstname }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="firstname" value="{{ firstname }}" placeholder="{{ entry_firstname }}" id="input-firstname" class="form-control"/>
|
||||
<div id="error-firstname" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-lastname" class="col-sm-2 col-form-label">{{ entry_lastname }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="lastname" value="{{ lastname }}" placeholder="{{ entry_lastname }}" id="input-lastname" class="form-control"/>
|
||||
<div id="error-lastname" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-email" class="col-sm-2 col-form-label">{{ entry_email }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="email" value="{{ email }}" placeholder="{{ entry_email }}" id="input-email" class="form-control"/>
|
||||
<div id="error-email" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-telephone" class="col-sm-2 col-form-label">{{ entry_telephone }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="telephone" value="{{ telephone }}" placeholder="{{ entry_telephone }}" id="input-telephone" class="form-control"/>
|
||||
<div id="error-telephone" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{{ text_product }}</legend>
|
||||
<div class="row mb-3 required">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_product }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="product" value="{{ product }}" placeholder="{{ entry_product }}" id="input-product" data-oc-target="autocomplete-product" class="form-control" autocomplete="off"/>
|
||||
<ul id="autocomplete-product" class="dropdown-menu"></ul>
|
||||
<input type="hidden" name="product_id" value="{{ product_id }}" id="input-product-id"/>
|
||||
<div class="form-text">{{ help_product }}</div>
|
||||
<div id="error-product" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-model" class="col-sm-2 col-form-label">{{ entry_model }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="model" value="{{ model }}" placeholder="{{ entry_model }}" id="input-model" class="form-control"/>
|
||||
<div id="error-model" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-quantity" class="col-sm-2 col-form-label">{{ entry_quantity }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="quantity" value="{{ quantity }}" placeholder="{{ entry_quantity }}" id="input-quantity" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-return-reason" class="col-sm-2 col-form-label">{{ entry_return_reason }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="return_reason_id" id="input-return-reason" class="form-select">
|
||||
{% for return_reason in return_reasons %}
|
||||
<option value="{{ return_reason.return_reason_id }}"{% if return_reason.return_reason_id == return_reason_id %} selected{% endif %}>{{ return_reason.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div id="error-return-reason" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-opened" class="col-sm-2 col-form-label">{{ entry_opened }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="opened" id="input-opened" class="form-select">
|
||||
<option value="1"{% if opened %} selected{% endif %}>{{ text_opened }}</option>
|
||||
<option value="0"{% if not opened %} selected{% endif %}>{{ text_unopened }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-comment" class="col-sm-2 col-form-label">{{ entry_comment }}</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea name="comment" rows="5" placeholder="{{ entry_comment }}" id="input-comment" class="form-control">{{ comment }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-return-action" class="col-sm-2 col-form-label">{{ entry_return_action }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="return_action_id" id="input-return-action" class="form-select">
|
||||
<option value="0"></option>
|
||||
{% for return_action in return_actions %}
|
||||
<option value="{{ return_action.return_action_id }}"{% if return_action.return_action_id == return_action_id %} selected{% endif %}>{{ return_action.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{% if not return_id %}
|
||||
<div class="row mb-3">
|
||||
<label for="input-return-status" class="col-sm-2 col-form-label">{{ entry_return_status }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="return_status_id" id="input-return-status" class="form-select">
|
||||
{% for return_status in return_statuses %}
|
||||
<option value="{{ return_status.return_status_id }}"{% if return_status.return_status_id == return_status_id %} selected{% endif %}>{{ return_status.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</fieldset>
|
||||
</div>
|
||||
<div id="tab-history" class="tab-pane">
|
||||
<fieldset>
|
||||
<legend>{{ text_history }}</legend>
|
||||
<div id="history">{{ history }}</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{{ text_history_add }}</legend>
|
||||
<div class="row mb-3">
|
||||
<label for="input-return-status" class="col-sm-2 col-form-label">{{ entry_return_status }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="return_status_id" id="input-return-status" class="form-select">
|
||||
{% for return_status in return_statuses %}
|
||||
<option value="{{ return_status.return_status_id }}"{% if return_status.return_status_id == return_status_id %} selected{% endif %}>{{ return_status.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_notify }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check form-switch form-switch-lg">
|
||||
<input type="hidden" name="notify" value="0"/> <input type="checkbox" name="notify" value="1" id="input-notify" class="form-check-input"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-history" class="col-sm-2 col-form-label">{{ entry_comment }}</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea name="comment" rows="8" placeholder="{{ entry_comment }}" id="input-history" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="button" id="button-history" class="btn btn-primary"><i class="fa-solid fa-plus-circle"></i> {{ button_history_add }}</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="return_id" value="{{ return_id }}" id="input-return-id"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#input-customer').autocomplete({
|
||||
'source': function (request, response) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=customer/customer.autocomplete&user_token={{ user_token }}&filter_name=' + encodeURIComponent(request),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
response($.map(json, function (item) {
|
||||
return {
|
||||
category: item['customer_group'],
|
||||
label: item['name'],
|
||||
value: item['customer_id'],
|
||||
firstname: item['firstname'],
|
||||
lastname: item['lastname'],
|
||||
email: item['email'],
|
||||
telephone: item['telephone']
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
'select': function (item) {
|
||||
$('#input-customer').val(item['label']);
|
||||
$('#input-customer-id').val(item['value']);
|
||||
$('#input-firstname').val(item['firstname']);
|
||||
$('#input-lastname').val(item['lastname']);
|
||||
$('#input-email').val(item['email']);
|
||||
$('#input-telephone').val(item['telephone']);
|
||||
}
|
||||
});
|
||||
|
||||
$('#input-product').autocomplete({
|
||||
'source': function (request, response) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=catalog/product.autocomplete&user_token={{ user_token }}&filter_name=' + encodeURIComponent(request),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
response($.map(json, function (item) {
|
||||
return {
|
||||
label: item['name'],
|
||||
value: item['product_id'],
|
||||
model: item['model']
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
'select': function (item) {
|
||||
$('#input-product').val(item['label']);
|
||||
$('#input-product-id').val(item['value']);
|
||||
$('#input-model').val(item['model']);
|
||||
}
|
||||
});
|
||||
|
||||
$('#history').on('click', '.pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#history').load(this.href);
|
||||
});
|
||||
|
||||
$('#button-history').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=sale/returns.addHistory&user_token={{ user_token }}&return_id=' + $('#input-return-id').val(),
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: 'return_status_id=' + $('#input-return-status').val() + '¬ify=' + ($('#input-notify').prop('checked') ? 1 : 0) + '&comment=' + encodeURIComponent($('#input-history').val()),
|
||||
beforeSend: function () {
|
||||
$('#button-history').button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$('#button-history').button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#tab-history').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#history').load('index.php?route=sale/returns.history&user_token={{ user_token }}&return_id=' + $('#input-return-id').val());
|
||||
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$('#input-history').val('');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
30
admininistrator/view/template/sale/returns_history.twig
Normal file
30
admininistrator/view/template/sale/returns_history.twig
Normal file
@ -0,0 +1,30 @@
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-start">{{ column_date_added }}</td>
|
||||
<td class="text-start">{{ column_comment }}</td>
|
||||
<td class="text-start">{{ column_status }}</td>
|
||||
<td class="text-start">{{ column_notify }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if histories %}
|
||||
{% for history in histories %}
|
||||
<tr>
|
||||
<td class="text-start">{{ history.date_added }}</td>
|
||||
<td class="text-start">{{ history.comment }}</td>
|
||||
<td class="text-start">{{ history.status }}</td>
|
||||
<td class="text-start">{{ history.notify }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="4">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
46
admininistrator/view/template/sale/returns_list.twig
Normal file
46
admininistrator/view/template/sale/returns_list.twig
Normal file
@ -0,0 +1,46 @@
|
||||
<form id="form-return" method="post" data-oc-toggle="ajax" data-oc-load="{{ action }}" data-oc-target="#return">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center" style="width: 1px;"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', $(this).prop('checked'));" class="form-check-input"/></td>
|
||||
<td class="text-end"><a href="{{ sort_return_id }}"{% if sort == 'r.return_id' %} class="{{ order|lower }}"{% endif %}>{{ column_return_id }}</a></td>
|
||||
<td class="text-end"><a href="{{ sort_order_id }}"{% if sort == 'r.order_id' %} class="{{ order|lower }}"{% endif %}>{{ column_order_id }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_customer }}"{% if sort == 'customer' %} class="{{ order|lower }}"{% endif %}>{{ column_customer }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_product }}"{% if sort == 'r.product' %} class="{{ order|lower }}"{% endif %}>{{ column_product }}</a></td>
|
||||
<td class="text-start d-none d-lg-table-cell"><a href="{{ sort_model }}"{% if sort == 'r.model' %} class="{{ order|lower }}"{% endif %}>{{ column_model }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_status }}"{% if sort == 'return_status' %} class="{{ order|lower }}"{% endif %}>{{ column_status }}</a></td>
|
||||
<td class="text-start d-none d-lg-table-cell"><a href="{{ sort_date_added }}"{% if sort == 'r.date_added' %} class="{{ order|lower }}"{% endif %}>{{ column_date_added }}</a></td>
|
||||
<td class="text-start d-none d-lg-table-cell"><a href="{{ sort_date_modified }}"{% if sort == 'r.date_modified' %} class="{{ order|lower }}"{% endif %}>{{ column_date_modified }}</a></td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if returns %}
|
||||
{% for return in returns %}
|
||||
<tr>
|
||||
<td class="text-center"><input type="checkbox" name="selected[]" value="{{ return.return_id }}" class="form-check-input"/></td>
|
||||
<td class="text-end">{{ return.return_id }}</td>
|
||||
<td class="text-end">{{ return.order_id }}</td>
|
||||
<td class="text-start">{{ return.customer }}</td>
|
||||
<td class="text-start">{{ return.product }}</td>
|
||||
<td class="text-start d-none d-lg-table-cell">{{ return.model }}</td>
|
||||
<td class="text-start">{{ return.return_status }}</td>
|
||||
<td class="text-start d-none d-lg-table-cell">{{ return.date_added }}</td>
|
||||
<td class="text-start d-none d-lg-table-cell">{{ return.date_modified }}</td>
|
||||
<td class="text-end"><a href="{{ return.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa-solid fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="10">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
</form>
|
143
admininistrator/view/template/sale/subscription.twig
Normal file
143
admininistrator/view/template/sale/subscription.twig
Normal file
@ -0,0 +1,143 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="button" data-bs-toggle="tooltip" title="{{ button_filter }}" onclick="$('#filter-subscription').toggleClass('d-none');" class="btn btn-light d-md-none"><i class="fa-solid fa-filter"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div id="filter-subscription" class="col-lg-3 col-md-12 order-lg-last d-none d-lg-block mb-3">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-filter"></i> {{ text_filter }}</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label for="input-subscription-id" class="form-label">{{ entry_subscription_id }}</label>
|
||||
<input type="text" name="filter_subscription_id" value="{{ filter_subscription_id }}" placeholder="{{ entry_subscription_id }}" id="input-subscription-id" class="form-control"/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-order-id" class="form-label">{{ entry_order_id }}</label>
|
||||
<input type="text" name="filter_order_id" value="{{ filter_order_id }}" placeholder="{{ entry_order_id }}" id="input-order-id" class="form-control"/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-customer" class="form-label">{{ entry_customer }}</label>
|
||||
<input type="text" name="filter_customer" value="{{ filter_customer }}" placeholder="{{ entry_customer }}" id="input-customer" data-oc-target="autocomplete-customer" class="form-control" autocomplete="off"/>
|
||||
<ul id="autocomplete-customer" class="dropdown-menu"></ul>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-subscription-status" class="form-label">{{ entry_subscription_status }}</label> <select name="filter_subscription_status_id" id="input-subscription-status" class="form-select">
|
||||
<option value=""></option>
|
||||
{% for subscription_status in subscription_statuses %}
|
||||
<option value="{{ subscription_status.subscription_status_id }}"{% if subscription_status.subscription_status_id == filter_subscription_status_id %} selected{% endif %}>{{ subscription_status.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-date-from" class="form-label">{{ entry_date_from }}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="filter_date_from" value="{{ filter_date_from }}" placeholder="{{ entry_date_from }}" id="input-date-from" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-date-to" class="form-label">{{ entry_date_to }}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="filter_date_to" value="{{ filter_date_to }}" placeholder="{{ entry_date_to }}" id="input-date-to" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="button" id="button-filter" class="btn btn-light"><i class="fa-solid fa-filter"></i> {{ button_filter }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_list }}</div>
|
||||
<div id="subscription" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#subscription').on('click', 'thead a, .pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#subscription').load(this.href);
|
||||
});
|
||||
|
||||
$('#button-filter').on('click', function () {
|
||||
url = '';
|
||||
|
||||
var filter_subscription_id = $('#input-subscription-id').val();
|
||||
|
||||
if (filter_subscription_id) {
|
||||
url += '&filter_subscription_id=' + filter_subscription_id;
|
||||
}
|
||||
|
||||
var filter_order_id = $('#input-order-id').val();
|
||||
|
||||
if (filter_order_id) {
|
||||
url += '&filter_order_id=' + filter_order_id;
|
||||
}
|
||||
|
||||
var filter_customer = $('#input-customer').val();
|
||||
|
||||
if (filter_customer) {
|
||||
url += '&filter_customer=' + encodeURIComponent(filter_customer);
|
||||
}
|
||||
|
||||
var filter_subscription_status_id = $('#input-subscription-status').val();
|
||||
|
||||
if (filter_subscription_status_id !== '') {
|
||||
url += '&filter_subscription_status_id=' + filter_subscription_status_id;
|
||||
}
|
||||
|
||||
var filter_date_from = $('#input-date-from').val();
|
||||
|
||||
if (filter_date_from) {
|
||||
url += '&filter_date_from=' + encodeURIComponent(filter_date_from);
|
||||
}
|
||||
|
||||
var filter_date_to = $('#input-date-to').val();
|
||||
|
||||
if (filter_date_to) {
|
||||
url += '&filter_date_to=' + encodeURIComponent(filter_date_to);
|
||||
}
|
||||
|
||||
window.history.pushState({}, null, 'index.php?route=sale/subscription&user_token={{ user_token }}' + url);
|
||||
|
||||
$('#subscription').load('index.php?route=sale/subscription.list&user_token={{ user_token }}' + url);
|
||||
});
|
||||
|
||||
$('#input-customer').autocomplete({
|
||||
'source': function (request, response) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=customer/customer.autocomplete&user_token={{ user_token }}&filter_name=' + encodeURIComponent(request),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
response($.map(json, function (item) {
|
||||
return {
|
||||
label: item['name'],
|
||||
value: item['customer_id']
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
'select': function (item) {
|
||||
$('#input-customer').val(item['label']);
|
||||
}
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
32
admininistrator/view/template/sale/subscription_history.twig
Normal file
32
admininistrator/view/template/sale/subscription_history.twig
Normal file
@ -0,0 +1,32 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-start">{{ column_date_added }}</td>
|
||||
<td class="text-start">{{ column_comment }}</td>
|
||||
<td class="text-start">{{ column_status }}</td>
|
||||
<td class="text-start">{{ column_notify }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if histories %}
|
||||
{% for history in histories %}
|
||||
<tr>
|
||||
<td class="text-start">{{ history.date_added }}</td>
|
||||
<td class="text-start">{{ history.comment }}</td>
|
||||
<td class="text-start">{{ history.status }}</td>
|
||||
<td class="text-start">{{ history.notify }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="4">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
604
admininistrator/view/template/sale/subscription_info.twig
Normal file
604
admininistrator/view/template/sale/subscription_info.twig
Normal file
@ -0,0 +1,604 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="submit" form="form-subscription" formaction="{{ save }}" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i></button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card mb-3">
|
||||
<div class="card-header"><i class="fa-solid fa-info-circle"></i> {{ text_form }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-subscription">
|
||||
<div class="row row-cols-1 row-cols-sm-1 row-cols-md-3 row-cols-xl-3">
|
||||
|
||||
<div class="col">
|
||||
<div class="form-control p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_date_added }}</strong>
|
||||
<br/>
|
||||
{{ date_added }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="form-control p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_order }}</strong>
|
||||
<br/>
|
||||
<a href="index.php?route=customer/customer.form&user_token={{ user_token }}&customer_id={{ customer_id }}" target="_blank">{{ order_id }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="input-group mb-3">
|
||||
<div class="form-control border rounded-start">
|
||||
<div class="lead"><strong>{{ text_customer }}</strong>
|
||||
<br/>
|
||||
<div id="customer-value"><a href="index.php?route=customer/customer.form&user_token={{ user_token }}&customer_id={{ customer_id }}" target="_blank">{{ firstname }} {{ lastname }}</a></div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" data-bs-toggle="modal" data-bs-target="#modal-customer" class="btn btn-outline-primary"><i class="fa-solid fa-cog"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row row-cols-1">
|
||||
<div class="col-12">
|
||||
<div class="input-group mb-3">
|
||||
<div class="form-control p-0 border rounded-start">
|
||||
<div class="lead p-2"><strong>{{ text_subscription_plan }}</strong>
|
||||
<br/>
|
||||
{{ subscription_plan }}
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" data-bs-toggle="modal" data-bs-target="#modal-subscription-plan" class="btn btn-outline-primary"><i class="fa-solid fa-cog"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row row-cols-1 row-cols-sm-1 row-cols-md-3 row-cols-xl-3">
|
||||
<div class="col">
|
||||
<div class="form-control p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_date_next }}</strong>
|
||||
<br/>
|
||||
{{ date_next }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="form-control p-0 border rounded mb-3">
|
||||
<div class="lead p-2"><strong>{{ text_remaining }}</strong>
|
||||
<br/>
|
||||
{{ remaining }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md">
|
||||
<div class="input-group mb-3">
|
||||
<div class="form-control border rounded-start">
|
||||
<div class="lead"><strong>{{ text_payment_address }}</strong>
|
||||
<br/>
|
||||
<div id="payment-address-value">
|
||||
{% if payment_firstname %}
|
||||
{{ payment_firstname }} {{ payment_lastname }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
|
||||
{% if payment_company %}
|
||||
{{ payment_company }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
|
||||
{% if payment_address_1 %}
|
||||
{{ payment_address_1 }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
|
||||
{% if payment_address_2 %}
|
||||
{{ payment_address_2 }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
|
||||
{% if payment_city %}
|
||||
{{ payment_city }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
|
||||
{% if payment_postcode %}
|
||||
{{ payment_postcode }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
|
||||
{% if payment_zone %}
|
||||
{{ payment_zone }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
{% if payment_country %}
|
||||
{{ payment_country }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" data-bs-toggle="modal" data-bs-target="#modal-payment-address" class="btn btn-outline-primary float-end"><i class="fa-solid fa-cog"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="shipping-address" class="col">
|
||||
<div class="input-group mb-3">
|
||||
<div class="form-control border rounded-start">
|
||||
<div class="lead"><strong>{{ text_shipping_address }}</strong>
|
||||
<br/>
|
||||
<div id="shipping-address-value">
|
||||
{% if shipping_firstname %}
|
||||
{{ shipping_firstname }} {{ shipping_lastname }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
{% if shipping_company %}
|
||||
{{ shipping_company }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
{% if shipping_address_1 %}
|
||||
{{ shipping_address_1 }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
{% if shipping_address_2 %}
|
||||
{{ shipping_address_2 }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
{% if shipping_city %}
|
||||
{{ shipping_city }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
{% if shipping_postcode %}
|
||||
{{ shipping_postcode }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
{% if shipping_zone %}
|
||||
{{ shipping_zone }}
|
||||
<br/>
|
||||
{% endif %}
|
||||
{% if shipping_country %}
|
||||
{{ shipping_country }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" data-bs-toggle="modal" data-bs-target="#modal-shipping-address" class="btn btn-outline-primary float-end"><i class="fa-solid fa-cog"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div id="shipping-method" class="col-md">
|
||||
<div class="input-group mb-3">
|
||||
<div class="form-control border rounded-start">
|
||||
<div class="lead"><strong>{{ text_shipping_method }}</strong>
|
||||
<br/>
|
||||
{% if shipping_method %}
|
||||
<span id="shipping-method-value">{{ shipping_method }}</span>
|
||||
{% else %}
|
||||
<span id="shipping-method-value"></span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="shipping_code" value="{{ shipping_code }}" id="input-shipping-code"/>
|
||||
<button type="button" id="button-shipping-methods" class="btn btn-outline-primary"><i class="fa-solid fa-cog"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="payment-method" class="col-md">
|
||||
<div class="input-group mb-3">
|
||||
<div class="form-control border rounded-start">
|
||||
<div class="lead"><strong>{{ text_payment_method }}</strong>
|
||||
<br/>
|
||||
{% if payment_method %}
|
||||
<span id="payment-method-value">{{ payment_method }}</span>
|
||||
{% else %}
|
||||
<span id="payment-method-value"></span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="payment_code" value="{{ payment_code }}" id="input-payment-code"/>
|
||||
<button type="button" id="button-payment-methods" class="btn btn-outline-primary"><i class="fa-solid fa-cog"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<fieldset>
|
||||
<legend>{{ text_product }}</legend>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{{ column_product }}</td>
|
||||
<td>{{ column_quantity }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><a href="{{ product }}" target="_blank">{{ product_name }}</a>
|
||||
{% if options %}
|
||||
{% for option in options %}
|
||||
<br/>
|
||||
<small> - {{ option.name }}: {{ option.value }}</small>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
<br/>
|
||||
<small> - {{ text_subscription }}: {{ description }}</small>
|
||||
</td>
|
||||
<td>{{ quantity }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<input type="hidden" name="subscription_id" value="{{ subscription_id }}" id="input-subscription-id"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_history }}</div>
|
||||
<div class="card-body">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item"><a href="#tab-history" data-bs-toggle="tab" class="nav-link active">{{ tab_history }}</a></li>
|
||||
<li class="nav-item"><a href="#tab-order" data-bs-toggle="tab" class="nav-link">{{ tab_order }}</a></li>
|
||||
{% for tab in tabs %}
|
||||
<li class="nav-item"><a href="#tab-{{ tab.code }}" data-bs-toggle="tab" class="nav-link">{{ tab.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="tab-history" class="tab-pane active">
|
||||
<fieldset>
|
||||
<legend>{{ text_history }}</legend>
|
||||
<div id="history">{{ history }}</div>
|
||||
</fieldset>
|
||||
<form id="form-history">
|
||||
<fieldset>
|
||||
<legend>{{ text_history_add }}</legend>
|
||||
<div class="row mb-3">
|
||||
<label for="input-subscription-status" class="col-sm-2 col-form-label">{{ entry_subscription_status }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="subscription_status_id" id="input-subscription-status" class="form-select">
|
||||
{% for subscription_status in subscription_statuses %}
|
||||
<option value="{{ subscription_status.subscription_status_id }}"{% if subscription_status.subscription_status_id == subscription_status_id %} selected{% endif %}>{{ subscription_status.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_override }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check form-switch form-switch-lg">
|
||||
<input type="hidden" name="override" value="0"/> <input type="checkbox" name="override" value="1" id="input-override" class="form-check-input">
|
||||
</div>
|
||||
<div class="form-text">{{ help_override }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_notify }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check form-switch form-switch-lg">
|
||||
<input type="hidden" name="notify" value="0"/> <input type="checkbox" name="notify" value="1" id="input-notify" class="form-check-input"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-comment" class="col-sm-2 col-form-label">{{ entry_comment }}</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea name="comment" rows="8" placeholder="{{ entry_comment }}" id="input-comment" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="submit" id="button-history" class="btn btn-primary"><i class="fa-solid fa-plus-circle"></i> {{ button_history_add }}</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<div id="tab-order" class="tab-pane">
|
||||
<fieldset>
|
||||
<legend>{{ text_order }}</legend>
|
||||
<div id="order">{{ orders }}</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{% for tab in tabs %}
|
||||
<div id="tab-{{ tab.code }}" class="tab-pane">{{ tab.content }}</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form id="form-subscription">
|
||||
<div id="modal-customer" class="modal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">{{ text_customer }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="mb-3">
|
||||
<label for="input-customer" class="form-label">{{ entry_customer }}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="customer" value="{{ firstname }} {{ lastname }}" placeholder="{{ entry_customer }}" id="input-customer" data-oc-target="autocomplete-customer" class="form-control" autocomplete="off"/><a href="{{ customer_add }}" target="_blank" data-bs-toggle="tooltip" title="{{ button_customer_add }}" class="btn btn-outline-secondary"><i class="fa-solid fa-user-plus"></i></a>
|
||||
</div>
|
||||
<input type="hidden" name="customer_id" value="{{ customer_id }}" id="input-customer-id"/>
|
||||
<ul id="autocomplete-customer" class="dropdown-menu"></ul>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="button" id="button-customer" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i> {{ button_save }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="modal-subscription-plan" class="modal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">{{ text_subscription }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="mb-3">
|
||||
<label for="input-subscription-plan" class="form-label">{{ entry_subscription_plan }}</label> <select name="subscription_plan_id" id="input-subscription-plan" class="form-select">
|
||||
<option value="0" selected>{{ text_none }}</option>
|
||||
{% for subscription_plan in subscription_plans %}
|
||||
<option value="{{ subscription_plan.subscription_plan_id }}"{% if subscription_plan.subscription_plan_id == subscription_plan_id %} selected{% endif %}>{{ subscription_plan.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div id="error-subscription-plan" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<fieldset>
|
||||
<legend>{{ text_trial }}</legend>
|
||||
<div class="mb-3">
|
||||
<label for="input-trial-price" class="form-label">{{ entry_trial_price }}</label> <input type="text" name="trial_price" value="{{ trial_price }}" placeholder="{{ entry_trial_price }}" id="input-trial-price" class="form-control"/>
|
||||
<div class="form-text">{{ help_trial_price }}</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-trial-duration" class="form-label">{{ entry_trial_duration }}</label> <input type="text" name="trial_duration" value="{{ trial_duration }}" placeholder="{{ entry_trial_duration }}" id="input-trial-duration" class="form-control"/>
|
||||
<div id="error-trial-duration" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-trial-remaining" class="form-label">{{ entry_trial_remaining }}</label> <input type="text" name="remaining" value="{{ trial_remaining }}" placeholder="{{ entry_trial_remaining }}" id="input-trial-remaining" class="form-control"/>
|
||||
<div id="error-trial-remaining" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-trial-cycle" class="form-label">{{ entry_trial_cycle }}</label> <input type="text" name="trial_cycle" value="{{ trial_cycle }}" placeholder="{{ entry_trial_cycle }}" id="input-trial-cycle" class="form-control"/>
|
||||
<div id="error-trial-cycle" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-trial-frequency" class="form-label">{{ entry_trial_frequency }}</label> <select name="trial_frequency" id="input-trial-frequency" class="form-select">
|
||||
{% for frequency in frequencies %}
|
||||
<option value="{{ frequency.value }}"{% if frequency.value == trial_frequency %} selected{% endif %}>{{ frequency.text }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div id="error-trial-frequency" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{{ entry_trial_status }}</label>
|
||||
<div class="form-check form-switch form-switch-lg">
|
||||
<input type="hidden" name="trial_status" value="0"/>
|
||||
<input type="checkbox" name="trial_status" value="1" id="input-trial-status" class="form-check-input"{% if trial_status %} checked{% endif %}/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{{ text_subscription }}</legend>
|
||||
<div class="mb-3">
|
||||
<label for="input-price" class="form-label">{{ entry_price }}</label>
|
||||
<input type="text" name="trial_price" value="{{ price }}" placeholder="{{ entry_price }}" id="input-price" class="form-control"/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-duration" class="form-label">{{ entry_duration }}</label>
|
||||
<input type="text" name="duration" value="{{ duration }}" placeholder="{{ entry_duration }}" id="input-duration" class="form-control"/>
|
||||
<div id="error-duration" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-remaining" class="form-label">{{ entry_remaining }}</label>
|
||||
<input type="text" name="remaining" value="{{ remaining }}" placeholder="{{ entry_remaining }}" id="input-remaining" class="form-control"/>
|
||||
<div id="error-remaining" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-cycle" class="form-label">{{ entry_cycle }}</label>
|
||||
<input type="text" name="cycle" value="{{ cycle }}" placeholder="{{ entry_cycle }}" id="input-cycle" class="form-control"/>
|
||||
<div id="error-cycle" class="invalid-feedback"></div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-frequency" class="form-label">{{ entry_frequency }}</label>
|
||||
<select name="frequency" id="input-frequency" class="form-select">
|
||||
{% for frequency in frequencies %}
|
||||
<option value="{{ frequency.value }}"{% if frequency.value == frequency %} selected{% endif %}>{{ frequency.text }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div id="error-frequency" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend>{{ text_date_next }}</legend>
|
||||
<div class="mb-3">
|
||||
<div class="input-group">
|
||||
<input type="text" name="date_next" value="{{ date_next }}" placeholder="{{ entry_date_next }}" id="input-date-next" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
<div class="form-text">{{ help_date_next }}</div>
|
||||
<div id="error-date-next" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="text-end">
|
||||
<button type="button" id="button-customer" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i> {{ button_save }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modal-payment-address" class="modal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">{{ text_payment_address }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="mb-3">
|
||||
<label for="input-payment-address" class="form-label">{{ entry_address }}</label>
|
||||
<select name="payment_address" id="input-payment-address" class="form-select">
|
||||
<option value="0" selected>{{ text_none }}</option>
|
||||
{% for address in addresses %}
|
||||
<option value="{{ address.address_id }}">{{ address.firstname }} {{ address.lastname }},{% if address.company %} {{ address.company }},{% endif %} {{ address.address_1 }}, {{ address.city }}, {{ address.country }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="button" id="button-customer" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i> {{ button_save }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="modal-shipping-address" class="modal">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">{{ text_shipping_address }}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="mb-3">
|
||||
<label for="input-shipping-address" class="form-label">{{ entry_address }}</label>
|
||||
<select name="shipping_address" id="input-shipping-address" class="form-select">
|
||||
<option value="0" selected>{{ text_none }}</option>
|
||||
{% for address in addresses %}
|
||||
<option value="{{ address.address_id }}">{{ address.firstname }} {{ address.lastname }},{% if address.company %} {{ address.company }},{% endif %} {{ address.address_1 }}, {{ address.city }}, {{ address.country }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="button" id="button-customer" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i> {{ button_save }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
<script type="text/javascript"><!--
|
||||
$('#input-customer').autocomplete({
|
||||
'source': function(request, response) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=customer/customer.autocomplete&user_token={{ user_token }}&filter_name=' + encodeURIComponent(request),
|
||||
dataType: 'json',
|
||||
success: function(json) {
|
||||
response($.map(json, function(item) {
|
||||
return {
|
||||
category: item['customer_group'],
|
||||
label: item['name'],
|
||||
value: item['customer_id'],
|
||||
customer_group_id: item['customer_group_id']
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
'select': function(item) {
|
||||
$('#input-customer').val(item['label']);
|
||||
$('#input-customer-id').val(item['value']);
|
||||
$('#input-customer-group').val(item['customer_group_id']);
|
||||
}
|
||||
});
|
||||
|
||||
$('#input-product').autocomplete({
|
||||
'source': function(request, response) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=catalog/product.autocomplete&user_token={{ user_token }}&filter_name=' + encodeURIComponent(request),
|
||||
dataType: 'json',
|
||||
success: function(json) {
|
||||
response($.map(json, function(item) {
|
||||
return {
|
||||
label: item['name'],
|
||||
value: item['product_id'],
|
||||
model: item['model']
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
'select': function(item) {
|
||||
$('#input-product').val(item['label']);
|
||||
$('#input-product-id').val(item['value']);
|
||||
$('#input-model').val(item['model']);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#history').on('click', '.pagination a', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#history').load(this.href);
|
||||
});
|
||||
|
||||
$('#form-history').on('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=sale/subscription.addHistory&user_token={{ user_token }}&subscription_id=' + $('#input-subscription-id').val(),
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: $('#form-history').serialize(),
|
||||
contentType: 'application/x-www-form-urlencoded',
|
||||
beforeSend: function() {
|
||||
$('#button-history').button('loading');
|
||||
},
|
||||
complete: function() {
|
||||
$('#button-history').button('reset');
|
||||
},
|
||||
success: function(json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$('#history').load('index.php?route=sale/subscription.history&user_token={{ user_token }}&subscription_id=' + $('#input-subscription-id').val());
|
||||
|
||||
$('#input-history').val('');
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#order').on('click', '.pagination a', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#order').load(this.href);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
38
admininistrator/view/template/sale/subscription_list.twig
Normal file
38
admininistrator/view/template/sale/subscription_list.twig
Normal file
@ -0,0 +1,38 @@
|
||||
<form id="form-subscription" method="post" data-oc-toggle="ajax" data-oc-load="{{ action }}" data-oc-target="#subscription">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-end"><a href="{{ sort_subscription }}"{% if sort == 's.subscription_id' %} class="{{ order|lower }}"{% endif %}>{{ column_subscription_id }}</a></td>
|
||||
<td class="text-end"><a href="{{ sort_order }}"{% if sort == 's.order_id' %} class="{{ order|lower }}"{% endif %}>{{ column_order_id }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_customer }}"{% if sort == 'customer' %} class="{{ order|lower }}"{% endif %}>{{ column_customer }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_status }}"{% if sort == 's.status' %} class="{{ order|lower }}"{% endif %}>{{ column_status }}</a></td>
|
||||
<td class="text-start d-none d-lg-table-cell"><a href="{{ sort_date_added }}"{% if sort == 's.date_added' %} class="{{ order|lower }}"{% endif %}>{{ column_date_added }}</a></td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if subscriptions %}
|
||||
{% for subscription in subscriptions %}
|
||||
<tr>
|
||||
<td class="text-end">{{ subscription.subscription_id }}</td>
|
||||
<td class="text-end">{{ subscription.order_id }}</td>
|
||||
<td class="text-start">{{ subscription.customer }}</td>
|
||||
<td class="text-start">{{ subscription.status }}</td>
|
||||
<td class="text-start d-none d-lg-table-cell">{{ subscription.date_added }}</td>
|
||||
<td class="text-end"><a href="{{ subscription.view }}" data-bs-toggle="tooltip" title="{{ button_view }}" class="btn btn-primary"><i class="fa-solid fa-eye"></i></a> <a href="{{ subscription.order }}" data-bs-toggle="tooltip" title="{{ button_order }}" class="btn btn-light"><i class="fa-solid fa-shopping-cart"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="6">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
</form>
|
32
admininistrator/view/template/sale/subscription_order.twig
Normal file
32
admininistrator/view/template/sale/subscription_order.twig
Normal file
@ -0,0 +1,32 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-end">{{ column_order_id }}</td>
|
||||
<td class="text-start">{{ column_status }}</td>
|
||||
<td class="text-end">{{ column_total }}</td>
|
||||
<td class="text-start">{{ column_date_added }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if orders %}
|
||||
{% for order in orders %}
|
||||
<tr>
|
||||
<td class="text-end"><a href="{{ order.view }}" target="_blank">{{ order.order_id }}</a></td>
|
||||
<td class="text-start">{{ order.status }}</td>
|
||||
<td class="text-end">{{ order.total }}</td>
|
||||
<td class="text-start">{{ order.date_added }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="4">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
59
admininistrator/view/template/sale/voucher.twig
Normal file
59
admininistrator/view/template/sale/voucher.twig
Normal file
@ -0,0 +1,59 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="button" id="button-send" data-bs-toggle="tooltip" title="{{ button_send }}" class="btn btn-warning"><i class="fa-solid fa-envelope"></i></button>
|
||||
<a href="{{ add }}" data-bs-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa-solid fa-plus"></i></a>
|
||||
<button type="submit" form="form-voucher" formaction="{{ delete }}" data-bs-toggle="tooltip" title="{{ button_delete }}" onclick="return confirm('{{ text_confirm }}');" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_list }}</div>
|
||||
<div id="voucher" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#voucher').on('click', 'thead a, .pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#voucher').load(this.href);
|
||||
});
|
||||
|
||||
$('#button-send').on('click', function () {
|
||||
$.ajax({
|
||||
url: 'index.php?route=sale/voucher.send&user_token={{ user_token }}',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: $('input[name^=\'selected\']:checked'),
|
||||
beforeSend: function () {
|
||||
$('#button-send').prop('disabled', true);
|
||||
},
|
||||
complete: function () {
|
||||
$('#button-send').prop('disabled', false);
|
||||
},
|
||||
success: function (json) {
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
})
|
||||
//--></script>
|
||||
{{ footer }}
|
155
admininistrator/view/template/sale/voucher_form.twig
Normal file
155
admininistrator/view/template/sale/voucher_form.twig
Normal file
@ -0,0 +1,155 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
{% if voucher_id %}
|
||||
<button type="button" id="button-send" data-bs-toggle="tooltip" title="{{ button_send }}" class="btn btn-warning"><i class="fa-solid fa-envelope"></i></button>
|
||||
{% endif %}
|
||||
<button type="submit" form="form-voucher" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i></button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-pencil"></i> {{ text_form }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-voucher" action="{{ save }}" method="post" data-oc-toggle="ajax">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item"><a href="#tab-general" data-bs-toggle="tab" class="nav-link active">{{ tab_general }}</a></li>
|
||||
<li class="nav-item"><a href="#tab-history" data-bs-toggle="tab" class="nav-link">{{ tab_history }}</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="tab-general" class="tab-pane active">
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-code" class="col-sm-2 col-form-label">{{ entry_code }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="code" value="{{ code }}" placeholder="{{ entry_code }}" id="input-code" class="form-control"/>
|
||||
<div class="form-text">{{ help_code }}</div>
|
||||
<div id="error-code" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-from-name" class="col-sm-2 col-form-label">{{ entry_from_name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="from_name" value="{{ from_name }}" placeholder="{{ entry_from_name }}" id="input-from-name" class="form-control"/>
|
||||
<div id="error-from-name" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-from-email" class="col-sm-2 col-form-label">{{ entry_from_email }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="from_email" value="{{ from_email }}" placeholder="{{ entry_from_email }}" id="input-from-email" class="form-control"/>
|
||||
<div id="error-from-email" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-to-name" class="col-sm-2 col-form-label">{{ entry_to_name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="to_name" value="{{ to_name }}" placeholder="{{ entry_to_name }}" id="input-to-name" class="form-control"/>
|
||||
<div id="error-to-name" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-to-email" class="col-sm-2 col-form-label">{{ entry_to_email }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="to_email" value="{{ to_email }}" placeholder="{{ entry_to_email }}" id="input-to-email" class="form-control"/>
|
||||
<div id="error-to-email" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-theme" class="col-sm-2 col-form-label">{{ entry_theme }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="voucher_theme_id" id="input-theme" class="form-select">
|
||||
{% for voucher_theme in voucher_themes %}
|
||||
{% if voucher_theme.voucher_theme_id == voucher_theme_id %}
|
||||
<option value="{{ voucher_theme.voucher_theme_id }}" selected>{{ voucher_theme.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ voucher_theme.voucher_theme_id }}">{{ voucher_theme.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-message" class="col-sm-2 col-form-label">{{ entry_message }}</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea name="message" rows="5" placeholder="{{ entry_message }}" id="input-message" class="form-control">{{ message }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-amount" class="col-sm-2 col-form-label">{{ entry_amount }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="amount" value="{{ amount }}" placeholder="{{ entry_amount }}" id="input-amount" class="form-control"/>
|
||||
<div id="error-amount" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_status }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check form-switch form-switch-lg">
|
||||
<input type="hidden" name="status" value="0"/>
|
||||
<input type="checkbox" name="status" value="1" id="input-status" class="form-check-input"{% if status %} checked{% endif %}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tab-history" class="tab-pane">
|
||||
<fieldset>
|
||||
<legend>{{ text_history }}</legend>
|
||||
<div id="history">{{ history }}</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="voucher_id" value="{{ voucher_id }}" id="input-voucher-id"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#button-send').on('click', function () {
|
||||
var element = this;
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=sale/voucher.send&user_token={{ user_token }}',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: 'voucher_id=' + $('#input-voucher-id').val(),
|
||||
beforeSend: function () {
|
||||
$(element).prop('disabled', true);
|
||||
},
|
||||
complete: function () {
|
||||
$(element).prop('disabled', false);
|
||||
},
|
||||
success: function (json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#history').on('click', '.pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#history').load(this.href);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
32
admininistrator/view/template/sale/voucher_history.twig
Normal file
32
admininistrator/view/template/sale/voucher_history.twig
Normal file
@ -0,0 +1,32 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-end">{{ column_order_id }}</td>
|
||||
<td class="text-start">{{ column_customer }}</td>
|
||||
<td class="text-end">{{ column_amount }}</td>
|
||||
<td class="text-start">{{ column_date_added }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if histories %}
|
||||
{% for history in histories %}
|
||||
<tr>
|
||||
<td class="text-end">{{ history.order_id }}</td>
|
||||
<td class="text-start">{{ history.customer }}</td>
|
||||
<td class="text-end">{{ history.amount }}</td>
|
||||
<td class="text-start">{{ history.date_added }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="4">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
53
admininistrator/view/template/sale/voucher_list.twig
Normal file
53
admininistrator/view/template/sale/voucher_list.twig
Normal file
@ -0,0 +1,53 @@
|
||||
<form id="form-voucher" method="post" data-oc-toggle="ajax" data-oc-load="{{ action }}" data-oc-target="#voucher">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center" style="width: 1px;"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', $(this).prop('checked'));" class="form-check-input"/></td>
|
||||
<td class="text-start"><a href="{{ sort_code }}"{% if sort == 'v.code' %} class="{{ order|lower }}"{% endif %}>{{ column_code }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_from }}"{% if sort == 'v.from_name' %} class="{{ order|lower }}"{% endif %}>{{ column_from }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_to }}"{% if sort == 'v.to_name' %} class="{{ order|lower }}"{% endif %}>{{ column_to }}</a></td>
|
||||
<td class="text-end"><a href="{{ sort_amount }}"{% if sort == 'v.amount' %} class="{{ order|lower }}"{% endif %}>{{ column_amount }}</a></td>
|
||||
<td class="text-start d-none d-lg-table-cell"><a href="{{ sort_theme }}"{% if sort == 'theme' %} class="{{ order|lower }}"{% endif %}>{{ column_theme }}</a></td>
|
||||
<td class="text-start d-none d-lg-table-cell"><a href="{{ sort_date_added }}"{% if sort == 'v.date_added' %} class="{{ order|lower }}"{% endif %}>{{ column_date_added }}</a></td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if vouchers %}
|
||||
{% for voucher in vouchers %}
|
||||
<tr>
|
||||
<td class="text-center"><input type="checkbox" name="selected[]" value="{{ voucher.voucher_id }}" class="form-check-input"/></td>
|
||||
<td class="text-start">{{ voucher.code }}
|
||||
<br/>
|
||||
{% if voucher.status %}
|
||||
<small class="text-success">{{ text_enabled }}</small>
|
||||
{% else %}
|
||||
<small class="text-danger">{{ text_disabled }}</small>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-start">{{ voucher.from }}</td>
|
||||
<td class="text-start">{{ voucher.to }}</td>
|
||||
<td class="text-end">{{ voucher.amount }}</td>
|
||||
<td class="text-start d-none d-lg-table-cell">{{ voucher.theme }}</td>
|
||||
<td class="text-start d-none d-lg-table-cell">{{ voucher.date_added }}</td>
|
||||
<td class="text-end">
|
||||
{% if voucher.order %}
|
||||
<a href="{{ voucher.order }}" data-bs-toggle="tooltip" title="{{ button_order }}" class="btn btn-info"><i class="fa-solid fa-eye"></i></a>
|
||||
{% endif %}
|
||||
<a href="{{ voucher.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa-solid fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="9">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
</form>
|
30
admininistrator/view/template/sale/voucher_theme.twig
Normal file
30
admininistrator/view/template/sale/voucher_theme.twig
Normal file
@ -0,0 +1,30 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end"><a href="{{ add }}" data-bs-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa-solid fa-plus"></i></a>
|
||||
<button type="submit" form="form-voucher-theme" formaction="{{ delete }}" data-bs-toggle="tooltip" title="{{ button_delete }}" onclick="return confirm('{{ text_confirm }}');" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_list }}</div>
|
||||
<div id="voucher-theme" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#voucher-theme').on('click', 'thead a, .pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#voucher-theme').load(this.href);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
52
admininistrator/view/template/sale/voucher_theme_form.twig
Normal file
52
admininistrator/view/template/sale/voucher_theme_form.twig
Normal file
@ -0,0 +1,52 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="submit" form="form-voucher-theme" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i></button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-pencil"></i> {{ text_form }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-voucher-theme" action="{{ save }}" method="post" data-oc-toggle="ajax">
|
||||
<div class="row mb-3 required">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_name }}</label>
|
||||
<div class="col-sm-10">
|
||||
{% for language in languages %}
|
||||
<div class="input-group">
|
||||
<div class="input-group-text"><img src="{{ language.image }}" title="{{ language.name }}"/></div>
|
||||
<input type="text" name="voucher_theme_description[{{ language.language_id }}][name]" value="{{ voucher_theme_description[language.language_id] ? voucher_theme_description[language.language_id].name }}" placeholder="{{ entry_name }}" id="input-name-{{ language.language_id }}" class="form-control"/>
|
||||
</div>
|
||||
<div id="error-name-{{ language.language_id }}" class="invalid-feedback"></div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-image" class="col-sm-2 col-form-label">{{ entry_image }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="card image">
|
||||
<img src="{{ thumb }}" alt="" title="" id="thumb-image" data-oc-placeholder="{{ placeholder }}" class="card-img-top"/> <input type="hidden" name="image" value="{{ image }}" id="input-image"/>
|
||||
<div class="card-body">
|
||||
<button type="button" data-oc-toggle="image" data-oc-target="#input-image" data-oc-thumb="#thumb-image" class="btn btn-primary btn-sm btn-block"><i class="fa-solid fa-pencil"></i> {{ button_edit }}</button>
|
||||
<button type="button" data-oc-toggle="clear" data-oc-target="#input-image" data-oc-thumb="#thumb-image" class="btn btn-warning btn-sm btn-block"><i class="fa-regular fa-trash-can"></i> {{ button_clear }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="error-image" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="voucher_theme_id" value="{{ voucher_theme_id }}" id="input-voucher-theme-id"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ footer }}
|
32
admininistrator/view/template/sale/voucher_theme_list.twig
Normal file
32
admininistrator/view/template/sale/voucher_theme_list.twig
Normal file
@ -0,0 +1,32 @@
|
||||
<form id="form-voucher-theme" method="post" data-oc-toggle="ajax" data-oc-load="{{ action }}" data-oc-target="#voucher-theme">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center" style="width: 1px;"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', $(this).prop('checked'));" class="form-check-input"/></td>
|
||||
<td class="text-start"><a href="{{ sort_name }}"{% if sort == 'name' %} class="{{ order|lower }}"{% endif %}>{{ column_name }}</a></td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if voucher_themes %}
|
||||
{% for voucher_theme in voucher_themes %}
|
||||
<tr>
|
||||
<td class="text-center"><input type="checkbox" name="selected[]" value="{{ voucher_theme.voucher_theme_id }}" class="form-check-input"/></td>
|
||||
<td class="text-start">{{ voucher_theme.name }}</td>
|
||||
<td class="text-end"><a href="{{ voucher_theme.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa-solid fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="3">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
</form>
|
Reference in New Issue
Block a user