v.2.30
Добавлен расширенный отчет по реализации Добавлен монитор активности
This commit is contained in:
@@ -9,10 +9,8 @@
|
||||
if (typeof input == 'string') {
|
||||
input = parseFloat(input.replace(/,/g, '.'));
|
||||
}
|
||||
|
||||
var outputValue = input;
|
||||
|
||||
if (typeof outputValue !== 'undefined') {
|
||||
if (typeof outputValue !== 'undefined' && outputValue !== null) {
|
||||
return outputValue.toFixed(2);
|
||||
} else {
|
||||
return 0.00;
|
||||
@@ -72,7 +70,7 @@
|
||||
//Отображение текущего времени
|
||||
$scope.currentDate = new Date();
|
||||
|
||||
var timer = $interval(function() {
|
||||
var timer = $interval(function () {
|
||||
$scope.currentDate = new Date();
|
||||
}, 1000);
|
||||
|
||||
@@ -85,10 +83,10 @@
|
||||
|
||||
//Автоматическое обновление данных
|
||||
$scope.timerEnabled = false;
|
||||
$scope.timeRemaining = new Date(0, 0, 0, 0, 2, 0);
|
||||
$scope.timeRemaining = new Date(0, 0, 0, 0, 1, 0);
|
||||
var updateTimer = null;
|
||||
|
||||
$scope.toggleTimer = function() {
|
||||
$scope.toggleTimer = function () {
|
||||
if ($scope.timerEnabled) {
|
||||
startTimer();
|
||||
} else {
|
||||
@@ -98,12 +96,12 @@
|
||||
|
||||
function startTimer() {
|
||||
if (updateTimer === null) {
|
||||
updateTimer = $interval(function() {
|
||||
updateTimer = $interval(function () {
|
||||
$scope.timeRemaining.setSeconds($scope.timeRemaining.getSeconds() - 1);
|
||||
console.log($scope.timeRemaining.getSeconds());
|
||||
//console.log($scope.timeRemaining.getSeconds());
|
||||
if ($scope.timeRemaining.getMinutes() === 0 && $scope.timeRemaining.getSeconds() === 0) {
|
||||
stopTimer();
|
||||
$scope.timeRemaining = new Date(0, 0, 0, 0, 2, 0);
|
||||
$scope.timeRemaining = new Date(0, 0, 0, 0, 1, 0);
|
||||
console.log('Данные обновлены');
|
||||
smartRequest.get('v1/clearcache?folder=dashboard', function (data) {
|
||||
});
|
||||
@@ -122,11 +120,43 @@
|
||||
}
|
||||
|
||||
//Остановка таймеров
|
||||
$scope.$on('$destroy', function() {
|
||||
$scope.$on('$destroy', function () {
|
||||
$interval.cancel(timer);
|
||||
$interval.cancel(updateTimer);
|
||||
});
|
||||
|
||||
$scope.dataTablesOpt = {
|
||||
language: {
|
||||
url: "https://cdn.datatables.net/plug-ins/1.13.3/i18n/ru.json",
|
||||
},
|
||||
autoWidth: false,
|
||||
searching: true,
|
||||
paging: false,
|
||||
info: false,
|
||||
};
|
||||
|
||||
/* $scope.dtoptions = {
|
||||
/!*dom: "lfBrtip",*!/
|
||||
language: {
|
||||
url: "https://cdn.datatables.net/plug-ins/1.13.3/i18n/ru.json",
|
||||
},
|
||||
autoWidth: true,
|
||||
searching: true,
|
||||
paging: false,
|
||||
info: false,
|
||||
aoColumns: [
|
||||
{title: "#"},
|
||||
{title: "Гость", visible: false},
|
||||
{title: "Статус", className: "text-right"},
|
||||
{title: "Открыт", className: "text-right"},
|
||||
{title: "Закрыт", className: "text-right"},
|
||||
{title: "Сумма, BYN", className: "text-right"}
|
||||
]
|
||||
/!*buttons: [
|
||||
{text: 'Экспорт в PDF', className: 'md-btn md-raised m-b-sm blue', extend: 'pdf'},
|
||||
]*!/
|
||||
};*/
|
||||
|
||||
$scope.orders_closed = {
|
||||
percent: 0,
|
||||
total: 0,
|
||||
@@ -137,6 +167,11 @@
|
||||
total: 0,
|
||||
sum: 0
|
||||
};
|
||||
$scope.orders_cancellations = {
|
||||
percent: 0,
|
||||
total: 0,
|
||||
sum: 0
|
||||
};
|
||||
$scope.orders_deleted = {
|
||||
percent: 0,
|
||||
total: 0,
|
||||
@@ -334,231 +369,12 @@
|
||||
});
|
||||
};
|
||||
|
||||
$scope.updateData = function () {
|
||||
smartRequest.get('dashboard/online/updatetime', function (data) {
|
||||
$scope.update_time = data.updated;
|
||||
});
|
||||
|
||||
smartRequest.get('v1/dashboard?method=info', function (data) {
|
||||
$scope.shiftInfo = data;
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/payments', function (data) {
|
||||
$scope.payments.labels = data.payments.map(payment => payment.name);
|
||||
$scope.payments.data = data.payments.map(payment => payment.value);
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/orders', function (data) {
|
||||
var total = data.wait_count + data.closed_count + data.deleted_count + data.returned_count;
|
||||
|
||||
$scope.orders_closed.percent = $scope.calcPercentageForGroupOrders(total, data.closed_count);
|
||||
$scope.orders_closed.total = data.closed_count;
|
||||
$scope.orders_closed.sum = data.closed_sum;
|
||||
|
||||
$scope.orders_waited.percent = $scope.calcPercentageForGroupOrders(total, data.wait_count);
|
||||
$scope.orders_waited.total = data.wait_count;
|
||||
$scope.orders_waited.sum = data.wait_sum;
|
||||
|
||||
$scope.orders_deleted.percent = $scope.calcPercentageForGroupOrders(total, data.deleted_count);
|
||||
$scope.orders_deleted.total = data.deleted_count;
|
||||
$scope.orders_deleted.sum = data.deleted_sum;
|
||||
|
||||
$scope.orders_returned.percent = $scope.calcPercentageForGroupOrders(total, data.returned_count);
|
||||
$scope.orders_returned.total = data.returned_count;
|
||||
$scope.orders_returned.sum = data.returned_sum;
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/middle', function (data) {
|
||||
$scope.middle = data.middle_check;
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/total', function (data) {
|
||||
$scope.total = data.total;
|
||||
});
|
||||
|
||||
smartRequest.get('v1/onlinestaff?method=dashboard', function (data) {
|
||||
$scope.personals = data.staff;
|
||||
});
|
||||
|
||||
smartRequest.get('v1/topdishes', function (data) {
|
||||
$scope.dishes = data.dishes;
|
||||
$scope.terminalId = data.terminal;
|
||||
if ($scope.terminalId > 0) {
|
||||
smartRequest.post('settings/update/force', {
|
||||
task: 'online',
|
||||
terminal: $scope.terminalId,
|
||||
}, function (data) {
|
||||
$('#preload-modal').modal();
|
||||
|
||||
setTimeout(function () {
|
||||
Notification.success('Данные синхронизируются. Обновите страницу через 5 минут.');
|
||||
$('#preload-modal').modal('toggle');
|
||||
}, 5000);
|
||||
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
smartRequest.get('dashboard/online/folders', function (data) {
|
||||
$scope.folders.labels = data.folders.map(folder => folder.name);
|
||||
$scope.folders.data = data.folders.map(folder => Math.roundClearNG(folder.count));
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/printers', function (data) {
|
||||
$scope.printers.labels = [];
|
||||
$scope.printers.data = [];
|
||||
|
||||
for (var i = 0; i < data.printers.length; i++) {
|
||||
$scope.printers.labels.push(data.printers[i].name);
|
||||
$scope.printers.data.push(Math.roundClearNG(data.printers[i].count, -2));
|
||||
}
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/tables', function (data) {
|
||||
$scope.tables = data.tables;
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/menu', function (data) {
|
||||
$scope.menus.labels = [];
|
||||
$scope.menus.data = [];
|
||||
|
||||
for (var i = 0; i < data.menus.length; i++) {
|
||||
$scope.menus.labels.push(data.menus[i].menu_name);
|
||||
$scope.menus.data.push(Math.roundClearNG(data.menus[i].count, -2));
|
||||
}
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/profit', function (data) {
|
||||
$scope.profit = data.profit;
|
||||
});
|
||||
|
||||
smartRequest.get('v1/dashboard?method=guests', function (data) {
|
||||
$scope.guests = data.guestsCount;
|
||||
$scope.namedGuests = data.namedGuests;
|
||||
$scope.sumNamedGuests = data.totalSum;
|
||||
});
|
||||
|
||||
smartRequest.get('v1/dashboard?method=deleted', function (data) {
|
||||
$scope.deleted = Math.roundNG(data.count, -2);
|
||||
$scope.deleted_sum = Math.roundNG(data.sum, -2);
|
||||
});
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
smartRequest.get('v1/dashboard?method=guests&type=median', function (data) {
|
||||
$scope.medianGuests.labels = [];
|
||||
$scope.medianGuests.data = [[]];
|
||||
|
||||
var tempData = [];
|
||||
var tempTime = [];
|
||||
for (var i = 0; i < data.data.length; i++) {
|
||||
var newDate = $scope.getMomentDate(data.data[i].time);
|
||||
|
||||
tempData.push(parseInt(data.data[i].count));
|
||||
tempTime.push(newDate);
|
||||
|
||||
var indexTime = $scope.getIntervals(tempTime[i], $scope.medianGuests.labels);
|
||||
|
||||
if (indexTime == -1) {
|
||||
$scope.medianGuests.labels.push(tempTime[i]);
|
||||
$scope.medianGuests.data[0].push(tempData[i]);
|
||||
} else {
|
||||
$scope.medianGuests.data[0][indexTime] += tempData[i];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/finance/median', function (data) {
|
||||
$scope.medianFinance.labels = [];
|
||||
$scope.medianFinance.data = [[], [], []];
|
||||
|
||||
var tempSum = [];
|
||||
var tempTotalCost = [];
|
||||
var tempProffit = [];
|
||||
var tempTime = [];
|
||||
|
||||
for (var i = 0; i < data.data.length; i++) {
|
||||
var newDate = $scope.getMomentDate(data.data[i].time);
|
||||
|
||||
tempSum.push(data.data[i].sum);
|
||||
tempTotalCost.push(data.data[i].totalCost);
|
||||
var proffit = parseFloat((tempSum[i] - tempTotalCost[i]).toFixed(2));
|
||||
tempProffit.push(proffit);
|
||||
tempTime.push(newDate);
|
||||
|
||||
var indexTime = $scope.getIntervals(tempTime[i], $scope.medianFinance.labels);
|
||||
|
||||
$scope.fillMedianFinance(indexTime, tempTime[i], tempSum[i], tempTotalCost[i], tempProffit[i]);
|
||||
}
|
||||
|
||||
for (var i = 0; i < $scope.medianFinance.data.length; i++) {
|
||||
for (var j = 0; j < $scope.medianFinance.data[i].length; j++) {
|
||||
var data = $scope.medianFinance.data[i][j];
|
||||
data = Math.round(data * 100) / 100;
|
||||
$scope.medianFinance.data[i][j] = data;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$scope.checkUpdate();
|
||||
};
|
||||
|
||||
|
||||
$scope.update = function () {
|
||||
|
||||
smartRequest.get('dashboard/online/updatetime', function (data) {
|
||||
$scope.update_time = data.updated;
|
||||
});
|
||||
|
||||
smartRequest.get('v1/dashboard?method=info', function (data) {
|
||||
$scope.shiftInfo = data;
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/payments', function (data) {
|
||||
$scope.payments.labels = data.payments.map(payment => payment.name);
|
||||
$scope.payments.data = data.payments.map(payment => payment.value);
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/orders', function (data) {
|
||||
var total = data.wait_count + data.closed_count + data.deleted_count + data.returned_count;
|
||||
|
||||
$scope.orders_closed.percent = $scope.calcPercentageForGroupOrders(total, data.closed_count);
|
||||
$scope.orders_closed.total = data.closed_count;
|
||||
$scope.orders_closed.sum = data.closed_sum;
|
||||
|
||||
$scope.orders_waited.percent = $scope.calcPercentageForGroupOrders(total, data.wait_count);
|
||||
$scope.orders_waited.total = data.wait_count;
|
||||
$scope.orders_waited.sum = data.wait_sum;
|
||||
|
||||
$scope.orders_deleted.percent = $scope.calcPercentageForGroupOrders(total, data.deleted_count);
|
||||
$scope.orders_deleted.total = data.deleted_count;
|
||||
$scope.orders_deleted.sum = data.deleted_sum;
|
||||
|
||||
$scope.orders_returned.percent = $scope.calcPercentageForGroupOrders(total, data.returned_count);
|
||||
$scope.orders_returned.total = data.returned_count;
|
||||
$scope.orders_returned.sum = data.returned_sum;
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/middle', function (data) {
|
||||
$scope.middle = data.middle_check;
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/total', function (data) {
|
||||
$scope.total = data.total;
|
||||
});
|
||||
|
||||
smartRequest.get('v1/onlinestaff?method=dashboard', function (data) {
|
||||
$scope.personals = data.staff;
|
||||
});
|
||||
|
||||
smartRequest.get('v1/topdishes', function (data) {
|
||||
$scope.dishes = data.dishes;
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/folders', function (data) {
|
||||
$scope.folders.labels = data.folders.map(folder => folder.name);
|
||||
$scope.folders.data = data.folders.map(folder => Math.roundClearNG(folder.count));
|
||||
@@ -574,7 +390,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/tables', function (data) {
|
||||
smartRequest.get('v1/dashboard?method=tables&type=online', function (data) {
|
||||
$scope.tables = data.tables;
|
||||
});
|
||||
|
||||
@@ -588,22 +404,59 @@
|
||||
}
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/profit', function (data) {
|
||||
smartRequest.get('dashboard/online/payments', function (data) {
|
||||
$scope.payments.labels = data.payments.map(payment => payment.name);
|
||||
$scope.payments.data = data.payments.map(payment => payment.value);
|
||||
});
|
||||
|
||||
smartRequest.get('v1/dashboard?method=info', function (data) {
|
||||
$scope.shiftInfo = data;
|
||||
});
|
||||
|
||||
smartRequest.get('v1/dashboard?method=total', function (data) {
|
||||
$scope.total = data.total;
|
||||
var total_closed = data.waited_count + data.closed_count + data.cancellations_count;
|
||||
var total_dr = data.deleted_count + data.returned_count;
|
||||
|
||||
$scope.orders_closed.percent = $scope.calcPercentageForGroupOrders(total_closed, data.closed_count);
|
||||
$scope.orders_closed.total = data.closed_count;
|
||||
$scope.orders_closed.sum = data.closed_sum;
|
||||
$scope.orders_waited.percent = $scope.calcPercentageForGroupOrders(total_closed, data.waited_count);
|
||||
$scope.orders_waited.total = data.waited_count;
|
||||
$scope.orders_waited.sum = data.waited_sum;
|
||||
$scope.orders_cancellations.percent = $scope.calcPercentageForGroupOrders(total_closed, data.cancellations_count);
|
||||
$scope.orders_cancellations.total = data.cancellations_count;
|
||||
$scope.orders_cancellations.sum = data.cancellations_sum;
|
||||
|
||||
$scope.orders_deleted.percent = $scope.calcPercentageForGroupOrders(total_dr, data.deleted_count);
|
||||
$scope.orders_deleted.total = data.deleted_count;
|
||||
$scope.orders_deleted.sum = data.deleted_sum;
|
||||
|
||||
$scope.orders_returned.percent = $scope.calcPercentageForGroupOrders(total_dr, data.returned_count);
|
||||
$scope.orders_returned.total = data.returned_count;
|
||||
$scope.orders_returned.sum = data.returned_sum;
|
||||
});
|
||||
|
||||
smartRequest.get('v1/dashboard?method=staff&type=online', function (data) {
|
||||
$scope.personals = data.staff;
|
||||
});
|
||||
|
||||
smartRequest.get('v1/topdishes', function (data) {
|
||||
$scope.dishes = data.dishes;
|
||||
});
|
||||
|
||||
smartRequest.get('v1/dashboard?method=profit', function (data) {
|
||||
$scope.profit = data.profit;
|
||||
$scope.middle = data.middle;
|
||||
$scope.guests = data.guests;
|
||||
});
|
||||
|
||||
smartRequest.get('v1/dashboard?method=guests', function (data) {
|
||||
$scope.guests = data.guestsCount;
|
||||
$scope.namedGuests = data.namedGuests;
|
||||
$scope.sumNamedGuests = data.totalSum;
|
||||
});
|
||||
|
||||
smartRequest.get('v1/dashboard?method=deleted', function (data) {
|
||||
$scope.deleted = Math.roundNG(data.count, -2);
|
||||
$scope.deleted_sum = Math.roundNG(data.sum, -2);
|
||||
});
|
||||
|
||||
smartRequest.get('v1/onlinediscount', function (data) {
|
||||
smartRequest.get('v1/dashboard?method=discounts&type=online', 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);
|
||||
@@ -765,24 +618,261 @@
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getMoreGuests = function (code) {
|
||||
smartRequest.get('v1/dashboard?method=guests&type=more', function (data) {
|
||||
$scope.moreData = data;
|
||||
$('#get-more-guests').modal();
|
||||
|
||||
$scope.getOrderInfo = function (order_id, opened, closed) {
|
||||
$scope.clients_modal = false;
|
||||
$scope.orders_modal = true;
|
||||
smartRequest.get('v1/orderhistory?order_id=' + order_id, function (actions) {
|
||||
$scope.actions = actions;
|
||||
});
|
||||
smartRequest.get('v1/orderinfo?order_id=' + order_id + '&opened=' + opened + '&closed=' + closed, function (data) {
|
||||
$scope.order = data.info;
|
||||
$scope.cols = 5;
|
||||
if ($scope.order.returned_count > 0) {
|
||||
$scope.cols = $scope.cols + 1;
|
||||
}
|
||||
if ($scope.order.deleted_count > 0) {
|
||||
$scope.cols = $scope.cols + 1;
|
||||
}
|
||||
$scope.backModal('orders', 'order');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.closeModal = function (modalName) {
|
||||
$scope.modalName = '#' + modalName;
|
||||
$('.modal-body').scrollTop(0);
|
||||
$($scope.modalName).modal('dispose');
|
||||
return true;
|
||||
};
|
||||
|
||||
$scope.backModal = function (prevModalName, targetModalName) {
|
||||
$scope.prevModalName = '#' + prevModalName;
|
||||
$scope.targetModalName = '#' + targetModalName;
|
||||
$('.modal-body').scrollTop(0);
|
||||
$($scope.prevModalName).modal('hide');
|
||||
$($scope.targetModalName).modal('toggle');
|
||||
return true;
|
||||
};
|
||||
|
||||
$scope.getMoreTotal = function (type) {
|
||||
$scope.type = type;
|
||||
$scope.guests_info = false;
|
||||
$scope.deleted_info = false;
|
||||
$scope.discount_info = false;
|
||||
smartRequest.get('v1/roommap?method=statistic&type=full', function (data) {
|
||||
$scope.staff_name = false;
|
||||
$scope.waited_count = data.waited_count;
|
||||
$scope.waited_sum = data.waited_sum;
|
||||
$scope.closed_count = data.closed_count;
|
||||
$scope.closed_sum = data.closed_sum;
|
||||
$scope.deleted_count = data.deleted_count;
|
||||
$scope.deleted_sum = data.deleted_sum;
|
||||
$scope.returned_count = data.returned_count;
|
||||
$scope.returned_sum = data.returned_sum;
|
||||
$scope.cancellations_count = data.cancellations_count;
|
||||
$scope.cancellations_sum = data.cancellations_sum;
|
||||
$scope.orders = data.orders;
|
||||
$scope.orders.forEach(function (order) {
|
||||
$scope.title = '';
|
||||
if (order.is_printed_before_edit) {
|
||||
$scope.title = $scope.title + '➖ Распечатан предчек до удаления позиции!<br>';
|
||||
}
|
||||
if (order.hasMove) {
|
||||
$scope.title = $scope.title + '➖ Использовался перенос заказа!<br>';
|
||||
}
|
||||
if (order.hasMerge) {
|
||||
$scope.title = $scope.title + '➖ Использовалось объединение заказов!<br>';
|
||||
}
|
||||
if (order.hasSlice) {
|
||||
$scope.title = $scope.title + '➖ Использовалось разбиение заказа!<br>';
|
||||
}
|
||||
if (order.hasDelete) {
|
||||
$scope.title = $scope.title + '➖ Присутствует удаление товаров!<br>';
|
||||
}
|
||||
order.title = $scope.title;
|
||||
});
|
||||
if ($scope.waited_count + $scope.closed_count + $scope.deleted_count + $scope.returned_count + $scope.cancellations_count > 0) {
|
||||
$('#orders').modal('show');
|
||||
} else {
|
||||
Notification.error('Заказы отсутствуют');
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
$scope.getMoreGuests = function (type) {
|
||||
$scope.guests_info = true;
|
||||
$scope.type = type;
|
||||
$scope.deleted_info = false;
|
||||
$scope.discount_info = false;
|
||||
smartRequest.get('v1/roommap?method=statistic&type=full&guests=true', function (data) {
|
||||
$scope.staff_name = false;
|
||||
$scope.waited_count = data.waited_count;
|
||||
$scope.waited_sum = data.waited_sum;
|
||||
$scope.closed_count = data.closed_count;
|
||||
$scope.closed_sum = data.closed_sum;
|
||||
$scope.deleted_count = data.deleted_count;
|
||||
$scope.deleted_sum = data.deleted_sum;
|
||||
$scope.returned_count = data.returned_count;
|
||||
$scope.returned_sum = data.returned_sum;
|
||||
$scope.cancellations_count = data.cancellations_count;
|
||||
$scope.cancellations_sum = data.cancellations_sum;
|
||||
$scope.orders = data.orders;
|
||||
$scope.orders.forEach(function (order) {
|
||||
$scope.title = '';
|
||||
if (order.is_printed_before_edit) {
|
||||
$scope.title = $scope.title + '➖ Распечатан предчек до удаления позиции!<br>';
|
||||
}
|
||||
if (order.hasMove) {
|
||||
$scope.title = $scope.title + '➖ Использовался перенос заказа!<br>';
|
||||
}
|
||||
if (order.hasMerge) {
|
||||
$scope.title = $scope.title + '➖ Использовалось объединение заказов!<br>';
|
||||
}
|
||||
if (order.hasSlice) {
|
||||
$scope.title = $scope.title + '➖ Использовалось разбиение заказа!<br>';
|
||||
}
|
||||
if (order.hasDelete) {
|
||||
$scope.title = $scope.title + '➖ Присутствует удаление товаров!<br>';
|
||||
}
|
||||
order.title = $scope.title;
|
||||
});
|
||||
if ($scope.waited_count + $scope.closed_count + $scope.deleted_count + $scope.returned_count + $scope.cancellations_count > 0) {
|
||||
$('#orders').modal('show');
|
||||
} else {
|
||||
Notification.error('Заказы отсутствуют');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getMoreStaff = function (staff, type) {
|
||||
$scope.type = type;
|
||||
$scope.guests_info = false;
|
||||
$scope.deleted_info = false;
|
||||
$scope.discount_info = false;
|
||||
smartRequest.get('v1/roommap?method=statistic&type=full&staff_id=' + staff.code, function (data) {
|
||||
$scope.staff_name = staff.name;
|
||||
$scope.waited_count = data.waited_count;
|
||||
$scope.waited_sum = data.waited_sum;
|
||||
$scope.closed_count = data.closed_count;
|
||||
$scope.closed_sum = data.closed_sum;
|
||||
$scope.deleted_count = data.deleted_count;
|
||||
$scope.deleted_sum = data.deleted_sum;
|
||||
$scope.returned_count = data.returned_count;
|
||||
$scope.returned_sum = data.returned_sum;
|
||||
$scope.cancellations_count = data.cancellations_count;
|
||||
$scope.cancellations_sum = data.cancellations_sum;
|
||||
$scope.orders = data.orders;
|
||||
$scope.orders.forEach(function (order) {
|
||||
$scope.title = '';
|
||||
if (order.is_printed_before_edit) {
|
||||
$scope.title = $scope.title + '➖ Распечатан предчек до удаления позиции!<br>';
|
||||
}
|
||||
if (order.hasMove) {
|
||||
$scope.title = $scope.title + '➖ Использовался перенос заказа!<br>';
|
||||
}
|
||||
if (order.hasMerge) {
|
||||
$scope.title = $scope.title + '➖ Использовалось объединение заказов!<br>';
|
||||
}
|
||||
if (order.hasSlice) {
|
||||
$scope.title = $scope.title + '➖ Использовалось разбиение заказа!<br>';
|
||||
}
|
||||
if (order.hasDelete) {
|
||||
$scope.title = $scope.title + '➖ Присутствует удаление товаров!<br>';
|
||||
}
|
||||
order.title = $scope.title;
|
||||
});
|
||||
if ($scope.waited_count + $scope.closed_count + $scope.deleted_count + $scope.returned_count + $scope.cancellations_count > 0) {
|
||||
$('#orders').modal('show');
|
||||
} else {
|
||||
Notification.error('Заказы отсутствуют');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getMoreDeleted = function () {
|
||||
smartRequest.get('v1/dashboard?method=deleted&more=true', function (data) {
|
||||
$scope.moreData = data;
|
||||
$('#get-more-deleted').modal();
|
||||
$scope.guests_info = false;
|
||||
$scope.deleted_info = true;
|
||||
$scope.discount_info = false;
|
||||
smartRequest.get('v1/roommap?method=statistic&type=full&deleted=true', function (data) {
|
||||
$scope.waited_count = data.waited_count;
|
||||
$scope.waited_sum = data.waited_sum;
|
||||
$scope.closed_count = data.closed_count;
|
||||
$scope.closed_sum = data.closed_sum;
|
||||
$scope.deleted_count = data.deleted_count;
|
||||
$scope.deleted_sum = data.deleted_sum;
|
||||
$scope.returned_count = data.returned_count;
|
||||
$scope.returned_sum = data.returned_sum;
|
||||
$scope.cancellations_count = data.cancellations_count;
|
||||
$scope.cancellations_sum = data.cancellations_sum;
|
||||
$scope.orders = data.orders;
|
||||
$scope.orders.forEach(function (order) {
|
||||
$scope.title = '';
|
||||
if (order.is_printed_before_edit) {
|
||||
$scope.title = $scope.title + '➖ Распечатан предчек до удаления позиции!<br>';
|
||||
}
|
||||
if (order.hasMove) {
|
||||
$scope.title = $scope.title + '➖ Использовался перенос заказа!<br>';
|
||||
}
|
||||
if (order.hasMerge) {
|
||||
$scope.title = $scope.title + '➖ Использовалось объединение заказов!<br>';
|
||||
}
|
||||
if (order.hasSlice) {
|
||||
$scope.title = $scope.title + '➖ Использовалось разбиение заказа!<br>';
|
||||
}
|
||||
if (order.hasDelete) {
|
||||
$scope.title = $scope.title + '➖ Присутствует удаление товаров!<br>';
|
||||
}
|
||||
order.title = $scope.title;
|
||||
});
|
||||
if ($scope.waited_count + $scope.closed_count + $scope.deleted_count + $scope.returned_count + $scope.cancellations_count > 0) {
|
||||
$('#orders').modal('show');
|
||||
} else {
|
||||
Notification.error('Заказы отсутствуют');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getMoreDiscount = function () {
|
||||
smartRequest.get('v1/morediscount/', function (data) {
|
||||
$scope.moreData = data;
|
||||
$('#get-more-discount').modal();
|
||||
$scope.guests_info = false;
|
||||
$scope.deleted_info = false;
|
||||
$scope.discount_info = true;
|
||||
smartRequest.get('v1/roommap?method=statistic&type=full&discounts=true', function (data) {
|
||||
$scope.waited_count = data.waited_count;
|
||||
$scope.waited_sum = data.waited_sum;
|
||||
$scope.closed_count = data.closed_count;
|
||||
$scope.closed_sum = data.closed_sum;
|
||||
$scope.deleted_count = data.deleted_count;
|
||||
$scope.deleted_sum = data.deleted_sum;
|
||||
$scope.returned_count = data.returned_count;
|
||||
$scope.returned_sum = data.returned_sum;
|
||||
$scope.cancellations_count = data.cancellations_count;
|
||||
$scope.cancellations_sum = data.cancellations_sum;
|
||||
$scope.orders = data.orders;
|
||||
$scope.orders.forEach(function (order) {
|
||||
$scope.title = '';
|
||||
if (order.is_printed_before_edit) {
|
||||
$scope.title = $scope.title + '➖ Распечатан предчек до удаления позиции!<br>';
|
||||
}
|
||||
if (order.hasMove) {
|
||||
$scope.title = $scope.title + '➖ Использовался перенос заказа!<br>';
|
||||
}
|
||||
if (order.hasMerge) {
|
||||
$scope.title = $scope.title + '➖ Использовалось объединение заказов!<br>';
|
||||
}
|
||||
if (order.hasSlice) {
|
||||
$scope.title = $scope.title + '➖ Использовалось разбиение заказа!<br>';
|
||||
}
|
||||
if (order.hasDelete) {
|
||||
$scope.title = $scope.title + '➖ Присутствует удаление товаров!<br>';
|
||||
}
|
||||
order.title = $scope.title;
|
||||
});
|
||||
if ($scope.waited_count + $scope.closed_count + $scope.deleted_count + $scope.returned_count + $scope.cancellations_count > 0) {
|
||||
$('#orders').modal('show');
|
||||
} else {
|
||||
Notification.error('Заказы отсутствуют');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -794,54 +884,6 @@
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getItemsDeleted = function (order) {
|
||||
$('#get-more-deleted').modal('toggle');
|
||||
smartRequest.get('v1/dashboard?method=deleted&items=true&order_id=' + order.number, function (data) {
|
||||
$scope.order = data;
|
||||
$('#items-deleted').modal('toggle');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getItemsStaff = function (order) {
|
||||
$('#get-more-staff').modal('toggle');
|
||||
smartRequest.get('v1/onlinestaff?method=items&order=' + order.number, function (data) {
|
||||
$scope.order = data;
|
||||
$('#items-staff').modal('toggle');
|
||||
});
|
||||
};
|
||||
|
||||
$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');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getTotalItems = function (order) {
|
||||
$('#get-more-total').modal('toggle');
|
||||
smartRequest.get('dashboard/total/items?order=' + order.number, function (data) {
|
||||
$scope.order = data;
|
||||
smartRequest.get('v1/orderhistory?order_id=' + order.number, function (actions) {
|
||||
$scope.actions = actions;
|
||||
});
|
||||
$('#items-total').modal('toggle');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getStaffMore = function (staff) {
|
||||
smartRequest.get('dashboard/more/staff?code=' + staff.code, function (data) {
|
||||
$scope.staff = data;
|
||||
$('#get-more-staff').modal('toggle');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getTableMore = function (table) {
|
||||
smartRequest.get('dashboard/more/table?place=' + table.place_name + '&table=' + table.table_name, function (data) {
|
||||
$scope.table_ord = data;
|
||||
@@ -876,7 +918,7 @@
|
||||
};
|
||||
|
||||
$scope.GetCountNamedGuests = declOfNum(['именованный гость', 'именованных гостя', 'именованных гостей']);
|
||||
$scope.GetCountDeletedPositions = declOfNum(['позиций', 'позиции', 'позиций']);
|
||||
$scope.GetCountDeletedPositions = declOfNum(['товаров', 'товара', 'товаров']);
|
||||
$scope.GetCountTotalOrders = declOfNum(['заказ', 'заказа', 'заказов']);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user