Ignore:
Timestamp:
Sep 30, 2015, 11:55:11 PM (9 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

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

    r747 r748  
    99  function ShowFinanceOperation($Subject)
    1010  {
    11     $UserOperationTableQuery = '((SELECT `Text`, `Time`, `Value`, `File`, `BillCode`, NULL AS `PeriodFrom`, NULL AS `PeriodTo` '.
    12       'FROM `FinanceOperation` WHERE (`Subject`='.$Subject['Id'].')) UNION ALL '.
     11    $UserOperationTableQuery = '((SELECT `Text`, `Time`, `Value`, `File`, `BillCode`, NULL AS `PeriodFrom`, NULL AS `PeriodTo`, `DocumentLineCode`.`Name` AS `BillName` '.
     12      'FROM `FinanceOperation` '.
     13      'LEFT JOIN `DocumentLineCode` ON `DocumentLineCode`.`Id`=`FinanceOperation`.`BillCode` '.
     14      'WHERE (`Subject`='.$Subject['Id'].') '.
     15      ') UNION ALL '.
    1316      '(SELECT (SELECT GROUP_CONCAT(`Description` SEPARATOR ",") FROM `FinanceInvoiceItem` WHERE `FinanceInvoice`=`FinanceInvoice`.`Id`) AS `Text`, '.
    14       '`Time`, -`Value`, `File`, `BillCode`, `PeriodFrom`, `PeriodTo` FROM `FinanceInvoice` WHERE (`Subject`='.$Subject['Id'].')))';
     17      '`Time`, -`Value`, `File`, `BillCode`, `PeriodFrom`, `PeriodTo`, `DocumentLineCode`.`Name` AS `BillName` FROM `FinanceInvoice` '.
     18      'LEFT JOIN `DocumentLineCode` ON `DocumentLineCode`.`Id`=`FinanceInvoice`.`BillCode` '.
     19      'WHERE (`Subject`='.$Subject['Id'].')))';
    1520
    1621    $Output = '<div style="text-align:center">Výpis finančních operací</div>';
     
    4651      if($Row['Value'] == -0) $Row['Value'] = 0;
    4752      if($Row['Value'] > 0) $Row['Value'] = '+'.$Row['Value'];
    48       if($Row['BillCode'] == '') $Row['BillCode'] = 'PDF';
    49       if($Row['File'] > 0) $Invoice = '<a href="'.$this->System->Link('/file?id='.$Row['File']).'">'.$Row['BillCode'].'</a>';
    50       else $Invoice = NotBlank($Row['BillCode']);
     53      if($Row['BillName'] == '') $Row['BillName'] = 'PDF';
     54      if($Row['File'] > 0) $Invoice = '<a href="'.$this->System->Link('/file?id='.$Row['File']).'">'.$Row['BillName'].'</a>';
     55        else $Invoice = NotBlank($Row['BillName']);
    5156      if($Row['PeriodFrom'] != '') $Period = HumanDate($Row['PeriodFrom']).' - '.HumanDate($Row['PeriodTo']);
    52       else $Period = '&nbsp;';
     57        else $Period = '&nbsp;';
    5358      $Output .= '<tr><td style="text-align: right;">'.HumanDate($Row['Time']).'</td>'.
    5459          '<td style="text-align: left;">'.$Row['Text'].'</td>'.
Note: See TracChangeset for help on using the changeset viewer.