Discounts block update
This commit is contained in:
miroman-afk
2022-04-28 23:55:53 +03:00
parent 53dfb77d7a
commit 2d148e3eb5
9 changed files with 169 additions and 22 deletions

View File

@@ -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');
});