Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 471

Přidáno uživatelem Jiří Sviták před asi 15 roky(ů)

Uprava vypisu neidentifikovanych plateb.

Zobrazit rozdíly:

freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php
'balance' => 'Stav',
'bank account' => 'Bankovní účet',
'bank account id' => 'ID bankovního účtu',
'bank account name' => 'Název bankovního účtu',
'bank accounts' => 'Bankovní účty',
'bank accounts of association' => 'Bankovní účty sdružení',
'bank code' => 'Kód banky',
freenetis/trunk/kohana/application/models/bank_transfer.php
public function get_unidentified_transfers($limit_from = 0, $limit_results = 500, $order_by = 'id', $order_by_direction = 'asc', $filter_values = array())
{
$where = '';
if (count($filter_values) > 0)
$where .= 'WHERE ';
foreach($filter_values as $key => $value)
{
if($key!='submit')
if ($key != 'submit')
{
if($where!='WHERE ')
$where .= ' AND ';
$where .= $key.' LIKE \'%'.$value.'%\' COLLATE utf8_general_ci';
if ($key == 'name')
$key = 'ba.name';
if ($where == '')
$where .= 'WHERE '.$key.' LIKE \'%'.$value.'%\' COLLATE utf8_general_ci';
else
$where .= ' AND '.$key.' LIKE \'%'.$value.'%\' COLLATE utf8_general_ci';
}
}
if ($order_by == 'amount')
$order_by = 'IF( t.destination_id = '.$account_id.', amount, amount*-1 )';
// srct contains all source transactions, asst contains all transfers assigned to credit accounts
$q="SELECT srct.id, srct.datetime, srct.amount, srct.text, bt.variable_symbol, ba.account_nr, ba.bank_nr
$q="SELECT srct.id, srct.datetime, srct.amount, srct.text,
bt.variable_symbol,
ba.account_nr, ba.bank_nr, ba.name
FROM transfers srct
JOIN accounts a ON a.id = srct.origin_id
AND srct.member_id = 0
......
public function count_unidentified_transfers($filter_values = array())
{
$where = '';
if (count($filter_values) > 0)
$where .= 'WHERE ';
foreach($filter_values as $key => $value)
{
if($key!='submit')
if ($key != 'submit')
{
if($where!='WHERE ')
$where .= ' AND ';
$where .= $key.' LIKE \'%'.$value.'%\' COLLATE utf8_general_ci';
if ($key == 'name')
$key = 'ba.name';
if ($where == '')
$where .= 'WHERE '.$key.' LIKE \'%'.$value.'%\' COLLATE utf8_general_ci';
else
$where .= ' AND '.$key.' LIKE \'%'.$value.'%\' COLLATE utf8_general_ci';
}
}
return self::$db->query("SELECT COUNT(*) AS total
freenetis/trunk/kohana/application/controllers/bank_transfers.php
// creates fields for filtering unidentified transfers
$filter=new Table_Form(url_lang::base()."bank_transfers/unidentified_transfers", "get", array(
new Table_Form_Item('text', 'datetime', 'Date and time'),
new Table_Form_Item('text', 'text', 'Text'),
new Table_Form_Item('text', 'name', 'Account name'),
"tr",
new Table_Form_Item('text', 'variable_symbol', 'Variable symbol'),
new Table_Form_Item('text', 'amount', 'Amount'),
......
$grid->order_field('datetime')->label(url_lang::lang('texts.Date and time'));
$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('name')->label(url_lang::lang('texts.Account name'));
//$grid->order_field('text')->label(url_lang::lang('texts.Text'));
$grid->order_field('variable_symbol')->label(url_lang::lang('texts.Variable symbol'));
$grid->order_field('amount')->label(url_lang::lang('texts.Amount'));
if ($this->acl_check_new('Accounts_Controller', 'transfers'))

Také k dispozici: Unified diff