Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
6a970920fc
@ -116,7 +116,7 @@ class Configurationctrl extends BaseController
|
||||
|
||||
function updateconfig()
|
||||
{
|
||||
// dd($this->request->getPost());
|
||||
|
||||
$ConfigId = $this->request->getPost('ConfigId');
|
||||
$ConfigName = $this->request->getPost('ConfigName');
|
||||
$Comments = $this->request->getPost('Remarks');
|
||||
|
||||
@ -668,6 +668,8 @@ class Emergencypurchaseorder extends BaseController
|
||||
|
||||
$getAvailableqty = $this->mrir_model->getItemQuantityFromStock(trim((string)$MaterialCode));
|
||||
|
||||
$avlQty = 0;
|
||||
|
||||
if (count($getAvailableqty) > 0) {
|
||||
$avlQty = $getAvailableqty[0]['Quantity'];
|
||||
}
|
||||
|
||||
@ -3119,111 +3119,143 @@ class StockController extends BaseController
|
||||
public function updateTrpProductionDetails($inserts = null, $freshEntry = false)
|
||||
{
|
||||
|
||||
|
||||
//getting values from post request
|
||||
$postData['updateTrpProductionDetails'] = json_decode($this->request->getPost('updateTrpProductionDetails'),true);
|
||||
|
||||
|
||||
|
||||
//checking if post data is empty data ?
|
||||
if (empty($postData['updateTrpProductionDetails'])) {
|
||||
|
||||
//if empty data , we still check for inserts data is available or not
|
||||
if (empty($inserts)) {
|
||||
|
||||
//if both fails return "no data found"
|
||||
return $this->response->setJSON(['error' => 'No data found to update']);
|
||||
|
||||
} else {
|
||||
|
||||
//if inserts data is available , then assign to post data
|
||||
$postData['updateTrpProductionDetails'] = $inserts;
|
||||
}
|
||||
}
|
||||
|
||||
$updateTrpProductionDetails = $postData['updateTrpProductionDetails'];
|
||||
|
||||
// Extract all dates from input data
|
||||
// Extract all dates from post data
|
||||
$dates = array_column($updateTrpProductionDetails, 'Date');
|
||||
|
||||
//format from "d-m-Y" to db "Y-m-d" format
|
||||
$formattedDates = array_map(fn($date) => $this->convertToDateWithFlexibleFormats($date, ["d-m-Y", "Y-m-d", "m/d/Y", "m-d-Y"], "Y-m-d"), $dates);
|
||||
|
||||
// Fetch all existing records in a single query per table
|
||||
|
||||
|
||||
// Fetch all existing maintenance , production and waste records for the given formatted dates
|
||||
|
||||
$existingMaintenance = $this->TrpProductionMaintenance_model->whereIn('date', $formattedDates)->findAll();
|
||||
|
||||
$existingProduction = $this->TrpProduction_model->whereIn('date', $formattedDates)->findAll();
|
||||
|
||||
$existingWaste = $this->TrpProductionWaste_model->whereIn('date', $formattedDates)->findAll();
|
||||
|
||||
// Map existing records by date for quick lookup
|
||||
$existingMaintenanceMap = array_column($existingMaintenance, null, 'date');
|
||||
$existingProductionMap = array_column($existingProduction, null, 'date');
|
||||
$existingWasteMap = array_column($existingWaste, null, 'date');
|
||||
|
||||
//getting list of existing dates of maintenance , production and waste records
|
||||
|
||||
$existingMaintenanceDateList = array_column($existingMaintenance, null, 'date');
|
||||
|
||||
$existingProductionDateList = array_column($existingProduction, null, 'date');
|
||||
|
||||
$existingWasteDateList = array_column($existingWaste, null, 'date');
|
||||
|
||||
$insertMaintenance = [];
|
||||
|
||||
$updateMaintenance = [];
|
||||
$insertProduction = [];
|
||||
$updateProduction = [];
|
||||
$insertWaste = [];
|
||||
$updateWaste = [];
|
||||
$updateProduction = [];
|
||||
$updateWaste = [];
|
||||
|
||||
|
||||
$insertMaintenance = [];
|
||||
$insertProduction = [];
|
||||
$insertWaste = [];
|
||||
|
||||
|
||||
foreach ($updateTrpProductionDetails as $data) {
|
||||
|
||||
$date = $this->convertToDateWithFlexibleFormats($data['Date'], ["d-m-Y", "Y-m-d", "m/d/Y", "m-d-Y"], "Y-m-d");
|
||||
|
||||
// Data arrays
|
||||
$dbDataTrpMaintenance = [
|
||||
'date' => $date,
|
||||
'openingTime' => $data['openingTime'],
|
||||
'closingTime' => $data['closingTime'],
|
||||
'totalHours' => $data['totalHours'],
|
||||
'coldStart' => $data['coldStart'],
|
||||
'breakdownHours' => $data['breakdownHours'],
|
||||
'burnerFiringHours' => $data['burnerFiringHours'],
|
||||
'sandFeedingHours' => $data['sandFeedingHours'],
|
||||
'workingPersonEngineers' => $data['workingPersonEngineers'],
|
||||
'workingPersonSupervisiors' => $data['workingPersonSupervisiors'],
|
||||
'workingPersonOperators' => $data['workingPersonOperators'],
|
||||
'rollerDrivers' => $data['rollerDrivers'],
|
||||
'natureOfMaintenance' => $data['natureOfMaintenance'],
|
||||
'location' => $data['location'],
|
||||
'description' => $data['description']
|
||||
'date' => $date,
|
||||
'openingTime' => $data['openingTime'],
|
||||
'closingTime' => $data['closingTime'],
|
||||
'totalHours' => $data['totalHours'],
|
||||
'coldStart' => $data['coldStart'],
|
||||
'breakdownHours' => $data['breakdownHours'],
|
||||
'burnerFiringHours' => $data['burnerFiringHours'],
|
||||
'sandFeedingHours' => $data['sandFeedingHours'],
|
||||
'workingPersonEngineers' => $data['workingPersonEngineers'],
|
||||
'workingPersonSupervisiors' => $data['workingPersonSupervisiors'],
|
||||
'workingPersonOperators' => $data['workingPersonOperators'],
|
||||
'rollerDrivers' => $data['rollerDrivers'],
|
||||
'natureOfMaintenance' => $data['natureOfMaintenance'],
|
||||
'location' => $data['location'],
|
||||
'description' => $data['description']
|
||||
];
|
||||
|
||||
$dbDataTrpProduction = [
|
||||
'date' => $date,
|
||||
'gasReceiptBg' => $data['gasReceiptBg'],
|
||||
'gasReceiptPg' => $data['gasReceiptPg'],
|
||||
'physicalGasConsumption' => $data['physicalGasConsumption'],
|
||||
'trpPlusDrierGasConsumption' => $data['trpPlusDrierGasConsumption'],
|
||||
'trpPhysicalGasPerTon' => $data['trpPhysicalGasPerTon'],
|
||||
'panelGasConsumption' => $data['panelGasConsumption'],
|
||||
'panelGasPerTon' => $data['panelGasPerTon'],
|
||||
'edRunningHours' => $data['edRunningHours'],
|
||||
'edProduction' => $data['edProduction'],
|
||||
'edUsage' => $data['edUsage'],
|
||||
'trpProduction' => $data['trpProduction'],
|
||||
'trpProductionPerHour' => $data['trpProductionPerHour'],
|
||||
'waterReceipt' => $data['waterReceipt'],
|
||||
'waterConsumption' => $data['waterConsumption'],
|
||||
'ebReading' => $data['ebReading'],
|
||||
'ebReadingPerUnitTon' => $data['ebReadingPerUnitTon'],
|
||||
'date' => $date,
|
||||
'gasReceiptBg' => $data['gasReceiptBg'],
|
||||
'gasReceiptPg' => $data['gasReceiptPg'],
|
||||
'physicalGasConsumption' => $data['physicalGasConsumption'],
|
||||
'trpPlusDrierGasConsumption' => $data['trpPlusDrierGasConsumption'],
|
||||
'trpPhysicalGasPerTon' => $data['trpPhysicalGasPerTon'],
|
||||
'panelGasConsumption' => $data['panelGasConsumption'],
|
||||
'panelGasPerTon' => $data['panelGasPerTon'],
|
||||
'edRunningHours' => $data['edRunningHours'],
|
||||
'edProduction' => $data['edProduction'],
|
||||
'edUsage' => $data['edUsage'],
|
||||
'trpProduction' => $data['trpProduction'],
|
||||
'trpProductionPerHour' => $data['trpProductionPerHour'],
|
||||
'waterReceipt' => $data['waterReceipt'],
|
||||
'waterConsumption' => $data['waterConsumption'],
|
||||
'ebReading' => $data['ebReading'],
|
||||
'ebReadingPerUnitTon' => $data['ebReadingPerUnitTon'],
|
||||
];
|
||||
|
||||
$dbDataTrpWaste = [
|
||||
'date' => $date,
|
||||
'msSeperation' => $data['msSeperation'],
|
||||
'edWaste' => $data['edWaste'],
|
||||
'coolerBags' => $data['coolerBags'],
|
||||
'edPlus20Waste' => $data['edPlus20Waste'],
|
||||
'cycloneWaste' => $data['cycloneWaste'],
|
||||
'date' => $date,
|
||||
'msSeperation' => $data['msSeperation'],
|
||||
'edWaste' => $data['edWaste'],
|
||||
'coolerBags' => $data['coolerBags'],
|
||||
'edPlus20Waste' => $data['edPlus20Waste'],
|
||||
'cycloneWaste' => $data['cycloneWaste'],
|
||||
];
|
||||
|
||||
// Check if data already exists
|
||||
if (isset($existingMaintenanceMap[$date])) {
|
||||
$dbDataTrpMaintenance['id'] = $existingMaintenanceMap[$date]['id'];
|
||||
if (isset($existingMaintenanceDateList[$date])) {
|
||||
|
||||
$dbDataTrpMaintenance['id'] = $existingMaintenanceDateList[$date]['id'];
|
||||
$updateMaintenance[] = $dbDataTrpMaintenance;
|
||||
|
||||
} else {
|
||||
|
||||
$insertMaintenance[] = $dbDataTrpMaintenance;
|
||||
|
||||
}
|
||||
|
||||
if (isset($existingProductionMap[$date])) {
|
||||
$dbDataTrpProduction['id'] = $existingProductionMap[$date]['id'];
|
||||
if (isset($existingProductionDateList[$date])) {
|
||||
|
||||
$dbDataTrpProduction['id'] = $existingProductionDateList[$date]['id'];
|
||||
$updateProduction[] = $dbDataTrpProduction;
|
||||
|
||||
} else {
|
||||
$insertProduction[] = $dbDataTrpProduction;
|
||||
}
|
||||
|
||||
if (isset($existingWasteMap[$date])) {
|
||||
$dbDataTrpWaste['id'] = $existingWasteMap[$date]['id'];
|
||||
if (isset($existingWasteDateList[$date])) {
|
||||
|
||||
$dbDataTrpWaste['id'] = $existingWasteDateList[$date]['id'];
|
||||
$updateWaste[] = $dbDataTrpWaste;
|
||||
|
||||
} else {
|
||||
$insertWaste[] = $dbDataTrpWaste;
|
||||
}
|
||||
@ -3233,6 +3265,15 @@ class StockController extends BaseController
|
||||
$this->db->transBegin();
|
||||
|
||||
try {
|
||||
|
||||
// dd($updateMaintenance);
|
||||
// dd($updateProduction);
|
||||
// dd($updateWaste);
|
||||
|
||||
// dd($insertMaintenance);
|
||||
// dd($insertProduction);
|
||||
// dd($insertWaste);
|
||||
|
||||
// Insert new records in batch
|
||||
if (!empty($insertMaintenance)) {
|
||||
$this->TrpProductionMaintenance_model->insertBatch($insertMaintenance);
|
||||
@ -3272,6 +3313,7 @@ class StockController extends BaseController
|
||||
|
||||
|
||||
public function updateAbstractDetails() {
|
||||
|
||||
$updateAbstractDetails = json_decode($this->request->getPost('updateAbstractDetails'), true);
|
||||
|
||||
if (empty($updateAbstractDetails)) {
|
||||
|
||||
@ -7511,8 +7511,8 @@ if (!empty($INRSYMBOL)) {
|
||||
return false;
|
||||
} else {
|
||||
// Submit the form using AJAX
|
||||
$('#loader').show();
|
||||
// disableButtons();
|
||||
|
||||
$('#loader').show();
|
||||
$.ajax({
|
||||
url: "<?php echo base_url() ?>emergencypurchaseorder/addNewRevenuePurchaseOrder",
|
||||
type: "POST",
|
||||
@ -7531,8 +7531,12 @@ if (!empty($INRSYMBOL)) {
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
// Handle errors
|
||||
alert("Error: " + error);
|
||||
alert("Error in ajax route - emergencypurchaseorder/addNewRevenuePurchaseOrder: " + error);
|
||||
// setTimeout(function() { enableButtons(); }, 2000);
|
||||
},
|
||||
complete: function () {
|
||||
console.log("Ajax request completed for route -post - emergencypurchaseorder/addNewRevenuePurchaseOrder .");
|
||||
$('#loader').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -533,7 +533,7 @@ if (!empty($POItem) && $CapitalRange == '1') {
|
||||
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label>Select Supplier</label>
|
||||
<label>Select Supplier</label><span class="text-danger"> * </span>
|
||||
<?php
|
||||
if (!empty($Suplist)) {
|
||||
foreach ($Suplist as $SID):
|
||||
@ -578,7 +578,7 @@ if (!empty($POItem) && $CapitalRange == '1') {
|
||||
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<b><u>Select Delivery By</u></b>
|
||||
<b><u>Select Delivery By</u></b><span class="text-danger"> * </span>
|
||||
<div style="display:inline-flex;">
|
||||
<div class="centered">
|
||||
<div id="dispatchinternational" style="display:none;">
|
||||
@ -594,7 +594,7 @@ if (!empty($POItem) && $CapitalRange == '1') {
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group col-md-3" id="Schedulediv" style="display:none;">
|
||||
<label>Schedule By </label>
|
||||
<label>Schedule By </label><span class="text-danger"> * </span>
|
||||
<input type="hidden" name="beforeSchedule" value="<?php echo $DeliverSchedule; ?>">
|
||||
<?php
|
||||
$data = array('name' => 'Scheduleby', 'value' => set_value('Scheduleby', $DeliverSchedule), 'id' => 'Scheduleby', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40', 'maxlength' => '110');
|
||||
@ -647,7 +647,7 @@ if (!empty($POItem) && $CapitalRange == '1') {
|
||||
target="_blank"><u>(Click here)</u></a>
|
||||
</div>
|
||||
<div class="form-group col-md-3" id="ExchangeRateOnDiv" style="display:none;">
|
||||
<label>Exchange Rate On</label>
|
||||
<label>Exchange Rate On</label><span class="text-danger"> * </span>
|
||||
|
||||
<?php
|
||||
$data = array('type' => 'date', 'name' => 'Exchangerateon', 'value' => set_value('Exchangerateon', $ExchangeRateOn), 'id' => 'Exchangerateon', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
|
||||
@ -656,7 +656,7 @@ if (!empty($POItem) && $CapitalRange == '1') {
|
||||
|
||||
</div>
|
||||
<div class="form-group col-md-3" id="ExchangeRateDiv" style="display:none;">
|
||||
<label id="CurrencySymbol">Exchange Rate </label>
|
||||
<label id="CurrencySymbol">Exchange Rate </label><span class="text-danger"> * </span>
|
||||
|
||||
<?php
|
||||
$data = array('name' => 'ExchangeRt', 'value' => set_value('ExchangeRt', $exchangeRate), 'id' => 'ExchangeRt', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'style' => 'text-align:right');
|
||||
@ -666,7 +666,7 @@ if (!empty($POItem) && $CapitalRange == '1') {
|
||||
|
||||
</div>
|
||||
<div class="form-group col-md-3" id="placeoforgin">
|
||||
<label>Place of Origin</label>
|
||||
<label>Place of Origin</label><span class="text-danger"> * </span>
|
||||
|
||||
<?php
|
||||
// $data = array('name' => 'PlaceOforigin','value' => set_value('PlaceOforigin'),'id'=>'PlaceOforigin', 'class' => 'form-control' ,'required' => 'true', 'onkeypress'=>'return false;');
|
||||
@ -755,7 +755,7 @@ if (!empty($POItem) && $CapitalRange == '1') {
|
||||
</div>
|
||||
<div class="form-group col-md-3"><input type="hidden" name="beforePaymentmethod"
|
||||
id="beforePaymentmethod" value="<?php echo $PaymentTerms; ?>">
|
||||
<label for="payablefrom">Payable Terms</label>
|
||||
<label for="payablefrom">Payable Terms</label><span class="text-danger"> * </span>
|
||||
<?php
|
||||
foreach ($Payment as $rl):
|
||||
|
||||
@ -1648,7 +1648,7 @@ if (!empty($POItem) && $CapitalRange == '1') {
|
||||
<input type="reset" class="btn btn-success" value="Reset">
|
||||
|
||||
</div>
|
||||
</div> -->
|
||||
</div> -->
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label id="lbl_international">Total Order Value <?php echo "($INR)" ?> </label>
|
||||
|
||||
@ -167,7 +167,7 @@ if (!empty($master)) {
|
||||
|
||||
<?php echo $con->ConfigValue ?>
|
||||
</a>
|
||||
</td>
|
||||
</td>
|
||||
<?php }else{ ?>
|
||||
<td><?php echo $con->ConfigValue; ?></td>
|
||||
<?php } ?>
|
||||
@ -394,10 +394,8 @@ if (!empty($master)) {
|
||||
|
||||
<!-- script_sec_starts -->
|
||||
|
||||
<!-- prevent duplicate entries made in the config by checking it during on change event of the config value in add or edit -->
|
||||
<script>
|
||||
|
||||
//prevent duplicate entries made in the config by checking it during on change event of the config value in add or edit
|
||||
|
||||
$('#AddConfigValue,#configValue').on('change', function() {
|
||||
|
||||
let configValue = $(this).val().trim(); //
|
||||
@ -446,6 +444,7 @@ if (!empty($master)) {
|
||||
|
||||
</script>
|
||||
|
||||
<!-- add or update config value -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
@ -553,7 +552,7 @@ if (!empty($master)) {
|
||||
|
||||
|
||||
//this click function is used for showing material codes in modal window , MC created using a particular configuration value
|
||||
$(".config-category").click(function () {
|
||||
$(document).on("click", ".config-category", function () {
|
||||
|
||||
|
||||
|
||||
@ -664,10 +663,7 @@ if (!empty($master)) {
|
||||
//final update button for master config add / update action made in the editConfig page
|
||||
$('#updateConfigBtnId').click(function() {
|
||||
|
||||
alert("final config update..!!");
|
||||
return;
|
||||
|
||||
|
||||
|
||||
|
||||
if($('#ConfigName').val().trim() == ''){
|
||||
alert('Please enter Configuration Name..!!');
|
||||
|
||||
@ -1297,7 +1297,7 @@ if (!empty($getlogpodtl)) {
|
||||
|
||||
</div> <!-- ends box-body -->
|
||||
|
||||
<div class="form-row px-4">
|
||||
<div class="form-row px-1">
|
||||
<label>Select Purchase Order File</label>
|
||||
<div class="form-group col-md-12" align="left">
|
||||
<input type="file" class="" name="POFile" id="POFile">
|
||||
@ -1372,7 +1372,7 @@ if (!empty($getlogpodtl)) {
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-row px-4 ">
|
||||
<div class="form-row px-1 ">
|
||||
<div class="form-group col-md-12" align="left">
|
||||
|
||||
<label>Request On :</label><?php echo $Reqon; ?><br />
|
||||
|
||||
@ -17,6 +17,19 @@
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.grab {
|
||||
cursor: grab; /* Default open-hand cursor */
|
||||
}
|
||||
|
||||
.grab:active {
|
||||
cursor: grabbing; /* Closed-hand cursor when dragging */
|
||||
}
|
||||
|
||||
/* .fht-table td[contenteditable="true"] {
|
||||
background-color: lightyellow;
|
||||
color:rgb(13, 7, 7);
|
||||
} */
|
||||
|
||||
.fht-table td:hover {
|
||||
background-color: #50bbd9;
|
||||
color: #ffffff;
|
||||
@ -151,14 +164,14 @@
|
||||
}
|
||||
|
||||
.celda_encabezado_total {
|
||||
background-color:#ffffff !important;
|
||||
background-color: #ffffff !important;
|
||||
border: 1px solid #ffffff;
|
||||
color: #ffffff !important;
|
||||
font-weight: bold;
|
||||
padding: 6px 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
.celda_normal {
|
||||
/*background-color: #fff;*/
|
||||
/* <!-- ad9271 into ffffff brown-light to green-light --> */
|
||||
@ -219,19 +232,15 @@
|
||||
}
|
||||
|
||||
td {
|
||||
min-width: 150px;
|
||||
max-width: 150px;
|
||||
}
|
||||
|
||||
th {
|
||||
min-width: 150px;
|
||||
max-width: 150px;
|
||||
min-width: 100px;
|
||||
max-width: 100px;
|
||||
}
|
||||
|
||||
tfoot tr {
|
||||
background-color:rgb(235, 236, 203);
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
@ -151,14 +151,6 @@
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.celda_encabezado_total {
|
||||
background-color:#ffffff !important;
|
||||
border: 1px solid #ffffff;
|
||||
color: #ffffff !important;
|
||||
font-weight: bold;
|
||||
padding: 6px 10px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.celda_normal {
|
||||
/*background-color: #fff;*/
|
||||
@ -349,6 +341,7 @@ $timeOtions[] = "12:00 AM";
|
||||
|
||||
|
||||
<div class="table-responsive">
|
||||
|
||||
<table id="trpProductionStockDetailsTableId" class="fht-table table-striped">
|
||||
|
||||
<thead class="celda_encabezado_general" style="padding: 10px;">
|
||||
@ -443,7 +436,7 @@ $timeOtions[] = "12:00 AM";
|
||||
|
||||
<?php foreach($wcsSupplierList as $supplier){ ?>
|
||||
|
||||
<th class="celda_encabezado_general"><?=$supplier?> </th>
|
||||
<th class="celda_encabezado_general" style="min-width:200px !important;" ><?=$supplier?> </th>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
@ -465,7 +458,7 @@ $timeOtions[] = "12:00 AM";
|
||||
|
||||
<?php foreach($crsClientList as $client){ ?>
|
||||
|
||||
<th class="celda_encabezado_general"><?=$client?> </th>
|
||||
<th class="celda_encabezado_general" style="min-width:200px !important;"><?=$client?> </th>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
@ -1277,7 +1270,7 @@ $timeOtions[] = "12:00 AM";
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
<br><br><br>
|
||||
|
||||
|
||||
|
||||
<?php } ?>
|
||||
@ -1303,7 +1296,7 @@ $timeOtions[] = "12:00 AM";
|
||||
|
||||
</div>
|
||||
|
||||
<br><br><br>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
@ -661,6 +661,11 @@
|
||||
<div class="modal-content" style="border: 1px solid #ddd; margin-top: 73px; box-shadow: 0 0 40px rgb(0 0 0 / 43%);">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="gasShortageListLabel" align="center">List of Gas Shortages</h5>
|
||||
|
||||
<button type="button" class="btn btn-primary btn-sm" id="exportGasShortage" style="margin-left: 10px;">
|
||||
Export
|
||||
<i class="fa fa-download" style="color:white;"></i>
|
||||
</button>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
@ -1276,8 +1281,8 @@
|
||||
if(regex.test(item.MaterialCategory) ){
|
||||
$('#gasShortageHeader').show();
|
||||
$('#gasShortageListHeader').show();
|
||||
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageCalculator" title="gas Shortage Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-gas-pump" style="text-align: center;"></i></a> </td>' ;
|
||||
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageList" title="gas Shortage List" ><i class="fa fa-solid fa-list" style="text-align: center;"></i></a> </td>' ;
|
||||
trIGRHTML += '<td style="width: 25px; cursor:pointer;"><a target="_blank" data-toggle="modal" data-target="#gasShortageCalculator" title="gas Shortage Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-gas-pump" style="text-align: center;"></i></a> </td>' ;
|
||||
trIGRHTML += '<td style="width: 25px; cursor:pointer;"><a target="_blank" data-toggle="modal" data-target="#gasShortageList" title="gas Shortage List" ><i class="fa fa-solid fa-list" style="text-align: center;"></i></a> </td>' ;
|
||||
|
||||
trIGRHTML +='</tr>';
|
||||
}else{
|
||||
@ -1329,8 +1334,8 @@
|
||||
if(regex.test(item.MaterialCategory) ){
|
||||
$('#gasShortageHeader').show();
|
||||
$('#gasShortageListHeader').show();
|
||||
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageCalculator" title="gas Shortage Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-gas-pump" style="text-align: center;"></i></a> </td>' ;
|
||||
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageList" title="gas Shortage List" ><i class="fa fa-solid fa-list" style="text-align: center;"></i></a> </td>' ;
|
||||
trIGRHTML += '<td style="width: 25px; cursor:pointer;"><a target="_blank" data-toggle="modal" data-target="#gasShortageCalculator" title="gas Shortage Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-gas-pump" style="text-align: center;"></i></a> </td>' ;
|
||||
trIGRHTML += '<td style="width: 25px; cursor:pointer;"><a target="_blank" data-toggle="modal" data-target="#gasShortageList" title="gas Shortage List" ><i class="fa fa-solid fa-list" style="text-align: center;"></i></a> </td>' ;
|
||||
|
||||
trIGRHTML +='</tr>';
|
||||
}else{
|
||||
@ -1370,13 +1375,13 @@
|
||||
'<input type="file" id="txtWeightFile' + i + '" name="txtWeightFile' + i + '"value="' + item.WeightFile + '">' +
|
||||
'<input type="hidden" id="txtWeightFileName' + i + '" name="txtWeightFileName' + i + '"value="' + item.WeightFile + '">';
|
||||
|
||||
let regex = /gas/i;
|
||||
let regex = /gas/i;
|
||||
|
||||
if(regex.test(item.MaterialCategory) ){
|
||||
$('#gasShortageHeader').show();
|
||||
$('#gasShortageListHeader').show();
|
||||
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageCalculator" title="gas Shortage Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-gas-pump" style="text-align: center;"></i></a> </td>' ;
|
||||
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#gasShortageList" title="gas Shortage List" ><i class="fa fa-solid fa-list" style="text-align: center;"></i></a> </td>' ;
|
||||
trIGRHTML += '<td style="width: 25px; cursor:pointer;"><a target="_blank" data-toggle="modal" data-target="#gasShortageCalculator" title="gas Shortage Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-gas-pump" style="text-align: center;"></i></a> </td>' ;
|
||||
trIGRHTML += '<td style="width: 25px; cursor:pointer;"><a target="_blank" data-toggle="modal" data-target="#gasShortageList" title="gas Shortage List" ><i class="fa fa-solid fa-list" style="text-align: center;"></i></a> </td>' ;
|
||||
|
||||
trIGRHTML +='</tr>';
|
||||
}else{
|
||||
@ -2587,28 +2592,29 @@
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
if (response.status === "success") {
|
||||
|
||||
console.log(response.data);
|
||||
|
||||
let data = response.data ;
|
||||
console.log("gas shortage list");
|
||||
console.log(data);
|
||||
|
||||
let tableData = '';
|
||||
|
||||
data.forEach((val) => {
|
||||
data.forEach((val) => {
|
||||
|
||||
let fullCylinderDate = val.fullCylinderDate.split("-").reverse().join("-");
|
||||
let emptyCylinderDate = val.emptyCylinderDate.split("-").reverse().join('-');
|
||||
|
||||
tableData += `
|
||||
<tr>
|
||||
<td>${val.fullCylinderDate}</td>
|
||||
<td>${val.emptyCylinderDate}</td>
|
||||
<td>${fullCylinderDate}</td>
|
||||
<td>${emptyCylinderDate}</td>
|
||||
<td>${val.invoiceNo}</td>
|
||||
<td>${val.cylinderNo}</td>
|
||||
<td>${val.grossWeight}</td>
|
||||
<td>${val.tareWeight}</td>
|
||||
<td>${val.netWeight}</td>
|
||||
<td>${val.netWeight}</td>
|
||||
<td>${val.actualWeight}</td>
|
||||
<td>${val.shortage}</td>
|
||||
<td style="display:none">${val.id}</td>
|
||||
<td style="width: 25px;">
|
||||
<td style="width: 25px; cursor: pointer;">
|
||||
<i class="fa fa-solid fa-edit btnEditGasShortageCalculator"
|
||||
style="text-align: center;"
|
||||
data-toggle="modal"
|
||||
@ -2802,5 +2808,51 @@ $("#gasShortageCalculator, #editGasShortageCalculator").submit(function (event)
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
function exportTableToExcel(tableID, filename = '') {
|
||||
let table = document.getElementById(tableID);
|
||||
|
||||
let cloneTable = table.cloneNode(true); // Clone the table to modify
|
||||
|
||||
// Remove hidden rows
|
||||
$(cloneTable).find('tr').filter(function () {
|
||||
return $(this).css('display') === 'none';
|
||||
}).remove();
|
||||
|
||||
// Remove hidden columns
|
||||
$(cloneTable).find('th, td').each(function () {
|
||||
if ($(this).css('display') === 'none') {
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
|
||||
let ws = XLSX.utils.table_to_sheet(cloneTable); // Convert modified table to sheet
|
||||
let wb = XLSX.utils.book_new(); // Create a new workbook
|
||||
XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); // Append sheet to workbook
|
||||
XLSX.writeFile(wb, filename || 'export.xlsx'); // Save the file
|
||||
}
|
||||
|
||||
let tableId = 'gasShortageTable';
|
||||
|
||||
document.getElementById('exportGasShortage').addEventListener('click',function(){
|
||||
|
||||
exportTableToExcel(tableId, 'gas_shortage_<?= $date->format('d-m-Y') ?>.xlsx');
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user