Changeset 295 for trunk/finance
- Timestamp:
- Oct 2, 2010, 7:40:25 PM (14 years ago)
- Location:
- trunk/finance
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/finance/bills.php
r184 r295 27 27 28 28 switch($Bill['Type']) 29 30 29 { 30 case 'invoice': 31 31 $Output = '<table width="100%"><tr><td colspan="2">'. 32 32 '<font size="6"><div align="center">Faktura - daňový doklad</font></div>'. … … 62 62 'Datum zdanitel. plnění: '.HumanDate($Bill['TimeCreate']).'<br>'. 63 63 'Datum splatnosti: '.HumanDate($Bill['TimeDue']).'<br>'; 64 if(($Bill['TimeFrom'] != '0000-00-00 00:00:00') and ($Bill['TimeTo'] != '0000-00-00 00:00:00'))65 $Output .= 'Fakturované období: '.HumanDate($Bill['TimeFrom']).' - '.HumanDate($Bill['TimeTo']).'<br>';64 //if(($Bill['TimeFrom'] != '0000-00-00 00:00:00') and ($Bill['TimeTo'] != '0000-00-00 00:00:00')) 65 // $Output .= 'Fakturované období: '.HumanDate($Bill['TimeFrom']).' - '.HumanDate($Bill['TimeTo']).'<br>'; 66 66 $Output .= '</td></tr>'. 67 67 '<tr><td colspan="2">'. … … 83 83 '<tr><td colspan="2"><hr></td></tr>'. 84 84 '</table>'; 85 86 87 85 break; 86 case 'income': 87 $Output = '<table width="100%" border="1" cellspacing="0" cellpadding="3"><tr><td width="50%">'. 88 88 '<strong>Firma:</strong><br>'. 89 89 'Ing. Jiří Hajda<br>'. … … 105 105 if($Subject['DIC'] != '') $Output .= 'DIČ: '.$Subject['DIC'].'<br>'; 106 106 $Total = 0; 107 107 $Description = ''; 108 108 foreach($Dodavka as $Polozka) 109 109 { … … 114 114 '<tr><td colspan="2"><strong>Částka:</strong> '.$Total.' Kč<br><br>'. 115 115 '</td></tr>'. 116 '<tr><td colspan="2"><strong>Účel platby:</strong><br>'.$Description.'</td></tr>'. 117 116 '<tr><td colspan="2"><strong>Účel platby:</strong><br>'.$Description.'</td></tr>'. 117 '<tr><td><br><br>Podpis příjemce:</td><td><br><br>Podpis pokladníka:</td></tr>'; 118 118 $Output .= '</table>'; 119 break; 120 } 121 119 break; 120 } 121 return($Output); 122 122 } 123 123 -
trunk/finance/clenove.php
r207 r295 10 10 { 11 11 $Finance = $this->System->Modules['Finance']; 12 13 12 $this->System->Modules['Finance']->LoadTariffs(1); 13 if(!$this->System->Modules['User']->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění'); 14 14 15 15 // Seznam členů 16 16 $Output = 'Seznam účastníků:<br>'. 17 17 '<table class="WideTable">'. 18 18 '<tr><th>Zástupce</th><th>Subjekt</th>'; 19 19 //<th>Cena za zařízení [Kč]</th> 20 $Output .= '<th>Měsíční poplatek [Kč]</th><th>Stav účtu [Kč]</th><th>Běžící tarif</th><th>Příští tarif</th>< /tr>';20 $Output .= '<th>Měsíční poplatek [Kč]</th><th>Stav účtu [Kč]</th><th>Běžící tarif</th><th>Příští tarif</th><th>Poznámky</th><th>WWW</th></tr>'; 21 21 $TotalDevice = 0; 22 22 $TotalMonth = 0; 23 23 $TotalCash = 0; 24 $DbResult = $this->Database->query('SELECT MonthlyTotal, Cash, Subject.Id, Subject. Name, NetworkDevice, InternetTariffCurrentMonth, InternetTariffNextMonth, User.Name AS FullName FROM MemberPayment LEFT JOIN Member ON Member.Id=MemberPayment.Member LEFT JOIN Subject ON Subject.Id=Member.Subject JOIN User ON User.Id=Member.ResponsibleUser ORDER BY FullName');24 $DbResult = $this->Database->query('SELECT MonthlyTotal, Cash, Subject.Id, Subject.WWW, Subject.Note, Subject.Name, NetworkDevice, InternetTariffCurrentMonth, InternetTariffNextMonth, User.Name AS FullName FROM MemberPayment LEFT JOIN Member ON Member.Id=MemberPayment.Member LEFT JOIN Subject ON Subject.Id=Member.Subject JOIN User ON User.Id=Member.ResponsibleUser ORDER BY FullName'); 25 25 while($Row = $DbResult->fetch_assoc()) 26 26 { … … 32 32 $Output .= '<tr><td>'.$Row['FullName'].'</td><td><a href="user_state.php?Subject='.$Row['Id'].'">'.$Row['Name'].'</a></td>'; 33 33 //<td align="right">'.$Row['network_device'].'</td> 34 $Output .= '<td align="right">'.$Row['MonthlyTotal'].'</td><td align="right">'.$Row['Cash'].'</td><td align="center">'.$Tarif.'</td><td align="center">'.$PristiTarif.'</td>< /tr>';34 $Output .= '<td align="right">'.$Row['MonthlyTotal'].'</td><td align="right">'.$Row['Cash'].'</td><td align="center">'.$Tarif.'</td><td align="center">'.$PristiTarif.'</td><td>'.$Row['Note'].'</td><td>'.$Row['WWW'].'</td></tr>'; 35 35 $TotalDevice += $Row['NetworkDevice']; 36 36 $TotalMonth += ($Row['MonthlyTotal']); -
trunk/finance/manage.php
r294 r295 54 54 case 'MonthlyPayment': 55 55 $Output = $this->ShowMonthlyPayment(); 56 break; 57 case 'GenerateBills': 58 $Output = $this->GenerateBills(); 56 59 break; 57 60 default: … … 68 71 $Output .= '<a href="clenove.php">Seznam členů</a><br />'; 69 72 $Output .= '<a href="zivnost.php">Živnost</a><br />'; 73 $Output .= '<a href="?Operation=GenerateBills">Generovat chybějící doklady</a><br />'; 70 74 } 71 75 return($Output); … … 538 542 $BillCode = $Finance->GetNextDocumentLineNumber(6); // Faktury vydané 539 543 $BillId = $this->System->Modules['Bill']->CreateBill($Member['Subject'], array(array('Description' => 'Připojení k síti', 'Price' => $PayPerPeriod, 'Quantity' => 1)), $Period['From'], $Period['To'], $BillCode); 540 $this->Database->insert('FinanceClaimsLiabilities', array('Value' => $PayPerPeriod, 'Subject' => $Member['Subject'], 'TimeCreation' => 'NOW()', 'T ext' => 'Připojení k síti za období '.$TimePeriodText, 'Bill' => 0, 'BillCode' => $BillCode));544 $this->Database->insert('FinanceClaimsLiabilities', array('Value' => $PayPerPeriod, 'Subject' => $Member['Subject'], 'TimeCreation' => 'NOW()', 'TimeDue' => 'DATE_ADD(NOW(), INTERVAL 15 DAY)', 'Text' => 'Připojení k síti za období '.$TimePeriodText, 'Bill' => 0, 'BillCode' => $BillCode)); 541 545 $Output .= $this->SendPaymentEmail($Member['Id']); 542 546 $this->Database->update('Member', 'Id='.$Member['Id'], array('BillingPeriodLastDate' => TimeToMysqlDateTime($Period['To']))); … … 616 620 } else $Output = 'Uživatel '.$User['Name'].' nemá email.'; 617 621 } 622 623 function GenerateBills() 624 { 625 // FinanceClaimsLiablities 626 $DbResult = $this->Database->query('SELECT * FROM FinanceClaimsLiabilities WHERE (BillCode <> "") AND (Value >= 0)'); 627 while($Row = $DbResult->fetch_assoc()) 628 { 629 $BillId = $this->System->Modules['Bill']->CreateBill($Row['Subject'], array(array('Description' => $Row['Text'], 'Price' => $Row['Value'], 'Quantity' => 1)), MysqlDateTimeToTime($Row['TimeCreation']), MysqlDateTimeToTime($Row['TimeDue']), $Row['BillCode']); 630 $this->Database->update('FinanceClaimsLiabilities', 'Id='.$Row['Id'], array('Bill' => $BillId)); 631 echo('.'); 632 } 633 634 // FinanceOperations 635 } 618 636 } 619 637
Note:
See TracChangeset
for help on using the changeset viewer.