Changeset 738 for trunk/Modules/Finance/Finance.php
- Timestamp:
- Apr 14, 2015, 10:20:16 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/Finance.php
r737 r738 159 159 function GetVATByType($TypeId) 160 160 { 161 162 161 $Time = time(); 162 $DbResult = $this->Database->select('FinanceVAT', 'Value', '(Type='.$TypeId. 163 163 ') AND (ValidFrom <= "'.TimeToMysqlDate($Time).'") AND ((ValidTo >= "'. 164 164 TimeToMysqlDate($Time).'") OR (ValidTo IS NULL)) LIMIT 1'); … … 204 204 'DefaultSortOrder' => 1, 205 205 'Items' => array( 206 207 206 'Direction' => array('Type' => 'TFinanceOperationDirection', 'Caption' => 'Směr', 'Default' => '1'), 207 'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''), 208 208 'BillCode' => array('Type' => 'String', 'Caption' => 'Označení', 'Default' => ''), 209 209 'Subject' => array('Type' => 'TSubject', 'Caption' => 'Subjekt', 'Default' => ''), … … 274 274 'DefaultSortOrder' => 1, 275 275 'Items' => array( 276 277 276 'Direction' => array('Type' => 'TFinanceInvoiceDirection', 'Caption' => 'Směr', 'Default' => '1'), 277 'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => ''), 278 278 'BillCode' => array('Type' => 'String', 'Caption' => 'Označení', 'Default' => ''), 279 279 'Subject' => array('Type' => 'TSubject', 'Caption' => 'Subjekt', 'Default' => ''), … … 286 286 'PeriodFrom' => array('Type' => 'Date', 'Caption' => 'Období od', 'Default' => '', 'Null' => true), 287 287 'PeriodTo' => array('Type' => 'Date', 'Caption' => 'Období do', 'Default' => '', 'Null' => true), 288 288 'Cash' => array('Type' => 'Boolean', 'Caption' => 'Platit hotově', 'Default' => ''), 289 289 'Items' => array('Type' => 'TFinanceInvoiceItemListInvoice', 'Caption' => 'Položky', 'Default' => ''), 290 290 'OperationRel' => array('Type' => 'TFinanceInvoiceOperationRelListInvoice', 'Caption' => 'Platba', 'Default' => ''), … … 314 314 315 315 $this->System->FormManager->RegisterFormType('TFinanceInvoiceDirection', array( 316 317 316 'Type' => 'Enumeration', 317 'States' => array(-1 => 'Příjem', 1 => 'Výdej'), 318 318 )); 319 319 … … 323 323 'Items' => array( 324 324 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => '0'), 325 325 'Subject' => array('Type' => 'TSubject', 'Caption' => 'Subjekt', 'Default' => '0'), 326 326 ), 327 327 )); … … 353 353 )); 354 354 $this->System->FormManager->RegisterFormType('TFinanceTreasury', array( 355 356 357 358 359 355 'Type' => 'Reference', 356 'Table' => 'FinanceTreasury', 357 'Id' => 'Id', 358 'Name' => 'Name', 359 'Filter' => '1', 360 360 )); 361 361 $this->System->FormManager->RegisterClass('FinanceBankAccount', array( … … 374 374 'LoginPassword' => array('Type' => 'String', 'Caption' => 'Přihlašovací heslo', 'Default' => ''), 375 375 'Operations' => array('Type' => 'TFinanceOperationListAccount', 'Caption' => 'Operace', 'Default' => ''), 376 376 'Use' => array('Type' => 'Boolean', 'Caption' => 'Používat', 'Default' => '0'), 377 377 'LastImportDate' => array('Type' => 'Date', 'Caption' => 'Datum posledního importu', 'Default' => ''), 378 378 'LastImportId' => array('Type' => 'String', 'Caption' => 'Id posledního importu', 'Default' => ''), … … 380 380 'ReadOnly' => true, 'Suffix' => 'Kč', 'SQL' => '(SELECT SUM(`FinanceOperation`.`Value` * `FinanceOperation`.`Direction`) FROM `FinanceOperation` '. 381 381 'WHERE `FinanceOperation`.`BankAccount`=#Id)'), 382 382 'AutoImport' => array('Type' => 'Boolean', 'Caption' => 'Automaticky stahovat z banky', 'Default' => ''), 383 383 ), 384 384 'ItemActions' => array( … … 388 388 )); 389 389 $this->System->FormManager->RegisterFormType('TFinanceBankAccount', array( 390 391 392 393 394 390 'Type' => 'Reference', 391 'Table' => 'FinanceBankAccount', 392 'Id' => 'Id', 393 'Name' => 'Comment', 394 'Filter' => '1', 395 395 )); 396 396 $this->System->FormManager->RegisterClass('FinanceBank', array( … … 433 433 'TopTariffPrice' => array('Type' => 'Integer', 'Caption' => 'Nejvyšší cena tarifu', 'Default' => '0', 'Suffix' => 'Kč'), 434 434 'ChangeAction' => array('Type' => 'TActionEnum', 'Caption' => 'Změna - akce', 'Default' => '', 'Null' => true), 435 436 435 'ChangeTime' => array('Type' => 'DateTime', 'Caption' => 'Změna - čas', 'Default' => '', 'Null' => true), 436 'ChangeReplaceId' => array('Type' => 'TFinanceCharge', 'Caption' => 'Změna - položka', 'Default' => '0', 'Null' => true), 437 437 ), 438 438 )); … … 475 475 )); 476 476 $this->System->FormManager->RegisterFormType('TFinanceVAT', array( 477 478 479 480 481 477 'Type' => 'Reference', 478 'Table' => 'FinanceVAT', 479 'Id' => 'Id', 480 'Name' => 'Name', 481 'Filter' => '1', 482 482 )); 483 483 $this->System->FormManager->RegisterFormType('TFinanceVATType', array( 484 485 486 487 488 484 'Type' => 'Reference', 485 'Table' => 'FinanceVATType', 486 'Id' => 'Id', 487 'Name' => 'Name', 488 'Filter' => '1', 489 489 )); 490 490 $this->System->FormManager->RegisterFormType('TBankAccount', array( 491 492 493 494 495 496 491 'Type' => 'Reference', 492 'Table' => 'FinanceBankAccount', 493 'Id' => 'Id', 494 'Name' => 'CONCAT(`Comment`, " (", `Number`, "/", '. 495 '(SELECT `FinanceBank`.`Code` FROM `FinanceBank` WHERE `FinanceBank`.`Id`=`FinanceBankAccount`.`Bank`), ")")', 496 'Filter' => '1', 497 497 )); 498 498 … … 509 509 function BeforeInsertFinanceOperation($Form) 510 510 { 511 512 511 if(array_key_exists('Time', $Form->Values)) $Year = date("Y", $Form->Values['Time']); 512 else $Year = date("Y", $Form->Values['ValidFrom']); 513 513 $DocumentLine = $Form->Values['DocumentLine']; 514 514 $Form->Values['BillCode'] = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine, $Year);
Note:
See TracChangeset
for help on using the changeset viewer.