stock changes 07-04-2025
This commit is contained in:
parent
ba328c5fe7
commit
8c6f13975f
@ -107,6 +107,7 @@ class Configurationctrl extends BaseController
|
|||||||
$data['master'] = $this->configmodel->GetConfigCenterMaster($ConfigID);
|
$data['master'] = $this->configmodel->GetConfigCenterMaster($ConfigID);
|
||||||
|
|
||||||
$data['child'] = $this->configmodel->GetConfigCenterDetails($ConfigID,$isActiveFilter);
|
$data['child'] = $this->configmodel->GetConfigCenterDetails($ConfigID,$isActiveFilter);
|
||||||
|
|
||||||
$data['ConfigID'] = $ConfigID;
|
$data['ConfigID'] = $ConfigID;
|
||||||
|
|
||||||
$this->global['pageTitle'] = 'Edit Config';
|
$this->global['pageTitle'] = 'Edit Config';
|
||||||
@ -252,8 +253,10 @@ class Configurationctrl extends BaseController
|
|||||||
$configId = $data['ConfigID'];
|
$configId = $data['ConfigID'];
|
||||||
$configValue = $data['ConfigValue'];
|
$configValue = $data['ConfigValue'];
|
||||||
$key = $data['key']??'';
|
$key = $data['key']??'';
|
||||||
|
$userId = $data['userId'];
|
||||||
|
|
||||||
$result = $this->configmodel->saveConfigValue($key,$configId, $configValue);
|
|
||||||
|
$result = $this->configmodel->saveConfigValue($key,$configId, $configValue,$userId);
|
||||||
|
|
||||||
if($result){
|
if($result){
|
||||||
return $this->response->setJSON(['status'=>true]);
|
return $this->response->setJSON(['status'=>true]);
|
||||||
|
|||||||
@ -289,7 +289,7 @@ class Rawmaterialdetails extends BaseController
|
|||||||
$data['assetcode'] = $this->rawmaterialdetails_model->getAssetcode();
|
$data['assetcode'] = $this->rawmaterialdetails_model->getAssetcode();
|
||||||
$data['avg_price'] = $this->rawmaterialdetails_model->getMaterialAvg($RawMaterialID);
|
$data['avg_price'] = $this->rawmaterialdetails_model->getMaterialAvg($RawMaterialID);
|
||||||
$data['materialRateHistory'] = $this->rawmaterialdetails_model->getMaterialRateHistory($RawMaterialID);
|
$data['materialRateHistory'] = $this->rawmaterialdetails_model->getMaterialRateHistory($RawMaterialID);
|
||||||
$data['materialListPage'] = $_GET['page'];
|
$data['materialListPage'] = $_GET['page']??1;
|
||||||
|
|
||||||
//print_r($data['avg_price']);die();
|
//print_r($data['avg_price']);die();
|
||||||
$this->global['pageTitle'] = 'Edit Material Master';
|
$this->global['pageTitle'] = 'Edit Material Master';
|
||||||
@ -318,7 +318,7 @@ class Rawmaterialdetails extends BaseController
|
|||||||
$stock = $this->request->getPost('openstock');
|
$stock = $this->request->getPost('openstock');
|
||||||
$reorder = $this->request->getPost('reorder');
|
$reorder = $this->request->getPost('reorder');
|
||||||
$stockdate = $this->request->getPost('Date');
|
$stockdate = $this->request->getPost('Date');
|
||||||
$materialListPage = $this->request->getPost('materialListPage');
|
$materialListPage = $this->request->getPost('materialListPage') ?? 1;
|
||||||
$stockdate = (empty($stockdate)) ? NULL : get_date_time_dynamical_format('d-m-Y','Y-m-d',"$stockdate");
|
$stockdate = (empty($stockdate)) ? NULL : get_date_time_dynamical_format('d-m-Y','Y-m-d',"$stockdate");
|
||||||
|
|
||||||
$chked = $this->request->getPost('isactive');
|
$chked = $this->request->getPost('isactive');
|
||||||
|
|||||||
@ -96,10 +96,24 @@ class Config_model extends Model
|
|||||||
{
|
{
|
||||||
//echo $ConfigID ;die();
|
//echo $ConfigID ;die();
|
||||||
$builder = $this->db->table('t_configmaster COM')
|
$builder = $this->db->table('t_configmaster COM')
|
||||||
->select('*')
|
->select('COM.*,
|
||||||
->join('t_configdetails con', 'con.Config_ID = COM.Config_ID', 'left')
|
con.*,
|
||||||
->where('COM.Config_ID', $ConfigID)
|
creator_emp.FirstName AS created_by,
|
||||||
->where('con.isActive', $isActiveFilter);
|
updater_emp.FirstName AS updated_by
|
||||||
|
')
|
||||||
|
->join('t_configdetails con', 'con.Config_ID = COM.Config_ID', 'left')
|
||||||
|
|
||||||
|
// Join for Created By
|
||||||
|
->join('tbl_users creator', 'creator.userId = con.created_by', 'left')
|
||||||
|
->join('t_employee_details creator_emp', 'creator_emp.EmpID = creator.EmpID', 'left')
|
||||||
|
// Join for Updated By
|
||||||
|
->join('tbl_users updater', 'updater.userId = con.updated_by', 'left')
|
||||||
|
->join('t_employee_details updater_emp', 'updater_emp.EmpID = updater.EmpID', 'left')
|
||||||
|
|
||||||
|
->where('COM.Config_ID', $ConfigID)
|
||||||
|
->where('con.isActive', $isActiveFilter);
|
||||||
|
|
||||||
|
|
||||||
$query = $builder->get();
|
$query = $builder->get();
|
||||||
|
|
||||||
return $query->getResult();
|
return $query->getResult();
|
||||||
@ -288,7 +302,7 @@ return $result;
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function saveConfigValue($key,$configId, $configValue){
|
public function saveConfigValue($key,$configId, $configValue,$userId){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -297,7 +311,8 @@ return $result;
|
|||||||
->where('Config_ID', $configId)
|
->where('Config_ID', $configId)
|
||||||
->where('key',$key)
|
->where('key',$key)
|
||||||
->update([
|
->update([
|
||||||
'ConfigValue'=> $configValue
|
'ConfigValue'=> $configValue,
|
||||||
|
'updated_by' => $userId
|
||||||
]);
|
]);
|
||||||
$res = $this->db->affectedRows();
|
$res = $this->db->affectedRows();
|
||||||
return $res;
|
return $res;
|
||||||
@ -308,6 +323,7 @@ return $result;
|
|||||||
[
|
[
|
||||||
'ConfigValue'=>$configValue,
|
'ConfigValue'=>$configValue,
|
||||||
'Config_ID'=>$configId,
|
'Config_ID'=>$configId,
|
||||||
|
'created_by'=> $userId,
|
||||||
'isActive'=> 1]);
|
'isActive'=> 1]);
|
||||||
$res = $this->db->affectedRows();
|
$res = $this->db->affectedRows();
|
||||||
return $res;
|
return $res;
|
||||||
|
|||||||
@ -256,16 +256,19 @@ $currentday = date('d');
|
|||||||
|
|
||||||
<div class="col-9 text-right d-flex" style="justify-content: end;" id="savebutton">
|
<div class="col-9 text-right d-flex" style="justify-content: end;" id="savebutton">
|
||||||
|
|
||||||
<input type="text" id="searchInput" placeholder="Search..." style="padding: 8px;margin-bottom: 10px;width: 250px;border: 1px solid #ccc;border-radius: 5px;margin-right:15px;">
|
<input type="text" id="searchInput" placeholder="Search..."
|
||||||
|
style="padding: 8px;margin-bottom: 10px;width: 250px;border: 1px solid #ccc;
|
||||||
|
cursor:pointer;
|
||||||
|
border-radius: 5px;margin-right:15px;">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<i id="exportButton" class="fas fa-download download-icon" style="margin-right: 15px;margin-top: 8px;font-size:25px;" title="Export Excel"></i>
|
<i id="exportButton" class="fas fa-download download-icon" style="margin-right: 15px;margin-top: 8px;font-size:25px; cursor:pointer;" title="Export Excel"></i>
|
||||||
|
|
||||||
<i class="fe-maximize noti-icon" onclick="toggleDivFullscreen()" style="margin-right: 15px;margin-top: 5px;font-size: 28px;" title="Full screen view"></i>
|
<i class="fe-maximize noti-icon" onclick="toggleDivFullscreen()" style="margin-right: 15px;margin-top: 5px;font-size: 28px; cursor:pointer;" title="Full screen view"></i>
|
||||||
|
|
||||||
<i class="fas fa-save" id="c" style="margin-right: 15px;margin-top: 5px;font-size:28px;" title="Save"></i>
|
<i class="fas fa-save" id="c" style="margin-right: 15px;margin-top: 5px;font-size:28px; cursor:pointer;" title="Save"></i>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -633,7 +636,6 @@ $currentday = date('d');
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
@ -670,25 +672,12 @@ $(document).ready(function () {
|
|||||||
function exportTableToExcel(tableId, filename = 'attendance.xlsx') {
|
function exportTableToExcel(tableId, filename = 'attendance.xlsx') {
|
||||||
var table = document.getElementById(tableId);
|
var table = document.getElementById(tableId);
|
||||||
var rows = table.rows;
|
var rows = table.rows;
|
||||||
var data = [];
|
|
||||||
|
|
||||||
for (var i = 0; i < rows.length; i++) {
|
|
||||||
var row = rows[i];
|
let ws = XLSX.utils.table_to_sheet(table); // Convert modified table to sheet
|
||||||
var cols = row.querySelectorAll('td, th');
|
let wb = XLSX.utils.book_new(); // Create a new workbook
|
||||||
var rowData = [];
|
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); // Append sheet to workbook
|
||||||
|
XLSX.writeFile(wb, filename || 'export.xlsx'); // Save the file
|
||||||
for (var j = 0; j < cols.length; j++) {
|
|
||||||
rowData.push(cols[j].innerText);
|
|
||||||
}
|
|
||||||
|
|
||||||
data.push(rowData);
|
|
||||||
}
|
|
||||||
|
|
||||||
var wb = XLSX.utils.book_new();
|
|
||||||
var ws = XLSX.utils.aoa_to_sheet(data);
|
|
||||||
|
|
||||||
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
|
|
||||||
XLSX.writeFile(wb, filename);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add click event listener to the export button
|
// Add click event listener to the export button
|
||||||
|
|||||||
@ -146,9 +146,9 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
if (!empty($userRecords)) {
|
if (!empty($userRecords)) {
|
||||||
foreach ($userRecords as $record) {
|
foreach ($userRecords as $record) {
|
||||||
?>
|
?>
|
||||||
<tr
|
<tr
|
||||||
class="<?php if ($record->isActive == 0) {
|
class="<?php if ($record->isActive == 0) {
|
||||||
echo "deactivatedRow";
|
echo "deactivatedRow";
|
||||||
|
|||||||
@ -24,6 +24,8 @@ if (!empty($master)) {
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="content-page">
|
<div class="content-page">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<!-- Start Content-->
|
<!-- Start Content-->
|
||||||
@ -119,6 +121,8 @@ if (!empty($master)) {
|
|||||||
<div>
|
<div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-row" style="margin-top:10px">
|
<div class="form-row" style="margin-top:10px">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
@ -129,6 +133,8 @@ if (!empty($master)) {
|
|||||||
<tr>
|
<tr>
|
||||||
<th>S.NO</th>
|
<th>S.NO</th>
|
||||||
<th>Configuration Value</th>
|
<th>Configuration Value</th>
|
||||||
|
<th>Created By</th>
|
||||||
|
<th>Updated By</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -148,21 +154,31 @@ if (!empty($master)) {
|
|||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<?php echo $index; ?></td>
|
<?php echo $index; ?>
|
||||||
<?php if($con->Config_ID === 'C023'){ ?>
|
</td>
|
||||||
<td>
|
<?php if($con->Config_ID === 'C023'){ ?>
|
||||||
<a
|
<td>
|
||||||
class="config-category"
|
<a
|
||||||
data-value="<?php echo $con->ConfigValue;?>"
|
class="config-category"
|
||||||
data-key="<?php echo $con->Key; ?>"
|
data-value="<?php echo $con->ConfigValue;?>"
|
||||||
style="cursor: pointer;">
|
data-key="<?php echo $con->Key; ?>"
|
||||||
|
style="cursor: pointer;">
|
||||||
|
|
||||||
|
<?php echo $con->ConfigValue ?>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<?php }else{ ?>
|
||||||
|
<td><?php echo $con->ConfigValue; ?></td>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<?php echo $con->created_by ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<?php echo $con->updated_by ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
<?php echo $con->ConfigValue ?>
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
<?php }else{ ?>
|
|
||||||
<td><?php echo $con->ConfigValue; ?></td>
|
|
||||||
<?php } ?>
|
|
||||||
<td>
|
<td>
|
||||||
<?php if ($con->isActive == 0) { ?>
|
<?php if ($con->isActive == 0) { ?>
|
||||||
|
|
||||||
@ -453,7 +469,9 @@ if (!empty($master)) {
|
|||||||
url: "<?php echo base_url('configurationctrl/saveConfigValue'); ?>",
|
url: "<?php echo base_url('configurationctrl/saveConfigValue'); ?>",
|
||||||
data: {
|
data: {
|
||||||
ConfigID: $('#ConfigId').val(),
|
ConfigID: $('#ConfigId').val(),
|
||||||
ConfigValue: $("#AddConfigValue").val()
|
ConfigValue: $("#AddConfigValue").val(),
|
||||||
|
userId : "<?= $_SESSION['userId']?>",
|
||||||
|
|
||||||
},
|
},
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
@ -513,7 +531,8 @@ if (!empty($master)) {
|
|||||||
data: {
|
data: {
|
||||||
key : $('#key').val(),
|
key : $('#key').val(),
|
||||||
ConfigID: $('#Config_ID').val(),
|
ConfigID: $('#Config_ID').val(),
|
||||||
ConfigValue: $("#configValue").val()
|
ConfigValue: $("#configValue").val(),
|
||||||
|
userId : "<?= $_SESSION['userId']?>"
|
||||||
},
|
},
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
@ -594,7 +613,7 @@ if (!empty($master)) {
|
|||||||
<td style="text-align:left; overflow: hidden;text-overflow: ellipsis; word-wrap: break-word !important;
|
<td style="text-align:left; overflow: hidden;text-overflow: ellipsis; word-wrap: break-word !important;
|
||||||
white-space: normal !important; width: 100px !important; ">${item.MaterialName}</td>
|
white-space: normal !important; width: 100px !important; ">${item.MaterialName}</td>
|
||||||
<td style="text-align:left; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">${item.MaterialType}</td>
|
<td style="text-align:left; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">${item.MaterialType}</td>
|
||||||
<td style="text-align:left; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">${item.IsActive?"Active":"InActive"}</td>
|
<td style="text-align:left; overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">${item.IsActive == 1 ?"Active":"InActive"}</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
`;
|
`;
|
||||||
|
|||||||
@ -198,15 +198,17 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-9 text-right d-flex" style="justify-content: end;" id="savebutton">
|
<div class="col-9 text-right d-flex" style="justify-content: end;" id="savebutton">
|
||||||
|
|
||||||
<input type="text" id="searchInput" placeholder="Search..." style="padding: 8px;margin-bottom: 10px;width: 250px;border: 1px solid #ccc;border-radius: 5px;margin-right:15px;">
|
<input type="text" id="searchInput" placeholder="Search..." style="padding: 8px;margin-bottom: 10px;width: 250px;
|
||||||
|
cursor:pointer;
|
||||||
|
border: 1px solid #ccc;border-radius: 5px;margin-right:15px;">
|
||||||
|
|
||||||
<!-- <input type="button" id="submit" value="Save" class="btn btn-success" onclick="getAllData();" style="margin-top:0px;"> -->
|
<!-- <input type="button" id="submit" value="Save" class="btn btn-success" onclick="getAllData();" style="margin-top:0px;"> -->
|
||||||
|
|
||||||
<i id="exportButton" class="fas fa-download download-icon" style="margin-right: 15px;margin-top: 8px;font-size:25px;" title="Export Excel"></i>
|
<i id="exportButton" class="fas fa-download download-icon" style="margin-right: 15px;margin-top: 8px;font-size:25px;cursor:pointer;" title="Export Excel"></i>
|
||||||
|
|
||||||
<i class="fe-maximize noti-icon" onclick="toggleDivFullscreen()" style="margin-right: 15px;margin-top: 5px;font-size: 28px;" title="Full screen view"></i>
|
<i class="fe-maximize noti-icon" onclick="toggleDivFullscreen()" style="margin-right: 15px;margin-top: 5px;font-size: 28px;cursor:pointer;" title="Full screen view"></i>
|
||||||
|
|
||||||
<i class="fas fa-save" onclick="getAllData();" style="margin-right: 15px;margin-top: 5px;font-size:28px;" title="Save"></i>
|
<i class="fas fa-save" onclick="getAllData();" style="margin-right: 15px;margin-top: 5px;font-size:28px;cursor:pointer;" title="Save"></i>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -770,7 +772,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
|
||||||
@ -808,25 +810,11 @@ $(document).ready(function () {
|
|||||||
function exportTableToExcel(tableId, filename = 'monthlypay.xlsx') {
|
function exportTableToExcel(tableId, filename = 'monthlypay.xlsx') {
|
||||||
var table = document.getElementById(tableId);
|
var table = document.getElementById(tableId);
|
||||||
var rows = table.rows;
|
var rows = table.rows;
|
||||||
var data = [];
|
|
||||||
|
let ws = XLSX.utils.table_to_sheet(table); // Convert modified table to sheet
|
||||||
for (var i = 0; i < rows.length; i++) {
|
let wb = XLSX.utils.book_new(); // Create a new workbook
|
||||||
var row = rows[i];
|
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); // Append sheet to workbook
|
||||||
var cols = row.querySelectorAll('td, th');
|
XLSX.writeFile(wb, filename || 'export.xlsx'); // Save the file
|
||||||
var rowData = [];
|
|
||||||
|
|
||||||
for (var j = 0; j < cols.length; j++) {
|
|
||||||
rowData.push(cols[j].innerText);
|
|
||||||
}
|
|
||||||
|
|
||||||
data.push(rowData);
|
|
||||||
}
|
|
||||||
|
|
||||||
var wb = XLSX.utils.book_new();
|
|
||||||
var ws = XLSX.utils.aoa_to_sheet(data);
|
|
||||||
|
|
||||||
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1');
|
|
||||||
XLSX.writeFile(wb, filename);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add click event listener to the export button
|
// Add click event listener to the export button
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user