Revize 334
Přidáno uživatelem Jiří Sviták před více než 15 roky(ů)
freenetis/trunk/kohana/application/models/bank_transfer.php | ||
---|---|---|
}
|
||
|
||
/**
|
||
* Function gets count of unidentified transfers
|
||
* @return unknown_type
|
||
*/
|
||
public function count_unidentified_transfers()
|
||
{
|
||
return self::$db->query("SELECT COUNT(*) AS total
|
||
FROM transfers t
|
||
JOIN bank_transfers bt ON bt.transfer_id = t.id
|
||
LEFT JOIN bank_accounts ba ON ba.id = bt.origin_id
|
||
LEFT JOIN accounts a ON a.id = t.origin_id
|
||
WHERE t.id NOT IN
|
||
(SELECT previous_transfer_id
|
||
FROM transfers t
|
||
WHERE t.previous_transfer_id IS NOT NULL)
|
||
AND a.account_attribute_id = ".Account_attribute_Model::$member_fees
|
||
)->current()->total;
|
||
}
|
||
|
||
/**
|
||
* It gets unidentified transfer including bank information
|
||
* @param $trans_id
|
||
* @return unknown_type
|
freenetis/trunk/kohana/application/controllers/vlans.php | ||
---|---|---|
|
||
$vlan_model = new Vlan_Model();
|
||
$total_vlans = $vlan_model->count_all_vlans();
|
||
if (($sql_offset = ($page - 1) * $limit_results) > $total_translations)
|
||
if (($sql_offset = ($page - 1) * $limit_results) > $total_vlans)
|
||
$sql_offset = 0;
|
||
$query = $vlan_model->get_all_vlans($sql_offset, (int)$limit_results, $order_by, $order_by_direction);
|
||
|
freenetis/trunk/kohana/application/controllers/bank_transfers.php | ||
---|---|---|
$order_by_direction = 'asc';
|
||
|
||
$mt_model = new Bank_transfer_Model();
|
||
$total_transfers = $mt_model->count_unidentified();
|
||
$total_transfers = $mt_model->count_unidentified_transfers();
|
||
if (($sql_offset = ($page - 1) * $limit_results) > $total_transfers)
|
||
$sql_offset = 0;
|
||
$transfers = $mt_model->get_unidentified_transfers($sql_offset, (int)$limit_results, $order_by, $order_by_direction);
|
||
|
||
$grid = new Grid(url_lang::base().'transfers', null,array(
|
||
'separator' => '<br />',
|
||
//'separator' => '<br />',
|
||
//'use_paginator' => false,
|
||
//'use_selector' => false,
|
||
'current' => $limit_results, // current selected 'records_per_page' value
|
||
... | ... | |
'limit_results' => $limit_results,
|
||
//'variables' => $acc_id.'/',
|
||
'url_array_ofset' => 0
|
||
));//,'unident_grid_template');
|
||
));
|
||
|
||
|
||
//$grid->add_new_button(url_lang::base().'accounts/new_transfer/'.$member_id, url_lang::lang('texts.New transfer'));
|
||
$grid->order_field('id')->label('ID');
|
||
$grid->order_field('datetime')->label(url_lang::lang('texts.Date and time'));
|
freenetis/trunk/kohana/application/controllers/accounts.php | ||
---|---|---|
$order_by_direction = 'asc';
|
||
|
||
$account_model = new Account_Model();
|
||
$total_accounts = $account_model->get_credit_accounts_count($filter_values);
|
||
$total_accounts = $account_model->get_accounts_count($filter_values);
|
||
if (($sql_offset = ($page - 1) * $limit_results) > $total_accounts)
|
||
$sql_offset = 0;
|
||
$accounts = $account_model->get_accounts($sql_offset, (int)$limit_results, $order_by, $order_by_direction, $filter_values);
|
Také k dispozici: Unified diff
Opraveny drobne chyby ve strankovani gridu.