Esempio n. 1
0
        echo $category['finance_category_id'];
        ?>
"><?php 
        echo htmlspecialchars($category['name']);
        ?>
</label> <br/>
                        <?php 
    }
    ?>

                    <input type="checkbox" name="finance_category_new_checked" value="new">
                    <input type="text" name="finance_category_new" value="">
                </div> &nbsp;
	<?php 
    $header_cats = ob_get_clean();
    $header_rows[] = array('sort_date' => array('data' => '<input type="text" name="transaction_date" class="date_field" value="' . print_date(time()) . '"> '), 'sort_name' => array('data' => '<input type="text" name="name" id="new_transaction_name">'), 'finance_description' => array('data' => '<input type="text" name="description">'), 'finance_customer' => array('data' => ''), 'sort_credit' => array('data' => currency('') . '<input type="text" name="credit" class="currency">', 'cell_class' => 'success_text'), 'sort_debit' => array('data' => currency('') . '<input type="text" name="debit" class="currency">', 'cell_class' => 'error_text'), 'sort_account' => array('data' => print_select_box(module_finance::get_accounts(), 'finance_account_id', '', '', true, 'name', true)), 'finance_categories' => array('data' => $header_cats), 'finance_tick' => array('data' => '<input type="submit" name="addnew" value="' . _l('Quick Add') . '" class="small_button">'));
    $table_manager->set_header_rows($header_rows);
}
$table_manager->set_rows($recent_transactions);
if (module_config::c('finance_list_show_totals', 1)) {
    $footer_rows = array();
    foreach ($finance_credit_total + $finance_debit_total as $currency_id => $foo) {
        $currency = get_single('currency', 'currency_id', $currency_id);
        $footer_rows[] = array('sort_date' => array('data' => ' ', 'cell_colspan' => 3), 'finance_customer' => array('data' => '<strong>' . _l('%s Totals:', $currency && isset($currency['code']) ? $currency['code'] : '') . '</strong>', 'cell_class' => 'text-right'), 'sort_credit' => array('data' => '<strong>' . dollar(isset($finance_credit_total[$currency_id]) ? $finance_credit_total[$currency_id] : 0, true, $currency_id) . '</strong>'), 'sort_debit' => array('data' => '<strong>' . dollar(isset($finance_debit_total[$currency_id]) ? $finance_debit_total[$currency_id] : 0, true, $currency_id) . '</strong>'), 'sort_account' => array('data' => ' ', 'cell_colspan' => 4));
    }
    $footer_rows[] = array('sort_date' => array('data' => ' ', 'cell_colspan' => 8), 'finance_tick' => array('data' => '<input type="button" name="link" value="' . _l('Link') . '" class="small_button" onclick="$(\'#link_go\').val(\'go\'); $(\'#quick_add_form\')[0].submit();">
						<input type="hidden" name="link_go" value="0" id="link_go">
                        ' . _hr('Combine transactions together. eg: an invoice payment history with corresponding bank statement transaction. Transactions need to be the same dollar amount to link successfully.'), 'cell_colspan' => 4));
    $table_manager->set_footer_rows($footer_rows);
}
$table_manager->pagination = true;
Esempio n. 2
0
if (module_finance::can_i('create', 'Finance Upcoming')) {
    $heading['button'][] = array('title' => "Add New", 'type' => 'add', 'url' => module_finance::link_open_recurring('new'));
    $heading['button'][] = array('title' => _l("Set Starting Balance (currently %s)", dollar($balance)), 'url' => 'javascript:set_starting_balance();');
}
print_heading($heading);
?>

<form action="" method="post" id="finance_recurring_form">

    <?php 
$categories_rel = array();
foreach (module_finance::get_categories() as $category) {
    $categories_rel[$category['finance_category_id']] = $category['name'];
}
$accounts_rel = array();
foreach (module_finance::get_accounts() as $account) {
    $accounts_rel[$account['finance_account_id']] = $account['name'];
}
$search_bar = array('elements' => array('due_date' => array('title' => _l('Due Date:'), 'fields' => array(array('type' => 'date', 'name' => 'search[date_from]', 'value' => isset($search['date_from']) ? $search['date_from'] : ''), _l('to'), array('type' => 'date', 'name' => 'search[date_to]', 'value' => isset($search['date_to']) ? $search['date_to'] : ''))), 'name' => array('title' => _l('Name:'), 'field' => array('type' => 'text', 'name' => 'search[generic]', 'value' => isset($search['generic']) ? $search['generic'] : '', 'size' => 20)), 'amount' => array('title' => _l('Amount:'), 'fields' => array(array('type' => 'currency', 'name' => 'search[amount_from]', 'value' => isset($search['amount_from']) ? $search['amount_from'] : ''), _l('to'), array('type' => 'currency', 'name' => 'search[amount_to]', 'value' => isset($search['amount_to']) ? $search['amount_to'] : ''))), 'account' => array('title' => _l('Account:'), 'field' => array('type' => 'select', 'name' => 'search[finance_account_id]', 'value' => isset($search['finance_account_id']) ? $search['finance_account_id'] : '', 'options' => $accounts_rel)), 'category' => array('title' => _l('Category:'), 'field' => array('type' => 'select', 'name' => 'search[finance_category_id]', 'value' => isset($search['finance_category_id']) ? $search['finance_category_id'] : '', 'options' => $categories_rel))));
echo module_form::search_bar($search_bar);
?>


<table width="100%" border="0" cellspacing="0" cellpadding="2" class="tableclass tableclass_rows">
    <thead>
    <tr class="title">
        <th><?php 
echo _l('Next Due Date');
?>
</th>
        <th><?php 
Esempio n. 3
0
?>
> <label for="expense"><?php 
_e('Expense/Debit');
?>
</label> <br/>
                </td>
            </tr>
            <tr>
                <th>
                    <?php 
echo _l('Default Account');
?>
                </th>
                <td valign="top">
                    <?php 
echo print_select_box(module_finance::get_accounts(), 'finance_account_id', isset($recurring['finance_account_id']) ? $recurring['finance_account_id'] : '', '', true, 'name', true);
?>
                </td>
            </tr>
            <tr>
                <th>
                    <?php 
echo _l('Default Categories');
?>
                </th>
                <td valign="top">
                    <?php 
$categories = module_finance::get_categories();
foreach ($categories as $category) {
    ?>
                        <input type="checkbox" name="finance_category_id[]" value="<?php 
Esempio n. 4
0
?>

                        <input type="text" name="search[date_to]" value="<?php 
echo isset($search['date_to']) ? htmlspecialchars($search['date_to']) : '';
?>
" class="date_field">
                    </td>
                    <td width="30">
                        <?php 
_e('Account:');
?>

                    </td>
                    <td>
                        <?php 
echo print_select_box(module_finance::get_accounts(), 'search[finance_account_id]', isset($search['finance_account_id']) ? $search['finance_account_id'] : '', '', true, 'name');
?>

                    </td>
                    <td width="30">
                        <?php 
_e('Category:');
?>

                    </td>
                    <td>
                        <?php 
echo print_select_box(module_finance::get_categories(), 'search[finance_category_id]', isset($search['finance_category_id']) ? $search['finance_category_id'] : '', '', true, 'name');
?>

                    </td>
Esempio n. 5
0
                        </div>
                        <script type="text/javascript">
                            set_add_del('finance_tax_holder');
                        </script>
                    <?php 
    }
}));
if ($locked) {
    $element_fields = array('type' => 'html', 'value' => dollar($finance['amount'], true, $finance['currency_id']), 'ignore' => !$locked);
} else {
    $element_fields = array('type' => 'currency', 'currency_id' => $finance['currency_id'], 'name' => 'amount', 'id' => 'finance_total_amount', 'value' => $finance['amount']);
}
$fieldset_data['elements'][] = array('title' => 'Total Amount', 'field' => $element_fields);
$fieldset_data['elements'][] = array('title' => 'Currency', 'field' => array('type' => 'select', 'name' => 'currency_id', 'options' => get_multiple('currency', '', 'currency_id'), 'options_array_id' => 'code', 'value' => $finance['currency_id']));
$fieldset_data['elements'][] = array('title' => 'Account', 'field' => array('type' => 'select', 'name' => 'finance_account_id', 'options' => module_finance::get_accounts(), 'options_array_id' => 'name', 'allow_new' => true, 'value' => isset($finance['finance_account_id']) ? $finance['finance_account_id'] : ''));
$fieldset_data['elements'][] = array('title' => 'Categories', 'fields' => array(function () use(&$finance, $locked) {
    $categories = module_finance::get_categories();
    foreach ($categories as $category) {
        ?>

                    <input type="checkbox" name="finance_category_id[]" value="<?php 
        echo $category['finance_category_id'];
        ?>
" id="category_<?php 
        echo $category['finance_category_id'];
        ?>
" <?php 
        echo isset($finance['category_ids'][$category['finance_category_id']]) ? ' checked' : '';
        ?>
>