diff --git a/application/controllers/emergencypurchaseorder.php b/application/controllers/emergencypurchaseorder.php index 56370ad7..92248ad7 100644 --- a/application/controllers/emergencypurchaseorder.php +++ b/application/controllers/emergencypurchaseorder.php @@ -67,14 +67,9 @@ class emergencypurchaseorder extends BaseController $data['PoTypeOptions'] = $this->purchaseorder_model->getConfigValue('C026'); - if($this->DEPCode == PURCHASE ) - { + $this->loadViews("alterpurchaseorder", $this->global, $data, Null); - } - else - { - $this->loadViews("access", $this->global, $data, Null); - } + } @@ -679,14 +674,9 @@ class emergencypurchaseorder extends BaseController $data['POData'] = $this->purchaseorder_model->purchaseorderListing(); $this->global['pageTitle'] = 'Resico : Purchase Orders'; - if($this->DEPCode == PURCHASE ) - { + $this->loadViews("POlist", $this->global, $data, NULL); - } - else - { - $this->loadViews("access", $this->global, $data, NULL); - } + } /** diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 68eff5d5..465ca1a0 100644 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -8,7 +8,7 @@ require APPPATH . '/third_party/mpdf/mpdf.php'; * purchaseorder Class to control all po related operations. * @author : Venba InfoTech * @version : 1.1 - * @since : 18 November 2017 + * @since : 18 November 2017 */ class purchaseorder extends BaseController @@ -915,7 +915,7 @@ class purchaseorder extends BaseController $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'); @@ -931,7 +931,7 @@ class purchaseorder extends BaseController $POType = $this->input->post('POType'); - + $BudgetType = $this->input->post('Budget'); $Modeofshipment=$this->input->post('addmodeofshipment'); $supplierreference=$this->input->post('addsupplierreference'); @@ -961,8 +961,9 @@ class purchaseorder extends BaseController $PaymentTerms=$this->input->post('PaymentTerms'); $OtherPayment=$this->input->post('Otherpayment'); $Local_Interstate=$this->input->post('Range'); + $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); + $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); @@ -999,8 +1000,8 @@ class purchaseorder extends BaseController $FreightType = $this->input->post('FreightType'.$i); $FreightValue = $this->input->post('FreightVal'.$i); $AfterFreightValue = $this->input->post('AfterFreightVal'.$i); - $NOOfTrip = $this->input->post('NoOfTrip'.$i); - $InsuranceValue = $this->input->post('Insval'.$i); + $NOOfTrip = $this->input->post('NoOfTrip'.$i); + $InsuranceValue = $this->input->post('Insval'.$i); $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); $revenuedescription = $this->input->post('Service_Description'.$i); $CostCenter = $this->input->post('costCode'.$i); @@ -1093,7 +1094,7 @@ 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'); $POStatus = $this->input->post('txtStatus'); @@ -1109,9 +1110,12 @@ class purchaseorder extends BaseController $PaymentTerms=$this->input->post('PaymentTerms'); $OtherPayment=$this->input->post('Otherpayment'); $Local_Interstate=$this->input->post('Range'); + + $Qualitycheck=1; // 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); + $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); $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); $LineItemStatus = REQITEM_NEW; @@ -1240,6 +1244,7 @@ class purchaseorder extends BaseController $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR'); $data['reveuetax']=$this->purchaseorder_model->getRevenueTaxinforforpdf($PONO); + $data['AmendmentPDF'] = $this->purchaseorder_model->amendpdf($PONO); $Currencycode=''; $TotalOrderValue=$data['POItem'][0]->TotalOrderValue; @@ -1314,6 +1319,7 @@ $AdvanceAmount=0.00; $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformationforPDF(); $data['GetPoFormat'] = $this->purchaseorder_model->GetPoFormat($PONO); $data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetailsForpdf($PONO); + $data['AmendmentPDF'] = $this->purchaseorder_model->amendpdf($PONO); $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); @@ -1410,6 +1416,8 @@ public function importpoprint($PONO) $data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetailsForPDF($PONO); $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); + $data['AmendmentPDF'] = $this->purchaseorder_model->amendpdf($PONO); + $data['RequistionDetails'] = $this->purchaseorder_model->GetPdfRequistionDetails($PONO); foreach ($data['POItem'] as $Reqdby) @@ -1497,7 +1505,7 @@ public function importpoprint($PONO) $mpdf->showWatermarkImage = true; $mpdf->SetDisplayMode('fullpage'); - if($PoStatus == PO_RELEASED || $PoStatus == PO_SERVICE_COMPLETED || $PoStatus == MRIR_APPROVED || $PoStatus == MRIR_REJECTED || $PoStatus == IGR_CREATED || $PoStatus==''){ + if($PoStatus == PO_RELEASED || $PoStatus == PO_SERVICE_COMPLETED || $PoStatus == MRIR_APPROVED || $PoStatus == MRIR_REJECTED || $PoStatus == IGR_CREATED || $PoStatus==''||$PoStatus==SPECIAL_PO){ $mpdf->SetWatermarkText(''); } @@ -1611,6 +1619,7 @@ function addNewImportPurchaseOrder() $POStatus = $this->input->post('textStatus'); + $BudgetType = $this->input->post('Budget'); $CreateBy = $this->session->userdata ( 'userId' ); $RowCount = $this->input->post('txtRowCount'); @@ -1653,8 +1662,11 @@ 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,'BudgetType'=>$BudgetType $POMaster = $this->purchaseorder_model->addPOMaster($POList,$POType,$importoption); @@ -1813,6 +1825,8 @@ function addNewImportPurchaseOrder() $TotalOrder = $this->input->post('txttot'); $POStatus = $this->input->post('txtStatus'); + $BudgetType = $this->input->post('Budget'); + $CreateBy = $this->session->userdata ( 'userId' ); $RowCount = $this->input->post('txtRowCount'); @@ -1850,9 +1864,10 @@ function addNewImportPurchaseOrder() { $Insurancenumber=''; $insurestatus='0'; - } + } + $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); + $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); $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); @@ -2031,15 +2046,15 @@ function addNewImportPurchaseOrder() $userID = $this->session->userdata ( 'userId' ); $data['AppList'] = $this->purchaseorder_model->getPOList($q); - if($this->DEPCode == FINANCE) - { + // if($this->DEPCode == FINANCE) + // { $this->loadViews("poapproval_view", $this->global,$data, NULL); - } + // } - else - { - $this->loadViews("access", $this->global, $data, NULL); - } + // else + // { + // $this->loadViews("access", $this->global, $data, NULL); + // } } @@ -2102,14 +2117,14 @@ function addNewImportPurchaseOrder() $userID = $this->session->userdata ( 'userId' ); $data['AppList'] = $this->purchaseorder_model->getPOList($q); - if($this->DEPCode == MANAGEMENT) - { + //if($this->DEPCode == MANAGEMENT) + // { $this->loadViews("porelease_view", $this->global,$data, NULL); - } - else - { - $this->loadViews("access", $this->global, $data, NULL); - } + // } + // else + // { + // $this->loadViews("access", $this->global, $data, NULL); + // } } @@ -2208,6 +2223,8 @@ function addNewImportPurchaseOrder() $PaymentMethod = $this->input->post('PaymentMethod'); $OtherPayment=$this->input->post('Otherpayment'); + $BudgetType = $this->input->post('Budget'); + @@ -2227,8 +2244,11 @@ function addNewImportPurchaseOrder() $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $createddt = $dt->format('Y-m-d H:i:s'); $currencytypeID = $this->input->post('currencytype'); - - $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); + + + $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,'BudgetType'=>$BudgetType); @@ -2470,9 +2490,10 @@ function addNewImportPurchaseOrder() $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $createddt = $dt->format('Y-m-d H:i:s'); $updateddt = $dt->format('Y-m-d H:i:s'); - + $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); + + $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); @@ -2665,6 +2686,8 @@ function addNewImportPurchaseOrder() $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformationforPDF(); $data['GetPoFormat'] = $this->purchaseorder_model->GetPoFormat($PONO); $data['POItem'] = $this->purchaseorder_model->GetCapitalPurchaseOrderDetailsForPDF($PONO); + + $data['AmendmentPDF'] = $this->purchaseorder_model->amendpdf($PONO); $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); $CurrencyType=''; diff --git a/application/controllers/storestatus.php b/application/controllers/storestatus.php index 748ded91..09ac8e65 100644 --- a/application/controllers/storestatus.php +++ b/application/controllers/storestatus.php @@ -50,14 +50,9 @@ class storestatus extends BaseController $data['Stock'] = $this->store_model->viewStock(); $data['MaterialList'] = $this->store_model->GetAllMaterialList(); $data['StockStatus'] = $this->store_model->GetConfigValue('C021'); - if($this->DEPCode == STORE) - { + $this->loadViews("storestatus", $this->global, $data,null); - } - else - { - $this->loadViews("access", $this->global, $data,null); - } + } diff --git a/application/controllers/supplier.php b/application/controllers/supplier.php index 43b8029c..caebf32c 100644 --- a/application/controllers/supplier.php +++ b/application/controllers/supplier.php @@ -47,22 +47,10 @@ class supplier extends BaseController $this->global['pageTitle'] = 'Resico : Supplier Listing'; - if($this->role == ROLE_ADMIN || $this->DEPCode == SALES || $this->DEPCode == FINANCE ||$this->DEPCode == HR) - { - - if($this->DEPCode != FINANCE && $this->DEPCode != HR) - { + //Load the view supplierListing.php $this->loadViews("supplierListing", $this->global, $data, NULL); - - } - } - - else - { - //Load the view access.php - $this->loadViews("access", $this->global, $data, NULL); - } + } @@ -74,21 +62,11 @@ class supplier extends BaseController $data['payment'] = $this->supplier_model->getPaymentTerms(); $this->global['pageTitle'] = 'Resico : Add New Supplier'; - if($this->role == ROLE_ADMIN || $this->DEPCode == SALES || $this->DEPCode == FINANCE ||$this->DEPCode == HR) - { - if($this->DEPCode != FINANCE && $this->DEPCode != HR) - { + //Load the view addsupplier.php $this->loadViews("addsupplier", $this->global,$data, NULL); - } - } - - else - { - //Load the view access.php - $this->loadViews("access", $this->global,$data, NULL); - } + } @@ -464,22 +442,11 @@ class supplier extends BaseController $data['supplier'] = $this->supplier_model->getSupplierInfo($supplierID); $data['payment'] = $this->supplier_model->getPaymentTerms($Payment); $this->global['pageTitle'] = 'Resico : Edit Supplier'; - if($this->role == ROLE_ADMIN || $this->DEPCode == SALES || $this->DEPCode == FINANCE ||$this->DEPCode == HR) - { - - if($this->DEPCode != FINANCE && $this->DEPCode != HR) - { + //Load the view editSupplier.php $this->loadViews("editSupplier", $this->global,$data, NULL); - } - } - - else - { - //Load the view access.php - $this->loadViews("access", $this->global,$data, NULL); - } + } /** diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index d67199b5..ad48acca 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -18,7 +18,7 @@ class purchaseorder_model extends CI_Model $query = $this->db->get(); - return $query->result(); + return $query->result(); } @@ -185,6 +185,19 @@ function purchaseorderListing($forwhat='') return $query->result(); } + + + + function getqtycheck($PONO) + { + $this->db->select('IsQualityChkReqired'); + $this->db->from('T_PurchaseOrder_Master'); + $this->db->where('PONO',$PONO); + $query = $this->db->get(); + + return $query->result(); + + } /** * This function is used to get the Raw Material information * @return array $result : This is result of the query diff --git a/application/views/capitalpurchaseorder.php b/application/views/capitalpurchaseorder.php index 8208bf7e..b3c719c7 100644 --- a/application/views/capitalpurchaseorder.php +++ b/application/views/capitalpurchaseorder.php @@ -255,7 +255,15 @@ function vaildateBeforeOpenModal() $('#PoTypeOptions').focus(); return false; } + + else if($('#BudgetType').val()=="0") + { + alert('Please Select Budget Type'); + $('#BudgetType').focus(); + return false; + + } else if($('#Deliverydt').val() == '' && $('#Scheduleby').val() == '') { alert('Please Enter the Dispatch Instruction'); @@ -736,6 +744,18 @@ function vaildateBeforeOpenModal() + + +
+ + 'Select','1'=>'REVENUE','2'=>'CAPITAL'); + echo form_dropdown('BudgetType', $optionsnew,set_value('BudgetType'),'id="BudgetType"' ,'required="true"' ,'class="form-control select2'); + + ?> +
@@ -2525,10 +2545,8 @@ function vaildateBeforeOpenModal() - - - - + +   Save   Submit   Reset @@ -2604,6 +2622,16 @@ function vaildateBeforeOpenModal() }; + $("#BudgetType").change(function(){ + + var aa = $("#BudgetType option:selected").text(); + + $('#Budget').val(aa); + + +}); + + $(function() { $("#PODate").datepicker({ @@ -3501,16 +3529,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 */ @@ -3759,16 +3787,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() @@ -4674,11 +4702,16 @@ 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; - } + else if($('#PoTypeOptions').val()== "0") + { + alert('Please Select POType'); + $('#PoTypeOptions').focus(); + return false; + + } else { $('#content').loader('show'); @@ -5266,16 +5299,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/importpo.php b/application/views/importpo.php index d2374900..fa5609ff 100644 --- a/application/views/importpo.php +++ b/application/views/importpo.php @@ -230,6 +230,13 @@ function vaildateBeforeOpenModal() return false; } + else if($('#BudgetType').val()=="0") + { + alert('Please Select Budget Type'); + $('#BudgetType').focus(); + return false; + + } @@ -677,9 +684,20 @@ function vaildateBeforeOpenModal() + +
+ + 'Select','1'=>'REVENUE','2'=>'CAPITAL'); + echo form_dropdown('BudgetType', $optionsnew,set_value('BudgetType'),'id="BudgetType"' ,'required="true"' ,'class="form-control select2'); + + ?>
+ @@ -2024,7 +2042,8 @@ echo form_textarea($data); - + +   Save   Submit @@ -2096,7 +2115,14 @@ $(document).on('change',".changetodecimal", function(){ }); +$("#BudgetType").change(function(){ + var aa = $("#BudgetType option:selected").text(); + + $('#Budget').val(aa); + + +}); var SelectedMaterialCode = []; var RequistQuantity = ''; var AvilBudAmt = ''; @@ -2291,6 +2317,15 @@ $("#txtBasicValue").val(''); var Material = ; var AvlBudAmt =''; + if(AvlBudAmt == '') + { + $("#AvlBudAmt").val(parseFloat(0).toFixed(2)); + } + + else + { + $("#AvlBudAmt").val(parseFloat(AvlBudAmt).toFixed(2)); + } //alert(Material); // For Binding DepartmentName @@ -2304,7 +2339,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) { @@ -2672,16 +2707,16 @@ function validateEditExceedLimit() exp=basicAmountRate*exchangerate; //console.log(exp); - if(exp > avalbudAmte || totalAmount > avalbudAmte) - { - swal('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#EditRate').focus(); - return false; - } - else - { + // if(exp > avalbudAmte || totalAmount > avalbudAmte) + // { + // swal('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#EditRate').focus(); + // return false; + // } + // else + // { return true; - } + // } } @@ -2704,16 +2739,16 @@ var avalbudAmt= ; exp=basicAmountRate*exchangerate; //console.log(exp); - if(exp > avalbudAmt || totalAmount > avalbudAmt) - { - swal('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#Rate').focus(); - return false; - } - else - { + // if(exp > avalbudAmt || totalAmount > avalbudAmt) + // { + // swal('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#Rate').focus(); + // return false; + // } + // else + // { return true; - } + // } } @@ -3353,7 +3388,14 @@ $('#drpFreight').change(function() { { $('#TripsValue').show(); - } + } } + + + else if($('#Importoption').val()== "0") + { + alert('Please Select POType'); + $('#Importoption').focus(); + return false; else { $('#TripsValue').hide(); @@ -4538,7 +4580,15 @@ if(validate()&&Budgetcheck()) swal('Please Select Line item to Create PO'); $('#Deliverydt').focus(); return false; - } + } + + + else if($('#Importoption').val()== "0") + { + alert('Please Select POType'); + $('#Importoption').focus(); + return false; + } else { diff --git a/application/views/purchaseorder.php b/application/views/purchaseorder.php index 3afdd957..dda61996 100644 --- a/application/views/purchaseorder.php +++ b/application/views/purchaseorder.php @@ -180,7 +180,14 @@ function vaildateBeforeOpenModal() $('#PoTypeOptions').focus(); return false; } - + else if($('#BudgetType').val()=="0") + { + swal('Please Select Budget Type'); + $('#BudgetType').focus(); + return false; + + } + else { return true; @@ -2128,16 +2135,16 @@ function validateEditExceedLimit() //swal(basicAmountRate); // var totalAmount = parseFloat($('#txtEditTotalOrderValue').val()); - if(basicAmountRate > avalbudAmt)// || totalAmount > avalbudAmt) - { - swal('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); - $('#EditRate').focus(); - return false; - } - else - { + // if(basicAmountRate > avalbudAmt)// || totalAmount > avalbudAmt) + // { + // swal('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); + // $('#EditRate').focus(); + // return false; + // } + // else + // { return true; - } + // } } function calculateEditTotalValue() @@ -2432,8 +2439,8 @@ function calculateEditTaxValue()
- - + +
+ + +
+ + 'Select','1'=>'REVENUE','2'=>'CAPITAL'); + echo form_dropdown('BudgetType', $optionsnew,set_value('BudgetType'),'id="BudgetType"' ,'required="true"' ,'class="form-control select2'); + + ?> + + +
@@ -3578,7 +3599,8 @@ function calculateEditTaxValue() - + +   Save   Submit   Reset @@ -3635,7 +3657,14 @@ $("#insurance").change(function(){ $("#insurancenodiv").show(); $("#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'); @@ -3752,7 +3781,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(); @@ -4270,11 +4299,11 @@ var AvlBudAmt = ''; $('#Deliverydt').focus(); return false; } - else if(parseInt(AvlBudAmt) < parseInt(finalBasicAmount)) { - swal('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); + // else if(parseInt(AvlBudAmt) < parseInt(finalBasicAmount)) { + // swal('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); - return false; - } + // return false; + // } else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){ swal('Please Enter Payable Terms Description'); $('#Otherpayment').focus(); @@ -4285,6 +4314,15 @@ var AvlBudAmt = ''; $('#insurance').focus(); return false; } + + + else if($('#PoTypeOptions').val()=="0") + { + alert('Please Select POType'); + $('#PoTypeOptions').focus(); + return false; + + } else { diff --git a/application/views/servicePurchaseorder.php b/application/views/servicePurchaseorder.php index c54e7830..302fa245 100644 --- a/application/views/servicePurchaseorder.php +++ b/application/views/servicePurchaseorder.php @@ -516,15 +516,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; - } + // } } @@ -989,6 +989,20 @@ function clearEditTaxField() + + + +
+ + 'Select','1'=>'REVENUE','2'=>'CAPITAL'); + echo form_dropdown('BudgetType', $optionsnew,set_value('BudgetType'),'id="BudgetType"' ,'required="true"' ,'class="form-control select2'); + + ?> +
+ @@ -1684,7 +1698,8 @@ function clearEditTaxField() - + +   Save   Submit   Reset @@ -1721,8 +1736,19 @@ function clearEditTaxField()