include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/ui.inc");
+include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/admin/db/company_db.inc");
function amount_cell($label, $bold=false)
{
if ($bold)
- label_cell("<b>".number_format2($label,user_price_dec())."</b>", "nowrap align=right");
+ label_cell("<b>".price_format($label)."</b>", "nowrap align=right");
else
- label_cell(number_format2($label,user_price_dec()), "nowrap align=right");
+ label_cell(price_format($label), "nowrap align=right");
}
function percent_cell($label, $bold=false)
{
if ($bold)
- label_cell("<b>".number_format2($label,user_percent_dec())."</b>", "nowrap align=right");
+ label_cell("<b>".percent_format($label)."</b>", "nowrap align=right");
else
- label_cell(number_format2($label,user_percent_dec()), "nowrap align=right");
+ label_cell(percent_format($label), "nowrap align=right");
}
-function qty_cell($label, $bold=false)
+function qty_cell($label, $bold=false, $dec=null)
{
if ($bold)
- label_cell("<b>".number_format2($label,user_qty_dec())."</b>", "nowrap align=right");
+ label_cell("<b>".qty_format($label, $dec)."</b>", "nowrap align=right");
else
- label_cell(number_format2($label,user_qty_dec()), "nowrap align=right");
+ label_cell(qty_format($label, $dec), "nowrap align=right");
}
function label_cells($label, $value, $params="", $params2="")
$_POST[$name] = $init== null ? '' : $init;
}
- small_amount_row($label, $name, $_POST[$name], null, "%");
+ small_amount_row($label, $name, $_POST[$name], null, "%", user_percent_dec());
}
-function amount_cells_ex($label, $name, $size, $max=null, $init=null, $params=null, $post_label=null)
+function amount_cells_ex($label, $name, $size, $max=null, $init=null, $params=null, $post_label=null, $dec=null)
{
+ if (!isset($dec))
+ $dec = user_price_dec();
if (!isset($_POST[$name]) || $_POST[$name] == "")
{
if ($init)
echo "<td>";
- echo "<input class='amount' type=\"text\" name=\"$name\" size=\"$size\" maxlength=\"$max\" value=\"" . $_POST[$name]. "\">";
+ echo "<input class='amount' type=\"text\" name=\"$name\" size=\"$size\" maxlength=\"$max\" dec=\"$dec\" value=\"" . $_POST[$name]. "\">";
if ($post_label)
echo " " . $post_label;
//-----------------------------------------------------------------------------------
-function amount_cells($label, $name, $init=null, $params=null, $post_label=null)
+function amount_cells($label, $name, $init=null, $params=null, $post_label=null, $dec=null)
{
- amount_cells_ex($label, $name, 15, 15, $init, $params, $post_label);
+ amount_cells_ex($label, $name, 15, 15, $init, $params, $post_label, $dec);
}
-function amount_row($label, $name, $init=null, $params=null, $post_label=null)
+function amount_row($label, $name, $init=null, $params=null, $post_label=null, $dec=null)
{
echo "<tr>";
- amount_cells($label, $name, $init, $params, $post_label);
+ amount_cells($label, $name, $init, $params, $post_label, $dec);
echo "</tr>\n";
}
-function small_amount_row($label, $name, $init=null, $params=null, $post_label=null)
+function small_amount_row($label, $name, $init=null, $params=null, $post_label=null, $dec=null)
{
echo "<tr>";
- small_amount_cells($label, $name, $init, $params, $post_label);
+ small_amount_cells($label, $name, $init, $params, $post_label, $dec);
echo "</tr>\n";
}
//-----------------------------------------------------------------------------------
-function small_amount_cells($label, $name, $init=null, $params=null, $post_label=null)
+function qty_cells($label, $name, $init=null, $params=null, $post_label=null, $dec=null)
{
- amount_cells_ex($label, $name, 7, 12, $init, $params, $post_label);
+ if(!isset($dec))
+ $dec = user_qty_dec();
+
+ amount_cells_ex($label, $name, 15, 15, $init, $params, $post_label, $dec);
+}
+
+function qty_row($label, $name, $init=null, $params=null, $post_label=null, $dec=null)
+{
+ if(!isset($dec))
+ $dec = user_qty_dec();
+
+ echo "<tr>";
+ amount_cells($label, $name, $init, $params, $post_label, $dec);
+ echo "</tr>\n";
+}
+
+function small_qty_row($label, $name, $init=null, $params=null, $post_label=null, $dec=null)
+{
+ if(!isset($dec))
+ $dec = user_qty_dec();
+
+ echo "<tr>";
+ small_amount_cells($label, $name, $init, $params, $post_label, $dec);
+ echo "</tr>\n";
+}
+
+//-----------------------------------------------------------------------------------
+
+function small_amount_cells($label, $name, $init=null, $params=null, $post_label=null, $dec=null)
+{
+ amount_cells_ex($label, $name, 7, 12, $init, $params, $post_label, $dec);
+}
+
+//-----------------------------------------------------------------------------------
+
+function small_qty_cells($label, $name, $init=null, $params=null, $post_label=null, $dec=null)
+{
+ if (!isset($dec))
+ $dec = user_qty_dec();
+ amount_cells_ex($label, $name, 7, 12, $init, $params, $post_label, $dec);
}
//-----------------------------------------------------------------------------------
$_POST['units'] = $item_info["units"];
}
- amount_cells(null, 'qty', $_POST['qty']);
+ qty_cells(null, 'qty', $_POST['qty']);
label_cell($_POST['units']);
amount_cells(null, 'std_cost', $_POST['std_cost']);
}
- small_amount_cells(null, 'qty', $_POST['qty']);
+ small_qty_cells(null, 'qty', $_POST['qty']);
label_cell($_POST['units']);
if (isset($_GET['Edit']))
{
$_POST['conversion_factor'] = exrate_format(1);
}
-amount_row(_("Conversion Factor (to our UOM):"), 'conversion_factor', exrate_format($_POST['conversion_factor']));
+amount_row(_("Conversion Factor (to our UOM):"), 'conversion_factor',
+ exrate_format($_POST['conversion_factor']), null, null, user_exrate_dec() );
text_row(_("Supplier's Code or Description:"), 'supplier_description', null, 50, 51);
end_table(1);
$_POST[$myrow["loc_code"]] = qty_format($myrow["reorder_level"]);
label_cell(number_format2($qoh,user_qty_dec()), "nowrap align='right'");
- amount_cells(null, $myrow["loc_code"]);
+ qty_cells(null, $myrow["loc_code"]);
end_row();
$j++;
If ($j == 12)
{
$_POST['quantity'] = qty_format(1);
}
- amount_row(_("Quantity:"), 'quantity', $_POST['quantity']);
+ qty_row(_("Quantity:"), 'quantity', $_POST['quantity']);
end_table(1);
submit_center('Submit', _("Add/Update"));
if ($_POST['type'] == wo_types::advanced())
{
- amount_row(_("Quantity Required:"), 'quantity', 12);
+ qty_row(_("Quantity Required:"), 'quantity', 12);
if ($_POST['released'])
label_row(_("Quantity Manufactured:"), qty_format($_POST['units_issued']));
date_row(_("Date") . ":", 'date_');
}
else
{
- amount_row(_("Quantity:"), 'quantity', 12);
+ qty_row(_("Quantity:"), 'quantity', 12);
date_row(_("Date") . ":", 'date_');
hidden('RequDate', '');
if ($use_popup_windows)
$js .= get_js_open_window(900, 500);
-$js .= get_js_allocate();
+add_js_allocate();
page(_("Allocate Supplier Payment or Credit Note"), false, false, "", $js);
$_POST['req_del_date'] = add_days(Today(), 10);
}
- amount_cells(null, 'qty', null);
+ qty_cells(null, 'qty', null);
label_cell($_POST['units']);
date_cells(null, 'req_del_date', null, 0, 0, 0);
$page_security = 4;
$path_to_root="..";
-include($path_to_root . "/purchasing/includes/po_class.inc");
+include_once($path_to_root . "/purchasing/includes/po_class.inc");
-include($path_to_root . "/includes/session.inc");
+include_once($path_to_root . "/includes/session.inc");
-include($path_to_root . "/includes/data_checks.inc");
-include($path_to_root . "/includes/manufacturing.inc");
+//include($path_to_root . "/includes/data_checks.inc");
+//include($path_to_root . "/includes/manufacturing.inc");
include_once($path_to_root . "/purchasing/includes/purchasing_ui.inc");
qty_cell($qty_outstanding);
if ($qty_outstanding > 0)
- amount_cells(null, $ln_itm->line_no, qty_format($ln_itm->receive_qty), "align=right");
+ qty_cells(null, $ln_itm->line_no, qty_format($ln_itm->receive_qty), "align=right");
else
- amount_cells(null, $ln_itm->line_no, qty_format($ln_itm->receive_qty), "align=right",
+ qty_cells(null, $ln_itm->line_no, qty_format($ln_itm->receive_qty), "align=right",
"disabled");
amount_cell($ln_itm->price);
$path_to_root="..";
-include($path_to_root . "/purchasing/includes/supp_trans_class.inc");
+include_once($path_to_root . "/purchasing/includes/supp_trans_class.inc");
$page_security=5;
-include($path_to_root . "/includes/session.inc");
+include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/data_checks.inc");
label_cell($_POST['grn_item_id']);
label_cell($myrow['item_code'] . " " . $myrow['description']);
qty_cell($myrow["quantity_inv"]);
- amount_cells(null, 'This_QuantityCredited', qty_format(max($myrow['quantity_inv'],0)));
+ qty_cells(null, 'This_QuantityCredited', qty_format(max($myrow['quantity_inv'],0)));
amount_cell($myrow['unit_price']);
amount_cells(null, 'ChgPrice', price_format($myrow['unit_price']));
end_row();
label_cell($myrow['item_code']);
label_cell($myrow['description']);
qty_cell($myrow['QtyOstdg']);
- amount_cells(null, 'this_quantity_inv', qty_format($myrow['QtyOstdg']));
+ qty_cells(null, 'this_quantity_inv', qty_format($myrow['QtyOstdg']));
amount_cell($myrow['unit_price']);
small_amount_cells(null, 'ChgPrice', price_format($myrow['unit_price']));
end_row();
$page_security=5;
$path_to_root="..";
-include($path_to_root . "/purchasing/includes/supp_trans_class.inc");
-include($path_to_root . "/includes/session.inc");
+include_once($path_to_root . "/purchasing/includes/supp_trans_class.inc");
+include_once($path_to_root . "/includes/session.inc");
-include($path_to_root . "/purchasing/includes/purchasing_ui.inc");
+include_once($path_to_root . "/purchasing/includes/purchasing_ui.inc");
$js = "";
if ($use_date_picker)
$js .= get_js_date_picker();
include($path_to_root . "/includes/ui/allocation_cart.inc");
include_once($path_to_root . "/includes/session.inc");
+include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/sales/includes/sales_ui.inc");
include_once($path_to_root . "/sales/includes/sales_db.inc");
if ($use_popup_windows)
$js .= get_js_open_window(900, 500);
-$js .= get_js_allocate();
+add_js_allocate();
page(_("Allocate Customer Payment or Credit Note"), false, false, "", $js);
label_cell($ln_itm->units);
qty_cell($ln_itm->qty_done);
- small_amount_cells(null, 'Line'.$line, qty_format($ln_itm->qty_dispatched));
+ small_qty_cells(null, 'Line'.$line, qty_format($ln_itm->qty_dispatched));
$display_discount_percent = percent_format($ln_itm->discount_percent*100) . "%";
hidden('Line' . $line, $ln_itm->qty_dispatched );
echo qty_format($ln_itm->qty_dispatched).'</td>';
} else {
- small_amount_cells(null, 'Line'.$line, qty_format($ln_itm->qty_dispatched));
+ small_qty_cells(null, 'Line'.$line, qty_format($ln_itm->qty_dispatched));
}
$display_discount_percent = percent_format($ln_itm->discount_percent*100) . " %";
}
- amount_cells(null, 'qty', $_POST['qty']);
+ qty_cells(null, 'qty', $_POST['qty']);
// if ($order->trans_no!=0) {
// amount_cell($line_no==-1 ? 0 :$order->line_items[$line_no]->qty_done);
// }
label_cell($_POST['units']);
amount_cells(null, 'price', null);
- small_amount_cells(null, 'Disc', percent_format(0));
+ small_amount_cells(null, 'Disc', percent_format(0), null, null, user_percent_dec());
amount_cell($_POST['qty'] * $_POST['price'] * (1 - $_POST['Disc']/100));
$_POST['Disc'] = percent_format($order->default_discount * 100);
}
- amount_cells(null, 'qty', qty_format($_POST['qty']));
+ qty_cells(null, 'qty', qty_format($_POST['qty']));
if ($order->trans_no!=0) {
amount_cell($line_no==-1 ? 0 :$order->line_items[$line_no]->qty_done);
label_cell($_POST['units']);
amount_cells(null, 'price');
- small_amount_cells(null, 'Disc', percent_format($_POST['Disc']));
+ small_amount_cells(null, 'Disc', percent_format($_POST['Disc']), null, null, user_percent_dec());
$line_total = $_POST['qty'] * $_POST['price'] * (1 - $_POST['Disc'] / 100);
amount_cell($line_total);
if (!isset($_POST['rate' . $i]) || $_POST['rate' . $i] == "")
$_POST['rate' . $i] = percent_format($default_rate);
- small_amount_cells(null, 'rate' . $i, $_POST['rate' . $i]);
+ small_amount_cells(null, 'rate' . $i, $_POST['rate' . $i], null, null,
+ user_percent_dec());
}
end_row();
}
hidden('selected_id', $selected_id);
}
text_row_ex(_("Description:"), 'name', 50);
-small_amount_row(_("Default Rate:"), 'rate', '', "", "%");
+small_amount_row(_("Default Rate:"), 'rate', '', "", "%", user_percent_dec());
gl_all_accounts_list_row(_("Sales GL Account:"), 'sales_gl_code', null);
gl_all_accounts_list_row(_("Purchasing GL Account:"), 'purchasing_gl_code', null);