From d59ee2c79666bbc441f983d18fb421b8f3f1936c Mon Sep 17 00:00:00 2001 From: venbatechnologies Date: Thu, 5 Jul 2018 16:42:38 +0530 Subject: [PATCH] igr alert show --- .../controllers/amendmentpurchaseorder.php | 42 ++++++++++++++++++- application/models/purchaseorder_model.php | 30 +++++++++++++ application/views/Favourite.php | 18 +++++--- .../views/Report_monthly_gst_table.php | 5 +++ 4 files changed, 88 insertions(+), 7 deletions(-) mode change 100755 => 100644 application/views/Favourite.php diff --git a/application/controllers/amendmentpurchaseorder.php b/application/controllers/amendmentpurchaseorder.php index bf1bb5a1..ec5d8c4a 100755 --- a/application/controllers/amendmentpurchaseorder.php +++ b/application/controllers/amendmentpurchaseorder.php @@ -541,6 +541,26 @@ foreach ($igrvalue as $value) { $RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType,'NoOfTrip'=>$NoofTrips,'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'SGST'=>$VatValue,'AfterSGST'=>$AfterVatValue,'CGST'=>$GSTValue,'AfterCGST'=>$AfterGSTValue,'IGST'=>$OtherTaxValue,'AfterIGST'=>$AfterOtherTaxValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt); $RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList); + + + if($Quantity == $RecQtyvalue ) + { + + $Newstatus = array('Status'=>IGR_CREATED); + $this->purchaseorder_model-> POLineItemsupdatestatus($NewPO,$Newstatus); + $Newstat = array('Status'=>IGR_CREATED); + $this->purchaseorder_model->pomasterupdatestatus($NewPO,$Newstat); + + } + else if($Quantity != $RecQtyvalue ) + { + $Newstatus = array('Status'=>POLINEITEM_IGRPARTIAL_CREATED); + $this->purchaseorder_model->POLineItemsupdatestatus($NewPO,$Newstatus); + $Newstat = array('Status'=>PO_RELEASED); + $this->purchaseorder_model->pomasterupdatestatus($NewPO,$Newstat); + + } + } @@ -777,7 +797,27 @@ foreach ($igrvalue as $value) { $ServiceTaxList = array('LineItemNo'=>$LineItemNo,'CGST'=>$CGST,'After_CGST'=>$AfterCGST,'SGST'=>$SGST,'After_SGST'=>$AfterSGST,'IGST'=>$IGST,'After_IGST'=>$AfterIGST,'otherallowance'=>$otherallowance, 'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt); $ServiceList =$this->purchaseorder_model->addServiceTax($ServiceTaxList); - + + if($Quantity == $RecQtyvalue ) + { + + $Newstatus = array('Status'=>IGR_CREATED); + $this->purchaseorder_model-> POLineItemsupdatestatus($NewPO,$Newstatus); + $Newstat = array('Status'=>IGR_CREATED); + $this->purchaseorder_model->pomasterupdatestatus($NewPO,$Newstat); + + } + else if($Quantity != $RecQtyvalue ) + { + $Newstatus = array('Status'=>POLINEITEM_IGRPARTIAL_CREATED); + $this->purchaseorder_model->POLineItemsupdatestatus($NewPO,$Newstatus); + $Newstat = array('Status'=>PO_RELEASED); + $this->purchaseorder_model->pomasterupdatestatus($NewPO,$Newstat); + + } + + + } echo 'PO Number is'.$PONO . ' is Amended Successfully! - New Amended PO Number is '.$NewPO; } diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index 8f5bfd46..73c2c130 100644 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -193,6 +193,36 @@ $this->db->where('PONO',$PONO); } + +function getpolineqty($NewPO) +{ + $this->db->select('*'); + $this->db->from('T_PurchaseOrder_LineItem'); + $this->db->where('PONO',$NewPO); + + $query = $this->db->get(); + return $query->result(); +} + + +function POLineItemsupdatestatus($POno,$Newstatus) +{ + $this->db->where('PONO',$POno); + $this->db->update('T_PurchaseOrder_LineItem',$Newstatus); + $update = $this->db->affected_rows(); + return $update; + +} + +function pomasterupdatestatus($POno,$Newstat) +{ + $this->db->where('PONO',$POno); + $this->db->update('T_PurchaseOrder_Master',$Newstat); + $update = $this->db->affected_rows(); + return $update; +} + + /*--------------------------------------------------*/ diff --git a/application/views/Favourite.php b/application/views/Favourite.php old mode 100755 new mode 100644 index 6cfa9e04..547b3d49 --- a/application/views/Favourite.php +++ b/application/views/Favourite.php @@ -44,7 +44,7 @@ -
+

Siddharth Industries - Add Favourite

@@ -1151,8 +1151,8 @@ var js_array = []; });