photo remaining
This commit is contained in:
@ -144,6 +144,7 @@ class MStocks extends CI_Model
|
||||
$Item->Item = $this->db->where("item_id", $item_id)->get("tbl_items")->row();
|
||||
$Item->qty = $this->db->where("items_id", $item_id)->select("sum(qty) as qty")->get("tbl_stocks")->row()->qty;
|
||||
$Item->amount = $this->db->where("items_id", $item_id)->select("sum(price * qty) as amount")->get("tbl_stocks")->row()->amount;
|
||||
$Item->Unit = $this->db->where("unit_id", $Item->Item->units_id)->get("tbl_units")->row();
|
||||
$Item->Opening = $this->getOpeningStock($item_id);
|
||||
$Item->Purchase = $this->getItemPurchaseStock($item_id);
|
||||
$Item->Sales = $this->getItemSalesStock($item_id);
|
||||
@ -208,13 +209,12 @@ class MStocks extends CI_Model
|
||||
$this->db->insert("tbl_stocks", $TableData);
|
||||
}
|
||||
}
|
||||
// public function getUnitByItemId($id)
|
||||
// {
|
||||
// $this->db->where('status', 1);
|
||||
// $Item = $this->db->where("item_id", $id)->get("tbl_items")->row();
|
||||
// $Unit = $this->db->where("unit_id", $Item->units_id)->get("tbl_units")->row();
|
||||
// $unitname = $Unit->title;
|
||||
// return $unitname;
|
||||
public function getUnitByItemId($id)
|
||||
{
|
||||
$this->db->where('status', 1);
|
||||
$Item = $this->db->where("item_id", $id)->get("tbl_items")->row();
|
||||
$Unit = $this->db->where("unit_id", $Item->units_id)->get("tbl_units")->row();
|
||||
return $Unit;
|
||||
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user