v.2.15
Discounts block update
This commit is contained in:
@@ -392,7 +392,7 @@
|
||||
$scope.deleted_sum = Math.roundNG(data.sum, -2);
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/discount', function (data) {
|
||||
smartRequest.get('v1/onlinediscount', function (data) {
|
||||
$scope.discounts = Math.roundNG(data.count, -2);
|
||||
$scope.discounts_sum = Math.roundNG(data.sum, -2);
|
||||
$scope.tot_disc_sum = Math.roundNG(data.total_sum, -2);
|
||||
@@ -555,7 +555,7 @@
|
||||
$scope.deleted_sum = Math.roundNG(data.sum, -2);
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/discount', function (data) {
|
||||
smartRequest.get('v1/onlinediscount', function (data) {
|
||||
$scope.discounts = Math.roundNG(data.count, -2);
|
||||
$scope.discounts_sum = Math.roundNG(data.sum, -2);
|
||||
$scope.tot_disc_sum = Math.roundNG(data.total_sum, -2);
|
||||
@@ -715,6 +715,13 @@
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getMoreDiscount = function () {
|
||||
smartRequest.get('v1/morediscount/', function (data) {
|
||||
$scope.moreData = data;
|
||||
$('#get-more-discount').modal();
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getItems = function (modal, order) {
|
||||
$('#get-more-' + modal).modal('toggle');
|
||||
smartRequest.get('dashboard/' + modal + '/items?order=' + order.number, function (data) {
|
||||
@@ -723,6 +730,14 @@
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getItemsDiscount = function (order) {
|
||||
$('#get-more-discount').modal('toggle');
|
||||
smartRequest.get('v1/discountitems?order=' + order.number, function (data) {
|
||||
$scope.order = data;
|
||||
$('#items-discount').modal('toggle');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.returnModal = function (name) {
|
||||
$('#items-' + name).on('hidden.bs.modal', function (event) {
|
||||
$('#get-more-' + name).modal('show');
|
||||
@@ -735,7 +750,6 @@
|
||||
$scope.order = data;
|
||||
smartRequest.get('v1/orderhistory?order_id=' + order.number, function (actions) {
|
||||
$scope.actions = actions;
|
||||
console.log(actions);
|
||||
});
|
||||
$('#items-total').modal('toggle');
|
||||
});
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
<div class="box-tool box-tool-white">
|
||||
<ul class="nav">
|
||||
<li class="nav-item">
|
||||
<a ng-click="getMore('discount')">
|
||||
<a ng-click="getMoreDiscount()">
|
||||
<i class="fa fa-eye"></i>
|
||||
</a>
|
||||
</li>
|
||||
@@ -531,20 +531,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-xl-4">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3>Типы меню</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<div class="box-body">
|
||||
<canvas class="chart chart-pie" chart-data="menus.data" chart-labels="menus.labels" chart-options="menus.options"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-xl-4">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<th>Блюдо (со скидкой)</th>
|
||||
<th>Количество</th>
|
||||
<th class="text-right">Цена, BYN</th>
|
||||
<th class="text-right">Cкидка, BYN</th>
|
||||
<th class="text-right">Сумма, BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -21,8 +22,9 @@
|
||||
<tr ng-repeat="item in order.items">
|
||||
<td>{{ item.name }} ({{ item.discount }}%)</td>
|
||||
<td>{{ item.count }}</td>
|
||||
<td class="text-right">{{ item.sale_price | curr }}</td>
|
||||
<td class="text-right">{{ item.sum | curr }}</td>
|
||||
<td class="text-right">{{ (item.sum * item.discount) / 100 | curr }}</td>
|
||||
<td class="text-right">{{ item.sale_price | curr }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
|
||||
@@ -99,6 +99,8 @@
|
||||
<!--Разбиение заказа-->
|
||||
<div ng-if="actions.slice_trigger == 1" class="tab-pane animated fadeIn text-muted" id="tab3" aria-expanded="false">
|
||||
<div ng-repeat="sliced_order_item in actions.sliced_order_items">
|
||||
<p class="text-muted m-b-0">Время разбиения: <span class="m-b-0">{{ sliced_order_item.time }}</span></p>
|
||||
<p class="text-muted m-b-0">Пользователь: <span class="m-b-0">{{ sliced_order_item.staff }}</span></p>
|
||||
<p class="text-muted m-b-0">Товары перенесенные в заказ №<span class="m-b-0">{{ sliced_order_item.order }}</span></p>
|
||||
<div class="table-responsive">
|
||||
<table class="table m-a-0">
|
||||
@@ -122,7 +124,10 @@
|
||||
<!--Объединение заказа-->
|
||||
<div ng-if="actions.merge_trigger == 1" class="tab-pane animated fadeIn text-muted" id="tab4" aria-expanded="false">
|
||||
<div ng-repeat="merged_order_item in actions.merged_order_items">
|
||||
<p class="text-muted m-b-0">Время объединения: <span class="m-b-0">{{ merged_order_item.time }}</span></p>
|
||||
<p class="text-muted m-b-0">Пользователь: <span class="m-b-0">{{ merged_order_item.staff }}</span></p>
|
||||
<p class="text-muted m-b-0">Товары перенесенные из заказа №<span class="m-b-0">{{ merged_order_item.order }}</span></p>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table m-a-0">
|
||||
<thead>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr ng-repeat="order in moreData.orders" ng-click="getItems('discount', order)">
|
||||
<tr ng-repeat="order in moreData.orders" ng-click="getItemsDiscount(order)">
|
||||
<td>{{ order.number }}</td>
|
||||
<td class="text-right">{{ order.full_sum | curr }}</td>
|
||||
<td class="text-right">{{ order.sale_sum | curr }}</td>
|
||||
|
||||
Reference in New Issue
Block a user