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