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"), 'ptype' => _("Transfer")),
114 1=> array ('id' => 1, 'name' => _("Chequing Account"),'ptype' => _("Cheque")),
115 2=> array ('id' => 2, 'name' => _("Credit Account"), 'ptype' => _("Credit")),
116 3=> array ('id' => 3, 'name' => _("Cash Account"), 'ptype' => _("Cash"))
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'];
134 function transfer_type($index)
136 global $bank_account_types_array;
137 return $bank_account_types_array[$index]['ptype'];
140 //----------------------------------------------------------------------------------
142 include_once($path_to_root . "/manufacturing/includes/manufacturing_db.inc");
143 include_once($path_to_root . "/purchasing/includes/purchasing_db.inc");
144 include_once($path_to_root . "/sales/includes/sales_db.inc");
145 include_once($path_to_root . "/dimensions/includes/dimensions_db.inc");
147 $payment_person_types_array = array (
148 0=> array ('id' => 0, 'name' => _("Miscellaneous")),
149 1=> array ('id' => 1, 'name' => _("Work Order")),
150 2=> array ('id' => 2, 'name' => _("Customer")),
151 3=> array ('id' => 3, 'name' => _("Supplier")),
152 4=> array ('id' => 4, 'name' => _("Quick Entry"))
155 class payment_person_types
160 global $payment_person_types_array;
161 return $payment_person_types_array;
184 function QuickEntry()
194 function type_name($type)
196 global $payment_person_types_array;
197 return $payment_person_types_array[$type]['name'];
200 function person_name($type, $person_id, $full=true)
204 case payment_person_types::misc() :
206 case payment_person_types::QuickEntry() :
207 $qe = get_quick_entry($person_id);
208 return ($full?payment_person_types::type_name($type) . " ":"") . $qe["description"];
209 case payment_person_types::WorkOrder() :
210 $wo = get_work_order($person_id);
211 return ($full?payment_person_types::type_name($type) . " ":"") . $wo["wo_ref"];
212 case payment_person_types::customer() :
213 return ($full?payment_person_types::type_name($type) . " ":"") . get_customer_name($person_id);
214 case payment_person_types::supplier() :
215 return ($full?payment_person_types::type_name($type) . " ":"") . get_supplier_name($person_id);
217 //DisplayDBerror("Invalid type sent to person_name");
223 function person_currency($type, $person_id)
227 case payment_person_types::misc() :
228 case payment_person_types::QuickEntry() :
229 case payment_person_types::WorkOrder() :
230 return get_company_currency();
232 case payment_person_types::customer() :
233 return get_customer_currency($person_id);
235 case payment_person_types::supplier() :
236 return get_supplier_currency($person_id);
239 return get_company_currency();
243 function has_items($type)
247 case payment_person_types::misc() :
249 case payment_person_types::QuickEntry() :
250 return db_has_quick_entries();
251 case payment_person_types::WorkOrder() : // 070305 changed to open workorders JH
252 return db_has_open_workorders();
253 case payment_person_types::customer() :
254 return db_has_customers();
255 case payment_person_types::supplier() :
256 return db_has_suppliers();
258 display_db_error("Invalid type sent to has_items", "");
264 //----------------------------------------------------------------------------------
266 $wo_types_array = array (
267 0=> array ('id' => 0, 'name' => _("Assemble")),
268 1=> array ('id' => 1, 'name' => _("Unassemble")),
269 2=> array ('id' => 2, 'name' => _("Advanced Manufacture"))
280 function unassemble()
292 global $wo_types_array;
293 return $wo_types_array;;
296 function name($index)
298 global $wo_types_array;
299 return $wo_types_array[$index]['name'];
303 $quick_actions = array(
304 '=' => _('Remainder'), // post current base amount to GL account
305 '-' => _('Amount, reduce base'), // post amount to GL account and reduce base
306 '+' => _('Amount, increase base'), // post amount to GL account and increase base
307 '%' => _('% amount of base'), // store acc*amount% to GL account
308 '%+' => _('% amount of base, increase base'), // ditto & increase base amount
309 '%-' => _('% amount of base, reduce base'), // ditto & reduce base amount
310 'T' => _('Taxes added'), // post taxes calculated on base amount
311 'T+' => _('Taxes added, increase base'), // ditto & increase base amount
312 'T-' => _('Taxes added, reduce base'), // ditto & reduce base amount
313 't' => _('Taxes included'), // post taxes calculated on base amount
314 't+' => _('Taxes included, increase base'), // ditto & increase base amount
315 't-' => _('Taxes included, reduce base') // ditto & reduce base amount
318 define('QE_DEPOSIT', '1');
319 define('QE_PAYMENT', '2');
320 define('QE_JOURNAL', '3');
321 define('QE_SUPPINV', '4');
323 $quick_entry_types = array(
324 QE_DEPOSIT => _("Bank Deposit"),
325 QE_PAYMENT => _("Bank Payment"),
326 QE_JOURNAL => _("Journal Entry"),
327 QE_SUPPINV => _("Supplier Invoice/Credit")