Added currency defualt bank accounts used in reporting instead of manually selected...
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 18 Sep 2009 22:15:55 +0000 (22:15 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Fri, 18 Sep 2009 22:15:55 +0000 (22:15 +0000)
13 files changed:
CHANGELOG.txt
gl/includes/db/gl_db_bank_accounts.inc
gl/manage/bank_accounts.php
reporting/includes/reporting.inc
reporting/rep107.php
reporting/rep108.php
reporting/rep109.php
reporting/rep111.php
reporting/rep209.php
reporting/reports_main.php
sql/alter2.2.sql
sql/en_US-demo.sql
sql/en_US-new.sql

index 939ca8dce20c3dc3f6d0941ae2a5f0fade1f37f3..1473ecd3b2098454808e4cc1a3f08af4a4be877f 100644 (file)
@@ -19,6 +19,21 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+18-Sep-2009 Janusz Dobrowolski
++ Added currency default bank accounts used in reporting instead of manual account selector.
+$ /gl/includes/db/gl_db_bank_accounts.inc
+  /gl/manage/bank_accounts.php
+  /reporting/rep107.php
+  /reporting/rep108.php
+  /reporting/rep109.php
+  /reporting/rep111.php
+  /reporting/rep209.php
+  /reporting/reports_main.php
+  /reporting/includes/reporting.inc
+  /sql/alter2.2.sql
+  /sql/en_US-demo.sql
+  /sql/en_US-new.sql
+
 17-Sep-2009 Joe Hunt
 + Added release note file for 2.2.
 $ /doc/2.2-Beta.txt
index 53f3facfbc9ba0c168ce77e455b75a772e94e096..dbc1e01afdc4c85c313269ef9ee791450d9f315e 100644 (file)
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
 //---------------------------------------------------------------------------------------------
+function clear_dflt_curr_account($curr_code) {
+         $sql = "UPDATE ".TB_PREF."bank_accounts SET dflt_curr_act=0 WHERE bank_curr_code="
+         .db_escape($curr_code);
+         db_query($sql, "could not update default currency account");
+}
 
-function add_bank_account($account_code, $account_type, $bank_account_name, $bank_name, $bank_account_number,
-       $bank_address, $bank_curr_code)
+function add_bank_account($account_code, $account_type, $bank_account_name,
+       $bank_name, $bank_account_number, $bank_address, $bank_curr_code, 
+       $dflt_curr_act)
 {
-       $sql = "INSERT INTO ".TB_PREF."bank_accounts (account_code, account_type, bank_account_name, bank_name, bank_account_number, bank_address, bank_curr_code)
+       if($dflt_curr_act)      // only one default account for any currency
+         clear_dflt_curr_account($bank_curr_code);
+
+       $sql = "INSERT INTO ".TB_PREF."bank_accounts (account_code, account_type, 
+               bank_account_name, bank_name, bank_account_number, bank_address, 
+               bank_curr_code, dflt_curr_act)
                VALUES (".db_escape($account_code).", $account_type, ".db_escape($bank_account_name).", ".db_escape($bank_name).", ".db_escape($bank_account_number).",
-               ".db_escape($bank_address).", '$bank_curr_code')";
+               ".db_escape($bank_address).", '$bank_curr_code', '$dflt_curr_act')";
 
        db_query($sql, "could not add a bank account for $account_code");
 }
 
 //---------------------------------------------------------------------------------------------
 
-function update_bank_account($id, $account_code, $account_type, $bank_account_name, $bank_name, $bank_account_number,
-       $bank_address, $bank_curr_code)
+function update_bank_account($id, $account_code, $account_type, $bank_account_name, 
+       $bank_name, $bank_account_number, $bank_address, $bank_curr_code, $dflt_curr_act)
 {
+       if($dflt_curr_act)      // only one default account for any currency
+         clear_dflt_curr_account($bank_curr_code);
+
        $sql = "UPDATE ".TB_PREF."bank_accounts SET account_type = $account_type,
                account_code=".db_escape($account_code).",
                bank_account_name=".db_escape($bank_account_name).", bank_name=".db_escape($bank_name).",
                bank_account_number=".db_escape($bank_account_number).", bank_curr_code='$bank_curr_code',
-               bank_address=".db_escape($bank_address)." WHERE id = '$id'";
+               bank_address=".db_escape($bank_address).","
+               ."dflt_curr_act='$dflt_curr_act' WHERE id = '$id'";
 
        db_query($sql, "could not update bank account for $account_code");
 }
