diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index 5078a164..bd792449 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -414,19 +414,20 @@ class purchaseorder extends BaseController $data['POItem'] = $this->purchaseorder_model->getCapitalPurchaseOrderDetails($PONO); $data['requestedBy'] = $this->purchaseorder_model->GetRequesedByDetails($PONO); - //print_r($data['POItem']); + - + $CapitalRange=''; foreach($data['POItem'] as $Rate) { - + $exRate=$Rate->ExchangeRate; + $CapitalRange=$Rate->CapitalRange; } - + foreach($data['POItem'] as $CUR) { @@ -436,13 +437,26 @@ class purchaseorder extends BaseController } - - + + if($CapitalRange=='0'){ + $data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency); + $data['ExchangeRate']=$exRate; $data['Currency']=$this->purchaseorder_model->GetCurrencytype(); + + } + else if($CapitalRange=='1'){ + $data['CurrencyDetail']=''; + + $data['ExchangeRate']=$exRate; + + $data['Currency']=$this->purchaseorder_model->GetCurrencytype(); + + } + $this->global['pageTitle'] = 'Siddharth : Edit Capital Purchase order form'; $this->loadViews("editCapitalPo", $this->global, $data, NULL); @@ -1536,7 +1550,7 @@ $createddt=''; function addNewCapitalPurchaseOrder() { - + $POdt =$this->input->post('PODate'); $PODate = $this->getDateformat($POdt); $SupplierID = $this->input->post('drpSupplier'); @@ -1555,8 +1569,19 @@ $createddt=''; $Deliverydt = $this->getDateformat($dt); $DeliverySchedule = ''; } - - $ExchangeRateOn = $this->input->post('ExchangeRateOn'); + $capitalType = $this->input->post('capitalType'); + if($capitalType=='Domestic'){ + $CapitalRange = '1'; + $ExchangeRateOn = ''; + $ExchangeRate=''; + } + else{ + + $CapitalRange = '0'; + $ExchangeRateOn = $this->input->post('ExchangeRateOn'); + $ExchangeRate=$this->input->post('ExchangeRt'); + } + $PaymentMethod = $this->input->post('PaymentMethod'); $PayableAT = $this->input->post('PayableAT'); @@ -1576,10 +1601,10 @@ $createddt=''; $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $createddt = $dt->format('Y-m-d H:i:s'); - - - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'POType'=>$POType); - + $currencytypeID = $this->input->post('currencytype'); + + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'ExchangeRate'=>$ExchangeRate,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CapitalRange'=>$CapitalRange,'POType'=>$POType,'CurrencyType'=>currencytypeID); + $POMaster = $this->purchaseorder_model->addPOMaster($POList); @@ -1599,9 +1624,9 @@ $createddt=''; $Reqnumber = $this->input->post('Reqnumber'.$i); $itemRate = $this->input->post('itemRate'.$i); - $Exchangerate = $this->input->post('echangeRate'.$i); + $BasicPriceinmton = $this->input->post('rateInUs'.$i); - $Productprice = $this->input->post('basicval'.$i); + $Productprice = $this->input->post('basicvalInINR'.$i); $LandingCharge = $this->input->post('beforeLanding'.$i); $AfterLandingCharge = $this->input->post('landingCharge'.$i); $HighSeas = $this->input->post('beforeHighSeasSalesCharge'.$i); @@ -1635,7 +1660,7 @@ $createddt=''; $RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i); $QuantityKG = $this->input->post('PurQuantity'.$i); - $currencytypeID = $this->input->post('currencytype'); + $Totalvalueitem=$this->input->post('PerKgExpense'.$i); //echo $BasicPriceinmton; @@ -1682,7 +1707,7 @@ $createddt=''; $ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt); $ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList); - $ImportTaxList = array('LineItemNo'=>$LineItemNo, 'ExchangeRate'=>$Exchangerate,'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,'CurrencyType'=>$currencytypeID,'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); //print_r($ImportTaxList); //die(); @@ -1700,7 +1725,7 @@ $createddt=''; /*Edit Capital po*/ function EditCapitalPurchaseOrder() { - + $PONO =$this->input->post('txtPONO'); $POdt =$this->input->post('PODate'); @@ -1722,7 +1747,20 @@ $createddt=''; $DeliverySchedule = ''; } - $ExchangeRateOn = $this->input->post('ExchangeRateOn'); + $capitalType = $this->input->post('capitalType'); + $currencytypeID = $this->input->post('currencytype'); + if($capitalType=='1'){ + $CapitalRange = '1'; + $ExchangeRateOn = ''; + $ExchangeRate=''; + + } + else{ + + $CapitalRange = '0'; + $ExchangeRateOn = $this->input->post('ExchangeRateOn'); + $ExchangeRate=$this->input->post('ExchangeRt'); + } $PaymentMethod = $this->input->post('PaymentMethod'); $PayableAT = $this->input->post('PayableAT'); @@ -1744,7 +1782,7 @@ $createddt=''; $createddt = $dt->format('Y-m-d H:i:s'); $updateddt = $dt->format('Y-m-d H:i:s'); - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID); $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); @@ -1764,7 +1802,7 @@ $createddt=''; $Exchangerate = $this->input->post('echangeRate'.$i); $BasicPriceinmton = $this->input->post('rateInUs'.$i); - $Productprice = $this->input->post('basicval'.$i); + $Productprice = $this->input->post('basicvalInINR'.$i); $LandingCharge = $this->input->post('beforeLanding'.$i); $AfterLandingCharge = $this->input->post('landingCharge'.$i); $HighSeas = $this->input->post('beforeHighSeasSalesCharge'.$i); @@ -1798,7 +1836,7 @@ $createddt=''; $RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i); $QuantityKG = $this->input->post('PurQuantity'.$i); - $currencytypeID = $this->input->post('currencytype'); + $Totalvalueitem=$this->input->post('PerKgExpense'.$i); //echo $BasicPriceinmton; @@ -1848,7 +1886,7 @@ $createddt=''; $ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt); $ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList); - $ImportTaxList = array('LineItemNo'=>$LineItemNo, 'ExchangeRate'=>$Exchangerate,'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,'CurrencyType'=>$currencytypeID,'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); //print_r($ImportTaxList); //die(); @@ -1870,7 +1908,7 @@ $createddt=''; $ServiceTaxList = array('ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt); $ServiceTax = $this->purchaseorder_model->updateServiceTax($LineItemNo,$ServiceTaxList); - $ImportTaxList = array('LineItemNo'=>$LineItemNo, 'ExchangeRate'=>$Exchangerate,'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,'CurrencyType'=>$currencytypeID,'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); $ImportList= $this->purchaseorder_model->updateImportTax($LineItemNo,$ImportTaxList); } diff --git a/application/controllers/purchaseorder.php~ b/application/controllers/purchaseorder.php~ index 52606d70..bd792449 100755 --- a/application/controllers/purchaseorder.php~ +++ b/application/controllers/purchaseorder.php~ @@ -115,7 +115,7 @@ class purchaseorder extends BaseController $data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006'); $data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018'); $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); - $data['Payment']=$this->purchaseorder_model->getSupplierPayment(); + $data['Payment']=$this->purchaseorder_model->getSupplierPayment('C009'); $data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019'); @@ -141,17 +141,20 @@ class purchaseorder extends BaseController $Req = $SelectedReq->Req; $data['ReqList'] = $Req ; $ReqArray = array(); - $ReqType = ''; + $ReqType = $this->input->post('txtReqType'); $result = array(); foreach ($Req as $SID): $ReqArray[] = $SID->ReqNo ; $result[] = $this->purchaseorder_model->getRawPOMaterialList($SID->ReqNo); - $ReqType = $SID->ReqType; + if($ReqType == '') + { + $ReqType = $SID->ReqType; + } endforeach; - + $data['MaterialList'] = $result; //print_r($data['MaterialList']); /* Cost code from Requisition - Client Review Fix @@ -180,7 +183,8 @@ class purchaseorder extends BaseController // $data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate(); $data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate(); $data['Currency']=$this->purchaseorder_model->GetCurrencytype(); - //print_r($data['Currency']); + $data['INRSYMBOL']=$this->purchaseorder_model->GetINRCurrencytype('INR'); + //print_r($data['INRSYMBOL']); // $data[$Rate->ExchangeRate]=$Rate->ExchangeRate; @@ -267,6 +271,7 @@ class purchaseorder extends BaseController $data['MaterialList'] = $result;//$this->purchaseorder_model->getRawMaterialList($ReqType,$ReqArray); $data['Suplist'] = $this->purchaseorder_model->getSupplierName(); $data['Payment']=$this->purchaseorder_model->getSupplierPayment(); + $data['INRSYMBOL']=$this->purchaseorder_model->GetINRCurrencytype('INR'); /* Cost code from Requisition - Client Review Fix Start here */ $ReqDetails = $this->purchaseorder_model->getRequistDetails($ReqArray); @@ -318,6 +323,11 @@ class purchaseorder extends BaseController { $PAYTERM=$TER->PaymentTerms; } + + // foreach ($data['POMaster'] as $STATUSCODE) + // { + // $STATUSNAME=$STATUSCODE->PaymentTerms; + // } //print_r($PAYTERM); //print_r($exRate); //$data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate(); @@ -329,6 +339,7 @@ class purchaseorder extends BaseController $data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetails($PONO); $data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO); + //$data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019'); $data['WorkStatus']=$this->purchaseorder_model->GetWorkStatus('C019'); $this->global['pageTitle'] = 'Siddharth : Edit Service Purchase order form'; $this->loadViews("EditservicePurchaseorder", $this->global, $data, NULL); @@ -370,12 +381,21 @@ class purchaseorder extends BaseController $data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency); $data['PaymentTerms']=$this->purchaseorder_model->GetPaymentTerms($PONO); //print_r($data['PaymentTerms']); + $unicode =''; foreach ($data['CurrencyDetail'] as $Detail) { $unicode=$Detail->FontCode2000; } + + + foreach ($data['CurrencyDetail'] as $Detail) + { + $currencycode=$Detail->Currency_Code; + } + //print_r($unicode); $data['unicode']=$unicode; + $data['currencycode']=$currencycode; $this->global['pageTitle'] = 'Siddharth : Edit Import Purchase order form'; $this->loadViews("editimportpo", $this->global, $data, NULL); } @@ -394,19 +414,20 @@ class purchaseorder extends BaseController $data['POItem'] = $this->purchaseorder_model->getCapitalPurchaseOrderDetails($PONO); $data['requestedBy'] = $this->purchaseorder_model->GetRequesedByDetails($PONO); - //print_r($data['POItem']); + - + $CapitalRange=''; foreach($data['POItem'] as $Rate) { - + $exRate=$Rate->ExchangeRate; + $CapitalRange=$Rate->CapitalRange; } - + foreach($data['POItem'] as $CUR) { @@ -416,13 +437,26 @@ class purchaseorder extends BaseController } - - + + if($CapitalRange=='0'){ + $data['CurrencyDetail']=$this->purchaseorder_model->GetCurrencyDetail($Currency); + $data['ExchangeRate']=$exRate; $data['Currency']=$this->purchaseorder_model->GetCurrencytype(); + + } + else if($CapitalRange=='1'){ + $data['CurrencyDetail']=''; + + $data['ExchangeRate']=$exRate; + + $data['Currency']=$this->purchaseorder_model->GetCurrencytype(); + + } + $this->global['pageTitle'] = 'Siddharth : Edit Capital Purchase order form'; $this->loadViews("editCapitalPo", $this->global, $data, NULL); @@ -635,7 +669,7 @@ class purchaseorder extends BaseController $SupplierID = $this->input->post('drpSupplier'); $DeliveryAddr = $this->input->post('DeliveryAddr'); $dt = $this->input->post('Deliverydt'); - //$Deliverydt = $this->getDateformat($dt); + $POType = $this->input->post('POType'); $DeliveryOption = $this->input->post('DateRange'); if($DeliveryOption==1){ $Deliverydt = ''; @@ -677,7 +711,7 @@ $DeliveryOption = $this->input->post('DateRange'); $PaymentTerms=$this->input->post('PaymentTerms'); $Payableat=$this->input->post('PayableAT'); // PO Master - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays,'POType'=>$POType); $POMaster = $this->purchaseorder_model->addPOMaster($POList); @@ -778,7 +812,7 @@ $DeliveryOption = $this->input->post('DateRange'); $DeliveryAddr = $this->input->post('txtDeliveryAddress'); $dt = $this->input->post('Deliverydt'); //$Deliverydt = $this->getDateformat($dt); - $DeliveryOption = $this->input->post('DateRange'); + $DeliveryOption = $this->input->post('DateRange'); if($DeliveryOption==1){ $Deliverydt = ''; $DeliverySchedule = $this->input->post('Scheduleby'); @@ -1015,7 +1049,7 @@ public function importpoprint($PONO) $this->load->library('dompdf_gen'); // Convert to PDF - $this->dompdf->set_paper(array(0, 0, 841.89, 1190.55), 'landscape'); + //$this->dompdf->set_paper(array(0, 0, 841.89, 1190.55), 'landscape'); $this->dompdf->load_html($php); $this->dompdf->render(); $data['Attachment'] = FALSE; @@ -1127,7 +1161,7 @@ function addNewImportPurchaseOrder() - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays,'POType'=>$POType); //print_r($POList);PaymentDays //die(); @@ -1454,12 +1488,12 @@ $createddt=''; $store = array('Status'=>$StatusCode,'ApprovedOn'=>$ApprovedDate,'Approvedby'=>$ApprovedBy,'Remarks'=>$Remarks); $this->purchaseorder_model->UpdatePO($store,$PONO); - echo "Successfully Updated the Purchase Order No: ".$PONO; + echo "Successfully Approve the Purchase Order No: ".$PONO; } else{ $store = array('Status'=>$StatusCode,'OnHoldOn'=>$ApprovedDate,'OnHoldBy'=>$ApprovedBy,'Remarks'=>$Remarks); $this->purchaseorder_model->UpdatePO($store,$PONO); - echo "Successfully Updated the Purchase Order No: ".$PONO; + echo "The Purchase Order No: ".$PONO ."is On Hold"; } @@ -1503,12 +1537,12 @@ $createddt=''; $store = array('Status'=>$StatusCode,'ReleasedOn'=>$ReleasedDate,'ReleasedBy'=>$ReleasedBy,'Remarks'=>$Remarks); $this->purchaseorder_model->UpdatePO($store,$PONO); - echo "Successfully Updated the Purchase Order No: ".$PONO; + echo "Successfully Released the Purchase Order No: ".$PONO; } else{ $store = array('Status'=>$StatusCode,'OnHoldOn'=>$ReleasedOn,'OnHoldBy'=>$ReleasedBy,'Remarks'=>$Remarks); $this->purchaseorder_model->UpdatePO($store,$PONO); - echo "Successfully Updated the Purchase Order No: ".$PONO; + echo "The Purchase Order No: ".$PONO ."is On Hold"; } } @@ -1516,7 +1550,7 @@ $createddt=''; function addNewCapitalPurchaseOrder() { - + $POdt =$this->input->post('PODate'); $PODate = $this->getDateformat($POdt); $SupplierID = $this->input->post('drpSupplier'); @@ -1535,8 +1569,19 @@ $createddt=''; $Deliverydt = $this->getDateformat($dt); $DeliverySchedule = ''; } - - $ExchangeRateOn = $this->input->post('ExchangeRateOn'); + $capitalType = $this->input->post('capitalType'); + if($capitalType=='Domestic'){ + $CapitalRange = '1'; + $ExchangeRateOn = ''; + $ExchangeRate=''; + } + else{ + + $CapitalRange = '0'; + $ExchangeRateOn = $this->input->post('ExchangeRateOn'); + $ExchangeRate=$this->input->post('ExchangeRt'); + } + $PaymentMethod = $this->input->post('PaymentMethod'); $PayableAT = $this->input->post('PayableAT'); @@ -1556,10 +1601,10 @@ $createddt=''; $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $createddt = $dt->format('Y-m-d H:i:s'); - - - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption); - + $currencytypeID = $this->input->post('currencytype'); + + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'ExchangeRate'=>$ExchangeRate,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CapitalRange'=>$CapitalRange,'POType'=>$POType,'CurrencyType'=>currencytypeID); + $POMaster = $this->purchaseorder_model->addPOMaster($POList); @@ -1579,9 +1624,9 @@ $createddt=''; $Reqnumber = $this->input->post('Reqnumber'.$i); $itemRate = $this->input->post('itemRate'.$i); - $Exchangerate = $this->input->post('echangeRate'.$i); + $BasicPriceinmton = $this->input->post('rateInUs'.$i); - $Productprice = $this->input->post('basicval'.$i); + $Productprice = $this->input->post('basicvalInINR'.$i); $LandingCharge = $this->input->post('beforeLanding'.$i); $AfterLandingCharge = $this->input->post('landingCharge'.$i); $HighSeas = $this->input->post('beforeHighSeasSalesCharge'.$i); @@ -1615,7 +1660,7 @@ $createddt=''; $RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i); $QuantityKG = $this->input->post('PurQuantity'.$i); - $currencytypeID = $this->input->post('currencytype'); + $Totalvalueitem=$this->input->post('PerKgExpense'.$i); //echo $BasicPriceinmton; @@ -1662,7 +1707,7 @@ $createddt=''; $ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt); $ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList); - $ImportTaxList = array('LineItemNo'=>$LineItemNo, 'ExchangeRate'=>$Exchangerate,'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,'CurrencyType'=>$currencytypeID,'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); //print_r($ImportTaxList); //die(); @@ -1680,7 +1725,7 @@ $createddt=''; /*Edit Capital po*/ function EditCapitalPurchaseOrder() { - + $PONO =$this->input->post('txtPONO'); $POdt =$this->input->post('PODate'); @@ -1702,7 +1747,20 @@ $createddt=''; $DeliverySchedule = ''; } - $ExchangeRateOn = $this->input->post('ExchangeRateOn'); + $capitalType = $this->input->post('capitalType'); + $currencytypeID = $this->input->post('currencytype'); + if($capitalType=='1'){ + $CapitalRange = '1'; + $ExchangeRateOn = ''; + $ExchangeRate=''; + + } + else{ + + $CapitalRange = '0'; + $ExchangeRateOn = $this->input->post('ExchangeRateOn'); + $ExchangeRate=$this->input->post('ExchangeRt'); + } $PaymentMethod = $this->input->post('PaymentMethod'); $PayableAT = $this->input->post('PayableAT'); @@ -1724,7 +1782,7 @@ $createddt=''; $createddt = $dt->format('Y-m-d H:i:s'); $updateddt = $dt->format('Y-m-d H:i:s'); - $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption); + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'PORange'=>$PoRange,'ExchangeRate'=>$ExchangeRate,'ExchangeRateCalculatedon'=>$ExchangeRateOn,'PaymentTerms'=>$PaymentMethod,'PaymentDays'=>$PaymentDate,'PayableAt'=>$PayableAT,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$createddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'CurrencyType'=>$currencytypeID); $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); @@ -1744,7 +1802,7 @@ $createddt=''; $Exchangerate = $this->input->post('echangeRate'.$i); $BasicPriceinmton = $this->input->post('rateInUs'.$i); - $Productprice = $this->input->post('basicval'.$i); + $Productprice = $this->input->post('basicvalInINR'.$i); $LandingCharge = $this->input->post('beforeLanding'.$i); $AfterLandingCharge = $this->input->post('landingCharge'.$i); $HighSeas = $this->input->post('beforeHighSeasSalesCharge'.$i); @@ -1778,7 +1836,7 @@ $createddt=''; $RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomers'.$i); $QuantityKG = $this->input->post('PurQuantity'.$i); - $currencytypeID = $this->input->post('currencytype'); + $Totalvalueitem=$this->input->post('PerKgExpense'.$i); //echo $BasicPriceinmton; @@ -1828,7 +1886,7 @@ $createddt=''; $ServiceTaxList = array('LineItemNo'=>$LineItemNo, 'ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt); $ServiceTax = $this->purchaseorder_model->addServiceTax($ServiceTaxList); - $ImportTaxList = array('LineItemNo'=>$LineItemNo, 'ExchangeRate'=>$Exchangerate,'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,'CurrencyType'=>$currencytypeID,'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); //print_r($ImportTaxList); //die(); @@ -1850,7 +1908,7 @@ $createddt=''; $ServiceTaxList = array('ServiceTax'=>$ServiceTax,'EducessTax'=>$EduCess,'SecHigherEducessTax'=>$SecHighTax,'KrishiKalyantax'=>$KrishiTax,'SwachhBharattax'=>$SwachhTax,'TotalValue'=>$TotalOrderValue, 'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt); $ServiceTax = $this->purchaseorder_model->updateServiceTax($LineItemNo,$ServiceTaxList); - $ImportTaxList = array('LineItemNo'=>$LineItemNo, 'ExchangeRate'=>$Exchangerate,'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,'CurrencyType'=>$currencytypeID,'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); $ImportList= $this->purchaseorder_model->updateImportTax($LineItemNo,$ImportTaxList); } diff --git a/application/controllers/storerequisition.php b/application/controllers/storerequisition.php old mode 100644 new mode 100755 diff --git a/application/controllers/storerequisitionlist.php b/application/controllers/storerequisitionlist.php old mode 100644 new mode 100755 diff --git a/application/logs/log-2017-07-05.php b/application/logs/log-2017-07-05.php old mode 100644 new mode 100755 index a17112c6..c30aad65 --- a/application/logs/log-2017-07-05.php +++ b/application/logs/log-2017-07-05.php @@ -115,3 +115,5 @@ ERROR - 2017-07-05 14:05:35 --> Severity: Notice --> Undefined index: Requisiti ERROR - 2017-07-05 14:05:35 --> Severity: Notice --> Undefined index: RequisitionStatus /opt/lampp/htdocs/siddharth_application/application/views/approvalstorerequisitionslip.php 33 ERROR - 2017-07-05 14:05:35 --> Severity: Notice --> Undefined index: RequisitionStatus /opt/lampp/htdocs/siddharth_application/application/views/approvalstorerequisitionslip.php 33 ERROR - 2017-07-05 14:05:35 --> Severity: Notice --> Undefined index: RequisitionStatus /opt/lampp/htdocs/siddharth_application/application/views/approvalstorerequisitionslip.php 33 +ERROR - 2017-07-05 14:33:38 --> Severity: Warning --> mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given /opt/lampp/htdocs/Git_Server/siddharth_application/system/database/drivers/mysqli/mysqli_result.php 38 +ERROR - 2017-07-05 14:34:05 --> Severity: Warning --> explode() expects parameter 2 to be string, array given /opt/lampp/htdocs/Git_Server/siddharth_application/application/third_party/dompdf/include/style.cls.php 948 diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index 2818602f..b4de241e 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -1075,13 +1075,15 @@ function GetCurrencytype() } //This is get the capital po list for edit + + function getCapitalPurchaseOrderDetails($PONO = '') { $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName, -Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue ,ROUND((ServiceTax.ServiceTax + ServiceTax.EducessTax + ServiceTax.SecHigherEducessTax + ServiceTax.KrishiKalyantax + ServiceTax.SwachhBharattax),2) as ServiceTaxamount +Mat.UOM,Quantity,Rate,Req.Status,ROUND((ServiceTax.ServiceTax + ServiceTax.EducessTax + ServiceTax.SecHigherEducessTax + ServiceTax.KrishiKalyantax + ServiceTax.SwachhBharattax),2) as ServiceTaxamount ,ServiceTax.TotalValue,ServiceTax,EducessTax,ServiceTax.SecHigherEducessTax,ServiceTax.KrishiKalyantax,ServiceTax.SwachhBharattax, - ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,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,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,POMast.CurrencyType, Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO diff --git a/application/models/purchaseorder_model.php~ b/application/models/purchaseorder_model.php~ index b7906003..b4de241e 100755 --- a/application/models/purchaseorder_model.php~ +++ b/application/models/purchaseorder_model.php~ @@ -33,13 +33,16 @@ class purchaseorder_model extends CI_Model function purchaseorderListing($forwhat='') { $this->db->distinct(); - $this->db->select('POMast.PONO,supp.SupplierName,TotalOrderValue,PODate,Stat.StatusName,Stat.StatusCode,Req.ReqType,DeliveryDate,DeliverySchedule,DeliveryOption'); + $this->db->select('POMast.PONO,supp.SupplierName,TotalOrderValue,PODate,Stat.StatusName,Stat.StatusCode,POMast.POType as ReqType,DeliveryDate,DeliverySchedule,DeliveryOption'); $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'); $this->db->join('T_PurchaseOrder_LineItem LineItem', 'POMast.PONO = LineItem.PONO'); $this->db->join('T_Requestion_Master Req', 'Req.ReqNo = LineItem.ReqNo'); - + if($forwhat=='amendment') + { + $this->db->where('POMast.Status',PO_RELEASED); + } $query = $this->db->get(); //print_r( $this->db->last_query()); $result = $query->result(); @@ -169,10 +172,15 @@ function purchaseorderListing($forwhat='') return $query->result_array(); */ - $subQuery ='select BudgetAmount, (select ifnull(sum(TotalOrderValue),0) as Totalvalue from + /* $subQuery ='select BudgetAmount, (select ifnull(sum(TotalOrderValue),0) as Totalvalue from T_PurchaseOrder_Master PO join T_PurchaseOrder_LineItem Item on Item.PONO = PO.PONO join T_Requestion_Master mast on mast.ReqNo = Item.ReqNo where Item.CostCenterCode=? and mast.ReqType=?)as Totalvalue from T_CostCenter_Budget Bud where Bud.CostCenterCode=? and + BudgetYear = ? and BudgetType =?'; */ + + $subQuery ='select BudgetAmount, (select ifnull(sum(Quantity*Rate),0) as Totalvalue from + T_PurchaseOrder_LineItem Item join T_Requestion_Master mast on mast.ReqNo = Item.ReqNo where Item.CostCenterCode=? and mast.ReqType=?)as Totalvalue + from T_CostCenter_Budget Bud where Bud.CostCenterCode=? and BudgetYear = ? and BudgetType =?'; $query = $this->db->query($subQuery,array($CostCode,$BudgetType,$CostCode,$Year,$BudgetType)); @@ -446,7 +454,7 @@ function purchaseorderListing($forwhat='') function GetServicePurchaseOrder($PONO = '') { $this->db->distinct(); - $this->db->select('ReqNo,POMast.PONO,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,POMast.PaymentTerms,POMast.PaymentDays,POMast.PayableAT,POMast.ExchangeRate,POMast.UpdatedOn,Stat.StatusCode'); + $this->db->select('ReqNo,POMast.PONO,ServiceDescription,supp.SupplierID,supp.SupplierName,supp.Address,PODate,Stat.StatusName,DeliveryOption,DeliverySchedule,DeliveryDate,DeliveryAddress,POMast.PaymentTerms,POMast.PaymentDays,POMast.PayableAT,POMast.ExchangeRate,POMast.UpdatedOn,Stat.StatusCode,POMast.ServiceWorkStatus,POMast.*'); $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'); @@ -465,7 +473,7 @@ function purchaseorderListing($forwhat='') { $subQuery ='SELECT distinct LineItem.LineItemNo,ReqNo,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,Rate,Status,ROUND((Quantity *Rate),2 ) as BasicValue ,ROUND((ServiceTax + EducessTax + SecHigherEducessTax + KrishiKalyantax + SwachhBharattax),2)as Taxamount - ,TotalValue,ServiceTax,EducessTax,SecHigherEducessTax,KrishiKalyantax,SwachhBharattax,CostCenterCode + ,TotalValue,ServiceTax,EducessTax,SecHigherEducessTax,KrishiKalyantax,SwachhBharattax,CostCenterCode,LineItem.ServiceFrequency FROM T_PurchaseOrder_LineItem LineItem join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode join T_Service_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo @@ -546,9 +554,10 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '') { $subQuery ='SELECT distinct LineItem.LineItemNo,ReqNo,Mat.MaterialCode,Mat.MaterialName, - Mat.UOM,Quantity,Rate,ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount , + Mat.UOM,Quantity,ReqMas.Requestedby,Rate,ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount , ProductPrice,Tax.*,CostCenterCode , POMaster.*,sup.SupplierName,sup.Address FROM T_PurchaseOrder_LineItem LineItem + join T_Requestion_Master ReqMas on ReqMas.ReqNo=LineItem.ReqNo join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode join T_Import_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo join T_PurchaseOrder_Master POMaster on POMaster.PONO = LineItem.PONO @@ -574,6 +583,23 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '') } + function GerRequesterName($Requester='') + { + $subQuery='SELECT EmpID,FirstName from T_Employee_Details where EmpID=?'; + + $query=$this->db->query($subQuery,array($Requester)); + + return $query->result(); + } + + function GerCurrencyCodeName($Currencycode='') + { + $subQuery='SELECT Currency_Code,FontCode2000 from T_Currency_Details where Currency_Code=?'; + $query=$this->db->query($subQuery,array($Currencycode)); + return $query->result(); + } + + function GetPOStatus($Status='') { $subQuery='SELECT StatusName from T_Status where StatusCode=?'; @@ -595,15 +621,26 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '') - function getSupplierPayment($Currency='') - { + // function getSupplierPayment($Currency='') + // { - $subQuery='select distinct PaymentTerms from T_SupplierDetailsN'; - $query=$this->db->query($subQuery,array($Currency)); - //print_r($this->db->last_query()); - return $query->result(); + // $subQuery='select distinct PaymentTerms from T_SupplierDetailsN'; + // $query=$this->db->query($subQuery,array($Currency)); + // //print_r($this->db->last_query()); + // return $query->result(); - } + // } + + function getSupplierPayment($Config_ID='') + { + + // $subQuery='select distinct PaymentTerms from T_SupplierDetailsN'; + $subQuery='select ConfigValue from T_ConfigDetails where Config_ID=?'; + $query=$this->db->query($subQuery,array($Config_ID)); + //print_r($this->db->last_query()); + return $query->result(); + + } function GetWorkStatus($Config_ID='') { @@ -622,9 +659,10 @@ function GetImportPurchaseOrderDetails($PONO = '') $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName, Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue , - ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,ExchangeRate,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((Quantity *Rate)+(RMCIncludingCustomersPerKG*Quantity),2)as TotalOrderValue,ROUND((ExchangeRate*BasicPriceInMTon),2) as BasicINRValue,TotalValue,CurrencyType, + ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((Quantity *Rate)+(RMCIncludingCustomersPerKG*Quantity),2)as TotalOrderValue,ROUND((POMast.ExchangeRate*BasicPriceInMTon),2) as BasicINRValue,TotalValue,CurrencyType, Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem + join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode join T_Import_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo join T_Requestion_Master Req on Req.ReqNo = LineItem.ReqNo @@ -651,6 +689,15 @@ function GetCurrencytype() return $query->result(); } + function GetINRCurrencytype($Currency_Code='') + { + $subQuery='select FontCode2000 from T_Currency_Details where Currency_Code=?'; + $query=$this->db->query($subQuery,array($Currency_Code)); + //print_r($this->db->last_query()); + return $query->result(); + + } + @@ -969,11 +1016,11 @@ function GetCurrencytype() * @return array $result : This is result of the query join T_DepartmentDetails Dept on emp.Departmentcode = Dept.DEPCode */ - function getPOList($q) + function getPOList($Amendment) { $this->db->distinct(); - $this->db->select('mast.PONO,mast.TotalOrderValue,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,rmast.ReqType,bud.BudgetAmount,mast.Remarks'); + $this->db->select('mast.PONO,mast.TotalOrderValue,st.StatusCode,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,mast.POType as ReqType,bud.BudgetAmount,mast.Remarks'); $this->db->from('T_PurchaseOrder_Master mast'); $this->db->join('T_Status st', 'st.StatusCode=mast.Status'); $this->db->join('tbl_users tbl', 'mast.createdby=tbl.userid'); @@ -982,19 +1029,21 @@ function GetCurrencytype() $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 and ccm.CostCenterCode = bud.CostCenterCode'); - $this->db->where('mast.Status','ST030'); // EMERGENGY PO - if($q=='A'){ - $this->db->where('mast.Status','ST015');//PO CREATED - $this->db->or_where('mast.Status','ST020');//ON HOLD - $this->db->or_where('mast.Status','ST025');// PO APPROVED - $this->db->or_where('mast.Status','ST026');//PO RELEASED - $this->db->or_where('mast.Status','ST024'); // EMERGENGY PO + // $this->db->where('mast.Status',PO_AMENDED); // EMERGENGY PO + if($Amendment=='A'){ //A- Approved + $this->db->or_where('mast.Status',PO_CREATED);//PO CREATED + $this->db->or_where('mast.Status',PO_ONHOLD);//ON HOLD + $this->db->or_where('mast.Status',PO_AWAITING_RELEASE);// PO APPROVED + $this->db->or_where('mast.Status',PO_RELEASED);//PO RELEASED + $this->db->or_where('mast.Status',REQITEM_Emergency_PO_CREATED); // EMERGENGY PO + // $this->db->or_where('mast.Status',PO_AMENDED); // EMERGENGY PO } - else if($q=='R'){ - $this->db->or_where('mast.Status','ST025');// PO APPROVED + else if($Amendment=='R'){ // R -RELEASED + $this->db->or_where('mast.Status',PO_AWAITING_RELEASE);// PO APPROVED + $this->db->or_where('mast.Status',PO_RELEASED); } $result=$this->db->get(); - // print_r($result->result()); + // print_r($this->db->last_query()); return $result->result(); @@ -1026,15 +1075,18 @@ function GetCurrencytype() } //This is get the capital po list for edit + + function getCapitalPurchaseOrderDetails($PONO = '') { $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName, -Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue ,ROUND((ServiceTax.ServiceTax + ServiceTax.EducessTax + ServiceTax.SecHigherEducessTax + ServiceTax.KrishiKalyantax + ServiceTax.SwachhBharattax),2) as ServiceTaxamount +Mat.UOM,Quantity,Rate,Req.Status,ROUND((ServiceTax.ServiceTax + ServiceTax.EducessTax + ServiceTax.SecHigherEducessTax + ServiceTax.KrishiKalyantax + ServiceTax.SwachhBharattax),2) as ServiceTaxamount ,ServiceTax.TotalValue,ServiceTax,EducessTax,ServiceTax.SecHigherEducessTax,ServiceTax.KrishiKalyantax,ServiceTax.SwachhBharattax, - ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,ExchangeRate,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,AfterCustomEdCess,ROUND((ExchangeRate*BasicPriceInMTon*Quantity),2) as BasicINRValue,Tax.TotalValue as ImportTotalValue,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,POMast.CurrencyType, Req.CostCenterCode,Dept.DepartmentName FROM T_PurchaseOrder_LineItem LineItem + join T_PurchaseOrder_Master POMast on POMast.PONO = LineItem.PONO join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode join T_Service_Tax ServiceTax on ServiceTax.LineItemNo = LineItem.LineItemNo join T_Import_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo diff --git a/application/models/storerequistion_model.php b/application/models/storerequistion_model.php old mode 100644 new mode 100755 diff --git a/application/third_party/dompdf/lib/fonts/log.htm b/application/third_party/dompdf/lib/fonts/log.htm index d382dff4..3180f355 100755 --- a/application/third_party/dompdf/lib/fonts/log.htm +++ b/application/third_party/dompdf/lib/fonts/log.htm @@ -1,4 +1,4 @@ -10,240 KB 115.7951 ms
+10,240 KB 232.5711 ms

