Changeset 749


Ignore:
Timestamp:
Oct 3, 2015, 8:32:52 AM (9 years ago)
Author:
chronos
Message:
  • Fixed: SQL query in trade summary.
File:
1 edited

Legend:

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

    r748 r749  
    325325        $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">';
    326326        $Output .= '<tr><th>Datum</th><th>Název</th><th>Hodnota [Kč]</th><th>Doklad</th></tr>';
    327         $DbResult = $this->Database->query('SELECT `FinanceOperation`.*, `DocumentLineCode`.`Name` AS `BillName` FROM `FinanceOperation` '.
     327        $DbResult = $this->Database->query('SELECT `FinanceOperation`.*, `DocumentLineCode`.`Name` AS `BillName` '.
     328          'FROM `FinanceOperation` '.
    328329          'LEFT JOIN `DocumentLineCode` ON `DocumentLineCode`.`Id` = `FinanceOperation`.`BillCode` '.
    329           'WHERE `Subject=`'.$_GET['Id'].' ORDER BY `Time`');
     330          'LEFT JOIN `FinanceOperationGroup` ON `FinanceOperationGroup`.`Id` = `FinanceOperation`.`Group` '.
     331          'WHERE `Subject`='.$_GET['Id'].' ORDER BY `Time`');
    330332        while($Row = $DbResult->fetch_array())
    331333        {
    332334          $Output .= '<tr><td>'.HumanDate($Row['Time']).'</td><td>'.$Row['Text'].
    333             '</td><td>'.($Row['Value']*$Row['ValueSign']).'</td><td>'.$Row['BillName'].'</td></tr>';
     335            '</td><td>'.$Row['Value'].'</td><td>'.$Row['BillName'].'</td></tr>';
    334336        }
    335337        $Output .= '</table></td><td style="vertical-align: top;">';
     
    340342        $DbResult = $this->Database->query('SELECT `FinanceInvoice`.*, (SELECT GROUP_CONCAT(Description SEPARATOR ",") '.
    341343          'FROM FinanceInvoiceItem WHERE `FinanceInvoiceItem`.`FinanceInvoice` = `FinanceInvoice`.`Id`) AS `Text`, `DocumentLineCode`.`Name` AS `BillName` '.
    342           'LEFT JOIN `DocumentLineCode` ON `DocumentLineCode`.`Id` = `FinanceOperation`.`BillCode` '.
     344          'FROM `FinanceInvoice` '.
     345          'LEFT JOIN `DocumentLineCode` ON `DocumentLineCode`.`Id` = `FinanceInvoice`.`BillCode` '.
    343346          'WHERE `Subject`='.$_GET['Id'].' ORDER BY `Time`');
    344347        while($Row = $DbResult->fetch_array())
    345348        {
    346349          $Output .= '<tr><td>'.HumanDate($Row['Time']).'</td><td>'.HumanDate($Row['TimePayment']).
    347             '</td><td>'.$Row['Text'].'</td><td>'.round($Row['Value'] * $Row['ValueSign'], $Finance->Rounding).'</td><td>'.$Row['BillName'].'</td></tr>';
     350            '</td><td>'.$Row['Text'].'</td><td>'.round($Row['Value'], $Finance->Rounding).'</td><td>'.$Row['BillName'].'</td></tr>';
    348351        }
    349352        $Output .= '</table></td></tr></table>';
Note: See TracChangeset for help on using the changeset viewer.