Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme

This commit is contained in:
vadivelJ96 2025-04-28 11:59:44 +05:30
commit 1bada0fec3
34 changed files with 464 additions and 146 deletions

View File

@ -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');

View File

@ -346,7 +346,7 @@ class Employeedetails extends BaseController
'esi_applicable' => $esi_applicable,
'pf_applicable' => $pf_applicable,
'work_location' => $work_location,
'is_driver' => $is_driver,
'is_driver' => ($is_driver === null || $is_driver === '') ? 0 : $is_driver,
);
//print_r($Employee);die();
@ -854,7 +854,7 @@ class Employeedetails extends BaseController
'ESI' => $esino,
'NomineeDetails' => $Nominee,
'is_management_team' => $is_management_team,
'is_driver' => $is_driver,
'is_driver' => ($is_driver === null || $is_driver === '') ? 0 : $is_driver,
'esi_applicable' => $esi_applicable,
'pf_applicable' => $pf_applicable,
'work_location' => $work_location,

View File

@ -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');
});
@ -611,14 +612,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 +625,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 +794,8 @@ function viewIGRDetails()
function UpdateIGR()
{
# Step 1 : Gethering Data..
$IGRNo = $this->request->getPost('igr');
$PONo = $this->request->getPost('po');
@ -817,22 +814,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 +850,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 +881,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 +907,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 +919,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 +939,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 +968,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 +1076,7 @@ function viewIGRDetails()
}
}
# Step 6 : Confimation alert message
if ($updateigrmaster > 0) {
$finalstatement = "Successfully Updated IGR Number: $IGRNo \n";
} else if($updateigrlineitem >0){
@ -1045,6 +1085,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 +1097,78 @@ 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);
$POMasterStatus = array('Status' => PO_RELEASED);
$this->inwardgateregister_model->UpdatePOMasterStatus($PONo, $POMasterStatus);
}
# 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(){
@ -1283,7 +1396,7 @@ function updateIGRWeight(){
$POMasterStatus = array('Status' => PO_RELEASED);
$this->inwardgateregister_model->UpdatePOMasterOGRStatus($pono, $POMasterStatus);
$this->inwardgateregister_model->UpdatePOMasterStatus($pono, $POMasterStatus);
}
}

View File

