first commit
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,32 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-left">{{ column_date_added }}</td>
|
||||
<td class="text-left">{{ column_comment }}</td>
|
||||
<td class="text-left">{{ column_status }}</td>
|
||||
<td class="text-left">{{ column_notify }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if histories %}
|
||||
{% for history in histories %}
|
||||
<tr>
|
||||
<td class="text-left">{{ history.date_added }}</td>
|
||||
<td class="text-left">{{ history.comment }}</td>
|
||||
<td class="text-left">{{ history.status }}</td>
|
||||
<td class="text-left">{{ 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-left">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-right">{{ results }}</div>
|
||||
</div>
|
||||
@@ -0,0 +1,597 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right"><a href="{{ invoice }}" target="_blank" data-toggle="tooltip" title="{{ button_invoice_print }}" class="btn btn-info"><i class="fa fa-print"></i></a> <a href="{{ shipping }}" target="_blank" data-toggle="tooltip" title="{{ button_shipping_print }}" class="btn btn-info"><i class="fa fa-truck"></i></a> <a href="{{ edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a> <a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-shopping-cart"></i> {{ text_order_detail }}</h3>
|
||||
</div>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 1%;"><button data-toggle="tooltip" title="{{ text_store }}" class="btn btn-info btn-xs"><i class="fa fa-shopping-cart fa-fw"></i></button></td>
|
||||
<td><a href="{{ store_url }}" target="_blank">{{ store_name }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><button data-toggle="tooltip" title="{{ text_date_added }}" class="btn btn-info btn-xs"><i class="fa fa-calendar fa-fw"></i></button></td>
|
||||
<td>{{ date_added }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><button data-toggle="tooltip" title="{{ text_payment_method }}" class="btn btn-info btn-xs"><i class="fa fa-credit-card fa-fw"></i></button></td>
|
||||
<td>{{ payment_method }}</td>
|
||||
</tr>
|
||||
{% if shipping_method %}
|
||||
<tr>
|
||||
<td><button data-toggle="tooltip" title="{{ text_shipping_method }}" class="btn btn-info btn-xs"><i class="fa fa-truck fa-fw"></i></button></td>
|
||||
<td>{{ shipping_method }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-user"></i> {{ text_customer_detail }}</h3>
|
||||
</div>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td style="width: 1%;"><button data-toggle="tooltip" title="{{ text_customer }}" class="btn btn-info btn-xs"><i class="fa fa-user fa-fw"></i></button></td>
|
||||
<td>{% if customer %} <a href="{{ customer }}" target="_blank">{{ firstname }} {{ lastname }}</a> {% else %}
|
||||
{{ firstname }} {{ lastname }}
|
||||
{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><button data-toggle="tooltip" title="{{ text_customer_group }}" class="btn btn-info btn-xs"><i class="fa fa-group fa-fw"></i></button></td>
|
||||
<td>{{ customer_group }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><button data-toggle="tooltip" title="{{ text_email }}" class="btn btn-info btn-xs"><i class="fa fa-envelope-o fa-fw"></i></button></td>
|
||||
<td><a href="mailto:{{ email }}">{{ email }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><button data-toggle="tooltip" title="{{ text_telephone }}" class="btn btn-info btn-xs"><i class="fa fa-phone fa-fw"></i></button></td>
|
||||
<td>{{ telephone }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-cog"></i> {{ text_option }}</h3>
|
||||
</div>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ text_invoice }}</td>
|
||||
<td id="invoice" class="text-right">{{ invoice_no }}</td>
|
||||
<td style="width: 1%;" class="text-center">{% if not invoice_no %}
|
||||
<button id="button-invoice" data-loading-text="{{ text_loading }}" data-toggle="tooltip" title="{{ button_generate }}" class="btn btn-success btn-xs"><i class="fa fa-cog"></i></button>
|
||||
{% else %}
|
||||
<button disabled="disabled" class="btn btn-success btn-xs"><i class="fa fa-refresh"></i></button>
|
||||
{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_reward }}</td>
|
||||
<td class="text-right">{{ reward }}</td>
|
||||
<td class="text-center">{% if customer and reward %}
|
||||
{% if not reward_total %}
|
||||
<button id="button-reward-add" data-loading-text="{{ text_loading }}" data-toggle="tooltip" title="{{ button_reward_add }}" class="btn btn-success btn-xs"><i class="fa fa-plus-circle"></i></button>
|
||||
{% else %}
|
||||
<button id="button-reward-remove" data-loading-text="{{ text_loading }}" data-toggle="tooltip" title="{{ button_reward_remove }}" class="btn btn-danger btn-xs"><i class="fa fa-minus-circle"></i></button>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<button disabled="disabled" class="btn btn-success btn-xs"><i class="fa fa-plus-circle"></i></button>
|
||||
{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_affiliate }}
|
||||
{% if affiliate %}
|
||||
(<a href="{{ affiliate }}">{{ affiliate_firstname }} {{ affiliate_lastname }}</a>)
|
||||
{% endif %}</td>
|
||||
<td class="text-right">{{ commission }}</td>
|
||||
<td class="text-center">{% if affiliate %}
|
||||
{% if not commission_total %}
|
||||
<button id="button-commission-add" data-loading-text="{{ text_loading }}" data-toggle="tooltip" title="{{ button_commission_add }}" class="btn btn-success btn-xs"><i class="fa fa-plus-circle"></i></button>
|
||||
{% else %}
|
||||
<button id="button-commission-remove" data-loading-text="{{ text_loading }}" data-toggle="tooltip" title="{{ button_commission_remove }}" class="btn btn-danger btn-xs"><i class="fa fa-minus-circle"></i></button>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<button disabled="disabled" class="btn btn-success btn-xs"><i class="fa fa-plus-circle"></i></button>
|
||||
{% endif %}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-info-circle"></i> {{ text_order }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 50%;" class="text-left">{{ text_payment_address }}</td>
|
||||
{% if shipping_method %}
|
||||
<td style="width: 50%;" class="text-left">{{ text_shipping_address }}</td>
|
||||
{% endif %} </tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-left">{{ payment_address }}</td>
|
||||
{% if shipping_method %}
|
||||
<td class="text-left">{{ shipping_address }}</td>
|
||||
{% endif %} </tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-left">{{ column_product }}</td>
|
||||
<td class="text-left">{{ column_model }}</td>
|
||||
<td class="text-right">{{ column_quantity }}</td>
|
||||
<td class="text-right">{{ column_price }}</td>
|
||||
<td class="text-right">{{ column_total }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{% for product in products %}
|
||||
<tr>
|
||||
<td class="text-left"><a href="{{ product.href }}">{{ product.name }}</a> {% for option in product.option %}
|
||||
<br/>
|
||||
{% if option.type != 'file' %}
|
||||
|
||||
<small> - {{ option.name }}: {{ option.value }}</small> {% else %}
|
||||
|
||||
<small> - {{ option.name }}: <a href="{{ option.href }}">{{ option.value }}</a></small> {% endif %}
|
||||
{% endfor %}</td>
|
||||
<td class="text-left">{{ product.model }}</td>
|
||||
<td class="text-right">{{ product.quantity }}</td>
|
||||
<td class="text-right">{{ product.price }}</td>
|
||||
<td class="text-right">{{ product.total }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% for voucher in vouchers %}
|
||||
<tr>
|
||||
<td class="text-left"><a href="{{ voucher.href }}">{{ voucher.description }}</a></td>
|
||||
<td class="text-left"></td>
|
||||
<td class="text-right">1</td>
|
||||
<td class="text-right">{{ voucher.amount }}</td>
|
||||
<td class="text-right">{{ voucher.amount }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% for total in totals %}
|
||||
<tr>
|
||||
<td colspan="4" class="text-right">{{ total.title }}</td>
|
||||
<td class="text-right">{{ total.text }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
{% if comment %}
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{{ text_comment }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ comment }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %} </div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-comment-o"></i> {{ text_history }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#tab-history" data-toggle="tab">{{ tab_history }}</a></li>
|
||||
<li><a href="#tab-additional" data-toggle="tab">{{ tab_additional }}</a></li>
|
||||
{% for tab in tabs %}
|
||||
<li><a href="#tab-{{ tab.code }}" data-toggle="tab">{{ tab.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tab-history">
|
||||
<div id="history"></div>
|
||||
<br/>
|
||||
<fieldset>
|
||||
<legend>{{ text_history_add }}</legend>
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-order-status">{{ entry_order_status }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="order_status_id" id="input-order-status" class="form-control">
|
||||
|
||||
|
||||
{% for order_statuses in order_statuses %}
|
||||
{% if order_statuses.order_status_id == order_status_id %}
|
||||
|
||||
|
||||
<option value="{{ order_statuses.order_status_id }}" selected="selected">{{ order_statuses.name }}</option>
|
||||
|
||||
|
||||
{% else %}
|
||||
|
||||
|
||||
<option value="{{ order_statuses.order_status_id }}">{{ order_statuses.name }}</option>
|
||||
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-override"><span data-toggle="tooltip" title="{{ help_override }}">{{ entry_override }}</span></label>
|
||||
<div class="col-sm-10">
|
||||
<div class="checkbox">
|
||||
<input type="checkbox" name="override" value="1" id="input-override"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-notify">{{ entry_notify }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="checkbox">
|
||||
<input type="checkbox" name="notify" value="1" id="input-notify"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-comment">{{ entry_comment }}</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea name="comment" rows="8" id="input-comment" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</fieldset>
|
||||
<div class="text-right">
|
||||
<button id="button-history" data-loading-text="{{ text_loading }}" class="btn btn-primary"><i class="fa fa-plus-circle"></i> {{ button_history_add }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="tab-additional"> {% if account_custom_fields %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="2">{{ text_account_custom_field }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{% for custom_field in account_custom_fields %}
|
||||
<tr>
|
||||
<td>{{ custom_field.name }}</td>
|
||||
<td>{{ custom_field.value }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if payment_custom_fields %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="2">{{ text_payment_custom_field }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{% for custom_field in payment_custom_fields %}
|
||||
<tr>
|
||||
<td>{{ custom_field.name }}</td>
|
||||
<td>{{ custom_field.value }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if shipping_method and shipping_custom_fields %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="2">{{ text_shipping_custom_field }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{% for custom_field in shipping_custom_fields %}
|
||||
<tr>
|
||||
<td>{{ custom_field.name }}</td>
|
||||
<td>{{ custom_field.value }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="2">{{ text_browser }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ text_ip }}</td>
|
||||
<td>{{ ip }}</td>
|
||||
</tr>
|
||||
{% if forwarded_ip %}
|
||||
<tr>
|
||||
<td>{{ text_forwarded_ip }}</td>
|
||||
<td>{{ forwarded_ip }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td>{{ text_user_agent }}</td>
|
||||
<td>{{ user_agent }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_accept_language }}</td>
|
||||
<td>{{ accept_language }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% for tab in tabs %}
|
||||
<div class="tab-pane" id="tab-{{ tab.code }}">{{ tab.content }}</div>
|
||||
{% endfor %} </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$(document).delegate('#button-invoice', 'click', function() {
|
||||
$.ajax({
|
||||
url: 'index.php?route=sale/order/createinvoiceno&user_token={{ user_token }}&order_id={{ order_id }}',
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
$('#button-invoice').button('loading');
|
||||
},
|
||||
complete: function() {
|
||||
$('#button-invoice').button('reset');
|
||||
},
|
||||
success: function(json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
|
||||
}
|
||||
|
||||
if (json['invoice_no']) {
|
||||
$('#invoice').html(json['invoice_no']);
|
||||
|
||||
$('#button-invoice').replaceWith('<button disabled="disabled" class="btn btn-success btn-xs"><i class="fa fa-cog"></i></button>');
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).delegate('#button-reward-add', 'click', function() {
|
||||
$.ajax({
|
||||
url: 'index.php?route=sale/order/addreward&user_token={{ user_token }}&order_id={{ order_id }}',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
$('#button-reward-add').button('loading');
|
||||
},
|
||||
complete: function() {
|
||||
$('#button-reward-add').button('reset');
|
||||
},
|
||||
success: function(json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');
|
||||
|
||||
$('#button-reward-add').replaceWith('<button id="button-reward-remove" data-toggle="tooltip" title="{{ button_reward_remove }}" class="btn btn-danger btn-xs"><i class="fa fa-minus-circle"></i></button>');
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).delegate('#button-reward-remove', 'click', function() {
|
||||
$.ajax({
|
||||
url: 'index.php?route=sale/order/removereward&user_token={{ user_token }}&order_id={{ order_id }}',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
$('#button-reward-remove').button('loading');
|
||||
},
|
||||
complete: function() {
|
||||
$('#button-reward-remove').button('reset');
|
||||
},
|
||||
success: function(json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');
|
||||
|
||||
$('#button-reward-remove').replaceWith('<button id="button-reward-add" data-toggle="tooltip" title="{{ button_reward_add }}" class="btn btn-success btn-xs"><i class="fa fa-plus-circle"></i></button>');
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).delegate('#button-commission-add', 'click', function() {
|
||||
$.ajax({
|
||||
url: 'index.php?route=sale/order/addcommission&user_token={{ user_token }}&order_id={{ order_id }}',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
$('#button-commission-add').button('loading');
|
||||
},
|
||||
complete: function() {
|
||||
$('#button-commission-add').button('reset');
|
||||
},
|
||||
success: function(json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');
|
||||
|
||||
$('#button-commission-add').replaceWith('<button id="button-commission-remove" data-toggle="tooltip" title="{{ button_commission_remove }}" class="btn btn-danger btn-xs"><i class="fa fa-minus-circle"></i></button>');
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).delegate('#button-commission-remove', 'click', function() {
|
||||
$.ajax({
|
||||
url: 'index.php?route=sale/order/removecommission&user_token={{ user_token }}&order_id={{ order_id }}',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
$('#button-commission-remove').button('loading');
|
||||
},
|
||||
complete: function() {
|
||||
$('#button-commission-remove').button('reset');
|
||||
},
|
||||
success: function(json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');
|
||||
|
||||
$('#button-commission-remove').replaceWith('<button id="button-commission-add" data-toggle="tooltip" title="{{ button_commission_add }}" class="btn btn-success btn-xs"><i class="fa fa-plus-circle"></i></button>');
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
var api_token = '';
|
||||
|
||||
$.ajax({
|
||||
url: '{{ catalog }}index.php?route=api/login',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: 'key={{ api_key }}',
|
||||
crossDomain: true,
|
||||
success: function(json) {
|
||||
$('.alert').remove();
|
||||
if (json['error']) {
|
||||
if (json['error']['key']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' + json['error']['key'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
|
||||
}
|
||||
if (json['error']['ip']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> ' + json['error']['ip'] + ' <button type="button" id="button-ip-add" data-loading-text="{{ text_loading }}" class="btn btn-danger btn-xs pull-right"><i class="fa fa-plus"></i>{{ button_ip_add }}</button></div>');
|
||||
}
|
||||
}
|
||||
if (json['token']) {
|
||||
api_token = json['token'];
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
$('#history').delegate('.pagination a', 'click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#history').load(this.href);
|
||||
});
|
||||
|
||||
$('#history').load('index.php?route=sale/order/history&user_token={{ user_token }}&order_id={{ order_id }}');
|
||||
|
||||
$('#button-history').on('click', function() {
|
||||
$.ajax({
|
||||
url: '{{ catalog }}index.php?route=api/order/history&api_token={{ api_token }}&store_id={{ store_id }}&order_id={{ order_id }}',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: 'order_status_id=' + encodeURIComponent($('select[name=\'order_status_id\']').val()) + '¬ify=' + ($('input[name=\'notify\']').prop('checked') ? 1 : 0) + '&override=' + ($('input[name=\'override\']').prop('checked') ? 1 : 0) + '&append=' + ($('input[name=\'append\']').prop('checked') ? 1 : 0) + '&comment=' + encodeURIComponent($('textarea[name=\'comment\']').val()),
|
||||
beforeSend: function() {
|
||||
$('#button-history').button('loading');
|
||||
},
|
||||
complete: function() {
|
||||
$('#button-history').button('reset');
|
||||
},
|
||||
success: function(json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#history').before('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#history').load('index.php?route=sale/order/history&user_token={{ user_token }}&order_id={{ order_id }}');
|
||||
|
||||
$('#history').before('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
|
||||
|
||||
$('textarea[name=\'comment\']').val('');
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
//--></script>
|
||||
</div>
|
||||
{{ footer }}
|
||||
@@ -0,0 +1,125 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="{{ direction }}" lang="{{ lang }}">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>{{ title }}</title>
|
||||
<base href="{{ base }}" />
|
||||
<link href="view/javascript/bootstrap/css/bootstrap.css" rel="stylesheet" media="all" />
|
||||
<script type="text/javascript" src="view/javascript/jquery/jquery-2.1.1.min.js"></script>
|
||||
<script type="text/javascript" src="view/javascript/bootstrap/js/bootstrap.min.js"></script>
|
||||
<link href="view/javascript/font-awesome/css/font-awesome.min.css" type="text/css" rel="stylesheet" />
|
||||
<link type="text/css" href="view/stylesheet/stylesheet.css" rel="stylesheet" media="all" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
{% for order in orders %}
|
||||
<div style="page-break-after: always;">
|
||||
<h1>{% if order.invoice_no %}{{ text_invoice }} #{{ order.invoice_no }}{% else %}{{ text_order }}{% endif %}</h1>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="2">{{ text_order_detail }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width: 50%;"><address>
|
||||
<strong>{{ order.store_name }}</strong><br />
|
||||
{{ order.store_address }}
|
||||
</address>
|
||||
<b>{{ text_telephone }}</b> {{ order.store_telephone }}<br />
|
||||
{% if order.store_fax %}
|
||||
<b>{{ text_fax }}</b> {{ order.store_fax }}<br />
|
||||
{% endif %}
|
||||
<b>{{ text_email }}</b> {{ order.store_email }}<br />
|
||||
<b>{{ text_website }}</b> <a href="{{ order.store_url }}">{{ order.store_url }}</a></td>
|
||||
<td style="width: 50%;"><b>{{ text_date_added }}</b> {{ order.date_added }}<br />
|
||||
{% if order.invoice_no %}
|
||||
<b>{{ text_invoice_no }}</b> {{ order.invoice_no }}<br />
|
||||
{% endif %}
|
||||
<b>{{ text_order_id }}</b> {{ order.order_id }}<br />
|
||||
<b>{{ text_payment_method }}</b> {{ order.payment_method }}<br />
|
||||
{% if order.shipping_method %}
|
||||
<b>{{ text_shipping_method }}</b> {{ order.shipping_method }}<br />
|
||||
{% endif %}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 50%;"><b>{{ text_payment_address }}</b></td>
|
||||
<td style="width: 50%;"><b>{{ text_shipping_address }}</b></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><address>
|
||||
{{ order.payment_address }}
|
||||
</address></td>
|
||||
<td><address>
|
||||
{{ order.shipping_address }}
|
||||
</address></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><b>{{ column_product }}</b></td>
|
||||
<td><b>{{ column_model }}</b></td>
|
||||
<td class="text-right"><b>{{ column_quantity }}</b></td>
|
||||
<td class="text-right"><b>{{ column_price }}</b></td>
|
||||
<td class="text-right"><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 %}</td>
|
||||
<td>{{ product.model }}</td>
|
||||
<td class="text-right">{{ product.quantity }}</td>
|
||||
<td class="text-right">{{ product.price }}</td>
|
||||
<td class="text-right">{{ product.total }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% for voucher in order.voucher %}
|
||||
<tr>
|
||||
<td>{{ voucher.description }}</td>
|
||||
<td></td>
|
||||
<td class="text-right">1</td>
|
||||
<td class="text-right">{{ voucher.amount }}</td>
|
||||
<td class="text-right">{{ voucher.amount }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% for total in order.total %}
|
||||
<tr>
|
||||
<td class="text-right" colspan="4"><b>{{ total.title }}</b></td>
|
||||
<td class="text-right">{{ total.text }}</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>
|
||||
@@ -0,0 +1,302 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right">
|
||||
<button type="button" data-toggle="tooltip" title="{{ button_filter }}" onclick="$('#filter-order').toggleClass('hidden-sm hidden-xs');" class="btn btn-default hidden-md hidden-lg"><i class="fa fa-filter"></i></button>
|
||||
<button type="submit" id="button-shipping" form="form-order" formaction="{{ shipping }}" formtarget="_blank" data-toggle="tooltip" title="{{ button_shipping_print }}" class="btn btn-info"><i class="fa fa-truck"></i></button>
|
||||
<button type="submit" id="button-invoice" form="form-order" formaction="{{ invoice }}" formtarget="_blank" data-toggle="tooltip" title="{{ button_invoice_print }}" class="btn btn-info"><i class="fa fa-print"></i></button>
|
||||
<a href="{{ add }}" data-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa fa-plus"></i></a> </div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if success %}
|
||||
<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div id="filter-order" class="col-md-3 col-md-push-9 col-sm-12 hidden-sm hidden-xs">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-filter"></i> {{ text_filter }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-order-id">{{ 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="form-group">
|
||||
<label class="control-label" for="input-customer">{{ entry_customer }}</label>
|
||||
<input type="text" name="filter_customer" value="{{ filter_customer }}" placeholder="{{ entry_customer }}" id="input-customer" class="form-control" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-order-status">{{ entry_order_status }}</label>
|
||||
<select name="filter_order_status_id" id="input-order-status" class="form-control">
|
||||
<option value=""></option>
|
||||
|
||||
{% if filter_order_status_id == '0' %}
|
||||
|
||||
<option value="0" selected="selected">{{ text_missing }}</option>
|
||||
|
||||
{% else %}
|
||||
|
||||
<option value="0">{{ text_missing }}</option>
|
||||
|
||||
{% endif %}
|
||||
{% for order_status in order_statuses %}
|
||||
{% if order_status.order_status_id == filter_order_status_id %}
|
||||
|
||||
<option value="{{ order_status.order_status_id }}" selected="selected">{{ order_status.name }}</option>
|
||||
|
||||
{% else %}
|
||||
|
||||
<option value="{{ order_status.order_status_id }}">{{ order_status.name }}</option>
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-total">{{ entry_total }}</label>
|
||||
<input type="text" name="filter_total" value="{{ filter_total }}" placeholder="{{ entry_total }}" id="input-total" class="form-control" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-date-added">{{ entry_date_added }}</label>
|
||||
<div class="input-group date">
|
||||
<input type="text" name="filter_date_added" value="{{ filter_date_added }}" placeholder="{{ entry_date_added }}" data-date-format="YYYY-MM-DD" id="input-date-added" class="form-control" />
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
|
||||
</span> </div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-date-modified">{{ entry_date_modified }}</label>
|
||||
<div class="input-group date">
|
||||
<input type="text" name="filter_date_modified" value="{{ filter_date_modified }}" placeholder="{{ entry_date_modified }}" data-date-format="YYYY-MM-DD" id="input-date-modified" class="form-control" />
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
|
||||
</span> </div>
|
||||
</div>
|
||||
<div class="form-group text-right">
|
||||
<button type="button" id="button-filter" class="btn btn-default"><i class="fa fa-filter"></i> {{ button_filter }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9 col-md-pull-3 col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list"></i> {{ text_list }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form method="post" action="" enctype="multipart/form-data" id="form-order">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" /></td>
|
||||
<td class="text-right">{% if sort == 'o.order_id' %} <a href="{{ sort_order }}" class="{{ order|lower }}">{{ column_order_id }}</a> {% else %} <a href="{{ sort_order }}">{{ column_order_id }}</a> {% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'customer' %} <a href="{{ sort_customer }}" class="{{ order|lower }}">{{ column_customer }}</a> {% else %} <a href="{{ sort_customer }}">{{ column_customer }}</a> {% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'order_status' %} <a href="{{ sort_status }}" class="{{ order|lower }}">{{ column_status }}</a> {% else %} <a href="{{ sort_status }}">{{ column_status }}</a> {% endif %}</td>
|
||||
<td class="text-right">{% if sort == 'o.total' %} <a href="{{ sort_total }}" class="{{ order|lower }}">{{ column_total }}</a> {% else %} <a href="{{ sort_total }}">{{ column_total }}</a> {% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'o.date_added' %} <a href="{{ sort_date_added }}" class="{{ order|lower }}">{{ column_date_added }}</a> {% else %} <a href="{{ sort_date_added }}">{{ column_date_added }}</a> {% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'o.date_modified' %} <a href="{{ sort_date_modified }}" class="{{ order|lower }}">{{ column_date_modified }}</a> {% else %} <a href="{{ sort_date_modified }}">{{ column_date_modified }}</a> {% endif %}</td>
|
||||
<td class="text-right">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{% if orders %}
|
||||
{% for order in orders %}
|
||||
<tr>
|
||||
<td class="text-center"> {% if order.order_id in selected %}
|
||||
<input type="checkbox" name="selected[]" value="{{ order.order_id }}" checked="checked" />
|
||||
{% else %}
|
||||
<input type="checkbox" name="selected[]" value="{{ order.order_id }}" />
|
||||
{% endif %}
|
||||
<input type="hidden" name="shipping_code[]" value="{{ order.shipping_code }}" /></td>
|
||||
<td class="text-right">{{ order.order_id }}</td>
|
||||
<td class="text-left">{{ order.customer }}</td>
|
||||
<td class="text-left">{{ order.order_status }}</td>
|
||||
<td class="text-right">{{ order.total }}</td>
|
||||
<td class="text-left">{{ order.date_added }}</td>
|
||||
<td class="text-left">{{ order.date_modified }}</td>
|
||||
<td class="text-right"><div style="min-width: 120px;">
|
||||
<div class="btn-group"> <a href="{{ order.view }}" data-toggle="tooltip" title="{{ button_view }}" class="btn btn-primary"><i class="fa fa-eye"></i></a>
|
||||
<button type="button" data-toggle="dropdown" class="btn btn-primary dropdown-toggle"><span class="caret"></span></button>
|
||||
<ul class="dropdown-menu dropdown-menu-right">
|
||||
<li><a href="{{ order.edit }}"><i class="fa fa-pencil"></i> {{ button_edit }}</a></li>
|
||||
<li><a href="{{ order.order_id }}"><i class="fa fa-trash-o"></i> {{ button_delete }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="8">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-left">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-right">{{ results }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#button-filter').on('click', function() {
|
||||
url = '';
|
||||
|
||||
var filter_order_id = $('input[name=\'filter_order_id\']').val();
|
||||
|
||||
if (filter_order_id) {
|
||||
url += '&filter_order_id=' + encodeURIComponent(filter_order_id);
|
||||
}
|
||||
|
||||
var filter_customer = $('input[name=\'filter_customer\']').val();
|
||||
|
||||
if (filter_customer) {
|
||||
url += '&filter_customer=' + encodeURIComponent(filter_customer);
|
||||
}
|
||||
|
||||
var filter_order_status_id = $('select[name=\'filter_order_status_id\']').val();
|
||||
|
||||
if (filter_order_status_id !== '') {
|
||||
url += '&filter_order_status_id=' + encodeURIComponent(filter_order_status_id);
|
||||
}
|
||||
|
||||
var filter_total = $('input[name=\'filter_total\']').val();
|
||||
|
||||
if (filter_total) {
|
||||
url += '&filter_total=' + encodeURIComponent(filter_total);
|
||||
}
|
||||
|
||||
var filter_date_added = $('input[name=\'filter_date_added\']').val();
|
||||
|
||||
if (filter_date_added) {
|
||||
url += '&filter_date_added=' + encodeURIComponent(filter_date_added);
|
||||
}
|
||||
|
||||
var filter_date_modified = $('input[name=\'filter_date_modified\']').val();
|
||||
|
||||
if (filter_date_modified) {
|
||||
url += '&filter_date_modified=' + encodeURIComponent(filter_date_modified);
|
||||
}
|
||||
|
||||
location = 'index.php?route=sale/order&user_token={{ user_token }}' + url;
|
||||
});
|
||||
//--></script>
|
||||
<script type="text/javascript"><!--
|
||||
$('input[name=\'filter_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[name=\'filter_customer\']').val(item['label']);
|
||||
}
|
||||
});
|
||||
//--></script>
|
||||
<script type="text/javascript"><!--
|
||||
$('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_code\']').val()) {
|
||||
$('#button-shipping').prop('disabled', false);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#button-shipping, #button-invoice').prop('disabled', true);
|
||||
|
||||
$('input[name^=\'selected\']:first').trigger('change');
|
||||
|
||||
// IE and Edge fix!
|
||||
$('#button-shipping, #button-invoice').on('click', function(e) {
|
||||
$('#form-order').attr('action', this.getAttribute('formAction'));
|
||||
});
|
||||
|
||||
$('#form-order li:last-child a').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var element = this;
|
||||
|
||||
if (confirm('{{ text_confirm }}')) {
|
||||
$.ajax({
|
||||
url: '{{ catalog }}index.php?route=api/order/delete&api_token={{ api_token }}&store_id={{ store_id }}&order_id=' + $(element).attr('href'),
|
||||
dataType: 'json',
|
||||
beforeSend: function() {
|
||||
$(element).parent().parent().parent().find('button').button('loading');
|
||||
},
|
||||
complete: function() {
|
||||
$(element).parent().parent().parent().find('button').button('reset');
|
||||
},
|
||||
success: function(json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
location = '{{ delete }}';
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
//--></script>
|
||||
<script src="view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
|
||||
<link href="view/javascript/jquery/datetimepicker/bootstrap-datetimepicker.min.css" type="text/css" rel="stylesheet" media="screen" />
|
||||
<script type="text/javascript"><!--
|
||||
$('.date').datetimepicker({
|
||||
language: '{{ datepicker }}',
|
||||
pickTime: false
|
||||
});
|
||||
$('#filter-order').on('keydown', function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
$('#button-filter').trigger('click')
|
||||
}
|
||||
});
|
||||
//--></script></div>
|
||||
{{ footer }}
|
||||
@@ -0,0 +1,122 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="{{ direction }}" lang="{{ lang }}">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>{{ title }}</title>
|
||||
<base href="{{ base }}" />
|
||||
<link href="view/javascript/bootstrap/css/bootstrap.css" rel="stylesheet" media="all" />
|
||||
<script type="text/javascript" src="view/javascript/jquery/jquery-2.1.1.min.js"></script>
|
||||
<script type="text/javascript" src="view/javascript/bootstrap/js/bootstrap.min.js"></script>
|
||||
<link href="view/javascript/font-awesome/css/font-awesome.min.css" type="text/css" rel="stylesheet" />
|
||||
<link type="text/css" href="view/stylesheet/stylesheet.css" rel="stylesheet" media="all" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
{% for order in orders %}
|
||||
<div style="page-break-after: always;">
|
||||
<h1>{{ text_picklist }} #{{ order.order_id }}</h1>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td colspan="2">{{ text_order_detail }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><address>
|
||||
<strong>{{ order.store_name }}</strong><br />
|
||||
{{ order.store_address }}
|
||||
</address>
|
||||
<b>{{ text_telephone }}</b> {{ order.store_telephone }}<br />
|
||||
<b>{{ text_email }}</b> {{ order.store_email }}<br />
|
||||
<b>{{ text_website }}</b> <a href="{{ order.store_url }}">{{ order.store_url }}</a></td>
|
||||
<td style="width: 50%;"><b>{{ text_date_added }}</b> {{ order.date_added }}<br />
|
||||
{% if order.invoice_no %}
|
||||
<b>{{ text_invoice_no }}</b> {{ order.invoice_no }}<br />
|
||||
{% endif %}
|
||||
<b>{{ text_order_id }}</b> {{ order.order_id }}<br />
|
||||
{% if order.shipping_method %}
|
||||
<b>{{ text_shipping_method }}</b> {{ order.shipping_method }}<br />
|
||||
{% endif %}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 50%;"><b>{{ text_shipping_address }}</b></td>
|
||||
<td style="width: 50%;"><b>{{ text_contact }}</b></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ order.shipping_address }}</td>
|
||||
<td>{{ order.email }}<br/>
|
||||
{{ order.telephone }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<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-right"><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 %}</td>
|
||||
<td>{{ product.weight }}</td>
|
||||
<td>{{ product.model }}</td>
|
||||
<td class="text-right">{{ 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>
|
||||
@@ -0,0 +1,7 @@
|
||||
<div class="buttons clearfix">
|
||||
<div class="pull-right">
|
||||
{% for button in buttons %}
|
||||
<a href="{{ button.link }}" class="btn btn-primary">{{ button.text }}</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,145 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right"><a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list"></i> {{ text_recurring_detail }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td>{{ text_order_recurring_id }}</td>
|
||||
<td>{{ order_recurring_id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_reference }}</td>
|
||||
<td>{{ reference }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_recurring_name }}</td>
|
||||
<td>{% if recurring %}
|
||||
<a href="{{ recurring }}">{{ recurring_name }}</a>
|
||||
{% else %}
|
||||
{{ recurring_name }}
|
||||
{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_recurring_description }}</td>
|
||||
<td>{{ recurring_description }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_recurring_status }}</td>
|
||||
<td>{{ recurring_status }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_payment_method }}</td>
|
||||
<td>{{ payment_method }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list"></i> {{ text_order_detail }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
<td>{{ text_order_id }}</td>
|
||||
<td><a href="{{ order }}">{{ order_id }}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_customer }}</td>
|
||||
<td>{% if customer %}
|
||||
<a href="{{ customer }}">{{ firstname }} {{ lastname }}</a>
|
||||
{% else %}
|
||||
{{ firstname }} {{ lastname }}
|
||||
{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_email }}</td>
|
||||
<td>{{ email }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_order_status }}</td>
|
||||
<td>{{ order_status }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{ text_date_added }}</td>
|
||||
<td>{{ date_added }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list"></i> {{ text_product_detail }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>{{ text_product }}</td>
|
||||
<td>{{ text_quantity }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ product }}</td>
|
||||
<td>{{ quantity }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list"></i> {{ text_transaction }}</h3>
|
||||
</div>
|
||||
<div class="panel-body"> {{ buttons }}
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-left">{{ column_date_added }}</td>
|
||||
<td class="text-right">{{ column_amount }}</td>
|
||||
<td class="text-left">{{ column_type }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if transactions %}
|
||||
{% for transaction in transactions %}
|
||||
<tr>
|
||||
<td class="text-left">{{ transaction.date_added }}</td>
|
||||
<td class="text-right">{{ transaction.amount }}</td>
|
||||
<td class="text-left">{{ transaction.type }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="7">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ footer }}
|
||||
@@ -0,0 +1,212 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right">
|
||||
<button type="button" data-toggle="tooltip" title="{{ button_filter }}" onclick="$('#filter-recurring').toggleClass('hidden-sm hidden-xs');" class="btn btn-default hidden-md hidden-lg"><i class="fa fa-filter"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if success %}
|
||||
<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div id="filter-recurring" class="col-md-3 col-md-push-9 col-sm-12 hidden-sm hidden-xs">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-filter"></i> {{ text_filter }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-order-recurring-id">{{ entry_order_recurring_id }}</label>
|
||||
<input type="text" name="filter_order_recurring_id" value="{{ filter_order_recurring_id }}" placeholder="{{ entry_order_recurring_id }}" id="input-order-recurring-id" class="form-control" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-customer">{{ entry_customer }}</label>
|
||||
<input type="text" name="filter_customer" value="{{ filter_customer }}" placeholder="{{ entry_customer }}" id="input-customer" class="form-control" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-order-id">{{ 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="form-group">
|
||||
<label class="control-label" for="input-status">{{ entry_status }}</label>
|
||||
<select name="filter_status" id="input-status" class="form-control">
|
||||
|
||||
{% for recurring_status in recurring_statuses %}
|
||||
{% if filter_status == recurring_status.value %}
|
||||
<option value="{{ recurring_status.value }}" selected="selected">{{ recurring_status.text }}</option>
|
||||
{% else %}
|
||||
<option value="{{ recurring_status.value }}">{{ recurring_status.text }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-reference">{{ entry_reference }}</label>
|
||||
<input type="text" name="filter_reference" value="{{ filter_reference }}" placeholder="{{ entry_reference }}" id="input-reference" class="form-control" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-date-date_added">{{ entry_date_added }}</label>
|
||||
<div class="input-group date">
|
||||
<input type="text" name="filter_date_added" value="{{ filter_date_added }}" placeholder="{{ entry_date_added }}" data-date-format="YYYY-MM-DD" id="input-date-date_added" class="form-control" />
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
|
||||
</span> </div>
|
||||
</div>
|
||||
<div class="form-group text-right">
|
||||
<button type="button" id="button-filter" class="btn btn-default"><i class="fa fa-filter"></i> {{ button_filter }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9 col-md-pull-3 col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list"></i> {{ text_list }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="" method="post" enctype="multipart/form-data" id="form-recurring">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-right">{% if sort == 'or.order_recurring_id' %} <a href="{{ sort_order_recurring }}" class="{{ order|lower }}">{{ column_order_recurring_id }}</a> {% else %} <a href="{{ sort_order_recurring }}">{{ column_order_recurring_id }}</a> {% endif %}</td>
|
||||
<td class="text-right">{% if sort == 'or.order_id' %} <a href="{{ sort_order }}" class="{{ order|lower }}">{{ column_order_id }}</a> {% else %} <a href="{{ sort_order }}">{{ column_order_id }}</a> {% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'or.reference' %} <a href="{{ sort_reference }}" class="{{ order|lower }}">{{ column_reference }}</a> {% else %} <a href="{{ sort_reference }}">{{ column_reference }}</a> {% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'customer' %} <a href="{{ sort_customer }}" class="{{ order|lower }}">{{ column_customer }}</a> {% else %} <a href="{{ sort_customer }}">{{ column_customer }}</a> {% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'or.status' %} <a href="{{ sort_status }}" class="{{ order|lower }}">{{ column_status }}</a> {% else %} <a href="{{ sort_status }}">{{ column_status }}</a> {% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'or.date_added' %} <a href="{{ sort_date_added }}" class="{{ order|lower }}">{{ column_date_added }}</a> {% else %} <a href="{{ sort_date_added }}">{{ column_date_added }}</a> {% endif %}</td>
|
||||
<td class="text-right">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{% if recurrings %}
|
||||
{% for recurring in recurrings %}
|
||||
<tr>
|
||||
<td class="text-right">{{ recurring.order_recurring_id }}</td>
|
||||
<td class="text-right">{{ recurring.order_id }}</td>
|
||||
<td class="text-left">{{ recurring.reference }}</td>
|
||||
<td class="text-left">{{ recurring.customer }}</td>
|
||||
<td class="text-left">{{ recurring.status }}</td>
|
||||
<td class="text-left">{{ recurring.date_added }}</td>
|
||||
<td class="text-right"><a href="{{ recurring.view }}" data-toggle="tooltip" title="{{ button_order_recurring }}" class="btn btn-info"><i class="fa fa-eye"></i></a> <a href="{{ recurring.order }}" data-toggle="tooltip" title="{{ button_order }}" class="btn btn-info"><i class="fa fa-shopping-cart"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="7">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-left">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-right">{{ results }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#button-filter').on('click', function() {
|
||||
url = 'index.php?route=sale/recurring&user_token={{ user_token }}';
|
||||
|
||||
var filter_order_recurring_id = $('input[name=\'filter_order_recurring_id\']').val();
|
||||
|
||||
if (filter_order_recurring_id) {
|
||||
url += '&filter_order_recurring_id=' + encodeURIComponent(filter_order_recurring_id);
|
||||
}
|
||||
|
||||
var filter_order_id = $('input[name=\'filter_order_id\']').val();
|
||||
|
||||
if (filter_order_id) {
|
||||
url += '&filter_order_id=' + encodeURIComponent(filter_order_id);
|
||||
}
|
||||
|
||||
var filter_reference = $('input[name=\'filter_reference\']').val();
|
||||
|
||||
if (filter_reference) {
|
||||
url += '&filter_reference=' + encodeURIComponent(filter_reference);
|
||||
}
|
||||
|
||||
var filter_customer = $('input[name=\'filter_customer\']').val();
|
||||
|
||||
if (filter_customer) {
|
||||
url += '&filter_customer=' + encodeURIComponent(filter_customer);
|
||||
}
|
||||
|
||||
var filter_status = $('select[name=\'filter_status\']').val();
|
||||
|
||||
if (filter_status != 0) {
|
||||
url += '&filter_status=' + encodeURIComponent(filter_status);
|
||||
}
|
||||
|
||||
var filter_date_added = $('input[name=\'filter_date_added\']').val();
|
||||
|
||||
if (filter_date_added != '') {
|
||||
url += '&filter_date_added=' + encodeURIComponent(filter_date_added);
|
||||
}
|
||||
|
||||
location = url;
|
||||
});
|
||||
|
||||
$('#form input').keydown(function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
filter();
|
||||
}
|
||||
});
|
||||
|
||||
$('.date').datetimepicker({
|
||||
language: '{{ datepicker }}',
|
||||
pickTime: false
|
||||
});
|
||||
//--></script>
|
||||
<script type="text/javascript"><!--
|
||||
$('input[name=\'filter_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[name=\'filter_customer\']').val(item['label']);
|
||||
}
|
||||
});
|
||||
//--></script>
|
||||
<script type="text/javascript"><!--
|
||||
$('#filter-recurring').on('keydown', function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
$('#button-filter').trigger('click')
|
||||
}
|
||||
});
|
||||
//--></script>
|
||||
</div>
|
||||
{{ footer }}
|
||||
@@ -0,0 +1,343 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right">
|
||||
<button type="submit" form="form-return" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa fa-save"></i></button>
|
||||
<a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a> </div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_form }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#tab-general" data-toggle="tab">{{ tab_general }}</a></li>
|
||||
{% if return_id %}
|
||||
<li><a href="#tab-history" data-toggle="tab">{{ tab_history }}</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tab-general">
|
||||
<form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-return" class="form-horizontal">
|
||||
<fieldset>
|
||||
<legend>{{ text_order }}</legend>
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-order-id">{{ 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" />
|
||||
{% if error_order_id %}
|
||||
<div class="text-danger">{{ error_order_id }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-date-ordered">{{ entry_date_ordered }}</label>
|
||||
<div class="col-sm-3">
|
||||
<div class="input-group date">
|
||||
<input type="text" name="date_ordered" value="{{ date_ordered }}" placeholder="{{ entry_date_ordered }}" data-date-format="YYYY-MM-DD" id="input-date-ordered" class="form-control" />
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-customer">{{ entry_customer }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="customer" value="{{ customer }}" placeholder="{{ entry_customer }}" id="input-customer" class="form-control" />
|
||||
<input type="hidden" name="customer_id" value="{{ customer_id }}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-firstname">{{ entry_firstname }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="firstname" value="{{ firstname }}" placeholder="{{ entry_firstname }}" id="input-firstname" class="form-control" />
|
||||
{% if error_firstname %}
|
||||
<div class="text-danger">{{ error_firstname }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-lastname">{{ entry_lastname }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="lastname" value="{{ lastname }}" placeholder="{{ entry_lastname }}" id="input-lastname" class="form-control" />
|
||||
{% if error_lastname %}
|
||||
<div class="text-danger">{{ error_lastname }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-email">{{ entry_email }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="email" value="{{ email }}" placeholder="{{ entry_email }}" id="input-email" class="form-control" />
|
||||
{% if error_email %}
|
||||
<div class="text-danger">{{ error_email }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-telephone">{{ entry_telephone }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="telephone" value="{{ telephone }}" placeholder="{{ entry_telephone }}" id="input-telephone" class="form-control" />
|
||||
{% if error_telephone %}
|
||||
<div class="text-danger">{{ error_telephone }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{{ text_product }}</legend>
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-product"><span data-toggle="tooltip" title="{{ help_product }}">{{ entry_product }}</span></label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="product" value="{{ product }}" placeholder="{{ entry_product }}" id="input-product" class="form-control" />
|
||||
<input type="hidden" name="product_id" value="{{ product_id }}" />
|
||||
{% if error_product %}
|
||||
<div class="text-danger">{{ error_product }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-model">{{ entry_model }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="model" value="{{ model }}" placeholder="{{ entry_model }}" id="input-model" class="form-control" />
|
||||
{% if error_model %}
|
||||
<div class="text-danger">{{ error_model }}</div>
|
||||
{% endif %} </div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-quantity">{{ 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="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-return-reason">{{ entry_return_reason }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="return_reason_id" id="input-return-reason" class="form-control">
|
||||
{% for return_reason in return_reasons %}
|
||||
{% if return_reason.return_reason_id == return_reason_id %}
|
||||
<option value="{{ return_reason.return_reason_id }}" selected="selected">{{ return_reason.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ return_reason.return_reason_id }}">{{ return_reason.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-opened">{{ entry_opened }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="opened" id="input-opened" class="form-control">
|
||||
{% if opened %}
|
||||
<option value="1" selected="selected">{{ text_opened }}</option>
|
||||
<option value="0">{{ text_unopened }}</option>
|
||||
{% else %}
|
||||
<option value="1">{{ text_opened }}</option>
|
||||
<option value="0" selected="selected">{{ text_unopened }}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-comment">{{ 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="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-return-action">{{ entry_return_action }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="return_action_id" id="input-return-action" class="form-control">
|
||||
<option value="0"></option>
|
||||
{% for return_action in return_actions %}
|
||||
{% if return_action.return_action_id == return_action_id %}
|
||||
<option value="{{ return_action.return_action_id }}" selected="selected"> {{ return_action.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ return_action.return_action_id }}">{{ return_action.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{% if not return_id %}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-return-status">{{ entry_return_status }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="return_status_id" id="input-return-status" class="form-control">
|
||||
{% for return_status in return_statuses %}
|
||||
{% if return_status.return_status_id == return_status_id %}
|
||||
<option value="{{ return_status.return_status_id }}" selected="selected">{{ return_status.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ return_status.return_status_id }}">{{ return_status.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
{% if return_id %}
|
||||
<div class="tab-pane" id="tab-history">
|
||||
<fieldset>
|
||||
<legend>{{ text_history }}</legend>
|
||||
<div id="history"></div>
|
||||
</fieldset>
|
||||
<br />
|
||||
<fieldset>
|
||||
<legend>{{ text_history_add }}</legend>
|
||||
<form class="form-horizontal">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-return-status">{{ entry_return_status }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="return_status_id" id="input-return-status" class="form-control">
|
||||
{% for return_status in return_statuses %}
|
||||
{% if return_status.return_status_id == return_status_id %}
|
||||
<option value="{{ return_status.return_status_id }}" selected="selected">{{ return_status.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ return_status.return_status_id }}">{{ return_status.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-notify">{{ entry_notify }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="checkbox" name="notify" value="1" id="input-notify" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-history-comment">{{ entry_comment }}</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea name="comment" rows="8" id="input-history-comment" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<button id="button-history" data-loading-text="{{ text_loading }}" class="btn btn-primary"><i class="fa fa-plus-circle"></i> {{ button_history_add }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</fieldset>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('input[name=\'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[name=\'customer\']').val(item['label']);
|
||||
$('input[name=\'customer_id\']').val(item['value']);
|
||||
$('input[name=\'firstname\']').val(item['firstname']);
|
||||
$('input[name=\'lastname\']').val(item['lastname']);
|
||||
$('input[name=\'email\']').val(item['email']);
|
||||
$('input[name=\'telephone\']').val(item['telephone']);
|
||||
}
|
||||
});
|
||||
//--></script>
|
||||
<script type="text/javascript"><!--
|
||||
$('input[name=\'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[name=\'product\']').val(item['label']);
|
||||
$('input[name=\'product_id\']').val(item['value']);
|
||||
$('input[name=\'model\']').val(item['model']);
|
||||
}
|
||||
});
|
||||
|
||||
$('#history').delegate('.pagination a', 'click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#history').load(this.href);
|
||||
});
|
||||
|
||||
$('#history').load('index.php?route=sale/return/history&user_token={{ user_token }}&return_id={{ return_id }}');
|
||||
|
||||
$('#button-history').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=sale/return/addhistory&user_token={{ user_token }}&return_id={{ return_id }}',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: 'return_status_id=' + encodeURIComponent($('#tab-history select[name=\'return_status_id\']').val()) + '¬ify=' + ($('input[name=\'notify\']').prop('checked') ? 1 : 0) + '&comment=' + encodeURIComponent($('#tab-history textarea[name=\'comment\']').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 fa-exclamation-circle"></i> ' + json['error'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#history').load('index.php?route=sale/return/history&user_token={{ user_token }}&return_id={{ return_id }}');
|
||||
|
||||
$('#tab-history').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="close" data-dismiss="alert">×</button></div>');
|
||||
|
||||
$('#tab-history textarea[name=\'comment\']').val('');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
//--></script>
|
||||
<script type="text/javascript"><!--
|
||||
$('.date').datetimepicker({
|
||||
language: '{{ datepicker }}',
|
||||
pickTime: false
|
||||
});
|
||||
//--></script></div>
|
||||
{{ footer }}
|
||||
@@ -0,0 +1,38 @@
|
||||
{% if error %}
|
||||
<div class="alert alert-danger alert-dismissible">{{ error }}</div>
|
||||
{% endif %}
|
||||
{% if success %}
|
||||
<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-left">{{ column_date_added }}</td>
|
||||
<td class="text-left">{{ column_comment }}</td>
|
||||
<td class="text-left">{{ column_status }}</td>
|
||||
<td class="text-left">{{ column_notify }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if histories %}
|
||||
{% for history in histories %}
|
||||
<tr>
|
||||
<td class="text-left">{{ history.date_added }}</td>
|
||||
<td class="text-left">{{ history.comment }}</td>
|
||||
<td class="text-left">{{ history.status }}</td>
|
||||
<td class="text-left">{{ 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-left">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-right">{{ results }}</div>
|
||||
</div>
|
||||
@@ -0,0 +1,331 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right">
|
||||
<button type="button" data-toggle="tooltip" title="{{ button_filter }}" onclick="$('#filter-return').toggleClass('hidden-sm hidden-xs');" class="btn btn-default hidden-md hidden-lg"><i class="fa fa-filter"></i></button>
|
||||
<a href="{{ add }}" data-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa fa-plus"></i></a>
|
||||
<button type="button" data-toggle="tooltip" title="{{ button_delete }}" class="btn btn-danger" onclick="confirm('{{ text_confirm }}') ? $('#form-return').submit() : false;"><i class="fa fa-trash-o"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if success %}
|
||||
<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="row">
|
||||
<div id="filter-return" class="col-md-3 col-md-push-9 col-sm-12 hidden-sm hidden-xs">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-filter"></i> {{ text_filter }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-return-id">{{ 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="form-group">
|
||||
<label class="control-label" for="input-order-id">{{ 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="form-group">
|
||||
<label class="control-label" for="input-customer">{{ entry_customer }}</label>
|
||||
<input type="text" name="filter_customer" value="{{ filter_customer }}" placeholder="{{ entry_customer }}" id="input-customer" class="form-control" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-product">{{ entry_product }}</label>
|
||||
<input type="text" name="filter_product" value="{{ filter_product }}" placeholder="{{ entry_product }}" id="input-product" class="form-control" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-model">{{ entry_model }}</label>
|
||||
<input type="text" name="filter_model" value="{{ filter_model }}" placeholder="{{ entry_model }}" id="input-model" class="form-control" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-return-status">{{ entry_return_status }}</label>
|
||||
<select name="filter_return_status_id" id="input-return-status" class="form-control">
|
||||
<option value=""></option>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% for return_status in return_statuses %}
|
||||
{% if return_status.return_status_id == filter_return_status_id %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<option value="{{ return_status.return_status_id }}" selected="selected">{{ return_status.name }}</option>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% else %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<option value="{{ return_status.return_status_id }}">{{ return_status.name }}</option>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-date-added">{{ entry_date_added }}</label>
|
||||
<div class="input-group date">
|
||||
<input type="text" name="filter_date_added" value="{{ filter_date_added }}" placeholder="{{ entry_date_added }}" data-date-format="YYYY-MM-DD" id="input-date-added" class="form-control" />
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
|
||||
</span></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="control-label" for="input-date-modified">{{ entry_date_modified }}</label>
|
||||
<div class="input-group date">
|
||||
<input type="text" name="filter_date_modified" value="{{ filter_date_modified }}" placeholder="{{ entry_date_modified }}" data-date-format="YYYY-MM-DD" id="input-date-modified" class="form-control" />
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default"><i class="fa fa-calendar"></i></button>
|
||||
</span></div>
|
||||
</div>
|
||||
<div class="form-group text-right">
|
||||
<button type="button" id="button-filter" class="btn btn-default"><i class="fa fa-filter"></i> {{ button_filter }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-9 col-md-pull-3 col-sm-12">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list"></i> {{ text_list }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{ delete }}" method="post" enctype="multipart/form-data" id="form-return">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" /></td>
|
||||
<td class="text-right">{% if sort == 'r.return_id' %} <a href="{{ sort_return_id }}" class="{{ order|lower }}">{{ column_return_id }}</a> {% else %} <a href="{{ sort_return_id }}">{{ column_return_id }}</a> {% endif %}</td>
|
||||
<td class="text-right">{% if sort == 'r.order_id' %} <a href="{{ sort_order_id }}" class="{{ order|lower }}">{{ column_order_id }}</a> {% else %} <a href="{{ sort_order_id }}">{{ column_order_id }}</a> {% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'customer' %} <a href="{{ sort_customer }}" class="{{ order|lower }}">{{ column_customer }}</a> {% else %} <a href="{{ sort_customer }}">{{ column_customer }}</a> {% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'r.product' %} <a href="{{ sort_product }}" class="{{ order|lower }}">{{ column_product }}</a> {% else %} <a href="{{ sort_product }}">{{ column_product }}</a> {% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'r.model' %} <a href="{{ sort_model }}" class="{{ order|lower }}">{{ column_model }}</a> {% else %} <a href="{{ sort_model }}">{{ column_model }}</a> {% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'status' %} <a href="{{ sort_status }}" class="{{ order|lower }}">{{ column_status }}</a> {% else %} <a href="{{ sort_status }}">{{ column_status }}</a> {% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'r.date_added' %} <a href="{{ sort_date_added }}" class="{{ order|lower }}">{{ column_date_added }}</a> {% else %} <a href="{{ sort_date_added }}">{{ column_date_added }}</a> {% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'r.date_modified' %} <a href="{{ sort_date_modified }}" class="{{ order|lower }}">{{ column_date_modified }}</a> {% else %} <a href="{{ sort_date_modified }}">{{ column_date_modified }}</a> {% endif %}</td>
|
||||
<td class="text-right">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{% if returns %}
|
||||
{% for return in returns %}
|
||||
<tr>
|
||||
<td class="text-center">{% if return.return_id in selected %}
|
||||
<input type="checkbox" name="selected[]" value="{{ return.return_id }}" checked="checked" />
|
||||
{% else %}
|
||||
<input type="checkbox" name="selected[]" value="{{ return.return_id }}" />
|
||||
{% endif %}</td>
|
||||
<td class="text-right">{{ return.return_id }}</td>
|
||||
<td class="text-right">{{ return.order_id }}</td>
|
||||
<td class="text-left">{{ return.customer }}</td>
|
||||
<td class="text-left">{{ return.product }}</td>
|
||||
<td class="text-left">{{ return.model }}</td>
|
||||
<td class="text-left">{{ return.return_status }}</td>
|
||||
<td class="text-left">{{ return.date_added }}</td>
|
||||
<td class="text-left">{{ return.date_modified }}</td>
|
||||
<td class="text-right"><a href="{{ return.edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="10">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-left">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-right">{{ results }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#button-filter').on('click', function() {
|
||||
url = 'index.php?route=sale/return&user_token={{ user_token }}';
|
||||
|
||||
var filter_return_id = $('input[name=\'filter_return_id\']').val();
|
||||
|
||||
if (filter_return_id) {
|
||||
url += '&filter_return_id=' + encodeURIComponent(filter_return_id);
|
||||
}
|
||||
|
||||
var filter_order_id = $('input[name=\'filter_order_id\']').val();
|
||||
|
||||
if (filter_order_id) {
|
||||
url += '&filter_order_id=' + encodeURIComponent(filter_order_id);
|
||||
}
|
||||
|
||||
var filter_customer = $('input[name=\'filter_customer\']').val();
|
||||
|
||||
if (filter_customer) {
|
||||
url += '&filter_customer=' + encodeURIComponent(filter_customer);
|
||||
}
|
||||
|
||||
var filter_product = $('input[name=\'filter_product\']').val();
|
||||
|
||||
if (filter_product) {
|
||||
url += '&filter_product=' + encodeURIComponent(filter_product);
|
||||
}
|
||||
|
||||
var filter_model = $('input[name=\'filter_model\']').val();
|
||||
|
||||
if (filter_model) {
|
||||
url += '&filter_model=' + encodeURIComponent(filter_model);
|
||||
}
|
||||
|
||||
var filter_return_status_id = $('select[name=\'filter_return_status_id\']').val();
|
||||
|
||||
if (filter_return_status_id !== '') {
|
||||
url += '&filter_return_status_id=' + encodeURIComponent(filter_return_status_id);
|
||||
}
|
||||
|
||||
var filter_date_added = $('input[name=\'filter_date_added\']').val();
|
||||
|
||||
if (filter_date_added) {
|
||||
url += '&filter_date_added=' + encodeURIComponent(filter_date_added);
|
||||
}
|
||||
|
||||
var filter_date_modified = $('input[name=\'filter_date_modified\']').val();
|
||||
|
||||
if (filter_date_modified) {
|
||||
url += '&filter_date_modified=' + encodeURIComponent(filter_date_modified);
|
||||
}
|
||||
|
||||
location = url;
|
||||
});
|
||||
//--></script>
|
||||
<script type="text/javascript"><!--
|
||||
$('input[name=\'filter_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[name=\'filter_customer\']').val(item['label']);
|
||||
}
|
||||
});
|
||||
|
||||
$('input[name=\'filter_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[name=\'filter_product\']').val(item['label']);
|
||||
}
|
||||
});
|
||||
|
||||
$('input[name=\'filter_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[name=\'filter_model\']').val(item['label']);
|
||||
}
|
||||
});
|
||||
//--></script>
|
||||
<script type="text/javascript"><!--
|
||||
$('.date').datetimepicker({
|
||||
language: '{{ datepicker }}',
|
||||
pickTime: false
|
||||
});
|
||||
//--></script>
|
||||
<script type="text/javascript"><!--
|
||||
$('#filter-return').on('keydown', function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
$('#button-filter').trigger('click')
|
||||
}
|
||||
});
|
||||
//--></script>
|
||||
</div>
|
||||
{{ footer }}
|
||||
@@ -0,0 +1,182 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right">
|
||||
{% if voucher_id %}
|
||||
<button type="button" id="button-send" data-toggle="tooltip" title="{{ button_send }}" class="btn btn-primary"><i class="fa fa-envelope"></i></button>
|
||||
{% endif %}
|
||||
<button type="submit" form="form-voucher" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa fa-save"></i></button>
|
||||
<a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_form }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-voucher" class="form-horizontal">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#tab-general" data-toggle="tab">{{ tab_general }}</a></li>
|
||||
{% if voucher_id %}
|
||||
<li><a href="#tab-history" data-toggle="tab">{{ tab_history }}</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="tab-general">
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-code"><span data-toggle="tooltip" title="{{ help_code }}">{{ entry_code }}</span></label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="code" value="{{ code }}" placeholder="{{ entry_code }}" id="input-code" class="form-control" />
|
||||
{% if error_code %}
|
||||
<div class="text-danger">{{ error_code }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-from-name">{{ 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" />
|
||||
{% if error_from_name %}
|
||||
<div class="text-danger">{{ error_from_name }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-from-email">{{ 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" />
|
||||
{% if error_from_email %}
|
||||
<div class="text-danger">{{ error_from_email }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-to-name">{{ 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" />
|
||||
{% if error_to_name %}
|
||||
<div class="text-danger">{{ error_to_name }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-to-email">{{ 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" />
|
||||
{% if error_to_email %}
|
||||
<div class="text-danger">{{ error_to_email }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-theme">{{ entry_theme }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="voucher_theme_id" id="input-theme" class="form-control">
|
||||
{% for voucher_theme in voucher_themes %}
|
||||
{% if voucher_theme.voucher_theme_id == voucher_theme_id %}
|
||||
<option value="{{ voucher_theme.voucher_theme_id }}" selected="selected">{{ voucher_theme.name }}</option>
|
||||
{% else %}
|
||||
<option value="{{ voucher_theme.voucher_theme_id }}">{{ voucher_theme.name }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-message">{{ 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="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-amount">{{ entry_amount }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="amount" value="{{ amount }}" placeholder="{{ entry_amount }}" id="input-amount" class="form-control" />
|
||||
{% if error_amount %}
|
||||
<div class="text-danger">{{ error_amount }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-status">{{ entry_status }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="status" id="input-status" class="form-control">
|
||||
{% if status %}
|
||||
<option value="1" selected="selected">{{ text_enabled }}</option>
|
||||
<option value="0">{{ text_disabled }}</option>
|
||||
{% else %}
|
||||
<option value="1">{{ text_enabled }}</option>
|
||||
<option value="0" selected="selected">{{ text_disabled }}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if voucher_id %}
|
||||
<div class="tab-pane" id="tab-history">
|
||||
<div id="history"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if voucher_id %}
|
||||
<script type="text/javascript"><!--
|
||||
$('#button-send').on('click', function() {
|
||||
$.ajax({
|
||||
url: 'index.php?route=sale/voucher/send&user_token={{ user_token }}',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: 'voucher_id={{ voucher_id }}',
|
||||
beforeSend: function() {
|
||||
$('#button-send i').replaceWith('<i class="fa fa-circle-o-notch fa-spin"></i>');
|
||||
$('#button-send').prop('disabled', true);
|
||||
},
|
||||
complete: function() {
|
||||
$('#button-send i').replaceWith('<i class="fa fa-envelope"></i>');
|
||||
$('#button-send').prop('disabled', false);
|
||||
},
|
||||
success: function(json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
})
|
||||
//--></script>
|
||||
<script type="text/javascript"><!--
|
||||
$('#history').delegate('.pagination a', 'click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#history').load(this.href);
|
||||
});
|
||||
|
||||
$('#history').load('index.php?route=sale/voucher/history&user_token={{ user_token }}&voucher_id={{ voucher_id }}');
|
||||
//--></script>
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ footer }}
|
||||
@@ -0,0 +1,32 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-right">{{ column_order_id }}</td>
|
||||
<td class="text-left">{{ column_customer }}</td>
|
||||
<td class="text-right">{{ column_amount }}</td>
|
||||
<td class="text-left">{{ column_date_added }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if histories %}
|
||||
{% for history in histories %}
|
||||
<tr>
|
||||
<td class="text-right">{{ history.order_id }}</td>
|
||||
<td class="text-left">{{ history.customer }}</td>
|
||||
<td class="text-right">{{ history.amount }}</td>
|
||||
<td class="text-left">{{ 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-left">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-right">{{ results }}</div>
|
||||
</div>
|
||||
@@ -0,0 +1,149 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right">
|
||||
<button type="button" id="button-send" data-toggle="tooltip" title="{{ button_send }}" class="btn btn-warning"><i class="fa fa-envelope"></i></button>
|
||||
<a href="{{ add }}" data-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa fa-plus"></i></a>
|
||||
<button type="button" data-toggle="tooltip" title="{{ button_delete }}" class="btn btn-danger" onclick="confirm('{{ text_confirm }}') ? $('#form-voucher').submit() : false;"><i class="fa fa-trash-o"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if success %}
|
||||
<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list"></i> {{ text_list }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{ delete }}" method="post" enctype="multipart/form-data" id="form-voucher">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" /></td>
|
||||
<td class="text-left">{% if sort == 'v.code' %}
|
||||
<a href="{{ sort_code }}" class="{{ order|lower }}">{{ column_code }}</a>
|
||||
{% else %}
|
||||
<a href="{{ sort_code }}">{{ column_code }}</a>
|
||||
{% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'v.from_name' %}
|
||||
<a href="{{ sort_from }}" class="{{ order|lower }}">{{ column_from }}</a>
|
||||
{% else %}
|
||||
<a href="{{ sort_from }}">{{ column_from }}</a>
|
||||
{% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'v.to_name' %}
|
||||
<a href="{{ sort_to }}" class="{{ order|lower }}">{{ column_to }}</a>
|
||||
{% else %}
|
||||
<a href="{{ sort_to }}">{{ column_to }}</a>
|
||||
{% endif %}</td>
|
||||
<td class="text-right">{% if sort == 'v.amount' %}
|
||||
<a href="{{ sort_amount }}" class="{{ order|lower }}">{{ column_amount }}</a>
|
||||
{% else %}
|
||||
<a href="{{ sort_amount }}">{{ column_amount }}</a>
|
||||
{% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'theme' %}
|
||||
<a href="{{ sort_theme }}" class="{{ order|lower }}">{{ column_theme }}</a>
|
||||
{% else %}
|
||||
<a href="{{ sort_theme }}">{{ column_theme }}</a>
|
||||
{% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'v.status' %}
|
||||
<a href="{{ sort_status }}" class="{{ order|lower }}">{{ column_status }}</a>
|
||||
{% else %}
|
||||
<a href="{{ sort_status }}">{{ column_status }}</a>
|
||||
{% endif %}</td>
|
||||
<td class="text-left">{% if sort == 'v.date_added' %}
|
||||
<a href="{{ sort_date_added }}" class="{{ order|lower }}">{{ column_date_added }}</a>
|
||||
{% else %}
|
||||
<a href="{{ sort_date_added }}">{{ column_date_added }}</a>
|
||||
{% endif %}</td>
|
||||
<td class="text-right">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if vouchers %}
|
||||
{% for voucher in vouchers %}
|
||||
<tr>
|
||||
<td class="text-center">{% if voucher.voucher_id in selected %}
|
||||
<input type="checkbox" name="selected[]" value="{{ voucher.voucher_id }}" checked="checked" />
|
||||
{% else %}
|
||||
<input type="checkbox" name="selected[]" value="{{ voucher.voucher_id }}" />
|
||||
{% endif %}</td>
|
||||
<td class="text-left">{{ voucher.code }}</td>
|
||||
<td class="text-left">{{ voucher.from }}</td>
|
||||
<td class="text-left">{{ voucher.to }}</td>
|
||||
<td class="text-right">{{ voucher.amount }}</td>
|
||||
<td class="text-left">{{ voucher.theme }}</td>
|
||||
<td class="text-left">{{ voucher.status }}</td>
|
||||
<td class="text-left">{{ voucher.date_added }}</td>
|
||||
<td class="text-right">
|
||||
{% if voucher.order %}
|
||||
<a href="{{ voucher.order }}" data-toggle="tooltip" title="{{ button_order }}" class="btn btn-info"><i class="fa fa fa-eye"></i></a>
|
||||
{% endif %}
|
||||
<a href="{{ voucher.edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="9">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-left">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-right">{{ results }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#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 i').replaceWith('<i class="fa fa-circle-o-notch fa-spin"></i>');
|
||||
$('#button-send').prop('disabled', true);
|
||||
},
|
||||
complete: function() {
|
||||
$('#button-send i').replaceWith('<i class="fa fa-envelope"></i>');
|
||||
$('#button-send').prop('disabled', false);
|
||||
},
|
||||
success: function(json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> ' + json['error'] + '</div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#content > .container-fluid').prepend('<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> ' + json['success'] + '</div>');
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
})
|
||||
//--></script></div>
|
||||
{{ footer }}
|
||||
@@ -0,0 +1,55 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right">
|
||||
<button type="submit" form="form-theme-voucher" data-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa fa-save"></i></button>
|
||||
<a href="{{ cancel }}" data-toggle="tooltip" title="{{ button_cancel }}" class="btn btn-default"><i class="fa fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-pencil"></i> {{ text_form }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{ action }}" method="post" enctype="multipart/form-data" id="form-theme-voucher" class="form-horizontal">
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label">{{ entry_name }}</label>
|
||||
<div class="col-sm-10">
|
||||
{% for language in languages %}
|
||||
<div class="input-group"><span class="input-group-addon"><img src="language/{{ language.code }}/{{ language.code }}.png" title="{{ language.name }}" /></span>
|
||||
<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 }}" class="form-control" />
|
||||
</div>
|
||||
{% if error_name[language.language_id] %}
|
||||
<div class="text-danger">{{ error_name[language.language_id] }}</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-image">{{ entry_image }}</label>
|
||||
<div class="col-sm-10"><a href="" id="thumb-image" data-toggle="image" class="img-thumbnail"><img src="{{ thumb }}" alt="" title="" data-placeholder="{{ placeholder }}" /></a>
|
||||
<input type="hidden" name="image" value="{{ image }}" id="input-image" />
|
||||
{% if error_image %}
|
||||
<div class="text-danger">{{ error_image }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ footer }}
|
||||
@@ -0,0 +1,76 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="pull-right"><a href="{{ add }}" data-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa fa-plus"></i></a>
|
||||
<button type="button" data-toggle="tooltip" title="{{ button_delete }}" class="btn btn-danger" onclick="confirm('{{ text_confirm }}') ? $('#form-voucher-theme').submit() : false;"><i class="fa fa-trash-o"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ul class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
{% if error_warning %}
|
||||
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if success %}
|
||||
<div class="alert alert-success alert-dismissible"><i class="fa fa-check-circle"></i> {{ success }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><i class="fa fa-list"></i> {{ text_list }}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<form action="{{ delete }}" method="post" enctype="multipart/form-data" id="form-voucher-theme">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td style="width: 1px;" class="text-center"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', this.checked);" /></td>
|
||||
<td class="text-left">{% if sort == 'name' %}
|
||||
<a href="{{ sort_name }}" class="{{ order|lower }}">{{ column_name }}</a>
|
||||
{% else %}
|
||||
<a href="{{ sort_name }}">{{ column_name }}</a>
|
||||
{% endif %}</td>
|
||||
<td class="text-right">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if voucher_themes %}
|
||||
{% for voucher_theme in voucher_themes %}
|
||||
<tr>
|
||||
<td class="text-center">{% if voucher_theme.voucher_theme_id in selected %}
|
||||
<input type="checkbox" name="selected[]" value="{{ voucher_theme.voucher_theme_id }}" checked="checked" />
|
||||
{% else %}
|
||||
<input type="checkbox" name="selected[]" value="{{ voucher_theme.voucher_theme_id }}" />
|
||||
{% endif %}</td>
|
||||
<td class="text-left">{{ voucher_theme.name }}</td>
|
||||
<td class="text-right"><a href="{{ voucher_theme.edit }}" data-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="3">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-left">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-right">{{ results }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ footer }}
|
||||
Reference in New Issue
Block a user