diff --git a/application/controllers/amendmentpurchaseorder.php b/application/controllers/amendmentpurchaseorder.php index 41c3c5eb..aef4116c 100755 --- a/application/controllers/amendmentpurchaseorder.php +++ b/application/controllers/amendmentpurchaseorder.php @@ -228,8 +228,11 @@ class amendmentpurchaseorder extends BaseController function EditRevenuePurchaseOrder() { - $NewPO='0'; + $NewPO=''; + $MAD=''; + $PONO =$this->input->post('txtPONO'); + //echo "Revenue Amendment"; //echo "OLD PO IS" . $PONO; $POdt =$this->input->post('PODate'); @@ -238,22 +241,44 @@ class amendmentpurchaseorder extends BaseController $POType = $this->input->post('POType'); $DeliveryAddr = $this->input->post('txtDeliveryAddress'); $dt = $this->input->post('Deliverydt'); + $predeliverydate=$this->input->post('beforeDeliverydt'); + $preschedule=$this->input->post('beforeScheduleby'); //$Deliverydt = $this->getDateformat($dt); + $DeliverySchedule = $this->input->post('Scheduleby'); $DeliveryOption = $this->input->post('DateRange'); - if($DeliveryOption==1){ - $Deliverydt = ''; - $DeliverySchedule = $this->input->post('Scheduleby'); - } - else{ - $Deliverydt = $this->getDateformat($dt); - $DeliverySchedule = ''; - } + + if($DeliveryOption==1){ + $Deliverydt = ''; + $DeliverySchedule = $this->input->post('Scheduleby'); + } + else{ + $Deliverydt = $this->getDateformat($dt); + $DeliverySchedule = ''; + } + + //$predeliverydate=$this->getDateformat($predeliverydate); + + $POType = $this->input->post('POType'); $PoRange = $this->input->post('txtPoRange'); $PaymentTerms=$this->input->post('PaymentTerms'); + $prePaymentTerms=$this->input->post('beforePaymentTerms'); + if($PaymentTerms!=$prePaymentTerms) + { + $MAD="Amended PaymentTerms :  ". $prePaymentTerms ."
"; + } - - + if(($dt) != ($predeliverydate)) + { + + $predeliverydate = $this->getDateformat($dt); + $MAD.='Amended Delivery Date :    ' . $predeliverydate . '
' ; + } + if($DeliverySchedule != $preschedule) + { + $MAD.="Amended Schedule :  " . $preschedule."
"; + } + $SpcialInstruction = $this->input->post('SpcialInstruction'); $TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary'); @@ -262,26 +287,29 @@ class amendmentpurchaseorder extends BaseController $updatedBy = $this->session->userdata ( 'userId' ); $RowCount = $this->input->post('txtRowCount'); - + //echo "Rowcount is" . $RowCount; + //die(); $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $updateddt = $dt->format('Y-m-d H:i:s'); // PO Master // PO Master - $POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID,'POType'=>$POType,'PaymentTerms'=> $PaymentTerms,'PayableAT'=>$PayableAT,'PaymentDays'=>$PaymentDays,'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>'ST015','DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt ); + $POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID,'POType'=>$POType,'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>PO_RELEASED,'PaymentTerms'=>$PaymentTerms,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpcialInstruction,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'AmendedDetails'=>$MAD); //print_r($POMaster); - //$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList); - $LastPO = $this->purchaseorder_model->addPOMaster($POMaster); - foreach($LastPO as $PO): - $NewPO=$PO['PONO']; - endforeach; + + $LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster,$updatedBy,$PONO); + if(count($LastPO)>0) + { + $NewPO = $LastPO[0]['PONO']; + } + //echo "NEW PO IS " . $NewPO; //echo ""; //change old po status as Amendment - $PODetail=array('Status'=>"ST030");//TO SET PARENT PO AS AMENDMENT STATUS + $PODetail=array('Status'=>PO_AMENDED);//TO SET PARENT PO AS AMENDMENT STATUS //print_r($PODetail); $APO=$this->purchaseorder_model->updateAmendPOMaster($PONO,$PODetail); - echo $APO."Affected"; + //echo $APO."Affected"; //die(); //print_r($LastPO); @@ -296,54 +324,124 @@ class amendmentpurchaseorder extends BaseController for ($i = 1; $i <= $RowCount; $i++) { //echo "inside loop"; + $CAD=''; $MaterialCode = $this->input->post('materialCode'.$i); $Quantity = $this->input->post('quantity'.$i); + $preqty=$this->input->post('beforeqty'.$i); $Reqnumber = $this->input->post('Reqnumber'.$i); $itemRate = $this->input->post('itemRate'.$i); - + $preitemrate=$this->input->post('beforeitemRate'.$i); $DiscountType = $this->input->post('DisType'.$i); $DiscountValue = $this->input->post('DisVal'.$i); + $preDiscountValue = $this->input->post('beforeDisVal'.$i); $AfterDiscount = $this->input->post('AfterDisVal'.$i); $PackagingOption = $this->input->post('PackOption'.$i); $PackagingType = $this->input->post('PackType'.$i); $PackagingValue = $this->input->post('PackVal'.$i); + $prePackagingValue = $this->input->post('beforePackVal'.$i); $AfterPackagingValue = $this->input->post('AfterPackVal'.$i); - $ExciseOption = $this->input->post('ExciseOption'.$i); - $ExciseValue = $this->input->post('ExciseVal'.$i); - $AfterExciseValue = $this->input->post('AfterExciseVal'.$i); - $VatOption = $this->input->post('VatOption'.$i); + $VatOption = $this->input->post('VatOption'.$i);//SGST $VatValue = $this->input->post('VatVal'.$i); + $preVatValue = $this->input->post('beforeVatVal'.$i); $AfterVatValue = $this->input->post('AfterVatVal'.$i); - $CSTOption = $this->input->post('CSTOption'.$i); - $CSTValue = $this->input->post('CSTVal'.$i); - $AfterCSTValue = $this->input->post('AfterCSTVal'.$i); - $GSTValue = $this->input->post('GSTVal'.$i); + $GSTValue = $this->input->post('GSTVal'.$i);//CGST + $preGSTValue = $this->input->post('beforeGSTVal'.$i); $AfterGSTValue = $this->input->post('AfterGSTVal'.$i); - $OtherTaxValue = $this->input->post('OtherTaxVal'.$i); + $OtherTaxValue = $this->input->post('OtherTaxVal'.$i);//IGST + $preOtherTaxValue = $this->input->post('beforeOtherTaxVal'.$i); $AfterOtherTaxValue = $this->input->post('AfterOtherTaxVal'.$i); $FreightType = $this->input->post('FreightType'.$i); $FreightValue = $this->input->post('FreightVal'.$i); + $preFreightValue = $this->input->post('beforeFreightVal'.$i); $AfterFreightValue = $this->input->post('AfterFreightVal'.$i); $InsuranceValue = $this->input->post('Insval'.$i); + $preInsuranceValue = $this->input->post('beforeInsval'.$i); $TotalOrderValue = $this->input->post('TotalOrderValue'.$i); $POLineItemNo = $this->input->post('LineItemNo'.$i); $CostCenter = $this->input->post('costCode'.$i); + $ServiceFrequency=$this->input->post('Frequency'.$i); $LineItemNo = ''; + $RecQtyvalue=0; + $rowspanvalue=0; + if(($Quantity-$preqty)!=0) + { + $rowspanvalue++; + $CAD="Amended Qty :".$preqty ."Current Qty:".$Quantity.""; + } + if(($itemRate-$preitemrate)!=0) + { + $rowspanvalue++; + $CAD.="Amended Rate :" . $preitemrate."Current Item Rate:".$itemRate.""; + } + if(($DiscountValue-$preDiscountValue)!=0) + { + $rowspanvalue++; + $CAD.="Amended Discount:". $preDiscountValue ."Current Discount Value:".$itemRate.""; + } + if(($PackagingValue-$prePackagingValue)!=0) + { + $rowspanvalue++; + $CAD.="Amended PackageValue:". $prePackagingValue."Current Packaginf Value:".$PackagingValue.""; + } + if(($VatValue-$preVatValue)!=0)//SGST + { + $rowspanvalue++; + $CAD.="Amended SGST value:". $preVatValue."Current SGST Value:".$VatValue.""; + } + if(($GSTValue-$preGSTValue)!=0)//CGST + { + $rowspanvalue++; + $CAD.="Amended CGSTValue:". $preGSTValue."Current CGST Value:".$GSTValue.""; + } + if(($OtherTaxValue-$preOtherTaxValue)!=0)//IGST + { + $rowspanvalue++; + $CAD.="Amended IGST Value:". $preOtherTaxValue."Current IGST Value:".$OtherTaxValue.""; + } + if(($FreightValue-$preFreightValue)!=0) + { + $rowspanvalue++; + $CAD.="Amended FreightValue:". $preFreightValue."Current Freight Value:".$FreightValue.""; + } + if(($InsuranceValue-$preInsuranceValue)!=0) + { + $rowspanvalue++; + $CAD.="Amended InsuranceValue:". $preInsuranceValue."Current Insurance Value:".$InsuranceValue.""; + } + if($rowspanvalue>0) + { + $rowspanvalue++; + + $CAD2=''; + $CAD2=$CAD; + $CAD=''; + $CAD="".$MaterialCode.""; + $CAD.=$CAD2; + } + + + $ReceivedQty = $this->purchaseorder_model->GetLineItemReceivedQty($PONO,$MaterialCode); + + if(count($ReceivedQty)>0) + { + $RecQtyvalue = $ReceivedQty[0]['ReceivedQuantity']; + } + - - $POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter); - + $POLineItemList = array('PONO'=>$NewPO, 'ReqNo'=>$Reqnumber,'MaterialCode'=>$MaterialCode,'ReceivedQuantity'=>$RecQtyvalue,'Quantity'=>$Quantity,'Rate'=>$itemRate,'Status'=>$LineItemStatus,'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt,'CostCenterCode'=>$CostCenter,'ServiceFrequency'=>$ServiceFrequency,'AmendedDetails'=>$CAD); + //print_r($POLineItemList); $POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList); - foreach($POLineItem as $line): - $LineItemNo = $line['LineItemNo']; - endforeach; + if(count($POLineItem)>0) + { + $LineItemNo = $POLineItem[0]['LineItemNo']; + } - $RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'ExciseDuty'=>$ExciseValue,'ExciseDutyCalulatedOn'=>$ExciseOption,'AfterExciseDuty'=>$AfterExciseValue,'Vat'=>$VatValue,'AfterVAT'=>$AfterVatValue,'VatCalulatedOn'=>$VatOption, 'CST'=>$CSTValue,'AfterCST'=>$AfterCSTValue,'CSTCalulatedOn'=>$CSTOption,'GST'=>$GSTValue,'AfterGST'=>$AfterGSTValue,'OtherTaxes'=>$OtherTaxValue,'AfterOtherTaxes'=>$AfterOtherTaxValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt); - + $RevenueTaxList = array('LineItemNo'=>$LineItemNo, 'DiscountType'=>$DiscountType,'DiscountValue'=>$DiscountValue,'AfterDiscount'=>$AfterDiscount,'PackagingType'=>$PackagingType,'PackagingValue'=>$PackagingValue,'PackagingCalulatedOn'=>$PackagingOption,'AfterPackagingValue'=>$AfterPackagingValue,'FreightType'=>$FreightType, 'FreightValue'=>$FreightValue,'AfterFreightValue'=>$AfterFreightValue,'Vat'=>$VatValue,'AfterVAT'=>$AfterVatValue,'GST'=>$GSTValue,'AfterGST'=>$AfterGSTValue,'OtherTaxes'=>$OtherTaxValue,'AfterOtherTaxes'=>$AfterOtherTaxValue,'Insurance'=>$InsuranceValue,'TotalValue'=>$TotalOrderValue, 'CreatedBy'=>$updatedBy,'CreatedDate'=>$updateddt); + // print_r($RevenueTaxList); $RevenueList = $this->purchaseorder_model->addRevenueTax($RevenueTaxList); } @@ -959,6 +1057,499 @@ function UpdateAmendServicePurchaseOrder() } echo 'Purchase Order is'.$PONO.'Amended Successfully! New PO Number is: '.$NewPO ; } + +function CreateAmendPOPrint() + { + $PONO = $_GET['PONO']; + $ReqType = $_GET['ReqType']; + + if($ReqType == SERVICE) + { + $this ->servicepoprint($PONO); + + } + else if($ReqType == REVENUE) + { + $this ->revenuepoprint($PONO); + + } + + else if($ReqType == IMPORT) + { + $this ->importpoprint($PONO); + + } + else if($ReqType == CAPITAL) + { + $this ->CapitalPoPrint($PONO); + + } + } + + + public function revenuepoprint($PONO) + { + // Load all views as normal + + + + + $data['CompanyDetails'] = $this->purchaseorder_model->getCompanyInformation(); + $data['POItem'] = $this->purchaseorder_model->GetRevenuePurchaseOrderDetailsForPDF($PONO); + //print_r($data['POItem']); + //die(); + $data['releasedetails'] = $this->purchaseorder_model->GetReleasedDetails($PONO); + $data['CurrencySymbol']=$this->purchaseorder_model->GerCurrencyCodeName('INR'); + + $Currencycode=''; + + $TotalOrderValue=$data['POItem'][0]->TotalOrderValue; + + $totalAmt=sprintf("%.2f", $TotalOrderValue); + + // die(); + + $data['TotalAmountInWords']= $this->convertNumber($totalAmt); + + $data['RequistionDetails'] = $this->purchaseorder_model->GetPdfRequistionDetails($PONO); + + // Add header to pdf + //$this->load->view('includes/pdfheader'); + + // Load the pdf page with multiviews + $this->load->View("Amendrevenuepopdf", $data); + + // Add header to pdf + //$this->load->view('includes/pdffooter'); + + // Get output html + $php = $this->output->get_output(); + + // // Load library + $this->load->library('dompdf_gen'); + + // // Convert to PDF + $this->dompdf->load_html($php); + $this->dompdf->render(); + $data['Attachment'] = FALSE; + $this->dompdf->stream("Amendrevenuepopdf.pdf",$data,$php); + +} + + +public function convertNumber($number) + +{ + + list($integer, $fraction) = explode(".", (string) $number); + + $output = "Rupee"." "; + + if ($integer{0} == "-") + + { + + $output = "negative "; + + $integer = ltrim($integer, "-"); + + } + + else if ($integer{0} == "+") + + { + + $output = "positive "; + + $integer = ltrim($integer, "+"); + + } + + if ($integer{0} == "0") + + { + + $output .= "zero"; + + } + + else + + { + + $integer = str_pad($integer, 36, "0", STR_PAD_LEFT); + + $group = rtrim(chunk_split($integer, 3, " "), " "); + + $groups = explode(" ", $group); + + $groups2 = array(); + + foreach ($groups as $g) + + { + + $groups2[] = $this->convertThreeDigit($g{0}, $g{1}, $g{2}); + + } + + for ($z = 0; $z < count($groups2); $z++) + + { + + if ($groups2[$z] != "") + + { + + $output .= $groups2[$z] . $this->convertGroup(11 - $z) . ( + + $z < 11 + + && !array_search('', array_slice($groups2, $z + 1, -1)) + + && $groups2[11] != '' + + && $groups[11]{0} == '0' + + ? " " + + : ", " + + ); + + } + + } + + $output = rtrim($output, ", "); + + } + + if ($fraction > 0) + + { + + $output .= " paise"; + + for ($i = 0; $i < strlen($fraction); $i++) + + { + + $output .= " " . $this->convertDigit($fraction{$i}); + + } + + } + + return $output; + +} + +public function convertThreeDigit($digit1, $digit2, $digit3) + +{ + + $buffer = ""; + + if ($digit1 == "0" && $digit2 == "0" && $digit3 == "0") + + { + + return ""; + + } + + if ($digit1 != "0") + + { + + $buffer .= $this->convertDigit($digit1) . " hundred"; + + if ($digit2 != "0" || $digit3 != "0") + + { + + $buffer .= " and "; + + } + + } + + if ($digit2 != "0") + + { + + $buffer .= $this->convertTwoDigit($digit2, $digit3); + + } + + else if ($digit3 != "0") + + { + + $buffer .= $this->convertDigit($digit3); + + } + + return $buffer; + +} + +public function convertTwoDigit($digit1, $digit2) + +{ + + if ($digit2 == "0") + + { + + switch ($digit1) + + { + + case "1": + + return "ten"; + + case "2": + + return "twenty"; + + case "3": + + return "thirty"; + + case "4": + + return "forty"; + + case "5": + + return "fifty"; + + case "6": + + return "sixty"; + + case "7": + + return "seventy"; + + case "8": + + return "eighty"; + + case "9": + + return "ninety"; + + } + + } else if ($digit1 == "1") + + { + + switch ($digit2) + + { + + case "1": + + return "eleven"; + + case "2": + + return "twelve"; + + case "3": + + return "thirteen"; + + case "4": + + return "fourteen"; + + case "5": + + return "fifteen"; + + case "6": + + return "sixteen"; + + case "7": + + return "seventeen"; + + case "8": + + return "eighteen"; + + case "9": + + return "nineteen"; + + } + + } else + + { + + $temp = $this->convertDigit($digit2); + + switch ($digit1) + + { + + case "2": + + return "twenty-$temp"; + + case "3": + + return "thirty-$temp"; + + case "4": + + return "forty-$temp"; + + case "5": + + return "fifty-$temp"; + + case "6": + + return "sixty-$temp"; + + case "7": + + return "seventy-$temp"; + + case "8": + + return "eighty-$temp"; + + case "9": + + return "ninety-$temp"; + + } + + } + +} + +public function convertDigit($digit) + +{ + + switch ($digit) + + { + + case "0": + + return "zero"; + + case "1": + + return "one"; + + case "2": + + return "two"; + + case "3": + + return "three"; + + case "4": + + return "four"; + + case "5": + + return "five"; + + case "6": + + return "six"; + + case "7": + + return "seven"; + + case "8": + + return "eight"; + + case "9": + + return "nine"; + + } + +} + +public function convertGroup($index) + +{ + + switch ($index) + + { + + case 11: + + return " decillion"; + + case 10: + + return " nonillion"; + + case 9: + + return " octillion"; + + case 8: + + return " septillion"; + + case 7: + + return " sextillion"; + + case 6: + + return " quintrillion"; + + case 5: + + return " quadrillion"; + + case 4: + + return " trillion"; + + case 3: + + return " billion"; + + case 2: + + return " million"; + + case 1: + + return " thousand"; + + case 0: + + return ""; + + } + +} function getDateformat($Val) diff --git a/application/models/purchaseorder_model.php b/application/models/purchaseorder_model.php index 14aa648c..637bb396 100755 --- a/application/models/purchaseorder_model.php +++ b/application/models/purchaseorder_model.php @@ -569,7 +569,7 @@ function purchaseorderListing($forwhat='') Mat.UOM,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue , ROUND(((AfterPackagingValue + AfterFreightValue + AfterExciseDuty + AfterVAT + AfterCST + AfterGST + AfterOtherTaxes + Insurance)) ,2)as Taxamount , - TotalValue,Tax.*,CostCenterCode ,POMaster.*,sup.SupplierName,sup.Address + TotalValue,Tax.*,LineItem.CostCenterCode ,POMaster.*,sup.SupplierName,sup.Address FROM T_PurchaseOrder_LineItem LineItem join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode join T_Revenue_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo diff --git a/application/views/AmendPOlist.php b/application/views/AmendPOlist.php index 260bbf8f..61723c37 100755 --- a/application/views/AmendPOlist.php +++ b/application/views/AmendPOlist.php @@ -73,7 +73,7 @@     -         +         diff --git a/application/views/Amendrevenuepopdf.php b/application/views/Amendrevenuepopdf.php new file mode 100644 index 00000000..72713fc1 --- /dev/null +++ b/application/views/Amendrevenuepopdf.php @@ -0,0 +1,367 @@ + CompanyName; + $CompanyAddress = $CO->Address; + + } + } + if(!empty($POItem)) + { + + foreach ($POItem as $PO) + { + $PONO = $PO->PONO; + $postatus= $PO->Status; + $SuplierName = $PO->SupplierName; + $SuplierAddress = $PO->Address; + $DeliveryAddress = $PO->DeliveryAddress; + $postatus= $PO->Status; + $dt = new DateTime($PO->PODate, new DateTimeZone('Asia/Kolkata')); + $Podt = $dt->format('d-m-Y'); + if($PO->DeliveryOption=='1'){ + $DeliveryDate = ''; + $DeliverySchedule = $PO->DeliverySchedule; + } + else{ + $dtDe = new DateTime($PO->DeliveryDate, new DateTimeZone('Asia/Kolkata')); + $DeliveryDate = $dtDe->format('d-m-Y'); + $DeliverySchedule = ''; + } + + + $ServiceDescription =$PO->ServiceDescription; + $PaymentTerms = $PO->PaymentTerms; + $PaymentDays=$PO->PaymentDays; + $PayableAT=$PO->PayableAT; + + } +} + $currencyName='INR'; + $currencyCode =''; + if(!empty($CurrencySymbol)) + { + foreach ($CurrencySymbol as $Curr) + { + + $currencyCode = $Curr->FontCode2000; + //$currencyName = $currencyName; + + + } + + } + + if(!empty($ParentMaster)){ + foreach($ParentMaster as $pm){ + $PPaymentTerms = $pm->PaymentTerms; + + $PDeliverydate= $pm->DeliveryDate; + $dtDe = new DateTime($PDeliverydate, new DateTimeZone('Asia/Kolkata')); + $PDeliverydate = $dtDe->format('d-m-Y'); + $PDeliverySchedule=$pm->DeliverySchedule; + } + + } + + + ?> + + + +
+
+ DRAFT
'; + } + + ?> +
+
 
+
SIDDHARTH INDUSTRIES - PURCHASE ORDER - PO NO:
+
+ + + + + + + +
+


+
+ + + + + + + + + +
Vendor Address :

Delivery To :
+ + + + + + + +
PO DATE :DELIVERY DATE / SCHEDULE BY :
+
+ +

 

+
+ + + + + + + + + + + + + + + + + + +
Requistion NumberRequested ByRequested DepartmentCost Center
+ +

 

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + BasicValue; + $AfterExciseDuty =$AfterExciseDuty + $record->AfterExciseDuty; + $AfterVAT =$AfterVAT + $record->AfterVAT; + $AfterGST =$AfterGST + $record->AfterGST; + $AfterOtherTaxes =$AfterOtherTaxes + $record->AfterOtherTaxes; + $Insurance =$Insurance + $record->Insurance; + $AfterFreightValue =$AfterFreightValue + $record->AfterFreightValue; + $AfterDiscount = $AfterDiscount + $record->AfterDiscount ; + $AfterPackaging=$AfterPackaging+$record->AfterPackagingValue; + } + + + ?> +
#Item CodeItem DescriptionUOMQtyRate In INRBasic Value In INRDiscount In INRCGST In INRSGST In INRIGST In INRInsurance In INRPackaging In INRFreight In INRTotal Amount In INR
MaterialCode ; ?>MaterialName ; ?>UOM ; ?>Quantity ; ?>Rate ; ?>BasicValue ; ?>AfterDiscount; ?>AfterVAT ; ?>AfterGST ; ?>AfterOtherTaxes ; ?>Insurance ; ?>AfterPackagingValue ; ?>AfterFreightValue ; ?>BasicValue+$record->AfterExciseDuty + + $record->AfterVAT+$record->AfterCST+$record->AfterGST + $record->AfterOtherTaxes + $record->Insurance+ $record->AfterFreightValue+$record->AfterPackagingValue)- $record->AfterDiscount); + echo number_format($TotalAmount,2) ; ?>
+ + + + + +
+ + + + + + + + + + + + + + + lineamd ;?> + + + +
+

