Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
d72ee57c85
@ -63,7 +63,6 @@ $routes->match(['GET', 'POST', 'PUT', 'DELETE'], 'rawmaterialListing/(:num)', 'R
|
||||
$routes->post('materialExist', 'Rawmaterialdetails::checkmaterial');
|
||||
$routes->get('viewRawmaterial', 'Rawmaterialdetails::viewRawmaterial');
|
||||
$routes->post('rawmaterialdetails/editRawmaterial', 'Rawmaterialdetails::editRawmaterial');
|
||||
$routes->post('rawmaterialdetails/addMaterialCategories', 'Rawmaterialdetails::addMaterialCategories');
|
||||
$routes->get('exportmaterial', 'Rawmaterialdetails::exportmaterial');
|
||||
$routes->post('deleteMaterial', 'Rawmaterialdetails::deleteMaterial');
|
||||
$routes->post('reActivateMaterial', 'Rawmaterialdetails::reActivateMaterial');
|
||||
@ -144,6 +143,7 @@ $routes->post('configurationctrl/configValueCheck', 'Configurationctrl::configVa
|
||||
$routes->get('configurationctrl/deleteConfigValue', 'Configurationctrl::deleteConfigValue');
|
||||
$routes->get('configurationctrl/reActivateConfigValue', 'Configurationctrl::reActivateConfigValue');
|
||||
$routes->get('activeInactiveConfigValue', 'Configurationctrl::activeInactiveConfigValue');
|
||||
$routes->post('getPONOcreatedBasedOnConfig', 'Configurationctrl::getPONOcreatedBasedOnConfig');
|
||||
$routes->get('configurationctrl/editconfig', 'Configurationctrl::editconfig');
|
||||
$routes->post('configurationctrl/updateconfig', 'Configurationctrl::updateconfig');
|
||||
$routes->post('configurationctrl/configNameCheck', 'Configurationctrl::configNameCheck');
|
||||
|
||||
@ -43,6 +43,7 @@ class Configurationctrl extends BaseController
|
||||
|
||||
$data['userRecords'] = $this->configmodel->Configlisting();
|
||||
|
||||
|
||||
$this->global['pageTitle'] = 'Config Listing';
|
||||
|
||||
$this->loadViews("configlisting", $this->global, $data, NULL);
|
||||
@ -190,6 +191,14 @@ class Configurationctrl extends BaseController
|
||||
$result = $this->configmodel->activeInactiveConfigValue($key, $where);
|
||||
return redirect()->back();
|
||||
}
|
||||
public function getPONOcreatedBasedOnConfig(){
|
||||
$data = $this->request->getPost();
|
||||
$key_id = $data['key_id'];
|
||||
$result = $this->configmodel->getPONOcreatedBasedOnConfig($key_id);
|
||||
return $this->response->setJSON($result);
|
||||
// return $result;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function deleteConfigValue(){
|
||||
|
||||
@ -477,17 +477,8 @@ class Inwardgateregister extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
#Step 5 Save Master Detail On Stored on History Table
|
||||
foreach ($igr as $key => $value) {
|
||||
if (!empty($value)) { // Ensure the value is not empty
|
||||
if($key == 'CreatedBy'){ $key = 'MasterCreatedBy'; }
|
||||
if($key == 'UpdateBY'){ $key = 'MasterUpdatedBy'; }
|
||||
if($key == 'CreatedDate'){ $key = 'MasterCreatedDate'; }
|
||||
if($key == 'UpdatedOn'){ $key = 'MasterUpdatedDate'; }
|
||||
$hist = array( 'key' => $key, 'value' => $value, 'igr_no' => $IGRNO,'igr_item_no' => NULL);
|
||||
$this->saveIGRHistory($hist);
|
||||
}
|
||||
}
|
||||
#Step 5 Save Master Detail On Stored on History Table
|
||||
# - Check Step 9 After I Insert.
|
||||
|
||||
#Step 6 Updating OGR Details
|
||||
$OGRStatus = $IGRStatus;
|
||||
@ -579,18 +570,7 @@ class Inwardgateregister extends BaseController
|
||||
}
|
||||
$historydetails = array('MaterialCode' => $MaterialCode, 'Transaction_type' => "Add", 'Ref_Type' => "IGR", 'Ref_No' => $igrlineno, 'Quantity' => $QuantityAsPerInvoice, 'CreatedBy' => $CreatedBy, 'CreatedOn' => $createddt, 'SupplierID' => $SupplierId, 'ItemValue' => $itemvalue);
|
||||
$this->inwardgateregister_model->addmaterialhistory($historydetails);
|
||||
#Save IGR Detail On History Table
|
||||
foreach ($igrDetails as $key => $value) {
|
||||
if (!empty($value)) { // Ensure the value is not empty
|
||||
if($key == 'CreatedBy'){ $key = 'LineItemCreatedBy'; }
|
||||
if($key == 'UpdateBY'){ $key = 'LineItemUpdatedBy'; }
|
||||
if($key == 'IGRNO'){ $key = 'LineItemIGRNO'; }
|
||||
if($key == 'CreatedDate'){ $key = 'LineItemCreatedDate'; }
|
||||
if($key == 'UpdatedOn'){ $key = 'LineItemUpdatedDate'; }
|
||||
$hist = array( 'key' => $key, 'value' => $value, 'igr_no' => $IGRNO,'igr_item_no' => $igrlineno);
|
||||
$this->saveIGRHistory($hist);
|
||||
}
|
||||
}
|
||||
|
||||
$get_pre_qty = $this->inwardgateregister_model->get_CurrentQty($MaterialCode);
|
||||
$av_qty = 0; //$av_qty means Avaliable Quantity
|
||||
if (!empty($get_pre_qty)) {
|
||||
@ -632,6 +612,24 @@ class Inwardgateregister extends BaseController
|
||||
}}
|
||||
#finally
|
||||
$finalstatement = "Successfully Created IGR Number: $IGRNO \n";
|
||||
|
||||
# Step 5 Shifted Here
|
||||
if($IGRNO){
|
||||
$igr_history = [
|
||||
'field' => NULL,
|
||||
'history_dated' => get_current_date_time(),
|
||||
'by' => $this->session->get('userId'),
|
||||
'IGR_No' => $IGRNO,
|
||||
'is_add' => 1
|
||||
];
|
||||
|
||||
// Insert history entry
|
||||
$history_id = $this->inwardgateregister_model->igr_history($igr_history);
|
||||
if ($history_id) {
|
||||
log_message('error', "History Newly Created for IGR No: $IGRNO. History ID: $history_id. ");
|
||||
}
|
||||
}
|
||||
|
||||
if ($fileupdated_count > 0) {
|
||||
$finalstatement .= "Number of files updated: $fileupdated_count \n";
|
||||
$finalstatement .= "Files: \n" . implode(PHP_EOL, $fileupdated_name);
|
||||
@ -840,12 +838,7 @@ function viewIGRDetails()
|
||||
if(!empty($tableData )){
|
||||
#Save IGR Master On History Table
|
||||
foreach ($igrarr as $key => $value) {
|
||||
|
||||
if (!empty($value)) { // Ensure the value is not empty
|
||||
if($key == 'CreatedBy'){ $key = 'MasterCreatedBy'; }
|
||||
if($key == 'UpdateBY'){ $key = 'MasterUpdatedBy'; }
|
||||
if($key == 'CreatedDate'){ $key = 'MasterCreatedDate'; }
|
||||
if($key == 'UpdatedOn'){ $key = 'MasterUpdatedDate'; }
|
||||
$hist = array( 'key' => $key, 'value' => $value, 'igr_no' => $IGRNo,'igr_item_no' => NULL);
|
||||
$this->saveIGRHistory($hist);
|
||||
}
|
||||
@ -893,8 +886,6 @@ function viewIGRDetails()
|
||||
if($updateigrlineitem){
|
||||
foreach ($igrline as $key => $value) {
|
||||
if (!empty($value)) { // Ensure the value is not empty
|
||||
if($key == 'CreatedBy'){ $key = 'LineItemCreatedBy'; }
|
||||
if($key == 'UpdateBY'){ $key = 'LineItemUpdatedBy'; }
|
||||
if($key == 'IGRNO'){ $key = 'LineItemIGRNO'; }
|
||||
|
||||
$hist = array( 'key' => $key, 'value' => $value, 'igr_no' => $IGRNo,'igr_item_no' => NULL);
|
||||
@ -1041,9 +1032,6 @@ function updateIGRWeight(){
|
||||
|
||||
foreach ($igr_lineitem as $key => $value) {
|
||||
if (!empty($value)) { // Ensure the value is not empty
|
||||
if($key == 'CreatedBy'){ $key = 'LineItemCreatedBy'; }
|
||||
if($key == 'UpdateBY'){ $key = 'LineItemUpdatedBy'; }
|
||||
if($key == 'IGRNO'){ $key = 'LineItemIGRNO'; }
|
||||
$hist = array( 'key' => $key, 'value' => $value, 'igr_no' => $IGRNO,'igr_item_no' => $IGRItemNo);
|
||||
$this->saveIGRHistory($hist);
|
||||
}
|
||||
@ -1435,51 +1423,131 @@ function updateIGRWeight(){
|
||||
}
|
||||
|
||||
|
||||
public function saveIGRHistory($hist) {
|
||||
// public function saveIGRHistory($hist) {
|
||||
|
||||
// Extract fields from the input array
|
||||
$field = $hist['key'];
|
||||
// // Extract fields from the input array
|
||||
// $field = $hist['key'];
|
||||
|
||||
$igr_no = $hist['igr_no'];
|
||||
$igr_item_no = $hist['igr_item_no'];
|
||||
$new_data = $hist['value']; // Incoming new value
|
||||
$old_data = NULL; // Default old value is null
|
||||
// $igr_no = $hist['igr_no'];
|
||||
// $igr_item_no = $hist['igr_item_no'];
|
||||
// $new_data = $hist['value']; // Incoming new value
|
||||
// $old_data = NULL; // Default old value is null
|
||||
|
||||
log_message('error', "Save History function entered for IGR No: $igr_no, Item No: $igr_item_no, Field: $field.");
|
||||
// log_message('error', "Save History function entered for IGR No: $igr_no, Item No: $igr_item_no, Field: $field.");
|
||||
|
||||
// $latestHist = $this->inwardgateregister_model->get_igr_history($field, $igr_no, $igr_item_no);
|
||||
// $latestIGRMasterForHist = $this->inwardgateregister_model->get_igr_master_for_history($field, $igr_no); // it have value
|
||||
// $latestIGRChildForHist = $this->inwardgateregister_model->get_igr_child_for_history($field, $igr_no, $igr_item_no);
|
||||
|
||||
// if(empty($igr_item_no)){
|
||||
// if(!empty($latestIGRMasterForHist)){
|
||||
// if (!empty($latestHist)) {
|
||||
// if ($latestHist->new_data == $new_data) {
|
||||
// log_message('error', "No update needed for IGR No: $igr_no, Item No: $igr_item_no, Field: $field. Data already exists: $new_data");
|
||||
// return;
|
||||
// } else {
|
||||
// $old_data = $latestHist->new_data;
|
||||
// }
|
||||
// }else{
|
||||
// $old_data = $latestIGRMasterForHist;
|
||||
// }
|
||||
// }}
|
||||
|
||||
// if(!empty($igr_item_no)){
|
||||
// if(!empty($latestIGRChildForHist)){
|
||||
// if (!empty($latestHist)) {
|
||||
// if ($latestHist->new_data == $new_data) {
|
||||
// log_message('error', "No update needed for IGR No: $igr_no, Item No: $igr_item_no, Field: $field. Data already exists: $new_data");
|
||||
// return;
|
||||
// } else {
|
||||
// $old_data = $latestHist->new_data;
|
||||
// }
|
||||
// }else{
|
||||
// $old_data = $latestIGRChildForHist;
|
||||
// }
|
||||
// }}
|
||||
|
||||
$latestHist = $this->inwardgateregister_model->get_igr_history($field, $igr_no, $igr_item_no);
|
||||
|
||||
if (!empty($latestHist)) {
|
||||
if ($latestHist->new_data == $new_data) {
|
||||
log_message('error', "No update needed for IGR No: $igr_no, Item No: $igr_item_no, Field: $field. Data already exists: $new_data");
|
||||
return;
|
||||
} else {
|
||||
$old_data = $latestHist->new_data;
|
||||
}
|
||||
}
|
||||
|
||||
// Prepare history entry
|
||||
$igr_history = [
|
||||
'field' => $field,
|
||||
'new_data' => $new_data,
|
||||
'old_data' => $old_data,
|
||||
'history_dated' => get_current_date_time(),
|
||||
'by' => $this->session->get('userId'),
|
||||
'IGR_No' => $igr_no,
|
||||
'IGRItem_No' => $igr_item_no,
|
||||
'is_edit' => ($old_data !== NULL) ? 1 : 0,
|
||||
'is_add' => ($old_data === NULL) ? 1 : 0
|
||||
];
|
||||
|
||||
// Insert history entry
|
||||
$history_id = $this->inwardgateregister_model->igr_history($igr_history);
|
||||
if ($history_id) {
|
||||
log_message('error', "History updated successfully for IGR No: $igr_no, Item No: $igr_item_no, Field: $field. History ID: $history_id");
|
||||
} else {
|
||||
log_message('error', "Failed to update history for IGR No: $igr_no, Item No: $igr_item_no, Field: $field.");
|
||||
}
|
||||
}
|
||||
// // Prepare history entry
|
||||
// $igr_history = [
|
||||
// 'field' => $field,
|
||||
// 'new_data' => $new_data,
|
||||
// 'old_data' => $old_data,
|
||||
// 'history_dated' => get_current_date_time(),
|
||||
// 'by' => $this->session->get('userId'),
|
||||
// 'IGR_No' => $igr_no,
|
||||
// 'IGRItem_No' => $igr_item_no,
|
||||
// 'is_edit' => ($old_data !== NULL) ? 1 : 0,
|
||||
// 'is_add' => ($old_data === NULL) ? 1 : 0
|
||||
// ];
|
||||
|
||||
// // Insert history entry
|
||||
// $history_id = $this->inwardgateregister_model->igr_history($igr_history);
|
||||
// if ($history_id) {
|
||||
// log_message('error', "History updated successfully for IGR No: $igr_no, Item No: $igr_item_no, Field: $field. History ID: $history_id");
|
||||
// } else {
|
||||
// log_message('error', "Failed to update history for IGR No: $igr_no, Item No: $igr_item_no, Field: $field.");
|
||||
// }
|
||||
// }
|
||||
public function saveIGRHistory($hist) {
|
||||
|
||||
// Extract fields from the input array
|
||||
$field = $hist['key'];
|
||||
$igr_no = $hist['igr_no'];
|
||||
$igr_item_no = $hist['igr_item_no'];
|
||||
$new_data = $hist['value']; // Incoming new value
|
||||
$old_data = null; // Default old value is null
|
||||
|
||||
log_message('error', "Save History function entered for IGR No: $igr_no, Item No: $igr_item_no, Field: $field.");
|
||||
|
||||
// Fetch the latest history record for the field
|
||||
$latestHist = $this->inwardgateregister_model->get_igr_history($field, $igr_no, $igr_item_no);
|
||||
|
||||
|
||||
// Fetch the current value from the master or child table
|
||||
if (empty($igr_item_no)) {
|
||||
$current_data = $this->inwardgateregister_model->get_igr_master_for_history($field, $igr_no);
|
||||
} else {
|
||||
$current_data = $this->inwardgateregister_model->get_igr_child_for_history($field, $igr_no, $igr_item_no);
|
||||
}
|
||||
|
||||
// Determine the old_data
|
||||
if (!empty($latestHist)) {
|
||||
// If history exists, use the latest new_data as old_data
|
||||
$old_data = $latestHist->new_data;
|
||||
} else {
|
||||
// If no history exists, use the current data from the master/child table as old_data
|
||||
$old_data = $current_data;
|
||||
}
|
||||
|
||||
// Check if the new_data is different from the old_data
|
||||
if ($new_data == $old_data) {
|
||||
log_message('error', "No update needed for IGR No: $igr_no, Item No: $igr_item_no, Field: $field. Data already exists: $new_data");
|
||||
return; // No need to insert history if data hasn't changed
|
||||
}
|
||||
|
||||
// Prepare history entry
|
||||
$igr_history = [
|
||||
'field' => $field,
|
||||
'new_data' => $new_data,
|
||||
'old_data' => $old_data,
|
||||
'history_dated' => get_current_date_time(),
|
||||
'by' => $this->session->get('userId'),
|
||||
'IGR_No' => $igr_no,
|
||||
'IGRItem_No' => $igr_item_no,
|
||||
'is_edit' => ($old_data !== null) ? 1 : 0, // 1 if it's an edit, 0 if it's an add
|
||||
'is_add' => ($old_data === null) ? 1 : 0 // 1 if it's an add, 0 if it's an edit
|
||||
];
|
||||
|
||||
// Insert history entry
|
||||
$history_id = $this->inwardgateregister_model->igr_history($igr_history);
|
||||
if ($history_id) {
|
||||
log_message('error', "History updated successfully for IGR No: $igr_no, Item No: $igr_item_no, Field: $field. History ID: $history_id");
|
||||
} else {
|
||||
log_message('error', "Failed to update history for IGR No: $igr_no, Item No: $igr_item_no, Field: $field.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1225,7 +1225,8 @@ class Purchaseorder extends BaseController
|
||||
$AfterCgst = $this->request->getPost('RevenueAfterCgst' . $i);
|
||||
$AfterSgst = $this->request->getPost('RevenueAfterSgst' . $i);
|
||||
$AfterIgst = $this->request->getPost('RevenueAfterIgst' . $i);
|
||||
|
||||
$LineitemAuditorNotes = $this->request->getPost('LineItemNoteForAuditor' . $i);
|
||||
|
||||
$SkipInsert = "False";
|
||||
if (count($comma_separated) > 0) {
|
||||
for ($j = 1; $j < count($comma_separated); $j++) {
|
||||
@ -1238,7 +1239,7 @@ class Purchaseorder extends BaseController
|
||||
}
|
||||
if ($SkipInsert == "False") {
|
||||
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Per' => $per, 'ServiceMaterialDescription' => $revenuedescription, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CreatedDate' => $createddt, 'CostCenterCode' => $CostCenter);
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Per' => $per, 'ServiceMaterialDescription' => $revenuedescription, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CreatedDate' => $createddt, 'CostCenterCode' => $CostCenter,'LineitemAuditorNotes' => $LineitemAuditorNotes);
|
||||
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
|
||||
$LineItemNo = '';
|
||||
if (count($POLineItem) > 0) {
|
||||
@ -1266,7 +1267,6 @@ class Purchaseorder extends BaseController
|
||||
//This used to Edit the Revenue Purchase Order
|
||||
function EditRevenuePurchaseOrder()
|
||||
{
|
||||
// print_r($this->request->getPost());die;
|
||||
$PONO = $this->request->getPost('txtPONO');
|
||||
$POdt = $this->request->getPost('PODate');
|
||||
$PODate = get_date_time_format($POdt);
|
||||
@ -1419,6 +1419,7 @@ class Purchaseorder extends BaseController
|
||||
$TotalOrderValue = $this->request->getPost('TotalOrderValue' . $i);
|
||||
$POLineItemNo = $this->request->getPost('LineItemNo' . $i);
|
||||
$CostCenter = $this->request->getPost('costCode' . $i);
|
||||
$LineitemAuditorNotes = $this->request->getPost('LineItemNoteForAuditor' . $i);
|
||||
$LineItemNo = '';
|
||||
|
||||
/*---------start---------------------*/
|
||||
@ -1509,7 +1510,7 @@ class Purchaseorder extends BaseController
|
||||
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);
|
||||
$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);
|
||||
if (count($POLineItem) > 0) {
|
||||
@ -1519,7 +1520,7 @@ class Purchaseorder extends BaseController
|
||||
|
||||
$LineItemNo = $POLineItemNo;
|
||||
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'ReceivedQuantity' => $recqty, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'UpdateBY' => $updatedBy, 'UpdatedOn' => $updateddt, 'CostCenterCode' => $CostCenter);
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'ReceivedQuantity' => $recqty, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'UpdateBY' => $updatedBy, 'UpdatedOn' => $updateddt, 'CostCenterCode' => $CostCenter,'LineitemAuditorNotes'=>$LineitemAuditorNotes);
|
||||
|
||||
$POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO, $POLineItemNo, $POLineItemList);
|
||||
}
|
||||
@ -2108,6 +2109,7 @@ class Purchaseorder extends BaseController
|
||||
|
||||
$specialinstruction = $this->request->getPost('Addinstruction' . $i);
|
||||
$per = $this->request->getPost('Per' . $i);
|
||||
$LineitemAuditorNotes = $this->request->getPost('LineItemNoteForAuditor' . $i);
|
||||
|
||||
$SkipInsert = "False";
|
||||
if (count($comma_separated) > 0) {
|
||||
@ -2122,7 +2124,7 @@ class Purchaseorder extends BaseController
|
||||
}
|
||||
|
||||
if ($SkipInsert == "False") {
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CreatedDate' => $createddt, 'CostCenterCode' => $CostCenter, 'Per' => $per, 'ServiceMaterialDescription' => $specialinstruction);
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CreatedDate' => $createddt, 'CostCenterCode' => $CostCenter, 'Per' => $per, 'ServiceMaterialDescription' => $specialinstruction,'LineitemAuditorNotes' => $LineitemAuditorNotes);
|
||||
|
||||
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
|
||||
|
||||
@ -2412,6 +2414,7 @@ class Purchaseorder extends BaseController
|
||||
$specialinstruction = $this->request->getPost('Addinstruction' . $i);
|
||||
|
||||
$per = $this->request->getPost('Per' . $i);
|
||||
$LineitemAuditorNotes = $this->request->getPost('LineItemNoteForAuditor' . $i);
|
||||
// echo $per;
|
||||
//die();
|
||||
$LineItemNo = '';
|
||||
@ -2485,7 +2488,7 @@ class Purchaseorder extends BaseController
|
||||
//echo $LineItemNo;
|
||||
//die();
|
||||
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'UpdatedOn' => $updateddt, 'CostCenterCode' => $CostCenter, 'Per' => $per, 'ServiceMaterialDescription' => $specialinstruction);
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'UpdatedOn' => $updateddt, 'CostCenterCode' => $CostCenter, 'Per' => $per, 'ServiceMaterialDescription' => $specialinstruction,'LineitemAuditorNotes'=>$LineitemAuditorNotes);
|
||||
$POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO, $POLineItemNo, $POLineItemList);
|
||||
}
|
||||
$isExists = $this->purchaseorder_model->LineItemExistsinImportTax($LineItemNo);
|
||||
@ -2835,6 +2838,7 @@ class Purchaseorder extends BaseController
|
||||
|
||||
$CapitalItemDescription = $this->request->getPost('CapitalItemDescrition' . $i);
|
||||
$Per = $this->request->getPost('per' . $i);
|
||||
$LineitemAuditorNotes = $this->request->getPost('LineItemNoteForAuditor' . $i);
|
||||
$SkipInsert = "False";
|
||||
if (count($comma_separated) > 0) {
|
||||
for ($j = 1; $j < count($comma_separated); $j++) {
|
||||
@ -2847,7 +2851,7 @@ class Purchaseorder extends BaseController
|
||||
}
|
||||
}
|
||||
if ($SkipInsert == "False") {
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CreatedDate' => $createddt, 'CostCenterCode' => $CostCenter, 'ServiceMaterialDescription' => $CapitalItemDescription, 'Per' => $Per);
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CreatedDate' => $createddt, 'CostCenterCode' => $CostCenter, 'ServiceMaterialDescription' => $CapitalItemDescription, 'Per' => $Per,'LineitemAuditorNotes'=>$LineitemAuditorNotes);
|
||||
|
||||
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
|
||||
|
||||
@ -3141,7 +3145,7 @@ class Purchaseorder extends BaseController
|
||||
$FreightNoofTriploc = $this->request->getPost('NoTrip' . $i);
|
||||
$Freightrateloc = $this->request->getPost('Fvalue' . $i);
|
||||
$FreightAmountloc = $this->request->getPost('Afvalue' . $i);
|
||||
|
||||
$LineitemAuditorNotes = $this->request->getPost('LineItemNoteForAuditor' . $i);
|
||||
// echo $FreightTypeloc;
|
||||
// echo 'n';
|
||||
// echo $FreightNoofTriploc;
|
||||
@ -3216,7 +3220,7 @@ class Purchaseorder extends BaseController
|
||||
|
||||
if ($SkipInsert == "False") {
|
||||
if (strlen((string)$POLineItemNo) == 0) {
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CreatedDate' => $createddt, 'CostCenterCode' => $CostCenter, 'ServiceMaterialDescription' => $CapitalItemDescription, 'Per' => $Per);
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CreatedDate' => $createddt, 'CostCenterCode' => $CostCenter, 'ServiceMaterialDescription' => $CapitalItemDescription, 'Per' => $Per,'LineitemAuditorNotes'=>$LineitemAuditorNotes);
|
||||
|
||||
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
|
||||
// if($i != 1){
|
||||
@ -3277,7 +3281,7 @@ class Purchaseorder extends BaseController
|
||||
|
||||
|
||||
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CostCenterCode' => $CostCenter, 'ServiceMaterialDescription' => $CapitalItemDescription, 'Per' => $Per);
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CostCenterCode' => $CostCenter, 'ServiceMaterialDescription' => $CapitalItemDescription, 'Per' => $Per,'LineitemAuditorNotes'=>$LineitemAuditorNotes);
|
||||
$POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO, $LineItemNo, $POLineItemList);
|
||||
if ($capitalType == '1') {
|
||||
$ServiceTaxList = array('CGST' => $Cgst, 'After_CGST' => $AfterCgst, 'SGST' => $Sgst, 'After_SGST' => $AfterSgst, 'IGST' => $Igst, 'After_IGST' => $AfterIgst, 'otherallowance' => $OtherAmt, 'TotalValue' => $TaxtotalOrderValue, 'UpdateBY' => $CreateBy, 'UpdatedOn' => $createddt, 'discount' => $DiscountType, 'discountval' => $DiscountValue, 'Afterdiscountval' => $AfterDiscount, 'FreightType' => $FreightTypeloc, 'NoOfTrip' => $FreightNoofTriploc, 'FreightValue' => $Freightrateloc, 'AfterFreightValue' => $FreightAmountloc);
|
||||
|
||||
@ -352,40 +352,6 @@ class Rawmaterialdetails extends BaseController
|
||||
|
||||
}
|
||||
|
||||
function addMaterialCategories(){
|
||||
|
||||
$configCode = 'C023';
|
||||
$configVal = $this->request->getpost('category_name');
|
||||
$configArr = array('Config_ID' => $configCode, 'ConfigValue' => $configVal);
|
||||
$existingCategory = $this->rawmaterialdetails_model->checkMaterialCategory($configVal);
|
||||
|
||||
if ($existingCategory) {
|
||||
// Data already exists, handle this case (e.g., return an error or ignore the insert)
|
||||
return $this->response->setJSON([
|
||||
'status' => '409',
|
||||
'message' => 'Category Already Exists..!!',
|
||||
]);
|
||||
}
|
||||
|
||||
$insertResult=$this->rawmaterialdetails_model->insertvalueintoconfig($configArr);
|
||||
|
||||
if ($insertResult) {
|
||||
// Send a success response as JSON
|
||||
return $this->response->setJSON([
|
||||
'status' => '201',
|
||||
'message' => 'Category added successfully',
|
||||
]);
|
||||
} else {
|
||||
// Send an error response as JSON
|
||||
return $this->response->setJSON([
|
||||
'status' => '400',
|
||||
'message' => 'Failed to add category',
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function insertvalueintoconfig()
|
||||
{
|
||||
|
||||
|
||||
@ -289,6 +289,7 @@ class Servicepurchaseorder extends BaseController
|
||||
$ItemDescription = $this->request->getPost('ItemDescription' . $i);
|
||||
$OtherAmt = $this->request->getPost('OtherAmt' . $i);
|
||||
$TotalOrderValue = $this->request->getPost('TotalOrderValue' . $i);
|
||||
$LineitemAuditorNotes = $this->request->getPost('LineItemNoteForAuditor' . $i);
|
||||
|
||||
$SkipInsert = "False";
|
||||
if (count($comma_separated) > 0) {
|
||||
@ -314,7 +315,7 @@ class Servicepurchaseorder extends BaseController
|
||||
|
||||
|
||||
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CreatedDate' => $createddt, 'CostCenterCode' => $CostCenter, 'ServiceFrequency' => $ServiceFrequency, 'ServiceMaterialDescription' => $ItemDescription, 'Per' => $Per, 'ItemNo' => $ItemNo);
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CreatedDate' => $createddt, 'CostCenterCode' => $CostCenter, 'ServiceFrequency' => $ServiceFrequency, 'ServiceMaterialDescription' => $ItemDescription, 'Per' => $Per, 'ItemNo' => $ItemNo,'LineitemAuditorNotes' => $LineitemAuditorNotes);
|
||||
|
||||
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
|
||||
|
||||
@ -485,6 +486,7 @@ class Servicepurchaseorder extends BaseController
|
||||
$ItemDescription = $this->request->getPost('ItemDescription' . $i);
|
||||
$OtherAmt = $this->request->getPost('OtherAmt' . $i);
|
||||
$Per = $this->request->getPost('per' . $i);
|
||||
$LineitemAuditorNotes = $this->request->getPost('LineItemNoteForAuditor' . $i);
|
||||
|
||||
|
||||
|
||||
@ -557,7 +559,7 @@ class Servicepurchaseorder extends BaseController
|
||||
if (count($RetItemNo) > 0) {
|
||||
$ItemNo = $RetItemNo[0]['ItemNo'];
|
||||
}
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $updatedBy, 'CreatedDate' => $updateddt, 'CostCenterCode' => $CostCenter, 'ServiceFrequency' => $ServiceFrequency, 'ServiceMaterialDescription' => $ItemDescription, 'Per' => $Per, 'ItemNo' => $ItemNo);
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $updatedBy, 'CreatedDate' => $updateddt, 'CostCenterCode' => $CostCenter, 'ServiceFrequency' => $ServiceFrequency, 'ServiceMaterialDescription' => $ItemDescription, 'Per' => $Per, 'ItemNo' => $ItemNo,'LineitemAuditorNotes' => $LineitemAuditorNotes);
|
||||
|
||||
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
|
||||
if (count($POLineItem) > 0) {
|
||||
@ -566,7 +568,7 @@ class Servicepurchaseorder extends BaseController
|
||||
} else {
|
||||
$LineItemNo = $POLineItemNo;
|
||||
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'UpdateBY' => $updatedBy, 'UpdatedOn' => $updateddt, 'CostCenterCode' => $CostCenter, 'ServiceMaterialDescription' => $ItemDescription, 'Per' => $Per);
|
||||
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'UpdateBY' => $updatedBy, 'UpdatedOn' => $updateddt, 'CostCenterCode' => $CostCenter, 'ServiceMaterialDescription' => $ItemDescription, 'Per' => $Per,'LineitemAuditorNotes' => $LineitemAuditorNotes);
|
||||
$POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO, $POLineItemNo, $POLineItemList);
|
||||
}
|
||||
|
||||
|
||||
@ -228,4 +228,16 @@ class Config_model extends Model
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function getPONOcreatedBasedOnConfig($key_id){
|
||||
$builder = $this->db->table('t_purchaseorder_lineitem PL')
|
||||
->select('PL.PONO, MM.MaterialName, CD.ConfigValue as CategoryName')
|
||||
->join('t_materialmaster MM', 'MM.MaterialCode = PL.MaterialCode', 'left')
|
||||
->join('t_configdetails CD', 'CD.Key = MM.Category', 'left')
|
||||
->where('CD.Key', $key_id);
|
||||
|
||||
$query = $builder->get();
|
||||
$result = $query->getResultArray();
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
@ -249,6 +249,31 @@ class Inwardgateregister_model extends Model
|
||||
return $result;
|
||||
}
|
||||
|
||||
function get_igr_master_for_history($field, $igr_no) {
|
||||
$builder = $this->db->table('t_igr_master Master')
|
||||
->select("Master.$field"); // Select only the required field
|
||||
if ($igr_no) {
|
||||
$builder->where('Master.IGRNO', $igr_no);
|
||||
}
|
||||
$query = $builder->get();
|
||||
$result = $query->getRow();
|
||||
return $result ? $result->$field : null; // Return the field value directly
|
||||
}
|
||||
|
||||
function get_igr_child_for_history($field, $igr_no, $igr_item_no) {
|
||||
$builder = $this->db->table('t_igr_details Child')
|
||||
->select("Child.$field"); // Select only the required field
|
||||
if ($igr_no) {
|
||||
$builder->where('Child.IGRNO', $igr_no);
|
||||
}
|
||||
if ($igr_item_no) {
|
||||
$builder->where('Child.IGRItemNo', $igr_item_no);
|
||||
}
|
||||
$query = $builder->get();
|
||||
$result = $query->getRow();
|
||||
return $result ? $result->$field : null; // Return the field value directly
|
||||
}
|
||||
|
||||
function addigrM($igrM)
|
||||
{
|
||||
// print_r($igrM);die;
|
||||
|
||||
@ -1070,7 +1070,7 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
|
||||
{
|
||||
|
||||
$builder = $this->db->table('t_purchaseorder_master POMast')->distinct()
|
||||
->select('ReqNo,POMast.PONO,POMast.PaymentTerms,POMast.PaymentOtherDescription,
|
||||
->select('LineItem.LineitemAuditorNotes,ReqNo,POMast.PONO,POMast.PaymentTerms,POMast.PaymentOtherDescription,
|
||||
ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,supp.MSME,
|
||||
PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,
|
||||
POMast.PaymentTerms,POMast.ExchangeRate,POMast.UpdatedOn,Stat.StatusCode,
|
||||
@ -1095,7 +1095,7 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
|
||||
function GetServicePurchaseOrderDetails($PONO = '')
|
||||
{
|
||||
|
||||
$subQuery = 'SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,LineItem.Per,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,LineItem.Quantity,ReceivedQuantity,Rate,LineItem.Status,(LineItem.Quantity *Rate) as BasicValue ,(After_CGST + After_SGST + After_IGST) as Taxamount,Dept.DepartmentName
|
||||
$subQuery = 'SELECT distinct LineItem.LineitemAuditorNotes,LineItem.LineItemNo,LineItem.ReqNo,LineItem.Per,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,LineItem.Quantity,ReceivedQuantity,Rate,LineItem.Status,(LineItem.Quantity *Rate) as BasicValue ,(After_CGST + After_SGST + After_IGST) as Taxamount,Dept.DepartmentName
|
||||
,TotalValue,CGST,After_CGST,SGST,After_SGST,IGST,After_IGST,otherallowance,LineItem.CostCenterCode,LineItem.ServiceFrequency,LineItem.ServiceMaterialDescription,Req.Schedule_Type,Req.NumberOfService,Req.Service_Period,ReqDet.MaterialDescription
|
||||
FROM t_purchaseorder_lineitem LineItem
|
||||
left join t_materialmaster Mat on Mat.MaterialCode = LineItem.MaterialCode
|
||||
@ -1116,7 +1116,7 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
|
||||
|
||||
|
||||
|
||||
$subQuery = 'SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,LineItem.Per,LineItem.ServiceMaterialDescription,Mat.MaterialCode,Mat.MaterialName,POMaster.ParentPO,
|
||||
$subQuery = 'SELECT distinct LineItem.LineitemAuditorNotes,LineItem.LineItemNo,LineItem.ReqNo,LineItem.Per,LineItem.ServiceMaterialDescription,Mat.MaterialCode,Mat.MaterialName,POMaster.ParentPO,
|
||||
Mat.UOM,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue,POMaster.AmendedDetails,LineItem.AmendedDetails as lineamenddetails,
|
||||
ROUND(( Tax.After_SGST + Tax.After_CGST + Tax.After_IGST ) ,2)as Taxamount,ReqMat.NumberOfService,ReqMat.Schedule_Type,ReqMat.Service_Period,
|
||||
TotalValue,Tax.After_SGST AS AfterSGST,Tax.After_CGST AS AfterCGST,Tax.After_IGST AS AfterIGST , Tax.*,LineItem.CostCenterCode ,POMaster.*,sup.SupplierName,sup.SupplierID,sup.Address,sup.ContactNumber,sup.EmailAddress,sup.PAN,sup.GSTNO,sup.MSME,sup.Cert_MSME,Payment.PaymentTerms,AdvanceAmount
|
||||
@ -1141,8 +1141,8 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
|
||||
function GetRevenuePurchaseOrderDetails($PONO = '')
|
||||
{
|
||||
|
||||
$subQuery = 'SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,Per,ServiceMaterialDescription,ReceivedQuantity,Rate,Req.Status,(Quantity *Rate) as BasicValue , (( AfterSGST + AfterCGST +
|
||||
AfterIGST )) as Taxamount ,TotalValue,Tax.*,Req.CostCenterCode,Dept.DepartmentName
|
||||
$subQuery = 'SELECT distinct LineItem.LineitemAuditorNotes,LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,Per,ServiceMaterialDescription,ReceivedQuantity,Rate,Req.Status,(Quantity *Rate) as BasicValue , (( AfterSGST + AfterCGST +
|
||||
AfterIGST )) as Taxamount ,TotalValue,Tax.*,Req.CostCenterCode,Dept.DepartmentName,LineItem.LineitemAuditorNotes
|
||||
FROM t_purchaseorder_lineitem LineItem
|
||||
join t_materialmaster Mat on Mat.MaterialCode = LineItem.MaterialCode
|
||||
left join t_revenue_tax Tax on Tax.LineItemNo = LineItem.LineItemNo
|
||||
@ -1160,7 +1160,7 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
|
||||
function GetRevenuePurchaseOrderDetailsForPDF($PONO = '')
|
||||
{
|
||||
|
||||
$subQuery = 'SELECT distinct LineItem.LineItemNo,LineItem.Per,ReqNo,Mat.MaterialCode,Mat.MaterialName,POMaster.PaymentOtherDescription,LineItem.ServiceMaterialDescription,
|
||||
$subQuery = 'SELECT distinct LineItem.LineitemAuditorNotes,LineItem.LineItemNo,LineItem.Per,ReqNo,Mat.MaterialCode,Mat.MaterialName,POMaster.PaymentOtherDescription,LineItem.ServiceMaterialDescription,
|
||||
Mat.UOM,Mat.HSNCODE,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue ,
|
||||
ROUND(((AfterSGST + AfterCGST +
|
||||
AfterIGST)) ,2)as Taxamount,AdvanceAmount,
|
||||
@ -1213,7 +1213,7 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
|
||||
// join t_supplierdetailsn sup on sup.SupplierID = POMaster.SupplierID
|
||||
// where LineItem.PONO =?';
|
||||
|
||||
$subQuery = 'SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,Mat.MaterialCode,Mat.MaterialName,Import_DispatchDetails,LineItem.Per,LineItem.ServiceMaterialDescription,
|
||||
$subQuery = 'SELECT distinct LineItem.LineitemAuditorNotes,LineItem.LineItemNo,LineItem.ReqNo,Mat.MaterialCode,Mat.MaterialName,Import_DispatchDetails,LineItem.Per,LineItem.ServiceMaterialDescription,
|
||||
Mat.UOM,Quantity,ReqMas.Requestedby,Rate,ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount ,
|
||||
ProductPrice,Tax.*,LineItem.CostCenterCode ,Date(ReqMast.ReqDate) as ReqDate,POMaster.*,sup.SupplierName,sup.Address,LineItem.AmendedDetails as LineAmend,LineItem.AmendedDetails as lineamenddetails,AdvanceAmount, Pay.PaymentTerms as PaymentTerms,ROUND((Quantity *Rate),2 ) as BasicValue,HSNCODE,
|
||||
sup.EmailAddress,sup.SupplierID,sup.PAN,sup.ContactNumber,sup.GSTNO,sup.MSME,sup.Cert_MSME
|
||||
@ -1325,7 +1325,7 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
|
||||
|
||||
function GetImportPurchaseOrderDetails($PONO = '')
|
||||
{
|
||||
$subQuery = 'SELECT DISTINCT LineItem.LineItemNo, Req.ReqNo, Mat.MaterialCode, Mat.MaterialName,
|
||||
$subQuery = 'SELECT DISTINCT LineItem.LineitemAuditorNotes,LineItem.LineItemNo, Req.ReqNo, Mat.MaterialCode, Mat.MaterialName,
|
||||
Mat.UOM, Quantity, Rate, Req.Status, ROUND((Quantity * Rate), 2) AS BasicValue,
|
||||
ReceivedQuantity, QuantityRejected, ROUND(Quantity - ReceivedQuantity) AS PendingQty, Per,
|
||||
ROUND((RMCIncludingCustomersPerKG * Quantity), 2) AS Taxamount, LandingCharge, HighSeasSalesCharge,
|
||||
|
||||
@ -18,9 +18,10 @@ class Rawmaterialdetails_model extends Model
|
||||
{
|
||||
|
||||
$builder = $this->db->table('t_materialmaster')
|
||||
->select('t_materialmaster.* , emp.FirstName as createdby_user')
|
||||
->select('t_materialmaster.* , emp.FirstName as createdby_user,cd.ConfigValue as CategoryName')
|
||||
->join('tbl_users as user', 'user.UserId = t_materialmaster.createdby', 'left')
|
||||
->join('t_employee_details as emp', 'emp.EmpID = user.EmpID', 'left')
|
||||
->join('t_configdetails as cd', 'cd.Key = t_materialmaster.Category', 'left')
|
||||
->orderBy('CreatedDate','desc');
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
@ -76,7 +77,7 @@ class Rawmaterialdetails_model extends Model
|
||||
{
|
||||
$Config_ID = 'C023';
|
||||
$builder = $this->db->table('t_configdetails')
|
||||
->select('Config_ID,ConfigValue')
|
||||
->select('Key,Config_ID,ConfigValue')
|
||||
->where('isActive', 1)
|
||||
->where('Config_id', $Config_ID);
|
||||
if ($MaterialCategory != '') {
|
||||
@ -329,15 +330,18 @@ class Rawmaterialdetails_model extends Model
|
||||
|
||||
|
||||
// on 28/jan/2025. both add and edit. category condition added.
|
||||
// on 13/Feb/2025. Change based On Config Child Values.
|
||||
function checkMaterialExists($materialCode , $materialName ,$materialCategory)
|
||||
{
|
||||
$builder = $this->db->table('t_materialmaster')
|
||||
->select('MaterialCode,MaterialName,MaterialType,Category,IsActive');
|
||||
|
||||
$builder = $this->db->table('t_materialmaster MM')
|
||||
->select('MM.MaterialCode,MM.MaterialName,MM.MaterialType,MM.Category,MM.IsActive,CD.ConfigValue as CategoryName')
|
||||
->join('t_configdetails as CD', ' CD.Key = MM.Category', 'left');
|
||||
if(!empty($materialCode)){
|
||||
$builder = $builder->where('MaterialCode !=' , $materialCode);
|
||||
$builder = $builder->where('MM.MaterialCode !=' , $materialCode);
|
||||
}
|
||||
$builder->where('Category' , $materialCategory);
|
||||
$builder->where('REPLACE(MaterialName, " ", "")' , $materialName);
|
||||
$builder->where('MM.Category' , $materialCategory);
|
||||
$builder->where('REPLACE(MM.MaterialName, " ", "")' , $materialName);
|
||||
|
||||
$query = $builder->get();
|
||||
if ($query->getNumRows() > 0) {
|
||||
@ -347,17 +351,6 @@ class Rawmaterialdetails_model extends Model
|
||||
}
|
||||
}
|
||||
|
||||
function checkMaterialCategory($mc)
|
||||
{
|
||||
$builder = $this->db->table('t_configdetails')
|
||||
->select('ConfigValue')
|
||||
->where('Config_ID', 'C023')
|
||||
->like('ConfigValue', $mc);
|
||||
$query = $builder->get()->getRow();
|
||||
return $query;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function reOrderListing()
|
||||
{
|
||||
|
||||
@ -196,9 +196,10 @@ class Requistion_model extends Model
|
||||
*/
|
||||
function getRawMaterialList($MaterialCode)
|
||||
{
|
||||
$builder = $this->db->table('t_materialmaster')
|
||||
->select('MaterialName,UOM,Category')
|
||||
->where('MaterialCode',$MaterialCode );
|
||||
$builder = $this->db->table('t_materialmaster MM')
|
||||
->select('MM.MaterialName,MM.UOM,MM.Category,CD.ConfigValue as CategoryName')
|
||||
->join('t_configdetails CD', 'CD.Key = MM.Category', 'left')
|
||||
->where('MM.MaterialCode',$MaterialCode );
|
||||
$query = $builder->get();
|
||||
|
||||
return $query->getResultArray();
|
||||
|
||||
@ -1,3 +1,99 @@
|
||||
<style>
|
||||
.edit-container {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.edit-input-field {
|
||||
padding: 2px;
|
||||
font-size: 14px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.edit-input-field:focus {
|
||||
outline: none;
|
||||
border-color: #007bff;
|
||||
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
|
||||
}
|
||||
|
||||
.save-btn, .cancel-btn {
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
color: #28a745;
|
||||
background-color: #e8f5e9;
|
||||
}
|
||||
|
||||
.save-btn:hover {
|
||||
background-color: #c3e6cb;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
color: #dc3545;
|
||||
background-color: #f8d7da;
|
||||
}
|
||||
|
||||
.cancel-btn:hover {
|
||||
background-color: #f5c6cb;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$(document).on('click', '.editable-field', function (e) {
|
||||
e.preventDefault();
|
||||
const $link = $(this);
|
||||
const value = $link.text().trim();
|
||||
|
||||
// Hide the <a> tag and show the edit container
|
||||
$link.hide();
|
||||
const $editContainer = $link.siblings('.edit-container');
|
||||
$editContainer.find('.edit-input-field').val(value);
|
||||
$editContainer.show();
|
||||
});
|
||||
|
||||
// Handle click on the tick (save) button
|
||||
$(document).on('click', '.save-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $input = $editContainer.find('.edit-input-field');
|
||||
|
||||
const value = $input.val().trim();
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
const LineItemNoteForAuditor = $link.data('notes');
|
||||
const id = $link.data('id');
|
||||
var theForm = $(".CreatePO");
|
||||
$("#LineItemNoteForAuditor" + id).val(value); // to update the hidden fields
|
||||
$link.text(value).show(); // to update table cell
|
||||
$editContainer.hide();
|
||||
});
|
||||
|
||||
// Handle click on the close (cancel) button
|
||||
$(document).on('click', '.cancel-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
|
||||
// Hide the edit container and show the <a> tag
|
||||
$editContainer.hide();
|
||||
$link.show();
|
||||
});});</script>
|
||||
<?php
|
||||
$insuranceStatus = array(
|
||||
array("name" => "NO", "value" => "0"),
|
||||
@ -147,6 +243,7 @@ if (!empty($getlogpodtl)) {
|
||||
// var maxDate = new Date(minDate.getFullYear() + 1, minDate.getMonth(), minDate.getDate());
|
||||
});
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
tinymce.init({
|
||||
selector: "textarea#ScopeOfWork",
|
||||
@ -197,6 +294,47 @@ if (!empty($getlogpodtl)) {
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$(document).on('click', '.editable-field', function (e) {
|
||||
e.preventDefault();
|
||||
const $link = $(this);
|
||||
const value = $link.text().trim();
|
||||
|
||||
// Hide the <a> tag and show the edit container
|
||||
$link.hide();
|
||||
const $editContainer = $link.siblings('.edit-container');
|
||||
$editContainer.find('.edit-input-field').val(value);
|
||||
$editContainer.show();
|
||||
});
|
||||
|
||||
// Handle click on the tick (save) button
|
||||
$(document).on('click', '.save-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $input = $editContainer.find('.edit-input-field');
|
||||
|
||||
const value = $input.val().trim();
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
const LineItemNoteForAuditor = $link.data('notes');
|
||||
const id = $link.data('id');
|
||||
var theForm = $(".CreatePO");
|
||||
$("#LineItemNoteForAuditor" + id).val(value); // to update the hidden fields
|
||||
$link.text(value).show(); // to update table cell
|
||||
$editContainer.hide();
|
||||
});
|
||||
|
||||
// Handle click on the close (cancel) button
|
||||
$(document).on('click', '.cancel-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
|
||||
// Hide the edit container and show the <a> tag
|
||||
$editContainer.hide();
|
||||
$link.show();
|
||||
});
|
||||
|
||||
if (statuscheck == "<?php echo SPECIAL_PO; ?>") //|| statuscheck=="<?php echo PO_AWAITING_RELEASE; ?>" )
|
||||
{
|
||||
$('#splpodiv').show();
|
||||
@ -1100,6 +1238,7 @@ if (!empty($getlogpodtl)) {
|
||||
<th style="text-align:center !important;">Requisition No</th>
|
||||
<th style="text-align:center !important;">Item Code</th>
|
||||
<th>Item Name</th>
|
||||
<th>Line Item Specs</th>
|
||||
<th style="text-align: center;">Quantity</th>
|
||||
<th>UOM</th>
|
||||
<th style="text-align: right;">Rate <?php echo "($INRSYM)" ?></th>
|
||||
@ -1133,6 +1272,20 @@ if (!empty($getlogpodtl)) {
|
||||
<td align="center"><?php echo $record->ReqNo ?></td>
|
||||
<td align="center"><?php echo $record->MaterialCode ?></td>
|
||||
<td><?php echo $record->MaterialName ?></td>
|
||||
<td>
|
||||
<?php if ($PONOStatus === PO_DRAFT || $PONOStatus === PO_CREATED) { ?>
|
||||
<a href="#"
|
||||
class="editable-field"
|
||||
data-id ="<?php echo $index ?>" data-notes="<?php echo $record->LineitemAuditorNotes; ?>">
|
||||
<?php echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; ?>
|
||||
</a>
|
||||
<div class="edit-container" style="display:none;">
|
||||
<input type="text" class="edit-input-field" />
|
||||
<button class="save-btn">✔</button>
|
||||
<button class="cancel-btn">✖</button>
|
||||
</div>
|
||||
<?php }else{ echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; } ?>
|
||||
</td>
|
||||
<td align="center"><?php echo $record->Quantity ?></td>
|
||||
<td><?php echo $record->UOM ?></td>
|
||||
|
||||
@ -1196,6 +1349,7 @@ if (!empty($getlogpodtl)) {
|
||||
<input type="hidden" name="<?php echo 'OtherAmt' . $index ?>" id="<?php echo 'OtherAmt' . $index ?>" value="<?php echo $record->otherallowance; ?>" />
|
||||
|
||||
<input type="hidden" name="<?php echo 'OtherServiceDescription' . $index ?>" id="<?php echo 'OtherServiceDescription' . $index ?>" value="<?php echo $record->MaterialDescription; ?>" />
|
||||
<input type="hidden" name="<?php echo 'LineItemNoteForAuditor' . $index ?>" id="<?php echo 'LineItemNoteForAuditor' . $index ?>" value="<?php echo $record->LineitemAuditorNotes; ?>" />
|
||||
|
||||
|
||||
<?php
|
||||
@ -2455,13 +2609,24 @@ if (!empty($getlogpodtl)) {
|
||||
// Taxvalue: TotalTaxValue,
|
||||
// TotalValue: TotalOrderValue
|
||||
// }));
|
||||
PONOStatus = <?php echo $PONOStatus; ?>
|
||||
var rowHtml = `
|
||||
<tr id="${temp}">
|
||||
<td align="left">${temp}</td>
|
||||
<td align="left">${Reqnumber}</td>
|
||||
<td align="left">${materialCode}</td>
|
||||
<td align="left">${materialName}</td>
|
||||
<td align="right">${quantity}</td>
|
||||
<td align="left">${materialName}</td>`;
|
||||
if (PONOStatus === "PO_DRAFT" || PONOStatus === "PO_CREATED") {
|
||||
rowHtml += `<td><a href="#" class="editable-field"
|
||||
data-id="${temp}"
|
||||
data-notes="-">-</a>
|
||||
<div class="edit-container" style="display:none;">
|
||||
<input type="text" class="edit-input-field" />
|
||||
<button class="save-btn">✔</button>
|
||||
<button class="cancel-btn">✖</button>
|
||||
</div></td>`;
|
||||
}else{ rowHtml += `<td>-</td>`; }
|
||||
rowHtml += `<td align="right">${quantity}</td>
|
||||
<td align="left">${uom}</td>
|
||||
<td align="right">${itemRate}</td>
|
||||
<td align="right">${basicval}</td>
|
||||
@ -2576,12 +2741,12 @@ if (!empty($getlogpodtl)) {
|
||||
|
||||
cellval[2].innerHTML = editMaterialCode;
|
||||
cellval[3].innerHTML = editDescription;
|
||||
cellval[4].innerHTML = editQuantity;
|
||||
cellval[5].innerHTML = editUOM;
|
||||
cellval[6].innerHTML = parseFloat(itemRate).toFixed(2);
|
||||
cellval[7].innerHTML = parseFloat(basicval).toFixed(2);
|
||||
cellval[8].innerHTML = parseFloat(TotalTaxValue).toFixed(2);
|
||||
cellval[9].innerHTML = parseFloat(TotalOrderValue).toFixed(2);
|
||||
cellval[5].innerHTML = editQuantity;
|
||||
cellval[6].innerHTML = editUOM;
|
||||
cellval[7].innerHTML = parseFloat(itemRate).toFixed(2);
|
||||
cellval[8].innerHTML = parseFloat(basicval).toFixed(2);
|
||||
cellval[9].innerHTML = parseFloat(TotalTaxValue).toFixed(2);
|
||||
cellval[10].innerHTML = parseFloat(TotalOrderValue).toFixed(2);
|
||||
|
||||
|
||||
$('#materialCode' + userid).val(editMaterialCode);
|
||||
@ -3285,7 +3450,7 @@ if (!empty($getlogpodtl)) {
|
||||
$('#EditQuantity').val($('#quantity' + userid).val());
|
||||
RequistQuantity = $('#quantity' + userid).val();
|
||||
$('#EditRate').val($('#itemRate' + userid).val());
|
||||
$('#txtEditBasicValue').val(cellval[7].innerHTML);
|
||||
$('#txtEditBasicValue').val(cellval[8].innerHTML);
|
||||
$('#EditCgst').val($('#Cgst' + userid).val());
|
||||
$('#EditSgst').val($('#Sgst' + userid).val());
|
||||
$('#EditIgst').val($('#Igst' + userid).val());
|
||||
@ -3315,7 +3480,7 @@ if (!empty($getlogpodtl)) {
|
||||
$("#EditFrequencyNo").val($('#FrequencyValue' + userid).val());
|
||||
}
|
||||
|
||||
$('#EditTotalOrderValue').val(cellval[9].innerHTML);
|
||||
$('#EditTotalOrderValue').val(cellval[10].innerHTML);
|
||||
$('#EditOtherAllowances').val($('#OtherAmt' + userid).val());
|
||||
tinyMCE.get('EdittxtSpcialInstruction').setContent($('#ItemDescription' + userid).val());
|
||||
RequistQuantity = $('#quantity' + userid).val();
|
||||
@ -3396,7 +3561,7 @@ if (!empty($getlogpodtl)) {
|
||||
$('#ViewQuantity').val($('#quantity' + userid).val());
|
||||
RequistQuantity = $('#quantity' + userid).val();
|
||||
$('#ViewRate').val($('#itemRate' + userid).val());
|
||||
$('#txtViewBasicValue').val(cellval[7].innerHTML);
|
||||
$('#txtViewBasicValue').val(cellval[8].innerHTML);
|
||||
$('#ViewCgst').val($('#Cgst' + userid).val());
|
||||
$('#ViewSgst').val($('#Sgst' + userid).val());
|
||||
$('#ViewIgst').val($('#Igst' + userid).val());
|
||||
@ -3423,7 +3588,7 @@ if (!empty($getlogpodtl)) {
|
||||
$("#ViewFrequencyNo").val($('#FrequencyValue' + userid).val());
|
||||
}
|
||||
|
||||
$('#ViewTotalOrderValue').val(cellval[9].innerHTML);
|
||||
$('#ViewTotalOrderValue').val(cellval[10].innerHTML);
|
||||
$('#ViewOtherAllowances').val($('#OtherAmt' + userid).val());
|
||||
|
||||
tinyMCE.get('ViewtxtSpcialInstruction').setContent($('#ItemDescription' + userid).val());
|
||||
|
||||
@ -68,19 +68,19 @@
|
||||
</div>
|
||||
|
||||
<div class=" col-md-3">
|
||||
<label class="col-form-label" for="MatCate">Material Caterogy
|
||||
<label class="col-form-label" for="MatCate">Material Category
|
||||
<span class="badge">*</span></label>
|
||||
<i type="button" class="fe-plus-circle" id="addMaterialCaterogyModalButton"
|
||||
<!-- <i type="button" class="fe-plus-circle" id="addMaterialCaterogyModalButton"
|
||||
style="font-size: 16px; color:rgb(15, 155, 218);" data-toggle="modal" data-target="#addMaterialCaterogyModal"
|
||||
title="Add Material Caterogy">
|
||||
</i>
|
||||
title="Add Material Category">
|
||||
</i> -->
|
||||
<select class="form-control select2" required id="MatCate" name="MatCate">
|
||||
<option value="" required>Select Material Category </option>
|
||||
<?php
|
||||
if (!empty($materialcategory)) {
|
||||
foreach ($materialcategory as $SID) {
|
||||
?>
|
||||
<option value="<?php echo $SID->ConfigValue ?>"><?php echo $SID->ConfigValue ?></option>
|
||||
<option value="<?php echo $SID->Key ?>"><?php echo $SID->ConfigValue ?></option>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@ -322,27 +322,25 @@
|
||||
success: function(data) {
|
||||
|
||||
if (data && data.length >= 1) {
|
||||
$('#loader').hide();
|
||||
$('#loader').hide();
|
||||
let message = "";
|
||||
if (data[0]?.IsActive == 1) {
|
||||
message = "Material name already exists!\n\n";
|
||||
} else {
|
||||
message = "Material name already exists in the deleted section!\n\n";
|
||||
}
|
||||
|
||||
if(data[0]?.IsActive == 1){
|
||||
alert('Material name already existed ! ');
|
||||
$('#MaterialName').val('');
|
||||
}else{
|
||||
alert('Material name already existing in the deleted section.!!');
|
||||
$('#MaterialName').val('');
|
||||
}
|
||||
let related_name = "";
|
||||
$.each(data, function(i, obj) {
|
||||
related_name += obj.MaterialCode + " - " + obj.MaterialName + " - " + obj.MaterialType + " - " + obj.CategoryName + "\n";
|
||||
});
|
||||
|
||||
var related_name = "" ;
|
||||
$.each(data, function(i, obj) {
|
||||
message += "'" + materialName + "' - related materials are:\n\n" + related_name;
|
||||
|
||||
related_name += obj.MaterialCode + " - " + obj.MaterialName + " - " + obj.MaterialType + " - " + obj.Category + "\n";
|
||||
|
||||
});
|
||||
|
||||
alert("'" + materialName + "' - related materials are , " + " \n \n" + related_name);
|
||||
$("#MaterialName").val('');
|
||||
$("#MaterialName").focus();
|
||||
alert(message);
|
||||
|
||||
$("#MaterialName").val('');
|
||||
$("#MaterialName").focus();
|
||||
|
||||
} else{
|
||||
console.log("Material name is unique");
|
||||
@ -407,49 +405,6 @@
|
||||
alert('Material Category should have fewer than 20 letters.');
|
||||
return false;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url('/rawmaterialdetails/addMaterialCategories'); ?>",
|
||||
type: 'POST',
|
||||
data: {
|
||||
category_name: materialCategory
|
||||
},
|
||||
success: function(response) {
|
||||
|
||||
if(response.status == 201){
|
||||
|
||||
$("#addMaterialCaterogyModal").modal('hide');
|
||||
$("#MatCate").append(`<option value="${materialCategory}" selected > ${materialCategory} </option>`);
|
||||
|
||||
}else if(response.status=="409"){
|
||||
|
||||
$("#addMaterialCaterogyModal").modal('hide');
|
||||
|
||||
// $('#MatCate').val(materialCategory);
|
||||
|
||||
$('#MatCate').trigger('change');
|
||||
|
||||
setTimeout(()=>{ alert(`${response.message}`) },1000)
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
$("#addMaterialCaterogyModal").modal('hide');
|
||||
|
||||
setTimeout(()=>{ alert('Error Adding Category..!!'); },1000)
|
||||
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// Handle errors
|
||||
alert('Error adding category');
|
||||
console.log(error);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,5 +1,101 @@
|
||||
<style>
|
||||
.edit-container {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.edit-input-field {
|
||||
padding: 2px;
|
||||
font-size: 14px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.edit-input-field:focus {
|
||||
outline: none;
|
||||
border-color: #007bff;
|
||||
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
|
||||
}
|
||||
|
||||
.save-btn, .cancel-btn {
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
color: #28a745;
|
||||
background-color: #e8f5e9;
|
||||
}
|
||||
|
||||
.save-btn:hover {
|
||||
background-color: #c3e6cb;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
color: #dc3545;
|
||||
background-color: #f8d7da;
|
||||
}
|
||||
|
||||
.cancel-btn:hover {
|
||||
background-color: #f5c6cb;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(document).on('click', '.editable-field', function (e) {
|
||||
e.preventDefault();
|
||||
const $link = $(this);
|
||||
const value = $link.text().trim();
|
||||
|
||||
// Hide the <a> tag and show the edit container
|
||||
$link.hide();
|
||||
const $editContainer = $link.siblings('.edit-container');
|
||||
$editContainer.find('.edit-input-field').val(value);
|
||||
$editContainer.show();
|
||||
});
|
||||
|
||||
// Handle click on the tick (save) button
|
||||
$(document).on('click', '.save-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $input = $editContainer.find('.edit-input-field');
|
||||
|
||||
const value = $input.val().trim();
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
const LineItemNoteForAuditor = $link.data('notes');
|
||||
const id = $link.data('id');
|
||||
var theForm = $(".CreatePO");
|
||||
|
||||
addHidden(theForm, "LineItemNoteForAuditor" + id, value);
|
||||
$link.text(value).show();
|
||||
$editContainer.hide();
|
||||
});
|
||||
|
||||
// Handle click on the close (cancel) button
|
||||
$(document).on('click', '.cancel-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
|
||||
// Hide the edit container and show the <a> tag
|
||||
$editContainer.hide();
|
||||
$link.show();
|
||||
});
|
||||
|
||||
// When the second modal is about to be shown
|
||||
$('#packagingcalmodel').on('show.bs.modal', function() {
|
||||
// Set a higher z-index for the second modal to appear on top
|
||||
@ -14,7 +110,7 @@
|
||||
$('#packagingcalmodel').on('hidden.bs.modal', function() {
|
||||
$('#packagingcalmodel').css('z-index', ''); // Reset to default
|
||||
});
|
||||
|
||||
|
||||
$('#editpackagingcalmodel').on('show.bs.modal', function() {
|
||||
// Set a higher z-index for the second modal to appear on top
|
||||
$('#editpackagingcalmodel').css('z-index', 1060); // Set the z-index for the second modal
|
||||
@ -654,6 +750,7 @@ if (!empty($INRSYMBOL)) {
|
||||
<th>Requisition No</th>
|
||||
<th>Item Code</th>
|
||||
<th>Item Description</th>
|
||||
<th>Line Item Specs</th>
|
||||
<th>Quantity</th>
|
||||
<th>UOM</th>
|
||||
<th>Rate</th>
|
||||
@ -3392,6 +3489,15 @@ if (!empty($INRSYMBOL)) {
|
||||
<td align="left">${Reqnumber}</td>
|
||||
<td align="left">${materialCode}</td>
|
||||
<td align="left">${materialName}</td>
|
||||
<td>
|
||||
<a href="#" class="editable-field"
|
||||
data-notes = "-" data-id ="${temp}">-</a>
|
||||
<div class="edit-container" style="display:none;">
|
||||
<input type="text" class="edit-input-field" />
|
||||
<button class="save-btn">✔</button>
|
||||
<button class="cancel-btn">✖</button>
|
||||
</div>
|
||||
</td>
|
||||
<td align="left">${quantity}</td>
|
||||
<td align="left">${uom}</td>
|
||||
<td align="left">${itemRate}</td>
|
||||
@ -3490,7 +3596,7 @@ if (!empty($INRSYMBOL)) {
|
||||
addHidden(theForm, "NoofTriploc" + temp, Nooftriploc);
|
||||
addHidden(theForm, "FreightRateloc" + temp, Freightrateloc);
|
||||
addHidden(theForm, "AfterFreightRateloc" + temp, AfterFreightAmountloc);
|
||||
|
||||
addHidden(theForm, "LineItemNoteForAuditor" + temp, '-');
|
||||
// var a=parseFloat($('#NoofTriploc'+temp).val());
|
||||
// console.log(Nooftriploc);
|
||||
|
||||
@ -4190,7 +4296,7 @@ if (!empty($INRSYMBOL)) {
|
||||
|
||||
console.log($('#Igst' + userid).val());
|
||||
|
||||
$('#EdittxtTotalOrderValue').val(cellval[9].innerHTML);
|
||||
$('#EdittxtTotalOrderValue').val(cellval[10].innerHTML);
|
||||
$('#EditCgst').val($('#Cgst' + userid).val());
|
||||
$('#EditAfterCgst').val($('#AfterCgst' + userid).val());
|
||||
$('#EditSgst').val($('#Sgst' + userid).val());
|
||||
@ -4809,12 +4915,12 @@ if (!empty($INRSYMBOL)) {
|
||||
cellval[2].innerHTML = materialCode;
|
||||
cellval[3].innerHTML = materialName;
|
||||
|
||||
cellval[4].innerHTML = quantity;
|
||||
cellval[5].innerHTML = uom;
|
||||
cellval[6].innerHTML = itemRate;
|
||||
cellval[7].innerHTML = basicval;
|
||||
cellval[8].innerHTML = TotalTaxValue;
|
||||
cellval[9].innerHTML = Total;
|
||||
cellval[5].innerHTML = quantity;
|
||||
cellval[6].innerHTML = uom;
|
||||
cellval[7].innerHTML = itemRate;
|
||||
cellval[8].innerHTML = basicval;
|
||||
cellval[9].innerHTML = TotalTaxValue;
|
||||
cellval[10].innerHTML = Total;
|
||||
|
||||
|
||||
$('#EDITCAPITAL').modal('hide');
|
||||
|
||||
@ -75,7 +75,7 @@
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<a class="btn btn-success" href="<?php echo base_url(); ?>addconfig">Add New Configuration</a>
|
||||
<!-- <a class="btn btn-success" href="<?php echo base_url(); ?>addconfig">Add New Configuration</a> --> <!-- hidden temporary told by gowtham 13/feb/2025 -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -192,11 +192,11 @@
|
||||
|
||||
|
||||
|
||||
<a onclick="confirmDeleteConfig(event)"
|
||||
href="<?php echo base_url() . 'configurationctrl/deleteConfig?ConfigID=' . $record->Config_ID; ?>"
|
||||
data-toggle="tooltip"
|
||||
title="<?php echo $record->Config_ID ?> - Click here to Delete Config Details">
|
||||
<i class="fas fa-trash"></i>
|
||||
<a onclick="confirmDeleteConfig(event)"
|
||||
href="<?php echo base_url() . 'configurationctrl/deleteConfig?ConfigID=' . $record->Config_ID; ?>"
|
||||
data-toggle="tooltip"
|
||||
title="<?php echo $record->Config_ID ?> - Click here to Delete Config Details">
|
||||
<i class="fas fa-trash" data-toggle="tooltip" title="Click here to Delete the Config Value"></i>
|
||||
</a>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
@ -1,3 +1,99 @@
|
||||
<style>
|
||||
.edit-container {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.edit-input-field {
|
||||
padding: 2px;
|
||||
font-size: 14px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.edit-input-field:focus {
|
||||
outline: none;
|
||||
border-color: #007bff;
|
||||
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
|
||||
}
|
||||
|
||||
.save-btn, .cancel-btn {
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
color: #28a745;
|
||||
background-color: #e8f5e9;
|
||||
}
|
||||
|
||||
.save-btn:hover {
|
||||
background-color: #c3e6cb;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
color: #dc3545;
|
||||
background-color: #f8d7da;
|
||||
}
|
||||
|
||||
.cancel-btn:hover {
|
||||
background-color: #f5c6cb;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$(document).on('click', '.editable-field', function (e) {
|
||||
e.preventDefault();
|
||||
const $link = $(this);
|
||||
const value = $link.text().trim();
|
||||
|
||||
// Hide the <a> tag and show the edit container
|
||||
$link.hide();
|
||||
const $editContainer = $link.siblings('.edit-container');
|
||||
$editContainer.find('.edit-input-field').val(value);
|
||||
$editContainer.show();
|
||||
});
|
||||
|
||||
// Handle click on the tick (save) button
|
||||
$(document).on('click', '.save-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $input = $editContainer.find('.edit-input-field');
|
||||
|
||||
const value = $input.val().trim();
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
const LineItemNoteForAuditor = $link.data('notes');
|
||||
const id = $link.data('id');
|
||||
var theForm = $(".CreatePO");
|
||||
$("#LineItemNoteForAuditor" + id).val(value); // to update the hidden fields
|
||||
$link.text(value).show(); // to update table cell
|
||||
$editContainer.hide();
|
||||
});
|
||||
|
||||
// Handle click on the close (cancel) button
|
||||
$(document).on('click', '.cancel-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
|
||||
// Hide the edit container and show the <a> tag
|
||||
$editContainer.hide();
|
||||
$link.show();
|
||||
});});</script>
|
||||
<?php $parentPO = '';
|
||||
$AvlCapitalBudAmt = isset($AvlCapitalBudAmt) ? (int) $AvlCapitalBudAmt : 0;
|
||||
$insuranceStatus = array(
|
||||
@ -795,6 +891,7 @@ if (!empty($getlogpodtl)) {
|
||||
<th>Requisition No</th>
|
||||
<th>Item Code</th>
|
||||
<th>Item Description</th>
|
||||
<th>Line Item Specs</th>
|
||||
<th>Quantity</th>
|
||||
<th>UOM</th>
|
||||
<th>Rate<?php echo "($INR)" ?></th>
|
||||
@ -826,6 +923,20 @@ if (!empty($getlogpodtl)) {
|
||||
<td><?php echo $record->ReqNo ?></td>
|
||||
<td><?php echo $record->MaterialCode ?></td>
|
||||
<td><?php echo $record->MaterialName ?></td>
|
||||
<td>
|
||||
<?php if ($PONOStatus === PO_DRAFT || $PONOStatus === PO_CREATED) { ?>
|
||||
<a href="#"
|
||||
class="editable-field"
|
||||
data-id ="<?php echo $index ?>" data-notes="<?php echo $record->LineitemAuditorNotes; ?>">
|
||||
<?php echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; ?>
|
||||
</a>
|
||||
<div class="edit-container" style="display:none;">
|
||||
<input type="text" class="edit-input-field" />
|
||||
<button class="save-btn">✔</button>
|
||||
<button class="cancel-btn">✖</button>
|
||||
</div>
|
||||
<?php }else{ echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; } ?>
|
||||
</td>
|
||||
<td align="right"><?php echo $record->Quantity ?></td>
|
||||
<td align="right"><?php echo $record->UOM ?></td>
|
||||
<td align="right"><?php echo $record->Rate ?></td>
|
||||
@ -1088,6 +1199,7 @@ if (!empty($getlogpodtl)) {
|
||||
<input type="hidden" name="<?php echo 'basicval' . $index ?>"
|
||||
id="<?php echo 'basicval' . $index ?>"
|
||||
value="<?php echo $record->Rate * $record->Quantity; ?>" />
|
||||
<input type="hidden" name="<?php echo 'LineItemNoteForAuditor' . $index ?>" id="<?php echo 'LineItemNoteForAuditor' . $index ?>" value="<?php echo $record->LineitemAuditorNotes; ?>" />
|
||||
|
||||
|
||||
|
||||
@ -3157,7 +3269,7 @@ if (!empty($getlogpodtl)) {
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
<div class="form-group col-md-3" style=padding-left: -2px;">
|
||||
<div class="form-group col-md-3" style="padding-left: -2px;">
|
||||
<label>Freight Amt <?php echo "($INR)"; ?></label>
|
||||
<?php
|
||||
$data = array('name' => 'txtAfterFreightlocview', 'value' => set_value('txtAfterFreightlocview'), 'id' => 'txtAfterFreightlocview', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
@ -4663,13 +4775,24 @@ if (!empty($getlogpodtl)) {
|
||||
// ReceivedQuantity: 0,
|
||||
// PendingQuantity: quantity
|
||||
// }));
|
||||
PONOStatus = <?php echo $PONOStatus; ?>
|
||||
var rowHtml = `
|
||||
<tr id="${temp}">
|
||||
<td align="left">${temp}</td>
|
||||
<td align="left">${Reqnumber}</td>
|
||||
<td align="left">${materialCode}</td>
|
||||
<td align="left">${materialName}</td>
|
||||
<td align="right">${quantity}</td>
|
||||
<td align="left">${materialName}</td>`;
|
||||
if (PONOStatus === "PO_DRAFT" || PONOStatus === "PO_CREATED") {
|
||||
rowHtml += `<td><a href="#" class="editable-field"
|
||||
data-id="${temp}"
|
||||
data-notes="-">-</a>
|
||||
<div class="edit-container" style="display:none;">
|
||||
<input type="text" class="edit-input-field" />
|
||||
<button class="save-btn">✔</button>
|
||||
<button class="cancel-btn">✖</button>
|
||||
</div></td>`;
|
||||
}else{ rowHtml += `<td>-</td>`; }
|
||||
rowHtml += `<td align="right">${quantity}</td>
|
||||
<td align="right">${uom}</td>
|
||||
<td align="right">${itemRate}</td>
|
||||
<td align="right">${basicval}</td>
|
||||
@ -5548,7 +5671,7 @@ if (!empty($getlogpodtl)) {
|
||||
$('#EditCustomDutyExpenses').val($('#CustomDutyExpenses' + userid).val());
|
||||
//$('#txtEditInsurance').val($('#RMCIncludingCustomers'+userid).val());
|
||||
|
||||
$('#EdittxtTotalOrderValue').val(cellval[9].innerHTML);
|
||||
$('#EdittxtTotalOrderValue').val(cellval[10].innerHTML);
|
||||
|
||||
|
||||
|
||||
@ -5653,7 +5776,7 @@ if (!empty($getlogpodtl)) {
|
||||
$('#ViewAfterSgst').val($('#AfterSgst' + userid).val());
|
||||
$('#ViewAfterIgst').val($('#AfterIgst' + userid).val());
|
||||
$('#ViewOtherAllowances').val($('#OtherAmt' + userid).val());
|
||||
$('#ViewTotalAmountlocal').val(cellval[9].innerHTML);
|
||||
$('#ViewTotalAmountlocal').val(cellval[10].innerHTML);
|
||||
|
||||
|
||||
$('#drpFreightviewloc').val($("#Ftype" + userid).val());
|
||||
@ -6428,12 +6551,12 @@ if (!empty($getlogpodtl)) {
|
||||
cellval[2].innerHTML = materialCode;
|
||||
cellval[3].innerHTML = materialName;
|
||||
|
||||
cellval[4].innerHTML = quantity;
|
||||
cellval[5].innerHTML = uom;
|
||||
cellval[6].innerHTML = parseFloat(itemRate).toFixed(2);
|
||||
cellval[7].innerHTML = parseFloat(basicval).toFixed(2);
|
||||
cellval[8].innerHTML = parseFloat(TotalTaxValue).toFixed(2);
|
||||
cellval[9].innerHTML = parseFloat(Total).toFixed(2);
|
||||
cellval[5].innerHTML = quantity;
|
||||
cellval[6].innerHTML = uom;
|
||||
cellval[7].innerHTML = parseFloat(itemRate).toFixed(2);
|
||||
cellval[8].innerHTML = parseFloat(basicval).toFixed(2);
|
||||
cellval[9].innerHTML = parseFloat(TotalTaxValue).toFixed(2);
|
||||
cellval[10].innerHTML = parseFloat(Total).toFixed(2);
|
||||
|
||||
|
||||
|
||||
|
||||
@ -166,16 +166,16 @@ if ($total <= $reorder) {
|
||||
<div class="form-group">
|
||||
<label for="MaterialCategory">Material Category
|
||||
<span class="badge">*</span></label>
|
||||
<i type="button" class="fe-plus-circle" id="addMaterialCaterogyModalButton"
|
||||
<!-- <i type="button" class="fe-plus-circle" id="addMaterialCaterogyModalButton"
|
||||
style="font-size: 16px; color:rgb(15, 155, 218);" data-toggle="modal" data-target="#addMaterialCaterogyModal"
|
||||
title="Add Material Caterogy">
|
||||
</i>
|
||||
</i> -->
|
||||
<select class="form-control select2" id="MaterialCategory" name="MaterialCategory" required>
|
||||
<?php
|
||||
if (!empty($materialCategory)) {
|
||||
foreach ($materialCategory as $SID) {
|
||||
?>
|
||||
<option value="<?php echo $SID->ConfigValue ?>" <?php if ($MaterialCategory === $SID->ConfigValue) echo "selected"; ?>><?php echo $SID->ConfigValue ?></option>
|
||||
<option value="<?php echo $SID->Key ?>" <?php if ($MaterialCategory === $SID->Key) echo "selected"; ?>><?php echo $SID->ConfigValue ?></option>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
@ -424,23 +424,24 @@ if ($total <= $reorder) {
|
||||
|
||||
if (data && data.length >= 1) {
|
||||
$('#loader').hide();
|
||||
if(data[0]?.IsActive == 1){
|
||||
alert('Material name already existed ! ');
|
||||
$('#MaterialName').val('');
|
||||
}else{
|
||||
alert('Material name already existing in the deleted section.!!');
|
||||
$('#MaterialName').val('');
|
||||
}
|
||||
var related_name = "";
|
||||
$.each(data, function(i, obj) {
|
||||
let message = "";
|
||||
if (data[0]?.IsActive == 1) {
|
||||
message = "Material name already exists!\n\n";
|
||||
} else {
|
||||
message = "Material name already exists in the deleted section!\n\n";
|
||||
}
|
||||
|
||||
related_name += obj.MaterialCode + " - " + obj.MaterialName + " - " + obj.MaterialType + " - " + obj.Category + "\n";
|
||||
let related_name = "";
|
||||
$.each(data, function(i, obj) {
|
||||
related_name += obj.MaterialCode + " - " + obj.MaterialName + " - " + obj.MaterialType + " - " + obj.CategoryName + "\n";
|
||||
});
|
||||
|
||||
});
|
||||
message += "'" + materialName + "' - related materials are:\n\n" + related_name;
|
||||
|
||||
alert("'" + materialName + "' - related materials are , " + " \n \n" + related_name);
|
||||
$("#MaterialName").val('');
|
||||
$("#MaterialName").focus();
|
||||
alert(message);
|
||||
|
||||
$("#MaterialName").val('');
|
||||
$("#MaterialName").focus();
|
||||
} else {
|
||||
$('#loader').hide();
|
||||
console.log("working")
|
||||
@ -479,48 +480,6 @@ if ($total <= $reorder) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: "<?php echo base_url('/rawmaterialdetails/addMaterialCategories'); ?>",
|
||||
type: 'POST',
|
||||
data: {
|
||||
category_name: materialCategory
|
||||
},
|
||||
success: function(response) {
|
||||
|
||||
if(response.status== 201 ){
|
||||
|
||||
$("#addMaterialCaterogyModal").modal('hide');
|
||||
$("#materialCategoryInput").val('');
|
||||
$("#MaterialCategory").append(`<option value="${materialCategory}" selected > ${materialCategory} </option>`)
|
||||
}
|
||||
else if(response.status=="409"){
|
||||
|
||||
$("#addMaterialCaterogyModal").modal('hide');
|
||||
$("#materialCategoryInput").val('');
|
||||
// $('#MaterialCategory').val(materialCategory);
|
||||
|
||||
$('#MaterialCategory').trigger('change');
|
||||
|
||||
setTimeout(()=>{ alert(`${response.message}`) },1000)
|
||||
}
|
||||
else{
|
||||
$("#addMaterialCaterogyModal").modal('hide');
|
||||
$("#materialCategoryInput").val('');
|
||||
|
||||
setTimeout(()=>{ alert('Error Adding Category..!!'); },1000)
|
||||
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// Handle errors
|
||||
alert('Error adding category');
|
||||
console.log(error);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,5 +1,99 @@
|
||||
<style>
|
||||
.edit-container {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.edit-input-field {
|
||||
padding: 2px;
|
||||
font-size: 14px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.edit-input-field:focus {
|
||||
outline: none;
|
||||
border-color: #007bff;
|
||||
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
|
||||
}
|
||||
|
||||
.save-btn, .cancel-btn {
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
color: #28a745;
|
||||
background-color: #e8f5e9;
|
||||
}
|
||||
|
||||
.save-btn:hover {
|
||||
background-color: #c3e6cb;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
color: #dc3545;
|
||||
background-color: #f8d7da;
|
||||
}
|
||||
|
||||
.cancel-btn:hover {
|
||||
background-color: #f5c6cb;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$(document).on('click', '.editable-field', function (e) {
|
||||
e.preventDefault();
|
||||
const $link = $(this);
|
||||
const value = $link.text().trim();
|
||||
|
||||
// Hide the <a> tag and show the edit container
|
||||
$link.hide();
|
||||
const $editContainer = $link.siblings('.edit-container');
|
||||
$editContainer.find('.edit-input-field').val(value);
|
||||
$editContainer.show();
|
||||
});
|
||||
|
||||
// Handle click on the tick (save) button
|
||||
$(document).on('click', '.save-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $input = $editContainer.find('.edit-input-field');
|
||||
|
||||
const value = $input.val().trim();
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
const LineItemNoteForAuditor = $link.data('notes');
|
||||
const id = $link.data('id');
|
||||
var theForm = $(".CreatePO");
|
||||
$("#LineItemNoteForAuditor" + id).val(value); // to update the hidden fields
|
||||
$link.text(value).show(); // to update table cell
|
||||
$editContainer.hide();
|
||||
});
|
||||
|
||||
// Handle click on the close (cancel) button
|
||||
$(document).on('click', '.cancel-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
|
||||
// Hide the edit container and show the <a> tag
|
||||
$editContainer.hide();
|
||||
$link.show();
|
||||
});
|
||||
// When the second modal is about to be shown
|
||||
$('#freightcalmodel').on('show.bs.modal', function () {
|
||||
// Set a higher z-index for the second modal to appear on top
|
||||
@ -2241,6 +2335,7 @@ if (!empty($getlogpodtl)) {
|
||||
<th style="text-align:center !important">Requisition No</th>
|
||||
<th style="text-align:center !important">Item Code</th>
|
||||
<th style="text-align:left !important">Item Description</th>
|
||||
<th style="text-align:center !important">Line Item Specs</th>
|
||||
<th style="text-align:center !important">Quantity</th>
|
||||
<th style="text-align:center !important">UOM</th>
|
||||
<th style="text-align:right !important">Rate <?php echo "($INRSYM)" ?>
|
||||
@ -2273,6 +2368,20 @@ if (!empty($getlogpodtl)) {
|
||||
<td align="center"><?php echo $record->ReqNo ?></td>
|
||||
<td align="center"><?php echo $record->MaterialCode ?></td>
|
||||
<td align="left"><?php echo $record->MaterialName ?></td>
|
||||
<td>
|
||||
<?php if ($PONOStatus === PO_DRAFT || $PONOStatus === PO_CREATED) { ?>
|
||||
<a href="#"
|
||||
class="editable-field"
|
||||
data-id ="<?php echo $index ?>" data-notes="<?php echo $record->LineitemAuditorNotes; ?>">
|
||||
<?php echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; ?>
|
||||
</a>
|
||||
<div class="edit-container" style="display:none;">
|
||||
<input type="text" class="edit-input-field" />
|
||||
<button class="save-btn">✔</button>
|
||||
<button class="cancel-btn">✖</button>
|
||||
</div>
|
||||
<?php }else{ echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; } ?>
|
||||
</td>
|
||||
<td align="center"><?php echo $record->Quantity ?></td>
|
||||
<td align="center"><?php echo $record->UOM ?></td>
|
||||
<td align="right"><?php echo $record->Rate ?></td>
|
||||
@ -2413,9 +2522,11 @@ if (!empty($getlogpodtl)) {
|
||||
name="<?php echo 'TotalOrderValue' . $index ?>"
|
||||
id="<?php echo 'TotalOrderValue' . $index ?>"
|
||||
value="<?php echo $record->TotalValue; ?>" />
|
||||
<?php
|
||||
|
||||
if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == SPECIAL_PO) { ?>
|
||||
<input align="right" type="hidden"
|
||||
name="<?php echo 'LineItemNoteForAuditor' . $index ?>"
|
||||
id="<?php echo 'LineItemNoteForAuditor' . $index ?>"
|
||||
value="<?php echo $record->LineitemAuditorNotes; ?>" />
|
||||
<?php if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED || $PONOStatus == PO_APPROVED || $PONOStatus == SPECIAL_PO) { ?>
|
||||
<td align="center"> <a data-target='#EDITREVENUE'
|
||||
data-id="<?php echo $index; ?>"
|
||||
data-userid="<?php echo $index; ?>" data-toggle="modal"
|
||||
@ -4365,6 +4476,9 @@ if (!empty($getlogpodtl)) {
|
||||
|
||||
});
|
||||
index = parseInt(index) + 1;
|
||||
// $PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED
|
||||
PONOStatus = <?php echo $PONOStatus; ?>
|
||||
|
||||
|
||||
// var template = jQuery("#RevenueList").html();
|
||||
|
||||
@ -4391,14 +4505,25 @@ if (!empty($getlogpodtl)) {
|
||||
<td align="left">${temp}</td>
|
||||
<td align="left">${Reqnumber}</td>
|
||||
<td align="left">${materialCode}</td>
|
||||
<td align="left">${materialName}</td>
|
||||
<td align="left">${quantity}</td>
|
||||
<td align="left">${uom}</td>
|
||||
<td align="right">${itemRate}</td>
|
||||
<td align="right">${basicval}</td>
|
||||
<td align="right">${TotalTaxValue}</td>
|
||||
<td align="right">${TotalOrderValue}</td>
|
||||
<td>
|
||||
<td align="left">${materialName}</td>`;
|
||||
if (PONOStatus === "PO_DRAFT" || PONOStatus === "PO_CREATED") {
|
||||
rowHtml += `<td><a href="#" class="editable-field"
|
||||
data-id="${temp}"
|
||||
data-notes="-">-</a>
|
||||
<div class="edit-container" style="display:none;">
|
||||
<input type="text" class="edit-input-field" />
|
||||
<button class="save-btn">✔</button>
|
||||
<button class="cancel-btn">✖</button>
|
||||
</div></td>`;
|
||||
}else{ rowHtml += `<td>-</td>`; }
|
||||
rowHtml += `
|
||||
<td align="left">${quantity}</td>
|
||||
<td align="left">${uom}</td>
|
||||
<td align="right">${itemRate}</td>
|
||||
<td align="right">${basicval}</td>
|
||||
<td align="right">${TotalTaxValue}</td>
|
||||
<td align="right">${TotalOrderValue}</td>
|
||||
<td>
|
||||
<a data-target='#EDITREVENUE' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITREVENUE">
|
||||
<i class="ri-pencil-fill"></i>
|
||||
</a>
|
||||
@ -4406,7 +4531,7 @@ if (!empty($getlogpodtl)) {
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
$('#RevenueAppend').append(rowHtml);
|
||||
@ -4448,6 +4573,7 @@ if (!empty($getlogpodtl)) {
|
||||
addHidden(theForm, "LineItemNo" + temp, '');
|
||||
addHidden(theForm, "per" + temp, PER);
|
||||
addHidden(theForm, "service_description" + temp, service_description);
|
||||
addHidden(theForm, "LineItemNoteForAuditor" + temp, '-');
|
||||
$('#txtRowCount').val(temp);
|
||||
populateValueMainFormForRevenue();
|
||||
clearRevenueModalFields();
|
||||
|
||||
@ -170,14 +170,14 @@ if (!empty($master)) {
|
||||
|
||||
|
||||
|
||||
<a onclick="confirmDeleteConfig(event)" href="<?php echo base_url() . 'activeInactiveConfigValue
|
||||
?key=' . $con->Key . '
|
||||
&value=0'; ?>">
|
||||
<i class="fas fa-trash" data-toggle="tooltip"
|
||||
title="Click here to Delete the Config Value"></i>
|
||||
<a onclick="confirmDeleteConfig(event)"
|
||||
data-key="<?php echo $con->Key; ?>"
|
||||
data-code="<?php echo $con->Config_ID; ?>"
|
||||
href="<?php echo base_url() . 'activeInactiveConfigValue?key=' . $con->Key . '&value=0'; ?>"
|
||||
data-toggle="tooltip"
|
||||
title="<?php echo $con->ConfigValue ?> - Click here to Delete Config Details">
|
||||
<i class="fas fa-trash" data-toggle="tooltip" title="Click here to Delete the Config Value"></i>
|
||||
</a>
|
||||
|
||||
|
||||
<?php } ?>
|
||||
|
||||
</td>
|
||||
@ -620,12 +620,52 @@ if (!empty($master)) {
|
||||
});
|
||||
|
||||
function confirmDeleteConfig(event) {
|
||||
let result = confirm("Do You want to delete this configuration ?");
|
||||
if (result) {
|
||||
return;
|
||||
} else {
|
||||
event.preventDefault();
|
||||
}
|
||||
event.preventDefault(); // Prevent default link action
|
||||
|
||||
let key_id = $(event.currentTarget).data('key');
|
||||
let code_value = $(event.currentTarget).data('code');
|
||||
let deleteUrl = event.currentTarget.href; // Store the href URL
|
||||
|
||||
if (code_value == 'C023') {
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: "<?php echo base_url('getPONOcreatedBasedOnConfig'); ?>",
|
||||
data: { key_id: key_id },
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
|
||||
let content = "Do you want to delete this configuration?";
|
||||
|
||||
if (data.length > 0) {
|
||||
content += "\n\nCreated PONO's are - ";
|
||||
|
||||
data.forEach(function(item) {
|
||||
content += "\n- " + item.PONO;
|
||||
});
|
||||
let result = confirm(content);
|
||||
if (result) {
|
||||
window.location.assign(deleteUrl); // Use assign() instead of href
|
||||
}
|
||||
}else{
|
||||
let result = confirm("Do you want to delete this configuration?");
|
||||
if (result) {
|
||||
window.location.assign(deleteUrl); // Use assign() instead of href
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.log("Error occurred: ", error);
|
||||
},
|
||||
complete: function() {
|
||||
console.log('AJAX call completed.');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
let result = confirm("Do you want to delete this configuration?");
|
||||
if (result) {
|
||||
window.location.href = event.currentTarget.href; // Proceed with deletion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function confirmReActivateConfig(event) {
|
||||
|
||||
@ -1,3 +1,99 @@
|
||||
<style>
|
||||
.edit-container {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.edit-input-field {
|
||||
padding: 2px;
|
||||
font-size: 14px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.edit-input-field:focus {
|
||||
outline: none;
|
||||
border-color: #007bff;
|
||||
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
|
||||
}
|
||||
|
||||
.save-btn, .cancel-btn {
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
color: #28a745;
|
||||
background-color: #e8f5e9;
|
||||
}
|
||||
|
||||
.save-btn:hover {
|
||||
background-color: #c3e6cb;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
color: #dc3545;
|
||||
background-color: #f8d7da;
|
||||
}
|
||||
|
||||
.cancel-btn:hover {
|
||||
background-color: #f5c6cb;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$(document).on('click', '.editable-field', function (e) {
|
||||
e.preventDefault();
|
||||
const $link = $(this);
|
||||
const value = $link.text().trim();
|
||||
|
||||
// Hide the <a> tag and show the edit container
|
||||
$link.hide();
|
||||
const $editContainer = $link.siblings('.edit-container');
|
||||
$editContainer.find('.edit-input-field').val(value);
|
||||
$editContainer.show();
|
||||
});
|
||||
|
||||
// Handle click on the tick (save) button
|
||||
$(document).on('click', '.save-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $input = $editContainer.find('.edit-input-field');
|
||||
|
||||
const value = $input.val().trim();
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
const LineItemNoteForAuditor = $link.data('notes');
|
||||
const id = $link.data('id');
|
||||
var theForm = $(".CreatePO");
|
||||
$("#LineItemNoteForAuditor" + id).val(value); // to update the hidden fields
|
||||
$link.text(value).show(); // to update table cell
|
||||
$editContainer.hide();
|
||||
});
|
||||
|
||||
// Handle click on the close (cancel) button
|
||||
$(document).on('click', '.cancel-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
|
||||
// Hide the edit container and show the <a> tag
|
||||
$editContainer.hide();
|
||||
$link.show();
|
||||
});});</script>
|
||||
<?php
|
||||
$AvlAmount = 0;
|
||||
$ReqType = '';
|
||||
@ -736,6 +832,7 @@ if (!empty($getlogpodtl)) {
|
||||
<th>Requisition No</th>
|
||||
<th>Material Code</th>
|
||||
<th>Description</th>
|
||||
<th>Line Item Specs</th>
|
||||
<th>Quantity</th>
|
||||
<th>UOM</th>
|
||||
<th>Rate<?php echo $INR ?></th>
|
||||
@ -763,6 +860,20 @@ if (!empty($getlogpodtl)) {
|
||||
<td><?php echo $record->ReqNo ?></td>
|
||||
<td><?php echo $record->MaterialCode ?></td>
|
||||
<td><?php echo $record->MaterialName ?></td>
|
||||
<td>
|
||||
<?php if ($PONOStatus === PO_DRAFT || $PONOStatus === PO_CREATED) { ?>
|
||||
<a href="#"
|
||||
class="editable-field"
|
||||
data-id ="<?php echo $index ?>" data-notes="<?php echo $record->LineitemAuditorNotes; ?>">
|
||||
<?php echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; ?>
|
||||
</a>
|
||||
<div class="edit-container" style="display:none;">
|
||||
<input type="text" class="edit-input-field" />
|
||||
<button class="save-btn">✔</button>
|
||||
<button class="cancel-btn">✖</button>
|
||||
</div>
|
||||
<?php }else{ echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; } ?>
|
||||
</td>
|
||||
<td><?php echo $record->Quantity ?></td>
|
||||
<td><?php echo $record->UOM ?></td>
|
||||
<td><?php echo $record->Rate ?></td>
|
||||
@ -879,6 +990,7 @@ if (!empty($getlogpodtl)) {
|
||||
<input type="hidden" name="<?php echo 'NetValue' . $index ?>" id="<?php echo 'NetValue' . $index ?>" value="<?php echo $record->NetValue; ?>" />
|
||||
|
||||
<input type="hidden" name="<?php echo 'AfterCustomEdCess1' . $index ?>" id="<?php echo 'AfterCustomEdCess1' . $index ?>" value="<?php echo $record->AfterCustomEdCess; ?>" />
|
||||
<input type="hidden" name="<?php echo 'LineItemNoteForAuditor' . $index ?>" id="<?php echo 'LineItemNoteForAuditor' . $index ?>" value="<?php echo $record->LineitemAuditorNotes; ?>" />
|
||||
|
||||
|
||||
<?php
|
||||
@ -2442,7 +2554,7 @@ if (!empty($getlogpodtl)) {
|
||||
|
||||
<div id="viewimportmodal" class="modal fade" tabindex="-1" role="dialog"
|
||||
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
||||
<div class="modal-dialog modal-full-width" style="width: 1200px; !important">
|
||||
<div class="modal-dialog modal-full-width" style="width: 1200px !important;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">View Import Purchase Order Item</h4>
|
||||
@ -4166,13 +4278,24 @@ if (!empty($getlogpodtl)) {
|
||||
|
||||
|
||||
//alert('in');
|
||||
PONOStatus = <?php echo $PONOStatus; ?>
|
||||
var rowHtml = `
|
||||
<tr id="${temp}">
|
||||
<td align="left">${temp}</td>
|
||||
<td align="left">${Reqnumber}</td>
|
||||
<td align="left">${materialCode}</td>
|
||||
<td align="left">${materialName}</td>
|
||||
<td align="left">${quantity}</td>
|
||||
<td align="left">${materialName}</td>`;
|
||||
if (PONOStatus === "PO_DRAFT" || PONOStatus === "PO_CREATED") {
|
||||
rowHtml += `<td><a href="#" class="editable-field"
|
||||
data-id="${temp}"
|
||||
data-notes="-">-</a>
|
||||
<div class="edit-container" style="display:none;">
|
||||
<input type="text" class="edit-input-field" />
|
||||
<button class="save-btn">✔</button>
|
||||
<button class="cancel-btn">✖</button>
|
||||
</div></td>`;
|
||||
}else{ rowHtml += `<td>-</td>`; }
|
||||
rowHtml += `<td align="left">${quantity}</td>
|
||||
<td align="left">${uom}</td>
|
||||
<td align="left">${itemRate}</td>
|
||||
<td align="left">${BasicAmt}</td>
|
||||
@ -4371,7 +4494,7 @@ if (!empty($getlogpodtl)) {
|
||||
|
||||
$('#ViewPer').val($("#Per" + userid).val());
|
||||
|
||||
$('#ViewTotalOrderValue').val(cellval[6].innerHTML);
|
||||
$('#ViewTotalOrderValue').val(cellval[7].innerHTML);
|
||||
$("#ViewMaterialCode").empty();
|
||||
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||||
$("#ViewMaterialCode").append($('<option></option>').val($('#materialCode' + userid).val()).html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val()));
|
||||
@ -4741,7 +4864,7 @@ if (!empty($getlogpodtl)) {
|
||||
|
||||
|
||||
|
||||
$('#EditTotalOrderValue').val(cellval[6].innerHTML);
|
||||
$('#EditTotalOrderValue').val(cellval[7].innerHTML);
|
||||
$("#EditMaterialCode").empty();
|
||||
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||||
$("#EditMaterialCode").append($('<option></option>').val($('#materialCode' + userid).val()).html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val()));
|
||||
@ -4851,10 +4974,10 @@ if (!empty($getlogpodtl)) {
|
||||
var cellval = tr.cells;
|
||||
|
||||
|
||||
cellval[4].innerHTML = editQuantity;
|
||||
cellval[5].innerHTML = editUOM;
|
||||
cellval[6].innerHTML = itemRate;
|
||||
cellval[7].innerHTML = BasicValue;
|
||||
cellval[5].innerHTML = editQuantity;
|
||||
cellval[6].innerHTML = editUOM;
|
||||
cellval[7].innerHTML = itemRate;
|
||||
cellval[8].innerHTML = BasicValue;
|
||||
|
||||
$('#materialCode' + userid).val(editMaterialCode);
|
||||
$('#materialName' + userid).val(edititemname);
|
||||
|
||||
@ -320,11 +320,11 @@ td {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" id="category_div" >
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="otherD" class="control-label">Category</label>
|
||||
<input type ="text" id="category" readonly class="form-control">
|
||||
<label for="AddCategory" class="control-label">Category</label>
|
||||
<input type ="text" id="AddCategory" readonly class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -403,6 +403,14 @@ td {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="EditCategory" class="control-label">Category</label>
|
||||
<input type ="text" id="EditCategory" readonly class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="EditotherDescription">
|
||||
<div class="form-group">
|
||||
@ -536,6 +544,7 @@ td {
|
||||
//alert(converttext)
|
||||
|
||||
$("#Description").val('');
|
||||
$("#AddCategory").val('');
|
||||
$("#UOM").val('');
|
||||
if (id != '-1') {
|
||||
|
||||
@ -552,7 +561,7 @@ td {
|
||||
$('#loader').hide();
|
||||
//alert(json.MatDetail);
|
||||
$("#Description").val(json.MatDetail[0]['MaterialName']);
|
||||
$("#category").val(json.MatDetail[0]['Category']);
|
||||
$("#AddCategory").val(json.MatDetail[0]['CategoryName']);
|
||||
$("#UOM").val(json.MatDetail[0]['UOM']);
|
||||
}
|
||||
|
||||
@ -794,9 +803,11 @@ td {
|
||||
var uom = $("#UOM").val();
|
||||
var quantity = $("#Quantity").val();
|
||||
var materialdescription = $('#otherD').val();
|
||||
var categoryName = $('#AddCategory').val();
|
||||
|
||||
$('#drpMaterial option[value=' + materialCode + ']').remove();
|
||||
$('#Description').val('');
|
||||
$('#AddCategory').val('');
|
||||
$('#UOM').val('');
|
||||
$('#Quantity').val('');
|
||||
$('#otherD').val('')
|
||||
|
||||
@ -75,12 +75,106 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.edit-container {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.edit-input-field {
|
||||
padding: 2px;
|
||||
font-size: 14px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.edit-input-field:focus {
|
||||
outline: none;
|
||||
border-color: #007bff;
|
||||
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
|
||||
}
|
||||
|
||||
.save-btn, .cancel-btn {
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
color: #28a745;
|
||||
background-color: #e8f5e9;
|
||||
}
|
||||
|
||||
.save-btn:hover {
|
||||
background-color: #c3e6cb;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
color: #dc3545;
|
||||
background-color: #f8d7da;
|
||||
}
|
||||
|
||||
.cancel-btn:hover {
|
||||
background-color: #f5c6cb;
|
||||
}
|
||||
</style>
|
||||
<script src="<?php echo base_url() ?>public/assets/tinymce/js/tinymce/tinymce.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>public/assets/js/CreatePOValidation.js" type="text/javascript"></script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(document).on('click', '.editable-field', function (e) {
|
||||
e.preventDefault();
|
||||
const $link = $(this);
|
||||
const value = $link.text().trim();
|
||||
|
||||
// Hide the <a> tag and show the edit container
|
||||
$link.hide();
|
||||
const $editContainer = $link.siblings('.edit-container');
|
||||
$editContainer.find('.edit-input-field').val(value);
|
||||
$editContainer.show();
|
||||
});
|
||||
|
||||
// Handle click on the tick (save) button
|
||||
$(document).on('click', '.save-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $input = $editContainer.find('.edit-input-field');
|
||||
|
||||
const value = $input.val().trim();
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
const LineItemNoteForAuditor = $link.data('notes');
|
||||
const id = $link.data('id');
|
||||
var theForm = $(".CreatePO");
|
||||
|
||||
addHidden(theForm, "LineItemNoteForAuditor" + id, value);
|
||||
$link.text(value).show();
|
||||
$editContainer.hide();
|
||||
});
|
||||
|
||||
// Handle click on the close (cancel) button
|
||||
$(document).on('click', '.cancel-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
|
||||
// Hide the edit container and show the <a> tag
|
||||
$editContainer.hide();
|
||||
$link.show();
|
||||
});
|
||||
|
||||
$('#drpSupplier').change(function() {
|
||||
var id = $('#drpSupplier').val();
|
||||
@ -217,7 +311,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
|
||||
$('#editTripsValue').hide();
|
||||
}
|
||||
$('#EditPer').val($('#Per' + userid).val());
|
||||
$('#EditTotalOrderValue').val(cellval[8].innerHTML);
|
||||
$('#EditTotalOrderValue').val(cellval[9].innerHTML);
|
||||
$("#EditMaterialCode").empty();
|
||||
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
|
||||
$("#EditMaterialCode").append($('<option></option>').val($('#materialCode' + userid).val()).html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val()));
|
||||
@ -728,6 +822,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
|
||||
<th>Requisition No</th>
|
||||
<th>Material Code</th>
|
||||
<th>Description</th>
|
||||
<th>Line Item Specs</th>
|
||||
<th>Quantity</th>
|
||||
<th>UOM</th>
|
||||
<th>Rate<?php echo $INR ?></th>
|
||||
@ -3425,6 +3520,15 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
|
||||
<td align="left">${Reqnumber}</td>
|
||||
<td align="left">${materialCode}</td>
|
||||
<td align="left">${materialName}</td>
|
||||
<td>
|
||||
<a href="#" class="editable-field"
|
||||
data-notes = "-" data-id ="${temp}">-</a>
|
||||
<div class="edit-container" style="display:none;">
|
||||
<input type="text" class="edit-input-field" />
|
||||
<button class="save-btn">✔</button>
|
||||
<button class="cancel-btn">✖</button>
|
||||
</div>
|
||||
</td>
|
||||
<td align="left">${quantity}</td>
|
||||
<td align="left">${uom}</td>
|
||||
<td align="left">${itemRate}</td>
|
||||
@ -3504,6 +3608,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
|
||||
addHidden(theForm, "Per" + temp, per.trim());
|
||||
|
||||
addHidden(theForm, "Addinstruction" + temp, splins.trim());
|
||||
addHidden(theForm, "LineItemNoteForAuditor" + temp, '-');
|
||||
|
||||
|
||||
// alert(JSON.stringify(totalexp));
|
||||
@ -3757,10 +3862,10 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
|
||||
|
||||
var tr = document.getElementById(userid);
|
||||
var cellval = tr.cells;
|
||||
cellval[4].innerHTML = editQuantity;
|
||||
cellval[5].innerHTML = editUOM;
|
||||
cellval[6].innerHTML = itemRate;
|
||||
cellval[7].innerHTML = BasicValue;
|
||||
cellval[5].innerHTML = editQuantity;
|
||||
cellval[6].innerHTML = editUOM;
|
||||
cellval[7].innerHTML = itemRate;
|
||||
cellval[8].innerHTML = BasicValue;
|
||||
|
||||
$('#materialCode' + userid).val(editMaterialCode);
|
||||
$('#materialName' + userid).val(edititemname);
|
||||
|
||||
@ -519,7 +519,7 @@
|
||||
<th rowspan="2" style="white-space: nowrap;">
|
||||
<center><?php _trans('HSN'); ?></center>
|
||||
</th>
|
||||
<!-- <th rowspan="2" style="white-space: nowrap;"><center><?php _trans('UOM'); ?></center></th> -->
|
||||
<th rowspan="2" style="white-space: nowrap;"><center><?php _trans('Line Item Specs'); ?></center></th>
|
||||
<th rowspan="2" style="width: 3.125em; text-align: center; vertical-align: middle;">
|
||||
<center><?php _trans('Qty'); ?></center>
|
||||
</th>
|
||||
@ -593,6 +593,7 @@
|
||||
} ?>
|
||||
</td>
|
||||
<td class="text-right no-border"><?php echo $item->HSNCODE ?? 'N/A'; ?></td>
|
||||
<td class="text-right no-border"><?php echo $item->LineitemAuditorNotes; ?></td>
|
||||
<td class="text-right no-border"><?php if ((int)$item->Quantity > 0) {
|
||||
echo number_alignment($item->Quantity);
|
||||
if ($item->Per) : ?>
|
||||
@ -657,13 +658,14 @@
|
||||
<td class="text-right no-border"></td>
|
||||
<td class="text-right no-border"></td>
|
||||
<td class="text-right no-border"></td>
|
||||
<td class="text-right no-border"></td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td style="text-align: right;" colspan="6"><strong> TOTAL</strong></td>
|
||||
<td style="text-align: right;" colspan="7"><strong> TOTAL</strong></td>
|
||||
<td class="text-right"><?php echo number_alignment(abs(array_sum($basic))); ?></td>
|
||||
<td> </td>
|
||||
<td class="text-right"><?php if ($cgst) {
|
||||
|
||||
@ -1,5 +1,98 @@
|
||||
<style>
|
||||
.edit-container {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.edit-input-field {
|
||||
padding: 2px;
|
||||
font-size: 14px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.edit-input-field:focus {
|
||||
outline: none;
|
||||
border-color: #007bff;
|
||||
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
|
||||
}
|
||||
|
||||
.save-btn, .cancel-btn {
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
color: #28a745;
|
||||
background-color: #e8f5e9;
|
||||
}
|
||||
|
||||
.save-btn:hover {
|
||||
background-color: #c3e6cb;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
color: #dc3545;
|
||||
background-color: #f8d7da;
|
||||
}
|
||||
|
||||
.cancel-btn:hover {
|
||||
background-color: #f5c6cb;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(document).on('click', '.editable-field', function (e) {
|
||||
e.preventDefault();
|
||||
const $link = $(this);
|
||||
const value = $link.text().trim();
|
||||
|
||||
// Hide the <a> tag and show the edit container
|
||||
$link.hide();
|
||||
const $editContainer = $link.siblings('.edit-container');
|
||||
$editContainer.find('.edit-input-field').val(value);
|
||||
$editContainer.show();
|
||||
});
|
||||
|
||||
// Handle click on the tick (save) button
|
||||
$(document).on('click', '.save-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $input = $editContainer.find('.edit-input-field');
|
||||
const value = $input.val().trim();
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
const LineItemNoteForAuditor = $link.data('notes');
|
||||
const id = $link.data('id');
|
||||
$("#LineItemNoteForAuditor" + id).val(value); // to update the hidden fields
|
||||
$link.text(value).show(); // to update table cell
|
||||
$editContainer.hide();
|
||||
});
|
||||
|
||||
// Handle click on the close (cancel) button
|
||||
$(document).on('click', '.cancel-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
|
||||
// Hide the edit container and show the <a> tag
|
||||
$editContainer.hide();
|
||||
$link.show();
|
||||
});
|
||||
|
||||
// When the second modal is about to be shown
|
||||
$('#freightcalmodel').on('show.bs.modal', function() {
|
||||
// Set a higher z-index for the second modal to appear on top
|
||||
@ -2079,6 +2172,7 @@ if (!empty($INRSYMBOL)) {
|
||||
<th>Requisition No</th>
|
||||
<th>Item Code</th>
|
||||
<th>Item Description</th>
|
||||
<th>Line Item Specs</th>
|
||||
<th>Quantity</th>
|
||||
<th>UOM</th>
|
||||
<th>Rate <?php echo "($INRSYM)" ?></th>
|
||||
@ -3195,7 +3289,7 @@ if (!empty($INRSYMBOL)) {
|
||||
} else {
|
||||
$('#EditPer').val($('#uom' + userid).val());
|
||||
}
|
||||
$('#txtEditBasicValue').val(cellval[7].innerHTML);
|
||||
$('#txtEditBasicValue').val(cellval[8].innerHTML);
|
||||
RequistQuantity = $('#quantity' + userid).val();
|
||||
$('#txtEditDiscount').val($('#DisVal' + userid).val());
|
||||
$('#txtEditAfterDiscount').val($('#AfterDisVal' + userid).val());
|
||||
@ -3368,6 +3462,15 @@ if (!empty($INRSYMBOL)) {
|
||||
<td align="left">${Reqnumber}</td>
|
||||
<td align="left">${materialCode}</td>
|
||||
<td align="left">${materialName}</td>
|
||||
<td>
|
||||
<a href="#" class="editable-field"
|
||||
data-notes = "-" data-id ="${temp}">-</a>
|
||||
<div class="edit-container" style="display:none;">
|
||||
<input type="text" class="edit-input-field" />
|
||||
<button class="save-btn">✔</button>
|
||||
<button class="cancel-btn">✖</button>
|
||||
</div>
|
||||
</td>
|
||||
<td align="right">${quantity}</td>
|
||||
<td align="left">${uom}</td>
|
||||
<td align="right">${itemRate}</td>
|
||||
@ -3427,6 +3530,7 @@ if (!empty($INRSYMBOL)) {
|
||||
addHidden(theForm, "TotalOrderValue" + temp, TotalOrderValue);
|
||||
addHidden(theForm, "Service_Description" + temp, Service_Description);
|
||||
addHidden(theForm, "LineItemNo" + temp, 0);
|
||||
addHidden(theForm, "LineItemNoteForAuditor" + temp, '-');
|
||||
$('#txtRowCount').val(temp);
|
||||
$('#REVENUE').modal('hide');
|
||||
clearRevenueModalFields();
|
||||
@ -3481,12 +3585,12 @@ if (!empty($INRSYMBOL)) {
|
||||
var cellval = tr.cells;
|
||||
cellval[2].innerHTML = editMaterialCode;
|
||||
cellval[3].innerHTML = editDescription;
|
||||
cellval[4].innerHTML = editQuantity;
|
||||
cellval[5].innerHTML = editUOM;
|
||||
cellval[6].innerHTML = itemRate;
|
||||
cellval[7].innerHTML = basicval;
|
||||
cellval[8].innerHTML = TotalTaxValue;
|
||||
cellval[9].innerHTML = TotalOrderValue;
|
||||
cellval[5].innerHTML = editQuantity;
|
||||
cellval[6].innerHTML = editUOM;
|
||||
cellval[7].innerHTML = itemRate;
|
||||
cellval[8].innerHTML = basicval;
|
||||
cellval[9].innerHTML = TotalTaxValue;
|
||||
cellval[10].innerHTML = TotalOrderValue;
|
||||
|
||||
|
||||
$('#materialCode' + userid).val(editMaterialCode);
|
||||
|
||||
@ -157,7 +157,7 @@
|
||||
<?php } else { ?>
|
||||
<td>0</td>
|
||||
<?php } ?>
|
||||
<td><?php echo $record->Category ?></td>
|
||||
<td><?php echo $record->CategoryName ?></td>
|
||||
<td><?php echo $record->HSNCODE ?></td>
|
||||
<td><?php if ($record->IsActive == 1) {
|
||||
echo "Active";
|
||||
|
||||
@ -143,6 +143,7 @@ if (!empty($Emp)) {
|
||||
<th class="th">SNo</th>
|
||||
<th class="th">Material Code</th>
|
||||
<th class="th" style="text-align:left !important;">Material Name</th>
|
||||
<th class="th">Material Category</th>
|
||||
<th class="th">Uom</th>
|
||||
<th class="th">Quantity</th>
|
||||
<th class="th">Action</th>
|
||||
@ -213,11 +214,11 @@ if (!empty($Emp)) {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" id="category_div" >
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="otherD" class="control-label">Category</label>
|
||||
<input type ="text" id="category" readonly class="form-control">
|
||||
<label for="AddCategory" class="control-label">Category</label>
|
||||
<input type ="text" id="AddCategory" readonly class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -296,6 +297,18 @@ if (!empty($Emp)) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="EditCategory" class="control-label">Material Category</label>
|
||||
<?php
|
||||
$data = array('value' => set_value('EditCategory'), 'id' => 'EditCategory', 'class' => 'form-control', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12" id="EditotherDescription">
|
||||
<div class="form-group">
|
||||
@ -448,6 +461,7 @@ if (!empty($Emp)) {
|
||||
// alert(checkanswer)
|
||||
|
||||
$("#Description").val('');
|
||||
$("#AddCategory").val('');
|
||||
$("#UOM").val('');
|
||||
if (id != '-1') {
|
||||
|
||||
@ -465,7 +479,7 @@ if (!empty($Emp)) {
|
||||
// $('#content').loader('hide');
|
||||
//alert(json.MatDetail);
|
||||
$("#Description").val(json.MatDetail[0]['MaterialName']);
|
||||
$("#category").val(json.MatDetail[0]['Category']);
|
||||
$("#AddCategory").val(json.MatDetail[0]['CategoryName']);
|
||||
$("#UOM").val(json.MatDetail[0]['UOM']);
|
||||
}
|
||||
|
||||
@ -644,6 +658,7 @@ if (!empty($Emp)) {
|
||||
var temp = index;
|
||||
var materialCode = $("#MaterialCode option:selected").val();
|
||||
var materialName = $("#Description").val();
|
||||
var categoryName = $('#AddCategory').val();
|
||||
var uom = $("#UOM").val();
|
||||
var quantity = $("#Quantity").val();
|
||||
var materialdescription = $('#otherD').val();
|
||||
@ -653,6 +668,7 @@ if (!empty($Emp)) {
|
||||
|
||||
$('#Description').val('');
|
||||
$('#UOM').val('');
|
||||
$('#AddCategory').val('');
|
||||
$('#Quantity').val('');
|
||||
$('#otherDescription').hide();
|
||||
$('#otherD').val('');
|
||||
@ -663,6 +679,7 @@ if (!empty($Emp)) {
|
||||
<td align="center">${temp}</td>
|
||||
<td align="center">${materialCode}</td>
|
||||
<td align="left">${materialName}</td>
|
||||
<td align="center">${categoryName}</td>
|
||||
<td align="center">${uom}</td>
|
||||
<td align="center">${quantity}</td>
|
||||
<td align="center">
|
||||
@ -730,8 +747,9 @@ if (!empty($Emp)) {
|
||||
var $cells = $tr.find('td');
|
||||
$('#EditMaterialCode').val($cells.eq(1).text());
|
||||
$('#EditDescription').val($cells.eq(2).text());
|
||||
$('#EditUOM').val($cells.eq(3).text());
|
||||
$('#EditQuantity').val($cells.eq(4).text());
|
||||
$('#EditCategory').val($cells.eq(3).text());
|
||||
$('#EditUOM').val($cells.eq(4).text());
|
||||
$('#EditQuantity').val($cells.eq(5).text());
|
||||
$('#Edituserid').val(userid);
|
||||
});
|
||||
});
|
||||
@ -749,6 +767,7 @@ if (!empty($Emp)) {
|
||||
var edituserid = $("#Edituserid").val();
|
||||
var editMaterialCode = $("#EditMaterialCode").val();
|
||||
var editDescription = $("#EditDescription").val();
|
||||
var editCategory = $("#EditCategory").val();
|
||||
var editUOM = $('#EditUOM').val();
|
||||
var editQuantity = $('#EditQuantity').val();
|
||||
|
||||
@ -756,11 +775,13 @@ if (!empty($Emp)) {
|
||||
var cells = tr.find('td');
|
||||
cells.eq(1).text(editMaterialCode);
|
||||
cells.eq(2).text(editDescription);
|
||||
cells.eq(3).text(editUOM);
|
||||
cells.eq(4).text(editQuantity);
|
||||
cells.eq(3).text(editCategory);
|
||||
cells.eq(4).text(editUOM);
|
||||
cells.eq(5).text(editQuantity);
|
||||
|
||||
$('#MaterialCode' + edituserid).val(editMaterialCode);
|
||||
$('#Description' + edituserid).val(editDescription);
|
||||
$('#Category' + edituserid).val(editCategory);
|
||||
$('#UOM' + edituserid).val(editUOM);
|
||||
$('#Quantity' + edituserid).val(editQuantity);
|
||||
|
||||
|
||||
@ -1,3 +1,101 @@
|
||||
<style>
|
||||
.edit-container {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.edit-input-field {
|
||||
padding: 2px;
|
||||
font-size: 14px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
width: 150px;
|
||||
}
|
||||
|
||||
.edit-input-field:focus {
|
||||
outline: none;
|
||||
border-color: #007bff;
|
||||
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
|
||||
}
|
||||
|
||||
.save-btn, .cancel-btn {
|
||||
border: none;
|
||||
background: none;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
color: #28a745;
|
||||
background-color: #e8f5e9;
|
||||
}
|
||||
|
||||
.save-btn:hover {
|
||||
background-color: #c3e6cb;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
color: #dc3545;
|
||||
background-color: #f8d7da;
|
||||
}
|
||||
|
||||
.cancel-btn:hover {
|
||||
background-color: #f5c6cb;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(document).on('click', '.editable-field', function (e) {
|
||||
e.preventDefault();
|
||||
const $link = $(this);
|
||||
const value = $link.text().trim();
|
||||
|
||||
// Hide the <a> tag and show the edit container
|
||||
$link.hide();
|
||||
const $editContainer = $link.siblings('.edit-container');
|
||||
$editContainer.find('.edit-input-field').val(value);
|
||||
$editContainer.show();
|
||||
});
|
||||
|
||||
// Handle click on the tick (save) button
|
||||
$(document).on('click', '.save-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $input = $editContainer.find('.edit-input-field');
|
||||
|
||||
const value = $input.val().trim();
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
const LineItemNoteForAuditor = $link.data('notes');
|
||||
const id = $link.data('id');
|
||||
var theForm = $(".ServicePO");
|
||||
|
||||
addHidden(theForm, "LineItemNoteForAuditor" + id, value);
|
||||
$link.text(value).show();
|
||||
$editContainer.hide();
|
||||
});
|
||||
|
||||
// Handle click on the close (cancel) button
|
||||
$(document).on('click', '.cancel-btn', function (e) {
|
||||
e.preventDefault();
|
||||
const $btn = $(this);
|
||||
const $editContainer = $btn.closest('.edit-container');
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
|
||||
// Hide the edit container and show the <a> tag
|
||||
$editContainer.hide();
|
||||
$link.show();
|
||||
});});
|
||||
</script>
|
||||
<?php
|
||||
$insuranceStatus = array(
|
||||
array("name" => "NO", "value" => "0"),
|
||||
@ -610,12 +708,12 @@ if (!empty($INRSYMBOL)) {
|
||||
|
||||
cellval[2].innerHTML = editMaterialCode;
|
||||
cellval[3].innerHTML = editDescription;
|
||||
cellval[4].innerHTML = editQuantity;
|
||||
cellval[5].innerHTML = editUOM;
|
||||
cellval[6].innerHTML = parseFloat(itemRate).toFixed(2);
|
||||
cellval[7].innerHTML = parseFloat(basicval).toFixed(2);
|
||||
cellval[8].innerHTML = parseFloat(TotalTaxValue).toFixed(2);
|
||||
cellval[9].innerHTML = parseFloat(TotalOrderValue).toFixed(2);
|
||||
cellval[5].innerHTML = editQuantity;
|
||||
cellval[6].innerHTML = editUOM;
|
||||
cellval[7].innerHTML = parseFloat(itemRate).toFixed(2);
|
||||
cellval[8].innerHTML = parseFloat(basicval).toFixed(2);
|
||||
cellval[9].innerHTML = parseFloat(TotalTaxValue).toFixed(2);
|
||||
cellval[10].innerHTML = parseFloat(TotalOrderValue).toFixed(2);
|
||||
|
||||
|
||||
$('#materialCode' + userid).val(editMaterialCode);
|
||||
@ -954,6 +1052,7 @@ if (!empty($INRSYMBOL)) {
|
||||
<th>Requisition No</th>
|
||||
<th>Item Code</th>
|
||||
<th>Item Name</th>
|
||||
<th>Line Item Specs</th>
|
||||
<th>Quantity</th>
|
||||
<th>UOM</th>
|
||||
<th>Rate <?php echo "($INRSYM)" ?></th>
|
||||
@ -1883,6 +1982,15 @@ if (!empty($INRSYMBOL)) {
|
||||
<td align="left">${Reqnumber}</td>
|
||||
<td align="left">${materialCode}</td>
|
||||
<td align="left">${materialName}</td>
|
||||
<td>
|
||||
<a href="#" class="editable-field"
|
||||
data-notes = "-" data-id ="${temp}">-</a>
|
||||
<div class="edit-container" style="display:none;">
|
||||
<input type="text" class="edit-input-field" />
|
||||
<button class="save-btn">✔</button>
|
||||
<button class="cancel-btn">✖</button>
|
||||
</div>
|
||||
</td>
|
||||
<td align="left">${quantity}</td>
|
||||
<td align="left">${uom}</td>
|
||||
<td align="left">${itemRate}</td>
|
||||
@ -1931,7 +2039,7 @@ if (!empty($INRSYMBOL)) {
|
||||
addHidden(theForm, "TotalOrderValue" + temp, TotalOrderValue);
|
||||
addHidden(theForm, "ItemDescription" + temp, ServiceDescription);
|
||||
addHidden(theForm, "OtherAmt" + temp, OtherAmt);
|
||||
|
||||
addHidden(theForm, "LineItemNoteForAuditor" + temp, '-');
|
||||
addHidden(theForm, "OtherServiceDescription" + temp, otherdescription);
|
||||
|
||||
|
||||
|
||||
@ -1935,6 +1935,7 @@
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
var orderColumnIndex = <?php echo (session()->get('roleText') == 'Auditor') ? 6 : 0; ?>;
|
||||
table = $('#view_inward_gate_register').DataTable({
|
||||
dom: 'Blfrtip',
|
||||
buttons: [
|
||||
@ -1952,7 +1953,8 @@
|
||||
[10, 20, 30, 50, "All"]
|
||||
],
|
||||
responsive: false,
|
||||
ordering:false,
|
||||
ordering:true,
|
||||
order: [[parseInt(orderColumnIndex), 'desc']],
|
||||
language: {
|
||||
paginate: {
|
||||
next: '<i class="fas fa-angle-right"></i>', // Next button icon
|
||||
|
||||
Loading…
Reference in New Issue
Block a user