Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
e21817e222
@ -346,7 +346,8 @@ class StockController extends BaseController
|
||||
'clayOrLossOfIgnition' => $postData['clayOrLossOfIgnition'],
|
||||
'reportComments' => $postData['reportComments'],
|
||||
'gradeRange' => $postData['gradeRange'],
|
||||
'reportTime' => $postData['reportTime']
|
||||
'reportTime' => $postData['reportTime'],
|
||||
'remark' => $postData['remark']
|
||||
|
||||
];
|
||||
|
||||
@ -1244,9 +1245,17 @@ class StockController extends BaseController
|
||||
->where('machine_category','diesel')
|
||||
->findAll();
|
||||
|
||||
$filterUpdateNeeded = true ;
|
||||
|
||||
if( empty($customisedMachineCodes) && !empty($existingCustomMachineCodes)){
|
||||
$customisedMachineCodes = array_column($existingCustomMachineCodes, 'materialCode') ;
|
||||
$filterUpdateNeeded = false ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//check user applies for filter currently
|
||||
if(!empty($customisedMachineCodes)){
|
||||
if(!empty($customisedMachineCodes) && $filterUpdateNeeded){
|
||||
|
||||
//user applied filter,
|
||||
|
||||
@ -1407,11 +1416,62 @@ class StockController extends BaseController
|
||||
$groupedByDate[$date][] = $detail;
|
||||
}
|
||||
|
||||
// Sort each date's machines based on the custom order to set table body td
|
||||
if (!empty($customisedMachineCodes)) {
|
||||
|
||||
foreach ($groupedByDate as $date => &$machines) {
|
||||
|
||||
usort($machines, function ($a, $b) use ($customisedMachineCodes) {
|
||||
|
||||
$indexA = array_search($a['machine_id'], $customisedMachineCodes);
|
||||
$indexB = array_search($b['machine_id'], $customisedMachineCodes);
|
||||
|
||||
if ($indexA === false && $indexB === false) {
|
||||
return 0;
|
||||
}
|
||||
if ($indexA === false) {
|
||||
return 1;
|
||||
}
|
||||
if ($indexB === false) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $indexA - $indexB;
|
||||
});
|
||||
}
|
||||
unset($machines);
|
||||
}
|
||||
|
||||
// Reset the structure to have indexed arrays without the date keys
|
||||
$data['groupedDieselMachineStockDetails'] = array_values($groupedByDate);
|
||||
|
||||
|
||||
|
||||
// Sort each date's machines based on the custom order to set table header th
|
||||
|
||||
if (!empty($customisedMachineCodes)) {
|
||||
|
||||
|
||||
|
||||
usort($dieselMachines, function ($a, $b) use ($customisedMachineCodes) {
|
||||
|
||||
$indexA = array_search($a['id'], $customisedMachineCodes);
|
||||
$indexB = array_search($b['id'], $customisedMachineCodes);
|
||||
|
||||
if ($indexA === false && $indexB === false) {
|
||||
return 0;
|
||||
}
|
||||
if ($indexA === false) {
|
||||
return 1;
|
||||
}
|
||||
if ($indexB === false) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $indexA - $indexB;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$dieselMachinesCount = count($dieselMachines);
|
||||
|
||||
@ -1602,9 +1662,17 @@ class StockController extends BaseController
|
||||
->where('machine_category','electric')
|
||||
->findAll();
|
||||
|
||||
$filterUpdateNeeded = true ;
|
||||
|
||||
if( empty($customisedMachineCodes) && !empty($existingCustomMachineCodes)){
|
||||
$customisedMachineCodes = array_column($existingCustomMachineCodes, 'materialCode') ;
|
||||
$filterUpdateNeeded = false ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//check user applies for filter currently
|
||||
if(!empty($customisedMachineCodes)){
|
||||
if(!empty($customisedMachineCodes) && $filterUpdateNeeded){
|
||||
|
||||
//user applied filter,
|
||||
|
||||
@ -1769,10 +1837,63 @@ class StockController extends BaseController
|
||||
$groupedByDate[$date][] = $detail;
|
||||
}
|
||||
|
||||
|
||||
// Sort each date's machines based on the custom order to set table body td
|
||||
if (!empty($customisedMachineCodes)) {
|
||||
|
||||
foreach ($groupedByDate as $date => &$machines) {
|
||||
|
||||
usort($machines, function ($a, $b) use ($customisedMachineCodes) {
|
||||
|
||||
$indexA = array_search($a['machine_id'], $customisedMachineCodes);
|
||||
$indexB = array_search($b['machine_id'], $customisedMachineCodes);
|
||||
|
||||
if ($indexA === false && $indexB === false) {
|
||||
return 0;
|
||||
}
|
||||
if ($indexA === false) {
|
||||
return 1;
|
||||
}
|
||||
if ($indexB === false) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $indexA - $indexB;
|
||||
});
|
||||
}
|
||||
unset($machines);
|
||||
}
|
||||
|
||||
// Reset the structure to have indexed arrays without the date keys
|
||||
$data['groupedPowerConsumptionStockDetails'] = array_values($groupedByDate);
|
||||
|
||||
|
||||
// Sort each date's machines based on the custom order to set table header th
|
||||
|
||||
if (!empty($customisedMachineCodes)) {
|
||||
|
||||
|
||||
|
||||
usort($electricMachines, function ($a, $b) use ($customisedMachineCodes) {
|
||||
|
||||
$indexA = array_search($a['id'], $customisedMachineCodes);
|
||||
$indexB = array_search($b['id'], $customisedMachineCodes);
|
||||
|
||||
if ($indexA === false && $indexB === false) {
|
||||
return 0;
|
||||
}
|
||||
if ($indexA === false) {
|
||||
return 1;
|
||||
}
|
||||
if ($indexB === false) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $indexA - $indexB;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$electricMachinesCount = count($electricMachines);
|
||||
|
||||
$data['electricMachinesCount'] = $electricMachinesCount;
|
||||
@ -2076,7 +2197,7 @@ class StockController extends BaseController
|
||||
//check user applies for filter currently
|
||||
if(!empty($customisedMaterialCodes) && $filterUpdateNeeded){
|
||||
|
||||
//user applied filter,
|
||||
//user applied new filter,
|
||||
|
||||
//check already filter existing , if exists remove that ,
|
||||
if(!empty($existingCustomMaterialCodes)){
|
||||
@ -2137,7 +2258,7 @@ class StockController extends BaseController
|
||||
//no filter applied at all just present all active material codes
|
||||
$existingCustomMaterialCodes = $this->rawmaterialdetails_model->getAllResinMaterialCode();
|
||||
}else{
|
||||
//if filter present,get that material codes
|
||||
//if filter present , Reuse the filter and get that material codes
|
||||
$existingCustomMaterialCodes = $this->rawmaterialdetails_model
|
||||
->getSelectedResinMaterialCode(array_column($existingCustomMaterialCodes, 'materialCode'));
|
||||
}
|
||||
@ -2441,9 +2562,17 @@ class StockController extends BaseController
|
||||
->where('stock_category','packing_material')
|
||||
->findAll();
|
||||
|
||||
$filterUpdateNeeded = true ;
|
||||
|
||||
if( empty($customisedMaterialCodes) && !empty($existingCustomMaterialCodes)){
|
||||
$customisedMaterialCodes = array_column($existingCustomMaterialCodes, 'materialCode') ;
|
||||
$filterUpdateNeeded = false ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//check user applies for filter currently
|
||||
if(!empty($customisedMaterialCodes)){
|
||||
if(!empty($customisedMaterialCodes) && $filterUpdateNeeded){
|
||||
|
||||
//user applied filter,
|
||||
|
||||
@ -2582,6 +2711,34 @@ class StockController extends BaseController
|
||||
$groupedByDate[$date][] = $detail;
|
||||
}
|
||||
|
||||
// Sort each date's materials based on the custom order to set table body td
|
||||
if (!empty($customisedMaterialCodes)) {
|
||||
|
||||
foreach ($groupedByDate as $date => &$materials) {
|
||||
|
||||
usort($materials, function ($a, $b) use ($customisedMaterialCodes) {
|
||||
|
||||
$indexA = array_search($a['materialCode'], $customisedMaterialCodes);
|
||||
$indexB = array_search($b['materialCode'], $customisedMaterialCodes);
|
||||
|
||||
if ($indexA === false && $indexB === false) {
|
||||
return 0;
|
||||
}
|
||||
if ($indexA === false) {
|
||||
return 1;
|
||||
}
|
||||
if ($indexB === false) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $indexA - $indexB;
|
||||
});
|
||||
}
|
||||
unset($materials);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Reset the structure to have indexed arrays without the date keys
|
||||
$data['groupedBagStockDetails'] = array_values($groupedByDate);
|
||||
|
||||
@ -2600,6 +2757,31 @@ class StockController extends BaseController
|
||||
->first()['customer'] ?? '';
|
||||
}
|
||||
|
||||
|
||||
// Sort each date's materials based on the custom order to set table header th
|
||||
if (!empty($customisedMaterialCodes)) {
|
||||
|
||||
usort($bagMaterials, function ($a, $b) use ($customisedMaterialCodes) {
|
||||
|
||||
$indexA = array_search($a['MaterialCode'], $customisedMaterialCodes);
|
||||
$indexB = array_search($b['MaterialCode'], $customisedMaterialCodes);
|
||||
|
||||
if ($indexA === false && $indexB === false) {
|
||||
return 0;
|
||||
}
|
||||
if ($indexA === false) {
|
||||
return 1;
|
||||
}
|
||||
if ($indexB === false) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return $indexA - $indexB;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
$bagMaterialcount = count($bagMaterials);
|
||||
|
||||
$data['bagMaterialcount'] = $bagMaterialcount;
|
||||
@ -2853,7 +3035,7 @@ class StockController extends BaseController
|
||||
|
||||
$trpAbstract = $this->trpAbstract_model->where('date', $startDate)->findAll();
|
||||
|
||||
// dd( $trpAbstract );
|
||||
|
||||
|
||||
$groupedTrpAbstract = [] ;
|
||||
|
||||
|
||||
@ -1186,7 +1186,7 @@ $('#drierTable tbody').on('click', '.edit-btn', function() {
|
||||
console.log('working here', 'totalHours', totalHours);
|
||||
|
||||
if (totalHours != NaN && totalHours != Infinity) {
|
||||
$('#additionalEntryRunningHrsId').val(totalHours);
|
||||
$('#editEntryRunningHrsId').val(totalHours);
|
||||
editEntryGasPerTon();
|
||||
editEntryMoistureLossQty();
|
||||
editEntryQtyPerHrs();
|
||||
|
||||
@ -598,6 +598,7 @@
|
||||
return 0;
|
||||
}
|
||||
|
||||
//one of the type in empty space character list is 10
|
||||
if (typeof input === 'string' && input.split('').map(char => char.charCodeAt(0))[0] == 10) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -366,7 +366,7 @@
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Moisture loss Qty</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Sieve Loss Qty</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Salable Qty</th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px; min-width : 200px; max-width:200px;">Remark</th>
|
||||
<th class="celda_encabezado_general" style="display:none; ">Remark</th>
|
||||
<th class="celda_encabezado_general" style="display:none;">MaterialCode</th>
|
||||
<th class="celda_encabezado_general" style="display:none">id</th>
|
||||
<th class="celda_encabezado_general" style="display:none">testedBy</th>
|
||||
@ -595,20 +595,19 @@
|
||||
<!-- need to check the status and select values before hand -->
|
||||
|
||||
<!-- 'td:eq(33)' -->
|
||||
<td class="celda_normal" style="color:#02d0eb; background:white; min-width : 200px; max-width:200px;" contenteditable="true">
|
||||
<select class="status sand-status select2" style=" min-width : 180px; max-width:180px;">
|
||||
<option value="noRemark">Select</option>
|
||||
<option value="accepted"
|
||||
<?php echo ($record['remark'] == 'accepted') ? "selected":''; ?>
|
||||
>Accepted</option>
|
||||
<option value="conditionallyAccepted"
|
||||
<?php echo ($record['remark'] == 'conditionallyAccepted') ? "selected":''; ?>
|
||||
>Conditionally Accepted</option>
|
||||
<option value="rejected"
|
||||
<?php echo ($record['remark'] == 'rejected') ? "selected":''; ?>
|
||||
>Rejected</option>
|
||||
</select>
|
||||
|
||||
<td class="celda_normal" style="display:none;" >
|
||||
<select class="status sand-status select2" style=" min-width : 180px; max-width:180px;">
|
||||
<option value="noRemark">Select</option>
|
||||
<option value="accepted"
|
||||
<?php echo ($record['remark'] == 'accepted') ? "selected":''; ?>
|
||||
>Accepted</option>
|
||||
<option value="conditionallyAccepted"
|
||||
<?php echo ($record['remark'] == 'conditionallyAccepted') ? "selected":''; ?>
|
||||
>Conditionally Accepted</option>
|
||||
<option value="rejected"
|
||||
<?php echo ($record['remark'] == 'rejected') ? "selected":''; ?>
|
||||
>Rejected</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(34)' -->
|
||||
@ -1053,7 +1052,9 @@
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<b><small> * This is a system generated </small></b>
|
||||
<b><small> * This is a system generated </small></b>
|
||||
<br>
|
||||
<b><small id="reportNotice"> </small></b>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@ -1091,6 +1092,16 @@
|
||||
<input type="hidden" name="reportTime" id="reportTime" value="">
|
||||
|
||||
<div class="modal-footer">
|
||||
|
||||
<span style="min-width: 150px; max-width: 150px;">
|
||||
<select class="form-control select2" name="remark" id="remarkInFormId" required>
|
||||
<option value="">select</option>
|
||||
<option value="noRemark">No Remark</option>
|
||||
<option value="accepted" >Accepted</option>
|
||||
<option value="conditionallyAccepted" >Conditionally Accepted</option>
|
||||
<option value="rejected" >Rejected</option>
|
||||
</select>
|
||||
</span>
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="button" id="labReportSubmitId" class="btn btn-success" >Save</button>
|
||||
<button type="button" id="pdfGenerateId" class="btn btn-primary">Download</button>
|
||||
@ -1274,11 +1285,11 @@
|
||||
|
||||
|
||||
if(remark == "accepted"){
|
||||
$('#dwnldAcceptedId').text("Ok");
|
||||
$('#dwnldAcceptedId').text("Yes");
|
||||
}else if(remark == "conditionallyAccepted"){
|
||||
$('#dwnldAcceptedUnderDeviationId').text("Ok");
|
||||
$('#dwnldAcceptedUnderDeviationId').text("Yes");
|
||||
}else if(remark == "rejected"){
|
||||
$('#dwnldRejectedId').text("Ok");
|
||||
$('#dwnldRejectedId').text("Yes");
|
||||
}
|
||||
|
||||
|
||||
@ -1314,6 +1325,7 @@
|
||||
$('#reportComments').val(reportComments);
|
||||
$('#gradeRange').val(gradeRange);
|
||||
$('#reportTime').val(reportTime);
|
||||
$('#remarkInFormId').val(remark);
|
||||
|
||||
|
||||
|
||||
@ -1395,14 +1407,10 @@
|
||||
|
||||
|
||||
|
||||
<!-- Save All Data in Incoming Silica Sand Details -->
|
||||
<!-- Save All Data in Incoming Silica Sand Details from table -->
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
|
||||
|
||||
$('#save').click(function() {
|
||||
|
||||
var incomingSilicaSandDetailsData = $("#incomingSilicaSandDetailsTable").tableToJSON();
|
||||
@ -1563,19 +1571,22 @@
|
||||
|
||||
<!-- adding select 2 -->
|
||||
<script>
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
$('#remarkSelectId').select2({
|
||||
placeholder: "Select",
|
||||
data: [
|
||||
{ id: 'accepted', text: 'Accepted' },
|
||||
{ id: 'conditionallyAccepted', text: 'Accepted Under Deviation' },
|
||||
{ id: 'rejected', text: 'Rejected' }
|
||||
]
|
||||
});
|
||||
|
||||
$('.test-or-approve' ).select2({
|
||||
placeholder: "Select",
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
@ -1612,7 +1623,7 @@ $(document).ready(function() {
|
||||
plus30Loss : $('#plus30Loss').val(),
|
||||
sieveLossQty : $('#sieveLossQty').val(),
|
||||
salableQty : $('#salableQty').val(),
|
||||
remark : $('#dwnldAcceptedId').text(),
|
||||
remark : $('#remarkInFormId').val(),
|
||||
gradeCondition : $('#dwnldGradeId').text(),
|
||||
testedBy : $('#testedById').val(),
|
||||
approvedBy : $('#approvedById').val(),
|
||||
@ -1668,9 +1679,8 @@ $(document).ready(function() {
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<!-- excel export option -->
|
||||
<script>
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
function exportTableToExcel(tableID, filename = '') {
|
||||
@ -1731,11 +1741,9 @@ $(document).ready(function() {
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<!-- on enter key press allowing user to go next line instead of submitting any form here -->
|
||||
<script>
|
||||
document.addEventListener("keydown", function (event) {
|
||||
|
||||
@ -1774,6 +1782,7 @@ $(document).ready(function() {
|
||||
|
||||
</script>
|
||||
|
||||
<!-- fixing pasting of xcel values inside the table to prevent table element breakage -->
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("resultTableId td ,#basicDetailsTableId td, #meshTableId td, #incomingSilicaSandDetailsTable td").on("paste", function (e) {
|
||||
@ -1798,4 +1807,29 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<!-- remark onchange -->
|
||||
<script>
|
||||
$('#remarkInFormId').change(function(){
|
||||
|
||||
let remark = $(this).val();
|
||||
|
||||
$('#dwnldAcceptedId').text("");
|
||||
$('#dwnldAcceptedUnderDeviationId').text("");
|
||||
$('#dwnldRejectedId').text("");
|
||||
|
||||
if(remark == "accepted"){
|
||||
$('#dwnldAcceptedId').text("Yes");
|
||||
}else if(remark == "conditionallyAccepted"){
|
||||
$('#dwnldAcceptedUnderDeviationId').text("Yes");
|
||||
}else if(remark == "rejected"){
|
||||
$('#dwnldRejectedId').text("Yes");
|
||||
}
|
||||
|
||||
//without saving current change , cannot download the pdf
|
||||
$('#pdfGenerateId').css('display', 'none');
|
||||
$('#reportNotice').text("* Please save the changes to download");
|
||||
|
||||
})
|
||||
</script>
|
||||
Loading…
Reference in New Issue
Block a user