- // get the initial value of the fixed assset.
- $row = get_fixed_asset_move($stock_id, ST_SUPPRECEIVE);
- $inv_value = $row['price'] * $quantity;
- $adj_value = (-($row['price']) + $standard_cost) * $quantity;
- }
- if ($standard_cost > 0 || is_fixed_asset($mb_flag))
- {
- $stock_gl_codes = get_stock_gl_code($stock_id);
- add_gl_trans_std_cost(ST_INVADJUST, $adj_id, $date_,
- $stock_gl_codes['adjustment_account'], $stock_gl_codes['dimension_id'], $stock_gl_codes['dimension2_id'], $memo_, $adj_value );
- add_gl_trans_std_cost(ST_INVADJUST, $adj_id, $date_, $stock_gl_codes['inventory_account'], 0, 0, $memo_, $inv_value);
- }
-
+ // get the initial value of the fixed assset.
+ $row = get_fixed_asset_move($stock_id, ST_SUPPRECEIVE);
+ $inv_value = $row['price'] * $quantity;
+ $adj_value = (-($row['price']) + $unit_cost) * $quantity;
+ }
+
+ if ($unit_cost > 0 || is_fixed_asset($mb_flag))
+ {
+
+ $stock_gl_codes = get_stock_gl_code($stock_id);
+
+ add_gl_trans_std_cost(ST_INVADJUST, $adj_id, $date_,
+ $stock_gl_codes['adjustment_account'], $stock_gl_codes['dimension_id'], $stock_gl_codes['dimension2_id'], $memo_, $adj_value );
+
+ add_gl_trans_std_cost(ST_INVADJUST, $adj_id, $date_, $stock_gl_codes['inventory_account'], 0, 0, $memo_, $inv_value);
+ }
+