From 2c94ba2bc9f3b332bceead3ad7bede2a9e979f25 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Mon, 18 Feb 2008 09:18:27 +0000 Subject: [PATCH] Added default bank account --- reporting/includes/reporting.inc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/reporting/includes/reporting.inc b/reporting/includes/reporting.inc index 183b5974..501afcc3 100644 --- a/reporting/includes/reporting.inc +++ b/reporting/includes/reporting.inc @@ -1,6 +1,6 @@ 0, // from - these values are updated in print_document_link() 'PARAM_1' => 0, // to 'PARAM_2' => "", // currency - 'PARAM_3' => "", // bank account + 'PARAM_3' => get_first_bank_account(), // bank account 'PARAM_4' => 0, // email 'PARAM_5' => 0, // quote 'PARAM_6' => ""); // comments @@ -36,7 +36,7 @@ function print_hidden_script($type_no) 'PARAM_0' => 0, // from - these values are updated in print_document_link() 'PARAM_1' => 0, // to 'PARAM_2' => "", // currency - 'PARAM_3' => "", // bank account + 'PARAM_3' => get_first_bank_account(), // bank account 'PARAM_4' => 0, // email 'PARAM_5' => "", // paylink 'PARAM_6' => ""); // comments @@ -47,7 +47,7 @@ function print_hidden_script($type_no) 'PARAM_0' => 0, // from - these values are updated in print_document_link() 'PARAM_1' => 0, // to 'PARAM_2' => "", // currency - 'PARAM_3' => "", // bank account + 'PARAM_3' => get_first_bank_account(), // bank account 'PARAM_4' => 0, // email 'PARAM_5' => ""); // comments break; @@ -86,4 +86,13 @@ function print_document_link($doc_no, $link_text, $link=true) else return "javascript:printDocument('$doc_no');"; } + +function get_first_bank_account() +{ + $sql = "SELECT ".TB_PREF."bank_accounts.account_code 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 -- 2.30.2