GWM : expense
This commit is contained in:
parent
b9ac3c7df8
commit
e92e5f4b27
@ -45,14 +45,15 @@ class Expense extends BaseController
|
||||
$this->global['pageTitle'] = 'Non IGR / Expense List';
|
||||
$data['fromDate'] = date('d-m-Y', strtotime($fromDate));
|
||||
$data['toDate'] = date('d-m-Y', strtotime($toDate));
|
||||
|
||||
$this->loadViews("expense_list", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
private function generateSerialNumber($financialYear, $lastSerial)
|
||||
{
|
||||
// If no last serial number exists, start with 00001
|
||||
$lastNumber = $lastSerial ? (int)explode('/', $lastSerial)[1] : 0;
|
||||
$newNumber = str_pad($lastNumber + 1, 5, '0', STR_PAD_LEFT);
|
||||
$lastNumber = $lastSerial ? (int)explode('/', $lastSerial)[2] : 0;
|
||||
$newNumber = str_pad($lastNumber + 1, 3, '0', STR_PAD_LEFT);
|
||||
return "NonIGR/$financialYear/$newNumber";
|
||||
}
|
||||
|
||||
|
||||
@ -16,8 +16,7 @@ class Expense_model extends Model
|
||||
{
|
||||
return $this->db->table('t_expense')
|
||||
->select('serial_number')
|
||||
->like('serial_number', "$financialYear/", 'after')
|
||||
->orderBy('serial_number', 'DESC')
|
||||
->orderBy('id', 'DESC')
|
||||
->limit(1)
|
||||
->get()
|
||||
->getRow('serial_number');
|
||||
@ -25,12 +24,14 @@ class Expense_model extends Model
|
||||
|
||||
// Retrieve all active expenses
|
||||
public function getAllExpense($fromDate,$toDate) {
|
||||
return $this->join('t_supplierdetailsn', 't_expense.supplier_id = t_supplierdetailsn.SupplierID')
|
||||
|
||||
return $this->db->table('t_expense')
|
||||
->join('t_supplierdetailsn', 't_expense.supplier_id = t_supplierdetailsn.SupplierID', 'left')
|
||||
->where('t_expense.isactive', 1)
|
||||
->where('t_expense.created_on >=',"$fromDate")
|
||||
->where('t_expense.created_on <=',"$toDate")
|
||||
->orderBy('t_expense.created_on', 'DESC')
|
||||
->findAll();
|
||||
->get()->getResult();
|
||||
}
|
||||
|
||||
// Insert new expense
|
||||
|
||||
@ -778,14 +778,16 @@ $currentday = date('d');
|
||||
sundaysArray.forEach(element => {
|
||||
if (+element == dateInt) {
|
||||
sundayValidation = true;
|
||||
var current = value.textContent == '' ? 0 : parseFloat(value.textContent);
|
||||
var text = value.textContent.trim();
|
||||
var current = (text === '' || isNaN(parseFloat(text))) ? 0 : parseFloat(value.textContent);
|
||||
sundayWorkingHr += current;
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
if (sundayValidation == false) {
|
||||
var current = value.textContent == '' ? 0 : parseFloat(value.textContent);
|
||||
var text = value.textContent.trim();
|
||||
var current = (text === '' || isNaN(parseFloat(text))) ? 0 : parseFloat(value.textContent);
|
||||
totalworkingHrs += current;
|
||||
}
|
||||
|
||||
@ -794,8 +796,11 @@ $currentday = date('d');
|
||||
}
|
||||
|
||||
} else {
|
||||
var current = value.textContent == '' ? 0 : parseFloat(value.textContent);
|
||||
|
||||
var text = value.textContent.trim();
|
||||
var current = (text === '' || isNaN(parseFloat(text))) ? 0 : parseFloat(value.textContent);
|
||||
totalOTHrs = totalOTHrs + current;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
35
app/Views/download_multiple_files.php
Normal file
35
app/Views/download_multiple_files.php
Normal file
@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Download Files</title>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
const fileUrls = <?= json_encode($fileUrls); ?>;
|
||||
|
||||
// Function to trigger file downloads
|
||||
function downloadFiles(urls) {
|
||||
urls.forEach((url) => {
|
||||
const link = document.createElement('a');
|
||||
link.href = file.url;
|
||||
link.download = file.name; // Use explicit filename
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
});
|
||||
|
||||
document.body.removeChild(link);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Start downloading files
|
||||
downloadFiles(fileUrls);
|
||||
};
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Your download is starting...</h1>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,16 +1,10 @@
|
||||
<style>
|
||||
.modal {
|
||||
/* padding-right: 25% ! important; */
|
||||
}
|
||||
|
||||
|
||||
.num {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.modal-content {
|
||||
/* width: 800px ! important; */
|
||||
}
|
||||
|
||||
th {
|
||||
white-space: nowrap;
|
||||
}
|
||||
@ -68,19 +62,7 @@
|
||||
float: left;
|
||||
}
|
||||
|
||||
/* .dataTables_wrapper .dt-buttons,
|
||||
.dataTables_wrapper .dataTables_filter {
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.dataTables_wrapper .dt-buttons {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
} */
|
||||
/* .dataTables_wrapper .dataTables_filter {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
} */
|
||||
|
||||
</style>
|
||||
<script>
|
||||
$(function() {
|
||||
@ -209,6 +191,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Create Date</th>
|
||||
<th>Create Time</th>
|
||||
<th>IGR No</th>
|
||||
<th>PO No</th>
|
||||
<th>Supplier Name</th>
|
||||
@ -240,7 +223,8 @@
|
||||
$time = $createddate->format('h:i A');
|
||||
?>
|
||||
<tr id="<?php echo $index ?>" >
|
||||
<td align="right"><?php echo $date; ?></td>
|
||||
<td align="center"><?php echo $date; ?></td>
|
||||
<td align="center"><?php echo $time; ?></td>
|
||||
<td style="cursor:pointer; color:#0bb2b5" ><a data-toggle="modal" data-target="#Igrshow" data-id="<?php echo $index;?>" data-inx="<?php echo $index;?>" data-userid="<?php echo $record->IGRNO ?>" data-igrstatus="<?php echo $record->IGRStatus ?>">
|
||||
<?php echo $record->IGRNO ?></a>
|
||||
</td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user