bug fixes
This commit is contained in:
parent
173f8df643
commit
41f6ac2d5e
@ -402,9 +402,9 @@ class Inwardgateregister extends BaseController
|
||||
$IsThisOpenOrderPO = $this->request->getPost('hiddenIsOpenOrder');
|
||||
$DeliveryChellanOrInvoiceNo = $this->request->getPost('InvoiceNo');
|
||||
$DeliveryChellan = (string)$this->request->getPost('InvoiceDate');
|
||||
$DeliveryChellanDate = get_date_time_dynamical_format('d-m-Y','',$DeliveryChellan);
|
||||
$DeliveryChellanDate = !$DeliveryChellan || $DeliveryChellan === null ? NULL : get_date_time_format($DeliveryChellan);
|
||||
$Mat_Rcvd_Dt = (string)$this->request->getPost('MaterialRcvdDate');
|
||||
$MaterialRcvdDt = get_date_time_dynamical_format('d-m-Y','',$Mat_Rcvd_Dt);
|
||||
$MaterialRcvdDt = !$Mat_Rcvd_Dt || $Mat_Rcvd_Dt === null ? NULL : get_date_time_format($Mat_Rcvd_Dt);
|
||||
$VehicleNo = $this->request->getPost('VehicleNo');
|
||||
$TransporterId = $this->request->getPost('TransporterId');
|
||||
$DriverName = $this->request->getPost('DriverName');
|
||||
@ -834,6 +834,7 @@ function viewIGRDetails()
|
||||
$getigrstatus = $this->inwardgateregister_model->getigrstatus($IGRNo);
|
||||
$getigrstatus = $getigrstatus->IGRStatus;
|
||||
$updateigrmaster = $this->inwardgateregister_model->updateigr($igrarr, $IGRNo);
|
||||
|
||||
log_message('error', "Master updated successfully: " . $updateigrmaster);
|
||||
if(!empty($tableData )){
|
||||
|
||||
@ -893,76 +894,89 @@ function viewIGRDetails()
|
||||
|
||||
$notification = new Notification();
|
||||
|
||||
$history_content = "IGR History <br><br><br>";
|
||||
$history_content = "<br>IGR History<br><br> <ul>";
|
||||
$history = $result_for_history['history'];
|
||||
$field_labels = [
|
||||
"IGRNO" => "IGRNO",
|
||||
"PONO" => "PONO",
|
||||
"DeliveryChellanOrInvoiceNo" => "Invoice NO",
|
||||
"DeliveryChellanDate" => "Invoice Date",
|
||||
"MaterialRcvdDate" => "Material Received Date",
|
||||
"VehicleNo" => "Vehicle Number",
|
||||
"VehicleType" => "Vehicle Type",
|
||||
"TransporterId" => "Transporter Id",
|
||||
"CourierNo" => "Courier No",
|
||||
"Remark" => "Master Remark",
|
||||
"IGRStatus" => "IGR Status",
|
||||
"file" => "File",
|
||||
"Paymentstatus" => "Payment Status",
|
||||
"DriverName" => "Driver Name",
|
||||
"DriverMobileNumber" => "Driver Mobile Number",
|
||||
"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:";
|
||||
if(!empty($history)){
|
||||
|
||||
for ($j = 0; $j < count($history); $j++) {
|
||||
|
||||
$field_name = $history[$j]->field;
|
||||
$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 . "` .";
|
||||
}
|
||||
$email = "";
|
||||
for ($i = 0; $i < count($result_for_email['emails']); $i++) {
|
||||
$email .= $result_for_email['emails'][$i]->email . " , ";
|
||||
}
|
||||
$email = rtrim($email, " ,");
|
||||
|
||||
$email_response = $notification->sendEmail([
|
||||
'recipient_email' => $email,
|
||||
'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' => 'PONO '.$PONo.$result_for_history['first_line'].$history_content,
|
||||
'company' => $result_for_email['company'],
|
||||
'from_mail'=> $result_for_email['from_mail']
|
||||
]);
|
||||
$field_labels = [
|
||||
"IGRNO" => "IGRNO",
|
||||
"PONO" => "PONO",
|
||||
"DeliveryChellanOrInvoiceNo" => "Invoice NO",
|
||||
// "DeliveryChellanDate" => "Invoice Date",
|
||||
// "MaterialRcvdDate" => "Material Received Date",
|
||||
"VehicleNo" => "Vehicle Number",
|
||||
"VehicleType" => "Vehicle Type",
|
||||
"TransporterId" => "Transporter Id",
|
||||
"CourierNo" => "Courier No",
|
||||
"Remark" => "Master Remark",
|
||||
"IGRStatus" => "IGR Status",
|
||||
"file" => "File",
|
||||
"Paymentstatus" => "Payment Status",
|
||||
"DriverName" => "Driver Name",
|
||||
"DriverMobileNumber" => "Driver Mobile Number",
|
||||
"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:"; //old Format
|
||||
|
||||
for ($j = 0; $j < count($history); $j++) {
|
||||
$field_name = $history[$j]->field;
|
||||
$readable_field = isset($field_labels[$field_name]) ? $field_labels[$field_name] : $field_name;
|
||||
$history_content .= "<li>" .
|
||||
(($history[$j]->IGRItem_No)
|
||||
? $history[$j]->MaterialName . " (" . $history[$j]->MaterialCode . ") - "
|
||||
: "") .
|
||||
$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 .
|
||||
"</li><br>";
|
||||
// $history_content .= "<br>" . $readable_field . ": `" . $history[$j]->old_data . "` was updated to `" . $history[$j]->new_data . "` .";
|
||||
}
|
||||
$history_content .= "</ul>";
|
||||
$email = "";
|
||||
for ($i = 0; $i < count($result_for_email['emails']); $i++) {
|
||||
$email .= $result_for_email['emails'][$i]->email . " , ";
|
||||
}
|
||||
$email = rtrim($email, " ,");
|
||||
$email_response = $notification->sendEmail([
|
||||
'recipient_email' => "sanjeev.p@venbainfotech.com",
|
||||
'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' => $result_for_history['first_line']."<br>" .$history_content,
|
||||
'company' => $result_for_email['company'],
|
||||
'from_mail'=> $result_for_email['from_mail']
|
||||
]);
|
||||
|
||||
log_message('error', 'email reponse : ' . json_encode($email_response));
|
||||
// Determine the email response
|
||||
$mail_log = isset($email_response['success']) ? 'Email sent successfully' : 'Failed to send email';
|
||||
$receiving_status = isset($email_response['success']) ? 1 : 0;
|
||||
log_message('error', 'email reponse : ' . json_encode($email_response));
|
||||
// Determine the email response
|
||||
$mail_log = isset($email_response['success']) ? 'Email sent successfully' : 'Failed to send email';
|
||||
$receiving_status = isset($email_response['success']) ? 1 : 0;
|
||||
|
||||
// Log the result
|
||||
if ($receiving_status) {
|
||||
$this->logger->info("Email IDs = " . $email . " " . $mail_log);
|
||||
} else {
|
||||
$this->logger->error("Email IDs = " . $email . " " . $mail_log);
|
||||
}
|
||||
// Log the result
|
||||
if ($receiving_status) {
|
||||
$this->logger->info("Email IDs = " . $email . " " . $mail_log);
|
||||
} else {
|
||||
$this->logger->error("Email IDs = " . $email . " " . $mail_log);
|
||||
}
|
||||
|
||||
// echo "***".$history_content;die;
|
||||
// echo "***".$history_content;die;
|
||||
}else{
|
||||
$this->logger->info("History content Not Founded....");
|
||||
}
|
||||
}
|
||||
|
||||
if ($updateigrmaster > 0) {
|
||||
|
||||
@ -370,10 +370,8 @@ class Rawmaterialdetails extends BaseController
|
||||
$materialCode = $data['materialCode'] ?? '';
|
||||
$materialName = str_replace(' ', '', $data['materialName']);
|
||||
$materialCategory = $data['materialCategory'] ?? '';
|
||||
$materialType = $data['materialType'] ?? '';
|
||||
|
||||
|
||||
$query = $this->rawmaterialdetails_model->checkMaterialExists($materialCode , $materialName , $materialCategory,$materialType);
|
||||
$query = $this->rawmaterialdetails_model->checkMaterialExists($materialCode , $materialName , $materialCategory);
|
||||
|
||||
return $this->response->setJSON($query);
|
||||
|
||||
|
||||
@ -238,19 +238,36 @@ class Config_model extends Model
|
||||
// $query = $builder->get();
|
||||
// $result = $query->getResultArray();
|
||||
// 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;
|
||||
|
||||
|
||||
// return $this->db->table('t_purchaseorder_lineitem as pl')
|
||||
// ->select('DISTINCT po.PONO, DATE_FORMAT(po.PODate, "%d-%m-%Y") as PODate, mm.MaterialName, CD.Key, CD.ConfigValue as CategoryName, s.StatusName, s.statusCode, po.POType, po.CapitalRange')
|
||||
// ->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') // Left join
|
||||
// ->where('CD.Key', $key_id)
|
||||
// ->whereIn('po.Status', ['ST014', 'ST015', 'ST005', 'ST026', 'ST024', 'ST074', 'ST073'])
|
||||
// ->orderBy('po.CreatedDate', 'DESC')
|
||||
// ->get()
|
||||
// ->getResultArray();
|
||||
|
||||
$subQuery = "SELECT DISTINCT po.PONO, DATE_FORMAT(po.PODate, '%d-%m-%Y') as PODate,
|
||||
mm.MaterialName, CD.Key, CD.ConfigValue as CategoryName,
|
||||
s.StatusName, s.statusCode, po.POType, po.CapitalRange
|
||||
FROM t_purchaseorder_lineitem pl
|
||||
JOIN t_purchaseorder_master po ON po.PONO = pl.PONO
|
||||
JOIN t_materialmaster mm ON mm.MaterialCode = pl.MaterialCode
|
||||
JOIN t_configdetails CD ON CD.Key = mm.Category
|
||||
LEFT JOIN t_status s ON s.statusCode = po.Status
|
||||
WHERE CD.Key = ?
|
||||
AND po.Status IN (?, ?, ?, ?, ?, ?, ?)
|
||||
ORDER BY po.CreatedDate DESC";
|
||||
|
||||
$query = $this->db->query($subQuery, [$key_id, 'ST014', 'ST015', 'ST005', 'ST026', 'ST024', 'ST074', 'ST073']);
|
||||
$result = $query->getResultArray();
|
||||
return $result;
|
||||
|
||||
// 'OPEN_ORDER_PO','ST073'
|
||||
// 'IGR_DRAFT','ST074'
|
||||
// 'IGR_CREATED','ST027'
|
||||
|
||||
@ -221,6 +221,13 @@ class Inwardgateregister_model extends Model
|
||||
}
|
||||
|
||||
public function igr_history($hsty_arr) {
|
||||
$keysToRemove = ["UpdateBY", "MaterialRcvdDate", "DeliveryChellanDate"];
|
||||
foreach ($keysToRemove as $key) {
|
||||
if (isset($hsty_arr[$key])) {
|
||||
unset($hsty_arr[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
$builder = $this->db->table('t_igr_history');
|
||||
$builder->insert($hsty_arr);
|
||||
|
||||
@ -1087,17 +1094,19 @@ class Inwardgateregister_model extends Model
|
||||
{
|
||||
$builder = $this->db->table('t_igr_history');
|
||||
|
||||
$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->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,t_materialmaster.MaterialName,t_materialmaster.MaterialName,t_materialmaster.MaterialCode');
|
||||
$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->where('IGR_No', $igr);
|
||||
$builder->join('t_igr_details', 'CONVERT(t_igr_history.IGRItem_No USING utf8) = CONVERT(t_igr_details.IGRItemNo USING utf8)', 'left');
|
||||
$builder->join('t_materialmaster', 'CONVERT(t_materialmaster.MaterialCode USING utf8) = CONVERT(t_igr_details.MaterialCode USING utf8)', 'left');
|
||||
$builder->where('CONVERT(IGR_No USING utf8)', $igr);
|
||||
$builder->orderBy('t_igr_history.history_dated', 'asc');
|
||||
// $builder->where('IGR_No', $igr);
|
||||
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
return $result;
|
||||
|
||||
// Pass the result to the view or return it as JSON
|
||||
// return $this->response->setJSON($result);
|
||||
}
|
||||
public function isFileExistsInIGRmaster($filename)
|
||||
{
|
||||
@ -1211,7 +1220,7 @@ class Inwardgateregister_model extends Model
|
||||
$to = 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 ,
|
||||
$query3 = $this->db->query("Select t_igr_history.IGR_No,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
|
||||
@ -1255,13 +1264,15 @@ $builder = $this->db->table('t_igr_history')
|
||||
THEN (SELECT StatusName FROM t_status WHERE StatusCode = t_igr_history.old_data LIMIT 1)
|
||||
ELSE t_igr_history.old_data
|
||||
END AS old_data,
|
||||
t_igr_history.old_data as original_old_data
|
||||
t_igr_history.old_data as original_old_data,t_materialmaster.MaterialName,t_materialmaster.MaterialCode
|
||||
')
|
||||
// ->join('t_igr_details IGRD', 'IGRD.IGRItemNo = t_igr_history.IGRItem_No','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)
|
||||
->join('t_igr_details', 'CONVERT(t_igr_history.IGRItem_No USING utf8) = CONVERT(t_igr_details.IGRItemNo USING utf8)', 'left')
|
||||
->join('t_materialmaster', 'CONVERT(t_materialmaster.MaterialCode USING utf8) = CONVERT(t_igr_details.MaterialCode USING utf8)', 'left')
|
||||
->where('CONVERT(t_igr_history.IGR_No USING utf8)', $igr)
|
||||
->where('t_igr_history.is_edit', 1)
|
||||
->where('t_igr_history.history_dated BETWEEN "'.$from.'" AND "'.$to.'"');
|
||||
|
||||
@ -1271,7 +1282,7 @@ $builder = $this->db->table('t_igr_history')
|
||||
// echo $this->db->getLastQuery()->getQuery(); die;
|
||||
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,
|
||||
'first_line' => $first_line ? $first_line->IGR_No ." was Created by ". $first_line->history_by ." on ". $first_line->indian_date ." at ". $first_line->indian_time : null,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -330,8 +330,7 @@ class Rawmaterialdetails_model extends Model
|
||||
|
||||
|
||||
// on 28/jan/2025. both add and edit. category condition added.
|
||||
// on 13/Feb/2025. Change based On Config Child Values.
|
||||
function checkMaterialExists($materialCode , $materialName ,$materialCategory,$materialType)
|
||||
function checkMaterialExists($materialCode,$materialName ,$materialCategory)
|
||||
{
|
||||
|
||||
$builder = $this->db->table('t_materialmaster MM')
|
||||
@ -341,7 +340,6 @@ class Rawmaterialdetails_model extends Model
|
||||
$builder = $builder->where('MM.MaterialCode !=' , $materialCode);
|
||||
}
|
||||
$builder->where('MM.Category' , $materialCategory);
|
||||
$builder->where('MM.MaterialType' , $materialType);
|
||||
$builder->where('REPLACE(MM.MaterialName, " ", "")' , $materialName);
|
||||
|
||||
$query = $builder->get();
|
||||
|
||||
@ -314,10 +314,7 @@
|
||||
|
||||
$('#loader').show();
|
||||
$.ajax({
|
||||
data: {
|
||||
materialCode,materialType,
|
||||
materialName,materialCategory
|
||||
},
|
||||
data: {materialCode,materialName,materialCategory},
|
||||
type: "POST",
|
||||
url: "<?php echo base_url(); ?>materialExist",
|
||||
success: function(data) {
|
||||
|
||||
@ -779,31 +779,6 @@ if (!empty($EmpDetails)) {
|
||||
</div>
|
||||
<div class="col-md-11">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label>ESI Number</label>
|
||||
<input type="text" id="esino" name="esino"
|
||||
maxlength="10" onchange="validateESI();"
|
||||
class="form-control" title=" 10 digit number"
|
||||
value="<?php echo $esino; ?>"
|
||||
onkeypress="return isNumberKey(event)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="ESI_Rate">ESI Rate(%)</label>
|
||||
<font color="Red">*</font>
|
||||
<input type="text" name="ESI_Rate"
|
||||
value="<?php echo $empPay->ESI_Rate; ?>"
|
||||
class="form-control num"
|
||||
style="text-transform:uppercase;"
|
||||
pattern="([0-9]{1,2}([.][0-9]{1,2})?)"
|
||||
title="Enter the Valid ESI Rate, Minimum 1 digit, Maximum 2 digits"
|
||||
readonly />
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label>UAN</label>
|
||||
@ -827,6 +802,31 @@ if (!empty($EmpDetails)) {
|
||||
title="Enter the valid PF Rate, Minimum 1 digit, Maximum 2 digits"
|
||||
readonly />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label>ESI Number</label>
|
||||
<input type="text" id="esino" name="esino"
|
||||
maxlength="10" onchange="validateESI();"
|
||||
class="form-control" title=" 10 digit number"
|
||||
value="<?php echo $esino; ?>"
|
||||
onkeypress="return isNumberKey(event)">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="ESI_Rate">ESI Rate(%)</label>
|
||||
<font color="Red">*</font>
|
||||
<input type="text" name="ESI_Rate"
|
||||
value="<?php echo $empPay->ESI_Rate; ?>"
|
||||
class="form-control num"
|
||||
style="text-transform:uppercase;"
|
||||
pattern="([0-9]{1,2}([.][0-9]{1,2})?)"
|
||||
title="Enter the Valid ESI Rate, Minimum 1 digit, Maximum 2 digits"
|
||||
readonly />
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -414,12 +414,7 @@ if ($total <= $reorder) {
|
||||
|
||||
$('#loader').show();
|
||||
$.ajax({
|
||||
data: {
|
||||
materialCode,
|
||||
materialName,
|
||||
materialCategory,
|
||||
materialType
|
||||
},
|
||||
data: {materialCode,materialName,materialCategory},
|
||||
type: "POST",
|
||||
url: "<?php echo base_url(); ?>materialExist",
|
||||
success: function(data) {
|
||||
|
||||
@ -149,7 +149,11 @@ if (!empty($master)) {
|
||||
} ?>">
|
||||
|
||||
<td><?php echo $index; ?></td>
|
||||
<td><?php echo $con->ConfigValue; ?></td>
|
||||
<?php if($con->Config_ID === 'C023'){ ?>
|
||||
<td><a class="config-category" data-value="<?php echo $con->ConfigValue;?>" data-key="<?php echo $con->Key; ?>"><?php echo $con->ConfigValue ?></a></td>
|
||||
<?php }else{ ?>
|
||||
<td><?php echo $con->ConfigValue; ?></td>
|
||||
<?php } ?>
|
||||
<td>
|
||||
<?php if ($con->isActive == 0) { ?>
|
||||
|
||||
@ -308,6 +312,25 @@ if (!empty($master)) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Long Content Scroll Modal -->
|
||||
<div class="modal fade" id="scrollable-modal" tabindex="-1" role="dialog" aria-labelledby="scrollableModalTitle" aria-hidden="true" style="max-width: 100%;">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document" style="max-width: 50%;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="scrollableModalTitle"></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<!-- Table will be dynamically inserted here -->
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -489,6 +512,90 @@ if (!empty($master)) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$(".config-category").click(function () {
|
||||
|
||||
const key_id = $(this).data("key");
|
||||
const value = $(this).data("value");
|
||||
$('#loader').show();
|
||||
|
||||
$('#scrollableModalTitle').text(`List of PO created using ${value} `);
|
||||
// AJAX API call
|
||||
$.ajax({
|
||||
url: "<?php echo base_url('getPONOcreatedBasedOnConfig'); ?>",
|
||||
data: { key_id: key_id },
|
||||
method: 'POST',
|
||||
dataType: 'json',
|
||||
success: function (response) {
|
||||
if (response.length > 0) {
|
||||
let tableHtml = `
|
||||
<table class="table table-bordered">
|
||||
<thead style="background-color: #539754; color: white; font-size: 13px;">
|
||||
<tr>
|
||||
<th style="text-align: center;" >PO Number</th>
|
||||
<th style="text-align: center;" >PO Date</th>
|
||||
<th style="text-align: center;" >Material Name</th>
|
||||
<th style="text-align: center;" >PO Type</th>
|
||||
<th style="text-align: center;" >PO Status</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
`;
|
||||
|
||||
response.forEach(item => {
|
||||
|
||||
tableHtml += `
|
||||
<tr>
|
||||
<td class="pono-cell" data-pono="${item.PONO}" data-potype="${item.POType}" data-capitalrange="${item.CapitalRange}" style="cursor: pointer; color: #4d3a6d;">
|
||||
${item.PONO}
|
||||
</td>
|
||||
<td>${item.PODate}</td>
|
||||
<td>${item.MaterialName}</td>
|
||||
<td style="text-align: right;">${item.POType}</td>
|
||||
<td style="text-align: right;">${item.StatusName}</td>
|
||||
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
|
||||
tableHtml += `
|
||||
</tbody>
|
||||
</table>
|
||||
`;
|
||||
|
||||
// Insert the table into the modal body
|
||||
$('#scrollable-modal .modal-body').html(tableHtml);
|
||||
|
||||
// Show the modal
|
||||
$('#scrollable-modal').modal('show');
|
||||
|
||||
// Attach click event to PONO cells after the table is rendered
|
||||
$('.pono-cell').click(function () {
|
||||
const pono = $(this).data('pono');
|
||||
const ReqType = $(this).data('potype');
|
||||
const CapitalRange = $(this).data('capitalrange');
|
||||
const url = '<?php echo base_url(); ?>EditPO?PONO=' + pono +'&ReqType='+ReqType+'&CapitalRange='+CapitalRange;
|
||||
|
||||
window.open(url, '_blank');
|
||||
// window.location.href = url;
|
||||
});
|
||||
|
||||
} else {
|
||||
$('#scrollable-modal .modal-body').html('<p>No data found.</p>');
|
||||
$('#scrollable-modal').modal('show');
|
||||
}
|
||||
|
||||
$('#loader').hide();
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
// Handle any errors
|
||||
console.error("API Error:", error);
|
||||
alert("Failed to load material data.");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@ -519,7 +519,6 @@
|
||||
<th rowspan="2" style="white-space: nowrap;">
|
||||
<center><?php _trans('HSN'); ?></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>
|
||||
@ -581,19 +580,23 @@
|
||||
<td colspan="2" class="no-border" style="width:12.5em">
|
||||
<?php if ($POType == REVENUE) {
|
||||
echo ($item->MaterialCode . ' - ') . ($item->MaterialName . $item->ServiceMaterialDescription);
|
||||
echo ($item->LineitemAuditorNotes == '-' ? '' : '<br>( ' . $item->LineitemAuditorNotes. ' )</br>');
|
||||
} ?>
|
||||
<?php if ($POType == SERVICE) {
|
||||
echo ($item->MaterialCode . ' - ') . ($item->MaterialName ? $item->MaterialName : $item->ServiceMaterialDescription);
|
||||
echo ($item->LineitemAuditorNotes == '-' ? '' : '<br>( ' . $item->LineitemAuditorNotes. ' )</br>');
|
||||
} ?>
|
||||
<?php if ($POType == IMPORT) {
|
||||
echo ($item->MaterialCode . ' - ') . ($item->MaterialName);
|
||||
echo ($item->LineitemAuditorNotes == '-' ? '' : '<br>( ' . $item->LineitemAuditorNotes. ' )</br>');
|
||||
} ?>
|
||||
<?php if ($POType == CAPITAL) {
|
||||
echo ($item->MaterialCode . ' - ') . ($item->MaterialName);
|
||||
echo ($item->LineitemAuditorNotes == '-' ? '' : '<br>( ' . $item->LineitemAuditorNotes. ' )</br>');
|
||||
//old -- echo ($item->LineitemAuditorNotes == '-' ? '' : '<hr>'.$item->LineitemAuditorNotes );
|
||||
} ?>
|
||||
</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) : ?>
|
||||
@ -658,14 +661,13 @@
|
||||
<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="7"><strong> TOTAL</strong></td>
|
||||
<td style="text-align: right;" colspan="6"><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) {
|
||||
|
||||
@ -635,14 +635,14 @@
|
||||
<!-- modal4 - IGR history modal -->
|
||||
<div id="Historyshow" class="modal fade" tabindex="-1" role="dialog"
|
||||
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title">IGR History Details <span id="HisTitle"></span></h4>
|
||||
<button type="button" class="close" data-dismiss="modal"
|
||||
aria-hidden="true">×</button>
|
||||
</div>
|
||||
<div class="modal-body p-4">
|
||||
<div class="modal-body p-3">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="HisStatement"></div>
|
||||
@ -1351,12 +1351,12 @@
|
||||
// let fieldName = str.replace(/([a-z])([A-Z])/g, '$1 $2');
|
||||
let sentence = " ";
|
||||
if (parseInt(record.is_add) === 1) {
|
||||
sentence += record.IGR_No + " was added by "+record.FullName+ " on "+record.indian_date+" at "+record.indian_time;
|
||||
sentence += record.IGR_No + " was Created by "+record.FullName+ " on "+record.indian_date+" at "+record.indian_time;
|
||||
} else if (parseInt(record.is_edit) === 1) {
|
||||
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;
|
||||
if (str !== "UpdateBY" && str !== "MaterialRcvdDate" && str !== "DeliveryChellanDate") {
|
||||
let fieldName = str.replace(/([a-z])([A-Z])/g, '$1 $2');
|
||||
sentence += ((record.IGRItem_No) ? record.MaterialName+" ( "+ record.MaterialCode + " ) - " : "")+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) {
|
||||
let str = record.field;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user