178 lines
10 KiB
Smarty
178 lines
10 KiB
Smarty
{*
|
|
* 2020 Firmes
|
|
* Mechanizmy obsługi rozszerzenia FirmesLink B2B
|
|
* Obsluga wyswietlania historii dokumentow w panelu administracyjnym sklepu
|
|
*}
|
|
<div class="col">
|
|
<div class="card FirmesB2B-card">
|
|
<h3 class="card-header">
|
|
<i class="material-icons">description</i>
|
|
FirmesB2B
|
|
<span class="badge badge-primary rounded">{$documentCount}</span>
|
|
</h3>
|
|
<div class="card-body">
|
|
{if isset($customerInfo) && count($customerInfo)}
|
|
<!-- Block firmesb2b module -->
|
|
<div id="firmesb2b_block">
|
|
<h4 class="title_block">
|
|
{l s='Informacje handlowe' mod='blockcategories'}
|
|
</h4>
|
|
<div class="block">
|
|
<table class="table table-borderless">
|
|
<tbody>
|
|
{if $customerInfo.creditLimit > 0}
|
|
<tr>
|
|
<td>Przyznany limit kredytu kupieckiego:</td>
|
|
<td align="right">{$customerInfo.creditLimit|string_format:"%.2f"}</td>
|
|
</tr>
|
|
{/if}
|
|
<tr>
|
|
<td>Wykorzystany kredyt kupiecki:</td>
|
|
<td align="right"><strong>{$customerInfo.creditUsed|string_format:"%.2f"}</strong></td>
|
|
</tr>
|
|
<tr>
|
|
<td>Przeterminowane płatności:</td>
|
|
{if $customerInfo.creditOverdue > 0}
|
|
<td align="right"><span class="b2b_warn">{$customerInfo.creditOverdue|string_format:"%.2f"}</span></td>
|
|
{else}
|
|
<td align="right">{$customerInfo.creditOverdue|string_format:"%.2f"}</td>
|
|
{/if}
|
|
</tr>
|
|
{if $customerInfo.shopDiscount > 0}
|
|
<tr>
|
|
<td>Rabat:</td>
|
|
<td align="right">{$customerInfo.shopDiscount|string_format:"%.2f"}%</td>
|
|
</tr>
|
|
{/if}
|
|
{if $customerInfo.consultantId > 0}
|
|
<tr>
|
|
<td>
|
|
Opiekun:
|
|
</td>
|
|
<td align="right">
|
|
{$customerInfo.consultant}<br />
|
|
{if $customerInfo.consultantEmail != ''}
|
|
<a href="mailto:{$customerInfo.consultantEmail}" class="b2b_consultant">{$customerInfo.consultantEmail}</a><br />
|
|
{/if}
|
|
{if $customerInfo.consultantPhone != ''}
|
|
tel. {$customerInfo.consultantPhone}<br />
|
|
{/if}
|
|
</td>
|
|
</tr>
|
|
{/if}
|
|
</tbody>
|
|
</table>
|
|
<p>
|
|
<a class="btn btn-primary" data-toggle="collapse" href="#collapseFirmesB2B" role="button" aria-expanded="false" aria-controls="collapseFirmesB2B">
|
|
{l s='Historia faktur i płatności' mod='firmesb2b'}
|
|
</a>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
{*
|
|
<p class="text-muted text-center mb-0">
|
|
Nie odnaleziono rekordów
|
|
</p>
|
|
*}
|
|
<div class="collapse" id="collapseFirmesB2B">
|
|
{* <div class="card card-body"> *}
|
|
{block name="page_content"}
|
|
<div id="firmesb2b_block_documents">
|
|
{* <header class="page-header">
|
|
<h1 class="page-heading">{l s='Historia faktur i płatności' mod='firmesb2b'}</h1>
|
|
</header> *}
|
|
{if $B2Bdocuments}
|
|
<table class="table table-striped table-bordered table-labeled hidden-sm-down">
|
|
<thead class="thead-default">
|
|
<tr>
|
|
<th class="first_item">{l s='Dokument'}</th>
|
|
<th class="item">{l s='Data'}</th>
|
|
<th class="item">{l s='Netto'}</th>
|
|
<th class="item">{l s='Brutto'}</th>
|
|
<th class="item">{l s='Termin'}</th>
|
|
<th class="last_item">{l s='Do zapłaty'}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{foreach from=$B2Bdocuments item=document name=myLoop}
|
|
<tr class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if} {if $smarty.foreach.myLoop.index % 2}alternate_item{/if}">
|
|
<td class="b2b_number">
|
|
<a class="b2b_document_link" target="_blank" href="{$link->getModuleLink('firmesb2b', 'documents', ['id' => $document.document_id, 's' => $document.source_id, 'p' => $current_page])}">{$document.number}</a>
|
|
{if $document.db_documentId > 0 && $document.db_binaryId > 0 }
|
|
<a class="b2b_document_link" href="{$link->getModuleLink('firmesb2b', 'documents', ['getfile' => $document.document_id, 's' => $document.source_id, 'p' => $current_page])}"><img src="{$module_template_dir}img/pdf.gif" class="b2b_download_icon icon" alt="{l s='Wydruk PDF' mod='firmesb2b'}"/></a>
|
|
{* <a class="b2b_document_link" href="{$link->getModuleLink('firmesb2b', 'documents', ['getfile' => $document.document_id, 'binary_id' => $document.document_id*-1, 's' => $document.source_id, 'p' => $current_page])}" title = "Dokument EPP"><img src="{$module_template_dir}img/epp.png" class="b2b_download_icon icon" alt="{l s='Dokument EPP' mod='firmesb2b'}"/></a> *}
|
|
{/if}
|
|
|
|
{if $document.db_documentId > 0 && $document.eppid < 0 }
|
|
<a class="b2b_document_link" href="{$link->getModuleLink('firmesb2b', 'documents', ['getfile' => $document.document_id, 'binary_id' => $document.eppid, 's' => $document.source_id, 'p' => $current_page])}" title = "Dokument EPP"><img src="{$module_template_dir}img/epp.png" class="b2b_download_icon icon" alt="{l s='Dokument EPP' mod='firmesb2b'}"/></a>
|
|
{/if}
|
|
</td>
|
|
<td class="b2b_date">{dateFormat date=$document.date full=0}</td>
|
|
<td class="b2b_price">{$document.total_net|string_format:"%.2f"}</td>
|
|
<td class="b2b_price">{$document.total_gros|string_format:"%.2f"}</td>
|
|
<td class="b2b_date">
|
|
{if $document.payment_ammount > 0}
|
|
{if $smarty.now|date_format:"%Y-%m-%d" > $document.payment_date} <span class="b2b_warn"> {/if}
|
|
{dateFormat date=$document.payment_date full=0} ({$document.payment_lateness}d)
|
|
{if $smarty.now|date_format:"%Y-%m-%d" > $document.payment_date} </span>{/if}
|
|
{/if}
|
|
</td>
|
|
<td class="b2b_payment">
|
|
{if $document.payment_ammount > 0}
|
|
{if $smarty.now|date_format:"%Y-%m-%d" > $document.payment_date} <span class="b2b_warn"> {/if}
|
|
{$document.payment_ammount|string_format:"%.2f"}
|
|
{if $smarty.now|date_format:"%Y-%m-%d" > $document.payment_date} </span>{/if}
|
|
{/if}
|
|
</td>
|
|
</tr>
|
|
{/foreach}
|
|
</tbody>
|
|
</table>
|
|
{if $pages > 0}
|
|
<nav class="pagination">
|
|
<!-- Pagination -->
|
|
<div id="pagination" class="pagination">
|
|
<ul class="page-list clearfix text-xs-center">
|
|
{if $current_page > 0}
|
|
<li id="pagination_previous"><a href="{$link->getModuleLink('firmesb2b', 'documents', ['p' => ($current_page - 1)])}">« {l s='Poprzednia' mod='firmesb2b'}</a></li>
|
|
{else}
|
|
<li id="pagination_previous" class="disabled"><span>« {l s='Poprzednia' mod='firmesb2b'}</span></li>
|
|
{/if}
|
|
{section name=pagination start=0 loop=$pages+1 step=1}
|
|
{if $current_page == $smarty.section.pagination.index}
|
|
<li class="current"><span>{$current_page+1|escape:'htmlall':'UTF-8'}</span></li>
|
|
{else}
|
|
<li><a href="{$link->getModuleLink('firmesb2b', 'documents', ['p' => $smarty.section.pagination.index])}">{$smarty.section.pagination.index+1|escape:'htmlall':'UTF-8'}</a></li>
|
|
{/if}
|
|
{/section}
|
|
{if $current_page < $pages}
|
|
<li id="pagination_next"><a href="{$link->getModuleLink('firmesb2b', 'documents', ['p' => ($current_page + 1)])}">{l s='Następna' mod='firmesb2b'} »</a></li>
|
|
{else}
|
|
<li id="pagination_next" class="disabled"><span>{l s='Następna' mod='firmesb2b'} »</span></li>
|
|
{/if}
|
|
</ul>
|
|
</div>
|
|
</nav>
|
|
{/if}
|
|
{else}
|
|
<p class="warning">{l s='Lista dokumentów jest pusta.' mod='firmesb2b'}</p>
|
|
{/if}
|
|
</div>
|
|
{/block}
|
|
{* </div> *}
|
|
</div>
|
|
{if $customer_is_related != true}
|
|
<div class="alert alert-warning" role="alert">
|
|
<p>{l s='To konto nie jest powiązane z żadnym kontrahentem w systemie ERP.' mod='firmesb2b'}</p>
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
{if $customer_is_related == true}
|
|
<div class="card-footer text-muted text-center" title="Data ostatniej aktualizacji danych kontrahenta">
|
|
{$customerInfo.ci_timestamp}
|
|
{$_PS_VERSION_}
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
</div> |