tracker issues

This commit is contained in:
VE10-Sanjeev 2025-04-25 06:00:17 +00:00
parent dbb94ce103
commit 8b9066e3bd
16 changed files with 296 additions and 55 deletions

View File

@ -322,6 +322,7 @@ $routes->post('ViewIGRDetails', 'Inwardgateregister::viewIGRDetails');
$routes->post('GetIGRLineItemDetails', 'Inwardgateregister::getIGRLineItemDetails'); $routes->post('GetIGRLineItemDetails', 'Inwardgateregister::getIGRLineItemDetails');
$routes->post('SaveIGR', 'Inwardgateregister::SaveIGR');// Save IGR PAGE - Working $routes->post('SaveIGR', 'Inwardgateregister::SaveIGR');// Save IGR PAGE - Working
$routes->post('UpdateIGR', 'Inwardgateregister::UpdateIGR'); $routes->post('UpdateIGR', 'Inwardgateregister::UpdateIGR');
$routes->post('CancelIGR', 'Inwardgateregister::CancelIGR');
$routes->post('updateIGRWeight', 'Inwardgateregister::updateIGRWeight'); $routes->post('updateIGRWeight', 'Inwardgateregister::updateIGRWeight');
$routes->post('ViewIGRHistory', 'Inwardgateregister::ViewIGRHistory'); $routes->post('ViewIGRHistory', 'Inwardgateregister::ViewIGRHistory');
$routes->post('getCostCenterData', 'Inwardgateregister::getCostCenterData'); $routes->post('getCostCenterData', 'Inwardgateregister::getCostCenterData');

View File

