Changeset 627
- Timestamp:
- Jan 2, 2014, 12:42:49 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/FormClasses.php
r620 r627 76 76 'DateStart' => array('Type' => 'Date', 'Caption' => 'První den', 'Default' => ''), 77 77 'DateEnd' => array('Type' => 'Date', 'Caption' => 'Poslední den', 'Default' => ''), 78 'Closed' => array('Type' => 'Boolean', 'Caption' => 'Uzavřen', 'Default' => 0), 78 79 'Sequence' => array('Type' => 'TDocumentLineSequenceListYear', 'Caption' => 'Čísleníky', 'Default' => ''), 79 80 ), -
trunk/Application/Version.php
r623 r627 1 1 <?php 2 2 3 $Revision = 62 3; // Subversion revision4 $DatabaseRevision = 62 0; // SQL structure revision5 $ReleaseTime = '2013-12-29';3 $Revision = 627; // Subversion revision 4 $DatabaseRevision = 627; // SQL structure revision 5 $ReleaseTime = mktime(0, 0, 0, 1, 2, 2014); -
trunk/Common/Global.php
r599 r627 53 53 function HumanDate($Time) 54 54 { 55 $Date = explode(' ', $Time); 56 $Parts = explode('-', $Date[0]); 57 if($Date != '0000-00-00') return(($Parts[2]*1).'.'.($Parts[1]*1).'.'.$Parts[0]); 58 else return(' '); 55 if($Time != '') { 56 $Date = explode(' ', $Time); 57 $Parts = explode('-', $Date[0]); 58 if($Date != '0000-00-00') return(($Parts[2]*1).'.'.($Parts[1]*1).'.'.$Parts[0]); 59 else return(' '); 60 } else return(' '); 59 61 } 60 62 -
trunk/Common/Page.php
r607 r627 112 112 $Output .= '<div id="Footer">'. 113 113 '<i>| Správa webu: '.$this->System->Config['Web']['Admin'].' | e-mail: '.$this->System->Config['Web']['AdminEmail'].' | '. 114 ' Verze: '.$Revision.' ('. HumanDate($ReleaseTime).') |';114 ' Verze: '.$Revision.' ('.$this->System->HumanDate($ReleaseTime).') |'; 115 115 if($this->ShowRuntimeInfo == true) $Output .= ' Doba generování: '.$Time.' s / '.ini_get('max_execution_time'). 116 116 ' s | Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B |'; -
trunk/Common/Setup/Updates.php
r623 r627 536 536 } 537 537 538 function UpdateTo627($Manager) 539 { 540 $Manager->Execute('ALTER TABLE `FinanceInvoice` CHANGE `TimeCreation` `Time` DATETIME NOT NULL DEFAULT "0000-00-00 00:00:00";'); 541 $Manager->Execute('ALTER TABLE `FinanceYear` ADD `Closed` INT NOT NULL ;'); 542 } 543 538 544 class Updates 539 545 { … … 569 575 615 => array('Revision' => 619, 'Function' => 'UpdateTo619'), 570 576 619 => array('Revision' => 620, 'Function' => 'UpdateTo620'), 577 620 => array('Revision' => 627, 'Function' => 'UpdateTo627'), 571 578 )); 572 579 } -
trunk/Modules/Finance/Bill.php
r565 r627 86 86 '</td><td valign="top">'. 87 87 '<br>'. 88 'Datum vystavení: '.HumanDate($Invoice['Time Creation']).'<br>'.89 'Datum zdanitel. plnění: '.HumanDate($Invoice['Time Creation']).'<br>'.88 'Datum vystavení: '.HumanDate($Invoice['Time']).'<br>'. 89 'Datum zdanitel. plnění: '.HumanDate($Invoice['Time']).'<br>'. 90 90 'Datum splatnosti: '.HumanDate($Invoice['TimeDue']).'<br>'; 91 91 if(($Invoice['PeriodFrom'] != '') and ($Invoice['PeriodTo'] != '')) -
trunk/Modules/Finance/Finance.php
r605 r627 164 164 // Get latest year 165 165 $DbResult = $this->Database->select('FinanceYear', '*', '1 ORDER BY `Year` DESC LIMIT 1'); 166 } else $DbResult = $this->Database->select('FinanceYear', '*', 'Id='.$FinanceYear); 166 } else $DbResult = $this->Database->select('FinanceYear', '*', '`Year`='.$FinanceYear); 167 echo('rok:'.$FinanceYear.' '.$DbResult->num_rows); 168 if($DbResult->num_rows == 0) throw new Exception('Rok '.$FinanceYear.' nenalezen'); 167 169 $FinanceYear = $DbResult->fetch_assoc(); 170 if($FinanceYear['Closed'] == 1) throw new Exception('Rok '.$FinanceYear['Year'].' je již uzavřen. Nelze do něj přidávat položky.'); 168 171 169 172 $DbResult = $this->Database->query('SELECT `Shortcut`, `Id` FROM `DocumentLine` WHERE `Id`='.$Id); … … 349 352 'Title' => 'Faktury', 350 353 'Table' => 'FinanceInvoice', 351 'DefaultSortColumn' => 'Time Creation',354 'DefaultSortColumn' => 'Time', 352 355 'Items' => array( 353 356 'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''), 354 357 'BillCode' => array('Type' => 'String', 'Caption' => 'Označení', 'Default' => ''), 355 358 'Subject' => array('Type' => 'TSubject', 'Caption' => 'Subjekt', 'Default' => ''), 356 'Time Creation' => array('Type' => 'Date', 'Caption' => 'Čas vytvoření', 'Default' => ''),359 'Time' => array('Type' => 'Date', 'Caption' => 'Čas vytvoření', 'Default' => ''), 357 360 'TimeDue' => array('Type' => 'Date', 'Caption' => 'Čas splatnosti', 'Default' => ''), 358 361 'TimePayment' => array('Type' => 'Date', 'Caption' => 'Čas zaplacení', 'Default' => '', 'Null' => true), … … 462 465 function BeforeInsertFinanceOperation($Form) 463 466 { 467 $Year = date("Y", $Form->Values['Time']); 464 468 $DocumentLine = $Form->Values['DocumentLine']; 465 $Form->Values['BillCode'] = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine );469 $Form->Values['BillCode'] = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine, $Year); 466 470 return($Form->Values); 467 471 } -
trunk/Modules/Finance/Manage.php
r609 r627 111 111 $SumValue = $SumValue + $Item['Price'] * $Item['Quantity']; 112 112 $this->Database->insert('FinanceInvoice', array( 113 'Subject' => $Subject, 'Time Creation' => TimeToMysqlDateTime($TimeCreation),113 'Subject' => $Subject, 'Time' => TimeToMysqlDateTime($TimeCreation), 114 114 'TimeDue' => TimeToMysqlDateTime($TimeDue), 'Value' => $SumValue, 'BillCode' => $BillCode, 115 115 'PeriodFrom' => TimeToMysqlDate($PeriodFrom), 'PeriodTo' => TimeToMysqlDate($PeriodTo), … … 352 352 '<th style="border-style: solid; border-width: 1px; padding: 1px 5px 1px 5px; text-align: center; font-weight: bold;">Částka [Kč]</th></tr>'."\n"; 353 353 $DbResult = $this->Database->query('SELECT T1.* FROM ((SELECT Text, Time, Value AS Value, File FROM FinanceOperation WHERE (Subject='.$Member['Subject'].')) UNION ALL '. 354 '(SELECT CONCAT(`Text`, (SELECT GROUP_CONCAT(`Description` SEPARATOR "<br/>") FROM `FinanceInvoiceItem` WHERE `FinanceInvoiceItem`.`FinanceInvoice` = `FinanceInvoice`.`Id`)) AS `Text`, Time Creation as Time, -Value as Value, File FROM FinanceInvoice WHERE (Subject='.354 '(SELECT CONCAT(`Text`, (SELECT GROUP_CONCAT(`Description` SEPARATOR "<br/>") FROM `FinanceInvoiceItem` WHERE `FinanceInvoiceItem`.`FinanceInvoice` = `FinanceInvoice`.`Id`)) AS `Text`, Time, -Value as Value, File FROM FinanceInvoice WHERE (Subject='. 355 355 $Member['Subject'].')) ORDER BY Time DESC) AS T1 WHERE (T1.Time > "'.$Member['BillingPeriodLastDate'].'")'); 356 356 while($DbRow = $DbResult->fetch_assoc()) -
trunk/Modules/Finance/UserState.php
r554 r627 69 69 'FROM FinanceOperation WHERE (Subject='.$Subject['Id'].')) UNION ALL '. 70 70 '(SELECT (SELECT GROUP_CONCAT(Description SEPARATOR ",") FROM FinanceInvoiceItem WHERE FinanceInvoice=FinanceInvoice.Id) AS Text, '. 71 'Time Creation as Time, -Value as Value, File, BillCode, PeriodFrom, PeriodTo FROM FinanceInvoice WHERE (Subject='.$Subject['Id'].')) ORDER BY Time DESC) AS T1';71 'Time, -Value as Value, File, BillCode, PeriodFrom, PeriodTo FROM FinanceInvoice WHERE (Subject='.$Subject['Id'].')) ORDER BY Time DESC) AS T1'; 72 72 $DbResult = $this->Database->query('SELECT SUM(T1.Value) AS Total FROM '.$UserOperationTableQuery); 73 73 $DbRow = $DbResult->fetch_array(); -
trunk/Modules/Finance/Zivnost.php
r548 r627 28 28 $Balance['Spend']['End'] = $Row[0] + 0; 29 29 30 $DbResult = $this->Database->query('SELECT SUM(Value) FROM FinanceInvoice WHERE (Time Creation < "'.TimeToMysqlDateTime($StartTime).'") AND (TimeCreation>= "'.TimeToMysqlDateTime($this->StartEvidence).'") AND (Value > 0)');30 $DbResult = $this->Database->query('SELECT SUM(Value) FROM FinanceInvoice WHERE (Time < "'.TimeToMysqlDateTime($StartTime).'") AND (Time >= "'.TimeToMysqlDateTime($this->StartEvidence).'") AND (Value > 0)'); 31 31 $Row = $DbResult->fetch_array(); 32 32 $Balance['Claims']['Start'] = $Row[0] + 0; 33 $DbResult = $this->Database->query('SELECT SUM(Value) FROM FinanceInvoice WHERE (Time Creation <= "'.TimeToMysqlDateTime($EndTime).'") AND (TimeCreation>= "'.TimeToMysqlDateTime($this->StartEvidence).'") AND (Value > 0)');33 $DbResult = $this->Database->query('SELECT SUM(Value) FROM FinanceInvoice WHERE (Time <= "'.TimeToMysqlDateTime($EndTime).'") AND (Time >= "'.TimeToMysqlDateTime($this->StartEvidence).'") AND (Value > 0)'); 34 34 $Row = $DbResult->fetch_array(); 35 35 $Balance['Claims']['End'] = $Row[0] + 0; 36 36 37 $DbResult = $this->Database->query('SELECT SUM(-Value) FROM FinanceInvoice WHERE (Time Creation < "'.TimeToMysqlDateTime($StartTime).'") AND (TimeCreation>= "'.TimeToMysqlDateTime($this->StartEvidence).'") AND (Value < 0)');37 $DbResult = $this->Database->query('SELECT SUM(-Value) FROM FinanceInvoice WHERE (Time < "'.TimeToMysqlDateTime($StartTime).'") AND (Time >= "'.TimeToMysqlDateTime($this->StartEvidence).'") AND (Value < 0)'); 38 38 $Row = $DbResult->fetch_array(); 39 39 $Balance['Liabilities']['Start'] = $Row[0] + 0; 40 $DbResult = $this->Database->query('SELECT SUM(-Value) FROM FinanceInvoice WHERE (Time Creation <= "'.TimeToMysqlDateTime($EndTime).'") AND (TimeCreation>= "'.TimeToMysqlDateTime($this->StartEvidence).'") AND (Value < 0)');40 $DbResult = $this->Database->query('SELECT SUM(-Value) FROM FinanceInvoice WHERE (Time <= "'.TimeToMysqlDateTime($EndTime).'") AND (Time >= "'.TimeToMysqlDateTime($this->StartEvidence).'") AND (Value < 0)'); 41 41 $Row = $DbResult->fetch_array(); 42 42 $Balance['Liabilities']['End'] = $Row[0] + 0; … … 207 207 $DbResult = $this->Database->query('SELECT *, (SELECT GROUP_CONCAT(Description SEPARATOR ",") FROM FinanceInvoiceItem WHERE FinanceInvoiceItem.FinanceInvoice = FinanceInvoice.Id) AS Text '. 208 208 'FROM FinanceInvoice JOIN Subject ON Subject.Id = FinanceInvoice.Subject '. 209 'WHERE (Value > 0) AND (FinanceInvoice.Time Creation>= "'.$Year['DateStart'].210 '") AND (FinanceInvoice.Time Creation <= "'.$Year['DateEnd'].'") ORDER BY TimeCreation');209 'WHERE (Value > 0) AND (FinanceInvoice.Time >= "'.$Year['DateStart']. 210 '") AND (FinanceInvoice.Time <= "'.$Year['DateEnd'].'") ORDER BY Time'); 211 211 while($Row = $DbResult->fetch_array()) 212 212 { 213 213 if($Row['TimePayment'] == '0000-00-00 00:00:00') $Row['TimePayment'] = ' '; 214 $Output .= '<tr><td>'.HumanDate($Row['Time Creation']).'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td></tr>';214 $Output .= '<tr><td>'.HumanDate($Row['Time']).'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td></tr>'; 215 215 $Total += $Row['Value']; 216 216 } … … 229 229 $DbResult = $this->Database->query('SELECT *, (SELECT GROUP_CONCAT(Description SEPARATOR ",") FROM FinanceInvoiceItem WHERE FinanceInvoiceItem.FinanceInvoice = FinanceInvoice.Id) AS Text '. 230 230 'FROM FinanceInvoice JOIN Subject ON Subject.Id = FinanceInvoice.Subject '. 231 'WHERE (Value < 0) AND (FinanceInvoice.Time Creation>= "'.$Year['DateStart'].232 '") AND (FinanceInvoice.Time Creation <= "'.$Year['DateEnd'].'") ORDER BY TimeCreation');231 'WHERE (Value < 0) AND (FinanceInvoice.Time >= "'.$Year['DateStart']. 232 '") AND (FinanceInvoice.Time <= "'.$Year['DateEnd'].'") ORDER BY Time'); 233 233 while($Row = $DbResult->fetch_array()) 234 234 { 235 235 if($Row['TimePayment'] == '0000-00-00 00:00:00') $Row['TimePayment'] = ' '; 236 236 $Row['Value'] = $Row['Value'] * -1; 237 $Output .= '<tr><td>'.HumanDate($Row['Time Creation']).'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td></tr>';237 $Output .= '<tr><td>'.HumanDate($Row['Time']).'</td><td>'.$Row['BillCode'].'</td><td>'.$Row['Name'].'</td><td>'.$Row['Text'].'</td><td>'.$Row['Value'].'</td></tr>'; 238 238 $Total += $Row['Value']; 239 239 } … … 288 288 $Output .= '<table style="font-size: smaller;" border="1" cellspacing="0" cellpadding="3">'; 289 289 $Output .= '<tr><th>Datum vytvoření</th><th>Datum zaplacení</th><th>Název</th><th>Hodnota [Kč]</th><th>Doklad</th></tr>'; 290 $DbResult = $this->Database->select('FinanceInvoice', '*, (SELECT GROUP_CONCAT(Description SEPARATOR ",") FROM FinanceInvoiceItem WHERE FinanceInvoiceItem.FinanceInvoice = FinanceInvoice.Id) AS Text', 'Subject='.$_GET['Id'].' ORDER BY Time Creation');291 while($Row = $DbResult->fetch_array()) 292 { 293 $Output .= '<tr><td>'.HumanDate($Row['Time Creation']).'</td><td>'.HumanDate($Row['TimePayment']).290 $DbResult = $this->Database->select('FinanceInvoice', '*, (SELECT GROUP_CONCAT(Description SEPARATOR ",") FROM FinanceInvoiceItem WHERE FinanceInvoiceItem.FinanceInvoice = FinanceInvoice.Id) AS Text', 'Subject='.$_GET['Id'].' ORDER BY Time'); 291 while($Row = $DbResult->fetch_array()) 292 { 293 $Output .= '<tr><td>'.HumanDate($Row['Time']).'</td><td>'.HumanDate($Row['TimePayment']). 294 294 '</td><td>'.$Row['Text'].'</td><td>'.($Row['Value']).'</td><td>'.$Row['BillCode'].'</td></tr>'; 295 295 } … … 302 302 while($Row = $DbResult->fetch_array()) 303 303 { 304 $Output .= '<tr><td>'.$Row['Time Creation'].'</td><td>'.$Row['TimePass'].'</td><td>'.$Row['Direction'].'</td><td>'.($Row['Value']).'</td><td>'.$Row['CashFlowId'].'</td></tr>';304 $Output .= '<tr><td>'.$Row['Time'].'</td><td>'.$Row['TimePass'].'</td><td>'.$Row['Direction'].'</td><td>'.($Row['Value']).'</td><td>'.$Row['CashFlowId'].'</td></tr>'; 305 305 } 306 306 $Output .= '</table>';*/ -
trunk/Modules/IS/IS.php
r608 r627 92 92 } catch (Exception $E) 93 93 { 94 $Output .= $this->SystemMessage('Úprava položky', 'Položku se nepodařilo uložit. Opravte problém a opakujte akci. ');94 $Output .= $this->SystemMessage('Úprava položky', 'Položku se nepodařilo uložit. Opravte problém a opakujte akci.<br/>'.$E->getMessage()); 95 95 $Form->OnSubmit = '?a=edit&t='.$Table.'&i='.$_GET['i'].'&o=save'; 96 96 $Output .= $Form->ShowEditForm(); … … 178 178 } catch (Exception $E) 179 179 { 180 $Output .= $this->SystemMessage('Přidání položky', 'Položku se nepodařilo přidat. Opravte problém a opakujte akci. ');180 $Output .= $this->SystemMessage('Přidání položky', 'Položku se nepodařilo přidat. Opravte problém a opakujte akci.<br/>'.$E->getMessage()); 181 181 $Form->OnSubmit = '?a=add&t='.$Table.'&o=save'; 182 182 $Output .= $Form->ShowEditForm(); -
trunk/temp/Bills.php
r548 r627 15 15 if(strpos($Invoice['Text'], 'Poplatek za měsíc') !== false) 16 16 { 17 $Time = MysqlDateTimeToTime($Invoice['Time Creation']);17 $Time = MysqlDateTimeToTime($Invoice['Time']); 18 18 $TimeParts = ExtractTime($Time); 19 19 $PeriodFrom = mktime($TimeParts['Hour'], $TimeParts['Minute'], $TimeParts['Second'],
Note:
See TracChangeset
for help on using the changeset viewer.