bank stat

This commit is contained in:
venbatechnologies 2018-08-01 12:15:05 +05:30
parent 53d71d6ab4
commit 0ecb4161f2
7 changed files with 64 additions and 57 deletions

View File

@ -142,7 +142,7 @@ define('NO_RECEIVED', 'ST066');
define('PARTIALLY_RECEIVED', 'ST067'); define('PARTIALLY_RECEIVED', 'ST067');
define('AMOUNT_PAIDIGR', 'ST070'); define('AMOUNT_PAIDIGR', 'ST070');
define('PARTIALLY_PAIDIGR', 'ST071'); define('PARTIALLY_PAIDIGR', 'ST071');
define('NO_PAIDIGR', 'ST072'); define('NO_PAIDIGR', '+ST072');
/* Work status code */ /* Work status code */
define('SERVICE_COMPLETED', 'ST046'); define('SERVICE_COMPLETED', 'ST046');

View File

@ -7,14 +7,14 @@ require APPPATH . '/third_party/mpdf/mpdf.php';
* User Class to control all user related operations. * User Class to control all user related operations.
* @author : Gandhimathi * @author : Gandhimathi
* @version : 1.1 * @version : 1.1
* @since : 13 Nov 2017 * @since : 13 Nov 2017
*/ */
class cashbook extends BaseController class cashbook extends BaseController
{ {
/** /**
* This is default constructor of the class * This is default constructor of the class
*/ */
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
$this->load->model('cashbook_model'); $this->load->model('cashbook_model');
@ -501,13 +501,14 @@ class cashbook extends BaseController
//echo "<script>alert('Saved Successfully!');window.location.href='ViewIncomeExpense';</script>"; //echo "<script>alert('Saved Successfully!');window.location.href='ViewIncomeExpense';</script>";
echo "<script>alert('Saved Successfully!');</script>"; echo "<script>alert('Saved Successfully!');</script>";
if($amounttype == ' ')//Redirct To Listing Screen if($bankorcash==Bank)//Redirct To Listing Screen
{ {
redirect('ViewIncomeExpense','refresh'); redirect('Bankingstatement','refresh');
} }
else if($amounttype != ' ')//Redirct To Bank Report Screen else if($bankorcash != ' ')//Redirct To Bank Report Screen
{ {
redirect('Bankingstatement','refresh'); redirect('ViewIncomeExpense','refresh');
} }
} }
@ -1012,12 +1013,13 @@ class cashbook extends BaseController
function IGRFilelist() function IGRFilelist()
{ {
$igrno= $this->input->post('igrno'); $igrno= $this->input->post('igrno');
$igrsingle = $this->cashbook_model->igrmastersingle($igrno); $pono =$this->input->post('pono');
$igrmultiple =$this->cashbook_model->igrmastermultiple($igrno); $igrsingle = $this->cashbook_model->igrmastersingle($igrno,$pono);
$igrmultiple =$this->cashbook_model->igrmastermultiple($igrno,$pono);
$data = array_merge($igrsingle,$igrmultiple); $data = array_merge($igrsingle,$igrmultiple);
//print_r($data); // print_r($data);
echo json_encode($data); echo json_encode($data);
} }
@ -1026,8 +1028,9 @@ class cashbook extends BaseController
public function filelist() public function filelist()
{ {
$igrno= $this->input->post('igrno'); $igrno= $this->input->post('igrno');
$data = $this->cashbook_model->debitimage($igrno); $pono =$this->input->post('pono');
$data = $this->cashbook_model->debitimage($igrno,$pono);
echo json_encode($data); echo json_encode($data);

View File

@ -431,40 +431,19 @@ function receiptdata()
} }
// function debitpolist($bankid)
// {
// $this->db->select('bp.id,bp.mid,igrm.MaterialRcvdDate,bp.PONO,bp.Suppliername,bp.Totalpoamount,br.Debit,
// bp.Balancetopay,bp.Amountpaid,bp.IGRNO,bp.IGRLineItemNo,igrm.file,bu.FilePath');
// $this->db->from ('T_Bankmappingpo bp');
// $this->db->join ('T_IGR_Master igrm','bp.IGRNO = igrm.IGRNO','left');
// $this->db->join ('T_PurchaseOrder_BillUpload bu','bu.PONO = bp.PONO','left');
// $this->db->join ('T_bankreport br','br.ID=bp.mid');
// $this->db->where('bp.IsActive',1);
// $this->db->where('bp.mid',$bankid);
// // $this->db->where('igrde.BankStatus !=','ST072');
// $this->db->group_by('bp.id');
// $query = $this->db->get();
// return $query->result();
// }
//function for image
function debitimage($igrno)
function debitimage($igrno,$pono)
{ {
// $this->db->select('bp.PONO,bp.mid,bu.FilePath,bu.BillNo,bu.IGRNO');
// $this->db->from ('T_Bankmappingpo bp');
// $this->db->join ('T_PurchaseOrder_BillUpload bu','bp.PONO = bu.PONO','left');
// $this->db->where('bp.PONO',$pono);
// $this->db->group_by('bu.BillNo');
// $query = $this->db->get();
// return $query->result();
$this->db->select('*'); $this->db->select('*');
$this->db->from ('T_PurchaseOrder_BillUpload'); $this->db->from ('T_PurchaseOrder_BillUpload');
$this->db->where('IGRNO != "" ');
$this->db->where('IGRNO',$igrno); $this->db->where('IGRNO',$igrno);
$this->db->or_where('PONO',$pono);
$query = $this->db->get(); $query = $this->db->get();
$result = $query->result(); $result = $query->result();
// print_r($result);die;
return $result; return $result;
} }
@ -476,7 +455,7 @@ function receiptdata()
$this->db->select('bm.id,bm.mid,igrm.MaterialRcvdDate,bm.PONO,bm.Suppliername,bm.Totalpoamount, $this->db->select('bm.id,bm.mid,igrm.MaterialRcvdDate,bm.PONO,bm.Suppliername,bm.Totalpoamount,
bm.Balancetopay,bm.Amountpaid,bm.IGRNO,igrm.file,bm.IGRLineItemNo,br.Clearbalance,br.Balancetocleared,bu.FilePath,bu.BillNo,inward.FilePath as Fpath'); bm.Balancetopay,bm.Amountpaid,bm.IGRNO,igrm.file,bm.IGRLineItemNo,br.Clearbalance,br.Balancetocleared,bu.FilePath,bu.BillNo,inward.FilePath as Fpath');
$this->db->from ('T_Bankmappingpo bm'); $this->db->from ('T_Bankmappingpo bm');
$this->db->join ('T_IGR_Master igrm','igrm.IGRNO = bm.IGRNO'); $this->db->join ('T_IGR_Master igrm','igrm.PONO = bm.PONO or igrm.IGRNO = bm.IGRNO ','left');
//$this->db->join ('T_IGR_Details igrde','igrde.IGRNO=igrm.IGRNO'); //$this->db->join ('T_IGR_Details igrde','igrde.IGRNO=igrm.IGRNO');
$this->db->join ('T_SupplierDetailsN sd','sd.SupplierName = bm.Suppliername'); $this->db->join ('T_SupplierDetailsN sd','sd.SupplierName = bm.Suppliername');
$this->db->join ('T_bankreport br','br.ID=bm.mid'); $this->db->join ('T_bankreport br','br.ID=bm.mid');
@ -498,20 +477,38 @@ function receiptdata()
} }
function igrmastersingle($igrno) function igrmastersingle($igrno,$pono)
{ {
$this->db->distinct();
$this->db->select('IGRNO,file,PONO as pono'); $this->db->select('IGRNO,file,PONO as pono');
$this->db->from('T_IGR_Master'); $this->db->from('T_IGR_Master');
$this->db->where('IGRNO',$igrno); if(!empty($igrno) && !empty($pono)){
$this->db->where('PONO',$pono);
$this->db->where('IGRNO',$igrno);
}else if(!empty($pono)){
$this->db->where('PONO',$pono);
$this->db->where('IGRNO != ""');
}else{
$this->db->where('IGRNO',$IGRNO);
}
$query = $this->db->get(); $query = $this->db->get();
return $query->result(); return $query->result();
} }
function igrmastermultiple($igrno) function igrmastermultiple($igrno,$pono)
{ {
$this->db->distinct();
$this->db->select('BillNo,IGRNO,FilePath,PONO,Remarks'); $this->db->select('BillNo,IGRNO,FilePath,PONO,Remarks');
$this->db->from('T_Inwardgateregister_fileupload'); $this->db->from('T_Inwardgateregister_fileupload');
$this->db->where('IGRNO',$igrno); if(!empty($igrno) && !empty($pono)){
$this->db->where('PONO',$pono);
$this->db->where('IGRNO',$igrno);
}else if(!empty($pono)){
$this->db->where('PONO',$pono);
$this->db->where('IGRNO != ""');
}else{
$this->db->where('IGRNO',$IGRNO);
}
$query = $this->db->get(); $query = $this->db->get();
return $query->result(); return $query->result();

View File

@ -171,8 +171,8 @@ if(!empty($INRSYMBOL))
$("#PODate").datepicker({ $("#PODate").datepicker({
minDate : 'now', // minDate : 'now',
maxDate : 'now', // maxDate : 'now',
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
}); });
$("#Deliverydt").datepicker({ $("#Deliverydt").datepicker({

View File

@ -334,11 +334,13 @@ $.ajax({
function pono(i) function pono(i)
{ {
var igrno=$('#igrno'+i).text(); var igrno=$('#igrno'+i).text();
var pono =$('#pono'+i).text();
$("#Fileshow").modal('show'); $("#Fileshow").modal('show');
$.ajax( $.ajax(
{ {
data:{igrno:igrno}, data:{igrno:igrno,pono:pono},
type:"POST", type:"POST",
url:"<?php echo base_url() ?>cashbook/filelist", url:"<?php echo base_url() ?>cashbook/filelist",
success:function(data) success:function(data)
@ -434,11 +436,12 @@ $( function() {
function igrno(i) function igrno(i)
{ {
var igrno=$('#igrno'+i).text(); var igrno=$('#igrno'+i).text();
var pono=$('#pono'+i).text();
$("#Fileshow").modal('show'); $("#Fileshow").modal('show');
$.ajax( $.ajax(
{ {
data:{igrno:igrno}, data:{igrno:igrno,pono:pono},
type:"POST", type:"POST",
url:"<?php echo base_url()?>cashbook/IGRFilelist", url:"<?php echo base_url()?>cashbook/IGRFilelist",
success:function(data) success:function(data)

View File

@ -142,7 +142,7 @@ $('#merchant').autocomplete({
$('#payment').hide(); $('#payment').hide();
$('#towhom').text('Received From:'); $('#towhom').text('Received From:');
$("#accode").append( $('<option></option>').val(item.code).html(item.name)); $("#accode").append( $('<option></option>').val(item.code).html(item.name));
} }
}); });

View File

@ -3,7 +3,7 @@
<?php <?php
if(!empty($mapping)) if(!empty($mapping))
{ {
} }
@ -286,7 +286,7 @@ if(!empty($mapping))
<!--<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file ?>"--> <!--<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $rel->file ?>"-->
<td align="left" id="sn<?php echo $i ?>"><span><?php echo $ap->Suppliername?></span></td> <td align="left" id="sn<?php echo $i ?>"><span><?php echo $ap->Suppliername?></span></td>
<td align="left" id="tov<?php echo $i ?>"><span><?php echo $ap->Totalpoamount?></span></td> <td align="left" id="tov<?php echo $i ?>"><span><?php echo $ap->Totalpoamount?></span></td>
<td align="left" id="aa<?php echo $i ?>"><span><?php echo $ap->Totalpoamount-$ap->Amountpaid?></span></td> <td align="left" id="aa<?php echo $i ?>"><span><?php echo $ap->Balancetopay?></span></td>
<td align="left" id="aa<?php echo $i ?>"><span><?php echo $ap->Amountpaid?></span></td> <td align="left" id="aa<?php echo $i ?>"><span><?php echo $ap->Amountpaid?></span></td>
<?php <?php
if($ap->file !='') if($ap->file !='')
@ -485,12 +485,15 @@ if(!empty($mapping))
function pono(i) function pono(i)
{ {
var igrno=$('#igrno'+i).text(); var igrno=$('#igrno'+i).text();
//alert(igrno); var pono =$('#pono'+i).text();
// alert(igrno);
// alert(pono);
// return false;
$("#Fileshow").modal('show'); $("#Fileshow").modal('show');
$.ajax( $.ajax(
{ {
data:{igrno:igrno}, data:{igrno:igrno,pono:pono},
type:"POST", type:"POST",
url:"<?php echo base_url() ?>cashbook/filelist", url:"<?php echo base_url() ?>cashbook/filelist",
success:function(data) success:function(data)
@ -550,11 +553,12 @@ function pono(i)
function igrno(i) function igrno(i)
{ {
var igrno=$('#igrno'+i).text(); var igrno=$('#igrno'+i).text();
var pono =$('#pono'+i).text();
$("#Fileshow").modal('show'); $("#Fileshow").modal('show');
$.ajax( $.ajax(
{ {
data:{igrno:igrno}, data:{igrno:igrno,pono:pono},
type:"POST", type:"POST",
url:"<?php echo base_url() ?>cashbook/IGRFilelist", url:"<?php echo base_url() ?>cashbook/IGRFilelist",
success:function(data) success:function(data)