diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 786eeca0..6f0b94f7 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -2027,13 +2027,13 @@ function addNewImportPurchaseOrder() } } /* Add capital Po*/ - function addNewCapitalPurchaseOrder() + function addNewCapitalPurchaseOrder() { $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('Deliverydate'); @@ -2090,6 +2090,14 @@ function addNewImportPurchaseOrder() $ExchangeRate=$this->input->post('ExchangeRt'); $Palaceoforigin=$this->input->post('PlaceOforigin'); } + $ModeOfShipment=$this->input->post('addmodeofshipment'); + $SupplierReference=$this->input->post('addsupplierreference'); + $SuppliersOfferNo=$this->input->post('addsupplierofferno'); + $OtherReferences=$this->input->post('addotherreference'); + $Fincap=$this->input->post('addfincap'); + $InsuranceOptions=$this->input->post('insuranceStatus'); + $InsuranceNo=$this->input->post('insuranceNo'); + $ServiceTypeOptions=$this->input->post('PoTypeOptions'); $PaymentMethod = $this->input->post('PaymentMethod'); $OtherPayment=$this->input->post('Otherpayment'); @@ -2113,7 +2121,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,'PaymentOtherDescription'=>$OtherPayment); + $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); // $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); @@ -2135,9 +2143,7 @@ function addNewImportPurchaseOrder() $Quantity = $this->input->post('quantity'.$i); $Reqnumber = $this->input->post('Reqnumber'.$i); $itemRate = $this->input->post('itemRate'.$i); - //echo $itemRate; - //die(); - + $BasicPriceinmton = $this->input->post('rateInUs'.$i); $Productprice = $this->input->post('basicvalInINR'.$i); @@ -2173,7 +2179,10 @@ function addNewImportPurchaseOrder() $CustomDutyExpensesPerKG = $this->input->post('CustomDutyExpenses'.$i); $RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i); $QuantityKG = $this->input->post('PurQuantity'.$i); - + $FreightType = $this->input->post('FreightType'.$i); + $FreightValue = $this->input->post('FreightVal'.$i); + $AfterFreightValue = $this->input->post('AfterFreightVal'.$i); + $NOOfTrip = $this->input->post('NoOfTrip'.$i); $Totalvalueitem=$this->input->post('PerKgExpense'.$i); @@ -2187,8 +2196,12 @@ function addNewImportPurchaseOrder() $AfterCgst = $this->input->post('AfterCgst'.$i); $AfterSgst = $this->input->post('AfterSgst'.$i); $AfterIgst = $this->input->post('AfterIgst'.$i); - + $DiscountType = $this->input->post('DisType'.$i); + $DiscountValue = $this->input->post('DisVal'.$i); + $AfterDiscount = $this->input->post('AfterDisVal'.$i); $OtherAmt = $this->input->post('OtherAmt'.$i); + $CapitalItemDescription = $this->input->post('CapitalItemDescrition'.$i); + $Per = $this->input->post('per'.$i); $SkipInsert = "False"; if( count($comma_separated) > 0) { @@ -2206,7 +2219,7 @@ function addNewImportPurchaseOrder() } if($SkipInsert == "False") { - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter); + $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter,'ServiceMaterialDescription'=>$CapitalItemDescription,'Per'=>$Per); $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); @@ -2215,25 +2228,22 @@ function addNewImportPurchaseOrder() { $LineItemNo = $POLineItem[0]['LineItemNo']; } - //echo $LineItemNo; + if(trim($POType) == CAPITAL ) { if($CapitalRange=='1') { - $ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'CGST'=>$Cgst,'After_CGST'=>$AfterCgst,'SGST'=>$Sgst,'After_SGST'=>$AfterSgst,'IGST'=>$Igst,'After_IGST'=>$AfterIgst,'otherallowance'=>$OtherAmt,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt); + $ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'CGST'=>$Cgst,'After_CGST'=>$AfterCgst,'SGST'=>$Sgst,'After_SGST'=>$AfterSgst,'IGST'=>$Igst,'After_IGST'=>$AfterIgst,'otherallowance'=>$OtherAmt,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'discount'=>$DiscountType,'discountval'=>$DiscountValue,'Afterdiscountval'=>$AfterDiscount); $ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList); } if($CapitalRange=='0') { - //echo "dsc"; - //die(); - $ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem); + + $ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem,'FreightType'=>$FreightType,'NoOfTrip'=>$NOOfTrip,'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue); - //print_r( $ImportTaxList); - //die(); $ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList); @@ -2326,7 +2336,14 @@ function addNewImportPurchaseOrder() $TotalOrder = $this->input->post('CapitalToatlOrder'); $POStatus = $this->input->post('txtStatus'); $Palaceoforigin=$this->input->post('PlaceOforigin'); - + $ModeOfShipment=$this->input->post('editmodeofshipment'); + $SupplierReference=$this->input->post('editsupplierreference'); + $SuppliersOfferNo=$this->input->post('editsupplierofferno'); + $OtherReferences=$this->input->post('editotherreference'); + $Fincap=$this->input->post('editfincap'); + $InsuranceOptions=$this->input->post('insuranceStatus'); + $InsuranceNo=$this->input->post('insuranceNo'); + $ServiceTypeOptions=$this->input->post('PoTypeOptions'); $CreateBy = $this->session->userdata ( 'userId' ); $RowCount = $this->input->post('txtRowCount'); @@ -2340,7 +2357,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,'PaymentOtherDescription'=>$OtherPayment); + $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); $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); @@ -2409,7 +2426,17 @@ function addNewImportPurchaseOrder() $AfterSgst = $this->input->post('AfterSgst'.$i); $AfterIgst = $this->input->post('AfterIgst'.$i); - $OtherAmt = $this->input->post('OtherAmt'.$i); + $OtherAmt = $this->input->post('OtherAmt'.$i); + $DiscountType = $this->input->post('DisType'.$i); + $DiscountValue = $this->input->post('DisVal'.$i); + $AfterDiscount = $this->input->post('AfterDisVal'.$i); + $OtherAmt = $this->input->post('OtherAmt'.$i); + $CapitalItemDescription = $this->input->post('CapitalItemDescrition'.$i); + $Per = $this->input->post('per'.$i); + $FreightType = $this->input->post('FreightType'.$i); + $FreightValue = $this->input->post('FreightVal'.$i); + $AfterFreightValue = $this->input->post('AfterFreightVal'.$i); + $NOOfTrip = $this->input->post('NoOfTrip'.$i); $SkipInsert = "False"; if( count($comma_separated) > 0) { @@ -2429,7 +2456,7 @@ function addNewImportPurchaseOrder() { if(strlen($POLineItemNo) == 0) { - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter); + $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter,'ServiceMaterialDescription'=>$CapitalItemDescription,'Per'=>$Per); $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); @@ -2444,13 +2471,13 @@ function addNewImportPurchaseOrder() { if($capitalType=='1') { - $ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'CGST'=>$Cgst,'After_CGST'=>$AfterCgst,'SGST'=>$Sgst,'After_SGST'=>$AfterSgst,'IGST'=>$Igst,'After_IGST'=>$AfterIgst,'otherallowance'=>$OtherAmt,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt); + $ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'CGST'=>$Cgst,'After_CGST'=>$AfterCgst,'SGST'=>$Sgst,'After_SGST'=>$AfterSgst,'IGST'=>$Igst,'After_IGST'=>$AfterIgst,'otherallowance'=>$OtherAmt,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'discount'=>$DiscountType,'discountval'=>$DiscountValue,'Afterdiscountval'=>$AfterDiscount); $ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList); } if($capitalType=='0') { - $ImportTaxList = array('LineItemNo'=>$LineItemNo, 'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem); + $ImportTaxList = array('LineItemNo'=>$LineItemNo, 'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem,'FreightType'=>$FreightType,'NoOfTrip'=>$NOOfTrip,'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue); $ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList); } @@ -2465,17 +2492,17 @@ function addNewImportPurchaseOrder() - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter); + $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter,'ServiceMaterialDescription'=>$CapitalItemDescription,'Per'=>$Per); $POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$LineItemNo,$POLineItemList); if($capitalType=='1') { - $ServiceTaxList = array('CGST'=>$Cgst,'After_CGST'=>$AfterCgst,'SGST'=>$Sgst,'After_SGST'=>$AfterSgst,'IGST'=>$Igst,'After_IGST'=>$AfterIgst,'otherallowance'=>$OtherAmt,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$CreateBy,'UpdatedOn'=>$createddt); + $ServiceTaxList = array('CGST'=>$Cgst,'After_CGST'=>$AfterCgst,'SGST'=>$Sgst,'After_SGST'=>$AfterSgst,'IGST'=>$Igst,'After_IGST'=>$AfterIgst,'otherallowance'=>$OtherAmt,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$CreateBy,'UpdatedOn'=>$createddt,'discount'=>$DiscountType,'discountval'=>$DiscountValue,'Afterdiscountval'=>$AfterDiscount); $ServiceTax = $this->purchaseorder_model->updateServiceTax($LineItemNo,$ServiceTaxList); } if($capitalType=='0') { - $ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem); + $ImportTaxList = array('LineItemNo'=>$LineItemNo,'BasicPriceInMTon'=>$BasicPriceinmton,'ProductPrice'=>$Productprice,'LandingCharge'=>$LandingCharge,'AfterLandingCharge'=>$AfterLandingCharge,'AfterHighSeasSalesCharge'=>$AfterHighSeas,'HighSeasSalesCharge'=>$HighSeas,'CustomDuty'=>$CustomDuty,'AfterCustomDuty'=>$AfterCustomDuty,'ExciseDuty'=>$ExciseDuty,'AfterExciseDuty'=>$AfterExciseDuty,'ExciseDutyEdCess'=>$ExciseDutyEd,'AfterExciseDutyEdCess'=>$AfterExciseDutyEd,'ExciseDutySHCess'=>$ExciseDutySH,'CustomEdCess'=>$CustomEd,'CustomSHCess'=>$CustomSH,'AddlExciseDuty'=>$AddAdtional,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem,'FreightType'=>$FreightType,'NoOfTrip'=>$NOOfTrip,'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue); $ImportList= $this->purchaseorder_model->updateImportTax($LineItemNo,$ImportTaxList); diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index 2129301d..75d10f38 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -1298,9 +1298,9 @@ function GetCurrencytype() function getCapitalPurchaseOrderDetails($PONO = '') { - $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,LineItem.ServiceFrequency, + $subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.Per,LineItem.ServiceMaterialDescription,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,LineItem.ServiceFrequency, Mat.UOM,Quantity,ReceivedQuantity,Rate,Req.Status, - ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((POMast.ExchangeRate*BasicPriceInMTon*Quantity),2) as BasicINRValue,Tax.TotalValue as ImportTotalValue,POMast.CurrencyType, + ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((POMast.ExchangeRate*BasicPriceInMTon*Quantity),2) as BasicINRValue,Tax.TotalValue as ImportTotalValue,Tax.FreightType,Tax.NoOfTrip,Tax.FreightValue,Tax.AfterFreightValue,POMast.CurrencyType, Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO @@ -1362,9 +1362,9 @@ join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode function getDomesticCapitalPurchaseOrderDetails($PONO = '') { - $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,LineItem.ServiceFrequency, + $subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.Per,LineItem.ServiceMaterialDescription,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,LineItem.ServiceFrequency, Mat.UOM,Quantity,ReceivedQuantity,Rate,Req.Status,ROUND((ServiceTax.After_CGST + ServiceTax.After_SGST + ServiceTax.After_IGST + ServiceTax.otherallowance),2) as ServiceTaxamount - ,ServiceTax.TotalValue,ServiceTax.CGST,ServiceTax.After_CGST,ServiceTax.SGST,ServiceTax.After_SGST,ServiceTax.IGST,ServiceTax.After_IGST,ServiceTax.otherallowance, + ,ServiceTax.TotalValue,ServiceTax.CGST,ServiceTax.After_CGST,ServiceTax.SGST,ServiceTax.After_SGST,ServiceTax.IGST,ServiceTax.After_IGST,ServiceTax.otherallowance,ServiceTax.discount,ServiceTax.discountval,ServiceTax.Afterdiscountval, POMast.ExchangeRate,POMast.ExchangeRateCalculatedon,POMast.TotalOrderValue as BasicValue,POMast.CapitalRange,ROUND((POMast.TotalOrderValue),2) as BasicINRValue,POMast.CurrencyType, Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem diff --git a/application/views/capitalpurchaseorder.php b/application/views/capitalpurchaseorder.php index 69dea7ed..873a264a 100755 --- a/application/views/capitalpurchaseorder.php +++ b/application/views/capitalpurchaseorder.php @@ -1,4 +1,8 @@ - "NO","value"=>"0"),array("name"=>"YES","value"=>"1") + ); + $ReqType =''; $CompanyAddress = ''; $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $CurrentDate = $dt->format('d-m-Y'); @@ -80,11 +84,12 @@ if(!empty($INRSYMBOL)) z-index: 1080 !important; } + - + - + + diff --git a/application/views/editCapitalPo.php b/application/views/editCapitalPo.php index 56391f40..f7cb4cd3 100755 --- a/application/views/editCapitalPo.php +++ b/application/views/editCapitalPo.php @@ -1,5 +1,7 @@ "NO","value"=>"0"),array("name"=>"YES","value"=>"1") + ); $requestedBy=$requestedBy[0]->FirstName; $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $CurrentDate = $dt->format('d-m-Y'); @@ -66,6 +68,15 @@ $ExitTotalOrderValue=0; $ExitExchangeRate=''; + + $ModeOfShipment=''; + $SupplierReference=''; + $SuppliersOfferNo=''; + $OtherReferences=''; + $Fincap=''; + $InsuranceOptions=''; + $InsuranceNo=''; + $ServiceTypeOptions=''; if(!empty($INRSYMBOL)) { foreach ($INRSYMBOL as $INR) @@ -133,6 +144,15 @@ if(!empty($POMaster)) else{ $ExitTotalOrderValue=$Req->TotalOrderValue; } + + $ModeOfShipment=$Req->Mode_Of_Shipment; + $SupplierReference=$Req->Supplier_Reference; + $SuppliersOfferNo=$Req->Supplier_Offer_No; + $OtherReferences=$Req->Other_Reference; + $Fincap=$Req->Fincap; + $InsuranceOptions=$Req->InsuranceStatus; + $InsuranceNo=$Req->InsuranceNumber; + $ServiceTypeOptions=$Req->POSubType; } @@ -180,6 +200,28 @@ if(!empty($AvlBudAmt)) statusbar: false, toolbar: false }); + tinymce.init({ + selector: "textarea#ItemDescription", + menubar: false, + statusbar: false, + toolbar: false + }); + tinymce.init({ + selector: "textarea#EditItemDescription", + menubar: false, + statusbar: false, + toolbar: false + }); + tinymce.init({ + selector: "textarea#ViewItemDescription", + menubar: false, + statusbar: false, + toolbar: false, + readonly : 1 + }); + + +var insuranceOpt = ''; var DelOpt = ''; var SchName = ; var DelDt = ''; @@ -187,6 +229,12 @@ var DelDt = ''; $(document).ready(function () { $("#PaymentTerms").select2(); + if(insuranceOpt=="1"){ + +} +else{ +$('#insuranceTxtDiv').hide(); +} if(DelOpt=="0"){ $('#Deliverydtdiv').hide(); $('#Schedulediv').hide(); @@ -575,7 +623,7 @@ $("#PaymentMethod").select2();
'editmodeofshipment','value' => set_value('editmodeofshipment'),'id'=>'editmodeofshipment', 'class' => 'form-control'); + $data = array('name' => 'editmodeofshipment','value' => set_value('editmodeofshipment',$ModeOfShipment),'id'=>'editmodeofshipment', 'class' => 'form-control'); echo form_input($data); ?>
@@ -591,7 +639,7 @@ $("#PaymentMethod").select2();
'editsupplierreference','value' => set_value('editsupplierreference'),'id'=>'editsupplierreference', 'class' => 'form-control'); + $data = array('name' => 'editsupplierreference','value' => set_value('editsupplierreference',$SupplierReference),'id'=>'editsupplierreference', 'class' => 'form-control'); echo form_input($data); ?>
@@ -607,8 +655,9 @@ $("#PaymentMethod").select2();
'editsupplierofferno','value' => set_value('editsupplierofferno'),'id'=>'editsupplierofferno', 'class' => 'form-control'); + $data = array('name' => 'editsupplierofferno','value' => set_value('editsupplierofferno',$SuppliersOfferNo),'id'=>'editsupplierofferno', 'class' => 'form-control'); echo form_input($data); + ?>
@@ -621,7 +670,7 @@ $("#PaymentMethod").select2();
'editotherreference','value' => set_value('editotherreference'),'id'=>'editotherreference', 'class' => 'form-control'); + $data = array('name' => 'editotherreference','value' => set_value('editotherreference',$OtherReferences),'id'=>'editotherreference', 'class' => 'form-control'); echo form_input($data); ?>
@@ -631,7 +680,7 @@ $("#PaymentMethod").select2();
'editfincap','value' => set_value('editfincap'),'id'=>'editfincap', 'class' => 'form-control'); + $data = array('name' => 'editfincap','value' => set_value('editfincap',$Fincap),'id'=>'editfincap', 'class' => 'form-control'); echo form_input($data); ?>
@@ -640,6 +689,99 @@ $("#PaymentMethod").select2(); + +
+
+
+
+ + + +
+ + 'Select Work Status'); + + + if(!empty($PoTypeOptions)) + { + foreach ($PoTypeOptions as $POpt): + + if($ServiceTypeOptions==$POpt->ConfigValue){ + $optionsPO[$POpt->ConfigValue] = $POpt->ConfigValue; + } + endforeach; + foreach ($PoTypeOptions as $POpt1): + + if($ServiceTypeOptions!=$POpt1->ConfigValue){ + $optionsPO[$POpt1->ConfigValue] = $POpt1->ConfigValue; + } + endforeach; + } + + echo form_dropdown('PoTypeOptions', $optionsPO,set_value('PoTypeOptions'),'id="PoTypeOptions"' ,'required="true"' ,'class="form-control select2'); + + + ?> +
+ + + +
+
+
+
+
+ +
+ + +
+ + + + +
+
+
+ +
+ 'insuranceNo','value' => set_value('insuranceNo',$InsuranceNo),'id'=>'insuranceNo', 'class' => 'form-control' ,'required' => 'true'); + echo form_input($data); + ?> +
+
+ +
+
+
@@ -692,11 +834,12 @@ $("#PaymentMethod").select2();
- +
+
@@ -726,6 +869,7 @@ $("#PaymentMethod").select2(); { $index = 0; $totalCapitalOrder=0; + $TotalDiscountedAmt=0; foreach($POItem as $record) { $index = $index + 1; @@ -764,6 +908,8 @@ $("#PaymentMethod").select2(); + + @@ -778,11 +924,16 @@ $("#PaymentMethod").select2(); - + + + - + + + + @@ -834,6 +985,9 @@ $("#PaymentMethod").select2(); + + + @@ -857,6 +1011,7 @@ $("#PaymentMethod").select2(); $TotalIgst = $TotalIgst + $record->After_IGST; $OtherAmt = $OtherAmt + $record->otherallowance; $TotalSummary = $TotalSummary+$record->ServiceTaxamount; + $TotalDiscountedAmt = $TotalDiscountedAmt + $record->Afterdiscountval; } $TotalBasicAmount = $TotalBasicAmount+$record->BasicValue; $ServiceDescription = $ServiceDescription; @@ -882,7 +1037,7 @@ $("#PaymentMethod").select2(); // $totorder=$totorder+$record->TotalOrderValue; - $totalCapitalOrder = $totalCapitalOrder+$record->Rate * $record->Quantity; + $totalCapitalOrder = $totalCapitalOrder+$record->Rate * $record->Quantity-$TotalDiscountedAmt; @@ -1016,7 +1171,7 @@ $("#PaymentMethod").select2();
'CPQuantity','value' => set_value('CPQuantity'),'id'=>'CPQuantity', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'Ratechange();'); + $data = array('name' => 'CPQuantity','value' => set_value('CPQuantity'),'id'=>'CPQuantity', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'Ratechange();calculateFreight(3);'); echo form_input($data); ?>
@@ -1025,7 +1180,7 @@ $("#PaymentMethod").select2();
'CPRate','value' => set_value('CPRate'),'id'=>'CPRate', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'Ratechange();' ); + $data = array('name' => 'CPRate','value' => set_value('CPRate'),'id'=>'CPRate', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'Ratechange();calculateFreight(3);' ); echo form_input($data); ?>
@@ -1049,6 +1204,49 @@ $("#PaymentMethod").select2();
+
+
+
+ +
+ 'Select Discount Type'); + //print_r( $options); + + if(!empty($TaxType)) + { + foreach ($TaxType as $SID): + + + $options[$SID->ConfigValue] = $SID->ConfigValue; + + endforeach; + } + + echo form_dropdown('DiscountType', $options,set_value('DiscountType'),'id="DiscountType"' ,'class="form-control"'); + + ?> +
+
+
+ +
+ 'txtDiscount','value' => set_value('txtDiscount'),'id'=>'txtDiscount', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);' ,'onchange'=>'calculateDiscount(0);'); + echo form_input($data); + ?> +
+
+
+ +
+ 'txtAfterDiscount','value' => set_value('txtAfterDiscount',0.00),'id'=>'txtAfterDiscount', 'class' => 'form-control num' ,'readonly' => 'true'); + echo form_input($data); + ?> +
+
+
CGST In % @@ -1424,7 +1622,7 @@ $("#PaymentMethod").select2(); endforeach; } - echo form_dropdown('drpaddFreight', $options,set_value('drpaddFreight'),'id="drpaddFreight"' ,'class="form-control "'); + echo form_dropdown('drpFreight', $options,set_value('drpFreight'),'id="drpFreight"' ,'class="form-control "'); ?>
@@ -1433,7 +1631,7 @@ $("#PaymentMethod").select2(); NO Of Trips
'addNOOfTrips','value' => set_value('addNOOfTrips'),'id'=>'addNOOfTrips', 'class' => 'form-control num','onchange'=>'calculateFreight(0);' ); + $data = array('name' => 'NOOfTrips','value' => set_value('NOOfTrips'),'id'=>'NOOfTrips', 'class' => 'form-control num','onchange'=>'calculateFreight(0);' ); echo form_input($data); ?>
@@ -1442,7 +1640,7 @@ $("#PaymentMethod").select2(); Freight Rate
'addtxtFreight','value' => set_value('addtxtFreight'),'id'=>'addtxtFreight', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'calculateFreight(0);'); + $data = array('name' => 'txtFreight','value' => set_value('txtFreight'),'id'=>'txtFreight', 'class' => 'form-control num' ,'onkeypress'=>'return isNumberKey(event);','onchange'=>'calculateFreight(0);'); echo form_input($data); ?>
@@ -1452,7 +1650,7 @@ $("#PaymentMethod").select2(); Freight Amt In INR
'addtxtAfterFreight','value' => set_value('addtxtAfterFreight'),'id'=>'addtxtAfterFreight', 'class' => 'form-control num' ,'readonly' => 'true'); + $data = array('name' => 'txtAfterFreight','value' => set_value('txtAfterFreight'),'id'=>'txtAfterFreight', 'class' => 'form-control num' ,'readonly' => 'true'); echo form_input($data); ?>
@@ -1540,7 +1738,15 @@ $("#PaymentMethod").select2(); +
+ + + 'ItemDescription','value' => set_value('ItemDescription'),'id'=>'ItemDescription', 'class' => 'form-control' ,'rows' => '3', 'cols' => '40' ); + echo form_textarea($data); ?> + +