Changeset 413 for trunk/finance/zivnost.php
- Timestamp:
- Oct 7, 2012, 4:35:04 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/zivnost.php
r409 r413 160 160 $DbResult = $this->Database->select('FinanceYear', '*', 'Id='.$_GET['year']); 161 161 $Year = $DbResult->fetch_assoc(); 162 162 163 $Total = 0; 164 $TotalTax = array(0, 0); 165 $TotalCash = array(0, 0); 163 166 $Output .= '<strong>Příjmy za rok '.$Year['Year'].'</strong>'; 164 167 $Output .= '<table style="font-size: smaller;" class="WideTable">'; … … 170 173 $Row['Time'] = explode(' ', $Row['Time']); 171 174 $Row['Time'] = $Row['Time'][0]; 172 $Output .= '<tr><td>'.$Row['Time'].'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td><td>'.$Table[$Row['Taxable']].'</td><td>'.$Table[$Row['Cash']].'</td></tr>'; 173 } 174 $Output .= '</table>'; 175 $Output .= '<tr><td>'.HumanDate($Row['Time']).'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td><td>'.$Table[$Row['Taxable']].'</td><td>'.$Table[$Row['Cash']].'</td></tr>'; 176 $Total += $Row['Value']; 177 $TotalTax[$Row['Taxable']] += $Row['Value']; 178 $TotalCash[$Row['Cash']] += $Row['Value']; 179 } 180 $Output .= '</table><br/>'; 181 $Output .= '<strong>Souhrn</strong><br/>'; 182 $Output .= 'Celkem: '.$Total.' Kč<br/>'; 183 $Output .= ' Daňové: '.$TotalTax[1].' Kč<br/>'; 184 $Output .= ' Nedaňové: '.$TotalTax[0].' Kč<br/>'; 185 $Output .= ' Hotovostní: '.$TotalCash[1].' Kč<br/>'; 186 $Output .= ' Bezhotovostní: '.$TotalCash[0].' Kč<br/>'; 175 187 break; 176 188 case 'Expenses': … … 178 190 $DbResult = $this->Database->select('FinanceYear', '*', 'Id='.$_GET['year']); 179 191 $Year = $DbResult->fetch_assoc(); 180 192 193 $Total = 0; 194 $TotalTax = array(0, 0); 195 $TotalCash = array(0, 0); 181 196 $Output .= '<strong>Výdaje za rok '.$Year['Year'].'</strong>'; 182 197 $Output .= '<table style="font-size: smaller;" class="WideTable">'; … … 188 203 $Row['Time'] = explode(' ', $Row['Time']); 189 204 $Row['Time'] = $Row['Time'][0]; 190 $Output .= '<tr><td>'.$Row['Time'].'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td><td>'.$Table[$Row['Taxable']].'</td><td>'.$Table[$Row['Cash']].'</td></tr>'; 191 } 192 $Output .= '</table>'; 205 $Row['Value'] = $Row['Value'] * -1; 206 $Output .= '<tr><td>'.HumanDate($Row['Time']).'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td><td>'.$Table[$Row['Taxable']].'</td><td>'.$Table[$Row['Cash']].'</td></tr>'; 207 $Total += $Row['Value']; 208 $TotalTax[$Row['Taxable']] += $Row['Value']; 209 $TotalCash[$Row['Cash']] += $Row['Value']; 210 } 211 $Output .= '</table><br/>'; 212 $Output .= '<strong>Souhrn</strong><br/>'; 213 $Output .= 'Celkem: '.$Total.' Kč<br/>'; 214 $Output .= ' Daňové: '.$TotalTax[1].' Kč<br/>'; 215 $Output .= ' Nedaňové: '.$TotalTax[0].' Kč<br/>'; 216 $Output .= ' Hotovostní: '.$TotalCash[1].' Kč<br/>'; 217 $Output .= ' Bezhotovostní: '.$TotalCash[0].' Kč<br/>'; 193 218 break; 194 219 case 'Claims': … … 197 222 $Year = $DbResult->fetch_assoc(); 198 223 224 $Total = 0; 199 225 $Output .= '<strong>Pohledávky za rok '.$Year['Year'].'</strong>'; 200 226 $Output .= '<table style="font-size: smaller;" class="WideTable">'; 201 $Output .= '<tr><th> Kód</th><th>Subjekt</th><th>Text</th><th>Hodnota [Kč]</th><th>Čas vystavení</th><th>Čas splatnosti</th><th>Čas uhrazení</th></tr>';227 $Output .= '<tr><th>Čas vystavení</th><th>Kód</th><th>Subjekt</th><th>Text</th><th>Hodnota [Kč]</th></tr>'; 202 228 $DbResult = $this->Database->query('SELECT * FROM FinanceClaimsLiabilities JOIN Subject ON Subject.Id = FinanceClaimsLiabilities.Subject '. 203 229 'WHERE (Value > 0) AND (FinanceClaimsLiabilities.TimeCreation >= "'.$Year['DateStart'].'") AND (FinanceClaimsLiabilities.TimeCreation <= "'.$Year['DateEnd'].'") ORDER BY TimeCreation'); … … 205 231 { 206 232 if($Row['TimePayment'] == '0000-00-00 00:00:00') $Row['TimePayment'] = ' '; 207 $Output .= '<tr><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td><td>'.$Row['TimeCreation'].'</td><td>'.$Row['TimeDue'].'</td><td>'.$Row['TimePayment'].'</td></tr>'; 208 } 209 $Output .= '</table>'; 233 $Output .= '<tr><td>'.HumanDate($Row['TimeCreation']).'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td></tr>'; 234 $Total += $Row['Value']; 235 } 236 $Output .= '</table><br/>'; 237 $Output .= 'Celkem: '.$Total.' Kč<br/>'; 210 238 break; 211 239 case 'Liabilities': … … 214 242 $Year = $DbResult->fetch_assoc(); 215 243 244 $Total = 0; 216 245 $Output .= '<strong>Závazky za rok '.$Year['Year'].'</strong>'; 217 246 $Output .= '<table style="font-size: smaller;" class="WideTable">'; 218 $Output .= '<tr><th> Kód</th><th>Subjekt</th><th>Text</th><th>Hodnota [Kč]</th><th>Čas vystavení</th><th>Čas splatnosti</th><th>Čas uhrazení</th></tr>';247 $Output .= '<tr><th>Čas vystavení</th><th>Kód</th><th>Subjekt</th><th>Text</th><th>Hodnota [Kč]</th></tr>'; 219 248 $DbResult = $this->Database->query('SELECT * FROM FinanceClaimsLiabilities JOIN Subject ON Subject.Id = FinanceClaimsLiabilities.Subject '. 220 249 'WHERE (Value < 0) AND (FinanceClaimsLiabilities.TimeCreation >= "'.$Year['DateStart'].'") AND (FinanceClaimsLiabilities.TimeCreation <= "'.$Year['DateEnd'].'") ORDER BY TimeCreation'); … … 222 251 { 223 252 if($Row['TimePayment'] == '0000-00-00 00:00:00') $Row['TimePayment'] = ' '; 224 $Output .= '<tr><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td><td>'.$Row['TimeCreation'].'</td><td>'.$Row['TimeDue'].'</td><td>'.$Row['TimePayment'].'</td></tr>'; 225 } 226 $Output .= '</table>'; 253 $Row['Value'] = $Row['Value'] * -1; 254 $Output .= '<tr><td>'.HumanDate($Row['TimeCreation']).'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td></tr>'; 255 $Total += $Row['Value']; 256 } 257 $Output .= '</table><br/>'; 258 $Output .= 'Celkem: '.$Total.' Kč<br/>'; 227 259 break; 228 260 case 'SubjectList':
Note:
See TracChangeset
for help on using the changeset viewer.