Bug Fixes : ps

This commit is contained in:
VE10-Sanjeev 2025-02-24 12:55:07 +00:00
parent 22a401fcb5
commit 229ac1b4a2
19 changed files with 227 additions and 164 deletions

View File

@ -136,19 +136,24 @@ class Driver extends BaseController
public function loadDriverAttendance() public function loadDriverAttendance()
{ {
$input_driver_id = $this->request->getPost('gobal_driver_id') ? $this->request->getPost('gobal_driver_id') : $this->request->getGet('gobal_driver_id'); $input_driver_id = $this->request->getGet('gobal_driver_id');
$input_month_year = $this->request->getPost('month_year') ? $this->request->getPost('month_year') : $this->request->getGet('month_year'); // $input_month_year = $this->request->getPost('month_year') ? $this->request->getPost('month_year') : get_date_time_dynamical_format('d-M-Y','d-m-',"01-"+$this->request->getGet('month_year')) ;
list($month, $year) = explode('-', $input_month_year); $input_date = $this->request->getGet('date')
? $this->request->getGet('date')
: get_date_time_dynamical_format('d-M-Y','d-m-Y',"01-".$this->request->getGet('month_year'));
$month_in_number = get_date_time_dynamical_format('M','m',"$month");// refer helper
$get_last_date_of_the_month = cal_days_in_month(CAL_GREGORIAN, $month_in_number, $year); list($date,$month,$year) = explode('-', $input_date);
$from_mysql_date = get_date_time_dynamical_format('d-m-Y','Y-m-d',"01-$month_in_number-$year");
$to_mysql_date = get_date_time_dynamical_format('d-m-Y','Y-m-d',"$get_last_date_of_the_month-$month_in_number-$year"); $get_last_date_of_the_month = cal_days_in_month(CAL_GREGORIAN, $month, $year);
$indian_date = get_date_time_dynamical_format('d-m-Y','d-m-Y',"$get_last_date_of_the_month-$month_in_number-$year"); $from_mysql_date = get_date_time_dynamical_format('d-m-Y','Y-m-d',"01-$month-$year");
$to_mysql_date = get_date_time_dynamical_format('d-m-Y','Y-m-d',"$get_last_date_of_the_month-$month-$year");
$indian_date = get_date_time_dynamical_format('d-m-Y','d-m-Y',"$get_last_date_of_the_month-$month-$year");
$data['driver_attendance_list'] = $this->driver_model->useDriverAttendanceTable()->getDriverAttendanceList($input_driver_id,$from_mysql_date,$to_mysql_date); $data['driver_attendance_list'] = $this->driver_model->useDriverAttendanceTable()->getDriverAttendanceList($input_driver_id,$from_mysql_date,$to_mysql_date);
$data['page_driver_name'] = $this->driver_model->getDriverName($input_driver_id); $data['page_driver_name'] = $this->driver_model->getDriverName($input_driver_id);
$data['invoice_info'] = $this->driver_model->getInvoiceInfo(); $data['invoice_info'] = $this->driver_model->getInvoiceInfo();
$data['datefordropdown'] = $input_month_year; $data['datefordropdown'] = $input_date;
$data['gobal_driver_id'] = $input_driver_id; $data['gobal_driver_id'] = $input_driver_id;
$this->global['pageTitle'] = 'Driver Attendance List'; $this->global['pageTitle'] = 'Driver Attendance List';

View File

@ -632,7 +632,7 @@ class Emergencypurchaseorder extends BaseController
if (count($mrirmaster) > 0) { if (count($mrirmaster) > 0) {
foreach ($mrirmaster as $key) { foreach ($mrirmaster as $key) {
$MRIRNO = $key->MRIRNo; $MRIRNO = $key->MRIRNO;
} }
} }
@ -1525,6 +1525,6 @@ class Emergencypurchaseorder extends BaseController
$this->purchaseorder_model->DeletePOServiceTax($LineItemNo); $this->purchaseorder_model->DeletePOServiceTax($LineItemNo);
} }
$this->purchaseorder_model->DeletePOLineItem($LineItemNo, $ReqNo, $MaterialCode); $this->purchaseorder_model->DeletePOLineItem($LineItemNo, $ReqNo, $MaterialCode);
echo "Successfully Deleted the Line item" . $LineItemNo; echo "Successfully Deleted the Line item " . $LineItemNo;
} }
} }

