Changeset 550 for trunk/Modules/FinanceBankAPI/FileImport.php
- Timestamp:
- Jul 7, 2013, 7:37:48 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/FinanceBankAPI/FileImport.php
r548 r550 3 3 include_once(dirname(__FILE__).'/../../Common/Global.php'); 4 4 5 class FileImport5 class BankImport 6 6 { 7 7 var $Database; 8 var $BankAccount Id;8 var $BankAccount; 9 9 10 10 function __construct($Database) … … 19 19 function ImportFile($Content, $Ext) 20 20 { 21 } 22 23 function PairOperations() 24 { 25 $DbResult = $this->Database->select('FinanceBankImport', '*', 'FinanceOperation IS NULL'); 26 while($DbRow = $DbResult->fetch_assoc()) 27 { 28 if(is_numeric($DbRow['VariableSymbol'])) 29 { 30 $DbResult2 = $this->Database->select('Subject', 'Id', 'Id='.$DbRow['VariableSymbol']); 31 if($DbResult2->num_rows == 1) 32 { 33 $DbRow2 = $DbResult2->fetch_assoc(); 34 $DbResult3 = $this->Database->insert('FinanceOperation', array('Subject' => $DbRow2['Id'], 'Cash' => 0, 35 'Value' => $DbRow['Value'], 'Taxable' => 1, 'BankAccount' => $DbRow['BankAccount'], 'Network' => 1, 36 'Time' => $DbRow['Time'], 'Text' => $DbRow['Description'])); 37 $this->Database->update('FinanceBankImport', 'Id='.$DbRow['Id'], array('FinanceOperation' => $this->Database->insert_id)); 38 } 39 } 40 } 21 41 } 22 42 } … … 45 65 if(isset($Import)) 46 66 { 47 $Import->BankAccount Id = $BankAccount['Id'];67 $Import->BankAccount = $BankAccount; 48 68 $Output .= $Import->Import(); 69 $Import->PairOperations(); 49 70 } 50 71 return($Output); … … 100 121 else if($Bank['Code'] == '0300') $Import = new ImportPS($this->Database); 101 122 else $Output = $this->SystemMessage('Nepodporované API', 'Pro zvolenou banku není import podporován'); 102 $Import->BankAccount Id = $BankAccount['Id'];123 $Import->BankAccount = $BankAccount; 103 124 $Output .= $Import->ImportFile($File->GetContent(), $File->GetExt()); 104 125
Note:
See TracChangeset
for help on using the changeset viewer.