From 0372efa232e83c43a56d0ecd43a645bbfe1d437b Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 6 Jun 2018 10:18:28 +0530 Subject: [PATCH] reorder level po bug --- application/models/cashbook_model.php | 56 +++--- application/views/BatchcardMaintListing.php | 101 +++++----- application/views/bankdebit.php | 6 +- application/views/bankinvoice.php | 4 +- application/views/bankstatement.php | 194 +++++++++++++------- application/views/editOldRawmaterial.php | 10 +- application/views/includes/header.php | 16 +- application/views/materialadjustment.php | 1 + 8 files changed, 245 insertions(+), 143 deletions(-) diff --git a/application/models/cashbook_model.php b/application/models/cashbook_model.php index 76d1d0cc..c66435c0 100755 --- a/application/models/cashbook_model.php +++ b/application/models/cashbook_model.php @@ -276,15 +276,11 @@ function bankstatement($fdate,$tdate,$fa,$aa){ } function clearedbalance(){ - $sql = 'SELECT SUM(cbalancetocleared) as credit,SUM(Balancetocleared) as debit FROM T_bankreport'; - // $sql = 'SELECT SUM(Clearbalance) - SUM(CClearbalance) as creditdebit FROM T_bankreport'; + $sql = 'SELECT SUM(cbalancetocleared) as credit,SUM(Balancetocleared) as debit FROM T_bankreport'; + + $query = $this->db->query($sql); + return $query->result(); -// $row = mysql_fetch_array($sql); -// $sum = $row['total']; -$query = $this->db->query($sql); - return $query->result(); -// print_r($sum); -// die(); } @@ -306,19 +302,25 @@ $query = $this->db->query($sql); $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('POM.Paymentstatus !=','ST057'); - //$this->db->or_where('POM.Status',ST056); - - - - $this->db->where('POM.PODate BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"'); - $this->db->or_where('supp.SupplierID',$Supplierid); - - $this->db->group_by('POM.PONO'); - $query = $this->db->get(); - return $query->result(); - + // $this->db->where_in('POM.Status',[ST044,ST056]); + // $this->db->where('POM.Paymentstatus !=','ST057'); + + if ($fdate and $tdate != ''){ + $fromdate= date("Y-m-d",strtotime($fdate)); + $todate=date("Y-m-d",strtotime($tdate)); + $date = "date(igr.CreatedDate) >= '".$fromdate."' + and date(igr.CreatedDate) <= '".$todate."'"; + $this->db->where($date); + } + if ($Supplierid != ''){ + $this->db->where('supp.SupplierID',$Supplierid); + } + $this->db->where_in('POM.Status',[ST044,ST056]); + + $this->db->group_by('POM.PONO'); + $query = $this->db->get(); + return $query->result(); + } function bankinvoice($Customer,$fdate,$tdate) { @@ -332,10 +334,16 @@ $query = $this->db->query($sql); //$this->db->where('iva.receivedstatus !=','ST065'); $this->db->where('iv.invoice_status_id','2'); $this->db->where('iv.receivedstatus !=','ST065'); + if ($fdate and $tdate != ''){ + $fromdate= date("Y-m-d",strtotime($fdate)); + $todate=date("Y-m-d",strtotime($tdate)); + $date = "date(iv.invoice_date_created) >= '".$fromdate."' + and date(iv.invoice_date_created) <= '".$todate."'"; + $this->db->where($date); + } + if ($Customer != ''){ $this->db->where('ic.client_id',$Customer); - $this->db->or_where('iv.invoice_date_created BETWEEN "'. date('Y-m-d', strtotime($fdate)). '" and "'. date('Y-m-d', strtotime($tdate)).'"'); - - + } $this->db->group_by('iva.invoice_id'); //$this->db->where('inc.type','PAYMENT'); $query = $this->db->get(); diff --git a/application/views/BatchcardMaintListing.php b/application/views/BatchcardMaintListing.php index 4549f477..94291e92 100755 --- a/application/views/BatchcardMaintListing.php +++ b/application/views/BatchcardMaintListing.php @@ -1,18 +1,29 @@ - - + @@ -76,7 +87,7 @@ text-align: right !important; - + @@ -91,7 +102,7 @@ text-align: right !important;
- +
@@ -120,6 +131,7 @@ text-align: right !important; { //, Type, , , , , , , ?> + - - - --> - - - - - \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/application/views/bankdebit.php b/application/views/bankdebit.php index bcb0002f..9d73653e 100644 --- a/application/views/bankdebit.php +++ b/application/views/bankdebit.php @@ -130,7 +130,7 @@ foreach($financialyear as $item) - + @@ -218,6 +218,8 @@ foreach($financialyear as $item) + + + + '; + +} + ?>
Maintenance Details
Type == 0){ echo "MAINTENANCES"; }else{echo "BREAKDOWN";} ?> Supplier Name Total PO Amount (₹) Balance payable (₹)Balance Paid (₹)Amount Paid (₹)