Merged changes form main trunk since 2.1RC
[fa-stable.git] / includes / data_checks.inc
index 0b94f9328723b49f80317879c8cfa5c2b919285d..95bcb2ca68e5c5f16f29417e63769a99232cec8e 100644 (file)
@@ -1,4 +1,14 @@
 <?php
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
 function db_has_customers()
 {
        return check_empty_result("SELECT COUNT(*) FROM ".TB_PREF."debtors_master");
@@ -375,6 +385,7 @@ function db_has_bank_accounts()
 function check_db_has_bank_accounts($msg)
 {
        global $path_to_root;
+
     if (!db_has_bank_accounts()) 
     {
        display_error($msg, true);
@@ -383,6 +394,12 @@ function check_db_has_bank_accounts($msg)
     }  
 }
 
+function db_has_cash_accounts()
+{
+       return check_empty_result("SELECT COUNT(*) FROM ".TB_PREF."bank_accounts
+               WHERE account_type=3");
+}
+
 function db_has_gl_accounts()
 {
        return check_empty_result("SELECT COUNT(*) FROM ".TB_PREF."chart_master");