diff --git a/application/config/constants.php b/application/config/constants.php index 2c7488c7..bc413e34 100755 --- a/application/config/constants.php +++ b/application/config/constants.php @@ -140,6 +140,9 @@ define('PARTIALLY_PAID', 'ST059'); define('AMOUNT_RECEIVED', 'ST065'); define('NO_RECEIVED', 'ST066'); define('PARTIALLY_RECEIVED', 'ST067'); +define('AMOUNT_PAIDIGR', 'ST070'); +define('PARTIALLY_PAIDIGR', 'ST071'); +define('NO_PAIDIGR', 'ST072'); /* Work status code */ define('SERVICE_COMPLETED', 'ST046'); diff --git a/application/config/routes.php b/application/config/routes.php index c5015542..e37f5697 100755 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -239,6 +239,8 @@ $route['Receipt']= "cashbook/cashreceipt"; $route['Payment']= "cashbook/cashpayment"; $route['Invoice']= "cashbook/bankinvoice"; $route['Bankcash']= "cashbook/cashbanking"; +$route['DeleteInvoice']="cashbook/deletemappingiv"; +$route['MappingInvoice']="cashbook/mappinginvoice"; $route['qualityreportlist'] = "quality/reportList"; $route['qualityreportlistinward'] = "quality/reportListInward"; //<-------------Store page-----------------> diff --git a/application/controllers/cashbook.php b/application/controllers/cashbook.php index fa2156bb..79d830dd 100755 --- a/application/controllers/cashbook.php +++ b/application/controllers/cashbook.php @@ -441,8 +441,9 @@ class cashbook extends BaseController $option=Cash; } $balance=$totalbankamount-$totalamount; + $IsActive=1; $created_by = $this->session->userdata('userId'); - $addincomexpense = array('type'=>$accounttype,'account_code'=>$accountcode,'date'=>$date,'towhom'=>$towhome,'Supplier_id'=>$supplier,'invoice_no'=>$invoiceno,'merchant'=>$merchantname,'merchant_gst'=>$mergstno,'HSN'=>$hsn ,'value_before_gst'=>$beforegst,'sgst'=>$sgst,'cgst'=>$cgst,'igst'=>$igst,'total'=>$totalamount,'description'=>$description,'document'=>$document,'Created_By'=>$created_by,'cashtype'=>$option,'bankid'=>$bankid,'totalbankamount'=>$totalbankamount,'balance'=>$balance,'gststatus'=>(!empty($gsttoggle)?'1':'0'),'amounttype'=>$amounttype); + $addincomexpense = array('type'=>$accounttype,'account_code'=>$accountcode,'date'=>$date,'towhom'=>$towhome,'Supplier_id'=>$supplier,'invoice_no'=>$invoiceno,'merchant'=>$merchantname,'merchant_gst'=>$mergstno,'HSN'=>$hsn ,'value_before_gst'=>$beforegst,'sgst'=>$sgst,'cgst'=>$cgst,'igst'=>$igst,'total'=>$totalamount,'description'=>$description,'document'=>$document,'Created_By'=>$created_by,'cashtype'=>$option,'bankid'=>$bankid,'totalbankamount'=>$totalbankamount,'balance'=>$balance,'gststatus'=>(!empty($gsttoggle)?'1':'0'),'amounttype'=>$amounttype,'IsActive'=>$IsActive); //print_r($addincomexpense); //die(); if($balance=='0') @@ -495,11 +496,11 @@ class cashbook extends BaseController //echo ""; echo ""; - if($amounttype == '')//Redirct To Listing Screen + if($amounttype == ' ')//Redirct To Listing Screen { redirect('ViewIncomeExpense','refresh'); } - else if($amounttype != '')//Redirct To Bank Report Screen + else if($amounttype != ' ')//Redirct To Bank Report Screen { redirect('Bankingstatement','refresh'); } @@ -534,7 +535,7 @@ class cashbook extends BaseController $bankcash1 = array('cdate'=>$bankdate,'mid'=>$bankid,'btype'=>$type,'amount'=>$alreadypaid,'boption'=>$option,'mappingamount'=>$forstatus,'totalamount'=>$amount,'amounttype'=>$bankamounttype,'alreadycreditpaid'=>$alreadycreditpaid); //print_r($bankcash1); //die(); - $res1 = $this->cashbook_model->addcashbook($bankcash1); + // $res1 = $this->cashbook_model->addcashbook($bankcash1); } @@ -938,12 +939,14 @@ class cashbook extends BaseController { - // $this->global['pageTitle'] = 'Siddharth : Cashbook Listing'; - $this->global['pageTitle'] = 'Siddharth : Bank Report - Debited Settlements'; + $this->global['pageTitle'] = 'Siddharth : Cashbook Listing'; + $this->global['pageTitle'] = 'Siddharth : Bank Report - Debited Settlements'; $SupplierName = $this->input->post('SupplierName'); $fdate = $this->input->post('from_date'); $tdate = $this->input->post('to_date'); $bankid= $_GET['d']; + $data['clearbalance']= $_GET['clearbalance']; + $data['balancetoclear'] =$_GET['balancetoclear']; $data['mappingcashbook']=$this->cashbook_model->mappingcash($SupplierName,$fdate,$tdate,$bankid); $data['mapping'] = $this->cashbook_model->debitpolist($bankid); $data['paidcbook'] = $this->cashbook_model->cashbookamount($bankid); @@ -962,11 +965,14 @@ class cashbook extends BaseController $fdate = $this->input->post('from_date'); $tdate = $this->input->post('to_date'); $bankid= $_GET['d']; + $data['clearbalance']=$_GET['cb']; + $data['balancetoclear']=$_GET['btc']; $data['mappingcashbook']=$this->cashbook_model->mappingcash($SupplierName,$fdate,$tdate,$bankid); $data['mappingiv'] = $this->cashbook_model->creditinvoicelist($bankid); $data['paidcbook'] = $this->cashbook_model->cashbookamount($bankid); - $data['invoiceramount'] = $this->cashbook_model->invoiceamonut($bankid); + $data['invoiceramount'] = $this->cashbook_model->invoiceamonut($bankid); $data['supplier'] = $this->cashbook_model->getsupplier(); + //redirect('Bankingstatement','refresh'); $this->loadViews("bankinvoicesettlement", $this->global,$data,NULL); } @@ -1001,17 +1007,15 @@ class cashbook extends BaseController public function receipt() { - // die(); + $this->global['pageTitle'] = 'Siddharth : Bank Report - Store Debited Details'; $check = $this->input->post('check'); $rw = $this->input->post('rw'); - //$this->global['pageTitle'] = 'Siddharth : Cashbook Listing'; - $this->global['pageTitle'] = 'Siddharth : Bank Report - Store Debited Details'; - $date = $this->input->post('podate'); - $date = date_create($date);//,'Y-m-d'); + $date = $this->input->post('podate'); + $date = date_create($date); $date = date_format($date,'Y-m-d'); - //echo $date; - - $pono = $this->input->post('pono'); + $pono = $this->input->post('pono'); + $igrno=$this->input->post('igrno'); + $igrlineitem=$this->input->post('igrlineitem'); $sname = $this->input->post('sname'); $tot = $this->input->post('tot'); $rowcount = $this->input->post('rc'); @@ -1076,13 +1080,13 @@ class cashbook extends BaseController $amtpaid= ($ip+$ePay); - + $IsActive=1; - $podata1 = array('Podate'=>$date,'PONO'=>$pono,'Suppliername'=>$sname,'Totalpoamount'=>$tot,'Amountpaid'=>$ip,'Balancetopay'=>$balancetopay,'mid'=>$bankid); + $podata1 = array('Podate'=>$date,'PONO'=>$pono,'IGRNO'=>$igrno,'Suppliername'=>$sname,'Totalpoamount'=>$tot,'Amountpaid'=>$ip,'Balancetopay'=>$balancetopay,'mid'=>$bankid,'IGRLineItemNo'=>$igrlineitem,'IsActive'=>$IsActive); //print_r($podata1); //die(); - $podata = array('Podate'=>$date,'PONO'=>$pono,'Suppliername'=>$sname,'Totalpoamount'=>$tot,'Amountpaid'=>$amtpaid,'Balancetopay'=>$balancetopay,'mid'=>$bankid); - + $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); @@ -1104,18 +1108,29 @@ class cashbook extends BaseController echo "Saved Successfully!"; } - if($balancetopay==0) - { - $status=AMOUNT_PAID; + // if($balancetopay==0) + // { + // $status=AMOUNT_PAID; + // } + // else + // { + // $status=PARTIALLY_PAID; + // } + // $pomaster= array('Paymentstatus'=>$status); + + if($balancetopay==0) + { + $igrstatus=AMOUNT_PAIDIGR; } else { - $status=PARTIALLY_PAID; + $igrstatus=PARTIALLY_PAIDIGR; } - $pomaster= array('Paymentstatus'=>$status); - $result1 = $this->cashbook_model->poamountstatus($pomaster,$pono); - //$this->loadViews("bankstatement", $this->global,$data, NULL); + $igrdetails=array('BankStatus'=>$igrstatus); + $result1 = $this->cashbook_model->igrdetailstatus($igrdetails,$igrlineitem); + //$result1 = $this->cashbook_model->poamountstatus($pomaster,$pono); + $this->loadViews("bankstatement", $this->global,$data, NULL); } public function invoiceamount1() { @@ -1196,10 +1211,10 @@ class cashbook extends BaseController $amtpaid= ($ip+$eRec); $updateamount=($totalpaidamount+$eRec); - + $IsActive=1; $invoicedata1 = array('indate'=>$date,'invoiceno'=>$invid,'customername'=>$cname,'totinvoiceamount'=>$invamount,'balancetoreceived'=>$balancetoreceived1,'amountreceived'=>$amtpaid,'bankid'=>$bankid); - $invoicedata = array('indate'=>$date,'invoiceno'=>$invid,'customername'=>$cname,'totinvoiceamount'=>$invamount,'balancetoreceived'=>$balancetoreceived1,'amountreceived'=>$ip,'bankid'=>$bankid); + $invoicedata = array('indate'=>$date,'invoiceno'=>$invid,'customername'=>$cname,'totinvoiceamount'=>$invamount,'balancetoreceived'=>$balancetoreceived1,'amountreceived'=>$ip,'bankid'=>$bankid,'IsActive'=>$IsActive); // //print_r ($invoicedata); // //die(); @@ -1209,7 +1224,7 @@ class cashbook extends BaseController if(count($result3)<=0) { //echo "insert"; - $result = $this->cashbook_model->invoicedata($invoicedata); + $result = $this->cashbook_model->invoicedata($invoicedata1); } else @@ -1228,8 +1243,7 @@ class cashbook extends BaseController $status=PARTIALLY_RECEIVED; } $invoicemaster= array('receivedstatus'=>$status); - print_r($invoicemaster); - //die(); + $result1 = $this->cashbook_model->invoiceamountstatus($invoicemaster,$invid); echo ""; @@ -1250,12 +1264,11 @@ class cashbook extends BaseController $data['bankdebit'] = $this->cashbook_model->debitpolistfilter($SupplierName,$fdate,$tdate); } - $data['amountpaid'] = $this->cashbook_model->paided(); + $data['amountpaid'] = $this->cashbook_model->paided(); $data['supplier'] = $this->cashbook_model->getsupplier(); - $this->loadViews("bankamountpaid", $this->global,$data, NULL); + $this->loadViews("bankamountpaid", $this->global,$data, NULL); } - public function amountreceived() { @@ -1279,13 +1292,125 @@ class cashbook extends BaseController public function cashbanking() { $data['dropdownvalues'] = $this->cashbook_model->getAccounTypes(); - $data['cashbanking'] = $this->cashbook_model->newcashbook(); + //$data['cashbanking'] = $this->cashbook_model->newcashbook(); $data['getsupplier'] = $this->cashbook_model->getsupplier(); $this->global['pageTitle'] ='Siddharth :bankcashbook'; $this->loadViews("bankcashnew", $this->global,$data,NULL); - } + } + public function Deletemappingpo() + { + $totalamount = $_GET['Totalpoamount']; + $Bankid = $_GET['bankid']; + $Amount = $_GET['amount']; + $igrno = $_GET['igrno']; + $balancetoclear=$_GET['balancetoclear']; + $bankamount=$_GET['bankamount']; + $updateamount=$bankamount-$Amount; + $updatebalancetoclear=$Amount+$balancetoclear; + $data['$bankmappingamount'] = $this->cashbook_model->gettotalbankmappingpo($igrno); + $amountpaid=$data['$bankmappingamount'][0]->Amountpaid; + //$data['$totallineitemamount']=$this->cashbook_model->gettotallineitem($igrno); + + if($amountpaid==$totalamount) + { + $BankStatus=NO_PAIDIGR; + } + else + { + $BankStatus=PARTIALLY_PAIDIGR; + } + $result= $this->cashbook_model->IgrDetailsStatusUpdate($igrno,$BankStatus); + $result1= $this->cashbook_model->deletemapping($Bankid,$updateamount,$updatebalancetoclear); + //for update mapping amount in t_bankmappingpo table// + $balancetopay=$_GET['balancetopay']; + $totalbalancetopay=$Amount + $balancetopay; + //$updateamount=0; + $IsActive=0; + $result2= $this->cashbook_model->deleteBankmappingpo($igrno,$Bankid,$IsActive); + //for update mapping amount inT_Bankporeport table// + $result3= $this->cashbook_model->updateBankporeportpo($igrno,$totalbalancetopay,$updateamount,$Bankid); + + if(count($result2)>0) + { + redirect('Bankingstatement','refresh'); + } + + } + public function deletemappingiv() + { + + $this->global['pageTitle'] = 'Siddharth : Bank Report - Delete Mapping Invoice'; + $invoiceno = $this->input->post('invoiceno'); + $bankid = $this->input->post('bankid'); + $amountreceived = $this->input->post('amountreceived'); + $bankingclear = $this->input->post('bankingclear'); + $bankingbalclear = $this->input->post('bankingbalclear'); + $totinvoiceamount = $this->input->post('totinvoiceamount'); + $balancetoreceived = $this->input->post('balancetoreceived'); + $updatebalancetoclear=$amountreceived+$bankingbalclear; + $updateclearbalance=$bankingclear-$amountreceived; + $bankstatement=array('cbalancetocleared'=>$updatebalancetoclear,'cclearbalance'=>$updateclearbalance); + $result1= $this->cashbook_model->updatebankreportiv($bankid,$bankstatement); + print_r($result1); + //die(); + $IsActive=0; + $result2= $this->cashbook_model->deletemappinginvoice($bankid,$invoiceno,$IsActive); + $updatebalancetoreceived=$balancetoreceived+$amountreceived; + $updateamountreceived=$totinvoiceamount-$updatebalancetoreceived; + $result3= $this->cashbook_model->updatebankinvoicereport($invoiceno,$bankid,$updatebalancetoreceived,$updateamountreceived); + $this->loadViews("bankstatement", $this->global,$data, NULL); + + // if(count($result2)>0) + // { + // redirect('Bankingstatement','refresh'); + // } + + } + + public function Deletemappingcashbook() + { + $bankamount=$_GET['bankamount']; + $Bankid = $_GET['bankid']; + $Amount = $_GET['amount']; + $accountname = $_GET['accountname']; + $IsActive=0; + $balancetoclear=$_GET['balancetoclear']; + $clearbalance =$bankamount-$Amount; + $updatebankamount= $Amount+$balancetoclear; + $data['$accountcode'] = $this->cashbook_model->getaccountcode($accountname); + $accountcode=$data['$accountcode'][0]->code; + $result=$this->cashbook_model->deletecashbookdata($Bankid,$updatebankamount,$clearbalance,$IsActive); + $result1=$this->cashbook_model->StatusUpadateCashbook($Bankid,$accountcode,$IsActive); + if(count($result1)>0) + { + redirect('Bankingstatement','refresh'); + } + + } + public function Deletemappingcashbookcredit() + { + $bankamount=$_GET['bankamount']; + $Bankid = $_GET['bankid']; + $Amount = $_GET['amount']; + $accountname = $_GET['accountname']; + $IsActive=0; + $balancetoclear=$_GET['balancetoclear']; + $clearbalance =$_GET['clearbalance']; + $updateclearbalance=$clearbalance-$Amount; + $updatebalancetoclear=$balancetoclear+$Amount; + $data['$accountcode'] = $this->cashbook_model->getaccountcode($accountname); + $accountcode=$data['$accountcode'][0]->code; + $result=$this->cashbook_model->deletecashbookdatacredit($Bankid,$updateclearbalance,$updatebalancetoclear); + $result1=$this->cashbook_model->StatusUpadateCashbook($Bankid,$accountcode,$IsActive); + if(count($result1)>0) + { + // $this->loadViews("Bankingstatement", $this->global,$result1, NULL); + //echo ""; + redirect('Bankingstatement','refresh'); + } + } public function convertNumber($amt){ //echo $amt;die(); diff --git a/application/models/cashbook_model.php b/application/models/cashbook_model.php index 67be6b3d..ea4a492d 100755 --- a/application/models/cashbook_model.php +++ b/application/models/cashbook_model.php @@ -291,19 +291,20 @@ function clearedbalance(){ //die(); //$Supplierid; $this->db->distinct(); - $this->db->select('POM.PONO,POM.Paymentstatus,supp.SupplierName,igr.CreatedDate, - POM.TotalOrderValue,POM.ServiceDescription,BR.Balancetopay,BR.Amountpaid, - POM.POType,POM.ReleasedBy,POM.IsQualityChkReqired,POM.POType,POM.CapitalRange,POM.Status, - PUADV.AdvanceAmount'); - $this->db->from ('T_PurchaseOrder_Master POM'); - $this->db->join('T_IGR_Master igr','igr.PONO = POM.PONO'); - $this->db->join('T_SupplierDetailsN supp','supp.SupplierID = POM.SupplierID'); - - $this->db->join('T_PurchaseOrder_AdvanceRequest PUADV','POM.PONO=PUADV.PONO','left'); - - $this->db->join ('T_Bankporeport BR','BR.PONO = POM.PONO','left'); + $this->db->select('igr.PONO,supp.SupplierName,igrli.CreatedDate,igrli.IGRItemNo,igr.IGRNO,BR.Balancetopay,BR.Amountpaid,pom.Status,poli.ReceivedQuantity,poli.Rate'); + $this->db->from ('T_IGR_Details igrli'); + $this->db->join('T_IGR_Master igr','igrli.IGRNO = igr.IGRNO'); + $this->db->join('T_PurchaseOrder_Master pom','igr.PONO =pom.PONO'); + $this->db->join('T_PurchaseOrder_LineItem poli','pom.PONO= poli.PONO'); + $this->db->join('T_SupplierDetailsN supp','pom.SupplierID =supp.SupplierID'); + $this->db->join ('T_Bankporeport BR','pom.PONO = BR.PONO','left'); // $this->db->where_in('POM.Status',[ST044,ST056]); // $this->db->where('POM.Paymentstatus !=','ST057'); + // $sql='select distinct T_IGR_Master.PONO,T_IGR_Details.IGRNO,T_PurchaseOrder_LineItem.Quantity,T_PurchaseOrder_LineItem.Rate,T_SupplierDetailsN.SupplierName from T_IGR_Master + // INNER JOIN T_IGR_Details ON T_IGR_Details.IGRNO=T_IGR_Master.IGRNO + // INNER JOIN T_PurchaseOrder_Master ON T_PurchaseOrder_Master.PONO=T_IGR_Master.PONO + // INNER JOIN T_SupplierDetailsN ON T_SupplierDetailsN.SupplierID = T_PurchaseOrder_Master.SupplierID + // INNER JOIN T_PurchaseOrder_LineItem ON T_PurchaseOrder_LineItem.PONO=T_IGR_Master.PONO '; if ($fdate and $tdate != ''){ $fromdate= date("Y-m-d",strtotime($fdate)); @@ -315,9 +316,11 @@ function clearedbalance(){ if ($Supplierid != ''){ $this->db->where('supp.SupplierID',$Supplierid); } - $this->db->where_in('POM.Status',[ST044,ST056]); - - $this->db->group_by('POM.PONO'); + $this->db->where_in('pom.Status',[ST044,ST056]); + $this->db->where('igrli.BankStatus !=','ST070'); + //$this->db->group_by('pom.PONO'); + //$this->db->group_by('igrli.IGRItemNo'); + //$this->db->group_by('igr.IGRNO'); $query = $this->db->get(); return $query->result(); @@ -378,10 +381,14 @@ function receiptdata() function debitpolist($bankid) { $this->db->select('bp.mid,bp.Podate,bp.PONO,bp.Suppliername,bp.Totalpoamount, - bp.Balancetopay,bp.Amountpaid,bu.FilePath'); + bp.Balancetopay,bp.Amountpaid,bp.IGRNO,igrm.file,igrde.IGRItemNo'); $this->db->from ('T_Bankmappingpo bp'); - $this->db->join ('T_PurchaseOrder_BillUpload bu','bu.PONO = bp.PONO','left'); + $this->db->join ('T_IGR_Master igrm','igrm.IGRNO = bp.IGRNO','left'); + $this->db->join ('T_IGR_Details igrde','igrde.IGRNO=igrm.IGRNO','left'); + + //$this->db->join ('T_PurchaseOrder_BillUpload bu','bu.PONO = bp.PONO','left'); $this->db->where('mid',$bankid); + $this->db->where('igrde.BankStatus !=','ST072'); //$this->db->group_by('PONO'); $query = $this->db->get(); return $query->result(); @@ -412,9 +419,10 @@ function debitpolist($bankid) function creditinvoicelist($bankid) { $this->db->select('indate,invoiceno,customername,totinvoiceamount,bankid, - balancetoreceived,amountreceived'); + balancetoreceived,amountreceived'); $this->db->from ('T_Bankmappingiv'); $this->db->where('bankid',$bankid); + $this->db->where('IsActive',1); //$this->db->group_by('invoiceno'); $query = $this->db->get(); return $query->result(); @@ -445,6 +453,7 @@ function debitpolist($bankid) $this->db->select('sum(amountreceived)as amountreceived'); $this->db->from ('T_Bankmappingiv'); $this->db->where('bankid',$bankid); + $this->db->where('IsActive',1); //$this->db->group_by('invoiceno'); $query = $this->db->get(); return $query->result(); @@ -466,6 +475,7 @@ function debitpolist($bankid) $this->db->select('sum(total)as total'); $this->db->from ('t_income_expense'); $this->db->where('bankid',$bankid); + $this->db->where('IsActive',1); //$this->db->group_by('invoiceno'); $query = $this->db->get(); return $query->result(); @@ -478,7 +488,7 @@ function debitpolist($bankid) $this->db->from ('t_income_expense as ie'); $this->db->join ('t_accountcode ac ','ac.code = ie.account_code','left'); $this->db->where('bankid',$bankid); - + $this->db->where('IsActive',1); //$this->db->group_by('mid'); $query = $this->db->get(); return $query->result(); @@ -742,12 +752,12 @@ function debitpolist($bankid) return $result; } - function poamountstatus($pomaster,$pono) + + + function igrdetailstatus($igrdetails,$igrlineitem) { - //echo $pomaster; - //echo $pono; - $this->db->where('PONO', $pono); - $this->db->update('T_PurchaseOrder_Master',$pomaster); + $this->db->where('IGRItemNo', $igrlineitem); + $this->db->update('T_IGR_Details',$igrdetails); $r = $this->db->affected_rows(); return $r; @@ -805,6 +815,115 @@ function debitpolist($bankid) } } + function deletemapping($Bankid,$updateamount,$updatebalancetoclear) + { + $this->db->set('Clearbalance',$updateamount); + $this->db->set('Balancetocleared',$updatebalancetoclear); + $this->db->where('ID',$Bankid); + $this->db->update('T_bankreport'); + $r = $this->db->affected_rows(); + return $r; + } + function updatebankreportiv($bankid,$bankstatement) + { + $this->db->where('ID',$bankid); + $this->db->update('T_bankreport',$bankstatement); + $r = $this->db->affected_rows(); + return $r; + + } + function IgrDetailsStatusUpdate($igrno,$BankStatus) + { + + $this->db->set('BankStatus',$BankStatus); + $this->db->where('IGRItemNo',$igrno); + $this->db->update('T_IGR_Details'); + $r = $this->db->affected_rows(); + return $r; + } + function deleteBankmappingpo($igrno,$Bankid,$IsActive) + { + $this->db->set('IsActive',$IsActive); + $this->db->where('IGRLineItemNo',$igrno); + $this->db->where('mid',$Bankid); + $this->db->update('T_Bankmappingpo'); + $r = $this->db->affected_rows(); + return $r; + } + function deletemappinginvoice($bankid,$invoiceno,$IsActive) + { $this->db->set('IsActive',$IsActive); + $this->db->where('invoiceno',$invoiceno); + $this->db->where('bankid',$bankid); + $this->db->update('T_Bankmappingiv'); + $r = $this->db->affected_rows(); + return $r; + } + function updateBankporeportpo($igrno,$totalbalancetopay,$updateamount,$Bankid) + { + $this->db->set('Balancetopay',$totalbalancetopay); + $this->db->set('Amountpaid',$updateamount); + $this->db->where('IGRLineItemNo',$igrno); + $this->db->where('mid',$Bankid); + $this->db->update('T_Bankporeport'); + $r = $this->db->affected_rows(); + return $r; + + } + function updatebankinvoicereport($invoiceno,$bankid,$updatebalancetoreceived,$updateamountreceived) + { + $this->db->set('balancetoreceived',$updatebalancetoreceived); + $this->db->set('amountreceived',$updateamountreceived); + $this->db->where('invoiceno',$invoiceno); + $this->db->where('bankid',$bankid); + $this->db->update('T_Bankinvoicereport'); + $r = $this->db->affected_rows(); + return $r; + } + function gettotalbankmappingpo($igrno) + { + $this->db->select('sum(Amountpaid)as Amountpaid'); + $this->db->from ('T_Bankmappingpo'); + $this->db->where('IGRLineItemNo',$igrno); + $this->db->where('IsActive',1); + $this->db->group_by('T_Bankmappingpo.IGRLineItemNo'); + $query = $this->db->get(); + return $query->result(); + } + function deletecashbookdata($Bankid,$updatebankamount,$clearbalance) + { + $this->db->set('Clearbalance',$clearbalance); + $this->db->set('Balancetocleared',$updatebankamount); + $this->db->where('ID',$Bankid); + $this->db->update('T_bankreport'); + $r = $this->db->affected_rows(); + return $r; + } + function deletecashbookdatacredit($Bankid,$updateclearbalance,$updatebalancetoclear) + { + $this->db->set('cclearbalance',$updateclearbalance); + $this->db->set('cbalancetocleared',$updatebalancetoclear); + $this->db->where('ID',$Bankid); + $this->db->update('T_bankreport'); + $r = $this->db->affected_rows(); + return $r; + } + function getaccountcode($accountname) + { + $this->db->select('code'); + $this->db->from ('t_accountcode'); + $this->db->where('name',$accountname); + $query = $this->db->get(); + return $query->result(); + } + function StatusUpadateCashbook($Bankid,$accountcode,$IsActive) + { + $this->db->set('IsActive',$IsActive); + $this->db->where('bankid',$Bankid); + $this->db->where('account_code',$accountcode); + $this->db->update('t_income_expense'); + $r = $this->db->affected_rows(); + return $r; + } } diff --git a/application/views/bankdebit.php b/application/views/bankdebit.php index d686573f..320c9a92 100644 --- a/application/views/bankdebit.php +++ b/application/views/bankdebit.php @@ -155,14 +155,16 @@ foreach($financialyear as $item)