?
Current Path : /home1/savoy/public_html/savoyglobal.net/rms/application/views/accounting/ |
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/rms/application/views/accounting/manage_auto_journal.php |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?> <html class="no-js" lang="en"> <head> <?php $this->load->view('jsfiles'); $this->load->view('header'); $this->load->view('commonfunctions'); $accounts=$this->mastermodel->getdatas('finance_chart_master','chart_type_id','','chart_master_id'); ?> <script type="text/javascript"> $(document).ready(function() { viewdata('accounting', 'viewinaccountingsearch', 'search_auto_journal', 'view_fixed_journal', '1'); }); function insertbankpay() { addformdata('validateform') var debit= document.getElementById('sumdebit').value; var credit= document.getElementById('sumcredit').value; if(debit!=credit) { alert('Total credit and Debit Does not match'); return false; } else if(credit<=0 ||debit<=0) { alert('Add atleast one debit and credit account'); return false; } } function checknumeric() { $('input.auto').autoNumeric(); } function add_details() { var desc=document.getElementById('code').value; var ss=document.getElementById('code'); var www=document.getElementById('code').options[ss.selectedIndex].text; var counter=parseInt($('#counter').val()); var memo=document.getElementById('memo').value; var code=document.getElementById('code').value; var debit=document.getElementById('debit').value; var credit=document.getElementById('credit').value; if((debit>=1 && credit>=1) || (debit == credit)) { alert('Enter only credit or debit at a time!'); return false; } if(!code) { alert("Select a proper account for payment!") return false; } debit = (debit < 1) ? '0' : debit; credit = (credit < 1) ? '0' : credit; var newtr = document.createElement('table'); var idname="adddivtab_"+counter; newtr.innerHTML="<tr id=nwdiv_"+counter+" >\n\ <td width='29%'>\n\ <input style='width: 125px' class='newcls' id='code_"+counter+"' name='code_"+counter+"' type='text' readonly value='"+ code +"'/></td>\n\ <td width='20%'><input style='width:135px;text-align:right;' id='debit_"+counter+"' name='debit_"+counter+"' readonly type='text' value="+debit+">\n\ </td><td width='20%'><input style='width:135px;text-align:right;' id='credit_"+counter+"' name='credit_"+counter+"' readonly type='text' value="+credit+">\n\ </td><td width='15%'><textarea readonly style='width:150px;height:50px' id='memo_"+counter+"' name='memo_"+counter+"'>"+ memo +"</textarea></td>\n\ <td width='15%'><img name='edit[]' src='<?=base_url()?>/assets/images/edit-icon.gif' width='20px' height='20px' class='clickimage' onclick='calledit_journal("+counter+")'> \n\ <img name='del[]' src='<?=base_url()?>/assets/images/delete-icon.png' width='20px' height='20px' class='clickimage' onclick='delcall_journal("+counter+")'> \n\ </td></tr>\n\ <tr style='display:none' id=eddiv_"+counter+" >\n\ <td width='29%'>\n\<input type='hidden' name='hidecode_"+counter+"' id='hidecode_"+counter+"' value='"+desc+"'/>\n\ <select style='width:185px' name='code"+counter+"' id='code"+counter+"' ><option value='"+code+"' >"+www+"</option>\n\ \n\<?php $sub_t="temp"; foreach ($accounts as $value) { if($value['chart_type_id']!=$sub_t) { $optgp= $this->mastermodel->get_single_field_value('finance_chart_type','chart_type_name','chart_type_id',$value['chart_type_id']); echo "<optgroup label='".$optgp."'>".$optgp."</optgroup>"; } echo "<option value='".$value['chart_account_code']."'>".$value["chart_account_name"].'~'.$value["chart_account_code"]."</option>"; if($value['chart_type_id']!=$sub_t) { echo ""; } $sub_t=$value['chart_type_id']; } ?> </select> \n\ <td width='20%'><input type='text' style='text-align:right;width:135px' class='auto' onfocus='checknumeric()' id='debit"+counter+"' value="+debit+">\n\ </td><td width='20%'><input type='text' style='text-align:right;width:135px' class='auto' onfocus='checknumeric()' id='credit"+counter+"' value="+credit+">\n\ </td><td width='15%'><textarea style='width:150px;height:50px' id='memo"+counter+"' >"+memo+"</textarea></td>\n\ <td width='15%'><span style='width:22px'></span><img name='ok[]' src='<?=base_url()?>/assets/images/ok-icon.png' width='22px' height='22px' class='clickimage' onclick='updatecall_journal("+counter+")'> \n\ </td></tr>"; newtr.setAttribute('id',idname); newtr.setAttribute('class', 'table'); var newval=counter+1; document.getElementById('adddiv').appendChild(newtr); document.getElementById('counter').value=newval; document.getElementById('counter_check').value=counter; debit= parseFloat(document.getElementById('sumdebit').value) + parseFloat(debit); credit= parseFloat(document.getElementById('sumcredit').value) + parseFloat(credit); debit=Math.round(debit*100)/100; credit=Math.round(credit*100)/100; document.getElementById('sumdebit').value=debit; document.getElementById('showsumdebit').value= debit.formatMoney(2, '.', ','); document.getElementById('sumcredit').value=credit; document.getElementById('showsumcredit').value= credit.formatMoney(2, '.', ','); document.getElementById('credit').value=''; document.getElementById('debit').value=''; document.getElementById('code').value=''; // document.getElementById('code_id').value=''; document.getElementById('memo').value=''; counter++; } function delcall_journal(id) { var debit= document.getElementById('debit_'+id).value; var credit= document.getElementById('credit_'+id).value; var sumdebit= document.getElementById('sumdebit').value; var sumcredit= document.getElementById('sumcredit').value; sumdebit=parseFloat(sumdebit)-parseFloat(debit); sumdebit=Math.round(sumdebit*100)/100; document.getElementById('sumdebit').value=sumdebit; document.getElementById('showsumdebit').value=sumdebit.formatMoney(2, '.', ','); sumcredit=parseFloat(sumcredit)-parseFloat(credit); sumcredit=Math.round(sumcredit*100)/100; document.getElementById('sumcredit').value=sumcredit; document.getElementById('showsumcredit').value=sumcredit.formatMoney(2, '.', ','); document.getElementById('adddivtab_'+id).deleteRow(1); document.getElementById('adddivtab_'+id).deleteRow(0); var newval= document.getElementById('counter').value; newval=newval-1; document.getElementById('counter').value=newval; } function calledit_journal(id) { var newid1='nwdiv_'+id; var editid1='eddiv_'+id; // document.getElementById('code'+id).value=document.getElementById('code_'+id).value; document.getElementById('debit'+id).value=document.getElementById('debit_'+id).value; document.getElementById('credit'+id).value=document.getElementById('credit_'+id).value; document.getElementById('memo'+id).value=document.getElementById('memo_'+id).value; if(document.getElementById('class_ch').value!="") { var val=document.getElementById('class_ch').value; var newid='nwdiv_'+val; var editid='eddiv_'+val; document.getElementById(newid).style.display='table-row'; document.getElementById(editid).style.display='none'; } document.getElementById(newid1).style.display='none'; document.getElementById(editid1).style.display='table-row'; document.getElementById('class_ch').value=id; } function updatecall_journal(id) { var newid='nwdiv_'+id; var editid='eddiv_'+id; var code1='code_'+id; var hidedesc1='hidecode_'+id; var descs='code'+id; var desc1='code_'+id; var debit1='debit_'+id; var credit1='credit_'+id; var memo1='memo_'+id; var codes='code'+id; var debits='debit'+id; var credits='credit'+id; var memos='memo'+id; var debitval = $('#debit'+id).val(); var creditval = $('#credit'+id).val(); creditval =(creditval < 1) ? '0' : creditval; debitval =(debitval < 1) ? '0' : debitval; if((debitval >=1 && creditval >=1) || (debitval==creditval)) { alert('enter any one(credit or debit) at a time'); return false; } var ss=document.getElementById(descs); var www=document.getElementById(descs).options[ss.selectedIndex].text; var old_deb=parseFloat(document.getElementById(debit1).value); var old_cre=parseFloat(document.getElementById(credit1).value); // document.getElementById(code1).value=document.getElementById(codes).value; document.getElementById(hidedesc1).value=document.getElementById(descs).value; document.getElementById(desc1).value=document.getElementById(descs).value; document.getElementById(debit1).value=debitval; document.getElementById(credit1).value=creditval; document.getElementById(memo1).value=document.getElementById(memos).value; document.getElementById(newid).style.display='table-row'; document.getElementById(editid).style.display='none'; var new_deb=parseFloat(debitval); var new_cre=parseFloat(creditval); var sum_deb=parseFloat(document.getElementById('sumdebit').value); var sum_cre=parseFloat(document.getElementById('sumcredit').value); var temp_deb=sum_deb+new_deb-old_deb; temp_deb=Math.round(temp_deb*100)/100; var temp_cre=sum_cre+new_cre-old_cre; temp_cre=Math.round(temp_cre*100)/100; document.getElementById('sumdebit').value=temp_deb; document.getElementById('sumcredit').value=temp_cre; document.getElementById('showsumdebit').value= temp_deb.formatMoney(2, '.', ','); document.getElementById('showsumcredit').value= temp_cre.formatMoney(2, '.', ','); } </script> </head> <body> <div id="height-wrapper"> <?php $this->load->view('menu'); ?> <div role="main" class="container_12" id="content-wrapper"> <div id="main_content"> <?php $this->load->view('top'); ?> <div id="inner_content"> </div> </div> <div class="push clear"></div> </div> <div class="clear"></div> <div class="push"></div> </div> <?php $this->load->view('footer'); ?> </body> </html>