Revize 637
Přidáno uživatelem Jiří Sviták před asi 14 roky(ů)
freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php | ||
---|---|---|
'back to all subnets' => 'Zpět na seznam podsítí',
|
||
'back to bank account' => 'Zpět na bankovní účet',
|
||
'back to bank accounts' => 'Zpět na bankovní účty',
|
||
'back to bank statements' => 'Zpět na bankovní výpisy',
|
||
'back to bank templates' => 'Zpět na bankovní šablony',
|
||
'back to day book' => 'Zpět na účetní deník',
|
||
'back to detail' => 'Zpět na detail',
|
||
... | ... | |
'bank info' => 'Údaje platby',
|
||
'bank interest' => 'Bankovní úrok',
|
||
'bank interests' => 'Bankovní úroky',
|
||
'bank statements' => 'Bankovní výpisy',
|
||
'bank templates of csv files' => 'Bankovní šablony pro CSV soubory',
|
||
'bank transfer' => 'Bankovní převod',
|
||
'bank transfer fee' => 'Bankovní poplatek',
|
||
'bank transfer has been successfully added' => 'Bankovní převod byl úspěšně uložen.',
|
||
'bank transfer id' => 'ID bankovního převodu',
|
||
'bank transfer type' => 'Typ bankovního převodu',
|
||
'bank transfers' => 'Bankovní převody',
|
||
'basic data' => 'Základní údaje',
|
||
'basic information' => 'Základní informace',
|
||
'basic' => 'Základní',
|
||
... | ... | |
'cash' => 'Pokladna',
|
||
'cash flow' => 'Peněžní tok',
|
||
'cash drawn' => 'Výběry hotovosti',
|
||
'chairman and agent' => 'Předseda a jednatel',
|
||
'change' => 'Změnit',
|
||
'change application password' => 'Změnit aplikační heslo',
|
||
'change owner of directory of upload (for example /var/www/freenetis/upload) to www-data' => 'Změňte majitele adresáře upload (například /var/www/freenetis/upload) na www-data.',
|
||
'change password' => 'Změnit heslo',
|
||
'channel' => 'Kanál',
|
||
'check again' => 'Znovu zkontrolovat',
|
||
'choose language' => 'Vyberte jazyk',
|
||
'choose format of export' => 'Vyberte formát exportu',
|
||
'clean urls' => 'Čistá URL',
|
||
'closing balance' => 'Konečný zůstatek',
|
||
'cloud' => 'Oblast',
|
||
'cloud has been successfully added' => 'Oblast byla úspěšně přidána',
|
||
'cloud has been successfully deleted' => 'Oblast byla úspěšně smazána',
|
||
... | ... | |
'devices' => 'Zařízení',
|
||
'dhcp configuration' => 'Konfigurace DHCP',
|
||
'dhcp configuration file was successfully generated' => 'Konfigurační soubor pro DHCP byl úspěšně vygenerován',
|
||
'directory upload for file uploading is not writable' => 'Do adresáře upload pro nahrávání souborů nelze zapisovat.',
|
||
'disabled' => 'Vypnuto',
|
||
'display member' => 'Zobraz člena',
|
||
'display user' => 'Zobraz uživatele',
|
||
... | ... | |
'honorary member' => 'Čestný člen',
|
||
'hours' => 'Hodin',
|
||
'hours2' => 'Hodiny',
|
||
'chairman and agent' => 'Předseda a jednatel',
|
||
'change' => 'Změnit',
|
||
'change application password' => 'Změnit aplikační heslo',
|
||
'change password' => 'Změnit heslo',
|
||
'channel' => 'Kanál',
|
||
'check again' => 'Znovu zkontrolovat',
|
||
'choose language' => 'Vyberte jazyk',
|
||
'i' => 'P',
|
||
'i accept this message and i want to cancel this redirection' => 'Beru na vědomí tuto zprávu a chci zrušit toto přesměrování',
|
||
'id' => 'ID',
|
||
... | ... | |
'information about main user' => 'Informace o hlavním uživateli',
|
||
'information about you' => 'Informace o vás',
|
||
'information for members (how to log in)' => 'Informace pro členy (jak se přihlásit)',
|
||
'information from header of bank statement' => 'Informace z hlavičky bankovního výpisu',
|
||
'infrastructure account' => 'Účet infrastruktury',
|
||
'insert' => 'Vložit',
|
||
'install' => 'Instalovat',
|
||
... | ... | |
'new password' => 'Nové heslo',
|
||
'new transfer' => 'Nový převod',
|
||
'new transfer from account' => 'Nový převod z účtu',
|
||
'next' => 'Další',
|
||
'next' => 'Další',
|
||
'next step' => 'Další krok',
|
||
'nineth-degree certified engineers' => 'Certifikování technici devátého stupně',
|
||
'nineth-degree certified engineers' => 'Certifikování technici devátého stupně',
|
||
'no' => 'ne',
|
||
'no member fee set!' => 'Členský příspěvek nenastaven!',
|
||
'nonactive' => 'Neaktivní',
|
||
... | ... | |
'o' => 'V',
|
||
'october' => 'Říjen',
|
||
'old password' => 'Staré heslo',
|
||
'opening balance' => 'Počáteční zůstatek',
|
||
'operating account' => 'Provozní účet',
|
||
'optional' => 'nepovinné',
|
||
'optional information' => 'Nepovinné informace',
|
||
... | ... | |
'post title' => 'Tituly za jménem',
|
||
'pppoe' => 'pppoe',
|
||
'pre title' => 'Tituly před jménem',
|
||
'pre-installation check' => 'Předinstalační kontrola',
|
||
'previous' => 'Předchozí',
|
||
'pre-installation check' => 'Předinstalační kontrola',
|
||
'previous' => 'Předchozí',
|
||
'previous transfer' => 'Předchozí převod',
|
||
'prepaid' => 'Předplacený',
|
||
'price' => 'Cena',
|
||
... | ... | |
'show invoice item' => 'Zobrazit položku faktury',
|
||
'show redirection' => 'Zobrazit přesměrování',
|
||
'show smokeping record' => 'Zobrazit záznam smokepingu',
|
||
'show statements' => 'Zobrazit výpisy',
|
||
'show transfer' => 'ukaž transakci',
|
||
'show transfers' => 'Zobrazit převody',
|
||
'show transfers on this account' => 'Ukaž převody tohoto účtu',
|
||
... | ... | |
'static ip' => 'Statická IP',
|
||
'state' => 'Stav',
|
||
'stats' => 'Statistiky',
|
||
'steps' => 'Kroky',
|
||
'steps' => 'Kroky',
|
||
'street' => 'Ulice',
|
||
'street already exists' => 'Ulice již existuje',
|
||
'street detail' => 'Detail ulice',
|
||
... | ... | |
'transfer will be effected within 15 minutes' => 'Převod bude uskutečněn během 15 minut.',
|
||
'transfers' => 'Převody',
|
||
'transfers of bank account' => 'Převody na bankovním účtu',
|
||
'transfers of bank statement' => 'Převody na bankovním výpisu',
|
||
'transfers of credit account' => 'Převody na kreditním účtu',
|
||
'transfers of double-entry account' => 'Převody na podvojném účtu',
|
||
'transfers of member' => 'Převody člena',
|
||
... | ... | |
'variable symbol already exists in database' => 'Variabilní symbol už existuje v databázi.',
|
||
'variable symbol has not been found in the database' => 'Variabilní symbol nebyl nalezen v databázi.',
|
||
'vat' => 'DPH',
|
||
'version' => 'verze',
|
||
'version' => 'verze',
|
||
'virus' => 'Počítačový vir',
|
||
'vlan detail' => 'Detail VLANu',
|
||
'vlan interface' => 'VLAN rozhraní',
|
||
... | ... | |
'year' => 'Rok',
|
||
'yes' => 'ano',
|
||
'you can simply open config-samplephp in a text editor, fill in your information, and save it as configphp' => 'Můžete jednoduše otevřít config-sample.php v textovém editoru, doplnit vaše údaje a uložit jej jako config.php.',
|
||
'you are in debt' => 'Jste v dluhu',
|
||
'you are in debt' => 'Máte dluh',
|
||
'you have been successfully logged out' => 'Byl jste úspěšně odhlášen.',
|
||
'you have no permission to access redirection' => 'Nemáte práva k zobrazení přesměrování',
|
||
'you have no permission to delete redirection' => 'Nemáte práva ke smazání přesměrování',
|
freenetis/trunk/kohana/application/models/bank_statement.php | ||
---|---|---|
<?php
|
||
class Bank_statement_Model extends ORM
|
||
{
|
||
protected $belongs_to = array("bank_account", "user");
|
||
protected $has_many = array("bank_transfers");
|
||
|
||
/**
|
||
* Counts bank statements of given bank account.
|
||
* @author Jiri Svitak
|
||
* @param $ba_id
|
||
* @param $filter_values
|
||
* @return unknown_type
|
||
*/
|
||
public function count_bank_statements($ba_id, $filter_values = array())
|
||
{
|
||
return self::$db->query("SELECT COUNT(*) AS total
|
||
FROM bank_statements
|
||
WHERE bank_account_id = $ba_id
|
||
")->current()->total;
|
||
}
|
||
|
||
/**
|
||
* Gets bank statements of given bank account.
|
||
* @author Jiri Svitak
|
||
* @param $ba_id
|
||
* @param $limit_from
|
||
* @param $limit_results
|
||
* @param $order_by
|
||
* @param $order_by_direction
|
||
* @param $filter_values
|
||
* @return unknown_type
|
||
*/
|
||
public function get_bank_statements($ba_id = null, $limit_from = 0, $limit_results = 20, $order_by = 'id', $order_by_direction = 'DESC', $filter_values = array())
|
||
{
|
||
return self::$db->query("SELECT *
|
||
FROM bank_statements
|
||
WHERE bank_account_id = $ba_id
|
||
ORDER BY $order_by $order_by_direction
|
||
LIMIT $limit_from, $limit_results");
|
||
}
|
||
}
|
||
?>
|
freenetis/trunk/kohana/application/models/bank_transfer.php | ||
---|---|---|
}
|
||
|
||
/**
|
||
* Gets bank transfers by bank statement.
|
||
* @author Jiri Svitak
|
||
* @param $bs_id
|
||
* @param $limit_from
|
||
* @param $limit_results
|
||
* @param $order_by
|
||
* @param $order_by_direction
|
||
* @param $filter_values
|
||
* @return unknown_type
|
||
*/
|
||
public function get_bank_transfers_by_statement($bs_id = null, $limit_from = 0, $limit_results = 20, $order_by = 'id', $order_by_direction = 'DESC', $filter_values = array())
|
||
{
|
||
return self::$db->query("SELECT
|
||
bt.id,
|
||
ba.account_nr, ba.bank_nr,
|
||
ba.name,
|
||
t.datetime, t.text, t.amount,
|
||
bt.variable_symbol, bt.transfer_id
|
||
FROM bank_transfers bt
|
||
LEFT JOIN transfers t ON t.id = bt.transfer_id
|
||
LEFT JOIN bank_accounts ba ON ba.id = IF(bt.origin_id = (SELECT DISTINCT bank_account_id FROM bank_statements WHERE id = $bs_id), bt.destination_id, bt.origin_id)
|
||
WHERE bt.bank_statement_id = $bs_id
|
||
ORDER BY $order_by $order_by_direction
|
||
LIMIT $limit_from, $limit_results"
|
||
);
|
||
}
|
||
|
||
/**
|
||
* @author Jiri Svitak
|
||
* It counts all bank transfers of given bank account.
|
||
* @param $account_id
|
||
* @return unknown_type
|
||
*/
|
||
public function count_bank_transfers_by_statement($bs_id, $filter_values = array())
|
||
{
|
||
|
||
return self::$db->query("SELECT COUNT(*) AS total
|
||
FROM bank_transfers bt
|
||
WHERE bt.bank_statement_id = $bs_id"
|
||
)->current()->total;
|
||
}
|
||
|
||
|
||
/**
|
||
* @author Jiri Svitak, Tomas Dulik
|
||
* It gets unidentified member fees transfers from db.
|
||
* Unidentified transfer is that with member_id=0.
|
freenetis/trunk/kohana/application/controllers/members.php | ||
---|---|---|
'account_attribute_id' => Account_attribute_Model::$credit))->find();
|
||
// count expiration date of credit
|
||
$balance = $account->get_account_balance($account->id);
|
||
$fee_model = new Fee_Model();
|
||
$fee = $fee_model->get_by_date_type(date('Y-m-d'), 'regular member fee');
|
||
if ($fee->fee > 0)
|
||
$expiration_date = date('Y-m-d', mktime(0, 0, 0, date('m'), 1, date('Y')) + (($balance / $fee->fee) * 30 * 24 * 60 * 60));
|
||
if ($balance == 0)
|
||
{
|
||
$expiration_date = null;
|
||
}
|
||
else
|
||
$expiration_date = url_lang::lang('texts.No member fee set!');
|
||
{
|
||
$fee_model = new Fee_Model();
|
||
$fee = $fee_model->get_by_date_type(date('Y-m-d'), 'regular member fee');
|
||
if ($fee->fee > 0)
|
||
{
|
||
$expiration_date = date('Y-m-d', mktime(0, 0, 0, date('m'), 1, date('Y')) + (($balance / $fee->fee) * 30 * 24 * 60 * 60));
|
||
}
|
||
else
|
||
{
|
||
$expiration_date = url_lang::lang('texts.No member fee set!');
|
||
}
|
||
}
|
||
}
|
||
// contacts of main user of member
|
||
$model_contacts = new Contact_Model();
|
freenetis/trunk/kohana/application/controllers/transfers.php | ||
---|---|---|
$filter_values['type'] = Transfer_Model::$inbound_and_outbound;
|
||
// count expiration date of credit
|
||
$balance = $account->get_account_balance($account_id);
|
||
$fee_model = new Fee_Model();
|
||
$fee = $fee_model->get_by_date_type(date('Y-m-d'), 'regular member fee');
|
||
$expiration_date = date('Y-m-d', mktime(0, 0, 0, date('m'), 1, date('Y')) + (($balance / $fee->fee) * 30 * 24 * 60 * 60));
|
||
if ($balance == 0)
|
||
{
|
||
$expiration_date = null;
|
||
}
|
||
else
|
||
{
|
||
$fee_model = new Fee_Model();
|
||
$fee = $fee_model->get_by_date_type(date('Y-m-d'), 'regular member fee');
|
||
if ($fee->fee > 0)
|
||
{
|
||
$expiration_date = date('Y-m-d', mktime(0, 0, 0, date('m'), 1, date('Y')) + (($balance / $fee->fee) * 30 * 24 * 60 * 60));
|
||
}
|
||
else
|
||
{
|
||
$expiration_date = url_lang::lang('texts.No member fee set!');
|
||
}
|
||
}
|
||
// transfers on account
|
||
$transfer_model = new Transfer_Model();
|
||
$total_transfers = $transfer_model->count_transfers($account_id, $filter_values);
|
freenetis/trunk/kohana/application/controllers/bank_transfers.php | ||
---|---|---|
$grid->add_new_button(url_lang::base().'bank_accounts/show_all', url_lang::lang('texts.Back to bank accounts'));
|
||
if ($ba->member_id == 1 && $this->acl_check_new('Accounts_Controller', 'bank_transfers'))
|
||
{
|
||
// add new bank transfer
|
||
$grid->add_new_button(url_lang::base().'bank_transfers/add/'.$bank_account_id, url_lang::lang('texts.Add new bank transfer'));
|
||
// add new bank fee
|
||
$grid->add_new_button(url_lang::base().'bank_transfers/add_fee/'.$bank_account_id, url_lang::lang('texts.Add new bank transfer without counteraccount'));
|
||
// show imported bank statements
|
||
$grid->add_new_button(url_lang::base().'bank_statements/show_by_bank_account/'.$bank_account_id, url_lang::lang('texts.Show statements'));
|
||
}
|
||
//$grid->order_field('id')->label('ID');
|
||
$grid->order_field('datetime')->label(url_lang::lang('texts.Date and time'));
|
||
... | ... | |
} // end of show_by_bank_account function
|
||
|
||
/**
|
||
* @author Jiri Svitak
|
||
* Shows transfers of bank statement.
|
||
* @param $account_id
|
||
* @return unknown_type
|
||
*/
|
||
function show_by_bank_statement($bank_statement_id = NULL, $limit_results = 500, $order_by = 'id', $order_by_direction = 'desc', $page_word = null, $page = 1)
|
||
{
|
||
if (!isset($bank_statement_id))
|
||
Controller::warning(PARAMETER);
|
||
// bank account
|
||
$bs = new Bank_statement_Model($bank_statement_id);
|
||
if ($bs->id == 0)
|
||
Controller::error(RECORD);
|
||
// access rights
|
||
if (!$this->acl_check_view('Accounts_Controller', 'bank_transfers'))
|
||
Controller::error(ACCESS);
|
||
|
||
if (is_numeric($this->input->get('record_per_page')))
|
||
$limit_results = (int) $this->input->get('record_per_page');
|
||
$allowed_order_type = array('id', 'name', 'amount', 'datetime', 'trans_type', 'account_number', 'variable_symbol');
|
||
if (!in_array(strtolower($order_by), $allowed_order_type))
|
||
$order_by = 'id';
|
||
if (strtolower($order_by_direction) != 'asc' && strtolower($order_by_direction) != 'desc')
|
||
$order_by_direction = 'desc';
|
||
|
||
// model
|
||
$bt_model = new Bank_transfer_Model();
|
||
$total_bank_transfers = $bt_model->count_bank_transfers_by_statement($bank_statement_id);
|
||
if (($sql_offset = ($page - 1) * $limit_results) > $total_bank_transfers)
|
||
$sql_offset = 0;
|
||
$bts = $bt_model->get_bank_transfers_by_statement($bank_statement_id, $sql_offset, (int)$limit_results, $order_by, $order_by_direction);
|
||
|
||
$headline = url_lang::lang('texts.Transfers of bank statement');
|
||
$grid = new Grid(url_lang::base().'transfers', null, array(
|
||
//'separator' => '<br />-----------',
|
||
//'use_paginator' => false,
|
||
//'use_selector' => false,
|
||
'current' => $limit_results, // current selected 'records_per_page' value
|
||
'selector_increace' => 500, // increace
|
||
'selector_min' => 500, // minimum where selector start
|
||
'selector_max_multiplier' => 10,
|
||
'base_url' => Config::get('lang').'/bank_transfers/show_by_bank_account/'.$bank_statement_id.'/'.$limit_results.'/'.$order_by.'/'.$order_by_direction ,
|
||
'uri_segment' => 'page', // pass a string as uri_segment to trigger former 'label' functionality
|
||
'total_items' => $total_bank_transfers, // use db count query here of course
|
||
'items_per_page' => $limit_results, // it may be handy to set defaults for stuff like this in config/pagination.php
|
||
'style' => 'classic',
|
||
'order_by' => $order_by,
|
||
'order_by_direction' => $order_by_direction,
|
||
'limit_results' => $limit_results,
|
||
'variables' => $bank_statement_id.'/',
|
||
'url_array_ofset' => 1,
|
||
));
|
||
|
||
$grid->add_new_button(url_lang::base().'bank_statements/show_by_bank_account/'.$bs->bank_account_id, url_lang::lang('texts.Back to bank statements'));
|
||
|
||
//$grid->order_field('id')->label('ID');
|
||
$grid->order_field('datetime')->label(url_lang::lang('texts.Date and time'));
|
||
$grid->order_field('name')->label(url_lang::lang('texts.Counteraccount'));
|
||
if ($this->acl_check_view('Accounts_Controller', 'bank_transfers'))
|
||
{
|
||
$grid->order_field('account_nr')->label(url_lang::lang('texts.Account number'));
|
||
$grid->order_field('bank_nr')->label(url_lang::lang('texts.Bank code'));
|
||
}
|
||
$grid->order_field('text')->label(url_lang::lang('texts.Text'));
|
||
$grid->order_field('variable_symbol')->label(url_lang::lang('texts.VS'));
|
||
$grid->order_field('amount')->label(url_lang::lang('texts.Amount'));
|
||
if ($this->acl_check_view('Accounts_Controller', 'transfers'))
|
||
$grid->action_field('transfer_id') ->label(url_lang::lang('texts.Transfer'))->url(url_lang::base().'transfers/show')->action(url_lang::lang('texts.Show'));
|
||
$grid->datasource($bts);
|
||
|
||
$view = new View('main');
|
||
$view->title = $headline;
|
||
$view->content = new View('show_all');
|
||
$view->content->headline = $headline;
|
||
$view->content->message = $this->session->get_once('message');
|
||
$view->content->table = $grid;
|
||
$view->render(TRUE);
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
/**
|
||
* It shows unidentified bank transfers.
|
||
* @param $limit_results
|
||
* @param $order_by
|
freenetis/trunk/kohana/application/controllers/import.php | ||
---|---|---|
public $duplicity;
|
||
public function __construct($duplicity=NULL) {$this->duplicity=$duplicity;}
|
||
}
|
||
class Statistics {
|
||
public function __get($var) {
|
||
|
||
class Statistics
|
||
{
|
||
public function __get($var)
|
||
{
|
||
return 0;
|
||
}
|
||
}
|
||
|
||
class Import_Controller extends Controller
|
||
{
|
||
// static constants of bank listing types
|
||
... | ... | |
protected $parsed_bank_acc = NULL;
|
||
protected $time_now;
|
||
protected $stats;
|
||
|
||
// for saving id of bank statement
|
||
protected $bank_statement_id;
|
||
|
||
// automatic redirect
|
||
function index()
|
||
... | ... | |
Controller::warning(PARAMETER);
|
||
if (!$this->acl_check_new('Accounts_Controller', 'bank_transfers'))
|
||
Controller::error(ACCESS);
|
||
$bank_acc_model=new Bank_account_Model($id);
|
||
$bank_acc_model = new Bank_account_Model($id);
|
||
if ($bank_acc_model->id == 0)
|
||
Controller::error(RECORD);
|
||
// file types of bank listings
|
||
... | ... | |
// form
|
||
$form = new Forge(url_lang::base()."import/upload_bank_file/$id", '','POST',array('id' => 'article_form'));
|
||
$form->set_attr('class', 'form_class')->set_attr('method', 'post');
|
||
$form->dropdown('type')->label(url_lang::lang('texts.File type'))->options($types)->rules('required');
|
||
$form->group('')->label(url_lang::lang('texts.File type'));
|
||
$form->dropdown('type')->label(url_lang::lang('texts.File type').':')->options($types)->rules('required');
|
||
//$form->dropdown('csv_template')->label(url_lang::lang('texts.CSV file template'))->options($arr_templates);
|
||
$form->upload('listing', TRUE)->label(url_lang::lang('texts.File with bank transfer listing'))->rules('required');
|
||
$form->upload('listing', TRUE)->label(url_lang::lang('texts.File with bank transfer listing').':')->rules('required');
|
||
$form->group('')->label(url_lang::lang('texts.Information from header of bank statement'));
|
||
$form->date('from')->label(url_lang::lang('texts.Date from').':')->years(date('Y')-100, date('Y'))->rules('required');
|
||
$form->date('to')->label(url_lang::lang('texts.Date to').':')->years(date('Y')-100, date('Y'))->rules('required');
|
||
$form->input('opening_balance')->label(url_lang::lang('texts.Opening balance').':');
|
||
$form->input('closing_balance')->label(url_lang::lang('texts.Closing balance').':');
|
||
//$form->datetime();
|
||
$form->submit(url_lang::lang('texts.Submit'));
|
||
special::required_forge_style($form, ' *', 'required');
|
||
// validation
|
||
if($form->validate())
|
||
{
|
||
$form_data = $form->as_array();
|
||
// save bank statement
|
||
$statement = new Bank_statement_Model();
|
||
$statement->bank_account_id = $id;
|
||
$statement->user_id = $this->session->get('user_id');
|
||
$statement->from = date('Y-m-d', $form_data['from']);
|
||
$statement->to = date('Y-m-d', $form_data['to']);
|
||
$statement->opening_balance = $form_data['opening_balance'];
|
||
$statement->closing_balance = $form_data['closing_balance'];
|
||
switch($form_data['type'])
|
||
{
|
||
case self::$html_ebanka:
|
||
$statement->extension = "html";
|
||
$statement->save();
|
||
$this->bank_statement_id = $statement->id;
|
||
$this->parse_ebank_account($id, $form->listing->value);
|
||
break;
|
||
case self::$csv_postovni_sporitelna:
|
||
... | ... | |
|
||
private function create_transfers($src_acc, $dst_acc, $amount,
|
||
$src_bank_acc, $dst_bank_acc, $data,
|
||
$member_id=null, $prev_id=null) {
|
||
static $transfer; // static variable saves a little bit of memory & time
|
||
$member_id=null, $prev_id=null)
|
||
{
|
||
// static variable saves a little bit of memory & time
|
||
static $transfer;
|
||
static $bank_transfer;
|
||
if (!isset($transfer)) {
|
||
$transfer=new Transfer_Model();
|
||
... | ... | |
$bank_transfer->transfer_id = $transfer->id;
|
||
$bank_transfer->origin_id = isset($src_bank_acc)? $src_bank_acc->id : null;
|
||
$bank_transfer->destination_id = isset($dst_bank_acc)? $dst_bank_acc->id : null;
|
||
$bank_transfer->bank_statement_id = $this->bank_statement_id;
|
||
$bank_transfer->number = $data->number;
|
||
$bank_transfer->variable_symbol = $data->variable_symbol;
|
||
$bank_transfer->constant_symbol = $data->constant_symbol;
|
||
$bank_transfer->specific_symbol = $data->specific_symbol;
|
||
$bank_transfer->save();
|
||
return $transfer->id;
|
||
}
|
||
}
|
||
|
||
/**
|
||
* @author Tomas Dulik
|
||
... | ... | |
* @param $account_id - ID of the account whose data will be parsed.
|
||
* @return void
|
||
*/
|
||
private function parse_ebank_account($bank_account_id=NULL, $url="")
|
||
private function parse_ebank_account($bank_account_id = NULL, $url = "")
|
||
{
|
||
// disable logging of database operations - it slows down import and creates too many log items
|
||
// problem: session doesn't work inside ORM class
|
||
//$this->session->set('log', 0);
|
||
|
||
//$this->profiler = new Profiler;
|
||
$mem=memory_get_usage();
|
||
$start=microtime(true);
|
||
... | ... | |
$parser->set_callback(array($this, "store_transfer_ebanka"));
|
||
// pokud z gridu dostáváme $account_id, pak si ho uložíme pro potřeby callback funkce
|
||
if (isset($bank_account_id))
|
||
$this->parsed_bank_acc=new Bank_account_Model($bank_account_id);
|
||
$this->parsed_bank_acc=new Bank_account_Model($bank_account_id);
|
||
|
||
try {
|
||
$duplicity_err='';
|
||
... | ... | |
$view->title = $title;
|
||
$view->content = new View('show_all');
|
||
$view->content->table = $duplicity_err . "Shrnutí:".$sum_table."Statistiky:".$stats_table;
|
||
$view->content->link_back = html::anchor(url_lang::base().'bank_accounts/show_all', url_lang::lang('texts.Back to bank accounts'));
|
||
$links = array();
|
||
$links[] = html::anchor(url_lang::base().'bank_accounts/show_all', url_lang::lang('texts.Back to bank accounts'));
|
||
$links[] = html::anchor(url_lang::base().'bank_transfers/show_by_bank_statement/'.$this->bank_statement_id, url_lang::lang('texts.Transfers of bank statement'));
|
||
$view->content->link_back = implode(' | ', $links);
|
||
$view->content->headline = $title;
|
||
$view->render(TRUE);
|
||
|
||
// enable logging of database items
|
||
//$this->session->set('log', 1);
|
||
}
|
||
}
|
||
|
freenetis/trunk/kohana/application/controllers/bank_statements.php | ||
---|---|---|
<?php
|
||
class Bank_statements_Controller extends Controller
|
||
{
|
||
/**
|
||
* Function imported bank statements by bank account.
|
||
* @author Jiri Svitak
|
||
* @param $limit_results
|
||
* @param $order_by
|
||
* @param $order_by_direction
|
||
* @param $page_word
|
||
* @param $page
|
||
* @return unknown_type
|
||
*/
|
||
function show_by_bank_account($bank_account_id = NULL, $limit_results = 500, $order_by = 'id', $order_by_direction = 'desc', $page_word = null, $page = 1)
|
||
{
|
||
if (!isset($bank_account_id))
|
||
Controller::warning(PARAMETER);
|
||
$ba = new Bank_account_Model($bank_account_id);
|
||
if ($ba->id == 0)
|
||
Controller::error(RECORD);
|
||
// access rights
|
||
if (!$this->acl_check_view('Accounts_Controller', 'bank_transfers'))
|
||
Controller::error(ACCESS);
|
||
|
||
if (is_numeric($this->input->get('record_per_page')))
|
||
$limit_results = (int) $this->input->get('record_per_page');
|
||
$allowed_order_type = array('id', 'name', 'amount', 'datetime', 'trans_type', 'account_number', 'variable_symbol');
|
||
if (!in_array(strtolower($order_by), $allowed_order_type))
|
||
$order_by = 'id';
|
||
if (strtolower($order_by_direction) != 'asc' && strtolower($order_by_direction) != 'desc')
|
||
$order_by_direction = 'desc';
|
||
|
||
// model
|
||
$bs_model = new Bank_statement_Model();
|
||
$total_bank_statements = $bs_model->count_bank_statements($bank_account_id);
|
||
if (($sql_offset = ($page - 1) * $limit_results) > $total_bank_statements)
|
||
$sql_offset = 0;
|
||
$bank_statements = $bs_model->get_bank_statements($bank_account_id, $sql_offset, (int)$limit_results, $order_by, $order_by_direction);
|
||
|
||
$headline = url_lang::lang('texts.Bank statements');
|
||
$grid = new Grid(url_lang::base().'transfers', null, array(
|
||
//'separator' => '<br />-----------',
|
||
//'use_paginator' => false,
|
||
//'use_selector' => false,
|
||
'current' => $limit_results, // current selected 'records_per_page' value
|
||
'selector_increace' => 500, // increace
|
||
'selector_min' => 500, // minimum where selector start
|
||
'selector_max_multiplier' => 10,
|
||
'base_url' => Config::get('lang').'/bank_transfers/show_by_bank_account/'.$bank_account_id.'/'.$limit_results.'/'.$order_by.'/'.$order_by_direction ,
|
||
'uri_segment' => 'page', // pass a string as uri_segment to trigger former 'label' functionality
|
||
'total_items' => $total_bank_statements, // use db count query here of course
|
||
'items_per_page' => $limit_results, // it may be handy to set defaults for stuff like this in config/pagination.php
|
||
'style' => 'classic',
|
||
'order_by' => $order_by,
|
||
'order_by_direction' => $order_by_direction,
|
||
'limit_results' => $limit_results,
|
||
'variables' => $bank_account_id.'/',
|
||
'url_array_ofset' => 1,
|
||
));
|
||
|
||
$grid->add_new_button(url_lang::base().'bank_transfers/show_by_bank_account/'.$bank_account_id, url_lang::lang('texts.Back to bank account'));
|
||
$grid->order_field('id')->label('ID');
|
||
$grid->order_field('from')->label(url_lang::lang('texts.Date from'));
|
||
$grid->order_field('to')->label(url_lang::lang('texts.Date to'));
|
||
$grid->order_field('extension')->label(url_lang::lang('texts.Type'));
|
||
$grid->order_field('opening_balance')->label(url_lang::lang('texts.Opening balance'));
|
||
$grid->order_field('closing_balance')->label(url_lang::lang('texts.Closing balance'));
|
||
if ($this->acl_check_view('Accounts_Controller', 'bank_transfers'))
|
||
$grid->action_field('id') ->label(url_lang::lang('texts.Bank transfers'))->url(url_lang::base().'bank_transfers/show_by_bank_statement')->action(url_lang::lang('texts.Show'));
|
||
$grid->datasource($bank_statements);
|
||
|
||
$view = new View('main');
|
||
$view->title = $headline;
|
||
$view->content = new View('show_all');
|
||
$view->content->headline = $headline;
|
||
$view->content->message = $this->session->get_once('message');
|
||
$view->content->table = $grid;
|
||
$view->render(TRUE);
|
||
}
|
||
}
|
||
?>
|
freenetis/trunk/kohana/application/libraries/Form_Upload.php | ||
---|---|---|
|
||
public function validate()
|
||
{
|
||
// The upload directory must always be set
|
||
empty($this->directory) and $this->directory();
|
||
// exception handling added by jsvitak
|
||
try
|
||
{
|
||
// The upload directory must always be set
|
||
empty($this->directory) and $this->directory();
|
||
}
|
||
catch(Exception $e)
|
||
{
|
||
// in case of exception (upload not writable), freenetis shows better error message
|
||
$view = new View('main');
|
||
$view->content = new View('statesbox');
|
||
$view->title = url_lang::lang('texts.Error');
|
||
$view->content->icon = html::image(array('src' => 'media/images/states/error.png', 'width' => '100', 'height' => '100', 'alt' => 'Image', 'class' => 'noborder'));
|
||
$view->content->message = url_lang::lang('texts.Directory upload for file uploading is not writable.');
|
||
$view->content->content = url_lang::lang('texts.Change owner of directory of upload (for example /var/www/freenetis/upload) to www-data.');
|
||
$view->render(TRUE);
|
||
die();
|
||
}
|
||
|
||
// By default, there is no uploaded file
|
||
$filename = '';
|
freenetis/trunk/kohana/application/libraries/MY_Controller.php | ||
---|---|---|
foreach ($upgrade_sql[$i] as $query)
|
||
$this->db->query($query);
|
||
//}
|
||
// problem - it seems that Kohana uses separate connection for each query, so transaction
|
||
// processing with rollback does not work
|
||
/*catch (Kohana_Database_Exception $e)
|
||
{
|
||
$this->db->query('ROLLBACK;');
|
freenetis/trunk/kohana/application/views/members_show.php | ||
---|---|---|
<th><?php echo url_lang::lang('texts.Current credit') ?></th>
|
||
<td><?php echo number_format((float) $account->get_account_balance($account->id), 2, ',', ' ').' '.$this->settings->get('currency') ?></td>
|
||
</tr>
|
||
<?php if (isset($expiration_date)) { ?>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Payed to')?></th>
|
||
<td><?php echo date('Y-m-d') < $expiration_date ? $expiration_date : '<span style="color:red">'.url_lang::lang('texts.You are in debt').'</span>' ?></td>
|
||
<td><?php echo date('Y-m-d') <= $expiration_date ? $expiration_date : '<span style="color:red">'.url_lang::lang('texts.You are in debt').'</span>' ?></td>
|
||
</tr>
|
||
<?php } ?>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Entrance fee') ?></th>
|
||
<td><?php echo number_format((float)$member_data->entrance_fee, 2, ',', ' ').' '.$this->settings->get('currency') ?></td>
|
freenetis/trunk/kohana/application/views/transfers/show_by_account.php | ||
---|---|---|
<th><?php echo url_lang::lang('texts.Variable symbol')?></th>
|
||
<td><?php echo $account->member->variable_symbol ?></td>
|
||
</tr>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Payed to')?></th>
|
||
<td><?php echo date('Y-m-d') < $expiration_date ? $expiration_date : '<span style="color:red">'.url_lang::lang('texts.You are in debt').'</span>' ?></td>
|
||
</tr>
|
||
<?php if (isset($expiration_date)) { ?>
|
||
<tr>
|
||
<th><?php echo url_lang::lang('texts.Payed to')?></th>
|
||
<td><?php echo date('Y-m-d') < $expiration_date ? $expiration_date : '<span style="color:red">'.url_lang::lang('texts.You are in debt').'</span>' ?></td>
|
||
</tr>
|
||
<?php } ?>
|
||
<?php } ?>
|
||
</table>
|
||
<br class="clear" />
|
Také k dispozici: Unified diff
Pridana obsluha vyjimky pro nemoznost zapisu do upload. Pridana zakladni evidence bankovnich vypisu. Opraven vypocet, do kdy ma clen zaplaceno kredit.