v.2.15
Добавлен журнал заказов Добавлены отчеты: по переносам, по объединениям, по разбиениям
This commit is contained in:
218
commands/GETDataReport.php
Normal file
218
commands/GETDataReport.php
Normal file
@@ -0,0 +1,218 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Commands;
|
||||||
|
|
||||||
|
use App\Component\Models\ExchangeActions;
|
||||||
|
use App\Component\Models\Staff;
|
||||||
|
use App\Console\Commands\HRCCommand;
|
||||||
|
use App\Console\Commands\HRCCommandInterface;
|
||||||
|
|
||||||
|
class GETDataReport extends HRCCommand implements HRCCommandInterface {
|
||||||
|
protected $signature = 'getdatareport';
|
||||||
|
|
||||||
|
public function command($input, $output = null) {
|
||||||
|
function data_decode($data) {
|
||||||
|
$alph = [
|
||||||
|
"А", "Б", "В", "Г", "Д",
|
||||||
|
"Е", "Ё", "Ж", "З", "И",
|
||||||
|
"Й", "К", "Л", "М", "Н",
|
||||||
|
"О", "П", "Р", "С", "Т",
|
||||||
|
"У", "Ф", "Х", "Ц", "Ч",
|
||||||
|
"Ш", "Щ", "Ъ", "Ы", "Ь",
|
||||||
|
"Э", "Ю", "Я",
|
||||||
|
"а", "б", "в", "г", "д",
|
||||||
|
"е", "ё", "ж", "з", "и",
|
||||||
|
"й", "к", "л", "м", "н",
|
||||||
|
"о", "п", "р", "с", "т",
|
||||||
|
"у", "ф", "х", "ц", "ч",
|
||||||
|
"ш", "щ", "ъ", "ы", "ь",
|
||||||
|
"э", "ю", "я",
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($alph as $key => $letter) {
|
||||||
|
$haystack = mb_convert_encoding($data, "CP1251", "UTF-8");
|
||||||
|
$needle = $letter;
|
||||||
|
$pos = strripos($haystack, $needle);
|
||||||
|
if ($pos === false) {
|
||||||
|
$after_conv = false;
|
||||||
|
} else {
|
||||||
|
$after_conv = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$after_conv) {
|
||||||
|
foreach ($alph as $key => $letter) {
|
||||||
|
$haystack = $data;
|
||||||
|
$needle = $letter;
|
||||||
|
$pos = strripos($haystack, $needle);
|
||||||
|
if ($pos === false) {
|
||||||
|
$before_conv = false;
|
||||||
|
} else {
|
||||||
|
$before_conv = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($after_conv) {
|
||||||
|
$retval = mb_convert_encoding($data, "CP1251", "UTF-8");
|
||||||
|
} elseif ($before_conv) {
|
||||||
|
$retval = $data;
|
||||||
|
} else {
|
||||||
|
$retval = $data;
|
||||||
|
}
|
||||||
|
return $retval;
|
||||||
|
}
|
||||||
|
|
||||||
|
function staffName($data) {
|
||||||
|
$staff_name = Staff::where('code', $data)->where('is_history', 0)->first();
|
||||||
|
if ($staff_name) {
|
||||||
|
$staff_name = $staff_name['name'];
|
||||||
|
} else {
|
||||||
|
$staff_name = Staff::where('code', $data)->where('is_history', 1)->first();
|
||||||
|
if ($staff_name) {
|
||||||
|
$staff_name = $staff_name['name'];
|
||||||
|
} else {
|
||||||
|
$staff_name = 'Связанный персонал не найден';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $staff_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
$reportType = $input['type'];
|
||||||
|
$shiftNumber = $input['shift_id'];
|
||||||
|
//merge, slice, move
|
||||||
|
if (isset($reportType) && isset($shiftNumber)) {
|
||||||
|
//merge
|
||||||
|
if ($reportType == 'merge') {
|
||||||
|
$merged_order_items = [];
|
||||||
|
$orders = ExchangeActions::select('order_code')->where('shift_id', $input['shift_id'])->groupBy('order_code')->get();
|
||||||
|
foreach ($orders as $key => $order) {
|
||||||
|
$actions = ExchangeActions::where('order_code', $order['order_code'])->where('shift_id', $input['shift_id'])->orderBy('time', 'asc')->get();
|
||||||
|
foreach ($actions as $key => $item) {
|
||||||
|
if ($item['action_type'] == 31) {
|
||||||
|
$merge_order = $item['value'];
|
||||||
|
$item_actions = ExchangeActions::where('order_code', $item['value'] + 0)
|
||||||
|
->where('shift_id', $input['shift_id'])
|
||||||
|
->where('action_type', 32)
|
||||||
|
->get();
|
||||||
|
foreach ($item_actions as $key => $item_action) {
|
||||||
|
if ($item_action['more']) {
|
||||||
|
$merge_trigger = 1;
|
||||||
|
$merge_items_before = $merge_items_after = $merge_items = $merge_order_item_before = $merge_order_item_after = $merged_items = [];
|
||||||
|
$merge_order_items = json_decode(utf8_encode($item_action['more']), true, JSON_INVALID_UTF8_SUBSTITUTE);
|
||||||
|
$merge_order_items_before = $merge_order_items['before']['items'];
|
||||||
|
$merge_order_items_after = $merge_order_items['after']['items'];
|
||||||
|
foreach ($merge_order_items_before as $key => $merge_order_item_before) {
|
||||||
|
$merge_items_before[] = array('id' => $key + 1,
|
||||||
|
'code' => $merge_order_item_before['id'],
|
||||||
|
'name' => $merge_order_item_before['name'],
|
||||||
|
'count' => $merge_order_item_before['count'],
|
||||||
|
'sale_price' => $merge_order_item_before['sale_price']);
|
||||||
|
}
|
||||||
|
foreach ($merge_order_items_after as $key => $merge_order_item_after) {
|
||||||
|
$merge_items_after[] = array('id' => $key + 1,
|
||||||
|
'code' => $merge_order_item_after['id'],
|
||||||
|
'name' => $merge_order_item_after['name'],
|
||||||
|
'count' => $merge_order_item_after['count'],
|
||||||
|
'sale_price' => $merge_order_item_after['sale_price']);
|
||||||
|
}
|
||||||
|
foreach ($merge_order_items_after as $key => $merge_order_item_after) {
|
||||||
|
if (!in_array(array('id' => $key + 1,
|
||||||
|
'code' => $merge_order_item_after['id'],
|
||||||
|
'name' => $merge_order_item_after['name'],
|
||||||
|
'count' => $merge_order_item_after['count'],
|
||||||
|
'sale_price' => $merge_order_item_after['sale_price']), $merge_items_before, true)) {
|
||||||
|
$merged_items[] = array('code' => $merge_order_item_after['id'],
|
||||||
|
'name' => $merge_order_item_after['name'],
|
||||||
|
'count' => $merge_order_item_after['count'],
|
||||||
|
'sale_price' => $merge_order_item_after['sale_price']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach ($merged_items as $key => $merged_item) {
|
||||||
|
$merge_items[] = array('id' => $key + 1,
|
||||||
|
'code' => $merged_item['code'],
|
||||||
|
'name' => $merged_item['name'],
|
||||||
|
'count' => $merged_item['count'],
|
||||||
|
'sale_price' => $merged_item['sale_price']);
|
||||||
|
}
|
||||||
|
$staff_name = staffName($item['who']);
|
||||||
|
$start_order_place = ExchangeActions::where('order_code', $item['order_code'])->where('action_type', 45)->where('shift_id', $input['shift_id'])->first();
|
||||||
|
$start_order_place = data_decode($start_order_place['value']);
|
||||||
|
$end_order_place = ExchangeActions::where('order_code', $merge_order + 0)->where('action_type', 45)->where('shift_id', $input['shift_id'])->first();
|
||||||
|
$end_order_place = data_decode($end_order_place['value']);
|
||||||
|
$merged_order_items[] = array('start_order' => $item['order_code'], 'end_order' => $merge_order + 0, 'time' => date('d.m.Y H:i:s', strtotime($item['time'])), 'staff' => $staff_name, 'start_order_place' => $start_order_place, 'end_order_place' => $end_order_place, 'merge_order_items' => $merge_order_items, 'items' => $merge_items);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'shift_id' => $input['shift_id'],
|
||||||
|
'count' => count($merged_order_items),
|
||||||
|
'data' => $merged_order_items,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
//slice
|
||||||
|
if ($reportType == 'slice') {
|
||||||
|
$sliced_order_data = [];
|
||||||
|
$orders = ExchangeActions::select('order_code')->where('shift_id', $input['shift_id'])->groupBy('order_code')->get();
|
||||||
|
$action_count = ExchangeActions::where('shift_id', $input['shift_id'])->where('action_type', 35)->count();
|
||||||
|
if ($action_count > 0) {
|
||||||
|
foreach ($orders as $key => $order) {
|
||||||
|
$actions = ExchangeActions::where('order_code', $order['order_code'])->where('shift_id', $input['shift_id'])->where('action_type', 35)->orderBy('time', 'asc')->get();
|
||||||
|
foreach ($actions as $key => $action) {
|
||||||
|
$value = $action['value'];
|
||||||
|
$codeOrder = $action['order_code'];
|
||||||
|
$moved_items = json_decode(utf8_encode($action['more']), true, JSON_INVALID_UTF8_SUBSTITUTE);
|
||||||
|
$from_place = ExchangeActions::where('order_code', $codeOrder)->where('action_type', 45)->where('shift_id', $input['shift_id'])->first();
|
||||||
|
$from_place = data_decode($from_place['value']);
|
||||||
|
$to_place = ExchangeActions::where('order_code', $value)->where('action_type', 45)->where('shift_id', $input['shift_id'])->first();
|
||||||
|
$to_place = data_decode($to_place['value']);
|
||||||
|
$to_action = ExchangeActions::where('value', $codeOrder)->where('order_code', $value)->where('action_type', 34)->where('shift_id', $input['shift_id'])->first();
|
||||||
|
$start_data = json_decode(utf8_encode($to_action['more']), true, JSON_INVALID_UTF8_SUBSTITUTE);
|
||||||
|
$staff_name = staffName($action['who']);
|
||||||
|
$time = date('d.m.Y H:i:s', strtotime($action['time']));
|
||||||
|
$sliced_order_data[] = array('from_order' => $codeOrder, 'from_place' => $from_place, 'staff' => $staff_name, 'time' => $time, 'start_data' => $start_data, 'to_order' => $value, 'to_place' => $to_place, 'moved_items' => $moved_items);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'shift_id' => $input['shift_id'],
|
||||||
|
'count' => $action_count,
|
||||||
|
'data' => $sliced_order_data,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($reportType == 'move') {
|
||||||
|
$orders = ExchangeActions::select('order_code')->where('shift_id', $input['shift_id'])->groupBy('order_code')->get();
|
||||||
|
foreach ($orders as $key => $order) {
|
||||||
|
$actions = ExchangeActions::where('order_code', $order['order_code'])->where('shift_id', $input['shift_id'])->orderBy('time', 'asc')->get();
|
||||||
|
foreach ($actions as $key => $item) {
|
||||||
|
if ($item['action_type'] == 39) {
|
||||||
|
$staff_name_to = staffName($item['who']);
|
||||||
|
$time_to = date('d.m.Y H:i:s', strtotime($item['time']));
|
||||||
|
$data_from = ExchangeActions::where('order_code', $item['order_code'])->where('shift_id', $input['shift_id'])->where('action_type', 45)->first();
|
||||||
|
$staff_name_from = staffName($data_from['who']);
|
||||||
|
$time_from = date('d.m.Y H:i:s', strtotime($data_from['time']));
|
||||||
|
$moved_order_data[] = array('order' => $item['order_code'], 'move_from' => data_decode($data_from['value']), 'move_from_staff' => $staff_name_from, 'move_from_time' => $time_from, 'move_to' => data_decode($item['value']), 'move_to_staff' => $staff_name_to, 'move_to_time' => $time_to);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'count' => count($moved_order_data),
|
||||||
|
'data' => $moved_order_data,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'error_message' => 'Проверьте введенные данные',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,8 +22,9 @@ class GETOrderHistory extends HRCCommand implements HRCCommandInterface {
|
|||||||
$bill_count = 0;
|
$bill_count = 0;
|
||||||
$slice_trigger = 0;
|
$slice_trigger = 0;
|
||||||
$slice_order = 0;
|
$slice_order = 0;
|
||||||
$merged_order_items = $sliced_order_items = [];
|
$merged_order_items = $sliced_order_items = $moved_order_data = [];
|
||||||
$merge_trigger = 0;
|
$merge_trigger = 0;
|
||||||
|
$move_trigger = 0;
|
||||||
|
|
||||||
function data_decode($data) {
|
function data_decode($data) {
|
||||||
$alph = [
|
$alph = [
|
||||||
@@ -197,7 +198,6 @@ class GETOrderHistory extends HRCCommand implements HRCCommandInterface {
|
|||||||
->get();
|
->get();
|
||||||
foreach ($item_actions as $key => $item_action) {
|
foreach ($item_actions as $key => $item_action) {
|
||||||
if ($item_action['more']) {
|
if ($item_action['more']) {
|
||||||
$merge_trigger = 1;
|
|
||||||
$merge_items_before = $merge_items_after = $merge_items = $merge_order_item_before = $merge_order_item_after = $merged_items = [];
|
$merge_items_before = $merge_items_after = $merge_items = $merge_order_item_before = $merge_order_item_after = $merged_items = [];
|
||||||
$merge_order_items = json_decode(utf8_encode($item_action['more']), true, JSON_INVALID_UTF8_SUBSTITUTE);
|
$merge_order_items = json_decode(utf8_encode($item_action['more']), true, JSON_INVALID_UTF8_SUBSTITUTE);
|
||||||
$merge_order_items_before = $merge_order_items['before']['items'];
|
$merge_order_items_before = $merge_order_items['before']['items'];
|
||||||
@@ -242,15 +242,37 @@ class GETOrderHistory extends HRCCommand implements HRCCommandInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$merged_order_items[] = array('order' => $merge_order, 'time' => date('d.m.Y H:i:s', strtotime($item['time'])), 'staff' => $staff_name, 'items' => $merge_items);
|
$merged_order_items[] = array('order' => $merge_order, 'time' => date('d.m.Y H:i:s', strtotime($item['time'])), 'staff' => $staff_name, 'items' => $merge_items);
|
||||||
|
$merge_trigger = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($item['type_action'] == 39) {
|
||||||
|
$action_name = data_decode($item['value']);
|
||||||
|
$order_data = ShiftOnlineActions::where('order_code', $item['order_code'] + 0)
|
||||||
|
->where('type_action', 39)
|
||||||
|
->get();
|
||||||
|
foreach ($order_data as $key => $data) {
|
||||||
|
$staff_name = Staff::where('code', $data['who'])->where('is_history', 0)->first();
|
||||||
|
if ($staff_name) {
|
||||||
|
$staff_name = $staff_name['name'];
|
||||||
|
} else {
|
||||||
|
$staff_name = Staff::where('code', $data['who'])->where('is_history', 1)->first();
|
||||||
|
if ($staff_name) {
|
||||||
|
$staff_name = $staff_name['name'];
|
||||||
|
} else {
|
||||||
|
$staff_name = 'Связанный персонал не найден';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$moved_order_data[] = array('staff_name' => $staff_name, 'time' => date('d.m.Y H:i:s', strtotime($data['time'])), 'data' => data_decode($data['value']));
|
||||||
|
$move_trigger = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($item['type_action'] == 46) {
|
if ($item['type_action'] == 46) {
|
||||||
$action_name = 'Изменено количество гостей: ' . $item['value'];
|
$action_name = 'Изменено количество гостей: ' . $item['value'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($item['type_action'] == 45 || $item['type_action'] == 39) {
|
if ($item['type_action'] == 45) {
|
||||||
$action_name = data_decode($item['value']);
|
$action_name = data_decode($item['value']);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,8 +284,10 @@ class GETOrderHistory extends HRCCommand implements HRCCommandInterface {
|
|||||||
'bill' => $bill_count,
|
'bill' => $bill_count,
|
||||||
'slice_trigger' => $slice_trigger,
|
'slice_trigger' => $slice_trigger,
|
||||||
'merge_trigger' => $merge_trigger,
|
'merge_trigger' => $merge_trigger,
|
||||||
|
'move_trigger' => $move_trigger,
|
||||||
'sliced_order_items' => $sliced_order_items,
|
'sliced_order_items' => $sliced_order_items,
|
||||||
'merged_order_items' => $merged_order_items,
|
'merged_order_items' => $merged_order_items,
|
||||||
|
'moved_order_data' => $moved_order_data,
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
return [
|
return [
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
$scope.currentPage = 1;
|
$scope.currentPage = 1;
|
||||||
$scope.statistic = {};
|
$scope.statistic = {};
|
||||||
$scope.staffs = [];
|
$scope.staffs = [];
|
||||||
|
$scope.parseFloat = parseFloat;
|
||||||
|
|
||||||
$scope.add = function() {
|
$scope.add = function() {
|
||||||
$scope.reImport = {};
|
$scope.reImport = {};
|
||||||
@@ -76,6 +77,39 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$scope.reportMerged = function (shift) {
|
||||||
|
smartRequest.get('v1/datareport?type=merge&shift_id=' + shift.id, function (data) {
|
||||||
|
$scope.report_merge = data.data;
|
||||||
|
$scope.report_merge.count = data.count;
|
||||||
|
$scope.report_merge.shift_id = data.shift_id;
|
||||||
|
$scope.start_date = shift.opened;
|
||||||
|
$scope.end_date = shift.closed;
|
||||||
|
$('#report-merge').modal();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
$scope.reportMoved = function (shift) {
|
||||||
|
smartRequest.get('v1/datareport?type=move&shift_id=' + shift.id, function (data) {
|
||||||
|
$scope.report_move = data.data;
|
||||||
|
$scope.report_move.count = data.count;
|
||||||
|
$scope.start_date = shift.opened;
|
||||||
|
$scope.end_date = shift.closed;
|
||||||
|
$('#report-move').modal();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.reportSliced = function (shift) {
|
||||||
|
smartRequest.get('v1/datareport?type=slice&shift_id=' + shift.id, function (data) {
|
||||||
|
$scope.report_slice = data.data;
|
||||||
|
$scope.report_slice.count = data.count;
|
||||||
|
$scope.report_slice.shift_id = data.shift_id;
|
||||||
|
$scope.start_date = shift.opened;
|
||||||
|
$scope.end_date = shift.closed;
|
||||||
|
$('#report-slice').modal();
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
$scope.reportDelete = function (shift) {
|
$scope.reportDelete = function (shift) {
|
||||||
smartRequest.get('report/deleted?shift_id=' + shift.id, function (data) {
|
smartRequest.get('report/deleted?shift_id=' + shift.id, function (data) {
|
||||||
$scope.report_delete = data.deleted;
|
$scope.report_delete = data.deleted;
|
||||||
|
|||||||
@@ -169,7 +169,7 @@
|
|||||||
terminal: $scope.terminal_id,
|
terminal: $scope.terminal_id,
|
||||||
task: task.code
|
task: task.code
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
Notification.success('Задача запушена');
|
Notification.success('Задача запущена');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,9 @@
|
|||||||
<li class="nav-item" ng-if="actions.merge_trigger == 1">
|
<li class="nav-item" ng-if="actions.merge_trigger == 1">
|
||||||
<a class="nav-link" href="" data-toggle="tab" data-target="#tab4" aria-expanded="false">История объединения</a>
|
<a class="nav-link" href="" data-toggle="tab" data-target="#tab4" aria-expanded="false">История объединения</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item" ng-if="actions.move_trigger == 1">
|
||||||
|
<a class="nav-link" href="" data-toggle="tab" data-target="#tab5" aria-expanded="false">История переноса</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-content p-a m-b-md">
|
<div class="tab-content p-a m-b-md">
|
||||||
@@ -147,6 +150,15 @@
|
|||||||
<hr>
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!--Перенос заказа-->
|
||||||
|
<div ng-if="actions.move_trigger == 1" class="tab-pane animated fadeIn text-muted" id="tab5" aria-expanded="false">
|
||||||
|
<div ng-repeat="moved_order in actions.moved_order_data">
|
||||||
|
<p class="m-b-0">Время переноса: <span class="m-b-0">{{ moved_order.time }}</span></p>
|
||||||
|
<p class="m-b-0">Пользователь: <span class="m-b-0">{{ moved_order.staff_name }}</span></p>
|
||||||
|
<p class="m-b-0">{{ moved_order.data }}</span></p>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
125
web/views/reports/items/merge.html
Normal file
125
web/views/reports/items/merge.html
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
<div class="modal-dialog modal-lg" style="min-width: 390px; max-width: 1300px">
|
||||||
|
<div class="modal-content" id="reportMerged">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<button class="btn btn-icon white" ng-click="printElem('#reportMerged')">
|
||||||
|
<i class="fa fa-print"></i>
|
||||||
|
</button>
|
||||||
|
<h4 class="modal-title">{{globals.currentUser.organization.name}}</h4>
|
||||||
|
<h5 class="modal-title">Отчет по объединениям</h5>
|
||||||
|
<h5 class="modal-title">Смена №{{report_merge.shift_id}}</h5>
|
||||||
|
<span class="text-muted">{{start_date}} - {{end_date}}</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-body p-lg">
|
||||||
|
<div class="table-responsive" ng-if="report_merge.count > 0">
|
||||||
|
|
||||||
|
<div class="row" ng-repeat="report in report_merge" style="margin-left: 0px; margin-right: 0px;">
|
||||||
|
<hr/>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="box">
|
||||||
|
<div class="box-header">
|
||||||
|
<h2>Исходный заказ объединения #{{ report.start_order }}</h2>
|
||||||
|
<small>{{ report.start_order_place }}</small>
|
||||||
|
<small> - </small>
|
||||||
|
<small> - </small>
|
||||||
|
</div>
|
||||||
|
<div class="box-divider m-0"></div>
|
||||||
|
<table class="table table-striped b-t">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th>Товар</th>
|
||||||
|
<th>Кол-во</th>
|
||||||
|
<th>Итог</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="item in report.merge_order_items.before.items">
|
||||||
|
<td>{{$index + 1}}</td>
|
||||||
|
<td>{{ item.name }}</td>
|
||||||
|
<td>{{ item.count.replace(",", ".") }}</td>
|
||||||
|
<td>{{ (parseFloat(item.sale_price.replace(",", "."))) * (parseFloat(item.count.replace(",", "."))) | curr }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="box">
|
||||||
|
<div class="box-header">
|
||||||
|
<h2>Исходный заказ объединения #{{ report.end_order}}</h2>
|
||||||
|
<small>{{ report.end_order_place }}</small>
|
||||||
|
<small> - </small>
|
||||||
|
<small> - </small>
|
||||||
|
</div>
|
||||||
|
<table class="table table-striped b-t">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th>Товар</th>
|
||||||
|
<th>Кол-во</th>
|
||||||
|
<th>Итог</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="item in report.items">
|
||||||
|
<td>{{$index + 1}}</td>
|
||||||
|
<td>{{ item.name }}</td>
|
||||||
|
<td>{{ item.count.replace(",", ".") }}</td>
|
||||||
|
<td>{{ (parseFloat(item.sale_price.replace(",", "."))) * (parseFloat(item.count.replace(",", "."))) | curr }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="box">
|
||||||
|
<div class="box-header">
|
||||||
|
<h2>Конечный заказ объединения #{{ report.start_order }}</h2>
|
||||||
|
<small>{{ report.start_order_place }}</small>
|
||||||
|
<small>Время объединения: {{ report.time }}</small>
|
||||||
|
<small>Пользователь: {{ report.staff }}</small>
|
||||||
|
</div>
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th>Товар</th>
|
||||||
|
<th>Кол-во</th>
|
||||||
|
<th>Итог</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="end_order_item in report.merge_order_items.after.items">
|
||||||
|
<td>{{ $index + 1 }}</td>
|
||||||
|
<td>{{ end_order_item.name }}</td>
|
||||||
|
<td>{{ end_order_item.count.replace(",", ".") }}</td>
|
||||||
|
<td>{{ (parseFloat(end_order_item.sale_price.replace(",", "."))) * (parseFloat(end_order_item.count.replace(",", "."))) | curr }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<strong>Итого</strong>
|
||||||
|
</td>
|
||||||
|
<td style="text-align: right">
|
||||||
|
<strong>{{ report_merge.count }}</strong> объединений
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-if="report_merge.count == 0">
|
||||||
|
<p>Объединения заказов отсутствуют</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
45
web/views/reports/items/move.html
Normal file
45
web/views/reports/items/move.html
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
<div class="modal-dialog modal-lg">
|
||||||
|
<div class="modal-content" id="reportMoved">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<button class="btn btn-icon white" ng-click="printElem('#reportMoved')">
|
||||||
|
<i class="fa fa-print"></i>
|
||||||
|
</button>
|
||||||
|
<h4 class="modal-title">{{globals.currentUser.organization.name}}</h4>
|
||||||
|
<h5 class="modal-title">Отчет по перемещениям</h5>
|
||||||
|
<span class="text-muted">{{start_date}} - {{end_date}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body p-lg">
|
||||||
|
<div class="table-responsive" ng-if="report_move.count > 0">
|
||||||
|
<table class="table table-bordered" ng-repeat="report in report_move">
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<td>
|
||||||
|
<p>Заказ #{{ report.order }} </p>
|
||||||
|
<p>{{report.move_from}} в {{report.move_from_time}} пользователем {{report.move_from_staff}}</p>
|
||||||
|
<p>{{report.move_to}} в {{report.move_to_time}} пользователем {{report.move_to_staff}}</p>
|
||||||
|
</td>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<strong>Итого</strong>
|
||||||
|
</td>
|
||||||
|
<td style="text-align: right">
|
||||||
|
<strong>{{ report_move.count }}</strong> перемещений</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-if="report_move.count == 0">
|
||||||
|
<p>Перемещенные заказы отсутствуют</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
124
web/views/reports/items/slice.html
Normal file
124
web/views/reports/items/slice.html
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
<div class="modal-dialog modal-lg" style="min-width: 390px; max-width: 1300px">
|
||||||
|
<div class="modal-content" id="reportSliced">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<button class="btn btn-icon white" ng-click="printElem('#reportSliced')">
|
||||||
|
<i class="fa fa-print"></i>
|
||||||
|
</button>
|
||||||
|
<h4 class="modal-title">{{globals.currentUser.organization.name}}</h4>
|
||||||
|
<h5 class="modal-title">Отчет по разбиениям</h5>
|
||||||
|
<h5 class="modal-title">Смена №{{report_slice.shift_id}}</h5>
|
||||||
|
<span class="text-muted">{{start_date}} - {{end_date}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body p-lg">
|
||||||
|
<div class="table-responsive" ng-if="report_slice.count > 0">
|
||||||
|
|
||||||
|
<div class="row" ng-repeat="report in report_slice" style="margin-left: 0px; margin-right: 0px;">
|
||||||
|
<hr/>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="box">
|
||||||
|
<div class="box-header">
|
||||||
|
<h2>Исходный заказ разбиения #{{ report.from_order }}</h2>
|
||||||
|
<small>Время разбиения: {{ report.time }}</small>
|
||||||
|
<small>Пользователь: {{ report.staff }}</small>
|
||||||
|
<small>{{ report.from_place }}</small>
|
||||||
|
</div>
|
||||||
|
<div class="box-divider m-0"></div>
|
||||||
|
<table class="table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th>Товар</th>
|
||||||
|
<th>Кол-во</th>
|
||||||
|
<th>Итог</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="item in report.start_data.before.items">
|
||||||
|
<td>{{$index + 1}}</td>
|
||||||
|
<td>{{ item.name }}</td>
|
||||||
|
<td>{{ item.count.replace(",", ".") }}</td>
|
||||||
|
<td>{{ (parseFloat(item.sale_price.replace(",", "."))) * (parseFloat(item.count.replace(",", "."))) | curr }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="box">
|
||||||
|
<div class="box-header">
|
||||||
|
<h2>Конечный заказ разбиения #{{ report.from_order }}</h2>
|
||||||
|
<small> - </small>
|
||||||
|
<small> - </small>
|
||||||
|
<small> {{ report.from_place }} </small>
|
||||||
|
</div>
|
||||||
|
<table class="table table-striped b-t">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th>Товар</th>
|
||||||
|
<th>Кол-во</th>
|
||||||
|
<th>Итог</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="item in report.start_data.after.items">
|
||||||
|
<td>{{$index + 1}}</td>
|
||||||
|
<td>{{ item.name }}</td>
|
||||||
|
<td>{{ item.count.replace(",", ".") }}</td>
|
||||||
|
<td>{{ (parseFloat(item.sale_price.replace(",", "."))) * (parseFloat(item.count.replace(",", "."))) | curr }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="box">
|
||||||
|
<div class="box-header">
|
||||||
|
<h2>Конечный заказ разбиения #{{ report.to_order }}</h2>
|
||||||
|
<small> - </small>
|
||||||
|
<small> - </small>
|
||||||
|
<small> {{ report.to_place }} </small>
|
||||||
|
</div>
|
||||||
|
<table class="table table-striped b-t">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<th>Товар</th>
|
||||||
|
<th>Кол-во</th>
|
||||||
|
<th>Итог</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="moved_item in report.moved_items.items">
|
||||||
|
<td>{{ $index + 1 }}</td>
|
||||||
|
<td>{{ moved_item.name }}</td>
|
||||||
|
<td>{{ moved_item.count.replace(",", ".") }}</td>
|
||||||
|
<td>{{ (parseFloat(moved_item.sale_price.replace(",", "."))) * (parseFloat(moved_item.count.replace(",", "."))) | curr }}</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<strong>Итого</strong>
|
||||||
|
</td>
|
||||||
|
<td style="text-align: right">
|
||||||
|
<strong>{{ report_slice.count }}</strong> разбиений
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div ng-if="report_slice.count == 0">
|
||||||
|
<p>Разбиения заказов отсутствуют</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -28,8 +28,8 @@
|
|||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
<th>Открыта</th>
|
<th>Открыта</th>
|
||||||
<th>Закрыта</th>
|
<th>Закрыта</th>
|
||||||
<th>Выручка, BYN</th>
|
<th>Итог</th>
|
||||||
<th style="width: 80px">
|
<th>
|
||||||
<i class="material-icons"></i>
|
<i class="material-icons"></i>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>{{ shift.sum | curr}}</td>
|
<td>{{ shift.sum | curr}}</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="dropdown inline" style="margin-top: -5px; position: absolute;">
|
<div class="dropdown inline" style="margin-top: -5px; position: relative;">
|
||||||
<button class="btn white dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="padding: 0.2rem 0.4rem">
|
<button class="btn white dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" style="padding: 0.2rem 0.4rem">
|
||||||
<i class="material-icons"></i>
|
<i class="material-icons"></i>
|
||||||
</button>
|
</button>
|
||||||
@@ -57,6 +57,10 @@
|
|||||||
<a class="dropdown-item" ng-click="reportDelete(shift)">По удалениям</a>
|
<a class="dropdown-item" ng-click="reportDelete(shift)">По удалениям</a>
|
||||||
<a class="dropdown-item" ng-click="reportStaff(shift)">По персоналу</a>
|
<a class="dropdown-item" ng-click="reportStaff(shift)">По персоналу</a>
|
||||||
<a class="dropdown-item" ng-click="reportPay(shift)">По отделам</a>
|
<a class="dropdown-item" ng-click="reportPay(shift)">По отделам</a>
|
||||||
|
<!-- <a class="dropdown-item" ng-click="reportOrders(shift)">По заказам</a> -->
|
||||||
|
<a class="dropdown-item" ng-click="reportMerged(shift)">По объединениям</a>
|
||||||
|
<a class="dropdown-item" ng-click="reportSliced(shift)">По разбиениям</a>
|
||||||
|
<a class="dropdown-item" ng-click="reportMoved(shift)">По переносам</a>
|
||||||
<a class="dropdown-item" ng-click="reportOut(shift)">По внешним заказам</a>
|
<a class="dropdown-item" ng-click="reportOut(shift)">По внешним заказам</a>
|
||||||
<a class="dropdown-item" ng-click="restoreShift(shift)">Восстановить смену</a>
|
<a class="dropdown-item" ng-click="restoreShift(shift)">Восстановить смену</a>
|
||||||
<a class="dropdown-item" ng-if="delete_shift_value > 0" ng-click="deleteShift(shift)">Удалить смену</a>
|
<a class="dropdown-item" ng-if="delete_shift_value > 0" ng-click="deleteShift(shift)">Удалить смену</a>
|
||||||
@@ -119,6 +123,18 @@
|
|||||||
<div ui-include="'../views/shifts/reimport.html'"></div>
|
<div ui-include="'../views/shifts/reimport.html'"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="report-merge" data-backdrop="true">
|
||||||
|
<div ui-include="'../views/reports/items/merge.html'"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="report-move" data-backdrop="true">
|
||||||
|
<div ui-include="'../views/reports/items/move.html'"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal fade" id="report-slice" data-backdrop="true">
|
||||||
|
<div ui-include="'../views/reports/items/slice.html'"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="modal fade" id="preload-modal" data-backdrop="true">
|
<div class="modal fade" id="preload-modal" data-backdrop="true">
|
||||||
<div ui-include="'../views/shifts/preload.html'"></div>
|
<div ui-include="'../views/shifts/preload.html'"></div>
|
||||||
</div>
|
</div>
|
||||||
Reference in New Issue
Block a user