<?php
-
+/**********************************************************************
+ Copyright (C) FrontAccounting, LLC.
+ Released under the terms of the GNU General Public License, GPL,
+ as published by the Free Software Foundation, either version 3
+ of the License, or (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
include_once($path_to_root . "/includes/ui.inc");
//--------------------------------------------------------------------------------------
if (db_num_rows($result) == 0)
{
display_note(_("The bill of material for this item is empty."), 0, 1);
- }
- else
+ }
+ else
{
start_table($table_style);
$total_cost = 0;
- while ($myrow = db_fetch($result))
+ while ($myrow = db_fetch($result))
{
alt_table_row_color($k);
label_cell($myrow["description"]);
label_cell($myrow["WorkCentreDescription"]);
label_cell($myrow["location_name"]);
- qty_cell($myrow["quantity"]);
+ qty_cell($myrow["quantity"], false, get_qty_dec($myrow["component"]));
amount_cell($myrow["standard_cost"]);
amount_cell($myrow["ComponentCost"]);
end_row();
if (db_num_rows($result) == 0)
{
display_note(_("There are no Requirements for this Order."), 1, 0);
- }
- else
+ }
+ else
{
start_table("$table_style width=80%");
if ($date == null)
$date = Today();
- while ($myrow = db_fetch($result))
+ while ($myrow = db_fetch($result))
{
$qoh = 0;
-
+ $show_qoh = true;
// if it's a non-stock item (eg. service) don't show qoh
if (!has_stock_holding($myrow["mb_flag"]))
$show_qoh = false;
if ($show_qoh)
$qoh = get_qoh_on_date($myrow["stock_id"], $myrow["loc_code"], $date);
- if ($show_qoh && ($myrow["units_req"] * $quantity > $qoh) &&
- !sys_prefs::allow_negative_stock())
+ if ($show_qoh && ($myrow["units_req"] * $quantity > $qoh) &&
+ !sys_prefs::allow_negative_stock())
{
// oops, we don't have enough of one of the component items
start_row("class='stockmankobg'");
$has_marked = true;
- }
+ }
else
alt_table_row_color($k);
label_cell($myrow["location_name"]);
label_cell($myrow["WorkCentreDescription"]);
- qty_cell($myrow["units_req"]);
- qty_cell($myrow["units_req"] * $quantity);
- qty_cell($myrow["units_issued"]);
+ $dec = get_qty_dec($myrow["stock_id"]);
+ qty_cell($myrow["units_req"], false, $dec);
+ qty_cell($myrow["units_req"] * $quantity, false, $dec);
+ qty_cell($myrow["units_issued"], false, $dec);
if ($show_qoh)
- qty_cell($qoh);
+ qty_cell($qoh, false, $dec);
else
label_cell("");
end_row();
if (db_num_rows($result) == 0)
{
display_note(_("There are no Productions for this Order."), 1, 1);
- }
- else
+ }
+ else
{
start_table($table_style);
$th = array(_("#"), _("Reference"), _("Date"), _("Quantity"));
$k = 0; //row colour counter
$total_qty = 0;
- while ($myrow = db_fetch($result))
+ while ($myrow = db_fetch($result))
{
alt_table_row_color($k);
label_cell(get_trans_view_str(29, $myrow["id"]));
label_cell($myrow['reference']);
label_cell(sql2date($myrow["date_"]));
- qty_cell($myrow['quantity']);
+ qty_cell($myrow['quantity'], false, get_qty_dec($myrow['reference']));
end_row();
}//end of while
- label_row(_("Total"), number_format2($total_qty,user_qty_dec()),
+ label_row(_("Total"), number_format2($total_qty,user_qty_dec()),
"colspan=3", "nowrap align=right");
end_table();
if (db_num_rows($result) == 0)
{
display_note(_("There are no Issues for this Order."), 0, 1);
- }
- else
+ }
+ else
{
start_table($table_style);
$th = array(_("#"), _("Reference"), _("Date"));
$k = 0; //row colour counter
- while ($myrow = db_fetch($result))
+ while ($myrow = db_fetch($result))
{
alt_table_row_color($k);
if (db_num_rows($result) == 0)
{
- echo _("There are no Payments for this Order.") . "<br>";
- }
- else
+ display_note(_("There are no Payments for this Order."), 0, 1);
+ }
+ else
{
start_table($table_style);
$th = array(_("#"), _("Reference"), _("Date"), _("Amount"));
$k = 0; //row colour counter
- while ($myrow = db_fetch($result))
+ while ($myrow = db_fetch($result))
{
alt_table_row_color($k);
$myrow = get_work_order($woid);
- if (strlen($myrow[0]) == 0)
+ if (strlen($myrow[0]) == 0)
{
display_note(_("The work order number sent is not valid."));
exit;
start_table("$table_style width=80%");
- if ($myrow["released"] == true)
+ if ($myrow["released"] == true)
$th = array(_("#"), _("Reference"), _("Type"), _("Manufactured Item"),
_("Into Location"), _("Date"), _("Required By"), _("Quantity Required"),
_("Released Date"), _("Manufactured"));
- else
+ else
$th = array(_("#"), _("Reference"), _("Type"), _("Manufactured Item"),
_("Into Location"), _("Date"), _("Required By"), _("Quantity Required"));
label_cell($myrow["location_name"]);
label_cell(sql2date($myrow["date_"]));
label_cell(sql2date($myrow["required_by"]));
+ $dec = get_qty_dec($myrow["stock_id"]);
+ qty_cell($myrow["units_reqd"], false, $dec);
- qty_cell($myrow["units_reqd"]);
-
- if ($myrow["released"] == true)
+ if ($myrow["released"] == true)
{
label_cell(sql2date($myrow["released_date"]));
- qty_cell($myrow["units_issued"]);
+ qty_cell($myrow["units_issued"], false, $dec);
}
end_row();
end_table();
- if ($myrow["closed"] == true)
+ if ($myrow["closed"] == true)
{
display_note(_("This work order is closed."));
}
$myrow = get_work_order($woid);
- if (strlen($myrow[0]) == 0)
+ if (strlen($myrow[0]) == 0)
{
display_note(_("The work order number sent is not valid."));
exit;
$th = array(_("#"), _("Reference"), _("Type"), _("Manufactured Item"),
_("Into Location"), _("Date"), _("Quantity"));
- table_header($th);
+ table_header($th);
start_row();
if ($suppress_view_link)
label_cell($myrow["location_name"]);
label_cell(sql2date($myrow["date_"]));
- qty_cell($myrow["units_issued"]);
+ qty_cell($myrow["units_issued"], false, get_qty_dec($myrow["stock_id"]));
end_row();
end_table();
- if ($myrow["closed"] == true)
+ if ($myrow["closed"] == true)
{
display_note(_("This work order is closed."));
}