Files
crm.twinpol.com/modules/EcmReports/tpls/RaportMM.html
2025-05-12 15:45:02 +00:00

302 lines
12 KiB
HTML

<script type="text/javascript" src="https://mottie.github.io/tablesorter/docs/js/jquery-latest.min.js"></script>
<link class="theme" rel="stylesheet" href="https://mottie.github.io/tablesorter/docs/css/jquery-ui.min.css">
<script type="text/javascript" src="https://mottie.github.io/tablesorter/docs/js/jquery-ui.min.js"></script>
<script src="https://mottie.github.io/tablesorter/js/jquery.tablesorter.js"></script>
<script src="https://mottie.github.io/tablesorter/js/jquery.tablesorter.widgets.js"></script>
<script src="https://mottie.github.io/tablesorter/js/widgets/widget-scroller.js"></script>
<link class="theme" rel="stylesheet" href="modules/EcmReports/TableSorterNew/css/theme.blue.css">
<script type="text/javascript" src="modules/EcmReports/javascript/RaportZamowien.js"></script>
<script type="text/javascript" src="modules/EcmReports/javascript/RaportMM.js"></script>
<style type="text/css">
{literal}
thead, tfoot {font-weight: bold;}
.additionalColumn {
background-color: #87CCED;
border-top: 1px solid black;
}
.groupActive {
border-top: 1px solid black;
border-bottom: 1px solid black;
border-left: 1px solid black;
background-color: #87CCED;
}
.sumRow {
background-color: #BDC7B5;
}
.sumAll td{
background-color: #BDC7B5;
}
table.tablesorter tbody tr:hover td {
background: #E8E8E8;
color: #343432;
}
/* Extra selectors needed to override the default styling */
table.tablesorter tbody tr.normal-row td {
background: #EFEFF1;
color: #343432;
}
table.tablesorter tbody tr.alt-row td {
background: #FFF;
color: #343432;
}
/* Extra selectors needed to override the default styling */
table.tablesorter tbody tr.normal-row:hover td {
background: #E8E8E8;
color: #343432;
}
table.tablesorter tbody tr.alt-row:hover td {
background: #E8E8E8;
color: #343432;
}
table.tablesorter tbody tr.sumAll td {
background: #EBEBED;
color: black;
}
table.tablesorter tbody tr.sumAll:hover td {
background: #E0E0E2;
color: black;
font-weight: bold;
}
table.tablesorter .sumRow, .oddListRowS1 {
text-align: right;
}
table.tablesorter .alignLeft {
text-align: left;
}
table.tablesorter .subcategory .alignLeft {
padding-left: 20px;
}
table.tablesorter .contractor .alignLeft {
padding-left: 40px;
}
.plusStyle {
color: #abc3d7;
text-decoration: none;
cursor: pointer;
}
.green-text{
color:#2E8B57;
}
.no-price{
color: red !important;
}
{/literal}
</style>
<table id="tableMenu" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td>
<img src="themes/Sugar/images/EcmProducts.gif" style="margin-top: 3px; margin-right: 3px;" alt="EcmProducts" width="16" border="0" height="16">
</td>
<td>
<h2>Ranking sprzedaży marketów </h2>
</td>
</tr>
</table>
<br />
<ul class="tablist" style="width:100%;">
<li>
<a class="current" href="#">Podstawowe wyszukiwanie</a>
</li>
</ul>
<form action="index.php" method="get" name="searchReportSales">
<input type="hidden" name="module" value="EcmReports" />
<input type="hidden" name="action" value="RaportMM" />
<table style="border-top: 0px none; margin-bottom: 4px;width:100%" class="tabForm" border="0" cellpadding="0" cellspacing="0">
<tr>
{* Search by date_from *}
<td class="dataLabel" width="5%" nowrap="nowrap"> Data od </td>
<td class="dataField" width="10%" nowrap="nowrap">
<input id="date_from" name="date_from" type="text" maxlength="10" size="11" tabindex="" title="" value="{$date_from}" autocomplete="off">
<img id="date_from_trigger" border="0" align="absmiddle" alt="Enter Date" src="themes/default/images/jscalendar.gif">
<script language="JavaScript" type="text/javascript">
Calendar.setup ({ldelim}
inputField : "date_from",
daFormat : "{$dateFormat}",
button : "date_from_trigger",
singleClick : true,
dateStr : "",
step : 1
{rdelim}
);
</script>
</td>
</td>
{* Search by date_to *}
<td class="dataLabel" width="5%" nowrap="nowrap">Data do</td>
<td class="dataField" width="10%" nowrap="nowrap">
<input autocomplete="off" name="date_to" id="date_to" value="{$date_to}" title="" tabindex="" size="11" maxlength="10" type="text">
<img src="themes/default/images/jscalendar.gif" alt="Enter Date" id="date_to_trigger" align="absmiddle" border="0">
<script language="JavaScript" type="text/javascript">
Calendar.setup ({ldelim}
inputField : "date_to",
daFormat : "{$dateFormat}",
button : "date_to_trigger",
singleClick : true,
dateStr : "",
step : 1
{rdelim}
);
</script>
</td>
{* Search by date_to *}
<td class="dataLabel" width="5%" nowrap="nowrap">Wybierz plik</td>
<td class="dataField" width="10%" nowrap="nowrap">
<select name="file_id" required>
<option value=""></option>
{foreach from=$files key="key" item="item"}
<option value="{$item.file_id}" {if $item.file_id==$file_id}selected="selected"{/if}>{$item.file_name} - {$item.file_date|date_format:"%d.%m.%Y %H:%M" }</option>
{/foreach}
</select>
</td>
</tr>
</tbody>
</table>
<input class="button" name="submit" value="Wykonaj" type="submit">
<input class="button" name="clear" value="Wyczyść" type="button" onclick="location.href='index.php?module=EcmReports&action=RaportMM';">
<br>
<br>
{if $rows|@count>0}
<table id="myTable" class="tablesorter tablesorter-blue" role="grid">
<thead>
<tr class="tablesorter-headerRow" role="row">
<th width="30%" class="sorter-text tablesorter-header tablesorter-headerUnSorted" data-column="0"
tabindex="0" colspan=2 scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">Kontrahent</th>
<th width="10%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="2"
tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on" style="-moz-user-select: none;"
aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">Sprzedana ilość</th>
<th width="8%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="4" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on"
style="-moz-user-select: none;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">Ilość w markecie</th>
<th width="10%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="3" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on"
style="-moz-user-select: none;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">Wartość sprzedaży</th>
<th width="8%" class="sorter-saas tablesorter-header tablesorter-headerUnSorted" data-column="4" tabindex="0" scope="col" role="columnheader" aria-disabled="false" unselectable="on"
style="-moz-user-select: none;" aria-sort="none" aria-label="Name: No sort applied, activate to apply an ascending sort">Wartość odsprzedaży</th>
</tr>
</thead>
{* id="functions-core" class="tablesorter-infoOnly" *}
<tbody>
{foreach from=$rows key="key" item="item"}
<tr class="">
<td class="oddListRowS1 alignLeft {if $item.brak_ceny_odsprzedazy==1 || $item.brak_ceny_zakupu==1}no-price{/if}" colspan=2 onclick="showChildren('{$item.parent_id}');"><a style="color: cadetblue; text-decoration: none; cursor: pointer;">[+]</a><b class="parent_{$item.parent_id}" data-value='0'> {$item.name}</b></td>
<td class="oddListRowS1 sumRow {if $item.brak_ceny_odsprzedazy==1 || $item.brak_ceny_zakupu==1}no-price{/if}" ><b>{$item.sell_quantity|number_format:0:".":"" }</b></td>
<td class="oddListRowS1 sumRow {if $item.brak_ceny_odsprzedazy==1 || $item.brak_ceny_zakupu==1}no-price{/if}" ><b>{$item.purchase_quantity|number_format:0:".":"" }</b></td>
<td class="oddListRowS1 sumRow {if $item.brak_ceny_odsprzedazy==1 || $item.brak_ceny_zakupu==1}no-price{/if}" data-value="{$item.total_sell}" ><b>{$item.total_sell|number_format:2:",":"." }</b></td>
<td class="oddListRowS1 sumRow {if $item.brak_ceny_odsprzedazy==1 || $item.brak_ceny_zakupu==1}no-price{/if}" data-value="{$item.total_purchase}"><b>{$item.total_purchase|number_format:2:",":"." }</b></td>
</tr>
{if $item.products|@count>0}
<tr style="width:100%;display:none;" class="subcategory tablesorter-infoOnly {$item.parent_id}" >
<td colspan="6">
<table style="width:100%" id="table_{$item.parent_id}">
<thead>
<th>Indeks</th>
<th>Nazwa produktu</th>
<th>Sprzedana ilość</th>
<th>Ilość w markecie</th>
<th>Cena sprzedaży</th>
<th>Cena odsprzedaży</th>
<th>Wartość sprzedaży</th>
<th>Wartość odsprzedaży</th>
</thead>
<tbody>
{foreach from=$item.products key="key2" item="prod"}
<tr>
<td class="oddListRowS1 alignLeft"><a target="_blank" href="index.php?module=EcmProducts&action=DetailView&record={$prod.product_id}"><b> {$prod.code}</b></a></td>
<td class="oddListRowS1 alignLeft"><b><a>{$prod.name}</a></b></td>
<td class="oddListRowS1 sumRow" ><b>{$prod.sell_quantity|number_format:0:".":"" }</b></td>
<td class="oddListRowS1 sumRow" ><b>{$prod.buy_quantity|number_format:0:".":"" }</b></td>
<td class="oddListRowS1 sumRow {if $prod.purchase_price==''}no-price{/if}" data-value="{$prod.purchase_price}"><b>{$prod.purchase_price|number_format:2:",":"." }</b></td>
<td class="oddListRowS1 sumRow {if $prod.sell_price==''}no-price{/if}" data-value="{$prod.sell_price}"><b>{$prod.sell_price|number_format:2:",":"." }</b></td>
<td class="oddListRowS1 sumRow" data-value="{$prod.total_sell}"><b>{$prod.total_sell|number_format:2:",":"." }</b></td>
<td class="oddListRowS1 sumRow" data-value="{$prod.total_purchase}"><b>{$prod.total_purchase|number_format:2:",":"." }</b></td>
</tr>
{/foreach}
</tbody>
</table>
</td>
</tr>
{/if}
<script>
{literal}
$(document)
.ready(
function() {
$('#table_{/literal}{$item.parent_id}{literal}').tablesorter({
cssChildRow: "subcategory",
widget: ['zebra'],
headers: {
4: {
sorter: 'number'
},
5: {
sorter: 'number'
},
6: {
sorter: 'number'
},
7: {
sorter: 'number'
}
}
});
});
{/literal}
</script>
{/foreach}
</tbody>
<tfoot>
<tr class="">
<td class="oddListRowS1 alignRight" colspan=2><b>Razem:</b></td>
<td class="oddListRowS1 sumRow" ><b>{$total.sell_quantity|number_format:0:".":"" }</b></td>
<td class="oddListRowS1 sumRow" ><b>{$total.purchase_quantity|number_format:0:".":"" }</b></td>
<td class="oddListRowS1 sumRow" ><b>{$total.total_sell|number_format:2:",":"." }</b></td>
<td class="oddListRowS1 sumRow" ><b>{$total.total_purchase|number_format:2:",":"." }</b></td>
</tr>
</tfoot>
</table>
<br/>
{/if}