View File

@ -1962,7 +1962,7 @@ class Purchaseorder extends BaseController
$this->purchaseorder_model->DeletePOServiceTax($LineItemNo); $this->purchaseorder_model->DeletePOServiceTax($LineItemNo);
} }
$this->purchaseorder_model->DeletePOLineItem($LineItemNo, $ReqNo, $MaterialCode); $this->purchaseorder_model->DeletePOLineItem($LineItemNo, $ReqNo, $MaterialCode);
echo "Successfully Deleted the Line item" . $LineItemNo; echo "Successfully Deleted the Line item " . $LineItemNo;
} }

View File

@ -341,7 +341,7 @@ class Servicepurchaseorder extends BaseController
} }
} }
} }
echo 'Service Purchase Order Created Successfully!The PO NO Is: ' . $PONO; echo 'Service Purchase Order Created Successfully! PO Number Is: ' . $PONO;
} }
//update service po //update service po
function UpdateServicePurchaseOrder() function UpdateServicePurchaseOrder()

View File

@ -47,11 +47,11 @@ class Driver_model extends Model
return $this->table . '.' . $field; return $this->table . '.' . $field;
}, $this->allowedFields)); }, $this->allowedFields));
$selectFields = "CONCAT_WS(' ', t_employee_details.FirstName, t_employee_details.LastName) AS FullName, t_employee_details.IsActive as employee_isactive, t_driver.driver_name,ip_clients.client_name as customer,ip_invoices.received_qty as quantity,t_driver_payroll.id as payroll_id,t_driver_payroll.PayOn," . $fields; $selectFields = "CONCAT_WS(' ', t_employee_details.FirstName, t_employee_details.LastName) AS FullName, t_employee_details.IsActive as employee_isactive, CONCAT_WS(' ', driver.FirstName, driver.LastName) AS driver_name,ip_clients.client_name as customer,ip_invoices.received_qty as quantity,t_driver_payroll.id as payroll_id,t_driver_payroll.PayOn," . $fields;
$month_year = get_date_time_dynamical_format('Y-m-d','m-Y',"$from"); $month_year = get_date_time_dynamical_format('Y-m-d','m-Y',"$from");
return $this->select($selectFields) return $this->select($selectFields)
->join('t_driver', 't_driver.driver_id = ' . $this->table . '.driver_id', 'left') ->join('t_employee_details as driver', 'driver.EmpID = ' . $this->table . '.driver_id', 'left')
->join('tbl_users', 'tbl_users.userId = ' . $this->table . '.created_by', 'left') ->join('tbl_users', 'tbl_users.userId = ' . $this->table . '.created_by', 'left')
->join('t_employee_details', 'tbl_users.EmpID = t_employee_details.EmpID', 'left') ->join('t_employee_details', 'tbl_users.EmpID = t_employee_details.EmpID', 'left')
->join('ip_invoices', 'ip_invoices.invoice_number = ' . $this->table . '.invoice_number', 'left') ->join('ip_invoices', 'ip_invoices.invoice_number = ' . $this->table . '.invoice_number', 'left')
@ -60,6 +60,7 @@ class Driver_model extends Model
->where($this->table.'.date BETWEEN "'.$from.'" AND "'.$to.'"') ->where($this->table.'.date BETWEEN "'.$from.'" AND "'.$to.'"')
->where($this->table . '.driver_id', $driver_id) ->where($this->table . '.driver_id', $driver_id)
->where($this->table . '.isactive', 1) ->where($this->table . '.isactive', 1)
->where('driver.is_driver', 1)
->findAll(); ->findAll();
} }
@ -73,9 +74,9 @@ class Driver_model extends Model
function getDriverName($id) function getDriverName($id)
{ {
$builder = $this->db->table('t_driver') $builder = $this->db->table('t_employee_details')
->select('driver_name') ->select('CONCAT_WS(" ", t_employee_details.FirstName, t_employee_details.LastName) as driver_name')
->where('driver_id', $id); ->where('EmpID', $id);
$query = $builder->get()->getRow(); $query = $builder->get()->getRow();

View File

@ -2991,15 +2991,8 @@ if (!empty($getlogpodtl)) {
type: "POST", type: "POST",
url: "<?php echo base_url() ?>purchaseorder/DeletePODetails", url: "<?php echo base_url() ?>purchaseorder/DeletePODetails",
success: function(data) { success: function(data) {
if (data) { $('#loader').hide();
$('#loader').hide(); (data) ? alert(response) : alert("Error");
alert(data);
} else {
$('#loader').hide();
alert("Error");
}
} }
}); });
} }

