Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme

This commit is contained in:
VE10-Sanjeev 2025-02-11 09:31:44 +00:00
commit 907d1d79a7
3 changed files with 52 additions and 15 deletions

View File

@ -1973,7 +1973,37 @@ class StockController extends BaseController
{
$currentMonth = $this->request->getPost('month') ? $this->request->getPost('month') : date('M-Y');
//drier will be processing different method than other stock in case of session stock month and date format for generating
//dummy data and updating the data . be cautious while updating the code..!!
if ($this->request->getMethod() === 'POST') {
$currentMonth = $this->request->getPost('month');
$date = DateTime::createFromFormat('M-Y', $currentMonth); //in M-Y format
$formattedDate = $date->format('Y-m'); //in Y-m format
$session = session ();
$session->set('stock_month',$formattedDate);
} else {
$session = session();
$currentMonth = $session->get('stock_month');
if (empty($currentMonth)) {
$currentMonth = date('M-Y'); // Default to the current month
}else{
$currentMonth = DateTime::createFromFormat('Y-m', $currentMonth); // in Y-m format
$currentMonth = $currentMonth->format('M-Y'); // in M-Y format
}
}
$monthData = $this->getMonthDatesFromInput($currentMonth);
@ -2139,9 +2169,9 @@ class StockController extends BaseController
$month = $this->request->getPost('month');
$date = DateTime::createFromFormat('M-Y', $month);
$date = DateTime::createFromFormat('M-Y', $month); //in M-Y format
$formattedDate = $date->format('Y-m');
$formattedDate = $date->format('Y-m'); //in Y-m format
$month = $formattedDate;

View File

@ -947,7 +947,7 @@
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-secondary" data-dismiss="modal" id="cancelBtn">Cancel</button>
<button type="submit" class="btn btn-primary">Save </button>
</div>
</form>
@ -1704,8 +1704,13 @@
data: { id: batchId },
success: function (response) {
if(response.status == "200"){
alert("Batch file deleted successfully!");
alert("Batch File Deleted Successfully!");
$(this).closest('.batch-container').remove(); // Remove from UI
location.reload(); // Reload the page
} else{
alert("Removed Empty batch file");
// alert("Error deleting batch file: " + response.message);
}
},
error: function (xhr, status, error) {

View File

@ -550,15 +550,17 @@ foreach ($period as $day) {
$summary["machineId_$machineId"]['consumption'] += is_numeric($dieselStock['consumption']) ? $dieselStock['consumption'] : 0 ;
$summary["machineId_$machineId"]['running_hours'] += is_numeric($dieselStock['running_hours']) ? $dieselStock['running_hours'] : 0 ;
if($summary["machineId_$machineId"]['running_hours'] > 0){
$dieselMileage = round(
$summary["machineId_$machineId"]['consumption'] / $summary["machineId_$machineId"]['running_hours'],
2
);
}else{
$dieselMileage = 0 ;
}
if($summary["machineId_$machineId"]['running_hours'] > 0){
$dieselMileage = round(
$summary["machineId_$machineId"]['consumption'] / $summary["machineId_$machineId"]['running_hours'],
2
);
}else{
$dieselMileage = 0 ;
}
$summary["machineId_$machineId"]['mileage'] = is_numeric( $dieselMileage) ? $dieselMileage : 0 ;
@ -1245,7 +1247,7 @@ foreach ($period as $day) {
let dataId = `${otherDate} ${machine_id}`;
document.querySelector(`td.openingReading[data-id="${dataId}"]`).innerText = closingReading == 0 ? " " : (closingReading).toFixed(2) ;
document.querySelector(`td.openingReading[data-id="${dataId}"]`).innerText = closingReading == 0 ? " " : parseFloat(closingReading).toFixed(2) ;
let openingReading = validateInput(document.querySelector(`td.openingReading[data-id="${dataId}"]`).innerText);