|
|
|
@ -1319,7 +1319,7 @@ class Pages extends CI_controller
|
|
|
|
|
* Store Item Inquiry Methods
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public function getItemInfo()
|
|
|
|
|
public function getItemInfoByModelNo()
|
|
|
|
|
{
|
|
|
|
|
if(!$this->isLogged())
|
|
|
|
|
redirect('login', 'refresh');
|
|
|
|
@ -1331,35 +1331,92 @@ class Pages extends CI_controller
|
|
|
|
|
$this->load->model("StockReceivingView");
|
|
|
|
|
|
|
|
|
|
$result = $this->Items->getItemInfoByModelNo($this->input->post("modelno"));
|
|
|
|
|
$row = $result->row();
|
|
|
|
|
|
|
|
|
|
if($result->num_rows() > 0)
|
|
|
|
|
{
|
|
|
|
|
$row = $result->row();
|
|
|
|
|
|
|
|
|
|
$resultBranches = $this->BranchItemLedger->getDataByItemcodeWithBranchExcempt($row->itemcode);
|
|
|
|
|
|
|
|
|
|
$kwhRow = $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;
|
|
|
|
|
$this->ItemInquiryLog->catCode = $row->catCode;
|
|
|
|
|
$this->ItemInquiryLog->brCode = $this->session->user["branch"];
|
|
|
|
|
$this->ItemInquiryLog->searchedBy = $this->session->user["username"];
|
|
|
|
|
$this->ItemInquiryLog->dateSearched = date('m/d/Y');
|
|
|
|
|
$this->ItemInquiryLog->addNewData();
|
|
|
|
|
// --- END --- Log searched item
|
|
|
|
|
|
|
|
|
|
$htmlTable = "";
|
|
|
|
|
|
|
|
|
|
foreach($resultBranches->result() as $rowBranches )
|
|
|
|
|
{
|
|
|
|
|
$htmlTable .= "<tr><td>" . $rowBranches->itemcode . "</td><td>" . $rowBranches->brCode . "</td><td>" . $rowBranches->endingqty . "</td></tr>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo json_encode(array("success"=>true, "data" => $row, "htmlTable" => $htmlTable, "KWHData" => $kwhRow, "KWHStockReceived" => $kwhStockReceivedRow));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
echo json_encode(array("success"=>false, "data" => "No Record"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getItemInfoBySeries()
|
|
|
|
|
{
|
|
|
|
|
if(!$this->isLogged())
|
|
|
|
|
redirect('login', 'refresh');
|
|
|
|
|
|
|
|
|
|
$this->load->model("ItemLedger");
|
|
|
|
|
|
|
|
|
|
$resultBranches = $this->BranchItemLedger->getDataByItemcodeWithBranchExcempt($row->itemcode);
|
|
|
|
|
$result = $this->ItemLedger->getBranchesBySeriesCodeWithBranchExcempt($this->input->post("series"), false);
|
|
|
|
|
|
|
|
|
|
$htmlTable = "";
|
|
|
|
|
|
|
|
|
|
$kwhRow = $this->ItemLedger->getItemLedgerOfKWHByItemcode($row->itemcode);
|
|
|
|
|
//$kwhRow = $resultKWH->row();
|
|
|
|
|
foreach($result->result() as $rowItems )
|
|
|
|
|
{
|
|
|
|
|
$htmlTable .= "<tr><td>" . $rowItems->itemcode .
|
|
|
|
|
"</td><td>" . $rowItems->modelno .
|
|
|
|
|
"</td><td>" . $rowItems->seriescode .
|
|
|
|
|
"</td><td>" . $rowItems->item_desc .
|
|
|
|
|
"</td><td>" . $rowItems->brCode .
|
|
|
|
|
"</td><td>" . $rowItems->endingqty . "</td></tr>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$resultKWHStockReceived = $this->StockReceivingView->getDtlDataByItemcode($row->itemcode);
|
|
|
|
|
$kwhStockReceivedRow = $resultKWHStockReceived->row();
|
|
|
|
|
if($result->num_rows() > 0)
|
|
|
|
|
echo json_encode(array("success"=>true, "htmlTable" => $htmlTable));
|
|
|
|
|
else
|
|
|
|
|
echo json_encode(array("success"=>false, "data" => "No Record"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Log searched item
|
|
|
|
|
$this->ItemInquiryLog->itemcode = $row->itemcode;
|
|
|
|
|
$this->ItemInquiryLog->modelno = $row->modelno;
|
|
|
|
|
$this->ItemInquiryLog->catCode = $row->catCode;
|
|
|
|
|
$this->ItemInquiryLog->brCode = $this->session->user["branch"];
|
|
|
|
|
$this->ItemInquiryLog->searchedBy = $this->session->user["username"];
|
|
|
|
|
$this->ItemInquiryLog->dateSearched = date('m/d/Y');
|
|
|
|
|
$this->ItemInquiryLog->addNewData();
|
|
|
|
|
// --- END --- Log searched item
|
|
|
|
|
public function getItemInfoByDescription()
|
|
|
|
|
{
|
|
|
|
|
if(!$this->isLogged())
|
|
|
|
|
redirect('login', 'refresh');
|
|
|
|
|
|
|
|
|
|
$this->load->model("ItemLedger");
|
|
|
|
|
|
|
|
|
|
$result = $this->ItemLedger->getBranchesByDescWithBranchExcempt($this->input->post("series"), false);
|
|
|
|
|
|
|
|
|
|
$htmlTable = "";
|
|
|
|
|
|
|
|
|
|
foreach($resultBranches->result() as $rowBranches )
|
|
|
|
|
foreach($result->result() as $rowItems )
|
|
|
|
|
{
|
|
|
|
|
$htmlTable .= "<tr><td>" . $rowBranches->itemcode . "</td><td>" . $rowBranches->brCode . "</td><td>" . $rowBranches->endingqty . "</td></tr>";
|
|
|
|
|
$htmlTable .= "<tr><td>" . $rowItems->itemcode .
|
|
|
|
|
'</td><td><a href="itemmovementhistory?mts='.$rowItems->modelno.'">' . $rowItems->modelno .
|
|
|
|
|
"</a></td><td>" . $rowItems->seriescode .
|
|
|
|
|
"</td><td>" . $rowItems->item_desc .
|
|
|
|
|
"</td><td>" . $rowItems->brCode .
|
|
|
|
|
"</td><td>" . $rowItems->endingqty . "</td></tr>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($result->num_rows() > 0)
|
|
|
|
|
echo json_encode(array("success"=>true, "data" => $row, "htmlTable" => $htmlTable, "KWHData" => $kwhRow, "KWHStockReceived" => $kwhStockReceivedRow));
|
|
|
|
|
echo json_encode(array("success"=>true, "htmlTable" => $htmlTable));
|
|
|
|
|
else
|
|
|
|
|
echo json_encode(array("success"=>false, "data" => "No Record"));
|
|
|
|
|
}
|
|
|
|
|