Changeset 645 for trunk/Modules/Finance/Finance.php
- Timestamp:
- Mar 25, 2014, 12:38:20 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/Finance.php
r642 r645 18 18 define('DOC_LINE_ACCOUNT_IN', 3); 19 19 define('DOC_LINE_ACCOUNT_OUT', 4); 20 define('VAT_TYPE_BASE', 2); 20 21 21 22 … … 292 293 return($Output); 293 294 } 295 296 function GetVATByType($TypeId) 297 { 298 $Time = time(); 299 $DbResult = $this->Database->select('FinanceVAT', 'Value', '(Type='.$TypeId. 300 ') AND (ValidFrom <= "'.TimeToMysqlDate($Time).'") AND ((ValidTo >= "'. 301 TimeToMysqlDate($Time).'") OR (ValidTo IS NULL)) LIMIT 1'); 302 $Row = $DbResult->fetch_array(); 303 return($Row[0]); 304 } 294 305 } 295 306 … … 383 394 'Quantity' => array('Type' => 'Integer', 'Caption' => 'Množství', 'Default' => '1'), 384 395 'VAT' => array('Type' => 'Integer', 'Caption' => 'Daň', 'Default' => '21', 'Suffix' => '%'), 396 'Total' => array('Type' => 'Integer', 'Caption' => 'Celkem', 'Default' => '', 'Suffix' => 'Kč', 397 'ReadOnly' => true, 'SQL' => '`Price` * `Quantity`'), 385 398 ), 386 399 )); … … 459 472 ), 460 473 )); 474 $this->System->FormManager->RegisterClass('FinanceVAT', array( 475 'Title' => 'Sazby DPH', 476 'Table' => 'FinanceVAT', 477 'Items' => array( 478 'Type' => array('Type' => 'TFinanceVATType', 'Caption' => 'Typ', 'Default' => ''), 479 'ValidFrom' => array('Type' => 'Date', 'Caption' => 'Platnost od', 'Default' => ''), 480 'ValidTo' => array('Type' => 'Date', 'Caption' => 'Platnost do', 'Default' => '', 'Null' => true), 481 'Value' => array('Type' => 'Integer', 'Caption' => 'Hodnota', 'Default' => '', 'Suffix' => '%'), 482 ), 483 )); 484 $this->System->FormManager->RegisterClass('FinanceVATType', array( 485 'Title' => 'Sazby DPH', 486 'Table' => 'FinanceVATType', 487 'Items' => array( 488 'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''), 489 ), 490 )); 461 491 462 492 $this->System->AddModule(new Bill($this->System));
Note:
See TracChangeset
for help on using the changeset viewer.