Ignore:
Timestamp:
Apr 6, 2020, 11:17:40 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved code format.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Finance/Bill.php

    r748 r873  
    88  function GenerateHTML()
    99  {
    10     return('');
     10    return ('');
    1111  }
    1212
     
    2222  {
    2323    $Encoding = new Encoding();
    24     if($this->Checked == false) {
    25       if(CommandExist('htmldoc')) {
     24    if ($this->Checked == false) {
     25      if (CommandExist('htmldoc')) {
    2626        $this->Checked = true;
    2727      } else throw new Exception('htmldoc is not installed.');
     
    2929    $Output = shell_exec('echo "'.addslashes($Encoding->FromUTF8($HtmlCode)).
    3030      '"|htmldoc --no-numbered --webpage --no-embedfonts --charset 8859-2 -t pdf -');
    31     return($Output);
     31    return ($Output);
    3232  }
    3333}
     
    4343      $Subject['AddressStreet'].'<br>'.
    4444      $Subject['AddressPSC'].' '.$Subject['AddressTown'].'<br>';
    45     if($Subject['IC'] != 0) $Output .= 'IČ: '.$Subject['IC'].'<br>';
    46     if($Subject['DIC'] != '') $Output .= 'DIČ: '.$Subject['DIC'].'<br>';
    47     if($Subject['Account'] != '') $Output .= 'Účet: '.$Subject['Account'].'<br>';
    48     if($Subject['PayVAT'] != '') $Output .= 'Plátce DPH: '.$BooleanText[$Subject['PayVAT']].'<br>';
    49     return($Output);
     45    if ($Subject['IC'] != 0) $Output .= 'IČ: '.$Subject['IC'].'<br>';
     46    if ($Subject['DIC'] != '') $Output .= 'DIČ: '.$Subject['DIC'].'<br>';
     47    if ($Subject['Account'] != '') $Output .= 'Účet: '.$Subject['Account'].'<br>';
     48    if ($Subject['PayVAT'] != '') $Output .= 'Plátce DPH: '.$BooleanText[$Subject['PayVAT']].'<br>';
     49    return ($Output);
    5050  }
    5151
     
    7878    $InvoiceItems = array();
    7979    $DbResult = $this->Database->select('FinanceInvoiceItem', '*, ROUND(`Price` * `Quantity`, '.$Finance->Rounding.') AS `Total`', '`FinanceInvoice`='.$this->InvoiceId);
    80     while($Item = $DbResult->fetch_assoc())
     80    while ($Item = $DbResult->fetch_assoc())
    8181    {
    8282      $InvoiceItems[$Item['Id']] = $Item;
     
    8484
    8585    // If direction is in => switch sides
    86     if($Invoice['Direction'] == FINANCE_DIRECTION_OUT)
    87     {
    88     }
    89     else if($Invoice['Direction'] == FINANCE_DIRECTION_IN)
     86    if ($Invoice['Direction'] == FINANCE_DIRECTION_OUT)
     87    {
     88    }
     89    else if ($Invoice['Direction'] == FINANCE_DIRECTION_IN)
    9090    {
    9191      $Subject = $SubjectTo;
     
    121121      'Datum zdanitel. plnění: '.HumanDate($Invoice['Time']).'<br>'.
    122122      'Datum splatnosti: '.HumanDate($Invoice['TimeDue']).'<br>';
    123     if(($Invoice['PeriodFrom'] != '') and ($Invoice['PeriodTo'] != ''))
     123    if (($Invoice['PeriodFrom'] != '') and ($Invoice['PeriodTo'] != ''))
    124124      $Output .= 'Fakturované období: '.HumanDate($Invoice['PeriodFrom']).' - '.
    125125        HumanDate($Invoice['PeriodTo']).'<br>';
     
    133133
    134134    $Total = 0;
    135     foreach($InvoiceItems as $Item)
     135    foreach ($InvoiceItems as $Item)
    136136    {
    137137      $Output .= '<tr><td>'.$Item['Description'].'</td><td align="right">'.
     
    146146      '</table>';
    147147
    148     return($Output);
     148    return ($Output);
    149149  }
    150150}
     
    174174
    175175    $BooleanText = array('Ne', 'Ano');
    176     if($Operation['Direction'] == FINANCE_DIRECTION_OUT)
     176    if ($Operation['Direction'] == FINANCE_DIRECTION_OUT)
    177177    $Desc = array(
    178178      'Type' => 'VÝDAJOVÝ',
     
    180180      'Target' => 'Vydáno komu',
    181181    );
    182     else if($Operation['Direction'] == FINANCE_DIRECTION_IN)
     182    else if ($Operation['Direction'] == FINANCE_DIRECTION_IN)
    183183    $Desc = array(
    184184      'Type' => 'PŘÍJMOVÝ',
     
    206206      $Subject['AddressStreet'].'<br>'.
    207207      $Subject['AddressPSC'].' '.$Subject['AddressTown'].'<br>';
    208     if($Subject['IC'] != 0) $Output .= 'IČ: '.$Subject['IC'].'<br>';
    209     if($Subject['DIC'] != '') $Output .= 'DIČ: '.$Subject['DIC'].'<br>';
     208    if ($Subject['IC'] != 0) $Output .= 'IČ: '.$Subject['IC'].'<br>';
     209    if ($Subject['DIC'] != '') $Output .= 'DIČ: '.$Subject['DIC'].'<br>';
    210210    $Description = $Operation['Text'];
    211211    $Output .= '</td></tr>'.
     
    215215      '<tr><td>&nbsp;</td><td><br><br>'.$Desc['Signature'].':</td></tr>';
    216216    $Output .= '</table>';
    217     return($Output);
     217    return ($Output);
    218218  }
    219219}
Note: See TracChangeset for help on using the changeset viewer.