Update on dashboard

Provide view for last ordered qty of item
pull/10/head
paulcortez 1 year ago
parent 3048633841
commit 424c098780

@ -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"));
}

@ -0,0 +1,22 @@
<?php
class StockReceivingView extends CI_Model
{
public function __construct()
{
parent::__construct();
$this->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));
}
}

@ -325,7 +325,7 @@
' </div><!-- /.box -->';
}
function showIteminquiredInformation(data, htmlTable, KWHData)
function showIteminquiredInformation(data, htmlTable, KWHData, KWHStockReceived)
{
return '<div class="box">' +
' <div class="box-header with-border">' +
@ -363,7 +363,7 @@
' </table>' +
' </div>' +
' </div>' +
' <p>Beginning Quantity in Warehouse: ' + ((Number(KWHData["beginningqty"]) === 0) ? KWHData["inqty"] : KWHData["beginningqty"]) + '</p>' +
' <p>Beginning quantity: ' + KWHStockReceived["qty"] + '</p>' +
' <h3>Quantity Remaining in Warehouse: ' + KWHData["endingqty"] + '</h3>' +
' </div>' +
' </div>';
@ -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"]));
}

Loading…
Cancel
Save