bankstatement edit option

This commit is contained in:
gayathri1990 2018-06-21 13:51:43 +05:30
parent b0852aeaa1
commit 04447482aa
8 changed files with 527 additions and 139 deletions

View File

@ -140,6 +140,9 @@ define('PARTIALLY_PAID', 'ST059');
define('AMOUNT_RECEIVED', 'ST065'); define('AMOUNT_RECEIVED', 'ST065');
define('NO_RECEIVED', 'ST066'); define('NO_RECEIVED', 'ST066');
define('PARTIALLY_RECEIVED', 'ST067'); define('PARTIALLY_RECEIVED', 'ST067');
define('AMOUNT_PAIDIGR', 'ST070');
define('PARTIALLY_PAIDIGR', 'ST071');
define('NO_PAIDIGR', 'ST072');
/* Work status code */ /* Work status code */
define('SERVICE_COMPLETED', 'ST046'); define('SERVICE_COMPLETED', 'ST046');

View File

@ -239,6 +239,8 @@ $route['Receipt']= "cashbook/cashreceipt";
$route['Payment']= "cashbook/cashpayment"; $route['Payment']= "cashbook/cashpayment";
$route['Invoice']= "cashbook/bankinvoice"; $route['Invoice']= "cashbook/bankinvoice";
$route['Bankcash']= "cashbook/cashbanking"; $route['Bankcash']= "cashbook/cashbanking";
$route['DeleteInvoice']="cashbook/deletemappingiv";
$route['MappingInvoice']="cashbook/mappinginvoice";
$route['qualityreportlist'] = "quality/reportList"; $route['qualityreportlist'] = "quality/reportList";
$route['qualityreportlistinward'] = "quality/reportListInward"; $route['qualityreportlistinward'] = "quality/reportListInward";
//<-------------Store page-----------------> //<-------------Store page----------------->

View File

