Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
4343a76f4c
@ -830,19 +830,12 @@ function viewIGRDetails()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log_message('error', 'UpdateIGR igrarr: ' . json_encode($igrarr));
|
$this->saveIGRMasterHistory($igrarr,$IGRNo);
|
||||||
$getigrstatus = $this->inwardgateregister_model->getigrstatus($IGRNo);
|
$getigrstatus = $this->inwardgateregister_model->getigrstatus($IGRNo);
|
||||||
$getigrstatus = $getigrstatus->IGRStatus;
|
$getigrstatus = $getigrstatus->IGRStatus;
|
||||||
$updateigrmaster = $this->inwardgateregister_model->updateigr($igrarr, $IGRNo);
|
$updateigrmaster = $this->inwardgateregister_model->updateigr($igrarr, $IGRNo);
|
||||||
log_message('error', "Master updated successfully: " . $updateigrmaster);
|
log_message('error', "Master updated successfully: " . $updateigrmaster);
|
||||||
if(!empty($tableData )){
|
if(!empty($tableData )){
|
||||||
#Save IGR Master On History Table
|
|
||||||
foreach ($igrarr as $key => $value) {
|
|
||||||
if (!empty($value)) { // Ensure the value is not empty
|
|
||||||
$hist = array( 'key' => $key, 'value' => $value, 'igr_no' => $IGRNo,'igr_item_no' => NULL);
|
|
||||||
$this->saveIGRHistory($hist);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($tableData as $row) {
|
foreach ($tableData as $row) {
|
||||||
$quantityAsPerInvoice = $row['QuantityAsPerInvoice'];
|
$quantityAsPerInvoice = $row['QuantityAsPerInvoice'];
|
||||||
@ -867,6 +860,7 @@ function viewIGRDetails()
|
|||||||
'IGRItemNo' => $igrItemNo,
|
'IGRItemNo' => $igrItemNo,
|
||||||
'UpdateBY' => $updateby
|
'UpdateBY' => $updateby
|
||||||
);
|
);
|
||||||
|
$this->saveIGRLineitemHistory($igrline, $IGRNo,$igrItemNo);
|
||||||
// $WeightFile = $this->request->getfile('WeightFile');
|
// $WeightFile = $this->request->getfile('WeightFile');
|
||||||
// $requestWeightFileName = $WeightFile->getName();
|
// $requestWeightFileName = $WeightFile->getName();
|
||||||
|
|
||||||
@ -883,24 +877,6 @@ function viewIGRDetails()
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
$updateigrlineitem = $this->inwardgateregister_model->updateIGRLineItem($igrline, $igrItemNo);
|
$updateigrlineitem = $this->inwardgateregister_model->updateIGRLineItem($igrline, $igrItemNo);
|
||||||
if($updateigrlineitem){
|
|
||||||
foreach ($igrline as $key => $value) {
|
|
||||||
if (!empty($value)) { // Ensure the value is not empty
|
|
||||||
if($key == 'IGRNO'){ $key = 'LineItemIGRNO'; }
|
|
||||||
|
|
||||||
$hist = array( 'key' => $key, 'value' => $value, 'igr_no' => $IGRNo,'igr_item_no' => NULL);
|
|
||||||
$this->saveIGRHistory($hist);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($grossWeight){
|
|
||||||
$hist = array('key' => 'GrossWeight', 'value' => $grossWeight, 'igr_no' => $IGRNo, 'igr_item_no' => $igrItemNo);
|
|
||||||
$this->saveIGRHistory($hist);
|
|
||||||
}
|
|
||||||
if($grossWeight){
|
|
||||||
$hist = array('key' => 'GrossWeight', 'value' => $grossWeight, 'igr_no' => $IGRNo, 'igr_item_no' => $igrItemNo);
|
|
||||||
$this->saveIGRHistory($hist);
|
|
||||||
}
|
|
||||||
log_message('error', "lineitem updated successfully: " . $updateigrlineitem);
|
log_message('error', "lineitem updated successfully: " . $updateigrlineitem);
|
||||||
log_message('error', 'UpdateIGR updateigrlineitem: ' . json_encode($igrline));
|
log_message('error', 'UpdateIGR updateigrlineitem: ' . json_encode($igrline));
|
||||||
}
|
}
|
||||||
@ -913,28 +889,13 @@ function viewIGRDetails()
|
|||||||
|
|
||||||
$result_for_email = $this->inwardgateregister_model->getDetailsforEmail($this->session->get('userId'));
|
$result_for_email = $this->inwardgateregister_model->getDetailsforEmail($this->session->get('userId'));
|
||||||
$result_for_history = $this->inwardgateregister_model->getHistoryDetailsforEmail($IGRNo);
|
$result_for_history = $this->inwardgateregister_model->getHistoryDetailsforEmail($IGRNo);
|
||||||
print_r($result_for_history);die;
|
|
||||||
|
|
||||||
$notification = new Notification();
|
$notification = new Notification();
|
||||||
|
|
||||||
$history_content = NULL;
|
$history_content = "IGR History <br><br><br>";
|
||||||
$history = $result_for_history;
|
$history = $result_for_history['history'];
|
||||||
$field_labels = [
|
$field_labels = [
|
||||||
"IGRItemNo" => "IGRItemNo",
|
|
||||||
"IGRNO" => "IGRNO",
|
|
||||||
"MaterialCode" => "MaterialCode",
|
|
||||||
"QuantityAsPerInvoice" => "Received Qty",
|
|
||||||
"Remarks" => "Remarks",
|
|
||||||
"IGRItemStatus" => "IGRItemStatus",
|
|
||||||
"CancelNote" => "CancelNote",
|
|
||||||
"BankStatus" => "BankStatus",
|
|
||||||
"GrossWeight" => "Gross Weight",
|
|
||||||
"GrossWeightDate" => "Gross Weight Date",
|
|
||||||
"TareWeight" => "Tare Weight",
|
|
||||||
"TareWeightDate" => "Tare Weight Date",
|
|
||||||
"NetWeight" => "Net Weight",
|
|
||||||
"WeightFile" => "WeightFile",
|
|
||||||
"IGRID" => "IGRID",
|
|
||||||
"IGRNO" => "IGRNO",
|
"IGRNO" => "IGRNO",
|
||||||
"PONO" => "PONO",
|
"PONO" => "PONO",
|
||||||
"DeliveryChellanOrInvoiceNo" => "Invoice NO",
|
"DeliveryChellanOrInvoiceNo" => "Invoice NO",
|
||||||
@ -951,15 +912,28 @@ function viewIGRDetails()
|
|||||||
"DriverName" => "Driver Name",
|
"DriverName" => "Driver Name",
|
||||||
"DriverMobileNumber" => "Driver Mobile Number",
|
"DriverMobileNumber" => "Driver Mobile Number",
|
||||||
"MasterFile" => "Master File",
|
"MasterFile" => "Master File",
|
||||||
|
"IGRItemNo" => "IGR Item No",
|
||||||
|
"MaterialCode" => "Material Code",
|
||||||
|
"QuantityAsPerInvoice" => "Received Qty",
|
||||||
|
"Remarks" => "Remarks",
|
||||||
|
"IGRItemStatus" => "IGR Item Status",
|
||||||
|
"CancelNote" => "Cancel Note",
|
||||||
|
"BankStatus" => "Bank Status",
|
||||||
|
"GrossWeight" => "Gross Weight",
|
||||||
|
"GrossWeightDate" => "Gross Weight Date",
|
||||||
|
"TareWeight" => "Tare Weight",
|
||||||
|
"TareWeightDate" => "Tare Weight Date",
|
||||||
|
"NetWeight" => "Net Weight",
|
||||||
|
"WeightFile" => "Weight File"
|
||||||
];
|
];
|
||||||
$history_content = "<br>The following values have been edited:";
|
// $history_content = "<br>The following values have been edited:";
|
||||||
|
|
||||||
for ($j = 0; $j < count($history); $j++) {
|
for ($j = 0; $j < count($history); $j++) {
|
||||||
|
|
||||||
$field_name = $history[$j]->field;
|
$field_name = $history[$j]->field;
|
||||||
$readable_field = isset($field_labels[$field_name]) ? $field_labels[$field_name] : $field_name;
|
$readable_field = isset($field_labels[$field_name]) ? $field_labels[$field_name] : $field_name;
|
||||||
|
$history_content .= "<br>" . $readable_field . " `" . $history[$j]->old_data . "` was updated into `" . $history[$j]->new_data . "` by ".$history[$j]->history_by." on ".$history[$j]->indian_date." at ".$history[$j]->indian_time;
|
||||||
$history_content .= "<br>" . $readable_field . ": `" . $history[$j]->old_data . "` was updated to `" . $history[$j]->new_data . "` .";
|
// $history_content .= "<br>" . $readable_field . ": `" . $history[$j]->old_data . "` was updated to `" . $history[$j]->new_data . "` .";
|
||||||
}
|
}
|
||||||
$email = "";
|
$email = "";
|
||||||
for ($i = 0; $i < count($result_for_email['emails']); $i++) {
|
for ($i = 0; $i < count($result_for_email['emails']); $i++) {
|
||||||
@ -970,7 +944,8 @@ function viewIGRDetails()
|
|||||||
$email_response = $notification->sendEmail([
|
$email_response = $notification->sendEmail([
|
||||||
'recipient_email' => $email,
|
'recipient_email' => $email,
|
||||||
'subject' => $result_for_email['company'].' - IGR Notification',
|
'subject' => $result_for_email['company'].' - IGR Notification',
|
||||||
'description' => 'IGR Number : '.$IGRNo.' is Edited By '.($result_for_email['full_name'] ?? $this->session->get('name'))." On ".date('d-m-Y H:i A', strtotime(get_current_date_time() . ' +30 seconds')). $history_content,
|
// 'description' => 'IGR Number : '.$IGRNo.' is Edited By '.($result_for_email['full_name'] ?? $this->session->get('name'))." On ".date('d-m-Y H:i A', strtotime(get_current_date_time() . ' +30 seconds')). $history_content,
|
||||||
|
'description' => 'PONO '.$PONo.$result_for_history['first_line'].$history_content,
|
||||||
'company' => $result_for_email['company'],
|
'company' => $result_for_email['company'],
|
||||||
'from_mail'=> $result_for_email['from_mail']
|
'from_mail'=> $result_for_email['from_mail']
|
||||||
]);
|
]);
|
||||||
@ -1029,13 +1004,8 @@ function updateIGRWeight(){
|
|||||||
|
|
||||||
$IGRItemNo = $this->request->getPost('IGRlineitem');
|
$IGRItemNo = $this->request->getPost('IGRlineitem');
|
||||||
$igr_lineitem = array('GrossWeight' => $GrossWeight,'GrossWeightDate' => $GrossWtDt,'TareWeightDate' => $TareWtDt,'TareWeight' => $TareWeight,'NetWeight' => $NetWeight,'UpdateBY' => $updateby);
|
$igr_lineitem = array('GrossWeight' => $GrossWeight,'GrossWeightDate' => $GrossWtDt,'TareWeightDate' => $TareWtDt,'TareWeight' => $TareWeight,'NetWeight' => $NetWeight,'UpdateBY' => $updateby);
|
||||||
|
$this->saveIGRLineitemHistory($igr_lineitem, $IGRNO,$IGRItemNo);
|
||||||
|
|
||||||
foreach ($igr_lineitem as $key => $value) {
|
|
||||||
if (!empty($value)) { // Ensure the value is not empty
|
|
||||||
$hist = array( 'key' => $key, 'value' => $value, 'igr_no' => $IGRNO,'igr_item_no' => $IGRItemNo);
|
|
||||||
$this->saveIGRHistory($hist);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$requestWeightFileName =null ;
|
$requestWeightFileName =null ;
|
||||||
if($WeightFile){
|
if($WeightFile){
|
||||||
if (!empty($requestWeightFileName)) {
|
if (!empty($requestWeightFileName)) {
|
||||||
@ -1422,134 +1392,70 @@ function updateIGRWeight(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function saveIGRMasterHistory($request, $IGRNo) {
|
||||||
|
$dbIGRMaster = $this->inwardgateregister_model->get_igr_master_for_history($IGRNo);
|
||||||
|
$history_entries = [];
|
||||||
|
|
||||||
// public function saveIGRHistory($hist) {
|
foreach ($request as $key => $value) {
|
||||||
|
foreach ($dbIGRMaster as $key1 => $value1) {
|
||||||
// // Extract fields from the input array
|
if ($value1 != $value && $key1 == $key) {
|
||||||
// $field = $hist['key'];
|
// Store each changed field in an array
|
||||||
|
$history_entries[] = [
|
||||||
// $igr_no = $hist['igr_no'];
|
'field' => $key1,
|
||||||
// $igr_item_no = $hist['igr_item_no'];
|
'new_data' => $value,
|
||||||
// $new_data = $hist['value']; // Incoming new value
|
'old_data' => $value1,
|
||||||
// $old_data = NULL; // Default old value is null
|
'history_dated' => get_current_date_time(),
|
||||||
|
'by' => $this->session->get('userId'),
|
||||||
// log_message('error', "Save History function entered for IGR No: $igr_no, Item No: $igr_item_no, Field: $field.");
|
'IGR_No' => $IGRNo,
|
||||||
|
'IGRItem_No' => NULL,
|
||||||
// $latestHist = $this->inwardgateregister_model->get_igr_history($field, $igr_no, $igr_item_no);
|
'is_edit' => 1,
|
||||||
// $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;
|
|
||||||
// }
|
|
||||||
// }}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// // 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
|
// Insert all history entries
|
||||||
if (!empty($latestHist)) {
|
foreach ($history_entries as $entry) {
|
||||||
// If history exists, use the latest new_data as old_data
|
$history_id = $this->inwardgateregister_model->igr_history($entry);
|
||||||
$old_data = $latestHist->new_data;
|
if ($history_id) {
|
||||||
} else {
|
log_message('error', "History updated successfully for IGR No: $IGRNo, Field: {$entry['field']}. History ID: $history_id");
|
||||||
// If no history exists, use the current data from the master/child table as old_data
|
} else {
|
||||||
$old_data = $current_data;
|
log_message('error', "Failed to update history for IGR No: $IGRNo, Field: {$entry['field']}");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Check if the new_data is different from the old_data
|
public function saveIGRLineitemHistory($request, $IGRNo, $IGRLineItem) {
|
||||||
if ($new_data == $old_data) {
|
$dbIGRChild = $this->inwardgateregister_model->get_igr_child_for_history($IGRNo, $IGRLineItem);
|
||||||
log_message('error', "No update needed for IGR No: $igr_no, Item No: $igr_item_no, Field: $field. Data already exists: $new_data");
|
$history_entries = [];
|
||||||
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.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
foreach ($request as $key => $value) {
|
||||||
|
foreach ($dbIGRChild as $key1 => $value1) {
|
||||||
|
if ($value1 != $value && $key1 == $key) {
|
||||||
|
// Store each changed field in an array
|
||||||
|
$history_entries[] = [
|
||||||
|
'field' => $key1,
|
||||||
|
'new_data' => $value,
|
||||||
|
'old_data' => $value1,
|
||||||
|
'history_dated' => get_current_date_time(),
|
||||||
|
'by' => $this->session->get('userId'),
|
||||||
|
'IGR_No' => $IGRNo,
|
||||||
|
'IGRItem_No' => $IGRLineItem,
|
||||||
|
'is_edit' => 1,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Insert all history entries
|
||||||
|
foreach ($history_entries as $entry) {
|
||||||
|
$history_id = $this->inwardgateregister_model->igr_history($entry);
|
||||||
|
if ($history_id) {
|
||||||
|
log_message('error', "History updated successfully for IGR No: $IGRNo, Item No: $IGRLineItem, Field: {$entry['field']}. History ID: $history_id");
|
||||||
|
} else {
|
||||||
|
log_message('error', "Failed to update history for IGR No: $IGRNo, Item No: $IGRLineItem, Field: {$entry['field']}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -370,8 +370,10 @@ class Rawmaterialdetails extends BaseController
|
|||||||
$materialCode = $data['materialCode'] ?? '';
|
$materialCode = $data['materialCode'] ?? '';
|
||||||
$materialName = str_replace(' ', '', $data['materialName']);
|
$materialName = str_replace(' ', '', $data['materialName']);
|
||||||
$materialCategory = $data['materialCategory'] ?? '';
|
$materialCategory = $data['materialCategory'] ?? '';
|
||||||
|
$materialType = $data['materialType'] ?? '';
|
||||||
|
|
||||||
$query = $this->rawmaterialdetails_model->checkMaterialExists($materialCode , $materialName , $materialCategory);
|
|
||||||
|
$query = $this->rawmaterialdetails_model->checkMaterialExists($materialCode , $materialName , $materialCategory,$materialType);
|
||||||
|
|
||||||
return $this->response->setJSON($query);
|
return $this->response->setJSON($query);
|
||||||
|
|
||||||
|
|||||||
@ -229,15 +229,36 @@ class Config_model extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getPONOcreatedBasedOnConfig($key_id){
|
public function getPONOcreatedBasedOnConfig($key_id){
|
||||||
$builder = $this->db->table('t_purchaseorder_lineitem PL')
|
// $builder = $this->db->table('t_purchaseorder_lineitem PL')
|
||||||
->select('PL.PONO, MM.MaterialName, CD.ConfigValue as CategoryName')
|
// ->select('PL.PONO, MM.MaterialName, CD.ConfigValue as CategoryName')
|
||||||
->join('t_materialmaster MM', 'MM.MaterialCode = PL.MaterialCode', 'left')
|
// ->join('t_materialmaster MM', 'MM.MaterialCode = PL.MaterialCode', 'left')
|
||||||
->join('t_configdetails CD', 'CD.Key = MM.Category', 'left')
|
// ->join('t_configdetails CD', 'CD.Key = MM.Category', 'left')
|
||||||
->where('CD.Key', $key_id);
|
// ->where('CD.Key', $key_id);
|
||||||
|
|
||||||
$query = $builder->get();
|
// $query = $builder->get();
|
||||||
$result = $query->getResultArray();
|
// $result = $query->getResultArray();
|
||||||
return $result;
|
// return $result;
|
||||||
|
$builder = $this->db->table('t_purchaseorder_lineitem pl')
|
||||||
|
->select(['po.PONO',"DATE_FORMAT(po.PODate, '%d-%m-%Y') as PODate",'mm.MaterialName','CD.Key','CD.ConfigValue as CategoryName','s.StatusName','s.statusCode'])
|
||||||
|
->join('t_purchaseorder_master po', 'po.PONO = pl.PONO')
|
||||||
|
->join('t_materialmaster mm', 'mm.MaterialCode = pl.MaterialCode')
|
||||||
|
->join('t_configdetails CD', 'CD.Key = mm.Category')
|
||||||
|
->join('t_status s', 's.statusCode = po.Status', 'left')
|
||||||
|
->where('CD.Key', $key_id)
|
||||||
|
->whereIn('po.Status', [PO_DRAFT,PO_CREATED,REQ_PO_CREATED,PO_RELEASED,REQITEM_Emergency_PO_CREATED,IGR_DRAFT,IGR_DRAFT,OPEN_ORDER_PO])
|
||||||
|
->groupBy('po.PONO')
|
||||||
|
->orderBy('po.CreatedDate', 'DESC');
|
||||||
|
$query = $builder->get();
|
||||||
|
$result = $query->getResultArray();
|
||||||
|
return $result;
|
||||||
|
// 'OPEN_ORDER_PO','ST073'
|
||||||
|
// 'IGR_DRAFT','ST074'
|
||||||
|
// 'IGR_CREATED','ST027'
|
||||||
|
// 'REQITEM_Emergency_PO_CREATED','ST024'
|
||||||
|
// 'PO_DRAFT','ST014'
|
||||||
|
// 'PO_CREATED','ST015'
|
||||||
|
// 'REQ_PO_CREATED','ST005'
|
||||||
|
// 'PO_RELEASED','ST026'
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -249,20 +249,12 @@ class Inwardgateregister_model extends Model
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_igr_master_for_history($field, $igr_no) {
|
function get_igr_master_for_history($igr_no) {
|
||||||
$builder = $this->db->table('t_igr_master Master')
|
return $this->db->table('t_igr_master Master')->where('Master.IGRNO', $igr_no)->get()->getRow();
|
||||||
->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) {
|
function get_igr_child_for_history($igr_no, $igr_item_no) {
|
||||||
$builder = $this->db->table('t_igr_details Child')
|
$builder = $this->db->table('t_igr_details Child'); // Select only the required field
|
||||||
->select("Child.$field"); // Select only the required field
|
|
||||||
if ($igr_no) {
|
if ($igr_no) {
|
||||||
$builder->where('Child.IGRNO', $igr_no);
|
$builder->where('Child.IGRNO', $igr_no);
|
||||||
}
|
}
|
||||||
@ -271,7 +263,7 @@ class Inwardgateregister_model extends Model
|
|||||||
}
|
}
|
||||||
$query = $builder->get();
|
$query = $builder->get();
|
||||||
$result = $query->getRow();
|
$result = $query->getRow();
|
||||||
return $result ? $result->$field : null; // Return the field value directly
|
return $result; // Return the field value directly
|
||||||
}
|
}
|
||||||
|
|
||||||
function addigrM($igrM)
|
function addigrM($igrM)
|
||||||
@ -1095,7 +1087,7 @@ class Inwardgateregister_model extends Model
|
|||||||
{
|
{
|
||||||
$builder = $this->db->table('t_igr_history');
|
$builder = $this->db->table('t_igr_history');
|
||||||
|
|
||||||
$builder->select('t_igr_history.*, CONCAT_WS(" ", t_employee_details.FirstName, t_employee_details.LastName) AS FullName');
|
$builder->select('t_igr_history.*, DATE_FORMAT(t_igr_history.history_dated, "%d-%m-%Y") AS indian_date, DATE_FORMAT(t_igr_history.history_dated, "%h:%i:%s %p") AS indian_time, CONCAT_WS(" ", t_employee_details.FirstName, t_employee_details.LastName) AS FullName');
|
||||||
$builder->join('tbl_users', 'tbl_users.userId = t_igr_history.by', 'left');
|
$builder->join('tbl_users', 'tbl_users.userId = t_igr_history.by', 'left');
|
||||||
$builder->join('t_employee_details', 'tbl_users.EmpID = t_employee_details.EmpID', 'left');
|
$builder->join('t_employee_details', 'tbl_users.EmpID = t_employee_details.EmpID', 'left');
|
||||||
$builder->where('IGR_No', $igr);
|
$builder->where('IGR_No', $igr);
|
||||||
@ -1219,7 +1211,15 @@ class Inwardgateregister_model extends Model
|
|||||||
$to = date('Y-m-d H:i:s', strtotime($date . ' +30 seconds'));
|
$to = date('Y-m-d H:i:s', strtotime($date . ' +30 seconds'));
|
||||||
$from = date('Y-m-d H:i:s', strtotime($date . ' -30 seconds'));
|
$from = date('Y-m-d H:i:s', strtotime($date . ' -30 seconds'));
|
||||||
|
|
||||||
|
$query3 = $this->db->query("Select t_igr_history.history_dated,DATE_FORMAT(t_igr_history.history_dated, '%d-%m-%Y') AS indian_date,DATE_FORMAT(t_igr_history.history_dated, '%h:%i:%s %p') AS indian_time ,
|
||||||
|
t_igr_history.by,CONCAT_WS(' ', t_employee_details.FirstName, t_employee_details.LastName) AS history_by
|
||||||
|
from t_igr_history
|
||||||
|
LEFT JOIN tbl_users ON tbl_users.userId = t_igr_history.by
|
||||||
|
LEFT JOIN t_employee_details ON tbl_users.EmpID = t_employee_details.EmpID
|
||||||
|
where is_add = 1 and IGR_No = '".$igr."'");
|
||||||
|
$first_line = $query3->getRow();
|
||||||
|
|
||||||
|
// 392 po
|
||||||
|
|
||||||
$builder = $this->db->table('t_igr_history')
|
$builder = $this->db->table('t_igr_history')
|
||||||
->select('
|
->select('
|
||||||
@ -1232,7 +1232,9 @@ $builder = $this->db->table('t_igr_history')
|
|||||||
t_igr_history.by,
|
t_igr_history.by,
|
||||||
t_igr_history.IGR_No,
|
t_igr_history.IGR_No,
|
||||||
t_igr_history.IGRItem_No,
|
t_igr_history.IGRItem_No,
|
||||||
|
DATE_FORMAT(t_igr_history.history_dated, "%d-%m-%Y") AS indian_date,
|
||||||
|
DATE_FORMAT(t_igr_history.history_dated, "%h:%i:%s %p") AS indian_time,
|
||||||
|
CONCAT_WS(" ", t_employee_details.FirstName, t_employee_details.LastName) AS history_by,
|
||||||
CASE
|
CASE
|
||||||
WHEN t_igr_history.field = "TransporterId"
|
WHEN t_igr_history.field = "TransporterId"
|
||||||
THEN (SELECT name FROM t_transporter WHERE id = t_igr_history.new_data LIMIT 1)
|
THEN (SELECT name FROM t_transporter WHERE id = t_igr_history.new_data LIMIT 1)
|
||||||
@ -1257,13 +1259,20 @@ $builder = $this->db->table('t_igr_history')
|
|||||||
')
|
')
|
||||||
// ->join('t_igr_details IGRD', 'IGRD.IGRItemNo = t_igr_history.IGRItem_No','left')
|
// ->join('t_igr_details IGRD', 'IGRD.IGRItemNo = t_igr_history.IGRItem_No','left')
|
||||||
// ->join('t_materialmaster MM','MM.MaterialCode = IGRD.MaterialCode','left')
|
// ->join('t_materialmaster MM','MM.MaterialCode = IGRD.MaterialCode','left')
|
||||||
|
->join('tbl_users', 'tbl_users.userId = t_igr_history.by','left')
|
||||||
|
->join('t_employee_details','tbl_users.EmpID = t_employee_details.EmpID','left')
|
||||||
->where('t_igr_history.IGR_No', $igr)
|
->where('t_igr_history.IGR_No', $igr)
|
||||||
->where('t_igr_history.is_edit', 1)
|
->where('t_igr_history.is_edit', 1)
|
||||||
->where('t_igr_history.history_dated BETWEEN "'.$from.'" AND "'.$to.'"');
|
->where('t_igr_history.history_dated BETWEEN "'.$from.'" AND "'.$to.'"');
|
||||||
|
|
||||||
$query = $builder->get();
|
$query = $builder->get();
|
||||||
|
$result = $query->getResult();
|
||||||
|
|
||||||
// echo $this->db->getLastQuery()->getQuery(); die;
|
// echo $this->db->getLastQuery()->getQuery(); die;
|
||||||
return $query->getResult();
|
return [
|
||||||
|
'history' => $result,
|
||||||
|
'first_line' => $first_line ? " was added by ". $first_line->history_by ." on ". $first_line->indian_date ." at ". $first_line->indian_time : null,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDetailsforEmail($userId,$roleId = 2)
|
public function getDetailsforEmail($userId,$roleId = 2)
|
||||||
|
|||||||
@ -1740,7 +1740,7 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
|
|||||||
$subQuery = 'SELECT distinct LineItem.LineItemNo,LineItem.Per,LineItem.ServiceMaterialDescription,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,LineItem.ServiceFrequency,
|
$subQuery = 'SELECT distinct LineItem.LineItemNo,LineItem.Per,LineItem.ServiceMaterialDescription,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,LineItem.ServiceFrequency,
|
||||||
Mat.UOM,Quantity,ReceivedQuantity,Rate,Req.Status,Tax.*,
|
Mat.UOM,Quantity,ReceivedQuantity,Rate,Req.Status,Tax.*,
|
||||||
ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((POMast.ExchangeRate*BasicPriceInMTon*Quantity),2) as BasicINRValue,Tax.TotalValue as ImportTotalValue,Tax.FreightType,Tax.NoOfTrip,Tax.FreightValue,Tax.AfterFreightValue,POMast.CurrencyType,
|
ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((POMast.ExchangeRate*BasicPriceInMTon*Quantity),2) as BasicINRValue,Tax.TotalValue as ImportTotalValue,Tax.FreightType,Tax.NoOfTrip,Tax.FreightValue,Tax.AfterFreightValue,POMast.CurrencyType,
|
||||||
|
LineItem.LineitemAuditorNotes,
|
||||||
Req.CostCenterCode,Dept.DepartmentName FROM t_purchaseorder_lineitem LineItem
|
Req.CostCenterCode,Dept.DepartmentName FROM t_purchaseorder_lineitem LineItem
|
||||||
join t_purchaseorder_master POMast on POMast.PONO = LineItem.PONO
|
join t_purchaseorder_master POMast on POMast.PONO = LineItem.PONO
|
||||||
join t_materialmaster Mat on Mat.MaterialCode = LineItem.MaterialCode
|
join t_materialmaster Mat on Mat.MaterialCode = LineItem.MaterialCode
|
||||||
@ -1799,7 +1799,7 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
|
|||||||
Mat.UOM,Quantity,ReceivedQuantity,Rate,Req.Status,ROUND((ServiceTax.After_CGST + ServiceTax.After_SGST + ServiceTax.After_IGST),2) as ServiceTaxamount
|
Mat.UOM,Quantity,ReceivedQuantity,Rate,Req.Status,ROUND((ServiceTax.After_CGST + ServiceTax.After_SGST + ServiceTax.After_IGST),2) as ServiceTaxamount
|
||||||
,ServiceTax.TotalValue,ServiceTax.CGST,ServiceTax.After_CGST,ServiceTax.SGST,ServiceTax.After_SGST,ServiceTax.IGST,ServiceTax.After_IGST,ServiceTax.otherallowance,ServiceTax.discount,ServiceTax.discountval,ServiceTax.Afterdiscountval,
|
,ServiceTax.TotalValue,ServiceTax.CGST,ServiceTax.After_CGST,ServiceTax.SGST,ServiceTax.After_SGST,ServiceTax.IGST,ServiceTax.After_IGST,ServiceTax.otherallowance,ServiceTax.discount,ServiceTax.discountval,ServiceTax.Afterdiscountval,
|
||||||
POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,ROUND((POMast.TotalOrderValue),2) as BasicINRValue,POMast.CurrencyType,FreightType as Ftype,NoOfTrip as NoTrip,FreightValue as Fvalue,AfterFreightValue as Afvalue,
|
POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,ROUND((POMast.TotalOrderValue),2) as BasicINRValue,POMast.CurrencyType,FreightType as Ftype,NoOfTrip as NoTrip,FreightValue as Fvalue,AfterFreightValue as Afvalue,
|
||||||
|
LineItem.LineitemAuditorNotes,
|
||||||
Req.CostCenterCode,Dept.DepartmentName FROM t_purchaseorder_lineitem LineItem
|
Req.CostCenterCode,Dept.DepartmentName FROM t_purchaseorder_lineitem LineItem
|
||||||
join t_purchaseorder_master POMast on POMast.PONO = LineItem.PONO
|
join t_purchaseorder_master POMast on POMast.PONO = LineItem.PONO
|
||||||
join t_materialmaster Mat on Mat.MaterialCode = LineItem.MaterialCode
|
join t_materialmaster Mat on Mat.MaterialCode = LineItem.MaterialCode
|
||||||
|
|||||||
@ -331,7 +331,7 @@ class Rawmaterialdetails_model extends Model
|
|||||||
|
|
||||||
// on 28/jan/2025. both add and edit. category condition added.
|
// on 28/jan/2025. both add and edit. category condition added.
|
||||||
// on 13/Feb/2025. Change based On Config Child Values.
|
// on 13/Feb/2025. Change based On Config Child Values.
|
||||||
function checkMaterialExists($materialCode , $materialName ,$materialCategory)
|
function checkMaterialExists($materialCode , $materialName ,$materialCategory,$materialType)
|
||||||
{
|
{
|
||||||
|
|
||||||
$builder = $this->db->table('t_materialmaster MM')
|
$builder = $this->db->table('t_materialmaster MM')
|
||||||
@ -341,6 +341,7 @@ class Rawmaterialdetails_model extends Model
|
|||||||
$builder = $builder->where('MM.MaterialCode !=' , $materialCode);
|
$builder = $builder->where('MM.MaterialCode !=' , $materialCode);
|
||||||
}
|
}
|
||||||
$builder->where('MM.Category' , $materialCategory);
|
$builder->where('MM.Category' , $materialCategory);
|
||||||
|
$builder->where('MM.MaterialType' , $materialType);
|
||||||
$builder->where('REPLACE(MM.MaterialName, " ", "")' , $materialName);
|
$builder->where('REPLACE(MM.MaterialName, " ", "")' , $materialName);
|
||||||
|
|
||||||
$query = $builder->get();
|
$query = $builder->get();
|
||||||
|
|||||||
@ -305,6 +305,7 @@
|
|||||||
var materialName = $('#MaterialName').val().trim();
|
var materialName = $('#MaterialName').val().trim();
|
||||||
var materialCode = '';
|
var materialCode = '';
|
||||||
var materialCategory = $('#MatCate').val();
|
var materialCategory = $('#MatCate').val();
|
||||||
|
var materialType = $('MaterialType').val();
|
||||||
if(materialName == ''){
|
if(materialName == ''){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -314,7 +315,7 @@
|
|||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: {
|
data: {
|
||||||
materialCode,
|
materialCode,materialType,
|
||||||
materialName,materialCategory
|
materialName,materialCategory
|
||||||
},
|
},
|
||||||
type: "POST",
|
type: "POST",
|
||||||
|
|||||||
@ -78,9 +78,8 @@
|
|||||||
const LineItemNoteForAuditor = $link.data('notes');
|
const LineItemNoteForAuditor = $link.data('notes');
|
||||||
const id = $link.data('id');
|
const id = $link.data('id');
|
||||||
var theForm = $(".CreatePO");
|
var theForm = $(".CreatePO");
|
||||||
|
|
||||||
addHidden(theForm, "LineItemNoteForAuditor" + id, value);
|
|
||||||
$link.text(value).show();
|
$link.text(value).show();
|
||||||
|
$("#LineItemNoteForAuditor" + id).val(value);
|
||||||
$editContainer.hide();
|
$editContainer.hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -192,12 +192,12 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a onclick="confirmDeleteConfig(event)"
|
<!-- <a onclick="confirmDeleteConfig(event)"
|
||||||
href="<?php echo base_url() . 'configurationctrl/deleteConfig?ConfigID=' . $record->Config_ID; ?>"
|
href="<?php echo base_url() . 'configurationctrl/deleteConfig?ConfigID=' . $record->Config_ID; ?>"
|
||||||
data-toggle="tooltip"
|
data-toggle="tooltip"
|
||||||
title="<?php echo $record->Config_ID ?> - Click here to Delete Config Details">
|
title="<?php echo $record->Config_ID ?> - Click here to Delete Config Details">
|
||||||
<i class="fas fa-trash" data-toggle="tooltip" title="Click here to Delete the Config Value"></i>
|
<i class="fas fa-trash" data-toggle="tooltip" title="Click here to Delete the Config Value"></i>
|
||||||
</a>
|
</a> -->
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@ -404,6 +404,7 @@ if ($total <= $reorder) {
|
|||||||
var materialName = $('#MaterialName').val();
|
var materialName = $('#MaterialName').val();
|
||||||
var materialCode = $('#RMcode').val();
|
var materialCode = $('#RMcode').val();
|
||||||
var materialCategory = $('#MaterialCategory').val();
|
var materialCategory = $('#MaterialCategory').val();
|
||||||
|
var materialType = $('#MaterialType').val();
|
||||||
|
|
||||||
if(materialName == ''){
|
if(materialName == ''){
|
||||||
return;
|
return;
|
||||||
@ -416,7 +417,8 @@ if ($total <= $reorder) {
|
|||||||
data: {
|
data: {
|
||||||
materialCode,
|
materialCode,
|
||||||
materialName,
|
materialName,
|
||||||
materialCategory
|
materialCategory,
|
||||||
|
materialType
|
||||||
},
|
},
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<?php echo base_url(); ?>materialExist",
|
url: "<?php echo base_url(); ?>materialExist",
|
||||||
|
|||||||
@ -158,8 +158,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
|
|||||||
const LineItemNoteForAuditor = $link.data('notes');
|
const LineItemNoteForAuditor = $link.data('notes');
|
||||||
const id = $link.data('id');
|
const id = $link.data('id');
|
||||||
var theForm = $(".CreatePO");
|
var theForm = $(".CreatePO");
|
||||||
|
$("#LineItemNoteForAuditor" + id).val(value);
|
||||||
addHidden(theForm, "LineItemNoteForAuditor" + id, value);
|
|
||||||
$link.text(value).show();
|
$link.text(value).show();
|
||||||
$editContainer.hide();
|
$editContainer.hide();
|
||||||
});
|
});
|
||||||
@ -4205,6 +4204,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
|
|||||||
formData.append('txtRowCount', txtRowCount);
|
formData.append('txtRowCount', txtRowCount);
|
||||||
formData.append('txtDeletedRow', txtDeletedRow);
|
formData.append('txtDeletedRow', txtDeletedRow);
|
||||||
formData.append('textStatus', stat);
|
formData.append('textStatus', stat);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
// data:$('.ImportPO').serialize()+"&txtRowCount="+txtRowCount+"&txtDeletedRow="+txtDeletedRow+"&textStatus="+stat,
|
// data:$('.ImportPO').serialize()+"&txtRowCount="+txtRowCount+"&txtDeletedRow="+txtDeletedRow+"&textStatus="+stat,
|
||||||
//data:$('.CreatealterPO').serialize()+"&TextRowCount="+TextRowCount+"&TextDeQletedRowCount="+TextDeletedRowCount+"&TextTotalOrderValueSummaryService="+TextTotalOrderValueSummaryService+"&TextSpcialInstruction="+TextSpcialInstruction+"&TextExchangerate"+ExcLandingCharge="+hangerate+"Status="+TextStatus,
|
//data:$('.CreatealterPO').serialize()+"&TextRowCount="+TextRowCount+"&TextDeQletedRowCount="+TextDeletedRowCount+"&TextTotalOrderValueSummaryService="+TextTotalOrderValueSummaryService+"&TextSpcialInstruction="+TextSpcialInstruction+"&TextExchangerate"+ExcLandingCharge="+hangerate+"Status="+TextStatus,
|
||||||
|
|||||||
@ -78,8 +78,7 @@
|
|||||||
const LineItemNoteForAuditor = $link.data('notes');
|
const LineItemNoteForAuditor = $link.data('notes');
|
||||||
const id = $link.data('id');
|
const id = $link.data('id');
|
||||||
var theForm = $(".ServicePO");
|
var theForm = $(".ServicePO");
|
||||||
|
$("#LineItemNoteForAuditor" + id).val(value);
|
||||||
addHidden(theForm, "LineItemNoteForAuditor" + id, value);
|
|
||||||
$link.text(value).show();
|
$link.text(value).show();
|
||||||
$editContainer.hide();
|
$editContainer.hide();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1183,7 +1183,7 @@
|
|||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
|
||||||
alert(data);
|
alert(data);
|
||||||
location.reload();
|
// location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -1251,7 +1251,7 @@
|
|||||||
success: function(data) {
|
success: function(data) {
|
||||||
|
|
||||||
alert(data);
|
alert(data);
|
||||||
location.reload();
|
// location.reload();
|
||||||
},
|
},
|
||||||
error: function(xhr, status, error) { // Error callback
|
error: function(xhr, status, error) { // Error callback
|
||||||
console.error('AJAX Error:', status, error);
|
console.error('AJAX Error:', status, error);
|
||||||
@ -1346,15 +1346,22 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
function constructSentence(record) {
|
function constructSentence(record) {
|
||||||
let str = record.field;
|
|
||||||
let fieldName = str.replace(/([a-z])([A-Z])/g, '$1 $2');
|
// let str = record.field;
|
||||||
let sentence = record.FullName + ' on ' + formatDateTime(record.history_dated, 2) + " " + fieldName + " ";
|
// let fieldName = str.replace(/([a-z])([A-Z])/g, '$1 $2');
|
||||||
|
let sentence = " ";
|
||||||
if (parseInt(record.is_add) === 1) {
|
if (parseInt(record.is_add) === 1) {
|
||||||
sentence += record.new_data + " was added.";
|
sentence += record.IGR_No + " was added by "+record.FullName+ " on "+record.indian_date+" at "+record.indian_time;
|
||||||
} else if (parseInt(record.is_edit) === 1) {
|
} else if (parseInt(record.is_edit) === 1) {
|
||||||
sentence += record.old_data + " was updated into " + record.new_data + ".";
|
if(record.field != "UpdateBY"){
|
||||||
|
let str = record.field;
|
||||||
|
let fieldName = str.replace(/([a-z])([A-Z])/g, '$1 $2');
|
||||||
|
sentence += fieldName+" "+record.old_data + " was updated into " + record.new_data + " by "+record.FullName+ " on "+record.indian_date+" at "+record.indian_time;
|
||||||
|
}
|
||||||
} else if (parseInt(record.is_delete) === 1) {
|
} else if (parseInt(record.is_delete) === 1) {
|
||||||
sentence += record.new_data + " was deleted.";
|
let str = record.field;
|
||||||
|
let fieldName = str.replace(/([a-z])([A-Z])/g, '$1 $2');
|
||||||
|
sentence += fieldName+" "+record.new_data + " was deleted by "+record.FullName+ " on "+record.indian_date+" at "+record.indian_time;
|
||||||
}
|
}
|
||||||
return sentence;
|
return sentence;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user