Amended Details

+
+" . $v->AmendedDetails . ""; + break; + } +}?> +
Item Descriptionprevious DetailsCurrent Details
+ + + + + + + + + + + + + + + + + + +
Total Amount In Words

 Total Amount Before Tax In INR  
 Total Tax Amount In INR  
 Total Amount After Tax In INR  
+

 Payment Terms

+

+
+

 Certified that the particulars given above are true and correct

+

+

 

+

Authorized Signatory

+
+

 

+
Special Instruction:
+ + ReleasedOn, new DateTimeZone('Asia/Kolkata')); + + + ?> + + + + + + + + + + + + + +
Released By:Released On:
FirstName;?>format('d-m-Y');?>
+ + + + +
+
+ + + \ No newline at end of file diff --git a/application/views/editRevenueAmendPO.php b/application/views/editRevenueAmendPO.php index 23fda964..824035ee 100755 --- a/application/views/editRevenueAmendPO.php +++ b/application/views/editRevenueAmendPO.php @@ -59,6 +59,7 @@ foreach ($PaymentTerms as $TER) if(!empty($POMaster)) { // print_r($POMaster); + // print_r($Payment); // echo "****"; // print_r($PaymentTerms); @@ -75,6 +76,7 @@ if(!empty($POMaster)) $Ddt = new DateTime($Req->DeliveryDate); $Deliverydt = $Ddt->format('Y-m-d'); + $DeliveryAddress =$Req->DeliveryAddress; $POStatus = $Req->StatusCode; $PONO = $Req->PONO; @@ -183,213 +185,6 @@ $("#Requeston").datepicker({ }); - - - - -$('#drpSupplier').change(function() { - - var id = $('#drpSupplier').val(); - $("#SupAddress").val(''); - - if(id != '0') - { - var y = ; - - - $.each(y, function(idx, obj) { - if(obj.SupplierID === id) - { - $("#SupAddress").val(obj.Address); - - } - - }); - - } - else - { - alert('Please select the SupplierID'); - return false; - } - -}); - -$('#ReqNo').change(function() { - - var id = $('#ReqNo').val(); - $("#deptName").val(''); - $("#CostCenter").val(''); - $("#MaterialCode").empty(); - $("#ItemName").val(''); -$("#UOM").val(''); -$("#Quantity").val(''); -$("#ItemName").val(''); -$("#Rate").val(''); -$("#txtBasicValue").val(''); -$("#AvlBudAmt").val(''); - resetTaxField(); - if(id != '0') - { - var y = ; - - var Material = ; - var AvlBudAmt = ''; - // For Binding DepartmentName - $.each(y, function(idx, obj) { - if(obj.ReqNo === id) - { - $("#deptName").val(obj.DepartmentName); - $("#CostCenter").val(obj.CostCenterCode); - } - }); - $("#AvlBudAmt").val(AvlBudAmt); - // For Binding Material list center for the selected Requistion Number - $("#MaterialCode").append( $('').val("0").html("Select Material Code") ); - - var isAdded = "0"; - for(i=0;i').val(obj.MaterialCode).html(obj.MaterialCode + "-" + obj.MaterialName)); - } - - } - - - }); - } - } - else - { - alert('Please select the Requisition Number'); - return false; - } - id = ''; - -}); -$('#MaterialCode').change(function() { - - var id = $('#MaterialCode').val(); - $("#ItemName").val(''); -$("#UOM").val(''); -$("#Quantity").val(''); -$("#ItemName").val(''); -$("#Rate").val(''); -$("#txtBasicValue").val(''); - RequistQuantity = ''; - resetTaxField(); - if(id != '0') - { - var Material = ; - - for(i=0;i; - - for(i=0;i; - - } - else if(DiscountType == NilType ) - { - AfterDiscount = "0.00"; - } - else - { - AfterDiscount = ; - } - var discount = parseFloat(AfterDiscount).toFixed(2); - $('#txtAfterDiscount').val(discount); - } - else - { - $('#txtAfterDiscount').val("0.00"); - } - } - calculateTotalValue(); - } - else - { - if($('#EditMaterialCode').val() == "0") - { - alert('Please Select the Material Code'); - $('#EditMaterialCode').focus(); - return false; - } - else if($('#EditRate').val() == '') + if($('#EditRate').val() == '') { alert('Please Enter the Rate value'); $('#EditRate').focus(); @@ -657,94 +330,14 @@ function calculateDiscount(isEdit) } } calculateEditTotalValue(); - } + } /* * To calcuate the Packaging */ -function calculatePackaging(isEdit) +function calculatePackaging() { - if(isEdit == '0') - { - if($('#MaterialCode').val() == "0") - { - alert('Please Select the Material Code'); - $('#MaterialCode').focus(); - return false; - } - else if($('#Rate').val() == '') - { - alert('Please Enter the Rate value'); - $('#Rate').focus(); - return false; - } - else - { - - var basicValue = parseFloat($('#txtBasicValue').val()); - - var PackagingType =$("#PackagingType").val(); - - if(PackagingType == "0") - { - alert('Please select the Packaging Type'); - $('#txtPackaging').val(''); - $("#PackagingType").focus(); - } - - else if($('#txtPackaging').val() != '' && $('#txtPackaging').val() !='0') - { - var Packagingvalue = parseFloat($('#txtPackaging').val()); - var AfterPackaging = 0.0; - - if(PackagingType == PercentageType) - { - if($(PackagingCalculation != 0 && '#txtAfterDiscount').val() == '') - { - alert('Please Enter the Discount value'); - $('#txtPackaging').val(''); - $('#DiscountType').focus(); - - return false; - } - else - { - var AfterDiscount =parseFloat($('#txtAfterDiscount').val()); - AfterPackaging = PackagingCalculation == 0 ? : ; - } - - } - else if(PackagingType == NilType ) - { - AfterPackaging = "0.00"; - - } - else - { - - - AfterPackaging = PackagingCalculation == 0 ? : ; - - } - var Packaging = parseFloat(AfterPackaging).toFixed(2); - - $('#txtAfterPackaging').val(Packaging); - } - else - { - $('#txtAfterPackaging').val("0.00"); - } - } - calculateTotalValue(); - } - else - { - if($('#EditMaterialCode').val() == "0") - { - alert('Please Select the Material Code'); - $('#EditMaterialCode').focus(); - return false; - } - else if($('#EditRate').val() == '') + + if($('#EditRate').val() == '') { alert('Please Enter the Rate value'); $('#EditRate').focus(); @@ -806,273 +399,106 @@ function calculatePackaging(isEdit) } } calculateEditTotalValue(); - } - } - - function calculateExcise(isEdit) - { - if(isEdit == '0') - { - if($('#MaterialCode').val() == "") - { - alert('Please Select the Material Code'); - $('#MaterialCode').focus(); - $('#txtExciseDuty').val(''); - return false; - } - else if($('#Rate').val() == "0") - { - alert('Please Enter the Rate value'); - $('#txtExciseDuty').val(''); - $('#Rate').focus(); - return false; - } - - else - { - var basicValue = parseFloat($('#txtBasicValue').val()); - - - if($('#txtExciseDuty').val() != '' && $('#txtExciseDuty').val() != '0') - { - var AfterExciseDuty = 0.0; - var ExciseDuty = parseFloat($('#txtExciseDuty').val()); - if(ExciseCalculation == '0') - { - AfterExciseDuty = ; - } - else if(ExciseCalculation == '1') - { - if($('#txtAfterDiscount').val() == '') - { - alert('Please Enter the Discount value'); - $('#DiscountType').focus(); - $('#txtExciseDuty').val(''); - return false; - } - else - { - var AfterDiscount =parseFloat($('#txtAfterDiscount').val()); - AfterExciseDuty = ; - } - } - else if(ExciseCalculation == '2') - { - if($('#txtAfterDiscount').val() == '') - { - alert('Please Enter the Discount value'); - $('#DiscountType').focus(); - $('#txtExciseDuty').val(''); - return false; - } - else if($('#txtAfterPackaging').val() == '') - { - alert('Please Enter the Packaging value'); - $('#PackagingType').focus(); - $('#txtExciseDuty').val(''); - return false; - - } - else - { - var AfterDiscount =parseFloat($('#txtAfterDiscount').val()); - var AfterPackaging = parseFloat($('#txtAfterPackaging').val()); - AfterExciseDuty = ; - } - } - else - { - if($('#txtAfterPackaging').val() == '') - { - alert('Please Enter the Packaging value'); - $('#PackagingType').focus(); - $('#txtExciseDuty').val(''); - return false; - } - else - { - AfterExciseDuty = ; - var AfterPackaging = parseFloat($('#txtAfterPackaging').val()); - } - } - var ExciseVal = parseFloat(AfterExciseDuty).toFixed(2); - - $('#txtAfterExciseDuty').val(ExciseVal); - } - else - { - $('#txtAfterExciseDuty').val("0.00"); - } - - } - calculateTotalValue(); - } - else - { - if($('#EditMaterialCode').val() == "") - { - alert('Please Select the Material Code'); - $('#EditMaterialCode').focus(); - return false; - } - else if($('#EditRate').val() == "") - { - alert('Please Enter the Rate value'); - $('#EditRate').focus(); - return false; - } - - else - { - - var basicValue = parseFloat($('#txtEditBasicValue').val()); - - - - if($('#txtEditExciseDuty').val() != '' && $('#txtEditExciseDuty').val() != '0') - { - var AfterExciseDuty = 0.0; - var ExciseDuty = parseFloat($('#txtEditExciseDuty').val()); - if(ExciseCalculation == '0') - { - AfterExciseDuty = ; - } - else if(ExciseCalculation == '1') - { - if($('#txtEditAfterDiscount').val() == '') - { - alert('Please Enter the Discount value'); - $('#EditDiscountType').focus(); - $('#txtEditExciseDuty').val(''); - return false; - } - else - { - var AfterDiscount =parseFloat($('#txtEditAfterDiscount').val()); - AfterExciseDuty = ; - } - } - else if(ExciseCalculation == '2') - { - if($('#txtEditAfterDiscount').val() == '') - { - alert('Please Enter the Discount value'); - $('#EditDiscountType').focus(); - $('#txtEditExciseDuty').val(''); - return false; - } - else if($('#txtEditAfterPackaging').val() == '') - { - alert('Please Enter the Packaging value'); - $('#EditPackagingType').focus(); - $('#txtEditExciseDuty').val(''); - return false; - } - else - { - var AfterDiscount =parseFloat($('#txtEditAfterDiscount').val()); - var AfterPackaging = parseFloat($('#txtEditAfterPackaging').val()); - AfterExciseDuty = ; - } - } - else - { - if($('#txtEditAfterPackaging').val() == '') - { - alert('Please Enter the Packaging value'); - $('#EditPackagingType').focus(); - $('#txtEditExciseDuty').val(''); - return false; - } - else - { - var AfterPackaging = parseFloat($('#txtEditAfterPackaging').val()); - AfterExciseDuty = ; - } - } - var ExciseVal = parseFloat(AfterExciseDuty).toFixed(2); - - $('#txtEditAfterExciseDuty').val(ExciseVal); - } - else - { - $('#txtEditAfterExciseDuty').val("0.00"); - } - - } - calculateEditTotalValue(); - } - } - function calculateVat(isEdit) - { - if(isEdit == '0') - { - if($('#MaterialCode').val() == "0") - { - alert('Please Select the Material Code'); - $('#MaterialCode').focus(); - return false; - } - else if($('#Rate').val() == '') - { - alert('Please Enter the Rate value'); - $('#Rate').focus(); - return false; - } + // function calculateExcise() + // { + + // if($('#EditRate').val() == "") + // { + // alert('Please Enter the Rate value'); + // $('#EditRate').focus(); + // return false; + // } + + // else + // { + + // var basicValue = parseFloat($('#txtEditBasicValue').val()); - else - { - var basicValue = parseFloat($('#txtBasicValue').val()); - var AfterVat = 0.0; - if(VatCalculation != 0 && $('#txtVat').val() != '' ) - { - - if($('#txtAfterExciseDuty').val() == '') - { - alert('Please Enter the Excise value'); - $('#txtExciseDuty').focus(); - $('#txtVat').val(''); - return false; - } - else - { - var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val()); - vatValue = parseFloat($('#txtVat').val()); - AfterVat = ; - var Vatval = parseFloat(AfterVat).toFixed(2); - - $('#txtAfterVat').val(Vatval); - } - } - else if(VatCalculation == 0 && $('#txtVat').val() != '') - { - vatValue = parseFloat($('#txtVat').val()); - AfterVat = ; - var Vatval = parseFloat(AfterVat).toFixed(2); - - $('#txtAfterVat').val(Vatval); - } - - else - { - $('#txtAfterVat').val("0.00"); - } - calculateTotalValue(); - } - - } - else - { - if($('#EditMaterialCode').val() == "0") - { - alert('Please Select the Material Code'); - $('#EditMaterialCode').focus(); - return false; - } - else if($('#EditRate').val() == '') + + + // if($('#txtEditExciseDuty').val() != '' && $('#txtEditExciseDuty').val() != '0') + // { + // var AfterExciseDuty = 0.0; + // var ExciseDuty = parseFloat($('#txtEditExciseDuty').val()); + // if(ExciseCalculation == '0') + // { + // AfterExciseDuty = ; + // } + // else if(ExciseCalculation == '1') + // { + // if($('#txtEditAfterDiscount').val() == '') + // { + // alert('Please Enter the Discount value'); + // $('#EditDiscountType').focus(); + // $('#txtEditExciseDuty').val(''); + // return false; + // } + // else + // { + // var AfterDiscount =parseFloat($('#txtEditAfterDiscount').val()); + // AfterExciseDuty = ; + // } + // } + // else if(ExciseCalculation == '2') + // { + // if($('#txtEditAfterDiscount').val() == '') + // { + // alert('Please Enter the Discount value'); + // $('#EditDiscountType').focus(); + // $('#txtEditExciseDuty').val(''); + // return false; + // } + // else if($('#txtEditAfterPackaging').val() == '') + // { + // alert('Please Enter the Packaging value'); + // $('#EditPackagingType').focus(); + // $('#txtEditExciseDuty').val(''); + // return false; + // } + // else + // { + // var AfterDiscount =parseFloat($('#txtEditAfterDiscount').val()); + // var AfterPackaging = parseFloat($('#txtEditAfterPackaging').val()); + // AfterExciseDuty = ; + // } + // } + // else + // { + // if($('#txtEditAfterPackaging').val() == '') + // { + // alert('Please Enter the Packaging value'); + // $('#EditPackagingType').focus(); + // $('#txtEditExciseDuty').val(''); + // return false; + // } + // else + // { + // var AfterPackaging = parseFloat($('#txtEditAfterPackaging').val()); + // AfterExciseDuty = ; + // } + // } + // var ExciseVal = parseFloat(AfterExciseDuty).toFixed(2); + + // $('#txtEditAfterExciseDuty').val(ExciseVal); + // } + // else + // { + // $('#txtEditAfterExciseDuty').val("0.00"); + // } + + // } + // calculateEditTotalValue(); + + + // } + + function calculateVat()//SGST + { + + if($('#EditRate').val() == '') { alert('Please Enter the Rate value'); $('#EditRate').focus(); @@ -1082,29 +508,29 @@ function calculatePackaging(isEdit) else { var basicValue = parseFloat($('#txtEditBasicValue').val()); - var ExciseDuty = parseFloat($('#txtEditAfterExciseDuty').val()); + //var ExciseDuty = parseFloat($('#txtEditAfterExciseDuty').val()); var AfterVat = 0.0; - if(VatCalculation != 0 && $('#txtEditVat').val() != '' ) - { + // if(VatCalculation != 0 && $('#txtEditVat').val() != '' ) + // { - if($('#txtEditAfterExciseDuty').val() == '') - { - alert('Please Enter the Excise value'); - $('#txtEditAfterExciseDuty').focus(); - $('#txtEditVat').val(''); - return false; - } - else - { - var ExciseDuty = parseFloat($('#txtEditAfterExciseDuty').val()); - vatValue = parseFloat($('#txtEditVat').val()); - AfterVat = ; - var Vatval = parseFloat(AfterVat).toFixed(2); + // if($('#txtEditAfterExciseDuty').val() == '') + // { + // alert('Please Enter the Excise value'); + // $('#txtEditAfterExciseDuty').focus(); + // $('#txtEditVat').val(''); + // return false; + // } + // else + // { + // var ExciseDuty = parseFloat($('#txtEditAfterExciseDuty').val()); + // vatValue = parseFloat($('#txtEditVat').val()); + // AfterVat = ; + // var Vatval = parseFloat(AfterVat).toFixed(2); - $('#txtEditAfterVat').val(Vatval); - } - } - else if(VatCalculation == 0 && $('#txtEditVat').val() != '') + // $('#txtEditAfterVat').val(Vatval); + // } + // } + if($('#txtEditVat').val() != '') { vatValue = parseFloat($('#txtEditVat').val()); AfterVat = ; @@ -1121,173 +547,66 @@ function calculatePackaging(isEdit) calculateEditTotalValue(); } - } + } - function calculateCST(isEdit) - { - if(isEdit == '0') - { - if($('#MaterialCode').val() == "0") - { - alert('Please Select the Material Code'); - $('#MaterialCode').focus(); - return false; - } - else if($('#Rate').val() == '') - { - alert('Please Enter the Rate value'); - $('#Rate').focus(); - return false; - } + // function calculateCST() + // { + + // if($('#EditRate').val() == '') + // { + // alert('Please Enter the Rate value'); + // $('#EditRate').focus(); + // return false; + // } - else - { - var basicValue = parseFloat($('#txtBasicValue').val()); - var AfterCST = 0.0; - if(CSTCalculation != 0 && $('#txtCST').val() != '' ) - { + // else + // { + + // var basicValue = parseFloat($('#txtEditBasicValue').val()); + // var AfterCST = 0.0; + // if(CSTCalculation != 0 && $('#txtEditCST').val() != '' ) + // { - if($('#txtAfterExciseDuty').val() == '') - { - alert('Please Enter the Excise value'); - $('#txtExciseDuty').focus(); - $('#txtAfterCST').val(''); - return false; - } - else - { - var ExciseDuty = parseFloat($('#txtAfterExciseDuty').val()); - var CSTValue= parseFloat($('#txtCST').val()); - AfterCST = ; - var Vatval = parseFloat(AfterCST).toFixed(2); + // if($('#txtEditAfterExciseDuty').val() == '') + // { + // alert('Please Enter the Excise value'); + // $('#txtEditAfterExciseDuty').focus(); + // $('#txtEditCST').val(''); + // return false; + // } + // else + // { + // var ExciseDuty = parseFloat($('#txtEditAfterExciseDuty').val()); + // var CSTValue= parseFloat($('#txtEditCST').val()); + // AfterCST = ; + // var Vatval = parseFloat(AfterCST).toFixed(2); - $('#txtAfterCST').val(Vatval); - } - } - else if(CSTCalculation == 0 && $('#txtCST').val() != '') - { - var CSTValue= parseFloat($('#txtCST').val()); - AfterCST = ; - var Vatval = parseFloat(AfterCST).toFixed(2); + // $('#txtEditAfterCST').val(Vatval); + // } + // } + // else if(CSTCalculation == 0 && $('#txtEditCST').val() != '') + // { + // var CSTValue= parseFloat($('#txtEditCST').val()); + // AfterCST = ; + // var Vatval = parseFloat(AfterCST).toFixed(2); - $('#txtAfterCST').val(Vatval); - } + // $('#txtEditAfterCST').val(Vatval); + // } - else - { - $('#txtAfterCST').val("0.00"); - } - calculateTotalValue(); - } - - } - else - { - if($('#EditMaterialCode').val() == "0") - { - alert('Please Select the Material Code'); - $('#EditMaterialCode').focus(); - return false; - } - else if($('#EditRate').val() == '') - { - alert('Please Enter the Rate value'); - $('#EditRate').focus(); - return false; - } - - else - { + // else + // { + // $('#txtEditAfterCST').val("0.00"); + // } - var basicValue = parseFloat($('#txtEditBasicValue').val()); - var AfterCST = 0.0; - if(CSTCalculation != 0 && $('#txtEditCST').val() != '' ) - { - - if($('#txtEditAfterExciseDuty').val() == '') - { - alert('Please Enter the Excise value'); - $('#txtEditAfterExciseDuty').focus(); - $('#txtEditCST').val(''); - return false; - } - else - { - var ExciseDuty = parseFloat($('#txtEditAfterExciseDuty').val()); - var CSTValue= parseFloat($('#txtEditCST').val()); - AfterCST = ; - var Vatval = parseFloat(AfterCST).toFixed(2); - - $('#txtEditAfterCST').val(Vatval); - } - } - else if(CSTCalculation == 0 && $('#txtEditCST').val() != '') - { - var CSTValue= parseFloat($('#txtEditCST').val()); - AfterCST = ; - var Vatval = parseFloat(AfterCST).toFixed(2); - - $('#txtEditAfterCST').val(Vatval); - } - - else - { - $('#txtEditAfterCST').val("0.00"); - } - - calculateEditTotalValue(); - } + // calculateEditTotalValue(); + // } - } - } - function calculateGST(isEdit) + + // } + function calculateGST()//CGST { - if(isEdit == '0') - { - if($('#MaterialCode').val() == "0") - { - alert('Please Select the Material Code'); - $('#MaterialCode').focus(); - return false; - } - else if($('#Rate').val() == '') - { - alert('Please Enter the Rate value'); - $('#Rate').focus(); - return false; - } - else - { - var basicValue = parseFloat($('#txtBasicValue').val()); - - if($('#txtGST').val() != "0" && $('#txtGST').val() != '') - { - var GSTValue = parseFloat($('#txtGST').val()); - - var AfterGST = 0.0; - AfterGST = ; - - var GSTval = parseFloat(AfterGST).toFixed(2); - - $('#txtAfterGST').val(GSTval); - } - else - { - $('#txtAfterGST').val("0.00"); - } - - } - calculateTotalValue(); - } - else - { - if($('#EditMaterialCode').val() == "0") - { - alert('Please Select the Material Code'); - $('#EditMaterialCode').focus(); - return false; - } - else if($('#EditRate').val() == '') + + if($('#EditRate').val() == '') { alert('Please Enter the Rate value'); $('#EditRate').focus(); @@ -1316,57 +635,12 @@ function calculatePackaging(isEdit) } calculateEditTotalValue(); - } + } - function calculateOtherTaxes(isEdit) + function calculateOtherTaxes()//IGST { - if(isEdit == '0') - { - if($('#MaterialCode').val() == "0") - { - alert('Please Select the Material Code'); - $('#MaterialCode').focus(); - return false; - } - else if($('#Rate').val() == '') - { - alert('Please Enter the Rate value'); - $('#Rate').focus(); - return false; - } - else - { - var basicValue = parseFloat($('#txtBasicValue').val()); - - - if($('#txtOtherTax').val() != "0" && $('#txtOtherTax').val() != '') - { - var OtherTaxValue = parseFloat($('#txtOtherTax').val()); - - var AfterOtherTaxes = 0.0; - AfterOtherTaxes = ; - - var Otherval = parseFloat(AfterOtherTaxes).toFixed(2); - - $('#txtAfterOtherTax').val(Otherval); - } - else - { - $('#txtAfterOtherTax').val("0.00"); - } - calculateTotalValue(); - - } - } - else - { - if($('#EditMaterialCode').val() == "0") - { - alert('Please Select the Material Code'); - $('#EditMaterialCode').focus(); - return false; - } - else if($('#EditRate').val() == '') + + if($('#EditRate').val() == '') { alert('Please Enter the Rate value'); $('#EditRate').focus(); @@ -1396,83 +670,13 @@ function calculatePackaging(isEdit) } - } + } - function calculateFreight(isEdit) + function calculateFreight() { - if(isEdit == '0') - { - if($('#MaterialCode').val() == "0") - { - alert('Please Select the Material Code'); - $('#MaterialCode').focus(); - return false; - } - else if($('#Rate').val() == '') - { - alert('Please Enter the Rate value'); - $('#Rate').focus(); - return false; - } - else - { - var basicValue = parseFloat($('#txtBasicValue').val()); - var FreightType =$("#drpFreight").val(); - if(FreightType == "0") - { - alert('Please select Freight Type'); - $('#txtFreight').val(''); - $("#drpFreight").focus(); - } - else if( $('#txtFreight').val() != "0" && $('#txtFreight').val() != '') - { - var FreightValue = parseFloat($('#txtFreight').val()); - var UOM = parseFloat($('#UOM').val()); - var Quantity = parseFloat($('#Quantity').val()); - //alert(FreightType); - var AfterFreight = 0.0; - if(FreightType == PercentageType) - { - AfterFreight = ; - } - else if(FreightType == NilType) - { - AfterFreight = 0.0; - } - else if(FreightType == '') - { - AfterFreight = ; - } - else if(FreightType == '') - { - AfterFreight = ; - } - else if(FreightType == '') - { - AfterFreight = ; - } - var AfterFreightval = parseFloat(AfterFreight).toFixed(2); - - $('#txtAfterFreight').val(AfterFreightval); - } - else - { - $('#txtAfterFreight').val("0.00"); - } - - } - calculateTotalValue(); - } - else - { - if($('#EditMaterialCode').val() == "0") - { - alert('Please Select the Material Code'); - $('#EditMaterialCode').focus(); - return false; - } - else if($('#EditRate').val() == '') + + if($('#EditRate').val() == '') { alert('Please Enter the Rate value'); $('#EditRate').focus(); @@ -1527,7 +731,7 @@ function calculatePackaging(isEdit) } calculateEditTotalValue(); - } + } /* Set the Packaging calculation option for calculating Packaging */ @@ -1535,49 +739,49 @@ function calculatePackaging(isEdit) { PackagingCalculation = $("input:radio[name='optPackaging']:checked").val(); $('#packagingcalmodel').modal('hide'); - calculatePackaging($('#isEdit').val()); + calculatePackaging(); } /* Set the Packaging calculation option for calculating Packaging */ - function SetExciseCalculation() - { - ExciseCalculation = $("input:radio[name='optExcise']:checked").val(); - $('#ExciseDutyCalModel').modal('hide'); - calculateExcise($('#isEdit').val()); - } + // function SetExciseCalculation() + // { + // ExciseCalculation = $("input:radio[name='optExcise']:checked").val(); + // $('#ExciseDutyCalModel').modal('hide'); + // calculateExcise(); + // } /* Set the Packaging calculation option for calculating Packaging */ - function SetVatorCST() - { - StateTaxCheck = $("input:radio[name='Range']:checked").val(); - $('#txtPoRange').val(StateTaxCheck) ; - //alert('Radio clicke:'+StateTaxCheck); - if(StateTaxCheck == "0") - { - // style="display:none;" - $('#Vat').removeAttr("style"); - $('#TotVat').removeAttr("style"); - $('#CST').attr("style","display:none;"); - $('#TotCST').attr("style","display:none;"); - } - else - { - $('#CST').removeAttr("style"); - $('#TotCST').removeAttr("style"); - $('#Vat').attr("style","display:none;"); - $('#TotVat').attr("style","display:none;"); - } - } + // function SetVatorCST() + // { + // StateTaxCheck = $("input:radio[name='Range']:checked").val(); + // $('#txtPoRange').val(StateTaxCheck) ; + // //alert('Radio clicke:'+StateTaxCheck); + // if(StateTaxCheck == "0") + // { + // // style="display:none;" + // $('#Vat').removeAttr("style"); + // $('#TotVat').removeAttr("style"); + // $('#CST').attr("style","display:none;"); + // $('#TotCST').attr("style","display:none;"); + // } + // else + // { + // $('#CST').removeAttr("style"); + // $('#TotCST').removeAttr("style"); + // $('#Vat').attr("style","display:none;"); + // $('#TotVat').attr("style","display:none;"); + // } + // } function SetVatCalculation() - { - VatCalculation = $("input:radio[name='optVat']:checked").val(); - $('#VatCalModel').modal('hide'); - calculateVat($('#isEdit').val()); - } - function SetCSTCalculation() - { - CSTCalculation = $("input:radio[name='optCST']:checked").val(); - $('#CSTCalModel').modal('hide'); - calculateCST($('#isEdit').val()); - } + { + //VatCalculation = $("input:radio[name='optVat']:checked").val(); + //$('#VatCalModel').modal('hide'); + calculateVat(); + } + // function SetCSTCalculation() + // { + // CSTCalculation = $("input:radio[name='optCST']:checked").val(); + // $('#CSTCalModel').modal('hide'); + // calculateCST(); + // } @@ -1590,6 +794,14 @@ function calculatePackaging(isEdit) var txtUnitPrice = parseFloat($('#EditRate').val()); var Tot = txtQuantity * txtUnitPrice $('#txtEditBasicValue').val(Tot); + calculateDiscount(); + calculatePackaging(); + // calculateExcise(); + calculateVat(); + // calculateCST(); + calculateGST(); + calculateOtherTaxes(); + calculateFreight(); calculateEditTotalValue($('#isEdit').val()); } @@ -1616,17 +828,17 @@ function validateEditExceedLimit() function calculateEditTotalValue() { var Packaging = $('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val(); - var ExciseDuty = $('#txtEditAfterExciseDuty').val() == '' ? '0.00' : $('#txtEditAfterExciseDuty').val(); - var Vat = $('#txtEditAfterVat').val() == '' ? '0.00' : $('#txtEditAfterVat').val(); - var CST = $('#txtEditAfterCST').val() == '' ? '0.00' : $('#txtEditAfterCST').val(); - var GST = $('#txtEditAfterGST').val() == '' ? '0.00' : $('#txtEditAfterGST').val(); - var OtherTax = $('#txtEditAfterOtherTax').val() == '' ? '0.00' : $('#txtEditAfterOtherTax').val(); + + var Vat = $('#txtEditAfterVat').val() == '' ? '0.00' : $('#txtEditAfterVat').val();//SGST + + var GST = $('#txtEditAfterGST').val() == '' ? '0.00' : $('#txtEditAfterGST').val(); //CGST + var OtherTax = $('#txtEditAfterOtherTax').val() == '' ? '0.00' : $('#txtEditAfterOtherTax').val();//IGST var Freight = $('#txtEditAfterFreight').val() == '' ? '0.00' : $('#txtEditAfterFreight').val(); var Insurance = $('#txtEditInsurance').val() == '' ? '0.00' : $('#txtEditInsurance').val(); var Discount = $('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val(); var BasicVal = $('#txtEditBasicValue').val() == '' ? '0.00' : $('#txtEditBasicValue').val(); - var totvalue = ( parseFloat(BasicVal) + parseFloat(Packaging)+ parseFloat(ExciseDuty)+ parseFloat(Vat) + parseFloat(CST)+ parseFloat(GST) + parseFloat(OtherTax) + parseFloat(Freight) + parseFloat(Insurance)) - parseFloat(Discount); + var totvalue = ( parseFloat(BasicVal) + parseFloat(Packaging)+ parseFloat(Vat) + parseFloat(GST) + parseFloat(OtherTax) + parseFloat(Freight) + parseFloat(Insurance)) - parseFloat(Discount); var tot = parseFloat(totvalue).toFixed(2); @@ -1637,17 +849,17 @@ function validateEditExceedLimit() function calculateEditTaxValue() { var Packaging = $('#txtEditAfterPackaging').val() == '' ? '0.00' : $('#txtEditAfterPackaging').val(); - var ExciseDuty = $('#txtEditAfterExciseDuty').val() == '' ? '0.00' : $('#txtEditAfterExciseDuty').val(); - var Vat = $('#txtEditAfterVat').val() == '' ? '0.00' : $('#txtEditAfterVat').val(); - var CST = $('#txtEditAfterCST').val() == '' ? '0.00' : $('#txtEditAfterCST').val(); - var GST = $('#txtEditAfterGST').val() == '' ? '0.00' : $('#txtEditAfterGST').val(); - var OtherTax = $('#txtEditAfterOtherTax').val() == '' ? '0.00' : $('#txtEditAfterOtherTax').val(); + + var Vat = $('#txtEditAfterVat').val() == '' ? '0.00' : $('#txtEditAfterVat').val();//SGST + + var GST = $('#txtEditAfterGST').val() == '' ? '0.00' : $('#txtEditAfterGST').val();//CGST + var OtherTax = $('#txtEditAfterOtherTax').val() == '' ? '0.00' : $('#txtEditAfterOtherTax').val();//IGST var Freight = $('#txtEditAfterFreight').val() == '' ? '0.00' : $('#txtEditAfterFreight').val(); var Insurance = $('#txtEditInsurance').val() == '' ? '0.00' : $('#txtEditInsurance').val(); var Discount = $('#txtEditAfterDiscount').val() == '' ? '0.00' : $('#txtEditAfterDiscount').val(); - var totvalue = parseFloat(Discount) -( parseFloat(Packaging)+ parseFloat(ExciseDuty)+ parseFloat(Vat) + parseFloat(CST)+ parseFloat(GST) + parseFloat(OtherTax) + parseFloat(Freight) + parseFloat(Insurance)) ; + var totvalue = parseFloat(Discount) -( parseFloat(Packaging)+ parseFloat(Vat) + parseFloat(GST) + parseFloat(OtherTax) + parseFloat(Freight) + parseFloat(Insurance)) ; var tot = parseFloat(totvalue).toFixed(2); //alert('tot:'+tot); @@ -1665,6 +877,22 @@ function calculateEditTaxValue() $('#Schedulediv').show(); }); }); + $(document).ready(function () { + $('#Local').click(function () { + //for Date range selection + $('#IGSTShow').hide(); + $('#SGSTShow').show(); + $('#SGSTModel').show();// SGST Fields in Modal Show + $('#IGSTModel').hide(); // IGST Fields in Modal Hide + }); + $('#Inter_state').click(function () { + //for schedule range selection + $('#SGSTShow').hide(); + $('#IGSTShow').show(); + $('#IGSTModel').show(); // IGST Fields in Modal Show + $('#SGSTModel').hide(); // SGST Fields in Modal Hide + }); + });