@ -441,8 +441,9 @@ class cashbook extends BaseController
$option=Cash; $option=Cash;
} }
$balance=$totalbankamount-$totalamount; $balance=$totalbankamount-$totalamount;
$IsActive=1;
$created_by = $this->session->userdata('userId'); $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); //print_r($addincomexpense);
//die(); //die();
if($balance=='0') if($balance=='0')
@ -495,11 +496,11 @@ 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($amounttype == ' ')//Redirct To Listing Screen
{ {
redirect('ViewIncomeExpense','refresh'); redirect('ViewIncomeExpense','refresh');
} }
else if($amounttype != '')//Redirct To Bank Report Screen else if($amounttype != ' ')//Redirct To Bank Report Screen
{ {
redirect('Bankingstatement','refresh'); 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); $bankcash1 = array('cdate'=>$bankdate,'mid'=>$bankid,'btype'=>$type,'amount'=>$alreadypaid,'boption'=>$option,'mappingamount'=>$forstatus,'totalamount'=>$amount,'amounttype'=>$bankamounttype,'alreadycreditpaid'=>$alreadycreditpaid);
//print_r($bankcash1); //print_r($bankcash1);
//die(); //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 : Cashbook Listing';
$this->global['pageTitle'] = 'Siddharth : Bank Report - Debited Settlements'; $this->global['pageTitle'] = 'Siddharth : Bank Report - Debited Settlements';
$SupplierName = $this->input->post('SupplierName'); $SupplierName = $this->input->post('SupplierName');
$fdate = $this->input->post('from_date'); $fdate = $this->input->post('from_date');
$tdate = $this->input->post('to_date'); $tdate = $this->input->post('to_date');
$bankid= $_GET['d']; $bankid= $_GET['d'];
$data['clearbalance']= $_GET['clearbalance'];
$data['balancetoclear'] =$_GET['balancetoclear'];
$data['mappingcashbook']=$this->cashbook_model->mappingcash($SupplierName,$fdate,$tdate,$bankid); $data['mappingcashbook']=$this->cashbook_model->mappingcash($SupplierName,$fdate,$tdate,$bankid);
$data['mapping'] = $this->cashbook_model->debitpolist($bankid); $data['mapping'] = $this->cashbook_model->debitpolist($bankid);
$data['paidcbook'] = $this->cashbook_model->cashbookamount($bankid); $data['paidcbook'] = $this->cashbook_model->cashbookamount($bankid);
@ -962,11 +965,14 @@ 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');
$bankid= $_GET['d']; $bankid= $_GET['d'];
$data['clearbalance']=$_GET['cb'];
$data['balancetoclear']=$_GET['btc'];
$data['mappingcashbook']=$this->cashbook_model->mappingcash($SupplierName,$fdate,$tdate,$bankid); $data['mappingcashbook']=$this->cashbook_model->mappingcash($SupplierName,$fdate,$tdate,$bankid);
$data['mappingiv'] = $this->cashbook_model->creditinvoicelist($bankid); $data['mappingiv'] = $this->cashbook_model->creditinvoicelist($bankid);
$data['paidcbook'] = $this->cashbook_model->cashbookamount($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(); $data['supplier'] = $this->cashbook_model->getsupplier();
//redirect('Bankingstatement','refresh');
$this->loadViews("bankinvoicesettlement", $this->global,$data,NULL); $this->loadViews("bankinvoicesettlement", $this->global,$data,NULL);
} }
@ -1001,17 +1007,15 @@ class cashbook extends BaseController
public function receipt() public function receipt()
{ {
// die(); $this->global['pageTitle'] = 'Siddharth : Bank Report - Store Debited Details';
$check = $this->input->post('check'); $check = $this->input->post('check');
$rw = $this->input->post('rw'); $rw = $this->input->post('rw');
//$this->global['pageTitle'] = 'Siddharth : Cashbook Listing'; $date = $this->input->post('podate');
$this->global['pageTitle'] = 'Siddharth : Bank Report - Store Debited Details'; $date = date_create($date);
$date = $this->input->post('podate');
$date = date_create($date);//,'Y-m-d');
$date = date_format($date,'Y-m-d'); $date = date_format($date,'Y-m-d');
//echo $date; $pono = $this->input->post('pono');
$igrno=$this->input->post('igrno');
$pono = $this->input->post('pono'); $igrlineitem=$this->input->post('igrlineitem');
$sname = $this->input->post('sname'); $sname = $this->input->post('sname');
$tot = $this->input->post('tot'); $tot = $this->input->post('tot');
$rowcount = $this->input->post('rc'); $rowcount = $this->input->post('rc');
@ -1076,13 +1080,13 @@ class cashbook extends BaseController
$amtpaid= ($ip+$ePay); $amtpaid= ($ip+$ePay);
$IsActive=1;
$podata1 = array('Podate'=>$date,'PONO'=>$pono,'IGRNO'=>$igrno,'Suppliername'=>$sname,'Totalpoamount'=>$tot,'Amountpaid'=>$ip,'Balancetopay'=>$balancetopay,'mid'=>$bankid,'IGRLineItemNo'=>$igrlineitem,'IsActive'=>$IsActive);
$podata1 = array('Podate'=>$date,'PONO'=>$pono,'Suppliername'=>$sname,'Totalpoamount'=>$tot,'Amountpaid'=>$ip,'Balancetopay'=>$balancetopay,'mid'=>$bankid);
//print_r($podata1); //print_r($podata1);
//die(); //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); $result3 = $this->cashbook_model->getpono($pono);
@ -1104,18 +1108,29 @@ class cashbook extends BaseController
echo "Saved Successfully!"; echo "Saved Successfully!";
} }
if($balancetopay==0) // if($balancetopay==0)
{ // {
$status=AMOUNT_PAID; // $status=AMOUNT_PAID;
// }
// else
// {
// $status=PARTIALLY_PAID;
// }
// $pomaster= array('Paymentstatus'=>$status);
if($balancetopay==0)
{
$igrstatus=AMOUNT_PAIDIGR;
} }
else else
{ {
$status=PARTIALLY_PAID; $igrstatus=PARTIALLY_PAIDIGR;
} }
$pomaster= array('Paymentstatus'=>$status); $igrdetails=array('BankStatus'=>$igrstatus);
$result1 = $this->cashbook_model->poamountstatus($pomaster,$pono); $result1 = $this->cashbook_model->igrdetailstatus($igrdetails,$igrlineitem);
//$this->loadViews("bankstatement", $this->global,$data, NULL); //$result1 = $this->cashbook_model->poamountstatus($pomaster,$pono);
$this->loadViews("bankstatement", $this->global,$data, NULL);
} }
public function invoiceamount1() public function invoiceamount1()
{ {
@ -1196,10 +1211,10 @@ class cashbook extends BaseController
$amtpaid= ($ip+$eRec); $amtpaid= ($ip+$eRec);
$updateamount=($totalpaidamount+$eRec); $updateamount=($totalpaidamount+$eRec);
$IsActive=1;
$invoicedata1 = array('indate'=>$date,'invoiceno'=>$invid,'customername'=>$cname,'totinvoiceamount'=>$invamount,'balancetoreceived'=>$balancetoreceived1,'amountreceived'=>$amtpaid,'bankid'=>$bankid); $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); // //print_r ($invoicedata);
// //die(); // //die();
@ -1209,7 +1224,7 @@ class cashbook extends BaseController
if(count($result3)<=0) if(count($result3)<=0)
{ {
//echo "insert"; //echo "insert";
$result = $this->cashbook_model->invoicedata($invoicedata); $result = $this->cashbook_model->invoicedata($invoicedata1);
} }
else else
@ -1228,8 +1243,7 @@ class cashbook extends BaseController
$status=PARTIALLY_RECEIVED; $status=PARTIALLY_RECEIVED;
} }
$invoicemaster= array('receivedstatus'=>$status); $invoicemaster= array('receivedstatus'=>$status);
print_r($invoicemaster);
//die();
$result1 = $this->cashbook_model->invoiceamountstatus($invoicemaster,$invid); $result1 = $this->cashbook_model->invoiceamountstatus($invoicemaster,$invid);
echo "<script>alert('Saved Successfully!');window.location.href='Bankingstatement';</script>"; echo "<script>alert('Saved Successfully!');window.location.href='Bankingstatement';</script>";
@ -1250,12 +1264,11 @@ class cashbook extends BaseController
$data['bankdebit'] = $this->cashbook_model->debitpolistfilter($SupplierName,$fdate,$tdate); $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(); $data['supplier'] = $this->cashbook_model->getsupplier();
$this->loadViews("bankamountpaid", $this->global,$data, NULL); $this->loadViews("bankamountpaid", $this->global,$data, NULL);
} }
public function amountreceived() public function amountreceived()
{ {
@ -1279,13 +1292,125 @@ class cashbook extends BaseController
public function cashbanking() public function cashbanking()
{ {
$data['dropdownvalues'] = $this->cashbook_model->getAccounTypes(); $data['dropdownvalues'] = $this->cashbook_model->getAccounTypes();
$data['cashbanking'] = $this->cashbook_model->newcashbook(); //$data['cashbanking'] = $this->cashbook_model->newcashbook();
$data['getsupplier'] = $this->cashbook_model->getsupplier(); $data['getsupplier'] = $this->cashbook_model->getsupplier();
$this->global['pageTitle'] ='Siddharth :bankcashbook'; $this->global['pageTitle'] ='Siddharth :bankcashbook';
$this->loadViews("bankcashnew", $this->global,$data,NULL); $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 "<script>alert('Deleted Successfully!');window.location.href='Bankingstatement';</script>";
redirect('Bankingstatement','refresh');
}
}
public function convertNumber($amt){ public function convertNumber($amt){
//echo $amt;die(); //echo $amt;die();

View File

@ -291,19 +291,20 @@ function clearedbalance(){
//die(); //die();
//$Supplierid; //$Supplierid;
$this->db->distinct(); $this->db->distinct();
$this->db->select('POM.PONO,POM.Paymentstatus,supp.SupplierName,igr.CreatedDate, $this->db->select('igr.PONO,supp.SupplierName,igrli.CreatedDate,igrli.IGRItemNo,igr.IGRNO,BR.Balancetopay,BR.Amountpaid,pom.Status,poli.ReceivedQuantity,poli.Rate');
POM.TotalOrderValue,POM.ServiceDescription,BR.Balancetopay,BR.Amountpaid, $this->db->from ('T_IGR_Details igrli');
POM.POType,POM.ReleasedBy,POM.IsQualityChkReqired,POM.POType,POM.CapitalRange,POM.Status, $this->db->join('T_IGR_Master igr','igrli.IGRNO = igr.IGRNO');
PUADV.AdvanceAmount'); $this->db->join('T_PurchaseOrder_Master pom','igr.PONO =pom.PONO');
$this->db->from ('T_PurchaseOrder_Master POM'); $this->db->join('T_PurchaseOrder_LineItem poli','pom.PONO= poli.PONO');
$this->db->join('T_IGR_Master igr','igr.PONO = POM.PONO'); $this->db->join('T_SupplierDetailsN supp','pom.SupplierID =supp.SupplierID');
$this->db->join('T_SupplierDetailsN supp','supp.SupplierID = POM.SupplierID'); $this->db->join ('T_Bankporeport BR','pom.PONO = BR.PONO','left');
$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->where_in('POM.Status',[ST044,ST056]); // $this->db->where_in('POM.Status',[ST044,ST056]);
// $this->db->where('POM.Paymentstatus !=','ST057'); // $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 != ''){ if ($fdate and $tdate != ''){
$fromdate= date("Y-m-d",strtotime($fdate)); $fromdate= date("Y-m-d",strtotime($fdate));
@ -315,9 +316,11 @@ function clearedbalance(){
if ($Supplierid != ''){ if ($Supplierid != ''){
$this->db->where('supp.SupplierID',$Supplierid); $this->db->where('supp.SupplierID',$Supplierid);
} }
$this->db->where_in('POM.Status',[ST044,ST056]); $this->db->where_in('pom.Status',[ST044,ST056]);
$this->db->where('igrli.BankStatus !=','ST070');
$this->db->group_by('POM.PONO'); //$this->db->group_by('pom.PONO');
//$this->db->group_by('igrli.IGRItemNo');
//$this->db->group_by('igr.IGRNO');
$query = $this->db->get(); $query = $this->db->get();
return $query->result(); return $query->result();
@ -378,10 +381,14 @@ function receiptdata()
function debitpolist($bankid) function debitpolist($bankid)
{ {
$this->db->select('bp.mid,bp.Podate,bp.PONO,bp.Suppliername,bp.Totalpoamount, $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->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('mid',$bankid);
$this->db->where('igrde.BankStatus !=','ST072');
//$this->db->group_by('PONO'); //$this->db->group_by('PONO');
$query = $this->db->get(); $query = $this->db->get();
return $query->result(); return $query->result();
@ -412,9 +419,10 @@ function debitpolist($bankid)
function creditinvoicelist($bankid) function creditinvoicelist($bankid)
{ {
$this->db->select('indate,invoiceno,customername,totinvoiceamount,bankid, $this->db->select('indate,invoiceno,customername,totinvoiceamount,bankid,
balancetoreceived,amountreceived'); balancetoreceived,amountreceived');
$this->db->from ('T_Bankmappingiv'); $this->db->from ('T_Bankmappingiv');
$this->db->where('bankid',$bankid); $this->db->where('bankid',$bankid);
$this->db->where('IsActive',1);
//$this->db->group_by('invoiceno'); //$this->db->group_by('invoiceno');
$query = $this->db->get(); $query = $this->db->get();
return $query->result(); return $query->result();
@ -445,6 +453,7 @@ function debitpolist($bankid)
$this->db->select('sum(amountreceived)as amountreceived'); $this->db->select('sum(amountreceived)as amountreceived');
$this->db->from ('T_Bankmappingiv'); $this->db->from ('T_Bankmappingiv');
$this->db->where('bankid',$bankid); $this->db->where('bankid',$bankid);
$this->db->where('IsActive',1);
//$this->db->group_by('invoiceno'); //$this->db->group_by('invoiceno');
$query = $this->db->get(); $query = $this->db->get();
return $query->result(); return $query->result();
@ -466,6 +475,7 @@ function debitpolist($bankid)
$this->db->select('sum(total)as total'); $this->db->select('sum(total)as total');
$this->db->from ('t_income_expense'); $this->db->from ('t_income_expense');
$this->db->where('bankid',$bankid); $this->db->where('bankid',$bankid);
$this->db->where('IsActive',1);
//$this->db->group_by('invoiceno'); //$this->db->group_by('invoiceno');
$query = $this->db->get(); $query = $this->db->get();
return $query->result(); return $query->result();
@ -478,7 +488,7 @@ function debitpolist($bankid)
$this->db->from ('t_income_expense as ie'); $this->db->from ('t_income_expense as ie');
$this->db->join ('t_accountcode ac ','ac.code = ie.account_code','left'); $this->db->join ('t_accountcode ac ','ac.code = ie.account_code','left');
$this->db->where('bankid',$bankid); $this->db->where('bankid',$bankid);
$this->db->where('IsActive',1);
//$this->db->group_by('mid'); //$this->db->group_by('mid');
$query = $this->db->get(); $query = $this->db->get();
return $query->result(); return $query->result();
@ -742,12 +752,12 @@ function debitpolist($bankid)
return $result; return $result;
} }
function poamountstatus($pomaster,$pono)
function igrdetailstatus($igrdetails,$igrlineitem)
{ {
//echo $pomaster; $this->db->where('IGRItemNo', $igrlineitem);
//echo $pono; $this->db->update('T_IGR_Details',$igrdetails);
$this->db->where('PONO', $pono);
$this->db->update('T_PurchaseOrder_Master',$pomaster);
$r = $this->db->affected_rows(); $r = $this->db->affected_rows();
return $r; 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;
}
} }

View File

@ -155,14 +155,16 @@ foreach($financialyear as $item)
<th>Select</th> <th>Select</th>
<th>Date</th> <th>Date</th>
<th>PONO</th> <th>PONO</th>
<th>IGRNO</th>
<th>IGR Item No</th>
<th>Supplier Name</th> <th>Supplier Name</th>
<th>Total PO Amount (&#8377;)</th> <th>IGR Amount (&#8377;)</th>
<th>Balance payable (&#8377;)</th> <th>Balance payable (&#8377;)</th>
<th>Amount Paid (&#8377;)</th> <th>Amount Paid (&#8377;)</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
$i=1; $i=1;
$ti=0.00; $ti=0.00;
$tvt=0.00; $tvt=0.00;
@ -172,6 +174,9 @@ foreach($financialyear as $item)
$status=$t->Paymentstatus; $status=$t->Paymentstatus;
$balancetopay=$t->Balancetopay; $balancetopay=$t->Balancetopay;
$ReceivedQuantity=$t->ReceivedQuantity;
$rate=$t->Rate;
$value=$ReceivedQuantity*$rate;
if($status !='ST057') if($status !='ST057')
{ {
?> ?>
@ -180,9 +185,11 @@ foreach($financialyear as $item)
<td data-name="sell"><input type="checkbox" class="checkboxcheckbox" onchange="GetPayment(<?php echo $i ?>) "id="checkboxcheckbox<?php echo $i ?>" name="checkbox<?php echo $i ?>";></td> <td data-name="sell"><input type="checkbox" class="checkboxcheckbox" onchange="GetPayment(<?php echo $i ?>) "id="checkboxcheckbox<?php echo $i ?>" name="checkbox<?php echo $i ?>";></td>
<td align="left" id="date<?php echo $i ?>"><span><?php echo date_format(date_create($t->CreatedDate),'d-m-Y');?></span></td> <td align="left" id="date<?php echo $i ?>"><span><?php echo date_format(date_create($t->CreatedDate),'d-m-Y');?></span></td>
<td align="left" id="pono<?php echo $i ?>"><a href="<?= base_url() ?>cashbook/mappingdebit?sid=<?php echo $t->PONO;?>"><span><?php echo $t->PONO?></span></a></td> <td align="left" id="pono<?php echo $i ?>"><a href="<?= base_url() ?>cashbook/mappingdebit?sid=<?php echo $t->PONO;?>"><span><?php echo $t->PONO?></span></a></td>
<td align="left" id="igrno<?php echo $i ?>"><a href="<?= base_url() ?>cashbook/mappingdebit?sid=<?php echo $t->IGRNO;?>"><span><?php echo $t->IGRNO?></span></a></td>
<td align="left" id="igrlineitem<?php echo $i ?>" ><span><?php echo $t->IGRItemNo?></span></td>
<td align="left" id="sn<?php echo $i ?>" ><span><?php echo $t->SupplierName?></span></td> <td align="left" id="sn<?php echo $i ?>" ><span><?php echo $t->SupplierName?></span></td>
<td align="left" id="tov<?php echo $i ?>" ><span><?php echo $t->TotalOrderValue?></span></td> <td align="left" id="tov<?php echo $i ?>" ><span><?php echo $value?></span></td>
<td align="left" id="qw<?php echo $i ?>" ><span><?php echo ($t->TotalOrderValue-$t->Amountpaid)?></span></td> <td align="left" id="qw<?php echo $i ?>" ><span><?php echo ($value-$t->Amountpaid)?></span></td>
<td data-name="sel"><input type="text" onkeypress="return isNumberKey(event)" onchange="GetAmount(<?php echo $i ?>)" id="invoicepaymet<?php echo $i ?>"></td> <td data-name="sel"><input type="text" onkeypress="return isNumberKey(event)" onchange="GetAmount(<?php echo $i ?>)" id="invoicepaymet<?php echo $i ?>"></td>
</tr> </tr>
@ -200,6 +207,8 @@ foreach($financialyear as $item)
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td class="amount"> <td class="amount">
<strong><input type="text" id="addvalue" name="addvalue"> <strong><input type="text" id="addvalue" name="addvalue">
</strong> </strong>
@ -223,6 +232,10 @@ foreach($financialyear as $item)
<div class="col-md-12" id="HidePONODiv"></div> <div class="col-md-12" id="HidePONODiv"></div>
<div class="col-md-12" id="HideIGRDiv"></div>
<div class="col-md-12" id="HideIGRLineItem"></div>
<div class="col-md-12" id="HideSuppDiv"></div> <div class="col-md-12" id="HideSuppDiv"></div>
<div class="col-md-12" id="aa1"></div> <div class="col-md-12" id="aa1"></div>
@ -326,7 +339,8 @@ function GetPayment(i)
$('#Rowid').val(row); $('#Rowid').val(row);
var date= document.getElementById ( "date"+i ).innerText;//value taken from table, col name : date var date= document.getElementById ( "date"+i ).innerText;//value taken from table, col name : date
var pono =document.getElementById ( "pono"+i ).innerText;//value taken from table, col name : purchase order no var pono =document.getElementById ( "pono"+i ).innerText;//value taken from table, col name : purchase order no
var igrno =document.getElementById ( "igrno"+i ).innerText;
var igrlineitem=document.getElementById ( "igrlineitem"+i ).innerText;
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 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
var invoicepayment =document.getElementById ( "qw"+i ).innerText;//value taken from table col name : Balance to pay var invoicepayment =document.getElementById ( "qw"+i ).innerText;//value taken from table col name : Balance to pay
@ -347,6 +361,20 @@ function GetPayment(i)
value:pono value:pono
}).appendTo('#HidePONODiv'); }).appendTo('#HidePONODiv');
$('<input>').attr({
type:'hidden',
name:'hideigrno'+i,
id:'hideigrno'+i,
value:igrno
}).appendTo('#HideIGRDiv');
$('<input>').attr({
type:'hidden',
name:'hideigrline'+i,
id:'hideigrline'+i,
value:igrlineitem
}).appendTo('#HideIGRLineItem');
$('<input>').attr({ $('<input>').attr({
type:'hidden', type:'hidden',
name:'hidesupname'+i, name:'hidesupname'+i,
@ -425,6 +453,8 @@ else
$('#invoicepaymet'+i).val(''); $('#invoicepaymet'+i).val('');
$('#hidedate'+i).val(''); $('#hidedate'+i).val('');
$('#hidepono'+i).val(''); $('#hidepono'+i).val('');
$('#hideigrno'+i).val('');
$('#hideigrline'+i).val('');
$('#hidesupname'+i).val(''); $('#hidesupname'+i).val('');
$('#hidettlPoamt'+i).val(''); $('#hidettlPoamt'+i).val('');
$('#hideamtpaid'+i).val(''); $('#hideamtpaid'+i).val('');
@ -432,6 +462,8 @@ else
//$('#invoicepaymet'+i).remove(); //$('#invoicepaymet'+i).remove();
$('#hidedate'+i).remove(); $('#hidedate'+i).remove();
$('#hidepono'+i).remove(); $('#hidepono'+i).remove();
$('#hideigrno'+i).remove();
$('#hideigrline'+i).remove();
$('#hidesupname'+i).remove(); $('#hidesupname'+i).remove();
$('#hidettlPoamt'+i).remove(); $('#hidettlPoamt'+i).remove();
$('#hideamtpaid'+i).remove(); $('#hideamtpaid'+i).remove();
@ -472,6 +504,8 @@ function GetAmount(i)
var date= document.getElementById ( "date"+i ).innerText; var date= document.getElementById ( "date"+i ).innerText;
var pono =document.getElementById ( "pono"+i ).innerText; var pono =document.getElementById ( "pono"+i ).innerText;
var igr =document.getElementById ( "igrno"+i ).innerText;
var igrlineitem=document.getElementById ( "igrlineitem"+i ).innerText;
var supname =document.getElementById ("sn"+i ).innerText; var supname =document.getElementById ("sn"+i ).innerText;
var totalordervalue =document.getElementById ("tov"+i ).innerText; var totalordervalue =document.getElementById ("tov"+i ).innerText;
var balancetopay =document.getElementById ( "qw"+i ).innerText; var balancetopay =document.getElementById ( "qw"+i ).innerText;
@ -568,6 +602,10 @@ function Save()
var pono =$('#hidepono'+number).val(); var pono =$('#hidepono'+number).val();
var igrno =$('#hideigrno'+number).val();
var igrlineitem =$('#hideigrline'+number).val();
var suppliername=$('#hidesupname'+number).val(); var suppliername=$('#hidesupname'+number).val();
var totalordervalue=$('#hidettlPoamt'+number).val(); var totalordervalue=$('#hidettlPoamt'+number).val();
@ -588,7 +626,7 @@ function Save()
$.ajax( $.ajax(
{ {
data:{podate:date,pono:pono,sname:suppliername,tot:totalordervalue,aa:amountpaid,ip:invoicepaymet,rc:rowCount,tpv:totalvalue,bda:bankdebitamount,bi:bid,check:check,rw:rw}, data:{podate:date,pono:pono,igrno:igrno,igrlineitem:igrlineitem,sname:suppliername,tot:totalordervalue,aa:amountpaid,ip:invoicepaymet,rc:rowCount,tpv:totalvalue,bda:bankdebitamount,bi:bid,check:check,rw:rw},
type:"POST", type:"POST",
url:"<?php echo base_url() ?>cashbook/receipt", url:"<?php echo base_url() ?>cashbook/receipt",
success:function(data) success:function(data)

View File

@ -51,45 +51,61 @@ foreach($financialyear as $item)
<div class="box box-info"> <div class="box box-info">
<?php <?php
if(!empty($mappingiv)){ if(!empty($mappingiv)){
foreach($mappingiv as $ap) foreach($mappingiv as $ap)
{ {
$bankid=$ap->id; $bankid=$ap->id;
} }
} }
if(!empty($mappingcashbook)) if(!empty($mappingcashbook))
{ {
foreach($mappingcashbook as $mc) foreach($mappingcashbook as $mc)
{ {
$bankid=$mc->bankid; $bankid=$mc->bankid;
} }
} }
if(!empty($paidcbook)){ if(!empty($paidcbook)){
foreach($paidcbook as $pc) foreach($paidcbook as $pc)
{ {
$pcamount=$pc->total; $pcamount=$pc->total;
} }
} }
if(!empty($invoiceramount)) if(!empty($clearbalance)){
{
foreach($invoiceramount as $ia)
{
$inamount=$ia->amountreceived;
}
}
$totalamount=$pcamount+$inamount; $bankclear=$clearbalance;
?>
}
if(!empty($balancetoclear)){
$bankbaltoclear=$balancetoclear;
}
if(!empty($invoiceramount))
{
foreach($invoiceramount as $ia)
{
$inamount=$ia->amountreceived;
}
}
$totalamount=$pcamount+$inamount;
//echo $totalamount;
?>
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>"> <form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
<center><h3 class="box-title"><p style="color:#3c8dbc"><b>Bank Credit Amount Paid Report</b></p></h3></center> <center><h3 class="box-title"><p style="color:#3c8dbc"><b>Bank Credit Amount Paid Report</b></p></h3></center>
<br> <br>
@ -127,12 +143,13 @@ foreach($financialyear as $item)
<table class="table table-bordered table-hover" id="req" style="table-layout:auto;"> <table class="table table-bordered table-hover" id="req" style="table-layout:auto;">
<thead> <thead>
<tr> <tr>
<th>Date</th> <th>Date</th>
<th>INVOICE NO</th> <th>INVOICE NO</th>
<th>Customer Name</th> <th>Customer Name</th>
<th>Total Amount (&#8377;)</th> <th>Total Amount (&#8377;)</th>
<th>Balance To Received</th> <th>Balance To Received</th>
<th>Received Amount</th> <th>Received Amount</th>
<th>Action</th>
@ -149,14 +166,30 @@ foreach($financialyear as $item)
?> ?>
<tr> <tr>
<td align="left" id="tov"><span><?php echo date_format(date_create($ap->indate),'d-m-Y');?></span></td>
<td align="left" id="invno"><span><?php echo $ap->invoiceno?></span></td>
<td align="left" id="aa"><span><?php echo $ap->customername?></span></td>
<td align="left" id="aa"><span><?php echo $ap->totinvoiceamount?></span></td>
<td align="left" id="aa"><span><?php echo $ap->balancetoreceived?></span></td>
<td align="left" id="aa"><span><?php echo $ap->amountreceived?></span></td>
</tr>
<input type="hidden" name="bankingbalclear" id="bankingbalclear" value="<?php echo $bankbaltoclear; ?>"/>
<input type="hidden" name="bankingclear" id="bankingclear" value="<?php echo $bankclear; ?>"/>
<input type="hidden" name="bankingid" id="bankingid" value="<?php echo $ap->bankid; ?>"/>
<td align="left" id="tov"><span><?php echo date_format(date_create($ap->indate),'d-m-Y');?></span></td>
<td align="left" id="invno"><?php echo $ap->invoiceno?></span></td>
<td align="left" id="aa"><span><?php echo $ap->customername?></span></td>
<td align="left" id="totinvoiceamount"><span><?php echo $ap->totinvoiceamount?></span></td>
<td align="left" id="balancetoreceived"><span><?php echo $ap->balancetoreceived?></span></td>
<td align="left" id="amountreceived"><span><?php echo $ap->amountreceived?></span></td>
<td>
<a data-toggle="tooltip" ><i class="fa fa-trash" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Delete details" onclick="invoice()"></i>&nbsp;&nbsp;&nbsp;</a>
</td>
</tr>
<?php <?php
$i++; $i++;
} }
@ -173,12 +206,13 @@ foreach($financialyear as $item)
<tr> <tr>
<th>Date</th> <th>Date</th>
<th>Account Name</th> <th>Account Name</th>
<th>Bankid</th> <th>Bankid</th>
<th>Amount Type</th> <th>Amount Type</th>
<th>Total Amount (&#8377;)</th> <th>Total Amount (&#8377;)</th>
<!--<th>Advance PO Amount (&#8377;)</th>-->
<th>Option (&#8377;)</th> <th>Option (&#8377;)</th>
<th>Action</th>
</tr> </tr>
</thead> </thead>
@ -192,15 +226,24 @@ foreach($financialyear as $item)
foreach($mappingcashbook as $mc) foreach($mappingcashbook as $mc)
{ {
?> ?>
<tr> <tr>
<td align="left" id="date"><span><?php echo $mc->date?></span></td>
<td align="left" id="date"><span><?php echo $mc->name?></span></td>
<td align="left" id="sn"><span><?php echo $mc->bankid?></span></td>
<td align="left" id="tov"><span><?php echo $mc->amounttype?></span></td>
<td align="left" id="aa"><span><?php echo $mc->total?></span></td>
<td align="left" id="aa"><span><?php echo $mc->cashtype?></span></td> <td align="left" id="date"><span><?php echo $mc->date?></span></td>
<td align="left" id="date"><span><?php echo $mc->name?></span></td>
<!--<td align="left" id="pono"><a href="<?= base_url() ?>cashbook/receipt?sid=<?php echo $ap->PONO;?>"><span><?php echo $ap->PONO?></span></a></td>-->
<!--<td align="left"><a href="<?= base_url() ?>cashbook/bankreceipt?sid=<?php echo $t->PONO;?>"><span><?php echo $t->PONO?></span></a></td>-->
<td align="left" id="bankid"><span><?php echo $mc->bankid?></span></td>
<td align="left" id="tov"><span><?php echo $mc->amounttype?></span></td>
<td align="left" id="aa"><span><?php echo $mc->total?></span></td>
<td align="left" id="aa"><span><?php echo $mc->cashtype?></span></td>
<td>
<a data-toggle="tooltip" href="<?php echo base_url().'cashbook/Deletemappingcashbookcredit?bankid='.$mc->bankid; ?>&amount=<?php echo $mc->total?>&balancetoclear=<?php echo $balancetoclear?>&clearbalance=<?php echo $bankclear?>&accountname=<?php echo $mc->name?>&amounttype=<?php echo $mc->amounttype?>"><i class="fa fa-trash" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Delete details"></i>&nbsp;&nbsp;&nbsp;</a>
</td>
</tr> </tr>
@ -233,6 +276,39 @@ foreach($financialyear as $item)
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script> <script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
<script> <script>
function invoice()
{
$('#content').loader('show');
var totinvoiceamount=$('#totinvoiceamount').text();
var balancetoreceived=$('#balancetoreceived').text();
var invoiceno=$('#invno').text();
var bankid=$('#bankingid').val();
var amountreceived=$('#amountreceived').text();
var bankingclear=$('#bankingclear').val();
var bankingbalclear=$('#bankingbalclear').val();
$.ajax(
{
data:{invoiceno:invoiceno,bankid:bankid,amountreceived:amountreceived,bankingclear:bankingclear,bankingbalclear:bankingbalclear,totinvoiceamount:totinvoiceamount,balancetoreceived:balancetoreceived},
type:"POST",
url:"<?php echo base_url() ?>DeleteInvoice",
success:function(data)
{
if(data)
{
window.location.href ="Bankingstatement";
//location.reload();
}
}
});
}
$(document).ready(function() { $(document).ready(function() {
table = $('#req').DataTable( { table = $('#req').DataTable( {
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" + "dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +

View File

@ -66,7 +66,18 @@ if(!empty($mapping))
<!-- /.box-header --> <!-- /.box-header -->
<?php <?php
//for update bank amount//
if(!empty($clearbalance)){
$bankamount=$clearbalance;
}
if(!empty($balancetoclear))
{
$balancetoclear=$balancetoclear;
}
if(!empty($mappingcashbook)){ if(!empty($mappingcashbook)){
foreach($mappingcashbook as $mc) foreach($mappingcashbook as $mc)
@ -202,12 +213,15 @@ if(!empty($mapping))
<th>Date</th> <th>Date</th>
<th>PONO</th> <th>PONO</th>
<th>IGR NO</th>
<th>IGR Item NO</th>
<th>Supplier Name</th> <th>Supplier Name</th>
<th>Total PO Amount (&#8377;)</th> <th>Total PO Amount (&#8377;)</th>
<!--<th>Advance PO Amount (&#8377;)</th>--> <!--<th>Advance PO Amount (&#8377;)</th>-->
<th>Balance To Pay (&#8377;)</th> <th>Balance To Pay (&#8377;)</th>
<th>Amount Paid (&#8377;)</th> <th>Amount Paid (&#8377;)</th>
<th>File</th> <th>File</th>
<th>Action</th>
</tr> </tr>
@ -229,6 +243,8 @@ if(!empty($mapping))
<td align="left" id="date"><span><?php echo date_format(date_create($ap->Podate),'d-m-Y');?></span></td> <td align="left" id="date"><span><?php echo date_format(date_create($ap->Podate),'d-m-Y');?></span></td>
<td align="left" id="pono"><a href="<?= base_url() ?>cashbook/mappingdebit?sid=<?php echo $ap->PONO;?>"><span><?php echo $ap->PONO?></span></a></td> <td align="left" id="pono"><a href="<?= base_url() ?>cashbook/mappingdebit?sid=<?php echo $ap->PONO;?>"><span><?php echo $ap->PONO?></span></a></td>
<td align="left" id="igrno"><a href="<?= base_url() ?>cashbook/mappingdebit?sid=<?php echo $ap->IGRNO;?>"><span><?php echo $ap->IGRNO?></span></a></td>
<td align="left" id="sn"><span><?php echo $ap->IGRItemNo?></span></td>
<!--<td align="left"><a href="<?= base_url() ?>cashbook/bankreceipt?sid=<?php echo $t->PONO;?>"><span><?php echo $t->PONO?></span></a></td>--> <!--<td align="left"><a href="<?= base_url() ?>cashbook/bankreceipt?sid=<?php echo $t->PONO;?>"><span><?php echo $t->PONO?></span></a></td>-->
<!--<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"><span><?php echo $ap->Suppliername?></span></td> <td align="left" id="sn"><span><?php echo $ap->Suppliername?></span></td>
@ -249,11 +265,14 @@ if(!empty($mapping))
?> ?>
<td> <a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $ap->FilePath ?>"><i class="fa fa-download" ></i></a></td> <td> <a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $ap->FilePath ?>"><i class="fa fa-download" ></i></a></td>
<?php <?php
} }
?> ?>
<td>
<a data-toggle="tooltip" href="<?php echo base_url().'cashbook/Deletemappingpo?bankid='.$ap->mid; ?>&amount=<?php echo $ap->Amountpaid?>&bankamount=<?php echo $bankamount?>&balancetoclear=<?php echo$balancetoclear?>&igrno=<?php echo $ap->IGRItemNo?>&balancetopay=<?php echo $ap->Balancetopay?>&totalpoamount=<?php echo $ap->Totalpoamount?>"><i class="fa fa-trash" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Delete details"></i>&nbsp;&nbsp;&nbsp;</a>
</td>
@ -314,6 +333,7 @@ if(!empty($mapping))
<th>Total Amount (&#8377;)</th> <th>Total Amount (&#8377;)</th>
<!--<th>Advance PO Amount (&#8377;)</th>--> <!--<th>Advance PO Amount (&#8377;)</th>-->
<th>Option (&#8377;)</th> <th>Option (&#8377;)</th>
<th>Action</th>
@ -346,7 +366,9 @@ if(!empty($mapping))
<td align="left" id="tov"><span><?php echo $mc->amounttype?></span></td> <td align="left" id="tov"><span><?php echo $mc->amounttype?></span></td>
<td align="left" id="aa"><span><?php echo $mc->total?></span></td> <td align="left" id="aa"><span><?php echo $mc->total?></span></td>
<td align="left" id="aa"><span><?php echo $mc->cashtype?></span></td> <td align="left" id="aa"><span><?php echo $mc->cashtype?></span></td>
<td>
<a data-toggle="tooltip" href="<?php echo base_url().'cashbook/Deletemappingcashbook?bankid='.$mc->bankid; ?>&amount=<?php echo $mc->total?>&balancetoclear=<?php echo $balancetoclear?>&bankamount=<?php echo $bankamount?>&accountname=<?php echo $mc->name?>&amounttype=<?php echo $mc->amounttype?>"><i class="fa fa-trash" data-toggle="tooltip" title="<?php echo $record->AdjustmentId; ?> - Click here to Delete details"></i>&nbsp;&nbsp;&nbsp;</a>
</td>

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?>"><?php echo $clearbalance?></a></td> <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>
<?php <?php
if($status=='CLOSE') if($status=='CLOSE')
@ -312,10 +312,11 @@ $Bankname = $t->Bankname;
} }
else else
{ {
?> ?>
<td align="left" id="btc<?php echo $i ?>"><span><?php echo $t->Debit-$clearbalance?></span></td> <td align="left" id="btc<?php echo $i ?>"><?php echo $t->Debit-$clearbalance?></span></td>
<?php <?php
} }
?> ?>
@ -331,10 +332,12 @@ $Bankname = $t->Bankname;
<?php <?php
$clearbalance=$t->cclearbalance; $clearbalance=$t->cclearbalance;
$credit=$t->Credit;
$balanctoclear=$credit-$clearbalance;
?> ?>
<td align="left" id="credit2<?php echo $i ?>"><a href="<?php echo base_url() ?>cashbook/mappinginvoice?d=<?php echo $t->ID?>"><?php echo $clearbalance?></a></td> <td align="left" id="credit2<?php echo $i ?>"><a href="<?php echo base_url() ?>MappingInvoice?d=<?php echo $t->ID?>&cb=<?php echo $clearbalance?>&btc=<?php echo $balanctoclear?>"><span><?php echo $clearbalance?></a></span></td>
<td align="left" id="credited<?php echo $i ?>"><span><?php echo ($t->Credit)-($t->cclearbalance);?></span></td> <td align="left" id="credited<?php echo $i ?>"><span><?php echo ($t->Credit)-($t->cclearbalance);?></span></td>