Changeset 627 for trunk/Modules/Finance/Zivnost.php
- Timestamp:
- Jan 2, 2014, 12:42:49 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/Zivnost.php
r548 r627 28 28 $Balance['Spend']['End'] = $Row[0] + 0; 29 29 30 $DbResult = $this->Database->query('SELECT SUM(Value) FROM FinanceInvoice WHERE (Time Creation < "'.TimeToMysqlDateTime($StartTime).'") AND (TimeCreation>= "'.TimeToMysqlDateTime($this->StartEvidence).'") AND (Value > 0)');30 $DbResult = $this->Database->query('SELECT SUM(Value) FROM FinanceInvoice WHERE (Time < "'.TimeToMysqlDateTime($StartTime).'") AND (Time >= "'.TimeToMysqlDateTime($this->StartEvidence).'") AND (Value > 0)'); 31 31 $Row = $DbResult->fetch_array(); 32 32 $Balance['Claims']['Start'] = $Row[0] + 0; 33 $DbResult = $this->Database->query('SELECT SUM(Value) FROM FinanceInvoice WHERE (Time Creation <= "'.TimeToMysqlDateTime($EndTime).'") AND (TimeCreation>= "'.TimeToMysqlDateTime($this->StartEvidence).'") AND (Value > 0)');33 $DbResult = $this->Database->query('SELECT SUM(Value) FROM FinanceInvoice WHERE (Time <= "'.TimeToMysqlDateTime($EndTime).'") AND (Time >= "'.TimeToMysqlDateTime($this->StartEvidence).'") AND (Value > 0)'); 34 34 $Row = $DbResult->fetch_array(); 35 35 $Balance['Claims']['End'] = $Row[0] + 0; 36 36 37 $DbResult = $this->Database->query('SELECT SUM(-Value) FROM FinanceInvoice WHERE (Time Creation < "'.TimeToMysqlDateTime($StartTime).'") AND (TimeCreation>= "'.TimeToMysqlDateTime($this->StartEvidence).'") AND (Value < 0)');37 $DbResult = $this->Database->query('SELECT SUM(-Value) FROM FinanceInvoice WHERE (Time < "'.TimeToMysqlDateTime($StartTime).'") AND (Time >= "'.TimeToMysqlDateTime($this->StartEvidence).'") AND (Value < 0)'); 38 38 $Row = $DbResult->fetch_array(); 39 39 $Balance['Liabilities']['Start'] = $Row[0] + 0; 40 $DbResult = $this->Database->query('SELECT SUM(-Value) FROM FinanceInvoice WHERE (Time Creation <= "'.TimeToMysqlDateTime($EndTime).'") AND (TimeCreation>= "'.TimeToMysqlDateTime($this->StartEvidence).'") AND (Value < 0)');40 $DbResult = $this->Database->query('SELECT SUM(-Value) FROM FinanceInvoice WHERE (Time <= "'.TimeToMysqlDateTime($EndTime).'") AND (Time >= "'.TimeToMysqlDateTime($this->StartEvidence).'") AND (Value < 0)'); 41 41 $Row = $DbResult->fetch_array(); 42 42 $Balance['Liabilities']['End'] = $Row[0] + 0; … … 207 207 $DbResult = $this->Database->query('SELECT *, (SELECT GROUP_CONCAT(Description SEPARATOR ",") FROM FinanceInvoiceItem WHERE FinanceInvoiceItem.FinanceInvoice = FinanceInvoice.Id) AS Text '. 208 208 'FROM FinanceInvoice JOIN Subject ON Subject.Id = FinanceInvoice.Subject '. 209 'WHERE (Value > 0) AND (FinanceInvoice.Time Creation>= "'.$Year['DateStart'].210 '") AND (FinanceInvoice.Time Creation <= "'.$Year['DateEnd'].'") ORDER BY TimeCreation');209 'WHERE (Value > 0) AND (FinanceInvoice.Time >= "'.$Year['DateStart']. 210 '") AND (FinanceInvoice.Time <= "'.$Year['DateEnd'].'") ORDER BY Time'); 211 211 while($Row = $DbResult->fetch_array()) 212 212 { 213 213 if($Row['TimePayment'] == '0000-00-00 00:00:00') $Row['TimePayment'] = ' '; 214 $Output .= '<tr><td>'.HumanDate($Row['Time Creation']).'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td></tr>';214 $Output .= '<tr><td>'.HumanDate($Row['Time']).'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td></tr>'; 215 215 $Total += $Row['Value']; 216 216 } … … 229 229 $DbResult = $this->Database->query('SELECT *, (SELECT GROUP_CONCAT(Description SEPARATOR ",") FROM FinanceInvoiceItem WHERE FinanceInvoiceItem.FinanceInvoice = FinanceInvoice.Id) AS Text '. 230 230 'FROM FinanceInvoice JOIN Subject ON Subject.Id = FinanceInvoice.Subject '. 231 'WHERE (Value < 0) AND (FinanceInvoice.Time Creation>= "'.$Year['DateStart'].232 '") AND (FinanceInvoice.Time Creation <= "'.$Year['DateEnd'].'") ORDER BY TimeCreation');231 'WHERE (Value < 0) AND (FinanceInvoice.Time >= "'.$Year['DateStart']. 232 '") AND (FinanceInvoice.Time <= "'.$Year['DateEnd'].'") ORDER BY Time'); 233 233 while($Row = $DbResult->fetch_array()) 234 234 { 235 235 if($Row['TimePayment'] == '0000-00-00 00:00:00') $Row['TimePayment'] = ' '; 236 236 $Row['Value'] = $Row['Value'] * -1; 237 $Output .= '<tr><td>'.HumanDate($Row['Time Creation']).'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td></tr>';237 $Output .= '<tr><td>'.HumanDate($Row['Time']).'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td></tr>'; 238 238 $Total += $Row['Value']; 239 239 } … … 288 288 $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">'; 289 289 $Output .= '<tr><th>Datum vytvoření</th><th>Datum zaplacení</th><th>Název</th><th>Hodnota [Kč]</th><th>Doklad</th></tr>'; 290 $DbResult = $this->Database->select('FinanceInvoice', '*, (SELECT GROUP_CONCAT(Description SEPARATOR ",") FROM FinanceInvoiceItem WHERE FinanceInvoiceItem.FinanceInvoice = FinanceInvoice.Id) AS Text', 'Subject='.$_GET['Id'].' ORDER BY Time Creation');291 while($Row = $DbResult->fetch_array()) 292 { 293 $Output .= '<tr><td>'.HumanDate($Row['Time Creation']).'</td><td>'.HumanDate($Row['TimePayment']).290 $DbResult = $this->Database->select('FinanceInvoice', '*, (SELECT GROUP_CONCAT(Description SEPARATOR ",") FROM FinanceInvoiceItem WHERE FinanceInvoiceItem.FinanceInvoice = FinanceInvoice.Id) AS Text', 'Subject='.$_GET['Id'].' ORDER BY Time'); 291 while($Row = $DbResult->fetch_array()) 292 { 293 $Output .= '<tr><td>'.HumanDate($Row['Time']).'</td><td>'.HumanDate($Row['TimePayment']). 294 294 '</td><td>'.$Row['Text'].'</td><td>'.($Row['Value']).'</td><td>'.$Row['BillCode'].'</td></tr>'; 295 295 } … … 302 302 while($Row = $DbResult->fetch_array()) 303 303 { 304 $Output .= '<tr><td>'.$Row['Time Creation'].'</td><td>'.$Row['TimePass'].'</td><td>'.$Row['Direction'].'</td><td>'.($Row['Value']).'</td><td>'.$Row['CashFlowId'].'</td></tr>';304 $Output .= '<tr><td>'.$Row['Time'].'</td><td>'.$Row['TimePass'].'</td><td>'.$Row['Direction'].'</td><td>'.($Row['Value']).'</td><td>'.$Row['CashFlowId'].'</td></tr>'; 305 305 } 306 306 $Output .= '</table>';*/
Note:
See TracChangeset
for help on using the changeset viewer.