bankstatement credit note

This commit is contained in:
gayathri1990 2018-07-24 19:15:03 +05:30
parent 15e9081548
commit d4a34feb93
3 changed files with 31 additions and 59 deletions

View File

@ -23,7 +23,6 @@ class cashbook extends BaseController
$this->load->helper(array('form','url')); $this->load->helper(array('form','url'));
$this->load->library('upload'); $this->load->library('upload');
} }
function incomeExpenseList() function incomeExpenseList()
@ -1069,13 +1068,13 @@ class cashbook extends BaseController
$tdate = $this->input->post('to_date'); $tdate = $this->input->post('to_date');
$bankid= $_GET['d']; $bankid= $_GET['d'];
$data['clearbalance']=$_GET['cb']; $data['clearbalance']=$_GET['cb'];
if($data['clearbalance']==0) // if($data['clearbalance']==0)
{ // {
echo "<script>alert('No Mapped Amount!')</script>"; // echo "<script>alert('No Mapped Amount!')</script>";
redirect('Bankingstatement','refresh'); // redirect('Bankingstatement','refresh');
} // }
else // else
{ // {
$data['balancetoclear']=$_GET['btc']; $data['balancetoclear']=$_GET['btc'];
$data['mappingcashbook']=$this->cashbook_model->mappingcash($SupplierName,$fdate,$tdate,$bankid); $data['mappingcashbook']=$this->cashbook_model->mappingcash($SupplierName,$fdate,$tdate,$bankid);
$data['mappingiv'] = $this->cashbook_model->creditinvoicelist($bankid); $data['mappingiv'] = $this->cashbook_model->creditinvoicelist($bankid);
@ -1084,7 +1083,7 @@ class cashbook extends BaseController
$data['supplier'] = $this->cashbook_model->getsupplier(); $data['supplier'] = $this->cashbook_model->getsupplier();
//redirect('Bankingstatement','refresh'); //redirect('Bankingstatement','refresh');
$this->loadViews("bankinvoicesettlement", $this->global,$data,NULL); $this->loadViews("bankinvoicesettlement", $this->global,$data,NULL);
} //}
} }
public function mappingdebit() public function mappingdebit()
{ {
@ -1276,7 +1275,7 @@ class cashbook extends BaseController
} }
else else
{ {
$clearedblnce=-$totalpaidamount-(-$arec); $clearedblnce=$totalpaidamount+$arec;
} }
$balancetoreceived =($bankcreditamount-$totalpaidamount); $balancetoreceived =($bankcreditamount-$totalpaidamount);
$check =1; $check =1;
@ -1515,18 +1514,27 @@ class cashbook extends BaseController
$bankingbalclear = $this->input->post('bankingbalclear'); $bankingbalclear = $this->input->post('bankingbalclear');
$totinvoiceamount = $this->input->post('totinvoiceamount'); $totinvoiceamount = $this->input->post('totinvoiceamount');
$balancetoreceived = $this->input->post('balancetoreceived'); $balancetoreceived = $this->input->post('balancetoreceived');
$updatebalancetoclear=$amountreceived+$bankingbalclear;
if($amountreceived<0) if($amountreceived<0)
{ {
$updatebalancetoclear=$amountreceived+$bankingbalclear; $updateclearbalance=$bankingclear-($amountreceived);//450-(-250)
$updateclearbalance=$amountreceived+$bankingclear;
} }
else else
{ {
$updatebalancetoclear=$bankingbalclear+$amountreceived; $updateclearbalance=$bankingclear-$amountreceived;//450-650
$updateclearbalance=$bankingclear+$amountreceived;
} }
// if($amountreceived<0)
// {
// $updatebalancetoclear=$amountreceived+$bankingbalclear;
// $updateclearbalance=$amountreceived+$bankingclear;
// }
// else
// {
// $updatebalancetoclear=$bankingbalclear+$amountreceived;
// $updateclearbalance=$bankingclear+$amountreceived;
// }
//update Isactive field in T_Bankreport ////// //update Isactive field in T_Bankreport //////
$mapped=$balancetoreceived+$amountreceived; $mapped=$balancetoreceived+$amountreceived;
if($credit==$mapped) if($credit==$mapped)
@ -1707,42 +1715,5 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only";
return $amountInWords; return $amountInWords;
} }
public function addNewSupplierCash()
{
$this->load->model('supplier_model');
$suppliername = $this->input->post('suppliername');
$contact = $this->input->post('contact');
$alternatecont = $this->input->post('alternatecont');
$email = $this->input->post('email');
$Address = $this->input->post('Address');
$suparray = array('suppliername'=>$suppliername,'Address'=>$Address,'ContactNumber'=>$contact,'AlternateContactNumber'=>$alternatecont,'EmailAddress'=>$email );
$result = $this->supplier_model->addNewsupplier($suparray);
if($result > 0)
{
echo "New Supplier Created successfully!";
redirect('addnewIncomeExpense','refresh');
}
else
{
echo "Supplier Record Not Created!";
redirect('addnewIncomeExpense','refresh');
}
}
public function getAllSupplier()
{
$suplist = $this->cashbook_model->getsupplier();
echo json_encode($suplist);
}
} }
?> ?>

View File

@ -67,6 +67,7 @@ class cashbook_model extends CI_Model
$this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID','left'); $this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID','left');
$this->db->where('t_income_expense.IsActive',1); $this->db->where('t_income_expense.IsActive',1);
$this->db->where('t_income_expense.account_code !=','ADV001'); $this->db->where('t_income_expense.account_code !=','ADV001');
$this->db->where('t_income_expense.account_code !=','0013');
if ($firstyear and $secondyear != '') if ($firstyear and $secondyear != '')
{ {
$finyear = "t_income_expense.date >= '".$firstyear."-04-01' and t_income_expense.date <= '".$secondyear."-03-31'"; $finyear = "t_income_expense.date >= '".$firstyear."-04-01' and t_income_expense.date <= '".$secondyear."-03-31'";
@ -94,7 +95,7 @@ class cashbook_model extends CI_Model
$this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID','left'); $this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID','left');
$this->db->where('t_income_expense.IsActive',1); $this->db->where('t_income_expense.IsActive',1);
$this->db->where('t_income_expense.account_code','ADV001'); $this->db->where('t_income_expense.account_code','ADV001');
//$this->db->where('t_income_expense.account_code','0013'); $this->db->or_where('t_income_expense.account_code','0013');
$this->db->order_by("date","desc"); $this->db->order_by("date","desc");
if(!empty($i)) if(!empty($i))
{ {

View File

@ -314,13 +314,13 @@ var x = document.getElementById('checkboxcheckbox'+i).checked;
var amount= parseFloat( $('#invoicereceived'+i).val() == '' ? '0.00' : $('#invoicereceived'+i).val()) var amount= parseFloat( $('#invoicereceived'+i).val() == '' ? '0.00' : $('#invoicereceived'+i).val())
//alert(amount); //alert(amount);
var negative=0; var negative=0;
if(amount<0) // if(amount<0)
{ // {
negative=1; // negative=1;
alert("Invalid Amount") // alert("Invalid Amount")
$('#invoicereceived'+i).val(''); // $('#invoicereceived'+i).val('');
} // }
temp=intex; temp=intex;
if(x==true) if(x==true)
{ {