509 lines
27 KiB
PHP
509 lines
27 KiB
PHP
<style>
|
||
td .select2-container{
|
||
width: 249px !important;
|
||
}
|
||
.fe-plus-circle:hover {
|
||
color: #ff0000; /* Change to the desired hover color */
|
||
}
|
||
</style>
|
||
<div class="row">
|
||
<div class="col-lg-12">
|
||
<div class="card">
|
||
<div class="card-body">
|
||
<div class="row">
|
||
<div class="col-lg-6"><h4 class="header-title"><?= $page_name; ?></h4></div>
|
||
|
||
</div>
|
||
<br>
|
||
<form method="POST" enctype="multipart/form-data" action="<?= base_url() . "save_invoice"; ?>" class="main-form" id="myForm">
|
||
<div class="form-group">
|
||
<div class="form-row">
|
||
|
||
<div class="form-group col-md-6">
|
||
<label for="customerMobile" class="col-form-label">Donor Mobile<span class="text-danger"> *</span></label>
|
||
<?php if(get_user_role() != 'accounts') { ?>
|
||
<i type="button" class="fe-plus-circle" id="add-quk-donar" style="font-size: 24px;" data-toggle="modal" data-target="#standard-modal" title="Add Donor"></i>
|
||
<?php } ?>
|
||
<select class="form-control" id="donor_mobile" name="donor_mobile" required data-toggle="select2">
|
||
<option value="">--Select--</option>
|
||
<?php foreach ($customers as $customer) : ?>
|
||
<option value="<?= $customer->mobile_no ?>" <?php if (isset($receipt_details['donor_id']) && ($receipt_details['donor_id'] == $customer->donor_id)) echo "selected"; ?> > <?= $customer->mobile_no ?> </option>
|
||
<?php endforeach; ?>
|
||
</select>
|
||
</div>
|
||
|
||
<div class="form-group col-md-6">
|
||
<label for="customerName" class="col-form-label">Donor Name<span class="text-danger"> *</span></label>
|
||
<select class="form-control" id="customerName" name="donor_id" required data-toggle="select2">
|
||
<option value="">--Select--</option>
|
||
<?php foreach ($customers as $customer) : ?>
|
||
<option value="<?= $customer->donor_id ?>" <?php if (isset($receipt_details['donor_id']) && ($receipt_details['donor_id'] == $customer->donor_id)) echo "selected"; ?> > <?= $customer->first_name ?> </option>
|
||
<?php endforeach; ?>
|
||
</select>
|
||
</div>
|
||
|
||
<div class="form-group col-md-6">
|
||
<label for="event" class="col-form-label">Causes<span class="text-danger"> *</span></label>
|
||
<select class="form-control" id="event" name="causes_id" required >
|
||
<option value="">Select the Causes</option>
|
||
<?php foreach ($causes as $causesData) : if(date("Y-m-d") >= $causesData->from_date && date("Y-m-d") <= $causesData->to_date || $causesData->from_date == '' && $causesData->to_date == ''){?>
|
||
<option value="<?= $causesData->causes_id ?>" <?php if (isset($receipt_details['causes_id']) && ($receipt_details['causes_id'] === $causesData->causes_id)) echo "selected"; ?> ><?= $causesData->name ?> <?= ($causesData->from_date != '') ? '('. date("d-m-Y", strtotime($causesData->from_date)) .' - '. date("d-m-Y", strtotime($causesData->to_date)).' )' : ''; ?> </option>
|
||
<?php } else {
|
||
if(isset($receipt_details['causes_id']) && ($receipt_details['causes_id'] === $causesData->causes_id)) { ?>
|
||
<option value="<?= $causesData->causes_id ?>" <?php if (isset($receipt_details['causes_id']) && ($receipt_details['causes_id'] === $causesData->causes_id)) echo "selected disabled"; ?>><?= $causesData->name ?> ( <?= date("d-m-Y", strtotime($causesData->from_date)) ?> - <?= date("d-m-Y", strtotime($causesData->to_date)) ?> )</option>
|
||
<?php }
|
||
} endforeach; ?>
|
||
</select>
|
||
</div>
|
||
|
||
<div class="form-group col-md-6">
|
||
<label for="event" class="col-form-label">Campaign</label>
|
||
<select class="form-control" id="campaign" name="campaign_id" data-toggle="select2" >
|
||
<option value="">Select the Campaign</option>
|
||
<?php foreach ($campaign as $cam) : if(date("Y-m-d") >= $cam->start_date && date("Y-m-d") <= $cam->end_date || $cam->start_date == '' && $cam->end_date == ''){?>
|
||
<option value="<?= $cam->campaign_id ?>" <?php if (isset($receipt_details['campaign_id']) && ($receipt_details['campaign_id'] === $cam->campaign_id)) echo "selected"; ?>><?= $cam->name ?> ( <?= date("d-m-Y", strtotime($cam->start_date)) ?> - <?= date("d-m-Y", strtotime($cam->end_date)) ?> )</option>
|
||
<?php } endforeach; ?>
|
||
</select>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-6">
|
||
<label for="invoiceNumber" class="col-form-label">Receipt Number</label>
|
||
<input type="text" class="form-control" id="invoiceNumber" name="receipt_number" value="<?= isset($receipt_details['receipt_number']) ? $receipt_details['receipt_number'] : $count_receipt_no ?>" readonly>
|
||
<input type="hidden" id="hiddenNextId" name="next_id" placeholder="hidden for next id" />
|
||
</div>
|
||
<div class="form-group col-md-6">
|
||
<label for="invoiceDate" class="col-form-label">Receipt Date<span class="text-danger"> *</span></label>
|
||
<input type="date" class="form-control" id="invoiceDate" name="receipt_date" value="<?= isset($receipt_details['receipt_date']) ? $receipt_details['receipt_date'] : '' ?>" required>
|
||
</div>
|
||
</div>
|
||
<div class="form-row">
|
||
<div class="form-group col-md-1">
|
||
<label for="csname" class="col-form-label">Currency<span class="text-danger"> *</span></label>
|
||
<select class="form-control" id="currency" name="currency" data-toggle="select2" required>
|
||
<?php
|
||
$currencies = explode(",", $currency[0]['currency']);
|
||
$selectedCurrency = isset($receipt_details['currency']) ? $receipt_details['currency'] : '';
|
||
?>
|
||
<?php foreach ($currencies as $index => $currencyOption) : ?>
|
||
<option value="<?= $currencyOption ?>" <?= ($index === 0 || $selectedCurrency === $currencyOption) ? 'selected' : '' ?>>
|
||
<?= $currencyOption ?>
|
||
</option>
|
||
<?php endforeach; ?>
|
||
</select>
|
||
</div>
|
||
|
||
|
||
<div class="form-group col-md-5">
|
||
<label for="csname" class="col-form-label">Amount<span class="text-danger"> *</span></label>
|
||
<input type="text" class="form-control" id="org_name_field" name="amount" value="<?= isset($receipt_details['amount']) ? $receipt_details['amount'] : '' ?>" placeholder="Amount" oninput="this.value = this.value.replace(/[^0-9]/g, '')" required />
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label for="invoiceDate" class="col-form-label">Payment Mode<span class="text-danger"> *</span></label>
|
||
<select class="form-control" id="paymentMode" name="payment_mode" required>
|
||
<option value="" <?php if( isset($receipt_details['payment_mode']) && $receipt_details['payment_mode'] == '' ) { echo 'selected'; } ?> >Select Payment Mode</option>
|
||
<option value="credit" <?php if( isset($receipt_details['payment_mode']) && $receipt_details['payment_mode'] == 'credit' ) { echo 'selected'; } ?>>Credit Card</option>
|
||
<option value="debit" <?php if( isset($receipt_details['payment_mode']) && $receipt_details['payment_mode'] == 'debit' ) { echo 'selected'; } ?>>Debit Card</option>
|
||
<option value="cash" <?php if( isset($receipt_details['payment_mode']) && $receipt_details['payment_mode'] == 'cash' ) { echo 'selected'; } ?>>Cash</option>
|
||
<option value="upi" <?php if( isset($receipt_details['payment_mode']) && $receipt_details['payment_mode'] == 'upi' ) { echo 'selected'; } ?>>UPI</option>
|
||
<option value="banktransfer" <?php if( isset($receipt_details['payment_mode']) && $receipt_details['payment_mode'] == 'banktransfer' ) { echo 'selected'; } ?>>Bank Transfer</option>
|
||
</select>
|
||
</div>
|
||
<div class="form-group col-md-3">
|
||
<label for="invoiceDate" class="col-form-label">Payment Reference No</label>
|
||
<input type="text" class="form-control" id="invoiceDate" name="payment_ref_no" value="<?= isset($receipt_details['payment_ref_no']) ? $receipt_details['payment_ref_no'] : '' ?>" placeholder="Payment Reference No">
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12">
|
||
<label for="notes" class="col-form-label">Notes</label>
|
||
<textarea class="form-control" id="notes" name="notes" rows="2" placeholder="Notes"><?= isset($receipt_details['notes']) ? $receipt_details['notes'] : '' ?></textarea>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<input type="hidden" id="hiddenInvoiceId" name="receipt_id" placeholder="hidden for invoice id" value="<?= isset($receipt_details['receipt_id']) ? $receipt_details['receipt_id'] : '' ?>" />
|
||
<div class="form-group text-right m-b-0">
|
||
<?php if(get_user_role() != 'accounts') { ?>
|
||
<button type="submit" class="btn btn-primary waves-effect mr-1" name="saveas" value="Draft" id="saveDraftButton"><?= isset($receipt_details['receipt_id']) ? 'Update' : 'Save' ?></button>
|
||
<?php } ?>
|
||
</div>
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- Your Minton theme modal HTML structure -->
|
||
<div class="modal fade" id="successModal" tabindex="-1" role="dialog" aria-labelledby="successModalLabel" aria-hidden="true">
|
||
<div class="modal-dialog" role="document">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h5 class="modal-title" id="successModalLabel">Success</h5>
|
||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||
<span aria-hidden="true">×</span>
|
||
</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
<p>Your Receipt has been submitted successfully!</p>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<a href="#" class="btn btn-primary" id="downloadButton">Download</a>
|
||
<a href="<?= base_url() . "receipt_list"; ?>" class="btn btn-secondary" data-dismiss="modal">Close</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Your existing JavaScript code -->
|
||
|
||
<script>
|
||
$(document).ready(function () {
|
||
$('#myForm').submit(function (e) {
|
||
e.preventDefault();
|
||
|
||
$.ajax({
|
||
type: 'POST',
|
||
url: '<?= base_url("save_invoice"); ?>',
|
||
data: $(this).serialize(),
|
||
success: function (response) {
|
||
if (response.success) {
|
||
$('#successModal').modal('show');
|
||
$('#downloadButton').attr('href', "<?= base_url('generate_invoice_pdf/'); ?>" + response.invoice_id);
|
||
|
||
} else {
|
||
// Handle errors or display a different modal for failure
|
||
console.log(response.message);
|
||
}
|
||
},
|
||
error: function (error) {
|
||
console.log('AJAX Error:', error);
|
||
}
|
||
});
|
||
});
|
||
});
|
||
</script>
|
||
|
||
<script>
|
||
var data = <?php echo json_encode($customers); ?>;
|
||
var editdata = <?php echo json_encode($receipt_details); ?>;
|
||
console.log(editdata,'data');
|
||
|
||
$(function() {
|
||
// onload function
|
||
// if(editdata) {
|
||
// var selectedMobile = $('#donor_mobile').val();
|
||
// console.log(selectedMobile,'selectedMobiledsf');
|
||
// var options = '<option value="">Select a Donor</option>';
|
||
|
||
// // Assuming `data` is an array of objects containing donor information
|
||
// for (const donor of data) {
|
||
// if(selectedMobile == donor.mobile_no) {
|
||
// options += `<option value="${donor.donor_id}" ${editdata && editdata.donor_id == donor.donor_id ? 'selected' : ''}>${donor.first_name} ${donor.last_name}</option>`;
|
||
// }
|
||
// }
|
||
|
||
// // Assuming you have a select element with the id `#donor_select`
|
||
// $('#customerName').html(options);
|
||
// }
|
||
|
||
$('#donor_mobile').on('change', function(){
|
||
console.log($(this).val());
|
||
if($(this).val())
|
||
{
|
||
var selectedMobile = $(this).val();
|
||
var options = '<option value="">Select a Donor</option>';
|
||
|
||
// Assuming `data` is an array of objects containing donor information
|
||
for (const donor of data) {
|
||
if(selectedMobile == donor.mobile_no) {
|
||
options += `<option value="${donor.donor_id}" ${editdata && editdata.donor_id == donor.donor_id ? 'selected' : ''}>${donor.first_name}</option>`;
|
||
}
|
||
}
|
||
|
||
// Assuming you have a select element with the id `#donor_select`
|
||
$('#customerName').html(options);
|
||
}
|
||
else
|
||
{
|
||
var selectedMobile = $(this).val();
|
||
var options = '<option value="">Select a Donor</option>';
|
||
|
||
// Assuming `data` is an array of objects containing donor information
|
||
for (const donor of data) {
|
||
options += `<option value="${donor.donor_id}">${donor.first_name}</option>`;
|
||
}
|
||
|
||
// Assuming you have a select element with the id `#donor_select`
|
||
$('#customerName').html(options);
|
||
}
|
||
});
|
||
});
|
||
$(function() {
|
||
$('#donor_mobile').on('change', function(){
|
||
var selectedMobile = $(this).val();
|
||
|
||
// Find the donor with the selected mobile number
|
||
var matchingDonor = data.find(donor => donor.mobile_no == selectedMobile);
|
||
|
||
// Set the donor name directly if there's a matching donor
|
||
if (matchingDonor) {
|
||
$('#customerName').val(matchingDonor.donor_id).trigger('change');
|
||
} else {
|
||
// If there's no matching donor or multiple donors, reset the donor name input
|
||
$('#customerName').val('').trigger('change');
|
||
}
|
||
});
|
||
});
|
||
|
||
|
||
$(function() {
|
||
$('#form-submit').on('click', function(){
|
||
console.log('edakfibsefui');
|
||
// Disable the button to prevent multiple clicks
|
||
if ($('.myForm')[0].checkValidity()) {
|
||
this.disabled = true;
|
||
}
|
||
$('#submitBtn').click();
|
||
// Perform any other actions (e.g., form submission)
|
||
// For example, you can use AJAX to submit the form data
|
||
});
|
||
});
|
||
|
||
|
||
$(function() {
|
||
$('#saveDraftButton').on('click', function(){
|
||
// Check if the form is valid
|
||
if ($('.main-form')[0].checkValidity()) {
|
||
// Disable the button to prevent multiple clicks
|
||
$(this).prop('disabled', true);
|
||
|
||
// Submit the form
|
||
$('.main-form').submit();
|
||
}
|
||
});
|
||
|
||
});
|
||
|
||
// hide all fields for account login
|
||
$(function() {
|
||
role = "<?php echo get_user_role() ?>";
|
||
console.log(role);
|
||
if(role == "accounts" || role == "auditor")
|
||
{
|
||
// for input
|
||
var formElements = document.querySelectorAll('#myForm input, #myForm textarea');
|
||
formElements.forEach(function(element) {
|
||
element.setAttribute('readonly', true);
|
||
});
|
||
// for select
|
||
var formElements = document.querySelectorAll('#myForm select');
|
||
formElements.forEach(function(element) {
|
||
element.setAttribute('disabled', true);
|
||
});
|
||
|
||
$('#add-quk-donar').attr('disabled', true);
|
||
}
|
||
else
|
||
{
|
||
// for input
|
||
// var formElements = document.querySelectorAll('#myForm input, #myForm textarea');
|
||
// formElements.forEach(function(element) {
|
||
// element.setAttribute('readonly', false);
|
||
// });
|
||
// // for select
|
||
// var formElements = document.querySelectorAll('form select');
|
||
// formElements.forEach(function(element) {
|
||
// element.setAttribute('disabled', false);
|
||
// });
|
||
}
|
||
});
|
||
function restriction(event) {
|
||
var charCode = event.which || event.keyCode;
|
||
if ((charCode >= 48 && charCode <= 57)) {
|
||
return true;
|
||
} else {
|
||
event.preventDefault(); // Prevent the character from being entered
|
||
return false;
|
||
}
|
||
}
|
||
|
||
$(document).ready(function(){
|
||
|
||
$('#org_details_form').hide();
|
||
|
||
|
||
$('#DonorType').on('change', function(){
|
||
|
||
let DonorType = $(this).val();
|
||
|
||
if(DonorType === 'option2'){
|
||
$('#org_details_form').show();
|
||
$('#org_name_fie').prop('required', true);
|
||
$('#pan_no_org').prop('required', true);
|
||
$('#org_reg_details').prop('required', true);
|
||
$('#pan_no').prop('required', false);
|
||
$('#ind_pan').hide();
|
||
}
|
||
else{
|
||
$('#org_details_form').hide();
|
||
$('#org_name_fie').prop('required', false);
|
||
$('#pan_no_org').prop('required', false);
|
||
$('#org_reg_details').prop('required', false);
|
||
$('#pan_no').prop('required', true);
|
||
$('#ind_pan').show();
|
||
}
|
||
})
|
||
|
||
});
|
||
|
||
</script>
|
||
|
||
<!-- Standard modal content -->
|
||
<div id="standard-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="standard-modalLabel" aria-hidden="true">
|
||
<div class="modal-dialog">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<h4 class="modal-title" id="standard-modalLabel">Add Donor</h4>
|
||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||
</div>
|
||
<div class="modal-body">
|
||
<form class="needs-validation myForm" novalidate method="POST" enctype="multipart/form-data" action="<?= base_url() . "insert_donor"; ?>" id="myForm" name="myForm">
|
||
|
||
<input type="hidden" name="new_receipt" value="new_receipt"/>
|
||
<input type="hidden" id="business_id" name="business_id" placeholder="hidden for business id" value="<?php echo get_business_id() ?>" />
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12">
|
||
<label for="DonorType" class="col-form-label">Donor Type<span class="text-danger"> *</span></label>
|
||
<select class="form-control" id="DonorType" name="DonorType" required>
|
||
<option value="<?= isset($receipt_details['donor_type']) ? $receipt_details['donor_type'] : '' ?>"><?= isset($receipt_details['donor_type']) ? ($receipt_details['donor_type'] === 'option1' ? 'Individual' : ($receipt_details['donor_type'] === 'option2' ? 'Organization' : 'Select Donor Type')) : 'Select Donor Type'; ?></option>
|
||
<option value="option1">Individual</option>
|
||
<option value="option2">Organization</option>
|
||
</select>
|
||
<div class="invalid-feedback">Please provide.</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div id="org_details_form">
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12">
|
||
<label for="csname" class="col-form-label">Organization Name<span class="text-danger"> *</span></label>
|
||
<input type="text" class="form-control" id="org_name_fie" name="org_name" value="" placeholder="Organization Name" >
|
||
<div class="invalid-feedback"> Please provide. </div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12">
|
||
<label for="csname" class="col-form-label"><span class="contactPerson">Organization PAN Number<span class="text-danger"> *</span></label>
|
||
<input type="text" class="form-control" id="pan_no_org" name="o_pan_no" value="" placeholder="PAN Number" oninput="validatePANFormatOrg(this)" />
|
||
<div id="panNoErrors" style="display: none; color: red;">Invalid PAN format</div>
|
||
<div class="invalid-feedback"> Please provide. </div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12">
|
||
<label for="csname" class="col-form-label">Organization Reg Details<span class="text-danger"> *</span></label>
|
||
<input type="text" class="form-control" id="org_reg_details" name="org_reg_Details" value="" placeholder="Organization Reg details"/>
|
||
<div class="invalid-feedback"> Please provide. </div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12">
|
||
<label for="cfname" class="col-form-label"><span class="contactPerson">Contact Person </span>Name<span class="text-danger"> *</span></label>
|
||
<input type="text" class="form-control" id="cfname" name="cfname" value="<?= isset($receipt_details['first_name']) ? $receipt_details['first_name'] : '' ?>" placeholder="First Name" required />
|
||
<div class="invalid-feedback"> Please provide. </div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<div class="form-group col-md-12">
|
||
<label for="cfname" class="col-form-label"><span class="contactPerson">Contact Person </span>Email<span class="text-danger"> *</span></label>
|
||
<input type="email" class="form-control" id="cmail" name="cmail" value="<?= isset($receipt_details['email']) ? $receipt_details['email'] : '' ?>" placeholder="Email" required />
|
||
<div class="invalid-feedback"> Please provide a valid email address. </div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row" id="ind_pan">
|
||
<div class="form-group col-md-12">
|
||
<label for="csname" class="col-form-label">PAN Number<span class="text-danger"> *</span></label>
|
||
<input type="text" class="form-control" id="pan_no" name="pan_no" value="<?= isset($receipt_details['pan_no']) ? $receipt_details['pan_no'] : '' ?>" placeholder="PAN Number" oninput="validatePANFormat(this)" required />
|
||
<div id="panNoError" style="display: none; color: red;">Invalid PAN format</div>
|
||
|
||
<div class="invalid-feedback"> Please provide. </div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-row">
|
||
<label for="cmobile" class="col-form-label"><span class="contactPerson">Contact Person </span>Mobile<span class="text-danger"> *</span></label>
|
||
<div class="input-group mb-2">
|
||
<div class="input-group-prepend">
|
||
<div class="input-group-text">+91</div>
|
||
</div>
|
||
<input type="text" class="form-control" name="mobile" value="<?= isset($receipt_details['mobile_no']) ? $receipt_details['mobile_no'] : '' ?>" placeholder="Mobile Number (Enter only numbers)" required minlength="10" maxlength="10" onkeypress="return restriction(event)" />
|
||
|
||
<div class="invalid-feedback"> Please provide. </div>
|
||
</div>
|
||
</div>
|
||
<button class="btn btn-success waves-effect waves-light mr-1" id="submitBtn" type="submit" hidden></button>
|
||
</form>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button type="button" class="btn btn-light" data-dismiss="modal">Close</button>
|
||
<button type="button" id="form-submit" class="btn btn-primary">Save changes</button>
|
||
</div>
|
||
</div><!-- /.modal-content -->
|
||
</div><!-- /.modal-dialog -->
|
||
</div><!-- /.modal -->
|
||
|
||
<script>
|
||
function validateEmailFormat(email) {
|
||
var emailPattern = /^(.+)@(gmail\.com|yahoo\.com|hotmail\.com|[^@]+\.com\.org)$/i;
|
||
|
||
if (!emailPattern.test(email)) {
|
||
alert("Please provide a valid email addres");
|
||
// You can also update the UI to indicate the error, e.g., by adding a class to the input field.
|
||
// Example: $('#cmail').addClass('is-invalid');
|
||
}
|
||
}
|
||
</script>
|
||
<script>
|
||
function validatePANFormat(input) {
|
||
var isValidPAN = /[A-Z]{5}[0-9]{4}[A-Z]{1}$/.test(input.value.toUpperCase());
|
||
document.getElementById('panNoError').style.display = isValidPAN ? 'none' : 'block';
|
||
input.setCustomValidity(isValidPAN ? '' : 'Invalid PAN format');
|
||
}
|
||
</script>
|
||
<script>
|
||
function validatePANFormatOrg(input) {
|
||
var isValidPAN = /[A-Z]{5}[0-9]{4}[A-Z]{1}$/.test(input.value.toUpperCase());
|
||
document.getElementById('panNoErrors').style.display = isValidPAN ? 'none' : 'block';
|
||
input.setCustomValidity(isValidPAN ? '' : 'Invalid PAN format');
|
||
}
|
||
</script>
|
||
|
||
<script>
|
||
$(document).ready(function () {
|
||
$('#invoiceDate').on('change', function () {
|
||
var selectedDate = new Date($(this).val());
|
||
var currentDate = new Date();
|
||
|
||
// Compare the selected date with the current date
|
||
if (selectedDate > currentDate) {
|
||
$(this).val(''); // Clear the selected date
|
||
}
|
||
});
|
||
});
|
||
</script>
|
||
|
||
|
||
|
||
|
||
|