diff --git a/application/controllers/emergencypurchaseorder.php b/application/controllers/emergencypurchaseorder.php index 5f718355..7dba8e08 100755 --- a/application/controllers/emergencypurchaseorder.php +++ b/application/controllers/emergencypurchaseorder.php @@ -91,7 +91,7 @@ class emergencypurchaseorder extends BaseController } //This used to Create Service Purchase Order - function addNewServicePurchaseOrder() + function addNewServicePurchaseOrder() { @@ -128,7 +128,7 @@ class emergencypurchaseorder extends BaseController $createddt = $dt->format('Y-m-d H:i:s'); $PaymentTerms=$this->input->post('PaymentMethod'); - + $OtherPayment=$this->input->post('Otherpayment'); $ServiceWorkStatus=$this->input->post('workStatus'); @@ -149,7 +149,7 @@ class emergencypurchaseorder extends BaseController // 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'=>$ServiceWorkStatus,'POType'=>$POType); + $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'=>$ServiceWorkStatus,'POType'=>$POType,'PaymentOtherDescription'=>$OtherPayment); $POMaster = $this->purchaseorder_model->addPOMaster($POList); $PONO = ''; @@ -288,7 +288,7 @@ class emergencypurchaseorder extends BaseController $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $createddt = $dt->format('Y-m-d H:i:s'); $PaymentTerms=$this->input->post('PaymentMethod'); - + $OtherPayment=$this->input->post('Otherpayment'); //add requistion @@ -302,7 +302,7 @@ class emergencypurchaseorder extends BaseController $RegNo = $Req[0]['ReqNo']; } // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate ); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>$POStatus,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'POType'=>$POType,'CapitalRange'=>$Local_Interstate,'PaymentOtherDescription'=>$OtherPayment); $POMaster = $this->purchaseorder_model->addPOMaster($POList); @@ -335,6 +335,7 @@ class emergencypurchaseorder 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); $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); $CostCenter = $this->input->post('costCode'.$i); @@ -381,7 +382,7 @@ class emergencypurchaseorder extends BaseController if(trim($POType) == REVENUE ) { // echo 'Success'; - $RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt, 'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst); + $RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt, 'CGST'=>$Cgst,'AfterCGST'=>$AfterCgst,'SGST'=>$Sgst,'AfterSGST'=>$AfterSgst,'IGST'=>$Igst,'AfterIGST'=>$AfterIgst,'NoOfTrip'=>$NOOfTrip); $RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList); //echo 'Revenue tax Success'; diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index e3bcfdff..eda744f2 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -2076,7 +2076,7 @@ function addNewImportPurchaseOrder() } $PaymentMethod = $this->input->post('PaymentMethod'); - + $OtherPayment=$this->input->post('Otherpayment'); @@ -2097,7 +2097,7 @@ function addNewImportPurchaseOrder() $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); + $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); // $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); @@ -2301,7 +2301,7 @@ function addNewImportPurchaseOrder() $ExchangeRate=$this->input->post('ExchangeRt'); } $PaymentMethod = $this->input->post('PaymentMethod'); - + $OtherPayment=$this->input->post('Otherpayment'); @@ -2323,7 +2323,7 @@ function addNewImportPurchaseOrder() $updateddt = $dt->format('Y-m-d H:i:s'); - $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); + $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); $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); diff --git a/application/views/EditservicePurchaseorder.php b/application/views/EditservicePurchaseorder.php index 09076dcb..d1e6defd 100755 --- a/application/views/EditservicePurchaseorder.php +++ b/application/views/EditservicePurchaseorder.php @@ -62,7 +62,7 @@ if(!empty($POMaster)) $DeliveryAddress =$Req->DeliveryAddress; $PONOStatus = $Req->StatusCode; - $PONO = $Req->PONO; + $PONO = $Req->PONO; $ServiceDescription = $Req->ServiceDescription; @@ -2728,6 +2728,8 @@ tinyMCE.triggerSave(); var splinstr = $('#ScopeOfWork').val(); $('#ScopeOfWork').val(splinstr); $('#txtDeliveryAddress').val(deladd); +var AvlBudAmt = ''; +var txtTotalOrderValueSummary = $('#txtTotalOrderValueSummary').val(); if(validate()) { @@ -2737,6 +2739,11 @@ $('#txtDeliveryAddress').val(deladd); $('#Deliverydt').focus(); return false; } + else 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'){ alert('Please Enter Other Payment Details'); $('#Otherpayment').focus(); diff --git a/application/views/alterpurchaseorder.php b/application/views/alterpurchaseorder.php index 27ed2433..b8283b75 100755 --- a/application/views/alterpurchaseorder.php +++ b/application/views/alterpurchaseorder.php @@ -1,4 +1,3 @@ - ; } else if(FreightType == '') - { - AfterFreight = ; + { + if($('#NOOfTrips').val()==''){ + alert('Please Enter No of Trip'); + + $("#NOOfTrips").focus(); + $('#txtFreight').val(0) + AfterFreight=0; + $('#txtAfterFreight').val("0.00"); + return false; + } + else{ + var noOftrip = $("#NOOfTrips").val(); + AfterFreight = ; + AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2); + } + + } else { AfterFreight = $("#txtFreight").val(); @@ -1480,7 +1552,20 @@ function calculatePackaging(isEdit) } else if(FreightType == '') { - AfterFreight = ; + if($('#EditNOOfTrips').val()==''){ + alert('Please Enter No of Trip'); + + $("#EditNOOfTrips").focus(); + $('#txtEditFreight').val(0) + AfterFreight=0; + $('#txtEditAfterFreight').val("0.00"); + return false; + } + else{ + var noOftrip = $("#EditNOOfTrips").val(); + AfterFreight = ; + AfterFreight = parseFloat(AfterFreight * noOftrip).toFixed(2); + } } else { AfterFreight = $("#txtEditFreight").val(); @@ -2978,7 +3063,7 @@ function populateValueMainFormForDeleteItem(rowid)