diff --git a/application/controllers/cashbook.php b/application/controllers/cashbook.php index d02929ac..f0b70f59 100755 --- a/application/controllers/cashbook.php +++ b/application/controllers/cashbook.php @@ -986,8 +986,9 @@ class cashbook extends BaseController $data['bankdepit'] = $this->cashbook_model->debitbankstatemet($Supplierid,$fdate,$tdate); } +// print_r($data['bankdepit']); $data['getsupplier'] = $this->cashbook_model->getsupplier(); - $this->loadViews("bankdebit",$this->global,$data,NULL); + $this->loadViews("bankdebit",$this->global,$data,NULL); //die(); } @@ -1015,6 +1016,7 @@ class cashbook extends BaseController $igrsingle = $this->cashbook_model->igrmastersingle($igrno); $igrmultiple =$this->cashbook_model->igrmastermultiple($igrno); $data = array_merge($igrsingle,$igrmultiple); + //print_r($data); echo json_encode($data); @@ -1118,7 +1120,9 @@ class cashbook extends BaseController { $this->global['pageTitle'] = 'Siddharth : Bank Report - Store Debited Details'; $check = $this->input->post('check'); + // echo 'check'.$check; $rw = $this->input->post('rw'); + // echo 'rw'.$rw; $date = $this->input->post('podate'); $date = date_create($date); $date = date_format($date,'Y-m-d'); @@ -1128,9 +1132,15 @@ class cashbook extends BaseController $sname = $this->input->post('sname'); $tot = $this->input->post('tot'); + // echo'tot'.$tot; + $rowcount = $this->input->post('rc'); + $totalpaidamount= $this->input->post('tpv'); + //echo 'totalpaidamount'.$totalpaidamount; + $bankdebitamountamount= $this->input->post('bda'); + //echo 'bankdebitamountamount'.$bankdebitamountamount; $bankid =$this->input->post('bi'); $alreadypaid = 0; //echo $earlypaid; @@ -1147,14 +1157,17 @@ class cashbook extends BaseController $aPay = $ap->Clearbalance; } } + // echo 'apay',$apay; if($check == 1) { $clearedblnce=($totalpaidamount+$aPay); + //echo 'clearbalance'.$clearedblnce; + $balancetocleared=($bankdebitamountamount-$totalpaidamount); $check =1; } - //echo $balancetocleared; + //echo 'Balancetocleared'.$balancetocleared; //die(); if($balancetocleared>0) { @@ -1185,6 +1198,7 @@ class cashbook extends BaseController $ePay = $ep->Amountpaid; } } + //echo 'epay'.$epay; $ip=$this->input->post('aa'); $balancetopay=($tot-($ip+$ePay)); @@ -1198,7 +1212,7 @@ class cashbook extends BaseController $podata = array('Podate'=>$date,'PONO'=>$pono,'IGRNO'=>$igrno,'Suppliername'=>$sname,'Totalpoamount'=>$tot,'Amountpaid'=>$amtpaid,'Balancetopay'=>$balancetopay,'mid'=>$bankid,'IGRLineItemNo'=>$igrlineitem); //die(); - $result3 = $this->cashbook_model->getpono($pono); + $result3 = $this->cashbook_model->getpono($igrlineitem); $resultn = $this->cashbook_model->mappingpo($podata1); if(count($result3)<=0) @@ -1210,7 +1224,7 @@ class cashbook extends BaseController else { //echo "update"; - $result3 = $this->cashbook_model->poupdate($podata,$pono); + $result3 = $this->cashbook_model->poupdate($podata,$igrlineitem); } if($rw == $rowcount) @@ -1219,7 +1233,7 @@ class cashbook extends BaseController } - + if($balancetopay==0) { $igrstatus=AMOUNT_PAIDIGR; diff --git a/application/models/cashbook_model.php b/application/models/cashbook_model.php index 260adcf3..2aa21633 100755 --- a/application/models/cashbook_model.php +++ b/application/models/cashbook_model.php @@ -509,7 +509,7 @@ function receiptdata() function igrmastermultiple($igrno) { - $this->db->select('BillNo,IGRNO,FilePath,PONO'); + $this->db->select('BillNo,IGRNO,FilePath,PONO,Remarks'); $this->db->from('T_Inwardgateregister_fileupload'); $this->db->where('IGRNO',$igrno); $query = $this->db->get(); @@ -738,11 +738,11 @@ function receiptdata() } - public function getpono($pono) + public function getpono($igrlineitem) { - $this->db->select('PONO'); + $this->db->select('IGRLineItemNo'); $this->db->from('T_Bankporeport'); - $this->db->where('PONO ',$pono); + $this->db->where('IGRLineItemNo ',$igrlineitem); $query = $this->db->get(); // print_r( $this->db->last_query()); return $query->result(); @@ -801,11 +801,11 @@ function receiptdata() return TRUE; } - public function getearlyamount($IGRLineItemNo) + public function getearlyamount($igrlineitem) { $this->db->select('Amountpaid'); $this->db->from('T_Bankporeport'); - $this->db->where('IGRLineItemNo ',$IGRLineItemNo); + $this->db->where('IGRLineItemNo ',$igrlineitem); $query = $this->db->get(); // print_r( $this->db->last_query()); return $query->result(); @@ -842,10 +842,10 @@ function receiptdata() } - public function poupdate($podata,$pono) + public function poupdate($podata,$igrlineitem) { - $this->db->where('PONO',$pono); + $this->db->where('IGRLineItemNo',$igrlineitem); $this->db->update('T_Bankporeport',$podata); return TRUE; diff --git a/application/views/bankamountpaid.php b/application/views/bankamountpaid.php index efae2331..9775c0a6 100644 --- a/application/views/bankamountpaid.php +++ b/application/views/bankamountpaid.php @@ -440,7 +440,7 @@ $( function() { { data:{igrno:igrno}, type:"POST", - url:"cashbook/IGRFilelist", + url:"cashbook/IGRFilelist", success:function(data) { @@ -473,7 +473,7 @@ $( function() { PONO =item.pono; BillNO = '-'; - FilePath =item.file; + FilePath =""+item.file; } diff --git a/application/views/banksettlement.php b/application/views/banksettlement.php index 2ba59378..b26539a6 100644 --- a/application/views/banksettlement.php +++ b/application/views/banksettlement.php @@ -569,7 +569,7 @@ function pono(i) $.each($.parseJSON(data),function (i, item) { - if(item.file == null) + if(item.file ==null) { if(item.Remarks ==null) { //alert() @@ -588,8 +588,7 @@ function pono(i) Filename = item.file; PONO =item.pono; BillNO = '-'; - - FilePath =item.file; + FilePath =""+item.file; }