photo remaining

This commit is contained in:
Sampanna Rimal
2024-07-16 12:43:55 +05:45
parent 7ffe31e260
commit de0b041520
18 changed files with 273 additions and 198 deletions

View File

@ -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;
// }
}
}