diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 0bb76034..4540181f 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -931,12 +931,12 @@ class purchaseorder extends BaseController function addNewPurchaseOrder() { - - + + $POdt =$this->input->post('PODate'); $PODate = $this->getDateformat($POdt); - $SupplierID = $this->input->post('drpSupplier'); + $SupplierID = $this->input->post('drpSupplier'); $DeliveryAddr = $this->input->post('DeliveryAddr'); $dt = $this->input->post('Deliverydt'); $POType = $this->input->post('POType'); @@ -952,6 +952,9 @@ class purchaseorder extends BaseController $POType = $this->input->post('POType'); + $BudgetType = $this->input->post('Budget'); + + //$PoRange = $this->input->post('txtPoRange'); $Modeofshipment=$this->input->post('addmodeofshipment'); @@ -985,7 +988,7 @@ class purchaseorder extends BaseController $Qualitycheck=1; // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$supplierreference,'Mode_Of_Shipment'=>$Modeofshipment,'Supplier_Offer_No'=>$supplieroffno,'Other_Reference'=>$otherreference,'Fincap'=>$fincap,'InsuranceStatus'=>$insurancestatus,'POSubType'=>$revenuetype,'InsuranceNumber'=>$insuranceno,'IsQualityChkReqired'=>$Qualitycheck); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$supplierreference,'Mode_Of_Shipment'=>$Modeofshipment,'Supplier_Offer_No'=>$supplieroffno,'Other_Reference'=>$otherreference,'Fincap'=>$fincap,'InsuranceStatus'=>$insurancestatus,'POSubType'=>$revenuetype,'InsuranceNumber'=>$insuranceno,'IsQualityChkReqired'=>$Qualitycheck,'BudgetType'=>$BudgetType); // print_r($POList); // die(); @@ -1114,6 +1117,8 @@ class purchaseorder extends BaseController $POType = $this->input->post('POType'); $PoRange = $this->input->post('txtPoRange'); + + $BudgetType = $this->input->post('Budget'); $SpcialInstruction = $this->input->post('SpcialInstruction'); $TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary'); @@ -1135,7 +1140,7 @@ class purchaseorder extends BaseController $Qualitycheck=1; // PO Master // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$supplierreference,'Mode_Of_Shipment'=>$Modeofshipment,'Supplier_Offer_No'=>$supplieroffno,'Other_Reference'=>$otherreference,'Fincap'=>$fincap,'InsuranceStatus'=>$insurancestatus,'POSubType'=>$revenuetype,'InsuranceNumber'=>$insuranceno,'IsQualityChkReqired'=>$Qualitycheck); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$Local_Interstate,'ServiceDescription'=>$SpcialInstruction,'UpdateBY'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$supplierreference,'Mode_Of_Shipment'=>$Modeofshipment,'Supplier_Offer_No'=>$supplieroffno,'Other_Reference'=>$otherreference,'Fincap'=>$fincap,'InsuranceStatus'=>$insurancestatus,'POSubType'=>$revenuetype,'InsuranceNumber'=>$insuranceno,'IsQualityChkReqired'=>$Qualitycheck,'BudgetType'=>$BudgetType); //print_r($POList); //die(); $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); @@ -1714,6 +1719,7 @@ function addNewImportPurchaseOrder() $TotalOrder = $this->input->post('txtToatlOrder'); $POStatus = $this->input->post('textStatus'); + $BudgetType = $this->input->post('Budget'); $CreateBy = $this->session->userdata ( 'userId' ); $RowCount = $this->input->post('txtRowCount'); @@ -1760,7 +1766,7 @@ function addNewImportPurchaseOrder() $Qualitycheck=1; - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap,'InsuranceStatus'=>$Insurance,'InsuranceNumber'=>$Insurancenumber,'POSubType'=>$importoption,'IsQualityChkReqired'=>$Qualitycheck); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap,'InsuranceStatus'=>$Insurance,'InsuranceNumber'=>$Insurancenumber,'POSubType'=>$importoption,'IsQualityChkReqired'=>$Qualitycheck,'BudgetType'=>$BudgetType); //print_r($POList); //die(); @@ -1937,6 +1943,8 @@ function addNewImportPurchaseOrder() //die(); $POStatus = $this->input->post('txtStatus'); + $BudgetType = $this->input->post('Budget'); + $CreateBy = $this->session->userdata ( 'userId' ); $RowCount = $this->input->post('txtRowCount'); $DeletedRow = $this->input->post('txtDeletedRow'); @@ -1983,7 +1991,7 @@ function addNewImportPurchaseOrder() $Qualitycheck=1; - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap,'InsuranceStatus'=>$insurestatus,'InsuranceNumber'=>$Insurancenumber,'POSubType'=>$importoption,'IsQualityChkReqired'=>$Qualitycheck); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin,'PaymentOtherDescription'=>$OtherPayment,'Mode_Of_Shipment'=>$Shipmentmode,'Supplier_Reference'=>$SupplierRef,'Supplier_Offer_No'=>$SupplierOffer,'Other_Reference'=>$otherRef,'Fincap'=>$finCap,'InsuranceStatus'=>$insurestatus,'InsuranceNumber'=>$Insurancenumber,'POSubType'=>$importoption,'IsQualityChkReqired'=>$Qualitycheck,'BudgetType'=>$BudgetType); //echo $PONO; //echo $TotalOrder; //print_r($POList); @@ -2361,6 +2369,8 @@ function addNewImportPurchaseOrder() $PaymentMethod = $this->input->post('PaymentMethod'); $OtherPayment=$this->input->post('Otherpayment'); + + $BudgetType = $this->input->post('Budget'); @@ -2383,7 +2393,7 @@ function addNewImportPurchaseOrder() $Qualitycheck=1; - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'ExchangeRate'=>$ExchangeRate,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CapitalRange'=>$CapitalRange,'POType'=>$POType,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch,'DeliveryDate'=>$Deliverydt,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions,'IsQualityChkReqired'=>$Qualitycheck); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'ExchangeRate'=>$ExchangeRate,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CapitalRange'=>$CapitalRange,'POType'=>$POType,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch,'DeliveryDate'=>$Deliverydt,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions,'IsQualityChkReqired'=>$Qualitycheck,'BudgetType'=>$BudgetType); // $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'Import_DispatchDetails'=>$Dispatch,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'Import_PlaceofOrgin'=>$Palaceoforigin); @@ -2624,6 +2634,8 @@ function addNewImportPurchaseOrder() $InsuranceNo=$this->input->post('insuranceNo'); $ServiceTypeOptions=$this->input->post('PoTypeOptions'); + $BudgetType = $this->input->post('Budget'); + $CreateBy = $this->session->userdata ( 'userId' ); $RowCount = $this->input->post('txtRowCount'); @@ -2637,7 +2649,7 @@ function addNewImportPurchaseOrder() $Qualitycheck=1; - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch,'DeliveryDate'=>$Deliverydt,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions,'IsQualityChkReqired'=>$Qualitycheck); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID,'DeliverySchedule'=>$DeliverySchedule,'Import_PlaceofOrgin'=>$Palaceoforigin,'Import_DispatchDetails'=>$Dispatch,'DeliveryDate'=>$Deliverydt,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions,'IsQualityChkReqired'=>$Qualitycheck,'BudgetType'=>$BudgetType); $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); diff --git a/application/controllers/requisitionform.php b/application/controllers/requisitionform.php index f7460039..51397b27 100755 --- a/application/controllers/requisitionform.php +++ b/application/controllers/requisitionform.php @@ -100,6 +100,7 @@ class requisitionform extends BaseController $userID = $this->session->userdata ( 'userId' ); $data['ReqDetails'] = $this->requistion_model->getRequistDetails($ReqNo,'Yes'); + //print_r($data['ReqDetails']); $this->load->model('purchaseorder_model'); $POType= $this->purchaseorder_model->GetPOType($ReqNo); $ReqPOType = ''; diff --git a/application/controllers/servicepurchaseorder.php b/application/controllers/servicepurchaseorder.php index 8832a235..84c05e36 100755 --- a/application/controllers/servicepurchaseorder.php +++ b/application/controllers/servicepurchaseorder.php @@ -232,6 +232,8 @@ $result = $this->purchaseorder_model->GetPODetailforBillingServicePO($PO); $OtherPayment=$this->input->post('Otherpayment'); $POType = $this->input->post('POType'); + + $BudgetType = $this->input->post('Budget'); $SpcialInstruction = $this->input->post('ScopeOfWork'); $TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary'); @@ -248,7 +250,7 @@ $result = $this->purchaseorder_model->GetPODetailforBillingServicePO($PO); $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,'ServiceWorkStatus'=>$WorkStatus,'POType'=>$POType,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'Description_Of_Service'=>$DescriptionOfPo,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions); + $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,'ServiceWorkStatus'=>$WorkStatus,'POType'=>$POType,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'Description_Of_Service'=>$DescriptionOfPo,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions,'BudgetType'=>$BudgetType); $POMaster = $this->purchaseorder_model->addPOMaster($POList,$POType,$ServiceTypeOptions); @@ -369,6 +371,8 @@ $result = $this->purchaseorder_model->GetPODetailforBillingServicePO($PO); $OtherPayment=$this->input->post('Otherpayment'); $POType = $this->input->post('POType'); + + $BudgetType = $this->input->post('Budget'); $SpcialInstruction = $this->input->post('ScopeofWork'); $TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary'); @@ -385,7 +389,7 @@ $result = $this->purchaseorder_model->GetPODetailforBillingServicePO($PO); // 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,'ServiceWorkStatus'=>$WorkStatus,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'Description_Of_Service'=>$DescriptionOfPo,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions); + $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,'ServiceWorkStatus'=>$WorkStatus,'PaymentOtherDescription'=>$OtherPayment,'Supplier_Reference'=>$SupplierReference,'Mode_Of_Shipment'=>$ModeOfShipment,'Supplier_Offer_No'=>$SuppliersOfferNo,'Other_Reference'=>$OtherReferences,'Fincap'=>$Fincap,'Description_Of_Service'=>$DescriptionOfPo,'InsuranceStatus'=>$InsuranceOptions,'InsuranceNumber'=>$InsuranceNo,'POSubType'=>$ServiceTypeOptions,'BudgetType'=>$BudgetType); $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); diff --git a/application/models/mrir_model.php b/application/models/mrir_model.php index c940e2ac..feb4efc9 100755 --- a/application/models/mrir_model.php +++ b/application/models/mrir_model.php @@ -160,7 +160,7 @@ TMD.QuantityRejected,ST.StatusName,TMD.Remarks,AdvanceAmount '); $this->db->join ('T_PurchaseOrder_Master POMR ','IGRM.PONO = POMR.PONO');//to get podate,deliverydate,servicedescription // $this->db->join ('T_PurchaseOrder_LineItem POLT','IGRM.PONO=POLT.PONO');//to get receivedquantity,quantity $this->db->join('T_PurchaseOrder_LineItem Line','TMM.PONO=Line.PONO and TMD.MaterialCode=Line.MaterialCode'); - $this->db->join('T_CostCenter_Master COST','Line.CostCenterCode=COST.CostCenterCode'); + $this->db->join('T_CostCenter_Master COST','Line.CostCenterCode=COST.CostCenterCode','left'); //$this->db->join ('T_IGR_Details IGRD','IGRD.IGRNO = IGRM.IGRNO');//to get invoicequantity $this->db->join('T_IGR_Details IGRD','IGRD.IGRNO = TMM.IGRNO and TMD.MaterialCode=IGRD.MaterialCode'); $this->db->join ('T_MaterialMaster MM','TMD.MaterialCode = MM.MaterialCode'); diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index d290f94e..58e5c7d5 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -707,7 +707,7 @@ function GetPOType($ReqNo) function GetServicePurchaseOrder($PONO = '') { $this->db->distinct(); - $this->db->select('ReqNo,POMast.PONO,POMast.PaymentTerms,POMast.PaymentOtherDescription,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,POMast.PaymentTerms,POMast.ExchangeRate,POMast.UpdatedOn,Stat.StatusCode,POMast.ServiceWorkStatus,POMast.*,POMast.TotalOrderValue'); + $this->db->select('ReqNo,POMast.PONO,POMast.PaymentTerms,POMast.PaymentOtherDescription,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,POMast.PaymentTerms,POMast.ExchangeRate,POMast.UpdatedOn,Stat.StatusCode,POMast.ServiceWorkStatus,POMast.*,POMast.TotalOrderValue,POMast.BudgetType'); $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'); @@ -1355,7 +1355,7 @@ function GetCurrencytype() $this->db->join('T_PurchaseOrder_LineItem req', 'req.PONO= mast.PONO'); $this->db->join('T_Requestion_Master rmast','rmast.ReqNo=req.ReqNo'); //$this->db->join('T_CostCenter_Budget bud','bud.CostCenterCode = req.CostCenterCode and bud.BudgetType = rmast.ReqType'); - $this->db->join('T_CostCenter_Master ccm','ccm.CostCenterCode = req.CostCenterCode'); + $this->db->join('T_CostCenter_Master ccm','ccm.CostCenterCode = req.CostCenterCode','left'); $this->db->join('tbl_users tbl', 'rmast.createdby=tbl.userid'); $this->db->join('T_Employee_Details as emp', 'emp.empid=tbl.empid'); $this->db->join('T_DepartmentDetails as Dep','Dep.DEPCode=emp.Departmentcode'); diff --git a/application/models/requistion_model.php b/application/models/requistion_model.php index ebeb8029..011f5e15 100755 --- a/application/models/requistion_model.php +++ b/application/models/requistion_model.php @@ -290,13 +290,14 @@ ifnull(Po.Quantity,0) as POQTY,sta.StatusName $subQuery = 'select distinct ReqNo,ReqType,Status,Requestedby,DATE_FORMAT(mast.CreatedDate, "%d-%m-%Y") as CreatedDate,Schedule_Type,NumberOfService,Service_Period ,emp.FirstName,emp.EmpID,emp.Designation, Dept.DEPCode,Dept.DepartmentName,DATE_FORMAT(mast.ReqDate, "%d-%m-%Y") as ReqDate,mast.CostCenterCode,Cost.CostCenterName from T_Requestion_Master mast - join T_CostCenter_Master Cost on Cost.CostCenterCode = mast.CostCenterCode + left join T_CostCenter_Master Cost on Cost.CostCenterCode = mast.CostCenterCode join T_Employee_Details emp on mast.Requestedby = emp.EmpID join T_DepartmentDetails Dept on emp.Departmentcode = Dept.DEPCode where ReqNo=?'; - $query = $this->db->query($subQuery, array($ReqID)); + $query = $this->db->query($subQuery, array($ReqID)); + // print_r($this->db->last_query()); if($NoArray == '') { return $query->result_array(); diff --git a/application/views/EditservicePurchaseorder.php b/application/views/EditservicePurchaseorder.php index 993549bd..32a1b141 100755 --- a/application/views/EditservicePurchaseorder.php +++ b/application/views/EditservicePurchaseorder.php @@ -36,6 +36,7 @@ array("name"=>"NO","value"=>"0"),array("name"=>"YES","value"=>"1") $InsuranceNo=''; $ServiceTypeOptions=''; $DescriptionOfPo = ''; + $BudgetType = ''; if(!empty($INRSYMBOL)) @@ -88,10 +89,12 @@ if(!empty($POMaster)) $InsuranceNo=$Req->InsuranceNumber; $ServiceTypeOptions=$Req->POSubType; $DescriptionOfPo = $Req->Description_Of_Service; + $BudgetType = $Req->BudgetType; } } +//echo $BudgetType; if(!empty($RequistionDetails)) { @@ -533,15 +536,15 @@ function ExceedQuantityCheck() var ReqAmount = parseFloat(ValuetoCheck); var BudAmount = parseFloat(budgetAmount); - if(ReqAmount > BudAmount ) - { - alert('Your exceeding the Avaiable Budget :'+ AvilBudAmt +'.Please adjust the Product to proceed further.'); - return false; - } - else - { + // if(ReqAmount > BudAmount ) + // { + // alert('Your exceeding the Avaiable Budget :'+ AvilBudAmt +'.Please adjust the Product to proceed further.'); + // return false; + // } + // else + // { return true; - } + //} } function calculateServiceTax(varBasicValue) { @@ -1079,6 +1082,34 @@ $(document).ready(function () { + + +
+ + + + +
+ + + + @@ -2260,7 +2291,11 @@ $(document).ready(function () { - + + + + +   Save @@ -2323,6 +2358,18 @@ var userid = ''; }; + +$("#BudgetType").change(function(){ + + var aa = $("#BudgetType option:selected").text(); + + $('#Budget').val(aa); + + +}); + + + $('#EditotherDescription').hide(); $('#otherdescription').hide() @@ -2959,11 +3006,11 @@ var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val(); $('#Deliverydt').focus(); return false; } - else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) { - alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); + // else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) { + // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); - return false; - } + // return false; + // } else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){ alert('Please Enter Other Payment Details'); $('#Otherpayment').focus(); diff --git a/application/views/capitalpurchaseorder.php b/application/views/capitalpurchaseorder.php index c5909648..e82de6b0 100755 --- a/application/views/capitalpurchaseorder.php +++ b/application/views/capitalpurchaseorder.php @@ -250,13 +250,20 @@ function vaildateBeforeOpenModal() else if($('#PoTypeOptions').val()== "0") - { - alert('Please Select POType'); - $('#PoTypeOptions').focus(); - return false; + { + alert('Please Select POType'); + $('#PoTypeOptions').focus(); + return false; - } + } + else if($('#BudgetType').val()=="0") + { + alert('Please Select Budget Type'); + $('#BudgetType').focus(); + return false; + + } else if($('#Deliverydt').val() == '' && $('#Scheduleby').val() == '') { @@ -737,6 +744,24 @@ function vaildateBeforeOpenModal() + + +
+ + 'Select','1'=>'REVENUE','2'=>'CAPITAL'); + echo form_dropdown('BudgetType', $optionsnew,set_value('BudgetType'),'id="BudgetType"' ,'required="true"' ,'class="form-control select2'); + + ?> + + +
+ + + + @@ -2526,6 +2551,7 @@ function vaildateBeforeOpenModal() + @@ -2605,6 +2631,17 @@ function vaildateBeforeOpenModal() }; + + $("#BudgetType").change(function(){ + + var aa = $("#BudgetType option:selected").text(); + + $('#Budget').val(aa); + + +}); + + $(function() { $("#PODate").datepicker({ @@ -3514,16 +3551,16 @@ CalculateCtable() var ReqAmount = parseFloat(ValuetoCheck); var BudAmount = parseFloat(budgetAmount); - if(ReqAmount > BudAmount ) - { - alert('Your exceeding the Avaiable Budget :'+ BudAmount +'.Please adjust the Product to proceed further.'); + // if(ReqAmount > BudAmount ) + // { + // alert('Your exceeding the Avaiable Budget :'+ BudAmount +'.Please adjust the Product to proceed further.'); - return false; - } - else - { + // return false; + // } + // else + // { return true; - } + //} } var index=1; /* This is used add capital po line item */ @@ -3772,16 +3809,16 @@ CalculateCtable() else{ basicAmountRate=parseFloat(basicAmountRate) - parseFloat(discountRate); } - if(basicAmountRate > avalbudAmt) - { - alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#CPRate').focus(); - return false; - } - else - { + // if(basicAmountRate > avalbudAmt) + // { + // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#CPRate').focus(); + // return false; + // } + // else + // { return true; - } + //} } function validateCapitalTax() @@ -4687,11 +4724,11 @@ var basicAmountRate = parseFloat($('#CapitalToatlOrder').val()); $('#Otherpayment').focus(); return false; } - else if(parseInt(AvlBudAmt) < parseInt(basicAmountRate)) { - alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); + // else if(parseInt(AvlBudAmt) < parseInt(basicAmountRate)) { + // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); - return false; - } + // return false; + // } else if($('#PoTypeOptions').val()== "0") { @@ -5287,16 +5324,16 @@ var Freight=parseFloat($('#txtAfterFreightlocedit').val() == '' ? '0.00' : $('#t else{ basicAmountRate=parseFloat(basicAmountRate)- parseFloat(discountRate); } - if(basicAmountRate > avalbudAmt) - { - alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#EditCPRate').focus(); - return false; - } - else - { + // if(basicAmountRate > avalbudAmt) + // { + // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#EditCPRate').focus(); + // return false; + // } + // else + // { return true; - } + //} } diff --git a/application/views/editCapitalAmendPO.php b/application/views/editCapitalAmendPO.php index 563cf1de..dde56876 100755 --- a/application/views/editCapitalAmendPO.php +++ b/application/views/editCapitalAmendPO.php @@ -85,6 +85,9 @@ $ServiceTypeOptions=''; $FinalTotalBasic = 0; + $BudgetType = ''; + + $INR=''; $INRSYM=''; if(!empty($INRSYMBOL)) @@ -170,6 +173,7 @@ if(!empty($POMaster)) $InsuranceOptions=$Req->InsuranceStatus; $InsuranceNo=$Req->InsuranceNumber; $ServiceTypeOptions=$Req->POSubType; + $BudgetType = $Req->BudgetType; } } @@ -875,6 +879,35 @@ document.getElementById('dispatchinternational').style.display = 'block'; + + + +
+ + + + +
+ + + + @@ -2315,6 +2348,8 @@ document.getElementById('dispatchinternational').style.display = 'block'; var SelectedMaterialList = { Mat: [] }; + + $('#BudgetType').attr("style", "pointer-events: none;"); var index= +1; var myArray = ; @@ -2977,16 +3012,16 @@ var myArray = ; var ReqAmount = parseFloat(ValuetoCheck); var BudAmount = parseFloat(budgetAmount); - if(ReqAmount > BudAmount ) - { - alert('Your exceeding the Avaiable Budget :'+ BudAmount +'.Please adjust the Product to proceed further.'); + // if(ReqAmount > BudAmount ) + // { + // alert('Your exceeding the Avaiable Budget :'+ BudAmount +'.Please adjust the Product to proceed further.'); - return false; - } - else - { + // return false; + // } + // else + // { return true; - } + // } } @@ -3001,16 +3036,16 @@ var myArray = ; var basicAmountRate = parseFloat($('#CPTotalAmount').val()); var totalAmount = parseFloat($('#txtTotalOrderValue').val()); - if(basicAmountRate > avalbudAmt) - { - alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#CPRate').focus(); - return false; - } - else - { + // if(basicAmountRate > avalbudAmt) + // { + // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#CPRate').focus(); + // return false; + // } + // else + // { return true; - } + //} } function validateCapitalTax() @@ -3423,11 +3458,11 @@ basicamt=$('#txtTotalBasic').val() - $('#txtTotalDiscount').val(); return false; } - else if(parseInt(AvlBudAmt) < parseInt(basicamt)) { - alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); + // else if(parseInt(AvlBudAmt) < parseInt(basicamt)) { + // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); - return false; - } + // return false; + // } else { @@ -4005,16 +4040,16 @@ function validateEditCapitalTax() var basicAmountRate = parseFloat($('#EditCPTotalAmount').val()); var totalAmount = parseFloat($('#EdittxtTotalOrderValue').val()); - if(basicAmountRate > avalbudAmt) - { - alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#EditCPRate').focus(); - return false; - } - else - { + // if(basicAmountRate > avalbudAmt) + // { + // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#EditCPRate').focus(); + // return false; + // } + // else + // { return true; - } + //} } diff --git a/application/views/editCapitalPo.php b/application/views/editCapitalPo.php index 5206e515..6f3dc480 100755 --- a/application/views/editCapitalPo.php +++ b/application/views/editCapitalPo.php @@ -90,6 +90,8 @@ $InsuranceOptions=''; $InsuranceNo=''; $ServiceTypeOptions=''; + $BudgetType = ''; + if(!empty($INRSYMBOL)) { foreach ($INRSYMBOL as $INR) @@ -119,7 +121,7 @@ if(!empty($POMaster)) $SupId = $Req->SupplierID; - $SupName = $Req->SupplierName; + $SupName = $Req->SupplierName; $Address = $Req->Address; $pdt = new DateTime($Req->PODate); $PODate = $pdt->format('d-m-Y'); @@ -165,6 +167,7 @@ if(!empty($POMaster)) $InsuranceOptions=$Req->InsuranceStatus; $InsuranceNo=$Req->InsuranceNumber; $ServiceTypeOptions=$Req->POSubType; + $BudgetType = $Req->BudgetType; } @@ -884,6 +887,34 @@ $("#PaymentMethod").select2(); + + +
+ + + + +
+ + + + @@ -3756,6 +3787,8 @@ $("#PaymentMethod").select2(); + + ; }); + + $("#BudgetType").change(function(){ + + var aa = $("#BudgetType option:selected").text(); + + $('#Budget').val(aa); + + +}); + + $(function() { $("#PODate").datepicker({ @@ -4747,16 +4791,16 @@ if(isNaN(CustomDutyExpenses)) var ReqAmount = parseFloat(ValuetoCheck); var BudAmount = parseFloat(budgetAmount); - if(ReqAmount > BudAmount ) - { - alert('Your exceeding the Avaiable Budget :'+ BudAmount +'.Please adjust the Product to proceed further.'); + // if(ReqAmount > BudAmount ) + // { + // alert('Your exceeding the Avaiable Budget :'+ BudAmount +'.Please adjust the Product to proceed further.'); - return false; - } - else - { + // return false; + // } + // else + // { return true; - } + // } } @@ -4994,16 +5038,16 @@ if(isNaN(CustomDutyExpenses)) else{ basicAmountRate=parseFloat(basicAmountRate) - parseFloat(discountRate); } - if(basicAmountRate > avalbudAmt) - { - alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#CPRate').focus(); - return false; - } - else - { + // if(basicAmountRate > avalbudAmt) + // { + // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#CPRate').focus(); + // return false; + // } + // else + // { return true; - } + // } } function validateCapitalTax() @@ -6132,11 +6176,11 @@ var basicAmountRate = parseFloat($('#CapitalToatlOrder').val()); $('#Otherpayment').focus(); return false; } - else if(parseInt(AvlBudAmt) < parseInt(basicAmountRate)) { - alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); + // else if(parseInt(AvlBudAmt) < parseInt(basicAmountRate)) { + // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); - return false; - } + // return false; + // } else { @@ -6884,16 +6928,16 @@ var Freight=parseFloat($('#txtAfterFreightlocedit').val() == '' ? '0.00' : $('#t else{ basicAmountRate=parseFloat(basicAmountRate)- parseFloat(discountRate); } - if(basicAmountRate > avalbudAmt) - { - alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#EditCPRate').focus(); - return false; - } - else - { + // if(basicAmountRate > avalbudAmt) + // { + // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#EditCPRate').focus(); + // return false; + // } + // else + // { return true; - } + //} } diff --git a/application/views/editImportAmendPO.php b/application/views/editImportAmendPO.php index 9991eb6e..114e8d71 100755 --- a/application/views/editImportAmendPO.php +++ b/application/views/editImportAmendPO.php @@ -114,6 +114,9 @@ $StatusName=''; $Reqon = ''; $Requestedby=''; $RequesterName=''; +$BudgetType = ''; + + if(!empty($POMaster)) { foreach ($POMaster as $Req) @@ -161,6 +164,7 @@ if(!empty($POMaster)) $InsuranceNo=$Req->InsuranceNumber; $Importoption=$Req->POSubType; $InsuranceStatus=$Req->InsuranceStatus; + $BudgetType = $Req->BudgetType; } } @@ -820,7 +824,33 @@ if(!empty($RequistionDetails)) - + + +
+ + + + +
+ + + @@ -1953,6 +1983,10 @@ var NilType = ''; }; + +$('#BudgetType').attr("style", "pointer-events: none;"); + + $('#Insurance').change(function() { //var insure=$('#Insurance').val(); @@ -3329,16 +3363,16 @@ function Budgetcheck() var totordring=totalorderedamount*Exchange; var TotalSum=totavlbud; //console.log(TotalSum); - if(totordring>TotalSum) - { - alert('You are Exceeding The Budget Amount'); - return false; - } + // if(totordring>TotalSum) + // { + // alert('You are Exceeding The Budget Amount'); + // return false; + // } - else - { + // else + // { return true; - } + //} } diff --git a/application/views/editRevenueAmendPO.php b/application/views/editRevenueAmendPO.php index 4ea238d1..1681d395 100755 --- a/application/views/editRevenueAmendPO.php +++ b/application/views/editRevenueAmendPO.php @@ -65,6 +65,7 @@ foreach ($PaymentTerms as $TER) $revenuesubtype=''; $insurencestatus=''; $insurenceno=''; + $BudgetType = ''; if(!empty($POMaster)) { @@ -103,9 +104,12 @@ if(!empty($POMaster)) $revenuesubtype = $Req->POSubType; $insurencestatus = $Req->InsuranceStatus; $insurenceno = $Req->InsuranceNumber; + $BudgetType = $Req->BudgetType; } } + +//echo $BudgetType; if(!empty($RequistionDetails)) { @@ -881,16 +885,16 @@ function validateEditExceedLimit() var discount = parseFloat($('#txtEditAfterDiscount').val()); basicAmountRate = basicAmountRate - discount; //alert(basicAmountRate+'-'+avalbudAmt+'-'+discount); - if(basicAmountRate > avalbudAmt)// || totalAmount > avalbudAmt) - { - alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#EditRate').focus(); - return false; - } - else - { + // if(basicAmountRate > avalbudAmt)// || totalAmount > avalbudAmt) + // { + // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#EditRate').focus(); + // return false; + // } + // else + // { return true; - } + //} } function calculateEditTotalValue() @@ -1311,6 +1315,34 @@ function calculateEditTaxValue() + + +
+ + + + +
+ + + + @@ -2159,6 +2191,8 @@ function calculateEditTaxValue() var index = '1'; var userid = ''; +$('#BudgetType').attr("style", "pointer-events: none;"); + $("#EDITREVENUE").on("shown.bs.modal", function(e) { var AvlBudAmt = ''; @@ -2563,21 +2597,21 @@ function validateBudgetExceedLimit() { //alert(data); avalbudAmt = parseFloat(data); - if(basicAmountRate > avalbudAmt || totalAmount > avalbudAmt) - { + // if(basicAmountRate > avalbudAmt || totalAmount > avalbudAmt) + // { - alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('.content').loader('hide'); - $('#Rate').focus(); - return false; + // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('.content').loader('hide'); + // $('#Rate').focus(); + // return false; - } - else - { + // } + // else + // { //alert('Not exceeding in else part'); return true; - } + //} } @@ -2619,11 +2653,11 @@ var txtTotalDiscount = $('#txtTotalDiscount').val(); $('#Deliverydt').focus(); return false; } - else if(parseInt(AvlBudAmt) < (parseInt(txtTotBasicAmount) - parseInt(txtTotalDiscount))) { - alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); + // else if(parseInt(AvlBudAmt) < (parseInt(txtTotBasicAmount) - parseInt(txtTotalDiscount))) { + // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); - return false; - } + // return false; + // } else { //alert('final else for store data'); diff --git a/application/views/editRevenuepurchaseorder.php b/application/views/editRevenuepurchaseorder.php index 79e70974..4cb979a0 100755 --- a/application/views/editRevenuepurchaseorder.php +++ b/application/views/editRevenuepurchaseorder.php @@ -73,6 +73,7 @@ foreach ($PaymentTerms as $TER) $ServiceDescription = ''; $CapitalRange = ''; $otherPayment=''; + $BudgetType = ''; if(!empty($POMaster)) { //print_r($POMaster); @@ -106,11 +107,13 @@ if(!empty($POMaster)) $revenuesubtype = $Req->POSubType; $insurencestatus = $Req->InsuranceStatus; $insurenceno = $Req->InsuranceNumber; + $BudgetType = $Req->BudgetType; // echo $insurenceno; // echo $otherPayment; } } +//echo $BudgetType; @@ -204,6 +207,24 @@ if(!empty($RequistionDetails)) var SchName = ; var DelDt = ''; var insurancestatus = ''; +//alert(insurancestatus) + var budgettype=''; + + // if(budgettype == 'CAPITAL') + // { + // alert('capital') + // document.getElementById('BudgetType').text = 2; + // document.getElementById('BudgetType').value = 'player'; + // $('[name=BudgetType]').val(budgettype); + //} + //else + //{ + // alert('revenue') + //document.getElementById('BudgetType').text = 1; + // document.getElementById('BudgetType').value = 'player'; + //} + +//alert(budgettype); var insuranceno = ''; var statuscheck=''; @@ -2084,16 +2105,16 @@ function validateEditExceedLimit() var basicAmountRate = parseFloat($('#txtEditBasicValue').val()); var totalAmount = parseFloat($('#txtEditTotalOrderValue').val()); - if(basicAmountRate > avalbudAmt)// || totalAmount > avalbudAmt) - { - alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#EditRate').focus(); - return false; - } - else - { + // if(basicAmountRate > avalbudAmt)// || totalAmount > avalbudAmt) + // { + // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#EditRate').focus(); + // return false; + // } + // else + // { return true; - } + //} } function calculateEditTotalValue() @@ -2518,6 +2539,29 @@ function calculateEditTaxValue() + +
+ + + + +
@@ -4123,6 +4167,9 @@ function calculateEditTaxValue() + + +   Save @@ -4179,6 +4226,19 @@ function calculateEditTaxValue() var index = ; var userid = ''; + +$("#BudgetType").change(function(){ + + var aa = $("#BudgetType option:selected").text(); + + $('#Budget').val(aa); + + +}); + + + + $("#REVENUE").on("shown.bs.modal", function(e) { $('#isEdit').val(0); @@ -4186,7 +4246,7 @@ $("#REVENUE").on("shown.bs.modal", function(e) { $('.AddRevenue').click(function(){ tinyMCE.triggerSave(); - if(validateRevenueTax() && validateExceedLimit() && ExceedQuantityCheck()) + if(validateRevenueTax() && ExceedQuantityCheck()) { var temp = parseInt(index)+1; var Reqnumber = $('#ReqNo').val(); @@ -4717,17 +4777,17 @@ function validateBudgetExceedLimit() { //alert(data); avalbudAmt = parseFloat(data); - if(basicAmountRate > avalbudAmt || totalAmount > avalbudAmt) - { - alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#Rate').focus(); - return false; + // if(basicAmountRate > avalbudAmt || totalAmount > avalbudAmt) + // { + // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#Rate').focus(); + // return false; - } - else - { + // } + // else + // { return true; - } + //} } @@ -4928,11 +4988,11 @@ var totaldiscount = $('#txtTotalDiscount').val(); //{ // return false; //} - else if(parseInt(AvlBudAmt) < (parseInt(txtTotalbasicamount)- parseInt(totaldiscount))){ - alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); + // else if(parseInt(AvlBudAmt) < (parseInt(txtTotalbasicamount)- parseInt(totaldiscount))){ + // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); - return false; - } + // return false; + // } else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){ alert('Please Enter Payable Terms Description'); diff --git a/application/views/editServiceAmendPO.php b/application/views/editServiceAmendPO.php index 1a245139..d8bc45b6 100755 --- a/application/views/editServiceAmendPO.php +++ b/application/views/editServiceAmendPO.php @@ -38,6 +38,8 @@ $InsuranceNo=''; $ServiceTypeOptions=''; $DescriptionOfPo = ''; + $BudgetType = ''; + if(!empty($INRSYMBOL)) { @@ -92,10 +94,14 @@ $InsuranceNo=$Req->InsuranceNumber; $ServiceTypeOptions=$Req->POSubType; $DescriptionOfPo = $Req->Description_Of_Service; + $BudgetType = $Req->BudgetType; } } + + + if(!empty($RequistionDetails)) { @@ -600,15 +606,15 @@ function IGSTchange() var ReqAmount = parseFloat(ValuetoCheck); var BudAmount = parseFloat(budgetAmount); - if(ReqAmount > BudAmount ) - { - alert('Your exceeding the Avaiable Budget :'+ AvilBudAmt +'.Please adjust the Product to proceed further.'); - return false; - } - else - { + // if(ReqAmount > BudAmount ) + // { + // alert('Your exceeding the Avaiable Budget :'+ AvilBudAmt +'.Please adjust the Product to proceed further.'); + // return false; + // } + // else + // { return true; - } + // } } @@ -1065,6 +1071,34 @@ $(document).ready(function () { + + + +
+ + + + +
+ + + @@ -1661,6 +1695,9 @@ var userid = ''; }; +$('#BudgetType').attr("style", "pointer-events: none;"); + + $('#EditotherDescription').hide(); $("#EDITSERVICE").on("shown.bs.modal", function(e) { @@ -2223,12 +2260,12 @@ var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val(); if(validate()) { - if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) { - alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); + // if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) { + // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); - return false; - } - else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){ + // return false; + // } + if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){ alert('Please Enter Other Payment Details'); $('#Otherpayment').focus(); return false; diff --git a/application/views/editimportpo.php b/application/views/editimportpo.php index 56172e2f..b0dfd466 100755 --- a/application/views/editimportpo.php +++ b/application/views/editimportpo.php @@ -121,6 +121,7 @@ $SupplierRef=''; $SupOfferno=''; $Otherref=''; $Fincap=''; +$BudgetType = ''; if(!empty($POMaster)) { @@ -168,6 +169,7 @@ if(!empty($POMaster)) $Insurance=$Req->InsuranceStatus; $InsuranceNo=$Req->InsuranceNumber; $Importoption=$Req->POSubType; + $BudgetType = $Req->BudgetType; } } @@ -828,7 +830,35 @@ tinymce.init({ - + + + +
+ + + + +
+ + + + @@ -3028,7 +3058,9 @@ echo form_textarea($data); - + + + '; + +$("#BudgetType").change(function(){ + + var aa = $("#BudgetType option:selected").text(); + + $('#Budget').val(aa); + + +}); + + + $('#Importoption').attr("style", "pointer-events: none;"); $('#Insurance').change(function() { @@ -4330,16 +4374,16 @@ function validateEditExceedLimit() exp=basicAmountRate*exchangerate; //console.log(exp); - if(exp > totavlbud || totalAmount > totavlbud) - { - alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#EditRate').focus(); - return false; - } - else - { + // if(exp > totavlbud || totalAmount > totavlbud) + // { + // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#EditRate').focus(); + // return false; + // } + // else + // { return true; - } + //} } @@ -4368,16 +4412,16 @@ var totavlbud=avalbudAmt+Sum; exp=basicAmountRate*exchangerate; //console.log(exp); - if(exp > totavlbud || totalAmount > totavlbud) - { - alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#Rate').focus(); - return false; - } - else - { + // if(exp > totavlbud || totalAmount > totavlbud) + // { + // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#Rate').focus(); + // return false; + // } + // else + // { return true; - } + //} } @@ -5681,16 +5725,16 @@ function Budgetcheck() var totordring=totalorderedamount*Exchange; var TotalSum=totavlbud; //console.log(TotalSum); - if(totordring>TotalSum) - { - alert('You are Exceeding The Budget'); - return false; - } + // if(totordring>TotalSum) + // { + // alert('You are Exceeding The Budget'); + // return false; + // } - else - { + // else + // { return true; - } + //} } diff --git a/application/views/editrequisitionform.php b/application/views/editrequisitionform.php index f5a1d2ca..826504d0 100755 --- a/application/views/editrequisitionform.php +++ b/application/views/editrequisitionform.php @@ -34,6 +34,8 @@ if(!empty($ReqDetails)) } } +//echo $ReqType; + $description=''; diff --git a/application/views/importpo.php b/application/views/importpo.php index 93f33650..92b75fff 100755 --- a/application/views/importpo.php +++ b/application/views/importpo.php @@ -63,6 +63,8 @@ if(!empty($AvlimportBudAmt)) } +//echo $AvlAmount; + // if(!empty($AvlBudAmt)) // { @@ -231,6 +233,14 @@ function vaildateBeforeOpenModal() } + else if($('#BudgetType').val()=="0") + { + alert('Please Select Budget Type'); + $('#BudgetType').focus(); + return false; + + } + @@ -681,6 +691,24 @@ function vaildateBeforeOpenModal() + + +
+ + 'Select','1'=>'REVENUE','2'=>'CAPITAL'); + echo form_dropdown('BudgetType', $optionsnew,set_value('BudgetType'),'id="BudgetType"' ,'required="true"' ,'class="form-control select2'); + + ?> + + +
+ + + + @@ -2028,7 +2056,10 @@ echo form_textarea($data); - + + + +   Save   Submit @@ -2101,6 +2132,17 @@ $(document).on('change',".changetodecimal", function(){ }); + +$("#BudgetType").change(function(){ + + var aa = $("#BudgetType option:selected").text(); + + $('#Budget').val(aa); + + +}); + + var SelectedMaterialCode = []; var RequistQuantity = ''; var AvilBudAmt = ''; @@ -2292,6 +2334,16 @@ $("#txtBasicValue").val(''); var Material = ; var AvlBudAmt =''; + //alert(AvlBudAmt); + if(AvlBudAmt == '') + { + $("#AvlBudAmt").val(parseFloat(0).toFixed(2)); + } + + else + { + $("#AvlBudAmt").val(parseFloat(AvlBudAmt).toFixed(2)); + } //alert(Material); // For Binding DepartmentName @@ -2305,7 +2357,7 @@ $("#txtBasicValue").val(''); }); //$("#AvlBudAmt").val(AvlBudAmt); - $("#AvlBudAmt").val(parseFloat(AvlBudAmt).toFixed(2)); + // $("#AvlBudAmt").val(parseFloat(AvlBudAmt).toFixed(2)); // For Binding Cost center for the selected department /* $("#CostCenter").append( $('').val("0").html("Select Cost Center") ); $.each(cost, function(idx, obj) { @@ -2663,6 +2715,7 @@ if(isNaN(txtINR)) var avalbudAmte= ; +//alert(avalbudAmte) function validateEditExceedLimit() { //var avalbudAmt = parseFloat($('#EditAvlBudAmt').val()); @@ -2673,16 +2726,16 @@ function validateEditExceedLimit() exp=basicAmountRate*exchangerate; //console.log(exp); - if(exp > avalbudAmte || totalAmount > avalbudAmte) - { - alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#EditRate').focus(); - return false; - } - else - { + // if(exp > avalbudAmte || totalAmount > avalbudAmte) + // { + // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#EditRate').focus(); + // return false; + // } + // else + // { return true; - } + // } } @@ -2705,16 +2758,16 @@ var avalbudAmt= ; exp=basicAmountRate*exchangerate; //console.log(exp); - if(exp > avalbudAmt || totalAmount > avalbudAmt) - { - alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#Rate').focus(); - return false; - } - else - { + // if(exp > avalbudAmt || totalAmount > avalbudAmt) + // { + // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#Rate').focus(); + // return false; + // } + // else + // { return true; - } + //} } @@ -4493,16 +4546,16 @@ function Budgetcheck() var totordring=totalorderedamount*Exchange; var TotalSum=avalbudAmte; - if(totordring>TotalSum) - { - alert('You are Exceeding The Budget'); - return false; - } + // if(totordring>TotalSum) + // { + // alert('You are Exceeding The Budget'); + // return false; + // } - else - { + // else + // { return true; - } + //} } diff --git a/application/views/purchaseorder.php b/application/views/purchaseorder.php index e3fdc29e..9feaada3 100755 --- a/application/views/purchaseorder.php +++ b/application/views/purchaseorder.php @@ -124,6 +124,7 @@ if(!empty($INRSYMBOL)) function openModal() { + if(vaildateBeforeOpenModal()) { $('#REVENUE').modal('show'); @@ -181,6 +182,14 @@ function vaildateBeforeOpenModal() $('#PoTypeOptions').focus(); return false; + } + + else if($('#BudgetType').val()=="0") + { + alert('Please Select Budget Type'); + $('#BudgetType').focus(); + return false; + } else @@ -2137,16 +2146,16 @@ function validateEditExceedLimit() //alert(basicAmountRate); // var totalAmount = parseFloat($('#txtEditTotalOrderValue').val()); - if(basicAmountRate > avalbudAmt)// || totalAmount > avalbudAmt) - { - alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#EditRate').focus(); - return false; - } - else - { + // if(basicAmountRate > avalbudAmt)// || totalAmount > avalbudAmt) + // { + // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#EditRate').focus(); + // return false; + // } + // else + // { return true; - } + //} } function calculateEditTotalValue() @@ -2521,7 +2530,25 @@ function calculateEditTaxValue() ?> + + + + +
+ + 'Select','1'=>'REVENUE','2'=>'CAPITAL'); + echo form_dropdown('BudgetType', $optionsnew,set_value('BudgetType'),'id="BudgetType"' ,'required="true"' ,'class="form-control select2'); + + ?> + + +
+ + @@ -3586,7 +3613,8 @@ function calculateEditTaxValue() - + +   Save   Submit   Reset @@ -3644,6 +3672,18 @@ $("#insurance").change(function(){ $("#insuranceno").val('Yes');} }); + +$("#BudgetType").change(function(){ + + var aa = $("#BudgetType option:selected").text(); + + $('#Budget').val(aa); + + +}); + + + $("#EDITREVENUE").on("shown.bs.modal", function(e) { userid = $(e.relatedTarget).data('userid'); @@ -3760,7 +3800,7 @@ $("#EDITREVENUE").on("shown.bs.modal", function(e) { }); $('.AddRevenue').click(function(){ tinyMCE.triggerSave(); - if(validateRevenueTax() && validateExceedLimit() && ExceedQuantityCheck()) + if(validateRevenueTax()&& ExceedQuantityCheck()) { var temp = index; var Reqnumber = $('#ReqNo').val(); @@ -4278,11 +4318,11 @@ var AvlBudAmt = ''; $('#Deliverydt').focus(); return false; } - else if(parseInt(AvlBudAmt) < parseInt(finalBasicAmount)) { - alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); + // else if(parseInt(AvlBudAmt) < parseInt(finalBasicAmount)) { + // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); - return false; - } + // return false; + // } else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){ alert('Please Enter Payable Terms Description'); $('#Otherpayment').focus(); diff --git a/application/views/requisitionform.php b/application/views/requisitionform.php index ea059b74..15f51fe2 100755 --- a/application/views/requisitionform.php +++ b/application/views/requisitionform.php @@ -704,11 +704,11 @@ function validate() alert('Please Add Line Item'); return false; } - else if(isExceed == 1) - { - alert('You dont have Budget and You cant Raise New Requisition'); - return false; - } + // else if(isExceed == 1) + // { + // alert('You dont have Budget and You cant Raise New Requisition'); + // return false; + // } else { return true; @@ -747,15 +747,15 @@ function validateBeforeAdd() } else if($("#CostCenter").val() == '-1') { - alert('Please select the Cost center to check the Budget Availablity '); + alert('Please select the Cost center'); $("#CostCenter").focus(); return false; } - else if( isExceed == '1') - { - alert('You dont have available Budget Amount. You cant raise new Requisition'); - return false; - } + // else if( isExceed == '1') + // { + // alert('You dont have available Budget Amount. You cant raise new Requisition'); + // return false; + // } else { $('#myModal1').modal('show'); diff --git a/application/views/servicePurchaseorder.php b/application/views/servicePurchaseorder.php index 8e8b7183..36dff57f 100755 --- a/application/views/servicePurchaseorder.php +++ b/application/views/servicePurchaseorder.php @@ -528,15 +528,15 @@ function ExceedQuantityCheck() var ReqAmount = parseFloat(ValuetoCheck); var BudAmount = parseFloat(budgetAmount); - if(ReqAmount > BudAmount ) - { - alert('Your exceeding the Avaiable Budget :'+ AvilBudAmt +'.Please adjust the Product to proceed further.'); - return false; - } - else - { + // if(ReqAmount > BudAmount ) + // { + // alert('Your exceeding the Avaiable Budget :'+ AvilBudAmt +'.Please adjust the Product to proceed further.'); + // return false; + // } + // else + // { return true; - } + //} } @@ -1001,6 +1001,26 @@ function clearEditTaxField() + + + + +
+ + 'Select','1'=>'REVENUE','2'=>'CAPITAL'); + echo form_dropdown('BudgetType', $optionsnew,set_value('BudgetType'),'id="BudgetType"' ,'required="true"' ,'class="form-control select2'); + + ?> + + +
+ + + + @@ -1707,7 +1727,8 @@ function clearEditTaxField() - + +   Save   Submit   Reset @@ -1748,6 +1769,21 @@ function clearEditTaxField() $('#otherdescription').hide(); var index = '1'; var userid = ''; + + +$("#BudgetType").change(function(){ + + var aa = $("#BudgetType option:selected").text(); + + $('#Budget').val(aa); + + +}); + + + + + $("#EDITSERVICE").on("shown.bs.modal", function(e) { userid = $(e.relatedTarget).data('userid'); @@ -2424,11 +2460,11 @@ var AvlBudAmt = ''; $('#Deliverydt').focus(); return false; } - else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) { - alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); + // else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) { + // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); - return false; - } + // return false; + // } else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){ alert('Please Enter Other Payable Terms Description'); $('#Otherpayment').focus();