tracker id 1595
This commit is contained in:
parent
982b403ef4
commit
7dbbf252a3
@ -163,6 +163,7 @@ class Inwardgateregister extends BaseController
|
|||||||
// $data['PO_NO'] = array_filter($result, function($item) {
|
// $data['PO_NO'] = array_filter($result, function($item) {
|
||||||
// return !($item->status === 'ST027' && $item->IsOpenOrder === null);
|
// return !($item->status === 'ST027' && $item->IsOpenOrder === null);
|
||||||
// });
|
// });
|
||||||
|
// dd($result);
|
||||||
$data['PO_NO'] = array_filter($result, function($item) {
|
$data['PO_NO'] = array_filter($result, function($item) {
|
||||||
return !($item->status === 'ST027');
|
return !($item->status === 'ST027');
|
||||||
});
|
});
|
||||||
@ -1151,6 +1152,8 @@ function viewIGRDetails()
|
|||||||
$totalReceivedqty = ($ReceivedQuantity-$quantityAsPerInvoice);
|
$totalReceivedqty = ($ReceivedQuantity-$quantityAsPerInvoice);
|
||||||
$POLineItem = array('ReceivedQuantity' => ($totalReceivedqty > 0) ? $totalReceivedqty : 0 );
|
$POLineItem = array('ReceivedQuantity' => ($totalReceivedqty > 0) ? $totalReceivedqty : 0 );
|
||||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONo, $MaterialCode);
|
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONo, $MaterialCode);
|
||||||
|
$POMasterStatus = array('Status' => PO_RELEASED);
|
||||||
|
$this->inwardgateregister_model->UpdatePOMasterStatus($PONo, $POMasterStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Step 5.3 : Updating IGRlineitem
|
# Step 5.3 : Updating IGRlineitem
|
||||||
@ -1393,7 +1396,7 @@ function updateIGRWeight(){
|
|||||||
|
|
||||||
$POMasterStatus = array('Status' => PO_RELEASED);
|
$POMasterStatus = array('Status' => PO_RELEASED);
|
||||||
|
|
||||||
$this->inwardgateregister_model->UpdatePOMasterOGRStatus($pono, $POMasterStatus);
|
$this->inwardgateregister_model->UpdatePOMasterStatus($pono, $POMasterStatus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -326,7 +326,7 @@ class Requisitionform extends BaseController
|
|||||||
$servicePeriod = $this->request->getPost('serviceSchedule');
|
$servicePeriod = $this->request->getPost('serviceSchedule');
|
||||||
// $noOfService = $this->request->getPost('noOfService');
|
// $noOfService = $this->request->getPost('noOfService');
|
||||||
$noOfService = 1;
|
$noOfService = 1;
|
||||||
$IsExists = $this->requistion_model->RequistionIsExists($Requestedby);
|
// $IsExists = $this->requistion_model->RequistionIsExists($Requestedby);
|
||||||
|
|
||||||
|
|
||||||
$Request = array('ReqType' => $RequestType, 'Requestedby' => $Requestedby, 'ReqDate' => $createddt, 'CostCenterCode' => $CostCenter, 'Status' => $Status, 'CreatedDate' => $createddt, 'CreatedBy' => $CreateBy, 'Schedule_Type' => $serviceSchedule, 'NumberOfService' => $noOfService, 'Service_Period' => $servicePeriod, 'RequestedDept' => $RequestedbyDept);
|
$Request = array('ReqType' => $RequestType, 'Requestedby' => $Requestedby, 'ReqDate' => $createddt, 'CostCenterCode' => $CostCenter, 'Status' => $Status, 'CreatedDate' => $createddt, 'CreatedBy' => $CreateBy, 'Schedule_Type' => $serviceSchedule, 'NumberOfService' => $noOfService, 'Service_Period' => $servicePeriod, 'RequestedDept' => $RequestedbyDept);
|
||||||
@ -337,14 +337,10 @@ class Requisitionform extends BaseController
|
|||||||
$Request['ApprovedOn'] = get_current_date_time();
|
$Request['ApprovedOn'] = get_current_date_time();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($IsExists) == 0) {
|
|
||||||
$Req = $this->requistion_model->addRequisition($Request);
|
$Req = $this->requistion_model->addRequisition($Request);
|
||||||
} else {
|
|
||||||
$UpdateReq = $this->requistion_model->UpdateRequistion($Request, $IsExists[0]['ReqNo']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$ReqNumber = (count($Req) > 0) ? $Req[0]['ReqNo']
|
|
||||||
: $IsExists[0]['ReqNo'];
|
$ReqNumber = $Req[0]['ReqNo'];
|
||||||
|
|
||||||
$SkipInsert = "false";
|
$SkipInsert = "false";
|
||||||
for ($i = 1; $i <= $RowCount; $i++) {
|
for ($i = 1; $i <= $RowCount; $i++) {
|
||||||
|
|||||||
@ -616,7 +616,7 @@ class Inwardgateregister_model extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function UpdatePOMasterOGRStatus($pono, $POMasterStatuss)
|
function UpdatePOMasterStatus($pono, $POMasterStatuss)
|
||||||
{
|
{
|
||||||
$this->db->table('t_purchaseorder_master')
|
$this->db->table('t_purchaseorder_master')
|
||||||
->where('PONO', $pono)
|
->where('PONO', $pono)
|
||||||
|
|||||||
@ -380,14 +380,11 @@ class Requistion_model extends Model
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
function addRequisition($Requisition) {
|
function addRequisition($Requisition) {
|
||||||
$this->db->transStart(); // Start transaction
|
|
||||||
|
|
||||||
$result = $this->db->table('t_requestion_master')->insert($Requisition);
|
$result = $this->db->table('t_requestion_master')->insert($Requisition);
|
||||||
$insert_id = $this->db->insertID();
|
$insert_id = $this->db->insertID();
|
||||||
$affected_rows = $this->db->affectedRows();
|
$affected_rows = $this->db->affectedRows();
|
||||||
$this->db->transComplete(); // Complete transaction
|
|
||||||
|
|
||||||
try {
|
|
||||||
if ($affected_rows > 0) {
|
if ($affected_rows > 0) {
|
||||||
$subQuery = 'SELECT ReqNo FROM t_requestion_master ORDER BY CreatedDate DESC LIMIT 1';
|
$subQuery = 'SELECT ReqNo FROM t_requestion_master ORDER BY CreatedDate DESC LIMIT 1';
|
||||||
$query = $this->db->query($subQuery);
|
$query = $this->db->query($subQuery);
|
||||||
@ -396,11 +393,7 @@ class Requistion_model extends Model
|
|||||||
|
|
||||||
return $query->getResultArray();
|
return $query->getResultArray();
|
||||||
} else {
|
} else {
|
||||||
throw new \Exception("Database error occurred, requisition master details not inserted");
|
return [];
|
||||||
}
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
log_message('error', $e->getMessage());
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1526,7 +1526,7 @@
|
|||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
|
||||||
alert(data);
|
alert(data);
|
||||||
// location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -1609,7 +1609,7 @@
|
|||||||
// setTimeout(function () {
|
// setTimeout(function () {
|
||||||
// $("#Igrshow").modal('hide');
|
// $("#Igrshow").modal('hide');
|
||||||
// }, 2000);
|
// }, 2000);
|
||||||
// location.reload();
|
location.reload();
|
||||||
},
|
},
|
||||||
error: function(xhr, status, error) { // Error callback
|
error: function(xhr, status, error) { // Error callback
|
||||||
console.error('AJAX Error:', status, error);
|
console.error('AJAX Error:', status, error);
|
||||||
@ -1655,7 +1655,7 @@
|
|||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
|
||||||
alert(data);
|
alert(data);
|
||||||
// location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user