$before_qty_row = db_fetch_row($before_qty);
$after_qty = $before_qty = $before_qty_row[0];
-if (!isset($before_qty_row[0]))
+if (!isset($before_qty_row[0]))
{
$after_qty = $before_qty = 0;
}
$total_in = 0;
$total_out = 0;
-while ($myrow = db_fetch($result))
+while ($myrow = db_fetch($result))
{
alt_table_row_color($k);
$type_name = systypes::name($myrow["type"]);
- if ($myrow["qty"] > 0)
+ if ($myrow["qty"] > 0)
{
$quantity_formatted = number_format2($myrow["qty"],user_qty_dec());
$total_in += $myrow["qty"];
}
- else
+ else
{
$quantity_formatted = number_format2(-$myrow["qty"],user_qty_dec());
$total_out += -$myrow["qty"];
$person = $myrow["person_id"];
$gl_posting = "";
- if (($myrow["type"] == 10) || ($myrow["type"] == 11))
+ if (($myrow["type"] == 13) || ($myrow["type"] == 11))
{
$cust_row = get_customer_details_from_trans($myrow["type"], $myrow["trans_no"]);
if (strlen($cust_row['name']) > 0)
$person = $cust_row['name'] . " (" . $cust_row['br_name'] . ")";
- }
- elseif ($myrow["type"] == 25)
+ }
+ elseif ($myrow["type"] == 25)
{
// get the supplier name
$sql = "SELECT supp_name FROM ".TB_PREF."suppliers WHERE supplier_id = '" . $myrow["person_id"] . "'";
if (strlen($supp_row['supp_name']) > 0)
$person = $supp_row['supp_name'];
- }
- elseif ($myrow["type"] == systypes::location_transfer() || $myrow["type"] == systypes::inventory_adjustment())
+ }
+ elseif ($myrow["type"] == systypes::location_transfer() || $myrow["type"] == systypes::inventory_adjustment())
{
// get the adjustment type
$movement_type = get_movement_type($myrow["person_id"]);
$person = $movement_type["name"];
- }
- elseif ($myrow["type"]==systypes::work_order() || $myrow["type"] == 28 ||
- $myrow["type"] == 29)
+ }
+ elseif ($myrow["type"]==systypes::work_order() || $myrow["type"] == 28 ||
+ $myrow["type"] == 29)
{
$person = "";
}
}
//end of while loop
-if ($total_in != 0 || $total_out != 0)
+if ($total_in != 0 || $total_out != 0)
{
start_row("class='inquirybg'");
label_cell("<b>"._("Quantity on hand after") . " " . $_POST['BeforeDate']."</b>", "align=center colspan=7");
FROM ".TB_PREF."stock_moves
WHERE stock_id='$stockid'
AND loc_code ='$location'
- AND (type=10 OR type=11)
+ AND (type=13 OR type=11)
AND visible=1";
$TransResult = db_query($sql,"No transactions were returned");
$cols = array(0, 50, 150, 180, 210, 240, 270, 300, 330, 390, 435, 480, 525);
- $per0 = strftime('%b',mktime(0,0,0,date('m'),date('d'),date('Y')));
- $per1 = strftime('%b',mktime(0,0,0,date('m')-1,date('d'),date('Y')));
- $per2 = strftime('%b',mktime(0,0,0,date('m')-2,date('d'),date('Y')));
- $per3 = strftime('%b',mktime(0,0,0,date('m')-3,date('d'),date('Y')));
- $per4 = strftime('%b',mktime(0,0,0,date('m')-4,date('d'),date('Y')));
+ $per0 = strftime('%b',mktime(0,0,0,date('m'),1,date('Y')));
+ $per1 = strftime('%b',mktime(0,0,0,date('m')-1,1,date('Y')));
+ $per2 = strftime('%b',mktime(0,0,0,date('m')-2,1,date('Y')));
+ $per3 = strftime('%b',mktime(0,0,0,date('m')-3,1,date('Y')));
+ $per4 = strftime('%b',mktime(0,0,0,date('m')-4,1,date('Y')));
$headers = array(_('Category'), '', $per4, $per3, $per2, $per1, $per0, '3*M',
_('QOH'), _('Cust Ord'), _('Supp Ord'), _('Sugg Ord'));