account igr : ps

This commit is contained in:
VE10-Sanjeev 2025-03-01 05:24:28 +00:00
parent 267e871d7a
commit b6567d1801

View File

@ -93,41 +93,41 @@
var mindt = year - 70; var mindt = year - 70;
var maxdt = year - 15; var maxdt = year - 15;
$("#Invoice_Date , #MaterialRcvdDate").datepicker({ // $("#Invoice_Date , #MaterialRcvdDate").datepicker({
minDate: new Date(year - SIAStartYear, 1, 1), // minDate: new Date(year - SIAStartYear, 1, 1),
maxDate: 'now', // maxDate: 'now',
dateFormat: 'dd-mm-yy', // dateFormat: 'dd-mm-yy',
changeMonth: true, // changeMonth: true,
changeYear: true, // changeYear: true,
yearRange: '-100:+0' // yearRange: '-100:+0'
}); // });
$('#Driver_Name').autocomplete({ // $('#Driver_Name').autocomplete({
onSearchStart: function(query) { // onSearchStart: function(query) {
//alert(query); // //alert(query);
$('#Driver_Name').autocomplete("option", "minLength", 0); // $('#Driver_Name').autocomplete("option", "minLength", 0);
}, // },
serviceUrl: "<?php echo base_url(); ?>drivernameautocomplete", // serviceUrl: "<?php echo base_url(); ?>drivernameautocomplete",
onSelect: function(suggestion) { // onSelect: function(suggestion) {
var data = suggestion.DriverName; // var data = suggestion.DriverName;
} // }
}); // });
$('#DriverMobileNumber').autocomplete({ // $('#DriverMobileNumber').autocomplete({
serviceUrl: "<?php echo base_url(); ?>drivermobileautocomplete", // serviceUrl: "<?php echo base_url(); ?>drivermobileautocomplete",
params: { // params: {
driverName: function() { // driverName: function() {
return $('#Driver_Name').val(); // Pass the value of the DriverName input field // return $('#Driver_Name').val(); // Pass the value of the DriverName input field
} // }
}, // },
onSearchStart: function(query) { // onSearchStart: function(query) {
$('#DriverMobileNumber').autocomplete("option", "minLength", 0); // $('#DriverMobileNumber').autocomplete("option", "minLength", 0);
}, // },
onSelect: function(suggestion) { // onSelect: function(suggestion) {
var data = suggestion.DriverMobileNumber; // var data = suggestion.DriverMobileNumber;
} // }
}); // });
}); });
@ -219,8 +219,13 @@
<td><?php echo $record->SupplierName ?></td> <td><?php echo $record->SupplierName ?></td>
<td><?php echo $record->DeliveryChellanOrInvoiceNo ?></td> <td><?php echo $record->DeliveryChellanOrInvoiceNo ?></td>
<td align="right"><?php <td align="right"><?php
$date = new DateTime($record->DeliveryChellanDate); $invdate = $record->DeliveryChellanDate;
echo $date->format('d-m-Y'); ?></td> if(!$invdate || $invdate == 'null' || $invdate === '0000-00-00 00:00:00'){
echo "";
}else{
$date = new DateTime($invdate);
echo $date->format('d-m-Y'); }
?></td>
<td align="center"><?php echo $record->itemCount ?></td> <td align="center"><?php echo $record->itemCount ?></td>
<td align="right"><?php echo $record->ReceivedQuantity ?></td> <td align="right"><?php echo $record->ReceivedQuantity ?></td>
<td align="center"><?php echo $record->NetWeight ?></td> <td align="center"><?php echo $record->NetWeight ?></td>
@ -772,9 +777,11 @@
} }
// Format dates // Format dates
var dcd = new Date(item.DeliveryChellanDate); if(item.DeliveryChellanDate !== '0000-00-00 00:00:00' ){
var dcd2 = (String(dcd.getDate()).padStart(2, '0') + '-' + (String(dcd.getMonth() + 1).padStart(2, '0')) + '-' + dcd.getFullYear()); var dcd = new Date(item.DeliveryChellanDate);
$("#Invoice_Date").val(dcd2); var dcd2 = (String(dcd.getDate()).padStart(2, '0') + '-' + (String(dcd.getMonth() + 1).padStart(2, '0')) + '-' + dcd.getFullYear());
$("#Invoice_Date").val(dcd2);
}
console.log(item.MaterialRcvdDate) console.log(item.MaterialRcvdDate)
var Mat_rcv_date = (item.MaterialRcvdDate == 'null') ? ' ' : formatDateTime(item.MaterialRcvdDate, 1); var Mat_rcv_date = (item.MaterialRcvdDate == 'null') ? ' ' : formatDateTime(item.MaterialRcvdDate, 1);
$("#MaterialRcvdDate").val(Mat_rcv_date); $("#MaterialRcvdDate").val(Mat_rcv_date);
@ -1179,15 +1186,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 Created 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 + "."; let str = record.field;
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) { } 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;
} }
@ -1396,6 +1410,7 @@
</script> </script>
<script> <script>
function formatDateTime(dateString, flag) { function formatDateTime(dateString, flag) {
console.log("ff",dateString);
// Note 1 means DATE only // Note 1 means DATE only
// 2 means DATE and Time // 2 means DATE and Time
// Check if the date string is null or empty // Check if the date string is null or empty