Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 3.148.231.77
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
wb /
templates /
analytics /
Delete
Unzip
Name
Size
Permission
Date
Action
index.html.twig
52.89
KB
-rw-rw-r--
2023-08-29 09:17
pagination.html.twig
2.95
KB
-rw-rw-r--
2022-12-25 13:44
Save
Rename
{% extends 'layouts/main-layout.html.twig' %} {% block content %} <!-- Content Wrapper. Contains page content --> <div class="content-wrapper" style="margin-left:0 !important;"> <!-- Content Header (Page header) --> <section class="content-header"> <div class="container-fluid"> <div class="row mb-2"> <div class="col-sm-6"> <h1>WB аналитика</h1> </div> <div class="col-sm-6"> <ol class="breadcrumb float-sm-right"> <li class="breadcrumb-item"><a href="/lk/analytics">Главная страница</a></li> <li class="breadcrumb-item active">WB</li> </ol> </div> </div> </div><!-- /.container-fluid --> </section> <!-- Main content --> <section class="content"> <div class="container-fluid"> <div class="row"> <div class="col-lg-3 col-6"> <div class="small-box bg-warning gray-light"> <div class="inner"><h3 style="font-size: 1.5rem;">Наличие на складах</h3></div> <div class="card-footer">{{ sum_amount }} шт.</div> </div> </div> <div class="col-lg-3 col-6"> <div class="small-box bg-warning green-light"> <div class="inner"><h3 style="font-size: 1.5rem;">Денег в товарах</h3></div> <div class="card-footer">{{ all_money_in_good }} ₽</div> </div> </div> <div class="col-lg-3 col-6"> <div class="small-box bg-warning yellow-light"> <div class="inner"><h3 style="font-size: 1.5rem;">Потенциальная чистая прибыль</h3></div> <div class="card-footer">{{ sum_free_fee_all }} ₽</div> </div> </div> <div class="col-lg-3 col-6"> <div class="small-box bg-warning red-light"> <div class="inner"><h3 style="font-size: 1.5rem;">Чистая прибыль</h3></div> <div class="icon"><i class="ion ion-alert-circle"></i></div> <div class="card-footer">{{ sum_free_fee_from_all }} ₽</div> </div> </div> </div> <div class="row"> <div class="col-md-12"> <div class="card"> <div class="card-body"> <form method="get" action="" id="filter-form"> <div class="row"> <div class="col-md-2"> Найдено товаров: <strong>{{ items }}</strong><br> Данные: <strong>с {{ data_from }} по {{ data_to }}</strong> </div> <div class="col-md-4"> <button type="button" class="btn btn-primary {% if date == '30days' %}btn-dark{% endif %}" onclick="location.href='/lk/analytics?date=30days'">30 дней</button> <button type="button" class="btn btn-primary {% if date == 'now' %}btn-dark{% endif %}" onclick="location.href='/lk/analytics?date=now'">Сегодня</button> <button type="button" class="btn btn-primary {% if date == 'yerstaday' %}btn-dark{% endif %}" onclick="location.href='/lk/analytics?date=yerstaday'">Вчера</button> <button type="button" class="btn btn-primary {% if date == '7days' %}btn-dark{% endif %}" onclick="location.href='/lk/analytics?date=7days'">7 дней</button> {#<button type="button" id="custom_date_btn" class="btn btn-primary {% if custom_date is not empty %}btn-dark{% endif %}">Выбрать дату</button>#} <br><label for="custom_date">Задать дату:</label> <input type="text" class="form-control mt-2" name="custom_date" id="custom_date" style="width: 40%; display: inline-block"> {# <button type="button" class="btn btn-primary" id="custom_date_btn" style="position: relative; top: -2px;">Выбрать</button>#} </div> <div class="col-md-2"> Бренд <select class="form-control select2" name="brand" style="width: 100%;" onchange="$('#filter-form').submit()"> <option value="" selected="selected">Все</option> {% for brand in brands %} <option value="{{ brand }}" {% if current_brand == brand %}selected="selected"{% endif %}>{{ brand }}</option> {% endfor %} </select> </div> <div class="col-md-2"> Склады <select class="form-control select2" name="warehouse" style="width: 100%;" onchange="$('#filter-form').submit()"> <option value="" selected="selected">Все</option> {% for warehouse in warehouses %} <option value="{{ warehouse }}" {% if current_warehouse == warehouse %}selected="selected"{% endif %}>{{ warehouse }}</option> {% endfor %} </select> </div> <div class="col-md-2 pt-4 text-right"> <a href="/lk/analytics?xls=Y" target="_blank" class="btn btn-primary">XLS</a> </div> </div> <div class=""><a href="javascript:void(0)" id="show-filter">Показать фильтр</a></div> <div class="filter-block {{ filter_show }}"> <div class="row"> <div class="col-md-3"> <div class="form-group row"> <div class="col"> <label for="our_rate">Рейтинг:</label> <select class="form-control select2" name="our_rate" style="width: 70%;"> <option value="" selected="selected">Все</option> <option value="A" {% if our_rate == 'A' %}selected="selected"{% endif %}>A</option> <option value="A-B" {% if our_rate == 'A-B' %}selected="selected"{% endif %}>A-B</option> <option value="A-C" {% if our_rate == 'A-C' %}selected="selected"{% endif %}>A-C</option> <option value="B-C" {% if our_rate == 'B-C' %}selected="selected"{% endif %}>B-C</option> <option value="C" {% if our_rate == 'C' %}selected="selected"{% endif %}>C</option> </select> </div> </div> </div> <div class="col-md-3"> <div class="form-group row"> <div class="col"> <label for="filter_price_from">Наличие, от:</label> <input type="text" class="form-control mb-2" name="filter_quantity_from" value="{{ filter_quantity_from }}"> </div> <div class="col"> <label for="filter_price_to">Наличие, до:</label> <input type="text" class="form-control mb-2" name="filter_quantity_to" value="{{ filter_quantity_to }}"> </div> </div> </div> <div class="col-md-3"> <div class="form-group row"> <div class="col"> <label for="filter_price_from">Рыночная цена, от:</label> <input type="text" class="form-control mb-2" name="filter_price_from" value="{{ filter_price_from }}"> </div> <div class="col"> <label for="filter_price_to">Рыночная цена, до:</label> <input type="text" class="form-control mb-2" name="filter_price_to" value="{{ filter_price_to }}"> </div> </div> </div> <div class="col-md-3"> <div class="form-group row green-light"> <div class="col"> <label for="filter_money_in_good_from">Денег в товаре, от:</label> <input type="text" class="form-control mb-2" name="filter_money_in_good_from" value="{{ filter_money_in_good_from }}"> </div> <div class="col"> <label for="filter_money_in_good_to">Денег в товаре, до:</label> <input type="text" class="form-control mb-2" name="filter_money_in_good_to" value="{{ filter_money_in_good_to }}"> </div> </div> </div> </div> <div class="row"> <div class="col-md-3"> <div class="form-group row yellow-light"> <div class="col"> <label for="filter_free_fee_one_from">ПЧП с 1 ед., от:</label> <input type="text" class="form-control mb-2" name="filter_free_fee_one_from" value="{{ filter_free_fee_one_from }}"> </div> <div class="col"> <label for="filter_free_fee_one_to">ПЧП с 1 ед., до:</label> <input type="text" class="form-control mb-2" name="filter_free_fee_one_to" value="{{ filter_free_fee_one_to }}"> </div> </div> </div> <div class="col-md-3"> <div class="form-group row yellow-light"> <div class="col"> <label for="filter_free_fee_all_from">ПЧП с товара, от:</label> <input type="text" class="form-control mb-2" name="filter_free_fee_all_from" value="{{ filter_free_fee_all_from }}"> </div> <div class="col"> <label for="filter_free_fee_all_to">ПЧП с товара, до:</label> <input type="text" class="form-control mb-2" name="filter_free_fee_all_to" value="{{ filter_free_fee_all_to }}"> </div> </div> </div> <div class="col-md-3"> <div class="form-group row"> <div class="col"> <label for="filter_medium_buy_from">Средний выкуп, от:</label> <input type="text" class="form-control mb-2" name="filter_medium_buy_from" value="{{ filter_medium_buy_from }}"> </div> <div class="col"> <label for="filter_medium_buy_to">Средний выкуп, до:</label> <input type="text" class="form-control mb-2" name="filter_medium_buy_to" value="{{ filter_medium_buy_to }}"> </div> </div> </div> <div class="col-md-3"> <div class="form-group row"> <div class="col"> <label for="filter_cost_price_from">Себестоимость, от:</label> <input type="text" class="form-control mb-2" name="filter_cost_price_from" value="{{ filter_cost_price_from }}"> </div> <div class="col"> <label for="filter_cost_price_to">Себестоимость, до:</label> <input type="text" class="form-control mb-2" name="filter_cost_price_to" value="{{ filter_cost_price_to }}"> </div> </div> </div> </div> <div class="row"> <div class="col-md-3"> <div class="form-group row red-light"> <div class="col"> <label for="filter_number_sale_from">Выкуплено товара, от:</label> <input type="text" class="form-control mb-2" name="filter_number_sale_from" value="{{ filter_number_sale_from }}"> </div> <div class="col"> <label for="filter_number_sale_to">Выкуплено товара, до:</label> <input type="text" class="form-control mb-2" name="filter_number_sale_to" value="{{ filter_number_sale_to }}"> </div> </div> </div> <div class="col-md-3"> <div class="form-group row red-light"> <div class="col"> <label for="filter_number_sale_price_from">Средняя цена, от:</label> <input type="text" class="form-control mb-2" name="filter_number_sale_price_from" value="{{ filter_number_sale_price_from }}"> </div> <div class="col"> <label for="filter_number_sale_price_to">Средняя цена, до:</label> <input type="text" class="form-control mb-2" name="filter_number_sale_price_to" value="{{ filter_number_sale_price_to }}"> </div> </div> </div> <div class="col-md-3"> <div class="form-group row red-light"> <div class="col"> <label for="filter_fee_from">Выручка, от:</label> <input type="text" class="form-control mb-2" name="filter_fee_from" value="{{ filter_fee_from }}"> </div> <div class="col"> <label for="filter_fee_to">Выручка, до:</label> <input type="text" class="form-control mb-2" name="filter_fee_to" value="{{ filter_fee_to }}"> </div> </div> </div> <div class="col-md-3"> <div class="form-group row red-light"> <div class="col"> <label for="filter_free_fee_from_one_from">ЧП с 1 ед., от:</label> <input type="text" class="form-control mb-2" name="filter_free_fee_from_one_from" value="{{ filter_free_fee_from_one_from }}"> </div> <div class="col"> <label for="filter_free_fee_from_one_to">ЧП с 1 ед., до:</label> <input type="text" class="form-control mb-2" name="filter_free_fee_from_one_to" value="{{ filter_free_fee_from_one_to }}"> </div> </div> </div> </div> <div class="row"> <div class="col-md-3"> <div class="form-group row red-light"> <div class="col"> <label for="filter_free_fee_from_all_from">ЧП с товара, от:</label> <input type="text" class="form-control mb-2" name="filter_free_fee_from_all_from" value="{{ filter_free_fee_from_all_from }}"> </div> <div class="col"> <label for="filter_free_fee_from_all_to">ЧП с товара, до:</label> <input type="text" class="form-control mb-2" name="filter_free_fee_from_all_to" value="{{ filter_free_fee_from_all_to }}"> </div> </div> </div> <div class="col-md-7"> </div> <div class="col-md-2 pt-4 text-right"> <input type="reset" class="btn btn-info" name="reset" value="Сбросить"> <input type="submit" class="btn btn-primary" name="filter" value="Фильтровать"> </div> </div> </div> </form> </div> </div> </div> </div> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-body table-responsive-sm p-0"> <table class="table table-hover text-nowrap"> <thead> <tr> <th title="Фирменный ABC">Рейтинг <a href="{{ path('analytics', {sortBy: 'our_rate', sortType: 'asc'}) }}" class="fa fa-arrow{% if sortBy=='our_rate' and sortType=='asc' %}-circle{% endif %}-up"></a> <a href="{{ path('analytics', {sortBy: 'our_rate', sortType: 'desc'}) }}" class="fa fa-arrow{% if sortBy=='our_rate' and sortType=='desc' %}-circle{% endif %}-down"></a></th> <th>Фото</th> <th title="Название Товара, Бренд, SKU, Артикул WB, ссылка на WB, Рейтинг WB">Товар</th> <th style="width:50px;word-wrap: break-word;white-space: initial !important;" title="Остатки товара (штрихкод), с дифференциацией по складам">Наличие на складах <a href="{{ path('analytics', {sortBy: 'amount', sortType: 'asc'}) }}" class="fa fa-arrow{% if sortBy=='amount' and sortType=='asc' %}-circle{% endif %}-up"></a> <a href="{{ path('analytics', {sortBy: 'amount', sortType: 'desc'}) }}" class="fa fa-arrow{% if sortBy=='amount' and sortType=='desc' %}-circle{% endif %}-down"></a></th> <th style="width:50px;word-wrap: break-word;white-space: initial !important;" title="Рыночная цена после скидки на данный момент">Рыночная цена <a href="{{ path('analytics', {sortBy: 'price', sortType: 'asc'}) }}" class="fa fa-arrow{% if sortBy=='price' and sortType=='asc' %}-circle{% endif %}-up"></a> <a href="{{ path('analytics', {sortBy: 'price', sortType: 'desc'}) }}" class="fa fa-arrow{% if sortBy=='price' and sortType=='desc' %}-circle{% endif %}-down"></a></th> <th style="width:50px;word-wrap: break-word;white-space: initial !important;" title="Денег в товаре на данный момент">Денег в товаре <a href="{{ path('analytics', {sortBy: 'money_in_good', sortType: 'asc'}) }}" class="fa fa-arrow{% if sortBy=='money_in_good' and sortType=='asc' %}-circle{% endif %}-up"></a> <a href="{{ path('analytics', {sortBy: 'money_in_good', sortType: 'desc'}) }}" class="fa fa-arrow{% if sortBy=='money_in_good' and sortType=='desc' %}-circle{% endif %}-down"></a></th> <th style="width:50px;word-wrap: break-word;white-space: initial !important;" title="Потенциальная чистая прибыль с одной единицы товара при текущей рыночной цене">ПЧП с 1 ед. <a href="{{ path('analytics', {sortBy: 'free_fee_one', sortType: 'asc'}) }}" class="fa fa-arrow{% if sortBy=='free_fee_one' and sortType=='asc' %}-circle{% endif %}-up"></a> <a href="{{ path('analytics', {sortBy: 'free_fee_one', sortType: 'desc'}) }}" class="fa fa-arrow{% if sortBy=='free_fee_one' and sortType=='desc' %}-circle{% endif %}-down"></a></th> <th style="width:50px;word-wrap: break-word;white-space: initial !important;" title="Потенциальная чистая прибыль со всего товара в наличии товара при текущей рыночной цене">ПЧП с товара <a href="{{ path('analytics', {sortBy: 'free_fee_all', sortType: 'asc'}) }}" class="fa fa-arrow{% if sortBy=='free_fee_all' and sortType=='asc' %}-circle{% endif %}-up"></a> <a href="{{ path('analytics', {sortBy: 'free_fee_all', sortType: 'desc'}) }}" class="fa fa-arrow{% if sortBy=='free_fee_all' and sortType=='desc' %}-circle{% endif %}-down"></a></th> <th style="width:50px;word-wrap: break-word;white-space: initial !important;" title="Процент выкупа товаров по данным WB">Средний выкуп <a href="{{ path('analytics', {sortBy: 'medium_buy', sortType: 'asc'}) }}" class="fa fa-arrow{% if sortBy=='medium_buy' and sortType=='asc' %}-circle{% endif %}-up"></a> <a href="{{ path('analytics', {sortBy: 'medium_buy', sortType: 'desc'}) }}" class="fa fa-arrow{% if sortBy=='medium_buy' and sortType=='desc' %}-circle{% endif %}-down"></a></th> <th style="width:50px;word-wrap: break-word;white-space: initial !important;" title="Себестоимость">Себестоимость <a href="{{ path('analytics', {sortBy: 'cost_price', sortType: 'asc'}) }}" class="fa fa-arrow{% if sortBy=='cost_price' and sortType=='asc' %}-circle{% endif %}-up"></a> <a href="{{ path('analytics', {sortBy: 'cost_price', sortType: 'desc'}) }}" class="fa fa-arrow{% if sortBy=='cost_price' and sortType=='desc' %}-circle{% endif %}-down"></a></th> <th style="width:50px;word-wrap: break-word;white-space: initial !important;" title="Общее количеств о выкупов по всему товару за выбранный период (все размеры и склады)">Выкуплено товара <a href="{{ path('analytics', {sortBy: 'number_sale', sortType: 'asc'}) }}" class="fa fa-arrow{% if sortBy=='number_sale' and sortType=='asc' %}-circle{% endif %}-up"></a> <a href="{{ path('analytics', {sortBy: 'number_sale', sortType: 'desc'}) }}" class="fa fa-arrow{% if sortBy=='number_sale' and sortType=='desc' %}-circle{% endif %}-down"></a></th> <th style="width:50px;word-wrap: break-word;white-space: initial !important;" title="Средняя цена одной продажи за выбранный период">Средняя цена <a href="{{ path('analytics', {sortBy: 'number_sale_price', sortType: 'asc'}) }}" class="fa fa-arrow{% if sortBy=='number_sale_price' and sortType=='asc' %}-circle{% endif %}-up"></a> <a href="{{ path('analytics', {sortBy: 'number_sale_price', sortType: 'desc'}) }}" class="fa fa-arrow{% if sortBy=='number_sale_price' and sortType=='desc' %}-circle{% endif %}-down"></a></th> <th style="width:50px;word-wrap: break-word;white-space: initial !important;" title="Сумма выкупов по всему товару за выбранный период (все размеры и склады)">Выручка <a href="{{ path('analytics', {sortBy: 'fee', sortType: 'asc'}) }}" class="fa fa-arrow{% if sortBy=='fee' and sortType=='asc' %}-circle{% endif %}-up"></a> <a href="{{ path('analytics', {sortBy: 'fee', sortType: 'desc'}) }}" class="fa fa-arrow{% if sortBy=='fee' and sortType=='desc' %}-circle{% endif %}-down"></a></th> <th style="width:50px;word-wrap: break-word;white-space: initial !important;" title="Чистая прибыль с одной единицы проданного товара в среднем за выбранный период)">ЧП с 1 ед. <a href="{{ path('analytics', {sortBy: 'free_fee_from_one', sortType: 'asc'}) }}" class="fa fa-arrow{% if sortBy=='free_fee_from_one' and sortType=='asc' %}-circle{% endif %}-up"></a> <a href="{{ path('analytics', {sortBy: 'free_fee_from_one', sortType: 'desc'}) }}" class="fa fa-arrow{% if sortBy=='free_fee_from_one' and sortType=='desc' %}-circle{% endif %}-down"></a></th> <th style="width:50px;word-wrap: break-word;white-space: initial !important;" title="Чистая прибыль со всего проданного товара за выбранный период">ЧП с товара <a href="{{ path('analytics', {sortBy: 'free_fee_from_all', sortType: 'asc'}) }}" class="fa fa-arrow{% if sortBy=='free_fee_from_all' and sortType=='asc' %}-circle{% endif %}-up"></a> <a href="{{ path('analytics', {sortBy: 'free_fee_from_all', sortType: 'desc'}) }}" class="fa fa-arrow{% if sortBy=='free_fee_from_all' and sortType=='desc' %}-circle{% endif %}-down"></a></th> {# <th>free_fee_from_all</th> <th>sum_free_fee_all_part</th> <th>part_amount</th> #} <th title="">Динамика продаж</th> </tr> </thead> <tbody> <tr> {% if cards is not empty %} {% for card in cards %} <td>{{ card.our_rate }}</td> <td> {% if card.img is not empty %} <img width="100" alt="" src="{{ card.img }}" /> {% endif %} </td> <td> <div ><b>{{ card.object }}</b></div> <div ><b>Бренд:</b> {{ card.brand }}</div> <div ><b>Артикул:</b> <a target="_blank" class="wb-link" href="https://www.wildberries.ru/catalog/{{ card.nmID }}/detail.aspx">{{ card.nmID }}</a></div> <div ><b>Рейтинг WB: {{ card.wb_rating }}</b></div> </td> <td><a href="javascript:void(0)" class="show_stocks_list"><strong>{{ card.amount }} шт.</strong></a> <div class="stocks_list"> {% for stock in card.amountStocks %} {% if stock.quantity %} {{ stock.quantity }} шт.<br> {{ stock.warehouse_name }}<br> {% if stock.tech_size is not empty %}{{ stock.tech_size }}<br>{% endif %} <div id="ajax-edit-comm-{{ stock.id }}">Комм(%): {{ stock.commision }} <a href="#" class="ajax-edit-comm" data-id="{{ stock.id }}" data-price="{{ stock.commision }}"><i class="fa fa-edit"></i></a></div> <div id="ajax-edit-log-{{ stock.id }}">Логис(р): {{ stock.logistics }} <a href="#" class="ajax-edit-log" data-id="{{ stock.id }}" data-price="{{ stock.logistics }}"><i class="fa fa-edit"></i></a></div> <br><br> {% endif %} {% endfor %} </div> </td> <td>{{ card.price }} ₽</td> <td class="green-light">{{ card.money_in_good }} ₽</td> <td class="yellow-light">{{ card.free_fee_one }} ₽</td> <td class="yellow-light">{{ card.free_fee_all }} ₽</td> <td>{{ card.medium_buy }}</td> <td id="ajax-edit-cost-{{ card.id }}">{{ card.cost_price }} ₽ <a href="#" class="ajax-edit-cost" data-id="{{ card.id }}" data-price="{{ card.cost_price }}"><i class="fa fa-edit"></i></a></td> <td class="red-light">{{ card.number_sale }}</td> <td class="red-light">{{ card.number_sale_price }} ₽</td> <td class="red-light">{{ card.fee }} ₽</td> <td class="red-light">{{ card.free_fee_from_one }} ₽</td> <td class="red-light">{{ card.free_fee_from_all }} ₽</td> {#<td>{{ card.sum_free_fee_all_part }}</td> <td>{{ card.part_amount }}</td> <td>{{ card.sum_two }}</td> #} <td> <div class="chart" data-id="{{ card.id }}" data-date="{% if date %}{{ date }}{% endif %}"> <canvas class="lineChart_{{ card.nmID }}" style="min-height: 150px; height: 150px; max-height: 150px; max-width: 100%;"></canvas> </div> </td> </tr> {% endfor %} {% endif %} </tbody> </table> </div> <!-- /.card-body --> <div class="card-footer clearfix"> {{ knp_pagination_render(cards, 'analytics/pagination.html.twig') }} </div> {# <div class="card-footer clearfix"> <ul class="pagination pagination-sm m-0 float-right"> <li class="page-item"><a class="page-link" href="#">«</a></li> <li class="page-item"><a class="page-link" href="#">1</a></li> <li class="page-item"><a class="page-link" href="#">2</a></li> <li class="page-item"><a class="page-link" href="#">3</a></li> <li class="page-item"><a class="page-link" href="#">»</a></li> </ul> </div> #} </div> <!-- /.card --> </div> </div> </div> </section> <!-- /.content --> </div> <!-- /.content-wrapper --> <div class="modal" id="chartModal" tabindex="-1" style="max-width: 80%"> <div class="modal-dialog" role="document" style="max-width: 80%"> <div class="modal-content"> <div class="modal-header"> <h5 class="modal-title"></h5> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> <div class="modal-body"> <div class="chart-modal"> <canvas class="lineChart_modal" style="min-height: 150px; height: 500px; max-height: 400px; width: 800px; max-width: 100%;"></canvas> </div> </div> </div> </div> </div> {% endblock content %} {% block javascript_bottom %} {{ parent() }} <script> $(function () { /* ChartJS * ------- * Here we will create a few charts using ChartJS */ var areaChartData = { labels : [{{ graph_dates|raw }}], datasets: [ { label : 'Наличие на складах', backgroundColor : 'rgba(10,10,188,1)', borderColor : 'rgba(10,10,188,1)', pointRadius : false, pointColor : '#3b8bba', pointStrokeColor : 'rgba(10,10,188,1)', pointHighlightFill : '#fff', pointHighlightStroke: 'rgba(220,220,220,1)', data : [] }, { label : 'Рыночная цена', backgroundColor : 'rgba(210, 214, 222, 1)', borderColor : 'rgba(210, 214, 222, 1)', pointRadius : false, pointColor : 'rgba(210, 214, 222, 1)', pointStrokeColor : '#c1c7d1', pointHighlightFill : '#fff', pointHighlightStroke: 'rgba(220,220,220,1)', data : [] }, { label : 'Выкуплено товара', backgroundColor : 'rgba(10, 214, 10, 1)', borderColor : 'rgba(10, 214, 10, 1)', pointRadius : false, pointColor : 'rgba(10, 214, 10, 1)', pointStrokeColor : '#c1c7d1', pointHighlightFill : '#fff', pointHighlightStroke: 'rgba(220,220,220,1)', data : [] }, ] } var areaChartOptions = { maintainAspectRatio : false, responsive : true, legend: { display: false }, scales: { xAxes: [{ gridLines : { display : false, } }], yAxes: [{ gridLines : { display : false, } }] } } //------------- //- LINE CHART - //-------------- {% if cards is not empty %} {% for card in cards %} var lineChartCanvas = $('.lineChart_{{ card.nmID }}').get(0).getContext('2d') var lineChartOptions = $.extend(true, {}, areaChartOptions) var lineChartData = $.extend(true, {}, areaChartData) lineChartData.datasets[0].fill = false; lineChartData.datasets[1].fill = false; lineChartData.datasets[2].fill = false; lineChartData.datasets[0]['data'] = [{{ stock_quantity_full[card.nmID]|raw }}]; lineChartData.datasets[1]['data'] = [{{ stock_price[card.nmID]|raw }}]; lineChartData.datasets[2]['data'] = [{{ number_sale[card.nmID]|raw }}]; lineChartOptions.datasetFill = false var lineChart = new Chart(lineChartCanvas, { type: 'line', data: lineChartData, options: lineChartOptions }) {% endfor %} {% endif %} $(document).on('click', '.chart', function() { let id = $(this).data('id') let data_date = $(this).data('date') let url = '/lk/analytics/chart/'+id let getdata = 'id='+id+'&date='+data_date $.ajax({ type: "GET", url: url, data: getdata, success: (data) => { var areaChartData = { labels : [{{ graph_dates|raw }}], axisY:[{ title: "Наличие на складах", lineColor: "rgba(10,10,188,1)", tickColor: "rgba(10,10,188,1)", labelFontColor: "rgba(10,10,188,1)", titleFontColor: "rgba(10,10,188,1)", includeZero: true, }, { title: "Рыночная цена", lineColor: "rgba(210, 214, 222, 1)", tickColor: "rgba(210, 214, 222, 1)", labelFontColor: "rgba(210, 214, 222, 1)", titleFontColor: "rgba(210, 214, 222, 1)", includeZero: true, }], axisY2: { title: "Выкуплено товара", lineColor: "rgba(10, 214, 10, 1)", tickColor: "rgba(10, 214, 10, 1)", labelFontColor: "rgba(10, 214, 10, 1)", titleFontColor: "rgba(10, 214, 10, 1)", includeZero: true, }, datasets: [ { label : 'Наличие на складах', axisYIndex : 0, showInLegend : true, type : "line", backgroundColor : 'rgba(10,10,188,1)', borderColor : 'rgba(10,10,188,1)', pointRadius : false, pointColor : '#3b8bba', pointStrokeColor : 'rgba(10,10,188,1)', pointHighlightFill : '#fff', pointHighlightStroke: 'rgba(220,220,220,1)', data : [] }, { label : 'Рыночная цена', axisYIndex : 1, showInLegend : true, type : "line", backgroundColor : 'rgba(210, 214, 222, 1)', borderColor : 'rgba(210, 214, 222, 1)', pointRadius : false, pointColor : 'rgba(210, 214, 222, 1)', pointStrokeColor : '#c1c7d1', pointHighlightFill : '#fff', pointHighlightStroke: 'rgba(220,220,220,1)', data : [] }, { label : 'Выкуплено товара', axisYType : "secondary", showInLegend : true, type : "line", backgroundColor : 'rgba(10, 214, 10, 1)', borderColor : 'rgba(10, 214, 10, 1)', pointRadius : false, pointColor : 'rgba(10, 214, 10, 1)', pointStrokeColor : '#c1c7d1', pointHighlightFill : '#fff', pointHighlightStroke: 'rgba(220,220,220,1)', data : [] }, ] } var areaChartOptions = { maintainAspectRatio : false, responsive : true, legend: { display: true, cursor: "pointer", }, axisX: { title: "Даты" }, axisY: { title: "Значения", }, } $('#chartModal .modal-title').html('График показателей для товара: '+data.title) $('#chartModal').modal() var lineChartCanvas = $('#chartModal .lineChart_modal').get(0).getContext('2d') var lineChartOptions = $.extend(true, {}, areaChartOptions) var lineChartData = $.extend(true, {}, areaChartData) lineChartData.datasets[0].fill = false; lineChartData.datasets[1].fill = false; lineChartData.datasets[2].fill = false; lineChartData.datasets[0]['data'] = data.stock_quantity_full; lineChartData.datasets[1]['data'] = data.stock_price; lineChartData.datasets[2]['data'] = data.number_sale; lineChartOptions.datasetFill = false var lineChart = new Chart(lineChartCanvas, { type: 'line', data: lineChartData, options: lineChartOptions }) } }); return false }) $('#custom_date').daterangepicker({ "locale": { "format": "YYYY-MM-DD", "separator": " - ", "applyLabel": "Применить", "cancelLabel": "Отмена", "fromLabel": "От", "toLabel": "До", "customRangeLabel": "Custom", "weekLabel": "W", "daysOfWeek": [ "Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб" ], "monthNames": [ "Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", "Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь" ], "firstDay": 1 }, "startDate": "2023-08-08", "endDate": "2023-08-14", "minDate": "2023-06-01", "maxDate": "2023-08-14" }, function(start, end, label) { location.href='/lk/analytics?custom_date='+start.format('YYYY-MM-DD')+' - '+end.format('YYYY-MM-DD'); }); $(document).on('click', '#custom_date_btn', function() { location.href='/lk/analytics?custom_date='+$('#custom_date').val(); }); $(document).on('click', '#show-filter', function() { if ($('.filter-block').hasClass('active')) { $('.filter-block').slideUp().removeClass('active'); $(this).html('Показать фильтр'); } else { $('.filter-block').slideDown().addClass('active'); $(this).html('Скрыть фильтр'); } }); $(document).on('click', '.show_stocks_list', function() { let stocks_list = $(this).siblings($('.stocks_list')) if (stocks_list.css('display')=='none') stocks_list.slideDown(); else stocks_list.slideUp(); }); $(document).on('click', '.ajax-edit-cost', function() { let id = $(this).data('id') let price = $(this).data('price') $('#ajax-edit-cost-'+id).html('<input type="text" value="'+price+'" id="ajax-cost-value-'+id+'" style="width:90px;"> <a href="#" class="ajax-save-cost" data-id="'+id+'"><i class="fa fa-save"></i></a>') return false }) $(document).on('click', '.ajax-save-cost', function() { let id = $(this).data('id') let price = $('#ajax-cost-value-'+id).val() let url = '/lk/analytics/save/cost/'+id let getdata = 'price='+price $.ajax({ type: "GET", url: url, data: getdata, // beforeSend: () => { // button.addClass('ajax-executing'); // button.prop('disabled', true); // }, success: (data) => { $('#ajax-edit-cost-'+id).html(data+' <a href="#" class="ajax-edit-cost" data-id="'+id+'" data-price="'+data+'"><i class="fa fa-edit"></i></a>') } }); return false }) $(document).on('click', '.ajax-edit-comm', function() { let id = $(this).data('id') let price = $(this).data('price') $('#ajax-edit-comm-'+id).html('<input type="text" value="'+price+'" id="ajax-comm-value-'+id+'" style="width:90px;"> <a href="#" class="ajax-save-comm" data-id="'+id+'"><i class="fa fa-save"></i></a>') return false }) $(document).on('click', '.ajax-save-comm', function() { let id = $(this).data('id') let price = $('#ajax-comm-value-'+id).val() let url = '/lk/analytics/save/comm/'+id let getdata = 'price='+price $.ajax({ type: "GET", url: url, data: getdata, success: (data) => { $('#ajax-edit-comm-'+id).html('Комм(%): '+data+' <a href="#" class="ajax-edit-comm" data-id="'+id+'" data-price="'+data+'"><i class="fa fa-edit"></i></a>') } }); return false }) $(document).on('click', '.ajax-edit-log', function() { let id = $(this).data('id') let price = $(this).data('price') $('#ajax-edit-log-'+id).html('<input type="text" value="'+price+'" id="ajax-log-value-'+id+'" style="width:90px;"> <a href="#" class="ajax-save-log" data-id="'+id+'"><i class="fa fa-save"></i></a>') return false }) $(document).on('click', '.ajax-save-log', function() { let id = $(this).data('id') let price = $('#ajax-log-value-'+id).val() let url = '/lk/analytics/save/log/'+id let getdata = 'price='+price $.ajax({ type: "GET", url: url, data: getdata, success: (data) => { $('#ajax-edit-log-'+id).html('Логис(р): '+data+' <a href="#" class="ajax-edit-log" data-id="'+id+'" data-price="'+data+'"><i class="fa fa-edit"></i></a>') } }); return false }) }) </script> {% endblock %}