@@ -200,4 +215,24 @@ function get_quick_entry_line($selected_id)
 
 //---------------------------------------------------------------------------------------------
 
+function get_default_bank_account($curr)
+{
+       /* default bank account is selected as first found account from:
+               . default account in $curr if any
+               . first defined account in $curr if any
+               . default account in home currency
+               . first defined account in home currency
+       */
+       $home_curr = get_company_pref('curr_default');
+
+       $sql = "SELECT b.*, b.bank_curr_code='$home_curr' as fall_back FROM "
+               .TB_PREF."bank_accounts b"
+               ." WHERE b.bank_curr_code=".db_escape($curr)
+               ." OR b.bank_curr_code='$home_curr'
+               ORDER BY fall_back, dflt_curr_act desc";
+
+       $result = db_query($sql, "could not retreive default bank account");
+
+       return db_fetch($result);
+}
 ?>
\ No newline at end of file
index c70fc9e9aa14059b2eb01496ce2ccecb1da118f1..fb57c0f527c0b08536c9ae712d8728a3a8dde381 100644 (file)
@@ -42,7 +42,8 @@ if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM')
                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']);
                        display_notification(_('Bank account has been updated'));
        } 
        else 
@@ -50,8 +51,8 @@ if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM')
     
                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']);
                        display_notification(_('New bank account has been added'));
        }
                $Mode = 'RESET';
@@ -112,7 +113,7 @@ start_form();
 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);
 table_header($th);     
 
@@ -129,6 +130,11 @@ while ($myrow = db_fetch($result))
     label_cell($myrow["bank_name"], "nowrap");
     label_cell($myrow["bank_account_number"], "nowrap");
     label_cell($myrow["bank_address"]);
+    if ($myrow["dflt_curr_act"])
+               label_cell(_("Yes"));
+       else
+               label_cell(_("No"));
+
        inactive_control_cell($myrow["id"], $myrow["inactive"], 'bank_accounts', 'id');
        edit_button_cell("Edit".$myrow["id"], _("Edit"));
        delete_button_cell("Delete".$myrow["id"], _("Delete"));
@@ -154,6 +160,7 @@ if ($is_editing)
        $_POST['bank_account_number'] = $myrow["bank_account_number"];
        $_POST['bank_address'] = $myrow["bank_address"];
        $_POST['BankAccountCurrency'] = $myrow["bank_curr_code"];
+       $_POST['dflt_curr_act'] = $myrow["dflt_curr_act"];
   }
        hidden('selected_id', $selected_id);
        hidden('account_code');
@@ -181,6 +188,8 @@ else
        currencies_list_row(_("Bank Account Currency:"), 'BankAccountCurrency', null);
 }      
 
+yesno_list_row(_("Default currency account:"), 'dflt_curr_act');
+
 if($is_editing)
        label_row(_("Bank Account GL Code:"), $_POST['account_code']);
 else 
index e38ed6a225119a276ea76359fa7bc65f1a4505b9..12cffc11e558cba7e6841b55e94f9d91dac973a8 100644 (file)
@@ -30,10 +30,9 @@ function print_document_link($doc_no, $link_text, $link=true, $type_no,
                        $ar = array(
                                'PARAM_0' => $doc_no, 
                                'PARAM_1' => $doc_no, 
-                               'PARAM_2' => "", 
-                               'PARAM_3' => get_first_bank_account(), 
-                               'PARAM_4' => $email, 
-                               'PARAM_5' => "");
+                               'PARAM_2' => '', 
+                               'PARAM_3' => $email, 
+                               'PARAM_4' => '');
                        break;
                case ST_SALESORDER :
                        $rep = 109;
@@ -41,11 +40,10 @@ function print_document_link($doc_no, $link_text, $link=true, $type_no,
                        $ar = array(
                                'PARAM_0' => $doc_no, 
                                'PARAM_1' => $doc_no, 
-                               'PARAM_2' => "", 
-                               'PARAM_3' => get_first_bank_account(), 
-                               'PARAM_4' => $email, 
-                               'PARAM_5' => 0, 
-                               'PARAM_6' => "");
+                               'PARAM_2' => '', 
+                               'PARAM_3' => $email, 
+                               'PARAM_4' => 0, 
+                               'PARAM_5' => '');
                        break;
                case ST_CUSTDELIVERY :
                        $rep = 110;
