Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 264

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

Neidentifikovane platby.

Zobrazit rozdíly:

freenetis/trunk/kohana/application/i18n/cs_CZ/texts.php
'password successfully changed' => 'Heslo úspěšně změněno',
'password' => 'Heslo',
'pay from account' => 'Platit z účtu',
'payment' => 'Platba',
'penalty' => 'Pokuta',
'penalty and fee' => 'Poplatky a pokuty',
'penalty have to be a number' => 'Pokuta musí být číslo',
freenetis/trunk/kohana/application/models/money_transfer.php
{
if ($order_by == 'amount')
$order_by = 'IF( mt.destination_id = '.$account_id.', amount, amount*-1 )';
return self::$db->query('SELECT a.name AS aname, a.id AS aid, a.member_id, mt. * , mt.id AS mtid, IF( mt.destination_id = '.$account_id.', FALSE, TRUE ) AS trans_type
FROM money_transfers mt
LEFT JOIN accounts a ON a.id = IF( mt.origin_id = '.$account_id.', mt.destination_id, mt.origin_id )
WHERE mt.origin_id = '.$account_id.'
OR mt.destination_id = '.$account_id.'
ORDER BY '.$order_by.' '.$order_by_direction.'
LIMIT '.$limit_from.' , '.$limit_results.''
);
return self::$db->query('SELECT
a.id AS aid, a.name AS aname,
mt.id AS mtid, IF(mt.destination_id = '.$account_id.', FALSE, TRUE) AS trans_type
mt.text, mt.amount
FROM money_transfers mt
LEFT JOIN accounts a ON a.id = IF(mt.origin_id = '.$account_id.', mt.destination_id, mt.origin_id)
WHERE mt.origin_id = '.$account_id.' OR mt.destination_id = '.$account_id.'
ORDER BY '.$order_by.' '.$order_by_direction.'
LIMIT '.$limit_from.' , '.$limit_results.''
);
}
/**
......
* and no other transfer has set previous_transfer_id to this transfer.
* @return unknown_type
*/
public function get_unidentified_transfers($limit_from = 0, $limit_results = 20, $order_by = 'mt.id', $order_by_direction = 'DESC')
public function get_unidentified_transfers($limit_from = 0, $limit_results = 20, $order_by = 'mt.id', $order_by_direction = 'desc')
{
if ($order_by == 'amount')
$order_by = 'IF( mt.destination_id = '.$account_id.', amount, amount*-1 )';
return self::$db->query("SELECT mt.id as mtid, mt.*
FROM money_transfers mt
WHERE mt.previous_transfer_id IS NULL
ORDER BY ".$order_by." ".$order_by_direction."
LIMIT ".$limit_from." , ".$limit_results
);
return self::$db->query("SELECT mt.id AS mtid, mt.datetime, mt.amount, mt.text,
bi.variable_symbol AS varsym,
CONCAT(ba.account_nr, '/', ba.bank_nr) AS account_number
FROM money_transfers mt
LEFT JOIN bank_accounts ba ON ba.account_id = mt.origin_id
JOIN money_transfer_bank_infos bi ON bi.transfer_id = mt.id
WHERE mt.previous_transfer_id IS NULL
ORDER BY ".$order_by." ".$order_by_direction."
LIMIT ".$limit_from." , ".$limit_results
);
}
public function get_last_transfers($account_id = null)
freenetis/trunk/kohana/application/controllers/money_transfers.php
* @param $order_by_direction
* @return unknown_type
*/
function unidentified_transfers($limit_results = 50, $order_by = 'mt.id', $order_by_direction = 'DESC')
function unidentified_transfers($limit_results = 50, $order_by = 'mt.id', $order_by_direction = 'asc')
{
// to do - access rights
//if (!$this->acl_check_view(get_class($this), 'unidentified_transfers'))
......
//'use_paginator' => false,
//'use_selector' => false,
'current' => $limit_results, // current selected 'records_per_page' value
'selector_increace' => 50, // increace
'selector_increace' => 50, // increace
'selector_min' => 50, // minimum where selector start
'selector_max_multiplier' => 10,
'base_url' => Config::item('locale.lang').'/money_transfers/unidentified_transfers/'.$limit_results.'/'.$order_by.'/'.$order_by_direction ,
'uri_segment' => 'page', // pass a string as uri_segment to trigger former 'label' functionality
'total_items' => $total_transfers, // use db count query here of course
'total_items' => $total_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,
......
//$grid->add_new_button(url_lang::base().'accounts/new_transfer/'.$member_id, url_lang::lang('texts.New transfer'));
$grid->order_field('mtid','mt.id')->label('ID');
$grid->order_field('datetime')->label(url_lang::lang('texts.Time'));
$grid->order_field('amount')->label(url_lang::lang('texts.Amount'))->style('style="width:80px;"');
//$grid->order_field('variable_symbol')->label(url_lang::lang('texts.Variable symbol'));
//$grid->order_field('name')->label(url_lang::lang('texts.Account name'));
$grid->field('text')->label(url_lang::lang('texts.Completive informations'));
$grid->action_field('mtid') ->label(url_lang::lang('texts.Details'))->url(url_lang::base().'accounts/unidentified_detail')->action(url_lang::lang('texts.Details'))->style('style="text-align:center;"');
$grid->action_field('mtid') ->label(url_lang::lang('texts.Assign transfer'))->url(url_lang::base().'accounts/assign_transfer')->action(url_lang::lang('texts.Assign'))->style('style="text-align:center;"');
$grid->datasource( $transfers );
$grid->order_field('datetime')->label(url_lang::lang('texts.Date and time'));
$grid->order_field('amount')->label(url_lang::lang('texts.Amount'));
$grid->order_field('varsym')->label(url_lang::lang('texts.Variable symbol'));
$grid->order_field('account_number')->label(url_lang::lang('texts.Account number'));
$grid->field('text')->label(url_lang::lang('texts.Text'));
//$grid->action_field('mtid') ->label(url_lang::lang('texts.Details'))->url(url_lang::base().'accounts/unidentified_detail')->action(url_lang::lang('texts.Details'))->style('style="text-align:center;"');
$grid->action_field('mtid') ->label(url_lang::lang('texts.Payment'))->url(url_lang::base().'accounts/assign_transfer')->action(url_lang::lang('texts.Assign'));
$grid->datasource($transfers);
$view = new View('template');
$view->header = new View('base/header');

Také k dispozici: Unified diff