CHANGE_TRACKER_ISSUE

This commit is contained in:
aadhavan valli 2024-09-12 08:59:06 +05:30
parent 75e6d7653c
commit dfa592d764
7 changed files with 566 additions and 441 deletions

View File

@ -1,250 +1,252 @@
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css"> <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style> <style>
.dataTables_filter input {padding: 4px;} .dataTables_filter input {
.dataTables_filter { padding: 4px;
width: 50%; }
float: right;
text-align: right;
}
.dataTables_paginate {
width: 50%;
float: right;
text-align: right;
}
div.dt-buttons {
position: relative;
float: right;
} .dataTables_filter {
.btn-success { width: 50%;
background-color: #00d976;; float: right;
border-color: #00d976;; text-align: right;
} }
.dataTables_paginate {
</style> width: 50%;
<div class="content-wrapper"> float: right;
<section class="content"> text-align: right;
<div class="row" style="min-height: 600px;"> }
<!-- Left col -->
<div class="col-md-12"> div.dt-buttons {
<!-- TABLE: LATEST ORDERS --> position: relative;
<div class="box box-info"> float: right;
<div class="box-header with-border">
<center><h3 class="box-title"><p style="color: #00d976;"><b>Report - Month-wise-Inward(<?php echo $mont; ?>)</b></p></h3></center> }
</div>
<!-- /.box-header --> .btn-success {
<div class="box-body"> background-color: #00d976;
<div> ;
<table class="table table-bordered table-hover" id="cc" style="font-size:14px;"> border-color: #00d976;
<thead> ;
<tr> }
<th style="text-align:center">Supplier Name</th> </style>
<th style="text-align:center">Material Name</th> <div class="content-wrapper">
<th style="text-align:center">Quantity</th> <section class="content">
<th style="text-align:center">Total Value &nbsp;(&#8377;)</th> <div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
</tr> <!-- TABLE: LATEST ORDERS -->
</thead> <div class="box box-info">
<tbody> <div class="box-header with-border">
<?php if(!empty($month)){ <center>
$tr3=0; <h3 class="box-title">
$tr4=0; <p style="color: #00d976;"><b>Report - Month-wise-Inward(<?php echo $mont; ?>)</b></p>
$ab = $this->input->get('ab'); </h3>
$last = $this->input->get('dat'); </center>
$new = date("F",strtotime($last))."\n";
foreach($month as $rel)
{
?>
<tr>
<td><span>
<a href="<?= base_url() ?>report/ilink_purchase?sid=<?php echo $rel->sid;?>&mid=<?php echo $rel->mid;?>&ab=<?php echo $ab;?>&m=<?php echo $new;?>"><?php echo $rel->supplier_name;?></a>
</span></td>
<td><span><?php echo $rel->material_name;?></span></td>
<td style="text-align:right"><span><?php
$tr3= $tr3 + round($rel->quantity);
echo round($rel->quantity);?></span></td>
<td style="text-align:right"><span><?php
$tr4= $tr4 + number_format($rel->total,2,'.','');
echo number_format($rel->total,2,'.','');?></span></td>
</tr>
<?php
}
?>
</tbody>
<tfoot width="100%">
<tr>
<td style="text-align:center;">
<strong><?php echo 'Total'; ?></strong>
</td>
<td style="text-align:center;">
<?php echo ''; ?>
</td>
<td style="text-align:right">
<strong>
<?php
{
echo round($tr3);
}
?>
</strong>
</td>
<td style="text-align:right">
<strong>
<?php
{
echo number_format($tr4,2,'.','');
}
?>
</strong>
</td>
</tr>
</tfoot>
<?php
}
?>
</table>
</div>
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
</section>
</div> </div>
<!-- /.box-header -->
<div class="box-body">
<div>
<table class="table table-bordered table-hover" id="cc" style="font-size:14px;">
<thead>
<tr>
<th style="text-align:center">Supplier Name</th>
<th style="text-align:center">Material Name</th>
<th style="text-align:center">Quantity</th>
<th style="text-align:center">Total Value &nbsp;(&#8377;)</th>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script> </tr>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script> </thead>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script> <tbody>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script> <?php if (!empty($month)) {
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script> $tr3 = 0;
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script> $tr4 = 0;
$ab = $this->input->get('ab');
$last = $this->input->get('dat');
$new = date("F", strtotime($last)) . "\n";
foreach ($month as $rel) {
?>
<tr>
<td><span>
<a href="<?= base_url() ?>report/ilink_purchase?sid=<?php echo $rel->sid; ?>&mid=<?php echo $rel->mid; ?>&ab=<?php echo $ab; ?>&m=<?php echo $new; ?>"><?php echo $rel->supplier_name; ?></a>
</span></td>
<td><span><?php echo $rel->material_name; ?></span></td>
<td style="text-align:right"><span><?php
$tr3 = $tr3 + round($rel->quantity);
echo round($rel->quantity); ?></span></td>
<td style="text-align:right"><span><?php
$tr4 = $tr4 + number_format($rel->total, 2, '.', '');
echo number_format($rel->total, 2, '.', ''); ?></span></td>
</tr>
<?php
}
?>
</tbody>
<tfoot width="100%">
<tr>
<td style="text-align:center;">
<strong><?php echo 'Total'; ?></strong>
</td>
<td style="text-align:center;">
<?php echo ''; ?>
</td>
<script> <td style="text-align:right">
<strong>
<?php {
echo round($tr3);
}
?>
</strong>
</td>
<td style="text-align:right">
<strong>
<?php {
echo number_format($tr4, 2, '.', '');
}
?>
</strong>
</td>
// Bootstrap datepicker
// Set up your table
$(document).ready(function() {
table = $('#cc').DataTable( {
"language": {
"emptyTable": "<center> Data Not Found ! </center>"
},
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
"<'row'<'col-md-6'><'col-md-6'>>" +
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
buttons: [
{
extend: 'excelHtml5',
footer: 'true',
//messageTop: $('h3').text(),
title: $('h3').text(),
exportOptions: {
columns: ':visible'
}
},
'colvis'
],
,
"footerCallback": function ( row, data, start, end, display ) {
var api = this.api(), data;
// Remove the formatting to get integer data for summation
var intVal = function ( i ) {
return typeof i === 'string' ?
parseFloat(i.replace(/[^0.00-9.00]+/g,"")*1) :
typeof i === 'number' ?
parseFloat(i) : 0;
};
TotalQTY = api
.column( 2, { search:'applied' } )
.data()
.reduce( function (a, b) {
return intVal(a) + intVal(b);
}, 0 );
$( api.column( 2 ).footer() ).html( TotalQTY.toFixed().bold() ); </tr>
</tfoot>
TotalVALUE = api <?php
.column( 3, { search:'applied' } ) }
.data() ?>
.reduce( function (a, b) { </table>
return intVal(a) + intVal(b);
}, 0 );
$( api.column( 3 ).footer() ).html( TotalVALUE.toFixed(2).bold() );
} </div>
} ); </div>
} ); </div>
$('#mySelect').on('change',function(){ <!-- /.box -->
</div>
table <!-- /.col -->
.column(4) </div>
.search(this.value) </section>
.draw(); </div>
});
$( function() { <script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
<script>
// Bootstrap datepicker
// Set up your table
$(document).ready(function() {
table = $('#cc').DataTable({
"language": {
"emptyTable": "<center> Data Not Found ! </center>"
},
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
"<'row'<'col-md-6'><'col-md-6'>>" +
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
buttons: [
{
extend: 'excelHtml5',
footer: 'true',
//messageTop: $('h3').text(),
title: $('h3').text(),
exportOptions: {
columns: ':visible'
}
},
'colvis'
],
,
"footerCallback": function(row, data, start, end, display) {
var api = this.api(),
data;
// Remove the formatting to get integer data for summation
var intVal = function(i) {
return typeof i === 'string' ?
parseFloat(i.replace(/[^0.00-9.00]+/g, "") * 1) :
typeof i === 'number' ?
parseFloat(i) : 0;
};
TotalQTY = api
.column(2, {
search: 'applied'
})
.data()
.reduce(function(a, b) {
return intVal(a) + intVal(b);
}, 0);
$(api.column(2).footer()).html(TotalQTY.toFixed().bold());
TotalVALUE = api
.column(3, {
search: 'applied'
})
.data()
.reduce(function(a, b) {
return intVal(a) + intVal(b);
}, 0);
$(api.column(3).footer()).html(TotalVALUE.toFixed(2).bold());
}
});
});
$('#mySelect').on('change', function() {
table
.column(4)
.search(this.value)
.draw();
});
$(function() {
//var dateFormat = "mm/dd/yy", //var dateFormat = "mm/dd/yy",
from = $( "#min-date" ) from = $("#min-date")
.datepicker({ .datepicker({
dateFormat: "dd-mm-yy", dateFormat: "dd-mm-yy",
defaultDate: "+0d",
changeMonth: true,
//numberOfMonths: 1
})
.on( "change", function() {
to.datepicker("option", "minDate", getDate( this ) );
}),
to = $( "#max-date" ).datepicker({
dateFormat: "dd-mm-yy",
defaultDate: "+0d", defaultDate: "+0d",
changeMonth: true, changeMonth: true,
//numberOfMonths: 1 //numberOfMonths: 1
}) })
.on( "change", function() { .on("change", function() {
from.datepicker( "option", "maxDate", getDate( this ) ); to.datepicker("option", "minDate", getDate(this));
}),
to = $("#max-date").datepicker({
dateFormat: "dd-mm-yy",
defaultDate: "+0d",
changeMonth: true,
//numberOfMonths: 1
})
.on("change", function() {
from.datepicker("option", "maxDate", getDate(this));
}); });
function getDate( element ) { function getDate(element) {
var date; var date;
try { try {
date = $.datepicker.parseDate( dateFormat, element.value ); date = $.datepicker.parseDate(dateFormat, element.value);
} catch( error ) { } catch (error) {
date = null; date = null;
} }
return date; return date;
} }
} ); });
function Reset() function Reset() {
{ $('#mySelect').val('');
$('#mySelect').val('');
}
</script> }
</script>

View File

@ -830,7 +830,7 @@
onkeypress="return isNumberKey(event)"> onkeypress="return isNumberKey(event)">
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="col-md-3" style="margin-top: 18px;">
<div class="form-group"> <div class="form-group">
<span for="ESI_Rate">ESI Rate(%)</span> <span for="ESI_Rate">ESI Rate(%)</span>
<font color="Red">*</font> <font color="Red">*</font>

View File

@ -55,6 +55,24 @@
<form role="form" id="addemppaydate" action="<?php echo base_url() ?>emppaydate/addNewemppay" method="post" name="addform"> <form role="form" id="addemppaydate" action="<?php echo base_url() ?>emppaydate/addNewemppay" method="post" name="addform">
<div class="box-body"> <div class="box-body">
<!-- Supplier Information --> <!-- Supplier Information -->
<div class="col-md-12" style="margin-bottom: 27px;">
<div class="row">
<div class="col-md-3">
</div>
</div>
</div>
<div class="col-md-12" style="margin-bottom: 27px;">
<div class="row">
<div class="col-md-3">
</div>
</div>
</div>
<div class="col-md-12" style="margin-bottom: 27px;">
<div class="row">
<div class="col-md-3">
</div>
</div>
</div>
<div class="col-md-12" style="margin-bottom: 27px;"> <div class="col-md-12" style="margin-bottom: 27px;">
<div class="row"> <div class="row">
<div class="col-md-3"> <div class="col-md-3">
@ -269,7 +287,7 @@
$('#Loan_Amount').val("0.00"); $('#Loan_Amount').val("0.00");
$('#paid_due').val(0); $('#paid_due').val(0);
$('#Paid_Amount').val("0.00"); $('#Paid_Amount').val("0.00");
} }

