feat: add fiscalization settings, POST callbacks and fix callback issues
This commit is contained in:
@@ -16,6 +16,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
{% if warning_ocmod %}
|
||||
<div class="alert alert-warning"><i class="fa fa-exclamation-triangle"></i> {{ warning_ocmod }}</div>
|
||||
{% endif %}
|
||||
{% if warning_receipt_email %}
|
||||
<div class="alert alert-warning"><i class="fa fa-exclamation-triangle"></i> {{ warning_receipt_email }}</div>
|
||||
{% endif %}
|
||||
{% if error_warning %}
|
||||
<div class="alert alert-danger"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}
|
||||
<button type="button" class="close" data-dismiss="alert">×</button>
|
||||
@@ -64,9 +70,15 @@
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-integrity-code">{{ entry_integrity_code_label }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="payment_payanyway_integrity_code" value="{{ payment_payanyway_integrity_code }}"
|
||||
placeholder="{{ entry_integrity_code_description }}" id="input-integrity-code"
|
||||
class="form-control"/>
|
||||
<div class="input-group">
|
||||
<input type="password" name="payment_payanyway_integrity_code" value="{{ payment_payanyway_integrity_code }}"
|
||||
placeholder="{{ entry_integrity_code_description }}" id="input-integrity-code"
|
||||
class="form-control" autocomplete="off"/>
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" id="button-integrity-code-toggle"
|
||||
data-toggle="tooltip" title="{{ button_integrity_code_toggle }}"><i class="fa fa-eye"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
{% if error_integrity_code %}
|
||||
<div class="text-danger">{{ error_integrity_code }}</div>
|
||||
{% endif %}
|
||||
@@ -84,18 +96,87 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# НДС #}
|
||||
{# Тестовый режим #}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-vat-rate">{{ entry_vat_rate_label }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="payment_payanyway_vat_rate" id="input-vat-rate" class="form-control">
|
||||
{% for vat_id, label in payment_payanyway_vat_rates %}
|
||||
<option value="{{ vat_id }}"
|
||||
{% if vat_id == payment_payanyway_vat_rate %}selected="selected"{% endif %}>
|
||||
{{ label }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="col-sm-10 col-sm-offset-2">
|
||||
<div class="form-check" style="display: flex; column-gap: 8px;">
|
||||
<input type="hidden" name="payment_payanyway_test_mode" value="0"/>
|
||||
<input class="form-check-input" type="checkbox" name="payment_payanyway_test_mode" id="input-test-mode"
|
||||
value="1"
|
||||
{% if payment_payanyway_test_mode == "1" %} checked{% endif %}>
|
||||
<label class="form-check-label" for="input-test-mode">{{ entry_test_mode_label }}</label>
|
||||
</div>
|
||||
<p class="help-block">{{ help_test_mode }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Фискализация чеков #}
|
||||
<div class="form-group">
|
||||
<div class="col-sm-10 col-sm-offset-2">
|
||||
<div class="form-check" style="display: flex; column-gap: 8px;">
|
||||
<input type="hidden" name="payment_payanyway_fiscalization" value="0"/>
|
||||
<input class="form-check-input" type="checkbox" name="payment_payanyway_fiscalization"
|
||||
id="input-fiscalization" value="1"
|
||||
{% if payment_payanyway_fiscalization == "1" %} checked{% endif %}>
|
||||
<label class="form-check-label" for="input-fiscalization">{{ entry_fiscalization_label }}</label>
|
||||
</div>
|
||||
<p class="help-block">{{ help_fiscalization }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Поля чека — только при фискализации. Скрываются, а не блокируются: заблокированное
|
||||
поле браузер не отправляет, и значение потерялось бы. #}
|
||||
<div id="fiscalization-fields">
|
||||
{# Email для чеков #}
|
||||
<div class="form-group required">
|
||||
<label class="col-sm-2 control-label" for="input-receipt-email">{{ entry_receipt_email_label }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="email" name="payment_payanyway_receipt_email" value="{{ payment_payanyway_receipt_email }}"
|
||||
placeholder="shop@example.ru" id="input-receipt-email" class="form-control" maxlength="64"/>
|
||||
<p class="help-block">{{ help_receipt_email }}</p>
|
||||
{% if error_receipt_email %}
|
||||
<div class="text-danger">{{ error_receipt_email }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# НДС #}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-vat-rate">{{ entry_vat_rate_label }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="payment_payanyway_vat_rate" id="input-vat-rate" class="form-control">
|
||||
{% for vat_id, label in payment_payanyway_vat_rates %}
|
||||
<option value="{{ vat_id }}"
|
||||
{% if vat_id == payment_payanyway_vat_rate %}selected="selected"{% endif %}>
|
||||
{{ label }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Признак способа расчёта #}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-payment-method">{{ entry_payment_method_label }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="payment_payanyway_payment_method" id="input-payment-method" class="form-control">
|
||||
{% for value, label in payment_payanyway_payment_methods %}
|
||||
<option value="{{ value }}" {% if value == payment_payanyway_payment_method %}selected="selected"{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Признак предмета расчёта #}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-payment-object">{{ entry_payment_object_label }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="payment_payanyway_payment_object" id="input-payment-object" class="form-control">
|
||||
{% for value, label in payment_payanyway_payment_objects %}
|
||||
<option value="{{ value }}" {% if value == payment_payanyway_payment_object %}selected="selected"{% endif %}>{{ label }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -192,6 +273,28 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# canceled #}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">
|
||||
<span data-toggle="tooltip"
|
||||
title="{{ help_canceled_order_status }}">{{ entry_canceled_order_status_label }}</span>
|
||||
</label>
|
||||
<div class="col-sm-9">
|
||||
<div class="well well-sm" style="height: 150px; overflow: auto; margin-bottom: 0;">
|
||||
{% for order_status in order_statuses %}
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="payment_payanyway_canceled_order_status_ids[]"
|
||||
value="{{ order_status.order_status_id }}"
|
||||
{% if order_status.order_status_id in payment_payanyway_canceled_order_status_ids %} checked="checked"{% endif %}/>
|
||||
{{ order_status.name }}
|
||||
</label>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -218,6 +321,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# URL для уведомлений #}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-callback-url">{{ entry_callback_url_label }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group">
|
||||
<input type="text" value="{{ callback_url }}" id="input-callback-url" class="form-control" readonly/>
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-default" id="button-callback-url-copy">{{ button_copy }}</button>
|
||||
</span>
|
||||
</div>
|
||||
<p class="help-block">{{ help_callback_url }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# sort-order #}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" for="input-sort-order">
|
||||
@@ -234,4 +351,34 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style>
|
||||
{# Разделитель админки — .form-group + .form-group: обёртка полей чека его разрывает. #}
|
||||
#fiscalization-fields > .form-group:first-child,
|
||||
#fiscalization-fields + .form-group {
|
||||
border-top: 1px solid #ededed;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(function () {
|
||||
function toggleFiscalizationFields() {
|
||||
$('#fiscalization-fields').toggle($('#input-fiscalization').is(':checked'));
|
||||
}
|
||||
$('#input-fiscalization').on('change', toggleFiscalizationFields);
|
||||
toggleFiscalizationFields();
|
||||
|
||||
$('#button-integrity-code-toggle').on('click', function () {
|
||||
var $input = $('#input-integrity-code');
|
||||
$input.attr('type', $input.attr('type') === 'password' ? 'text' : 'password');
|
||||
$(this).find('i').toggleClass('fa-eye fa-eye-slash');
|
||||
});
|
||||
|
||||
$('#button-callback-url-copy').on('click', function () {
|
||||
var $button = $(this);
|
||||
$('#input-callback-url').trigger('select');
|
||||
document.execCommand('copy');
|
||||
$button.text('{{ text_copied }}');
|
||||
setTimeout(function () { $button.text('{{ button_copy }}'); }, 2000);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{{ footer }}
|
||||
|
||||
Reference in New Issue
Block a user