Token = $this->BankAccount['LoginName']; if ($this->BankAccount['LastImportDate'] == '') $PeriodStart = time(); else $PeriodStart = MysqlDateToTime($this->BankAccount['LastImportDate']); $PeriodEnd = time(); $Records = $Fio->Import($PeriodStart, $PeriodEnd); $Output = ''; //$Output .= ''; //$Output .= ''; //$Output .= ''; //$Output .= ''; //$Output .= ''; //$Output .= ''; //$Output .= ''; //$Output .= ''; foreach ($Records['Items'] as $Record) { $DbResult = $this->Database->select('FinanceBankImport', 'ID', 'Identification='.$Record['ID']); if ($DbResult->num_rows == 0) { $Record['Value'] = str_replace(",", ".", $Record['Value']); $Output .= ''; $this->Database->insert('FinanceBankImport', array('Time' => TimeToMysqlDate($Record['Date']), 'BankAccount' => $this->BankAccount['Id'], 'Value' => $Record['Value'], 'SpecificSymbol' => $Record['SpecificSymbol'], 'VariableSymbol' => $Record['VariableSymbol'], 'ConstantSymbol' => $Record['ConstantSymbol'], 'Currency' => $this->BankAccount['Currency'], 'Identification' => $Record['ID'], 'AccountNumber' => $Record['OffsetAccount'], 'BankCode' => $Record['BankCode'], 'Description' => $Record['Type'], 'OffsetAccountName' => $Record['UserIdent'])); $Output .= ''; $Output .= ''; $Output .= ''; $Output .= ''; $Output .= ''."\n"; } } $Output .= '
Jméno účtu: '.$Records['AccountName'].'Číslo účtu: '.$Records['AccountNumber'].'Ke dni '.date('j.n.Y', $Records['DateStart']).' je stav účtu '.$Records['OpeningBalance'].' KčKe dni '.date('j.n.Y', $Records['DateEnd']).' je stav účtu '.$Records['ClosingBalance'].' KčSuma příjmů: '.$Records['CreditValue'].' KčSuma výdajů: '.$Records['DebitValue'].' Kč
'.$Record['OffsetAccount'].''.$Record['BankCode'].''.$Record['UserIdent'].''.$Record['Value'].'
'; $this->Database->update('FinanceBankAccount', 'Id='.$this->BankAccount['Id'], array('LastImportDate' => TimeToMysqlDate($PeriodEnd))); return $Output; } }