Add/Edit Asset Details
This commit is contained in:
parent
70ba1db7fd
commit
a702878f09
@ -38,9 +38,7 @@ class assetdetails extends BaseController
|
||||
{
|
||||
|
||||
$this->load->model('assetdetails_model');
|
||||
|
||||
|
||||
|
||||
|
||||
$data['userRecords'] = $this->assetdetails_model->assetListing();
|
||||
|
||||
$this->global['pageTitle'] = 'Siddharth : Asset List';
|
||||
@ -129,11 +127,11 @@ class assetdetails extends BaseController
|
||||
echo json_encode($ser);
|
||||
die();
|
||||
}
|
||||
function getlin(){
|
||||
$line = $this->input->post('line');
|
||||
// function getlin(){
|
||||
// $line = $this->input->post('line');
|
||||
|
||||
|
||||
}
|
||||
// }
|
||||
/* Validation for Department Dropdown
|
||||
*/
|
||||
function Department_validate($selectValue)
|
||||
@ -217,9 +215,15 @@ class assetdetails extends BaseController
|
||||
$DateOfCommission = $this->input->post('DateOfCommission');
|
||||
$CreatedBy = $this->session->userdata('userId');
|
||||
$AssetValue = $this->input->post('Assetvalue');
|
||||
$DOPurchase = $this->getDateformat($DateOfPurchase);
|
||||
$DOCommission= $this->getDateformat($DateOfCommission);
|
||||
$AssetStatus = $this->input->post('AssetStatus');
|
||||
if($DateOfCommission != '')
|
||||
{
|
||||
$DOPurchase = $this->getDateformat($DateOfPurchase);
|
||||
}
|
||||
if($DateOfPurchase != '')
|
||||
{
|
||||
$DOCommission= $this->getDateformat($DateOfCommission);
|
||||
}
|
||||
$AssetStatus = $this->input->post('AssetStatus');
|
||||
$Remarks = $this->input->post('Remarks');
|
||||
$PONO = $this->input->post('PONO');
|
||||
$lineitem = $this->input->post('lineitem');
|
||||
@ -265,12 +269,13 @@ class assetdetails extends BaseController
|
||||
/**
|
||||
* This function is used load user edit information
|
||||
* @param number $userId : Optional : This is user id
|
||||
|
||||
*/
|
||||
|
||||
function ech(){
|
||||
/*function ech(){
|
||||
|
||||
echo $this->input->post('Asset_Code');
|
||||
}*/
|
||||
|
||||
function editOldasset($AssetCode = '',$PO='')
|
||||
{
|
||||
|
||||
@ -300,6 +305,7 @@ class assetdetails extends BaseController
|
||||
$this->loadViews("editOldasset", $this->global, $data,NULL);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This function is used to edit the user information
|
||||
@ -340,9 +346,17 @@ class assetdetails extends BaseController
|
||||
// $DateOfPurchase = $DateOfPurchase ->format('d-m-y');
|
||||
$DateOfCommission = $this->input->post('DateOfCommission');
|
||||
$UpdatedBy = $this->session->userdata('userId');
|
||||
$AssetValue = $this->input->post('Assetvalue');
|
||||
$DOPurchase = $this->getDateformat($DateOfPurchase);
|
||||
$DOCommission= $this->getDateformat($DateOfCommission);
|
||||
$Assetvalue = $this->input->post('Assetvalue');
|
||||
if($DateOfCommission != '')
|
||||
{
|
||||
$DOPurchase = $this->getDateformat($DateOfPurchase);
|
||||
}
|
||||
if($DateOfPurchase != '')
|
||||
{
|
||||
$DOCommission= $this->getDateformat($DateOfCommission);
|
||||
}
|
||||
|
||||
|
||||
$AssetStatus = $this->input->post('AssetStatus');
|
||||
$Remarks = $this->input->post('Remarks');
|
||||
$PONO = $this->input->post('PONO');
|
||||
@ -364,7 +378,7 @@ class assetdetails extends BaseController
|
||||
$asset = array();
|
||||
|
||||
|
||||
$asset = array('AssetName'=>$AssetName, 'Description'=>$Description,'DEPCode'=>$Department,'Location'=>$Location,'UserName'=>$User,'SupplierCode'=>$SupplierName,'DateOfPurchase'=>$DOPurchase,'DateOfCommison'=>$DOCommission,'AssetValue'=>$AssetValue,'AssetStatus'=>$AssetStatus,'IsActive'=>$IsActive,'Remarks'=>$Remarks,'UpdatedBy'=>$UpdatedBy,'PONO'=>$PONO,'POLineItem'=>$lineitem,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity);
|
||||
$asset = array('AssetName'=>$AssetName, 'Description'=>$Description,'DEPCode'=>$Department,'Location'=>$Location,'UserName'=>$User,'SupplierCode'=>$SupplierName,'DateOfPurchase'=>$DOPurchase,'DateOfCommison'=>$DOCommission,'AssetValue'=>$Assetvalue,'AssetStatus'=>$AssetStatus,'IsActive'=>$IsActive,'Remarks'=>$Remarks,'UpdatedBy'=>$UpdatedBy,'PONO'=>$PONO,'POLineItem'=>$lineitem,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity);
|
||||
|
||||
//print_r($asset);die();
|
||||
|
||||
@ -388,7 +402,7 @@ class assetdetails extends BaseController
|
||||
function getDateformat($Val)
|
||||
{
|
||||
$date = new DateTime($Val);
|
||||
$retDate = $date->format('d-m-y H:i:s');
|
||||
$retDate = $date->format('Y-m-d H:i:s');
|
||||
return $retDate;
|
||||
}
|
||||
|
||||
|
||||
@ -15,7 +15,7 @@ class assetdetails_model extends CI_Model
|
||||
$this->db->select('asd.*,dep.DepartmentName,sup.SupplierName');
|
||||
$this->db->from('T_Asset_Details asd');
|
||||
$this->db->join('T_DepartmentDetails dep', ' dep.DEPCode = asd.DEPCode','left');
|
||||
$this->db->join ('T_SupplierDetailsN sup','sup.SupplierID = asd.SupplierCode');
|
||||
$this->db->join ('T_SupplierDetailsN sup','sup.SupplierID = asd.SupplierCode','left');
|
||||
|
||||
|
||||
$query = $this->db->get();
|
||||
@ -222,7 +222,7 @@ function addNewasset($asset)
|
||||
|
||||
|
||||
$query = $this->db->get();
|
||||
// print_r($this->db->last_query());
|
||||
//print_r($this->db->last_query());
|
||||
return $query->result();
|
||||
}
|
||||
function editasset($asset, $Asset_Code)
|
||||
|
||||
@ -234,7 +234,7 @@ $("#DeliveryDate").datepicker({
|
||||
<b>
|
||||
<span for="DeliveryDate">Delivery Date</span>
|
||||
</b>
|
||||
<input id="DeliveryDate" name="DeliveryDate" onkeypress="return false;" maxlength="10" class="form-control" value= "<?php echo isset($_POST['DeliveryDate']) ? $_POST['DeliveryDate'] : '' ?>">
|
||||
<input id="DeliveryDate" readonly name="DeliveryDate" onkeypress="return false;" maxlength="10" class="form-control" value= "<?php echo isset($_POST['DeliveryDate']) ? $_POST['DeliveryDate'] : '' ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
||||
@ -14,6 +14,7 @@ $AssetStatus = '';
|
||||
$IsActive ='';
|
||||
$Remarks = '';
|
||||
$DepartmentName ='';
|
||||
$Department ='';
|
||||
$SupplierCode = '';
|
||||
$MaterialCode = '';
|
||||
$PONO = '';
|
||||
@ -26,22 +27,23 @@ if(!empty($assetList))
|
||||
{
|
||||
foreach ($assetList as $Asset)
|
||||
{
|
||||
//print_r($Asset);die();
|
||||
$AssetCode = $Asset->AssetCode;
|
||||
$AssetName = $Asset->AssetName;
|
||||
$Description = $Asset->Description;
|
||||
$Department = $Asset->DepartmentName ;
|
||||
$Department = $Asset->DEPCode;
|
||||
$DepartmentName = $Asset->DepartmentName;
|
||||
$Location = $Asset->Location;
|
||||
$User = $Asset->UserName;
|
||||
$SupplierName = $Asset->SupplierName;
|
||||
$SupplierCode = $Asset->SupplierCode;
|
||||
$DateOfPurchase = $Asset->DateOfPurchase;
|
||||
$DateOfPurchase = $Asset->DateOfPurchase;//print_r($Asset->DateOfPurchase);
|
||||
$PODate = new DateTime($DateOfPurchase);
|
||||
$DateOfPurchase = $PODate->format('Y-m-d');
|
||||
$DateOfCommission = $Asset->DateOfCommison;
|
||||
$assetDate = new DateTime($DateOfCommison);
|
||||
$DateOfCommison = $assetDate->format('Y-m-d');
|
||||
|
||||
//print_r($Asset->DateOfCommison);
|
||||
//$assetDate = new DateTime($DateOfCommison);
|
||||
$DateOfCommission= new DateTime($Asset->DateOfCommison, new DateTimeZone('Asia/Kolkata'));
|
||||
$DateOfCommison = $DateOfCommission->format('Y-m-d');
|
||||
$AssetValue = $Asset->AssetValue;
|
||||
$AssetStatus = $Asset->AssetStatus;
|
||||
$MaterialCode = $Asset->MaterialCode;
|
||||
@ -50,10 +52,10 @@ if(!empty($assetList))
|
||||
$Quantity = $Asset->Quantity;
|
||||
$MaterialName = $Asset->MaterialName;
|
||||
$UOM = $Asset->UOM;
|
||||
$DeliveryDate = $Asset->DeliveryDate;
|
||||
$PODelivery = new DateTime($DeliveryDate);
|
||||
$DeliveryDate = $PODelivery ->format('Y-m-d');
|
||||
|
||||
$DDate = new DateTime($Asset->DeliveryDate, new DateTimeZone('Asia/Kolkata'));
|
||||
//$PODelivery = new DateTime($DeliveryDate);//print_r($Asset->DeliveryDate);
|
||||
$DeliveryDate = $DDate ->format('Y-m-d');
|
||||
//print_r($DateOfPurchase);print_r($DateOfCommison);print_r($DeliveryDate);
|
||||
$Remarks = $Asset->Remarks;
|
||||
$chk = $Asset->IsActive;
|
||||
|
||||
@ -71,11 +73,11 @@ if(!empty($assetList))
|
||||
$dtpurchase = new DateTime($DateOfPurchase);
|
||||
$DOPurchase = $dtpurchase ->format('Y-m-d');
|
||||
}
|
||||
if($DateOfCommission != '')
|
||||
{
|
||||
$dtCommission = new DateTime($DateOfCommission);
|
||||
$DOCommission = $dtCommission ->format('Y-m-d');
|
||||
}
|
||||
// if($DateOfCommission != '')
|
||||
// {
|
||||
// $dtCommission = new DateTime($DateOfCommission);
|
||||
// $DOCommission = $dtCommission ->format('Y-m-d');
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@ -291,10 +293,10 @@ $("#DeliveryDate").datepicker({
|
||||
|
||||
|
||||
<div class="form-group">
|
||||
<input type="hidden" name="AssetDept" id="depcode">
|
||||
<input type="hidden" name="AssetDept" id="depcode" value="<?php echo $Department?>">
|
||||
<b>
|
||||
<span for="AssetDept">Asset Department</span></b>
|
||||
<input type="text" class="form-control required" value="<?php echo $Department;?>" id="AssetDept" readonly name="" value="">
|
||||
<input type="text" class="form-control required" value="<?php echo $DepartmentName;?>" id="AssetDept" readonly>
|
||||
|
||||
</div>
|
||||
|
||||
@ -312,15 +314,15 @@ $("#DeliveryDate").datepicker({
|
||||
<div class="form-group">
|
||||
<b>
|
||||
<span for="DateOfPurchase">Supplier Name</span></b>
|
||||
<input type="hidden" name="SupplierName" id="SupID">
|
||||
<input id="SupplierName" required name="" readonly onkeypress="return false;" maxlength="10" class="form-control" value= "<?php echo $SupplierName ?>">
|
||||
<input type="hidden" name="SupplierName" id="SupID" value="<?php echo $SupplierCode;?>">
|
||||
<input id="SupplierName" readonly onkeypress="return false;" maxlength="10" class="form-control" value= "<?php echo $SupplierName; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3" style="padding:0px;">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group"><b>
|
||||
<span for="DeliveryDate">Delivery Date</span></b>
|
||||
<input id="DeliveryDate" required name="DeliveryDate" onkeypress="return false;" maxlength="10" class="form-control" value= "<?php echo $DeliveryDate;?>">
|
||||
<input id="DeliveryDate" readonly name="DeliveryDate" maxlength="10" class="form-control" value= "<?php echo $DeliveryDate;?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
@ -491,13 +493,14 @@ $("#DeliveryDate").datepicker({
|
||||
$('#DeliveryDate').val(item.DeliveryDate);
|
||||
$('#SupplierName').val(item.SupplierName);
|
||||
$('#SupID').val(item.SupplierID);
|
||||
//alert(item.SupplierID);
|
||||
$('#MaterialCode').val(item.MaterialCode);
|
||||
$('#UOM').val(item.UOM);
|
||||
$('#Quantity').val(item.Quantity);
|
||||
$('#depcode').val(item.Departmentcode);
|
||||
$('#AssetDept').val(item.DepartmentName);
|
||||
$('#PODescription').val(item.MaterialName);
|
||||
//alert(item.TotalValue);
|
||||
//salert(item.TotalValue);
|
||||
$('#Assetvalue').val(item.TotalValue);
|
||||
|
||||
var date = new Date(item.DeliveryDate);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user