} // Add or subtract display vars $net_sign = ' – '; // long dash $net_txt = 'Diff'; if ($net_multiplier != -1) { $net_sign = ' + '; $net_txt = 'Sum'; } // build account dropdowns $account_list = Account::Get_account_list($_SESSION['login_id']); $account1_dropdown = Build_dropdown($account_list, 'account1_id', $account1_id); $account2_dropdown = Build_dropdown($account_list, 'account2_id', $account2_id); // plus / minus dropdown $sum_list = array('-1' => 'Subtract', '1' => 'Add'); $sum_dropdown = Build_dropdown($sum_list, 'net_multiplier', $net_multiplier); // Get summary data $summary_list = array(); $error = Account::Get_summary_list($account1_id, $account2_id, $start_date, $end_date, $summary_list); $fuel_list = array(); if ($error == '') { // Get fuel consumption data $error = Account::Get_gas_totals($fuel_list); } ?> <html> <head> <title>Account Summary</title> <link href="style.css" rel="stylesheet" type="text/css"> <script language="javascript" type="text/javascript">
$savingsHeader = ''; if ($showBalance) { $balanceHeader = '<th onclick="sortBalance();">Balance</th>'; } else { $savingsHeader = "<th style='text-align: right;' onclick='sortSaved();'>Saved</th> \n" . "\t\t<th style='text-align: right;' onclick='sortToSave();'>To Save</th>"; } $activeOnlyChecked = $activeOnly ? 'checked="checked"' : ''; $startDateText = $startDate->format('m/d/Y'); $endDateText = $endDate->format('m/d/Y'); // build account dropdowns: include inactive, and only show top 2 tiers $account_list = Account::Get_account_list($login_id, '', -1, false, false, true, true); // Add special Checking - Liabilities option $top_item_array = array(); $top_item_array[-99] = 'Checking - Credit Cards'; $account_list = $top_item_array + $account_list; $account_dropdown = Build_dropdown($account_list, 'account_id', $account_id); $minDate = $startDate; if ($showBalance) { // when showing balance, we need to go back to the beginning. $minDate = new DateTime('0001-01-01'); } // Build main data list $account_list = array(); // pass by reference if ($error == '') { if ($account_id == -99) { // special query for checking - liabilities $error = Account::Get_checking_and_liabilities($startDate, $endDate, $login_id, $account_list); } else { $error = Account::Get_account_details($account_id, $startDate, $endDate, $minDate, $activeOnly, $account_list); }
$sec_list = array('-1' => '--Select account--') + $sec_list; $sec_dropdown = Build_dropdown($sec_list, 'sec_account_id', $sec_account_id, 'select_account()'); $ter_list = Account::Get_account_list($_SESSION['login_id'], '', $sec_account_id, true); $ter_list = array('-1' => '--Select account--') + $ter_list; $ter_dropdown = Build_dropdown($ter_list, 'ter_account_id', $ter_account_id); // Build account_debit dropdown $debit_list = array('1' => 'Debit (assets, expenses)', '-1' => 'Credit (liabilities, income)'); $debit_dropdown = Build_dropdown($debit_list, 'account_debit', $account->get_account_debit()); // Build Equation side dropdown $side_list = array('L' => 'LHS (assets)', 'R' => 'RHS (revenue)'); $side_dropdown = Build_dropdown($side_list, 'equation_side', $account->get_equation_side()); // Savings account dropdown $savings_list = array(); $error = Account::Get_savings_accounts($_SESSION['login_id'], $savings_list); $savings_list = array('-1' => '--Select--') + $savings_list; $savings_dropdown = Build_dropdown($savings_list, 'savings_account_id', $account->get_savings_account_id()); // Active checkbox if ($account->get_active() == 1) { $active_txt = ' CHECKED'; } else { $active_txt = ''; } if ($account->get_is_paycheck_sink() == 1) { $is_paycheck_sink_txt = ' CHECKED'; } else { $is_paycheck_sink_txt = ''; } if ($account->get_is_savings() == 1) { $is_savings_txt = ' CHECKED'; } else { $is_savings_txt = '';
if ($fixed_login_id > -1 || $mode == 'select' && $login_id > -1) { // fixed login OR new login selected $login->Load_login($login_id); } // Build dropdowns $login_list = Login::Get_login_list(); $login_list = array('-1' => '--Select login--') + $login_list; $login_input = Build_dropdown($login_list, 'login_id', $login_id); $acc_list = Account::Get_account_list($login_id); $acc_list = array('-1' => '--Select Account--') + $acc_list; $defAcc_dropdown = Build_dropdown($acc_list, 'default_account_id', $login->get_default_account_id()); $summ1_dropdown = Build_dropdown($acc_list, 'default_summary1', $login->get_default_summary1()); $summ2_dropdown = Build_dropdown($acc_list, 'default_summary2', $login->get_default_summary2()); $car_dropdown = Build_dropdown($acc_list, 'car_account_id', $login->get_car_account_id()); $admin_list = array('0' => 'Normal user', '1' => 'Account manager', '2' => 'System manager'); $admin_input = Build_dropdown($admin_list, 'login_admin', $login->get_login_admin()); $active_input = '<input type="checkbox" name="active" value="1"'; if ($login->get_active() == 1) { $active_input .= ' CHECKED'; } $active_input .= '>'; if ($fixed_login_id > -1) { // replace dropdown with fixed text $login_input = $login->get_login_user() . ' (' . $login->get_display_name() . ') <input type="hidden" ' . 'name="login_id" value="' . $fixed_login_id . '">'; $admin_input = $login->get_login_admin(true) . '<input type="hidden" name="login_admin" value="' . $login->get_login_admin() . '">'; $active_input = $login->get_active(true) . ' <input type="hidden" name="active" value="' . $login->get_active() . '">'; } ?> <html>
$listR = $trans->get_ledgerR_list(); // create 5 rows of ledger adjustments (1 LHS column, 2 RHS columns) for ($i = 0; $i < 5; $i++) { // LHS $ledger = GetLedger($listL, $i); echo "\t<tr>\n" . ' <td><input type="hidden" name="ledgerL_id[]"' . " value='" . $ledger->ledgerId . "'> \n"; // Build account dropdown $acct_drop = Build_dropdown($acctL_list, 'accountL_id[]', $ledger->getAccountIdDebitString()); echo $acct_drop . "</td>\n" . "\t\t<td><input type='text' size='8' maxlength='10' " . "name='amountL[]' value='" . $ledger->amount . "'> </td> \n"; //RHS for ($j = 0; $j <= 1; $j++) { // Get the LedgerEntry at index i & i+5 $ledger = GetLedger($listR, $i + 5 * $j); echo "\t\t<td><input type='hidden' name='ledgerR_id[]'" . " value='" . $ledger->ledgerId . "'> \n"; // Build account dropdown $acct_drop = Build_dropdown($acctR_list, 'accountR_id[]', $ledger->getAccountIdDebitString()); echo $acct_drop . " </td>\n" . "\t\t<td><input type='text' size='8' maxlength='10' " . "name='amountR[]' value='" . $ledger->amount . "'></td> \n"; } echo "\t</tr> \n\n"; } ?> </table> <table style="float: left;"> <tr class="padded-row"> <td style="padding-left: 25px;"> </td> <td><input type="submit" name="save" value="Save transaction"></td> <?php if ($trans->get_trans_id() > -1) { // currently editing; show delete button echo '<td><input type="submit" name="delete" id="deleteButton" ' . "onClick=\"return confirmDelete()\" value=\"Delete transaction\" /></td>\n" . "<td><input type=\"submit\" value=\"Cancel\" name=\"cancel\" id=\"cancelButton\" /></td>\n" . "<td><input type=\"button\" id=\"copyButton\" value=\"Copy\" onclick=\"copyTransaction()\" /></td>\n";