v.2.3
Happy New Year!
90
commands/Import — копия.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace App\Commands;
|
||||
|
||||
use App\Component\Models\Terminal;
|
||||
use App\Console\Commands\HRCCommand;
|
||||
use App\Console\Commands\HRCCommandInterface;
|
||||
|
||||
class Import extends HRCCommand implements HRCCommandInterface {
|
||||
protected $signature = 'getimport';
|
||||
|
||||
public function command($input, $output = null) {
|
||||
$HRCPortalURL = 'https://portal.hrc.by/';
|
||||
$folder = 'backup';
|
||||
$terminals = Terminal::where('soft', '=', 1)->where('is_active', '=', 1)->get();
|
||||
$end_date = date('m/d/Y H:i:s', strtotime($input['end_date']) + 86399);
|
||||
$start_date = date('m/d/Y H:i:s', strtotime($input['start_date']));
|
||||
foreach ($terminals as $terminal) {
|
||||
$url = $HRCPortalURL . 'api/cloud/list?api=2.0&project_code=hrc&code=' . $terminal['key'] . '&folder=' . $folder;
|
||||
$search = curl_init();
|
||||
|
||||
curl_setopt_array($search, array(
|
||||
CURLOPT_URL => $url,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_HEADER => false,
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 0,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
));
|
||||
$search_response = curl_exec($search);
|
||||
curl_close($search);
|
||||
$responses = json_decode($search_response, TRUE)['files'];
|
||||
|
||||
foreach ($responses as $key => $response) {
|
||||
if (array_key_exists('filename', $response)) {
|
||||
$fulldate = date_parse_from_format('d-m-Y-H-i-s', $response['filename']);
|
||||
$fulldate = mktime($fulldate['hour'], $fulldate['minute'], $fulldate['second'], $fulldate['month'], $fulldate['day'], $fulldate['year']);
|
||||
if ($fulldate >= strtotime($start_date) && $fulldate <= strtotime($end_date)) {
|
||||
$out[] = date('d-m-Y-H-i-s', $fulldate);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isset($out)) {
|
||||
return [
|
||||
'status' => 'success',
|
||||
'message' => 'shifts not found',
|
||||
];
|
||||
} else {
|
||||
foreach ($out as $filename) {
|
||||
$date_file = date('Y-m-d', $filename);
|
||||
//$path = '/backup/' . $filename . '.xml';
|
||||
$path = '/Резервная%20копия/' . $date_file . '/exchange/' . $date_file . '/exchange/' . $filename . '.xml';
|
||||
$download_url = $HRCPortalURL . 'api/cloud/download?api=2.0&project_code=hrc&code=' . $terminal['key'] . '&path=' . $path;
|
||||
$download = curl_init();
|
||||
|
||||
curl_setopt_array($download, array(
|
||||
CURLOPT_URL => $download_url,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_HEADER => false,
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 0,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
));
|
||||
$download_response = curl_exec($download);
|
||||
curl_close($download);
|
||||
$file = json_decode($download_response, TRUE)['content'];
|
||||
$params = array('code' => $terminal['key'], 'name' => $filename . '.xml', 'folder' => 'exchange', 'content' => $file, 'project_code' => 'hrc', 'api' => '2.0');
|
||||
$upload = curl_init();
|
||||
curl_setopt_array($upload, array(
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_HEADER => true,
|
||||
CURLOPT_URL => $HRCPortalURL . 'api/cloud/upload',
|
||||
CURLOPT_SSL_VERIFYHOST => 0,
|
||||
CURLOPT_POST => true,
|
||||
CURLOPT_POSTFIELDS => $params,
|
||||
));
|
||||
$upload_response = curl_exec($upload);
|
||||
curl_close($upload);
|
||||
}
|
||||
return [
|
||||
'status' => 'success',
|
||||
'start_date' => strtotime($start_date),
|
||||
'end_date' => strtotime($end_date),
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
125
commands/TopDishesNewYear.php
Normal file
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
namespace App\Commands;
|
||||
|
||||
use App\Component\Models\Dishes;
|
||||
use App\Component\Models\ExchangeItems;
|
||||
use App\Component\Models\ExchangeOrders;
|
||||
use App\Component\Models\Terminal;
|
||||
use App\Console\Commands\HRCCommand;
|
||||
use App\Console\Commands\HRCCommandInterface;
|
||||
|
||||
class TopDishesNewYear extends HRCCommand implements HRCCommandInterface {
|
||||
protected $signature = 'gettopdishesnewyear';
|
||||
|
||||
public function command($input, $output = null) {
|
||||
$terminal = Terminal::where('soft', '=', 1)->where('is_active', '=', 1)->first();
|
||||
$dirname = __DIR__ . "\\..\\..\\..\\Exchange\\" . $terminal['key'] . "\\";
|
||||
$filename = "newyear.json";
|
||||
if (!is_dir($dirname)) {
|
||||
mkdir($dirname, 0777);
|
||||
}
|
||||
if (!file_exists($dirname . $filename)) {
|
||||
$info = ExchangeItems::where('menu_code', '>', 0)
|
||||
->where('real_price', '>', 1)
|
||||
->where('created_at', '>=', '2021-10-01 00:00:00')
|
||||
->where('created_at', '<', '2021-12-31 23:59:59')
|
||||
->get()
|
||||
->unique('menu_code');
|
||||
$count = ExchangeItems::where('menu_code', '>', 0)->where('created_at', '>=', '2021-10-01 00:00:00')->where('created_at', '<', '2021-12-31 23:59:59')->count();
|
||||
if ($count > 0) {
|
||||
foreach ($info as $key => $value) {
|
||||
$out[] = $value;
|
||||
}
|
||||
foreach ($out as $key => $item) {
|
||||
$dishInfo = Dishes::where('code', '=', $item['menu_code'])
|
||||
->where('legacy_code', '=', $item['dishes_code'])
|
||||
// ->where('is_history', '=', 0)
|
||||
->first();
|
||||
$onlineDishInfo = ExchangeItems::where('menu_code', '=', $item['menu_code'])
|
||||
->where('dishes_code', '=', $item['dishes_code'])
|
||||
->where('created_at', '>=', '2021-10-01 00:00:00')
|
||||
->where('created_at', '<', '2021-12-31 23:59:59')
|
||||
->first();
|
||||
$dishName = $dishInfo['name'];
|
||||
$dishCount = ExchangeItems::where('menu_code', '=', $item['menu_code'])
|
||||
->where('created_at', '>=', '2021-10-01 00:00:00')
|
||||
->where('created_at', '<', '2021-12-31 23:59:59')
|
||||
->sum('count');
|
||||
$dishSum = $onlineDishInfo['real_price'] * $dishCount;
|
||||
if ($dishSum > 0) {
|
||||
$dishTotalCost = round(($onlineDishInfo['special_price'] * $dishCount), 2);
|
||||
$dishPercent = round((100 - ((($dishSum - $dishTotalCost) * 100) / $dishSum)), 2);
|
||||
$dishProfit = $dishSum - $dishTotalCost;
|
||||
} else {
|
||||
$dishTotalCost = 0;
|
||||
$dishPercent = 0;
|
||||
$dishProfit = 0;
|
||||
}
|
||||
$dishes[] = array('name' => $dishName, 'count' => intval($dishCount), 'sum' => intval($dishSum), 'totalCost' => intval($dishTotalCost), 'percentProffit' => $dishPercent, 'proffit' => $dishProfit);
|
||||
}
|
||||
for ($i = 0; $i < count($dishes); $i++) {
|
||||
$sortkey[$i] = $dishes[$i]['count'];
|
||||
}
|
||||
arsort($sortkey);
|
||||
foreach ($sortkey as $key => $key) {
|
||||
$sorted[] = $dishes[$key];
|
||||
}
|
||||
$sorted = array_slice($sorted, 0, 3);
|
||||
//End top dishes counter
|
||||
|
||||
//Start top day
|
||||
//SELECT COUNT(`code`) AS `orders_counter`, `shift_id` FROM `exchange_orders` WHERE `is_closed` > 0 AND `opened` > '2021-01-01 00:00:00' GROUP BY `shift_id` ORDER BY `orders_counter` desc
|
||||
$shifts = ExchangeOrders::where('is_closed', '>', 0)
|
||||
->where('opened', '>', '2021-01-01 00:00:00')
|
||||
->get()
|
||||
->unique('shift_id');
|
||||
foreach ($shifts as $key => $shift) {
|
||||
$shift_id = $shift['shift_id'];
|
||||
$shift_order_count = ExchangeOrders::where('shift_id', '=', $shift_id)->count();
|
||||
$shift_order_sum = ExchangeOrders::where('shift_id', '=', $shift_id)->sum('order_sum');
|
||||
$shift_date = ExchangeOrders::where('shift_id', '=', $shift_id)->first();
|
||||
$tr_m = ['Нулябрь' /* для сдвига индекса на +1*/, 'Января', 'Февраля', 'Марта', 'Апреля', 'Мая', 'Июня', 'Июля', 'Августа', 'Сентября', 'Октября', 'Ноября', 'Декабря'];
|
||||
$exp_date = getdate(strtotime($shift_date['opened']));
|
||||
$full_datedate = sprintf(
|
||||
'%d %s %d',
|
||||
$exp_date['mday'],
|
||||
$tr_m[$exp_date['mon']],
|
||||
$exp_date['year']
|
||||
);
|
||||
$shift_counter[] = array('shift_id' => $shift_id, 'count' => $shift_order_count, 'date' => $full_datedate, 'sum' => $shift_order_sum);
|
||||
}
|
||||
for ($i = 0; $i < count($shift_counter); $i++) {
|
||||
$shift_counter_sortkey[$i] = $shift_counter[$i]['count'];
|
||||
}
|
||||
arsort($shift_counter_sortkey);
|
||||
foreach ($shift_counter_sortkey as $key => $key) {
|
||||
$shift_counter_sorted[] = $shift_counter[$key];
|
||||
}
|
||||
$shift_counter_sorted = array_slice($shift_counter_sorted, 0, 1);
|
||||
//End top day
|
||||
|
||||
//Return data
|
||||
$data = [
|
||||
'status' => 'success',
|
||||
'count' => $count,
|
||||
'dishes' => $sorted,
|
||||
'top_shift' => $shift_counter_sorted,
|
||||
];
|
||||
$handle = fopen($dirname . $filename, 'w+');
|
||||
fputs($handle, json_encode($data));
|
||||
fclose($handle);
|
||||
return $data;
|
||||
} else {
|
||||
return [
|
||||
'status' => 'success',
|
||||
'count' => 0,
|
||||
'dishes' => [],
|
||||
];
|
||||
}
|
||||
} else {
|
||||
$data = json_decode(file_get_contents($dirname . $filename), true);
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hrc-admin/hello-world",
|
||||
"version": "2.2",
|
||||
"version": "2.3",
|
||||
"require": {
|
||||
"horeca/admin-php-module-core": "dev-master"
|
||||
},
|
||||
|
||||
9
models/ExchangeItems.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Component\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ExchangeItems extends Model {
|
||||
protected $table = 'exchange_items';
|
||||
}
|
||||
9
models/ExchangeOrders.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Component\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ExchangeOrders extends Model {
|
||||
protected $table = 'exchange_orders';
|
||||
}
|
||||
9
models/ExchangeShifts.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Component\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ExchangeShifts extends Model {
|
||||
protected $table = 'exchange_shifts';
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
[info]
|
||||
name=V1
|
||||
version=2.2
|
||||
version=2.3
|
||||
[build]
|
||||
version=2.2
|
||||
version=2.3
|
||||
|
||||
585
web/controllers/dashboard.js
Normal file
@@ -0,0 +1,585 @@
|
||||
// code style: https://github.com/johnpapa/angular-styleguide
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
angular
|
||||
.module('app')
|
||||
.filter('curr', function () { //maybe we should take it to the filter folder
|
||||
return function (input) {
|
||||
if (typeof input == 'string') {
|
||||
input = parseFloat(input.replace(/,/g, '.'));
|
||||
}
|
||||
|
||||
var outputValue = input;
|
||||
|
||||
if (typeof outputValue !== 'undefined') {
|
||||
return outputValue.toFixed(2);
|
||||
} else {
|
||||
return 0.00;
|
||||
}
|
||||
};
|
||||
})
|
||||
.controller('DashboardCtrl', DashboardCtrl);
|
||||
|
||||
DashboardCtrl.inject = ['$scope', 'smartRequest', '$interval', '$location'];
|
||||
function DashboardCtrl($scope, smartRequest, $interval, $location) {
|
||||
$(document).ready(function() {
|
||||
if (moment(moment().format('YYYY-MM-DD')).isAfter('2021-12-25')) {
|
||||
if (moment(moment().format('YYYY-MM-DD')).isBefore('2022-01-10')) {
|
||||
smartRequest.get('v1/topdishesnewyear', function (data) {
|
||||
$scope.year_count = data.count;
|
||||
$scope.top_dishes = data.dishes;
|
||||
$scope.top_shifts = data.top_shift;
|
||||
});
|
||||
var delayMs = 1500; // delay in milliseconds
|
||||
setTimeout(function(){
|
||||
$('#get-more-newyear').modal('show');
|
||||
}, delayMs);
|
||||
if ($( window ).width() < 700) {
|
||||
$('#get-more-newyear').on('show.bs.modal', function () {
|
||||
$('.modal-dialog').css('margin',0);
|
||||
$('.modal-content').css('height',$( window ).height()*0.95);
|
||||
$('.modal-content').css('width',$( window ).width());
|
||||
$('.myCarousel').css('height', $( window ).height()*0.95);
|
||||
$('.myCarousel').css('width', 'auto');
|
||||
$('.myCarousel').css('object-fit', 'cover');
|
||||
});
|
||||
} else {
|
||||
$('#get-more-newyear').on('show.bs.modal', function () {
|
||||
$('.modal-dialog').css('margin-right',$( window ).width()/4);
|
||||
$('.modal-dialog').css('margin-left',$( window ).width()/4);
|
||||
$('.modal-dialog').css('margin-top',$( window ).height()/8);
|
||||
$('.modal-content').css('height',$( window ).height()*0.7);
|
||||
$('.modal-content').css('width',$( window ).width()*0.5);
|
||||
$('.myCarousel').css('height', $( window ).height()*0.7);
|
||||
$('.myCarousel').css('width', 'auto');
|
||||
$('.myCarousel').css('object-fit', 'cover');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
$scope.nextImage = function () {
|
||||
$('.carousel').carousel('next');
|
||||
};
|
||||
$scope.previousImage = function () {
|
||||
$('.carousel').carousel('prev');
|
||||
};
|
||||
|
||||
$scope.orders_closed = {
|
||||
percent: 0,
|
||||
total: 0,
|
||||
sum: 0
|
||||
};
|
||||
$scope.orders_waited = {
|
||||
percent: 0,
|
||||
total: 0,
|
||||
sum: 0
|
||||
};
|
||||
$scope.orders_deleted = {
|
||||
percent: 0,
|
||||
total: 0,
|
||||
sum: 0
|
||||
};
|
||||
$scope.orders_returned = {
|
||||
percent: 0,
|
||||
total: 0,
|
||||
sum: 0
|
||||
};
|
||||
|
||||
$scope.middle = 0;
|
||||
$scope.total = 0;
|
||||
$scope.guests = 0;
|
||||
$scope.namedGuests = 0;
|
||||
$scope.profit = 0;
|
||||
$scope.deleted = 0;
|
||||
$scope.deleted_sum = 0;
|
||||
$scope.discounts = 0;
|
||||
$scope.discounts_sum = 0;
|
||||
|
||||
$scope.personals = [];
|
||||
$scope.dishes = [];
|
||||
|
||||
$scope.need_update = false;
|
||||
|
||||
$scope.shiftInfo = {};
|
||||
|
||||
$scope.folders = {
|
||||
data: [],
|
||||
labels: [],
|
||||
options: {
|
||||
legend: {
|
||||
display: true
|
||||
},
|
||||
tooltips: {
|
||||
mode: 'nearest',
|
||||
displayColors: false
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.printers = {
|
||||
data: [],
|
||||
labels: [],
|
||||
options: {
|
||||
legend: {
|
||||
display: true
|
||||
},
|
||||
tooltips: {
|
||||
mode: 'nearest',
|
||||
displayColors: false
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.menus = {
|
||||
data: [],
|
||||
labels: [],
|
||||
options: {
|
||||
legend: {
|
||||
display: true
|
||||
},
|
||||
tooltips: {
|
||||
mode: 'nearest',
|
||||
displayColors: false
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.payments = {
|
||||
data: [[]],
|
||||
labels: [],
|
||||
options: {
|
||||
legend: {
|
||||
display: true
|
||||
},
|
||||
tooltips: {
|
||||
mode: 'nearest',
|
||||
displayColors: false
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.update_time = '';
|
||||
|
||||
$scope.colors = [
|
||||
{
|
||||
backgroundColor: '#97bbcd',
|
||||
borderColor: '#97bbcd',
|
||||
hoverBackgroundColor: '#97bbcd',
|
||||
hoverBorderColor: '#97bbcd'
|
||||
},
|
||||
{
|
||||
backgroundColor: '#F7464A',
|
||||
borderColor: '#F7464A',
|
||||
hoverBackgroundColor: '#F7464A',
|
||||
hoverBorderColor: '#F7464A'
|
||||
},
|
||||
{
|
||||
backgroundColor: '#46BFBD',
|
||||
borderColor: '#46BFBD',
|
||||
hoverBackgroundColor: '#46BFBD',
|
||||
hoverBorderColor: '#46BFBD'
|
||||
}
|
||||
];
|
||||
|
||||
//for widget mediana guests
|
||||
$scope.medianGuests = {
|
||||
series: ['Количество'],
|
||||
data: [[]],
|
||||
labels: [],
|
||||
options: {
|
||||
tooltips: {
|
||||
mode: 'nearest',
|
||||
displayColors: false,
|
||||
callbacks: {
|
||||
title: function (tooltipItems, data) {
|
||||
var time = tooltipItems[0].xLabel;
|
||||
var nextTime = moment(time).add(30, 'm');
|
||||
return time.format('HH:mm') + ' - ' + nextTime.format('HH:mm');
|
||||
}
|
||||
}
|
||||
},
|
||||
scales: {
|
||||
xAxes: [{
|
||||
type: 'time',
|
||||
bounds: 'ticks',
|
||||
time: {
|
||||
unit: 'hour',
|
||||
unitStepSize: 0.5,
|
||||
displayFormats: {
|
||||
'hour': 'HH:mm'
|
||||
},
|
||||
}
|
||||
}],
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
}]
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
//for widget mediana finance
|
||||
$scope.medianFinance = {
|
||||
data: [[], [], []],
|
||||
labels: [],
|
||||
series: ['Выручка', 'Себестоимость', 'Прибыль'],
|
||||
options: {
|
||||
legend: {
|
||||
display: true
|
||||
},
|
||||
scales: {
|
||||
xAxes: [{
|
||||
type: 'time',
|
||||
bounds: 'ticks',
|
||||
time: {
|
||||
unit: 'hour',
|
||||
unitStepSize: 0.5,
|
||||
displayFormats: {
|
||||
'hour': 'HH:mm'
|
||||
}
|
||||
}
|
||||
}],
|
||||
yAxes: [{
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
}]
|
||||
},
|
||||
tooltips: {
|
||||
callbacks: {
|
||||
title: function (tooltipItems, data) {
|
||||
var time = tooltipItems[0].xLabel;
|
||||
var nextTime = moment(time).add(30, 'm');
|
||||
return time.format('HH:mm') + ' - ' + nextTime.format('HH:mm');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.NOT_CLOSED = 'не закрыт';
|
||||
|
||||
$scope.checkUpdate = function () {
|
||||
smartRequest.get('dashboard/ping', function (data) {
|
||||
$scope.need_update = data.data.update;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.update = function () {
|
||||
|
||||
smartRequest.get('dashboard/online/updatetime', function (data) {
|
||||
$scope.update_time = data.updated;
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/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('dashboard/online/staff', 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));
|
||||
});
|
||||
|
||||
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('dashboard/online/guests', function (data) {
|
||||
$scope.guests = data.guestsCount;
|
||||
$scope.namedGuests = data.namedGuests;
|
||||
$scope.sumNamedGuests = data.totalSum;
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/deleted', function (data) {
|
||||
$scope.deleted = Math.roundNG(data.count, -2);
|
||||
$scope.deleted_sum = Math.roundNG(data.sum, -2);
|
||||
});
|
||||
|
||||
smartRequest.get('dashboard/online/discount', 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('dashboard/online/guests/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();
|
||||
|
||||
$scope.ping = function () {
|
||||
let stop = $interval(function () {
|
||||
if($location.url() == '/dashboard') {
|
||||
smartRequest.get('dashboard/ping', function (data) {
|
||||
$scope.need_update = data.data.update;
|
||||
|
||||
if (!$scope.need_update) {
|
||||
$scope.update();
|
||||
$interval.cancel(stop);
|
||||
}
|
||||
});
|
||||
}
|
||||
}, 10000);
|
||||
};
|
||||
|
||||
$scope.ping();
|
||||
|
||||
$scope.all_widgets = [];
|
||||
$scope.add = function () {
|
||||
smartRequest.get('settings/widgets/all', function (data) {
|
||||
$scope.all_widgets = data.widgets;
|
||||
});
|
||||
|
||||
$('#add-widget').modal();
|
||||
};
|
||||
|
||||
$scope.calcPercentageForGroupOrders = function (total, countOrdersGroup) {
|
||||
return total > 0 ? Math.round(countOrdersGroup * 100 / total) : 0;
|
||||
};
|
||||
|
||||
|
||||
$scope.addWidget = function () {
|
||||
$('#add-widget').modal('toggle');
|
||||
|
||||
smartRequest.post('settings/widgets/enable', {
|
||||
code: $scope.add_widget_code
|
||||
}, function (data) {
|
||||
$scope.update();
|
||||
});
|
||||
};
|
||||
|
||||
$scope.deleteWidget = function (code) {
|
||||
smartRequest.post('settings/widgets/disable', {
|
||||
code: code
|
||||
}, function (data) {
|
||||
$scope.update();
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getMomentDate = function (date_str) {
|
||||
var date = moment(date_str, 'DD.MM.YYYY HH:mm:ss');
|
||||
var remainder = 30 - (date.minute() % 30);
|
||||
return moment(date).add(remainder, 'minutes').set('second', 0);
|
||||
};
|
||||
|
||||
$scope.getIntervals = function (momentTime, array) {
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
var time = array[i];
|
||||
if (time.get('hour') == momentTime.get('hour') && time.get('minute') == momentTime.get('minute')) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
|
||||
|
||||
$scope.fillMedianFinance = function (index, time, sum, totalCost, proffit) {
|
||||
if (index == -1) {
|
||||
$scope.pushToMedianFinance(time, sum, totalCost, proffit);
|
||||
} else {
|
||||
$scope.incMedianFinance(index, sum, totalCost, proffit);
|
||||
}
|
||||
};
|
||||
|
||||
$scope.pushToMedianFinance = function (time, sum, totalCost, proffit) {
|
||||
$scope.medianFinance.labels.push(time);
|
||||
$scope.medianFinance.data[0].push(sum);
|
||||
$scope.medianFinance.data[1].push(totalCost);
|
||||
$scope.medianFinance.data[2].push(proffit);
|
||||
};
|
||||
|
||||
$scope.incMedianFinance = function (index, sum, totalCost, proffit) {
|
||||
$scope.medianFinance.data[0][index] += sum;
|
||||
$scope.medianFinance.data[1][index] += totalCost;
|
||||
$scope.medianFinance.data[2][index] += proffit;
|
||||
};
|
||||
|
||||
$scope.getMore = function (code) {
|
||||
smartRequest.get('dashboard/more/' + code, function (data) {
|
||||
$scope.moreData = data;
|
||||
$('#get-more-' + code).modal();
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getItems = function (modal, order) {
|
||||
$('#get-more-' + modal).modal('toggle');
|
||||
smartRequest.get('dashboard/' + modal + '/items?order=' + order.number, function (data) {
|
||||
$scope.order = data;
|
||||
$('#items-' + modal).modal('toggle');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.returnModal = function (name) {
|
||||
$('#items-' + name).on('hidden.bs.modal', function (event) {
|
||||
$('#get-more-' + name).modal('show');
|
||||
});
|
||||
};
|
||||
|
||||
$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;
|
||||
$('#get-more-table').modal('toggle');
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getClosedDate = function (closeTime) {
|
||||
if (closeTime == '30.12.1899')
|
||||
return $scope.NOT_CLOSED;
|
||||
return closeTime;
|
||||
};
|
||||
|
||||
$scope.getBackClass = function (percentProffit) {
|
||||
if (percentProffit <= 25) {
|
||||
return 'green-600';
|
||||
} else if (percentProffit <= 35) {
|
||||
return 'green';
|
||||
} else if (percentProffit <= 50) {
|
||||
return '';
|
||||
} else if (percentProffit <= 100) {
|
||||
return 'red';
|
||||
}
|
||||
};
|
||||
|
||||
var declOfNum = function (titles, number) {
|
||||
number = Math.abs(number);
|
||||
var cases = [2, 0, 1, 1, 1, 2];
|
||||
return function (number) {
|
||||
return titles[(number % 100 > 4 && number % 100 < 20) ? 2 : cases[(number % 10 < 5) ? number % 10 : 5]];
|
||||
};
|
||||
};
|
||||
|
||||
$scope.GetCountNamedGuests = declOfNum(['именованный гость', 'именованных гостя', 'именованных гостей']);
|
||||
$scope.GetCountDeletedPositions = declOfNum(['позиций', 'позиции', 'позиций']);
|
||||
$scope.GetCountTotalOrders = declOfNum(['заказ', 'заказа', 'заказов']);
|
||||
}
|
||||
|
||||
})();
|
||||
@@ -0,0 +1,9 @@
|
||||
group_name: 'HRC',
|
||||
item: [
|
||||
{
|
||||
name: 'Рабочий стол',
|
||||
url: 'app.dashboard',
|
||||
icon: 'dashboard',
|
||||
order: 0
|
||||
}
|
||||
];
|
||||
@@ -1,3 +1,11 @@
|
||||
{
|
||||
code: 'app.dashboard',
|
||||
url: '/dashboard',
|
||||
templateUrl: '../views/dashboard/dashboard.html',
|
||||
data : { title: 'Рабочий стол' },
|
||||
controller: 'DashboardCtrl',
|
||||
resolve: ['scripts/controllers/dashboard.js', 'chart']
|
||||
},
|
||||
{
|
||||
code: 'app.v1.reimport',
|
||||
url: '/v1/reimport',
|
||||
|
||||
19
web/views/dashboard/add.html
Normal file
@@ -0,0 +1,19 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">Добавление виджета</h5>
|
||||
</div>
|
||||
<div class="modal-body text-center p-lg">
|
||||
<form role="form" class="ng-pristine ng-valid container">
|
||||
<select name="widget" id="add-widget-name" ng-model="add_widget_code" class="form-control input-c">
|
||||
<option ng-repeat="widget in all_widgets" value="{{ widget.code }}">{{ widget.name }}</option>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn dark-white p-x-md" data-dismiss="modal">Отмена</button>
|
||||
<button type="button" class="btn success p-x-md" ng-click="addWidget()">Добавить</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
615
web/views/dashboard/dashboard.html
Normal file
@@ -0,0 +1,615 @@
|
||||
<div id="container-floating">
|
||||
<div class="nd1 nds" data-toggle="tooltip" data-placement="left" title="Обновить" ng-click="update()" style="background-color: #d3a411"
|
||||
onmouseenter="$(this).tooltip('show')">
|
||||
<i class="material-icons"></i>
|
||||
</div>
|
||||
|
||||
<div id="floating-button" data-toggle="tooltip" data-placement="left" title="Действия" onmouseenter="$(this).tooltip('show')">
|
||||
<p class="plus">
|
||||
<i class="material-icons"></i>
|
||||
</p>
|
||||
<p class="edit">
|
||||
<i class="material-icons"></i>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="padding">
|
||||
<div class="margin">
|
||||
<h5 class="m-b-0 _300">{{update_time}}
|
||||
<i title="Данные о текущей смене скоро обновятся. Обновите страницу через несколько минут" class="fa fa-spinner fa-spin text-success" ng-if="need_update"></i>
|
||||
</h5>
|
||||
<small class="text-muted">Данные по филиалу
|
||||
<strong>{{globals.currentUser.organization.name}}</strong>
|
||||
</small>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-3">
|
||||
<div class="box" style="height: 198px;">
|
||||
<div class="box-header warn">
|
||||
<h3>Смена № {{shiftInfo.z_number}}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div ng-if="!shiftInfo.exists">Информация о смене будет доступна позже</div>
|
||||
<div ng-if="shiftInfo.exists">
|
||||
<span>Открыл: {{shiftInfo.open}} в {{shiftInfo.opened | date:'H:mm d.MM'}}</span>
|
||||
<div ng-if="shiftInfo.closed">
|
||||
<span>Закрыл: {{shiftInfo.close}} в {{shiftInfo.closed | date:'H:mm d.MM'}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-12 col-md-9">
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-md-4 one-height">
|
||||
<div class="box p-a">
|
||||
<div class="pull-left m-r">
|
||||
<span class="w-40 {{app.setting.theme.primary}} text-center rounded">
|
||||
<i class="material-icons"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="clear">
|
||||
<h4 class="m-a-0 text-md">
|
||||
<a>{{total | curr}}</a>
|
||||
</h4>
|
||||
<small class="text-muted">выручка</small>
|
||||
</div>
|
||||
|
||||
<div class="box-tool">
|
||||
<ul class="nav">
|
||||
<li class="nav-item">
|
||||
<a ng-click="getMore('total')">
|
||||
<i class="fa fa-eye"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 col-md-4 one-height">
|
||||
<div class="box-color p-a {{app.setting.theme.primary}}">
|
||||
<div class="pull-left m-r">
|
||||
<span class="w-40 dker text-center rounded">
|
||||
<i class="material-icons"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="clear">
|
||||
<h4 class="m-a-0 text-md">
|
||||
<a>{{profit | curr}}</a>
|
||||
</h4>
|
||||
<small class="text-muted">валовый доход</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 col-md-4 one-height">
|
||||
<div class="box-color p-a {{app.setting.theme.accent}}">
|
||||
<div class="pull-left m-r">
|
||||
<span class="w-40 dker text-center rounded">
|
||||
<i class="material-icons"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="clear">
|
||||
<h4 class="m-a-0 text-md">
|
||||
<a>{{middle | curr}}</a>
|
||||
</h4>
|
||||
<small class="text-muted">средний чек</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6 col-md-4 one-height">
|
||||
<div class="box">
|
||||
<div class="box-header danger">
|
||||
<h3>Удаления</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-tool box-tool-white">
|
||||
<ul class="nav">
|
||||
<li class="nav-item">
|
||||
<a ng-click="getMore('delete')">
|
||||
<i class="fa fa-eye"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="box-body b-t">
|
||||
<h4 class="m-a-0 text-md" ng-if="deleted > 0">
|
||||
<a>
|
||||
{{deleted}}
|
||||
<span class="text-sm">на сумму</span> {{deleted_sum | curr}}
|
||||
</a>
|
||||
</h4>
|
||||
<span class="text-muted" ng-if="deleted == 0">Удаленных позиций нет</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 col-md-4 one-height">
|
||||
<div class="box">
|
||||
<div class="box-header primary">
|
||||
<h3>
|
||||
Заказы со скидками
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-tool box-tool-white">
|
||||
<ul class="nav">
|
||||
<li class="nav-item">
|
||||
<a ng-click="getMore('discount')">
|
||||
<i class="fa fa-eye"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="box-body b-t">
|
||||
<h4 class="m-a-0 text-md" ng-if="discounts > 0">
|
||||
<a>
|
||||
{{discounts}}
|
||||
<span class="text-sm">на сумму </span> {{tot_disc_sum | curr}}
|
||||
</a>
|
||||
</h4>
|
||||
<span class="text-muted" ng-if="discounts == 0">Заказов со скидками нет</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6 col-md-4 one-height">
|
||||
<div class="box">
|
||||
<div class="box-header blue">
|
||||
<h3>
|
||||
Гостей: {{guests}}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-tool box-tool-white">
|
||||
<ul class="nav">
|
||||
<li class="nav-item">
|
||||
<a ng-click="getMore('guests')">
|
||||
<i class="fa fa-eye"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="box-body b-t">
|
||||
<h4 class="m-a-0 text-md" ng-if="namedGuests > 0">
|
||||
<a>
|
||||
{{namedGuests}}
|
||||
<span class="text-sm">{{ GetCountNamedGuests(namedGuests) }}. Сумма заказов: </span>
|
||||
{{sumNamedGuests | curr}}
|
||||
</a>
|
||||
</h4>
|
||||
<span class="text-muted" ng-if="namedGuests == 0">Именованных гостей нет</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-xl-4">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3>Текущие заказы</h3>
|
||||
</div>
|
||||
|
||||
<div class="text-center b-t" style="height: 230px">
|
||||
<div class="row-col">
|
||||
<div class="row-cell p-a">
|
||||
<div class="inline m-b">
|
||||
<div ui-jp="easyPieChart" class="easyPieChart" ui-refresh="app.setting.color" data-redraw='true' data-percent="{{ orders_closed.percent }}"
|
||||
ui-options="{
|
||||
lineWidth: 8,
|
||||
trackColor: 'rgba(0,0,0,0.05)',
|
||||
barColor: '{{ app.setting.color.primary }}',
|
||||
scaleColor: 'transparent',
|
||||
size: 100,
|
||||
scaleLength: 0,
|
||||
animate:{
|
||||
duration: 1500,
|
||||
enabled:true
|
||||
}
|
||||
}">
|
||||
<div>
|
||||
<h5>{{ orders_closed.percent }}%</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
Закрытые
|
||||
<small class="block m-b">
|
||||
<strong>{{ orders_closed.total }}</strong> на сумму
|
||||
<strong>{{ orders_closed.sum | curr}}</strong>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-cell p-a dker" style="height: 230px">
|
||||
<div class="inline m-b">
|
||||
<div ui-jp="easyPieChart" class="easyPieChart" ui-refresh="app.setting.color" data-redraw='true' data-percent="{{ orders_waited.percent }}"
|
||||
ui-options="{
|
||||
lineWidth: 8,
|
||||
trackColor: 'rgba(0,0,0,0.05)',
|
||||
barColor: '{{ app.setting.color.warn }}',
|
||||
scaleColor: 'transparent',
|
||||
size: 100,
|
||||
scaleLength: 0,
|
||||
animate:{
|
||||
duration: 1500,
|
||||
enabled:true
|
||||
}
|
||||
}">
|
||||
<div>
|
||||
<h5>{{ orders_waited.percent }}%</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
Отложенные
|
||||
<small class="block m-b">
|
||||
<strong>{{ orders_waited.total }}</strong> на сумму
|
||||
<strong>{{ orders_waited.sum | curr}}</strong>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-xl-4">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3>Текущие заказы</h3>
|
||||
</div>
|
||||
|
||||
<div class="text-center b-t" style="height: 230px">
|
||||
<div class="row-col">
|
||||
<div class="row-cell p-a">
|
||||
<div class="inline m-b">
|
||||
<div ui-jp="easyPieChart" class="easyPieChart" ui-refresh="app.setting.color" data-redraw='true' data-percent="{{ orders_deleted.percent }}"
|
||||
ui-options="{
|
||||
lineWidth: 8,
|
||||
trackColor: 'rgba(0,0,0,0.05)',
|
||||
barColor: '#f44455',
|
||||
scaleColor: 'transparent',
|
||||
size: 100,
|
||||
scaleLength: 0,
|
||||
animate:{
|
||||
duration: 1500,
|
||||
enabled:true
|
||||
}
|
||||
}">
|
||||
<div>
|
||||
<h5>{{ orders_deleted.percent }}%</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
Удаленные
|
||||
<small class="block m-b">
|
||||
<strong>{{ orders_deleted.total }}</strong> на сумму
|
||||
<strong>{{ orders_deleted.sum | curr}}</strong>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-cell p-a dker" style="height: 230px">
|
||||
<div class="inline m-b">
|
||||
<div ui-jp="easyPieChart" class="easyPieChart" ui-refresh="app.setting.color" data-redraw='true' data-percent="{{ orders_returned.percent }}"
|
||||
ui-options="{
|
||||
lineWidth: 8,
|
||||
trackColor: 'rgba(0,0,0,0.05)',
|
||||
barColor: '{{ app.setting.color.accent }}',
|
||||
scaleColor: 'transparent',
|
||||
size: 100,
|
||||
scaleLength: 0,
|
||||
animate:{
|
||||
duration: 1500,
|
||||
enabled:true
|
||||
}
|
||||
}">
|
||||
<div>
|
||||
<h5>{{ orders_returned.percent }}%</h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
Возвраты
|
||||
<small class="block m-b">
|
||||
<strong>{{ orders_returned.total }}</strong> на сумму
|
||||
<strong>{{ orders_returned.sum | curr}}</strong>
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-xl-4">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3>Персонал</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-tool">
|
||||
<ul class="nav">
|
||||
<li class="nav-item">
|
||||
<span bs-tooltip="" title="Кликните по персоналу для просмотра подробной информации" class="text-muted inline p-a-xs m-r-sm">
|
||||
<i class="fa fa-question"></i>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="scrollable" style="height: 230px">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>ФИО</td>
|
||||
<td class="text-right">Количество заказов</td>
|
||||
<td class="text-right">Сумма, BYN</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="personal in personals" ng-click="getStaffMore(personal)">
|
||||
<td class="text-left">
|
||||
<strong>{{ personal.name }}</strong>
|
||||
</td>
|
||||
<td class="text-right">{{ personal.orders_count }}</td>
|
||||
<td class="text-right">{{ personal.orders_sum | curr}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-xl-6">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3>Гости</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<canvas class="chart chart-bar" chart-data="medianGuests.data" chart-series="medianGuests.series" chart-labels="medianGuests.labels"
|
||||
chart-options="medianGuests.options" chart-colors="colors"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-xl-6">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3>Финансы</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<canvas class="chart chart-bar" chart-data="medianFinance.data" chart-labels="medianFinance.labels" chart-series="medianFinance.series"
|
||||
chart-options="medianFinance.options" chart-colors="colors"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-xl-8">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3>Топ продаваемых товаров</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-tool">
|
||||
<ul class="nav">
|
||||
<li class="nav-item">
|
||||
<span bs-tooltip="" title="< 25%-сверхприбыль 25-35%-прибыль 35-50%-самоокупаемость > 50%-убыток" class="text-muted inline p-a-xs m-r-sm">
|
||||
<i class="fa fa-question"></i>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th class="text-center">Кол-во</th>
|
||||
<th class="text-center">Сумма,
|
||||
<br> BYN</th>
|
||||
<th class="text-center">Total cost,
|
||||
<br> BYN</th>
|
||||
<th class="text-center">Total cost /
|
||||
<br>Сумма</th>
|
||||
<th class="text-center">Прибыль,
|
||||
<br> BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="text-right" ng-repeat="dish in dishes">
|
||||
<td>
|
||||
<strong>{{ dish.name }}</strong>
|
||||
</td>
|
||||
<td>{{ dish.count }}</td>
|
||||
<td>{{ dish.sum | curr}}</td>
|
||||
<td>{{ dish.totalCost | curr}}</td>
|
||||
<td ng-class="getBackClass(dish.percentProffit)">{{ dish.percentProffit }} %</td>
|
||||
<td>{{ dish.proffit | curr}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 col-xl-4">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3>Список занятых столов</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-tool">
|
||||
<ul class="nav">
|
||||
<li class="nav-item">
|
||||
<span bs-tooltip="" title="Кликните по столу для просмотра подробной информации" class="text-muted inline p-a-xs m-r-sm">
|
||||
<i class="fa fa-question"></i>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<p class="text-muted text-center" ng-if="tables.length == 0">Занятых столов нет</p>
|
||||
|
||||
<div class="table-responsive" ng-if="tables.length > 0">
|
||||
<table class="table table-striped table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Зал</th>
|
||||
<th>Номер стола</th>
|
||||
<th>Количество заказов</th>
|
||||
<th>Сумма, BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="table in tables" ng-click="getTableMore(table)">
|
||||
<td>
|
||||
<strong>{{ table.place_name }}</strong>
|
||||
</td>
|
||||
<td>
|
||||
<strong>{{ table.table_name }}</strong>
|
||||
</td>
|
||||
<td>{{ table.guests_count }}</td>
|
||||
<td class="text-right">{{ table.sum | curr}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<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="folders.data" chart-labels="folders.labels" chart-options="folders.options"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</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="printers.data" chart-labels="printers.labels" chart-options="printers.options"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</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">
|
||||
<h3>Типы оплат</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<div class="box-body">
|
||||
<canvas class="chart chart-pie" chart-data="payments.data" chart-labels="payments.labels" chart-options="payments.options"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="add-widget">
|
||||
<div ui-include="'../views/dashboard/add.html'"></div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="get-more-delete">
|
||||
<div ui-include="'../views/dashboard/items/more-delete.html'"></div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="get-more-newyear">
|
||||
<div ui-include="'../views/dashboard/items/more-newyear.html'"></div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="get-more-guests">
|
||||
<div ui-include="'../views/dashboard/items/more-guests.html'"></div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="get-more-discount">
|
||||
<div ui-include="'../views/dashboard/items/more-discount.html'"></div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="get-more-total">
|
||||
<div ui-include="'../views/dashboard/items/more-total.html'"></div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="get-more-staff">
|
||||
<div ui-include="'../views/dashboard/items/more-staff.html'"></div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="get-more-table">
|
||||
<div ui-include="'../views/dashboard/items/more-table.html'"></div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="items-guests">
|
||||
<div ui-include="'../views/dashboard/items/items-guests.html'"></div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="items-discount">
|
||||
<div ui-include="'../views/dashboard/items/items-discount.html'"></div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="items-total">
|
||||
<div ui-include="'../views/dashboard/items/items-total.html'"></div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="items-staff">
|
||||
<div ui-include="'../views/dashboard/items/items-staff.html'"></div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="items-delete">
|
||||
<div ui-include="'../views/dashboard/items/items-delete.html'"></div>
|
||||
</div>
|
||||
BIN
web/views/dashboard/images/2.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
web/views/dashboard/images/4.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
web/views/dashboard/images/6.png
Normal file
|
After Width: | Height: | Size: 628 KiB |
BIN
web/views/dashboard/images/7.png
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
web/views/dashboard/images/8.png
Normal file
|
After Width: | Height: | Size: 838 KiB |
BIN
web/views/dashboard/images/9.png
Normal file
|
After Width: | Height: | Size: 1.7 MiB |
BIN
web/views/dashboard/images/new-year-1.jpg
Normal file
|
After Width: | Height: | Size: 200 KiB |
41
web/views/dashboard/items/items-delete.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-toggle="modal" data-target="#items-delete" ng-click="returnModal('delete')">
|
||||
<i class="material-icons md-24">arrow_back</i>
|
||||
</button>
|
||||
<h5 class="modal-title">Подробнее об удалениях в заказе № {{ order.code }}</h5>
|
||||
</div>
|
||||
<div class="modal-body p-lg">
|
||||
<div class="table-responsive">
|
||||
<table class="table m-a-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Удаленное блюдо</th>
|
||||
<th>Количество удалений</th>
|
||||
<th>Сумма удалений, BYN</th>
|
||||
<th>Удалил</th>
|
||||
<th>Причина удаления</th>
|
||||
<th>Время удаления</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="item in order.items">
|
||||
<td>{{ item.dish }}</td>
|
||||
<td>{{ item.count }}</td>
|
||||
<td class="text-right">{{ item.sale_price | curr }}</td>
|
||||
<td>{{ item.who_deleted }}</td>
|
||||
<td>{{ item.reason }}</td>
|
||||
<td>{{ item.time }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="6" class="text-right">Всего {{ order.all_count }} удалений на сумму {{ order.all_sum | curr }} BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
38
web/views/dashboard/items/items-discount.html
Normal file
@@ -0,0 +1,38 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-toggle="modal" data-target="#items-discount" ng-click="returnModal('discount')">
|
||||
<i class="material-icons md-24">arrow_back</i>
|
||||
</button>
|
||||
<h5 class="modal-title">Подробнее о заказе № {{ order.title }}</h5>
|
||||
</div>
|
||||
<div class="modal-body p-lg">
|
||||
<div class="table-responsive">
|
||||
<table class="table m-a-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Блюдо (со скидкой)</th>
|
||||
<th>Количество</th>
|
||||
<th class="text-right">Цена, BYN</th>
|
||||
<th class="text-right">Сумма, BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<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>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3"></th>
|
||||
<th class="text-right">Итого: {{ order.total | curr }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
37
web/views/dashboard/items/items-guests.html
Normal file
@@ -0,0 +1,37 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-toggle="modal" data-target="#items-guests" ng-click="returnModal('guests')">
|
||||
<i class="material-icons md-24">arrow_back</i>
|
||||
</button>
|
||||
<h5 class="modal-title">{{ order.title }}</h5>
|
||||
</div>
|
||||
<div class="modal-body p-lg">
|
||||
<div class="table-responsive">
|
||||
<table class="table m-a-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Блюдо</th>
|
||||
<th>Количество</th>
|
||||
<th class="text-right">Сумма, BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr ng-repeat="item in order.items">
|
||||
<td>{{ item.name }}</td>
|
||||
<td>{{ item.count }}</td>
|
||||
<td class="text-right">{{ item.sale_price | curr }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2"></th>
|
||||
<th class="text-right">Итого: {{ order.total | curr }} BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
41
web/views/dashboard/items/items-staff.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-toggle="modal" data-target="#items-staff" ng-click="returnModal('staff')">
|
||||
<i class="material-icons md-24">arrow_back</i>
|
||||
</button>
|
||||
<h5 class="modal-title">{{ order.title }}</h5>
|
||||
<p class="text-muted m-b-0">Открыл: {{ order.who_open }}</p>
|
||||
<p class="text-muted m-b-0" ng-if="!order.hasOwnProperty('who_close')">{{NOT_CLOSED}}</p>
|
||||
<p class="text-muted m-b-0" ng-if="order.hasOwnProperty('who_close')">Закрыл: {{ order.who_close }}</p>
|
||||
</div>
|
||||
<div class="modal-body p-lg">
|
||||
<div class="table-responsive">
|
||||
<table class="table m-a-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Блюдо</th>
|
||||
<th>Количество</th>
|
||||
<th class="text-right">Сумма, BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr ng-repeat="item in order.items">
|
||||
<td>{{ item.name }}</td>
|
||||
<td>{{ item.count }}</td>
|
||||
<td class="text-right">{{ item.sale_price | curr }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2"></th>
|
||||
<th class="text-right">Итого: {{ order.total | curr }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
55
web/views/dashboard/items/items-total.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-toggle="modal" data-target="#items-total" ng-click="returnModal('total')">
|
||||
<i class="material-icons md-24">arrow_back</i>
|
||||
</button>
|
||||
<h5 class="modal-title" style="padding-bottom: 12px;">Подробнее о заказе № {{ order.title }}</h5>
|
||||
<div class="row">
|
||||
<div class="col-xs-6 col-md-3">
|
||||
<p class="text-muted m-b-0">Открыт</p>
|
||||
<p class="m-b-0">{{ order.who_open }}</p>
|
||||
<p class="m-b-0">{{ order.opened }}</p>
|
||||
</div>
|
||||
<div class="col-xs-6 col-md-3">
|
||||
<div ng-if="getClosedDate(order.closed) == NOT_CLOSED">
|
||||
<p class="text-muted m-b-0">{{NOT_CLOSED}}</p>
|
||||
</div>
|
||||
<div ng-if="getClosedDate(order.closed) != NOT_CLOSED">
|
||||
<p class="text-muted m-b-0">Закрыт</p>
|
||||
<p class="m-b-0">{{ order.who_close }}</p>
|
||||
<p class="m-b-0">{{ order.closed }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body p-lg">
|
||||
<div class="table-responsive">
|
||||
<table class="table m-a-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Блюдо</th>
|
||||
<th>Количество</th>
|
||||
<th class="text-right">Сумма, BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr ng-repeat="item in order.items">
|
||||
<td>{{ item.name }}</td>
|
||||
<td>{{ item.count }}</td>
|
||||
<td class="text-right">{{ item.sale_price | curr }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2"></th>
|
||||
<th class="text-right">Итого: {{ order.total | curr }} BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
39
web/views/dashboard/items/more-delete.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h5 class="modal-title">{{ moreData.title }}</h5>
|
||||
</div>
|
||||
<div class="modal-body p-lg">
|
||||
<div class="table-responsive" ng-if="moreData.deleted_orders.length > 0">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-right">Заказ №</th>
|
||||
<th class="text-right">Открыт</th>
|
||||
<th class="text-right">Закрыт</th>
|
||||
<th class="text-right">Сумма удалений, BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr ng-repeat="deleted_order in moreData.deleted_orders" ng-click="getItems('delete', deleted_order)">
|
||||
<td class="text-right">{{ deleted_order.number }}</td>
|
||||
<td class="text-right">{{ deleted_order.opened }}</td>
|
||||
<td class="text-right">{{ getClosedDate(deleted_order.closed) }}</td>
|
||||
<td class="text-right">{{ deleted_order.deleted_sum | curr}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4" class="text-right">Удаление {{ moreData.total_count }} {{ GetCountDeletedPositions(more.total_count) }} на сумму {{ moreData.total_sum | curr }} BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div ng-if="moreData.deleted_orders.length == 0">
|
||||
<div class="text-muted">Удаленных позиций нет</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
43
web/views/dashboard/items/more-discount.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h5 class="modal-title">{{ moreData.title }}</h5>
|
||||
</div>
|
||||
<div class="modal-body p-lg">
|
||||
<div class="table-responsive" ng-if="moreData.orders.length > 0">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Заказ №</th>
|
||||
<th class="text-right">Без скидки, BYN</th>
|
||||
<th class="text-right">Скидка, BYN</th>
|
||||
<th class="text-right">Итого, BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr ng-repeat="order in moreData.orders" ng-click="getItems('discount', order)">
|
||||
<td>{{ order.number }}</td>
|
||||
<td class="text-right">{{ order.full_sum | curr }}</td>
|
||||
<td class="text-right">{{ order.sale_sum | curr }}</td>
|
||||
<td class="text-right">{{ order.order_sum | curr }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Всего: {{ discounts }} {{ GetCountTotalOrders(discounts) }}</th>
|
||||
<th class="text-right">на сумму {{ moreData.amount | curr }}</th>
|
||||
<th class="text-right">со скидой в: {{discounts_sum | curr }}</th>
|
||||
<th class="text-right">Итого: {{ moreData.total_sum | curr }} BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div ng-if="moreData.orders.length == 0">
|
||||
<div class="text-muted">Заказов со скидками нет</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
34
web/views/dashboard/items/more-guests.html
Normal file
@@ -0,0 +1,34 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h5 class="modal-title">{{ moreData.title }}</h5>
|
||||
</div>
|
||||
<div class="modal-body p-lg">
|
||||
<div class="table-responsive" ng-if="moreData.clients.length > 0">
|
||||
<div ng-repeat="client in moreData.clients">
|
||||
|
||||
<table class="table m-a-0 table-hover">
|
||||
<thead class="thead-inverses">
|
||||
<tr>
|
||||
<th class="text-right" style="text-align: left; width: 20%;" colspan="4">{{ client.name }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr ng-click="getItems('guests', client)">
|
||||
<td class="text-right" style="width: 20%;">Заказ № {{ client.number }}</td>
|
||||
<td class="text-right" style="width: 30%;">Открыт {{ client.opened }}</td>
|
||||
<td class="text-right" style="width: 30%;">{{ client.closed }}</td>
|
||||
<td class="text-right" style="width: 20%;">{{ client.sum | curr }} BYN</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-if="moreData.clients.length == 0">
|
||||
<div class="text-muted">Заказов от именованных гостей нет</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
75
web/views/dashboard/items/more-newyear.html
Normal file
@@ -0,0 +1,75 @@
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content" style="background-image: url('../views/dashboard/images/new-year-1.jpg');">
|
||||
<div class="modal-body" style="background-image: url('../views/dashboard/images/new-year-1.jpg');">
|
||||
<button type="button" class="close text-white" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
|
||||
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
|
||||
<ol class="carousel-indicators">
|
||||
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
|
||||
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
|
||||
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
|
||||
<li data-target="#carouselExampleIndicators" data-slide-to="3"></li>
|
||||
<li data-target="#carouselExampleIndicators" data-slide-to="4"></li>
|
||||
</ol>
|
||||
<div class="carousel-inner">
|
||||
<div class="carousel-item active">
|
||||
<img sglclick="nextImage()" ng-swipe-left="nextImage()" ng-swipe-right="previousImage()" class="d-block w-100 myCarousel img-responsive" src="../views/dashboard/images/new-year-1.jpg" alt="">
|
||||
<div class="carousel-caption d-none d-md-block" style="text-align: left; right: 2em; left: 2em;">
|
||||
<h4><i>С наступающим Новым годом и Рождеством!</i></h5>
|
||||
<p><h6>Мы подготовили для Вас кое-что интересное!</h6></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img sglclick="nextImage()" ng-swipe-left="nextImage()" ng-swipe-right="previousImage()" class="d-block w-100 myCarousel img-responsive" id="myCarousel" src="../views/dashboard/images/2.png" alt="">
|
||||
<div class="carousel-caption d-none d-md-block" style="text-align: left; right: 2em; left: 2em;">
|
||||
<h4><i> · {{year_count}} · </i></h5>
|
||||
<p><h6>Столько товаров вы продали за 2021 год!</h6></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img sglclick="nextImage()" ng-swipe-left="nextImage()" ng-swipe-right="previousImage()" class="d-block w-100 myCarousel img-responsive" id="myCarousel" src="../views/dashboard/images/6.png" alt="">
|
||||
<div class="carousel-caption d-none d-md-block" style="text-align: left; right: 2em; left: 2em;">
|
||||
<h4><i>Топ товаров проданных за 2021 год:</i></h5>
|
||||
<h6 ng-repeat="top_dish in top_dishes" class="text-left">
|
||||
<p> · {{ top_dish.name }} · {{ top_dish.count }} шт. на сумму {{ top_dish.sum | curr}} BYN </p>
|
||||
</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img sglclick="nextImage()" ng-swipe-left="nextImage()" ng-swipe-right="previousImage()" class="d-block w-100 myCarousel img-responsive" id="myCarousel" src="../views/dashboard/images/4.png" alt="">
|
||||
<div class="carousel-caption d-none d-md-block" style="text-align: left; right: 2em; left: 2em;">
|
||||
<h4><i>Наибольшее количество заказов:</i></h5>
|
||||
<h6 ng-repeat="top_shift in top_shifts" class="text-left">
|
||||
<p> {{ top_shift.date }}г. закрыто {{ top_shift.count }} заказов</p>
|
||||
<p> На общую сумму {{ top_shift.sum | curr}} BYN </p>
|
||||
</h6>
|
||||
</div>
|
||||
</div>
|
||||
<div class="carousel-item">
|
||||
<img sglclick="nextImage()" ng-swipe-left="nextImage()" ng-swipe-right="previousImage()" class="d-block w-100 myCarousel img-responsive" id="myCarousel" src="../views/dashboard/images/7.png" alt="">
|
||||
<div class="carousel-caption d-none d-md-block" style="text-align: left; right: 2em; left: 2em;">
|
||||
<h5><i>
|
||||
<p>Дорогие коллеги, поздравляем вас с Новым годом и желаем вам в новом году еще больше успехов, побед и достижений!</p>
|
||||
<p>Пускай ваши мечты сбудутся, а каждый день дарит приятные сюрпризы и отличное настроение!<p>
|
||||
<p>Желаем, чтобы все, что вы делаете, приносило удовольствие и радость!</p>
|
||||
</i>
|
||||
</h5>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
|
||||
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Previous</span>
|
||||
</a>
|
||||
<a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
|
||||
<span class="carousel-control-next-icon" aria-hidden="true"></span>
|
||||
<span class="sr-only">Next</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
42
web/views/dashboard/items/more-staff.html
Normal file
@@ -0,0 +1,42 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h5 class="modal-title">{{ staff.title }}</h5>
|
||||
</div>
|
||||
<div class="modal-body p-lg">
|
||||
<div class="table-responsive">
|
||||
<table class="table m-a-0 table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Заказ №</th>
|
||||
<th>Открыт</th>
|
||||
<th>Закрыт</th>
|
||||
<th>Зал</th>
|
||||
<th>Стол</th>
|
||||
<th class="text-right">Итого, BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr ng-repeat="order in staff.orders" ng-click="getItems('staff', order)">
|
||||
<td>{{order.number}}</td>
|
||||
<td>{{order.opened}}</td>
|
||||
<td>{{ getClosedDate(order.closed) }}</td>
|
||||
<td>{{order.place}}</td>
|
||||
<td>{{order.table}}</td>
|
||||
<td class="text-right">{{order.sum | curr}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left" colspan="4">Всего: {{staff.count}} {{ GetCountTotalOrders(staff.count) }}</th>
|
||||
<th class="text-right" colspan="2">Итого: {{staff.total|curr}} BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
47
web/views/dashboard/items/more-table.html
Normal file
@@ -0,0 +1,47 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h5 class="modal-title">{{ table_ord.title }}</h5>
|
||||
</div>
|
||||
<div class="modal-body p-lg">
|
||||
<div class="table-responsive" ng-repeat="order in table_ord.orders">
|
||||
<h5>Заказ № {{ order.number }}</h5>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 35%">Блюдо</th>
|
||||
<th style="width: 25%">Количество</th>
|
||||
<th class="text-right" style="width: 40%">Сумма, BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr ng-repeat="item in order.items">
|
||||
<td>{{ item.name }}</td>
|
||||
<td>{{ item.count }}</td>
|
||||
<td class="text-right">{{ item.sale_price | curr }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" class="text-right">Итого: {{ order.total | curr }} BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="2"></th>
|
||||
<th class="text-right">Общий итог: {{ table_ord.total | curr }} BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
40
web/views/dashboard/items/more-total.html
Normal file
@@ -0,0 +1,40 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<h5 class="modal-title">{{ moreData.title }}</h5>
|
||||
</div>
|
||||
<div class="modal-body p-lg">
|
||||
<div class="table-responsive" ng-if="moreData.orders.length > 0">
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Заказ №</th>
|
||||
<th>Открыт</th>
|
||||
<th>Закрыт</th>
|
||||
<th class="text-right">Итого, BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr ng-repeat="order in moreData.orders" ng-click="getItems('total', order)">
|
||||
<td>{{ order.number }}</td>
|
||||
<td>{{ order.opened }}</td>
|
||||
<td>{{ getClosedDate(order.closed) }}</td>
|
||||
<td class="text-right">{{ order.sum | curr }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="text-left" colspan="3">Всего: {{ moreData.count }} {{ GetCountTotalOrders(moreData.count) }}</th>
|
||||
<th class="text-right">Итого: {{ moreData.sum | curr }} BYN</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div ng-if="moreData.orders.length == 0">
|
||||
<div class="text-muted">Закрытых заказов нет</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||