X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=gl%2Fincludes%2Fgl_db.inc;h=7a9c49002b7198914918fa9ab7dbf90b166fdddb;hb=4deaa6ba6e084655989c30cfb7d9dd307408c7dc;hp=8f6efddd58f05661d0a3771c1f94bab4bd9311e9;hpb=d567a10b7925c8bb97c734e213d6651a979af29d;p=fa-stable.git diff --git a/gl/includes/gl_db.inc b/gl/includes/gl_db.inc index 8f6efddd..7a9c4900 100644 --- a/gl/includes/gl_db.inc +++ b/gl/includes/gl_db.inc @@ -12,6 +12,7 @@ include_once($path_to_root . "/includes/banking.inc"); include_once($path_to_root . "/gl/includes/db/gl_db_trans.inc"); +include_once($path_to_root . "/gl/includes/db/gl_journal.inc"); include_once($path_to_root . "/gl/includes/db/gl_db_bank_trans.inc"); include_once($path_to_root . "/gl/includes/db/gl_db_banking.inc"); include_once($path_to_root . "/gl/includes/db/gl_db_bank_accounts.inc"); @@ -20,4 +21,23 @@ include_once($path_to_root . "/gl/includes/db/gl_db_rates.inc"); include_once($path_to_root . "/gl/includes/db/gl_db_accounts.inc"); include_once($path_to_root . "/gl/includes/db/gl_db_account_types.inc"); //-------------------------------------------------------------------------------- -?> \ No newline at end of file + +function add_budget($account, $dim1, $dim2, $amounts) +{ + begin_transaction(__FUNCTION__, func_get_args()); + + foreach($amounts as $date => $amount) { + add_update_gl_budget_trans($date, $account, $dim1, $dim2, $amount); + } + commit_transaction(); +} + +function delete_budget($account, $dim1, $dim2, $dates) +{ + begin_transaction(__FUNCTION__, func_get_args()); + + foreach($amounts as $date) { + delete_gl_budget_trans($date, $account, $dim1, $dim2); + } + commit_transaction(); +}