3 //----------------------------------------------------------------------------------
5 $systypes_array = array (
6 0=> array ('name' => _("Journal Entry")),
7 1=> array ('name' => _("Bank Payment")),
8 2=> array ('name' => _("Bank Deposit")),
9 4=> array ('name' => _("Funds Transfer")),
10 10=> array ('name' => _("Sales Invoice")),
11 11=> array ('name' => _("Customer Credit Note")),
12 12=> array ('name' => _("Customer Payment")),
13 13=> array ('name' => _("Delivery Note")),
14 16=> array ('name' => _("Location Transfer")),
15 17=> array ('name' => _("Inventory Adjustment")),
16 18=> array ('name' => _("Purchase Order")),
17 20=> array ('name' => _("Supplier Invoice")),
18 21=> array ('name' => _("Supplier Credit Note")),
19 22=> array ('name' => _("Supplier Payment")),
20 25=> array ('name' => _("Purchase Order Delivery")),
21 26=> array ('name' => _("Work Order")),
22 28=> array ('name' => _("Work Order Issue")),
23 29=> array ('name' => _("Work Order Production")),
24 30=> array ('name' => _("Sales Order")),
25 35=> array ('name' => _("Cost Update")),
26 40=> array ('name' => _("Dimension"))
31 function journal_entry()
36 function bank_payment()
41 function bank_deposit()
46 function bank_transfer()
51 function cust_payment()
56 function cust_dispatch()
61 function location_transfer()
66 function inventory_adjustment()
76 function supp_payment()
86 function sales_order()
91 function cost_update()
101 function name($index)
103 global $systypes_array;
106 return $systypes_array[$index]['name'];
110 //----------------------------------------------------------------------------------
112 $bank_account_types_array = array (
113 0=> array ('id' => 0, 'name' => _("Savings Account")),
114 1=> array ('id' => 1, 'name' => _("Chequing Account")),
115 2=> array ('id' => 2, 'name' => _("Credit Account")),
116 3=> array ('id' => 3, 'name' => _("Cash Account"))
119 class bank_account_types
124 global $bank_account_types_array;
125 return $bank_account_types_array;;
128 function name($index)
130 global $bank_account_types_array;
131 return $bank_account_types_array[$index]['name'];
135 //----------------------------------------------------------------------------------
137 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
138 include_once($path_to_root . "/purchasing/includes/purchasing_db.inc");
139 include_once($path_to_root . "/sales/includes/sales_db.inc");
140 include_once($path_to_root . "/dimensions/includes/dimensions_db.inc");
142 $payment_person_types_array = array (
143 0=> array ('id' => 0, 'name' => _("Miscellaneous")),
144 1=> array ('id' => 1, 'name' => _("Work Order")),
145 2=> array ('id' => 2, 'name' => _("Customer")),
146 3=> array ('id' => 3, 'name' => _("Supplier")),
149 class payment_person_types
154 global $payment_person_types_array;
155 return $payment_person_types_array;
183 //function Project() { return 4; }
185 function type_name($type)
187 global $payment_person_types_array;
188 return $payment_person_types_array[$type]['name'];
191 function person_name($type, $person_id, $full=true)
195 case payment_person_types::misc() :
197 case payment_person_types::WorkOrder() :
198 $wo = get_work_order($person_id);
199 return ($full?payment_person_types::type_name($type) . " ":"") . $wo["wo_ref"];
200 case payment_person_types::customer() :
201 return ($full?payment_person_types::type_name($type) . " ":"") . get_customer_name($person_id);
202 case payment_person_types::supplier() :
203 return ($full?payment_person_types::type_name($type) . " ":"") . get_supplier_name($person_id);
204 //case payment_person_types::Project() :
205 // return ($full?payment_person_types::type_name($type) . " ":"") . get_dimension_string($person_id);
207 //DisplayDBerror("Invalid type sent to person_name");
213 function person_currency($type, $person_id)
217 case payment_person_types::misc() :
218 case payment_person_types::WorkOrder() :
219 //case payment_person_types::Project() :
220 return get_company_currency();
222 case payment_person_types::customer() :
223 return get_customer_currency($person_id);
225 case payment_person_types::supplier() :
226 return get_supplier_currency($person_id);
229 return get_company_currency();
233 function has_items($type)
237 case payment_person_types::misc() :
239 case payment_person_types::WorkOrder() : // 070305 changed to open workorders ES
240 return db_has_open_workorders();
241 case payment_person_types::customer() :
242 return db_has_customers();
243 case payment_person_types::supplier() :
244 return db_has_suppliers();
245 //case payment_person_types::Project() :
246 // return db_has_dimensions();
248 display_db_error("Invalid type sent to has_items", "");
254 //----------------------------------------------------------------------------------
256 $wo_types_array = array (
257 0=> array ('id' => 0, 'name' => _("Assemble")),
258 1=> array ('id' => 1, 'name' => _("Unassemble")),
259 2=> array ('id' => 2, 'name' => _("Advanced Manufacture"))
270 function unassemble()
282 global $wo_types_array;
283 return $wo_types_array;;
286 function name($index)
288 global $wo_types_array;
289 return $wo_types_array[$index]['name'];