View File

@ -6,6 +6,13 @@
label { label {
font-style: bold; font-style: bold;
} }
input[type="file"] {
white-space: normal;
word-wrap: break-word;
overflow-wrap: break-word;
width: 100%;
}
</style> </style>
<script> <script>
$(document).ready(function() { $(document).ready(function() {

View File

@ -333,64 +333,105 @@ if (!empty($INRSYMBOL)) {
function vaildateBeforeOpenModal() { function vaildateBeforeOpenModal() {
var radioValue = $("input[name='DateRange']:checked").val(); var radioValue = $("input[name='DateRange']:checked").val();
if (capitalType == 'International') {
if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details');
$('#drpSupplier').focus();
return false;
} else if ($('#PODate').val() == '') {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
} else if (radioValue == 0 && $('#Deliverydate').val() == '') {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 1 && $('#Scheduleby').val() == '') {
alert('Please Enter the Schedule By');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 2 && $('#Dispatch').val().trim() == '') {
alert('Please Enter the Dispatch Instruction');
$('#Deliverydate').focus();
return false;
} else if ($('#Deliverydt').val() == '' && $('#Scheduleby').val() == '') {
alert('Please Enter the Dispatch Instruction');
$('#Deliverydt').focus();
return false;
} else if ($('#DeliveryAddr').val() == '') {
alert('Please Enter the Delivery Address');
$('#DeliveryAddr').focus();
return false;
} else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select Capital Type');
$('#PoTypeOptions').focus();
return false;
if ($('#PODate').val() == '') { } else if ($('#BudgetType').val() == "0") {
alert('Please Enter the Purchase Order date'); alert('Please Select Budget Type');
$('#PODate').focus(); $('#BudgetType').focus();
return false; return false;
} else if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details');
$('#drpSupplier').focus();
return false;
} else if (radioValue == 0 && $('#Deliverydate').val() == '') {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 1 && $('#Scheduleby').val() == '') {
alert('Please Enter the Schedule By');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 2 && $('#Dispatch').val().trim() == '') {
alert('Please Enter the Dispatch Instruction');
$('#Deliverydate').focus();
return false;
} else if ($('#DeliveryAddr').val() == '') {
alert('Please Enter the Delivery Address');
$('#DeliveryAddr').focus();
return false;
} else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select POType');
$('#PoTypeOptions').focus();
return false;
} else if ($('#BudgetType').val() == "0") { }
alert('Please Select Budget Type');
$('#BudgetType').focus();
return false;
} else if ($('#Deliverydt').val() == '' && $('#Scheduleby').val() == '') {
alert('Please Enter the Dispatch Instruction');
$('#Deliverydt').focus();
return false;
} else if ($('#currencytype').val() == '0') {
alert('Please Select the Currency Type');
$('#currencytype').focus();
return false;
} else if (capitalType == 'International') {
if ($('#ExchangeRt').val() == '') {
alert('Please Enter the Exchange Rate');
$('#ExchangeRt').focus();
return false;
} else if ($('#PlaceOforigin').val().trim() == '') {
alert('Please Enter the Place Of Origin');
$('#PlaceOforigin').focus();
return false;
} else {
return true;
}
} else {
return true;
} }
if (capitalType == 'Domestic') {
if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details');
$('#drpSupplier').focus();
return false;
} else if ($('#currencytype').val() == '0') {
alert('Please Select the Currency Type');
$('#currencytype').focus();
return false;
} else if ($('#PODate').val() == '') {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
} else if (radioValue == 0 && $('#Deliverydate').val() == '') {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 1 && $('#Scheduleby').val() == '') {
alert('Please Enter the Schedule By');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 2 && $('#Dispatch').val().trim() == '') {
alert('Please Enter the Dispatch Instruction');
$('#Deliverydate').focus();
return false;
} else if ($('#Deliverydt').val() == '' && $('#Scheduleby').val() == '') {
alert('Please Enter the Dispatch Instruction');
$('#Deliverydt').focus();
return false;
} else if ($('#ExchangeRt').val() == '') {
alert('Please Enter the Exchange Rate');
$('#ExchangeRt').focus();
return false;
} else if ($('#PlaceOforigin').val().trim() == '') {
alert('Please Enter the Place Of Origin');
$('#PlaceOforigin').focus();
return false;
} else if ($('#DeliveryAddr').val() == '') {
alert('Please Enter the Delivery Address');
$('#DeliveryAddr').focus();
return false;
} else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select Capital Type');
$('#PoTypeOptions').focus();
return false;
} else if ($('#BudgetType').val() == "0") {
alert('Please Select Budget Type');
$('#BudgetType').focus();
return false;
}
}
} }
</script> </script>
<div class="content-page"> <div class="content-page">

