+ if ($label != null)
+ echo "<td>$label</td>\n";
+ echo "<td>";
+
+ $items = $systypes_array;
+
+ // exclude quotes, orders and dimensions
+ foreach (array(ST_PURCHORDER, ST_SALESORDER, ST_DIMENSION, ST_SALESQUOTE, ST_LOCTRANSFER) as $excl)
+ unset($items[$excl]);
+
+ echo array_selector($name, $value, $items,
+ array(
+ 'spec_option'=> _("All"),
+ 'spec_id' => -1,
+ 'select_submit'=> $submit_on_change,
+ 'async' => false
+ )
+ );
+ echo "</td>\n";
+}
+
+function cust_allocations_list_cells($label, $name, $selected=null, $submit_on_change=false)
+{
+
+ if ($label != null)
+ label_cell($label);
+ echo "<td>\n";
+ $allocs = array(
+ ALL_TEXT=>_("All Types"),
+ '1'=> _("Sales Invoices"),
+ '2'=> _("Unsettled transactions"),
+ '3' => _("Payments"),
+ '4' => _("Credit Notes"),
+ '5' => _("Delivery Notes")
+ );
+ echo array_selector($name, $selected, $allocs, array('select_submit'=> $submit_on_change));
+ echo "</td>\n";
+}
+
+function supp_allocations_list_cell($name, $selected=null)
+{
+
+ echo "<td>\n";
+ $allocs = array(
+ ALL_TEXT=>_("All Types"),
+ '1'=> _("Invoices"),
+ '2'=> _("Overdue Invoices"),
+ '3' => _("Payments"),
+ '4' => _("Credit Notes"),
+ '5' => _("Overdue Credit Notes")
+ );
+ echo array_selector($name, $selected, $allocs);
+ echo "</td>\n";
+}
+
+function supp_transactions_list_cell($name, $selected=null, $submit_on_change=false)
+{
+
+ echo "<td>\n";
+ $allocs = array(
+ ALL_TEXT=>_("All Types"),
+ '6'=>_("GRNs"),
+ '1'=> _("Invoices"),
+ '2'=> _("Unsettled transactions"),
+ '3' => _("Payments"),
+ '4' => _("Credit Notes"),
+ '5' => _("Overdue Credit Notes")
+ );
+
+ echo array_selector($name, $selected, $allocs, array('select_submit'=> $submit_on_change));
+ echo "</td>\n";
+}
+
+function policy_list_cells($label, $name, $selected=null)
+{
+ if ($label != null)
+ label_cell($label);
+ echo "<td>\n";
+ echo array_selector($name, $selected,
+ array( '' => _("Automatically put balance on back order"),
+ 'CAN' => _("Cancel any quantites not delivered")) );
+ echo "</td>\n";
+}
+
+function policy_list_row($label, $name, $selected=null)
+{
+ echo "<tr><td class='label'>$label</td>";
+ policy_list_cells(null, $name, $selected);
+ echo "</tr>\n";
+}
+
+function credit_type_list_cells($label, $name, $selected=null, $submit_on_change=false)
+{
+ if ($label != null)
+ label_cell($label);
+ echo "<td>\n";
+ echo array_selector($name, $selected,
+ array( 'Return' => _("Items Returned to Inventory Location"),
+ 'WriteOff' => _("Items Written Off")),
+ array( 'select_submit'=> $submit_on_change ) );
+ echo "</td>\n";
+}
+
+function credit_type_list_row($label, $name, $selected=null, $submit_on_change=false)
+{
+ echo "<tr><td class='label'>$label</td>";
+ credit_type_list_cells(null, $name, $selected, $submit_on_change);
+ echo "</tr>\n";
+}
+
+function number_list($name, $selected, $from, $to, $no_option=false)
+{
+ $items = array();
+ for ($i = $from; $i <= $to; $i++)
+ $items[$i] = "$i";
+
+ return array_selector($name, $selected, $items,
+ array( 'spec_option' => $no_option,
+ 'spec_id' => ALL_NUMERIC) );
+}
+
+function number_list_cells($label, $name, $selected, $from, $to, $no_option=false)
+{
+ if ($label != null)
+ label_cell($label);
+ echo "<td>\n";
+ echo number_list($name, $selected, $from, $to, $no_option);
+ echo "</td>\n";
+}
+
+function number_list_row($label, $name, $selected, $from, $to, $no_option=false)
+{
+ echo "<tr><td class='label'>$label</td>";
+ echo number_list_cells(null, $name, $selected, $from, $to, $no_option);
+ echo "</tr>\n";
+}
+
+function print_profiles_list_row($label, $name, $selected_id=null, $spec_opt=false,
+ $submit_on_change=true)
+{
+ $sql = "SELECT profile FROM ".TB_PREF."print_profiles"
+ ." GROUP BY profile";
+ $result = db_query($sql, 'cannot get all profile names');
+ $profiles = array();
+ while($myrow=db_fetch($result)) {
+ $profiles[$myrow['profile']] = $myrow['profile'];
+ }
+
+ echo "<tr>";
+ if ($label != null)
+ echo "<td class='label'>$label</td>\n";
+ echo "<td>";
+
+ echo array_selector($name, $selected_id, $profiles,
+ array( 'select_submit'=> $submit_on_change,
+ 'spec_option'=>$spec_opt,
+ 'spec_id' => ''
+ ));
+
+ echo "</td></tr>\n";
+}
+
+function printers_list($name, $selected_id=null, $spec_opt=false, $submit_on_change=false)
+{
+ static $printers; // query only once for page display
+
+ if (!$printers) {
+ $sql = "SELECT id, name, description FROM ".TB_PREF."printers";
+ $result = db_query($sql, 'cannot get all printers');
+ $printers = array();
+ while($myrow=db_fetch($result)) {
+ $printers[$myrow['id']] = $myrow['name'].' - '.$myrow['description'];