Changeset 479 for trunk/finance/zivnost.php
- Timestamp:
- Feb 5, 2013, 9:45:44 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/zivnost.php
r454 r479 291 291 break; 292 292 case 'SubjectAccount': 293 $Output .= '<table style="width: 100%"><tr><td style="vertical-align: top;">'; 293 294 $Output .= '<strong>Výpis příjmů/výdajů</strong>'; 294 295 $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">'; 295 $Output .= '<tr><th>Datum</th><th>Název</th><th>Hodnota [Kč]</th></tr>'; 296 $DbResult = $this->Database->select('FinanceCashFlow', '*', 'Subject='.$_GET['Id']); 297 while($Row = $DbResult->fetch_array()) 298 { 299 $Output .= '<tr><td>'.$Row['Time'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td><td>'.$Row['Bill'].'</td></tr>'; 300 } 301 $Output .= '</table><br />'; 296 $Output .= '<tr><th>Datum</th><th>Název</th><th>Hodnota [Kč]</th><th>Doklad</th></tr>'; 297 $DbResult = $this->Database->select('FinanceOperation', '*', 'Subject='.$_GET['Id'].' ORDER BY Time'); 298 while($Row = $DbResult->fetch_array()) 299 { 300 $Output .= '<tr><td>'.HumanDate($Row['Time']).'</td><td>'.$Row['Text']. 301 '</td><td>'.$Row['Value'].'</td><td>'.$Row['BillCode'].'</td></tr>'; 302 } 303 $Output .= '</table></td><td style="vertical-align: top;">'; 302 304 303 305 $Output .= '<strong>Výpis závazků/pohledávek</strong>'; 304 306 $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">'; 305 $Output .= '<tr><th>Datum vytvoření</th><th>Datum zaplacení</th><th>Název</th><th>Hodnota [Kč]</th></tr>'; 306 $DbResult = $this->Database->select('FinanceClaimsLiabilities', '*', 'Subject='.$_GET['Id']); 307 while($Row = $DbResult->fetch_array()) 308 { 309 $Output .= '<tr><td>'.$Row['TimeCreation'].'</td><td>'.$Row['TimePayment'].'</td><td>'.$Row['Text'].'</td><td>'.(-$Row['Value']).'</td><td>'.$Row['Bill'].'</td></tr>'; 310 } 311 $Output .= '</table><br />'; 312 313 $Output .= '<strong>Výpis záloh</strong>'; 307 $Output .= '<tr><th>Datum vytvoření</th><th>Datum zaplacení</th><th>Název</th><th>Hodnota [Kč]</th><th>Doklad</th></tr>'; 308 $DbResult = $this->Database->select('FinanceClaimsLiabilities', '*', 'Subject='.$_GET['Id'].' ORDER BY TimeCreation'); 309 while($Row = $DbResult->fetch_array()) 310 { 311 $Output .= '<tr><td>'.HumanDate($Row['TimeCreation']).'</td><td>'.HumanDate($Row['TimePayment']). 312 '</td><td>'.$Row['Text'].'</td><td>'.($Row['Value']).'</td><td>'.$Row['BillCode'].'</td></tr>'; 313 } 314 $Output .= '</table></td></tr></table>'; 315 316 /*$Output .= '<strong>Výpis záloh</strong>'; 314 317 $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">'; 315 318 $Output .= '<tr><th>Datum vytvoření</th><th>Datum zaplacení</th><th>Název</th><th>Hodnota [Kč]</th></tr>'; … … 319 322 $Output .= '<tr><td>'.$Row['TimeCreation'].'</td><td>'.$Row['TimePass'].'</td><td>'.$Row['Direction'].'</td><td>'.($Row['Value']).'</td><td>'.$Row['CashFlowId'].'</td></tr>'; 320 323 } 321 $Output .= '</table>'; 322 323 $DbResult = $this->Database->query('SELECT Id, 0 AS Cash, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = Subject.Id AND FinanceClaimsLiabilities.Value > 0) as Claims, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = Subject.Id AND FinanceClaimsLiabilities.Value > 0 AND TimePayment IS NULL) as OpenedClaims, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = Subject.Id AND FinanceClaimsLiabilities.Value < 0) as Liabilities, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = Subject.Id AND FinanceClaimsLiabilities.Value < 0 AND TimePayment IS NULL) as OpenedLiabilities, (SELECT SUM(FinanceCashFlow.Value) FROM FinanceCashFlow WHERE FinanceCashFlow.Subject = Subject.Id AND FinanceCashFlow.Value > 0) as Gains, (SELECT SUM(FinanceCashFlow.Value) FROM FinanceCashFlow WHERE FinanceCashFlow.Subject = Subject.Id AND FinanceCashFlow.Value < 0) as Spends, (SELECT SUM(FinanceAdvances.Value) FROM FinanceAdvances WHERE FinanceAdvances.Subject = Subject.Id AND FinanceAdvances.Direction="In") as AdvancesIn, (SELECT SUM(FinanceAdvances.Value) FROM FinanceAdvances WHERE FinanceAdvances.Subject = Subject.Id AND FinanceAdvances.Direction="Out") as AdvancesOut FROM Subject WHERE Id='.$_GET['Id']); 324 $Output .= '</table>';*/ 325 326 $DbResult = $this->Database->query('SELECT Id, 0 AS Cash, (SELECT SUM(FinanceClaimsLiabilities.Value) '. 327 'FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = Subject.Id AND '. 328 'FinanceClaimsLiabilities.Value > 0) as Claims, (SELECT SUM(FinanceClaimsLiabilities.Value) '. 329 'FROM FinanceClaimsLiabilities WHERE FinanceClaimsLiabilities.Subject = Subject.Id AND '. 330 'FinanceClaimsLiabilities.Value > 0 AND TimePayment IS NULL) as OpenedClaims, '. 331 '(SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities '. 332 'WHERE FinanceClaimsLiabilities.Subject = Subject.Id AND FinanceClaimsLiabilities.Value < 0) AS '. 333 'Liabilities, (SELECT SUM(FinanceClaimsLiabilities.Value) FROM FinanceClaimsLiabilities '. 334 'WHERE FinanceClaimsLiabilities.Subject = Subject.Id AND FinanceClaimsLiabilities.Value < 0 '. 335 'AND TimePayment IS NULL) as OpenedLiabilities, (SELECT SUM(FinanceOperation.Value) '. 336 'FROM FinanceOperation WHERE FinanceOperation.Subject = Subject.Id AND FinanceOperation.Value > 0) '. 337 'AS Gains, (SELECT SUM(FinanceOperation.Value) FROM FinanceOperation WHERE '. 338 'FinanceOperation.Subject = Subject.Id AND FinanceOperation.Value < 0) as Spends '. 339 'FROM Subject WHERE Id='.$_GET['Id']); 324 340 $Row = $DbResult->fetch_array(); 325 $Output .= 'Stav placení: '.( $Row['AdvancesIn'] - $Row['AdvancesOut'] -$Row['OpenedClaims'] + Abs($Row['OpenedLiabilities']));341 $Output .= 'Stav placení: '.(-$Row['OpenedClaims'] + Abs($Row['OpenedLiabilities'])); 326 342 break; 327 343 case 'PrintMonthOperations':
Note:
See TracChangeset
for help on using the changeset viewer.