Files
b2b.redline.com.pl/modules/firmesb2b/views/templates/front/firmesb2b-document.tpl
2025-06-24 14:14:35 +02:00

119 lines
5.3 KiB
Smarty

{*
* 2012 Firmes
* Mechanizmy obsługi rozszerzenia FirmesLink B2B
* Obsluga wyswietlania historii dokumentow
*}
{extends file='page.tpl'}
{block name="page_content"}
<div id="firmesb2b_block_documents">
{if $document}
<header class="page-header">
<h1 class="page-heading">{$document.title} {$document.number} <span class="b2b_h2_desc">z dn. {dateFormat date=$document.payment_date full=0}</span></h1>
</header>
{if $document && $details && count($details)}
<table class="table table-striped table-bordered table-labeled hidden-sm-down">
<thead class="thead-default">
<tr>
<th class="first_item">{l s='Nazwa' mod='firmesb2b'}</th>
<th class="item">{l s='Ilość' mod='firmesb2b'}</th>
<th class="item">{l s='JM' mod='firmesb2b'}</th>
<th class="item">{l s='Cena' mod='firmesb2b'}</th>
<th class="item">{l s='VAT' mod='firmesb2b'}</th>
<th class="item">{l s='Netto' mod='firmesb2b'}</th>
<th class="last_item">{l s='Brutto' mod='firmesb2b'}</th>
</tr>
</thead>
<tbody>
{foreach from=$details item=detail 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">
{$detail.product_name}
</td>
<td class="b2b_price">{$detail.quantity|string_format:"%.0f"}</td>
<td class="b2b_price">{$detail.unit}</td>
<td class="b2b_price">{$detail.price_net|string_format:"%.2f"}</td>
<td class="b2b_price">{$detail.tax_rate|string_format:"%.0f"}%</td>
<td class="b2b_price">{$detail.total_net|string_format:"%.2f"}</td>
<td class="b2b_price">{$detail.total_gros|string_format:"%.2f"}</td>
</tr>
{/foreach}
</tbody>
<tfoot>
<tr class="b2b_foot">
<td colspan="5" class="b2b_price">{l s='Razem:' mod='firmesb2b'}</td>
<td class="b2b_price">{$document.total_net|string_format:"%.2f"}</td>
<td class="b2b_price">{$document.total_gros|string_format:"%.2f"}</td>
</tr>
</tfoot>
</table>
<div >
{if $document.payment_ammount > 0}
<p>
{if $smarty.now|date_format:"%Y-%m-%d" > $document.payment_date} <span class="b2b_warn"> {/if}
Pozostało do zapłaty {$document.payment_ammount|string_format:"%.2f"} w terminie {dateFormat date=$document.payment_date full=0} ({$document.payment_lateness} dni).
{if $smarty.now|date_format:"%Y-%m-%d" > $document.payment_date} </span>{/if}
</p>
{/if}
{if $document.db_documentId > 0}
<p><a href="{$link->getModuleLink('firmesb2b', 'documents', ['getfile' => $document.document_id, 's' => $document.source_id, 'p' => $return_page])}">Pobierz wydruk PDF dokumentu <img src="{$module_template_dir}img/pdf.gif" class="b2b_download_icon icon" alt="{l s='Wydruk PDF' mod='firmesb2b'}"/></a></p>
{/if}
{* {if strpos($document.db_file, 'pdf') !== false}
<p>Welcome</p>
{/if}
{foreach from=$document key=team item=record}
{$team}: {$record} </br>
{/foreach} *}
</div>
{/if}
{else}
<p class="warning">{l s='Nie mozna wyświetlić wybranego dokumentu.' mod='firmesb2b'}</p>
{/if}
{if $B2BrelatedDocumentsCount}
<p>&nbsp;</p>
<table class="table table-striped table-bordered table-labeled hidden-sm-down">
<thead class="thead-default">
<tr>
<th class="first_item">{l s='Załączniki do dokumentu' mod='firmesb2b'}</th>
<th class="item">{l s='Opis' mod='firmesb2b'}</th>
<th class="item" style="text-align:right">{l s='Plik' mod='firmesb2b'}</th>
</tr>
</thead>
<tbody>
{foreach from=$B2BrelatedDocuments item=row name=myLoop2}
<tr class="{if $smarty.foreach.myLoop2.first}first_item{elseif $smarty.foreach.myLoop2.last}last_item{else}item{/if} {if $smarty.foreach.myLoop2.index % 2}alternate_item{/if}">
<td class="b2b_number">
{$row.bi_name}
</td>
<td class="b2b_price">{$row.bi_description}</td>
<td class="b2b_price">
<a href="{$link->getModuleLink('firmesb2b', 'documents', ['getfile' => $row.bi_binaryId, 's' => $row.bi_sourceId, 'p' => $return_page, 'attachment' => 1])}">
<img src="{$module_template_dir}img/pdf.gif" class="b2b_download_icon icon" alt="{l s='Wydruk PDF' mod='firmesb2b'}"/>
</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
{/if}
<p>&nbsp;</p>
<ul class="footer_links clearfix">
<li class="fleft">
<a class="btn btn-default button button-small" href="{$link->getPageLink('my-account', true)|escape:'htmlall':'UTF-8'}">
<span>
<i class="icon-chevron-left"></i>{l s='Powrót do Twojego konta' mod='firmesb2b'}
</span>
</a>
</li>
<li class="fleft">
<a class="btn btn-default button button-small" href="{$link->getModuleLink('firmesb2b', 'documents', ['p' => $return_page])}">
<span>
<i class="icon-chevron-left"></i>{l s='Faktury i płatności' mod='firmesb2b'}
</span>
</a>
</li>
</ul>
</div>
{/block}