@@ -53,8 +51,7 @@ function print_document_link($doc_no, $link_text, $link=true, $type_no,
                        $ar = array(
                                'PARAM_0' => $doc_no, 
                                'PARAM_1' => $doc_no, 
-                               'PARAM_2' => $email, 
-                               'PARAM_3' => "");
+                               'PARAM_2' => $email);
                        break;
                case ST_SALESINVOICE : // Sales Invoice
                case ST_CUSTCREDIT : // Customer Credit Note
@@ -63,12 +60,11 @@ function print_document_link($doc_no, $link_text, $link=true, $type_no,
                        $ar = array(
                                'PARAM_0' => $doc_no, 
                                'PARAM_1' => $doc_no, 
-                               'PARAM_2' => "", 
-                               'PARAM_3' => get_first_bank_account(), 
-                               'PARAM_4' => $email, 
-                               'PARAM_5' => "",
-                               'PARAM_6' => "", 
-                               'PARAM_7' => $type_no);
+                               'PARAM_2' => '', 
+                               'PARAM_3' => $email, 
+                               'PARAM_4' => '',
+                               'PARAM_5' => '', 
+                               'PARAM_6' => $type_no);
                        break;
                case ST_PURCHORDER :
                        $rep = 209;
@@ -76,10 +72,9 @@ function print_document_link($doc_no, $link_text, $link=true, $type_no,
                        $ar = array(
                                'PARAM_0' => $doc_no, 
                                'PARAM_1' => $doc_no, 
-                               'PARAM_2' => "", 
-                               'PARAM_3' => get_first_bank_account(), 
-                               'PARAM_4' => $email, 
-                               'PARAM_5' => "");
+                               'PARAM_2' => '', 
+                               'PARAM_3' => $email, 
+                               'PARAM_4' => '');
                        break;
 //             default: $ar = array();
        }
@@ -113,12 +108,4 @@ function print_link($link_text, $rep, $pars = array(), $dir = '',
        return "<a target='_blank' href='$url'$id$class $pars[1]>$pars[0]</a>";
 }
 
-function get_first_bank_account()
-{
-       $sql = "SELECT ".TB_PREF."bank_accounts.id FROM ".TB_PREF."bank_accounts, ".TB_PREF."company
-               WHERE bank_curr_code=curr_default LIMIT 0, 1";
-       $result = db_query($sql);
-       $row = db_fetch_row($result);
-       return $row[0];
-}
 ?>
\ No newline at end of file
index 5a297da48397a835a716bef6892478bcb0c22c44..2c5449445d86c2ff2c102b48c4138da13a92fafb 100644 (file)
@@ -39,10 +39,9 @@ function print_invoices()
        $from = $_POST['PARAM_0'];
        $to = $_POST['PARAM_1'];
        $currency = $_POST['PARAM_2'];
-       $bankaccount = $_POST['PARAM_3'];
-       $email = $_POST['PARAM_4'];
-       $paylink = $_POST['PARAM_5'];
-       $comments = $_POST['PARAM_6'];
+       $email = $_POST['PARAM_3'];
+       $paylink = $_POST['PARAM_4'];
+       $comments = $_POST['PARAM_5'];
 
        if ($from == null)
                $from = 0;
@@ -58,10 +57,8 @@ function print_invoices()
        // $headers in doctext.inc
        $aligns = array('left', 'left', 'right', 'left', 'right', 'right', 'right');
 
-       $params = array('comments' => $comments,
-                                       'bankaccount' => $bankaccount);
+       $params = array('comments' => $comments);
 
-       $baccount = get_bank_account($params['bankaccount']);
        $cur = get_company_Pref('curr_default');
 
        if ($email == 0)
@@ -82,6 +79,9 @@ function print_invoices()
                                continue;
                        $sign = $j==ST_SALESINVOICE ? 1 : -1;
                        $myrow = get_customer_trans($i, $j);
+                       $baccount = get_default_bank_account($myrow['curr_code']);
+                       $params['bankaccount'] = $baccount['id'];
+
                        $branch = get_branch($myrow["branch_code"]);
                        $branch['disable_branch'] = $paylink; // helper
                        if ($j == ST_SALESINVOICE)
index 156b5499455f322e1be81b4535144837931676d4..a85073a2388d5653a895a73ffd07434566186415 100644 (file)
@@ -54,9 +54,8 @@ function print_statements()
 
        $customer = $_POST['PARAM_0'];
        $currency = $_POST['PARAM_1'];
