?
Current Path : /home1/savoy/public_html/savoyglobal.net/sibs_draft/system/application/views/HR/ |
Linux gator3171.hostgator.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 |
Current File : /home1/savoy/public_html/savoyglobal.net/sibs_draft/system/application/views/HR/hrfunctions.php |
<script type="text/javascript"> function calculteallowancetotal(val,mode,count) { var basicsalary=$("input#basicsalary").val(); if(!basicsalary) { alert("Please set basic salary") } else { if(mode==0) { val=parseFloat(basicsalary)*parseFloat(val)*0.01; } $('input#alltotal_'+count).val(val); var allowcount=$("input#allowcount").val(); var deduction=$("input#deduction").val(); var sumallow=0; for(var i=1;i<allowcount;i++) { var allowamount=$("input#alltotal_"+i).val(); if(allowamount) sumallow+=parseFloat(allowamount); } $('input#allowance').val(sumallow); var commission=$("input#commission").val(); var grosssalary=parseFloat(sumallow)+parseFloat(basicsalary); var netsalary=parseFloat(grosssalary)-parseFloat(deduction); var payamount=parseFloat(netsalary)+parseFloat(commission); $('input#grosssalary').val(grosssalary); $('input#netsalary').val(netsalary); $('input#payamount').val(payamount); } } function calcultedeductiontotal(val,mode,count) { var basicsalary=$("input#basicsalary").val(); if(!basicsalary) { alert("Please set basic salary") } else { if(mode==0) { val=parseFloat(basicsalary)*parseFloat(val)*0.01; } $("input#dedtotal_"+count).val(val); var dedcount=$("input#dedcount").val(); var allowance=$("input#allowance").val(); var sumded=0; for(var i=1;i<dedcount;i++) { var dedamount=$("input#dedtotal_"+i).val(); if(dedamount) sumded+=parseFloat(dedamount); } $('input#deduction').val(sumded); var commission=$("input#commission").val(); // alert(commission) // if(isNAN(commission) || commission==null){ // commission=0; // } var grosssalary=parseFloat(allowance)+parseFloat(basicsalary); var netsalary=parseFloat(grosssalary)-parseFloat(sumded); var payamount=parseFloat(netsalary)+parseFloat(commission); $('input#grosssalary').val(grosssalary); $('input#netsalary').val(netsalary); $('input#payamount').val(payamount); } } function changebasicsalary(val) { var allowance=$("input#allowance").val(); var deduction=$("input#deduction").val(); var grosssalary=parseFloat(allowance)+parseFloat(val); var netsalary=parseFloat(grosssalary)-parseFloat(deduction); $('input#grosssalary').val(grosssalary); $('input#netsalary').val(netsalary); } function calculatepayamount(comm) { var netsalary=$("input#netsalary").val(); var commission=parseFloat(netsalary)+parseFloat(comm); $('input#payamount').val(commission); } function calculateAllpayamount(comm,emp_id) { var netsalary=$("input#netsalary_"+emp_id).val(); var commission=parseFloat(netsalary)+parseFloat(comm); $('input#payamount_'+emp_id).val(commission); } function calculteAllallowancetotal(val,mode,count,emp_id) { var basicsalary=$("input#basicsalary_"+emp_id).val(); if(!basicsalary) { alert("Please set basic salary") } else { if(mode==0) { val=parseFloat(basicsalary)*parseFloat(val)*0.01; } $('input#alltotal_'+emp_id+'_'+count).val(val); var allowcount=$("input#allowcount_"+emp_id).val(); var deduction=$("input#deduction_"+emp_id).val(); var sumallow=0; for(var i=1;i<allowcount;i++) { var allowamount=$("input#alltotal_"+emp_id+'_'+i).val(); if(allowamount) sumallow+=parseFloat(allowamount); } $('input#allowance_'+emp_id).val(sumallow); var commission=$("input#commission_"+emp_id).val(); var grosssalary=parseFloat(sumallow)+parseFloat(basicsalary); var netsalary=parseFloat(grosssalary)-parseFloat(deduction); var payamount=parseFloat(netsalary)+parseFloat(commission); $('input#grosssalary_'+emp_id).val(grosssalary); $('input#netsalary_'+emp_id).val(netsalary); $('input#payamount_'+emp_id).val(payamount); } } function calculteAlldeductiontotal(val,mode,count,emp_id) { var basicsalary=$("input#basicsalary_"+emp_id).val(); if(!basicsalary) { alert("Please set basic salary") } else { if(mode==0) { val=parseFloat(basicsalary)*parseFloat(val)*0.01; } $("input#dedtotal_"+emp_id+'_'+count).val(val); var dedcount=$("input#dedcount_"+emp_id).val(); var allowance=$("input#allowance_"+emp_id).val(); var sumded=0; for(var i=1;i<dedcount;i++) { var dedamount=$("input#dedtotal_"+emp_id+"_"+i).val(); if(dedamount) sumded+=parseFloat(dedamount); } $("input#deduction_"+emp_id).val(sumded); var commission=$("input#commission_"+emp_id).val(); var grosssalary=parseFloat(allowance)+parseFloat(basicsalary); var netsalary=parseFloat(grosssalary)-parseFloat(sumded); var payamount=parseFloat(netsalary)+parseFloat(commission); $('input#grosssalary_'+emp_id).val(grosssalary); $('input#netsalary_'+emp_id).val(netsalary); $('input#payamount_'+emp_id).val(payamount); } } </script>