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) {
|
||||
// return !($item->status === 'ST027' && $item->IsOpenOrder === null);
|
||||
// });
|
||||
// dd($result);
|
||||
$data['PO_NO'] = array_filter($result, function($item) {
|
||||
return !($item->status === 'ST027');
|
||||
});
|
||||
@ -1151,6 +1152,8 @@ function viewIGRDetails()
|
||||
$totalReceivedqty = ($ReceivedQuantity-$quantityAsPerInvoice);
|
||||
$POLineItem = array('ReceivedQuantity' => ($totalReceivedqty > 0) ? $totalReceivedqty : 0 );
|
||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONo, $MaterialCode);
|
||||
$POMasterStatus = array('Status' => PO_RELEASED);
|
||||
$this->inwardgateregister_model->UpdatePOMasterStatus($PONo, $POMasterStatus);
|
||||
}
|
||||
|
||||
# Step 5.3 : Updating IGRlineitem
|
||||
@ -1393,7 +1396,7 @@ function updateIGRWeight(){
|
||||
|
||||
$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');
|
||||
// $noOfService = $this->request->getPost('noOfService');
|
||||
$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);
|
||||
@ -337,14 +337,10 @@ class Requisitionform extends BaseController
|
||||
$Request['ApprovedOn'] = get_current_date_time();
|
||||
}
|
||||
|
||||
if (count($IsExists) == 0) {
|
||||
$Req = $this->requistion_model->addRequisition($Request);
|
||||
} else {
|
||||
$UpdateReq = $this->requistion_model->UpdateRequistion($Request, $IsExists[0]['ReqNo']);
|
||||
}
|
||||
$Req = $this->requistion_model->addRequisition($Request);
|
||||
|
||||
$ReqNumber = (count($Req) > 0) ? $Req[0]['ReqNo']
|
||||
: $IsExists[0]['ReqNo'];
|
||||
|
||||
$ReqNumber = $Req[0]['ReqNo'];
|
||||
|
||||
$SkipInsert = "false";
|
||||
for ($i = 1; $i <= $RowCount; $i++) {
|
||||
@ -372,7 +368,7 @@ class Requisitionform extends BaseController
|
||||
if ($Status == REQ_DRAFT) {
|
||||
$display_message = "Successfully Saved the Requisition details in Draft!\nRequistion Number Is: ". $ReqNumber;
|
||||
// $display_message = "Requistion Saved as Draft!\nRequistion Number Is: ". $ReqNumber;
|
||||
} else if($Status == REQ_APPROVED) {
|
||||
}else if($Status == REQ_APPROVED) {
|
||||
$display_message = "Successfully Updated the Requistion details as Approved!\nRequistion Number Is: ". $ReqNumber;
|
||||
// $display_message = "Requistion Created Successfully!\nRequistion Number Is: ". $ReqNumber;
|
||||
}else{
|
||||
|
||||
@ -148,7 +148,7 @@ class Inwardgateregister_model extends Model
|
||||
$query = $builder->get();
|
||||
|
||||
$result = $query->getResult();
|
||||
// echo $this->db->getLastQuery()->getQuery(); die;
|
||||
// echo $this->db->getLastQuery()->getQuery(); die;
|
||||
|
||||
return $result;
|
||||
}
|
||||
@ -616,7 +616,7 @@ class Inwardgateregister_model extends Model
|
||||
}
|
||||
|
||||
|
||||
function UpdatePOMasterOGRStatus($pono, $POMasterStatuss)
|
||||
function UpdatePOMasterStatus($pono, $POMasterStatuss)
|
||||
{
|
||||
$this->db->table('t_purchaseorder_master')
|
||||
->where('PONO', $pono)
|
||||
|
||||
@ -380,14 +380,11 @@ class Requistion_model extends Model
|
||||
// }
|
||||
|
||||
function addRequisition($Requisition) {
|
||||
$this->db->transStart(); // Start transaction
|
||||
|
||||
$result = $this->db->table('t_requestion_master')->insert($Requisition);
|
||||
$insert_id = $this->db->insertID();
|
||||
$affected_rows = $this->db->affectedRows();
|
||||
$this->db->transComplete(); // Complete transaction
|
||||
|
||||
try {
|
||||
|
||||
if ($affected_rows > 0) {
|
||||
$subQuery = 'SELECT ReqNo FROM t_requestion_master ORDER BY CreatedDate DESC LIMIT 1';
|
||||
$query = $this->db->query($subQuery);
|
||||
@ -396,12 +393,8 @@ class Requistion_model extends Model
|
||||
|
||||
return $query->getResultArray();
|
||||
} 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) {
|
||||
|
||||
alert(data);
|
||||
// location.reload();
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -1609,7 +1609,7 @@
|
||||
// setTimeout(function () {
|
||||
// $("#Igrshow").modal('hide');
|
||||
// }, 2000);
|
||||
// location.reload();
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) { // Error callback
|
||||
console.error('AJAX Error:', status, error);
|
||||
@ -1655,7 +1655,7 @@
|
||||
success: function(data) {
|
||||
|
||||
alert(data);
|
||||
// location.reload();
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user