}
text_row_ex(_("Category Short Name:"), 'name', 30);
-textarea_row(_("Category Description:"), 'description', null, 60,4);
+textarea_row(_("Category Description:"), 'description', null, 60, 4);
end_table(1);
hidden ('months');
}
refline_list_row(_("Reference line:"), 'refline', ST_JOURNAL, null, false, true);
- textarea_row(_("Memo:"), 'memo_', null, 40,4);
+ textarea_row(_("Memo:"), 'memo_', null, 40, 4);
end_table(1);
//-----------------------------------------------------------------------------------
-function textarea_cells($label, $name, $value, $cols, $rows, $title = null, $params="")
+function textarea_cells($label, $name, $value, $cols, $rows, $max=255, $title = null, $params="")
{
global $Ajax;
$value = (!isset($_POST[$name]) ? "" : $_POST[$name]);
echo "<td><textarea name='$name' cols='$cols' rows='$rows'"
.($title ? " title='$title'" : '')
+ .($max ? " maxlength=$max" : '')
.">$value</textarea></td>\n";
$Ajax->addUpdate($name, $name, $value);
}
-function textarea_row($label, $name, $value, $cols, $rows, $title=null, $params="")
+function textarea_row($label, $name, $value, $cols, $rows, $max=255, $title=null, $params="")
{
echo "<tr><td class='label'>$label</td>";
- textarea_cells(null, $name, $value, $cols, $rows, $title, $params);
+ textarea_cells(null, $name, $value, $cols, $rows, $max, $title, $params);
echo "</tr>\n";
}
yesno_list_row(_("Type:"), 'IssueType', $_POST['IssueType'],
_("Return Items to Location"), _("Issue Items to Work order"));
- textarea_row(_("Memo"), 'memo_', null, 50, 3);
+ textarea_row(_("Memo"), 'memo_', null, 50, 3, 40); // stock move reference is 40 max
end_table(1);
}
$Ajax->activate('req_del_date');
$Ajax->activate('line_total');
}
- $item_info = get_item_edit_info($_POST['stock_id']);
- $_POST['units'] = $item_info["units"];
- $dec = $item_info["decimals"];
+ $dec = 0; $_POST['units'] = '';
+ $item_info = get_item_edit_info($_POST['stock_id']);
+ if ($item_info) {
+ $_POST['units'] = $item_info["units"];
+ $dec = $item_info["decimals"];
+ }
$_POST['qty'] = number_format2(get_purchase_conversion_factor ($order->supplier_id, $_POST['stock_id']), $dec);
$_POST['price'] = price_decimal_format(get_purchase_price ($order->supplier_id, $_POST['stock_id']), $dec2);
if ($order->trans_type == ST_PURCHORDER)
text_row(_("Deliver To:"), 'deliver_to', $order->deliver_to, 50, 60,
_('Additional identifier for delivery e.g. name of receiving person'));
- textarea_row(_("Address:"), 'delivery_address', $order->delivery_address, 35, 5,
+ textarea_row(_("Address:"), 'delivery_address', $order->delivery_address, 35, 5, 255,
_('Delivery address. Default is address of customer branch'));
table_section(2);