913 lines
36 KiB
PHP
913 lines
36 KiB
PHP
<?php use_stylesheet("backend/stInvoiceBackend.css"); ?>
|
|
<?php use_stylesheet('backend/stOrderProductOptions.css') ?>
|
|
<?php use_helper('stCurrency') ?>
|
|
|
|
<?php
|
|
if ($mode == 'edit'): ?>
|
|
|
|
<div class="edit-mode" style="margin: 0px auto; padding: 15px; width: 1080px;">
|
|
|
|
<div style="float:left;width: 485px;">
|
|
<?php echo textarea_tag("invoice[company_description]", $invoice->getCompanyDescription(), array('size' => '54x6', 'rich' => true, 'tinymce_options' => "height:80,width:'100%' ,theme:'simple'")) ?>
|
|
</div>
|
|
|
|
<div style=" float:right;">
|
|
|
|
<div class="st_invoice_frame" >
|
|
|
|
<div class="st_invoice_frame_header" >
|
|
<?php echo __('Miejsce wystawienia') ?>:
|
|
</div>
|
|
|
|
<div class="st_invoice_frame_content" >
|
|
<?php echo input_tag("invoice[town]", $invoice->getTown()) ?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="st_invoice_frame" >
|
|
|
|
<div class="st_invoice_frame_header" >
|
|
<?php echo $config->get('date_label', null, true); ?>:
|
|
</div>
|
|
|
|
<div class="st_invoice_frame_content" >
|
|
<?php echo input_date_tag("invoice[date_selle]", $invoice->getDateSelle(), array('readonly' => 'true', 'size' => '8px', 'rich' => 'true', 'calendar_button_img' => '/sf/sf_admin/images/date.png')) ?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="st_invoice_frame" >
|
|
|
|
<div class="st_invoice_frame_header" >
|
|
<?php echo __('Data wystawienia') ?>:
|
|
</div>
|
|
|
|
<div class="st_invoice_frame_content_last" >
|
|
<?php echo input_date_tag("invoice[date_create_copy]", $invoice->getDateCreateCopy(), array('readonly' => 'true', 'size' => '8px', 'rich' => 'true', 'calendar_button_img' => '/sf/sf_admin/images/date.png')) ?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<br class="st_clear_all">
|
|
|
|
<br><br>
|
|
|
|
<div style=" float:left; width: 45%;">
|
|
|
|
<div class="st_invoice_frame" style="width: 100%;">
|
|
|
|
<div class="st_invoice_frame_header" >
|
|
<?php echo __('Sprzedawca') ?>:
|
|
</div>
|
|
|
|
<div class="st_invoice_frame_content_last" >
|
|
|
|
<div style="margin:2px;">
|
|
<div style="float:left; width:120px; text-align:right; margin-right: 10px; padding:10px;"><?php echo __('firma') ?></div>
|
|
<div style="text-align:left;"><?php echo input_tag("invoice_user_seller[company]", $InvoiceUserSeller->getCompany()) ?></div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
<div style="margin:2px;">
|
|
<div style="float:left; width:120px; text-align:right; margin-right: 10px; padding:10px;"><?php echo __('imie i nazwisko') ?></div>
|
|
<div style="text-align:left;"><?php echo input_tag("invoice_user_seller[full_name]", $InvoiceUserSeller->getFullName()) ?></div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
<div style="margin:2px;">
|
|
<div style="float:left; width:120px; text-align:right; margin-right: 10px; padding:10px;"><?php echo __('adres') ?></div>
|
|
<div style="text-align:left;"><?php echo input_tag("invoice_user_seller[address]", $InvoiceUserSeller->getAddress()) ?></div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
<div style="margin:2px;">
|
|
<div style="float:left; width:120px; text-align:right; margin-right: 10px; padding:10px;"><?php echo __('adres cd') ?></div>
|
|
<div style="text-align:left;"><?php echo input_tag("invoice_user_seller[address_more]", $InvoiceUserSeller->getAddressMore()) ?></div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
<div style="margin:2px;">
|
|
<div style="float:left; width:120px; text-align:right; margin-right: 10px; padding:10px;"><?php echo __('województwo') ?></div>
|
|
<div style="text-align:left;"><?php echo input_tag("invoice_user_seller[region]", $InvoiceUserSeller->getRegion()) ?></div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
<div style="margin:2px;">
|
|
<div style="float:left; width:120px; text-align:right; margin-right: 10px; padding:10px;"><?php echo __('kod, miasto') ?></div>
|
|
<div style="text-align:left;"><?php echo input_tag("invoice_user_seller[code]", $InvoiceUserSeller->getCode()) ?> <?php echo input_tag("invoice_user_seller[town]", $InvoiceUserSeller->getTown()) ?></div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
<div style="margin:2px;">
|
|
<div style="float:left; width:120px; text-align:right; margin-right: 10px; padding:10px;"><?php echo __('Kraj') ?></div>
|
|
<div style="text-align:left;"><?php echo input_tag("invoice_user_seller[country]", $InvoiceUserSeller->getCountry()) ?></div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
<div style="margin:2px;">
|
|
<div style="float:left; width:120px; text-align:right; margin-right: 10px; padding:10px;"><?php echo __('NIP') ?></div>
|
|
<div style="text-align:left;"><?php echo input_tag("invoice_user_seller[vat_number]", $InvoiceUserSeller->getVatNumber()) ?></div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style=" float:right; width: 45%;">
|
|
|
|
<div class="st_invoice_frame" style="width: 100%;">
|
|
|
|
<div class="st_invoice_frame_header" >
|
|
<?php echo __('Nabywca') ?>:
|
|
</div>
|
|
|
|
<div class="st_invoice_frame_content_last" >
|
|
|
|
<div style="margin:2px;">
|
|
<div style="float:left; width:120px; text-align:right; margin-right: 10px; padding:10px;"><?php echo __('firma') ?></div>
|
|
<div style="text-align:left;"><?php echo input_tag("invoice_user_customer[company]", $InvoiceUserCustomer->getCompany()) ?></div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
<div style="margin:2px;">
|
|
<div style="float:left; width:120px; text-align:right; margin-right: 10px; padding:10px;"><?php echo __('imie i nazwisko') ?></div>
|
|
<div style="text-align:left;"><?php echo input_tag("invoice_user_customer[full_name]", $InvoiceUserCustomer->getFullName()) ?></div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
<div style="margin:2px;">
|
|
<div style="float:left; width:120px; text-align:right; margin-right: 10px; padding:10px;"><?php echo __('adres') ?></div>
|
|
<div style="text-align:left;"><?php echo input_tag("invoice_user_customer[address]", $InvoiceUserCustomer->getAddress()) ?></div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
<div style="margin:2px;">
|
|
<div style="float:left; width:120px; text-align:right; margin-right: 10px; padding:10px;"><?php echo __('adres cd') ?></div>
|
|
<div style="text-align:left;"><?php echo input_tag("invoice_user_customer[address_more]", $InvoiceUserCustomer->getAddressMore()) ?></div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
<div style="margin:2px;">
|
|
<div style="float:left; width:120px; text-align:right; margin-right: 10px; padding:10px;"><?php echo __('województwo') ?></div>
|
|
<div style="text-align:left;"><?php echo input_tag("invoice_user_customer[region]", $InvoiceUserCustomer->getRegion()) ?></div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
<div style="margin:2px;">
|
|
<div style="float:left; width:120px; text-align:right; margin-right: 10px; padding:10px;"><?php echo __('kod, miasto') ?></div>
|
|
<div style="text-align:left;"><?php echo input_tag("invoice_user_customer[code]", $InvoiceUserCustomer->getCode()) ?> <?php echo input_tag("invoice_user_customer[town]", $InvoiceUserCustomer->getTown()) ?></div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
<div style="margin:2px;">
|
|
<div style="float:left; width:120px; text-align:right; margin-right: 10px; padding:10px;"><?php echo __('Kraj') ?></div>
|
|
<div style="text-align:left;"><?php echo input_tag("invoice_user_customer[country]", $InvoiceUserCustomer->getCountry()) ?></div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
<div style="margin:2px;">
|
|
<div style="float:left; width:120px; text-align:right; margin-right: 10px; padding:10px;"><?php echo __('PESEL') ?></div>
|
|
<div style="text-align:left;"><?php echo input_tag("invoice_user_customer[pesel]", $InvoiceUserCustomer->getPesel()) ?></div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
|
|
<div style="margin:2px;">
|
|
<div style="float:left; width:120px; text-align:right; margin-right: 10px; padding:10px;"><?php echo __('NIP') ?></div>
|
|
<div style="text-align:left;"><?php echo input_tag("invoice_user_customer[vat_number]", $InvoiceUserCustomer->getVatNumber()) ?></div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<br class="st_clear_all">
|
|
|
|
<br><br>
|
|
|
|
<div id="st_invoice_number">
|
|
<?php echo $config->get('invoice_label', null, true); ?>
|
|
<?php echo input_tag("invoice[number]", $invoice->getNumber(), array("size" => "15")) ?>
|
|
</div>
|
|
|
|
<br>
|
|
|
|
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="st_invoice_table">
|
|
<tr>
|
|
<td width="10px" class="st_invoice_table_head"><?php echo __('Lp') ?></td>
|
|
|
|
<td class="st_invoice_table_head"><?php echo __('Kod') ?></td>
|
|
|
|
<td class="st_invoice_table_head"><?php echo __('Nazwa') ?></td>
|
|
|
|
<td class="st_invoice_table_head" ><?php echo __('Ilość') ?></td>
|
|
|
|
<td class="st_invoice_table_head"><?php echo __('j.m.') ?></td>
|
|
|
|
<td class="st_invoice_table_head" style="background-color:#eee"><?php echo __('Cena jed.') ?><br/><?php echo __('netto') ?></td>
|
|
|
|
<td class="st_invoice_table_head"><?php echo __('Cena jed.') ?><br/><?php echo __('brutto') ?></td>
|
|
|
|
<td class="st_invoice_table_head"><?php echo __('VAT') ?><br/>[%]</td>
|
|
|
|
<td class="st_invoice_table_head" style="background-color:#eee"><?php echo __('Wartość netto') ?></td>
|
|
|
|
<td class="st_invoice_table_head" style="background-color:#eee"><?php echo __('VAT') ?></td>
|
|
|
|
<td class="st_invoice_table_head" style="background-color:#eee"><?php echo __('Wartość brutto') ?></td>
|
|
|
|
<td class="st_invoice_table_head"> </td>
|
|
</tr>
|
|
|
|
<SCRIPT language=Javascript type="text/javascript">
|
|
|
|
function isNumberKey(evt)
|
|
{
|
|
var charCode = (evt.which) ? evt.which : evt.keyCode
|
|
if (charCode > 31 && (charCode < 48 || charCode > 57) && charCode != 46)
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
|
|
|
|
function checkValue(i)
|
|
{
|
|
|
|
var input1 = "x" + i;
|
|
var input2 = "y" + i;
|
|
var input3 = "z" + i;
|
|
var input4 = "v" + i;
|
|
var input5 = "C" + i;
|
|
|
|
|
|
x = document.getElementById(input1).value;
|
|
// y = document.getElementById(input2).value;
|
|
z = document.getElementById(input3).value;
|
|
vat = document.getElementById(input4).value;
|
|
|
|
|
|
|
|
var vSplit = vat.split(":");
|
|
|
|
v = vSplit[1];
|
|
|
|
|
|
if (!x) {
|
|
x=0; }
|
|
// if(!y){ y=0; }
|
|
if (!z) {
|
|
z=0; }
|
|
if (!v) {
|
|
v=0; }
|
|
|
|
|
|
var X = parseFloat(x);
|
|
// var Y = parseFloat(y);
|
|
var Z = parseFloat(z);
|
|
var V = parseFloat(v);
|
|
|
|
|
|
|
|
price_netto = Z /(1+V/100);
|
|
|
|
|
|
total_netto = X * price_netto;
|
|
|
|
total_brutto = Z * X;
|
|
|
|
// if(Y!=0)
|
|
// {
|
|
// if(Y>99)
|
|
// {
|
|
// Y=99;
|
|
// }
|
|
//
|
|
//
|
|
// discount = total_brutto * (Y/100);
|
|
// total_brutto = total_brutto - discount;
|
|
// }
|
|
//
|
|
// discount_percent = Y;
|
|
vat_amount = total_brutto * (V/(100+V));
|
|
|
|
A = total_netto.toFixed(2);
|
|
B = vat_amount.toFixed(2);
|
|
C = total_brutto.toFixed(2);
|
|
D = price_netto.toFixed(2);
|
|
// y = discount_percent;
|
|
|
|
|
|
output1 = "A" + i;
|
|
output2 = "B" + i;
|
|
output3 = "C" + i;
|
|
output4 = "D" + i;
|
|
// output5 = "y" + i;
|
|
|
|
document.getElementById(output1).value = A;
|
|
document.getElementById(output2).value = B;
|
|
document.getElementById(output3).value = C;
|
|
document.getElementById(output4).value = D;
|
|
// document.getElementById(output5).value = y;
|
|
}
|
|
|
|
</SCRIPT>
|
|
|
|
<?php $i = 0; ?>
|
|
<?php
|
|
foreach ($invoiceProducts as $product) { ?>
|
|
<?php $i++; ?>
|
|
<tr>
|
|
<td class="st_invoice_table_td" style="text-align: center;"><?php echo $i; ?></td>
|
|
|
|
<td class="st_invoice_table_td"><?php echo input_tag("invoice_product[" . $i . "][code]", $product->getCode(), array("size" => "10")) ?></td>
|
|
|
|
<td class="st_invoice_table_td"><?php echo input_tag("invoice_product[" . $i . "][name]", $product->getName(), array("size" => "25")) ?></td>
|
|
|
|
<td class="st_invoice_table_td"><?php echo input_tag("invoice_product[" . $i . "][quantity]", $product->getQuantity(), array("size" => "5", "onkeypress" => "return isNumberKey(event)", "onkeyup" => "checkValue(" . $i . ")", "id" => "x" . $i . "")) ?></td>
|
|
|
|
<td class="st_invoice_table_td"><?php echo input_tag("invoice_product[" . $i . "][measure_unit]", $product->getMeasureUnit(), array("size" => "5")) ?></td>
|
|
|
|
<td class="st_invoice_table_td"><?php echo input_tag("invoice_product[" . $i . "][price_netto]", stCurrency::formatPrice($product->getPriceNetto()), array("size" => "5", "readonly" => "true", "id" => "D" . $i . "")) ?></td>
|
|
|
|
<td class="st_invoice_table_td"><?php echo input_tag("invoice_product[" . $i . "][price_brutto]", stCurrency::formatPrice($product->getPriceBrutto()), array("size" => "5", "onkeypress" => "return isNumberKey(event)", "onkeyup" => "checkValue(" . $i . ")", "id" => "z" . $i . "")) ?></td>
|
|
|
|
<td class="st_invoice_table_td">
|
|
|
|
<?php echo select_tag("invoice_product[" . $i . "][vat]", options_for_select($invoice->getInvoiceUserCustomer()->isCompany() ? $normalTaxRates : $euConsumerTaxRates, $product->getVatId() . ":" . $product->getVat()), array("onchange" => "checkValue(" . $i . ")", "id" => "v" . $i . "")) ?>
|
|
|
|
</td>
|
|
|
|
<td class="st_invoice_table_td"><?php echo input_tag("invoice_product[" . $i . "][total_price_netto]", stCurrency::formatPrice($product->getTotalPriceNetto()), array("size" => "5", "readonly" => "true", "id" => "A" . $i . "")) ?></td>
|
|
|
|
<td class="st_invoice_table_td"><?php echo input_tag("invoice_product[" . $i . "][vat_ammount]", stCurrency::formatPrice($product->getVatAmmount()), array("size" => "5", "readonly" => "true", "id" => "B" . $i . "")) ?></td>
|
|
|
|
<td class="st_invoice_table_td"><?php echo input_tag("invoice_product[" . $i . "][opt_total_price_brutto]", stCurrency::formatPrice($product->getOptTotalPriceBrutto()), array("size" => "8", "readonly" => "true", "id" => "C" . $i . "")) ?></td>
|
|
|
|
<td class="st_invoice_table_td"><?php
|
|
echo link_to(image_tag('backend/icons/delete.gif', array('alt' => __('delete'), 'title' => __('delete'))), 'stInvoiceBackend/deleteProformaInvoiceProduct?id=' . $invoice->getId() . "&product_id=" . $product->getId(). "&return=" . $sf_context->getActionName(), array(
|
|
'post' => true,
|
|
'confirm' => __('Jesteś pewien?', null, 'stAdminGeneratorPlugin'),
|
|
))
|
|
?></td>
|
|
|
|
</tr>
|
|
|
|
<?php echo input_hidden_tag("invoice_product[" . $i . "][product_id]", $product->getId()) ?>
|
|
|
|
<?php } ?>
|
|
|
|
<tr>
|
|
<td colspan="13" align="right">
|
|
<div id="add_row">
|
|
<?php echo st_get_admin_actions_head() ?>
|
|
<?php echo st_get_admin_action('add', __('Dodaj pozycję'), null, array('name' => 'addNwProduct')) ?>
|
|
<?php echo st_get_admin_actions_foot() ?>
|
|
</div>
|
|
|
|
</td>
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<?php echo __('Rodzaj płatności') ?> <?php echo select_tag('invoice[payment_type]', options_for_select(
|
|
array('none' => __('brak'), 'cash' => __('gotówką'), 'transfer_on_delivery' => __('za pobraniem'), 'transfer' => __('przelewem'), 'transfer_zagiel' => __('Żagiel - eRaty'), 'transfer_przelewy24' => __('Przelewy24'), 'transfer_polcard' => __('Polcard'), 'transfer_payu' => __('PayU'), 'transfer_moneybookers' => __('Moneybookers'), 'transfer_lukas' => __('LUKAS Raty'), 'transfer_ecard' => __('eCard'), 'transfer_dotpay' => __('Dotpay'), 'transfer_paypal' => __('Paypal')),
|
|
array($invoice->getPaymentType())
|
|
)) ?>
|
|
<br><br>
|
|
|
|
<?php echo __('Maksymalny czas oczekiwania na płatność') ?> <?php echo select_tag('invoice[max_day]', options_for_select(
|
|
array('none' => __('brak'), '7' => __('7'), '14' => __('14'), '21' => __('21'), '28' => __('28')),
|
|
array($invoice->getMaxDay())
|
|
)) ?>
|
|
|
|
<br><br>
|
|
|
|
<?php echo textarea_tag("invoice[invoice_description]", $invoice->getInvoiceDescription(), array ( 'size' => '54x6', 'rich' => true, 'tinymce_options' => "height:80,width:'100%' ,theme:'simple'")) ?>
|
|
|
|
<br><br>
|
|
|
|
<div style="float:left; width: 340px; text-align:center;">
|
|
|
|
<div class="st_invoice_frame_signature" style="width: 100%;">
|
|
|
|
<div class="st_invoice_frame_header_signature" >
|
|
<?php echo __('Wystawił(a)') ?>:
|
|
</div>
|
|
|
|
<div class="st_invoice_frame_content_signature" >
|
|
<?php echo input_tag("invoice[seller_signature]", $invoice->getSignatureSeller()) ?>
|
|
<br>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="font-size:9px">
|
|
<?php echo __('Podpis osoby upoważnionej do wystawiania faktury VAT') ?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="float:right; width: 340px; margin-right:6px; text-align:center;">
|
|
|
|
<div class="st_invoice_frame_signature" style="width: 100%;">
|
|
|
|
<div class="st_invoice_frame_header_signature" >
|
|
<?php echo __('Odebrał(a)') ?>:
|
|
</div>
|
|
|
|
<div class="st_invoice_frame_content_signature" >
|
|
<?php echo input_tag("invoice[customer_signature]", $invoice->getSignatureCustomer()) ?>
|
|
<br>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="font-size:9px">
|
|
<?php echo __('Podpis osoby upoważnionej do odbioru faktury VAT') ?>
|
|
</div>
|
|
</div>
|
|
<br class="st_clear_all">
|
|
</div>
|
|
|
|
<?php echo input_hidden_tag("invoice[type]", $type) ?>
|
|
<?php echo input_hidden_tag("invoice[invoice_id]", $invoice->getId()) ?>
|
|
<?php echo input_hidden_tag("invoice_user_customer[user_customer_id]", $InvoiceUserCustomer->getId()) ?>
|
|
<?php echo input_hidden_tag("invoice_user_seller[user_seller_id]", $InvoiceUserSeller->getId()) ?>
|
|
|
|
|
|
<!--End edit mode-->
|
|
<?php else
|
|
: ?>
|
|
|
|
<div style="margin: 30px auto; padding: 15px; width: 830px;">
|
|
|
|
<div style="float:left; width: 400px;">
|
|
<?php echo $invoice->getCompanyDescription(); ?>
|
|
</div>
|
|
|
|
<div style=" float:right; width: 400px;">
|
|
|
|
<div class="st_invoice_frame" >
|
|
|
|
<div class="st_invoice_frame_header" >
|
|
<?php echo __('Miejsce wystawienia') ?>:
|
|
</div>
|
|
|
|
<div class="st_invoice_frame_content" >
|
|
<?php echo $invoice->getTown(); ?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="st_invoice_frame" >
|
|
|
|
<div class="st_invoice_frame_header" >
|
|
<?php echo $config->get('date_label', null, true); ?>:
|
|
</div>
|
|
|
|
<div class="st_invoice_frame_content" >
|
|
<?php echo $invoice->getDateSelle(); ?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="st_invoice_frame" >
|
|
|
|
<div class="st_invoice_frame_header" >
|
|
<?php echo __('Data wystawienia') ?>:
|
|
|
|
</div>
|
|
|
|
<div class="st_invoice_frame_content_last" >
|
|
<?php echo $invoice->getDateCreateCopy(); ?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
<div class="st_clear_all"></div>
|
|
<br /><br />
|
|
|
|
|
|
|
|
<div style=" float:left; width: 400px;">
|
|
|
|
<div class="st_invoice_frame" style="width: 100%;">
|
|
|
|
<div class="st_invoice_frame_header" >
|
|
<?php echo __('Sprzedawca') ?>:
|
|
</div>
|
|
|
|
<div class="st_invoice_frame_content_last" style="text-align:left;">
|
|
|
|
<span><?php echo $InvoiceUserSeller->getCompany(); ?></span><br>
|
|
|
|
<?php
|
|
if ($InvoiceUserSeller->getCompany() == ""): ?>
|
|
<span><?php echo $InvoiceUserSeller->getFullName(); ?></span><br>
|
|
<?php endif; ?>
|
|
|
|
<span><?php echo $InvoiceUserSeller->getAddress(); ?></span><br>
|
|
<?php
|
|
if ($InvoiceUserSeller->getAddressMore() != ""): ?>
|
|
<span><?php echo $InvoiceUserSeller->getAddressMore(); ?></span><br>
|
|
<?php endif; ?>
|
|
<?php
|
|
if ($InvoiceUserSeller->getRegion() != ""): ?>
|
|
<span><?php echo $InvoiceUserSeller->getRegion(); ?></span><br>
|
|
<?php endif; ?>
|
|
<span><?php echo $InvoiceUserSeller->getCode(); ?> <?php echo $InvoiceUserSeller->getTown(); ?> <?php echo $InvoiceUserSeller->getCountry(); ?><br> </span>
|
|
<?php
|
|
if ($InvoiceUserSeller->getVatNumber() != ""): ?>
|
|
<span><?php echo __('NIP') ?>: <?php echo $InvoiceUserSeller->getVatNumber(); ?></span>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style=" float:right; width: 400px;">
|
|
|
|
<div class="st_invoice_frame" style="width: 100%;">
|
|
|
|
<div class="st_invoice_frame_header" >
|
|
<?php echo __('Nabywca') ?>:
|
|
</div>
|
|
|
|
<div class="st_invoice_frame_content_last" style="text-align:left;">
|
|
<?php
|
|
if ($InvoiceUserCustomer->getCompany() != ""): ?>
|
|
<span><?php echo $InvoiceUserCustomer->getCompany(); ?></span><br>
|
|
<?php endif; ?>
|
|
<?php
|
|
if ($InvoiceUserCustomer->getCompany() == ""): ?>
|
|
<span><?php echo $InvoiceUserCustomer->getFullName(); ?></span><br>
|
|
<?php endif; ?>
|
|
<span><?php echo $InvoiceUserCustomer->getAddress(); ?></span><br>
|
|
<?php
|
|
if ($InvoiceUserCustomer->getAddressMore() != ""): ?>
|
|
<span><?php echo $InvoiceUserCustomer->getAddressMore(); ?></span><br>
|
|
<?php endif; ?>
|
|
<?php
|
|
if ($InvoiceUserCustomer->getRegion() != ""): ?>
|
|
<span><?php echo $InvoiceUserCustomer->getRegion(); ?></span><br>
|
|
<?php endif; ?>
|
|
<span><?php echo $InvoiceUserCustomer->getCode(); ?> <?php echo $InvoiceUserCustomer->getTown(); ?> <?php echo $InvoiceUserCustomer->getCountry(); ?><br></span>
|
|
<?php
|
|
if ($InvoiceUserCustomer->getVatNumber() != ""): ?>
|
|
<span><?php echo __('NIP') ?>: <?php echo $InvoiceUserCustomer->getVatNumber(); ?></span><br>
|
|
<?php endif; ?>
|
|
<?php
|
|
if ($InvoiceUserCustomer->getPesel() != ""): ?>
|
|
<span><?php echo __('PESEL') ?>: <?php echo $InvoiceUserCustomer->getPesel(); ?></span><br>
|
|
<?php endif; ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="st_clear_all"></div>
|
|
<br /><br />
|
|
|
|
<div id="st_invoice_number">
|
|
<?php echo $config->get('invoice_label', null, true); ?>
|
|
<?php echo $invoice->getNumber(); ?>
|
|
</div>
|
|
|
|
<br />
|
|
|
|
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="st_invoice_table">
|
|
<tr>
|
|
<td width="10px" class="st_invoice_table_head"><?php echo __('Lp') ?></td>
|
|
|
|
<td width="50px" class="st_invoice_table_head"><?php echo __('Kod') ?></td>
|
|
|
|
<td width="150px" class="st_invoice_table_head"><?php echo __('Nazwa') ?></td>
|
|
|
|
<td class="st_invoice_table_head"><?php echo __('Ilość') ?></td>
|
|
|
|
<td class="st_invoice_table_head"><?php echo __('j.m.') ?></td>
|
|
|
|
<td class="st_invoice_table_head"><?php echo __('Cena jed.') ?><br/><?php echo __('netto') ?></td>
|
|
|
|
<td class="st_invoice_table_head"><?php echo __('Cena jed.') ?><br/><?php echo __('brutto') ?></td>
|
|
|
|
<td class="st_invoice_table_head"><?php echo __('VAT') ?><br/>[%]</td>
|
|
|
|
<td class="st_invoice_table_head"><?php echo __('Wartość netto') ?></td>
|
|
|
|
<td class="st_invoice_table_head"><?php echo __('VAT') ?></td>
|
|
|
|
<td class="st_invoice_table_head"><?php echo __('Wartość brutto') ?></td>
|
|
</tr>
|
|
<?php $i = 0; ?>
|
|
<?php
|
|
foreach ($invoiceProducts as $product) { ?>
|
|
|
|
<tr>
|
|
<td class="st_invoice_table_td" style="text-align:center;"><?php $i++; ?><?php echo $i; ?></td>
|
|
|
|
<td class="st_invoice_table_td" style="text-align:left;"><?php echo $product->getCode(); ?></td>
|
|
|
|
<td class="st_invoice_table_td" style="text-align:left;"><?php echo $product->getName(); ?></td>
|
|
|
|
<td class="st_invoice_table_td" style="text-align:center;"><?php echo $product->getQuantity(); ?></td>
|
|
|
|
<td class="st_invoice_table_td" style="text-align:center;"><?php echo $product->getMeasureUnit(); ?></td>
|
|
|
|
<td class="st_invoice_table_td"><?php echo st_back_price($product->getPriceNetto()) ?></td>
|
|
|
|
<td class="st_invoice_table_td"><?php echo st_back_price($product->getPriceBrutto()) ?></td>
|
|
|
|
<?php
|
|
|
|
$vat = $product->getVat();
|
|
|
|
$c = new Criteria();
|
|
$c->add(TaxPeer::ID, $product->getVatId());
|
|
$tax = TaxPeer::doSelectOne($c);
|
|
|
|
if($tax){
|
|
|
|
if($tax->getVatName()=="zw"){
|
|
$vat = "zw";
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<td class="st_invoice_table_td" style="text-align:center;"><?php echo $vat ?></td>
|
|
|
|
|
|
|
|
<td class="st_invoice_table_td"><?php echo st_back_price($product->getTotalPriceNetto()) ?></td>
|
|
|
|
<td class="st_invoice_table_td"><?php echo st_back_price($product->getVatAmmount()) ?></td>
|
|
|
|
<td class="st_invoice_table_td"><?php echo st_back_price($product->getOptTotalPriceBrutto()) ?></td>
|
|
</tr>
|
|
|
|
<?php } ?>
|
|
|
|
</table>
|
|
<br>
|
|
<?php
|
|
if (!$invoice->getIsProforma()): ?>
|
|
|
|
<div>
|
|
<div style="float:right; width:550px;">
|
|
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="st_invoice_table">
|
|
<tr>
|
|
<td width="200px" class="st_invoice_table_head"><?php echo __('według stawki VAT') ?></td>
|
|
|
|
<td class="st_invoice_table_head"><?php echo __('wartość netto') ?></td>
|
|
|
|
<td class="st_invoice_table_head"><?php echo __('kwota VAT') ?></td>
|
|
|
|
<td class="st_invoice_table_head"><?php echo __('wartość brutto') ?></td>
|
|
</tr>
|
|
<?php $i = 0; ?>
|
|
<?php
|
|
$sumTotalNetto = 0;
|
|
$sumTotalAmmountVat = 0;
|
|
$sumTotalBrutto = 0;
|
|
?>
|
|
<?php
|
|
foreach ($invoice->getTaxRatesSummary() as $rate => $taxRateSummary) { ?>
|
|
|
|
<tr>
|
|
<td class="st_invoice_table_td" style="text-align:left;">
|
|
<?php
|
|
if ($taxRateSummary['is_default'] == 1): ?>
|
|
<?php echo __('Podstawowy podatek VAT') ?> <?php echo $rate ?>%
|
|
<?php else: ?>
|
|
<?php echo __('Podatek VAT') ?> <?php echo $rate ?>%
|
|
<?php endif; ?>
|
|
</td>
|
|
|
|
<td class="st_invoice_table_td" style="text-align:right;"><?php echo st_back_price($taxRateSummary['total_netto']) ?></td>
|
|
|
|
<td class="st_invoice_table_td" style="text-align:right;"><?php echo st_back_price($taxRateSummary['total_ammount_vat']) ?></td>
|
|
|
|
<td class="st_invoice_table_td" style="text-align:right;"><?php echo st_back_price($taxRateSummary['total_brutto']) ?></td>
|
|
</tr>
|
|
|
|
<?php
|
|
$sumTotalNetto += stCurrency::formatPrice($taxRateSummary['total_netto']);
|
|
$sumTotalAmmountVat += stCurrency::formatPrice($taxRateSummary['total_ammount_vat']);
|
|
$sumTotalBrutto += stCurrency::formatPrice($taxRateSummary['total_brutto']);
|
|
?>
|
|
<?php } ?>
|
|
|
|
<tr>
|
|
<td class="st_invoice_table_td" style="border-color: #fff; text-align:right;"><?php echo __('Razem') ?>:</td>
|
|
|
|
<td class="st_invoice_table_td" style="border-color: #fff; text-align:right;"><?php echo st_back_price($sumTotalNetto) ?></td>
|
|
|
|
<td class="st_invoice_table_td" style="border-color: #fff; text-align:right;"><?php echo st_back_price($sumTotalAmmountVat) ?></td>
|
|
|
|
<td class="st_invoice_table_td" style="border-color: #fff; text-align:right;"><?php echo st_back_price($sumTotalBrutto) ?></td>
|
|
</tr>
|
|
|
|
</table>
|
|
<br>
|
|
</div>
|
|
<br class="st_clear_all">
|
|
<?php endif ?>
|
|
<div class="st_invoice_frame" style="float:right; width:450px;">
|
|
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="font-size: 16px">
|
|
<?php
|
|
if ($invoice->getIsProforma() && $invoice->hasDiscount() && $invoice->getTotalDiscountAmount() > 0): ?>
|
|
<tr>
|
|
<td><?php echo __('Razem') ?>:</td>
|
|
<td style="text-align: right; padding:7px;"><?php echo st_back_price($invoice->getTotalAmount(false))." ".$shortcut ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td><?php echo __('Rabat', null, 'stOrder') ?>:</td>
|
|
<td style="text-align: right; padding:7px;">-<?php echo st_back_price($invoice->getTotalDiscountAmount())." ".$shortcut ?></td>
|
|
</tr>
|
|
<?php endif ?>
|
|
<tr class="st_invoice_frame_header" style="font-weight: bold;">
|
|
<td style="text-align: left; padding:7px;"><?php echo __('Razem do zapłaty') ?>:</td>
|
|
<td style="text-align: right; padding:7px;"><?php echo st_back_price($invoice->getTotalAmount())." ".$shortcut; ?></td>
|
|
</tr>
|
|
</table>
|
|
<?php
|
|
if ($culture=='pl_PL')
|
|
: ?>
|
|
<div class="st_invoice_frame_content_last" style="text-align:left;">
|
|
<?php echo __('Słownie') ?>: <?php
|
|
$ammountArr1 = explode('.', $invoice->getTotalAmount());
|
|
|
|
$ammountArr2 = explode('.', number_format($invoice->getTotalAmount(), 2));
|
|
|
|
echo ( @stInvoice::getAmmountWord($ammountArr1[0]) . " " . $shortcut . " " . $ammountArr2[1] . '/100' );
|
|
?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<div class="st_invoice_frame" style="float:left; width:400px;">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<?php
|
|
if ($status->getPaidAmount() > 0)
|
|
: ?>
|
|
<tr>
|
|
<td>
|
|
<b><?php echo __("Zapłacono"); ?>:</b></td>
|
|
<td style="padding-left: 10px"><?php echo st_back_price($paid_amount)." ".$shortcut ?></td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<b><?php echo __("Pozostało do zapłaty"); ?>:</b></td>
|
|
<td style="padding-left: 10px">
|
|
<b><?php echo st_back_price($unpaid_amount)." ".$shortcut ?></b></td>
|
|
</tr>
|
|
<?php else: ?>
|
|
<tr>
|
|
<td>
|
|
<b><?php echo __("Do zapłaty"); ?>:</b></td>
|
|
<td style="padding-left: 10px"><?php echo st_back_price($paid_amount)." ".$shortcut ?></td>
|
|
</tr>
|
|
<?php endif; ?>
|
|
</table>
|
|
<div style="float:left;">
|
|
<?php
|
|
if ($invoice->getPaymentType()!="none"): ?>
|
|
|
|
<?php echo __("płatność"); ?>
|
|
|
|
<?php
|
|
if ($invoice->getPaymentType()=="cash"): ?>
|
|
<?php echo __("gotówką"); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
if ($invoice->getPaymentType()=="transfer_on_delivery"): ?>
|
|
<?php echo __("za pobraniem"); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
if ($invoice->getPaymentType()=="transfer"): ?>
|
|
<?php echo __("przelewem"); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
if ($invoice->getPaymentType()=="transfer_zagiel"): ?>
|
|
<?php echo __("Żagiel - eRaty"); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
if ($invoice->getPaymentType()=="transfer_przelewy24"): ?>
|
|
<?php echo __("Przelewy24"); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
if ($invoice->getPaymentType()=="transfer_polcard"): ?>
|
|
<?php echo __("Polcard"); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
if ($invoice->getPaymentType()=="transfer_payu"): ?>
|
|
<?php echo __("PayU"); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
if ($invoice->getPaymentType()=="transfer_moneybookers"): ?>
|
|
<?php echo __("Moneybookers"); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
if ($invoice->getPaymentType()=="transfer_lukas"): ?>
|
|
<?php echo __("LUKAS Raty"); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
if ($invoice->getPaymentType()=="transfer_ecard"): ?>
|
|
<?php echo __("eCard"); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
if ($invoice->getPaymentType()=="transfer_dotpay"): ?>
|
|
<?php echo __("Dotpay"); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
if ($invoice->getPaymentType()=="transfer_paypal"): ?>
|
|
<?php echo __("Paypal"); ?>
|
|
<?php endif; ?>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
if ($invoice->getMaxDay()!="none"): ?>
|
|
<?php echo __("termin płatności"); ?> <?php echo $invoice->getMaxDay() ?> <?php echo __("dni"); ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="st_clear_all"></div>
|
|
<br />
|
|
<?php echo $invoice->getInvoiceDescription(); ?>
|
|
|
|
|
|
<br><br>
|
|
|
|
<div style="float:left; width: 340px; text-align:center;">
|
|
|
|
<div class="st_invoice_frame_signature" style="width: 100%;">
|
|
|
|
<div class="st_invoice_frame_header_signature" >
|
|
<?php echo __('Wystawił(a)') ?>:
|
|
</div>
|
|
|
|
<div class="st_invoice_frame_content_signature" >
|
|
<?php echo $invoice->getSignatureSeller(); ?>
|
|
<br>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="font-size:9px">
|
|
<?php echo __('Podpis osoby upoważnionej do wystawiania faktury VAT') ?>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="float:right; width: 340px; margin-right:15px; text-align:center;">
|
|
|
|
<div class="st_invoice_frame_signature" style="width: 100%;">
|
|
|
|
<div class="st_invoice_frame_header_signature" >
|
|
<?php echo __('Odebrał(a)') ?>:
|
|
</div>
|
|
|
|
<div class="st_invoice_frame_content_signature" >
|
|
<?php echo $invoice->getSignatureCustomer(); ?>
|
|
<br>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div style="font-size:9px">
|
|
<?php echo __('Podpis osoby upoważnionej do odbioru faktury VAT') ?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
|
|