Changeset 397 for trunk/finance/zivnost.php
- Timestamp:
- Mar 11, 2012, 9:53:42 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/zivnost.php
r338 r397 156 156 $Output .= '</table>'; 157 157 break; 158 case ' CashFlow':158 case 'Incomes': 159 159 $Table = array('Ne', 'Ano'); 160 $Output .= '<table style="font-size: smaller;" class="WideTable">'; 161 $Output .= '<tr><th>Čas</th><th>Subjekt</th><th>Text</th><th>Hodnota [Kč]</th><th>Daňový</th><th>Hotovost</th></tr>'; 162 $DbResult = $this->Database->query('SELECT * FROM FinanceOperation LEFT JOIN Subject ON Subject.Id = FinanceOperation.Subject ORDER BY Time'); 160 $DbResult = $this->Database->select('FinanceYear', '*', 'Id='.$_GET['year']); 161 $Year = $DbResult->fetch_assoc(); 162 163 $Output .= '<strong>Příjmy za rok '.$Year['Year'].'</strong>'; 164 $Output .= '<table style="font-size: smaller;" class="WideTable">'; 165 $Output .= '<tr><th>Čas</th><th>Kód</th><th>Subjekt</th><th>Text</th><th>Hodnota [Kč]</th><th>Daňový</th><th>Hotovost</th></tr>'; 166 $DbResult = $this->Database->query('SELECT * FROM FinanceOperation LEFT JOIN Subject ON Subject.Id = FinanceOperation.Subject '. 167 'WHERE (Value > 0) AND (FinanceOperation.Time >= "'.$Year['DateStart'].'") AND (FinanceOperation.Time <= "'.$Year['DateEnd'].'") ORDER BY Time'); 163 168 while($Row = $DbResult->fetch_array()) 164 169 { 165 170 $Row['Time'] = explode(' ', $Row['Time']); 166 171 $Row['Time'] = $Row['Time'][0]; 167 $Output .= '<tr><td>'.$Row['Time'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td><td>'.$Table[$Row['Taxable']].'</td><td>'.$Table[$Row['Cash']].'</td></tr>'; 168 } 169 $Output .= '</table>'; 170 break; 171 case 'ClaimsLiabilities': 172 $Output .= '<table width="100%"><tr><td valign="top">'; 173 $Output .= '<strong>Pohledávky</strong>'; 174 $Output .= '<table style="font-size: smaller;" class="WideTable">'; 175 $Output .= '<tr><th>Subjekt</th><th>Text</th><th>Hodnota [Kč]</th><th>Čas vystavení</th><th>Čas splatnosti</th><th>Čas uhrazení</th></tr>'; 176 $DbResult = $this->Database->query('SELECT * FROM FinanceClaimsLiabilities JOIN Subject ON Subject.Id = FinanceClaimsLiabilities.Subject WHERE Value > 0 ORDER BY TimeCreation'); 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 break; 176 case 'Expenses': 177 $Table = array('Ne', 'Ano'); 178 $DbResult = $this->Database->select('FinanceYear', '*', 'Id='.$_GET['year']); 179 $Year = $DbResult->fetch_assoc(); 180 181 $Output .= '<strong>Výdaje za rok '.$Year['Year'].'</strong>'; 182 $Output .= '<table style="font-size: smaller;" class="WideTable">'; 183 $Output .= '<tr><th>Čas</th><th>Kód</th><th>Subjekt</th><th>Text</th><th>Hodnota [Kč]</th><th>Daňový</th><th>Hotovost</th></tr>'; 184 $DbResult = $this->Database->query('SELECT * FROM FinanceOperation LEFT JOIN Subject ON Subject.Id = FinanceOperation.Subject '. 185 'WHERE (Value < 0) AND (FinanceOperation.Time >= "'.$Year['DateStart'].'") AND (FinanceOperation.Time <= "'.$Year['DateEnd'].'") ORDER BY Time'); 186 while($Row = $DbResult->fetch_array()) 187 { 188 $Row['Time'] = explode(' ', $Row['Time']); 189 $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>'; 193 break; 194 case 'Claims': 195 $Table = array('Ne', 'Ano'); 196 $DbResult = $this->Database->select('FinanceYear', '*', 'Id='.$_GET['year']); 197 $Year = $DbResult->fetch_assoc(); 198 199 $Output .= '<strong>Pohledávky za rok '.$Year['Year'].'</strong>'; 200 $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>'; 202 $DbResult = $this->Database->query('SELECT * FROM FinanceClaimsLiabilities JOIN Subject ON Subject.Id = FinanceClaimsLiabilities.Subject '. 203 'WHERE (Value > 0) AND (FinanceClaimsLiabilities.TimeCreation >= "'.$Year['DateStart'].'") AND (FinanceClaimsLiabilities.TimeCreation <= "'.$Year['DateEnd'].'") ORDER BY TimeCreation'); 177 204 while($Row = $DbResult->fetch_array()) 178 205 { 179 206 if($Row['TimePayment'] == '0000-00-00 00:00:00') $Row['TimePayment'] = ' '; 180 $Output .= '<tr><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>'; 181 } 182 $Output .= '</table></td><td valign="top">'; 183 184 $Output .= '<strong>Závazky</strong>'; 185 $Output .= '<table style="font-size: smaller;" class="WideTable">'; 186 $Output .= '<tr><th>Subjekt</th><th>Text</th><th>Hodnota [Kč]</th><th>Čas vystavení</th><th>Čas splatnosti</th><th>Čas uhrazení</th></tr>'; 187 $DbResult = $this->Database->query('SELECT * FROM FinanceClaimsLiabilities JOIN Subject ON Subject.Id = FinanceClaimsLiabilities.Subject WHERE Value < 0 ORDER BY TimeCreation'); 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>'; 210 break; 211 case 'Liabilities': 212 $Table = array('Ne', 'Ano'); 213 $DbResult = $this->Database->select('FinanceYear', '*', 'Id='.$_GET['year']); 214 $Year = $DbResult->fetch_assoc(); 215 216 $Output .= '<strong>Závazky za rok '.$Year['Year'].'</strong>'; 217 $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>'; 219 $DbResult = $this->Database->query('SELECT * FROM FinanceClaimsLiabilities JOIN Subject ON Subject.Id = FinanceClaimsLiabilities.Subject '. 220 'WHERE (Value < 0) AND (FinanceClaimsLiabilities.TimeCreation >= "'.$Year['DateStart'].'") AND (FinanceClaimsLiabilities.TimeCreation <= "'.$Year['DateEnd'].'") ORDER BY TimeCreation'); 188 221 while($Row = $DbResult->fetch_array()) 189 222 { 190 223 if($Row['TimePayment'] == '0000-00-00 00:00:00') $Row['TimePayment'] = ' '; 191 $Output .= '<tr><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>';192 } 193 $Output .= '</table> </td></tr></table>';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>'; 194 227 break; 195 228 case 'SubjectList': … … 265 298 break; 266 299 default: 300 $Output .= '<strong>Celkové přehledy</strong><br/>'; 267 301 $Output .= '<a href="?table=AnnualBalance">Účetní závěrka</a><br />'; 268 302 $Output .= '<a href="?table=MonthlyBalance">Měsíční přehledy</a><br />'; 269 $Output .= '<a href="?table=CashFlow">Příjmy a výdaje</a><br />'; 270 $Output .= '<a href="?table=ClaimsLiabilities">Závazky a pohledávky</a><br />'; 271 $Output .= '<a href="?table=Advantages">Zálohy</a><br />'; 303 $Output .= '<a href="?table=SubjectList">Seznam subjektů</a><br />'; 272 304 $Output .= '<a href="?table=SmallAssets">Drobný majetek</a><br />'; 273 $Output .= '<a href="?table=SubjectList">Seznam subjektů</a><br />'; 305 $Output .= '<br/>'; 306 $Output .= '<strong>Roční přehledy</strong><br/>'; 307 $Output .= $this->ShowFinanceYears(); 308 $Year = $_GET['year'] * 1; 309 $Output .= '<a href="?table=Incomes&year='.$Year.'">Příjmy</a><br />'; 310 $Output .= '<a href="?table=Expenses&year='.$Year.'">Výdaje</a><br />'; 311 $Output .= '<a href="?table=Claims&year='.$Year.'">Pohledávky</a><br />'; 312 $Output .= '<a href="?table=Liabilities&year='.$Year.'">Závazky</a><br />'; 313 $Output .= '<a href="?table=Advantages&year='.$Year.'">Zálohy</a><br />'; 274 314 } 275 315 return($Output); 276 316 } 317 318 function ShowFinanceYears() 319 { 320 $Output = 'Roky: '; 321 $DbRows = $this->Database->select('FinanceYear', '*'); 322 while($DbRow = $DbRows->fetch_assoc()) 323 $Output .= '<a href="?year='.$DbRow['Id'].'">'.$DbRow['Year'].'</a> '; 324 $Output .= '<br/>'; 325 return($Output); 326 } 277 327 278 328 function AddMoney($Subject, $Value, $Text, $Time)
Note:
See TracChangeset
for help on using the changeset viewer.