- Timestamp:
- Dec 7, 2021, 11:08:42 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Contract/Contract.php
r912 r916 21 21 function DoStart(): void 22 22 { 23 global $Config; 24 25 $this->DirectoryId = $Config['Contract']['DirectoryId']; 23 $this->DirectoryId = $this->System->Config['Contract']['DirectoryId']; 26 24 $this->System->RegisterPage(['smlouvy', 'generovat'], 'PageContractGenerate'); 27 25 $this->System->FormManager->RegisterClass('Contract', array( -
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 = ''; -
trunk/Modules/Network/UserHosts.php
r912 r916 12 12 function Show(): string 13 13 { 14 global $Config;15 16 14 if (ModuleUser::Cast($this->System->GetModule('User'))->User->User['Id'] == '') return $this->SystemMessage('Nepovolený přístup', 'Nemáte oprávnění pro tuto operaci'); 17 15 $Output = '<div align="center" style="font-size: small;"><table class="WideTable">'; -
trunk/Modules/Stock/Stock.php
r901 r916 20 20 function DoStart(): void 21 21 { 22 global $Config;23 24 22 $this->System->FormManager->RegisterClass('Product', array( 25 23 'Title' => 'Produkty', … … 114 112 'Amount' => array('Type' => 'Integer', 'Caption' => 'Množství', 'Default' => '1'), 115 113 'Total' => array('Type' => 'Integer', 'Caption' => 'Celkem', 'Default' => '', 'Suffix' => 'Kč', 116 'ReadOnly' => true, 'SQL' => 'ROUND(`UnitPrice` * `Amount`, '.$ Config['Finance']['Rounding'].')'),114 'ReadOnly' => true, 'SQL' => 'ROUND(`UnitPrice` * `Amount`, '.$this->System->Config['Finance']['Rounding'].')'), 117 115 'Položky pohybů' => array('Type' => 'TStockMoveItemSerialListItem', 'Caption' => 'Vztahy sériových čísel', 'Default' => ''), 118 116 'Sériové čísla' => array('Type' => 'String', 'Caption' => 'Sériové čísla', 'ReadOnly' => true, -
trunk/Modules/User/User.php
r914 r916 25 25 } 26 26 27 function DoInstall(): void28 {29 }30 31 27 function DoInsertSampleData(): void 32 28 { -
trunk/Modules/User/UserModel.php
r908 r916 45 45 } 46 46 47 // TODO: Make User class more general without dependencies toSystem, Mail, Log47 // TODO: Make User class more general without dependencies on System, Mail, Log 48 48 49 49 class User extends Model … … 418 418 $Row['Id'].'&H='.$Row['Password'].'&P='.$NewPassword.'">tento odkaz</a>.'."\n<br />". 419 419 "Po přihlášení si prosím změňte heslo na nové.\n\n<br><br>Na tento email neodpovídejte.", 'text/html'); 420 print_r($Mail); 420 421 $Mail->Send(); 421 422 -
trunk/Modules/WebCam/WebCam.php
r912 r916 69 69 function ShowImage(): string 70 70 { 71 global $Config;72 71 $Output = ''; 73 72 $Output .= '<a href="//www.zdechov.net/kamery/?Id=5"><img alt="Koupaliště" width="140" height="79" src="//www.zdechov.net/images/webcam/webcam5.jpg" /></a>'; -
trunk/Packages/Common/Mail.php
r887 r916 20 20 private array $Priorities; 21 21 private string $Boundary; 22 public bool $TestMode; 22 23 23 24 function __construct() … … 26 27 $this->Boundary = md5(date('r', time())); 27 28 $this->AgentIdent = 'PHP/Mail'; 29 $this->TestMode = false; 28 30 $this->Clear(); 29 31 } … … 145 147 if ($this->Subject == '') throw new Exception(T('Mail message missing Subject')); 146 148 147 $res = mail($To, $this->Subject, $Body, $Headers); 149 if ($this->TestMode) 150 { 151 echo('to: '.$To.', subject: '.$this->Subject.', body: '.$Body.', headers: '.$Headers); 152 $res = true; 153 } else 154 { 155 $res = mail($To, $this->Subject, $Body, $Headers); 156 } 148 157 return $res; 149 158 }
Note:
See TracChangeset
for help on using the changeset viewer.