issues fixs : ps
This commit is contained in:
parent
47d49099ab
commit
8f2de433df
@ -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);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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,LineItem.LineitemDescription
|
||||
$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,
|
||||
|
||||
@ -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,11 +68,11 @@
|
||||
</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"
|
||||
style="font-size: 16px; color:rgb(15, 155, 218);" data-toggle="modal" data-target="#addMaterialCaterogyModal"
|
||||
title="Add Material Caterogy">
|
||||
title="Add Material Category">
|
||||
</i> -->
|
||||
<select class="form-control select2" required id="MatCate" name="MatCate">
|
||||
<option value="" required>Select Material Category </option>
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
|
||||
|
||||
@ -72,26 +72,15 @@
|
||||
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 invoiceId = $link.data('lineitemdesc');
|
||||
$('#loader').show();
|
||||
// Save logic (API call)
|
||||
$.ajax({
|
||||
url: '<?php echo base_url() ?>updateInvRecQty',
|
||||
method: 'POST',
|
||||
data: { invoice_id: invoiceId, received_qty: value },
|
||||
success: function (response) {
|
||||
// Show success and update the <a> tag value
|
||||
$link.text(value).show();
|
||||
$editContainer.hide();
|
||||
$('#loader').hide();
|
||||
},
|
||||
error: function (xhr) {
|
||||
$('#loader').hide();
|
||||
alert('Failed to save the value.');
|
||||
}
|
||||
});
|
||||
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
|
||||
@ -2346,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)" ?>
|
||||
@ -2362,7 +2352,6 @@ if (!empty($getlogpodtl)) {
|
||||
<!-- <th>Actual Quantity</th>
|
||||
<th>Received Quantity</th>
|
||||
<th>Pending Quantity</th> -->
|
||||
<th style="text-align:center !important">Lineitem Description</th>
|
||||
<th style="text-align:center !important">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -2379,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>
|
||||
@ -2519,19 +2522,10 @@ if (!empty($getlogpodtl)) {
|
||||
name="<?php echo 'TotalOrderValue' . $index ?>"
|
||||
id="<?php echo 'TotalOrderValue' . $index ?>"
|
||||
value="<?php echo $record->TotalValue; ?>" />
|
||||
|
||||
<td>
|
||||
<a href="#"
|
||||
class="editable-field"
|
||||
data-lineitemdescription="<?php echo $record->LineitemDescription; ?>">
|
||||
<?php echo !empty($record->LineitemDescription) ? $record->LineitemDescription : "-"; ?>
|
||||
</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>
|
||||
<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; ?>"
|
||||
@ -4482,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();
|
||||
|
||||
@ -4508,23 +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>
|
||||
<a href="#" class="editable-field"
|
||||
data-lineitemdescription ="-">-</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>
|
||||
<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>
|
||||
@ -4532,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);
|
||||
@ -4574,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();
|
||||
|
||||
@ -624,6 +624,7 @@ if (!empty($master)) {
|
||||
|
||||
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({
|
||||
@ -641,13 +642,16 @@ if (!empty($master)) {
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
let result = confirm(content);
|
||||
|
||||
if (result) {
|
||||
window.location.href = event.currentTarget.href; // Proceed with deletion
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.log("Error occurred: ", error);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -74,24 +74,11 @@
|
||||
const $input = $editContainer.find('.edit-input-field');
|
||||
const value = $input.val().trim();
|
||||
const $link = $editContainer.siblings('.editable-field');
|
||||
const invoiceId = $link.data('lineitemdesc');
|
||||
$('#loader').show();
|
||||
// Save logic (API call)
|
||||
$.ajax({
|
||||
url: '<?php echo base_url() ?>updateInvRecQty',
|
||||
method: 'POST',
|
||||
data: { invoice_id: invoiceId, received_qty: value },
|
||||
success: function (response) {
|
||||
// Show success and update the <a> tag value
|
||||
$link.text(value).show();
|
||||
$editContainer.hide();
|
||||
$('#loader').hide();
|
||||
},
|
||||
error: function (xhr) {
|
||||
$('#loader').hide();
|
||||
alert('Failed to save the value.');
|
||||
}
|
||||
});
|
||||
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
|
||||
@ -2185,13 +2172,13 @@ 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>
|
||||
<th>Basic Amount <?php echo "($INRSYM)" ?></th>
|
||||
<th>Tax Amount <?php echo "($INRSYM)" ?></th>
|
||||
<th>Total Order Amount <?php echo "($INRSYM)" ?></th>
|
||||
<th>Lineitem Description </th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -3302,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());
|
||||
@ -3475,21 +3462,21 @@ 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>
|
||||
<td align="right">${basicval}</td>
|
||||
<td align="right">${TotalTaxValue}</td>
|
||||
<td align="right">${TotalOrderValue}</td>
|
||||
<td>
|
||||
<a href="#" class="editable-field"
|
||||
data-lineitemdescription ="-">-</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>
|
||||
<a data-target='#EDITREVENUE' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITREVENUE">
|
||||
<i class="ri-pencil-fill" data-toggle="tooltip"></i>
|
||||
@ -3543,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();
|
||||
@ -3597,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);
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user