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

@ -22,7 +22,6 @@ class cashbook extends BaseController
$this->isLoggedIn();
$this->load->helper(array('form','url'));
$this->load->library('upload');
}
@ -1069,13 +1068,13 @@ class cashbook extends BaseController
$tdate = $this->input->post('to_date');
$bankid= $_GET['d'];
$data['clearbalance']=$_GET['cb'];
if($data['clearbalance']==0)
{
echo "<script>alert('No Mapped Amount!')</script>";
redirect('Bankingstatement','refresh');
}
else
{
// if($data['clearbalance']==0)
// {
// echo "<script>alert('No Mapped Amount!')</script>";
// redirect('Bankingstatement','refresh');
// }
// else
// {
$data['balancetoclear']=$_GET['btc'];
$data['mappingcashbook']=$this->cashbook_model->mappingcash($SupplierName,$fdate,$tdate,$bankid);
$data['mappingiv'] = $this->cashbook_model->creditinvoicelist($bankid);
@ -1084,7 +1083,7 @@ class cashbook extends BaseController
$data['supplier'] = $this->cashbook_model->getsupplier();
//redirect('Bankingstatement','refresh');
$this->loadViews("bankinvoicesettlement", $this->global,$data,NULL);
}
//}
}
public function mappingdebit()
{
@ -1276,7 +1275,7 @@ class cashbook extends BaseController
}
else
{
$clearedblnce=-$totalpaidamount-(-$arec);
$clearedblnce=$totalpaidamount+$arec;
}
$balancetoreceived =($bankcreditamount-$totalpaidamount);
$check =1;
@ -1515,18 +1514,27 @@ class cashbook extends BaseController
$bankingbalclear = $this->input->post('bankingbalclear');
$totinvoiceamount = $this->input->post('totinvoiceamount');
$balancetoreceived = $this->input->post('balancetoreceived');
$updatebalancetoclear=$amountreceived+$bankingbalclear;
if($amountreceived<0)
{
$updatebalancetoclear=$amountreceived+$bankingbalclear;
$updateclearbalance=$amountreceived+$bankingclear;
$updateclearbalance=$bankingclear-($amountreceived);//450-(-250)
}
else
{
$updatebalancetoclear=$bankingbalclear+$amountreceived;
$updateclearbalance=$bankingclear+$amountreceived;
$updateclearbalance=$bankingclear-$amountreceived;//450-650
}
// if($amountreceived<0)
// {
// $updatebalancetoclear=$amountreceived+$bankingbalclear;
// $updateclearbalance=$amountreceived+$bankingclear;
// }
// else
// {
// $updatebalancetoclear=$bankingbalclear+$amountreceived;
// $updateclearbalance=$bankingclear+$amountreceived;
// }
//update Isactive field in T_Bankreport //////
$mapped=$balancetoreceived+$amountreceived;
if($credit==$mapped)
@ -1707,42 +1715,5 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only";
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->where('t_income_expense.IsActive',1);
$this->db->where('t_income_expense.account_code !=','ADV001');
$this->db->where('t_income_expense.account_code !=','0013');
if ($firstyear and $secondyear != '')
{
$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->where('t_income_expense.IsActive',1);
$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");
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())
//alert(amount);
var negative=0;
if(amount<0)
{
negative=1;
alert("Invalid Amount")
$('#invoicereceived'+i).val('');
// if(amount<0)
// {
// negative=1;
// alert("Invalid Amount")
// $('#invoicereceived'+i).val('');
}
// }
temp=intex;
if(x==true)
{