<?php
/**********************************************************************
Copyright (C) FrontAccounting, LLC.
<?php
/**********************************************************************
Copyright (C) FrontAccounting, LLC.
- Released under the terms of the GNU Affero General Public License,
- AGPL, as published by the Free Software Foundation, either version
- 3 of the License, or (at your option) any later version.
+ Released under the terms of the GNU General Public License, GPL,
+ as published by the Free Software Foundation, either version 3
+ of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
update_bank_account($selected_id, $_POST['account_code'],
$_POST['account_type'], $_POST['bank_account_name'],
$_POST['bank_name'], $_POST['bank_account_number'],
update_bank_account($selected_id, $_POST['account_code'],
$_POST['account_type'], $_POST['bank_account_name'],
$_POST['bank_name'], $_POST['bank_account_number'],
- $_POST['bank_address'], $_POST['BankAccountCurrency']);
+ $_POST['bank_address'], $_POST['BankAccountCurrency'],
+ $_POST['dflt_curr_act']);
add_bank_account($_POST['account_code'], $_POST['account_type'],
$_POST['bank_account_name'], $_POST['bank_name'],
add_bank_account($_POST['account_code'], $_POST['account_type'],
$_POST['bank_account_name'], $_POST['bank_name'],
- $_POST['bank_account_number'], $_POST['bank_address'],
- $_POST['BankAccountCurrency']);
+ $_POST['bank_account_number'], $_POST['bank_address'],
+ $_POST['BankAccountCurrency'], $_POST['dflt_curr_act']);
$result = db_query($sql,"check failed");
$myrow = db_fetch_row($result);
if ($myrow[0] > 0)
$result = db_query($sql,"check failed");
$myrow = db_fetch_row($result);
if ($myrow[0] > 0)
$result = db_query($sql,"check failed");
$myrow = db_fetch_row($result);
if ($myrow[0] > 0)
$result = db_query($sql,"check failed");
$myrow = db_fetch_row($result);
if ($myrow[0] > 0)
$sql = "SELECT account.*, gl_account.account_name
FROM ".TB_PREF."bank_accounts account, ".TB_PREF."chart_master gl_account
$sql = "SELECT account.*, gl_account.account_name
FROM ".TB_PREF."bank_accounts account, ".TB_PREF."chart_master gl_account
- WHERE account.account_code = gl_account.account_code"
- ." ORDER BY account_code, bank_curr_code";
+ WHERE account.account_code = gl_account.account_code";
+if (!check_value('show_inactive')) $sql .= " AND !account.inactive";
+$sql .= " ORDER BY account_code, bank_curr_code";
start_table("$table_style width='80%'");
$th = array(_("Account Name"), _("Type"), _("Currency"), _("GL Account"),
start_table("$table_style width='80%'");
$th = array(_("Account Name"), _("Type"), _("Currency"), _("GL Account"),
- _("Bank"), _("Number"), _("Bank Address"),'','');
+ _("Bank"), _("Number"), _("Bank Address"), _("Dflt"), '','');
+inactive_control_column($th);
label_cell($myrow["bank_curr_code"], "nowrap");
label_cell($myrow["account_code"] . " " . $myrow["account_name"], "nowrap");
label_cell($myrow["bank_name"], "nowrap");
label_cell($myrow["bank_account_number"], "nowrap");
label_cell($myrow["bank_address"]);
label_cell($myrow["bank_curr_code"], "nowrap");
label_cell($myrow["account_code"] . " " . $myrow["account_name"], "nowrap");
label_cell($myrow["bank_name"], "nowrap");
label_cell($myrow["bank_account_number"], "nowrap");
label_cell($myrow["bank_address"]);
edit_button_cell("Edit".$myrow["id"], _("Edit"));
delete_button_cell("Delete".$myrow["id"], _("Delete"));
end_row();
}
edit_button_cell("Edit".$myrow["id"], _("Edit"));
delete_button_cell("Delete".$myrow["id"], _("Delete"));
end_row();
}
$_POST['bank_account_number'] = $myrow["bank_account_number"];
$_POST['bank_address'] = $myrow["bank_address"];
$_POST['BankAccountCurrency'] = $myrow["bank_curr_code"];
$_POST['bank_account_number'] = $myrow["bank_account_number"];
$_POST['bank_address'] = $myrow["bank_address"];
$_POST['BankAccountCurrency'] = $myrow["bank_curr_code"];
hidden('BankAccountCurrency', $_POST['BankAccountCurrency']);
set_focus('bank_account_name');
}
text_row(_("Bank Account Name:"), 'bank_account_name', null, 50, 100);
hidden('BankAccountCurrency', $_POST['BankAccountCurrency']);
set_focus('bank_account_name');
}
text_row(_("Bank Account Name:"), 'bank_account_name', null, 50, 100);
-bank_account_types_list_row(_("Account Type:"), 'account_type', null);
-
+if ($is_editing)
+{
+ label_row(_("Account Type:"), $bank_account_types[$_POST['account_type']]);
+}
+else
+{
+ bank_account_types_list_row(_("Account Type:"), 'account_type', null);
+}