in default tally when we record a new sales/purchase entry it automatically fetch last recorded item rate just after quantity input how to implement this in VAT/tax inclusive invoice code my existing codes are ;;--------------Tax Inclusive Rates in Purchase and Sales Voucher-------------;; [#Part : CMP AccFeat Left] Add : Line : CMP Final Rate [Line : CMP Final Rate] Field : Medium Prompt, Logical Field Local : Field : Medium Prompt : Info : $$LocaleString:"Tax inclusive rates on Invoices ?" Local : Field : Logical Field : Storage : isFinalRateOn Local : Field : Default : On : Focus : Yes : Set : SVERPFeatureDesc : "Allow Tax Inclusive Rates, and automatically calculate" Space Top: 0.4 [System : UDF] isFinalRateOn: Logical : 23 [System : Formula] isFinalRateOn:$isFinalRateOn:Company:##SVCurrentCompany [#Part : STKI Batch] Add : Line : STKImyVATRATE [Line : STKImyVATRATE] Field : Medium Prompt, STKImyVATRATE Local : Field : Medium Prompt : Info : $$LocaleString:"VAT Rate (in %) ?" Space Top: 0.4 [Field: STKImyVATRATE] Use: Number Field Storage: RateofVAT Align : Left Width : 6 Format : "Percentage" [#Line : VCHBatch ColumnOne] Add : option : My VCH Batch Column One : (@@isSales OR @@isPurchase) and @@isFinalRateOn [!Line : My VCH Batch Column One] Add : Right Field : Before : VCH RateTitle : MyFinalRateTitle [Field : My FinalRateTitle] Use : Name Field INfo : "Tax inc. Rate" Width : 10 Lines : 1 Style : Normal Bold Align : Centre [#Line : VCHBatch ColumnTwo] Add : option : My VCH Batch Column Two : (@@isSales OR @@isPurchase) and @@isFinalRateOn [!Line : My VCH Batch Column Two] Add : Right Field : Before : VCH RateTitle : MyFinalRateTitle Local : Field : MyFinalRateTitle : Info : "" [#Line : STKVCH Batch2] Add : Option : MyStkvch Batch2 : (@@isSales OR @@isPurchase) and @@isFinalRateOn [!Line : MystkVCH Batch2] Add : Right Field : Before : VCHBATCH Rate : MyFinalRate [Field: MyFinalRate] Use : Rate Price Field Storage : MyFinalRate Skip : $$Line > 1 Width : 10 [system: UDF] MyFinalRate: Rate: 101 MyFinalRate2: Rate : 102 [#Field: VCHBATCH Rate] Add : Option : MyRate : (@@isSales OR @@isPurchase) and @@isFinalRateOn [!Field : MyRate] Delete : Set as Delete : Set By Condition Add : Set By Condition : Yes : ($MyFinalRate *100 ) / (100 + $RateofVAT:Stockitem:$Stockitemname) [#Line : Ei ColumnOne] Add : option : My VCH Batch Column One : (@@isSales OR @@isPurchase) and @@isFinalRateOn [#Line : Ei ColumnTwo] Add : option : My VCH Batch Column Two : (@@isSales OR @@isPurchase) and @@isFinalRateOn [#Line : Ei InvInfo] Add : Option : My Ei Info : (@@isSales OR @@isPurchase) and @@isFinalRateOn [#Line : Ci InvInfo] Add : Option : My Ei Info : (@@isSales OR @@isPurchase) and @@isFinalRateOn [!Line : My ei info] Add : Right Field : Before : VCH Rate : MyFinalRate2 [Field : MyFinalRate2] Use : Rate Price Field Width : 10 Storage : MyFinalRate2 Set always : Yes Inactive : $$isEnd:$Stockitemname Skip on : @@hasinvsuballoc AND NOT @@isPOSInvoice Setval : if @@HasInvSubAlloc then $$CollectionField:$MyFinalRate:1:BatchAllocations else + if $BilledQty = 0 then 0 else + if $$IsValidPriceLevel:$PriceLevel then $$ForexValue@StdVchRate else + if $StockItemName != #VCHPrevItem AND NOT $$IsStartupValue then $$ForexValue@StdVchRate else + if ($Amount != 0) AND ($Amount != @@CalcedAmt) then @@NrmlAmount / $BilledQty else + if $$IsFieldEdited OR $$InAlterMode then $$Value else + if $$IsEmpty:$$Value then $$ForexValue@StdVchRate else $$Value Set as : If #VCHBilledQty = 0 OR #VCHBilledQty != 0 then @Setval else @Setval [#Field: VCH NrmlRate] Add : Option : MyRate2 : (@@isSales OR @@isPurchase) and @@isFinalRateOn [#Field: VCH POS Rate] Add : Option : MyRate2 : (@@isSales OR @@isPurchase) and @@isFinalRateOn [!Field : MyRate2] Delete : Set as Add : Set as : ($MyFinalRate2 *100 ) / (100 + $RateofVAT:Stockitem:$Stockitemname)