Old ineffective sql_trail superseded by new improved db_trail logging only calls...
[fa-stable.git] / gl / includes / gl_db.inc
1 <?php
2 /**********************************************************************
3     Copyright (C) FrontAccounting, LLC.
4         Released under the terms of the GNU General Public License, GPL, 
5         as published by the Free Software Foundation, either version 3 
6         of the License, or (at your option) any later version.
7     This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
10     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
12 include_once($path_to_root . "/includes/banking.inc");
13
14 include_once($path_to_root . "/gl/includes/db/gl_db_trans.inc");
15 include_once($path_to_root . "/gl/includes/db/gl_journal.inc");
16 include_once($path_to_root . "/gl/includes/db/gl_db_bank_trans.inc");
17 include_once($path_to_root . "/gl/includes/db/gl_db_banking.inc");
18 include_once($path_to_root . "/gl/includes/db/gl_db_bank_accounts.inc");
19 include_once($path_to_root . "/gl/includes/db/gl_db_currencies.inc");
20 include_once($path_to_root . "/gl/includes/db/gl_db_rates.inc");
21 include_once($path_to_root . "/gl/includes/db/gl_db_accounts.inc");
22 include_once($path_to_root . "/gl/includes/db/gl_db_account_types.inc");
23 //--------------------------------------------------------------------------------
24
25 function add_budget($account, $dim1, $dim2, $amounts)
26 {
27         begin_transaction(__FUNCTION__, func_get_args());
28
29         foreach($amounts as $date => $amount) {
30                 add_update_gl_budget_trans($date, $account, $dim1, $dim2, $amount);
31         }
32         commit_transaction();
33 }
34
35 function delete_budget($account, $dim1, $dim2, $dates)
36 {
37         begin_transaction(__FUNCTION__, func_get_args());
38
39         foreach($amounts as $date) {
40                 delete_gl_budget_trans($date, $account, $dim1, $dim2);
41         }
42         commit_transaction();
43 }