From 61db6d8e3a4c45b08426d16d92f77f465d71a7c4 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Tue, 11 Jul 2017 14:33:38 +0530 Subject: [PATCH] import po --- application/controllers/purchaseorder.php | 328 ++++++++++++++-------- application/views/editimportpo.php | 40 ++- application/views/importpopdf.php | 4 +- 3 files changed, 234 insertions(+), 138 deletions(-) mode change 100755 => 100644 application/views/editimportpo.php diff --git a/application/controllers/purchaseorder.php b/application/controllers/purchaseorder.php index b981fa42..daa256ca 100755 --- a/application/controllers/purchaseorder.php +++ b/application/controllers/purchaseorder.php @@ -1030,15 +1030,15 @@ $DeliveryOption = $this->input->post('DateRange'); -public function importpoprint($PONO) - { - - // $this->load->view('includes/pdfheader'); +public function importpoprint($PONO) + { + + //$this->load->view('includes/pdfheader'); // Load the pdf page with multiviews - $Requester=''; - $Depcode=''; - $Currencycode=''; + $Requester=''; + $Depcode=''; + $Currencycode=''; $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); $data['POItem'] = $this->purchaseorder_model->GetImportPurchaseOrderDetailsForPDF($PONO); @@ -1063,18 +1063,58 @@ public function importpoprint($PONO) $data['DEPCODE']=$this->purchaseorder_model->GerRequesterDep($Depcode); //print_r($data['Requestername']); $data['Currencytype']=$this->purchaseorder_model->GerCurrencyCodeName($Currencycode); -$ProductPrice=''; + $ProductPrice=''; foreach ($data['POItem'] as $PO ) { - $ProductPrice=$PO->ProductPrice; + $TotalOrderValue=$PO->TotalOrderValue; } - $totalAmt=sprintf("%.2f", $ProductPrice); - $data['TotalAmountInWords']= $this->convertNumber($totalAmt); - //print_r($data['TotalAmountInWords']); + //$totalAmt=sprintf("%.2f", $ProductPrice); + //$data['TotalAmountInWords']= $this->convertNumber($totalAmt); + //print_r($data['TotalAmountInWords']); - $this->load->View("importpopdf", $data); + //$this->load->View("importpopdf", $data); + + $CurrencyType=''; + if(!empty($data['POItem'])){ + $CurrencyType=$data['POItem'][0]->CurrencyType; + } + else{ + } + + if($CurrencyType==''){ + $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR'); + + + $TotalOrderValue=$data['POItem'][0]->$TotalOrderValue; + //print_r($data['POItem'][0]); + + $totalAmt=sprintf("%.2f", $TotalOrderValue); + + $data['TotalAmountInWords']= $this->convertNumber($totalAmt); + + } + + + else{ + $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName($CurrencyType); + //print_r($data['CurrencySymbol']); + $SymbolCurrency=$data['CurrencySymbol'][0]->FontCode2000; + $SymbolCurrencyName=$data['CurrencySymbol'][0]->Currency; + $PaiseVal=$data['CurrencySymbol'][0]->PaiseVal; + + $TotalOrderValue=$data['POItem'][0]->TotalOrderValue; + + $totalAmt=sprintf("%.2f", $TotalOrderValue); + + $data['TotalAmountInWords']= $this->convertNumberSymbol($totalAmt,$SymbolCurrency,$SymbolCurrencyName,$PaiseVal); + } + + + $this->load->View("importpopdf", $data); + + // Add header to pdf //$this->load->view('includes/pdffooter'); @@ -1089,10 +1129,11 @@ $ProductPrice=''; $this->dompdf->load_html($php); $this->dompdf->render(); $data['Attachment'] = FALSE; - $this->dompdf->stream("ImportPOReport.pdf",$data,$php); + //$this->dompdf->stream("ImportPOReport.pdf",$data,$php); } + /** * This function used to load the Delete the Requistion Items */ @@ -1313,26 +1354,28 @@ function addNewImportPurchaseOrder() } - function EditImportPurchaseOrder() + function EditImportPurchaseOrder() { + //echo "dfds"; + //die(); $PONO =$this->input->post('txtPONO'); $POdt = ''; $createddt=''; - $PODate = $this->getDateformat($POdt); + $PODate = $this->getDateformat($POdt); $SupplierID = $this->input->post('drpSupplier'); - $DeliveryAddr = $this->input->post('DeliveryAddr'); - $dt = $this->input->post('Deliverydt'); - $Deliverydt = $this->getDateformat($dt); - $POType = $this->input->post('POType'); - $PoRange = $this->input->post('txtPoRange'); + $DeliveryAddr = $this->input->post('DeliveryAddr'); + $dt = $this->input->post('Deliverydt'); + $Deliverydt = $this->getDateformat($dt); + $POType = $this->input->post('POType'); + //$PoRange = $this->input->post('txtPoRange'); $DeliveryOption = $this->input->post('DateRange'); $Exchangerate=$this->input->post('ExchangeRate'); - $ExchangeRateCalculatedon=$this->input->post('Exchangerateon'); - $CurrencyType=$this->input->post('currencytype'); - + $ExchangeRateCalculatedon=$this->input->post('Exchangerateon'); + $CurrencyType=$this->input->post('currencytype'); + if($DeliveryOption==1){ $Deliverydt = ''; @@ -1345,54 +1388,62 @@ $createddt=''; $PaymentDate=$this->input->post('Payment'); if($PaymentDate==1) { - $PaymentDays='After'; + $PaymentDays='After'; } else { - $PaymentDays='Before'; + $PaymentDays='Before'; } - - $SpcialInstruction = $this->input->post('txtSpcialInstruction'); - $TotalOrder = $this->input->post('txtToatlOrder'); - $POStatus = $this->input->post('txtStatus'); + + $SpcialInstruction = $this->input->post('txtSpcialInstruction'); + $TotalOrder = $this->input->post('txtToatlOrder'); + //echo $TotalOrder; + //die(); + $POStatus = $this->input->post('txtStatus'); $CreateBy = $this->session->userdata ( 'userId' ); - $RowCount = $this->input->post('txtRowCount'); - $DeletedRow = $this->input->post('txtDeletedRow'); - - $comma_separated = explode(':', $DeletedRow); - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $updateddt = $dt->format('Y-m-d H:i:s'); + $RowCount = $this->input->post('txtRowCount'); + $DeletedRow = $this->input->post('txtDeletedRow'); + + $comma_separated = explode(':', $DeletedRow); + $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); + $updateddt = $dt->format('Y-m-d H:i:s'); - $PaymentTerms=$this->input->post('PaymentTerms'); - $Payableat=$this->input->post('PayableAT'); - // PO Master - // PO Master - $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); - //echo $PONO; - //echo $TotalOrder; - //print_r($POList); - //die(); - - $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); - - $LineItemStatus = REQITEM_NEW; - - - - //echo $RowCount; - for ($i = 1; $i <= $RowCount; $i++) - { - //echo "sdsfsd"; - //die(); - $MaterialCode = $this->input->post('materialCode'.$i); - $Quantity = $this->input->post('Quantity'.$i); + $PaymentTerms=$this->input->post('PaymentTerms'); + $Payableat=$this->input->post('PayableAT'); + // PO Master + // PO Master + $POList = array('SupplierID'=>$SupplierID, 'TotalOrderValue'=>$TotalOrder,'PODate'=>$PODate,'Status'=>$POStatus,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$CreateBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'CreatedDate'=>$updateddt,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ExchangeRate'=>$Exchangerate,'ExchangeRateCalculatedon'=>$ExchangeRateCalculatedon,'CurrencyType'=>$CurrencyType,'PaymentTerms'=>$PaymentTerms,'PayableAT'=>$Payableat,'PaymentDays'=>$PaymentDays); + //echo $PONO; + //echo $TotalOrder; + //print_r($POList); + //die(); + + $POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); + //echo "sdasds"; + $LineItemStatus = REQITEM_NEW; + //echo $LineItemStatus; + + + + //echo $RowCount; + for ($i = 1; $i <= $RowCount; $i++) + { + + $MaterialCode = $this->input->post('materialCode'.$i); + + $Quantity = $this->input->post('quantity'.$i); + //echo $Quantity; $Reqnumber = $this->input->post('Reqnumber'.$i); $itemRate = $this->input->post('itemRate'.$i); + ; + //die(); //$Exchangerate = $this->input->post('Exchangerate'.$i); $BasicPriceinmton = $this->input->post('BasicPriceInMTon'.$i); - $Productprice = $this->input->post('BasicAmt'.$i); + $Productprice = $this->input->post('TotalValue'.$i); + //echo $ProductPrice; + //die(); $LandingCharge = $this->input->post('LandingCharge'.$i); $AfterLandingCharge = $this->input->post('AfterLandingCharge'.$i); $HighSeas = $this->input->post('HighSeasSalesCharge'.$i); @@ -1419,80 +1470,113 @@ $createddt=''; $AfterAddAdtional = $this->input->post('AfterAddlExciseDuty'.$i); $Grossdutypayable = $this->input->post('Grossdutypayable'.$i); + //echo $Grossdutypayable; + //die(); + $AvailableModvat = $this->input->post('AvailableModvat'.$i); + $Grossexpensesduetocustomduty = $this->input->post('Grossexpensesduetocustomduty'.$i); + + $purchaseratePerKG = $this->input->post('purchaseratePerKG'.$i); + $CustomDutyExpensesPerKG = $this->input->post('CustomDutyExpensesPerKG'.$i); + $RMCIncludingCustomersPerKG = $this->input->post('RMCIncludingCustomersPerKG'.$i); + $QuantityKG = $this->input->post('QuantityKG'.$i); - + $POLineItemNo = $this->input->post('LineItemNo'.$i); + $CostCenter = $this->input->post('costCode'.$i); + //$ExciseDutySH = $this->input->post('ExcisedutySH'.$i); $Totalvalueitem=$this->input->post('TotalValue'.$i); + // echo $Totalvalueitem; + //die(); $LineItemNo = ''; - // echo "sdsfsd"; - //die(); - - //$currencytypeID = $this->input->post('currencytype'); - $SkipInsert = "False"; - if( count($comma_separated) > 0) - { - for($j = 1; $j < count($comma_separated); $j++) - { - $deletedRow = $comma_separated[$j] ; - - if($deletedRow == $i ) - { - $SkipInsert = "True"; - break; - } - - } - } - if($SkipInsert == "False") - { - if(strlen($POLineItemNo) == 0) - { - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter); - if(count($POLineItem)>0) - { - $LineItemNo = $POLineItem[0]['LineItemNo']; - } - - } - else - { - $LineItemNo = $POLineItemNo; - - $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'UpdateBY'=>$updatedBy,'UpdatedOn'=>$updateddt,'CostCenterCode'=>$CostCenter); - $POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$POLineItemNo,$POLineItemList); - - } - $isExists = $this->purchaseorder_model->LineItemExistsinImportTax($LineItemNo); - if(count($isExists) == 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); - //print_r($ImportTaxList); - //die(); - $ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList); - - } - else - { - $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); - - //print_r($ImportTaxList); - //die(); - $this->purchaseorder_model->updateImportTax($LineItemNo,$ImportTaxList); - - } - } - - } - - echo 'Purchase Order Updated Successfully! PO Number Is: '.$PONO ; + //echo "sdsfsd"; + //die(); + + $currencytypeID = $this->input->post('currencytype'); + $SkipInsert = "False"; + if( count($comma_separated) > 0) + { + for($j = 1; $j < count($comma_separated); $j++) + { + $deletedRow = $comma_separated[$j] ; + + if($deletedRow == $i ) + { + $SkipInsert = "True"; + break; + } + + } + } + if($SkipInsert == "False") + { + if(strlen($POLineItemNo) == 0) + { + $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$CreateBy,'CreatedDate'=>$createddt,'CostCenterCode'=>$CostCenter); + $POLineItem=$this->purchaseorder_model->addPOLineItem($POLineItemList); + if(count($POLineItem)>0) + { + $LineItemNo = $POLineItem[0]['LineItemNo']; + } + + } + else + { + + + + $LineItemNo = $POLineItemNo; + //echo $LineItemNo; + //die(); + + $POLineItemList = array('PONO'=>$PONO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'UpdatedOn'=>$updateddt,'CostCenterCode'=>$CostCenter); + $POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO,$POLineItemNo,$POLineItemList); + + } + $isExists = $this->purchaseorder_model->LineItemExistsinImportTax($LineItemNo); + //echo $isExists; + + //die(); + if(count($isExists) == 0) + { + print_r(count($isExists)); + //echo $isExists; + //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,'UpdatedOn'=>$updateddt,'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(); + $ImportList = $this->purchaseorder_model->addImportTax($ImportTaxList); + + } + else + { + //echo "xxcx"; + //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,'UpdatedOn'=>$updateddt,'AfterExciseDutySHCess'=>$AfterExciseDutySH,'AfterAddlExciseDuty'=>$AfterAddAdtional,'Grossdutypayable'=>$Grossdutypayable,'AvailableModvat'=>$AvailableModvat,'Grossexpensesduetocustomduty'=>$Grossexpensesduetocustomduty,'purchaseratePerKG'=>$purchaseratePerKG,'CustomDutyExpensesPerKG'=>$CustomDutyExpensesPerKG,'RMCIncludingCustomersPerKG'=>$RMCIncludingCustomersPerKG,'QuantityKG'=>$QuantityKG,'AfterCustomSHCess'=>$AfterCustomSH,'AfterCustomEdCess'=>$AfterCustomEd,'TotalValue'=>$Totalvalueitem); + //echo "cxvc "; + //die(); + //print_r($ImportTaxList); + //die(); + $this->purchaseorder_model->updateImportTax($LineItemNo,$ImportTaxList); + + + } + } + + } + + + echo 'Purchase Order Updated Successfully! PO Number Is: '.$PONO ; } + /* All Function following This command for FINANCE TEAM PO APPROVAL SCREEN*/ diff --git a/application/views/editimportpo.php b/application/views/editimportpo.php old mode 100755 new mode 100644 index 067d11c0..9bcf5dd5 --- a/application/views/editimportpo.php +++ b/application/views/editimportpo.php @@ -1760,8 +1760,7 @@ body { - - + AfterLandingCharge; $tothighseas = $tothighseas + $record->AfterHighSeasSalesCharge; $totcustom = $totcustom + $record->AfterCustomDuty; - $totexciseduty = $totexciseduty + $record->ExciseDuty; - $totexcisedutyED = $totexcisedutyED + $record->ExciseDutyEdCess; + $totexciseduty = $totexciseduty + $record->AfterExciseDuty; + $totexcisedutyED = $totexcisedutyED + $record->AfterExciseDutyEdCess; $totexciseSH = $totexciseSH + $record->AfterExciseDutySHCess; $totcustomED = $totcustomED +$record->AfterCustomEdCess; - $totcustomSH = $totcustomSH + $record->CustomSHCess; - $totaddtnlexcise= $totaddtnlexcise + $record->AddlExciseDuty; + $totcustomSH = $totcustomSH + $record->AfterCustomSHCess; + $totaddtnlexcise= $totaddtnlexcise + $record->AfterAddlExciseDuty; $totgrossduty = $totgrossduty + $record->Grossdutypayable; $totavlmodvat = $totavlmodvat +$record->AvailableModvat; $totgrossduty=$totgrossduty+$record->Grossdutypayable; $totavlmodvat=$totavlmodvat+$record->AvailableModvat; $totgrossexpense=$totgrossexpense+$record->Grossexpensesduetocustomduty; $ExchangeRate=$record->ExchangeRate; - $totorder=$totorder+$record->BasicPriceInMTon; + //$totorder=$totorder+$record->ProductPrice; + $totorder=$totorder+$record->ProductPrice; + //alert($totorder); @@ -2130,7 +2131,7 @@ $('#drpSupplier').change(function() { $("#SupAddress").val(obj.Address); $("#PayableAT").val(obj.PayableAT); var a=obj.PaymentDays; - console.log(a); + // console.log(a); if (a=="After") { //alert(); @@ -3243,7 +3244,7 @@ $('.AddImport').click(function() //index = parseInt(index)+1; - populateValueMainFormForImportTax(); + // populateValueMainFormForImportTax(); //alert('in'); @@ -3313,7 +3314,8 @@ $('.AddImport').click(function() //addHidden(theForm,"AfterBasicPriceTax"+temp,AfterBasicPriceTax); $('#txtRow').val(index); var a=parseFloat($('#txtRow').val()); - alert(a) + //alert(a) + populateValueMainFormForImportTax(); clearTaxField(); @@ -3387,8 +3389,11 @@ function populateValueMainFormForImportTax() { //$('#txtToatlOrder').val(parseFloat(TotalOrderValue)).toFixed(2); - +//var Aft=$('#AfterLandingCharge').val(); +//console.log(Aft); var AfterLandingCharge= $('#AfterLandingCharge').val() == '' ? '0.00' : $('#AfterLandingCharge').val(); + +//console.log(AfterLandingCharge); var AfterHighseas=$('#AfterHighseas').val()==''?'0.00':$('#AfterHighseas').val(); var AfterCustomduty=$('#AfterCustomduty').val()==''?'0.00':$('#AfterCustomduty').val(); var AfterExcisedutyTax=$('#AfterExcisedutyTax').val()==''?'0.00':$('#AfterExcisedutyTax').val(); @@ -3401,7 +3406,10 @@ var Grossdutypayable=$('#Grossdutypayable').val()==''?'0.00':$('#Grossdutypayabl var AvailableModvat=$('#AvailableModvat').val()==''?'0.00':$('#AvailableModvat').val(); var Grossexpenses=$('#Grossexpenses').val()==''?'0.00':$('#Grossexpenses').val(); var totalexp=$('#TotalExp').val()==''?'0.00':$('#TotalExp').val(); -var TotalLanding=$('#txttotallanding').val()==''?'0.00':$('#txttotallanding').val(); +//var TotalLanding=$('#txttotallanding').val()==''?'0.00':$('#txttotallanding').val(); +var TotalLanding=parseFloat($('#txttotallanding').val()); +//alert(TotalLanding); +//console.log(TotalLanding); var TotalHighseas=$('#txttotalhighseas').val()==''?'0.00':$('#txttotalhighseas').val(); var TotalCustom=$('#txttotalcustom').val()==''?'0.00':$('#txttotalcustom').val(); var TotalExcise=$('#txttotalexcise').val()==''?'0.00':$('#txttotalexcise').val(); @@ -3414,6 +3422,8 @@ var TotalGrossDuty=$('#txttotalgrossduty').val()==''?'0.00':$('#txttotalgrossdut var TotalAvlmodvat=$('#txttotalavlmodvat').val()==''?'0.00':$('#txttotalavlmodvat').val(); var TotalGrossExpense=$('#txttotalgrossexpense').val()==''?'0.00':$('#txttotalgrossexpense').val(); var TotalOrder=$('#txtToatlOrder').val()==''?'0.00':$('#txtToatlOrder').val(); + + $('#txttotallanding').val((parseFloat(AfterLandingCharge) + parseFloat(TotalLanding)).toFixed(2) ); $('#txttotalhighseas').val((parseFloat(TotalHighseas) + parseFloat(AfterHighseas)).toFixed(2) ); $('#txttotalcustom').val((parseFloat(TotalCustom) + parseFloat(AfterCustomduty)).toFixed(2) ); @@ -3427,7 +3437,9 @@ $('#txttotalgrossduty').val((parseFloat(TotalGrossDuty) + parseFloat(Grossdutypa $('#txttotalavlmodvat').val((parseFloat(TotalAvlmodvat) + parseFloat(AvailableModvat)).toFixed(2) ); $('#txttotalgrossexpense').val((parseFloat(TotalGrossExpense) + parseFloat(Grossexpenses)).toFixed(2) ); $('#txtToatlOrder').val((parseFloat(TotalOrder) + parseFloat(totalexp)).toFixed(2) ); -//alert(JSON.stringify(totalexp)); +var r=parseFloat($('#txtToatlOrder').val()); +console.log(r); +//alert(JSON.stringify(txttotallanding)); //alert(TotalOrder); @@ -3924,7 +3936,7 @@ if(validate()) $('#txtDeletedRow').val(''); //$('#SpcialInstruction').val(''); //$('#txtDeliveryAddress').val(''); - // window.location = "purchaseorderListing"; + window.location = "purchaseorderListing"; } else diff --git a/application/views/importpopdf.php b/application/views/importpopdf.php index e2252bd0..519fe41e 100755 --- a/application/views/importpopdf.php +++ b/application/views/importpopdf.php @@ -210,7 +210,7 @@ Rate ; ?> Quantity*$record->Rate); echo number_format($BasicValue,2) ; ?> - BasicPriceInMTon; ?> + ProductPrice; ?>