Update api requests
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
.idea/
|
.idea/
|
||||||
temp/
|
temp/
|
||||||
vendor/
|
vendor/
|
||||||
|
build.zip
|
||||||
|
|||||||
34
commands/Bot.php
Normal file
34
commands/Bot.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Commands;
|
||||||
|
|
||||||
|
use App\Component\Models\Dishes;
|
||||||
|
use App\Component\Models\Folders;
|
||||||
|
use App\Component\Models\Orders;
|
||||||
|
use App\Component\Models\Settings;
|
||||||
|
use App\Component\Models\Tasks;
|
||||||
|
use App\Console\Commands\HRCCommand;
|
||||||
|
use App\Console\Commands\HRCCommandInterface;
|
||||||
|
|
||||||
|
class Bot extends HRCCommand implements HRCCommandInterface {
|
||||||
|
protected $signature = 'getbot';
|
||||||
|
|
||||||
|
public function command($input, $output = null) {
|
||||||
|
$settings = Settings::where('code', '=', 5)->where('value', '=', 1)->get();
|
||||||
|
if (isset($settings['0']['value'])) {
|
||||||
|
$dishes = Dishes::where('is_bot_export', '=', 0)->update(['is_bot_export' => 1]);
|
||||||
|
$folders = Folders::where('is_bot_export', '=', 0)->update(['is_bot_export' => 1]);
|
||||||
|
}
|
||||||
|
$ordersinfo = Tasks::where('method', '=', 'orderinfo')->get();
|
||||||
|
$delete_params = ['closed', 'deleted'];
|
||||||
|
foreach ($ordersinfo as $more) {
|
||||||
|
$order = Orders::where('id', '=', $more['more'])->whereIn('status', $delete_params)->get();
|
||||||
|
foreach ($order as $value) {
|
||||||
|
$delete = Tasks::where('method', '=', 'orderinfo')->where('more', '=', $value['id'])->delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
99
commands/ClientFile.php
Normal file
99
commands/ClientFile.php
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Commands;
|
||||||
|
|
||||||
|
use App\Component\Models\Client;
|
||||||
|
use App\Component\Models\Terminal;
|
||||||
|
use App\Console\Commands\HRCCommand;
|
||||||
|
use App\Console\Commands\HRCCommandInterface;
|
||||||
|
|
||||||
|
class ClientFile extends HRCCommand implements HRCCommandInterface {
|
||||||
|
protected $signature = 'getclientfile';
|
||||||
|
|
||||||
|
public function command($input, $output = null) {
|
||||||
|
$terminal = Terminal::where('soft', '=', 1)->where('is_active', '=', 1)->where('work_code', '=', 1)->first();
|
||||||
|
$tmp_dirname = __DIR__ . "\\..\\..\\..\\Exchange\\" . $terminal['key'] . "\\tmp\\" . $terminal['key'] . "\\";
|
||||||
|
$dirname = __DIR__ . "\\..\\..\\..\\Exchange\\" . $terminal['key'] . "\\";
|
||||||
|
$code = '';
|
||||||
|
if (isset($input['complete'])) {
|
||||||
|
foreach (glob($tmp_dirname . "*.tmp") as $filename) {
|
||||||
|
$code .= file_get_contents($filename);
|
||||||
|
}
|
||||||
|
$filename = str_replace(' ', '_', date("d.m.Y H.i.s")) . '.csv';
|
||||||
|
file_put_contents($dirname . $filename, $code);
|
||||||
|
$files = glob($tmp_dirname . "*");
|
||||||
|
foreach ($files as $file) {
|
||||||
|
if (is_file($file)) {
|
||||||
|
unlink($file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$files = glob($dirname . "*.*");
|
||||||
|
usort($files, function ($a, $b) {
|
||||||
|
return filemtime($a) < filemtime($b);
|
||||||
|
});
|
||||||
|
foreach ($files as $plk2) {
|
||||||
|
$file_array[] = str_replace($dirname, '', $plk2);
|
||||||
|
}
|
||||||
|
if (array_key_exists(0, $file_array)) {
|
||||||
|
$file = date("d.m.Y H:i:s", filemtime($dirname . $file_array['0']));
|
||||||
|
} else {
|
||||||
|
$file = '';
|
||||||
|
}
|
||||||
|
$baseCSV = file($dirname . $filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||||
|
|
||||||
|
foreach ($baseCSV as $itemBaseCSV) {
|
||||||
|
$arrLineCsv = explode(";", $itemBaseCSV);
|
||||||
|
$arrUniqFinish[$arrLineCsv[0] . ";" . $arrLineCsv[1]] = $arrLineCsv[1];
|
||||||
|
}
|
||||||
|
$arrUniqFinish = array_unique($arrUniqFinish);
|
||||||
|
|
||||||
|
foreach ($arrUniqFinish as $keyArr => $valueArr) {
|
||||||
|
$finishSavedCsv[] = $keyArr;
|
||||||
|
}
|
||||||
|
file_put_contents($dirname . $filename, implode("\n", $finishSavedCsv));
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'filename' => $filename,
|
||||||
|
'filedate' => $file,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
$clientsCount = Client::count();
|
||||||
|
$urlThread = $input['th'];
|
||||||
|
$mainThreads = 4;
|
||||||
|
$countPerThread = ceil($clientsCount / $mainThreads);
|
||||||
|
$offset = ($urlThread - 1) * $countPerThread;
|
||||||
|
$clients = Client::with('clientPhone:client_guid,phone')->skip($offset)->take($countPerThread)->get();
|
||||||
|
|
||||||
|
if (!is_dir($tmp_dirname)) {
|
||||||
|
mkdir($tmp_dirname, 0755, 'w+');
|
||||||
|
}
|
||||||
|
$filename = str_replace(' ', '_', date("d.m.Y H.i.s")) . '_' . $urlThread . '.tmp';
|
||||||
|
$handle = fopen($tmp_dirname . $filename, 'w+');
|
||||||
|
fputs($handle, chr(0xEF) . chr(0xBB) . chr(0xBF)); // BOM
|
||||||
|
$filename = str_replace('_', ' ', $filename);
|
||||||
|
foreach ($clients as $row) {
|
||||||
|
if (($row['clientPhone']->phone !== '') && ($row['clientPhone']->phone !== '+375 ( ) - -')) {
|
||||||
|
$row = array($row['name'], $row['clientPhone']->phone);
|
||||||
|
fputcsv($handle, $row, ';');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
fclose($handle);
|
||||||
|
$files = glob($tmp_dirname . "*.*");
|
||||||
|
usort($files, function ($a, $b) {
|
||||||
|
return filemtime($a) < filemtime($b);
|
||||||
|
});
|
||||||
|
foreach ($files as $plk2) {
|
||||||
|
$file_array[] = str_replace($tmp_dirname, '', $plk2);
|
||||||
|
}
|
||||||
|
if (array_key_exists(0, $file_array)) {
|
||||||
|
$file = date("d.m.Y H:i:s", filemtime($tmp_dirname . $file_array['0']));
|
||||||
|
} else {
|
||||||
|
$file = '';
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'filename' => $filename,
|
||||||
|
'filedate' => $file,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
55
commands/ClientGroup.php
Normal file
55
commands/ClientGroup.php
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Commands;
|
||||||
|
|
||||||
|
use App\Component\Models\ClientsGroup;
|
||||||
|
use App\Component\Models\Terminal;
|
||||||
|
use App\Console\Commands\HRCCommand;
|
||||||
|
use App\Console\Commands\HRCCommandInterface;
|
||||||
|
|
||||||
|
class ClientGroup extends HRCCommand implements HRCCommandInterface {
|
||||||
|
protected $signature = 'getclientgroup';
|
||||||
|
|
||||||
|
public function command($input, $output = null) {
|
||||||
|
if (ClientsGroup::where('code', '0')->count() == 0) {
|
||||||
|
$group = new ClientsGroup;
|
||||||
|
$group->code = '0';
|
||||||
|
$group->name = 'Без группы';
|
||||||
|
$group->save();
|
||||||
|
}
|
||||||
|
$client_groups = ClientsGroup::orderBy('code')->get();
|
||||||
|
foreach ($client_groups as $client_group) {
|
||||||
|
$out[] = array('id' => $client_group['id'], 'name' => $client_group['name']);
|
||||||
|
}
|
||||||
|
$terminal = Terminal::where('soft', '=', 1)->where('is_active', '=', 1)->where('work_code', '=', 1)->first();
|
||||||
|
$dir = __DIR__ . "/../../../Exchange/" . $terminal['key'] . "/";
|
||||||
|
if (!is_dir($dir)) {
|
||||||
|
mkdir($dir, 0755, 'w+');
|
||||||
|
}
|
||||||
|
|
||||||
|
$files = glob($dir . "*.*");
|
||||||
|
if (count($files) > 0) {
|
||||||
|
usort($files, function ($a, $b) {
|
||||||
|
return filemtime($a) < filemtime($b);
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach ($files as $plk2) {
|
||||||
|
$file_array[] = str_replace($dir, '', $plk2);
|
||||||
|
}
|
||||||
|
$filename = $file_array['0'];
|
||||||
|
$file = date("d.m.Y H:i:s", filemtime(__DIR__ . "/../../../Exchange/" . $terminal['key'] . "/" . $file_array['0']));
|
||||||
|
} else {
|
||||||
|
$file_array = '';
|
||||||
|
$filename = '';
|
||||||
|
$file = '';
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'groups' => $out,
|
||||||
|
'terminalKey' => $terminal['key'],
|
||||||
|
'files' => $files,
|
||||||
|
'filename' => $filename,
|
||||||
|
'filedate' => $file,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
56
commands/Clients.php
Normal file
56
commands/Clients.php
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Commands;
|
||||||
|
|
||||||
|
use App\Component\Models\Client;
|
||||||
|
use App\Component\Models\ClientsGroup;
|
||||||
|
use App\Component\Models\ClientsPhone;
|
||||||
|
use App\Console\Commands\HRCCommand;
|
||||||
|
use App\Console\Commands\HRCCommandInterface;
|
||||||
|
|
||||||
|
class Clients extends HRCCommand implements HRCCommandInterface {
|
||||||
|
protected $signature = 'getclients';
|
||||||
|
|
||||||
|
public function command($input, $output = null) {
|
||||||
|
if (ClientsGroup::where('code', '0')->count() == 0) {
|
||||||
|
$group = new ClientsGroup([
|
||||||
|
'code' => '0',
|
||||||
|
'name' => 'Без группы',
|
||||||
|
]);
|
||||||
|
$group->save();
|
||||||
|
}
|
||||||
|
$countPerPage = 25;
|
||||||
|
$offset = ($input['page'] - 1) * $countPerPage;
|
||||||
|
if ($input['group_id'] == 0) {
|
||||||
|
$group = ClientsGroup::where('code', '=', $input['group_id'])->first();
|
||||||
|
} else {
|
||||||
|
$group = ClientsGroup::where('id', '=', $input['group_id'])->first();
|
||||||
|
}
|
||||||
|
$clients = Client::where('group_id', '=', $group['code'])->skip($offset)->take($countPerPage)->get();
|
||||||
|
$total = Client::where('group_id', '=', $group['code'])->count();
|
||||||
|
if ($total == NULL) {
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'clients' => array(),
|
||||||
|
'total' => 0,
|
||||||
|
'size' => $countPerPage,
|
||||||
|
'pages' => 1,
|
||||||
|
'currentGroup' => $group['id'],
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
|
||||||
|
foreach ($clients as $client) {
|
||||||
|
$phone = ClientsPhone::where('client_guid', '=', $client['user_code'])->first();
|
||||||
|
$out[] = array('id' => $client['id'], 'name' => $client['name'], 'phone' => $phone['phone']);
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'clients' => $out,
|
||||||
|
'total' => $total,
|
||||||
|
'size' => $countPerPage,
|
||||||
|
'pages' => ceil($total / $countPerPage),
|
||||||
|
'currentGroup' => $group['id'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
53
commands/CreateBarcode.php
Normal file
53
commands/CreateBarcode.php
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Commands;
|
||||||
|
|
||||||
|
use App\Component\Models\Client;
|
||||||
|
use App\Component\Models\ClientsBarcode;
|
||||||
|
use App\Component\Models\ClientsGroup;
|
||||||
|
use App\Console\Commands\HRCCommand;
|
||||||
|
use App\Console\Commands\HRCCommandInterface;
|
||||||
|
|
||||||
|
class CreateBarcode extends HRCCommand implements HRCCommandInterface {
|
||||||
|
protected $signature = 'postcreatebarcode';
|
||||||
|
|
||||||
|
public function command($input, $output = null) {
|
||||||
|
$group = ClientsGroup::where('id', '=', $input['group_id'])->first();
|
||||||
|
if (($input['start'] <= $input['end']) && (srtlen($input['start']) == srtlen($input['end']))) {
|
||||||
|
for ($i = $input['start']; $i <= $input['end']; $i++) {
|
||||||
|
$total = Client::where('name', '=', $i)->count();
|
||||||
|
$client = new Client;
|
||||||
|
if ($total >= 1) {
|
||||||
|
$total = $total + 1;
|
||||||
|
$client->name = '#' . $total . ' ' . urldecode($i);
|
||||||
|
} else {
|
||||||
|
$client->name = urldecode($i);
|
||||||
|
}
|
||||||
|
$client->user_code = strtoupper(md5(time() + $i));
|
||||||
|
$client->group_id = $group['code'];
|
||||||
|
$client->is_special_price = 0;
|
||||||
|
|
||||||
|
$barcode = new ClientsBarcode;
|
||||||
|
$barcode->code_id = $i;
|
||||||
|
$barcode->name = '';
|
||||||
|
$barcode->client_guid = $client->user_code;
|
||||||
|
$barcode->value = $i;
|
||||||
|
$barcode->block = 0;
|
||||||
|
$barcode->symptom_block = 0;
|
||||||
|
|
||||||
|
$barcode->save();
|
||||||
|
$client->save();
|
||||||
|
}
|
||||||
|
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => 'Штрих коды созданы',
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
return [
|
||||||
|
'status' => 'error',
|
||||||
|
'message' => 'Проверьте правильность введенных данных',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
73
commands/CreateClient.php
Normal file
73
commands/CreateClient.php
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Commands;
|
||||||
|
|
||||||
|
use App\Component\Models\Client;
|
||||||
|
use App\Component\Models\ClientsAddress;
|
||||||
|
use App\Component\Models\ClientsBarcode;
|
||||||
|
use App\Component\Models\ClientsEmail;
|
||||||
|
use App\Component\Models\ClientsGroup;
|
||||||
|
use App\Component\Models\ClientsPhone;
|
||||||
|
use App\Console\Commands\HRCCommand;
|
||||||
|
use App\Console\Commands\HRCCommandInterface;
|
||||||
|
|
||||||
|
class CreateClient extends HRCCommand implements HRCCommandInterface {
|
||||||
|
protected $signature = 'postcreateclient';
|
||||||
|
|
||||||
|
public function command($input, $output = null) {
|
||||||
|
$group = ClientsGroup::where('id', '=', $input['group_id'])->first();
|
||||||
|
$total = Client::where('name', '=', $input['name'])->count();
|
||||||
|
if ($input['is_special_price'] == 'true') {
|
||||||
|
$specialPrice = 1;
|
||||||
|
} else {
|
||||||
|
$specialPrice = 0;
|
||||||
|
}
|
||||||
|
$client = new Client;
|
||||||
|
if ($total >= 1) {
|
||||||
|
$total = $total + 1;
|
||||||
|
$client->name = '#' . $total . ' ' . urldecode($input['name']);
|
||||||
|
} else {
|
||||||
|
$client->name = urldecode($input['name']);
|
||||||
|
}
|
||||||
|
$client->user_code = strtoupper(md5(time()));
|
||||||
|
$client->group_id = $group['code'];
|
||||||
|
$client->is_special_price = $specialPrice;
|
||||||
|
|
||||||
|
$clientEmail = new ClientsEmail;
|
||||||
|
$clientEmail->email = urldecode($input['email']);
|
||||||
|
$clientEmail->client_guid = $client->user_code;
|
||||||
|
|
||||||
|
$clientAddress = new ClientsAddress;
|
||||||
|
$clientAddress->address = urldecode($input['address']);
|
||||||
|
$clientAddress->client_guid = $client->user_code;
|
||||||
|
|
||||||
|
$clientPhone = new ClientsPhone;
|
||||||
|
if ($input['phone'] !== '') {
|
||||||
|
$phoneData = urldecode($input['phone']);
|
||||||
|
$phone = '+375 (' . substr($phoneData, 0, 2) . ') ' . substr($phoneData, 2, 3) . '-' . substr($phoneData, 5, 2) . '-' . substr($phoneData, 7, 2);
|
||||||
|
} else {
|
||||||
|
$phone = '';
|
||||||
|
}
|
||||||
|
$clientPhone->phone = $phone;
|
||||||
|
$clientPhone->client_guid = $client->user_code;
|
||||||
|
|
||||||
|
$clientBarcode = new ClientsBarcode;
|
||||||
|
$clientBarcode->code_id = urldecode($input['barcode']);
|
||||||
|
$clientBarcode->name = '';
|
||||||
|
$clientBarcode->client_guid = $client->user_code;
|
||||||
|
$clientBarcode->value = urldecode($input['barcode']);
|
||||||
|
$clientBarcode->block = 0;
|
||||||
|
$clientBarcode->symptom_block = 0;
|
||||||
|
|
||||||
|
$clientBarcode->save();
|
||||||
|
$clientEmail->save();
|
||||||
|
$clientAddress->save();
|
||||||
|
$client->save();
|
||||||
|
$clientPhone->save();
|
||||||
|
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => 'Клиент создан',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
35
commands/Equipment.php
Normal file
35
commands/Equipment.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Commands;
|
||||||
|
|
||||||
|
use App\Component\Models\Printer;
|
||||||
|
use App\Component\Models\PrinterSettings;
|
||||||
|
use App\Component\Models\Terminal;
|
||||||
|
use App\Console\Commands\HRCCommand;
|
||||||
|
use App\Console\Commands\HRCCommandInterface;
|
||||||
|
|
||||||
|
class Equipment extends HRCCommand implements HRCCommandInterface {
|
||||||
|
protected $signature = 'getequipment';
|
||||||
|
|
||||||
|
public function command($input, $output = null) {
|
||||||
|
$terminals = Terminal::select('work_code', 'work_group')
|
||||||
|
->where('key', '=', $input['terminal'])
|
||||||
|
->get();
|
||||||
|
foreach ($terminals as $terminal) {
|
||||||
|
$terminal_data = array('work_code' => $terminal['work_code'], 'work_group' => $terminal['work_group']);
|
||||||
|
}
|
||||||
|
$printer_groups = Printer::select('code', 'name')
|
||||||
|
->where('is_history', '=', 0)
|
||||||
|
->get();
|
||||||
|
$printers = PrinterSettings::select('name', 'id', 'ip', 'com_port', 'type', 'speed', 'printer_group', 'template', 'size', 'driver', 'codepage', 'more')
|
||||||
|
->where('workgroup', '=', $terminal_data['work_group'])
|
||||||
|
->where('workcode', '=', $terminal_data['work_code'])
|
||||||
|
->get();
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'terminal_data' => $terminal_data,
|
||||||
|
'printer_groups' => $printer_groups,
|
||||||
|
'printers' => $printers,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
22
commands/Fiscals.php
Normal file
22
commands/Fiscals.php
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Commands;
|
||||||
|
|
||||||
|
use App\Component\Models\Terminal;
|
||||||
|
use App\Console\Commands\HRCCommand;
|
||||||
|
use App\Console\Commands\HRCCommandInterface;
|
||||||
|
|
||||||
|
class Fiscals extends HRCCommand implements HRCCommandInterface {
|
||||||
|
protected $signature = 'postfiscals';
|
||||||
|
|
||||||
|
public function command($input, $output = null) {
|
||||||
|
$terminals = Terminal::select('work_code', 'work_group')->where('key', '=', $input['terminal'])->get();
|
||||||
|
foreach ($terminals as $terminal) {
|
||||||
|
$out = array('work_code' => $terminal['work_code'], 'work_group' => $terminal['work_group']);
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'terminal_data' => $out,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Commands;
|
|
||||||
|
|
||||||
use App\Console\Commands\HRCCommand;
|
|
||||||
use App\Console\Commands\HRCCommandInterface;
|
|
||||||
use App\Models\User;
|
|
||||||
|
|
||||||
class HelloWorld extends HRCCommand implements HRCCommandInterface
|
|
||||||
{
|
|
||||||
protected $signature = 'gethello';
|
|
||||||
|
|
||||||
public function command($input, $output = null)
|
|
||||||
{
|
|
||||||
$users = User::all();
|
|
||||||
|
|
||||||
return [
|
|
||||||
'status' => 'success',
|
|
||||||
'users' => $users
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
87
commands/Import.php
Normal file
87
commands/Import.php
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
<?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)->where('work_code', '=', 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) {
|
||||||
|
$path = '/backup/' . $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),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
138
commands/OutOrders.php
Normal file
138
commands/OutOrders.php
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Commands;
|
||||||
|
|
||||||
|
use App\Component\Models\Orders;
|
||||||
|
use App\Component\Models\Report;
|
||||||
|
use App\Component\Models\Shifts;
|
||||||
|
use App\Console\Commands\HRCCommand;
|
||||||
|
use App\Console\Commands\HRCCommandInterface;
|
||||||
|
|
||||||
|
class OutOrders extends HRCCommand implements HRCCommandInterface {
|
||||||
|
protected $signature = 'getoutorders';
|
||||||
|
|
||||||
|
public function command($input, $output = null) {
|
||||||
|
if ((array_key_exists('shift_id', $input)) === true) {
|
||||||
|
$shifts = Shifts::select('id', 'opened', 'closed')->where('id', '=', $input['shift_id'])->get();
|
||||||
|
if (is_array($shifts) || is_object($shifts)) {
|
||||||
|
foreach ($shifts as $shift) {
|
||||||
|
$out = array('id' => $shift['id'], 'opened' => $shift['opened'], 'closed' => $shift['closed']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$orders = Orders::select('id', 'order', 'created_at')->where('created_at', '>', $out['opened'])->where('created_at', '<=', $out['closed'])->get();
|
||||||
|
$count_items = 0;
|
||||||
|
if (is_array($orders) || is_object($orders)) {
|
||||||
|
foreach ($orders as $order) {
|
||||||
|
$order_id = $order['id'];
|
||||||
|
$price = json_decode(base64_decode($order['order']), true)['price'];
|
||||||
|
$items = json_decode(base64_decode($order['order']), true)['items'];
|
||||||
|
$date = strtotime($order['created_at']);
|
||||||
|
$newformat = date('Y-m-d H:i:s', $date);
|
||||||
|
foreach ($items as $key => $item) {
|
||||||
|
$out_item[$key] = array(
|
||||||
|
'id' => $item['id'], 'name' => $item['name'], 'count' => $item['count'], 'price' => $item['price'],
|
||||||
|
'full_price' => $item['full_price'],
|
||||||
|
);
|
||||||
|
$count_items += 1;
|
||||||
|
}
|
||||||
|
$remoteOrder[] = array(
|
||||||
|
'id' => $order_id,
|
||||||
|
'items_count' => $count_items,
|
||||||
|
'items' => $out_item,
|
||||||
|
'date' => $newformat,
|
||||||
|
'price' => $price,
|
||||||
|
);
|
||||||
|
unset($out_item);
|
||||||
|
$count_items = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isset($remoteOrder)) {
|
||||||
|
$total_count = 0;
|
||||||
|
$total_price = 0;
|
||||||
|
foreach ($orders as $order) {
|
||||||
|
$total_count += 1;
|
||||||
|
$total_price += json_decode(base64_decode($order['order']), true)['price'];
|
||||||
|
}
|
||||||
|
$total = array('total_count' => $total_count, 'total_price' => $total_price);
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => 'true',
|
||||||
|
'shift' => $out,
|
||||||
|
'orders' => $remoteOrder,
|
||||||
|
'total' => $total,
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => 'false',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((array_key_exists('start_date', $input)) === true) {
|
||||||
|
$start_t = strtotime($input['start_date']) + 1;
|
||||||
|
$end_t = strtotime($input['end_date']) - 1;
|
||||||
|
$start = date('Y-m-d H:i:s', $start_t);
|
||||||
|
$end = date('Y-m-d H:i:s', $end_t);
|
||||||
|
$orders = Orders::select('id', 'order', 'created_at')->where('created_at', '>', $start)->where('created_at', '<=', $end)->get();
|
||||||
|
$count_items = 0;
|
||||||
|
if (is_array($orders) || is_object($orders)) {
|
||||||
|
foreach ($orders as $order) {
|
||||||
|
$order_id = $order['id'];
|
||||||
|
$price = json_decode(base64_decode($order['order']), true)['price'];
|
||||||
|
$items = json_decode(base64_decode($order['order']), true)['items'];
|
||||||
|
$date = strtotime($order['created_at']);
|
||||||
|
$newformat = date('Y-m-d H:i:s', $date);
|
||||||
|
foreach ($items as $key => $item) {
|
||||||
|
$out_item[$key] = array(
|
||||||
|
'id' => $item['id'],
|
||||||
|
'name' => $item['name'],
|
||||||
|
'count' => $item['count'],
|
||||||
|
'price' => $item['price'],
|
||||||
|
'full_price' => $item['full_price'],
|
||||||
|
);
|
||||||
|
$count_items += 1;
|
||||||
|
}
|
||||||
|
$remoteOrder[] = array(
|
||||||
|
'id' => $order_id,
|
||||||
|
'items_count' => $count_items,
|
||||||
|
'items' => $out_item,
|
||||||
|
'date' => $newformat,
|
||||||
|
'price' => $price,
|
||||||
|
);
|
||||||
|
unset($out_item);
|
||||||
|
$count_items = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isset($remoteOrder)) {
|
||||||
|
$total_count = 0;
|
||||||
|
$total_price = 0;
|
||||||
|
if (is_array($orders) || is_object($orders)) {
|
||||||
|
foreach ($orders as $order) {
|
||||||
|
$total_count += 1;
|
||||||
|
$total_price += json_decode(base64_decode($order['order']), true)['price'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$total = array('total_count' => $total_count, 'total_price' => $total_price);
|
||||||
|
$report = new Report;
|
||||||
|
$report->user_id = $input['admin_user_id'];
|
||||||
|
$report->name = 'Отчет по внешним заказам';
|
||||||
|
$report->shift_id = 0;
|
||||||
|
$report->start_date = $start;
|
||||||
|
$report->end_date = $end;
|
||||||
|
$report->report_type = 'out';
|
||||||
|
$report->save();
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => 'true',
|
||||||
|
'orders' => $remoteOrder,
|
||||||
|
'total' => $total,
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'message' => 'false',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
71
commands/Printers.php
Normal file
71
commands/Printers.php
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Commands;
|
||||||
|
|
||||||
|
use App\Component\Models\Printer;
|
||||||
|
use App\Component\Models\PrinterSettings;
|
||||||
|
use App\Component\Models\Tasks;
|
||||||
|
use App\Component\Models\Terminal;
|
||||||
|
use App\Console\Commands\HRCCommand;
|
||||||
|
use App\Console\Commands\HRCCommandInterface;
|
||||||
|
|
||||||
|
class Printers extends HRCCommand implements HRCCommandInterface {
|
||||||
|
protected $signature = 'postprinters';
|
||||||
|
|
||||||
|
public function command($input, $output = null) {
|
||||||
|
$terminals = Terminal::select('id', 'work_code', 'work_group')->where('key', '=', $input['terminal'])->get();
|
||||||
|
foreach ($terminals as $terminal) {
|
||||||
|
$terminal_data = array('id' => $terminal['id'], 'work_code' => $terminal['work_code'], 'work_group' => $terminal['work_group']);
|
||||||
|
}
|
||||||
|
$first_printer_data = PrinterSettings::where('id', '=', $input['id'])->get();
|
||||||
|
foreach ($first_printer_data as $old_printer_data) {
|
||||||
|
}
|
||||||
|
$printer_name = Printer::where('code', '=', $input['group'])->get();
|
||||||
|
foreach ($printer_name as $group_name) {
|
||||||
|
}
|
||||||
|
if ($input['group'] == 0) {
|
||||||
|
$group_name['name'] = $input['name'];
|
||||||
|
}
|
||||||
|
if ($input['type'] == 'COM') {
|
||||||
|
$task[] = "UPDATE main.printers SET `name`='" . urldecode($group_name['name']) . "', `IP`=NULL, `port`=NULL, `COMport`='" . $input['com_port'] . "', `type`='" . $input['type'] . "', `size`=" . $input['size'] . ", `speed`=" . $input['speed'] . ", `driver`=NULL, `workcode`=" . $terminal_data['work_code'] . ", `workgroup`=" . $terminal_data['work_group'] . ",`printer_group`=" . $input['group'] . ", `template`='" . $input['template'] . "', `more`='" . urldecode($input['more']) . "' WHERE `name`='" . $old_printer_data['name'] . "' AND `workcode`=" . $terminal_data['work_code'] . " AND `workgroup`=" . $terminal_data['work_group'] . ";";
|
||||||
|
$task = base64_encode(json_encode(array('queries' => $task), TRUE));
|
||||||
|
$add_task = new Tasks;
|
||||||
|
$add_task->terminal_id = $terminal_data['id'];
|
||||||
|
$add_task->next_at = date("Y-m-d H:i:s");
|
||||||
|
$add_task->method = 'runquery';
|
||||||
|
$add_task->period = 0;
|
||||||
|
$add_task->is_cycle = 0;
|
||||||
|
$add_task->more = $task;
|
||||||
|
$add_task->save();
|
||||||
|
}
|
||||||
|
if ($input['type'] == 'LAN') {
|
||||||
|
$task[] = "UPDATE main.printers SET `name`='" . urldecode($group_name['name']) . "', `IP`='" . $input['ip_address'] . "', `port`=9100, `COMport`=NULL, `type`='" . $input['type'] . "', `size`=" . $input['size'] . ", `speed`=NULL, `driver`=NULL, `workcode`=" . $terminal_data['work_code'] . ", `workgroup`=" . $terminal_data['work_group'] . ",`printer_group`=" . $input['group'] . ", `template`='" . $input['template'] . "', `more`='" . urldecode($input['more']) . "' WHERE `name`='" . $old_printer_data['name'] . "' AND `workcode`=" . $terminal_data['work_code'] . " AND `workgroup`=" . $terminal_data['work_group'] . ";";
|
||||||
|
$task = base64_encode(json_encode(array('queries' => $task)));
|
||||||
|
$add_task = new Tasks;
|
||||||
|
$add_task->terminal_id = $terminal_data['id'];
|
||||||
|
$add_task->next_at = date("Y-m-d H:i:s");
|
||||||
|
$add_task->method = 'runquery';
|
||||||
|
$add_task->period = 0;
|
||||||
|
$add_task->is_cycle = 0;
|
||||||
|
$add_task->more = $task;
|
||||||
|
$add_task->save();
|
||||||
|
}
|
||||||
|
if ($input['type'] == 'Windows') {
|
||||||
|
$task[] = "UPDATE main.printers SET `name`='" . urldecode($group_name['name']) . "', `IP`=NULL, `port`=NULL, `COMport`=NULL, `type`='" . $input['type'] . "', `size`=" . $input['size'] . ", `speed`=NULL, `driver`='" . urldecode($input['driver']) . "', `workcode`=" . $terminal_data['work_code'] . ", `workgroup`=" . $terminal_data['work_group'] . ",`printer_group`=" . $input['group'] . ", `template`='" . $input['template'] . "', `more`='" . urldecode($input['more']) . "' WHERE `name`='" . $old_printer_data['name'] . "' AND `workcode`=" . $terminal_data['work_code'] . " AND `workgroup`=" . $terminal_data['work_group'] . ";";
|
||||||
|
$task = base64_encode(json_encode(array('queries' => $task)));
|
||||||
|
$add_task = new Tasks;
|
||||||
|
$add_task->terminal_id = $terminal_data['id'];
|
||||||
|
$add_task->next_at = date("Y-m-d H:i:s");
|
||||||
|
$add_task->method = 'runquery';
|
||||||
|
$add_task->period = 0;
|
||||||
|
$add_task->is_cycle = 0;
|
||||||
|
$add_task->more = $task;
|
||||||
|
$add_task->save();
|
||||||
|
}
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'input' => $input,
|
||||||
|
'task' => $task,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
70
commands/TopDishes.php
Normal file
70
commands/TopDishes.php
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Commands;
|
||||||
|
|
||||||
|
use App\Component\Models\Dishes;
|
||||||
|
use App\Component\Models\OnlineItems;
|
||||||
|
use App\Console\Commands\HRCCommand;
|
||||||
|
use App\Console\Commands\HRCCommandInterface;
|
||||||
|
|
||||||
|
class TopDishes extends HRCCommand implements HRCCommandInterface {
|
||||||
|
protected $signature = 'gettopdishes';
|
||||||
|
|
||||||
|
public function command($input, $output = null) {
|
||||||
|
|
||||||
|
$info = OnlineItems::where('menu_code', '>', 0)->get()->unique('menu_code');
|
||||||
|
$count = OnlineItems::where('menu_code', '>', 0)->count();
|
||||||
|
if ($count > 0) {
|
||||||
|
foreach ($info as $key => $value) {
|
||||||
|
$out[] = $value;
|
||||||
|
}
|
||||||
|
foreach ($out as $key => $item) {
|
||||||
|
$dishInfo = Dishes::select('name')
|
||||||
|
->where('code', '=', $item['menu_code'])
|
||||||
|
->where('legacy_code', '=', $item['dish_code'])
|
||||||
|
->where('is_history', '=', 0)
|
||||||
|
->get();
|
||||||
|
$onlineDishInfo = OnlineItems::select('real_price', 'sale_price', 'special_price')
|
||||||
|
->where('menu_code', '=', $item['menu_code'])
|
||||||
|
->where('dish_code', '=', $item['dish_code'])
|
||||||
|
->get();
|
||||||
|
$dishName = $dishInfo[0]->name;
|
||||||
|
$dishCount = OnlineItems::where('menu_code', '=', $item['menu_code'])->sum('count');
|
||||||
|
$dishSum = $onlineDishInfo[0]->real_price * $dishCount;
|
||||||
|
if ($dishSum > 0) {
|
||||||
|
$dishTotalCost = round(($onlineDishInfo[0]->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' => $dishCount, 'sum' => $dishSum, 'totalCost' => $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, 10);
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'dishes' => $sorted,
|
||||||
|
// 'info' => $info,
|
||||||
|
// 'test' => $dishes,
|
||||||
|
// 'count' => $dishCount,
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
return [
|
||||||
|
'status' => 'success',
|
||||||
|
'dishes' => [],
|
||||||
|
// 'info' => $info,
|
||||||
|
// 'test' => $dishes,
|
||||||
|
// 'count' => $dishCount,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hrc-admin/hello-world",
|
"name": "hrc-admin/hello-world",
|
||||||
"version": "1.0",
|
"version": "1.2",
|
||||||
"require": {
|
"require": {
|
||||||
"horeca/admin-php-module-core": "dev-master"
|
"horeca/admin-php-module-core": "dev-master"
|
||||||
},
|
},
|
||||||
|
|||||||
742
composer.lock
generated
742
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,34 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
class CreateTestTable extends Migration {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function up()
|
|
||||||
{
|
|
||||||
Schema::create('test', function(Blueprint $table)
|
|
||||||
{
|
|
||||||
$table->increments('id');
|
|
||||||
$table->timestamps();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function down()
|
|
||||||
{
|
|
||||||
Schema::drop('test');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<?php
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddRevenueToExchangeShiftsTable extends Migration {
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up() {
|
||||||
|
if (!Schema::hasColumn('exchange_shifts', 'revenue')) {
|
||||||
|
Schema::table('exchange_shifts', function (Blueprint $table) {
|
||||||
|
$table->decimal('revenue', $precision = 16, $scale = 2)->nullable()->after('closed');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down() {
|
||||||
|
Schema::table('exchange_shifts', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('revenue');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddValueToExchangeActionsTable extends Migration {
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up() {
|
||||||
|
Schema::table('exchange_actions', function (Blueprint $table) {
|
||||||
|
$table->string('value', 255)->nullable()->change();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down() {
|
||||||
|
Schema::table('exchange_actions', function (Blueprint $table) {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddForeignKeyToClientsTable extends Migration {
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up() {
|
||||||
|
|
||||||
|
Schema::table('clients', function (Blueprint $table) {
|
||||||
|
$table->string('user_code')->unique()->change();
|
||||||
|
|
||||||
|
});
|
||||||
|
Schema::table('clients_phone', function (Blueprint $table) {
|
||||||
|
$table->foreign('client_guid')->references('user_code')->on('clients');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down() {
|
||||||
|
Schema::table('clients', function (Blueprint $table) {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class AddOrderToOrderbotStorageTable extends Migration {
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up() {
|
||||||
|
Schema::table('orderbot_storage', function (Blueprint $table) {
|
||||||
|
$table->text('order')->change();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down() {
|
||||||
|
Schema::table('orderbot_storage', function (Blueprint $table) {
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class CreateClientsBarcodesTable extends Migration {
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up() {
|
||||||
|
Schema::create('clients_barcodes', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('client_guid');
|
||||||
|
$table->string('code_id');
|
||||||
|
$table->string('name');
|
||||||
|
$table->string('block');
|
||||||
|
$table->string('value');
|
||||||
|
$table->string('symptom_block');
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down() {
|
||||||
|
Schema::dropIfExists('clients_barcodes');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Database\Component\Seeders;
|
|
||||||
|
|
||||||
use App\Models\Subscriber;
|
|
||||||
use Illuminate\Database\Seeder;
|
|
||||||
|
|
||||||
class AddAfterMenuUploadSubscriber extends Seeder
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the database seeds.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
Subscriber::add('sync:postmenu', 'hello:gethello', 10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
17
database/seeders/AddAfterSyncHelloSubscriber.php
Normal file
17
database/seeders/AddAfterSyncHelloSubscriber.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Component\Seeders;
|
||||||
|
|
||||||
|
use App\Models\Subscriber;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
class AddAfterSyncHelloSubscriber extends Seeder {
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function run() {
|
||||||
|
Subscriber::add('sync:gethello', 'v1:getbot', 10);
|
||||||
|
}
|
||||||
|
}
|
||||||
23
database/seeders/AddClientGroup.php
Normal file
23
database/seeders/AddClientGroup.php
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Component\Seeders;
|
||||||
|
|
||||||
|
use App\Component\Models\ClientsGroup;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
|
class AddClientGroup extends Seeder {
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function run() {
|
||||||
|
if (ClientsGroup::where('code', '0')->count() == 0) {
|
||||||
|
$group = new ClientsGroup([
|
||||||
|
'code' => '0',
|
||||||
|
'name' => 'Без группы',
|
||||||
|
]);
|
||||||
|
$group->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace Database\Component\Seeders;
|
|
||||||
|
|
||||||
use App\Models\Right;
|
|
||||||
use Illuminate\Database\Seeder;
|
|
||||||
|
|
||||||
class AddTestRight extends Seeder
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the database seeds.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function run()
|
|
||||||
{
|
|
||||||
Right::add('test', 'Тестовый раздел');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
16
models/Client.php
Normal file
16
models/Client.php
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Client extends Model {
|
||||||
|
protected $table = 'clients';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get clients phone.
|
||||||
|
*/
|
||||||
|
public function clientPhone() {
|
||||||
|
return $this->hasOne('App\Component\Models\ClientsPhone', 'client_guid', 'user_code');
|
||||||
|
}
|
||||||
|
}
|
||||||
9
models/ClientsAddress.php
Normal file
9
models/ClientsAddress.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class ClientsAddress extends Model {
|
||||||
|
protected $table = 'clients_addreses';
|
||||||
|
}
|
||||||
9
models/ClientsBarcode.php
Normal file
9
models/ClientsBarcode.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class ClientsBarcode extends Model {
|
||||||
|
protected $table = 'clients_barcodes';
|
||||||
|
}
|
||||||
9
models/ClientsEmail.php
Normal file
9
models/ClientsEmail.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class ClientsEmail extends Model {
|
||||||
|
protected $table = 'clients_email';
|
||||||
|
}
|
||||||
9
models/ClientsGroup.php
Normal file
9
models/ClientsGroup.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class ClientsGroup extends Model {
|
||||||
|
protected $table = 'client_groups';
|
||||||
|
}
|
||||||
16
models/ClientsPhone.php
Normal file
16
models/ClientsPhone.php
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class ClientsPhone extends Model {
|
||||||
|
protected $table = 'clients_phone';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get clients.
|
||||||
|
*/
|
||||||
|
public function client() {
|
||||||
|
return $this->hasOne('App\Component\Models\Clients', 'user_code', 'client_guid');
|
||||||
|
}
|
||||||
|
}
|
||||||
9
models/Dishes.php
Normal file
9
models/Dishes.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Dishes extends Model {
|
||||||
|
protected $table = 'dishes';
|
||||||
|
}
|
||||||
9
models/Fiscal.php
Normal file
9
models/Fiscal.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Fiscal extends Model {
|
||||||
|
protected $table = 'fiscals';
|
||||||
|
}
|
||||||
9
models/Folders.php
Normal file
9
models/Folders.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Folders extends Model {
|
||||||
|
protected $table = 'folders';
|
||||||
|
}
|
||||||
9
models/OnlineItems.php
Normal file
9
models/OnlineItems.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class OnlineItems extends Model {
|
||||||
|
protected $table = 'shift_online_items';
|
||||||
|
}
|
||||||
9
models/Orders.php
Normal file
9
models/Orders.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Orders extends Model {
|
||||||
|
protected $table = 'orderbot_storage';
|
||||||
|
}
|
||||||
9
models/Printer.php
Normal file
9
models/Printer.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Printer extends Model {
|
||||||
|
protected $table = 'printers';
|
||||||
|
}
|
||||||
9
models/PrinterSettings.php
Normal file
9
models/PrinterSettings.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class PrinterSettings extends Model {
|
||||||
|
protected $table = 'printer_settings';
|
||||||
|
}
|
||||||
9
models/Report.php
Normal file
9
models/Report.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Report extends Model {
|
||||||
|
protected $table = 'report_history';
|
||||||
|
}
|
||||||
19
models/Right.php
Normal file
19
models/Right.php
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Right extends Model {
|
||||||
|
protected $table = 'rights';
|
||||||
|
|
||||||
|
public static function add($code, $name) {
|
||||||
|
if (Right::where('code', $code)->count() == 0) {
|
||||||
|
$right = new Right([
|
||||||
|
'code' => $code,
|
||||||
|
'name' => $name,
|
||||||
|
]);
|
||||||
|
$right->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
9
models/Settings.php
Normal file
9
models/Settings.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Settings extends Model {
|
||||||
|
protected $table = 'settings';
|
||||||
|
}
|
||||||
9
models/Shifts.php
Normal file
9
models/Shifts.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Shifts extends Model {
|
||||||
|
protected $table = 'exchange_shifts';
|
||||||
|
}
|
||||||
9
models/Tasks.php
Normal file
9
models/Tasks.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Tasks extends Model {
|
||||||
|
protected $table = 'terminals_update';
|
||||||
|
}
|
||||||
9
models/Terminal.php
Normal file
9
models/Terminal.php
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Component\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Terminal extends Model {
|
||||||
|
protected $table = 'terminals';
|
||||||
|
}
|
||||||
@@ -4,6 +4,6 @@ namespace App\Component\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
class Test extends Model {
|
class User extends Model {
|
||||||
protected $table = 'test';
|
protected $table = 'users';
|
||||||
}
|
}
|
||||||
5
module.ini
Normal file
5
module.ini
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[info]
|
||||||
|
name=V1
|
||||||
|
version=1.2
|
||||||
|
[build]
|
||||||
|
version=1.2
|
||||||
25
web/controllers/reimport.js
Normal file
25
web/controllers/reimport.js
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
(function () {
|
||||||
|
'use strict';
|
||||||
|
angular
|
||||||
|
.module('app')
|
||||||
|
.controller('ReImportCtrl', ReImportCtrl);
|
||||||
|
|
||||||
|
TestHelloCtrl.$inject = ['$scope', 'smartRequest', '$location', 'Notification'];
|
||||||
|
function TestHelloCtrl($scope, smartRequest, $location, Notification) {
|
||||||
|
$scope.orders = [];
|
||||||
|
$scope.total = [];
|
||||||
|
|
||||||
|
$scope.getOrders = function () {
|
||||||
|
smartRequest.get('v1/hello?start_date=' + encodeURIComponent($scope.start_date) + '&end_date=' + encodeURIComponent($scope.end_date), function (data) {
|
||||||
|
$scope.orders = data.orders;
|
||||||
|
$scope.total = data.total;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.update = function () {
|
||||||
|
$scope.getOrders();
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.update();
|
||||||
|
}
|
||||||
|
})();
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
(function () {
|
|
||||||
'use strict';
|
|
||||||
angular
|
|
||||||
.module('app')
|
|
||||||
.controller('TestHelloCtrl', TestHelloCtrl);
|
|
||||||
|
|
||||||
TestHelloCtrl.$inject = ['$scope', 'smartRequest', '$location', 'Notification'];
|
|
||||||
function TestHelloCtrl($scope, smartRequest, $location, Notification) {
|
|
||||||
$scope.users = [];
|
|
||||||
|
|
||||||
$scope.getUsers = function () {
|
|
||||||
smartRequest.get('php/hello', function (data) {
|
|
||||||
$scope.users = data.users;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.update = function () {
|
|
||||||
$scope.getUsers();
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.update();
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
group_name: 'Разработка',
|
|
||||||
item: [
|
|
||||||
{
|
|
||||||
name: 'Тест',
|
|
||||||
acl: 'test',
|
|
||||||
icon: 'code',
|
|
||||||
order: 0,
|
|
||||||
items: [
|
|
||||||
{
|
|
||||||
name: 'Hello',
|
|
||||||
acl: 'test',
|
|
||||||
url: 'app.test.hello',
|
|
||||||
icon: 'line_style',
|
|
||||||
count: 0,
|
|
||||||
order: 1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
];
|
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
code: 'app.test.hello',
|
code: 'app.v1.reimport',
|
||||||
url: '/test/hello',
|
url: '/v1/reimport',
|
||||||
templateUrl: '../views/test_hello.html',
|
templateUrl: '../views/reimport.html',
|
||||||
data: { title : 'Hello' },
|
data: { title : 'Повторная выгрузка' },
|
||||||
controller: 'TestHelloCtrl',
|
controller: 'ReImportCtrl',
|
||||||
resolve: ['scripts/controllers/test_hello.js']
|
resolve: ['scripts/controllers/reimport.js']
|
||||||
}
|
}
|
||||||
51
web/views/out.html
Normal file
51
web/views/out.html
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<div class="modal-dialog modal-lg">
|
||||||
|
<div class="modal-content" id="reportOut">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||||
|
<button class="btn btn-icon white" ng-click="printElem('#reportOut')">
|
||||||
|
<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="box">
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-bordered table-hover m-a-0">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="width: 10%;vertical-align : middle;text-align:center;" rowspan="2">Номер заказа</th>
|
||||||
|
<th style="width: 80%;vertical-align : middle;text-align:center;" colspan="4">Товар</th>
|
||||||
|
<th style="width: 10%;vertical-align : middle;text-align:center;" rowspan="2">Общ. итог</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Наим.</th>
|
||||||
|
<th>Кол-во</th>
|
||||||
|
<th>Цена</th>
|
||||||
|
<th>Итог</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody ng-repeat="order in orders">
|
||||||
|
<tr ng-repeat="item in order.items">
|
||||||
|
<td ng-if="$index == 0" style="vertical-align : middle;text-align:center;" rowspan={{order.items_count}}>{{item.id}}</td>
|
||||||
|
<td>{{item.name}}</td>
|
||||||
|
<td>{{item.count}}</td>
|
||||||
|
<td>{{item.price}}</td>
|
||||||
|
<td>{{item.full_price}} </td>
|
||||||
|
<td ng-if="$index == 0" style="vertical-align : middle;text-align:center;" rowspan={{order.items_count}}> {{order.price}} </td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
<thead>
|
||||||
|
<th colspan="6">Всего заказов: {{total.total_count}}</th>
|
||||||
|
</thead>
|
||||||
|
<thead>
|
||||||
|
<th colspan="6">Итого: {{total.total_price | curr}} BYN</th>
|
||||||
|
</thead>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
80
web/views/reimport.html
Normal file
80
web/views/reimport.html
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
<div class="padding">
|
||||||
|
<div class="box">
|
||||||
|
<div class="padding">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="single">Выберите даты для повторной выгрузки реализаций</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>С</label>
|
||||||
|
<div class='input-group date' ui-jp="datetimepicker" ui-options="{
|
||||||
|
format: 'DD.MM.YYYY',
|
||||||
|
icons: {
|
||||||
|
time: 'fa fa-clock-o',
|
||||||
|
date: 'fa fa-calendar',
|
||||||
|
up: 'fa fa-chevron-up',
|
||||||
|
down: 'fa fa-chevron-down',
|
||||||
|
previous: 'fa fa-chevron-left',
|
||||||
|
next: 'fa fa-chevron-right',
|
||||||
|
today: 'fa fa-screenshot',
|
||||||
|
clear: 'fa fa-trash',
|
||||||
|
close: 'fa fa-remove'
|
||||||
|
}
|
||||||
|
}">
|
||||||
|
<input type='text' class="form-control" ng-model="start_date" />
|
||||||
|
<span class="input-group-addon">
|
||||||
|
<i class="material-icons"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label>По</label>
|
||||||
|
<div class='input-group date' ui-jp="datetimepicker" ui-options="{
|
||||||
|
format: 'DD.MM.YYYY',
|
||||||
|
icons: {
|
||||||
|
time: 'fa fa-clock-o',
|
||||||
|
date: 'fa fa-calendar',
|
||||||
|
up: 'fa fa-chevron-up',
|
||||||
|
down: 'fa fa-chevron-down',
|
||||||
|
previous: 'fa fa-chevron-left',
|
||||||
|
next: 'fa fa-chevron-right',
|
||||||
|
today: 'fa fa-screenshot',
|
||||||
|
clear: 'fa fa-trash',
|
||||||
|
close: 'fa fa-remove'
|
||||||
|
}
|
||||||
|
}">
|
||||||
|
<input type='text' class="form-control" ng-model="end_date" />
|
||||||
|
<span class="input-group-addon">
|
||||||
|
<i class="material-icons"></i>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<button class="btn info btn-block" ng-click="createReport()">Выполнить повторную выгрузку
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="/libs/js/moment/locale/ru.js"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$('.date').on('dp.change', function () {
|
||||||
|
$(this).find('input').trigger('change');
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
<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="box">
|
|
||||||
<div class="table-responsive">
|
|
||||||
<table class="table table-bordered m-a-0">
|
|
||||||
<thead>
|
|
||||||
<th style="width: 20%">#</th>
|
|
||||||
<th style="width: 80%">Имя</th>
|
|
||||||
</thead>
|
|
||||||
|
|
||||||
<tbody>
|
|
||||||
<tr ng-repeat="user in users">
|
|
||||||
<td>{{ user.id }}</td>
|
|
||||||
<td>{{ user.name }}</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
Reference in New Issue
Block a user