1719 lines
74 KiB
PHP
1719 lines
74 KiB
PHP
<?php include('techsyn_header.php'); ?>
|
|
|
|
|
|
<!-- Main Content Container for side bar and body-->
|
|
<link rel="stylesheet" href="assets/css/select2.min.css" />
|
|
<div class="main-container ace-save-state" id="main-container">
|
|
<script type="text/javascript">
|
|
try {
|
|
ace.settings.loadState('main-container')
|
|
} catch (e) {}
|
|
</script>
|
|
<?php include('techsyn_sidebar.php'); ?>
|
|
<!--breadcrumb-->
|
|
|
|
<div class="main-content">
|
|
|
|
<div class="main-content-inner">
|
|
<div class="breadcrumbs ace-save-state" id="breadcrumbs">
|
|
<ul class="breadcrumb">
|
|
<li><i class="ace-icon fa fa-home home-icon"></i> <a href="#">Home</a>
|
|
</li>
|
|
<li class="active"><a href="billing.php">Billing Form</a></li>
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="page-content">
|
|
<div class="box box-primary" style="padding: 7px; margin: 2px 0px 50px 5px; width: 99.5%;">
|
|
<form id="bill_form" method="post">
|
|
<!-- box-body-->
|
|
<div class="box-body">
|
|
<div id="reload">
|
|
<div class="main_reload">
|
|
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<h3>
|
|
<center>Add Patient If Not Registered!</center>
|
|
</h3>
|
|
<div class="form-group col-sm-2">
|
|
<label for="new_patient_name"><strong>Patient Name:</strong></label>
|
|
<input class="form-control" id="new_patient_name" type="text" name="new_patient_name" />
|
|
</div>
|
|
|
|
<div class="col-sm-6">
|
|
<div class="form-group">
|
|
<label for="form-field-comment">DOB/AGE<span style="color: red">*</span></label>
|
|
<div class="row">
|
|
|
|
|
|
<div class="col-sm-6 no-padding-right">
|
|
|
|
<div class="input-group col-sm-12 no-padding">
|
|
<input class="input-medium date-picker" id="dob" name="dob" type="text" style="height: 34px; width: 100%;" data-date-format="dd/mm/yyyy" onchange="checkAge()" placeholder="Date of Birth(dd/mm/yyyy)" value="<?php echo date("d/m/Y", strtotime("-20 years")); ?>">
|
|
<span class="input-group-addon"> <i class="ace-icon fa fa-calendar"></i>
|
|
</span>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="col-sm-6 no-padding-left">
|
|
|
|
<input readonly class="col-xs-12 form-control" type="number" id="emp_age" name="emp_age" placeholder='Age'>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="col-sm-2 control-label no-padding-right" for="gender">GENDER <span style="color: red">*</span>
|
|
</label>
|
|
<div class="col-sm-4 no-padding-right">
|
|
<select id="gender" name="gender" class="form-control select">
|
|
<option value="" selected disabled>Choose Gender?</option>
|
|
<option value="M">Male</option>
|
|
<option value="F">Female</option>
|
|
<option value="O">Others</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
|
|
<div class="form-group col-sm-2">
|
|
<label for="phone_no"><strong>Phone No:</strong></label> <input class="form-control" id="phone_no" type="text" name="phone_no" placeholder="Phone No." data-max="10" />
|
|
</div>
|
|
<div class="form-group col-sm-3">
|
|
|
|
<label class="control-label" for="form-field-comment">Email
|
|
ID</label> <input type="email" class="form-control" id="email_id" name="email_id" placeholder="Email ID" maxlength="30" />
|
|
<!-- vikas checks onchange="emailCheck()" -->
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="com-sm-12">
|
|
|
|
<center>
|
|
<button class="btn btn-info save_button" type="button" id="save_button" onclick="validate_new_patient();">
|
|
<i class="ace-icon fa fa-floppy-o bigger-110"></i> Register
|
|
</button>
|
|
</center>
|
|
|
|
</div>
|
|
</div>
|
|
<hr>
|
|
|
|
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
|
|
|
|
<div class="form-group col-sm-2">
|
|
|
|
|
|
<label for="bill_date">Bill Date</label>
|
|
<div class="input-group">
|
|
|
|
<div class="input-group-addon">
|
|
<i class="ace-icon fa fa-calendar"></i>
|
|
</div>
|
|
<input class="input-medium date-picker" id="bill_date" name="bill_date" type="text" data-date-format="dd/mm/yyyy" placeholder="Bill Date(dd/mm/yyyy)" value="<?php echo date("d/m/Y", strtotime("-0 years")); ?>">
|
|
<!-- <span class="input-group-addon"> <i class="ace-icon fa fa-calendar"></i> -->
|
|
|
|
<!-- </span> -->
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="form-group col-sm-3">
|
|
|
|
|
|
|
|
<label for="patient_name">Select Patient:</label> <select name="patient_id" id="patient_id" class="form-control select2" onchange="showClient(this.value)">
|
|
<option value="" disabled selected>Select</option>
|
|
<?php echo generateOption2('patient_master', 'concat(patient_name," ",emp_code)', 'id', '', ''); ?>
|
|
</select>
|
|
|
|
|
|
</div>
|
|
|
|
<div class="form-group col-sm-3">
|
|
|
|
|
|
|
|
<label for="IsChargeable">IsChargeable?</label>
|
|
<select class="form-control" name="IsChargeable" id="IsChargeable">
|
|
<option value="1">Yes</option>
|
|
<option value="0">No</option>
|
|
</select>
|
|
</div>
|
|
|
|
|
|
<div class="form-group col-sm-3"></div>
|
|
</div>
|
|
</div>
|
|
<!-- </div> -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<table id="myTable" class="table table-bordered order-list">
|
|
<thead>
|
|
<tr>
|
|
<th>Product / Service</th>
|
|
|
|
<th>Rate Per Unit</th>
|
|
<th>Quantity</th>
|
|
<!-- <th>Total Before Discount</th>
|
|
<th>Discount Percentage</th>
|
|
<th>Discount Amount</th>
|
|
<th>Total After Discount</th>
|
|
<th>Tax Code1</th>
|
|
<th>Tax Rate1</th>
|
|
<th>Tax Code2</th>
|
|
<th>Tax Rate2</th>
|
|
<th>HSN Code</th>
|
|
<th>Total Tax</th> -->
|
|
<th>Total Amount</th>
|
|
<th>Delete</th>
|
|
|
|
|
|
</tr>
|
|
</thead>
|
|
<?php
|
|
|
|
$i = 0;
|
|
|
|
?>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td style="width: 12%">
|
|
|
|
|
|
|
|
<select class="form-control select2" id="product_list<?= $i ?>" onchange="showall(this.value,<?= $i ?>)" name="product_list<?= $i ?>" data-placeholder="Choose a product..." style="width: 100%;">
|
|
<option value=""></option>
|
|
<?php echo generateOption('product_service_master', 'product_name', 'product_id', $row['product_id'], ''); ?>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
|
|
|
<td style="width: 6%"><input type="number" name="rate_per_unit<?= $i ?>" id="rate_per_unit<?= $i ?>" class="form-control" readonly /></td>
|
|
|
|
<td style="width: 5%"><input type="number" name="qty<?= $i ?>" value="<?= $row['qty'] ?>" id="qty<?= $i ?>" onchange="caluculateQty(<?= $i ?>)" class="form-control" /></td>
|
|
|
|
|
|
|
|
<td style="width: 10%"><input type="number" name="total_amount<?= $i ?>" value="" id="total_amount<?= $i ?>" step="0.001" class="form-control" /></td>
|
|
|
|
<td style="width: 5%"></td>
|
|
</tr>
|
|
|
|
|
|
</tbody>
|
|
<?php
|
|
$i++;
|
|
|
|
?>
|
|
|
|
|
|
<tfoot>
|
|
<tr style="margin-left: 10px;">
|
|
<td colspan="14" style="text-align: left;"><input type="button" class="btn btn-lg btn-block " id="addrow" value="Add Row" onclick="addrow_rows()" /> <input type="hidden" name="count_items" id="count_items" value="1" /></td>
|
|
</tr>
|
|
|
|
|
|
<tr>
|
|
|
|
<td colspan="3"><strong style="font-size: 12px">Total</strong></td>
|
|
<!-- <input type="hidden" name="total_rate_per_unit" value="" id="total_rate_per_unit" class="form-control" /> <input type="hidden" name="total_qty" value="" id="total_qty" class="form-control" /> <input type="hidden" name="total_amount_bf_discount" value="" id="total_amount_bf_discount" class="form-control" />
|
|
<input type="hidden" name="total_discount_percentage" value="" id="total_discount_percentage" class="form-control" /> <input type="hidden" name="total_discount_amount" value="" id="total_discount_amount" class="form-control" />
|
|
<input type="hidden" name="total_afterdiscount" value="" id="total_afterdiscount" class="form-control" /> <strong style="font-size: 12px" id="total_tax_code1"></strong>
|
|
<input type="hidden" name="total_tax_rate1" value="" id="total_tax_rate1" class="form-control" /> <strong style="font-size: 12px" id="total_tax_code2"></strong>
|
|
<input type="hidden" name="total_tax_rate2" value="" id="total_tax_rate2" class="form-control" />
|
|
|
|
<input type="hidden" name="totaltax" value="" id="totaltax" class="form-control" /> -->
|
|
|
|
|
|
<td><input type="number" name="total" value="" id="total" class="form-control" /></td>
|
|
|
|
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</tfoot>
|
|
|
|
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<?php
|
|
// $hasWriteAccess = isAccessible ( $_SESSION ['RoleId'], $menu_key, 'W' );
|
|
?>
|
|
<?php
|
|
// if ($hasWriteAccess) {
|
|
?>
|
|
<div class="box-footer" style="text-align: center;">
|
|
<button class="btn btn-success new_button" id="new_button" type="reset" onclick="show_save_button();">
|
|
<i class="ace-icon fa fa-plus-square-o bigger-110"></i> New
|
|
</button>
|
|
|
|
<button class="btn btn-info save_button" type="button" id="save_button" onclick="validate();">
|
|
<i class="ace-icon fa fa-floppy-o bigger-110"></i> Save
|
|
</button>
|
|
|
|
|
|
<button class="btn btn-warning" type="reset">
|
|
<i class="ace-icon fa fa-undo bigger-110"></i> Reset
|
|
</button>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php
|
|
// }
|
|
?>
|
|
|
|
<!--End box-footer-->
|
|
|
|
</form>
|
|
</div>
|
|
|
|
<div class="main-container ace-save-state" id="main-container">
|
|
<script type="text/javascript">
|
|
try {
|
|
ace.settings.loadState('main-container')
|
|
} catch (e) {}
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<!--breadcrumb-->
|
|
<div class="main-content">
|
|
<div class="main-content-inner">
|
|
|
|
<div class="page-content" style="margin-top: -47px;">
|
|
|
|
<div id="flexigridDiv" class="table-responsive">
|
|
|
|
<form name="f1" method="post" action="" id="flex_form_bill">
|
|
<div id="flex1" style="width: 100%"></div>
|
|
<input type="hidden" name="flex_bill_id" id="flex_bill_id" />
|
|
<!-- <input type="hidden" name="client_id" id="flex_client_id" /> -->
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
<!-- /.page-content -->
|
|
</div>
|
|
</div>
|
|
<!-- /.main-content -->
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
var w = screen.width * .90;
|
|
var h = 0;
|
|
h = (window.innerHeight - ($("#navbar").height() + $(".breadcrumbs").height())) * .75;
|
|
$("#flex1").flexigrid({
|
|
url: 'billing_script.php',
|
|
dataType: 'json',
|
|
colModel: [{
|
|
display: '',
|
|
name: '',
|
|
width: w * .08,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'SR NO',
|
|
name: 'bill_id',
|
|
width: w * .04,
|
|
sortable: false,
|
|
align: 'left'
|
|
},
|
|
|
|
{
|
|
display: 'Bill Number',
|
|
name: 'bill_no',
|
|
width: w * .1,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
{
|
|
display: 'Bill Date',
|
|
name: 'bill_date',
|
|
width: w * .2,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
|
|
{
|
|
display: 'Patient Name',
|
|
name: 'patient_name',
|
|
width: w * .3,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
|
|
|
|
{
|
|
display: 'Final Bill Amount',
|
|
name: 'final_bill_amount',
|
|
width: w * .09,
|
|
sortable: true,
|
|
align: 'left'
|
|
},
|
|
|
|
|
|
|
|
|
|
],
|
|
buttons: [
|
|
|
|
// {name: 'Add', bclass: 'add', onpress : add},
|
|
// {separator: true},
|
|
{
|
|
name: 'PDF',
|
|
bclass: 'print',
|
|
onpress: pdf
|
|
},
|
|
{
|
|
separator: true
|
|
},
|
|
{
|
|
name: 'Excel',
|
|
bclass: 'print_excel',
|
|
onpress: excel
|
|
},
|
|
{
|
|
separator: true
|
|
}
|
|
],
|
|
searchitems: [
|
|
|
|
|
|
{
|
|
display: 'Bill Number',
|
|
name: 'bill_no'
|
|
},
|
|
{
|
|
display: 'Patient Name',
|
|
name: 'patient_name'
|
|
},
|
|
{
|
|
display: 'Client Name',
|
|
name: 'client_name'
|
|
},
|
|
|
|
|
|
|
|
|
|
],
|
|
sortname: "last_modified",
|
|
sortorder: "desc",
|
|
usepager: true, //pagination
|
|
|
|
useRp: true,
|
|
rp: 20, //records per page
|
|
showTableToggleBtn: false, //toggle button for the whole table
|
|
resizable: true,
|
|
//width: w,
|
|
height: h,
|
|
singleSelect: true
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
function pdf() {
|
|
window.open('billing_pdf.php');
|
|
}
|
|
|
|
function excel() {
|
|
window.location = 'billing_excel.php';
|
|
}
|
|
|
|
function add() {
|
|
// $(".save_button").show();
|
|
$("#bill_id").val("");
|
|
$("#bill_no").val("");
|
|
$("#bill_date").val("");
|
|
|
|
$("#total_amount_bf_discount").val("");
|
|
$("#total_discount_amount").val("");
|
|
$("#discount_voucher").val("");
|
|
$("#final_bill_amount").val("");
|
|
$("#amount_paid_patient").val("");
|
|
$("#amount_pending_company").val("");
|
|
$("#bill_status").val("");
|
|
|
|
|
|
// // $('#modal-add-staff').modal("show");
|
|
}
|
|
|
|
|
|
|
|
function show_save_button() {
|
|
$("#save_button").show();
|
|
$("#bill_id").val("");
|
|
}
|
|
|
|
function delete_bill(bill_id) {
|
|
$("#flex_bill_id").val(bill_id);
|
|
|
|
BootstrapDialog.confirm('Are you sure to delete the Bill Details?', function(result) {
|
|
if (result) {
|
|
$.ajax({
|
|
url: 'delete_bill.php?bill_id=' + bill_id + ' ',
|
|
type: "POST",
|
|
data: $("#flex_form_bill").serialize(),
|
|
success: function(data) {
|
|
if (data.indexOf("SUCCESS") != -1) {
|
|
BootstrapDialog.alert('Bill Details Deleted Successfully.');
|
|
$("#flex1").flexReload();
|
|
|
|
} else {
|
|
BootstrapDialog.alert('Error Deleting Bill Details');
|
|
}
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Deleting Bill Details');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function open_bill(bill_id, action) {
|
|
if (action == "V") {
|
|
$(".save_button").hide();
|
|
|
|
} else {
|
|
$(".save_button").show();
|
|
}
|
|
$.ajax({
|
|
url: 'select_bill.php?bill_id=' + bill_id + ' ',
|
|
type: 'POST',
|
|
success: function(data) {
|
|
// console.log(data);
|
|
|
|
var counter = $("#count_items").val();
|
|
while (counter--) {
|
|
$("#deletebtn").closest("tr").remove();
|
|
// $("#myTable > tbody").empty();
|
|
}
|
|
// console.log($.parseJSON(data));
|
|
|
|
$("#count_items").val("1");
|
|
|
|
|
|
var data = $.parseJSON(data);
|
|
|
|
|
|
$("#bill_id").val(bill_id);
|
|
$("#flex_bill_id").val(bill_id);
|
|
// $("#Pay_mod").val(data[0].Pay_mod);
|
|
$("#bill_no").val(data[0].bill_no);
|
|
$("#bill_date").val(myDateFormater(data[0].bill_date));
|
|
$("#patient_id").val(data[0].patient_id);
|
|
|
|
// console.log("Client" + data[0].patient_id);
|
|
// showClient2(data[0].patient_id);
|
|
// $("#client_id").val( showClient2(data[0].patient_id));
|
|
// $("#client_id").val(data[0].client_id);
|
|
|
|
|
|
|
|
|
|
|
|
// $("#total_amount_bf_discount").val(data[0].total_amount_bf_discount);
|
|
// $("#total_discount_amount").val(data[0].total_discount_amount);
|
|
// $("#discount_voucher").val(data[0].discount_voucher);
|
|
// showamount(data[0].discount_voucher);
|
|
// $("#final_bill_amount").val(data[0].final_bill_amount);
|
|
// $("#amount_paid_patient").val(data[0].amount_paid_patient);
|
|
// $("#amount_pending_company").val(data[0].amount_pending_company);
|
|
// $("#bill_status").val(data[0].bill_status);
|
|
$("#total").val(data[0].final_bill_amount);
|
|
//.final_bill_amount
|
|
var tot_r = data[0]['counter'];
|
|
total = '';
|
|
for (var z = 0; z < tot_r; z++) {
|
|
// console.log(data[z].product_list)
|
|
// total =data[z].total_amount;
|
|
|
|
$("#product_list" + z).val(data[z].product_list);
|
|
$("#rate_per_unit" + z).val(data[z].rate_per_unit);
|
|
$("#qty" + z).val(data[z].qty);
|
|
// $("#total_before_discount" + z).val(data[z].total_before_discount);
|
|
// $("#discount_percentage" + z).val(data[z].discount_percentage);
|
|
// $("#discount_amount" + z).val(data[z].discount_amount);
|
|
// $("#total_after_discount" + z).val(data[z].total_after_discount);
|
|
// $("#tax_code1" + z).val(data[z].tax_code1);
|
|
// $("#tax_rate1" + z).val(data[z].tax_rate1);
|
|
// $("#tax_code2" + z).val(data[z].tax_code2);
|
|
// $("#tax_rate2" + z).val(data[z].tax_rate2);
|
|
// $("#hsn_code" + z).val(data[z].hsn_code);
|
|
// $("#total_tax" + z).val(data[z].total_tax);
|
|
|
|
$("#total_amount" + z).val(data[z].total_amount);
|
|
if (tot_r - z > 1) {
|
|
addrow_rows();
|
|
}
|
|
// calculatetotaltax(z);
|
|
calculatetotalamount(z);
|
|
// calculatetotalamount();
|
|
//if(data[z].total_amount!='')
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('.select2').select2()
|
|
// $('#modal-add-staff').modal("show");
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Populating Bill Details');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
function caluculateQty(count) {
|
|
|
|
var total = "";
|
|
// var tbd="";
|
|
// var tad="";
|
|
// var ttax="";
|
|
|
|
var ref = $("#qty" + count).val();
|
|
console.log("the qty is " + ref);
|
|
if (ref == "" || ref == 0 || ref == null || ref == " ") {
|
|
ref = 1;
|
|
$("#qty" + count).val(1);
|
|
}
|
|
console.log("the qty is " + ref);
|
|
var gg = $("#rate_per_unit" + count).val();
|
|
// var dis = $("#discount_percentage" + count).val();
|
|
|
|
// var tx1 = $("#tax_rate1" + count).val();
|
|
// var tx2 = $("#tax_rate2" + count).val();
|
|
|
|
|
|
tbd = ref * gg;
|
|
console.log("the bill amt for " + count + " is " + tbd);
|
|
// var tbd = $("#total_before_discount" + count).val(tbd);
|
|
// td = (((ref * gg) * dis) / 100);
|
|
// var td = $("#discount_amount" + count).val(td);
|
|
// // tad=tbd-((tbd*dis)/100);
|
|
// tad = ref * gg - (((ref * gg) * dis) / 100);
|
|
// var tad = $("#total_after_discount" + count).val(tad);
|
|
// ttax = ((((ref * gg - (((ref * gg) * dis) / 100)) * (tx1)) / 100) + (((ref * gg - (((ref * gg) *
|
|
// dis) / 100)) * (tx2)) / 100));
|
|
// var ttax = $("#total_tax" + count).val(Number(ttax));
|
|
// total = ref * gg - (((ref * gg) * dis) / 100) + ((((ref * gg - (((ref * gg) * dis) / 100)) * (
|
|
// tx1)) / 100) + (((ref * gg - (((ref * gg) * dis) / 100)) * (tx2)) / 100));
|
|
|
|
|
|
|
|
$("#total_amount" + count).val(tbd);
|
|
|
|
|
|
// Calculate Vetical total
|
|
var counter = $("#count_items").val();
|
|
var tot_qty = "";
|
|
for (var i = 0; i < counter; i++) {
|
|
tot_qty = Number(tot_qty) + Number($("#qty" + i).val());
|
|
// console.log(tot_qty);
|
|
}
|
|
|
|
$("#total_qty").val(tot_qty);
|
|
// calculatetotaltax(count);
|
|
|
|
calculatetotalamount(count);
|
|
// $("#final_bill_amount").val($("#total").val());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// function calculateRate(count) {
|
|
|
|
|
|
|
|
|
|
|
|
// var counter = $("#count_items").val();
|
|
// var tot_rate = "";
|
|
// for (var i = 0; i < counter; i++) {
|
|
// tot_rate = Number(tot_rate) + Number($("#rate_per_unit" + i).val());
|
|
// // console.log(tot_rate);
|
|
// }
|
|
|
|
// $("#total_rate_per_unit").val(tot_rate);
|
|
// showall();
|
|
|
|
// }
|
|
|
|
|
|
// function calculateDiscount(count) {
|
|
|
|
|
|
|
|
|
|
|
|
// var counter = $("#count_items").val();
|
|
// var tot_dis = "";
|
|
// for (var i = 0; i < counter; i++) {
|
|
// tot_dis = Number(tot_dis) + Number($("#discount_percentage" + i).val());
|
|
// // console.log(tot_dis);
|
|
// }
|
|
|
|
// $("#total_discount_percentage").val(tot_dis);
|
|
// caluculateQty(count);
|
|
// }
|
|
|
|
|
|
// function calculatediscountamount(count) {
|
|
|
|
|
|
|
|
|
|
|
|
// var counter = $("#count_items").val();
|
|
// var tot_damount = "";
|
|
// for (var i = 0; i < counter; i++) {
|
|
// tot_damount = Number(tot_damount) + Number($("#discount_amount" + i).val());
|
|
// // console.log(tot_damount);
|
|
// }
|
|
|
|
// $("#total_discount_amount").val(tot_damount);
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// function calculatetaxrate1(count) {
|
|
|
|
// var counter = $("#count_items").val();
|
|
// var tot_tx1 = "";
|
|
// for (var i = 0; i < counter; i++) {
|
|
// tot_tx1 = Number(tot_tx1) + Number($("#tax_rate1" + i).val());
|
|
// // console.log(tot_tx1);
|
|
// }
|
|
|
|
// $("#total_tax_rate1").val(tot_tx1);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
// function calculatetaxrate2(count) {
|
|
|
|
// var counter = $("#count_items").val();
|
|
// var tot_tx2 = "";
|
|
// for (var i = 0; i < counter; i++) {
|
|
// tot_tx2 = Number(tot_tx2) + Number($("#tax_rate2" + i).val());
|
|
// // console.log(tot_tx2);
|
|
// }
|
|
|
|
// $("#total_tax_rate2").val(tot_tx2);
|
|
|
|
|
|
|
|
// }
|
|
|
|
// function calculatetotalbeforediscount(count) {
|
|
|
|
// var counter = $("#count_items").val();
|
|
// var tot_bd = "";
|
|
// for (var i = 0; i < counter; i++) {
|
|
// tot_bd = Number(tot_bd) + Number($("#total_before_discount" + i).val());
|
|
// // console.log(tot_bd);
|
|
// }
|
|
|
|
// $("#total_amount_bf_discount").val(tot_bd);
|
|
// }
|
|
|
|
|
|
// function calculatetotalafterdiscount(count) {
|
|
|
|
// var counter = $("#count_items").val();
|
|
// var tot_ad = "";
|
|
// for (var i = 0; i < counter; i++) {
|
|
// tot_ad = Number(tot_ad) + Number($("#total_after_discount" + i).val());
|
|
// // console.log(tot_ad);
|
|
// }
|
|
|
|
// $("#total_afterdiscount").val(tot_ad);
|
|
// }
|
|
|
|
|
|
// function calculatetotaltax(count) {
|
|
|
|
// var counter = $("#count_items").val();
|
|
// var tot_tax = "";
|
|
// for (var i = 0; i < counter; i++) {
|
|
// tot_tax = Number(tot_tax) + Number($("#total_tax" + i).val());
|
|
// // console.log(tot_tax);
|
|
// }
|
|
|
|
// $("#totaltax").val(tot_tax);
|
|
// }
|
|
function myDateFormater(myDate) {
|
|
|
|
var d = new Date(myDate);
|
|
|
|
var m = d.getMonth() + 1;
|
|
|
|
var y = d.getFullYear();
|
|
|
|
var date = d.getDate();
|
|
|
|
// alert(date+"/"+m+"/"+y);
|
|
|
|
return date + "/" + m + "/" + y;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
function calculatetotalamount(count) {
|
|
|
|
var counter = $("#count_items").val();
|
|
var tot_am = "";
|
|
for (var i = 0; i < counter; i++) {
|
|
tot_am = Number(tot_am) + Number($("#total_amount" + i).val());
|
|
// console.log(tot_am);
|
|
}
|
|
|
|
$("#total").val(tot_am);
|
|
}
|
|
|
|
|
|
// function showcompany() {
|
|
|
|
// var bpatient = $("#amount_paid_patient").val();
|
|
// var btotal = $("#final_bill_amount").val();
|
|
// acompany = btotal - bpatient;
|
|
|
|
// $("#amount_pending_company").val(acompany);
|
|
// }
|
|
|
|
function myDateFormat(date) {
|
|
|
|
var d = new Date(date);
|
|
var day = d.getDate();
|
|
var m = d.getMonth() + 1;
|
|
var y = d.getFullYear();
|
|
|
|
|
|
return day + "-" + m + "-" + y;
|
|
|
|
|
|
}
|
|
</script>
|
|
<?php include('common_bill.php'); ?>
|
|
<?php include('techsyn_footer.php'); ?>
|
|
|
|
|
|
<script>
|
|
// var client_id = "";
|
|
|
|
// function showClient(id) {
|
|
// $.ajax({
|
|
// url: 'select_client_list.php?id=' + id + ' ',
|
|
// type: 'POST',
|
|
// success: function(data) {
|
|
// //alert(data);
|
|
// var data = $.parseJSON(data);
|
|
|
|
// $("#client_id").val(data.client_name);
|
|
// console.log("client_id" + data.client_name);
|
|
// },
|
|
// error: function(data) {
|
|
// BootstrapDialog.alert('Error Populating');
|
|
// return;
|
|
// }
|
|
// });
|
|
// }
|
|
|
|
|
|
// function showamount(voucher_id) {
|
|
// console.log("Voucher" + voucher_id);
|
|
// if (voucher_id == 'none') {
|
|
// $("#final_bill_amount").val($("#total").val());
|
|
// $("#amount_paid_patient").val($("#total").val());
|
|
// $("#amount_pending_company").val('');
|
|
|
|
// } else {
|
|
|
|
// $.ajax({
|
|
// url: 'select_amount_list.php?voucher_id=' + voucher_id + ' ',
|
|
// type: 'POST',
|
|
// success: function(data) {
|
|
// // alert(data);
|
|
// var data = $.parseJSON(data);
|
|
// var dp = Number(data.discount_percentage);
|
|
// var bill = "";
|
|
|
|
// console.log(dp);
|
|
// var tot = $("#total").val();
|
|
// console.log(tot);
|
|
// bill = tot - ((tot * dp) / 100);
|
|
// console.log(bill);
|
|
|
|
// $("#final_bill_amount").val(bill);
|
|
// $("#amount_paid_patient").val(bill);
|
|
|
|
// // if(bill<$("#amount_paid_patient").val())
|
|
// // {
|
|
// // $("#amount_paid_patient").val('');
|
|
// // $("#amount_pending_company").val('');
|
|
// // }else
|
|
// // {
|
|
|
|
// // // $("#final_bill_amount").val()-$("#amount_paid_patient").val();
|
|
// // $("#amount_pending_company").val($("#final_bill_amount").val()-$("#amount_paid_patient").val());
|
|
// // // $("#amount_paid_patient").val();
|
|
// // }
|
|
|
|
// //amount_pending_company
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // console.log(data.final_bill_amount);
|
|
// },
|
|
// error: function(data) {
|
|
// BootstrapDialog.alert('Error Populating');
|
|
// return;
|
|
// }
|
|
// });
|
|
// }
|
|
// }
|
|
|
|
|
|
// var client_id = "";
|
|
function showall(product_id, count) {
|
|
$.ajax({
|
|
async: false,
|
|
url: 'select_all_list.php?product_id=' + product_id + ' ',
|
|
type: 'POST',
|
|
success: function(data) {
|
|
//alert(data);
|
|
var data = $.parseJSON(data);
|
|
|
|
$("#rate_per_unit" + count).val(data.rate_per_unit);
|
|
// $("#discount_percentage" + count).val(data.discount_percentage);
|
|
// $("#tax_code1" + count).val(data.tax_code1);
|
|
// $("#tax_rate1" + count).val(data.tax_rate1);
|
|
// $("#tax_code2" + count).val(data.tax_code2);
|
|
// $("#tax_rate2" + count).val(data.tax_rate2);
|
|
// $("#hsn_code" + count).val(data.hsn_code);
|
|
|
|
// calculateRate();
|
|
// calculateDiscount();
|
|
// calculatediscountamount();
|
|
// calculatetaxrate1();
|
|
// calculatetaxrate2();
|
|
// calculatetotalbeforediscount();
|
|
// calculatetotalafterdiscount();
|
|
// calculatetotaltax();
|
|
// calculatetotalamount();
|
|
caluculateQty(count);
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Populating');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
function save_new_patient() {
|
|
$.ajax({
|
|
url: 'save_quick_patient_register.php',
|
|
type: 'POST',
|
|
data: $("#bill_form").serialize(),
|
|
success: function(data) {
|
|
var data = $.parseJSON(data);
|
|
if (data['status'] == "success") {
|
|
BootstrapDialog.confirm(
|
|
'Patient is register with minimum details. Please click on OK',
|
|
function(result) {
|
|
if (result) {
|
|
location.reload();
|
|
}
|
|
|
|
});
|
|
} else {
|
|
BootstrapDialog.alert("Something Went Wrong!");
|
|
}
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Saving Patient Details');
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
function save_bill() {
|
|
console.log($("#bill_form").serialize());
|
|
// var sub_category_id;
|
|
$.ajax({
|
|
url: 'save_bill.php',
|
|
type: 'POST',
|
|
data: $("#bill_form").serialize(),
|
|
|
|
|
|
success: function(data) {
|
|
BootstrapDialog.alert('Bill Details Saved Successfully');
|
|
$("#bill_id").val("");
|
|
$("#bill_no").val("");
|
|
$("#bill_date").val("");
|
|
$("patient_id").val("");
|
|
// $("client_id").val("");
|
|
// $("#total_amount_bf_discount").val("");
|
|
// $("#total_discount_amount").val("");
|
|
// $("#discount_voucher").val("");
|
|
// $("#final_bill_amount").val("");
|
|
// $("#amount_paid_patient").val("");
|
|
// $("#amount_pending_company").val("");
|
|
// $("#bill_status").val("");
|
|
|
|
|
|
$("#flex1").flexReload();
|
|
return;
|
|
},
|
|
error: function(data) {
|
|
BootstrapDialog.alert('Error Saving Bill Details');
|
|
return;
|
|
}
|
|
});
|
|
$('.close').click();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$('#bill_date').datepicker({
|
|
|
|
autoclose: true,
|
|
|
|
|
|
|
|
format: 'dd/mm/yyyy',
|
|
|
|
//startDate: '1d/1m/2000y',
|
|
|
|
endDate: 'current',
|
|
|
|
todayHighlight: true,
|
|
|
|
// todayHighlight: true,
|
|
|
|
|
|
|
|
}).next().on(ace.click_event, function() {
|
|
|
|
$(this).prev().focus();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function validate_new_patient() {
|
|
|
|
var patient_name = $('#new_patient_name').val();
|
|
if (patient_name == '' || patient_name == null) {
|
|
BootstrapDialog.alert('Please Enter Name.!!!');
|
|
return false;
|
|
}
|
|
|
|
var dob = $('#dob').val();
|
|
// alert(dob);
|
|
if (dob == '' || dob == null) {
|
|
BootstrapDialog.alert('Please Enter DOB.!!!');
|
|
return false;
|
|
}
|
|
var gender = $('#gender').val();
|
|
if (gender == '' || gender == null) {
|
|
BootstrapDialog.alert('Please Enter Gender.!!!');
|
|
return false;
|
|
}
|
|
var phone_no = $('#phone_no').val();
|
|
if (phone_no == '' || phone_no == null) {
|
|
BootstrapDialog.alert('Please Enter Phone number.!!!');
|
|
return false;
|
|
}
|
|
|
|
if (phone_no.length < 10) {
|
|
BootstrapDialog.alert('Please Enter Valid number with 10 Digits.!!!');
|
|
return false;
|
|
}
|
|
|
|
save_new_patient();
|
|
}
|
|
|
|
|
|
|
|
function validate() {
|
|
|
|
|
|
// var discount_voucher = $('#discount_voucher').val();
|
|
// alert(discount_voucher);
|
|
// if (discount_voucher == '' || discount_voucher == null) {
|
|
|
|
// BootstrapDialog.alert('Please Enter Discount Voucher info.!!!');
|
|
|
|
// return false;
|
|
|
|
// }
|
|
var patient_id = $('#patient_id').val();
|
|
if (patient_id == '') {
|
|
|
|
BootstrapDialog.alert('Please Select Patient.!!!');
|
|
|
|
return false;
|
|
|
|
}
|
|
// var amount_paid_patient = $('#amount_paid_patient').val();
|
|
// if (amount_paid_patient == '') {
|
|
|
|
// BootstrapDialog.alert('Please Enter amount paid by patient.!!!');
|
|
|
|
// return false;
|
|
|
|
// }
|
|
// var amount_pending_company = $('#amount_pending_company').val();
|
|
// if (amount_pending_company == '') {
|
|
|
|
// BootstrapDialog.alert('Please Enter Amount Pending Companyt.!!!');
|
|
|
|
// return false;
|
|
|
|
// }
|
|
var bill_no = $('#bill_no').val();
|
|
|
|
|
|
save_bill();
|
|
}
|
|
$('.select2').select2()
|
|
</script>
|
|
|
|
<style>
|
|
#modal-add-ailment {
|
|
overflow-y: scroll;
|
|
}
|
|
</style>
|
|
|
|
|
|
|
|
<?php include('techsyn_footer.php'); ?>
|
|
<script type="text/javascript">
|
|
jQuery(function($) {
|
|
|
|
var myTable =
|
|
$('#dynamic-table')
|
|
|
|
.DataTable({
|
|
bAutoWidth: false,
|
|
"aoColumns": [{
|
|
"bSortable": false
|
|
},
|
|
null, null, null, null, null,
|
|
{
|
|
"bSortable": false
|
|
}
|
|
],
|
|
|
|
"aaSorting": [],
|
|
|
|
|
|
|
|
|
|
|
|
select: {
|
|
style: 'multi'
|
|
}
|
|
});
|
|
|
|
|
|
|
|
|
|
var defaultCopyAction = myTable.button(1).action();
|
|
myTable.button(1).action(function(e, dt, button, config) {
|
|
defaultCopyAction(e, dt, button, config);
|
|
$('.dt-button-info').addClass(
|
|
'gritter-item-wrapper gritter-info gritter-center white');
|
|
});
|
|
|
|
|
|
var defaultColvisAction = myTable.button(0).action();
|
|
myTable.button(0).action(function(e, dt, button, config) {
|
|
|
|
defaultColvisAction(e, dt, button, config);
|
|
|
|
|
|
if ($('.dt-button-collection > .dropdown-menu').length == 0) {
|
|
$('.dt-button-collection')
|
|
.wrapInner(
|
|
'<ul class="dropdown-menu dropdown-light dropdown-caret dropdown-caret" />'
|
|
)
|
|
.find('a').attr('href', '#').wrap("<li />")
|
|
}
|
|
$('.dt-button-collection').appendTo('.tableTools-container .dt-buttons')
|
|
});
|
|
|
|
|
|
|
|
setTimeout(function() {
|
|
$($('.tableTools-container')).find('a.dt-button').each(function() {
|
|
var div = $(this).find(' > div').first();
|
|
if (div.length == 1) div.tooltip({
|
|
container: 'body',
|
|
title: div.parent().text()
|
|
});
|
|
else $(this).tooltip({
|
|
container: 'body',
|
|
title: $(this).text()
|
|
});
|
|
});
|
|
}, 500);
|
|
|
|
|
|
|
|
|
|
|
|
myTable.on('select', function(e, dt, type, index) {
|
|
if (type === 'row') {
|
|
$(myTable.row(index).node()).find('input:checkbox').prop('checked', true);
|
|
}
|
|
});
|
|
myTable.on('deselect', function(e, dt, type, index) {
|
|
if (type === 'row') {
|
|
$(myTable.row(index).node()).find('input:checkbox').prop('checked', false);
|
|
}
|
|
});
|
|
|
|
|
|
|
|
|
|
$('th input[type=checkbox], td input[type=checkbox]').prop('checked', false);
|
|
|
|
|
|
$('#dynamic-table > thead > tr > th input[type=checkbox], #dynamic-table_wrapper input[type=checkbox]')
|
|
.eq(0).on('click', function() {
|
|
var th_checked = this.checked;
|
|
|
|
$('#dynamic-table').find('tbody > tr').each(function() {
|
|
var row = this;
|
|
if (th_checked) myTable.row(row).select();
|
|
else myTable.row(row).deselect();
|
|
});
|
|
});
|
|
|
|
|
|
$('#dynamic-table').on('click', 'td input[type=checkbox]', function() {
|
|
var row = $(this).closest('tr').get(0);
|
|
if (this.checked) myTable.row(row).deselect();
|
|
else myTable.row(row).select();
|
|
});
|
|
|
|
|
|
|
|
$(document).on('click', '#dynamic-table .dropdown-toggle', function(e) {
|
|
e.stopImmediatePropagation();
|
|
e.stopPropagation();
|
|
e.preventDefault();
|
|
});
|
|
|
|
|
|
|
|
|
|
var active_class = 'active';
|
|
$('#simple-table > thead > tr > th input[type=checkbox]').eq(0).on('click', function() {
|
|
var th_checked = this.checked;
|
|
|
|
$(this).closest('table').find('tbody > tr').each(function() {
|
|
var row = this;
|
|
if (th_checked) $(row).addClass(active_class).find(
|
|
'input[type=checkbox]').eq(0).prop('checked', true);
|
|
else $(row).removeClass(active_class).find('input[type=checkbox]')
|
|
.eq(0).prop('checked', false);
|
|
});
|
|
});
|
|
|
|
$('#simple-table').on('click', 'td input[type=checkbox]', function() {
|
|
var $row = $(this).closest('tr');
|
|
if ($row.is('.detail-row ')) return;
|
|
if (this.checked) $row.addClass(active_class);
|
|
else $row.removeClass(active_class);
|
|
});
|
|
|
|
|
|
|
|
|
|
$('[data-rel="tooltip"]').tooltip({
|
|
placement: tooltip_placement
|
|
});
|
|
|
|
|
|
function tooltip_placement(context, source) {
|
|
var $source = $(source);
|
|
var $parent = $source.closest('table')
|
|
var off1 = $parent.offset();
|
|
var w1 = $parent.width();
|
|
|
|
var off2 = $source.offset();
|
|
|
|
|
|
if (parseInt(off2.left) < parseInt(off1.left) + parseInt(w1 / 2)) return 'right';
|
|
return 'left';
|
|
}
|
|
|
|
|
|
|
|
|
|
/***************/
|
|
$('.show-details-btn').on('click', function(e) {
|
|
e.preventDefault();
|
|
$(this).closest('tr').next().toggleClass('open');
|
|
$(this).find(ace.vars['.icon']).toggleClass('fa-angle-double-down').toggleClass(
|
|
'fa-angle-double-up');
|
|
});
|
|
/***************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
$('.date-picker').datepicker({
|
|
autoclose: true,
|
|
format: 'dd/mm/yyyy'
|
|
}).next().on(ace.click_event, function() {
|
|
$(this).prev().focus();
|
|
});
|
|
</script>
|
|
<!-- bootstrap & fontawesome -->
|
|
<link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />
|
|
|
|
<!-- page specific plugin styles -->
|
|
<link rel="stylesheet" href="assets/css/jquery-ui.custom.min.css" />
|
|
<link rel="stylesheet" href="assets/css/chosen.min.css" />
|
|
<link rel="stylesheet" href="assets/css/bootstrap-datepicker3.min.css" />
|
|
<link rel="stylesheet" href="assets/css/bootstrap-timepicker.min.css" />
|
|
<link rel="stylesheet" href="assets/css/daterangepicker.min.css" />
|
|
<link rel="stylesheet" href="assets/css/bootstrap-datetimepicker.min.css" />
|
|
<link rel="stylesheet" href="assets/css/bootstrap-colorpicker.min.css" />
|
|
<script type="text/javascript" src="js/typeahead.bundle.js"></script>
|
|
<script src="assets/js/jquery-ui.custom.min.js"></script>
|
|
<script src="assets/js/jquery.ui.touch-punch.min.js"></script>
|
|
<script src="assets/js/chosen.jquery.min.js"></script>
|
|
<script src="assets/js/spinbox.min.js"></script>
|
|
<script src="assets/js/bootstrap-datepicker.min.js"></script>
|
|
<script src="assets/js/bootstrap-timepicker.min.js"></script>
|
|
<script src="assets/js/jquery.dataTables.min.js"></script>
|
|
<script src="assets/js/jquery.dataTables.bootstrap.min.js"></script>
|
|
<script src="assets/js/dataTables.buttons.min.js"></script>
|
|
<script src="assets/js/buttons.flash.min.js"></script>
|
|
<script src="assets/js/buttons.html5.min.js"></script>
|
|
<script src="assets/js/buttons.print.min.js"></script>
|
|
<script src="assets/js/buttons.colVis.min.js"></script>
|
|
<script src="assets/js/dataTables.select.min.js"></script>
|
|
|
|
|
|
<script src="assets/js/moment.min.js"></script>
|
|
<script src="assets/js/daterangepicker.min.js"></script>
|
|
<script src="assets/js/bootstrap-datetimepicker.min.js"></script>
|
|
<script src="assets/js/bootstrap-colorpicker.min.js"></script>
|
|
<script src="assets/js/jquery.knob.min.js"></script>
|
|
<script src="assets/js/autosize.min.js"></script>
|
|
<script src="assets/js/jquery.inputlimiter.min.js"></script>
|
|
<script src="assets/js/jquery.maskedinput.min.js"></script>
|
|
<script src="assets/js/bootstrap-tag.min.js"></script>
|
|
<script src="assets/js/ace-elements.min.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
var counter = $("#count_items").val();
|
|
var itemOptions =
|
|
"<?php echo generateOption('product_service_master', 'product_name', 'product_id', $row['product_id'], ''); ?>";
|
|
|
|
function addrow_rows() {
|
|
var counter = $("#count_items").val();
|
|
var newRow = $("<tr>");
|
|
var cols = "";
|
|
var select_treatment = "";
|
|
select_treatment += "<select ";
|
|
select_treatment += "id=\"product_list" + counter + "\"name=\"product_list" + counter +
|
|
"\" onchange=\"showall(this.value," + counter +
|
|
")\" class=\"form-control select2\" style=\"width:100%;\" data-placeholder=\"Choose a product...\"";
|
|
|
|
//select_treatment+="style=\"display: none;\"";
|
|
select_treatment += ">";
|
|
|
|
select_treatment += "<option value=\"\"> </option>";
|
|
select_treatment += itemOptions
|
|
select_treatment += "</select>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cols += '<td>' + select_treatment + '</td>';
|
|
cols += '<td><input type="number" class="form-control" onchange="calculateRate"(' + counter +
|
|
')" id="rate_per_unit' + counter + '" name="rate_per_unit' + counter + '" readonly /></td>';
|
|
cols += '<td><input type="number" class="form-control" onchange="caluculateQty(' + counter +
|
|
')" id="qty' + counter + '" name="qty' + counter + '"/></td>';
|
|
// cols += '<td><input type="number" class="form-control" id="total_before_discount' + counter +
|
|
// '" name="total_before_discount' + counter + '"/></td>';
|
|
// cols += '<td><input type="number" class="form-control" onchange="calculateDiscount(' + counter +
|
|
// ')" id="discount_percentage' + counter + '" name="discount_percentage' + counter + '" /></td>';
|
|
// cols += '<td><input type="number" class="form-control" id="discount_amount' + counter +
|
|
// '" name="discount_amount' + counter + '" /></td>';
|
|
// cols += '<td><input type="number" class="form-control" id="total_after_discount' + counter +
|
|
// '" name="total_after_discount' + counter + '"/></td>';
|
|
|
|
// cols += '<td><input type="text" class="form-control" id="tax_code1' + counter +
|
|
// '" name="tax_code1' + counter + '" readonly/></td>';
|
|
// cols += '<td><input type="number" class="form-control" onchange="caluculateQty(' + counter +
|
|
// ')" id="tax_rate1' + counter + '" name="tax_rate1' + counter + '" readonly /></td>';
|
|
// cols += '<td><input type="text" class="form-control" id="tax_code2' + counter +
|
|
// '" name="tax_code2' + counter + '" readonly/></td>';
|
|
// cols += '<td><input type="number" class="form-control" onchange="caluculateQty(' + counter +
|
|
// ')" id="tax_rate2' + counter + '" name="tax_rate2' + counter + '" readonly /></td>';
|
|
// cols += '<td><input type="text" class="form-control" id="hsn_code' + counter + '" name="hsn_code' +
|
|
// counter + '" readonly/></td>';
|
|
// cols += '<td><input type="number" class="form-control" id="total_tax' + counter +
|
|
// '" name="total_tax' + counter + '"/></td>';
|
|
|
|
cols += '<td><input type="number" class="form-control" id="total_amount' + counter +
|
|
'" name="total_amount' + counter + '"/></td>';
|
|
|
|
|
|
cols +=
|
|
'<td align="center"><a href="#" class="btn-lg" data-toggle="tooltip" id="deletebtn" title="Delete"><span class="glyphicon glyphicon-trash"></span></a></td>';
|
|
newRow.append(cols);
|
|
$("table.order-list").append(newRow);
|
|
/*$('#item_id'+counter).chosen({allow_single_deselect:true});
|
|
$('#item_id'+counter).next().css({'width': $('#item_id'+counter).parent().width()});*/
|
|
|
|
counter++;
|
|
$('.select2').select2();
|
|
|
|
$("#count_items").val(counter);
|
|
$('.date-picker').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true
|
|
})
|
|
}
|
|
|
|
|
|
|
|
$("table.order-list").on("click", "#deletebtn", function(event) {
|
|
$(this).closest("tr").remove();
|
|
counter -= 1;
|
|
$("#count_items").val(counter);
|
|
});
|
|
|
|
$(document).ready(function() {});
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
function checkAge() {
|
|
//ALTER TABLE `patient_master` ADD `patient_age` INT NOT NULL AFTER `dob`;
|
|
var dob = $("#dob").val();
|
|
console.log(dob);
|
|
age = getAge(dob);
|
|
console.log(age);
|
|
$("#emp_age").val(age);
|
|
}
|
|
jQuery(function($) {
|
|
$('#id-disable-check').on('click', function() {
|
|
var inp = $('#form-input-readonly').get(0);
|
|
if (inp.hasAttribute('disabled')) {
|
|
inp.setAttribute('readonly', 'true');
|
|
inp.removeAttribute('disabled');
|
|
inp.value = "This text field is readonly!";
|
|
} else {
|
|
inp.setAttribute('disabled', 'disabled');
|
|
inp.removeAttribute('readonly');
|
|
inp.value = "This text field is disabled!";
|
|
}
|
|
});
|
|
|
|
|
|
if (!ace.vars['touch']) {
|
|
$('.chosen-select').chosen({
|
|
allow_single_deselect: true
|
|
});
|
|
|
|
|
|
$(window)
|
|
.off('resize.chosen')
|
|
.on('resize.chosen', function() {
|
|
$('.chosen-select').each(function() {
|
|
var $this = $(this);
|
|
$this.next().css({
|
|
'width': $this.parent().width()
|
|
});
|
|
})
|
|
}).trigger('resize.chosen');
|
|
//resize chosen on sidebar collapse/expand
|
|
$(document).on('settings.ace.chosen', function(e, event_name, event_val) {
|
|
if (event_name != 'sidebar_collapsed') return;
|
|
$('.chosen-select').each(function() {
|
|
var $this = $(this);
|
|
$this.next().css({
|
|
'width': $this.parent().width()
|
|
});
|
|
})
|
|
});
|
|
|
|
|
|
$('#chosen-multiple-style .btn').on('click', function(e) {
|
|
var target = $(this).find('input[type=radio]');
|
|
var which = parseInt(target.val());
|
|
if (which == 2) $('#form-field-select-4').addClass('tag-input-style');
|
|
else $('#form-field-select-4').removeClass('tag-input-style');
|
|
});
|
|
}
|
|
|
|
|
|
$('[data-rel=tooltip]').tooltip({
|
|
container: 'body'
|
|
});
|
|
$('[data-rel=popover]').popover({
|
|
container: 'body'
|
|
});
|
|
|
|
autosize($('textarea[class*=autosize]'));
|
|
|
|
$('textarea.limited').inputlimiter({
|
|
remText: '%n character%s remaining...',
|
|
limitText: 'max allowed : %n.'
|
|
});
|
|
|
|
|
|
|
|
|
|
//"jQuery UI Slider"
|
|
//range slider tooltip example
|
|
$("#slider-range").css('height', '200px').slider({
|
|
orientation: "vertical",
|
|
range: true,
|
|
min: 0,
|
|
max: 100,
|
|
values: [17, 67],
|
|
slide: function(event, ui) {
|
|
var val = ui.values[$(ui.handle).index() - 1] + "";
|
|
|
|
if (!ui.handle.firstChild) {
|
|
$("<div class='tooltip right in' style='display:none;left:16px;top:-6px;'><div class='tooltip-arrow'></div><div class='tooltip-inner'></div></div>")
|
|
.prependTo(ui.handle);
|
|
}
|
|
$(ui.handle.firstChild).show().children().eq(1).text(val);
|
|
}
|
|
}).find('span.ui-slider-handle').on('blur', function() {
|
|
$(this.firstChild).hide();
|
|
});
|
|
|
|
|
|
$("#slider-range-max").slider({
|
|
range: "max",
|
|
min: 1,
|
|
max: 10,
|
|
value: 2
|
|
});
|
|
|
|
$("#slider-eq > span").css({
|
|
width: '90%',
|
|
'float': 'left',
|
|
margin: '15px'
|
|
}).each(function() {
|
|
// read initial values from markup and remove that
|
|
var value = parseInt($(this).text(), 10);
|
|
$(this).empty().slider({
|
|
value: value,
|
|
range: "min",
|
|
animate: true
|
|
|
|
});
|
|
});
|
|
|
|
$("#slider-eq > span.ui-slider-purple").slider('disable'); //disable third item
|
|
|
|
|
|
$('#id-input-file-1 , #id-input-file-2').ace_file_input({
|
|
no_file: 'No File ...',
|
|
btn_choose: 'Choose',
|
|
btn_change: 'Change',
|
|
droppable: false,
|
|
onchange: null,
|
|
thumbnail: false //| true | large
|
|
//whitelist:'gif|png|jpg|jpeg'
|
|
//blacklist:'exe|php'
|
|
//onchange:''
|
|
//
|
|
});
|
|
//pre-show a file name, for example a previously selected file
|
|
//$('#id-input-file-1').ace_file_input('show_file_list', ['myfile.txt'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//datepicker plugin
|
|
//link
|
|
$('.date-picker').datepicker({
|
|
autoclose: true,
|
|
todayHighlight: true
|
|
})
|
|
//show datepicker when clicking on the icon
|
|
.next().on(ace.click_event, function() {
|
|
$(this).prev().focus();
|
|
});
|
|
|
|
|
|
|
|
//chosen plugin inside a modal will have a zero width because the select element is originally hidden
|
|
//and its width cannot be determined.
|
|
//so we set the width after modal is show
|
|
$('#modal-form').on('shown.bs.modal', function() {
|
|
if (!ace.vars['touch']) {
|
|
$(this).find('.chosen-container').each(function() {
|
|
$(this).find('a:first-child').css('width', '210px');
|
|
$(this).find('.chosen-drop').css('width', '210px');
|
|
$(this).find('.chosen-search input').css('width', '200px');
|
|
});
|
|
}
|
|
})
|
|
/**
|
|
//or you can activate the chosen plugin after modal is shown
|
|
//this way select element becomes visible with dimensions and chosen works as expected
|
|
$('#modal-form').on('shown', function () {
|
|
$(this).find('.modal-chosen').chosen();
|
|
})
|
|
*/
|
|
|
|
|
|
|
|
$(document).one('ajaxloadstart.page', function(e) {
|
|
autosize.destroy('textarea[class*=autosize]')
|
|
|
|
$('.limiterBox,.autosizejs').remove();
|
|
$('.daterangepicker.dropdown-menu,.colorpicker.dropdown-menu,.bootstrap-datetimepicker-widget.dropdown-menu')
|
|
.remove();
|
|
});
|
|
|
|
});
|
|
//
|
|
</script>
|