latest changes

This commit is contained in:
gayathri1990 2018-11-13 13:13:24 +05:30
parent a06eb0b55b
commit 2e6c1a02c4
5 changed files with 38 additions and 40 deletions

View File

@ -1082,10 +1082,7 @@ class cashbook extends BaseController
$data['invoiceramount'] = $this->cashbook_model->invoiceamonut($bankid); $data['invoiceramount'] = $this->cashbook_model->invoiceamonut($bankid);
$data['mappingcashbook']=$this->cashbook_model->mappingcashcreditbankid($bankid); $data['mappingcashbook']=$this->cashbook_model->mappingcashcreditbankid($bankid);
$data['paidcbook'] = $this->cashbook_model->cashbookamount($bankid); $data['paidcbook'] = $this->cashbook_model->cashbookamount($bankid);
$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);
@ -1213,13 +1210,14 @@ class cashbook extends BaseController
$podata1 = array('Podate'=>$date,'PONO'=>$pono,'IGRNO'=>$igrno,'Suppliername'=>$sname,'SupplierID'=>$sid,'Totalpoamount'=>$tot,'Amountpaid'=>$ip,'Balancetopay'=>$balancetopay,'mid'=>$bankid,'IGRLineItemNo'=>$igrlineitem,'IsActive'=>$IsActive); $podata1 = array('Podate'=>$date,'PONO'=>$pono,'IGRNO'=>$igrno,'Suppliername'=>$sname,'SupplierID'=>$sid,'Totalpoamount'=>$tot,'Amountpaid'=>$ip,'Balancetopay'=>$balancetopay,'mid'=>$bankid,'IGRLineItemNo'=>$igrlineitem,'IsActive'=>$IsActive);
$resultn = $this->cashbook_model->mappingpo($podata1);
//print_r($podata1); //print_r($podata1);
$podata = array('Podate'=>$date,'PONO'=>$pono,'IGRNO'=>$igrno,'Suppliername'=>$sname,'SupplierID'=>$sid,'Totalpoamount'=>$tot,'Amountpaid'=>$amtpaid,'Balancetopay'=>$balancetopay,'mid'=>$bankid,'IGRLineItemNo'=>$igrlineitem,'IsActive'=>$IsActive); $podata = array('Podate'=>$date,'PONO'=>$pono,'IGRNO'=>$igrno,'Suppliername'=>$sname,'SupplierID'=>$sid,'Totalpoamount'=>$tot,'Amountpaid'=>$amtpaid,'Balancetopay'=>$balancetopay,'mid'=>$bankid,'IGRLineItemNo'=>$igrlineitem,'IsActive'=>$IsActive);
//die(); //die();
$result3 = $this->cashbook_model->getpono($igrlineitem); $result3 = $this->cashbook_model->getpono($igrlineitem);
$resultn = $this->cashbook_model->mappingpo($podata1);
if(count($result3)<=0) if(count($result3)<=0)
{ {
@ -1361,7 +1359,7 @@ class cashbook extends BaseController
$IsActive=1; $IsActive=1;
$invoicedata1 = array('indate'=>$date,'invoiceno'=>$invid,'customername'=>$cname,'customerid'=>$cid,'totinvoiceamount'=>$invamount,'balancetoreceived'=>$balancetoreceived1,'amountreceived'=>$amtpaid,'bankid'=>$bankid,'IsActive'=>$IsActive); $invoicedata1 = array('indate'=>$date,'invoiceno'=>$invid,'customername'=>$cname,'customerid'=>$cid,'totinvoiceamount'=>$invamount,'balancetoreceived'=>$balancetoreceived1,'amountreceived'=>$amtpaid,'bankid'=>$bankid,'IsActive'=>$IsActive);
$invoicedata = array('indate'=>$date,'invoiceno'=>$invid,'customername'=>$cname,'customerid'=>$cid,'totinvoiceamount'=>$invamount,'balancetoreceived'=>$updatenew,'amountreceived'=>$ip,'bankid'=>$bankid,'IsActive'=>$IsActive); $invoicedata = array('indate'=>$date,'invoiceno'=>$invid,'customername'=>$cname,'customerid'=>$cid,'totinvoiceamount'=>$invamount,'balancetoreceived'=>$balancetoreceived1,'amountreceived'=>$ip,'bankid'=>$bankid,'IsActive'=>$IsActive);
// //print_r ($invoicedata); // //print_r ($invoicedata);
// //die(); // //die();
@ -1411,17 +1409,17 @@ class cashbook extends BaseController
$fdate = $this->input->post('from_date'); $fdate = $this->input->post('from_date');
$tdate = $this->input->post('to_date'); $tdate = $this->input->post('to_date');
$supplierID= $this->input->post('supplier'); $supplierID= $this->input->post('supplier');
$data['supplierid']= $supplierID; $data['supplierid']=$supplierID;
$suppliername= $this->input->post('suppliername'); $suppliername= $this->input->post('suppliername');
$data['suppliername']=$suppliername; $data['suppliername']=$suppliername;
$data['fa']=$fa; $data['fa']=$fa;
$data['aa']=$aa; $data['aa']=$aa;
$data['m']=$m; $data['m']=$m;
$data['fdate']=$fdate; $data['fdate']=$fdate;
$data['tdate']=$tdate; $data['tdate']=$tdate;
$data['suppliername']= $suppliername; $data['suppliername']= $suppliername;
$data['bankdebit'] = $this->cashbook_model->debitpolistfilter($supplierID,$fa,$aa,$m,$fdate,$tdate); $data['bankdebit'] = $this->cashbook_model->debitpolistfilter($supplierID,$fa,$aa,$m,$fdate,$tdate);
//print_r($data['bankdebit']);
} }
else else
{ {

View File

@ -1020,19 +1020,17 @@ function receiptdata()
function debitpolistfilter($supplierID,$fa,$aa,$m,$fdate,$tdate) function debitpolistfilter($supplierID,$fa,$aa,$m,$fdate,$tdate)
{ {
// echo $suppliername+'sn'; $this->db->select('bm.id,bm.mid,bm.PONO,bm.Suppliername,bm.Totalpoamount,bm.Podate,
$this->db->select('bm.id,bm.mid,bm.Podate,bm.PONO,bm.Suppliername,bm.Totalpoamount, bm.Balancetopay,bm.Amountpaid,bm.IGRNO,bm.IGRLineItemNo,br.Balancetocleared,br.Clearbalance,
bm.Balancetopay,bm.Amountpaid,bm.IGRNO,igrm.file,bm.IGRLineItemNo,br.Clearbalance,br.Balancetocleared,bu.FilePath,bu.BillNo,inward.FilePath as Fpath'); inward.FilePath as igrfile,bu.FilePath pofile');
$this->db->from ('T_Bankporeport bm'); $this->db->from ('T_Bankmappingpo bm');
$this->db->join ('T_IGR_Master igrm','igrm.PONO = bm.PONO or igrm.IGRNO = bm.IGRNO ','left'); $this->db->join('T_Inwardgateregister_fileupload inward','inward.IGRNO =bm.IGRNO','left');
//$this->db->join ('T_IGR_Details igrde','igrde.IGRNO=igrm.IGRNO'); $this->db->join('T_PurchaseOrder_BillUpload bu','bm.PONO=bu.PONO','left');
$this->db->join ('T_SupplierDetailsN sd','sd.SupplierName = bm.Suppliername'); $this->db->join('T_bankreport br','br.ID=bm.mid','left');
$this->db->join ('T_bankreport br','br.ID=bm.mid');
$this->db->join('T_Inwardgateregister_fileupload inward','inward.IGRNO =igrm.IGRNO','left');
$this->db->join ('T_PurchaseOrder_BillUpload bu','bm.PONO=bu.PONO','left');
$this->db->where('bm.IsActive',1);
$this->db->where('bm.SupplierID',$supplierID); $this->db->where('bm.SupplierID',$supplierID);
if ($fa and $aa != ''){ $this->db->where('bm.IsActive',1);
//$this->db->group_by('bm.mid');
if ($fa and $aa != ''){
//$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')"; //$sql.=" and (im.CreatedDate >= '".$fa."-04-01' and im.CreatedDate <= '".$aa."-03-31')";
$year="(bm.Podate >= '".$fa."-04-01' and bm.Podate <= '".$aa."-03-31')"; $year="(bm.Podate >= '".$fa."-04-01' and bm.Podate <= '".$aa."-03-31')";
@ -1052,8 +1050,7 @@ function receiptdata()
and date(bm.Podate) <= '".$todate."'"; and date(bm.Podate) <= '".$todate."'";
$this->db->where($date); $this->db->where($date);
} }
$this->db->group_by('bm.IGRLineItemNo');
$query = $this->db->get(); $query = $this->db->get();
return $query->result(); return $query->result();
@ -1159,7 +1156,7 @@ function receiptdata()
$this->db->select('bm.ID,bm.indate,bm.invoiceno,bm.customername,bm.totinvoiceamount,bm.bankid, $this->db->select('bm.ID,bm.indate,bm.invoiceno,bm.customername,bm.totinvoiceamount,bm.bankid,
bm.balancetoreceived,bm.amountreceived,br.cclearbalance,br.cbalancetocleared'); bm.balancetoreceived,bm.amountreceived,br.cclearbalance,br.cbalancetocleared');
$this->db->from ('T_Bankinvoicereport bm'); $this->db->from ('T_Bankmappingiv bm');
$this->db->join ('ip_clients ic','ic.client_name = bm.customername','left'); $this->db->join ('ip_clients ic','ic.client_name = bm.customername','left');
$this->db->join('T_bankreport br','br.ID = bm.bankid'); $this->db->join('T_bankreport br','br.ID = bm.bankid');
@ -1525,9 +1522,10 @@ function receiptdata()
// $r = $this->db->affected_rows(); // $r = $this->db->affected_rows();
// return $r; // return $r;
// } // }
function mappingpo($podata) function mappingpo($podata1)
{ {
$this->db->insert('T_Bankmappingpo',$podata); print_r($podata1);
$this->db->insert('T_Bankmappingpo',$podata1);
// $this->db->where('PONO',$pono); // $this->db->where('PONO',$pono);
$r = $this->db->affected_rows(); $r = $this->db->affected_rows();
return $r; return $r;
@ -1678,7 +1676,7 @@ function receiptdata()
$this->db->select('bm.id,bm.mid,bm.PONO,bm.Suppliername,bm.Totalpoamount,bm.Podate, $this->db->select('bm.id,bm.mid,bm.PONO,bm.Suppliername,bm.Totalpoamount,bm.Podate,
bm.Balancetopay,bm.Amountpaid,bm.IGRNO,bm.IGRLineItemNo,br.Balancetocleared,br.Clearbalance, bm.Balancetopay,bm.Amountpaid,bm.IGRNO,bm.IGRLineItemNo,br.Balancetocleared,br.Clearbalance,
inward.FilePath as igrfile,bu.FilePath pofile'); inward.FilePath as igrfile,bu.FilePath pofile');
$this->db->from ('T_Bankporeport bm'); $this->db->from ('T_Bankmappingpo bm');
$this->db->join('T_Inwardgateregister_fileupload inward','inward.IGRNO =bm.IGRNO','left'); $this->db->join('T_Inwardgateregister_fileupload inward','inward.IGRNO =bm.IGRNO','left');
$this->db->join('T_PurchaseOrder_BillUpload bu','bm.PONO=bu.PONO','left'); $this->db->join('T_PurchaseOrder_BillUpload bu','bm.PONO=bu.PONO','left');
$this->db->join('T_bankreport br','br.ID=bm.mid','left'); $this->db->join('T_bankreport br','br.ID=bm.mid','left');
@ -1714,7 +1712,7 @@ function receiptdata()
{ {
$this->db->select('bm.id,bm.mid,bm.PONO,bm.Suppliername,bm.SupplierID,bm.Totalpoamount,bm.Podate, $this->db->select('bm.id,bm.mid,bm.PONO,bm.Suppliername,bm.SupplierID,bm.Totalpoamount,bm.Podate,
bm.Balancetopay,sum(bm.Amountpaid) as Amountpaid,bm.IGRNO,bm.IGRLineItemNo'); bm.Balancetopay,sum(bm.Amountpaid) as Amountpaid,bm.IGRNO,bm.IGRLineItemNo');
$this->db->from ('T_Bankporeport bm'); $this->db->from ('T_Bankmappingpo bm');
$this->db->where('bm.IsActive',1); $this->db->where('bm.IsActive',1);
$this->db->group_by('bm.SupplierID'); $this->db->group_by('bm.SupplierID');
$query = $this->db->get(); $query = $this->db->get();
@ -1821,7 +1819,7 @@ function receiptdata()
{ {
$this->db->select('bm.id,bm.mid,bm.PONO,bm.Suppliername,bm.SupplierID,sum(bm.Totalpoamount)as Totalpoamount, $this->db->select('bm.id,bm.mid,bm.PONO,bm.Suppliername,bm.SupplierID,sum(bm.Totalpoamount)as Totalpoamount,
bm.Balancetopay,sum(bm.Amountpaid) as Amountpaid,bm.Podate,bm.IGRLineItemNo'); bm.Balancetopay,sum(bm.Amountpaid) as Amountpaid,bm.Podate,bm.IGRLineItemNo');
$this->db->from ('T_Bankporeport bm'); $this->db->from ('T_Bankmappingpo bm');
$this->db->where('bm.IsActive',1); $this->db->where('bm.IsActive',1);
@ -1870,7 +1868,7 @@ function receiptdata()
{ {
$this->db->select('bm.indate,bm.invoiceno,bm.customername,bm.totinvoiceamount,bm.bankid,bm.customerid, $this->db->select('bm.indate,bm.invoiceno,bm.customername,bm.totinvoiceamount,bm.bankid,bm.customerid,
bm.balancetoreceived,bm.amountreceived,bm.ID,br.Credit,br.cclearbalance,br.cbalancetocleared'); bm.balancetoreceived,bm.amountreceived,bm.ID,br.Credit,br.cclearbalance,br.cbalancetocleared');
$this->db->from ('T_Bankinvoicereport bm'); $this->db->from ('T_Bankmappingiv bm');
$this->db->join('T_bankreport br','br.ID=bm.bankid'); $this->db->join('T_bankreport br','br.ID=bm.bankid');
$this->db->where('bm.IsActive',1); $this->db->where('bm.IsActive',1);
$this->db->where('bm.customerid',$clientid); $this->db->where('bm.customerid',$clientid);
@ -1901,7 +1899,7 @@ function receiptdata()
{ {
$this->db->select('bm.indate,bm.invoiceno,bm.customername,bm.totinvoiceamount,bm.bankid,ic.client_id,bm.customerid as customerid, $this->db->select('bm.indate,bm.invoiceno,bm.customername,bm.totinvoiceamount,bm.bankid,ic.client_id,bm.customerid as customerid,
bm.balancetoreceived,sum(bm.amountreceived)as amountreceived,bm.ID,br.Credit,br.cclearbalance,br.cbalancetocleared'); bm.balancetoreceived,sum(bm.amountreceived)as amountreceived,bm.ID,br.Credit,br.cclearbalance,br.cbalancetocleared');
$this->db->from ('T_Bankinvoicereport bm'); $this->db->from ('T_Bankmappingiv bm');
$this->db->join('T_bankreport br','br.ID=bm.bankid'); $this->db->join('T_bankreport br','br.ID=bm.bankid');
$this->db->join('ip_clients ic','ic.client_name=bm.customername','left'); $this->db->join('ip_clients ic','ic.client_name=bm.customername','left');
$this->db->where('bm.IsActive',1); $this->db->where('bm.IsActive',1);
@ -1913,7 +1911,7 @@ function receiptdata()
{ {
$this->db->select('bm.indate,bm.invoiceno,bm.customername,bm.customerid as customerid,bm.totinvoiceamount,bm.bankid,ic.client_id, $this->db->select('bm.indate,bm.invoiceno,bm.customername,bm.customerid as customerid,bm.totinvoiceamount,bm.bankid,ic.client_id,
bm.balancetoreceived,sum(bm.amountreceived)as amountreceived,bm.ID,br.Credit,br.cclearbalance,br.cbalancetocleared'); bm.balancetoreceived,sum(bm.amountreceived)as amountreceived,bm.ID,br.Credit,br.cclearbalance,br.cbalancetocleared');
$this->db->from ('T_Bankinvoicereport bm'); $this->db->from ('T_Bankmappingiv bm');
$this->db->join('T_bankreport br','br.ID=bm.bankid'); $this->db->join('T_bankreport br','br.ID=bm.bankid');
$this->db->join('ip_clients ic','ic.client_name=bm.customername','left'); $this->db->join('ip_clients ic','ic.client_name=bm.customername','left');
$this->db->where('bm.IsActive',1); $this->db->where('bm.IsActive',1);

View File

@ -318,7 +318,6 @@ var row = 0;
function GetPayment(i) function GetPayment(i)
{ {
var bankdebitamount=$('#debitamount').val(); var bankdebitamount=$('#debitamount').val();
var totalvalue=$('#addvalue').val(); var totalvalue=$('#addvalue').val();
var balanceamount=bankdebitamount-totalvalue; var balanceamount=bankdebitamount-totalvalue;
@ -348,7 +347,7 @@ function GetPayment(i)
var igrno=igrno1.trim(); var igrno=igrno1.trim();
var igrlineitem1=document.getElementById ("igrlineitem"+i).innerText; var igrlineitem1=document.getElementById ("igrlineitem"+i).innerText;
var igrlineitem=igrlineitem1.trim(); var igrlineitem=igrlineitem1.trim();
//alert(igrlineitem.trim()); alert(igrlineitem);
var supname =document.getElementById ("sn"+i).innerText;//value taken from table col name : suppliername var supname =document.getElementById ("sn"+i).innerText;//value taken from table col name : suppliername
var supid =document.getElementById ("sid"+i ).innerText; var supid =document.getElementById ("sid"+i ).innerText;
var totalordervalue =document.getElementById ("tov"+i ).innerText;//value taken from table col name : total po amount var totalordervalue =document.getElementById ("tov"+i ).innerText;//value taken from table col name : total po amount

View File

@ -60,6 +60,9 @@ if(!empty($mapping))
<div class="col-md-12"> <div class="col-md-12">
<!-- TABLE: LATEST ORDERS --> <!-- TABLE: LATEST ORDERS -->
<div class="box box-info"> <div class="box box-info">
<div class="col-md-1 col-md-offset-11">
<a href="<?php base_url() ?>Bankingstatement" class="btn btn-primary" value="Back"/>Back</a>
</div>
<!--<div class="box-header with-border">--> <!--<div class="box-header with-border">-->
<!--<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Cashbook Reports</b></p></h3></center>--> <!--<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Cashbook Reports</b></p></h3></center>-->
<!--</div>--> <!--</div>-->

View File

@ -300,7 +300,7 @@ $Bankname = $t->Bankname;
$clearbalance=$t->Clearbalance; $clearbalance=$t->Clearbalance;
?> ?>
<td align="left" id="totalpaid<?php echo $i?>"><a href="<?php echo base_url() ?>cashbook/mappingpo?d=<?php echo $t->ID?>&clearbalance=<?php echo $clearbalance;?>&balancetoclear=<?php echo $t->Debit-$clearbalance;?>"><span><?php echo $clearbalance?></a></span></td> <td align="left" id="totalpaid<?php echo $i?>"><a href="<?php echo base_url() ?>MappingPo?d=<?php echo $t->ID?>&clearbalance=<?php echo $clearbalance;?>&balancetoclear=<?php echo $t->Debit-$clearbalance;?>"><span><?php echo $clearbalance?></a></span></td>
<?php <?php
if($status=='CLOSE') if($status=='CLOSE')