Changeset 61 for www/finance


Ignore:
Timestamp:
Apr 1, 2008, 8:00:13 AM (17 years ago)
Author:
george
Message:

Upraveno: Správa generování dokladů. Řazení podle jména. Možnost regenerovat PDF data.

Location:
www/finance
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • www/finance/bills.php

    r52 r61  
    11<?php
    2 include_once('../style.php');
    32include('code.php');
    43
     
    4140      $User['psc'].' '.$User['town'].'<br>';
    4241      if($User['ico'] != 0) $Output .= 'IČO: '.$User['ico'].'<br>';
     42      if($User['dic'] != '') $Output .= 'DIČ: '.$User['dic'].'<br>';
    4343      $Output .=
    4444      '</td></tr>'.
     
    9696  }
    9797
     98  function RegeneratePDF($BillId)
     99  {
     100    global $Database;
     101
     102    $PdfData = $this->HtmlToPdf($this->GenerateBill($BillId));
     103    $Database->query('UPDATE finance_bills SET pdf = 0x'.bin2hex($PdfData).' WHERE id='.$BillId);
     104  }
     105
    98106  function ShowStoredBill($BillId)
    99107  {
     
    149157      while($Item = $DbResult->fetch_array())
    150158      {
    151         echo('<a href="?bill='.$Item['id'].'">faktura '.$Item['id'].'</a> <a href="?billpdf='.$Item['id'].'">PDF</a> <a href="?billpdf2='.$Item['id'].'">PDF</a><br>');
     159        echo('<a href="?bill='.$Item['id'].'">faktura '.$Item['id'].'</a> <a href="?billpdf='.$Item['id'].'">Uložené PDF</a> <a href="?billpdf2='.$Item['id'].'">Generované PDF</a> <a href="?regenerate='.$Item['id'].'">Přegenerovat</a><br>');
    152160      }
    153161    } else
     
    159167    {
    160168      $this->ShowGeneratedBill($_GET['billpdf2']);
     169    } else
     170    if(array_key_exists('regenerate', $_GET))
     171    {
     172      $this->RegeneratePDF($_GET['regenerate']);
    161173    } else
    162174    if(array_key_exists('bill', $_GET))
     
    171183      ShowHeader('Faktury', 'Faktury');
    172184      echo('Faktury:<br>');
    173       $DbResult = $Database->select('users', '*, CONCAT(second_name," ", first_name)  as fullname');
     185      $DbResult = $Database->select('users', '*, CONCAT(second_name," ", first_name)  as fullname', '1 ORDER BY fullname');
    174186      while($User = $DbResult->fetch_array())
    175187      {
     
    182194
    183195$InvoiceGenerator = new InvoiceGenerator;
    184 //$InvoiceGenerator->ShowPage();
     196
    185197?>
Note: See TracChangeset for help on using the changeset viewer.