diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index f0eb0bfc..d8f113ff 100644 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -116,6 +116,19 @@ class purchaseorder extends BaseController $data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018'); $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); $data['Payment']=$this->purchaseorder_model->getSupplierPayment(); + $data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019'); + + + foreach ($data['WorkStatus'] as $WST) + { + + $WStatus=$WST->ConfigValue; + //print_r($WStatus); + + } + + + //print_r($data['WorkStatus']); // foreach ($data['Suplist'] as $SUP) // { // $Detail=$SUP->PaymentTerms; @@ -310,6 +323,8 @@ 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'); $this->global['pageTitle'] = 'Siddharth : Edit Service Purchase order form'; $this->loadViews("EditservicePurchaseorder", $this->global, $data, NULL); } @@ -318,6 +333,7 @@ class purchaseorder extends BaseController $data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetails($PONO); $data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO); + //$data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019'); $this->global['pageTitle'] = 'Siddharth : Edit Revenue Purchase order form'; $this->loadViews("editRevenuepurchaseorder", $this->global, $data, NULL); } diff --git a/application/controllers/servicepurchaseorder.php b/application/controllers/servicepurchaseorder.php index 347b1ba6..31f7e5b7 100644 --- a/application/controllers/servicepurchaseorder.php +++ b/application/controllers/servicepurchaseorder.php @@ -80,6 +80,22 @@ class servicepurchaseorder extends BaseController $Deliverydt = $this->getDateformat($dt); $DeliverySchedule = ''; } + + + + $PaymentDate=$this->input->post('Payment'); + if($PaymentDate==1) + { + $PaymentDays='After'; + } + else + { + $PaymentDays='Before'; + } + + $PaymentTerms=$this->input->post('PaymentTerms'); + $Payableat=$this->input->post('PayableAT'); + $POType = $this->input->post('POType'); $SpcialInstruction = $this->input->post('txtSpcialInstruction'); @@ -95,7 +111,7 @@ class servicepurchaseorder extends BaseController $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $createddt = $dt->format('Y-m-d H:i:s'); // 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 ); + $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 ); $POMaster = $this->purchaseorder_model->addPOMaster($POList); @@ -187,6 +203,20 @@ class servicepurchaseorder extends BaseController $Deliverydt = $this->getDateformat($dt); $DeliverySchedule = ''; } + + + $PaymentDate=$this->input->post('Payment'); + if($PaymentDate==1) + { + $PaymentDays='After'; + } + else + { + $PaymentDays='Before'; + } + + $PaymentTerms=$this->input->post('PaymentTerms'); + $Payableat=$this->input->post('PayableAT'); $POType = $this->input->post('POType'); @@ -204,7 +234,7 @@ class servicepurchaseorder extends BaseController // 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 ); + $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 ); $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index 40e3e57b..48449893 100644 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -295,6 +295,9 @@ function purchaseorderListing() return $query->result(); } + + + /** * This function is used to get the Company information from T_Company_Details table @@ -589,6 +592,9 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '') } + + + function getSupplierPayment($Currency='') { @@ -599,6 +605,14 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '') } + function GetWorkStatus($Config_ID='') + { + $subQuery = 'select ConfigValue from T_ConfigDetails where Config_ID=?'; + $query=$this->db->query($subQuery,array($Config_ID)); + //print_r($query); + return $query->result(); + } + @@ -628,15 +642,15 @@ Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue , function GetCurrencytype() - { + { - $subQuery = 'select * from T_Currency_Details'; + $subQuery = 'select * from T_Currency_Details'; - $query = $this->db->query($subQuery); + $query = $this->db->query($subQuery); - - return $query->result(); - } + return $query->result(); + } + diff --git a/application/views/EditservicePurchaseorder.php b/application/views/EditservicePurchaseorder.php index f65df8d7..586029ef 100644 --- a/application/views/EditservicePurchaseorder.php +++ b/application/views/EditservicePurchaseorder.php @@ -22,6 +22,7 @@ $Deliverydt=''; $DeliverSchedule=''; $MaxPoDate = ''; $AvlAmount = 0; +$Value="₹"; if(!empty($MaxPODate)) { foreach ($MaxPODate as $date) @@ -49,6 +50,9 @@ if(!empty($POMaster)) $POStatus = $Req->StatusCode; $PONO = $Req->PONO; $ServiceDescription = $Req->ServiceDescription; + //$PaymentTerms=$Req->PaymentTerms; + $PayableAT=$Req->PayableAT; + $PaymentDays=$Req->PaymentDays; } } @@ -58,6 +62,12 @@ if(!empty($AvlBudAmt)) $AvlAmount = $AvlBudAmt; } + + +foreach ($PaymentTerms as $TER) +{ + $Terms=$TER->PaymentTerms; +} ?> @@ -122,6 +132,17 @@ $('#drpSupplier').change(function() { if(obj.SupplierID === id) { $("#SupAddress").val(obj.Address); + $("#PayableAT").val(obj.PayableAT); + var a=obj.PaymentDays; + console.log(a); + if (a=="After") + { + //alert(); + document.getElementById("After").checked = true; + + } + else + document.getElementById("Before").checked = true; } @@ -734,7 +755,7 @@ $(document).ready(function () {