Changeset 748 for trunk/Modules/Finance/Finance.php
- Timestamp:
- Sep 30, 2015, 11:55:11 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/Finance.php
r747 r748 17 17 define('INVOICE_GROUP_OUT', 2); 18 18 define('VAT_TYPE_BASE', 2); 19 define('FINANCE_DIRECTION_OUT', 0);20 define('FINANCE_DIRECTION_IN', 1);19 define('FINANCE_DIRECTION_OUT', 1); 20 define('FINANCE_DIRECTION_IN', 0); 21 21 22 22 class Finance extends Model … … 39 39 var $BillingPeriods; 40 40 var $DirectoryId; 41 var $Rounding; 41 42 42 43 function LoadMonthParameters($Period = 1) // 0 - now, 1 - next month … … 74 75 $this->TotalInternetPaid = $Row['MonthlyInternet']; 75 76 $this->TotalPaid = $Row['MonthlyTotal']; 77 $this->Rounding = $this->System->Config['Finance']['Rounding']; 76 78 } 77 79 … … 293 295 'DocumentLine' => array('Type' => 'TDocumentLine', 'Caption' => 'Dokladová řada', 'Default' => '0'), 294 296 'ValueSign' => array('Type' => 'TFinanceValueSign', 'Caption' => 'Znaménko hodnoty', 'Default' => '0'), 295 297 'Direction' => array('Type' => 'TFinanceDirection', 'Caption' => 'Směr', 'Default' => '0'), 296 298 ), 297 299 )); … … 325 327 'Value' => array('Type' => 'Integer', 'Caption' => 'Částka absolutní', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true), 326 328 'ValueUser' => array('Type' => 'Integer', 'Caption' => 'Částka', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true, 327 'SQL' => 'SELECT SUM(CEIL(`Price`*`Quantity`)) FROM `FinanceInvoiceItem` WHERE `FinanceInvoiceItem`.`FinanceInvoice`=#Id'), 329 'SQL' => 'SELECT ROUND(SUM(`Price`*`Quantity`), '.$Config['Finance']['Rounding'].') FROM `FinanceInvoiceItem` WHERE `FinanceInvoiceItem`.`FinanceInvoice`=#Id'), 330 'File' => array('Type' => 'TFile', 'Caption' => 'Doklad', 'Default' => '', 'Null' => true), 328 331 'Generate' => array('Type' => 'Boolean', 'Caption' => 'Generovat', 'Default' => ''), 329 332 'PeriodFrom' => array('Type' => 'Date', 'Caption' => 'Období od', 'Default' => '', 'Null' => true), … … 390 393 'VAT' => array('Type' => 'Integer', 'Caption' => 'Daň', 'Default' => '21', 'Suffix' => '%'), 391 394 'Total' => array('Type' => 'Integer', 'Caption' => 'Celkem', 'Default' => '', 'Suffix' => 'Kč', 392 'ReadOnly' => true, 'SQL' => ' CEIL(`Price` * `Quantity`)'),395 'ReadOnly' => true, 'SQL' => 'ROUND(`Price` * `Quantity`, '.$Config['Finance']['Rounding'].')'), 393 396 ), 394 397 'AfterInsert' => array($this, 'AfterInsertFinanceInvoiceItem'),
Note:
See TracChangeset
for help on using the changeset viewer.