Changeset 866 for trunk/Modules/Finance/Finance.php
- Timestamp:
- Dec 23, 2019, 1:08:17 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/Finance.php
r844 r866 82 82 return(round($Spotreba * 0.72 * $this->kWh)); 83 83 } 84 84 85 85 function CreateFinanceYear($Year) 86 86 { 87 87 $StartTime = mktime(0, 0, 0, 1, 1, $Year); 88 88 $EndTime = mktime(0, 0, 0, 12, 31, $Year); 89 $this->Database->insert('FinanceYear', array('Year' => $Year, 89 $this->Database->insert('FinanceYear', array('Year' => $Year, 90 90 'DateStart' => TimeToMysqlDate($StartTime), 'DateEnd' => TimeToMysqlDate($EndTime), 'Closed' => 0)); 91 91 $YearId = $this->Database->insert_id; … … 95 95 while($DbRow = $DbResult->fetch_assoc()) 96 96 { 97 $this->Database->insert('DocumentLineSequence', array('FinanceYear' => $YearId, 97 $this->Database->insert('DocumentLineSequence', array('FinanceYear' => $YearId, 98 98 'NextNumber' => 1, 'YearPrefix' => 1, 'DocumentLine' => $DbRow['Id'])); 99 99 } 100 100 } 101 101 102 102 function GetFinanceYear($Year) 103 103 { … … 111 111 { 112 112 $this->CreateFinanceYear($Year); 113 $DbResult = $this->Database->select('FinanceYear', '*', '`Year`='.$Year); 113 $DbResult = $this->Database->select('FinanceYear', '*', '`Year`='.$Year); 114 114 } else throw new Exception('Rok '.$Year.' nenalezen'); 115 115 } 116 116 $FinanceYear = $DbResult->fetch_assoc(); 117 if($FinanceYear['Closed'] == 1) 117 if($FinanceYear['Closed'] == 1) 118 118 throw new Exception('Rok '.$FinanceYear['Year'].' je již uzavřen. Nelze do něj přidávat položky.'); 119 return $FinanceYear; 119 return $FinanceYear; 120 120 } 121 121 … … 273 273 'AfterInsert' => array($this, 'AfterInsertFinanceOperation'), 274 274 'BeforeModify' => array($this, 'BeforeModifyFinanceOperation'), 275 'ItemActions' => array( 276 array('Caption' => 'Přegenerovat doklad', 'URL' => '/finance/sprava/?Operation=RegenerateOperation&i=#RowId'), 277 ), 275 278 )); 276 279 … … 377 380 'AfterInsert' => array($this, 'AfterInsertFinanceInvoice'), 378 381 'BeforeModify' => array($this, 'BeforeModifyFinanceInvoice'), 382 'ItemActions' => array( 383 array('Caption' => 'Přegenerovat doklad', 'URL' => '/finance/sprava/?Operation=RegenerateInvoice&i=#RowId'), 384 ), 379 385 )); 380 386 $this->System->FormManager->RegisterClass('FinanceInvoiceIn', $this->System->FormManager->Classes['FinanceInvoice']);
Note:
See TracChangeset
for help on using the changeset viewer.