View File

@ -221,7 +221,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<div class="col-md-6"> <div class="col-md-6">
<label class="form" for="load_type">Load Type</label> <label class="form" for="load_type">Load Type</label>
<select class="form-control" id="load_type" name="load_type" onchange="salary();"> <select class="form-control" id="load_type" name="load_type" onchange="updateSalaryBasedOnType();">
<option value="">Select</option> <option value="">Select</option>
<option value="Load">Load</option> <option value="Load">Load</option>
<option value="Waste Core">Waste Core</option> <option value="Waste Core">Waste Core</option>
@ -234,11 +234,11 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<div class="row mt-2"> <div class="row mt-2">
<div class="col-md-4"> <div class="col-md-4">
<label class="form" for="salary_amount">Salary Amount</label> <label class="form" for="salary_amount">Salary Amount</label>
<input type="text" class="form-control" id="salary_amount" name="salary_amount" onkeypress="return isNumber(event);" onchange="salary();"> <input type="text" class="form-control" id="salary_amount" name="salary_amount" onkeypress="return isNumber(event);" onchange="fetchSalary();">
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label class="form" for="food_amount">Food Amount</label> <label class="form" for="food_amount">Food Amount</label>
<input type="text" class="form-control" id="food_amount" name="food_amount" onkeypress="return isNumber(event);" onchange="salary();"> <input type="text" class="form-control" id="food_amount" name="food_amount" onkeypress="return isNumber(event);" onchange="fetchSalary();">
</div> </div>
<div class="col-md-4"> <div class="col-md-4">
<label class="form" for="total_amount">Total Amount</label> <label class="form" for="total_amount">Total Amount</label>
@ -463,25 +463,29 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
if (result) { return result; } else { event.preventDefault(); } if (result) { return result; } else { event.preventDefault(); }
} }
function salary() { $(document).ready(function() {
updateSalaryBasedOnType();
var type = $('#load_type').val(); fetchSalary();
});
if(type == 'Load'){
var value = parseFloat(1300);
$('#salary_amount').val(value);
}else if(type == 'Waste Core'){
var value = parseFloat(1050);
$('#salary_amount').val(value);
}
var sa = parseFloat($('#salary_amount').val()) || 0;
var fa = parseFloat($('#food_amount').val()) || 0;
var ttl = sa + fa;
$('#total_amount').val(ttl.toFixed(2));
function updateSalaryBasedOnType() {
var type = $('#load_type').val();
if (type == 'Load') {
$('#salary_amount').val(1300);
} else if (type == 'Waste Core') {
$('#salary_amount').val(1050);
}
fetchSalary();
} }
function fetchSalary() {
var sa = parseFloat($('#salary_amount').val()) || 0;
var fa = parseFloat($('#food_amount').val()) || 0;
var ttl = sa + fa;
$('#total_amount').val(ttl.toFixed(2));
}
function customerandquantity(){ function customerandquantity(){
if ($('#invoice_number').val() === '') { if ($('#invoice_number').val() === '') {
alert('Please Enter the Valid Invoice Number'); alert('Please Enter the Valid Invoice Number');

View File

@ -5358,15 +5358,8 @@ if (!empty($getlogpodtl)) {
type: "POST", type: "POST",
url: "<?php echo base_url() ?>purchaseorder/DeletePODetails", url: "<?php echo base_url() ?>purchaseorder/DeletePODetails",
success: function (data) { success: function (data) {
$('#loader').show(); $('#loader').hide();
(data) ? alert(response) : alert("Error");
if (data) {
// $('#content').loader('hide');
alert(data);
} else {
alert("Error");
}
} }
}); });
} }

