stock module latest today vadivel J 08-1-2025
This commit is contained in:
parent
e0f3cec801
commit
241059aca9
@ -1321,7 +1321,7 @@ class StockController extends BaseController
|
||||
|
||||
$data['month'] = $formattedDate;
|
||||
|
||||
// return $this->response->setJSON($data);
|
||||
//return $this->response->setJSON($data);
|
||||
|
||||
return $this->loadViews("trpProductionStockDetails", $this->global, $data, NULL);
|
||||
|
||||
|
||||
@ -1126,8 +1126,6 @@
|
||||
let tr = $(tdElement).closest('tr');
|
||||
|
||||
|
||||
let openingTime = tr.find('td:eq(1)').text().trim();
|
||||
let closingTime = tr.find('td:eq(2)').text().trim();
|
||||
let totalHours = tr.find('td:eq(3)').text().trim();
|
||||
let coldStart = tr.find('td:eq(4)').text().trim();
|
||||
let breakdownHours = tr.find('td:eq(5)').text().trim();
|
||||
@ -1154,6 +1152,19 @@
|
||||
|
||||
let ebReading = tr.find('td:eq(37)').text().trim();
|
||||
let ebReadingPerUnitTon = tr.find('td:eq(38)').text().trim();
|
||||
|
||||
|
||||
|
||||
|
||||
let result = sandFeedingHours(totalHours,coldStart,breakdownHours,burnerFiringHours);
|
||||
|
||||
sandFeedingHours = result[0];
|
||||
|
||||
burnerFiringHours = result[1];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1184,7 +1195,6 @@
|
||||
|
||||
$('.timeDropdown').change( function(){
|
||||
|
||||
console.log("working")
|
||||
|
||||
var tr = $(this).closest('tr');
|
||||
|
||||
@ -1202,16 +1212,27 @@
|
||||
}
|
||||
|
||||
// Calculate the difference in milliseconds
|
||||
const diffInMs = endDate - startDate;
|
||||
const totalDiffInMs = endDate - startDate;
|
||||
|
||||
// Convert milliseconds to hours and minutes
|
||||
const hours = Math.floor(diffInMs / (1000 * 60 * 60));
|
||||
const minutes = Math.floor((diffInMs % (1000 * 60 * 60)) / (1000 * 60));
|
||||
// Convert milliseconds to hours and minutes 3,600,000
|
||||
const hours = parseInt(totalDiffInMs / (1000 * 60 * 60));
|
||||
|
||||
const totalHours = hours + (minutes / 60);
|
||||
const hoursInMilliSeconds = hours * 60 * 60 * 1000;
|
||||
|
||||
const minutesInMilliseconds = totalDiffInMs - hoursInMilliSeconds;
|
||||
|
||||
const minutes = parseInt(minutesInMilliseconds / (1000 * 60));
|
||||
|
||||
const totalHours = hours +"."+ minutes;
|
||||
|
||||
tr.find('td:eq(3)').text(totalHours);
|
||||
|
||||
|
||||
trpStockChange(this);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1220,10 +1241,7 @@
|
||||
);
|
||||
|
||||
})
|
||||
|
||||
console.log("working")
|
||||
|
||||
|
||||
function convertTo24Hour(time) {
|
||||
|
||||
const [timePart, modifier] = time.split(" ");
|
||||
@ -1247,6 +1265,66 @@
|
||||
</script>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
function sandFeedingHours(totalHours,coldStart,breakdownHours,burnerFiringHours){
|
||||
|
||||
let sandFeedingHours = 0;
|
||||
|
||||
let totalHoursInt = milliSecondsFormat(totalHours);
|
||||
let coldStartInt = milliSecondsFormat(coldStart);
|
||||
let breakdownHoursInt = milliSecondsFormat(breakdownHours);
|
||||
|
||||
let burnerFiringHoursInt = totalHoursInt - breakdownHoursInt ;
|
||||
|
||||
sandFeedingHours = milliSecondsToHourMinuteFormat(burnerFiringHoursInt - coldStartInt);
|
||||
|
||||
burnerFiringHours = milliSecondsToHourMinuteFormat(burnerFiringHoursInt);
|
||||
|
||||
return [sandFeedingHours,burnerFiringHours];
|
||||
|
||||
}
|
||||
|
||||
|
||||
function milliSecondsFormat(givenCustomHourMinuteFormat){
|
||||
|
||||
let hoursInMilliSeconds = givenCustomHourMinuteFormat.split(".")[0] * 60 * 60 * 1000;
|
||||
|
||||
let minutesInMilliseconds = givenCustomHourMinuteFormat.split(".")[1] * 60 * 1000;
|
||||
|
||||
totalMilliSeconds = hoursInMilliSeconds + minutesInMilliseconds;
|
||||
|
||||
return totalMilliSeconds;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function milliSecondsDifference(a,b){
|
||||
|
||||
return a > b ? a - b : b - a ;
|
||||
|
||||
}
|
||||
|
||||
function milliSecondsToHourMinuteFormat(givenMilliSeconds){
|
||||
|
||||
const hours = parseInt(givenMilliSeconds / (1000 * 60 * 60));
|
||||
|
||||
const hoursInMilliSeconds = hours * 60 * 60 * 1000;
|
||||
|
||||
const minutesInMilliseconds = givenMilliSeconds - hoursInMilliSeconds;
|
||||
|
||||
const minutes = parseInt(minutesInMilliseconds / (1000 * 60));
|
||||
|
||||
const totalHours = hours +"."+ minutes;
|
||||
|
||||
return totalHours;
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user