diff --git a/application/controllers/Pages.php b/application/controllers/Pages.php index 2e9b0c4..d9b196d 100644 --- a/application/controllers/Pages.php +++ b/application/controllers/Pages.php @@ -1328,6 +1328,7 @@ class Pages extends CI_controller $this->load->model("BranchItemLedger"); $this->load->model("ItemLedger"); $this->load->model("ItemInquiryLog"); + $this->load->model("StockReceivingView"); $result = $this->Items->getItemInfoByModelNo($this->input->post("modelno")); $row = $result->row(); @@ -1337,6 +1338,9 @@ class Pages extends CI_controller $resultKWH = $this->ItemLedger->getItemLedgerOfKWHByItemcode($row->itemcode); $kwhRow = $resultKWH->row(); + $resultKWHStockReceived = $this->StockReceivingView->getDtlDataByItemcode($row->itemcode); + $kwhStockReceivedRow = $resultKWHStockReceived->row(); + // Log searched item $this->ItemInquiryLog->itemcode = $row->itemcode; $this->ItemInquiryLog->modelno = $row->modelno; @@ -1355,7 +1359,7 @@ class Pages extends CI_controller } if($result->num_rows() > 0) - echo json_encode(array("success"=>true, "data" => $row, "htmlTable" => $htmlTable, "KWHData" => $kwhRow)); + echo json_encode(array("success"=>true, "data" => $row, "htmlTable" => $htmlTable, "KWHData" => $kwhRow, "KWHStockReceived" => $kwhStockReceivedRow)); else echo json_encode(array("success"=>false, "data" => "No Record")); } diff --git a/application/models/StockReceivingView.php b/application/models/StockReceivingView.php new file mode 100644 index 0000000..62e023a --- /dev/null +++ b/application/models/StockReceivingView.php @@ -0,0 +1,22 @@ +load->database(); + } + + + public function getHdrDataByTransID($transID) + { + return $this->db->get_where("stockreceivinghdr", array("transid"=>$transID))->order_by("transid", "DESC"); + } + + public function getDtlDataByItemcode($itemcode) + { + return $this->db->get_where("stockreceivingdtl", array("itemcode"=>$itemcode)); + } +} \ No newline at end of file diff --git a/application/views/pages/dashboard.php b/application/views/pages/dashboard.php index a55dfb0..df3a546 100644 --- a/application/views/pages/dashboard.php +++ b/application/views/pages/dashboard.php @@ -325,7 +325,7 @@ ' '; } - function showIteminquiredInformation(data, htmlTable, KWHData) + function showIteminquiredInformation(data, htmlTable, KWHData, KWHStockReceived) { return '
' + '
' + @@ -363,7 +363,7 @@ ' ' + '
' + '
' + - '

Beginning Quantity in Warehouse: ' + ((Number(KWHData["beginningqty"]) === 0) ? KWHData["inqty"] : KWHData["beginningqty"]) + '

' + + '

Beginning quantity: ' + KWHStockReceived["qty"] + '

' + '

Quantity Remaining in Warehouse: ' + KWHData["endingqty"] + '

' + ' ' + ' '; @@ -400,7 +400,7 @@ modelno: $("#txtModelNoInquiry").val() }, function(data) { if (data["success"] == true) { - $("#resultContainerStoreInquiry").prepend(showIteminquiredInformation(data["data"], data["htmlTable"], data["KWHData"])); + $("#resultContainerStoreInquiry").prepend(showIteminquiredInformation(data["data"], data["htmlTable"], data["KWHData"], data["KWHStockReceived"])); } else { $("#resultContainerStoreInquiry").prepend(errorMessage(data["data"])); }