View File

@ -6,6 +6,13 @@
label { label {
font-style: bold; font-style: bold;
} }
input[type="file"] {
white-space: normal;
word-wrap: break-word;
overflow-wrap: break-word;
width: 100%;
}
</style> </style>
<?php <?php

View File

@ -191,7 +191,7 @@ $Reqon = '';
$RequesterName = ''; $RequesterName = '';
if (!empty($POMaster)) { if (!empty($POMaster)) {
//print_r($POMaster); // dd($POMaster);
//print_r($POItem); //print_r($POItem);
foreach ($POMaster as $Req) { foreach ($POMaster as $Req) {
$parentPO = $Req->ParentPO; $parentPO = $Req->ParentPO;
@ -218,6 +218,7 @@ if (!empty($POMaster)) {
$DeliveryAddress = $Req->DeliveryAddress; $DeliveryAddress = $Req->DeliveryAddress;
$PONOStatus = $Req->StatusCode; $PONOStatus = $Req->StatusCode;
// dd($PONOStatus);
$PONO = $Req->PONO; $PONO = $Req->PONO;
$ServiceDescription = $Req->ServiceDescription; $ServiceDescription = $Req->ServiceDescription;
$CapitalRange = $Req->CapitalRange; $CapitalRange = $Req->CapitalRange;
@ -4477,7 +4478,8 @@ if (!empty($getlogpodtl)) {
}); });
index = parseInt(index) + 1; index = parseInt(index) + 1;
// $PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED // $PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED
PONOStatus = <?php echo $PONOStatus; ?> var PONOStatus = <?php echo '"'.$PONOStatus.'"'; ?>
console.log("PONOStatus",PONOStatus);
// var template = jQuery("#RevenueList").html(); // var template = jQuery("#RevenueList").html();
@ -5087,12 +5089,7 @@ if (!empty($getlogpodtl)) {
url: "<?php echo base_url() ?>purchaseorder/DeletePODetails", url: "<?php echo base_url() ?>purchaseorder/DeletePODetails",
success: function (data) { success: function (data) {
$('#loader').hide(); $('#loader').hide();
if (data) { (data) ? alert(response) : alert("Error");
alert(data);
} else {
alert("Error");
}
} }
}); });

View File

@ -2044,14 +2044,8 @@ foreach ($PaymentTerms as $TER) {
type: "POST", type: "POST",
url: "<?php echo base_url() ?>purchaseorder/DeletePODetails", url: "<?php echo base_url() ?>purchaseorder/DeletePODetails",
success: function(data) { success: function(data) {
if (data) { $('#loader').hide();
$('#loader').hide(); (data) ? alert(response) : alert("Error");
alert(data);
} else {
$('#loader').hide();
alert("Error");
}
} }
}); });
} }

View File

@ -5334,14 +5334,7 @@ if (!empty($getlogpodtl)) {
url: "<?php echo base_url() ?>purchaseorder/DeletePODetails", url: "<?php echo base_url() ?>purchaseorder/DeletePODetails",
success: function(data) { success: function(data) {
$('#loader').hide(); $('#loader').hide();
(data) ? alert(response) : alert("Error");
if (data) {
// $('#content').loader('hide');
alert(data);
} else {
alert("Error");
}
} }
}); });
} }

