Removed obsolete complete parameter.
[fa-stable.git] / includes / types.inc
index 352ddcc5e60ea4af6cd2b76ddaaed03b0e4d8d0f..35ed2d84a0e5fa68a9fafbb34fb0d16d74553f68 100644 (file)
@@ -47,6 +47,31 @@ define('ST_DIMENSION', 40);
 define ('ST_STATEMENT', 91);
 define ('ST_CHEQUE', 92);
 
+// document inheritance
+$document_child_types = array(
+               ST_SALESQUOTE => ST_SALESORDER,
+               ST_SALESORDER => ST_CUSTDELIVERY,
+               ST_CUSTDELIVERY => ST_SALESINVOICE,
+               ST_SALESINVOICE => ST_CUSTCREDIT,
+
+               ST_PURCHORDER => ST_SUPPRECEIVE,
+               ST_SUPPRECEIVE => ST_SUPPINVOICE,
+               ST_SUPPINVOICE => ST_SUPPCREDIT,
+);
+
+function get_child_type($type)
+{
+       global $document_child_types;
+       return isset($document_child_types[$type]) ? $document_child_types[$type] : 0;
+}
+
+function get_parent_type($type)
+{
+       global $document_child_types;
+       $child = array_search($type, $document_child_types);
+       return $child ? $child : 0;
+}
+
 //----------------------------------------------------------------------------------
 //             Bank transaction types
 //
@@ -176,6 +201,12 @@ define('ANY_NUMERIC', -1);
 define('ALL_TEXT', '');
 define('ALL_NUMERIC', -1);
 
+//----------------------------------------------------------------------------------
+// Special class values for tables (start_table())
+define('TABLESTYLE',  1);
+define('TABLESTYLE2', 2);
+define('TABLESTYLE_NOBORDER', 3);
+
 //----------------------------------------------------------------------------------
 
 define('TAG_ACCOUNT',   1);