Changeset 486 for trunk/finance/user_state.php
- Timestamp:
- Feb 10, 2013, 9:20:06 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/user_state.php
r479 r486 52 52 else $SubjectParam = ''; 53 53 $Output .= 'Roky: '; 54 $DbResult = $this->Database->query('SELECT * FROM FinanceYear'); 54 $DbResult = $this->Database->query('SELECT * FROM FinanceYear WHERE Year >= '. 55 substr($Member['MembershipDate'], 0, strpos($Member['MembershipDate'], '-'))); 55 56 while($FinanceYear = $DbResult->fetch_assoc()) 56 57 { … … 62 63 63 64 // Account state 64 $UserOperationTableQuery = '((SELECT Text, Time, Value AS Value, Bill, BillCode FROM FinanceOperation WHERE (Subject='.$Subject['Id'].')) UNION ALL '. 65 '(SELECT Text, TimeCreation as Time, -Value as Value, Bill, BillCode FROM FinanceClaimsLiabilities WHERE (Subject='.$Subject['Id'].')) ORDER BY Time DESC) AS T1'; 65 $UserOperationTableQuery = '((SELECT Text, Time, Value AS Value, Bill, BillCode, NULL AS PeriodFrom, NULL AS PeriodTo '. 66 'FROM FinanceOperation WHERE (Subject='.$Subject['Id'].')) UNION ALL '. 67 '(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'; 66 69 $DbResult = $this->Database->query('SELECT SUM(T1.Value) AS Total FROM '.$UserOperationTableQuery); 67 70 $DbRow = $DbResult->fetch_array(); … … 72 75 // Tabulka operaci 73 76 $Output .= 'Výpis operací pro subjekt '.$Subject['Name'].':<br />'; 74 $Output .= '<table style="font-size: smaller;" class="WideTable"><tr><th>Datum</th><th>Popis</th><th>Částka</th><th>Doklad</th></tr>'; 77 $Output .= '<table style="font-size: smaller;" class="WideTable"><tr>'. 78 '<th>Datum</th><th>Popis</th><th>Částka</th><th>Období</th><th>Doklad</th></tr>'; 75 79 $Operations = array(); 76 80 $DbResult = $this->Database->query('SELECT T1.* FROM '.$UserOperationTableQuery.$YearWhere); … … 83 87 if($Row['Value'] > 0) $Row['Value'] = '+'.$Row['Value']; 84 88 if($Row['BillCode'] == '') $Row['BillCode'] = 'PDF'; 85 if($Row['Bill'] > 0) $Invoice = '<a href="bill.php?Id='.$Row['Bill'].'">'.$Row['BillCode'].'</a>'; else $Invoice = ' '; 86 $Output .= '<tr><td style="text-align: right;">'.HumanDate($Row['Time']).'</td><td style="text-align: left;">'.$Row['Text'].'</td><td style="text-align: right;">'.$Row['Value'].'</td><td style="text-align: center;">'.$Invoice.'</td></tr>'; 89 if($Row['Bill'] > 0) $Invoice = '<a href="bill.php?Id='.$Row['Bill'].'">'.$Row['BillCode'].'</a>'; 90 else $Invoice = ' '; 91 if($Row['PeriodFrom'] != '') $Period = HumanDate($Row['PeriodFrom']).' - '.HumanDate($Row['PeriodTo']); 92 else $Period = ' '; 93 $Output .= '<tr><td style="text-align: right;">'.HumanDate($Row['Time']).'</td>'. 94 '<td style="text-align: left;">'.$Row['Text'].'</td>'. 95 '<td style="text-align: right;">'.$Row['Value'].'</td>'. 96 '<td style="text-align: center;">'.$Period.'</td>'. 97 '<td style="text-align: center;">'.$Invoice.'</td></tr>'; 87 98 $SumValue = $SumValue + $Row['Value']; 88 99 } 89 $Output .= '<tr><td style="text-align: right;" colspan="2"><strong>Celkem za rok</strong></td><td style="text-align: right;"><strong>'.$SumValue.'</strong></td><td style="text-align: center;"> </td></tr>'; 100 $Output .= '<tr><td style="text-align: right;" colspan="2"><strong>Celkem za rok</strong></td>'. 101 '<td style="text-align: right;"><strong>'.$SumValue.'</strong></td>'. 102 '<td style="text-align: center;"> </td>'. 103 '<td style="text-align: center;"> </td></tr>'; 90 104 91 105
Note:
See TracChangeset
for help on using the changeset viewer.