View File

@ -135,7 +135,15 @@
} else { } else {
$cdate = date('d-m-Y', strtotime($record->Created_date)); $cdate = date('d-m-Y', strtotime($record->Created_date));
} ?> } ?>
<td><a class="a_tag_link" href="<?php echo base_url() . 'employeedetails/ViewEmployee/?EmpID=' . $record->EmpID; ?>" data-toggle="tooltip" title="<?php echo $record->EmpID; ?> - Click here to view Employee details"><?php echo $record->EmpID ?> </a></u></td> <td><a class="a_tag_link" href="<?php echo base_url() . 'employeedetails/ViewEmployee/?EmpID=' . $record->EmpID; ?>" data-toggle="tooltip" title="<?php echo $record->EmpID; ?> - Click here to view Employee details"><?php echo $record->EmpID ?> </a></u>
<?php if($record->is_driver){ ?>
&nbsp;&nbsp;&nbsp;
<a title="Trip Details" style="cursor:pointer;" href="<?= base_url() . 'loadDriverAttendance?gobal_driver_id=' . $record->EmpID.'&date='.$cdate; ?>">
<i class="fa fa-truck"></i>&nbsp;&nbsp;&nbsp;
</a>
<?php } ?>
</td>
<td><?php echo $record->FirstName; ?></td> <td><?php echo $record->FirstName; ?></td>
<td><?php echo $record->ContactNumber ?></td> <td><?php echo $record->ContactNumber ?></td>
<td><?php echo $record->Designation ?></td> <td><?php echo $record->Designation ?></td>

View File

@ -29,7 +29,7 @@
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<div class="row" style="padding-left: 26px;"> <div class="row" style="padding: 18px 26px;">
<div class="col-md-3"> <div class="col-md-3">
<span>Holiday Name : </span> <span>Holiday Name : </span>
<input type="text" name="hname" id="hname" class="form-control"> <input type="text" name="hname" id="hname" class="form-control">

View File

@ -204,15 +204,15 @@ if (!empty($INRSYMBOL)) {
function vaildateBeforeOpenModal() { function vaildateBeforeOpenModal() {
var radioValue = $("input[name='DateRange']:checked").val(); var radioValue = $("input[name='DateRange']:checked").val();
if ($('#PODate').val() == '') { if ($('#drpSupplier').val() == "0") {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
} else if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details'); alert('Please Select the Supplier details');
$('#drpSupplier').focus(); $('#drpSupplier').focus();
return false; return false;
} else if ($('#DeliveryAddr').val() == '') { } else if ($('#PODate').val() == '') {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
} else if ($('#DeliveryAddr').val() == '') {
alert('Please Enter the Delivery Address'); alert('Please Enter the Delivery Address');
$('#DeliveryAddr').focus(); $('#DeliveryAddr').focus();
return false; return false;
@ -224,15 +224,7 @@ if (!empty($INRSYMBOL)) {
alert('Please Enter the Schedule By'); alert('Please Enter the Schedule By');
$('#Deliverydate').focus(); $('#Deliverydate').focus();
return false; return false;
} else if (radioValue == 0 && $('#Deliverydate').val() == '') { } else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 1 && $('#Scheduleby').val().trim() == '') {
alert('Please Enter the Schedule By');
$('#Deliverydate').focus();
return false;
} else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select Revenue Type'); alert('Please Select Revenue Type');
$('#PoTypeOptions').focus(); $('#PoTypeOptions').focus();
return false; return false;
@ -3944,7 +3936,7 @@ if (!empty($INRSYMBOL)) {
} else { } else {
var formData = new FormData($('.CreatePO')[0]); var formData = new FormData($('.CreatePO')[0]);
disableButtons();
$.ajax({ $.ajax({
@ -3962,15 +3954,19 @@ if (!empty($INRSYMBOL)) {
//$('#SpcialInstruction').val(''); //$('#SpcialInstruction').val('');
//$('#txtDeliveryAddress').val(''); //$('#txtDeliveryAddress').val('');
window.location = "purchaseorderListing"; window.location = "purchaseorderListing";
setTimeout(function() { enableButtons(); }, 2000);
} else { } else {
alert("Error"); alert("Error");
setTimeout(function() { enableButtons(); }, 2000);
} }
}, },
error: function(jqXHR, textStatus, errorThrown) { error: function(jqXHR, textStatus, errorThrown) {
console.error("AJAX Error: " + textStatus + ": " + errorThrown); console.error("AJAX Error: " + textStatus + ": " + errorThrown);
alert("Error: " + textStatus); alert("Error: " + textStatus);
setTimeout(function() { enableButtons(); }, 2000);
} }
}); });
@ -4214,9 +4210,29 @@ if (!empty($INRSYMBOL)) {
} }
function Reset() { function Reset() {
disableButtons();
location.reload(); location.reload();
setTimeout(function() {
enableButtons();
}, 2000);
} }
function disableButtons() {
document.querySelectorAll('.Save, .Submit').forEach(function(button) {
button.classList.add('disabled');
button.setAttribute('disabled', 'disabled');
});
}
function enableButtons() {
document.querySelectorAll('.Save, .Submit').forEach(function(button) {
button.classList.remove('disabled');
button.removeAttribute('disabled');
});
}
</script> </script>

