Добавил колонку статуса в excel-таблице для в режиме All

parent 418073a7
...@@ -195,7 +195,7 @@ $(document).ready(function(){ ...@@ -195,7 +195,7 @@ $(document).ready(function(){
} }
}))); })));
$rowExcel = $('<tr class="' + trClass + '">'); $rowExcel = $('<tr class="order-item ' + trClass + '">');
$rowExcel.append($('<td>').html(item['period'])); $rowExcel.append($('<td>').html(item['period']));
} else { } else {
...@@ -212,7 +212,7 @@ $(document).ready(function(){ ...@@ -212,7 +212,7 @@ $(document).ready(function(){
$row.append($('<td class="'+ line +'">').append(templateTimestampContent({ $row.append($('<td class="'+ line +'">').append(templateTimestampContent({
data: {date: getDateValue(item[line]), time: getHourMinValue(item[line])} data: {date: getDateValue(item[line]), time: getHourMinValue(item[line])}
}))); })));
$rowExcel.append($('<td>').append(item[line])); $rowExcel.append($('<td class="Timestamp">').append(item[line]));
} else if (line == 'ViewID') { } else if (line == 'ViewID') {
$row.append($('<td class="'+ line +'">').append(templateViewIDContent({ $row.append($('<td class="'+ line +'">').append(templateViewIDContent({
data: {feedId: item[line][0], viewId: item[line][1]} data: {feedId: item[line][0], viewId: item[line][1]}
......
...@@ -288,6 +288,20 @@ $(document).ready(function(){ ...@@ -288,6 +288,20 @@ $(document).ready(function(){
if (activeStatus == 'all') { if (activeStatus == 'all') {
$('thead tr.orders-title.confirmed, thead tr.orders-title.rejected', $tableToExcelCopy).remove(); $('thead tr.orders-title.confirmed, thead tr.orders-title.rejected', $tableToExcelCopy).remove();
$('tbody tr.total-orders', $tableToExcelCopy).remove(); $('tbody tr.total-orders', $tableToExcelCopy).remove();
// Добавляем сколонку статуса:
$('thead tr th.Timestamp', $tableToExcelCopy).after('<th><b>Статус</b></th>');
$('tbody tr.order-item', $tableToExcelCopy).each(function(){
var
$this = $(this),
orderStatusTitle;
if ($this.hasClass('confirmed')) orderStatusTitle = 'Подтверждён';
if ($this.hasClass('rejected')) orderStatusTitle = 'Отклонён';
$('td.Timestamp', $this).after('<th>' + orderStatusTitle + '</th>');
});
} }
if (activeStatus == 'confirmed') { if (activeStatus == 'confirmed') {
$('thead tr.orders-title.all, thead tr.orders-title.rejected', $tableToExcelCopy).remove(); $('thead tr.orders-title.all, thead tr.orders-title.rejected', $tableToExcelCopy).remove();
......
...@@ -231,24 +231,17 @@ if (!$error) { ...@@ -231,24 +231,17 @@ if (!$error) {
<?php endif; */ ?> <?php endif; */ ?>
<?php if($current_report == 'transactions'): ?> <?php if($current_report == 'transactions'): ?>
<table id="table2excel" data-content="shop-<?= $shop_title ?>" width="100%"> <table id="table2excel" data-content="shop-<?= $shop_title ?>" width="100%">
<thead> <thead>
<tr class="orders-title all"><th colspan="4">Все заказы</th></tr> <tr class="orders-title all"><th colspan="4">Все заказы</th></tr>
<tr class="orders-title confirmed"><th colspan="4">Подтвержденные заказы</th></tr> <tr class="orders-title confirmed"><th colspan="4">Подтвержденные заказы</th></tr>
<tr class="orders-title rejected"><th colspan="4">Отклонённые заказы</th></tr> <tr class="orders-title rejected"><th colspan="4">Отклонённые заказы</th></tr>
<tr> <tr>
<th> <th><b><?= _t($main_cat['title'])?></b></th>
<b><?= _t($main_cat['title'])?></b> <th class="Timestamp"><b><?= _t('Дата время')?></b></th>
</th> <th><b><?= _t('Сумма')?></b></th>
<?php foreach($report_cats as $name => $title): ?> <th><b><?= _t('Комиссия')?></b></th>
<?php if ($name == 'Timestamp'): ?>
<th><b><?= _t('Дата время')?></b></th>
<?php else: ?>
<?php if (!in_array($name, ['ViewID', 'Basket'])): ?>
<th><b><?= _t($title)?></b></th>
<?php endif; ?>
<?php endif; ?>
<?php endforeach; ?>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment