Changeset 551 for trunk/Modules/FinanceBankAPI
- Timestamp:
- Jul 7, 2013, 9:26:44 PM (11 years ago)
- Location:
- trunk/Modules/FinanceBankAPI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/FinanceBankAPI/FileImport.php
r550 r551 5 5 class BankImport 6 6 { 7 var $System; 7 8 var $Database; 8 9 var $BankAccount; 9 10 10 function __construct($ Database)11 function __construct($System) 11 12 { 12 $this->Database = &$Database; 13 $this->Database = &$System->Database; 14 $this->System = &$System; 13 15 } 14 16 … … 26 28 while($DbRow = $DbResult->fetch_assoc()) 27 29 { 30 echo($DbRow['Id'].','); 28 31 if(is_numeric($DbRow['VariableSymbol'])) 29 32 { … … 32 35 { 33 36 $DbRow2 = $DbResult2->fetch_assoc(); 37 if($DbRow['Value'] >= 0) $DocumentLine = 3; // Receive money 38 else $DocumentLine = 4; // Send money 39 $BillCode = $this->System->Modules['Finance']->GetNextDocumentLineNumber($DocumentLine); 34 40 $DbResult3 = $this->Database->insert('FinanceOperation', array('Subject' => $DbRow2['Id'], 'Cash' => 0, 35 41 'Value' => $DbRow['Value'], 'Taxable' => 1, 'BankAccount' => $DbRow['BankAccount'], 'Network' => 1, 36 'Time' => $DbRow['Time'], 'Text' => $DbRow['Description'] ));42 'Time' => $DbRow['Time'], 'Text' => $DbRow['Description'], 'BillCode' => $BillCode)); 37 43 $this->Database->update('FinanceBankImport', 'Id='.$DbRow['Id'], array('FinanceOperation' => $this->Database->insert_id)); 38 44 } … … 60 66 $Output .= 'Účet: '.$BankAccount['Number'].'/'.$Bank['Code'].' ('.$Bank['Name'].')'; 61 67 62 if($Bank['Code'] == '2010') $Import = new ImportFio($this-> Database);63 else if($Bank['Code'] == '0300') $Import = new ImportPS($this-> Database);68 if($Bank['Code'] == '2010') $Import = new ImportFio($this->System); 69 else if($Bank['Code'] == '0300') $Import = new ImportPS($this->System); 64 70 else $Output = $this->SystemMessage('Nepodporované API', 'Pro zvolenou banku není import podporován'); 65 71 if(isset($Import)) … … 118 124 $Output .= 'Účet: '.$BankAccount['Number'].'/'.$Bank['Code'].' ('.$Bank['Name'].')'; 119 125 120 if($Bank['Code'] == '2010') $Import = new ImportFio($this-> Database);121 else if($Bank['Code'] == '0300') $Import = new ImportPS($this-> Database);126 if($Bank['Code'] == '2010') $Import = new ImportFio($this->System); 127 else if($Bank['Code'] == '0300') $Import = new ImportPS($this->System); 122 128 else $Output = $this->SystemMessage('Nepodporované API', 'Pro zvolenou banku není import podporován'); 123 129 $Import->BankAccount = $BankAccount; -
trunk/Modules/FinanceBankAPI/ImportFio.php
r550 r551 43 43 } 44 44 $Output .= '</table>'; 45 $this->Database-> Update('FinanceBankAccount', 'Id='.$this->BankAccount['Id'], array('LastImportDate' => TimeToMysqlDate($PeriodEnd)));45 $this->Database->update('FinanceBankAccount', 'Id='.$this->BankAccount['Id'], array('LastImportDate' => TimeToMysqlDate($PeriodEnd))); 46 46 return($Output); 47 47 }
Note:
See TracChangeset
for help on using the changeset viewer.