<?php

class ItemLedger extends CI_Model
{
    public $itemcode;
    public $brCode;
    public $beginningqty;
    public $inqty;
    public $outqty;
    public $sales;
    public $adjustment;
    public $endingqty;
    public $editDate;
    public $creationDate;
    public $remarks;

    public function __construct()
	{
		parent::__construct();

        $this->load->database();
    }

    public function getBranchesByItemcode($itemcode)
    {
        return $this->db->get_where("itemledger", array("itemcode"=>$itemcode));
    }

    public function getItemLedgerOfKWHByItemcode($itemcode)
    {
        return $this->db->get_where("itemledger", array("itemcode"=>$itemcode, "brCode"=>"KWH"));
    }
}