Ignore:
Timestamp:
Mar 1, 2013, 10:44:18 PM (12 years ago)
Author:
chronos
Message:
  • Opraveno: Přepočítávání stavu placení zákazníků.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/finance/user_state.php

    r486 r494  
    6363   
    6464    // Account state   
    65     $UserOperationTableQuery = '((SELECT Text, Time, Value AS Value, Bill, BillCode, NULL AS PeriodFrom, NULL AS PeriodTo '.
     65    $UserOperationTableQuery = '((SELECT Text, Time, Value AS Value, File, BillCode, NULL AS PeriodFrom, NULL AS PeriodTo '.
    6666      'FROM FinanceOperation WHERE (Subject='.$Subject['Id'].')) UNION ALL '.
    6767      '(SELECT (SELECT GROUP_CONCAT(Description SEPARATOR ",") FROM FinanceInvoiceItem WHERE FinanceInvoice=FinanceInvoice.Id) AS Text, '.
    68       'TimeCreation as Time, -Value as Value, Bill, BillCode, PeriodFrom, PeriodTo FROM FinanceInvoice WHERE (Subject='.$Subject['Id'].')) ORDER BY Time DESC) AS T1';
     68      'TimeCreation as Time, -Value as Value, File, BillCode, PeriodFrom, PeriodTo FROM FinanceInvoice WHERE (Subject='.$Subject['Id'].')) ORDER BY Time DESC) AS T1';
    6969    $DbResult = $this->Database->query('SELECT SUM(T1.Value) AS Total FROM '.$UserOperationTableQuery);
    7070    $DbRow = $DbResult->fetch_array();
     
    8787      if($Row['Value'] > 0) $Row['Value'] = '+'.$Row['Value'];
    8888      if($Row['BillCode'] == '') $Row['BillCode'] = 'PDF';
    89       if($Row['Bill'] > 0) $Invoice = '<a href="bill.php?Id='.$Row['Bill'].'">'.$Row['BillCode'].'</a>';
     89      if($Row['File'] > 0) $Invoice = '<a href="'.$this->System->Link('/FileDownload.php?Id='.$Row['File']).'">'.$Row['BillCode'].'</a>';
    9090        else $Invoice = '&nbsp;';
    9191      if($Row['PeriodFrom'] != '') $Period = HumanDate($Row['PeriodFrom']).' - '.HumanDate($Row['PeriodTo']);
Note: See TracChangeset for help on using the changeset viewer.