banking multiple excel sheet upload

This commit is contained in:
sriramv 2018-12-15 16:39:47 +05:30
parent ee5fd8cd8c
commit 3294b2800a
9 changed files with 10552 additions and 10 deletions

View File

@ -247,16 +247,21 @@ class cashbook extends BaseController
$sheet = $objTpl->getActiveSheet();//->toArray(null, true,true,true);
$highestRow = $sheet->getHighestRow();
$highestColumn = $sheet->getHighestColumn();
$highestRow4=$highestRow-4;
$bank = $this->input->post('bankbranchname');
$fileupload= array('Bankname'=>$bank,'document'=>$document);
$res = $this->cashbook_model->bankfile($fileupload);
if($bank == 'IndianBank')
{
for($x=21;$x<=$highestRow4;$x++){
if($x == 21){
@ -313,18 +318,307 @@ class cashbook extends BaseController
$balance=$sheet->getCell('H'.$x)->getValue();
// $IsActive=0;
$filedataupload= array('reportdate'=>$Date1,'valuedate'=>$Date2,'chequeNo'=>$cod,'Narration'=>$narration,'Cod'=> $chqno,'Debit'=>$debit,'Credit'=>$credit,'cbalancetocleared'=>$credit,'Balance'=>$balance,'Bankname'=>$bank);
// if(empty())
$filedataupload1 = array('reportdate'=>$Date1,'valuedate'=>$Date2,'chequeNo'=>$cod,'Narration'=>$narration,'Cod'=> $chqno,'Debit'=>$debit,'Credit'=>$credit,'cbalancetocleared'=>$credit,'Balance'=>$balance,'Bankname'=>$bank);
$filedataupload = array_filter($filedataupload1);
// print_r($filedataupload);
$res = $this->cashbook_model->bankfiledata($filedataupload);
}
}
if($bank == 'CUB')
{
$highestRow4=$highestRow-7;
for($x=17;$x<=$highestRow4;$x++)
{
if($x == 17){
$openingbalance=$sheet->getCell('F'.$x)->getValue();
}
if($x == $highestRow4){
$closingbalance=$sheet->getCell('F'.$highestRow4)->getValue();
}
$t=$sheet->getCell('A'.$x)->getValue();
if (empty($t))
{
$Date1 = NULL;
}
else
{
$Date1= date("Y-d-m ", strtotime($t));
}
$s=$sheet->getCell('A'.$x)->getValue();
//$dat1= str_replace('/','-',$s);
if (empty($s))
{
$Date2 = NULL;
}
else
{
$Date2 = date('Y-d-m',strtotime($s));
}
$chqno = $sheet->getCell('C'.$x)->getValue();
$narration = $sheet->getCell('B'.$x)->getValue();
// $cod =$sheet->getCell('E'.$x)->getValue();
$debit =$sheet->getCell('D'.$x)->getValue();
$credit=$sheet->getCell('E'.$x)->getValue();
$balance=$sheet->getCell('F'.$x)->getValue();
$filedataupload1 = array('reportdate'=>$Date1,'valuedate'=>$Date2,'chequeNo'=>$cod,'Narration'=>$narration,'Cod'=> $chqno,'Debit'=>$debit,'Credit'=>$credit,'cbalancetocleared'=>$credit,'Balance'=>$balance,'Bankname'=>$bank);
$filedataupload = array_filter($filedataupload1);
//print_r($filedataupload);
// die();
$res = $this->cashbook_model->bankfiledata($filedataupload);
}
}
if($bank == 'BOB')
{
$highestRow4=$highestRow-3;
for($x=13;$x<=$highestRow4;$x++)
{
if($x == 13){
$openingbalance=$sheet->getCell('H'.$x)->getValue();
}
if($x == $highestRow4){
$closingbalance=$sheet->getCell('H'.$highestRow4)->getValue();
}
$t=$sheet->getCell('B'.$x)->getValue();
if (empty($t))
{
$Date1 = NULL;
}
else
{
// $Date1 = strtotime( $dat);
$Date1 = date("Y-d-m ", strtotime($t));
}
$s=$sheet->getCell('I'.$x)->getValue();
if (empty($s))
{
$Date2 = NULL;
}
else
{
$Date2 = date("Y-d-m ", strtotime($s));
}
$chqno = $sheet->getCell('E'.$x)->getValue();
$narration = $sheet->getCell('C'.$x)->getValue();
// $cod =$sheet->getCell('E'.$x)->getValue();
//floatval(str_replace(',','',$num));
$debit =floatval(str_replace(',','',$sheet->getCell('F'.$x)->getValue()));
$credit=floatval(str_replace(',','',$sheet->getCell('G'.$x)->getValue()));
$balance=floatval(str_replace(',','',$sheet->getCell('H'.$x)->getValue()));
$filedataupload1= array('reportdate'=>$Date1,'valuedate'=>$Date2,'chequeNo'=>$cod,'Narration'=>$narration,'Cod'=> $chqno,'Debit'=>$debit,'Credit'=>$credit,'cbalancetocleared'=>$credit,'Balance'=>$balance,'Bankname'=>$bank);
$filedataupload = array_filter($filedataupload1);
//print_r($filedataupload);
// die();
$res = $this->cashbook_model->bankfiledata($filedataupload);
}
}
if($bank == 'OCC')
{
$highestRow4=$highestRow-1;
for($x=7;$x<=$highestRow4;$x++)
{
if($x == 7){
$openingbalance=$sheet->getCell('H'.$x)->getValue();
}
if($x == $highestRow4){
$closingbalance=$sheet->getCell('H'.$highestRow4)->getValue();
}
$t1=$sheet->getCell('B'.$x)->getValue();
$t = PHPExcel_Style_NumberFormat::toFormattedString($t1,"YYYY-M-D");
if (empty($t))
{
$Date1 = NULL;
}
else
{
$Date1 = $t;
}
$s1=$sheet->getCell('B'.$x)->getValue();
$s = PHPExcel_Style_NumberFormat::toFormattedString($s1,"YYYY-M-D");;
if (empty($s))
{
$Date2 = NULL;
}
else
{
$Date2 = $s;
}
// $chqno = $sheet->getCell('E'.$x)->getValue();
$narration = $sheet->getCell('D'.$x)->getValue();
// $cod =$sheet->getCell('E'.$x)->getValue();
$debit =$sheet->getCell('F'.$x)->getValue();
$credit=$sheet->getCell('G'.$x)->getValue();
$balance=$sheet->getCell('H'.$x)->getValue();
$filedataupload1 = array('reportdate'=>$Date1,'valuedate'=>$Date2,'chequeNo'=>$cod,'Narration'=>$narration,'Cod'=> $chqno,'Debit'=>$debit,'Credit'=>$credit,'cbalancetocleared'=>$credit,'Balance'=>$balance,'Bankname'=>$bank);
$filedataupload = array_filter($filedataupload1);
$res = $this->cashbook_model->bankfiledata($filedataupload);
}
}
if($bank == 'CA' )
{
$highestRow4=$highestRow-1;
for($x=8;$x<=$highestRow4;$x++)
{
if($x == 8){
$openingbalance=$sheet->getCell('H'.$x)->getValue();
}
if($x == $highestRow4){
$closingbalance=$sheet->getCell('H'.$highestRow4)->getValue();
}
$t1=$sheet->getCell('B'.$x)->getValue();
$t = PHPExcel_Style_NumberFormat::toFormattedString($t1,"YYYY-M-D");
if (empty($t))
{
$Date1 = NULL;
}
else
{
$Date1 = $t;
}
$s1=$sheet->getCell('B'.$x)->getValue();
$s = PHPExcel_Style_NumberFormat::toFormattedString($s1,"YYYY-M-D");;
if (empty($s))
{
$Date2 = NULL;
}
else
{
$Date2 = $s;
}
// $chqno = $sheet->getCell('E'.$x)->getValue();
$narration = $sheet->getCell('D'.$x)->getValue();
// $cod =$sheet->getCell('E'.$x)->getValue();
$debit =$sheet->getCell('F'.$x)->getValue();
$credit=$sheet->getCell('G'.$x)->getValue();
$balance=$sheet->getCell('H'.$x)->getValue();
$filedataupload1 = array('reportdate'=>$Date1,'valuedate'=>$Date2,'chequeNo'=>$cod,'Narration'=>$narration,'Cod'=> $chqno,'Debit'=>$debit,'Credit'=>$credit,'cbalancetocleared'=>$credit,'Balance'=>$balance,'Bankname'=>$bank);
$filedataupload = array_filter($filedataupload1);
// print_r($filedataupload);
// die();
$res = $this->cashbook_model->bankfiledata($filedataupload);
}
}
$balance= array('filename'=>$config['file_name'],'created_by'=>$created_by,'openingbalance'=>$openingbalance,'closingbalance'=>$closingbalance);
$bal = $this->cashbook_model->balance($balance);
if( $res == 1 ){
echo "<script>alert('Saved Successfully!');window.location.href='Bankingstatement';</script>";
echo "<script>alert('Saved Successfully!');window.location.href='Bankingstatement';</script>";
}
else
{

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -402,7 +402,8 @@ class cashbook_model extends CI_Model
else{
$this->db->insert('T_bankreport', $filedataupload);
$r = $this->db->affected_rows();
//print_r($this->db->last_query());
// print_r($this->db->insert_id());
// die();
return $r;
}
}

View File

@ -155,10 +155,13 @@ function checkYearMonthAsEmpty()
<div class="col-md-4"> <span>Bank Names</span>
<select type="text" id="bankbranchname" name="bankbranchname" class="form-control select2">
<option value="Indian Bank">Select Bank Name</option>
<option value="IndianBank">Indian Bank</option>
<option value="Indian Bank"><?php echo 'Indian Bank' ?></option>
<option value="CUB"><?php echo 'City Union Bank' ?></option>
<option value="BOB"><?php echo 'Bank of Baroda' ?></option>
<option value="CA"><?php echo 'Indus Ind CA' ?></option>
<option value="OCC"><?php echo 'Indus Ind OCC' ?></option>
</select>
</div>

View File

@ -234,7 +234,7 @@ $Bankname = $t->Bankname;
<br>
<br>
<br>
<center><h3>Bank Name:<?php echo $Bankname?></h3></center>
<!-- <center><h3>Bank Name:<?php echo $Bankname?></h3></center> -->
<table class="table table-bordered table-hover" data-order='[[1,"desc"]]' id="req" style="table-layout:auto;">