Changeset 480 for trunk/finance/manage.php
- Timestamp:
- Feb 5, 2013, 10:25:54 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 9 9 .buildpath 10 10 .settings 11 nbproject
-
- Property svn:ignore
-
trunk/finance/manage.php
r479 r480 55 55 $Output .= $this->System->Modules['Finance']->RecalculateMemberPayment(); 56 56 break; 57 case ' MonthlyPayment':57 case 'ShowMonthlyPayment': 58 58 $Output = $this->ShowMonthlyPayment(); 59 break; 60 case 'ProcessMonthlyPayment': 61 $Output = $this->ProcessMonthlyPayment(); 59 62 break; 60 63 case 'GenerateBills': … … 69 72 $Output .= '<a href="?Operation=Bills">Správa dokladů</a><br />'; 70 73 $Output .= '<a href="?Operation=Recalculate">Přepočet financí</a><br />'; 71 $Output .= '<a href="?Operation= MonthlyPayment">Měsíční vyúčtování</a><br />';74 $Output .= '<a href="?Operation=ShowMonthlyPayment">Měsíční vyúčtování</a><br />'; 72 75 $Output .= '<a href="clenove.php">Seznam členů</a><br />'; 73 76 $Output .= '<a href="zivnost.php">Živnost</a><br />'; … … 288 291 289 292 function ShowMonthlyPayment() 293 { 294 if(!$this->System->Modules['User']->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění'); 295 $SQL = 'SELECT Member.*, MemberPayment.MonthlyTotal AS Monthly, '. 296 'MemberPayment.Cash AS Cash, '. 297 '(SELECT GROUP_CONCAT(Service.Name) FROM ServiceCustomerRel LEFT JOIN Service '. 298 'ON Service.Id=ServiceCustomerRel.Service WHERE ServiceCustomerRel.Customer=Member.Id AND ServiceCustomerRel.Period=1) AS ServicesNextMonth, '. 299 'UNIX_TIMESTAMP(Member.BillingPeriodLastDate) AS LastDate, Subject.Name AS SubjectName, '. 300 'FinanceBillingPeriod.Name AS BillingPeriodName '. 301 'FROM MemberPayment JOIN Member ON Member.Id=MemberPayment.Member JOIN Subject '. 302 'ON Subject.Id=Member.Subject LEFT JOIN FinanceBillingPeriod ON '. 303 'FinanceBillingPeriod.Id=Member.BillingPeriodNext'; 304 305 $DbResult = $this->Database->query('SELECT COUNT(*) FROM ('.$SQL.') AS T'); 306 $DbRow = $DbResult->fetch_row(); 307 $PageList = GetPageList($DbRow[0]); 308 309 $Output = $PageList['Output']; 310 $Output .= '<table class="WideTable" style="font-size: small;">'; 311 312 $TableColumns = array( 313 array('Name' => 'SubjectName', 'Title' => 'Jméno'), 314 array('Name' => 'Monthly', 'Title' => 'Platba'), 315 array('Name' => 'Cash', 'Title' => 'Kredit'), 316 array('Name' => 'LastDate', 'Title' => 'Poslední fakturace'), 317 array('Name' => 'ServicesNextMonth', 'Title' => 'Služby'), 318 array('Name' => 'BillingPeriodName', 'Title' => 'Perioda'), 319 ); 320 $Order = GetOrderTableHeader($TableColumns, 'SubjectName', 0); 321 $Output .= $Order['Output']; 322 323 $Query = $SQL.' '.$Order['SQL'].$PageList['SQLLimit']; 324 325 $DbResult = $this->Database->query($Query); 326 while($Row = $DbResult->fetch_assoc()) 327 { 328 $Output .= '<tr>'. 329 '<td>'.$Row['SubjectName'].'</td>'. 330 '<td>'.$Row['Monthly'].'</td>'. 331 '<td>'.$Row['Cash'].'</td>'. 332 '<td>'.date('j.n.Y', $Row['LastDate']).'</td>'. 333 '<td>'.$Row['ServicesNextMonth'].'</td>'. 334 '<td>'.$Row['BillingPeriodName'].'</td>'. 335 '</tr>'; 336 } 337 $Output .= '</table>'; 338 $Output .= $PageList['Output']; 339 $Output .= '<a href="?Operation=ProcessMonthlyPayment">Generovat faktury</a>'; 340 return($Output); 341 } 342 343 function ProcessMonthlyPayment() 290 344 { 291 345 if(!$this->System->Modules['User']->CheckPermission('Finance', 'Manage')) return('Nemáte oprávnění');
Note:
See TracChangeset
for help on using the changeset viewer.