View File

@ -10,7 +10,13 @@ if (!empty($EmpCount)) {
} }
?> ?>
<style>
@media (min-width: 991.98px) {
.avatar-title.bg-soft-primary.rounded {
background-color: 'black';
}
}
</style>
<div class="content-wrapper"> <div class="content-wrapper">
<section class="content"> <section class="content">
<!-- Dashboard for Account department--> <!-- Dashboard for Account department-->
@ -630,42 +636,50 @@ if (!empty($EmpCount)) {
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<!-- <section class="content-header"> --> <!-- <section class="content-header"> -->
<!-- <h3>Admin Dashboard</h3> --> <!-- <h3>Admin Dashboard</h3> -->
<div class="row">
<div class="col-12 text-right" style="height: 75px;">
<a href="javascript:void(0)" type="button" title="Sync With Zoho Books" class="btn btn-success" onclick="synczohobooks()">
<i class="fas fa-sync-alt"></i> <!-- <img src="<?php echo base_url(); ?>public/new_assets/images/zoho_sync.png" alt="Sync Icon" style="width: 20px; height: 20px;"> -->
</a>
</div>
</div>
<!-- </section> --> <!-- </section> -->
<!-- Main content --> <!-- Main content -->
<section class="content"> <section class="content">
<br><br>
<br><br>
<div class="row"> <div class="row">
<div class="col-12 text-right" style="height: 75px;">
<div class="col-xl-3 col-md-3"> <a href="javascript:void(0)" type="button" title="Sync With Zoho Books" class="btn btn-success" onclick="synczohobooks()">
<i class="fas fa-sync-alt"></i> <!-- <img src="<?php echo base_url(); ?>public/new_assets/images/zoho_sync.png" alt="Sync Icon" style="width: 20px; height: 20px;"> -->
</a>
</div>
</div>
<div class="row">
<div class="col-xl-3">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<div class="d-flex justify-content-between"> <div class="row">
<div> <div class="col-12">
<h5 class="text-muted font-weight-normal mt-0 text-truncate" title="User Registrations">User Registrations</h5> <div class="d-flex justify-content-between">
<h3 class="my-2 py-1"><span data-plugin="counterup"><?php $users = isset($UserCount[0]->users) ? $UserCount[0]->users : 0; ?> <div>
<h3><?= $users; ?></h3> <h5 class="text-muted font-weight-normal mt-0 text-truncate" title="User Registrations">User Registrations</h5>
</span></h3> <h3 class="my-2 py-1"><span data-plugin="counterup"><?php $users = isset($UserCount[0]->users) ? $UserCount[0]->users : 0; ?>
<p class="mb-0 text-muted"> <h3><?= $users; ?></h3>
<?php $employees = isset($EmpCount[0]->EmpCount) ? $EmpCount[0]->EmpCount : 0; ?> </span></h3>
<?php echo $employees > 1 ? '<small>' . $employees . ' Employees </small>' : ($employees == 1 ? '<small>' . $employees . ' Employee</small>' : ''); ?></span> <p class="mb-0 text-muted">
</p> <?php $employees = isset($EmpCount[0]->EmpCount) ? $EmpCount[0]->EmpCount : 0; ?>
</div> <?php echo $employees > 1 ? '<small>' . $employees . ' Employees </small>' : ($employees == 1 ? '<small>' . $employees . ' Employee</small>' : ''); ?></span>
<div class="avatar-sm"> </p>
<span class="avatar-title bg-soft-primary rounded"> </div>
<a href="<?php echo base_url(); ?>userListing"> <i class="fe-arrow-right" style="color:black;"> <div class="avatar-sm">
</i> <span class="avatar-title bg-soft-primary rounded">
</a> <a href="<?php echo base_url(); ?>userListing"> <i class="fe-arrow-right" style="color:black;">
</i>
</a>
</span> </span>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div><!-- end col --> </div><!-- end col -->

View File

@ -7,6 +7,36 @@ if (empty($Status)) {
?> ?>
<style> <style>
/* Default minimized state */
.supplier-content {
max-width: 150px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
height: 20px;
/* Minimized height */
transition: height 0.3s ease-out;
/* Smooth transition */
}
/* Expanded state with fixed height and scrolling */
.supplier-content.expand {
height: 100px;
/* Fixed height for expanded state */
white-space: normal;
/* Allows wrapping */
overflow-y: auto;
/* Enable vertical scrolling */
transition: height 0.3s ease-in;
/* Smooth transition for height */
}
.table-bordered>thead>tr>th, .table-bordered>thead>tr>th,
.table-bordered>tbody>tr>th, .table-bordered>tbody>tr>th,
.table-bordered>tfoot>tr>th, .table-bordered>tfoot>tr>th,
@ -92,21 +122,21 @@ if (empty($Status)) {
<div class="content-page"> <div class="content-page">
<div class="content"> <div class="content">
<!-- Start Content--> <!-- Start Content-->
<div class="container-fluid"> <div class="container-fluid">
<!-- start page title --> <!-- start page title -->
<div> <div>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="page-title-box page-title-box-alt"> <div class="page-title-box page-title-box-alt">
<h4 class="page-title">Purchase Order Approve List</h4> <h4 class="page-title">Purchase Order Approve List</h4>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;"> <form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;">
<input type="hidden" name="table" value="requisition"> <input type="hidden" name="table" value="requisition">
<label for="fromDate">From:</label> <label for="fromDate">From:</label>
@ -119,9 +149,9 @@ if (empty($Status)) {
<i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i> <i class="fe-rotate-cw range_reset_button" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div class="error" id="error"></div> <div class="error" id="error"></div>
</form> </form>
<div class="card-body"> <div class="card-body">
<table id="po_release" class="table dt-responsive nowrap w-100"> <table id="po_release" class="table dt-responsive nowrap w-100">
<thead> <thead>
<tr> <tr>
<th>PO Date</th> <th>PO Date</th>
<th>Purchase Order Number</th> <th>Purchase Order Number</th>
@ -140,107 +170,110 @@ if (empty($Status)) {
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
if (!empty($AppList)) { if (!empty($AppList)) {
$index = 0; $index = 0;
foreach ($AppList as $record) { foreach ($AppList as $record) {
$index = $index + 1; $index = $index + 1;
//echo $index; //echo $index;
?> ?>
<tr id="<?php echo $index ?>"> <tr id="<?php echo $index ?>">
<td><?php $podt = new DateTime($record->PODate);
<td align="right" style="width:75px"><?php $podt = new DateTime($record->PODate); $PODate = $podt->format('d-m-Y');
$PODate = $podt->format('d-m-Y'); echo $PODate;
echo $PODate; ?></td>
?></td> <td><a target="_blank" href="<?php echo base_url() ?>purchaseorder/CreatePOPrint?PONO=<?php echo $record->PONO ?>&ReqType=<?php echo $record->RType ?>" data-id="<%=index%>" data-userid="<?php echo $record->PONO ?>"><u><?php echo $record->PONO ?> </td>
<td><a target="_blank" href="<?php echo base_url() ?>purchaseorder/CreatePOPrint?PONO=<?php echo $record->PONO ?>&ReqType=<?php echo $record->RType ?>" data-id="<%=index%>" data-userid="<?php echo $record->PONO ?>"><u><?php echo $record->PONO ?> </td> <td><?php echo $record->RType ?> </td>
<td><?php echo $record->RType ?> </td> <td><?php echo $record->CostCenterName ?> </td>
<td><?php echo $record->CostCenterName ?> </td> <!-- <td><?php // echo $record->CostCenterCode
<!-- <td><?php // echo $record->CostCenterCode ?></td> -->
?></td> --> <td class="supplier-name" style="text-wrap: balance;">
<td><?php echo $record->SupplierName ?></td> <div class="supplier-content">
<td><?php echo $record->FirstName ?></td> <?php echo $record->SupplierName ?>
<td><?php echo $record->DepartmentName ?></td> </div>
<!-- <td align="right"><?php // $Cdt = new DateTime($record->CreatedDate); </td>
// $CreatedDate = $Cdt->format('d-m-Y'); <td><?php echo $record->FirstName ?></td>
// echo $CreatedDate; <td><?php echo $record->DepartmentName ?></td>
?></td> --> <!-- <td align="right"><?php // $Cdt = new DateTime($record->CreatedDate);
// $CreatedDate = $Cdt->format('d-m-Y');
// echo $CreatedDate;
?></td> -->
<td align="right"><?php echo $record->TotalOrderValue ?></td> <td><?php echo $record->TotalOrderValue ?></td>
<td><?php echo $record->Approver ?></td> <td><?php echo $record->Approver ?></td>
<td><?php <td><?php
$statusMappings = [ $statusMappings = [
'PO APPROVED' => 'AWAITING APPROVE', 'PO APPROVED' => 'AWAITING APPROVE',
'AWAITING RELEASE' => 'AWAITING APPROVE', 'AWAITING RELEASE' => 'AWAITING APPROVE',
'RELEASER ONHOLD' => 'APPROVER ONHOLD', 'RELEASER ONHOLD' => 'APPROVER ONHOLD',
'PO RELEASED' => 'PO APPROVED', 'PO RELEASED' => 'PO APPROVED',
]; ];
if (isset($record->StatusName) && !empty($record->StatusName)) { if (isset($record->StatusName) && !empty($record->StatusName)) {
if (isset($statusMappings[$record->StatusName])) { if (isset($statusMappings[$record->StatusName])) {
echo $statusMappings[$record->StatusName]; echo $statusMappings[$record->StatusName];
} else { } else {
echo $record->StatusName; echo $record->StatusName;
}
} else {
echo "Status not provided";
}
?></td>
<?php
// if($record->StatusName == 'RELEASER ONHOLD' or $record->StatusName == 'AWAITING RELEASE' or $record->StatusName == 'AMENDMENT PO'){
if ($record->StatusCode == PO_APPROVER_ONHOLD or $record->StatusCode == PO_CREATED or $record->StatusCode == REQITEM_Emergency_PO_CREATED) {
?>
<td>
<select name="selectId" id="selectId" onchange="showvalue('<?php echo $record->PONO ?>','<?php echo $index; ?>',this.options[this.selectedIndex].value,'<?php echo $record->Remarks ?>');">
<option value="-1">Select Action</option>
<!-- <option value="1">Release</option> -->
<option value="1">Approve And Release</option>
<option value="2">OnHold</option>
</select>
</td>
<?php } else {
echo "<td><center>-</center></td>";
} ?>
<td contenteditable="true" id="remarks<?php echo $index; ?>"><?php
if ($record->Remarks == '') {
} else {
echo $record->Remarks;
} ?></td>
</tr>
<?php
} }
} else {
echo "Status not provided";
} }
?>
</tbody>
?></td> </table>
</div> <!-- end card body-->
</div> <!-- end card -->
<?php </div><!-- end col-->
// if($record->StatusName == 'RELEASER ONHOLD' or $record->StatusName == 'AWAITING RELEASE' or $record->StatusName == 'AMENDMENT PO'){ </div>
if ($record->StatusCode == PO_APPROVER_ONHOLD or $record->StatusCode == PO_CREATED or $record->StatusCode == REQITEM_Emergency_PO_CREATED) { </div>
</div> <!-- container -->
?> </div> <!-- content -->
<td>
<select name="selectId" id="selectId" onchange="showvalue('<?php echo $record->PONO ?>','<?php echo $index; ?>',this.options[this.selectedIndex].value,'<?php echo $record->Remarks ?>');">
<option value="-1">Select Action</option>
<!-- <option value="1">Release</option> -->
<option value="1">Approve And Release</option>
<option value="2">OnHold</option>
</select>
</td>
<?php } else {
echo "<td><center>-</center></td>";
} ?>
<td contenteditable="true" id="remarks<?php echo $index; ?>"><?php
if ($record->Remarks == '') {
} else {
echo $record->Remarks;
} ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
</div>
</div> <!-- container -->
</div> <!-- content -->
</div> </div>
<script> <script>
@ -328,7 +361,7 @@ if (empty($Status)) {
function Reset() { function Reset() {
$('#RequisitionStatus').val("-1"); $('#RequisitionStatus').val("-1");
$('#SearchDate').val(''); $('#SearchDate').val('');
} }
// <!--JQuery For POP UP and Getting all relevant Data-- > // <!--JQuery For POP UP and Getting all relevant Data-- >
$("#myModal").on("shown.bs.modal", function(e) { $("#myModal").on("shown.bs.modal", function(e) {
var ReqId = $(e.relatedTarget).data('userid'); var ReqId = $(e.relatedTarget).data('userid');
@ -502,7 +535,7 @@ if (empty($Status)) {
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/plug-ins/1.13.6/sorting/datetime-moment.js"></script> <script src="https://cdn.datatables.net/plug-ins/1.13.6/sorting/datetime-moment.js"></script>
<script> <script>
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) { $.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
var dateSplit = date.split('/'); var dateSplit = date.split('/');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1; return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
@ -511,78 +544,96 @@ if (empty($Status)) {
<script> <script>
$(document).ready(function() { $(document).ready(function() {
// Initialize the DataTable // Initialize the DataTable
var table = $('#po_release').DataTable({ var table = $('#po_release').DataTable({
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
buttons: [ buttons: [
'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons 'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons
], ],
pageLength: 10, // Default rows per page pageLength: 10, // Default rows per page
lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] ], // Rows per page options lengthMenu: [
responsive: true, // Responsive table [10, 20, 30, 50, -1],
order: [], // Default ordering (column index 0, descending) [10, 20, 30, 50, "All"]
language: { ], // Rows per page options
paginate: { responsive: true, // Responsive table
next: '<i class="fas fa-angle-right"></i>', // Next button icon order: [], // Default ordering (column index 0, descending)
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon language: {
} paginate: {
} next: '<i class="fas fa-angle-right"></i>', // Next button icon
}); previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
}
},
autoWidth: true
});
// Date range filter function // Date range filter function
$.fn.dataTable.ext.search.push( $.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) { function(settings, data, dataIndex) {
var fromDate = $('#fromDate').val(); var fromDate = $('#fromDate').val();
var toDate = $('#toDate').val(); var toDate = $('#toDate').val();
if (!fromDate || !toDate) {
return true; // If no dates selected, don't filter
}
var dateStr = data[0]; // Assuming the date is in the first column
var dateParts = dateStr.split("-");
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
var startDate = new Date(fromDate);
var endDate = new Date(toDate);
// Adjust startDate to include the day before the selected fromDate
startDate.setDate(startDate.getDate() - 1);
// Ensure endDate includes the entire end date by setting time to the end of the day
endDate.setHours(23, 59, 59, 999);
// Return true if the date is within the range if (!fromDate || !toDate) {
return date >= startDate && date <= endDate; return true; // If no dates selected, don't filter
} }
);
// Handle form submission for the date range filter var dateStr = data[0]; // Assuming the date is in the first column
$("#DateRangeFilter").submit(function(e) { var dateParts = dateStr.split("-");
e.preventDefault(); var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
table.draw(); // Redraw the table to apply the filter
});
// Reset button functionality var startDate = new Date(fromDate);
$("#resetButton").click(function() { var endDate = new Date(toDate);
$("#fromDate").val('');
$("#toDate").val('');
table.draw(); // Redraw the table to clear the filter
});
// Automatically focus and open the To Date picker when From Date is selected // Adjust startDate to include the day before the selected fromDate
document.getElementById('fromDate').addEventListener('change', function() { startDate.setDate(startDate.getDate() - 1);
var fromDate = this.value;
var toDateInput = document.getElementById('toDate');
// Set the min attribute of the To Date input to the selected From Date
toDateInput.min = fromDate;
// Optionally reset the To Date input if the current value is before the new min date // Ensure endDate includes the entire end date by setting time to the end of the day
if (toDateInput.value < fromDate) { endDate.setHours(23, 59, 59, 999);
toDateInput.value = fromDate;
} // Return true if the date is within the range
}); return date >= startDate && date <= endDate;
}); }
);
// Handle form submission for the date range filter
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw(); // Redraw the table to apply the filter
});
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").val('');
$("#toDate").val('');
table.draw(); // Redraw the table to clear the filter
});
// Automatically focus and open the To Date picker when From Date is selected
document.getElementById('fromDate').addEventListener('change', function() {
var fromDate = this.value;
var toDateInput = document.getElementById('toDate');
// Set the min attribute of the To Date input to the selected From Date
toDateInput.min = fromDate;
// Optionally reset the To Date input if the current value is before the new min date
if (toDateInput.value < fromDate) {
toDateInput.value = fromDate;
}
});
});
$(document).ready(function() {
$('.supplier-content').on('click', function() {
var $this = $(this);
if (!$this.hasClass('expand')) {
// Expand: Set to fixed height with scroll
$this.addClass('expand');
} else {
// Collapse: Reset to minimized height
// $this.css('height', '20px').removeClass('expand');
$this.removeClass('expand');
}
});
});
</script> </script>

View File

@ -3,15 +3,51 @@
<script src="<?php echo base_url() ?>public/assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js"></script> <script src="<?php echo base_url() ?>public/assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js"></script>
<script> <script>
$(function() { $(document).ready(function() {
// Initialize the datepicker with onSelect event
$("#hdate").datepicker({ $("#hdate").datepicker({
minDate: null,
dateFormat: 'dd-mm-yy', dateFormat: 'dd-mm-yy',
changeMonth: true, changeMonth: true,
changeYear: true, changeYear: true,
yearRange: '-100:+0' yearRange: '-100:+0',
});
function isValidDateFormat(date) {
var datePattern = /^\d{2}-\d{2}-\d{4}$/;
var altDatePattern = /^\d{2}\/\d{2}\/\d{4}$/;
return datePattern.test(date) || altDatePattern.test(date);
}
function convertToDDMMYY(date) {
if (date.includes("/")) {
var parts = date.split("/");
return parts[1] + '-' + parts[0] + '-' + parts[2];
}
return date;
}
// Handle manual input change for the date
$("#hdate").on('change', function() {
var selectedDate = $(this).val(); // Get the date entered manually (string)
if (selectedDate) {
if (isValidDateFormat(selectedDate)) {
selectedDate = convertToDDMMYY(selectedDate);
var dateParts = selectedDate.split("-");
var year = dateParts[2];
var yearNumber = parseInt(year, 10);
console.log("Year as a number: " + yearNumber);
$('#page-title-year-selected').html(yearNumber);
} else {
console.log("Invalid date format. Please enter in 'dd-mm-yy' format.");
}
} else {
console.log("No date selected or entered.");
}
}); });
}); });
$('html').bind('keypress', function(e) { $('html').bind('keypress', function(e) {
//alert('Key Pressed'); //alert('Key Pressed');
if (e.keyCode == 13) { if (e.keyCode == 13) {
@ -35,13 +71,15 @@
<div class="row"> <div class="row">
<div class="col-6"> <div class="col-6">
<div class="page-title-box page-title-box-alt"> <div class="page-title-box page-title-box-alt">
<h4 class="page-title"> Public Holiday Information - <?php echo date('Y'); ?></h4> <!-- <h4 class="page-title"> Public Holiday Information- <span id="page-title-year-selected"><?php echo date('Y'); ?></span></h4> -->
<h4 class="page-title"> Public Holiday Information</h4>
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="card"> <div class="card">
<br>
<div class="row" style="padding-left: 26px;"> <div class="row" style="padding-left: 26px;">
<div class="col-md-3"> <div class="col-md-3">
<span>Holiday Name : </span> <span>Holiday Name : </span>
@ -145,6 +183,7 @@
}); });
tr.parentNode.removeChild(tr); tr.parentNode.removeChild(tr);
} }
$('#Add').click(function() { $('#Add').click(function() {
var index = $('#phdays tr').length; var index = $('#phdays tr').length;
var H_name = $('#hname').val(); var H_name = $('#hname').val();
@ -163,11 +202,10 @@
}); });
$('#submit').click(function() { $('#submit').click(function() {
var jsondata = $('#phdays').tableToJSON(); var jsondata = $('#phdays').tableToJSON();
var jsondata = JSON.stringify(jsondata); var jsondata = JSON.stringify(jsondata);
$('#content').loader('show'); // $('#content').loader('show');
$.ajax({ $.ajax({
data: { data: {
param1: jsondata param1: jsondata
@ -176,11 +214,13 @@
url: "<?php echo base_url() ?>monthlypay/savePublicHolidays", url: "<?php echo base_url() ?>monthlypay/savePublicHolidays",
success: function(data) { success: function(data) {
$('#content').loader('hide'); // $('#content').loader('hide');
alert(data); alert(data);
} }
}); });
}); });
// $('#page-title-year-selected')
</script> </script>

View File

@ -1547,7 +1547,7 @@ function appendExistingFilesFileds(data){
<input type="text" id="file_name" name="file_name[]" maxlength="255" class="form-control" value="${data != null && data != '' ? data.file_name : ''}"> <input type="text" id="file_name" name="file_name[]" maxlength="255" class="form-control" value="${data != null && data != '' ? data.file_name : ''}">
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<span for="emp_file">File</span> <label class="col-form-label" for="emp_file">File</label>
<input type="file" id="emp_file" name="emp_file[]" class="form-control"> <input type="file" id="emp_file" name="emp_file[]" class="form-control">
</div> </div>
<div class="form-group col-md-4 p-4"> <div class="form-group col-md-4 p-4">