-       $bankaccount = $_POST['PARAM_2'];
-       $email = $_POST['PARAM_3'];
-       $comments = $_POST['PARAM_4'];
+       $email = $_POST['PARAM_2'];
+       $comments = $_POST['PARAM_3'];
 
        $dec = user_price_dec();
 
@@ -66,10 +65,7 @@ function print_statements()
 
        $aligns = array('left', 'left', 'left', 'left', 'right', 'right', 'right', 'right');
 
-       $params = array('comments' => $comments,
-                                       'bankaccount' => $bankaccount);
-
-       $baccount = get_bank_account($params['bankaccount']);
+       $params = array('comments' => $comments);
 
        $cur = get_company_pref('curr_default');
        $PastDueDays1 = get_company_pref('past_due_days');
@@ -97,6 +93,8 @@ function print_statements()
                $myrow['order_'] = "";
 
                $TransResult = getTransactions($myrow['debtor_no'], $date);
+               $baccount = get_default_bank_account($myrow['curr_code']);
+               $params['bankaccount'] = $baccount['id'];
                if (db_num_rows($TransResult) == 0)
                        continue;
                if ($email == 1)
index 3fb0ad5af0dd413c0b4aef88e9e6603bb22c7e83..07767415b169910e4c1e53a4314ed2a3efd38805 100644 (file)
@@ -39,10 +39,9 @@ function print_sales_orders()
        $from = $_POST['PARAM_0'];
        $to = $_POST['PARAM_1'];
        $currency = $_POST['PARAM_2'];
-       $bankaccount = $_POST['PARAM_3'];
-       $email = $_POST['PARAM_4'];
-       $print_as_quote = $_POST['PARAM_5'];
-       $comments = $_POST['PARAM_6'];
+       $email = $_POST['PARAM_3'];
+       $print_as_quote = $_POST['PARAM_4'];
+       $comments = $_POST['PARAM_5'];
 
        if ($from == null)
                $from = 0;
@@ -55,10 +54,8 @@ function print_sales_orders()
        // $headers in doctext.inc
        $aligns = array('left', 'left', 'right', 'left', 'right', 'right', 'right');
 
-       $params = array('comments' => $comments,
-                                       'bankaccount' => $bankaccount);
+       $params = array('comments' => $comments);
 
-       $baccount = get_bank_account($params['bankaccount']);
        $cur = get_company_Pref('curr_default');
 
        if ($email == 0)