A PHP Error was encountered

diff --git a/application/views/addstorerequisitionslip.php b/application/views/addstorerequisitionslip.php old mode 100644 new mode 100755 diff --git a/application/views/approvalstorerequisitionslip.php b/application/views/approvalstorerequisitionslip.php old mode 100644 new mode 100755 diff --git a/application/views/capitalpurchaseorder.php b/application/views/capitalpurchaseorder.php index a2b29a98..ba7b8f1b 100755 --- a/application/views/capitalpurchaseorder.php +++ b/application/views/capitalpurchaseorder.php @@ -44,6 +44,10 @@ $paymentCheckDays1='After'; .select2{ width:100% ! important; } + #DomesticNOT { + margin-top:200px; + z-index: 1080 !important; +} diff --git a/application/views/capitalpurchaseorder.php~ b/application/views/capitalpurchaseorder.php~ index 47878727..ba7b8f1b 100755 --- a/application/views/capitalpurchaseorder.php~ +++ b/application/views/capitalpurchaseorder.php~ @@ -4,6 +4,9 @@ $CurrentDate = $dt->format('Y-m-d'); $MaxPoDate = ''; $AvlAmount = 0; + $paymentDate=''; + $paymentCheckDays='Before'; +$paymentCheckDays1='After'; if(!empty($MaxPODate)) { foreach ($MaxPODate as $date) @@ -24,6 +27,7 @@ $AvlAmount = $AvlBudAmt; } + ?> \ No newline at end of file +$("#CurrencySymbol").val(''); +var DisplayCurrencySymbol=''; +$('#currencytype').change(function(){ +var SelectCurrency = $('#currencytype').val(); +var currency = ; + + $.each(currency, function(idx, obj) { + if(obj.Currency_Code === SelectCurrency) + { + + $("#CurrencySymbol").val(obj.FontCode2000); +$('#CurrencySymbol').html('Exchange Rate In' + " "+obj.FontCode2000); +$('#RateIn').html('Rate(in' + " "+obj.FontCode2000); +$('#EditRateIn').html('Rate(in' + " "+obj.FontCode2000); +$('#TotalAmount').html('Basic value in' + " "+obj.FontCode2000); +$('#EditTotalAmount').html('Basic value in' + " "+obj.FontCode2000); +DisplayCurrencySymbol=obj.FontCode2000; +$("p").html(obj.FontCode2000); + + + } + + }); +}); + +var PaymentDate='After'; +$('#Before').change(function(){ +PaymentDate=$('#Before').val(); +}); +$('#After').change(function(){ +PaymentDate=$('#After').val(); + +}); + +var capitalType = ''; +function SetCapitalPo() + { + + capitalType1 = $("input:radio[name='optcapital']:checked").val(); + + + if(capitalType1 == 0) + { + capitalType='International'; + $('#DomesticNOT').modal('hide'); + + } + else + { + capitalType='Domestic'; + $('#DomesticNOT').modal('hide'); + $('#currencyOpt').hide(); + $('#FromOnlineRate').hide(); + $('#hideExchangeRateOn').hide(); + $('#hideExchangeRate').hide(); + + $('#currencytype').val(''); + $('#hideModalExchange').hide(); + $('#hideModalExchangeEdit').hide(); + $('#ExchangeRtModal').val('1'); + + + + + + + } + + } + + + + + + \ No newline at end of file diff --git a/application/views/editCapitalPo.php b/application/views/editCapitalPo.php index 17de3bee..7e8a06ef 100755 --- a/application/views/editCapitalPo.php +++ b/application/views/editCapitalPo.php @@ -51,6 +51,8 @@ $ExchangeDate=''; $ExchangeRateOn=''; $UpdatedOn; + $CapitalRange=''; +$PoStatusName=''; if(!empty($MaxPODate)) { @@ -81,14 +83,17 @@ if(!empty($POMaster)) $DeliveryAddress =$Req->DeliveryAddress; $POStatus = $Req->StatusCode; + $PoStatusName=$Req->StatusName; $PONO = $Req->PONO; $ServiceDescription = $Req->ServiceDescription; $PayableAT=$Req->PayableAT; - $ExchangeRateOn=$Req->ExchangeRate; + $ExchangeRateOn=$Req->ExchangeRateCalculatedon; $PaymentDays=$Req->PaymentDays; $PaymentTerms=$Req->PaymentTerms; $UpdatedOn=$Req->UpdatedOn; + $CapitalRange=$Req->CapitalRange; + } } @@ -134,6 +139,38 @@ $('#Deliverydt').val(''); $('#Scheduleby').val(SchName); } }); + + +var capitalType=''; +window.onload = function() +{ + var CapRan = ''; + if(CapRan == '1') + { + + document.getElementById('ExchangeRateOnDiv').style.display = 'none'; + document.getElementById('ExchangeRateOnDiv').style.display = 'none'; + document.getElementById('ExchangeRateDiv').style.display = 'none'; +document.getElementById('currencyTypeDiv').style.display = 'none'; +document.getElementById('ExchangeRateModalDiv').style.display = 'none'; +document.getElementById('ExchangeRateModalEditDiv').style.display = 'none'; + + +capitalType='Domestic'; + + } + else + { + document.getElementById('ExchangeRateOnDiv').style.display = 'block'; + document.getElementById('ExchangeRateOnDiv').style.display = 'block'; + document.getElementById('ExchangeRateDiv').style.display = 'block'; +document.getElementById('currencyTypeDiv').style.display = 'block'; +document.getElementById('ExchangeRateModalDiv').style.display = 'block'; +document.getElementById('ExchangeRateModalEditDiv').style.display = 'block'; +capitalType='International'; +document.getElementById('currencyTypeDiv').style.display = 'block'; + } +} @@ -173,6 +210,7 @@ $('#Scheduleby').val(SchName); });
+
'form-label-left CapitalPO ','name' => 'CapitalPO','id' => 'ImportPO'); @@ -214,7 +252,7 @@ $('#Scheduleby').val(SchName); ?>
-
+