Advertisement
Guest User

rabat

a guest
Jan 24th, 2017
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 16.41 KB | None | 0 0
  1. <style>
  2.   page {
  3.     padding: 20 15 20 15;
  4.     font-size: 8;
  5.     font-family: LiberationSans;
  6.   }
  7.  
  8.   td, th {
  9.     padding: 0.5 1 0 1;
  10.   }
  11.  
  12.   translation {
  13.     <? if ($invoice['Invoice']['translation_language_id']):?>
  14.       font-size: 6;
  15.       font-style: italic;
  16.       display: inline;
  17.     <? else: // w przypadku faktury w języku polskim tłumaczenia są ukryte ?>
  18.       display: none;
  19.     <? endif ?>
  20.   }
  21. </style>
  22.  
  23. <? foreach ($parameters['pages'] as $page): ?>
  24. <page>
  25.   <header height="85">
  26.     <style>
  27.       .invoice-header {
  28.         position: absolute;
  29.         y: -10;
  30.         text-align: center;
  31.       }
  32.      
  33.       /* logo */
  34.       .invoice-logo {
  35.         width: 45%;
  36.         height: 40;
  37.         float: left;
  38.       }
  39.      
  40.       /* main info - start */
  41.       .invoice-main-info {
  42.         width: 48%;
  43.         float: right;
  44.       }
  45.      
  46.       .invoice-main-info tr th {
  47.         padding: 1.5 0 1.5 0;
  48.       }
  49.       .invoice-main-info tr td {
  50.         padding: 1 0 1 1;
  51.       }
  52.      
  53.       .invoice-main-info tr:child(0) {
  54.         font-size: 9;
  55.         text-align: center;
  56.         background-gradient-type: linear;
  57.         background-gradient-color1: white;
  58.         background-gradient-color2: lightgrey;
  59.       }
  60.      
  61.       .invoice-main-info tr td div:child(0) {
  62.         width: 49%;
  63.         float: left;
  64.       }
  65.      
  66.       .invoice-main-info tr td div:child(1) {
  67.         width: 49%;
  68.         float: right;
  69.       }
  70.      
  71.       .invoice-main-info tr td div div:child(0) {
  72.         width: 57%;
  73.         float: left;
  74.       }
  75.      
  76.       .invoice-main-info tr td div div:child(1) {
  77.         width: 42%;
  78.         float: right;
  79.       }
  80.       /* main info - stop */
  81.      
  82.      
  83.       /* transaction sides - start */
  84.       .invoice-transaction-side:child(0) {
  85.         width: 48%;
  86.         float: left;
  87.       }
  88.      
  89.       .invoice-transaction-side:child(1) {
  90.         width: 48%;
  91.         float: right;
  92.       }
  93.       /* transaction sides - stop */
  94.      
  95.      
  96.       .invoice-bar {
  97.         position: absolute;
  98.         y: 71;
  99.         font-size: 10;
  100.         text-align: right;
  101.         padding: 0 1 -0.5 0;
  102.         margin-top: 2;
  103.         border-bottom: 1px;
  104.         background-gradient-type: linear;
  105.         background-gradient-color1: white;
  106.         background-gradient-color2: lightgrey;
  107.         background-gradient-coordinates: 0 0 1 0;
  108.       }
  109.      
  110.     </style>
  111.    
  112.     <? if ($invoice['Invoice']['header']): ?>
  113.     <p class="invoice-header"><?=$xml->sanitize($invoice['Invoice']['header']);?></p>
  114.     <? endif ?>
  115.    
  116.     <div class="invoice-logo">
  117.       <? if ($parameters['logo_path']): ?>
  118.       <img width="80" src="<?=$parameters['logo_path']?>"/>
  119.       <? endif ?>
  120.     </div>
  121.    
  122.     <div class="invoice-main-info">
  123.       <table>
  124.         <tr>
  125.           <th>Faktura<?=$xml->sanitize($parameters['document_name_suffix'])?> nr <?=$xml->sanitize($invoice['Invoice']['fullnumber'])?></th>
  126.         </tr>
  127.         <tr>
  128.           <td>
  129.             <div>
  130.               <div>Data wystawienia:<br/><translation><?=$translation->get('Invoice:Data wystawienia')?></translation></div>
  131.               <div><?=$xml->sanitize($invoice['Invoice']['date'])?></div>
  132.               <div clear="both"/>
  133.             </div>
  134.            
  135.             <div>
  136.               <? if(!$invoice['Invoice']['disposaldate_empty']): ?>
  137.                 <div>Data sprzedaży:<br/><translation><?=$translation->get('Invoice:Data sprzedaży')?></translation></div>
  138.                 <div><?=$xml->sanitize($invoice['Invoice']['disposaldate_format'] == 'month' ? date('Y-m', strtotime($invoice['Invoice']['disposaldate'])) : $invoice['Invoice']['disposaldate'])?></div>
  139.               <? endif ?>
  140.               <div clear="both"/>
  141.             </div>
  142.            
  143.             <div clear="both"/>
  144.           </td>
  145.         </tr>
  146.         <tr>
  147.           <td>
  148.             <div>
  149.               <div>Termin płatności:<br/><translation><?=$translation->get('Invoice:Termin płatności')?></translation></div>
  150.               <div><?=$xml->sanitize($invoice['Invoice']['paymentdate'])?></div>
  151.               <div clear="both"/>
  152.             </div>
  153.            
  154.             <div>
  155.               <div>Metoda płatności:<br/><translation><?=$translation->get('Invoice:Metoda płatności')?></translation></div>
  156.               <div><?=$xml->sanitize($invoice['Invoice']['paymentmethod'])?><br/><translation><?=$xml->sanitize($translation->get('Invoice:'.$invoice['Invoice']['paymentmethod']))?></translation></div>
  157.               <div clear="both"/>
  158.             </div>
  159.            
  160.             <div clear="both"/>
  161.           </td>
  162.         </tr>
  163.       </table>
  164.     </div>
  165.    
  166.     <div clear="both"/>
  167.    
  168.     <? if ($parameters['duplicate']): ?>
  169.     <div position="absolute" x="50" y="25">
  170.       <img width="40" src="/images/duplicate/<?=date("Y-m-d")?>.png"/>
  171.     </div>
  172.     <? endif ?>
  173.    
  174.     <div class="invoice-transaction-side">
  175.       <h3>Sprzedawca: <translation>(<?=$translation->get('Invoice:Sprzedawca')?>)</translation></h3>
  176.       <p><?=nl2br($xml->sanitize($invoice['Invoice']['sellerinfo']))?></p>
  177.     </div>
  178.    
  179.     <div class="invoice-transaction-side">
  180.       <h3>Nabywca: <translation>(<?=$translation->get('Invoice:Nabywca')?>)</translation></h3>
  181.       <p><?=nl2br($xml->sanitize($invoice['Invoice']['buyerinfo']))?></p>
  182.     </div>
  183.    
  184.     <div clear="both"/>
  185.    
  186.    
  187.     <div class="invoice-bar">
  188.       <? if ($parameters['show_page_type']): ?>
  189.         <?=$page == 'original' ? 'O R Y G I N A Ł' : 'K O P I A'?>
  190.       <? else: ?>
  191.           <br/>
  192.       <? endif ?>
  193.     </div>
  194.    
  195.   </header>
  196.  
  197.   <body>
  198.     <table>
  199.       <header>
  200.         <tr>
  201.           <td width="3%">Lp<br/><translation><?=$translation->get('Invoice:Lp')?></translation></td>
  202.           <td>Nazwa<br/><translation><?=$translation->get('Invoice:Nazwa')?></translation></td>
  203.           <? if ($parameters['show_classification']): ?>
  204.           <td width="7%">PKWiU<br/><translation><?=$translation->get('Invoice:PKWiU')?></translation></td>
  205.           <? endif ?>
  206.           <td width="6%">Jedn.<br/><translation><?=$translation->get('Invoice:Jedn.')?></translation></td>
  207.           <td width="6%">Ilość<br/><translation><?=$translation->get('Invoice:Ilość')?></translation></td>
  208.           <td width="11%"><?=$invoice['Invoice']['tax_evaluation_method'] == 'netto' ? 'Cena netto' : 'Cena brutto'?><br/><translation><?=$translation->get('Invoice:Cena')?></translation></td>
  209.           <? if ($parameters['show_discount']): ?>
  210.           <td width="6%">Rabat</td>
  211.                   <td width="13%">Cena z rabatem</td>
  212.           <? endif ?>
  213.           <td width="8%">Stawka<br/><translation><?=$translation->get('Invoice:Stawka')?></translation></td>
  214.           <td width="12%">Wartość netto<br/><translation><?=$translation->get('Invoice:Wartość netto')?></translation></td>
  215.           <td width="12%">Wartość brutto<br/><translation><?=$translation->get('Invoice:Wartość brutto')?></translation></td>
  216.         </tr>
  217.       </header>
  218.      
  219.      
  220.       <? foreach ($invoiceContents as $key => $invoiceContent): ?>
  221.       <tr class="invoice-content">
  222.         <td><?=$key + 1?></td>
  223.         <td><?=$xml->sanitize($invoiceContent['InvoiceContent']['name'])?></td>
  224.         <? if ($parameters['show_classification']): ?>
  225.         <td><?=$xml->sanitize($invoiceContent['InvoiceContent']['classification'])?></td>
  226.         <? endif ?>
  227.         <td><?=$xml->sanitize($invoiceContent['InvoiceContent']['unit'])?></td>
  228.         <td class="invoice-content-count"><?=$xml->niceFloat($invoiceContent['InvoiceContent']['count'])?></td>
  229.         <td class="invoice-content-price"><?=$xml->currency($invoiceContent['InvoiceContent']['price'])?></td>
  230.         <? if ($parameters['show_discount']): ?>
  231.         <td width="5%"><?=$xml->niceFloat($invoiceContent['InvoiceContent']['discount_percent'])?>%</td>
  232.     <td width="9%"><?=$xml->currency($invoiceContent['InvoiceContent']['price'] - round($invoiceContent['InvoiceContent']['price'] * str_replace(',','.', $invoiceContent['InvoiceContent']['discount_percent']) / 100, 2))?></td>
  233.         <? endif ?>
  234.         <td><?=$invoiceContent['InvoiceContent']['vatcode']?></td>
  235.         <td class="invoice-content-netto"><?=$xml->currency($invoiceContent['InvoiceContent']['netto'])?></td>
  236.         <td class="invoice-content-brutto"><?=$xml->currency($invoiceContent['InvoiceContent']['brutto'])?></td>
  237.       </tr>
  238.       <? endforeach ?>
  239.     </table>
  240.    
  241.   </body>
  242.  
  243.   <footer height="80" margin-top="5">
  244.     <style>
  245.       /* vat sums - start */
  246.       .invoice-sums {
  247.         float: left;
  248.         width: 50%;
  249.       }
  250.       .invoice-sums th {
  251.         font-style: normal;
  252.       }
  253.       /* vat sums - stop */
  254.      
  255.      
  256.       /* payment info - start */
  257.       .invoice-payment-info {
  258.         border:0;
  259.         float: right;
  260.         width: <?=$invoice['Invoice']['translation_language_id'] ? '40%' : '30%'?>;
  261.       }
  262.       .invoice-payment-info tr td:child(1) {
  263.         text-align: right;
  264.       }
  265.       /* payment info - stop */
  266.      
  267.      
  268.       /* annotations - start */
  269.       .invoice-annotations {
  270.         float: left;
  271.         width: 48%;
  272.       }
  273.       .invoice-annotations p {
  274.         margin-top:3;
  275.       }
  276.       /* annotations - stop */
  277.      
  278.       .invoice-qr-code {
  279.         width: 25;
  280.         float: right;
  281.         text-align: center;
  282.         font-size: 6;
  283.       }
  284.      
  285.       .invoice-additional-image {
  286.         float: right;
  287.         width: 70;
  288.       }
  289.      
  290.      
  291.       /* signatures - start */
  292.       .invoice-signature {
  293.         text-align: center;
  294.         width: 45;
  295.       }
  296.       .invoice-signature:child(0) {
  297.         float: left;
  298.       }
  299.       .invoice-signature:child(1) {
  300.         float: right;
  301.       }
  302.       .invoice-signature span:child(0) {
  303.         font-style: bold;
  304.       }
  305.       .invoice-signature span:child(1) {
  306.         font-size: 7;
  307.       }
  308.       /* signatues - stop */
  309.      
  310.       .invoice-footer {
  311.         margin-top: 5;
  312.         text-align: center;
  313.       }
  314.     </style>
  315.  
  316.     <table class="invoice-sums">
  317.       <tr>
  318.         <th width="25%">Stawka VAT<br/><translation><?=$translation->get('Invoice:Stawka VAT')?></translation></th>
  319.         <th width="25%">Wartość Netto<br/><translation><?=$translation->get('Invoice:Wartość netto')?></translation></th>
  320.         <th width="25%">Kwota VAT<br/><translation><?=$translation->get('Invoice:Kwota VAT')?></translation></th>
  321.         <th width="25%">Wartość Brutto<br/><translation><?=$translation->get('Invoice:Wartość brutto')?></translation></th>
  322.       </tr>
  323.  
  324.       <? foreach ($invoice['VatContent'] as $vatContent): ?>
  325.         <tr>
  326.           <td><?=$vatContent['VatCode']['label']?></td>
  327.           <td><?=$xml->currency($vatContent['netto'])?></td>
  328.           <td><?=$xml->currency($vatContent['tax'])?></td>
  329.           <td><?=$xml->currency($vatContent['brutto'])?></td>
  330.         </tr>
  331.       <? endforeach ?>
  332.      
  333.       <tr>
  334.         <td>Razem <translation>(<?=$translation->get('Invoice:Razem')?>)</translation></td>
  335.         <td><?=$xml->currency($invoice['Invoice']['vat_content_netto'])?></td>
  336.         <td><?=$xml->currency($invoice['Invoice']['vat_content_tax'])?></td>
  337.         <td><?=$xml->currency($invoice['Invoice']['vat_content_brutto'])?></td>
  338.       </tr>
  339.     </table>
  340.    
  341.     <table class="invoice-payment-info">
  342.       <tr>
  343.         <td>Razem: <translation>(<?=$translation->get('Invoice:Metoda płatności')?>)</translation></td>
  344.         <td><?=$xml->currency($invoice['Invoice']['total'])?> <?=$invoice['Invoice']['currency']?></td>
  345.       </tr>
  346.       <tr>
  347.         <td width="60%">Zapłacono: <translation>(<?=$translation->get('Invoice:Zapłacono')?>)</translation></td>
  348.         <td width="40%"><?=$xml->currency($invoice['Invoice']['alreadypaid_initial'])?> <?=$invoice['Invoice']['currency']?></td>
  349.       </tr>
  350.       <tr>
  351.         <td>Pozostało: <translation>(<?=$translation->get('Invoice:Do zapłaty')?>)</translation></td>
  352.         <td><?=$xml->currency($invoice['Invoice']['total'] - $invoice['Invoice']['alreadypaid_initial'])?> <?=$invoice['Invoice']['currency']?></td>
  353.       </tr>
  354.     </table>
  355.    
  356.     <div clear="both"/>
  357.    
  358.     <div class="invoice-annotations">
  359.       <? if ($invoice['Invoice']['legal_annotations']): ?>
  360.       <p><?=$xml->sanitize($invoice['Invoice']['legal_annotations'])?></p>
  361.       <? endif ?>
  362.      
  363.       <? if (isset($invoice['Order']['type']) && $invoice['Order']['type'] == 'proforma'): ?>
  364.       <p>Zamówienie: <translation>(<?=$translation->get('Invoice:Zamówienie')?>)</translation> <?=$xml->sanitize($invoice['Order']['fullnumber'])?></p>
  365.       <? endif ?>
  366.      
  367.       <? if ($invoice['Invoice']['description']): ?>
  368.       <p>
  369.         Uwagi: <translation>( <?=$translation->get('Invoice:Uwagi')?>)</translation><br/>
  370.         <?=nl2br($invoice['Invoice']['description'])?>
  371.       </p>
  372.       <? endif ?>
  373.      
  374.       <? if ($invoice['Invoice']['currency'] != 'PLN' && !$parameters['show_invoice_foreign_currency_vat_content']): ?>
  375.       <p>
  376.         1 <?=$invoice['Invoice']['currency']?> = <?=number_format($invoice['Invoice']['currency_exchange'], 4, ',', ' ')?> PLN<br/>
  377.         Kurs z dnia: <?=$invoice['Invoice']['currency_date']?><br/>
  378.         Numer tabeli: <?=$invoice['Invoice']['currency_label']?>
  379.       </p>
  380.       <? endif ?>
  381.     </div>
  382.  
  383.     <? if ($parameters['invoice_send_external_type'] != 'none'): ?>
  384.     <div class="invoice-qr-code">
  385.       <a href="http://<?=$parameters['app_server']?>/faktura/<?=$invoice['Invoice']['id']?>/<?=$invoice['Invoice']['hash']?>">
  386.         <qr-code>http://<?=$parameters['app_server']?>/faktura/<?=$invoice['Invoice']['id']?>/<?=$invoice['Invoice']['hash']?></qr-code><br/>
  387.         panel klienta
  388.       </a>
  389.     </div>
  390.     <? endif ?>
  391.     <div clear="right"/>
  392.    
  393.     <? if ($parameters['additional_image_path']): ?>
  394.     <div class="invoice-additional-image">
  395.       <img width="70" src="<?=$parameters['additional_image_path']?>"/>
  396.     </div>
  397.     <? endif ?>
  398.    
  399.     <div clear="both" margin-bottom="5"/>
  400.    
  401.     <? if ($parameters['signature_image_path']): ?>
  402.       <img width="70" src="<?=$parameters['signature_image_path']?>"/>
  403.     <? endif ?>
  404.    
  405.    
  406.     <div margin-top="2">
  407.       <div class="invoice-signature">
  408.         <span><?=$xml->sanitize($invoice['Invoice']['user_name'])?></span><br/>
  409.         <span>Imię i nazwisko osoby uprawnionej do wystawiania faktury</span>
  410.       </div>
  411.      
  412.       <div class="invoice-signature">
  413.         <span><br/></span><br/>
  414.         <span>Imię i nazwisko osoby uprawnionej do odbioru faktury</span>
  415.       </div>
  416.      
  417.       <div clear="both"/>
  418.     </div>
  419.    
  420.     <? if ($invoice['Invoice']['footer']): ?>
  421.     <p class="invoice-footer"><?=$xml->sanitize($invoice['Invoice']['footer']);?></p>
  422.     <? endif ?>
  423.   </footer>
  424. </page>
  425.  
  426. <? if ($page == 'original' && $parameters['address']): // opcja adresu korespondecyjnego na odwrocie oryginału ?>
  427. <page padding-left="119" padding-top="255">
  428.   <?=nl2br($xml->sanitize($invoice['Invoice']['buyeraddress']));?>
  429. </page>
  430. <? endif ?>
  431. <? endforeach ?>
  432.  
  433. <? if ($parameters['leaflet']): // druczek przelewu ?>
  434. <page padding="20 0 0 20">
  435.   <? for ($i = 0; $i < 2; $i++): ?>
  436.   <div width="164" height="106" background-image="/images/reports/invoices/leaflet_<?=$i?>.png">
  437.     <style>
  438.       entry {
  439.         margin-left: 22.5;
  440.         margin-top: 4.6;
  441.       }
  442.     </style>
  443.  
  444.     <entry><?=$xml->sanitize($invoice['CompanyDetail']['name'])?></entry>
  445.     <entry>
  446.       <?=$xml->sanitize($invoice['CompanyDetail']['street'])?> <?=$xml->sanitize($invoice['CompanyDetail']['building_number'])?><?=$invoice['CompanyDetail']['flat_number'] ? "/".$xml->sanitize($invoice['CompanyDetail']['flat_number']) : ""?>,
  447.       <?=$xml->sanitize($invoice['CompanyDetail']['zip'])?> <?=$xml->sanitize($invoice['CompanyDetail']['city'])?>
  448.     </entry>
  449.     <entry letter-spacing="5"><?=str_replace(" ", "", $xml->sanitize($invoice['CompanyDetail']['bank_account']))?></entry>
  450.     <entry margin-left="98"><?=str_replace(".", ",", $invoice['Invoice']['remaining'])?></entry>
  451.     <entry><br/></entry>
  452.     <entry><?=$xml->sanitize($invoice['ContractorDetail']['name'])?></entry>
  453.     <entry>
  454.       <?=$xml->sanitize($invoice['ContractorDetail']['street'])?>,
  455.       <?=$xml->sanitize($invoice['ContractorDetail']['zip'])?> <?=$xml->sanitize($invoice['ContractorDetail']['city'])?>
  456.     </entry>
  457.     <entry><?=$xml->sanitize($invoice['Invoice']['fullnumber'])?></entry>
  458.   </div>
  459.   <? endfor ?>
  460. </page>
  461. <? endif ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement