Changeset 738 for trunk/temp/Bills.php
- Timestamp:
- Apr 14, 2015, 10:20:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/temp/Bills.php
r627 r738 15 15 if(strpos($Invoice['Text'], 'Poplatek za měsíc') !== false) 16 16 { 17 18 19 20 21 22 23 17 $Time = MysqlDateTimeToTime($Invoice['Time']); 18 $TimeParts = ExtractTime($Time); 19 $PeriodFrom = mktime($TimeParts['Hour'], $TimeParts['Minute'], $TimeParts['Second'], 20 $TimeParts['Month'], 1, $TimeParts['Year']); 21 $PeriodTo = mktime($TimeParts['Hour'], $TimeParts['Minute'], $TimeParts['Second'], 22 $TimeParts['Month'], date('t', $Time), $TimeParts['Year']); 23 $System->Database->query('UPDATE FinanceInvoice SET PeriodFrom = "'.TimeToMysqlDate($PeriodFrom). 24 24 '", PeriodTo ="'.TimeToMysqlDate($PeriodTo).'" WHERE Id='.$Invoice['Id']); 25 25 } 26 26 if(strpos($Invoice['Text'], 'za období') !== false) 27 27 { 28 29 30 31 32 33 28 $Period = substr($Invoice['Text'], strpos($Invoice['Text'], 'za období') + 10); 29 $PeriodFrom = strtotime(substr($Period, 0, strpos($Period, '-'))); 30 $PeriodTo = strtotime(substr($Period, strpos($Period, '-') + 1)); 31 $System->Database->query('UPDATE FinanceInvoice SET PeriodFrom = "'.TimeToMysqlDate($PeriodFrom). 32 '", PeriodTo ="'.TimeToMysqlDate($PeriodTo).'" WHERE Id='.$Invoice['Id']); 33 34 34 } 35 35 36 36 // SELECT * FROM (SELECT FinanceInvoice.Id, FinanceInvoice.Subject, FinanceInvoice.Value, (SELECT SUM(FinanceBillsItems.Price) FROM FinanceBillsItems WHERE FinanceBillsItems.Bill = FinanceBills.Id) AS BillPrice, (SELECT COUNT(FinanceBillsItems.Price) FROM FinanceBillsItems WHERE FinanceBillsItems.Bill = FinanceBills.Id) AS BillCount, (SELECT GROUP_CONCAT(FinanceBillsItems.Description SEPARATOR ",") FROM FinanceBillsItems WHERE FinanceBillsItems.Bill = FinanceBills.Id GROUP BY FinanceBillsItems.Bill) AS Items, FinanceInvoice.Text FROM `FinanceInvoice` LEFT JOIN FinanceBills ON FinanceBills.Id = FinanceInvoice.Bill WHERE FinanceInvoice.Bill IS NOT NULL) AS T WHERE Text <> Items AND Items <> "Poplatek za připojení k síti" 37 37 38 38 while($BillItem = $DbResult3->fetch_assoc()) 39 39 {
Note:
See TracChangeset
for help on using the changeset viewer.