diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 52606d70..bb3d6912 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -329,6 +329,7 @@ class purchaseorder extends BaseController $data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetails($PONO); $data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO); + //$data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019'); $data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019'); $this->global['pageTitle'] = 'Siddharth : Edit Service Purchase order form'; $this->loadViews("EditservicePurchaseorder", $this->global, $data, NULL); diff --git a/application/controllers/servicepurchaseorder.php b/application/controllers/servicepurchaseorder.php index 31f7e5b7..46213621 100755 --- a/application/controllers/servicepurchaseorder.php +++ b/application/controllers/servicepurchaseorder.php @@ -71,19 +71,20 @@ class servicepurchaseorder extends BaseController $DeliveryAddr = $this->input->post('DeliveryAddr'); $dt = $this->input->post('Deliverydt'); //$Deliverydt = $this->getDateformat($dt); - $DeliveryOption = $this->input->post('DateRange'); - if($DeliveryOption==1){ - $Deliverydt = ''; - $DeliverySchedule = $this->input->post('Scheduleby'); - } - else{ - $Deliverydt = $this->getDateformat($dt); - $DeliverySchedule = ''; - } + $DeliveryOption = $this->input->post('DateRange'); + if($DeliveryOption==1) + { + $Deliverydt = ''; + $DeliverySchedule = $this->input->post('Scheduleby'); + } + else{ + $Deliverydt = $this->getDateformat($dt); + $DeliverySchedule = ''; + } - $PaymentDate=$this->input->post('Payment'); + $PaymentDate=$this->input->post('Payment'); if($PaymentDate==1) { $PaymentDays='After'; @@ -110,9 +111,12 @@ class servicepurchaseorder extends BaseController $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $createddt = $dt->format('Y-m-d H:i:s'); + + $WorkStatus=$this->input->post('workstatus'); // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus, 'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption, 'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays ); - + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus, 'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption, 'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays,'ServiceWorkStatus'=>$WorkStatus ); + //print_r($POList); + //die(); $POMaster = $this->purchaseorder_model->addPOMaster($POList); $PONO = ''; @@ -137,6 +141,7 @@ class servicepurchaseorder extends BaseController $KrishiTax = $this->input->post('KrishiTax'.$i); $SwachhTax = $this->input->post('SwachhTax'.$i); $CostCenter = $this->input->post('costCode'.$i); + $ServiceFrequency=$this->input->post('Frequency'.$i); $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); @@ -158,7 +163,9 @@ class servicepurchaseorder extends BaseController if($SkipInsert == "False") { - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter); + $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter,'ServiceFrequency'=>$ServiceFrequency); + print_r($POLineItemList); + die(); $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); @@ -231,10 +238,11 @@ class servicepurchaseorder extends BaseController $comma_separated = explode(':', $DeletedRow); $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $updateddt = $dt->format('Y-m-d H:i:s'); + $WorkStatus=$this->input->post('workstatus'); // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays ); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays,'ServiceWorkStatus'=>$WorkStatus ); $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); @@ -253,7 +261,8 @@ class servicepurchaseorder extends BaseController $SwachhTax = $this->input->post('SwachhTax'.$i); $CostCenter = $this->input->post('costCode'.$i); $POLineItemNo = $this->input->post('LineItemNo'.$i); - $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); + $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); + $ServiceFrequency=$this->input->post('Frequency'.$i); $POLineItem = array(); $LineItemNo = ''; @@ -276,7 +285,7 @@ class servicepurchaseorder extends BaseController { if(strlen($POLineItemNo) == 0) { - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter); + $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter,'ServiceFrequency'=>$ServiceFrequency); $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); if(count($POLineItem)>0) { diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index b7906003..157042cd 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -446,7 +446,7 @@ function purchaseorderListing($forwhat='') function GetServicePurchaseOrder($PONO = '') { $this->db->distinct(); - $this->db->select('ReqNo,POMast.PONO,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,POMast.PaymentTerms,POMast.PaymentDays,POMast.PayableAT,POMast.ExchangeRate,POMast.UpdatedOn,Stat.StatusCode'); + $this->db->select('ReqNo,POMast.PONO,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,POMast.PaymentTerms,POMast.PaymentDays,POMast.PayableAT,POMast.ExchangeRate,POMast.UpdatedOn,Stat.StatusCode,POMast.ServiceWorkStatus'); $this->db->from('T_PurchaseOrder_Master POMast'); $this->db->join('T_SupplierDetailsN supp', 'supp.SupplierID = POMast.SupplierID'); $this->db->join('T_Status Stat', 'Stat.StatusCode = POMast.Status'); @@ -465,7 +465,7 @@ function purchaseorderListing($forwhat='') { $subQuery ='SELECT distinct LineItem.LineItemNo,ReqNo,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,Rate,Status,ROUND((Quantity *Rate),2 ) as BasicValue ,ROUND((ServiceTax + EducessTax + SecHigherEducessTax + KrishiKalyantax + SwachhBharattax),2)as Taxamount - ,TotalValue,ServiceTax,EducessTax,SecHigherEducessTax,KrishiKalyantax,SwachhBharattax,CostCenterCode + ,TotalValue,ServiceTax,EducessTax,SecHigherEducessTax,KrishiKalyantax,SwachhBharattax,CostCenterCode,LineItem.ServiceFrequency FROM T_PurchaseOrder_LineItem LineItem join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode join T_Service_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo diff --git a/application/views/EditservicePurchaseorder.php b/application/views/EditservicePurchaseorder.php index 586029ef..9132be4c 100755 --- a/application/views/EditservicePurchaseorder.php +++ b/application/views/EditservicePurchaseorder.php @@ -53,9 +53,12 @@ if(!empty($POMaster)) //$PaymentTerms=$Req->PaymentTerms; $PayableAT=$Req->PayableAT; $PaymentDays=$Req->PaymentDays; + $WrkStatus=$Req->ServiceWorkStatus; } } +//echo "$WrkStatus"; + if(!empty($AvlBudAmt)) { @@ -724,8 +727,20 @@ $(document).ready(function () {