Please help as i want state code to display in reports instead of state name or both will also do ;;TDL ------------------address book 3 [#Menu: GatewayOfTally] Add : Item : After : @@locQuit : Address Book: Menu: MyMenu [Menu: MyMenu] Title: Address Book Add: Item: Sundry Debtors Details: Display : SD Address Book Add: Item: Sundry Creditors Details: Display: SC Address book [Report: SD Address Book] Use: DSP Template Form: SD Address Book Title: Sundry Debtors Address Book [Report: SC Address Book] Use: SD Address Book Local: Collection: My Sundry Debtors: Child Of: $$GroupSundryCreditors Title: Sundry Creditors Address Book [Form: SD Address Book] Use: DSP Template Part: SD Address Book Title, SD Address Book Delete: Page Break Bottom Part:gtotal [Part: SD Address Book Title] Line: SD Address Book Title [Line: SD Address Book title] Use: SD Address Book Local: Field: SD Sr no: Set as: "Sr" Local: Field: SD Name: Set as: "Name" Local: Field: SD Contact No: Set as: "GSTIN" Local: Field: SD Mobile: Set as: "State Code" Local: Field: SD Address: Set as: "Address" Local: Field: SDCrLimit: Set as: "Credit Limit" Local: Field: SD PrLevel: Set as: "Price Level" Local: Field: SDClBal: Set as: "Closing Balance" Local: Field: SD DrCr: Set as: "Debit/Credit" Local : Field : Default : Style : Small Bold Local : Field : Default : Align: Center Border: Flush Totals [Part: SD Address Book] Line: SD Address Book Repeat: SD Address Book: My Sundry Debtors Total: SDCrLimit,SDClBal Scroll: Vertical Common Border: Yes [Line: SD Address Book] Field: SD Sr No,SD Name Right Field: SD Contact No, SD Mobile, SD Address, SDClBal, Option : alter on enter Local : field : SD Name: alter : Ledger : $$isLedger Border : Thin Bottom [Field: SD Sr No] Use: Short Name Field Set as: $$Line Style: Normal Width: 5 Align: Centre [Field: SD Name] Use: Name Field Set as: $Name Width: 32 Border: Thin Left Color: red [Field: SD Contact No] USe: Short Name Field Set As: $PartyGSTIN Border: ThinLeft Align: Right Width: 20 Color: blue [Field: SD Mobile] Use: Short Name Field Set As: $LedStateName Style: Normal Border: Thin Left Align: centre Color: geranium [Field: SD Address] Use: Short Name Field Set As: $$FullList:Address:$Address+", "+$StateName +", "+$PinCode Full Width: Yes Style: Normal Border: Thin Left Color: red [Field: SDCrLimit] Use: Short Name Field Set As:$CreditLimit:Ledger:$Name Format: "CrDr" Style: Normal Border: Thin Left Align: Right [Field: SD PrLevel] Use: Short Name Field Set As:$PriceLevel:Ledger:$Name Style: Normal Border: Thin Left Align: Centre [Field: SDClBal] Use :Short Name Field Set As:If $$IsDr:$_ClosingBalance then $$String:$_ClosingBalance + " Dr" else $$String:$_ClosingBalance + " Cr" Format : "CrDr" Style: Normal Border: Thin Left Align: Right Color: blue Width: 20 [Part:gtotal] Use : SD Address Book Delete : Repeat Delete : Scroll Delete : Total Border : Totals Local : Field : Default: Type : string Local : Field : SDCrLimit : Set As : $$Total:SDCrLimit Local : Field : SDClBal : Set As : $$Total:SDClBal Local : Field : Default : Style : Small Bold ;[Field: SD DrCr] ;Use :Short Name Field ;Style: Normal ;Border: Thin Left ;Align: Centre ;;Define Collection [Collection: My Sundry Debtors] Type: Ledger Child of: $$GroupSundryDebtors Belongs To: Yes ;;---------------------------- Please help as i want state code to display in reports instead of state name or both will also do
Check tally's function getGSTStateCode reverse the code, and you'll get statename for the code provided.
;----------Code For Getting "State Name" From State Code--------- [function : abc] Variable : PurSetStateCode : String Variable : PurSetState : String purSetState:SeturSetStateCode$$StringPart:$vPurExGSTno:0:2) spurSetState:SeturSetState:$$getGSTStateNameFunction:##PurSetStateCode [Function: getGSTStateNameFunction] Parameter : pStateName : String Return : String 01 : Do If : ##pStateName = "35" : Return : "Andaman & Nicobar Islands" 02 : Do If : ##pStateName = "37" : Return : "Andhra Pradesh" 03 : Do If : ##pStateName = "12" : Return : "Arunachal Pradesh" 04 : Do If : ##pStateName = "18" : Return : "Assam" 05 : Do If : ##pStateName = "10" : Return :"Bihar" 06 : Do If : ##pStateName = "04" : Return : "Chandigarh" 07 : Do If : ##pStateName = "22" : Return : "Chhattisgarh" 08 : Do If : ##pStateName = "26" : Return : "Dadra & Nagar Haveli" 09 : Do If : ##pStateName = "25" : Return : "Daman & Diu" 10 : Do If : ##pStateName = "07" : Return : "Delhi" 11 : Do If : ##pStateName = "30" : Return : "Goa" 12 : Do If : ##pStateName = "24" : Return : "Gujarat" 13 : Do If : ##pStateName = "06" : Return : "Haryana" 14 : Do If : ##pStateName = "02" : Return : "Himachal Pradesh" 15 : Do If : ##pStateName = "01" : Return : "Jammu & Kashmir" 16 : Do If : ##pStateName = "20" : Return : "Jharkhand" 17 : Do If : ##pStateName = "29" : Return : "Karnataka" 18 : Do If : ##pStateName = "32" : Return : "Kerala" 19 : Do If : ##pStateName = "31" : Return : "Lakshadweep" 20 : Do If : ##pStateName = "23" : Return : "Madhya Pradesh" 21 : Do If : ##pStateName = "27" : Return : "Maharashtra" 22 : Do If : ##pStateName = "14" : Return : "Manipur" 23 : Do If : ##pStateName = "17" : Return :"Meghalaya" 24 : Do If : ##pStateName = "15" : Return : "Mizoram" 25 : Do If : ##pStateName = "13" : Return : "Nagaland" 26 : Do If : ##pStateName = "21" : Return : "Odisha" 27 : Do If : ##pStateName = "34" : Return : "Puducherry" 29 : Do If : ##pStateName = "03" : Return : "Punjab" 30 : Do If : ##pStateName = "08" : Return : "Rajasthan" 31 : Do If : ##pStateName = "11" : Return : "Sikkim" 32 : Do If : ##pStateName = "33" : Return : "Tamil Nadu" 33 : Do If : ##pStateName = "36" : Return : "Telangana" 34 : Do If : ##pStateName = "16" : Return : "Tripura" 35 : Do If : ##pStateName = "05" : Return : "Uttarakhand" 36 : Do If : ##pStateName = "09" : Return :"Uttar Pradesh" 37 : Do If : ##pStateName = "19" : Return : "West Bengal" ; 38 : Do If : ($$IsSysNameEqual:GSTOtherTerritory:##pStateName): Return : "97" 39 : Do If : ##pStateName = "38" : Return : "Ladakh" ; @@GSTLadakhStateCode 40 : Return: "" ;;End of File
HOW TO SOLVE THIS PROBLEM PLEASE HELP ME SOLVE THIS CODE [#Collection: Indian States] Title: $$LocaleString: "List of States" Alignment: Right Full Height: Yes ListName : @@State1, @@State2, @@State3, @@State4, @@State5, @@State6, @@State7 ListName : @@State10,@@State11,@@State12,@@State13,@@State14,@@State15,@@State16 ListName : @@State17,@@State18,@@State19,@@State20,@@State21,@@State22,@@State23,@@State24 ListName : @@State25,@@State26,@@State27,@@State28,@@State29,@@State30,@@State31,@@State32 ListName : @@State33,@@State34,@@State35,@@State36, @@State37,@@State38 Format: @@StateFormat Client Only: Yes Add : SubTitle: $$LocaleString: "State Name", "State Code" Add :Format:$$getGSTStateNameFunction:##PurSetStateCode Fetch:getGSTStateNameFunction