@ -585,7 +585,7 @@ class Purchaseorder extends BaseController
$ReqType = $this->request->getVar('ReqType');
$Req = $this->purchaseorder_model->getRequistionNoFromPO($PONO);
$data['ReqList'] = $Req;
$result = array();
@ -1461,13 +1461,12 @@ class Purchaseorder extends BaseController
}
}
$ReqDetails = array('Quantity' => $Quantity, 'UpdatedBy' => $updatedBy, 'UpdatedOn' => $updateddt);
$this->purchaseorder_model->updateReqDetails($Reqnumber, $MaterialCode, $ReqDetails);
$recqty = 0;
if ($POStatus == SPECIAL_PO) {
$ReqDetails = array('Quantity' => $Quantity, 'UpdatedBy' => $updatedBy, 'UpdatedOn' => $updateddt);
$this->purchaseorder_model->updateReqDetails($Reqnumber, $MaterialCode, $ReqDetails);
$recqty = $Quantity;
@ -1485,9 +1484,6 @@ class Purchaseorder extends BaseController
$MaterialstockHistoryupdate = array('SupplierID' => $SupplierID, 'Quantity' => $Quantity, 'ItemValue' => $itemRate, 'UpdatedBY' => $updatedBy, 'UpdatedOn' => $updateddt);
$this->purchaseorder_model->updateMatStock(
$itemNo,
$MaterialstockHistoryupdate
@ -1510,17 +1506,26 @@ class Purchaseorder extends BaseController
$this->inwardgateregister_model->addmaterialmaster($current_qty, $MaterialCode);
}
/*------------------------------*/
$this->requistion_model = new requistion_model();
$RetItemNo = $this->requistion_model->getItemNumber($Reqnumber, $MaterialCode);
$ItemNo = '';
if (count($RetItemNo) > 0) {
$ItemNo = $RetItemNo[0]['ItemNo'];
}
$getOldReqDetailsQuantity = $this->purchaseorder_model->getOldReqDetailsQuantity($Reqnumber, $MaterialCode,$ItemNo);
if($Quantity == $getOldReqDetailsQuantity){
$ReqDetails = array('Quantity' => $Quantity, 'UpdatedBy' => $updatedBy, 'UpdatedOn' => $updateddt);
$this->purchaseorder_model->updateReqDetails($Reqnumber, $MaterialCode, $ReqDetails);
}
/*------------------------------*/
if ($SkipInsert == "False") {
if (strlen((string)$POLineItemNo) == 0) {
$this->requistion_model = new requistion_model();
$RetItemNo = $this->requistion_model->getItemNumber($Reqnumber, $MaterialCode);
$ItemNo = '';
if (count($RetItemNo) > 0) {
$ItemNo = $RetItemNo[0]['ItemNo'];
}
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'ReceivedQuantity' => $recqty, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $updatedBy, 'CreatedDate' => $updateddt, 'CostCenterCode' => $CostCenter,'LineitemAuditorNotes'=>$LineitemAuditorNotes );
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
@ -2497,12 +2502,20 @@ class Purchaseorder extends BaseController
/*------------------------------*/
$ReqDetails = array('Quantity' => $Quantity, 'UpdatedBy' => $CreateBy, 'UpdatedOn' => $updateddt);
//print_r($ReqDetails);
$this->purchaseorder_model->updateReqDetails($Reqnumber, $MaterialCode, $ReqDetails);
$this->requistion_model = new requistion_model();
$RetItemNo = $this->requistion_model->getItemNumber($Reqnumber, $MaterialCode);
$ItemNo = '';
if (count($RetItemNo) > 0) {
$ItemNo = $RetItemNo[0]['ItemNo'];
}
$getOldReqDetailsQuantity = $this->purchaseorder_model->getOldReqDetailsQuantity($Reqnumber, $MaterialCode,$ItemNo);
if($Quantity == $getOldReqDetailsQuantity){
$ReqDetails = array('Quantity' => $Quantity, 'UpdatedBy' => $CreateBy, 'UpdatedOn' => $updateddt);
$this->purchaseorder_model->updateReqDetails($Reqnumber, $MaterialCode, $ReqDetails);
}
/*------------------------------*/
if ($SkipInsert == "False") {
if (strlen((string)$POLineItemNo) == 0) {
@ -2595,7 +2608,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 +2676,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*/
@ -3251,13 +3265,19 @@ class Purchaseorder extends BaseController
}
/*------------------------------*/
$ReqDetails = array('Quantity' => $Quantity, 'UpdatedBy' => $CreateBy, 'UpdatedOn' => $updateddt);
//print_r($ReqDetails);
$this->purchaseorder_model->updateReqDetails($Reqnumber, $MaterialCode, $ReqDetails);
$this->requistion_model = new requistion_model();
$RetItemNo = $this->requistion_model->getItemNumber($Reqnumber, $MaterialCode);
$ItemNo = '';
if (count($RetItemNo) > 0) {
$ItemNo = $RetItemNo[0]['ItemNo'];
}
$getOldReqDetailsQuantity = $this->purchaseorder_model->getOldReqDetailsQuantity($Reqnumber, $MaterialCode,$ItemNo);
if($Quantity == $getOldReqDetailsQuantity){
$ReqDetails = array('Quantity' => $Quantity, 'UpdatedBy' => $CreateBy, 'UpdatedOn' => $updateddt);
$this->purchaseorder_model->updateReqDetails($Reqnumber, $MaterialCode, $ReqDetails);
}
/*------------------------------*/

View File

@ -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{

View File

@ -490,8 +490,18 @@ class Servicepurchaseorder extends BaseController
/*------------------------------ Quantity update the req details --*/
//if($MaterialCode!= ''){
$ReqDetails = array('Quantity' => $Quantity, 'UpdatedBy' => $updatedBy, 'UpdatedOn' => $updateddt);
$this->purchaseorder_model->updateReqDetails($Reqnumber, $MaterialCode, $ReqDetails);
$this->requistion_model = new requistion_model();
$RetItemNo = $this->requistion_model->getItemNumber($Reqnumber, $MaterialCode);
$ItemNo = '';
if (count($RetItemNo) > 0) {
$ItemNo = $RetItemNo[0]['ItemNo'];
}
$getOldReqDetailsQuantity = $this->purchaseorder_model->getOldReqDetailsQuantity($Reqnumber, $MaterialCode,$ItemNo);
if($Quantity == $getOldReqDetailsQuantity){
$ReqDetails = array('Quantity' => $Quantity, 'UpdatedBy' => $updatedBy, 'UpdatedOn' => $updateddt);
$this->purchaseorder_model->updateReqDetails($Reqnumber, $MaterialCode, $ReqDetails);
}
// }
/*------------------------------------------------------------------*/

View File

@ -1136,7 +1136,7 @@ group by month(created_date)";
}
function category()
{
$sql = "SELECT distinct Category FROM t_materialmaster;";
$sql = "SELECT distinct Category,cd.ConfigValue as Category_name FROM t_materialmaster left join t_configdetails cd on cd.key = t_materialmaster.Category;";
$query = $this->db->query($sql);
return $query->getResult();
}
@ -1395,11 +1395,13 @@ group by supplier_name,material_name
function report_cum_month($sup = null, $mat = null)
{
$sql = "SELECT sd.SupplierID as sid,mm.MaterialCode as mid,sd.SupplierName as supplier_name,ifnull(mm.MaterialName,'-') as material_name,IF(pl.Quantity IS NULL or pl.Quantity = '', 0, sum(pl.Quantity)) as tquantity,ifnull(sum(pl.Quantity * pl.Rate),0) as ttotal
$sql = "SELECT sd.SupplierID as sid,mm.MaterialCode as mid,sd.SupplierName as supplier_name,ifnull(mm.MaterialName,'-') as material_name,IF(pl.Quantity IS NULL or pl.Quantity = '', 0, sum(pl.Quantity)) as tquantity,ifnull(sum(pl.Quantity * pl.Rate),0) as ttotal,
cd.Key as category_id,cd.ConfigValue as category_name
FROM t_purchaseorder_master pm
left join t_purchaseorder_lineitem pl on pl.PONO = pm.PONO
left join t_materialmaster mm on mm.MaterialCode = pl.MaterialCode
left join t_supplierdetailsn sd on sd.SupplierID = pm.SupplierID
left join t_configdetails cd on cd.key = mm.category
where pm.Status != 'ST030' and pm.Status != 'ST056' and pm.Status != 'ST027' and sd.SupplierName is not null and month(pm.PODate) = month(current_date()) and sd.SupplierID = '" . $sup . "' and mm.MaterialCode = '" . $mat . "'
group by supplier_name,material_name";
$query = $this->db->query($sql);
@ -1445,7 +1447,7 @@ group by supplier_name,material_name";
{
$sql = "select im.IGRNO as igrn,pm.POType as potype,im.PONO as pono,date_format(im.CreatedDate,'%d-%m-%Y') as created_date,TIME_FORMAT(im.CreatedDate,'%l:%i %p') as created_time,mm.MaterialName as material_name,mm.Category as category,sd.SupplierName as supplier_name,mm.UOM as UOM, id.QuantityAsPerInvoice as quantity,pl.Rate as rate,round(id.QuantityAsPerInvoice * pl.Rate,2) as value,if(POType = 'IMPORT' or POType = 'CAPITAL',pm.ExchangeRate,0) as exchange_rate,date_format(im.MaterialRcvdDate,'%d-%m-%Y') as materialrcvddate,
$sql = "select cd.ConfigValue as category_name,im.IGRNO as igrn,pm.POType as potype,im.PONO as pono,date_format(im.CreatedDate,'%d-%m-%Y') as created_date,TIME_FORMAT(im.CreatedDate,'%l:%i %p') as created_time,mm.MaterialName as material_name,mm.Category as category,sd.SupplierName as supplier_name,mm.UOM as UOM, id.QuantityAsPerInvoice as quantity,pl.Rate as rate,round(id.QuantityAsPerInvoice * pl.Rate,2) as value,if(POType = 'IMPORT' or POType = 'CAPITAL',pm.ExchangeRate,0) as exchange_rate,date_format(im.MaterialRcvdDate,'%d-%m-%Y') as materialrcvddate,
round(ifnull(if(POType = 'REVENUE',
(id.QuantityAsPerInvoice * rt.AfterSGST / pl.Quantity),
(id.QuantityAsPerInvoice * st.After_SGST / pl.Quantity)),0),2) as sgst,
@ -1496,6 +1498,7 @@ left join t_service_tax st on st.LineItemNo = pl.LineItemNo
left join t_revenue_tax rt on rt.LineItemNo = pl.LineItemNo
left join t_purchaseorder_billupload pb on pb.IGRNO=im.IGRNO
left join t_inwardgateregister_fileupload infiles on infiles.IGRNO = im.IGRNO
left join t_configdetails cd on cd.key = mm.category
where pm.Status != 'ST030' ";
if ($cname != '') {
@ -1545,7 +1548,7 @@ where pm.Status != 'ST030' ";
{
$sql = "select im.IGRNO as igrn,pm.POType as potype,im.PONO as pono,date_format(im.CreatedDate,'%d-%m-%Y') as created_date,TIME_FORMAT(im.CreatedDate,'%l:%i %p') as created_time,mm.MaterialName as material_name,mm.Category as category,sd.SupplierName as supplier_name,mm.UOM as UOM, id.QuantityAsPerInvoice as quantity,pl.Rate as rate,round(id.QuantityAsPerInvoice * pl.Rate,2) as value,if(POType = 'IMPORT' or POType = 'CAPITAL',pm.ExchangeRate,0) as exchange_rate,date_format(im.MaterialRcvdDate,'%d-%m-%Y') as materialrcvddate,
$sql = "select im.IGRNO as igrn,pm.POType as potype,im.PONO as pono,date_format(im.CreatedDate,'%d-%m-%Y') as created_date,TIME_FORMAT(im.CreatedDate,'%l:%i %p') as created_time,mm.MaterialName as material_name,mm.Category as category,sd.SupplierName as supplier_name,mm.UOM as UOM, id.QuantityAsPerInvoice as quantity,pl.Rate as rate,round(id.QuantityAsPerInvoice * pl.Rate,2) as value,if(POType = 'IMPORT' or POType = 'CAPITAL',pm.ExchangeRate,0) as exchange_rate,date_format(im.MaterialRcvdDate,'%d-%m-%Y') as materialrcvddate,cd.ConfigValue as category_name,
round(ifnull(if(POType = 'REVENUE',
(id.QuantityAsPerInvoice * rt.AfterSGST / pl.Quantity),
(id.QuantityAsPerInvoice * st.After_SGST / pl.Quantity)),0),2) as sgst,
@ -1591,6 +1594,7 @@ left join t_purchaseorder_lineitem pl on pl.PONO = im.PONO
join t_igr_details id on id.IGRNO = im.IGRNO and id.MaterialCode = pl.MaterialCode
join t_purchaseorder_master pm on pm.PONO = pl.PONO
left join t_materialmaster mm on mm.MaterialCode = pl.MaterialCode
left join t_configdetails cd on cd.Key = mm.category
left join t_supplierdetailsn sd on sd.SupplierID = pm.SupplierID
left join t_service_tax st on st.LineItemNo = pl.LineItemNo
left join t_revenue_tax rt on rt.LineItemNo = pl.LineItemNo
@ -2018,8 +2022,9 @@ group by supplier_name,material_name";
$ab = $yearl;
$fa = substr($ab, 0, -5);
$aa = substr($ab, 5, 5);
$sql = "SELECT sid,mid,supplier_name,material_name,IF(Quantity IS NULL or Quantity = '', 0, sum(Quantity)) as tquantity,sum(value) as ttotal
$sql = "SELECT sid,mid,supplier_name,material_name,IF(Quantity IS NULL or Quantity = '', 0, sum(Quantity)) as tquantity,sum(value) as ttotal,cd.ConfigValue as category_name
FROM igr
left join t_configdetails cd on cd.key = year.category
where status != 'ST030' and
(materialrcvddate >= '" . $fa . "-04-01' and materialrcvddate <= '" . $aa . "-03-31')
and sid = '" . $sup . "' and mid= '" . $mat . "'
@ -2031,8 +2036,9 @@ group by supplier_name,material_name
function ireport_cum_day($sup = null, $mat = null)
{
$sql = "SELECT sid,mid,supplier_name,material_name,IF(Quantity IS NULL or Quantity = '', 0, sum(Quantity)) as tquantity,sum(value) as ttotal
$sql = "SELECT sid,mid,supplier_name,material_name,IF(Quantity IS NULL or Quantity = '', 0, sum(Quantity)) as tquantity,sum(value) as ttotal,cd.ConfigValue as category_name
FROM igr
left join t_configdetails cd on cd.key = year.category
where status != 'ST030' and
date(materialrcvddate) = current_date() and sid = '" . $sup . "' and mid = '" . $mat . "'
group by supplier_name,material_name";
@ -2049,8 +2055,8 @@ group by supplier_name,material_name";
$ab = $yearl;
$fa = substr($ab, 0, -5);
$aa = substr($ab, 5, 5);
$sql = "SELECT cd.ConfigValue as category_id,
cd.key, year.category,year.quantity as quantity,year.total as total,month.mquantity as mquantity,month.mtotal as mtotal,today.tquantity as tquantity,today.ttotal as ttotal
$sql = "SELECT cd.ConfigValue as category_name,cd.key as category_id,
year.category,year.quantity as quantity,year.total as total,month.mquantity as mquantity,month.mtotal as mtotal,today.tquantity as tquantity,today.ttotal as ttotal
FROM (SELECT category,sum(Quantity) as quantity,sum(value) as total
FROM igr
where status != 'ST030' and
@ -2085,8 +2091,9 @@ group by category ";
$ab = $yearl;
$fa = substr($ab, 0, -5);
$aa = substr($ab, 5, 5);
$sql = "SELECT category,sid,mid,supplier_name,material_name,IF(Quantity IS NULL or Quantity = '', 0, sum(Quantity)) as tquantity,sum(value) as ttotal
$sql = "SELECT category,sid,mid,supplier_name,material_name,IF(Quantity IS NULL or Quantity = '', 0, sum(Quantity)) as tquantity,sum(value) as ttotal,cd.ConfigValue as category_name
FROM igr
left join t_configdetails cd on cd.key = igr.category
where status != 'ST030' and
(materialrcvddate >= '" . $fa . "-04-01' and materialrcvddate <= '" . $aa . "-03-31')
and category = '" . $cat . "'
@ -2098,8 +2105,9 @@ group by supplier_name,material_name";
function rawi_report_cum_month($cat = null)
{
$sql = "SELECT category,sid,mid,supplier_name,material_name,IF(Quantity IS NULL or Quantity = '', 0, sum(Quantity)) as tquantity,sum(value) as ttotal
$sql = "SELECT category,sid,mid,supplier_name,material_name,IF(Quantity IS NULL or Quantity = '', 0, sum(Quantity)) as tquantity,sum(value) as ttotal,cd.ConfigValue as category_name
FROM igr
left join t_configdetails cd on cd.Key = igr.category
where status != 'ST030' and
month(materialrcvddate) = month(current_date()) and category = '" . $cat . "'
group by supplier_name,material_name";
@ -2109,8 +2117,9 @@ group by supplier_name,material_name";
function rawi_report_cum_day($cat = null)
{
$sql = "SELECT category,sid,mid,supplier_name,material_name,IF(Quantity IS NULL or Quantity = '', 0, sum(Quantity)) as tquantity,sum(value) as ttotal
$sql = "SELECT category,sid,mid,supplier_name,material_name,IF(Quantity IS NULL or Quantity = '', 0, sum(Quantity)) as tquantity,sum(value) as ttotal,cd.ConfigValue as category_name
FROM igr
left join t_configdetails cd on cd.Key = igr.category
where status != 'ST030' and
date(materialrcvddate) = current_date() and category = '" . $cat . "'
group by supplier_name,material_name";
@ -2148,8 +2157,9 @@ SUM(IF(month(materialrcvddate) = 12, value, 0)) AS vDecember,
SUM(IF(month(materialrcvddate) = 1, value, 0)) AS vJanuary,
SUM(IF(month(materialrcvddate) = 2, value, 0)) AS vFebruary,
SUM(IF(month(materialrcvddate) = 3, value, 0)) AS vMarch,
sum(value) as vtotal
sum(value) as vtotal,cd.ConfigValue as category_name
FROM igr
left join t_configdetails cd on cd.Key = igr.category
where status != 'ST030' ";
if ($cname != '') {
@ -2175,8 +2185,9 @@ where status != 'ST030' ";
$sql = "select category,sid,supplier_name,mid,material_name,
sum(Quantity) as quantity,
sum(value) as total
sum(value) as total,cd.ConfigValue as category_name
FROM igr
left join t_configdetails cd on cd.Key = igr.category
where status != 'ST030' and
monthname(materialrcvddate) = '" . $m . "' and category = '" . $cat . "' ";
if ($fa and $aa != '') {
@ -2193,8 +2204,9 @@ monthname(materialrcvddate) = '" . $m . "' and category = '" . $cat . "' ";
$sql = "select category,sid,supplier_name,mid,material_name,
sum(Quantity) as quantity,
sum(value) as total
sum(value) as total,cd.ConfigValue as category_name
FROM igr
left join t_configdetails cd on cd.Key = igr.category
where status != 'ST030' and
category = '" . $cat . "' ";
if ($fa and $aa != '') {

View File

@ -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;
}
@ -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,
@ -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)
@ -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')

View File

@ -132,6 +132,18 @@ class Purchaseorder_model extends Model
return $r;
}
function getOldReqDetailsQuantity($Reqnumber, $MaterialCode,$ItemNo){
$builder = $this->db->table('t_requestion_details')
->select('Quantity')
->where('ItemNo', $ItemNo)
->where('ReqNo', $Reqnumber)
->where('MaterialCode', $MaterialCode);
$query = $builder->get()->getRow();
$Quantity = $query ? $query->Quantity : 0;
return $Quantity;
}
function IGRDetailsupdate($PONO)
{

View File

@ -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;
}
}
/**

View File

@ -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>&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
} ?>
</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>
@ -3023,6 +3027,11 @@ if (!empty($getlogpodtl)) {
SelectedMaterialCode.splice(SelectedMaterialCode.indexOf('removeItem'), 1);
$.each(SelectedMaterialList.Mat, function (i, el) {
if (this.materialCode == removeItem) { //Type = '';
SelectedMaterialList.Mat.splice(i, 1);
}
});
var x = <?php echo json_encode($POItem, JSON_PRETTY_PRINT) ?>;
var result = '0';

View File

@ -62,7 +62,7 @@
?>
<tr>
<td style="text-align:left;">
<?php echo $rel->category; ?>
<?php echo $rel->category_name; ?>
</td>
<td><span>
<a href="<?= base_url() ?>report/ilink_purchase?sid=<?php echo $rel->sid; ?>&ab=<?php echo $ab; ?>&mid=<?php echo $rel->mid; ?>&cat=<?php echo $rel->category; ?>&m=<?php echo $m; ?>"><?php echo $rel->supplier_name; ?> </a>
@ -174,6 +174,7 @@
});
});
</script>
<script>
// "footerCallback": function ( row, data, start, end, display ) {
// var api = this.api(), data;

View File

@ -56,7 +56,7 @@ $vtot = 0;
<li class="breadcrumb-item"><a href="javascript: void(0);">Report</a></li>
<li class="breadcrumb-item"><a href="javascript: void(0);">Material Master</a></li>
<li class="breadcrumb-item active">
<h4 class="page-title"><b> Consolidate (Category-Wise) <?php echo isset($client_name) ? $client_name : ''; ?> <?php echo isset($financialyear) ? "(" . $financialyear . ")" : ''; ?> </b></h4>
<h4 class="page-title"><b> Consolidate (Category-Wise) </b></h4>
</li>
</ol>
</div>
@ -85,7 +85,8 @@ $vtot = 0;
<?php
foreach ($material as $item): { ?>
<option value="<?php echo $item->Category; ?>"><?php echo $item->Category; ?></option>
<option <?php if(isset($client_name) && ($client_name == $item->Category)){ echo 'selected'; } ?> value="<?php echo $item->Category; ?>"><?php echo $item->Category_name; ?></option>
<?php }
@ -185,7 +186,7 @@ $vtot = 0;
foreach ($spurchse as $index => $result) { ?>
<tr>
<td style="text-align:left;">
<a href="<?= base_url() ?>report/ilink_purchase?ab=<?php echo $ab; ?>&cat=<?php echo $result->category; ?>"><?php echo $result->category; ?> </a>
<a href="<?= base_url() ?>report/ilink_purchase?ab=<?php echo $ab; ?>&cat=<?php echo $result->category; ?>"><?php echo $result->category_name; ?> </a>
</td>
<td style="text-align:right;"><span id="april_qty<?php echo $index ?>">
<?php

View File

@ -61,7 +61,7 @@
?>
<tr>
<td style="text-align:left;">
<?php echo $rel->category; ?>
<?php echo $rel->category_name; ?>
</td>
<td><span>
<a href="<?= base_url() ?>report/ilink_purchase?sid=<?php echo $rel->sid; ?>&ab=<?php echo $ab; ?>&mid=<?php echo $rel->mid; ?>&cat=<?php echo $rel->category; ?>"><?php echo $rel->supplier_name; ?> </a>

View File

@ -59,7 +59,7 @@
foreach ($cum_day as $rel) {
?>
<tr>
<td><span><?php echo $rel->category; ?></span></td>
<td><span><?php echo $rel->category_name; ?></span></td>
<td><span>
<a href="<?= base_url() ?>report/ilink_purchase?sid=<?php echo $rel->sid; ?>&d=<?php echo $d; ?>&mid=<?php echo $rel->mid; ?>&cat=<?php echo $rel->category; ?>"><?php echo $rel->supplier_name; ?></a>
</span></td>

View File

@ -63,7 +63,7 @@
foreach ($cum_month as $rel) {
?>
<tr>
<td><span><?php echo $rel->category; ?></span></td>
<td><span><?php echo $rel->category_name; ?></span></td>
<td><span>
<a href="<?= base_url() ?>report/ilink_purchase?sid=<?php echo $rel->sid; ?>&ab=<?php echo $ab; ?>&m=<?php echo $month; ?>&mid=<?php echo $rel->mid; ?>&cat=<?php echo $rel->category; ?>"><?php echo $rel->supplier_name; ?></a>
</span></td>

View File

@ -99,7 +99,7 @@ if (date('m') >= 4) {
?></a>
</span></td>-->
<td><span>
<a href="<?= base_url() ?>report/ilink_purchase?ab=<?php echo $ab; ?>&cat=<?php echo $rel->category; ?>"><?php echo $rel->category; ?></a>
<a href="<?= base_url() ?>report/ilink_purchase?ab=<?php echo $ab; ?>&cat=<?php echo $rel->category; ?>"><?php echo $rel->category_name; ?></a>
</span></td>
<td style="text-align:right"><span id="d_qty<?php echo $index; ?>">
<?php

View File

@ -79,7 +79,7 @@ $yearl;
foreach ($cum_year as $rel) {
?>
<tr>
<td><span><?php echo $rel->category; ?></span></td>
<td><span><?php echo $rel->category_name; ?></span></td>
<td><span>
<a href="<?= base_url() ?>report/ilink_purchase?sid=<?php echo $rel->sid; ?>&ab=<?php echo $ab; ?>&mid=<?php echo $rel->mid; ?>&cat=<?php echo $rel->category; ?>"><?php echo $rel->supplier_name; ?></a>
</span></td>

View File

@ -259,7 +259,7 @@
<td style="text-align:right"><span><?php echo $rel->created_time; ?></span></td>
<td style="text-align:center"><span><?php echo $rel->materialrcvddate; ?></span></td>
<td><span><?php echo $rel->material_name; ?></span></td>
<td><span><?php echo $rel->category; ?></span></td>
<td><span><?php echo $rel->category_name; ?></span></td>
<td><span><?php echo $rel->supplier_name; ?></span></td>
<td style="text-align:right"><span><?php
$tot_qty = $tot_qty + round($rel->quantity);

View File

@ -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.');
}
});
});

View File

@ -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>&nbsp;&nbsp;&nbsp;
<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>

View File

@ -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>&nbsp;&nbsp;&nbsp;</a>
href="#EDITCAPITAL"><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> -->
<!-- <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
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>&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; ?>"
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>&nbsp;&nbsp;&nbsp;</a>
class="fa fa-eye"></i>&nbsp;&nbsp;&nbsp;</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>&nbsp;&nbsp;&nbsp;
<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>

View File

@ -1815,7 +1815,7 @@ if (!empty($EmpDetails)) {
reasonTextarea.setAttribute("required", "true");
reasonTextarea.focus(); // Auto-focus
alert("please Enter the reason!");
alert("Please enter the Reason!");

View File

@ -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>&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
// } else {
?>
@ -2516,7 +2516,7 @@ if (!empty($RequistionDetails)) {
$('#Rate').focus();
return false;
} else if ($('#imBasicPrice').val() == '') {
alert('Please Enter Basic Price In Us');
alert('Please Enter the Basic Price');
$('#imBasicPrice').focus();
return false;
}

View File

@ -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>

View File

@ -570,7 +570,7 @@ if (!empty($getlogpodtl)) {
resetTaxField();
if (id != '0') {
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
for (i = 0; i < Material.length; i++) {
$.each(Material[i], function (idx, obj) {
if (obj.MaterialCode === id) {

View File

@ -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>&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>
</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>&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>
<?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>&nbsp;&nbsp;&nbsp;
<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);
@ -4636,7 +4637,7 @@ if (!empty($getlogpodtl)) {
$('#Rate').focus();
return false;
} else if ($('#imBasicPrice').val() == '') {
alert('Please Enter Basic Price In Us');
alert('Please Enter the Basic Price');
$('#imBasicPrice').focus();
return false;
}

View File

@ -105,7 +105,8 @@
<td><?= esc($stdate) ?></td>
<td><?= esc($eddate) ?></td>
<td><?= esc($d['no_of_days']) ?></td>
<td class="auditor-restricted security-restricted labstaff-restricted stock-restricted"><?php if($d['status'] !== "Approved"){ ?>
<td class="auditor-restricted security-restricted labstaff-restricted stock-restricted">
<select
class="form-control"
name="drpStatus"
@ -117,9 +118,7 @@
<option value="Approved" <?php echo ($d['status'] == 'Approved') ? 'selected' : ''; ?> >Approve</option>
<option value="Cancel" <?php echo ($d['status'] == 'Cancel') ? 'selected' : ''; ?> >Cancel</option>
</select>
<?php }else{
echo esc($d['status']);
} ?>
<!-- <?php if($d['status'] !== "Approved"){ }else{ echo esc($d['status']); } ?> -->
</td>
@ -267,9 +266,6 @@
</div><!-- /.m o d a l-d i a l o g -->
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
@ -304,6 +300,19 @@
validateDateRange();
});
$('#status_val').change(function() {
var status = $('#status_val').val();
var role = "<?php echo session()->get('roleText'); ?>";
$("#tempClick").show();
if (role === 'System Administrator') {
$("#tempClick").show();
}
var restrictedRoles = ['Auditor','Security','Stock Handler','Lab Staff'];
if (restrictedRoles.includes(role) && status === 'Approved') {
$("#tempClick").hide();
}
});
$("#applicationModal").on("shown.bs.modal", function (e) {
var id = $(e.relatedTarget).data('id');
@ -319,14 +328,24 @@
$("#tempClick").show();
} else {
$('#applicationformTitle').text(arr.status === "Approved" ? "View Leave" : "Edit Leave");
$("#tempClick").toggle(arr.status !== "Approved");
// $("#tempClick").toggle(arr.status !== "Approved");
var role = "<?php echo session()->get('roleText'); ?>";
if (role === 'System Administrator') {
$("#tempClick").show();
}
var restrictedRoles = ['Auditor','Security','Stock Handler','Lab Staff'];
if (restrictedRoles.includes(role) && arr.status === "Approved") {
$("#tempClick").hide();
}else{
$("#tempClick").show();
}
}
if (id == 0 || arr.status !== "Approved") {
$("#emp_name, #start_date, #end_date, #status_val, #reason").prop({readonly: false, disabled: false});
$("#start_date, #end_date").prop('required', true);
} else {
$("#emp_name, #status_val").prop('disabled', true);
$("#emp_name").prop('disabled', true);
}
if (arr.emp_id) $("#emp_name").val(arr.emp_id).select2();

View File

@ -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>&nbsp;&nbsp;&nbsp;
<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>
@ -3699,7 +3699,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
$('#Rate').focus();
return false;
} else if ($('#imBasicPrice').val() == '') {
alert('Please Enter Basic Price In Us');
alert('Please Enter the Basic Price');
$('#imBasicPrice').focus();
return false;
}

View File

@ -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>
&nbsp;&nbsp;&nbsp;
<a href='#' onclick="DeleteRow('${temp}')" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
<span class="ri-delete-bin-7-fill"></span>
</a>

View File

@ -565,6 +565,7 @@ if (!empty($Emp)) {
if (document.getElementById('Items').rows.length < 0) {
alert('Please Select Line item to Create Requisition');
$('#Deliverydt').focus();
$('#loader').hide();
return false;
} else {
var serviceSchedule = '';
@ -597,16 +598,18 @@ if (!empty($Emp)) {
alert(data);
$('#txtRowCount').val('');
$('#txtDeletedRow').val('');
$('#loader').hide();
window.location = "Requisition";
} else {
alert("Error");
$('#loader').hide();
}
},
error: function(error){
console.log("error occurred..!!")
$('#loader').hide();
console.error(error);
},
complete : function (){
@ -617,6 +620,8 @@ if (!empty($Emp)) {
});
}
}else{
$('#loader').hide();
}
}
</script>
@ -827,10 +832,7 @@ if (!empty($Emp)) {
});
</script>
<script>
$(".requistion").submit(function(e) {
$(".requistion").submit(function(e) {
// var id = '<?php //echo REQ_PENDING_APPROVAL;
?>' // don't delete 22/04/2022
var id = '<?php echo REQ_APPROVED; ?>'
@ -878,15 +880,18 @@ if (!empty($Emp)) {
$('#txtDeletedRow').val('');
window.location = "Requisition";
$('#loader').hide();
} else {
alert("Error");
$('#loader').hide();
}
},
error: function(error){
console.log("error occurred..!!");
console.error(error);
$('#loader').hide();
},
complete : function (){
$('#loader').hide();
@ -894,6 +899,7 @@ if (!empty($Emp)) {
}
});
$('#loader').hide();
}
}

View File

@ -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>
&nbsp;&nbsp;&nbsp;
<a href='#' onclick="DeleteRow(${temp})" class="link" data-id="${temp}" data-userid="${temp}" id="Del">
<span class="ri-delete-bin-7-fill"></span>
</a>

View File

@ -294,7 +294,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");
@ -1287,7 +1290,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) {
@ -1337,6 +1339,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 {
@ -1470,6 +1476,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(),
@ -1544,6 +1551,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(),
@ -1615,6 +1623,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() {