Changeset 873 for trunk/Modules/FinanceBankAPI/FileImport.php
- Timestamp:
- Apr 6, 2020, 11:17:40 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/FinanceBankAPI/FileImport.php
r765 r873 26 26 { 27 27 $DbResult = $this->Database->select('FinanceBankImport', '*', 'FinanceOperation IS NULL'); 28 while ($DbRow = $DbResult->fetch_assoc())28 while ($DbRow = $DbResult->fetch_assoc()) 29 29 { 30 if (is_numeric($DbRow['VariableSymbol']))30 if (is_numeric($DbRow['VariableSymbol'])) 31 31 { 32 32 $DbResult2 = $this->Database->select('Subject', 'Id', 'Id='.$DbRow['VariableSymbol']); 33 if ($DbResult2->num_rows == 1)33 if ($DbResult2->num_rows == 1) 34 34 { 35 35 $DbRow2 = $DbResult2->fetch_assoc(); 36 if ($DbRow['Value'] >= 0) {36 if ($DbRow['Value'] >= 0) { 37 37 $FinanceGroup = $this->System->Modules['Finance']->GetFinanceGroupById(OPERATION_GROUP_ACCOUNT_IN, 'FinanceOperationGroup'); 38 38 } else { … … 51 51 $Form->SetClass('FinanceOperation'); 52 52 $Form->LoadValuesFromDatabase($Id); 53 if (array_key_exists('AfterInsert', $Form->Definition))53 if (array_key_exists('AfterInsert', $Form->Definition)) 54 54 { 55 55 $Class = $Form->Definition['AfterInsert'][0]; … … 80 80 $Output .= 'Účet: '.$BankAccount['Number'].'/'.$Bank['Code'].' ('.$Bank['Name'].')'."\n"; 81 81 82 if ($Bank['Code'] == '2010') $Import = new ImportFio($this->System);83 else if ($Bank['Code'] == '0300') $Import = new ImportPS($this->System);82 if ($Bank['Code'] == '2010') $Import = new ImportFio($this->System); 83 else if ($Bank['Code'] == '0300') $Import = new ImportPS($this->System); 84 84 else $Output = $this->SystemMessage('Nepodporované API', 'Pro zvolenou banku není import podporován'); 85 if (isset($Import))85 if (isset($Import)) 86 86 { 87 87 $Import->BankAccount = $BankAccount; … … 89 89 $Import->PairOperations(); 90 90 } 91 return ($Output);91 return ($Output); 92 92 } 93 93 94 94 function Show() 95 95 { 96 if (!$this->System->User->CheckPermission('Finance', 'SubjectList'))97 return ('Nemáte oprávnění');96 if (!$this->System->User->CheckPermission('Finance', 'SubjectList')) 97 return ('Nemáte oprávnění'); 98 98 99 99 $Output = $this->Import($_GET['i']); 100 return ($Output);100 return ($Output); 101 101 } 102 102 } … … 111 111 { 112 112 $Output = ''; 113 if (!$this->System->User->CheckPermission('Finance', 'SubjectList')) return('Nemáte oprávnění');114 if (array_key_exists('Operation', $_GET))113 if (!$this->System->User->CheckPermission('Finance', 'SubjectList')) return ('Nemáte oprávnění'); 114 if (array_key_exists('Operation', $_GET)) 115 115 { 116 if ($_GET['Operation'] == 'prepare') $Output .= $this->Prepare();117 else if ($_GET['Operation'] == 'insert') $Output .= $this->Insert();116 if ($_GET['Operation'] == 'prepare') $Output .= $this->Prepare(); 117 else if ($_GET['Operation'] == 'insert') $Output .= $this->Insert(); 118 118 else $Output .= 'Neplatná akce'; 119 119 } else $Output .= $this->ShowForm(); 120 return ($Output);120 return ($Output); 121 121 } 122 122 … … 128 128 $Form->Values['BankAccount'] = $_GET['id']; 129 129 $Output = $Form->ShowEditForm(); 130 return ($Output);130 return ($Output); 131 131 } 132 132 … … 147 147 $Output .= 'Účet: '.$BankAccount['Number'].'/'.$Bank['Code'].' ('.$Bank['Name'].')'; 148 148 149 if ($Bank['Code'] == '2010') $Import = new ImportFio($this->System);150 else if ($Bank['Code'] == '0300') $Import = new ImportPS($this->System);149 if ($Bank['Code'] == '2010') $Import = new ImportFio($this->System); 150 else if ($Bank['Code'] == '0300') $Import = new ImportPS($this->System); 151 151 else $Output = $this->SystemMessage('Nepodporované API', 'Pro zvolenou banku není import podporován'); 152 152 $Import->BankAccount = $BankAccount; 153 153 $Output .= $Import->ImportFile($File->GetContent(), $File->GetExt()); 154 154 155 return ($Output);155 return ($Output); 156 156 } 157 157 … … 171 171 $Output = ''; 172 172 173 for ($I = $_POST['ItemCount'] - 1; $I >= 0 ; $I--)173 for ($I = $_POST['ItemCount'] - 1; $I >= 0 ; $I--) 174 174 { 175 if ($_POST['Money'.$I] >= 0) {175 if ($_POST['Money'.$I] >= 0) { 176 176 $FinanceGroup = $Finance->GetFinanceGroupById(OPERATION_GROUP_ACCOUNT_IN, 177 177 'FinanceOperationGroup'); … … 187 187 $this->System->ModuleManager->Modules['Log']->NewRecord('Finance', 'NewPaymentInserted'); 188 188 } 189 return ($Output);189 return ($Output); 190 190 } 191 191 }
Note:
See TracChangeset
for help on using the changeset viewer.