Dear Experts, Please help me Change Voucher Class If Turnover Over 50 Lakhs. I use Two Voucher Class namely TCS @ 0.075% and Automatic Entries for non tcs entries. [#Field: EI CurrentTurnover] Field : Simple Prompt, Simple Field, Amount Forex Field, Short Prompt, TCSEligible Local : Field : Short Prompt : Info : $$LocaleString:"TCS" [Field: TCSEligible] Use : Name Field Set as : @@TcsEligible Background : @@TcsColor [#Field: Chg VchSubType] Set as : IF (($CurrentTurnover:Ledger:#EIConsignee) > 5000000) Then "TCS @ 0.075%" Else "Automatic Entries" Set Always:Yes [System: Formula] TcsEligible : IF (($CurrentTurnover:Ledger:#EIConsignee) > 5000000) Then "Eligible" else "Not Eligible" TcsColor : IF (($CurrentTurnover:Ledger:#EIConsignee) > 5000000) Then "Green" else "Red"
So ... what exactly is your problem ??? Above code.....does not have anything to do with Voucher Class......... FYI ........ Voucher class is selected before selection of the Consignee Name........... and therafter the Consignee turnover etc...............
Voucher Class itself is a predefined thing. so your condition or criteria will not get any effect. May be if you can set criteria at Voucher Class creation form.. I think you should use the logic of Rounding Method used at Voucher Class Creation Form.. As it automatically gets rounded .. Same can be set by referring through Party Turnover Field. This is my suggestion.
I used On field accept attribute and called for voucher class change function assigned in Button. Its working as I wanted.