Changeset 52
- Timestamp:
- Feb 24, 2008, 3:18:56 PM (17 years ago)
- Location:
- www
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
www/finance/bills.php
r50 r52 39 39 $User['fullname'].'<br>'. 40 40 $User['street'].'<br>'. 41 $User['psc'].' '.$User['town'].'<br>'. 42 'IČO: '.$User['ico'].'<br>'. 41 $User['psc'].' '.$User['town'].'<br>'; 42 if($User['ico'] != 0) $Output .= 'IČO: '.$User['ico'].'<br>'; 43 $Output .= 43 44 '</td></tr>'. 44 45 '<tr><td colspan="2"><hr></td></tr>'. … … 82 83 global $Database; 83 84 84 $Database->insert('finance_bills', array('time_create' => 'NOW()', 'user_id' => $UserId, 'time_from' => TimeToMysqlDateTime($TimeFrom), 'time_to' => TimeToMysqlDateTime($TimeTo), 'time_due' => TimeToMysqlDateTime(time()+ 15*24*3600)));85 $Database->insert('finance_bills', array('time_create' => TimeToMysqlDateTime($TimeFrom), 'user_id' => $UserId, 'time_from' => TimeToMysqlDateTime($TimeFrom), 'time_to' => TimeToMysqlDateTime($TimeTo), 'time_due' => TimeToMysqlDateTime($TimeFrom + 15*24*3600))); 85 86 $BillId = $Database->insert_id; 86 87 foreach($Items as $Item) … … 122 123 $Output = shell_exec('echo "'.addslashes(from_utf8($HtmlCode)).'"|htmldoc --no-numbered --webpage --charset 8859-2 -t pdf -'); 123 124 return($Output); 125 } 126 127 function CustomGenerate() 128 { 129 global $Database; 130 131 $DbResult = $Database->select('finance_operations', '*', '(date="2008-02-01" AND comment="Poplatek za měsíc Únor") OR '. 132 '(date="2008-01-01" AND comment="Poplatek za měsíc Leden") OR (date="2007-12-01" AND comment="Poplatek za měsíc Prosinec") AND (bill_id = 0)'); 133 while($Row = $DbResult->fetch_array()) 134 { 135 echo($Row['id']."<br>\n"); 136 $Time = MysqlDateToTime($Row['date']); 137 $BillId = $this->CreateBill($Row['user'], array(array('description' => 'Poplatek za připojení k síti', 'price' => (-$Row['money']), 'quantity' => 1)), $Time, $Time + (date("t", time()) - 1) * 24 * 3600); 138 $Database->update('finance_operations', 'id='.$Row['id'], array('bill_id' => $BillId)); 139 } 124 140 } 125 141 -
www/finance/prepocet.php
r50 r52 128 128 RecalculateTariffs(); 129 129 //DiscountNetworkDevicePrice(); 130 $InvoiceGenerator->CustomGenerate(); 130 131 RecalculateUsersFinance(); 131 132 -
www/global.php
r48 r52 45 45 { 46 46 return(date('Y-m-d H:i:s', $Time)); 47 } 48 49 function MysqlDateTimeToTime($Time) 50 { 51 $Parts = explode(' ', $Time); 52 $DateParts = explode('-', $Parts[0]); 53 $TimeParts = explode(':', $Parts[1]); 54 $Result = mktime($TimeParts[0], $TimeParts[1], $TimeParts[2], $DateParts[1], $DateParts[2], $DateParts[0]); 55 return($Result); 56 } 57 58 function MysqlDateToTime($Time) 59 { 60 return(MysqlDateTimeToTime($Time.' 0:0:0')); 47 61 } 48 62
Note:
See TracChangeset
for help on using the changeset viewer.