From 6d07073c8a019349d877287d4f4234ceb369dd4b Mon Sep 17 00:00:00 2001 From: velz2020 Date: Tue, 8 Aug 2017 10:37:48 +0530 Subject: [PATCH] AMEND ISSUES FIXED REVENUE --- .../controllers/amendmentpurchaseorder.php | 33 +++++++------ application/views/Amendrevenuepopdf.php | 37 ++++++++------- application/views/editCapitalAmendPO.php | 19 +++++++- application/views/editRevenueAmendPO.php | 46 +++++++++---------- 4 files changed, 77 insertions(+), 58 deletions(-) diff --git a/application/controllers/amendmentpurchaseorder.php b/application/controllers/amendmentpurchaseorder.php index 7670d1e3..9b52c326 100755 --- a/application/controllers/amendmentpurchaseorder.php +++ b/application/controllers/amendmentpurchaseorder.php @@ -178,13 +178,16 @@ class amendmentpurchaseorder extends BaseController { $CapitalRange = $_GET['CapitalRange']; - $AvlBudget = $this->purchaseorder_model->GetAvailableBudgetAmount($CostCode,$FYdt,$ReqType); - - - if(count($AvlBudget)>0) - { - $data['AvlBudAmt'] = $AvlBudget[0]['BudgetAmount'] - $AvlBudget[0]['Totalvalue']; - } + $CapitalAvlBudget = $this->purchaseorder_model->GetAvailableCapitalBudgetAmount($CostCode,$FYdt,$ReqType); + + + if(count($CapitalAvlBudget)>0) + { + + + $data['AvlCapitalBudAmt'] = $CapitalAvlBudget[0]['BudgetAmount'] - $CapitalAvlBudget[0]['Totalvalue']; + + } if($CapitalRange=='0'){ $data['POItem'] = $this->purchaseorder_model->getCapitalPurchaseOrderDetails($PONO); @@ -255,8 +258,8 @@ class amendmentpurchaseorder extends BaseController $MAD=''; $PONO =$this->input->post('txtPONO'); - echo "Revenue Amendment"; - echo "OLD PO IS" . $PONO; + // echo "Revenue Amendment"; + // echo "OLD PO IS" . $PONO; $POdt =$this->input->post('PODate'); $PODate = $this->getDateformat($POdt); @@ -299,7 +302,7 @@ class amendmentpurchaseorder extends BaseController $MAD.="Amended PaymentTerms :  ". $PaymentTermsText . $Otherpaymentamend ."
"; } - if((($predeliverydate != $testdate)&&($dt != $predeliverydate))|| ($DeliverySchedule1 != $preschedule)) + if(($dt != $predeliverydate)|| ($DeliverySchedule1 != $preschedule)) { @@ -308,7 +311,7 @@ class amendmentpurchaseorder extends BaseController $SpecialInstruction = $this->input->post('txtSpcialInstruction');//$_POST['txtSpcialInstruction'];//$this->input->post('txtSpcialInstruction');//t->post('txtSpcialInstruction')); - + //echo $MAD; $TotalOrderValueSummary = $this->input->post('txtTotalOrderValueSummary'); $POStatus = $this->input->post('txtStatus'); @@ -317,8 +320,8 @@ class amendmentpurchaseorder extends BaseController $RowCount = $this->input->post('txtRowCount'); - $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); - $updateddt = $dt->format('Y-m-d H:i:s'); + $dtt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); + $updateddt = $dtt->format('Y-m-d H:i:s'); if(empty($Deliverydt)) { $Deliverydt=null; @@ -332,6 +335,7 @@ class amendmentpurchaseorder extends BaseController $POMaster = array('ParentPO'=>$PONO,'SupplierID'=>$SupplierID,'POType'=>$POType,'TotalOrderValue'=>$TotalOrderValueSummary,'PODate'=>$PODate,'Status'=>PO_RELEASED,'PaymentTerms'=>$PaymentTerms,'PaymentOtherDescription'=>$Otherpayment,'DeliverySchedule'=>$DeliverySchedule,'DeliveryOption'=>$DeliveryOption,'ServiceDescription'=>$SpecialInstruction,'CreatedBy'=>$updatedBy,'DeliveryAddress'=>$DeliveryAddr,'DeliveryDate'=>$Deliverydt,'UpdatedOn'=>$updateddt,'AmendedDetails'=>$MAD); //print_r($POMaster); + $LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster,$updatedBy,$PONO); if(count($LastPO)>0) @@ -559,6 +563,7 @@ class amendmentpurchaseorder extends BaseController + function UpdateAmendServicePurchaseOrder() { $PONO =$this->input->post('txtPONO'); @@ -595,7 +600,7 @@ function UpdateAmendServicePurchaseOrder() $preTotalordervalue=$this->input->post('preTotalordervalue'); $MAD.="Amended Total OrderValue:  " . $preTotalordervalue . "
"; - if((($beforeddate != $testdate) && ($ddate != $beforeddate))||($dschedule != $beforedschedule)) + if(($ddate != $beforeddate)||($dschedule != $beforedschedule)) { $MAD.="Amended DeliveryOption :  " . $beforeddate . $beforedschedule."
"; } diff --git a/application/views/Amendrevenuepopdf.php b/application/views/Amendrevenuepopdf.php index b4d12000..82ea10b0 100755 --- a/application/views/Amendrevenuepopdf.php +++ b/application/views/Amendrevenuepopdf.php @@ -122,7 +122,7 @@ - + - + - + @@ -154,7 +154,7 @@

@@ -130,7 +130,7 @@
Vendor Address :
@@ -140,7 +140,7 @@

PO DATE :   DELIVERY DATE / SCHEDULE BY :  
- + @@ -169,7 +169,7 @@ { ?> - + @@ -186,7 +186,7 @@
Requistion Number Requistion Date Requested By
format("Y-m-d"); echo $date; ?>
- + @@ -214,14 +214,14 @@ $Insurance = 0; $AfterFreightValue = 0; $AfterDiscount = 0; - $AfterPackaging = 0; + $AfterPackaging = 0; foreach($POItem as $record) { $index = $index + 1; ?> - + @@ -246,15 +246,18 @@ $AfterPackaging=$AfterPackaging+$record->AfterPackagingValue; $totaltaxonly=($AfterCGST+$AfterSGST+$AfterIGST+$Insurance+$AfterFreightValue+$AfterPackaging); } + +$OrderValue = (( $SubTotalAmount + $AfterCGST +$AfterIGST+$AfterSGST +$Insurance +$AfterFreightValue+$AfterPackaging) - $AfterDiscount) ; +}?> + - ?>
# Item Code Item Description
MaterialCode ; ?> MaterialName ; ?>
 

- + @@ -267,7 +270,7 @@ - + @@ -285,6 +288,7 @@ @@ -302,7 +306,8 @@ - + +

- + +

AmendedDetails)){$i++;}}} if($i<0){ ?> @@ -368,7 +371,7 @@ $OrderValue = (( $SubTotalAmount + $AfterCGST +$AfterIGST+$AfterSGST +$Insuranc - + diff --git a/application/views/editCapitalAmendPO.php b/application/views/editCapitalAmendPO.php index 8af3da26..907a8c6e 100755 --- a/application/views/editCapitalAmendPO.php +++ b/application/views/editCapitalAmendPO.php @@ -140,7 +140,7 @@ if(!empty($POMaster)) if(!empty($AvlBudAmt)) { - $AvlAmount = $AvlBudAmt; + $AvlAmount = $AvlCapitalBudAmt; } ?> @@ -2883,13 +2883,28 @@ $('#txtStatus').val(stat); if(validate()) { - + var ex=$('#ExchangeRt').val(); + //alert(ex); + //alert(parseInt($('#CapitalToatlOrder').val() * ex)); + var AvlBudAmt = ''; + //alert(AvlBudAmt); if(document.getElementById('serviceTax').rows.length < 2) { alert('Please Select Line item to Create PO'); $('#Deliverydt').focus(); return false; } + else if($('#Otherpayment').val()=='' && $('#PaymentMethod').val()=='PT08'){ + alert('Please Enter Other Payable Terms Description'); + $('#Otherpayment').focus(); + return false; + } + + else if(parseInt(AvlBudAmt) < parseInt($('#CapitalToatlOrder').val() * ex)) { + alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); + + return false; + } else { diff --git a/application/views/editRevenueAmendPO.php b/application/views/editRevenueAmendPO.php index 533774f3..b874b1cb 100755 --- a/application/views/editRevenueAmendPO.php +++ b/application/views/editRevenueAmendPO.php @@ -1542,18 +1542,18 @@ function calculateEditTaxValue() - - - - - - - - - - - - + + + + + + + + + + + + @@ -1584,11 +1584,11 @@ function calculateEditTaxValue() $totDiscountAmt = $totDiscountAmt + $record->AfterDiscount; $totPackagingAmt = $totPackagingAmt + $record->AfterPackagingValue; $totExciseAmt = $totExciseAmt + $record->AfterExciseDuty; - $totVATAmt = $totVATAmt + $record->AfterVAT; - $totCSTAmt = $totCSTAmt + $record->AfterCST; - $totGSTAmt = $totGSTAmt +$record->AfterGST; + $totVATAmt = $totVATAmt + $record->AfterSGST; + //$totCSTAmt = $totCSTAmt + $record->AfterCST; + $totGSTAmt = $totGSTAmt +$record->AfterCGST; - $totOtherTaxAmt = $totOtherTaxAmt + $record->AfterOtherTaxes; + $totOtherTaxAmt = $totOtherTaxAmt + $record->AfterIGST; $totFreightAmt = $totFreightAmt + $record->AfterFreightValue; $totInsuranceAmt = $totInsuranceAmt + $record->Insurance; $totOrderSummaryAmt = $totOrderSummaryAmt +$record->TotalValue; @@ -1734,6 +1734,8 @@ function calculateEditTaxValue()
format('Y-m-d'); $data = array('name' => 'Requeston','value' => set_value('Requeston',$Reqon),'id'=>'Requeston', 'class' => 'form-control num' ,'required' => 'true','readonly' => 'true'); echo form_input($data); ?> @@ -1820,15 +1822,13 @@ $("#EDITREVENUE").on("shown.bs.modal", function(e) { $('#txtEditAfterDiscount').val($('#AfterDisVal'+userid).val()); $('#txtEditVat').val($('#VatVal'+userid).val()); $('#txtEditAfterVat').val($('#AfterVatVal'+userid).val()); - //$('#txtEditCST').val($('#CSTVal'+userid).val()); - //$('#txtEditAfterCST').val($('#AfterCSTVal'+userid).val()); + $('#txtEditPackaging').val($('#PackVal'+userid).val()); $('#txtEditAfterPackaging').val($('#AfterPackVal'+userid).val()); $('#txtEditGST').val($('#GSTVal'+userid).val()); $('#txtEditAfterGST').val($('#AfterGSTVal'+userid).val()); - //$('#txtEditExciseDuty').val($('#ExciseVal'+userid).val()); - //$('#txtEditAfterExciseDuty').val($('#AfterExciseVal'+userid).val()); + $('#txtEditOtherTax').val($('#OtherTaxVal'+userid).val()); $('#txtEditAfterOtherTax').val($('#AfterOtherTaxVal'+userid).val()); @@ -1903,11 +1903,7 @@ $("#EDITREVENUE").on("shown.bs.modal", function(e) { }); -function AmendChange(){ - - var amdqty=$('#EditQuantity').val($('#quantity'+userid).val()); - alert('Workeed'); -} + $('.editrevenue').click(function(){
HSN Code

Discount In INR

SGST 

Total Tax    Total Amount In INR 
Value Amt Value
HSNCODE)){echo $l->HSNCODE;}else{echo "NIL";} ; ?>FreightType == 'PER TRIP'){$type="TRIP"; echo $l->FreightValue ."*" . $l->NoOfTrip . $type;}else{ if($l->FreightType == 'LUMP SUM'){$type="LS";}else if($l->FreightType == 'NIL'){$type='';}else if($l->FreightType == 'PER UOM'){$type='UOM';}else if($l->FreightType == 'PERCENTAGE'){$type='%';} echo $l->PackagingValue . $type;}?> AfterFreightValue;?> AfterSGST+$l->AfterCGST+$l->AfterIGST+$l->AfterPackagingValue+$l->Insurance+$l->AfterFreightValue;echo number_format($tax,2);?>BasicValue + $tax)-($l->AfterDiscount)),2);?>BasicValue + $tax)-($l->AfterDiscount)),2);?>
Total Amount In Words :

 Total Amount Before Tax In INR : 
 Total Tax Amount In INR :