tracker issues
This commit is contained in:
parent
dbb94ce103
commit
8b9066e3bd
@ -322,6 +322,7 @@ $routes->post('ViewIGRDetails', 'Inwardgateregister::viewIGRDetails');
|
||||
$routes->post('GetIGRLineItemDetails', 'Inwardgateregister::getIGRLineItemDetails');
|
||||
$routes->post('SaveIGR', 'Inwardgateregister::SaveIGR');// Save IGR PAGE - Working
|
||||
$routes->post('UpdateIGR', 'Inwardgateregister::UpdateIGR');
|
||||
$routes->post('CancelIGR', 'Inwardgateregister::CancelIGR');
|
||||
$routes->post('updateIGRWeight', 'Inwardgateregister::updateIGRWeight');
|
||||
$routes->post('ViewIGRHistory', 'Inwardgateregister::ViewIGRHistory');
|
||||
$routes->post('getCostCenterData', 'Inwardgateregister::getCostCenterData');
|
||||
|
||||
@ -611,14 +611,8 @@ class Inwardgateregister extends BaseController
|
||||
}
|
||||
}
|
||||
$totalReceivedqty = (int)$IsThisOpenOrderPO == 1 ? 0 : (int)$ReceivedQuantity + (int)$QuantityAsPerInvoice ;
|
||||
// $totalReceivedqty = $ReceivedQuantity + $QuantityAsPerInvoice;
|
||||
if(((int)$totalReceivedqty > 0) && ((int)$IsThisOpenOrderPO != 1)){
|
||||
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty, 'Status' => $ItemStatus, 'UpdateBY' => $CreatedBy, 'UpdatedOn' => $createddt);
|
||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONO, $MaterialCode);
|
||||
}else if((int)$IsThisOpenOrderPO == 1){
|
||||
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty, 'Status' => $ItemStatus, 'UpdateBY' => $CreatedBy, 'UpdatedOn' => $createddt);
|
||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONO, $MaterialCode);
|
||||
}
|
||||
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty, 'Status' => $ItemStatus, 'UpdateBY' => $CreatedBy, 'UpdatedOn' => $createddt);
|
||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONO, $MaterialCode);
|
||||
}
|
||||
}
|
||||
$this->inwardgateregister_model->UpdatePOMaster($PONO, $CreatedBy,$IGRStatus);
|
||||
@ -630,7 +624,7 @@ class Inwardgateregister extends BaseController
|
||||
$this->inwardgateregister_model->POLineItemsupdatestatus($PONO, $Newstatus);
|
||||
$this->inwardgateregister_model->pomasterupdatestatus($PONO, $Newstatus);
|
||||
} else {
|
||||
/*echo 'error' ;*/
|
||||
/*echo 'Open Order PO' ;*/
|
||||
}}
|
||||
#finally
|
||||
$finalstatement = "Successfully Created IGR Number: $IGRNO \n";
|
||||
@ -799,6 +793,8 @@ function viewIGRDetails()
|
||||
function UpdateIGR()
|
||||
{
|
||||
|
||||
|
||||
# Step 1 : Gethering Data..
|
||||
$IGRNo = $this->request->getPost('igr');
|
||||
$PONo = $this->request->getPost('po');
|
||||
|
||||
@ -817,22 +813,27 @@ function viewIGRDetails()
|
||||
|
||||
$IGRStatus = (int)$this->request->getPost('status') == 1 ? IGR_CREATED : IGR_DRAFT;
|
||||
|
||||
# Here decode the tableData for IGRLineitem
|
||||
$tableData = $this->request->getPost('tableData');
|
||||
if (is_string($tableData)) {
|
||||
$tableData = json_decode($tableData, true);
|
||||
}
|
||||
|
||||
$updateby = $this->session->get('userId');
|
||||
|
||||
# path for file not available means create it
|
||||
$path = ROOTPATH.'public/uploads/Igrfiles/';
|
||||
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
||||
|
||||
$MasterRemarks = $this->request->getPost('MasterRemarks');
|
||||
$igrarr = array('DeliveryChellanDate' => $DeliveryChellanDate, 'MaterialRcvdDate' => $MaterialRcvdDt,'VehicleNo'=>$VehicleNo,'TransporterId'=>$TransporterId,'DriverMobileNumber'=>$DriverMobileNumber,'DriverName'=>$DriverName, 'IGRStatus' => $IGRStatus,'UpdateBY' => $updateby,'DeliveryChellanOrInvoiceNo'=>$DeliveryChellanOrInvoiceNo,'Remark'=>$MasterRemarks);
|
||||
|
||||
# master file
|
||||
$MasterFile = $this->request->getfile('MasterFile');
|
||||
$fileupdated_count = 0;
|
||||
$fileupdated_name = [];
|
||||
|
||||
# file move to dest. path
|
||||
if (!empty($MasterFile)) {
|
||||
$requestMasterFileName = $MasterFile->getName();
|
||||
if ($MasterFile && $MasterFile->isValid() && !$MasterFile->hasMoved()) {
|
||||
@ -848,10 +849,12 @@ function viewIGRDetails()
|
||||
}
|
||||
}
|
||||
|
||||
# multiple file
|
||||
$fileNames = $this->request->getPost('file_name');
|
||||
$files = $this->request->getFileMultiple('emp_file');
|
||||
|
||||
|
||||
# save and move the multiple file
|
||||
if(isset($files))
|
||||
{
|
||||
foreach ($files as $index => $file) {
|
||||
@ -877,17 +880,22 @@ function viewIGRDetails()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Step 2 : inserting IGR History
|
||||
$this->saveIGRMasterHistory($igrarr,$IGRNo);
|
||||
$getigrstatus = $this->inwardgateregister_model->getigrstatus($IGRNo);
|
||||
$getigrstatus = $getigrstatus->IGRStatus;
|
||||
$updateigrmaster = $this->inwardgateregister_model->updateigr($igrarr, $IGRNo);
|
||||
|
||||
# Step 3 : Updating IGR master
|
||||
$updateigrmaster = $this->inwardgateregister_model->updateigr($igrarr, $IGRNo);
|
||||
log_message('error', "Master updated successfully: " . $updateigrmaster);
|
||||
|
||||
# Step 4 : loop starts here for IGRlineitem to save
|
||||
if(!empty($tableData )){
|
||||
|
||||
foreach ($tableData as $row) {
|
||||
$quantityAsPerInvoice = $row['QuantityAsPerInvoice'];
|
||||
$MaterialCode = $row['MaterialCode'];
|
||||
$quantityAsPerInvoice = $row['QuantityAsPerInvoice']; // is also known as inward quantity
|
||||
$remarks = $row['Remarks'];
|
||||
$grossWeight = $row['GrossWeight'];
|
||||
$grossWeightDate = $row['GrossWeightDate'];
|
||||
@ -898,6 +906,7 @@ function viewIGRDetails()
|
||||
$GrossWtDt = !empty($grossWeightDate) && strtolower($grossWeightDate) !== 'null' ? get_date_time_format($grossWeightDate) : NULL;
|
||||
$TareWtDt = !empty($tareWeightDate) && strtolower($tareWeightDate) !== 'null' ? get_date_time_format($tareWeightDate) : NULL;
|
||||
|
||||
# Step 4.0 : IGR Lineitem And History Array Formation
|
||||
$igrline = array(
|
||||
'QuantityAsPerInvoice' => $quantityAsPerInvoice,
|
||||
'Remarks' => $remarks,
|
||||
@ -909,7 +918,11 @@ function viewIGRDetails()
|
||||
'IGRItemNo' => $igrItemNo,
|
||||
'UpdateBY' => $updateby
|
||||
);
|
||||
|
||||
# Step 4.1 : Save IGRlineitem History
|
||||
$this->saveIGRLineitemHistory($igrline, $IGRNo,$igrItemNo);
|
||||
|
||||
# Step 4.2 : Netweight File Details
|
||||
// $WeightFile = $this->request->getfile('WeightFile');
|
||||
// $requestWeightFileName = $WeightFile->getName();
|
||||
|
||||
@ -925,6 +938,27 @@ function viewIGRDetails()
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
# Step 4.3 : IGRlineitem affectedRow have value and MaterialCode have value means
|
||||
# : updated the polineitem Qty
|
||||
$OldQuantityAsPerInvoice = $this->inwardgateregister_model->getOldIgrReceivedQty($IGRNo, $igrItemNo,$MaterialCode);
|
||||
|
||||
if ($MaterialCode != '' && ((int)$quantityAsPerInvoice != (int)$OldQuantityAsPerInvoice)) {
|
||||
|
||||
$PolineitemQty = $this->inwardgateregister_model->getPOLineItemReceivedQty($PONo, $MaterialCode);
|
||||
$POReceivedQuantity = 0.00;
|
||||
if (count($PolineitemQty) > 0) {
|
||||
foreach ($PolineitemQty as $key) {
|
||||
$POReceivedQuantity = $key->ReceivedQuantity;
|
||||
}
|
||||
}
|
||||
|
||||
$totalReceivedqty = ($POReceivedQuantity - $OldQuantityAsPerInvoice) + $quantityAsPerInvoice;
|
||||
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty);
|
||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONo, $MaterialCode);
|
||||
}
|
||||
|
||||
# Step 4.3 : Updating IGRlineitem
|
||||
$updateigrlineitem = $this->inwardgateregister_model->updateIGRLineItem($igrline, $igrItemNo);
|
||||
log_message('error', "lineitem updated successfully: " . $updateigrlineitem);
|
||||
log_message('error', 'UpdateIGR updateigrlineitem: ' . json_encode($igrline));
|
||||
@ -933,6 +967,10 @@ function viewIGRDetails()
|
||||
|
||||
|
||||
}
|
||||
|
||||
# Step 5 : Mail Information
|
||||
# : System Admin means send a mail to Accounts (role-id 1 -> 2 )
|
||||
# : Account means send a mail to System Admin (role-id 2 -> 1 )
|
||||
if ($getigrstatus == 'ST027' && ($updateigrmaster > 0 || $updateigrlineitem > 0)) {
|
||||
|
||||
if(session()->get('roleText') == 'System Administrator') // id is 1
|
||||
@ -1037,6 +1075,7 @@ function viewIGRDetails()
|
||||
}
|
||||
}
|
||||
|
||||
# Step 6 : Confimation alert message
|
||||
if ($updateigrmaster > 0) {
|
||||
$finalstatement = "Successfully Updated IGR Number: $IGRNo \n";
|
||||
} else if($updateigrlineitem >0){
|
||||
@ -1045,6 +1084,7 @@ function viewIGRDetails()
|
||||
$finalstatement = "IGR Number: $IGRNo \n";
|
||||
}
|
||||
|
||||
# Step 6.1 : Display the file names along with Confimation alert message
|
||||
if ($fileupdated_count > 0) {
|
||||
$finalstatement .= "Number of files updated: $fileupdated_count \n";
|
||||
// $finalstatement .= "Files: \n" . implode(PHP_EOL, $fileupdated_name);
|
||||
@ -1056,6 +1096,76 @@ function viewIGRDetails()
|
||||
echo $finalstatement;
|
||||
}
|
||||
|
||||
function CancelIGR(){
|
||||
|
||||
# Step 1 : Gethering Data..
|
||||
$IGRNo = $this->request->getPost('igr');
|
||||
$PONo = $this->request->getPost('po');
|
||||
$IGRStatus = IGR_CANCELLED;
|
||||
$updateby = $this->session->get('userId');
|
||||
$igrarr = array('IGRStatus' => $IGRStatus,'UpdateBY' => $updateby);
|
||||
|
||||
# Step 2 : Here decode the tableData for IGRLineitem
|
||||
$tableData = $this->request->getPost('tableData');
|
||||
if (is_string($tableData)) {
|
||||
$tableData = json_decode($tableData, true);
|
||||
}
|
||||
|
||||
# Step 3 : inserting IGR History
|
||||
$this->saveIGRMasterHistory(array('IGRStatus' => $IGRStatus),$IGRNo);
|
||||
|
||||
# Step 4 : Updating IGR master
|
||||
$updateigrmaster = $this->inwardgateregister_model->updateigr($igrarr, $IGRNo);
|
||||
|
||||
# Step 5 : loop starts here for IGRlineitem to save
|
||||
if(!empty($tableData )){
|
||||
|
||||
foreach ($tableData as $row) {
|
||||
$MaterialCode = $row['MaterialCode'];
|
||||
$quantityAsPerInvoice = $row['QuantityAsPerInvoice']; // is also known as inward quantity
|
||||
$igrItemNo = $row['IGRItemNo'];
|
||||
|
||||
# Step 5.0 : IGR Lineitem And History Array Formation
|
||||
$igrline = array(
|
||||
'QuantityAsPerInvoice' => 0,
|
||||
'UpdateBY' => $updateby,
|
||||
'mIGRStatus' => IGR_CANCELLED
|
||||
);
|
||||
|
||||
# Step 5.1 : Save IGRlineitem History
|
||||
$this->saveIGRLineitemHistory(array('QuantityAsPerInvoice'=>0,'mIGRStatus' => $IGRStatus), $IGRNo,$igrItemNo);
|
||||
|
||||
# Step 5.2 : IGRlineitem affectedRow have value and MaterialCode have value means
|
||||
# : updated the polineitem Qty
|
||||
$oldQuantityAsPerInvoice = $this->inwardgateregister_model->getOldIgrReceivedQty($IGRNo, $igrItemNo,$MaterialCode);
|
||||
if ($MaterialCode != '') {
|
||||
|
||||
$PolineitemQty = $this->inwardgateregister_model->getPOLineItemReceivedQty($PONo, $MaterialCode);
|
||||
$ReceivedQuantity = 0.00;
|
||||
if (count($PolineitemQty) > 0) {
|
||||
foreach ($PolineitemQty as $key) {
|
||||
$ReceivedQuantity = $key->ReceivedQuantity;
|
||||
}
|
||||
}
|
||||
|
||||
$totalReceivedqty = ($ReceivedQuantity-$quantityAsPerInvoice);
|
||||
$POLineItem = array('ReceivedQuantity' => ($totalReceivedqty > 0) ? $totalReceivedqty : 0 );
|
||||
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONo, $MaterialCode);
|
||||
}
|
||||
|
||||
# Step 5.3 : Updating IGRlineitem
|
||||
$updateigrlineitem = $this->inwardgateregister_model->updateIGRLineItem($igrline, $igrItemNo);
|
||||
log_message('error', "lineitem updated successfully: " . $updateigrlineitem);
|
||||
log_message('error', 'UpdateIGR updateigrlineitem: ' . json_encode($igrline));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo "Successfully Cancelled IGR Number: $IGRNo \n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function updateIGRWeight(){
|
||||
|
||||
@ -2595,7 +2595,8 @@ class Purchaseorder extends BaseController
|
||||
|
||||
$store = array('Status' => $StatusCode, 'ApprovedOn' => $ApprovedDate, 'Approvedby' => $ApprovedBy, 'Remarks' => $Remarks);
|
||||
$this->purchaseorder_model->UpdatePO($store, $PONO);
|
||||
echo "Successfully Approve the Purchase Order No: " . $PONO;
|
||||
// echo "Successfully Approve the Purchase Order No: " . $PONO;
|
||||
echo "The Purchase Order No: " . $PONO . " is Approved";
|
||||
} else {
|
||||
$store = array('Status' => $StatusCode, 'OnHoldOn' => $ApprovedDate, 'OnHoldBy' => $ApprovedBy, 'Remarks' => $Remarks);
|
||||
$this->purchaseorder_model->UpdatePO($store, $PONO);
|
||||
@ -2662,11 +2663,11 @@ class Purchaseorder extends BaseController
|
||||
$store = array('Status' => $StatusCode, 'ReleasedOn' => $ReleasedDate, 'ReleasedBy' => $ReleasedBy, 'Remarks' => $Remarks);
|
||||
$this->purchaseorder_model->UpdatePO($store, $PONO);
|
||||
// echo "Successfully Released the Purchase Order No: " . $PONO;
|
||||
echo "The Purchase Order No: " . $PONO . "is Approved";
|
||||
echo "The Purchase Order No: " . $PONO . " is Approved";
|
||||
} else {
|
||||
$store = array('Status' => $StatusCode, 'OnHoldOn' => $ReleasedDate, 'OnHoldBy' => $ReleasedBy, 'Remarks' => $Remarks);
|
||||
$this->purchaseorder_model->UpdatePO($store, $PONO);
|
||||
echo "The Purchase Order No: " . $PONO . "is On Hold";
|
||||
echo "The Purchase Order No: " . $PONO . " is On Hold";
|
||||
}
|
||||
}
|
||||
/* Add capital Po*/
|
||||
|
||||
@ -571,7 +571,7 @@ class Inwardgateregister_model extends Model
|
||||
MM.MaterialName,MM.UOM,MM.HSNCODE,
|
||||
sup.Address,sup.SupplierName,
|
||||
POL.Rate,
|
||||
POM.ServiceDescription,POL.Quantity,POM.POType,POM.IsOpenOrder,
|
||||
POM.ServiceDescription,POL.Quantity, (POL.Quantity - POL.ReceivedQuantity) as POPendingQty, POM.POType,POM.IsOpenOrder,
|
||||
POM.CapitalRange,POM.CapitalRange,
|
||||
st.CGST as service_cgst,st.SGST as service_sgst,st.IGST as service_igst,
|
||||
it.IGST as import_igst,
|
||||
@ -721,6 +721,19 @@ class Inwardgateregister_model extends Model
|
||||
return $result;
|
||||
}
|
||||
|
||||
function getOldIgrReceivedQty($IGRitemNo,$IGR,$MaterialCode){
|
||||
$builder = $this->db->table('t_igr_details')
|
||||
->select('QuantityAsPerInvoice')
|
||||
->where('IGRItemNo', $IGRitemNo)
|
||||
->where('MaterialCode', $MaterialCode)
|
||||
->where('IGRNO', $IGR);
|
||||
|
||||
$query = $builder->get()->getRow();
|
||||
|
||||
$QuantityAsPerInvoice = $query ? $query->QuantityAsPerInvoice : 0;
|
||||
return $QuantityAsPerInvoice;
|
||||
}
|
||||
|
||||
|
||||
function GetMRIROutQty($MRIRNO, $MaterialCode)
|
||||
{
|
||||
@ -1085,6 +1098,19 @@ class Inwardgateregister_model extends Model
|
||||
$r = $this->db->affectedRows();
|
||||
return $r;
|
||||
}
|
||||
function getQuantityAsPerInvoice($IGR,$IGRitemNo,$itemCode){
|
||||
$builder = $this->db->table('t_igr_details')
|
||||
->select('QuantityAsPerInvoice')
|
||||
->where('IGRItemNo', $IGRitemNo)
|
||||
->where('IGRItemNo', $itemCode)
|
||||
->where('IGRNO', $IGR);
|
||||
|
||||
$query = $builder->get()->getRow();
|
||||
|
||||
$QuantityAsPerInvoice = $query ? $query->QuantityAsPerInvoice : 0;
|
||||
return $QuantityAsPerInvoice;
|
||||
|
||||
}
|
||||
function getpolineqty($NewPO)
|
||||
{
|
||||
$builder = $this->db->table('t_purchaseorder_lineitem')
|
||||
|
||||
@ -1399,11 +1399,15 @@ if (!empty($getlogpodtl)) {
|
||||
<?php
|
||||
|
||||
if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == SPECIAL_PO) { ?>
|
||||
<td> <a data-target='#EDITSERVICE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#EDITSERVICE"><i class="ri-pencil-fill" title="Click here to view/Edit the . <?php echo $record->ReqNo; ?> .Requisition details"></i></a>
|
||||
<td align="center">
|
||||
<a data-target='#EDITSERVICE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#EDITSERVICE"><i class="ri-pencil-fill" title="Click here to view/Edit the . <?php echo $record->ReqNo; ?> .Requisition details"></i></a>
|
||||
<a href='#' onclick="DeleteRow(<?php echo $index; ?>)" class="link auditor-restricted-btn" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del"><span class="ri-delete-bin-7-fill"></span></a>
|
||||
</td>
|
||||
<?php
|
||||
} else { ?>
|
||||
<td> <a data-target='#VIEWSERVICE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#VIEWSERVICE"><i class="fa fa-eye" title="<?php echo $record->ReqNo; ?> - Click here to view Requistion details"></i> </a> </td>
|
||||
<td align="center">
|
||||
<a data-target='#VIEWSERVICE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#VIEWSERVICE"><i class="fa fa-eye" title="<?php echo $record->ReqNo; ?> - Click here to view Requistion details"></i> </a>
|
||||
</td>
|
||||
<?php
|
||||
} ?>
|
||||
</tr>
|
||||
@ -2701,9 +2705,9 @@ if (!empty($getlogpodtl)) {
|
||||
<td align="right">${basicval}</td>
|
||||
<td align="right">${TotalTaxValue}</td>
|
||||
<td align="right">${TotalOrderValue}</td>
|
||||
<td>
|
||||
<td align="center">
|
||||
<a data-target='#EDITSERVICE' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITSERVICE">
|
||||
<i class="ri-pencil-fill" data-toggle="tooltip" ></i>
|
||||
<i class="ri-pencil-fill"></i>
|
||||
</a>
|
||||
<a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
|
||||
<span class="ri-delete-bin-7-fill"></span>
|
||||
|
||||
@ -496,6 +496,7 @@
|
||||
<div class="modal-footer">
|
||||
<div class="buttonContainer">
|
||||
<a class="btn btn-secondary" data-dismiss="modal" value="Close">Close</a>
|
||||
<a class="btn btn-primary" id="CancelIGR" value="CancelIGR">Cancel IGR</a>
|
||||
<a class="btn btn-primary" id="generateIGR" value="generateIGR">Generate IGR</a>
|
||||
<a class="btn btn-primary" id="draftIGR" value="draftIGR">Save as Draft IGR</a>
|
||||
</div>
|
||||
@ -684,7 +685,9 @@
|
||||
}
|
||||
} else {
|
||||
$(".a_tag_for_mrir").css("display", "none");
|
||||
if (igrstatus == "ST074") {
|
||||
if(igrstatus == "ST029"){
|
||||
buttonContainer.find("#CancelIGR, #draftIGR, #generateIGR").css("display", "none");
|
||||
}else if (igrstatus == "ST074") {
|
||||
buttonContainer.find("#draftIGR, #generateIGR").css("display", "inline-block");
|
||||
} else {
|
||||
buttonContainer.find("#draftIGR").css("display", "none");
|
||||
@ -991,6 +994,7 @@
|
||||
var row = $(this);
|
||||
++index;
|
||||
var rowData = {
|
||||
MaterialCode: row.find('#MaterialCode' + index).val(),
|
||||
Quantity: row.find('#txtOrderedQuantity' + index).val(),
|
||||
QuantityAsPerInvoice: row.find('#txtQuantityAsPerInvoice' + index).val(),
|
||||
Remarks: row.find('#txtRemarks' + index).val(),
|
||||
@ -1031,6 +1035,7 @@
|
||||
} else {
|
||||
console.log("ajax call");
|
||||
}
|
||||
$('#loader').show();
|
||||
$.ajax({
|
||||
data: formData,
|
||||
type: "POST",
|
||||
@ -1038,9 +1043,16 @@
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(data) {
|
||||
|
||||
alert(data);
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) { // Error callback
|
||||
console.error('AJAX Error:', status, error);
|
||||
alert("An error occurred: " + error);
|
||||
},
|
||||
complete: function() { // Complete callback
|
||||
$('#loader').hide();
|
||||
console.log('AJAX request completed.');
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -1063,6 +1075,7 @@
|
||||
var row = $(this);
|
||||
++index;
|
||||
var rowData = {
|
||||
MaterialCode: row.find('#MaterialCode' + index).val(),
|
||||
Quantity: row.find('#txtOrderedQuantity' + index).val(),
|
||||
QuantityAsPerInvoice: row.find('#txtQuantityAsPerInvoice' + index).val(),
|
||||
Remarks: row.find('#txtRemarks' + index).val(),
|
||||
@ -1120,12 +1133,53 @@
|
||||
error: function(xhr, status, error) { // Error callback
|
||||
console.error('AJAX Error:', status, error);
|
||||
alert("An error occurred: " + error);
|
||||
// Additional error handling (e.g., showing a custom message)
|
||||
},
|
||||
complete: function() { // Complete callback
|
||||
$('#loader').hide();
|
||||
console.log('AJAX request completed.');
|
||||
// Any cleanup or final actions after success/error
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#CancelIGR').click(function() {
|
||||
|
||||
var igrno = $("#IGRNO1").val();
|
||||
var pono = $("#PONO1").val();
|
||||
|
||||
var tableData = [];
|
||||
$('#tbleIGRAppend tr').each(function(index) {
|
||||
var row = $(this);
|
||||
++index;
|
||||
var rowData = {
|
||||
MaterialCode: row.find('#MaterialCode' + index).val(),
|
||||
QuantityAsPerInvoice: row.find('#txtQuantityAsPerInvoice' + index).val(),
|
||||
IGRItemNo: row.find('#txtIGRLineItem' + index).val(),
|
||||
};
|
||||
tableData.push(rowData);
|
||||
});
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('igr', igrno);
|
||||
formData.append('po', pono);
|
||||
formData.append('invno', $("#Invoice_No").val());
|
||||
formData.append('tableData', JSON.stringify(tableData));
|
||||
$('#loader').show();
|
||||
$.ajax({
|
||||
data: formData,
|
||||
type: "POST",
|
||||
url: "<?php echo base_url() ?>CancelIGR",
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(data) {
|
||||
alert(data);
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) { // Error callback
|
||||
console.error('AJAX Error:', status, error);
|
||||
alert("An error occurred: " + error);
|
||||
},
|
||||
complete: function() { // Complete callback
|
||||
$('#loader').hide();
|
||||
console.log('AJAX request completed.');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@ -3507,9 +3507,9 @@ if (!empty($INRSYMBOL)) {
|
||||
<td align="right">${basicval}</td>
|
||||
<td align="right">${TotalTaxValue}</td>
|
||||
<td align="right">${Total}</td>
|
||||
<td>
|
||||
<td style="text-align:center !important">
|
||||
<a data-target='#EDITCAPITAL' id="edit${temp}" data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITREVENUE">
|
||||
<i class="ri-pencil-fill" data-toggle="tooltip" ></i>
|
||||
<i class="ri-pencil-fill"></i>
|
||||
</a>
|
||||
<a href='#' onclick="DeleteRow('${temp}')" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
|
||||
<span class="ri-delete-bin-7-fill"></span>
|
||||
|
||||
@ -1389,8 +1389,7 @@ if (!empty($POItem) && $CapitalRange == '1') {
|
||||
|
||||
<td> <a data-target='#EDITCAPITAL' data-id="<?php echo $index; ?>"
|
||||
data-userid="<?php echo $index; ?>" data-toggle="modal"
|
||||
href="#EDITCAPITAL"><i class="ri-pencil-fill"
|
||||
data-toggle="tooltip"></i> </a>
|
||||
href="#EDITCAPITAL"><i class="ri-pencil-fill"></i> </a>
|
||||
<!-- <a href='#' onclick = "DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del" ><span class="ri-delete-bin-7-fill"></span></a> -->
|
||||
|
||||
<!-- <td> <a data-target='#VIEWCAPITAL' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#VIEWCAPITAL"><i class="fa fa-eye" data-toggle="tooltip" title="Click here to view the <?php echo $record->ReqNo; ?> Requisition details"></i> </a> </td> -->
|
||||
|
||||
@ -1272,17 +1272,18 @@ $(document).ready(function () {
|
||||
<?php
|
||||
|
||||
if ($POStatus == PO_DRAFT || $POStatus == PO_CREATED) { ?>
|
||||
<td> <a data-target='#EDITCAPITAL' data-id="<?php echo $index; ?>"
|
||||
<td style="text-align:center !important"> <a data-target='#EDITCAPITAL' data-id="<?php echo $index; ?>"
|
||||
data-userid="<?php echo $index; ?>" data-toggle="modal" href="#EDITCAPITAL"><i
|
||||
class="ri-pencil-fill" data-toggle="tooltip"></i> </a> <a href='#'
|
||||
class="ri-pencil-fill"></i> </a> <a href='#'
|
||||
onclick="DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>"
|
||||
data-userid="<?php echo $index; ?>" id="Del"><span class="ri-delete-bin-7-fill auditor-restricted-btn"></span></a>
|
||||
</td>
|
||||
<?php
|
||||
} else { ?>
|
||||
<td>
|
||||
<td style="text-align:center !important">
|
||||
<a data-target='#VIEWCAPITAL' data-id="<?php echo $index; ?>"
|
||||
data-userid="<?php echo $index; ?>" data-toggle="modal" href="#VIEWCAPITAL"><i
|
||||
class="fa fa-eye" data-toggle="tooltip"></i> </a>
|
||||
class="fa fa-eye"></i> </a>
|
||||
</td>
|
||||
<?php
|
||||
} ?>
|
||||
@ -4978,10 +4979,10 @@ $(document).ready(function () {
|
||||
<td style="text-align:right !important">${basicval}</td>
|
||||
<td style="text-align:right !important">${TotalTaxValue}</td>
|
||||
<td style="text-align:right !important">${Total}</td>
|
||||
<td>
|
||||
<td style="text-align:center !important">
|
||||
<a data-target='#EDITCAPITAL' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITREVENUE">
|
||||
<i class="ri-pencil-fill" data-toggle="tooltip" ></i>
|
||||
</a>
|
||||
<i class="ri-pencil-fill"></i>
|
||||
</a>
|
||||
<a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
|
||||
<span class="ri-delete-bin-7-fill"></span>
|
||||
</a>
|
||||
|
||||
@ -1446,7 +1446,7 @@ if (!empty($RequistionDetails)) {
|
||||
// if($PONOStatus == PO_DRAFT)
|
||||
// {
|
||||
?>
|
||||
<td> <a data-target='#editimportpomodel' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#editimportpomodel"><i class="ri-pencil-fill" data-toggle="tooltip"></i> </a> <!-- <a href='#' onclick = "DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del" ><span class="ri-delete-bin-7-fill"></span></a>-->
|
||||
<td> <a data-target='#editimportpomodel' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#editimportpomodel"><i class="ri-pencil-fill"></i> </a> <!-- <a href='#' onclick = "DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del" ><span class="ri-delete-bin-7-fill"></span></a>-->
|
||||
<?php
|
||||
// } else {
|
||||
?>
|
||||
|
||||
@ -316,6 +316,7 @@ if (!empty($emppay)) {
|
||||
<tr>
|
||||
<th>Due Amount</th>
|
||||
<th>Balance Amount </th>
|
||||
<th>Due Month</th>
|
||||
<th>Debit Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -325,6 +326,7 @@ if (!empty($emppay)) {
|
||||
<tr>
|
||||
<td><?php echo number_format($history->Due_Amount, 2); ?></td>
|
||||
<td><?php echo number_format($history->Balance_Amount, 2); ?></td>
|
||||
<td><?php echo get_date_time_dynamical_format('m-Y','F Y',$history->Due_Date); ?></td>
|
||||
<td><?php $entryDate = new DateTime($history->Entry_Date);
|
||||
echo $entryDate->format('F j, Y, g:i A'); ?></td>
|
||||
</tr>
|
||||
|
||||
@ -1043,13 +1043,13 @@ if (!empty($getlogpodtl)) {
|
||||
<?php
|
||||
|
||||
if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED || $PONOStatus == PO_APPROVED) { ?>
|
||||
<td> <a data-target='#editimportpomodel' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#editimportpomodel"><i class="ri-pencil-fill" data-toggle="tooltip"></i> </a>
|
||||
<td align="center"> <a data-target='#editimportpomodel' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#editimportpomodel"><i class="ri-pencil-fill"></i> </a>
|
||||
<a href='#' onclick="DeleteRow(<?php echo $index; ?>)" class="link auditor-restricted-btn" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del"><span class="ri-delete-bin-7-fill"></span></a>
|
||||
</td>
|
||||
<?php
|
||||
} else { ?>
|
||||
<!-- <td> <a data-target='#viewimportmodal' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#viewimportmodal"><i class="fa fa-eye" data-toggle="tooltip" title="Click here to view the <?php echo $record->ReqNo; ?> Requisition details"></i></a> </td> -->
|
||||
<td> <a data-target='#viewimportmodal' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#viewimportmodal"><i class=" ri-eye-fill" data-toggle="tooltip"></i> </a>
|
||||
<td align="center"> <a data-target='#viewimportmodal' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#viewimportmodal"><i class=" ri-eye-fill"></i> </a>
|
||||
</td>
|
||||
<?php
|
||||
} ?>
|
||||
@ -4365,16 +4365,17 @@ if (!empty($getlogpodtl)) {
|
||||
<td align="left">${uom}</td>
|
||||
<td align="right">${itemRate}</td>
|
||||
<td align="right">${BasicAmt}</td>
|
||||
<td>
|
||||
<td align="center">
|
||||
<a data-target='#editimportpomodel' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#editimportpomodel">
|
||||
<i class="ri-pencil-fill" data-toggle="tooltip" title="Click here to view/Edit the ${Reqnumber} Requisition details"></i>
|
||||
</a>
|
||||
<i class="ri-pencil-fill"></i>
|
||||
</a>
|
||||
<a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
|
||||
<span class="ri-delete-bin-7-fill"></span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
// data-toggle="tooltip" title="Click here to view/Edit the ${Reqnumber} Requisition details"
|
||||
setTimeout(() => {
|
||||
$('#importpomodel').modal('hide');
|
||||
}, 1000);
|
||||
|
||||
@ -3568,10 +3568,10 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
|
||||
<td style="text-align:left !important">${uom}</td>
|
||||
<td style="text-align:right !important">${itemRate}</td>
|
||||
<td style="text-align:right !important">${BasicAmt}</td>
|
||||
<td>
|
||||
<td style="text-align:center !important">
|
||||
<a data-target='#editimportpomodel' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#editimportpomodel">
|
||||
<i class="ri-pencil-fill" data-toggle="tooltip"></i>
|
||||
</a>
|
||||
<i class="ri-pencil-fill"></i>
|
||||
</a>
|
||||
<a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
|
||||
<span class="ri-delete-bin-7-fill"></span>
|
||||
</a>
|
||||
|
||||
@ -3521,11 +3521,10 @@ if (!empty($INRSYMBOL)) {
|
||||
<td style="text-align:right !important">${basicval}</td>
|
||||
<td style="text-align:right !important">${TotalTaxValue}</td>
|
||||
<td style="text-align:right !important">${TotalOrderValue}</td>
|
||||
<td>
|
||||
<td style="text-align:center !important">
|
||||
<a data-target='#EDITREVENUE' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITREVENUE">
|
||||
<i class="ri-pencil-fill" data-toggle="tooltip"></i>
|
||||
<i class="ri-pencil-fill"></i>
|
||||
</a>
|
||||
|
||||
<a href='#' onclick="DeleteRow('${temp}')" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
|
||||
<span class="ri-delete-bin-7-fill"></span>
|
||||
</a>
|
||||
|
||||
@ -2026,11 +2026,10 @@ if (!empty($INRSYMBOL)) {
|
||||
<td style="text-align:right !important">${basicval}</td>
|
||||
<td style="text-align:right !important">${TotalTaxValue}</td>
|
||||
<td style="text-align:right !important">${TotalOrderValue}</td>
|
||||
<td>
|
||||
<td style="text-align:center !important">
|
||||
<a data-target='#EDITSERVICELINEITEM' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITSERVICELINEITEM">
|
||||
<i class="ri-pencil-fill" data-toggle="tooltip"></i>
|
||||
<i class="ri-pencil-fill"></i>
|
||||
</a>
|
||||
|
||||
<a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
|
||||
<span class="ri-delete-bin-7-fill"></span>
|
||||
</a>
|
||||
|
||||
@ -292,7 +292,7 @@
|
||||
<td><?php echo $record->VehicleNo ?></td>
|
||||
<td><?php echo $record->DriverName ?></td>
|
||||
<td><?php echo $record->TransporterName ?></td>
|
||||
<td><?php echo $record->IGRStatus == 'ST074' ? 'Draft' : 'Completed'; ?></td>
|
||||
<td><?php if($record->IGRStatus == 'ST029'){ echo 'Cancel'; } elseif($record->IGRStatus == 'ST074'){ echo 'Draft'; } else{ echo 'Completed'; } ?></td>
|
||||
<td>
|
||||
|
||||
|
||||
@ -566,6 +566,7 @@
|
||||
<div class="modal-footer">
|
||||
<div class="buttonContainer">
|
||||
<a class="btn btn-secondary" data-dismiss="modal" value="Close">Close</a>
|
||||
<a class="btn btn-primary" id="CancelIGR" value="CancelIGR">Cancel IGR</a>
|
||||
<a class="btn btn-primary auditor-restricted" id="generateIGR" value="generateIGR">Generate IGR</a>
|
||||
<a class="btn btn-primary" id="draftIGR" value="draftIGR">Save as Draft IGR</a>
|
||||
</div>
|
||||
@ -1130,7 +1131,9 @@
|
||||
}
|
||||
} else {
|
||||
$(".a_tag_for_mrir").css("display", "none");
|
||||
if (igrstatus == "ST074") {
|
||||
if(igrstatus == "ST029"){
|
||||
buttonContainer.find("#CancelIGR, #draftIGR, #generateIGR").css("display", "none");
|
||||
}else if (igrstatus == "ST074") {
|
||||
buttonContainer.find("#draftIGR, #generateIGR").css("display", "inline-block");
|
||||
} else {
|
||||
buttonContainer.find("#draftIGR").css("display", "none");
|
||||
@ -1302,7 +1305,6 @@
|
||||
if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) {
|
||||
$('#QuantityAsPerInvoice' + i).attr('readonly', 'true');
|
||||
}
|
||||
|
||||
}
|
||||
// other userrole(except admin). based on status we show and here (else if)
|
||||
else if (userRole !== 1) {
|
||||
@ -1366,6 +1368,10 @@
|
||||
if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) {
|
||||
$('#QuantityAsPerInvoice' + i).attr('readonly', 'true');
|
||||
}
|
||||
// if ((item.POPendingQty - item.QuantityAsPerInvoice) == 0.00) {
|
||||
// $('#QuantityAsPerInvoice' + i).attr('readonly', 'true');
|
||||
// }
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
@ -1515,6 +1521,7 @@
|
||||
var row = $(this);
|
||||
++index;
|
||||
var rowData = {
|
||||
MaterialCode: row.find('#MaterialCode' + index).val(),
|
||||
Quantity: row.find('#txtOrderedQuantity' + index).val(),
|
||||
QuantityAsPerInvoice: row.find('#txtQuantityAsPerInvoice' + index).val(),
|
||||
Remarks: row.find('#txtRemarks' + index).val(),
|
||||
@ -1564,7 +1571,7 @@
|
||||
success: function(data) {
|
||||
|
||||
alert(data);
|
||||
location.reload();
|
||||
// location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -1589,6 +1596,7 @@
|
||||
var row = $(this);
|
||||
++index;
|
||||
var rowData = {
|
||||
MaterialCode: row.find('#MaterialCode' + index).val(),
|
||||
Quantity: row.find('#txtOrderedQuantity' + index).val(),
|
||||
QuantityAsPerInvoice: row.find('#txtQuantityAsPerInvoice' + index).val(),
|
||||
Remarks: row.find('#txtRemarks' + index).val(),
|
||||
@ -1646,7 +1654,7 @@
|
||||
// setTimeout(function () {
|
||||
// $("#Igrshow").modal('hide');
|
||||
// }, 2000);
|
||||
location.reload();
|
||||
// location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) { // Error callback
|
||||
console.error('AJAX Error:', status, error);
|
||||
@ -1660,6 +1668,42 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
$('#CancelIGR').click(function() {
|
||||
|
||||
var igrno = $("#IGRNO1").val();
|
||||
var pono = $("#PONO1").val();
|
||||
|
||||
var tableData = [];
|
||||
$('#tbleIGRAppend tr').each(function(index) {
|
||||
var row = $(this);
|
||||
++index;
|
||||
var rowData = {
|
||||
MaterialCode: row.find('#MaterialCode' + index).val(),
|
||||
QuantityAsPerInvoice: row.find('#txtQuantityAsPerInvoice' + index).val(),
|
||||
IGRItemNo: row.find('#txtIGRLineItem' + index).val(),
|
||||
};
|
||||
tableData.push(rowData);
|
||||
});
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('igr', igrno);
|
||||
formData.append('po', pono);
|
||||
formData.append('invno', $("#Invoice_No").val());
|
||||
formData.append('tableData', JSON.stringify(tableData));
|
||||
|
||||
$.ajax({
|
||||
data: formData,
|
||||
type: "POST",
|
||||
url: "<?php echo base_url() ?>CancelIGR",
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(data) {
|
||||
|
||||
alert(data);
|
||||
// location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user