CHANGE_TRACKER_ISSUE

This commit is contained in:
aadhavan valli 2024-09-12 12:25:06 +05:30
parent d108028a19
commit deb4b84350
10 changed files with 758 additions and 760 deletions

View File

@ -4,6 +4,7 @@
$("#loan_issued_date").datepicker({
minDate: 'now',
orientation: 'bottom',
// maxDate : 'now',
dateFormat: 'dd-mm-yy',
changeMonth: true,
@ -55,24 +56,6 @@
<form role="form" id="addemppaydate" action="<?php echo base_url() ?>emppaydate/addNewemppay" method="post" name="addform">
<div class="box-body">
<!-- 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="row">
<div class="col-md-3">

View File

@ -1,184 +1,185 @@
<?php
//print_r($AppList);
<?php
//print_r($AppList);
?>
<div class="content-wrapper">
<section class="content">
<div class="box">
<div class="box-header">
<center><h3 class="box-title"> Store Requisition Approval List</h3></center>
</div>
<?php
$attributes = array('class' => 'form-label-left Approve ','name' => 'Approve','id' => 'Approve');
echo form_open(base_url().'storerequisitionlist/SearchRequistLists',$attributes); ?>
<div class="container-fluid">
<!-- popup for view store requisition detail -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal -->
<form>
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<center><h4> Store Requisition Details - <span id="StReqno"></span></h4></center>
<section class="content">
<div class="box">
<div class="box-header">
<center>
<h3 class="box-title"> Store Requisition Approval List</h3>
</center>
</div>
<div align="left">
<div class="col-md-12">
<!--<div class="col-md-4">
<?php
$attributes = array('class' => 'form-label-left Approve ', 'name' => 'Approve', 'id' => 'Approve');
echo form_open(base_url() . 'storerequisitionlist/SearchRequistLists', $attributes); ?>
<div class="container-fluid">
<!-- popup for view store requisition detail -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal -->
<form>
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<center>
<h4> Store Requisition Details - <span id="StReqno"></span></h4>
</center>
</div>
<div align="left">
<div class="col-md-12">
<!--<div class="col-md-4">
<label>Requistion Type</label>
<div class="form-group">
<?php
$data = array('name' => 'ReqType','value' => set_value('ReqType'),'id'=>'ReqType', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
$data = array('name' => 'ReqType', 'value' => set_value('ReqType'), 'id' => 'ReqType', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div> -->
<div class="col-md-6">
<label>Requested By</label>
<div class="form-group">
<?php
$data = array('name' => 'Requestedby','value' => set_value('Requestedby'),'id'=>'Requestedby', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-6">
<label>Department Name</label>
<div class="form-group">
<?php
$data = array('name' => 'Desigination','value' => set_value('Desigination'),'id'=>'Desigination', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="col-md-12">
<div class="col-md-6">
<label>Requested Date</label>
<div class="form-group">
<?php
$data = array('name' => 'ReqDate','value' => set_value('ReqDate'),'id'=>'ReqDate', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-6">
<label>Cost Center Name</label>
<div class="form-group">
<?php
$data = array('name' => 'CostCenter','value' => set_value('CostCenter'),'id'=>'CostCenter', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
<div class="col-md-6">
<label>Requested By</label>
<div class="form-group">
<?php
$data = array('name' => 'Requestedby', 'value' => set_value('Requestedby'), 'id' => 'Requestedby', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-6">
<label>Department Name</label>
<div class="form-group">
<?php
$data = array('name' => 'Desigination', 'value' => set_value('Desigination'), 'id' => 'Desigination', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
</div>
<!-- <div class="col-md-4">
<div class="col-md-12">
<div class="col-md-6">
<label>Requested Date</label>
<div class="form-group">
<?php
$data = array('name' => 'ReqDate', 'value' => set_value('ReqDate'), 'id' => 'ReqDate', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="col-md-6">
<label>Cost Center Name</label>
<div class="form-group">
<?php
$data = array('name' => 'CostCenter', 'value' => set_value('CostCenter'), 'id' => 'CostCenter', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<!-- <div class="col-md-4">
<label>Avl Budget Amt</label>&nbsp;<img id="AlertImg" src="<?php echo base_url(); ?>public/assets/dist/img/red.png" alt="your image" width="25px" style="display:none"/>
<div class="form-group">
<?php
$data = array('name' => 'AvlBudgetAmount','value' => set_value('AvlBudgetAmount'),'id'=>'AvlBudgetAmount', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
$data = array('name' => 'AvlBudgetAmount', 'value' => set_value('AvlBudgetAmount'), 'id' => 'AvlBudgetAmount', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div> -->
</div>
</div>
<table id="Items" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<div align="right" style="padding-right:10px">
<div class="modal fade" role="dialog">
<thead>
<tr>
<th>SNo</th>
<th>Item Code</th>
<th>Item Description</th>
<th>UOM</th>
<th>Requested Quantity</th>
<th>Issued Quantity</th>
<th>Status</th>
<th>Remarks</th>
</tr>
</div>
</div>
<table id="Items" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<div align="right" style="padding-right:10px">
<div class="modal fade" role="dialog">
<thead>
<tr>
<th>SNo</th>
<th>Item Code</th>
<th>Item Description</th>
<th>UOM</th>
<th>Requested Quantity</th>
<th>Issued Quantity</th>
<th>Status</th>
<th>Remarks</th>
</tr>
</thead>
<tbody id="tbleAppend">
</tbody>
</div>
</div>
</table>
<div class="modal-footer">
<div class="col-md-12">
<a class="btn btn-info" data-dismiss="modal" value="Cancel">Ok</a>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<table id="Requisition" class="table table-bordered table-hover editabletable" style="background-color:#fff;font-size:12px;">
<div align="right" style="padding-right:10px">
<div id="content"> </div>
<div class="modal fade" role="dialog">
<thead>
<tr>
<th>Store Requisition Number</th>
<th>Requested By</th>
<th>Requested Date</th>
<th>Status</th>
<th>Action</th>
<th>comments</th>
</tr>
</thead>
<tbody id="tbleAppend">
</tbody>
</div>
</div>
</table>
<div class="modal-footer"> <div class="col-md-12">
<a class="btn btn-info" data-dismiss="modal" value="Cancel">Ok</a>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<table id="Requisition" class="table table-bordered table-hover editabletable" style="background-color:#fff;font-size:12px;">
<div align="right" style="padding-right:10px">
<div id="content" > </div>
<div class="modal fade" role="dialog">
<thead>
<tr>
<th>Store Requisition Number</th>
<th>Requested By</th>
<th>Requested Date</th>
<th>Status</th>
<th>Action</th>
<th>comments</th>
</tr>
</thead>
<tbody id="ApprovalList">
<?php
if(!empty($AppList))
{
//print_r($AppList);
$index = 0;
foreach($AppList as $record)
{
$index = $index +1;
?>
<tr id="<?php echo $index ?>" >
<td><a data-toggle="modal" data-target="#myModal" data-id="<%=index%>" data-userid="<?php echo $record->StoreReqNo ?>" ><u><?php echo $record->StoreReqNo ?></u></a></td>
<td><?php echo $record->FirstName?></td>
<td ><?php $Cdt = new DateTime($record->ReqDate);
$ReqDate= $Cdt->format('d-m-Y');
echo $ReqDate;
?></td>
<td><?php echo $record->StatusName ?></td>
<?php if (($record->Status) == STORE_PENDINGAPPROVAL)
{
?>
<!-- <td contenteditable="true"><input type="text" id="Remarks<?php echo $index ?>" name="Remarks<?php echo $index ?>"class="form-control" maxlength="100"></td> -->
<!-- <td data-name="sel" id="Action<?php echo $index ?>" onchange="saveToDatabase(this.options[this.selectedIndex].value,'question','<?php echo $record->StoreReqNo ; ?>','<?php echo $index ; ?>')">
<tbody id="ApprovalList">
<?php
if (!empty($AppList)) {
//print_r($AppList);
$index = 0;
foreach ($AppList as $record) {
$index = $index + 1;
?>
<tr id="<?php echo $index ?>">
<td><a data-toggle="modal" data-target="#myModal" data-id="<%=index%>" data-userid="<?php echo $record->StoreReqNo ?>"><u><?php echo $record->StoreReqNo ?></u></a></td>
<td><?php echo $record->FirstName ?></td>
<td><?php $Cdt = new DateTime($record->ReqDate);
$ReqDate = $Cdt->format('d-m-Y');
echo $ReqDate;
?></td>
<td><?php echo $record->StatusName ?></td>
<?php if (($record->Status) == STORE_PENDINGAPPROVAL) {
?>
<!-- <td contenteditable="true"><input type="text" id="Remarks<?php echo $index ?>" name="Remarks<?php echo $index ?>"class="form-control" maxlength="100"></td> -->
<!-- <td data-name="sel" id="Action<?php echo $index ?>" onchange="saveToDatabase(this.options[this.selectedIndex].value,'question','<?php echo $record->StoreReqNo; ?>','<?php echo $index; ?>')">
<select name="status<?php echo $index ?>" id="status<?php echo $index ?>">
@ -189,218 +190,207 @@
</select>
</td> -->
<td> <select name="selectId" id="selectId" title="Select Your Option" onchange="saveToDatabase('<?php echo $record->StoreReqNo ?>','<?php echo $index ; ?>',this.options[this.selectedIndex].value,'<?php echo $record->Comments ?>');">
<option value="-1" >Select Option</option>
<option value="1">Approve</option>
<option value="2">Reject</option>
</select></td>
<?php
}
else
{
?>
<td><?php echo "---";//$record->Comments ?></td>
<!-- <td><?php echo $record->StatusName ?></td> -->
<?php
}
?>
<td contenteditable="true" id="newcomments<?php echo $index ; ?>" ><?php echo $record->Comments ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<br>
</div>
</div>
</section>
<td> <select name="selectId" id="selectId" title="Select Your Option" onchange="saveToDatabase('<?php echo $record->StoreReqNo ?>','<?php echo $index; ?>',this.options[this.selectedIndex].value,'<?php echo $record->Comments ?>');">
<option value="-1">Select Option</option>
<option value="1">Approve</option>
<option value="2">Reject</option>
</select></td>
<?php
} else {
?>
<td><?php echo "---"; //$record->Comments
?></td>
<!-- <td><?php echo $record->StatusName ?></td> -->
<?php
}
?>
<td contenteditable="true" id="newcomments<?php echo $index; ?>"><?php echo $record->Comments ?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<br>
</div>
</div>
<script>
</section>
</div>
<script>
var startDate = '';
var endDate = '';
function Reset()
{
$('#RequisitionStatus').val("-1");
$('#SearchDate').val('');
}
$("#myModal").on("shown.bs.modal", function(e) {
var ReqId = $(e.relatedTarget).data('userid');
$("#StReqno").html(ReqId);
$('#ReqNO').val(ReqId);
$("#CostCenter").val('');
$("#tbleAppend").empty();
$("#ReqDate").val('');
$("#Desigination").val('');
$('#content').loader('show');
$.ajax({
data:{id:ReqId},
type:"POST",
var endDate = '';
function Reset() {
$('#RequisitionStatus').val("-1");
$('#SearchDate').val('');
}
$("#myModal").on("shown.bs.modal", function(e) {
var ReqId = $(e.relatedTarget).data('userid');
$("#StReqno").html(ReqId);
$('#ReqNO').val(ReqId);
$("#CostCenter").val('');
$("#tbleAppend").empty();
$("#ReqDate").val('');
$("#Desigination").val('');
$('#content').loader('show');
$.ajax({
data: {
id: ReqId
},
type: "POST",
dataType: 'json',
url:"<?php echo base_url() ?>storerequisitionlist/ViewRequest",
success:function(json) {
url: "<?php echo base_url() ?>storerequisitionlist/ViewRequest",
success: function(json) {
//success:function(data) {
$('#content').loader('hide');
//alert(json.Requist);
if(json.Requist != '')
{
//alert(json.Requist[0]['Requestedby']) ;
$("#Requestedby").val(json.Requist[0]['FirstName']);
$("#ReqDate").val(json.Requist[0]['ReqDate']);
$("#Desigination").val(json.Requist[0]['DepartmentName']);
$("#CostCenter").val(json.Requist[0]['CostCenterName']);
$("#tbleAppend").append(json.Items);
if (json.Requist != '') {
//alert(json.Requist[0]['Requestedby']) ;
$("#Requestedby").val(json.Requist[0]['FirstName']);
$("#ReqDate").val(json.Requist[0]['ReqDate']);
$("#Desigination").val(json.Requist[0]['DepartmentName']);
$("#CostCenter").val(json.Requist[0]['CostCenterName']);
$("#tbleAppend").append(json.Items);
}
}
});
});
}
});
});
function saveToDatabase(ReqId,Index,option,com)
{
var newcomments=document.getElementById('newcomments'+Index+'').innerHTML;
var id=ReqId;
var Status= '';
if (option == -1 )
{
alert("Please Select Approve/Reject option");
function saveToDatabase(ReqId, Index, option, com) {
var newcomments = document.getElementById('newcomments' + Index + '').innerHTML;
var id = ReqId;
var Status = '';
if (option == -1) {
alert("Please Select Approve/Reject option");
return false;
}
else if (option == 1 )
{
} else if (option == 1) {
// alert(' The Approval ');
Status='<?php echo STORE_APPROVAL;?>';
var strMsg='Do You want to Approve this requisition?';
}
else
{
Status='<?php echo STORE_REJECT;?>';
var strMsg='Do You want to Reject this requisition?';
Status = '<?php echo STORE_APPROVAL; ?>';
var strMsg = 'Do You want to Approve this requisition?';
} else {
Status = '<?php echo STORE_REJECT; ?>';
var strMsg = 'Do You want to Reject this requisition?';
}
var answer = confirm(strMsg);
if (answer)
{
var answer = confirm(strMsg);
if (answer) {
$('#content').loader('show');
$.ajax({
data:{id:id,newcomments:newcomments},
type:"POST",
url:"<?php echo base_url() ?>storerequisitionlist/ApproveRequest?Status="+Status,
success:function(data) {
if(data)
{
$('#content').loader('hide');
alert(data);
location.reload();
}
else
{
alert("Error");
}
$.ajax({
data: {
id: id,
newcomments: newcomments
},
type: "POST",
url: "<?php echo base_url() ?>storerequisitionlist/ApproveRequest?Status=" + Status,
success: function(data) {
if (data) {
$('#content').loader('hide');
alert(data);
location.reload();
} else {
alert("Error");
}
}
});
} else {
return;
}
});
}
else
{
return;
}
}
$(function() {
var d = new Date();
var month = d.getMonth();
var day = d.getDate();
var year = d.getFullYear() ;
var SIAStartYear = year - 2015;
var mindt = year-70;
var maxdt = year-15;
$( ".datePicker" ).datepicker(
{
minDate : new Date(year-SIAStartYear,1,1),
maxDate :'now',
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,
}
);
//$('#SearchDate').daterangepicker( );
//Initialize Select2 Elements
$(".select2").select2();
//$('#SearchDate').val('');
$('#SearchDate').daterangepicker(
{
locale: {
format: 'DD-MM-YYYY'
},
showDropdowns: true
},
function(start, end, label) {
startDate = start.format('DD-MM-YYYY');
endDate = end.format('DD-MM-YYYY');
$('#FromDate').val(startDate);
$('#ToDate').val(endDate);
//alert("A new date range was chosen: " + start.format('DD-MM-YYYY') + ' to ' + end.format('DD-MM-YYYY'));
});
$(function() {
var d = new Date();
var month = d.getMonth();
var day = d.getDate();
var year = d.getFullYear();
var SIAStartYear = year - 2015;
var mindt = year - 70;
var maxdt = year - 15;
$(".datePicker").datepicker({
minDate: new Date(year - SIAStartYear, 1, 1),
maxDate: 'now',
dateFormat: 'mm/dd/yy',
changeMonth: true,
changeYear: true,
});
//$('#SearchDate').daterangepicker( );
//Initialize Select2 Elements
$(".select2").select2();
//$('#SearchDate').val('');
$('#SearchDate').daterangepicker({
locale: {
format: 'DD-MM-YYYY'
},
showDropdowns: true
},
function(start, end, label) {
startDate = start.format('DD-MM-YYYY');
endDate = end.format('DD-MM-YYYY');
$('#FromDate').val(startDate);
$('#ToDate').val(endDate);
});
$(function () {
$('#Items').DataTable({
"paging": false,
"lengthChange": true,
"searching": false,
"ordering": false,
"info": false,
"autoWidth": false
});
$.fn.dataTable.moment( 'DD-MM-YYYY' );
$('#Requisition').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
// "columnDefs" : [{"targets":2, "type":"date-eu"}],
"aaSorting": [[ 2, "desc" ]],
"info": true,
"autoWidth": true
});
});
</script>
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
//alert("A new date range was chosen: " + start.format('DD-MM-YYYY') + ' to ' + end.format('DD-MM-YYYY'));
});
});
$(function() {
$('#Items').DataTable({
"paging": false,
"lengthChange": true,
"searching": false,
"ordering": false,
"info": false,
"autoWidth": false
});
$.fn.dataTable.moment('DD-MM-YYYY');
$('#Requisition').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
// "columnDefs" : [{"targets":2, "type":"date-eu"}],
"aaSorting": [
[2, "desc"]
],
"info": true,
"autoWidth": true
});
});
</script>
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>

View File

@ -149,14 +149,13 @@
// changeYear: true,
// yearRange: '0:+10'
// });
// $("#Exchangerateon").datepicker({
// //minDate : d,
// maxDate: 'now',
// dateFormat: 'dd-mm-yy',
// changeMonth: true,
// changeYear: true,
// yearRange: '-100:+0'
// });
$("#Exchangerateon").datepicker({
format: 'dd-mm-yyyy',
startDate: new Date(),
autoclose: true,
todayHighlight: true,
clearBtn: true
});
$('#Date').click(function() {
//for Dispatch range selection
@ -395,8 +394,8 @@
<label>Delivery Date<span class="text-danger">*</span></label>
<div>
<?php
$formattedDate = $dt->format('Y-m-d');
$data = array('type' => 'date', 'name' => 'Deliverydate', 'value' => set_value('Deliverydate', $formattedDate), 'id' => 'Deliverydate', 'class' => 'form-control', 'required' => 'true', 'onkeypress' => 'return false;');
$formattedDate = $dt->format('d-m-Y');
$data = array('type' => 'text', 'name' => 'Deliverydate', 'value' => set_value('Deliverydate', $formattedDate), 'id' => 'Deliverydate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
echo form_input($data);
?>
</div>
@ -420,8 +419,8 @@
<label>Exchange Rate On</label>
<div>
<?php
$formattedDate = $dt->format('Y-m-d');
$data = array('type' => 'date', 'name' => 'Exchangerateon', 'value' => set_value('Exchangerateon', $formattedDate), 'id' => 'Exchangerateon', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
$formattedDate = $dt->format('d-m-Y');
$data = array('type' => 'text', 'name' => 'Exchangerateon', 'value' => set_value('Exchangerateon', $formattedDate), 'id' => 'Exchangerateon', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
echo form_input($data);
?>
</div>
@ -454,8 +453,8 @@
<label>Purchase Order Date</label>
<div>
<?php
$formattedDate = $dt->format('Y-m-d');
$data = array('type' => "date", 'name' => 'PODate', 'value' => set_value('PODate', $formattedDate), 'id' => 'PODate', 'class' => 'form-control', 'required' => 'true', 'onkeypress' => 'return false;');
$formattedDate = $dt->format('d-m-Y');
$data = array('type' => "text", 'name' => 'PODate', 'value' => set_value('PODate', $formattedDate), 'id' => 'PODate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
echo form_input($data);
?>
</div>
@ -1479,126 +1478,126 @@
<div class="modal-body p-4">
<div class="form-row" style="padding:0px;">
<div class="form-group col-md-3">
<label>Req No<span class="text-danger">*</span></label>
<div>
<div class="form-group col-md-3">
<label>Req No<span class="text-danger">*</span></label>
<div>
<?php
$RL = array("0" => 'Select Req No');
if (!empty($RequistionDetails)) {
foreach ($RequistionDetails as $SID) :
$RL[$SID->ReqNo] = $SID->ReqNo . ' ' . ' - ' . ' ' . $SID->DepartmentName;
endforeach;
}
<?php
$RL = array("0" => 'Select Req No');
if (!empty($RequistionDetails)) {
foreach ($RequistionDetails as $SID) :
$RL[$SID->ReqNo] = $SID->ReqNo . ' ' . ' - ' . ' ' . $SID->DepartmentName;
endforeach;
}
$data = array('name' => 'EditReqnumber', 'value' => set_value('EditReqnumber'), 'id' => 'EditReqnumber', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
$data = array('name' => 'EditReqnumber', 'value' => set_value('EditReqnumber'), 'id' => 'EditReqnumber', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
?>
</div>
</div>
<div class="form-group col-md-2">
<label>Department Name</label>
<div>
<?php
$data = array('name' => 'EditCapitalDepartmentName', 'value' => set_value('EditCapitalDepartmentName'), 'id' => 'EditCapitalDepartmentName', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-2">
<label>Department Name</label>
<div>
<?php
$data = array('name' => 'EditCapitalDepartmentName', 'value' => set_value('EditCapitalDepartmentName'), 'id' => 'EditCapitalDepartmentName', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-2">
<label>Cost Center Code</label>
<div>
<?php
<div class="form-group col-md-2">
<label>Cost Center Code</label>
<div>
<?php
$data = array('name' => 'EditCostCenter', 'value' => set_value('EditCostCenter'), 'id' => 'EditCostCenter', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
$data = array('name' => 'EditCostCenter', 'value' => set_value('EditCostCenter'), 'id' => 'EditCostCenter', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-3"> <label>Avail Bud Amount</label>
<div> <?php $data = array('name' => 'EditCapitalbudAmt', 'value' => set_value('EditCapitalbudAmt'), 'id' => 'EditCapitalbudAmt', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data); ?> </div>
?>
</div>
</div>
<div class="form-group col-md-3"> <label>Avail Bud Amount</label>
<div> <?php $data = array('name' => 'EditCapitalbudAmt', 'value' => set_value('EditCapitalbudAmt'), 'id' => 'EditCapitalbudAmt', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data); ?> </div>
</div>
<div class="form-group col-md-2" id="hideModalExchangeEdit">
<label> Exchange Rate</label>
<div>
<?php
$data = array('name' => 'EditExchangeRtModal', 'value' => set_value('EditExchangeRtModal'), 'id' => 'EditExchangeRtModal', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
<div class="form-group col-md-2" id="hideModalExchangeEdit">
<label> Exchange Rate</label>
<div>
<?php
$data = array('name' => 'EditExchangeRtModal', 'value' => set_value('EditExchangeRtModal'), 'id' => 'EditExchangeRtModal', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row" style="padding:0px;">
<div class="form-group col-md-2">
<label>Item Code<span class="text-danger">*</span></label>
<div>
<?php
$options = array("0" => 'Item Code');
echo form_dropdown('MaterialCode', $options, set_value('EditMaterialCode'), 'id="EditMaterialCode" class="form-control select2"');
?>
</div>
</div>
<div class="form-group col-md-2" style="padding-right:0px;">
<label>Item Name</label>
<div>
<?php
$data = array('name' => 'EditCapitalItemName', 'value' => set_value('EditCapitalItemName'), 'id' => 'EditCapitalItemName', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-1">
<label>UOM</label>
<div>
<?php
$data = array('name' => 'EditCPUOM', 'value' => set_value('EditCPUOM'), 'id' => 'EditCPUOM', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-2">
<label>Quantity<span class="text-danger">*</span></label>
<div>
<?php
$data = array('name' => 'EditCPQuantity', 'value' => set_value('EditCPQuantity'), 'id' => 'EditCPQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();calculateFreight(4);calculateFreightloceditper()');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-2" style="padding-right: 0px;">
<label id="EditRateIn">Rate (In INR/UOM)</label><span class="text-danger">*</span>
<div>
<?php
$data = array('name' => 'EditCPRate', 'value' => set_value('EditCPRate'), 'id' => 'EditCPRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();calculateFreight(4);calculateFreightloceditper()');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-1">
<label>Per</label> <?php
$data = array('name' => 'EditPer', 'value' => set_value('EditPer'), 'id' => 'EditPer', 'class' => 'form-control');
echo form_input($data); ?>
</div>
<div class="form-group col-md-2">
<label id="EditTotalAmount">Basic value <?php echo "($INR)" ?></label>
<div>
<?php
$data = array('name' => 'EditCPTotalAmount', 'value' => set_value('EditCPTotalAmount'), 'id' => 'EditCPTotalAmount', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-2">
<label>Item Code<span class="text-danger">*</span></label>
<div>
<?php
$options = array("0" => 'Item Code');
echo form_dropdown('MaterialCode', $options, set_value('EditMaterialCode'), 'id="EditMaterialCode" class="form-control select2"');
?>
</div>
</div>
<div class="form-group col-md-2" style="padding-right:0px;">
<label>Item Name</label>
<div>
<?php
$data = array('name' => 'EditCapitalItemName', 'value' => set_value('EditCapitalItemName'), 'id' => 'EditCapitalItemName', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-1">
<label>UOM</label>
<div>
<?php
$data = array('name' => 'EditCPUOM', 'value' => set_value('EditCPUOM'), 'id' => 'EditCPUOM', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-2">
<label>Quantity<span class="text-danger">*</span></label>
<div>
<?php
$data = array('name' => 'EditCPQuantity', 'value' => set_value('EditCPQuantity'), 'id' => 'EditCPQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();calculateFreight(4);calculateFreightloceditper()');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-2" style="padding-right: 0px;">
<label id="EditRateIn">Rate (In INR/UOM)</label><span class="text-danger">*</span>
<div>
<?php
$data = array('name' => 'EditCPRate', 'value' => set_value('EditCPRate'), 'id' => 'EditCPRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();calculateFreight(4);calculateFreightloceditper()');
echo form_input($data);
?>
</div>
</div>
<div class="form-group col-md-1">
<label>Per</label> <?php
$data = array('name' => 'EditPer', 'value' => set_value('EditPer'), 'id' => 'EditPer', 'class' => 'form-control');
echo form_input($data); ?>
</div>
<div class="form-group col-md-2">
<label id="EditTotalAmount">Basic value <?php echo "($INR)" ?></label>
<div>
<?php
$data = array('name' => 'EditCPTotalAmount', 'value' => set_value('EditCPTotalAmount'), 'id' => 'EditCPTotalAmount', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div>
<div class="form-row">
@ -2254,21 +2253,20 @@
$(function() {
// $("#PODate").datepicker({
// minDate: d,
// maxDate: 'now',
// dateFormat: 'dd-mm-yy',
// changeMonth: true,
// changeYear: true,
// yearRange: '-100:+0'
// });
// $("#Deliverydate").datepicker({
// minDate: 'now',
// dateFormat: 'dd-mm-yy',
// changeMonth: true,
// changeYear: true,
// yearRange: '0:+10'
// });
$("#PODate").datepicker({
format: 'dd-mm-yyyy',
startDate: new Date(),
autoclose: true,
todayHighlight: true,
clearBtn: true
});
$("#Deliverydate").datepicker({
format: 'dd-mm-yyyy',
startDate: new Date(),
autoclose: true,
todayHighlight: true,
clearBtn: true
});
var a = parseFloat($('#optcapital').val());
@ -3312,7 +3310,7 @@
</td>
</tr>`;
$('#capitalAppend').append(rowHtml);
$('#capitalAppend').append(rowHtml);
//clearCapitalModalFields();
var theForm = $(".CapitalPO");
@ -4033,149 +4031,150 @@ $('#capitalAppend').append(rowHtml);
}
/* get Edit Capital Po Modal*/
$(document).ready(function() {
$("#EDITCAPITAL").on("shown.bs.modal", function(e) {
$(document).ready(function() {
$("#EDITCAPITAL").on("shown.bs.modal", function(e) {
userid = $(e.relatedTarget).data('userid');
userid = $(e.relatedTarget).data('userid');
$('#isEdit').val(1);
//alert(userid);
var tr = document.getElementById(userid);
$('#isEdit').val(1);
//alert(userid);
var tr = document.getElementById(userid);
var cellval = tr.cells;
var cellval = tr.cells;
var id = $('#Reqnumber' + userid).val();
var id = $('#Reqnumber' + userid).val();
$('#EditReqnumber').val($('#Reqnumber' + userid).val());
$('#EditCapitalDepartmentName').val($('#departmentName' + userid).val());
$("#EditCostCenter").val($('#CPCostCode' + userid).val());
$('#EditCapitalbudAmt').val($('#AvilBudget' + userid).val());
$('#EditExchangeRtModal').val($('#echangeRate' + userid).val());
$('#EditReqnumber').val($('#Reqnumber' + userid).val());
$('#EditCapitalDepartmentName').val($('#departmentName' + userid).val());
$("#EditCostCenter").val($('#CPCostCode' + userid).val());
$('#EditCapitalbudAmt').val($('#AvilBudget' + userid).val());
$('#EditExchangeRtModal').val($('#echangeRate' + userid).val());
$('#EditCapitalItemName').val($('#materialName' + userid).val());
$('#EditCPUOM').val($('#uom' + userid).val());
$('#EditPer').val($('#per' + userid).val());
var EditUOM = $('#uom' + userid).val();
$('#EditCPQuantity').val($('#quantity' + userid).val());
$('#EditCPRate').val($('#rateInUs' + userid).val());
$('#EditCapitalItemName').val($('#materialName' + userid).val());
$('#EditCPUOM').val($('#uom' + userid).val());
$('#EditPer').val($('#per' + userid).val());
var EditUOM = $('#uom' + userid).val();
$('#EditCPQuantity').val($('#quantity' + userid).val());
$('#EditCPRate').val($('#rateInUs' + userid).val());
$('#EditCPTotalAmount').val($('#basicval' + userid).val());
$('#EditCPTotalAmount').val($('#basicval' + userid).val());
RequistQuantity = $('#quantity' + userid).val();
RequistQuantity = $('#quantity' + userid).val();
$('#EditAfterServiceTax').val($('#AfterServiceTax' + userid).val());
$('#EditAfterEduCess').val($('#AfterEduCess' + userid).val());
$('#EditAfterSecHighTax').val($('#AfterSecHighTax' + userid).val());
$('#EditAfterKrishiTax').val($('#AfterKrishiTax' + userid).val());
$('#EditAfterSwachhTax').val($('#AfterSwachhTax' + userid).val());
$('#EditAfterServiceTax').val($('#AfterServiceTax' + userid).val());
$('#EditAfterEduCess').val($('#AfterEduCess' + userid).val());
$('#EditAfterSecHighTax').val($('#AfterSecHighTax' + userid).val());
$('#EditAfterKrishiTax').val($('#AfterKrishiTax' + userid).val());
$('#EditAfterSwachhTax').val($('#AfterSwachhTax' + userid).val());
$('#EditAfterBasicPriceTax').val($('#basicvalInINR' + userid).val());
$('#EditAfterLandingCharge').val($('#landingCharge' + userid).val());
$('#EditAfterBasicPriceTax').val($('#basicvalInINR' + userid).val());
$('#EditAfterLandingCharge').val($('#landingCharge' + userid).val());
$('#EditAfterCustomduty').val($('#CustomDuty' + userid).val());
$('#EditAfterCustomduty').val($('#CustomDuty' + userid).val());
$('#EditAfterCustomEDcess').val($('#CustomEDCess' + userid).val());
$('#EditAfterCustomSHcess').val($('#CustomSHCess' + userid).val());
$('#EditAfterCustomEDcess').val($('#CustomEDCess' + userid).val());
$('#EditAfterCustomSHcess').val($('#CustomSHCess' + userid).val());
$('#EditGrossdutypayable').val($('#GrossDutyPayable' + userid).val());
$('#EditCustomDutyExpenses').val($('#CustomDutyExpenses' + userid).val());
//$('#txtEditInsurance').val($('#RMCIncludingCustomers'+userid).val());
$('#EditGrossdutypayable').val($('#GrossDutyPayable' + userid).val());
$('#EditCustomDutyExpenses').val($('#CustomDutyExpenses' + userid).val());
//$('#txtEditInsurance').val($('#RMCIncludingCustomers'+userid).val());
$('#EdittxtTotalOrderValue').val(cellval[9].innerHTML);
$('#EditCgst').val($('#Cgst' + userid).val());
$('#EditAfterCgst').val($('#AfterCgst' + userid).val());
$('#EditSgst').val($('#Sgst' + userid).val());
$('#EditAfterSgst').val($('#AfterSgst' + userid).val());
$('#EditIgst').val($('#Igst' + userid).val());
$('#EditAfterIgst').val($('#AfterIgst' + userid).val());
$('#EditOtherAllowances').val($('#OtherAmt' + userid).val());
/* get % value */
$('#EdittxtTotalOrderValue').val(cellval[9].innerHTML);
$('#EditCgst').val($('#Cgst' + userid).val());
$('#EditAfterCgst').val($('#AfterCgst' + userid).val());
$('#EditSgst').val($('#Sgst' + userid).val());
$('#EditAfterSgst').val($('#AfterSgst' + userid).val());
$('#EditIgst').val($('#Igst' + userid).val());
$('#EditAfterIgst').val($('#AfterIgst' + userid).val());
$('#EditOtherAllowances').val($('#OtherAmt' + userid).val());
/* get % value */
$('#EditLandingCharge').val($('#beforeLanding' + userid).val());
$('#EditLandingCharge').val($('#beforeLanding' + userid).val());
$('#EditCustomduty').val($('#beforeCustomDuty' + userid).val());
$('#EditCustomduty').val($('#beforeCustomDuty' + userid).val());
$('#EditCustomEDcess').val($('#beforeCustomEDCess' + userid).val());
$('#EditCustomSHcess').val($('#beforeCustomSHCess' + userid).val());
$('#EditCustomEDcess').val($('#beforeCustomEDCess' + userid).val());
$('#EditCustomSHcess').val($('#beforeCustomSHCess' + userid).val());
$('#EditPurQuantity').val($('#PurQuantity' + userid).val());
$('#txtEditFreight').val($('#FreightVal' + userid).val());
$('#txtEditAfterFreight').val($('#AfterFreightVal' + userid).val());
$('#EditNOOfTrips').val($('#NoOfTrip' + userid).val());
$("#drpEditFreight").val($('#FreightType' + userid).val());
$('#EditPurQuantity').val($('#PurQuantity' + userid).val());
$('#txtEditFreight').val($('#FreightVal' + userid).val());
$('#txtEditAfterFreight').val($('#AfterFreightVal' + userid).val());
$('#EditNOOfTrips').val($('#NoOfTrip' + userid).val());
$("#drpEditFreight").val($('#FreightType' + userid).val());
$("#drpFreighteditloc").val($('#FreightTypeloc' + userid).val());
$("#NOOfTripslocedit").val($('#NoofTriploc' + userid).val());
$("#txtFreightlocedit").val($('#FreightRateloc' + userid).val());
$("#txtAfterFreightlocedit").val($('#AfterFreightRateloc' + userid).val());
$("#drpFreighteditloc").val($('#FreightTypeloc' + userid).val());
$("#NOOfTripslocedit").val($('#NoofTriploc' + userid).val());
$("#txtFreightlocedit").val($('#FreightRateloc' + userid).val());
$("#txtAfterFreightlocedit").val($('#AfterFreightRateloc' + userid).val());
$('#EditAfterAssessable').val($("#AfterAssessable" + userid).val());
$('#EditSubtotal').val($("#Subtotal" + userid).val());
$('#EditIgstInt').val($("#IgstInt" + userid).val());
$('#EditAfterIgstInt').val($("#AfterIgstInt" + userid).val());
$('#EditDutyImpact').val($("#Dutyimpact" + userid).val());
$('#EditClearingCharges').val($("#ClearingCharges" + userid).val());
$('#EditNett').val($("#Nett" + userid).val());
$('#EditAfterAssessable').val($("#AfterAssessable" + userid).val());
$('#EditSubtotal').val($("#Subtotal" + userid).val());
$('#EditIgstInt').val($("#IgstInt" + userid).val());
$('#EditAfterIgstInt').val($("#AfterIgstInt" + userid).val());
$('#EditDutyImpact').val($("#Dutyimpact" + userid).val());
$('#EditClearingCharges').val($("#ClearingCharges" + userid).val());
$('#EditNett').val($("#Nett" + userid).val());
var a = parseFloat($('#EditDutyImpact').val());
//var b =parseFloat($('#Dutyimpact'+userid).val());
var a = parseFloat($('#EditDutyImpact').val());
//var b =parseFloat($('#Dutyimpact'+userid).val());
// console.log(a);
//console.log(b);
// console.log(a);
//console.log(b);
var FreightTypeloc = $('#FreightTypeloc' + userid).val();
var FreightTypeloc = $('#FreightTypeloc' + userid).val();
if (FreightTypeloc == '<?php echo PERTRIP; ?>') {
$('#TripsValuelocedit').show();
} else {
$('#TripsValuelocedit').hide();
}
if (FreightTypeloc == '<?php echo PERTRIP; ?>') {
$('#TripsValuelocedit').show();
} else {
$('#TripsValuelocedit').hide();
}
var FreightType = $('#FreightType' + userid).val();
var FreightType = $('#FreightType' + userid).val();
if (FreightType == "PER TRIP") {
$('#EditTripsValue').show();
} else {
$('#EditTripsValue').hide();
}
$("#EditDiscountType").val($('#DisType' + userid).val());
$('#txtEditDiscount').val($('#DisVal' + userid).val());
$('#txtEditAfterDiscount').val($('#AfterDisVal' + userid).val());
if (FreightType == "PER TRIP") {
$('#EditTripsValue').show();
} else {
$('#EditTripsValue').hide();
}
$("#EditDiscountType").val($('#DisType' + userid).val());
$('#txtEditDiscount').val($('#DisVal' + userid).val());
$('#txtEditAfterDiscount').val($('#AfterDisVal' + userid).val());
tinyMCE.get('EditItemDescription').setContent($('#CapitalItemDescrition' + userid).val());
tinyMCE.get('EditItemDescription').setContent($('#CapitalItemDescrition' + userid).val());
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
$("#EditMaterialCode").empty();
$("#EditMaterialCode").empty();
$("#EditMaterialCode").append($('<option></option>').val($('#materialCode' + userid).val()).html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val()));
$('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + EditUOM + ')');
for (i = 0; i < Material.length; i++) {
$.each(Material[i], function(idx, obj) {
if (obj.MaterialCode != $('#materialCode' + userid).val()) {
$("#EditMaterialCode").append($('<option></option>').val(obj.MaterialCode).html(obj.MaterialCode + "-" + obj.MaterialName));
$("#EditMaterialCode").append($('<option></option>').val($('#materialCode' + userid).val()).html($('#materialCode' + userid).val() + "-" + $('#materialName' + userid).val()));
$('#EditRateIn').html('Rate(in' + " " + DisplayCurrencySymbol + '/' + EditUOM + ')');
for (i = 0; i < Material.length; i++) {
$.each(Material[i], function(idx, obj) {
if (obj.MaterialCode != $('#materialCode' + userid).val()) {
$("#EditMaterialCode").append($('<option></option>').val(obj.MaterialCode).html(obj.MaterialCode + "-" + obj.MaterialName));
}
});
}
}
});
}
}); });
});
});
/*get edit material list*/
$('#EditMaterialCode').change(function() {

View File

@ -11,6 +11,7 @@ if (!empty($EmpCount)) {
?>
<style>
@media (min-width: 991.98px) {
.avatar-title.bg-soft-primary.rounded {
background-color: 'black';
@ -640,10 +641,8 @@ if (!empty($EmpCount)) {
<!-- </section> -->
<!-- Main content -->
<section class="content">
<br><br>
<br><br>
<div class="row">
<div class="col-12 text-right" style="height: 75px;">
<div class="col-12 text-right synczohobooks_button" 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>

View File

@ -202,7 +202,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
return false;
} else if ($('#Importoption').val() == "0") {
alert('Please Select POType');
alert('Please Select Import Type');
$('#Importoption').focus();
return false;
@ -4196,7 +4196,7 @@ $('#ImportAppend').append(rowHtml);
} else if ($('#Importoption').val() == "0") {
alert('Please Select POType');
alert('Please Select Import Type');
$('#Importoption').focus();
return false;

View File

@ -111,6 +111,14 @@
}
});
}
// $("#hdate").datepicker({
// format: 'dd-mm-yyyy', // Correct format for Bootstrap Datepicker
// startDate: new Date(), // Replace `d` with `new Date()` if `d` is not defined
// autoclose: true,
// todayHighlight: true,
// clearBtn: true
// });
</script>
</body>

View File

@ -120,6 +120,12 @@
margin-top: 55px;
}
}
@media (max-width: 992px) {
.synczohobooks_button {
margin-top: 55px;
}
}
.topnav .navbar-nav .nav-link {
line-height: 15px;

View File

@ -1,61 +1,3 @@
<script src="<?php echo base_url() ?>public/assets/lightswitch/lightswitch/lib/jquery.tabletojson.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.13.6/underscore-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>
$(document).ready(function() {
// Initialize the datepicker with onSelect event
$("#hdate").datepicker({
minDate: null,
dateFormat: 'dd-mm-yy',
changeMonth: true,
changeYear: true,
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) {
//alert('Key Pressed');
if (e.keyCode == 13) {
return false;
}
});
</script>
<style type="text/css">
.num {
text-align: right;
@ -79,7 +21,6 @@
<div class="row">
<div class="col-12">
<div class="card">
<br>
<div class="row" style="padding-left: 26px;">
<div class="col-md-3">
<span>Holiday Name : </span>
@ -223,4 +164,61 @@
});
// $('#page-title-year-selected')
</script>
<script src="<?php echo base_url() ?>public/assets/lightswitch/lightswitch/lib/jquery.tabletojson.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.13.6/underscore-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>
$(document).ready(function() {
$("#hdate").datepicker({
format: 'dd-mm-yyyy', // Correct format for Bootstrap Datepicker
startDate: new Date(), // Replace `d` with `new Date()` if `d` is not defined
autoclose: true,
todayHighlight: true,
clearBtn: true
});
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) {
//alert('Key Pressed');
if (e.keyCode == 13) {
return false;
}
});
</script>

View File

@ -135,7 +135,7 @@ if (!empty($INRSYMBOL)) {
$('#Deliverydate').focus();
return false;
} else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select POType');
alert('Please Select Revenue Type');
$('#PoTypeOptions').focus();
return false;
} else if ($('#BudgetType').val() == "0") {
@ -1868,7 +1868,7 @@ if (!empty($INRSYMBOL)) {
</div>
<div class="form-group col-md-3" id="Deliverydtdiv">
<label>Delivery Date<span class="badge mandatory">*</span></label>
<input class="form-control num" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="Deliverydt" name="Deliverydt" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off" value="<?= date('d/m/Y'); ?>">
<input class="form-control num" data-provide="datepicker" data-date-format="dd-mm-yyyy" data-date-autoclose="true" id="Deliverydt" name="Deliverydt" data-date-start-date="<?= date('d-m-Y'); ?>" required autocomplete="off" value="<?= date('d-m-Y'); ?>">
<!-- <div>
<?php
@ -1898,7 +1898,7 @@ if (!empty($INRSYMBOL)) {
<div class="form-row">
<div class="form-group col-md-3">
<label>Purchase Order Date</label>
<input class="form-control num" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="PODate" name="PODate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off" value="<?= date('d/m/Y'); ?>">
<input class="form-control num" data-provide="datepicker" data-date-format="dd-mm-yyyy" data-date-autoclose="true" id="PODate" name="PODate" data-date-start-date="<?= date('d-m-Y'); ?>" required autocomplete="off" value="<?= date('d-m-Y'); ?>">
<!-- <div>
<?php
@ -3768,7 +3768,7 @@ $('#RevenueAppend').append(rowHtml);
$('#insurance').focus();
return false;
} else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select POType');
alert('Please Select Revenue Type');
$('#PoTypeOptions').focus();
return false;

View File

@ -116,51 +116,51 @@ if (!empty($INRSYMBOL)) {
document.getElementById("Date").checked = true;
$('#drpSupplier').change(function() {
var id = $('#drpSupplier').val();
console.log(id);
$("#SupAddress").val('');
var PaymentID = '';
if (id != '0') {
var suppliers = <?php echo json_encode($Suplist, JSON_PRETTY_PRINT); ?>;
var payments = <?php echo json_encode($Payment, JSON_PRETTY_PRINT); ?>;
// Find the selected supplier and set address and PaymentID
$.each(suppliers, function(idx, supplier) {
if (supplier.SupplierID === id) {
PaymentID = supplier.PaymentID; // Set PaymentID
if (supplier.MSME) {
$("#SupAddress").val("MSME : " + supplier.MSME + "\n" + supplier.Address);
} else {
$("#SupAddress").val(supplier.Address);
}
console.log(PaymentID); // Debugging PaymentID value
}
});
var id = $('#drpSupplier').val();
console.log(id);
// Conditional logic for PaymentID
if (PaymentID === 'PT08') {
$('#otheroptiondiv').show();
$('#Otherpayment').val('');
} else {
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
$("#SupAddress").val('');
var PaymentID = '';
// Populate Payment Terms
$('#PaymentTerms').empty();
$.each(payments, function(pay, payobj) {
$("#PaymentTerms").append($('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
});
if (id != '0') {
var suppliers = <?php echo json_encode($Suplist, JSON_PRETTY_PRINT); ?>;
var payments = <?php echo json_encode($Payment, JSON_PRETTY_PRINT); ?>;
} else {
alert('Please select a Supplier.');
return false;
}
});
// Find the selected supplier and set address and PaymentID
$.each(suppliers, function(idx, supplier) {
if (supplier.SupplierID === id) {
PaymentID = supplier.PaymentID; // Set PaymentID
if (supplier.MSME) {
$("#SupAddress").val("MSME : " + supplier.MSME + "\n" + supplier.Address);
} else {
$("#SupAddress").val(supplier.Address);
}
console.log(PaymentID); // Debugging PaymentID value
}
});
// Conditional logic for PaymentID
if (PaymentID === 'PT08') {
$('#otheroptiondiv').show();
$('#Otherpayment').val('');
} else {
$('#otheroptiondiv').hide();
$('#Otherpayment').val('');
}
// Populate Payment Terms
$('#PaymentTerms').empty();
$.each(payments, function(pay, payobj) {
$("#PaymentTerms").append($('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
});
} else {
alert('Please select a Supplier.');
return false;
}
});
$('#ReqNo').change(function() {
@ -536,7 +536,16 @@ if (!empty($INRSYMBOL)) {
}
$(document).ready(function() {
$("#Deliverydt").datepicker({
format: 'dd-mm-yyyy',
startDate: new Date(),
clearBtn: true
});
$("#PODate").datepicker({
format: 'dd-mm-yyyy',
startDate: new Date(),
clearBtn: true
});
$("#PaymentTerms").select2();
$('#Date').click(function() {
@ -634,18 +643,18 @@ if (!empty($INRSYMBOL)) {
<label>Select Supplier<span class="text-danger">*</span></label>
<?php
$options = array("0" => 'Select Supplier');
if (!empty($Suplist)) {
foreach ($Suplist as $SID) :
$options[$SID->SupplierID] = $SID->SupplierID . ' - ' . $SID->SupplierName;
endforeach;
}
$options = array("0" => 'Select Supplier');
echo form_dropdown('drpSupplier', $options, set_value('drpSupplier'), 'id="drpSupplier" required="true" class="form-control select2"');
?>
if (!empty($Suplist)) {
foreach ($Suplist as $SID) :
$options[$SID->SupplierID] = $SID->SupplierID . ' - ' . $SID->SupplierName;
endforeach;
}
echo form_dropdown('drpSupplier', $options, set_value('drpSupplier'), 'id="drpSupplier" required="true" class="form-control select2"');
?>
</div> <!-- 1.3. col-md-3 div closed here -->
@ -689,7 +698,8 @@ echo form_dropdown('drpSupplier', $options, set_value('drpSupplier'), 'id="drpSu
</div>
<div class="form-group col-md-3" id="Deliverydtdiv"> <!-- // $CurrentDate -->
<label>Delivery Date<span class="text-danger">*</span></label>
<input type="date" class="form-control num" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="Deliverydt" name="Deliverydt" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off" value="<?= date('d/m/Y'); ?>">
<!-- <input type="text" class="form-control num" data-provide="" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="Deliverydt" name="Deliverydt" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off" value="<?= date('d/m/Y'); ?>"> -->
<input type="text" class="form-control num" data-provide="" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="Deliverydt" name="Deliverydt" required autocomplete="off" value="<?= date('d-m-Y'); ?>">
</div>
<div class="form-group col-md-3" id="Schedulediv" style="display:none;">
<label>Schedule By<span class="text-danger">*</span></label>
@ -713,7 +723,7 @@ echo form_dropdown('drpSupplier', $options, set_value('drpSupplier'), 'id="drpSu
<div class="form-row">
<div class="form-group col-md-3">
<label>Purchase Order Date</label>
<input type="date" class="form-control num" data-provide="datepicker" data-date-format="dd/mm/yyyy" data-date-autoclose="true" id="PODate" name="PODate" data-date-end-date="<?= date('d/m/Y'); ?>" required autocomplete="off" value="<?= date('d/m/Y'); ?>">
<input type="text" class="form-control num" data-date-format="dd-mm-yyyy" data-date-autoclose="true" id="PODate" name="PODate" required autocomplete="off" value="<?= date('d-m-Y'); ?>">
</div>
<div class="form-group col-md-3">
<label>Mode Of Shipment</label>
@ -803,23 +813,23 @@ echo form_dropdown('drpSupplier', $options, set_value('drpSupplier'), 'id="drpSu
<div class="form-row">
<div class="form-group col-md-3">
<label>Insurance Options<span class="text-danger">*</span></label>
<?php
$optionsInsurance = array(); // Initialize the options array
if (!empty($insuranceStatus)) {
foreach ($insuranceStatus as $INS) {
$optionsInsurance[$INS['value']] = $INS['name'];
}
}
echo form_dropdown('insuranceStatus', $optionsInsurance, set_value('insuranceStatus'), 'id="insuranceStatus" required="true" class="form-control select2"');
?>
<?php
$optionsInsurance = array(); // Initialize the options array
if (!empty($insuranceStatus)) {
foreach ($insuranceStatus as $INS) {
$optionsInsurance[$INS['value']] = $INS['name'];
}
}
echo form_dropdown('insuranceStatus', $optionsInsurance, set_value('insuranceStatus'), 'id="insuranceStatus" required="true" class="form-control select2"');
?>
</div>
<div class="form-group col-md-3" id="insuranceTxtDiv" style="display:block;">
<label>Insurance No / Insurance Details<span class="text-danger">*</span></label>
@ -923,9 +933,9 @@ echo form_dropdown('insuranceStatus', $optionsInsurance, set_value('insuranceSta
</div><!-- col-md-2 div closed here -->
</div><!-- 8 form-row div closed here -->
<div class="form-row">
<div class="form-group col-md-12">
<label>Description Of Service<span class="text-danger">*</label>
<div class="form-group col-md-12">
<label>Description Of Service<span class="text-danger">*</label>
<?php
$data = array('name' => 'descofpo', 'value' => set_value('descofpo'), 'id' => 'descofpo', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
echo form_textarea($data);
@ -1237,14 +1247,14 @@ echo form_dropdown('insuranceStatus', $optionsInsurance, set_value('insuranceSta
<div class="form-row">
<div class="form-group col-md-12">
<label>Service Description </label>
<div class="form-group col-md-12">
<label>Service Description </label>
<?php
$data = array('name' => 'txtSpcialInstruction', 'value' => set_value('txtSpcialInstruction'), 'id' => 'txtSpcialInstruction', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
echo form_textarea($data); ?>
</div>
<?php
$data = array('name' => 'txtSpcialInstruction', 'value' => set_value('txtSpcialInstruction'), 'id' => 'txtSpcialInstruction', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
echo form_textarea($data); ?>
</div>
</div><!-- SERVICE -->
</div>
@ -1504,13 +1514,13 @@ echo form_dropdown('insuranceStatus', $optionsInsurance, set_value('insuranceSta
</div>
</div>
</div><!-- EDITSERVICE.8 form-row closed here -->
<div class="form-row">
<div class="form-group col-md-12">
<label>Service Description </label>
<?php
$data = array('name' => 'EdittxtSpcialInstruction', 'value' => set_value('EdittxtSpcialInstruction'), 'id' => 'EdittxtSpcialInstruction', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
echo form_textarea($data); ?>
<div class="form-group col-md-12">
<label>Service Description </label>
<?php
$data = array('name' => 'EdittxtSpcialInstruction', 'value' => set_value('EdittxtSpcialInstruction'), 'id' => 'EdittxtSpcialInstruction', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
echo form_textarea($data); ?>
</div>
</div><!-- EDITSERVICE.9 form-row closed here -->
@ -1766,8 +1776,8 @@ echo form_dropdown('insuranceStatus', $optionsInsurance, set_value('insuranceSta
</tr>
`;
// Append the generated HTML to your table body
$('#ServiceAppend').append(rowHtml);
// Append the generated HTML to your table body
$('#ServiceAppend').append(rowHtml);
@ -2173,12 +2183,17 @@ $('#ServiceAppend').append(rowHtml);
// this function is used to clear data changing schedule option
$('#Scheduleby').change(function() {
// $("#Deliverydt").datepicker({
// minDate: 'now',
// dateFormat: 'mm/dd/yy',
// });
$("#Deliverydt").datepicker({
minDate: 'now',
dateFormat: 'mm/dd/yy',
format: 'dd-mm-yyyy',
startDate: new Date(),
yearRange: '0:+10',
changeMonth: true,
changeYear: true,
yearRange: '0:+10'
clearBtn: true
});
});