@ -611,14 +611,8 @@ class Inwardgateregister extends BaseController
} }
} }
$totalReceivedqty = (int)$IsThisOpenOrderPO == 1 ? 0 : (int)$ReceivedQuantity + (int)$QuantityAsPerInvoice ; $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); $POLineItem = array('ReceivedQuantity' => $totalReceivedqty, 'Status' => $ItemStatus, 'UpdateBY' => $CreatedBy, 'UpdatedOn' => $createddt);
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONO, $MaterialCode); $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);
}
} }
} }
$this->inwardgateregister_model->UpdatePOMaster($PONO, $CreatedBy,$IGRStatus); $this->inwardgateregister_model->UpdatePOMaster($PONO, $CreatedBy,$IGRStatus);
@ -630,7 +624,7 @@ class Inwardgateregister extends BaseController
$this->inwardgateregister_model->POLineItemsupdatestatus($PONO, $Newstatus); $this->inwardgateregister_model->POLineItemsupdatestatus($PONO, $Newstatus);
$this->inwardgateregister_model->pomasterupdatestatus($PONO, $Newstatus); $this->inwardgateregister_model->pomasterupdatestatus($PONO, $Newstatus);
} else { } else {
/*echo 'error' ;*/ /*echo 'Open Order PO' ;*/
}} }}
#finally #finally
$finalstatement = "Successfully Created IGR Number: $IGRNO \n"; $finalstatement = "Successfully Created IGR Number: $IGRNO \n";
@ -799,6 +793,8 @@ function viewIGRDetails()
function UpdateIGR() function UpdateIGR()
{ {
# Step 1 : Gethering Data..
$IGRNo = $this->request->getPost('igr'); $IGRNo = $this->request->getPost('igr');
$PONo = $this->request->getPost('po'); $PONo = $this->request->getPost('po');
@ -817,22 +813,27 @@ function viewIGRDetails()
$IGRStatus = (int)$this->request->getPost('status') == 1 ? IGR_CREATED : IGR_DRAFT; $IGRStatus = (int)$this->request->getPost('status') == 1 ? IGR_CREATED : IGR_DRAFT;
# Here decode the tableData for IGRLineitem
$tableData = $this->request->getPost('tableData'); $tableData = $this->request->getPost('tableData');
if (is_string($tableData)) { if (is_string($tableData)) {
$tableData = json_decode($tableData, true); $tableData = json_decode($tableData, true);
} }
$updateby = $this->session->get('userId'); $updateby = $this->session->get('userId');
# path for file not available means create it
$path = ROOTPATH.'public/uploads/Igrfiles/'; $path = ROOTPATH.'public/uploads/Igrfiles/';
if(!is_dir($path)) { mkdir($path, 0777, true); } if(!is_dir($path)) { mkdir($path, 0777, true); }
$MasterRemarks = $this->request->getPost('MasterRemarks'); $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); $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'); $MasterFile = $this->request->getfile('MasterFile');
$fileupdated_count = 0; $fileupdated_count = 0;
$fileupdated_name = []; $fileupdated_name = [];
# file move to dest. path
if (!empty($MasterFile)) { if (!empty($MasterFile)) {
$requestMasterFileName = $MasterFile->getName(); $requestMasterFileName = $MasterFile->getName();
if ($MasterFile && $MasterFile->isValid() && !$MasterFile->hasMoved()) { if ($MasterFile && $MasterFile->isValid() && !$MasterFile->hasMoved()) {
@ -848,10 +849,12 @@ function viewIGRDetails()
} }
} }
# multiple file
$fileNames = $this->request->getPost('file_name'); $fileNames = $this->request->getPost('file_name');
$files = $this->request->getFileMultiple('emp_file'); $files = $this->request->getFileMultiple('emp_file');
# save and move the multiple file
if(isset($files)) if(isset($files))
{ {
foreach ($files as $index => $file) { foreach ($files as $index => $file) {
@ -878,16 +881,21 @@ function viewIGRDetails()
} }
} }
# Step 2 : inserting IGR History
$this->saveIGRMasterHistory($igrarr,$IGRNo); $this->saveIGRMasterHistory($igrarr,$IGRNo);
$getigrstatus = $this->inwardgateregister_model->getigrstatus($IGRNo); $getigrstatus = $this->inwardgateregister_model->getigrstatus($IGRNo);
$getigrstatus = $getigrstatus->IGRStatus; $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); log_message('error', "Master updated successfully: " . $updateigrmaster);
# Step 4 : loop starts here for IGRlineitem to save
if(!empty($tableData )){ if(!empty($tableData )){
foreach ($tableData as $row) { foreach ($tableData as $row) {
$quantityAsPerInvoice = $row['QuantityAsPerInvoice']; $MaterialCode = $row['MaterialCode'];
$quantityAsPerInvoice = $row['QuantityAsPerInvoice']; // is also known as inward quantity
$remarks = $row['Remarks']; $remarks = $row['Remarks'];
$grossWeight = $row['GrossWeight']; $grossWeight = $row['GrossWeight'];
$grossWeightDate = $row['GrossWeightDate']; $grossWeightDate = $row['GrossWeightDate'];
@ -898,6 +906,7 @@ function viewIGRDetails()
$GrossWtDt = !empty($grossWeightDate) && strtolower($grossWeightDate) !== 'null' ? get_date_time_format($grossWeightDate) : NULL; $GrossWtDt = !empty($grossWeightDate) && strtolower($grossWeightDate) !== 'null' ? get_date_time_format($grossWeightDate) : NULL;
$TareWtDt = !empty($tareWeightDate) && strtolower($tareWeightDate) !== 'null' ? get_date_time_format($tareWeightDate) : NULL; $TareWtDt = !empty($tareWeightDate) && strtolower($tareWeightDate) !== 'null' ? get_date_time_format($tareWeightDate) : NULL;
# Step 4.0 : IGR Lineitem And History Array Formation
$igrline = array( $igrline = array(
'QuantityAsPerInvoice' => $quantityAsPerInvoice, 'QuantityAsPerInvoice' => $quantityAsPerInvoice,
'Remarks' => $remarks, 'Remarks' => $remarks,
@ -909,7 +918,11 @@ function viewIGRDetails()
'IGRItemNo' => $igrItemNo, 'IGRItemNo' => $igrItemNo,
'UpdateBY' => $updateby 'UpdateBY' => $updateby
); );
# Step 4.1 : Save IGRlineitem History
$this->saveIGRLineitemHistory($igrline, $IGRNo,$igrItemNo); $this->saveIGRLineitemHistory($igrline, $IGRNo,$igrItemNo);
# Step 4.2 : Netweight File Details
// $WeightFile = $this->request->getfile('WeightFile'); // $WeightFile = $this->request->getfile('WeightFile');
// $requestWeightFileName = $WeightFile->getName(); // $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); $updateigrlineitem = $this->inwardgateregister_model->updateIGRLineItem($igrline, $igrItemNo);
log_message('error', "lineitem updated successfully: " . $updateigrlineitem); log_message('error', "lineitem updated successfully: " . $updateigrlineitem);
log_message('error', 'UpdateIGR updateigrlineitem: ' . json_encode($igrline)); 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 ($getigrstatus == 'ST027' && ($updateigrmaster > 0 || $updateigrlineitem > 0)) {
if(session()->get('roleText') == 'System Administrator') // id is 1 if(session()->get('roleText') == 'System Administrator') // id is 1
@ -1037,6 +1075,7 @@ function viewIGRDetails()
} }
} }
# Step 6 : Confimation alert message
if ($updateigrmaster > 0) { if ($updateigrmaster > 0) {
$finalstatement = "Successfully Updated IGR Number: $IGRNo \n"; $finalstatement = "Successfully Updated IGR Number: $IGRNo \n";
} else if($updateigrlineitem >0){ } else if($updateigrlineitem >0){
@ -1045,6 +1084,7 @@ function viewIGRDetails()
$finalstatement = "IGR Number: $IGRNo \n"; $finalstatement = "IGR Number: $IGRNo \n";
} }
# Step 6.1 : Display the file names along with Confimation alert message
if ($fileupdated_count > 0) { if ($fileupdated_count > 0) {
$finalstatement .= "Number of files updated: $fileupdated_count \n"; $finalstatement .= "Number of files updated: $fileupdated_count \n";
// $finalstatement .= "Files: \n" . implode(PHP_EOL, $fileupdated_name); // $finalstatement .= "Files: \n" . implode(PHP_EOL, $fileupdated_name);
@ -1056,6 +1096,76 @@ function viewIGRDetails()
echo $finalstatement; 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(){ function updateIGRWeight(){

View File

@ -2595,7 +2595,8 @@ class Purchaseorder extends BaseController
$store = array('Status' => $StatusCode, 'ApprovedOn' => $ApprovedDate, 'Approvedby' => $ApprovedBy, 'Remarks' => $Remarks); $store = array('Status' => $StatusCode, 'ApprovedOn' => $ApprovedDate, 'Approvedby' => $ApprovedBy, 'Remarks' => $Remarks);
$this->purchaseorder_model->UpdatePO($store, $PONO); $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 { } else {
$store = array('Status' => $StatusCode, 'OnHoldOn' => $ApprovedDate, 'OnHoldBy' => $ApprovedBy, 'Remarks' => $Remarks); $store = array('Status' => $StatusCode, 'OnHoldOn' => $ApprovedDate, 'OnHoldBy' => $ApprovedBy, 'Remarks' => $Remarks);
$this->purchaseorder_model->UpdatePO($store, $PONO); $this->purchaseorder_model->UpdatePO($store, $PONO);
@ -2662,11 +2663,11 @@ class Purchaseorder extends BaseController
$store = array('Status' => $StatusCode, 'ReleasedOn' => $ReleasedDate, 'ReleasedBy' => $ReleasedBy, 'Remarks' => $Remarks); $store = array('Status' => $StatusCode, 'ReleasedOn' => $ReleasedDate, 'ReleasedBy' => $ReleasedBy, 'Remarks' => $Remarks);
$this->purchaseorder_model->UpdatePO($store, $PONO); $this->purchaseorder_model->UpdatePO($store, $PONO);
// echo "Successfully Released the Purchase Order No: " . $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 { } else {
$store = array('Status' => $StatusCode, 'OnHoldOn' => $ReleasedDate, 'OnHoldBy' => $ReleasedBy, 'Remarks' => $Remarks); $store = array('Status' => $StatusCode, 'OnHoldOn' => $ReleasedDate, 'OnHoldBy' => $ReleasedBy, 'Remarks' => $Remarks);
$this->purchaseorder_model->UpdatePO($store, $PONO); $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*/ /* Add capital Po*/

View File

@ -571,7 +571,7 @@ class Inwardgateregister_model extends Model
MM.MaterialName,MM.UOM,MM.HSNCODE, MM.MaterialName,MM.UOM,MM.HSNCODE,
sup.Address,sup.SupplierName, sup.Address,sup.SupplierName,
POL.Rate, 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, POM.CapitalRange,POM.CapitalRange,
st.CGST as service_cgst,st.SGST as service_sgst,st.IGST as service_igst, st.CGST as service_cgst,st.SGST as service_sgst,st.IGST as service_igst,
it.IGST as import_igst, it.IGST as import_igst,
@ -721,6 +721,19 @@ class Inwardgateregister_model extends Model
return $result; 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) function GetMRIROutQty($MRIRNO, $MaterialCode)
{ {
@ -1085,6 +1098,19 @@ class Inwardgateregister_model extends Model
$r = $this->db->affectedRows(); $r = $this->db->affectedRows();
return $r; 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) function getpolineqty($NewPO)
{ {
$builder = $this->db->table('t_purchaseorder_lineitem') $builder = $this->db->table('t_purchaseorder_lineitem')

View File

@ -1399,11 +1399,15 @@ if (!empty($getlogpodtl)) {
<?php <?php
if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == SPECIAL_PO) { ?> 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> <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 <?php
} else { ?> } 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>&nbsp;&nbsp;&nbsp;</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>&nbsp;&nbsp;&nbsp;</a>
</td>
<?php <?php
} ?> } ?>
</tr> </tr>
@ -2701,9 +2705,9 @@ if (!empty($getlogpodtl)) {
<td align="right">${basicval}</td> <td align="right">${basicval}</td>
<td align="right">${TotalTaxValue}</td> <td align="right">${TotalTaxValue}</td>
<td align="right">${TotalOrderValue}</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"> <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>
<a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del"> <a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
<span class="ri-delete-bin-7-fill"></span> <span class="ri-delete-bin-7-fill"></span>

View File

@ -496,6 +496,7 @@
<div class="modal-footer"> <div class="modal-footer">
<div class="buttonContainer"> <div class="buttonContainer">
<a class="btn btn-secondary" data-dismiss="modal" value="Close">Close</a> <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="generateIGR" value="generateIGR">Generate IGR</a>
<a class="btn btn-primary" id="draftIGR" value="draftIGR">Save as Draft IGR</a> <a class="btn btn-primary" id="draftIGR" value="draftIGR">Save as Draft IGR</a>
</div> </div>
@ -684,7 +685,9 @@
} }
} else { } else {
$(".a_tag_for_mrir").css("display", "none"); $(".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"); buttonContainer.find("#draftIGR, #generateIGR").css("display", "inline-block");
} else { } else {
buttonContainer.find("#draftIGR").css("display", "none"); buttonContainer.find("#draftIGR").css("display", "none");
@ -991,6 +994,7 @@
var row = $(this); var row = $(this);
++index; ++index;
var rowData = { var rowData = {
MaterialCode: row.find('#MaterialCode' + index).val(),
Quantity: row.find('#txtOrderedQuantity' + index).val(), Quantity: row.find('#txtOrderedQuantity' + index).val(),
QuantityAsPerInvoice: row.find('#txtQuantityAsPerInvoice' + index).val(), QuantityAsPerInvoice: row.find('#txtQuantityAsPerInvoice' + index).val(),
Remarks: row.find('#txtRemarks' + index).val(), Remarks: row.find('#txtRemarks' + index).val(),
@ -1031,6 +1035,7 @@
} else { } else {
console.log("ajax call"); console.log("ajax call");
} }
$('#loader').show();
$.ajax({ $.ajax({
data: formData, data: formData,
type: "POST", type: "POST",
@ -1038,9 +1043,16 @@
processData: false, processData: false,
contentType: false, contentType: false,
success: function(data) { success: function(data) {
alert(data); alert(data);
location.reload(); 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); var row = $(this);
++index; ++index;
var rowData = { var rowData = {
MaterialCode: row.find('#MaterialCode' + index).val(),
Quantity: row.find('#txtOrderedQuantity' + index).val(), Quantity: row.find('#txtOrderedQuantity' + index).val(),
QuantityAsPerInvoice: row.find('#txtQuantityAsPerInvoice' + index).val(), QuantityAsPerInvoice: row.find('#txtQuantityAsPerInvoice' + index).val(),
Remarks: row.find('#txtRemarks' + index).val(), Remarks: row.find('#txtRemarks' + index).val(),
@ -1120,12 +1133,53 @@
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);
alert("An error occurred: " + error); alert("An error occurred: " + error);
// Additional error handling (e.g., showing a custom message)
}, },
complete: function() { // Complete callback complete: function() { // Complete callback
$('#loader').hide(); $('#loader').hide();
console.log('AJAX request completed.'); 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.');
} }
}); });
}); });