View File

@ -407,11 +407,14 @@ if (!empty($Emp)) {
$("#UOM").val(''); $("#UOM").val('');
// Get the ID of the first option // Get the ID of the first option
var firstOptionId = $('#CostCenter option:first').val(); var firstOptionId = $('#CostCenter option:first').val();
// Reset the Select2 dropdown to the first option $('#CostCenter').val("-1");
$('#CostCenter').val(firstOptionId).select2('data', {
id: firstOptionId,
text: $('#CostCenter option:selected').text() // // Reset the Select2 dropdown to the first option
}); // $('#CostCenter').val(firstOptionId).select2('data', {
// id: firstOptionId,
// text: $('#CostCenter option:selected').text()
// });
removeHiddenRows($('#Items').find('tr').length); removeHiddenRows($('#Items').find('tr').length);
@ -605,12 +608,13 @@ if (!empty($Emp)) {
</script> </script>
<script> <script>
function validate() { function validate() {
if ($("option:selected", $("#RequestType")).val() == '-1') { if ($("option:selected", $("#EmpID")).val() == '-1') {
alert('Please Select Request Type ');
return false;
} else if ($("option:selected", $("#EmpID")).val() == '-1') {
alert('Please Select Request by'); alert('Please Select Request by');
return false; return false;
}
else if ($("option:selected", $("#RequestType")).val() == '-1') {
alert('Please Select Request Type ');
return false;
} else if ($("#txtRowCount").val().length < 1) { } else if ($("#txtRowCount").val().length < 1) {
alert('Please Add Line Item'); alert('Please Add Line Item');
return false; return false;

View File

@ -176,9 +176,9 @@ if (!empty($Status)) {
href="<?php echo base_url() . 'EditRequisitionForm?ReqNo=' . $record->ReqNo . '&ReqType=' . $record->ReqType; ?>"><i href="<?php echo base_url() . 'EditRequisitionForm?ReqNo=' . $record->ReqNo . '&ReqType=' . $record->ReqType; ?>"><i
class="fas fa-pencil-alt" data-toggle="tooltip" class="fas fa-pencil-alt" data-toggle="tooltip"
title="<?php echo $record->ReqNo; ?> - Click here to view Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> title="<?php echo $record->ReqNo; ?> - Click here to view Requisition details"></i>&nbsp;&nbsp;&nbsp;</a>
<a data-toggle="tooltip" onclick="DeleteRow('<?php echo $record->ReqNo; ?>' )"><span <a data-toggle="tooltip" href="#" onclick="DeleteRow('<?php echo $record->ReqNo; ?>' )"><i
class="fas fa-trash" class="fas fa-trash" data-toggle="tooltip"
title="<?php echo $record->ReqNo; ?> - Click here to Delete Requisition details"></span></a> title="<?php echo $record->ReqNo; ?> - Click here to Delete Requisition details"></i>&nbsp;&nbsp;&nbsp;</a>
</td> </td>
</tr> </tr>