@@ -75,6 +72,8 @@ function print_sales_orders()
        for ($i = $from; $i <= $to; $i++)
        {
                $myrow = get_sales_order_header($i, ST_SALESORDER);
+               $baccount = get_default_bank_account($myrow['curr_code']);
+               $params['bankaccount'] = $baccount['id'];
                $branch = get_branch($myrow["branch_code"]);
                if ($email == 1)
                {
index cbf48a04f68f03f6bf4e91bf6b1ba3a481af8c9e..a16a1d7fc0efd7fc7e23657804b90aa9542453f1 100644 (file)
@@ -37,9 +37,8 @@ function print_sales_quotations()
        $from = $_POST['PARAM_0'];
        $to = $_POST['PARAM_1'];
        $currency = $_POST['PARAM_2'];
-       $bankaccount = $_POST['PARAM_3'];
-       $email = $_POST['PARAM_4'];
-       $comments = $_POST['PARAM_5'];
+       $email = $_POST['PARAM_3'];
+       $comments = $_POST['PARAM_4'];
 
        if ($from == null)
                $from = 0;
@@ -52,10 +51,8 @@ function print_sales_quotations()
        // $headers in doctext.inc
        $aligns = array('left', 'left', 'right', 'left', 'right', 'right', 'right');
 
-       $params = array('comments' => $comments,
-                                       'bankaccount' => $bankaccount);
+       $params = array('comments' => $comments);
 
-       $baccount = get_bank_account($params['bankaccount']);
        $cur = get_company_Pref('curr_default');
 
        if ($email == 0)
@@ -69,6 +66,8 @@ function print_sales_quotations()
        for ($i = $from; $i <= $to; $i++)
        {
                $myrow = get_sales_order_header($i, ST_SALESQUOTE);
+               $baccount = get_default_bank_account($myrow['curr_code']);
+               $params['bankaccount'] = $baccount['id'];
                $branch = get_branch($myrow["branch_code"]);
                if ($email == 1)
                {
index 7bd5c4ae1cbe5635ca880bc5ba12e474529d15b1..785420c9218cd7223133f931bf517b139942c0b8 100644 (file)
@@ -62,9 +62,8 @@ function print_po()
        $from = $_POST['PARAM_0'];
        $to = $_POST['PARAM_1'];
        $currency = $_POST['PARAM_2'];
-       $bankaccount = $_POST['PARAM_3'];
-       $email = $_POST['PARAM_4'];
-       $comments = $_POST['PARAM_5'];
+       $email = $_POST['PARAM_3'];
+       $comments = $_POST['PARAM_4'];
 
        if ($from == null)
                $from = 0;
@@ -77,10 +76,8 @@ function print_po()
        // $headers in doctext.inc
        $aligns = array('left', 'left', 'left', 'right', 'left', 'right', 'right');
 
-       $params = array('comments' => $comments,
-                                       'bankaccount' => $bankaccount);
+       $params = array('comments' => $comments);
 
-       $baccount = get_bank_account($params['bankaccount']);
        $cur = get_company_Pref('curr_default');
 
        if ($email == 0)
@@ -94,6 +91,8 @@ function print_po()
        for ($i = $from; $i <= $to; $i++)
        {
                $myrow = get_po($i);
+               $baccount = get_default_bank_account($myrow['curr_code']);
+               $params['bankaccount'] = $baccount['id'];
 
                if ($email == 1)
                {
index 4c5deab50382da37952f1fa9c55d5092b7a77b3d..8277d42651a29f3e522c8db63b00c253896d367d 100644 (file)
@@ -76,7 +76,6 @@ $reports->addReport(_('Customer'),107,_('Print &Invoices/Credit Notes'),
        array(  new ReportParam(_('From'),'INVOICE'),
                        new ReportParam(_('To'),'INVOICE'),
                        new ReportParam(_('Currency Filter'),'CURRENCY'),
-                       new ReportParam(_('Bank Account'),'BANK_ACCOUNTS'),
                        new ReportParam(_('email Customers'),'YES_NO'),
                        new ReportParam(_('Payment Link'),'PAYMENT_LINK'),
                        new ReportParam(_('Comments'),'TEXTBOX')));
@@ -88,14 +87,12 @@ $reports->addReport(_('Customer'),110,_('Print &Deliveries'),
 $reports->addReport(_('Customer'),108,_('Print &Statements'),
        array(  new ReportParam(_('Customer'),'CUSTOMERS_NO_FILTER'),
                        new ReportParam(_('Currency Filter'),'CURRENCY'),
-                       new ReportParam(_('Bank Account'),'BANK_ACCOUNTS'),
                        new ReportParam(_('Email Customers'),'YES_NO'),
                        new ReportParam(_('Comments'),'TEXTBOX')));
 $reports->addReport(_('Customer'),109,_('&Print Sales Orders'),
        array(  new ReportParam(_('From'),'ORDERS'),
                        new ReportParam(_('To'),'ORDERS'),
                        new ReportParam(_('Currency Filter'),'CURRENCY'),
-                       new ReportParam(_('Bank Account'),'BANK_ACCOUNTS'),
                        new ReportParam(_('Email Customers'),'YES_NO'),
                        new ReportParam(_('Print as Quote'),'YES_NO'),
                        new ReportParam(_('Comments'),'TEXTBOX')));
@@ -103,7 +100,6 @@ $reports->addReport(_('Customer'),111,_('&Print Sales Quotations'),
        array(  new ReportParam(_('From'),'QUOTATIONS'),
                        new ReportParam(_('To'),'QUOTATIONS'),
                        new ReportParam(_('Currency Filter'),'CURRENCY'),
-                       new ReportParam(_('Bank Account'),'BANK_ACCOUNTS'),
                        new ReportParam(_('Email Customers'),'YES_NO'),
                        new ReportParam(_('Comments'),'TEXTBOX')));
 
@@ -137,7 +133,6 @@ $reports->addReport(_('Supplier'),209,_('Print Purchase &Orders'),
        array(  new ReportParam(_('From'),'PO'),
                        new ReportParam(_('To'),'PO'),
                        new ReportParam(_('Currency Filter'),'CURRENCY'),
-                       new ReportParam(_('Bank Account'),'BANK_ACCOUNTS'),
                        new ReportParam(_('Email Customers'),'YES_NO'),
                        new ReportParam(_('Comments'),'TEXTBOX')));
 
index 486b1f50d758bb91d747662262a3231ad302aff5..a4d70802123690d67dcd34bb1c13a1f8c1153740 100644 (file)
@@ -105,4 +105,6 @@ ALTER TABLE `0_sales_orders` ADD COLUMN `reference` varchar(100) NOT NULL DEFAUL
 ALTER TABLE `0_sales_orders` DROP PRIMARY KEY;
 ALTER TABLE `0_sales_orders` ADD PRIMARY KEY ( `trans_type` , `order_no` ); 
 UPDATE `0_sales_orders`        SET `reference`=`order_no` WHERE 1;
-INSERT INTO `0_sys_types` (`type_id`, `type_no`, `next_reference`) VALUES (32, 0, '1');
\ No newline at end of file
+INSERT INTO `0_sys_types` (`type_id`, `type_no`, `next_reference`) VALUES (32, 0, '1');
+
+ALTER TABLE `0_bank_accounts` ADD COLUMN `dflt_curr_act` TINYINT(1) NOT NULL default '0' AFTER `bank_curr_code`;
index 85b699c4fa1cd9fc3f0c028c300701c35ebf7524..ea83c5522009069bac4de1cfa3a179ed885a5006 100644 (file)
@@ -80,6 +80,7 @@ CREATE TABLE `0_bank_accounts` (
   `bank_name` varchar(60) NOT NULL default '',
   `bank_address` tinytext,
   `bank_curr_code` char(3) NOT NULL default '',
+  `dflt_curr_act` TINYINT(1) NOT NULL default '0',
   `id` smallint(6) NOT NULL auto_increment,
   `last_reconciled_date` timestamp NOT NULL default '0000-00-00 00:00:00',
   `ending_reconcile_balance` double NOT NULL default '0',
@@ -92,8 +93,8 @@ CREATE TABLE `0_bank_accounts` (
 
 ### Data of table `0_bank_accounts` ###
 
-INSERT INTO `0_bank_accounts` VALUES ('1060', '0', 'Current account', '9999999999', 'Wachovia Bank', '', 'USD', '1', '0000-00-00 00:00:00', '0', '0');
-INSERT INTO `0_bank_accounts` VALUES ('1065', '3', 'Petty Cash account', 'N/A', 'N/A', '', 'USD', '2', '0000-00-00 00:00:00', '0', '0');
+INSERT INTO `0_bank_accounts` VALUES ('1060', '0', 'Current account', '9999999999', 'Wachovia Bank', '', 'USD', '1', '1', '0000-00-00 00:00:00', '0', '0');
+INSERT INTO `0_bank_accounts` VALUES ('1065', '3', 'Petty Cash account', 'N/A', 'N/A', '', 'USD', '0', '2', '0000-00-00 00:00:00', '0', '0');
 
 
 ### Structure of table `0_bank_trans` ###
index 43536d227a4b1b71a2fb93db9122b9a1b2db9c5a..5deaf13b46c5c2889e7dd6ce8d6aeccb2395fa9f 100644 (file)
@@ -77,6 +77,7 @@ CREATE TABLE `0_bank_accounts` (
   `bank_name` varchar(60) NOT NULL default '',
   `bank_address` tinytext,
   `bank_curr_code` char(3) NOT NULL default '',
+  `dflt_curr_act` TINYINT(1) NOT NULL default '0',
   `id` smallint(6) NOT NULL auto_increment,
   `last_reconciled_date` timestamp NOT NULL default '0000-00-00 00:00:00',
   `ending_reconcile_balance` double NOT NULL default '0',
@@ -89,8 +90,8 @@ CREATE TABLE `0_bank_accounts` (
 
 ### Data of table `0_bank_accounts` ###
 
-INSERT INTO `0_bank_accounts` VALUES ('1060', '0', 'Current account', 'N/A', 'N/A', '', 'USD', '1', '0000-00-00 00:00:00', '0', '0');
-INSERT INTO `0_bank_accounts` VALUES ('1065', '3', 'Petty Cash account', 'N/A', 'N/A', '', 'USD', '2', '0000-00-00 00:00:00', '0', '0');
+INSERT INTO `0_bank_accounts` VALUES ('1060', '0', 'Current account', 'N/A', 'N/A', '', 'USD', '1', '1', '0000-00-00 00:00:00', '0', '0');
+INSERT INTO `0_bank_accounts` VALUES ('1065', '3', 'Petty Cash account', 'N/A', 'N/A', '', 'USD', '0', '2', '0000-00-00 00:00:00', '0', '0');
 
 
 ### Structure of table `0_bank_trans` ###