View File

@ -3507,9 +3507,9 @@ if (!empty($INRSYMBOL)) {
<td align="right">${basicval}</td> <td align="right">${basicval}</td>
<td align="right">${TotalTaxValue}</td> <td align="right">${TotalTaxValue}</td>
<td align="right">${Total}</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"> <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>&nbsp;&nbsp;&nbsp; <i class="ri-pencil-fill"></i>
</a> </a>
<a href='#' onclick="DeleteRow('${temp}')" class="link" data-id="${temp}" data-userid="${temp}" id="Del"> <a href='#' onclick="DeleteRow('${temp}')" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
<span class="ri-delete-bin-7-fill"></span> <span class="ri-delete-bin-7-fill"></span>

View File

@ -1389,8 +1389,7 @@ if (!empty($POItem) && $CapitalRange == '1') {
<td> <a data-target='#EDITCAPITAL' data-id="<?php echo $index; ?>" <td> <a data-target='#EDITCAPITAL' data-id="<?php echo $index; ?>"
data-userid="<?php echo $index; ?>" data-toggle="modal" data-userid="<?php echo $index; ?>" data-toggle="modal"
href="#EDITCAPITAL"><i class="ri-pencil-fill" href="#EDITCAPITAL"><i class="ri-pencil-fill"></i>&nbsp;&nbsp;&nbsp;</a>
data-toggle="tooltip"></i>&nbsp;&nbsp;&nbsp;</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> --> <!-- <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>&nbsp;&nbsp;&nbsp;</a> </td> --> <!-- <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>&nbsp;&nbsp;&nbsp;</a> </td> -->

View File

@ -1272,17 +1272,18 @@ $(document).ready(function () {
<?php <?php
if ($POStatus == PO_DRAFT || $POStatus == PO_CREATED) { ?> 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 data-userid="<?php echo $index; ?>" data-toggle="modal" href="#EDITCAPITAL"><i
class="ri-pencil-fill" data-toggle="tooltip"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' class="ri-pencil-fill"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#'
onclick="DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>" 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> data-userid="<?php echo $index; ?>" id="Del"><span class="ri-delete-bin-7-fill auditor-restricted-btn"></span></a>
</td>
<?php <?php
} else { ?> } else { ?>
<td> <td style="text-align:center !important">
<a data-target='#VIEWCAPITAL' data-id="<?php echo $index; ?>" <a data-target='#VIEWCAPITAL' data-id="<?php echo $index; ?>"
data-userid="<?php echo $index; ?>" data-toggle="modal" href="#VIEWCAPITAL"><i data-userid="<?php echo $index; ?>" data-toggle="modal" href="#VIEWCAPITAL"><i
class="fa fa-eye" data-toggle="tooltip"></i>&nbsp;&nbsp;&nbsp;</a> class="fa fa-eye"></i>&nbsp;&nbsp;&nbsp;</a>
</td> </td>
<?php <?php
} ?> } ?>
@ -4978,10 +4979,10 @@ $(document).ready(function () {
<td style="text-align:right !important">${basicval}</td> <td style="text-align:right !important">${basicval}</td>
<td style="text-align:right !important">${TotalTaxValue}</td> <td style="text-align:right !important">${TotalTaxValue}</td>
<td style="text-align:right !important">${Total}</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"> <a data-target='#EDITCAPITAL' 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>&nbsp;&nbsp;&nbsp; </a>
<a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del"> <a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
<span class="ri-delete-bin-7-fill"></span> <span class="ri-delete-bin-7-fill"></span>
</a> </a>

View File

@ -1446,7 +1446,7 @@ if (!empty($RequistionDetails)) {
// if($PONOStatus == PO_DRAFT) // 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>&nbsp;&nbsp;&nbsp;</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>&nbsp;&nbsp;&nbsp;</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 <?php
// } else { // } else {
?> ?>

View File

@ -316,6 +316,7 @@ if (!empty($emppay)) {
<tr> <tr>
<th>Due Amount</th> <th>Due Amount</th>
<th>Balance Amount </th> <th>Balance Amount </th>
<th>Due Month</th>
<th>Debit Date</th> <th>Debit Date</th>
</tr> </tr>
</thead> </thead>
@ -325,6 +326,7 @@ if (!empty($emppay)) {
<tr> <tr>
<td><?php echo number_format($history->Due_Amount, 2); ?></td> <td><?php echo number_format($history->Due_Amount, 2); ?></td>
<td><?php echo number_format($history->Balance_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); <td><?php $entryDate = new DateTime($history->Entry_Date);
echo $entryDate->format('F j, Y, g:i A'); ?></td> echo $entryDate->format('F j, Y, g:i A'); ?></td>
</tr> </tr>

View File

@ -1043,13 +1043,13 @@ if (!empty($getlogpodtl)) {
<?php <?php
if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED || $PONOStatus == PO_APPROVED) { ?> 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>&nbsp;&nbsp;&nbsp;</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>&nbsp;&nbsp;&nbsp;</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> <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> </td>
<?php <?php
} else { ?> } 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="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>&nbsp;&nbsp;&nbsp;</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>&nbsp;&nbsp;&nbsp;</a>
</td> </td>
<?php <?php
} ?> } ?>
@ -4365,16 +4365,17 @@ if (!empty($getlogpodtl)) {
<td align="left">${uom}</td> <td align="left">${uom}</td>
<td align="right">${itemRate}</td> <td align="right">${itemRate}</td>
<td align="right">${BasicAmt}</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"> <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> <i class="ri-pencil-fill"></i>
</a>&nbsp;&nbsp;&nbsp; </a>
<a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del"> <a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
<span class="ri-delete-bin-7-fill"></span> <span class="ri-delete-bin-7-fill"></span>
</a> </a>
</td> </td>
</tr> </tr>
`; `;
// data-toggle="tooltip" title="Click here to view/Edit the ${Reqnumber} Requisition details"
setTimeout(() => { setTimeout(() => {
$('#importpomodel').modal('hide'); $('#importpomodel').modal('hide');
}, 1000); }, 1000);

View File

@ -3568,10 +3568,10 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
<td style="text-align:left !important">${uom}</td> <td style="text-align:left !important">${uom}</td>
<td style="text-align:right !important">${itemRate}</td> <td style="text-align:right !important">${itemRate}</td>
<td style="text-align:right !important">${BasicAmt}</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"> <a data-target='#editimportpomodel' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#editimportpomodel">
<i class="ri-pencil-fill" data-toggle="tooltip"></i> <i class="ri-pencil-fill"></i>
</a>&nbsp;&nbsp;&nbsp; </a>
<a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del"> <a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
<span class="ri-delete-bin-7-fill"></span> <span class="ri-delete-bin-7-fill"></span>
</a> </a>

View File

@ -3521,11 +3521,10 @@ if (!empty($INRSYMBOL)) {
<td style="text-align:right !important">${basicval}</td> <td style="text-align:right !important">${basicval}</td>
<td style="text-align:right !important">${TotalTaxValue}</td> <td style="text-align:right !important">${TotalTaxValue}</td>
<td style="text-align:right !important">${TotalOrderValue}</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"> <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>
&nbsp;&nbsp;&nbsp;
<a href='#' onclick="DeleteRow('${temp}')" class="link" data-id="${temp}" data-userid="${temp}" id="Del"> <a href='#' onclick="DeleteRow('${temp}')" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
<span class="ri-delete-bin-7-fill"></span> <span class="ri-delete-bin-7-fill"></span>
</a> </a>

View File

@ -2026,11 +2026,10 @@ if (!empty($INRSYMBOL)) {
<td style="text-align:right !important">${basicval}</td> <td style="text-align:right !important">${basicval}</td>
<td style="text-align:right !important">${TotalTaxValue}</td> <td style="text-align:right !important">${TotalTaxValue}</td>
<td style="text-align:right !important">${TotalOrderValue}</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"> <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>
&nbsp;&nbsp;&nbsp;
<a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del"> <a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
<span class="ri-delete-bin-7-fill"></span> <span class="ri-delete-bin-7-fill"></span>
</a> </a>

View File

@ -292,7 +292,7 @@
<td><?php echo $record->VehicleNo ?></td> <td><?php echo $record->VehicleNo ?></td>
<td><?php echo $record->DriverName ?></td> <td><?php echo $record->DriverName ?></td>
<td><?php echo $record->TransporterName ?></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> <td>
@ -566,6 +566,7 @@
<div class="modal-footer"> <div class="modal-footer">
<div class="buttonContainer"> <div class="buttonContainer">
<a class="btn btn-secondary" data-dismiss="modal" value="Close">Close</a> <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 auditor-restricted" id="generateIGR" value="generateIGR">Generate IGR</a>
<a class="btn btn-primary" id="draftIGR" value="draftIGR">Save as Draft IGR</a> <a class="btn btn-primary" id="draftIGR" value="draftIGR">Save as Draft IGR</a>
</div> </div>
@ -1130,7 +1131,9 @@
} }
} else { } else {
$(".a_tag_for_mrir").css("display", "none"); $(".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"); buttonContainer.find("#draftIGR, #generateIGR").css("display", "inline-block");
} else { } else {
buttonContainer.find("#draftIGR").css("display", "none"); buttonContainer.find("#draftIGR").css("display", "none");
@ -1302,7 +1305,6 @@
if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) { if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) {
$('#QuantityAsPerInvoice' + i).attr('readonly', 'true'); $('#QuantityAsPerInvoice' + i).attr('readonly', 'true');
} }
} }
// other userrole(except admin). based on status we show and here (else if) // other userrole(except admin). based on status we show and here (else if)
else if (userRole !== 1) { else if (userRole !== 1) {
@ -1366,6 +1368,10 @@
if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) { if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) {
$('#QuantityAsPerInvoice' + i).attr('readonly', 'true'); $('#QuantityAsPerInvoice' + i).attr('readonly', 'true');
} }
// if ((item.POPendingQty - item.QuantityAsPerInvoice) == 0.00) {
// $('#QuantityAsPerInvoice' + i).attr('readonly', 'true');
// }
} else { } else {
@ -1515,6 +1521,7 @@
var row = $(this); var row = $(this);
++index; ++index;
var rowData = { var rowData = {
MaterialCode: row.find('#MaterialCode' + index).val(),
Quantity: row.find('#txtOrderedQuantity' + index).val(), Quantity: row.find('#txtOrderedQuantity' + index).val(),
QuantityAsPerInvoice: row.find('#txtQuantityAsPerInvoice' + index).val(), QuantityAsPerInvoice: row.find('#txtQuantityAsPerInvoice' + index).val(),
Remarks: row.find('#txtRemarks' + index).val(), Remarks: row.find('#txtRemarks' + index).val(),
@ -1564,7 +1571,7 @@
success: function(data) { success: function(data) {
alert(data); alert(data);
location.reload(); // location.reload();
} }
}); });
}); });
@ -1589,6 +1596,7 @@
var row = $(this); var row = $(this);
++index; ++index;
var rowData = { var rowData = {
MaterialCode: row.find('#MaterialCode' + index).val(),
Quantity: row.find('#txtOrderedQuantity' + index).val(), Quantity: row.find('#txtOrderedQuantity' + index).val(),
QuantityAsPerInvoice: row.find('#txtQuantityAsPerInvoice' + index).val(), QuantityAsPerInvoice: row.find('#txtQuantityAsPerInvoice' + index).val(),
Remarks: row.find('#txtRemarks' + index).val(), Remarks: row.find('#txtRemarks' + index).val(),
@ -1646,7 +1654,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);
@ -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>
<script> <script>
$(document).ready(function() { $(document).ready(function() {