From 28e7dac267b65d8163ca41c452c42706d0ffb2dd Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Fri, 18 Sep 2009 22:15:55 +0000 Subject: [PATCH] Added currency defualt bank accounts used in reporting instead of manually selected account. --- CHANGELOG.txt | 15 ++++++++ gl/includes/db/gl_db_bank_accounts.inc | 49 ++++++++++++++++++++++---- gl/manage/bank_accounts.php | 17 ++++++--- reporting/includes/reporting.inc | 45 +++++++++-------------- reporting/rep107.php | 14 ++++---- reporting/rep108.php | 12 +++---- reporting/rep109.php | 13 ++++--- reporting/rep111.php | 11 +++--- reporting/rep209.php | 11 +++--- reporting/reports_main.php | 5 --- sql/alter2.2.sql | 4 ++- sql/en_US-demo.sql | 5 +-- sql/en_US-new.sql | 5 +-- 13 files changed, 123 insertions(+), 83 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 939ca8dc..1473ecd3 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 diff --git a/gl/includes/db/gl_db_bank_accounts.inc b/gl/includes/db/gl_db_bank_accounts.inc index 53f3facf..dbc1e01a 100644 --- a/gl/includes/db/gl_db_bank_accounts.inc +++ b/gl/includes/db/gl_db_bank_accounts.inc @@ -10,27 +10,42 @@ See the License here . ***********************************************************************/ //--------------------------------------------------------------------------------------------- +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 diff --git a/gl/manage/bank_accounts.php b/gl/manage/bank_accounts.php index c70fc9e9..fb57c0f5 100644 --- a/gl/manage/bank_accounts.php +++ b/gl/manage/bank_accounts.php @@ -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 diff --git a/reporting/includes/reporting.inc b/reporting/includes/reporting.inc index e38ed6a2..12cffc11 100644 --- a/reporting/includes/reporting.inc +++ b/reporting/includes/reporting.inc @@ -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 "$pars[0]"; } -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 diff --git a/reporting/rep107.php b/reporting/rep107.php index 5a297da4..2c544944 100644 --- a/reporting/rep107.php +++ b/reporting/rep107.php @@ -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) diff --git a/reporting/rep108.php b/reporting/rep108.php index 156b5499..a85073a2 100644 --- a/reporting/rep108.php +++ b/reporting/rep108.php @@ -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) diff --git a/reporting/rep109.php b/reporting/rep109.php index 3fb0ad5a..07767415 100644 --- a/reporting/rep109.php +++ b/reporting/rep109.php @@ -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) { diff --git a/reporting/rep111.php b/reporting/rep111.php index cbf48a04..a16a1d7f 100644 --- a/reporting/rep111.php +++ b/reporting/rep111.php @@ -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) { diff --git a/reporting/rep209.php b/reporting/rep209.php index 7bd5c4ae..785420c9 100644 --- a/reporting/rep209.php +++ b/reporting/rep209.php @@ -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) { diff --git a/reporting/reports_main.php b/reporting/reports_main.php index 4c5deab5..8277d426 100644 --- a/reporting/reports_main.php +++ b/reporting/reports_main.php @@ -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'))); diff --git a/sql/alter2.2.sql b/sql/alter2.2.sql index 486b1f50..a4d70802 100644 --- a/sql/alter2.2.sql +++ b/sql/alter2.2.sql @@ -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`; diff --git a/sql/en_US-demo.sql b/sql/en_US-demo.sql index 85b699c4..ea83c552 100644 --- a/sql/en_US-demo.sql +++ b/sql/en_US-demo.sql @@ -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` ### diff --git a/sql/en_US-new.sql b/sql/en_US-new.sql index 43536d22..5deaf13b 100644 --- a/sql/en_US-new.sql +++ b/sql/en_US-new.sql @@ -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` ### -- 2.30.2