X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Ftypes.inc;h=8bf64e97ae9804f4eb9ab1ac6b6ebe68944ad435;hb=ce937cf5d1c30aea446c8b5e530ace8e1bd7457c;hp=38c3101b39009e04d9247cf99647ce98abe25059;hpb=3dc709543cc713810811d269a8b2ce035146a559;p=fa-stable.git diff --git a/includes/types.inc b/includes/types.inc index 38c3101b..8bf64e97 100644 --- a/includes/types.inc +++ b/includes/types.inc @@ -309,6 +309,31 @@ class wo_types } } +define('CL_NONE', 0); // for backward compatibility +define('CL_ASSETS', 1); +define('CL_LIABILITIES', 2); +define('CL_EQUITY', 3); +define('CL_INCOME', 4); +define('CL_COGS', 5); +define('CL_EXPENSE', 6); + +$class_types = array( + CL_ASSETS => _("Assets"), + CL_LIABILITIES => _("Liabilities"), + CL_EQUITY => _("Equity"), + CL_INCOME => _("Income"), + CL_COGS => _("Cost of Goods Sold"), + CL_EXPENSE => _("Expense"), +); + +function get_class_type_convert($ctype) +{ + global $use_oldstyle_convert; + if (isset($use_oldstyle_convert) && $use_oldstyle_convert == 1) + return (($ctype >= CL_INCOME || $ctype == CL_NONE) ? -1 : 1); + else + return ((($ctype >= CL_LIABILITIES && $ctype <= CL_INCOME) || $ctype == CL_NONE) ? -1 : 1); +} define('WO_LABOUR', 0); define('WO_OVERHEAD', 1);