Changeset 738 for trunk/temp/Bills.php


Ignore:
Timestamp:
Apr 14, 2015, 10:20:16 PM (10 years ago)
Author:
chronos
Message:
  • Removed: Spaces on end of line.
  • Modified: Tabs converted to spaces.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/temp/Bills.php

    r627 r738  
    1515  if(strpos($Invoice['Text'], 'Poplatek za měsíc') !== false)
    1616  {
    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).
     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).
    2424      '", PeriodTo ="'.TimeToMysqlDate($PeriodTo).'" WHERE Id='.$Invoice['Id']);
    2525  }
    2626  if(strpos($Invoice['Text'], 'za období') !== false)
    2727  {
    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          
     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
    3434  }
    35  
     35
    3636  // 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
    3838  while($BillItem = $DbResult3->fetch_assoc())
    3939  {
Note: See TracChangeset for help on using the changeset viewer.