Changeset 916 for trunk/Modules/Finance
- Timestamp:
- Dec 7, 2021, 11:08:42 PM (3 years ago)
- Location:
- trunk/Modules/Finance
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Finance/Bill.php
r901 r916 16 16 $Subject['AddressStreet'].'<br>'. 17 17 $Subject['AddressPSC'].' '.$Subject['AddressTown'].'<br>'; 18 if ( $Subject['IC'] != 0) $Output .= 'IČ: '.$Subject['IC'].'<br>';18 if (($Subject['IC'] != '') and ($Subject['IC'] != 0)) $Output .= 'IČ: '.$Subject['IC'].'<br>'; 19 19 if ($Subject['DIC'] != '') $Output .= 'DIČ: '.$Subject['DIC'].'<br>'; 20 20 if ($Subject['Account'] != '') $Output .= 'Účet: '.$Subject['Account'].'<br>'; -
trunk/Modules/Finance/Finance.php
r910 r916 36 36 function DoStart(): void 37 37 { 38 global $Config;39 40 38 $this->System->RegisterPage(['finance', 'sprava'], 'PageFinanceManage'); 41 39 $this->System->RegisterPage(['finance', 'platby'], 'PageFinanceUserState'); … … 162 160 'Value' => array('Type' => 'Integer', 'Caption' => 'Částka absolutní', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true), 163 161 'ValueUser' => array('Type' => 'Integer', 'Caption' => 'Částka', 'Default' => '0', 'Suffix' => 'Kč', 'ReadOnly' => true, 164 'SQL' => 'SELECT ROUND(SUM(`Price`*`Quantity`), '.$ Config['Finance']['Rounding'].') FROM `FinanceInvoiceItem` WHERE `FinanceInvoiceItem`.`FinanceInvoice`=#Id'),162 'SQL' => 'SELECT ROUND(SUM(`Price`*`Quantity`), '.$this->System->Config['Finance']['Rounding'].') FROM `FinanceInvoiceItem` WHERE `FinanceInvoiceItem`.`FinanceInvoice`=#Id'), 165 163 'File' => array('Type' => 'TFile', 'Caption' => 'Doklad', 'Default' => '', 'Null' => true), 166 164 'Generate' => array('Type' => 'Boolean', 'Caption' => 'Generovat', 'Default' => ''), … … 244 242 'VAT' => array('Type' => 'Integer', 'Caption' => 'Daň', 'Default' => '21', 'Suffix' => '%'), 245 243 'Total' => array('Type' => 'Integer', 'Caption' => 'Celkem', 'Default' => '', 'Suffix' => 'Kč', 246 'ReadOnly' => true, 'SQL' => 'ROUND(`Price` * `Quantity`, '.$ Config['Finance']['Rounding'].')'),244 'ReadOnly' => true, 'SQL' => 'ROUND(`Price` * `Quantity`, '.$this->System->Config['Finance']['Rounding'].')'), 247 245 ), 248 246 'AfterInsert' => array($this, 'AfterInsertFinanceInvoiceItem'), … … 259 257 'State' => array('Type' => 'Float', 'Caption' => 'Stav', 'Default' => '', 260 258 'ReadOnly' => true, 'Suffix' => 'Kč', 'SQL' => 'IFNULL(ROUND((SELECT SUM(`FinanceOperation`.`Value`) FROM `FinanceOperation` '. 261 'WHERE `FinanceOperation`.`Treasury`=#Id), '.$ Config['Finance']['Rounding'].'), 0)'),259 'WHERE `FinanceOperation`.`Treasury`=#Id), '.$this->System->Config['Finance']['Rounding'].'), 0)'), 262 260 'Operations' => array('Type' => 'TFinanceOperationListTreasury', 'Caption' => 'Operace', 'Default' => ''), 263 261 'Check' => array('Type' => 'TFinanceTreasuryCheckListTreasury', 'Caption' => 'Kontrola', 'Default' => ''), … … 568 566 )); 569 567 570 $this->Finance->MainSubject = $ Config['Finance']['MainSubjectId'];571 $this->Finance->DirectoryId = $ Config['Finance']['DirectoryId'];568 $this->Finance->MainSubject = $this->System->Config['Finance']['MainSubjectId']; 569 $this->Finance->DirectoryId = $this->System->Config['Finance']['DirectoryId']; 572 570 573 571 ModuleIS::Cast($this->System->GetModule('IS'))->RegisterDashboardItem('Finance', array($this, 'ShowDashboardItem')); -
trunk/Modules/Finance/Manage.php
r912 r916 49 49 50 50 /* Get first day and last day of given billing period. Periods are aligned with year start/end. */ 51 function GetBillingPeriod( $Period)51 function GetBillingPeriod(int $Period): array 52 52 { 53 53 $Time = time(); … … 73 73 } 74 74 75 function ShowMonthlyPayment() 75 function ShowMonthlyPayment(): string 76 76 { 77 77 if (!ModuleUser::Cast($this->System->GetModule('User'))->User->CheckPermission('Finance', 'Manage')) return 'Nemáte oprávnění'; … … 126 126 } 127 127 128 function InsertInvoice( $Subject, $TimeCreation, $TimeDue,$Items,129 $Group, $PeriodFrom, $PeriodTo)128 function InsertInvoice(string $Subject, string $TimeCreation, string $TimeDue, array $Items, 129 array $Group, float $PeriodFrom, float $PeriodTo): string 130 130 { 131 131 global $LastInsertTime; … … 156 156 } 157 157 158 function ProduceInvoices() 158 function ProduceInvoices(): string 159 159 { 160 160 $Output = ''; … … 224 224 } 225 225 226 function TableUpdateChanges( $Table)226 function TableUpdateChanges(string $Table): void 227 227 { 228 228 $Time = time(); … … 256 256 } 257 257 258 function ProcessTableUpdates() 258 function ProcessTableUpdates(): string 259 259 { 260 260 // Update customers … … 277 277 } 278 278 279 function ProcessMonthlyPayment() 279 function ProcessMonthlyPayment(): string 280 280 { 281 281 if (!ModuleUser::Cast($this->System->GetModule('User'))->User->CheckPermission('Finance', 'Manage')) return 'Nemáte oprávnění'; … … 344 344 } 345 345 346 function SendPaymentEmail( $MemberId, $FileId = '')346 function SendPaymentEmail(string $MemberId, string $FileId = ''): string 347 347 { 348 348 global $Config; … … 418 418 } 419 419 420 function GenerateInvoice( $Where)420 function GenerateInvoice(string $Where): string 421 421 { 422 422 $DirectoryId = ModuleFinance::Cast($this->System->GetModule('Finance'))->Finance->DirectoryId; … … 447 447 } 448 448 449 function GenerateOperation( $Where)449 function GenerateOperation(string $Where): string 450 450 { 451 451 $DirectoryId = ModuleFinance::Cast($this->System->GetModule('Finance'))->Finance->DirectoryId; … … 476 476 } 477 477 478 function GenerateBills() 478 function GenerateBills(): string 479 479 { 480 480 $Output = '';
Note:
See TracChangeset
for help on using the changeset viewer.