Customer Payment, Supplier Payment: early discount support.
[fa-stable.git] / gl / includes / gl_db.inc
index 2577ecc381b7523636d2cca2575888f94a2858d9..7a9c49002b7198914918fa9ab7dbf90b166fdddb 100644 (file)
@@ -21,3 +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");
 //--------------------------------------------------------------------------------
+
+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();
+}