import re

from erpnext.stock.get_item_details import sales_doctypes

TIMEZONE = "Asia/Kolkata"

ABBREVIATIONS = {"SEZ", "GST", "CGST", "SGST", "IGST", "CESS", "HSN"}

GST_ACCOUNT_FIELDS = (
    "cgst_account",
    "sgst_account",
    "igst_account",
    "cess_account",
    "cess_non_advol_account",
)

GST_TAX_TYPES = tuple(field[:-8] for field in GST_ACCOUNT_FIELDS)

GST_RCM_TAX_TYPES = tuple(tax_type + "_rcm" for tax_type in GST_TAX_TYPES)

TAX_TYPES = (*GST_TAX_TYPES, *GST_RCM_TAX_TYPES)

GST_PARTY_TYPES = ("Customer", "Supplier", "Company")

# Map for e-Invoice Supply Type
GST_CATEGORIES = {
    "Registered Regular": "B2B",
    "Registered Composition": "B2B",
    "Unregistered": "B2C",
    "SEZ": "SEZ",
    "Overseas": "EXP",
    "Deemed Export": "DEXP",
    "UIN Holders": "B2B",
    "Tax Deductor": "B2B",
    "Tax Collector": "B2B",
    "Input Service Distributor": "B2B",
}

EXPORT_TYPES = (
    "WOP",  # Without Payment of Tax [0]
    "WP",  # With Payment of Tax [1]
)

STATE_NUMBERS = {
    "Andaman and Nicobar Islands": "35",
    "Andhra Pradesh": "37",
    "Arunachal Pradesh": "12",
    "Assam": "18",
    "Bihar": "10",
    "Chandigarh": "04",
    "Chhattisgarh": "22",
    "Dadra and Nagar Haveli and Daman and Diu": "26",
    "Delhi": "07",
    "Goa": "30",
    "Gujarat": "24",
    "Haryana": "06",
    "Himachal Pradesh": "02",
    "Jammu and Kashmir": "01",
    "Jharkhand": "20",
    "Karnataka": "29",
    "Kerala": "32",
    "Ladakh": "38",
    "Lakshadweep Islands": "31",
    "Madhya Pradesh": "23",
    "Maharashtra": "27",
    "Manipur": "14",
    "Meghalaya": "17",
    "Mizoram": "15",
    "Nagaland": "13",
    "Odisha": "21",
    "Other Countries": "96",
    "Other Territory": "97",
    "Puducherry": "34",
    "Punjab": "03",
    "Rajasthan": "08",
    "Sikkim": "11",
    "Tamil Nadu": "33",
    "Telangana": "36",
    "Tripura": "16",
    "Uttar Pradesh": "09",
    "Uttarakhand": "05",
    "West Bengal": "19",
}

INDIAN_STATES = {k: v for k, v in STATE_NUMBERS.items() if k != "Other Countries"}

GST_UOMS = {
    "Bottle": "BTL (Bottles)",
    "Dozen": "DOZ (Dozens)",
    "Gram": "GMS (Grammes)",
    "Litre": "LTR (Liters)",
    "Meter": "MTR (Meters)",
    "Nos": "NOS (Numbers)",
}

UOM_MAP = {
    "BAG": "BAGS",
    "BAL": "BALE",
    "BDL": "BUNDLES",
    "BKL": "BUCKLES",
    "BOU": "BILLION OF UNITS",
    "BOX": "BOX",
    "BTL": "BOTTLES",
    "BUN": "BUNCHES",
    "CAN": "CANS",
    "CBM": "CUBIC METERS",
    "CCM": "CUBIC CENTIMETERS",
    "CMS": "CENTIMETERS",
    "CTN": "CARTONS",
    "DOZ": "DOZENS",
    "DRM": "DRUMS",
    "GGK": "GREAT GROSS",
    "GMS": "GRAMMES",
    "GRS": "GROSS",
    "GYD": "GROSS YARDS",
    "KGS": "KILOGRAMS",
    "KLR": "KILOLITRE",
    "KME": "KILOMETRE",
    "LTR": "LITRES",
    "MLT": "MILILITRE",
    "MTR": "METERS",
    "MTS": "METRIC TON",
    "NOS": "NUMBERS",
    "OTH": "OTHERS",
    "PAC": "PACKS",
    "PCS": "PIECES",
    "PRS": "PAIRS",
    "QTL": "QUINTAL",
    "ROL": "ROLLS",
    "SET": "SETS",
    "SQF": "SQUARE FEET",
    "SQM": "SQUARE METERS",
    "SQY": "SQUARE YARDS",
    "TBS": "TABLETS",
    "TGM": "TEN GROSS",
    "THD": "THOUSANDS",
    "TON": "TONNES",
    "TUB": "TUBES",
    "UGS": "US GALLONS",
    "UNT": "UNITS",
    "YDS": "YARDS",
}

# Not available for Telangana, Ladakh, and Other Territory
STATE_PINCODE_MAPPING = {
    "Jammu and Kashmir": (180, 194),
    "Himachal Pradesh": (171, 177),
    "Punjab": (140, 160),
    "Chandigarh": (160, 160),
    "Uttarakhand": (244, 263),
    "Haryana": (121, 136),
    "Delhi": (110, 110),
    "Rajasthan": (301, 345),
    "Uttar Pradesh": (201, 285),
    "Bihar": (800, 855),
    "Sikkim": (737, 737),
    "Arunachal Pradesh": (790, 792),
    "Nagaland": (797, 798),
    "Manipur": (795, 795),
    "Mizoram": (796, 796),
    "Tripura": (799, 799),
    "Meghalaya": (793, 794),
    "Assam": (781, 788),
    "West Bengal": (700, 743),
    "Jharkhand": (813, 835),
    "Odisha": (751, 770),
    "Chhattisgarh": (490, 497),
    "Madhya Pradesh": (450, 488),
    "Gujarat": (360, 396),
    "Dadra and Nagar Haveli and Daman and Diu": ((362, 362), (396, 396)),
    "Maharashtra": (400, 445),
    "Karnataka": (560, 591),
    "Goa": (403, 403),
    "Lakshadweep Islands": (682, 682),
    "Kerala": (670, 695),
    "Tamil Nadu": (600, 643),
    "Puducherry": ((533, 533), (605, 605), (607, 607), (609, 609), (673, 673)),
    "Andaman and Nicobar Islands": (744, 744),
    "Andhra Pradesh": (500, 535),
}

PORT_CODES = {
    "INABG1": "Alibag",
    "INACH1": "Achra",
    "INADA6": "Ahmedabad Adalaj",
    "INADI1": "Androth Island",
    "INAGI1": "Agatti Island",
    "INAGR4": "Agra",
    "INAGR5": "FPO AGRA",
    "INAGR6": "Agra",
    "INAGTB": "Agartala",
    "INAGX4": "Agatti Island",
    "INAHD6": "ICD SANAND",
    "INAIG6": "GE PVT. LTD.",
    "INAII6": "M/S IGATE GS LTD.",
    "INAIK6": "IBRAHIMPURICD KHURJA",
    "INAIR6": "SP PVT. LTD.",
    "INAJE6": "WLSPUN ANJAR SEZ",
    "INAJJ6": "Arakkonam Melpakkam",
    "INAJL4": "Aizawl",
    "INAJM6": "MUNDRA PORT SEZ",
    "INAKB6": "BIACPL SEZ",
    "INAKD4": "Akola",
    "INAKP6": "APIICL SEZ",
    "INAKR6": "RPCIPL SEZ",
    "INAKV6": "Ankleshwar ICD",
    "INALA1": "ALANG SBY",
    "INALF1": "Allepey",
    "INAMD4": "Ahmedabad",
    "INAMD5": "Ahmedabad",
    "INAMD6": "Ahmedabad",
    "INAMG6": "Amingaon (Gauhati)",
    "INAMI1": "Amini Island",
    "INAMK6": "KSITIL/SEZ/ALAPPUZHA",
    "INANG1": "Anijengo",
    "INANL1": "Arnala",
    "INAPI6": "AAP-SEZ AHMEDABAD",
    "INAPL6": "Dadri ACPL CFS",
    "INAPT6": "Anaparti",
    "INARR6": "Aroor",
    "INASR2": "Amritsar Railway Stn",
    "INASR6": "Amritsar",
    "INATQ4": "Amritsar",
    "INATQ6": "Amritsar",
    "INATRB": "Attari Road",
    "INATT2": "Attari Railway Stat",
    "INAWM6": "SEZ, SHENDRA",
    "INAWS6": "SOMANI SEZ BHIWADI",
    "INAWW6": "WIDL AEZ, AURANGABAD",
    "INAZK1": "Azhikkal",
    "INBAG6": "GEM&JEWEL-SEZ/ULWE",
    "INBAI6": "IT/ITES-B-SEZ/ULWE",
    "INBAM6": "MULTISERVCE-SEZ/ULWE",
    "INBAP6": "MULTISERVICEDRONAGIR",
    "INBAT6": "IT/ITES-C SEZ/UIWE",
    "INBAU6": "IT/ITES-A-SEZ/ULWE",
    "INBAW6": "ICD BAWAL",
    "INBBI4": "Bhubaneswar",
    "INBBM6": "Bari Brahamna ICD",
    "INBBP1": "Bahabal Pur",
    "INBBS6": "SEZ, OIIDC, BHUBANES",
    "INBCH6": "HARI SEZ VARANASI",
    "INBCO6": "EURO MULTIVISION SEZ",
    "INBCP6": "PRITECH/SEZ/BANGLORE",
    "INBDB6": "PRECIOUSCARGOCUSTOMS",
    "INBDG1": "Badagara",
    "INBDH6": "ICD BADOHI",
    "INBDI6": "ICD BADDI,",
    "INBDM6": "ICD, PANCHI, SONIPAT",
    "INBDQ1": "Vadodara",
    "INBDR1": "Baindur",
    "INBED1": "Bedi",
    "INBEK4": "Bareilly",
    "INBEP4": "Bellary",
    "INBET1": "Betul",
    "INBEY1": "Beypore",
    "INBFR6": "M/S GRFL, ICD, BALLA",
    "INBGK6": "Bhagat ki Kothi Jodh",
    "INBGMB": "Baghmara",
    "INBGQ6": "QUEST SEZ BELGAUM",
    "INBGUB": "Bairgania",
    "INBGW1": "Bhagwa",
    "INBHC6": "JUBILANT/SEZ/VILAYAT",
    "INBHD6": "DAHEZ SEZ",
    "INBHJ4": "Bhuj",
    "INBHL6": "Bhilwara",
    "INBHM1": "Bheemunipatnam",
    "INBHO4": "Bhopal",
    "INBHS6": "STERLING BHARUCH",
    "INBHU1": "Bhavanagar",
    "INBHU4": "Bhavanagar",
    "INBKB4": "Bikaner",
    "INBKR1": "Belekeri",
    "INBKT1": "Bankot",
    "INBLC6": "CESSNA/SEZ/BANGALORE",
    "INBLE6": "CONCOR ICD BALASORE",
    "INBLJ6": "Agra",
    "INBLK1": "Belekeri",
    "INBLM1": "Bilimora",
    "INBLP1": "Belapur",
    "INBLR4": "Bangalore",
    "INBLR5": "Bangalore",
    "INBLR6": "Bangalore",
    "INBLTB": "Balet",
    "INBLV6": "VTV/SEZ/BANGALORE",
    "INBMA6": "APIIC PRAKASHAM",
    "INBMR2": "Barmer Railway Stati",
    "INBNC6": "KBITS SEZ BANGALORE",
    "INBND1": "Bandra",
    "INBNG6": "MAHAGAON ICD, THANE",
    "INBNK6": "KOLKATA IT PARK",
    "INBNP1": "Bheemunipatnam",
    "INBNRB": "Bhimnagar",
    "INBNT6": "TCS",
    "INBNW6": "WIPRO SEZ",
    "INBNX6": "CANDOR ONE HTSPL,SEZ",
    "INBNYB": "Berhni",
    "INBOK6": "BORKHEDI ICD NAGPUR",
    "INBOLB": "Bolanganj",
    "INBOM1": "Mumbai (Ex Bombay)",
    "INBOM4": "Mumbai (Ex Bombay)",
    "INBOM5": "Mumbai (Ex Bombay)",
    "INBOM6": "Mumbai(EPZ/SEZ)",
    "INBPL5": "BHOPAL FPO",
    "INBPS5": "APSO MUMBAI",
    "INBRAB": "Barsora",
    "INBRC6": "Baroda",
    "INBRH1": "Broach",
    "INBRI6": "RNBIPL SEZ BIKANER",
    "INBRL6": "L & T/SEZ/VADODARA",
    "INBRM1": "Borlai ¿ Mandla",
    "INBRS6": "S E & C/SEZ/WAGHODIA",
    "INBRY1": "Borya",
    "INBSAB": "Banbasa",
    "INBSB6": "Varanasi",
    "INBSL6": "Bhusaval ICD",
    "INBSN1": "Bassein",
    "INBSR1": "Bulsar",
    "INBSW6": "AFS KAPASHERA",
    "INBTK1": "Bhatkal",
    "INBTMB": "Bhithamore(Sursnad)",
    "INBTR1": "Bitra Island",
    "INBUD1": "Budge-Budge",
    "INBUL6": "AN FTWZ BULANDSHAHR",
    "INBUP4": "Bhatinda",
    "INBUP6": "Bhatinda",
    "INBVC6": "CONCR-ICD/BALLABGARH",
    "INBWD6": "Bhiwadi",
    "INBWN1": "Bhiwandi",
    "INBXR6": "DLF LTD., SEZ",
    "INBYT1": "Beyt",
    "INCAG6": "TATA STEEL SEZGANJAM",
    "INCAM1": "Cambay",
    "INCAP1": "Calingapatam",
    "INCAR1": "Carijam",
    "INCAS6": "SAPL SEZ/ GANJAM",
    "INCBC6": "CHIPL SEZ/ COIMBATOR",
    "INCBD4": "Car Nicobar",
    "INCBDB": "Changrabandh",
    "INCBE6": "COIMBATORE",
    "INCBL1": "Chandbali",
    "INCBS6": "SE&C COIMBATORE",
    "INCCH6": "Chinchwad ICD",
    "INCCI6": "WIPRO SEZ HINJEWADI",
    "INCCJ1": "Kozhikode (ex Calicu",
    "INCCJ4": "Kozhikode (ex Calicu",
    "INCCP6": "PEPPL SEZ, CHINCHWAD",
    "INCCQ6": "M/S QB PARK LTD.",
    "INCCT6": "KINFRAFP SEZ",
    "INCCU1": "Calcutta",
    "INCCU4": "Calcutta",
    "INCCU5": "Calcutta",
    "INCCW6": "WIPRO LTD.",
    "INCDC6": "RGT PARK (PHASE-II)",
    "INCDD6": "RGT PARK (PHASE-I)",
    "INCDL1": "Cuddalore",
    "INCDP1": "Coondapur (Ganguly)",
    "INCDP4": "Cuddapah",
    "INCDP6": "M/S APIIC LTD SEZ.",
    "INCDQ6": "QUARKCITY/SEZ/MOHALI",
    "INCDR6": "SUN PHARMACEUTICALS",
    "INCEC6": "L&T AE IT SEZ PVT.",
    "INCGA6": "MWCD APARELS CHENGPA",
    "INCGE6": "ETA TECH. PVT. LTD.",
    "INCGI6": "MWCD SEZ CHENGALPATU",
    "INCGL6": "MWCD AUTO ANCILARIES",
    "INCHE6": "Tiruppur-Chettipalay",
    "INCHJ6": "ICD WARDHA",
    "INCHL1": "Colachel",
    "INCHMB": "Chamurchi",
    "INCHN6": "Vadodara Chhani CFS",
    "INCHPB": "Champai",
    "INCHR1": "Chapora",
    "INCJA6": "L&T AE IT SEZ",
    "INCJB4": "Coimbatore",
    "INCJB6": "Coimbatore",
    "INCJC6": "NCTL (ENGG.) SEZ/ KA",
    "INCJD6": "DLF INFOCITY DEV.",
    "INCJE6": "ECTN KANCHEEPURAM",
    "INCJF6": "FTIL SRIPERUMBUDUR",
    "INCJH6": "ICD WARDHA",
    "INCJI6": "ETL IS LTD.",
    "INCJJ6": "J M FTZ/SEZ/MANNUR",
    "INCJN6": "NIPL SEZ SRIPERUMBUD",
    "INCJO6": "SIPCOT ORAGADAM SRIP",
    "INCJS6": "SIPCOT SRIPERUMBUDUR",
    "INCLK6": "KSITIL/SEZ/KOZHIKODE",
    "INCLU6": "ULCCS/SEZ/KOZHIKODE",
    "INCLX6": "Chirala",
    "INCMB1": "Cambay",
    "INCML6": "KATHUWAS ICD ALWAR",
    "INCNB1": "Car-Nicobar",
    "INCNC6": "NCT PVT. LTD. SEZ",
    "INCNN1": "Cannanore",
    "INCOA6": "KAKINADA SEZ KAKINAD",
    "INCOH4": "Cooch Behar",
    "INCOK1": "Cochin",
    "INCOK4": "Cochin",
    "INCOK6": "Cochin(EPZ/SEZ)",
    "INCOL1": "Colochel",
    "INCOO1": "Coondapur (Ganguly)",
    "INCOP6": "PARRY SEZ KAKINADA",
    "INCPC6": "Kanpur Chakeri",
    "INCPL6": "Dadri CGML",
    "INCPR6": "ICD CHAWAPAYAL",
    "INCRL6": "RGA SEZ CHIKKANKANNE",
    "INCRN1": "Cornwallis",
    "INCRW6": "WIPRO/SEZ/BANGALORE",
    "INCRXB": "LOKSAN LCS",
    "INCSP6": "SI PVT. LTD.",
    "INCSV6": "SPVL SEZ COIMBATORE",
    "INCTI1": "Chetlat Island",
    "INCUM1": "Cutch Mandvi",
    "INDAE4": "Daparizo",
    "INDAH1": "Dahej",
    "INDAI4": "Darjeeling",
    "INDAM1": "Daman",
    "INDAM4": "Daman",
    "INDAR6": "ARTHA SEZ GR. NOIDA",
    "INDBD4": "Dhanbad",
    "INDBS6": "SANTA-SEZ/ViII-MUPPI",
    "INDDL6": "PSWC ICD DHANDARIKAL",
    "INDEA6": "AS PVT. LTD.",
    "INDED4": "Dehra Dun",
    "INDEF6": "INFOSYS SEZ DADRI",
    "INDEG1": "Deogad",
    "INDEH6": "HCL TECH. LTD. DEV.",
    "INDEI6": "IVR SEZ NOIDA",
    "INDEJ6": "JUBILANT SEZ NOIDA",
    "INDEL4": "Delhi",
    "INDEL5": "Delhi",
    "INDEM6": "MOSERBAER/SEZ/NOIDA",
    "INDEN6": "M/S NIIT TECH. LTD.",
    "INDEP4": "Deparizo",
    "INDER6": "Dadri",
    "INDES6": "M/S SEAVIEW DEV. LTD",
    "INDET6": "UNITECH HITECH NOIDA",
    "INDEU6": "UNITECHINFRA NOIDA",
    "INDEW6": "M/S WIPRO LTD.",
    "INDGI6": "GALLANT SEZ NOIDA",
    "INDGT6": "GOLDEN SEZ NOIDA",
    "INDHA6": "Indore-Dhannad",
    "INDHBB": "Dhubri Steamerghat",
    "INDHLB": "Dhalaighat",
    "INDHM4": "Dharamsala",
    "INDHN1": "Dahanu",
    "INDHP1": "Dabhol Port",
    "INDHR1": "Dholera",
    "INDHU1": "Dahanu",
    "INDIB4": "Dibrugarh",
    "INDID6": "SEZ, MIDC, NANDED",
    "INDIG1": "Dighi Port",
    "INDIG6": "Dighi (Pune)",
    "INDIT6": "ANSAL IT/SEZ/NOIDA",
    "INDIU1": "Diu",
    "INDIU4": "Diu",
    "INDIV1": "Div",
    "INDLAB": "Dharchula",
    "INDLH6": "APLLP SEZ BENGALURU",
    "INDLI2": "Delhi Railway Statio",
    "INDLOB": "BIRPARA LCS",
    "INDLUB": "Dalu",
    "INDMA1": "DHAMRA",
    "INDMRB": "Demagir",
    "INDMT1": "Dharamtar",
    "INDMU4": "Dimapur",
    "INDPC4": "DPC BKC Mumbai",
    "INDPR6": "DAPPER",
    "INDRC6": "RCIPL SEZ NOIDA",
    "INDRGB": "Darranga",
    "INDRK1": "Dwarka (Rupen)",
    "INDRL1": "Dabolim",
    "INDRU6": "Belgaum Desur",
    "INDSK1": "Dhanu-shkodi",
    "INDSM6": "SMRTPL SEZ NOIDA",
    "INDTW1": "Dantiwara",
    "INDUR6": "ICD Durgapur",
    "INDWA1": "Dwarka",
    "INDWKB": "Dawki",
    "INDWN6": "ICD SAMALKHA PANIPAT",
    "INDWR6": "INFOSYS SEZ HUBLI",
    "INENR1": "KAMARAJAR PORT LTD",
    "INERP6": "PUTHUVYPEEN SEZ",
    "INERV6": "VALLARPADOM SEZ",
    "INESH1": "Elphinstone Harbour",
    "INFBD6": "ICD Faridabad",
    "INFBE6": "ESPIRE SEZ FARIDABAD",
    "INFBM6": "METRO SEZ GURGAON",
    "INFBP6": "PERPETUAL FARIDABAD",
    "INFBRB": "Fulbari LCS",
    "INFBS6": "SELECTOSEZ FARIDABAD",
    "INFCH5": "FPO(SEA) CHENNAI",
    "INFLT6": "Falta(SEZ)",
    "INFMA6": "APIICL MEDAK",
    "INFMH6": "HGSEZL RANGA REDDY",
    "INFMJ6": "M/S J.T. SEZ, RANGAR",
    "INFMS6": "M/S STARGAZE, SEZ",
    "INGAIB": "Gauriphanta",
    "INGALB": "Galgalia",
    "INGAO6": "OPGS POWER GUJARAT",
    "INGAS6": "ANSAL SEZ GURGAON",
    "INGAU1": "Gauhati (Panidi)",
    "INGAU2": "Gauhati (Panidi)",
    "INGAU4": "Gauhati (Panidi)",
    "INGAU5": "FPO GUWAHATI",
    "INGAW2": "Guwahati",
    "INGAY4": "Gaya",
    "INGDL6": "DLF CYBERCITY SEZ,",
    "INGDM6": "MF PARK PVT. LTD.",
    "INGDP6": "FLLPL SEZ THIRUVALUR",
    "INGED2": "Gede Railway Station",
    "INGGA1": "Gogha",
    "INGGB6": "SBPL SEZ GURGAON",
    "INGGC6": "ORIENT SEZ GURGAON",
    "INGGD6": "DLF LTD.",
    "INGGE6": "AEPL SEZ GURGAON",
    "INGGF6": "FRESH SEZ GURGAON",
    "INGGG6": "GHI SEZ GURGAON",
    "INGGI6": "GIL SEZ, GURGAON",
    "INGGL6": "LUXOR SEZ GURGAON",
    "INGGM6": "MIPPL SEZ GURGAON",
    "INGGN2": "Gurgaon",
    "INGGO6": "ORIENTCRAFT SEZ GGN",
    "INGGP6": "SUNWISE SEZ GURGAON",
    "INGGS6": "SUNCITY SEZ GURGAON",
    "INGGU6": "URP LTD.",
    "INGGV1": "GANGAVARAM PORT",
    "INGHA1": "Ghogha",
    "INGHC6": "ASF INSIGNIA SEZ",
    "INGHPB": "Ghasuapara",
    "INGHR6": "Garhi Harsaru Gurgao",
    "INGHWB": "Gauhati Steamerghat",
    "INGID6": "MID PLTD SEZ GURGAON",
    "INGIN6": "Gandhidham",
    "INGJIB": "Gunji",
    "INGJXB": "Ghojadanga",
    "INGKJ2": "Golakganj Railway St",
    "INGKJB": "Golakganj LCS",
    "INGLY6": "APIIC MAHABOOBNAGAR",
    "INGMI6": "MID PVT LTD.",
    "INGNA6": "APPL, SEZ",
    "INGNC6": "GIFT SEZ LTD",
    "INGNG6": "GIDC, SEZ",
    "INGNL6": "LOMA ITPARK GHANSOLI",
    "INGNP6": "GPRPL SEZ GURGAON",
    "INGNR6": "LIPL/MARRIPLEMGUNTUR",
    "INGNT6": "TCSL, SEZ",
    "INGOI4": "Goa",
    "INGOP4": "Gorakhpur",
    "INGPB6": "PROGRESSIVE GURGAON",
    "INGPR1": "Gopalpur",
    "INGRD6": "Mumbai DP-II",
    "INGRL6": "GPRL SEZ GURGAON",
    "INGRN6": "RELIANCE SEZ GURGAON",
    "INGRR6": "Mumbai DP-I",
    "INGRS6": "RAHEJA SEZ GURGAON",
    "INGRW6": "APM ICD BHAMBOLIKHED",
    "INGTGB": "Gitaldah road",
    "INGTI6": "INFOSYS TECH. LTD.",
    "INGTR2": "Guntur",
    "INGTS6": "SP PVT. LTD.",
    "INGTZB": "Getandah",
    "INGUX4": "Guna",
    "INGWL4": "Gwalior",
    "INGWL6": "Malanpuri (Gwalior)",
    "INGWM4": "VIJAYAWADA AIRPORT",
    "INHAL1": "Haldia",
    "INHAN6": "HINDAUN ICD KARAULI",
    "INHAO6": "OPTOINFRA/SEZ/HASSAN",
    "INHAS6": "HASSAN ICD",
    "INHBB6": "SDPL SEZ BENGALURU",
    "INHBX4": "Hubli",
    "INHDD6": "SIDCUL ICD PANTNAGAR",
    "INHEB6": "GOCL SEZ BENGALURU",
    "INHEI6": "INFOSYS/SEZ/MYSORE",
    "INHEM6": "MEBP/SEZ/BANGALORE",
    "INHGLB": "Hingalganj",
    "INHGT1": "Hangarkatta",
    "INHIR6": "SHB ICD SURAT",
    "INHJR4": "Khajuraho",
    "INHLD2": "Haldibari Railway St",
    "INHLE6": "INFY SEZ BEGURHOBLI",
    "INHLIB": "Hilli",
    "INHND1": "HEMNAGAR PORT",
    "INHON1": "Honavar",
    "INHPI6": "SANDKHERA ICD KASHIP",
    "INHRN1": "Harnai",
    "INHSF6": "KIADBFP SEZ HASSAN",
    "INHSP6": "KIADBP SEZ HASSAN",
    "INHSS4": "Hissar",
    "INHST6": "KIADBT SEZ HASSAN",
    "INHSU6": "ICD HOSUR",
    "INHTSB": "Hatisar",
    "INHUR6": "M/S RASSI, SEZ",
    "INHWR1": "Honawar",
    "INHYB6": "LHT PARK PVT. LTD.",
    "INHYD4": "Hyderabad",
    "INHYD5": "FPO HYDERABAD",
    "INHYD6": "Hyderabad",
    "INHZA1": "HAZIRA, SURAT",
    "INHZA6": "Hazira SEZ, Surat",
    "INIDR4": "Indore",
    "INIDR6": "Indore(EPZ/SEZ)",
    "INIGU6": "Coimbatore Irugur IC",
    "INILP6": "Tiruvallur-ILP ICD",
    "INIMF4": "Imphal",
    "ININB6": "CRYSTAL IT PARK, SEZ",
    "ININD6": "ICD Pithampur",
    "ININI6": "IMPETUS INFOTECH SEZ",
    "ININN6": "INFOSYS SEZ INDORE",
    "ININT6": "TCS SEZ INDORE",
    "INISK4": "Nasik",
    "INISK6": "Nasik",
    "INIXA4": "Agartala",
    "INIXB4": "Bagdogra",
    "INIXC4": "Chandigarh",
    "INIXD4": "Allahabad",
    "INIXE1": "Mangalore",
    "INIXE4": "Mangalore",
    "INIXG4": "Belgaum",
    "INIXH4": "Kailashahar",
    "INIXI4": "Lilabari",
    "INIXJ4": "Jammu",
    "INIXK4": "Keshod",
    "INIXL4": "Leh",
    "INIXL5": "FPO LEH",
    "INIXM4": "Madurai",
    "INIXM6": "MaduraiICD",
    "INIXN4": "Khowai",
    "INIXP4": "Pathankot",
    "INIXQ4": "Kamalpur",
    "INIXR4": "Ranchi",
    "INIXS4": "Silchar",
    "INIXT4": "Pasighat",
    "INIXU4": "AURANGABAD",
    "INIXW4": "Jamshedpur",
    "INIXW6": "Jamshedpur ICD",
    "INIXY1": "Kandla",
    "INIXY4": "Kandla",
    "INIXY6": "Kandla SEZ",
    "INIXZ1": "Port Blair",
    "INIXZ4": "Port Blair",
    "INJAI4": "Jaipur",
    "INJAI5": "Jaipur",
    "INJAI6": "Jaipur",
    "INJAK1": "Jakhau",
    "INJAL6": "Jalgaon",
    "INJAYB": "Jayanagar",
    "INJBD1": "Jafrabad",
    "INJBL6": "E-COMPLEX SEZ/Amreli",
    "INJBNB": "JOGBANI",
    "INJDA1": "Jodia",
    "INJDH4": "Jodhpur",
    "INJDH6": "Jodhpur",
    "INJGA4": "Jamnagar",
    "INJGB4": "Jagdalpur",
    "INJGD1": "Jaigad",
    "INJGI6": "GENPACT SEZ JAIPUR",
    "INJHA6": "VEDANTA ALU. LTD.",
    "INJHOB": "Jhulaghat (Pithoraga",
    "INJHV6": "VEDANTASEZJHARSUGUDA",
    "INJIGB": "Jaigaon",
    "INJJK6": "ICD JSL JAJPUR",
    "INJKA6": "SACHANA ICD VIRAMGAM",
    "INJLR4": "Jabalpur",
    "INJNJ6": "NEWFOUND SEZ THANE",
    "INJNR4": "Nashik-Janori ACC",
    "INJNR6": "Nashik-Janori ICD",
    "INJPGB": "Jalpaiguri",
    "INJPI6": "RIICO SEZ 1 SITAPUR",
    "INJPV6": "VATIKA SEZ JAIPUR",
    "INJPW6": "MWC JAIPUR LTD.",
    "INJRH4": "Jorhat",
    "INJSA4": "Jaisalmer",
    "INJSG6": "CONCOR JHARSUGUDA",
    "INJSM6": "ADANI POWER SEZ",
    "INJSZ6": "JAIPUR SEZ",
    "INJTP1": "Jaitapur",
    "INJUC6": "Jalandhar",
    "INJUX6": "Basni Jodhpur ICD",
    "INJWAB": "Jarwa",
    "INKAK1": "Kakinada",
    "INKAK6": "Kakinada",
    "INKAL1": "Kallai",
    "INKAP6": "Kapadra (Surat)",
    "INKAR6": "Karur ICD",
    "INKAT1": "KATTUPALLI PORT",
    "INKBC6": "ICD HAZIRA",
    "INKBT1": "Khambhat",
    "INKCG6": "NSL SEZ PVT. LTD.",
    "INKDD6": "Karedu",
    "INKDI1": "Kadmat Island",
    "INKDL6": "KANDLA SEZ",
    "INKDN1": "Kodinar(Muldwarka)",
    "INKDP1": "Kondiapetnam",
    "INKELB": "Kel Sahar Subdivisio",
    "INKGG6": "GLOBAL/SEZ/BANGALORE",
    "INKGJ1": "KARIMGANJ STEAMERGHA",
    "INKHD6": "ICD Kheda-Dhar",
    "INKIW1": "Kelwa",
    "INKJA6": "APP/SEZ/DODAKANAHALI",
    "INKJB6": "BAGMAN/SEZ/BANGALORE",
    "INKJD6": "DIVYA/SEZ/BANGALORE",
    "INKJG6": "GOPALAN/SEZ/BANGALOR",
    "INKJH6": "HCL/SEZ/BANGALORE",
    "INKJIB": "PIPRAUN LCS",
    "INKJM6": "BD SEZ BENGALURU",
    "INKJR6": "BBREL KUNDALAHALLI",
    "INKKR1": "Kilakari",
    "INKKU6": "Kanakpura Jaipur ICD",
    "INKLB6": "BLUE/SEZ/ERNAKULAM",
    "INKLC6": "CARB/SEZ/ERNAKULAM",
    "INKLG6": "SGS/SEZ/ERNAKULAM",
    "INKLH4": "Kohlapur",
    "INKLI6": "INFOPARK/SEZ/EKM",
    "INKLK6": "KINFRA KANAYANNOOR",
    "INKLM6": "MULTISERVCEKALAMBOLI",
    "INKLN6": "IT/ITES/SEZ/KALAMBOL",
    "INKLS6": "SMART CITY SEZ KOCHI",
    "INKLY1": "Kalyan",
    "INKMAB": "KULKULI LCS",
    "INKMB1": "Kumbharu",
    "INKMI6": "INFO SEZ ERNAKULAM",
    "INKML6": "DEIPL KURUBARAPALLI",
    "INKND1": "Kankudy",
    "INKNK6": "INFOPARK SEZ KORATTY",
    "INKNLB": "Kunauli",
    "INKNU4": "Kanpur",
    "INKNU5": "FPO KANPUR",
    "INKNU6": "Kanpur",
    "INKOC5": "Kochi",
    "INKOD1": "Kodinar",
    "INKOI1": "Koilthottum",
    "INKOK1": "Koka",
    "INKON1": "Konarak",
    "INKPK6": "CONCOR ICD MIHAN",
    "INKRI1": "Krishnapatnam",
    "INKRK1": "Karaikal",
    "INKRM6": "MADC LTD.",
    "INKRN1": "Karanja",
    "INKRP1": "Kiranpani",
    "INKRW1": "Karwar",
    "INKSG1": "Kasargod",
    "INKSH1": "Kelshi",
    "INKSP1": "Kulasekarapatnam",
    "INKTD1": "Kotda",
    "INKTGB": "Katarniyaghat",
    "INKTI1": "Kiltan Island",
    "INKTRB": "Kathihar",
    "INKTT6": "Kota",
    "INKTU4": "Kota",
    "INKTU6": "Kota",
    "INKTW1": "Koteshwar",
    "INKTY6": "CHEYYAR POCHAMPALLI",
    "INKUK1": "KOLLAM PORT",
    "INKUK6": "KSITIL/SEZ/KOLLAM",
    "INKUR6": "OIIDC SEZ KHURDA",
    "INKUU4": "Kulu",
    "INKVI1": "Kavi",
    "INKVL1": "Kovalam",
    "INKVR6": "WFPML SEZ KOVVUR",
    "INKVT1": "Kavaratti Island",
    "INKWAB": "Khunwa",
    "INKWGB": "Khowaighat",
    "INKWHB": "KAKRAHAWA LCS",
    "INKXJ2": "Karimganj Railway St",
    "INKYM6": "KOTTAYAM",
    "INKZE6": "E TECH-I/SEZ/THPURAM",
    "INKZP6": "E PARK-III/SEZ/T'RAM",
    "INKZT6": "E PARK-II/SEZ/TPURAM",
    "INLCH6": "HCL IT SEZ LUCKNOW",
    "INLDA4": "Malda",
    "INLDH6": "Ludhiana",
    "INLGLB": "Lalgola Town",
    "INLKO4": "Lucknow",
    "INLKQB": "LAUKAHA LCS",
    "INLON6": "ICD Loni",
    "INLPB6": "BBLLP NANAKRAMGUDA",
    "INLPC6": "CMC LTD.",
    "INLPD6": "M/S DLF, SEZ",
    "INLPG6": "GCPL SEZ KOKAPET",
    "INLPI6": "M/S SUNDEW, SEZ",
    "INLPJ6": "RELIANCE SEZ",
    "INLPM6": "MDL NANAKRAMGUDA",
    "INLPR1": "Leapuram",
    "INLPS6": "D NSL IP LTD.",
    "INLPW6": "WIPRO LTD. HYDERABAD",
    "INLTBB": "Latu Bazar",
    "INLUD6": "LUDHIANA",
    "INLUH4": "Ludhiana",
    "INLUH5": "FPO LUDHIANA",
    "INLUH6": "Ludhiana",
    "INLWG6": "WIPRO LTD.",
    "INMAA1": "Chennai (Ex Madras)",
    "INMAA4": "Chennai (Ex Madras)",
    "INMAA5": "Chennai (Ex Madras)",
    "INMAA6": "Chennai(EPZ/SEZ)",
    "INMAB6": "BRIGADE/SEZ/KANNADA",
    "INMAE6": "EC OF TAMIL NADU",
    "INMAH1": "Mahe",
    "INMAI6": "INFOSYS/SEZ/MANGALOR",
    "INMAL1": "Malpe",
    "INMAP1": "Masulipatnam",
    "INMAQ6": "MANGALORE SEZ",
    "INMAS6": "TRIL INFOPARK LTD.",
    "INMBC6": "Moradabad(EPZ/SEZ)",
    "INMBD6": "Pakwara (Moradabad)",
    "INMBS6": "Madhosingh ICD",
    "INMCI1": "Minicoi I",
    "INMDA1": "Magdalla",
    "INMDD6": "Mandideep ICD",
    "INMDE6": "APIIC SEZ MEDAK",
    "INMDG6": "Margao",
    "INMDK1": "Muldwarka",
    "INMDP1": "Mandapam",
    "INMDU6": "KERN ICD MADURAI",
    "INMDV1": "Mandvi",
    "INMDW1": "Meadows",
    "INMEA6": "APIIC-SEZ/ViII-LALGA",
    "INMEC6": "EC OF TAMIL NADU",
    "INMGHB": "Mahendraganj",
    "INMGR1": "Mangrol",
    "INMHA1": "Mahuva",
    "INMHDB": "Kotawalighat (Mohedi",
    "INMHE1": "Mahe",
    "INMHGB": "Mahurighat",
    "INMHN2": "Mahisashan Railway S",
    "INMKCB": "Manikarchar",
    "INMKD6": "MIKADO SEZ GURGAON",
    "INMLI1": "Maroli",
    "INMLP1": "Mallipuram",
    "INMLW1": "Malwan",
    "INMNB2": "Munabao Railway Stat",
    "INMNR1": "Manori",
    "INMNUB": "Manu",
    "INMNW1": "Mandwa",
    "INMOH4": "Mohanbari",
    "INMOR2": "Moradabad",
    "INMPC1": "TEST",
    "INMPR6": "Malanpur ICD",
    "INMQK6": "KIADB/SEZ/MANGALORE",
    "INMRA1": "Mora",
    "INMRD1": "Murad",
    "INMREB": "Moreh",
    "INMRG4": "Margao",
    "INMRJ6": "Miraj",
    "INMRM1": "Marmagoa",
    "INMSR6": "RENAIS/SEZ/BANGALORE",
    "INMTW1": "Metwad",
    "INMUC6": "SCPL/SEZ/MULUND",
    "INMUL6": "Mulund ICD",
    "INMUN1": "Mundra",
    "INMUR1": "Murad",
    "INMUZ6": "MODINAGAR ICD",
    "INMWA6": "ICD Maliwada",
    "INMYB1": "Mayabandar",
    "INMYL6": "L AND T/SEZ/MYSORE",
    "INMYO6": "OPTOINFRA/SEZ/MYSORE",
    "INMYQ4": "Mysore",
    "INMZA4": "Muzaffarnagar",
    "INMZU4": "Muzaffarpur",
    "INNAG4": "Nagpur",
    "INNAG6": "Nagpur",
    "INNAN1": "Nancowrie",
    "INNAV1": "Navlakhi",
    "INNDA6": "Noida(EPZ/SEZ)",
    "INNDC4": "Nanded",
    "INNDG1": "Nandgaon",
    "INNDP1": "Tuglakabad",
    "INNEE1": "Neendakara",
    "INNEL1": "Nellore",
    "INNGB6": "BUTIBORI ICD NAGPUR",
    "INNGKB": "NAGARKATA LCS",
    "INNGO6": "OSE SEZ NOIDA",
    "INNGP6": "Nagpur",
    "INNGRB": "Nepalgunj Road",
    "INNGSB": "Village Namgaya Ship",
    "INNKI6": "INDIABULLS NASHIK",
    "INNKNB": "Namkhana",
    "INNML1": "New Mangalore",
    "INNMTB": "Neamati steamer Ghat",
    "INNNN6": "AMRL SEZ NANGUNERI",
    "INNPGB": "Nampong",
    "INNPT1": "Nagapattinam",
    "INNRP6": "AA LTD.",
    "INNSA1": "Jawaharlal Nehru (Nh",
    "INNSK6": "Nasik",
    "INNTLB": "SHERATHANG LCS",
    "INNTVB": "THOOTHIBARI LCS",
    "INNUR6": "Kundli",
    "INNVB1": "Navabunder(with its",
    "INNVP1": "Navaspur",
    "INNVT1": "Nivti",
    "INNVY4": "Neyveli",
    "INNWP1": "Newapur",
    "INNYP6": "APIIC LTD.",
    "INOKH1": "Okha",
    "INOMN4": "Osmanabad",
    "INOMU1": "Old Mundra Port",
    "INONJ1": "Onjal",
    "INPAB4": "Bilaspur",
    "INPAK6": "KSITIL/SEZ/PAYYANOOR",
    "INPAN1": "Panaji Port",
    "INPAO6": "HBS SEZ PANOLI",
    "INPAP2": "Panipat",
    "INPAT4": "Patna",
    "INPAV1": "Pipavav (Victor) Por",
    "INPAV2": "Pipavav (Victor) Por",
    "INPBD1": "Porbandar",
    "INPBD4": "Porbandar",
    "INPBLB": "KAMARDWISA LCS",
    "INPDD1": "Padubidri Minor Port",
    "INPEK6": "EKIPL/SEZ/PUNE",
    "INPGH4": "Pantnagar",
    "INPHBB": "Phulbari",
    "INPID1": "Port Indai",
    "INPIN1": "Pindhara",
    "INPIT6": "ITL/SEZ/PUNE",
    "INPKD6": "IGEL SEZ SETTIPALI",
    "INPKR6": "ICD PALI, REWARI",
    "INPMB1": "Pamban",
    "INPMP6": "Pimpri",
    "INPMT6": "MTDCCL/SEZ/PUNE",
    "INPNB6": "BTSL SEZ PUNE",
    "INPNE6": "NT PVT. LTD.",
    "INPNF5": "PATNA FPO",
    "INPNI6": "MITTAL SEZ PANIPAT",
    "INPNJ1": "Panjim",
    "INPNK6": "KLPPL PANKI",
    "INPNL6": "PERSIPINA SEZ RAIGAD",
    "INPNM1": "Panambur",
    "INPNN1": "Ponnani",
    "INPNP6": "Babarpur",
    "INPNQ2": "Pune",
    "INPNQ4": "Pune",
    "INPNQ6": "SERUM BIO/SEZ/PUNE",
    "INPNTB": "Panitanki(Naxalbari)",
    "INPNU6": "TMSF PVT. LTD.",
    "INPNV6": "ICD Panvel",
    "INPNY1": "Pondicherry",
    "INPNY4": "Pondicherry",
    "INPNY6": "ICD PULICHAPALLAM",
    "INPPG6": "Patparganj ICD,DELHI",
    "INPPJ1": "Pellet Plant Jetty a",
    "INPRD6": "PREPL SEZ PERUNGUDI",
    "INPRG1": "Purangad",
    "INPRK6": "ICD POWARKHEDA",
    "INPRT1": "Paradeep",
    "INPSH1": "Palshet",
    "INPSI6": "SIPL/SEZ/PUNE",
    "INPSN6": "PERFECT SEZ NOIDA",
    "INPSP6": "NSPL SEZ HINJEWADI",
    "INPTL6": "Patli ICD",
    "INPTN1": "Portonovo",
    "INPTPB": "Petrapole LCS",
    "INPUA6": "AIGP SEZ WAGHOLI",
    "INPUE6": "EON KHARADI SEZ",
    "INPUI6": "KIPPLGDPLSEZ KHARADI",
    "INPUL1": "Pulicat",
    "INPUM6": "MIDC PUNE",
    "INPUN6": "M/S KBTV PVT., PUNE",
    "INPUR1": "Puri",
    "INPUT4": "Puttaparthi",
    "INPVL6": "Panvel ICD",
    "INPVS6": "SNPIP SEZ TAMBARAM",
    "INPWL6": "PALWAL ICD",
    "INPYB4": "Jeypore",
    "INPYS6": "SIPCOT SEZ ERODE",
    "INQRH6": "HTPL ICD KILARAIPUR",
    "INQRP6": "ADANI ICD KILARAIPUR",
    "INQUI1": "Quilon",
    "INRAI6": "Raipur",
    "INRAJ4": "Rajkot",
    "INRAJ6": "Rajkot",
    "INRAM1": "Rameshwaram",
    "INRDP2": "Radhikapur Railway S",
    "INREA6": "Rewari",
    "INRED1": "Redi",
    "INREW4": "Rewa",
    "INRGBB": "Old Raghna Bazar",
    "INRGH4": "Balurghat",
    "INRGJ2": "RAIGANJ LCS RLY",
    "INRGT1": "Ranghat Bay",
    "INRGUB": "Ryngku",
    "INRJA4": "Rajahmundry",
    "INRJI4": "Rajouri",
    "INRJN6": "LS PVT. LTD.",
    "INRJP1": "Rajpara",
    "INRJR1": "Rajpuri",
    "INRKG1": "Rajakkamangalam",
    "INRMD4": "Ramagundam",
    "INRML6": "CONCOR ICDNAYARAIPUR",
    "INRNC5": "RANCHI FPO",
    "INRNG2": "Ranaghat Railway Sta",
    "INRNR1": "Ranpar",
    "INRPL6": "Raddipalam",
    "INRPR4": "Raipur",
    "INRPR6": "Raipur",
    "INRPU5": "RAIPUR FPO",
    "INRRI1": "Raili",
    "INRRK4": "Rourkela",
    "INRTC1": "Ratnagiri",
    "INRTC4": "Ratnagiri",
    "INRTM6": "CONCOR ICD RATLAM",
    "INRUP4": "Rupsi",
    "INRVD1": "Revdanda",
    "INRWR1": "Rameshwaram",
    "INRXLB": "Raxaul",
    "INSABB": "Sabroom",
    "INSAC6": "Sachin (Surat)",
    "INSAJ6": "NAVKAR ICD UMBERGAON",
    "INSAL1": "Salaya",
    "INSAS6": "INFOSYS SEZ MOHALI",
    "INSAU6": "THAR DRY PORT",
    "INSBC6": "BIOCON SEZ BANGALORE",
    "INSBH1": "Sinbhour",
    "INSBI6": "ICD Sabarmati",
    "INSBK6": "KIADB/SEZ/BANGALORE",
    "INSBL6": "INFOSYS/SEZ/BANGLORE",
    "INSBW6": "WIPRO ELEC/SEZ/BLR",
    "INSBZ1": "SHELLA BAZAR",
    "INSCH6": "SAP-SEZ SURAT",
    "INSGF6": "GRFL ICD SAHNEWAL",
    "INSHI1": "Shirola",
    "INSHL4": "Shillong",
    "INSHP1": "Sinbhour Port",
    "INSIK1": "Sikka",
    "INSJR6": "Surajpur",
    "INSKD6": "ICD KALINGANAGAR",
    "INSKPB": "Sukhia Pokhari",
    "INSLL6": "Singanallur",
    "INSLR2": "Silcher R.M.S. Offic",
    "INSLRB": "Silcher Steamerghat",
    "INSLT6": "SALT LAKE (EPZ/SEZ)",
    "INSLV4": "Simla",
    "INSMK6": "KEONICS/SEZ/SHIMOGA",
    "INSMPB": "Srimantapur",
    "INSMR1": "Simor",
    "INSNA6": "ANSAL SEZ SONEPAT",
    "INSNBB": "Sonabarsa",
    "INSNF6": "ICD, Hyderabad",
    "INSNG2": "Singabad Railway Sta",
    "INSNI6": "KANECH, ICD SAHNEWAL",
    "INSNLB": "Sonauli",
    "INSNN6": "APIIC LTD.",
    "INSNR6": "ARI LTD.",
    "INSNS6": "NLE PVT. LTD.",
    "INSPC6": "CCLPIL SEZ VIZAG",
    "INSPE6": "ASDI SEZ NELLORE",
    "INSRE6": "Saharanpur",
    "INSRK6": "KSITILA/SEZ/PALI/ALZ",
    "INSRV1": "Surasani-Yanam",
    "INSSE4": "Sholapur",
    "INSTFB": "SIKTA LCS",
    "INSTIB": "Sitai",
    "INSTM6": "MIDC PHALTAN SEZ",
    "INSTP1": "Satpati",
    "INSTRB": "Sutarkandi",
    "INSTT6": "Dadri STTPL CFS",
    "INSTU6": "MIDC SEZ SATARA",
    "INSTV1": "Surat",
    "INSTV4": "Surat",
    "INSTV6": "Surat(EPZ/SEZ)",
    "INSWD1": "Shriwardhan",
    "INSXE6": "ELCOT AMMAPALAYAM",
    "INSXR4": "Srinagar",
    "INSXR5": "FPO SRINAGAR",
    "INSXV4": "Salem",
    "INSXV6": "Salem",
    "INTAD1": "Tadri",
    "INTAS6": "SRICITYPVTLTD-SEZ",
    "INTBC6": "CTS PVT. LTD.",
    "INTBM6": "PHPL SEZ KANCHEPURAM",
    "INTBP6": "SPIPL SEZ, PERUGULTH",
    "INTBS6": "HEXAWARE TECH. LTD.",
    "INTBT6": "TCS LTD.",
    "INTCR6": "M/S TICS, ICD MATHIL",
    "INTDE6": "Tudiyalur-Coimbatore",
    "INTEI4": "Tezu",
    "INTEL1": "Tellicherry",
    "INTEN6": "SIPCOT GANGAKONDAN",
    "INTEZ4": "Tezpur",
    "INTGN6": "KEIPL/ PUNE",
    "INTHA6": "Thar Dry Port Jodhpu",
    "INTHL1": "Thal",
    "INTHO6": "Tiruppur-Thottiplaya",
    "INTIR4": "Tirupati",
    "INTIV1": "Tiviri",
    "INTJA1": "Talaja",
    "INTJPB": "Tezpur Steamerghat",
    "INTJV4": "Thanjavur",
    "INTKD2": "Tuglakabad",
    "INTKD6": "Tuglakabad",
    "INTKNB": "Tikonia",
    "INTLG6": "Pune-Talegoan ICD",
    "INTLT6": "L&T SBL L&T CHENNAI",
    "INTMI6": "M/S IFFCO KISAN, SEZ",
    "INTMP1": "Trombay",
    "INTMX6": "ICD, THIMMAPUR,",
    "INTNA1": "Thana",
    "INTNC6": "CCCL SEZ TUTICORIN",
    "INTND1": "Tondi",
    "INTNGB": "Tungi",
    "INTNI6": "HIPL SEZ",
    "INTNK1": "Tankari",
    "INTNS6": "SSL SEZ TUTICORIN",
    "INTPH1": "Thopputhurai",
    "INTPJ6": "ECTN SEZ TRICHY",
    "INTPN1": "Talpona",
    "INTRA1": "Tranquebar",
    "INTRL6": "ICD Tiruvallur",
    "INTRP1": "Tarapur",
    "INTRV4": "Thiruvananthapuram",
    "INTRZ4": "Tiruchirapalli",
    "INTSI6": "HVCPL SEZ KADAYAM",
    "INTTP6": "Dadri TTPL",
    "INTTS1": "T.T. SHED (KIDDERPOR)",
    "INTUI6": "FCPL SEZ KESAVARAM",
    "INTUN1": "Tuna",
    "INTUP6": "Tirupur",
    "INTUT1": "Tuticorin",
    "INTUT6": "Tuticorin ICD",
    "INTVC6": "KINFRAA SEZ",
    "INTVT6": "ICD TONDIARPET CHENN",
    "INTYR1": "Tirukkadayyur",
    "INUDI6": "SYNEFRA-SEZ/UDUPI",
    "INUDN6": "GHB-SEZ SURAT",
    "INUDR4": "Udaipur",
    "INUDR6": "Udaipur",
    "INUDZ6": "Udaipur",
    "INUKL6": "ETLISL SEZ ERODE",
    "INULPB": "Ultapani",
    "INULW1": "Ulwa",
    "INUMB1": "Umbergoan",
    "INUMR1": "Umarsadi",
    "INURF6": "FAB CITY SPV-SEZ/SRI",
    "INURG6": "GMR HYDTABAD AVIATIO",
    "INURI6": "INDU TECHZONE PVT.",
    "INURT6": "TCS LTD. ADIBATLA",
    "INUTN1": "Uttan",
    "INVAD1": "Vadinar",
    "INVAL6": "Valvada ICD",
    "INVAP1": "Vapi",
    "INVEN1": "Vengurla",
    "INVEP1": "Veppalodai",
    "INVGA4": "Vijayawada",
    "INVGA5": "FPO VIJAYAWADA",
    "INVGR6": "BHOJVA ICD VIRAMGAM",
    "INVKH6": "HIRANANDANI BUIL.",
    "INVKM1": "Valinokkam",
    "INVLD6": "DISH/SEZ/KALYANGADH",
    "INVLN6": "NG REALTY-SEZ/TALUKA",
    "INVLR6": "SIPCOT LTD.",
    "INVNG1": "Vengurla",
    "INVNS4": "Varanasi",
    "INVNS5": "FPO VARANASI",
    "INVNS6": "Varanasi",
    "INVPI6": "Vapi",
    "INVRD1": "Varavda",
    "INVRU1": "Vadarevu",
    "INVSA6": "APIIC (HALL NO.3)",
    "INVSI1": "Vansi-Borsi",
    "INVSK6": "APIIC- (HALL NO. 2)",
    "INVSP6": "WIPRO SEZRESPUVANIPA",
    "INVSV1": "Varsova",
    "INVTC6": "CHEYYAR VELLORE",
    "INVTZ1": "Visakhapatnam",
    "INVTZ4": "Visakhapatnam",
    "INVTZ6": "Visakhapatnam SEZ",
    "INVVA1": "Veraval",
    "INVYD1": "Vijaydurg",
    "INVZJ1": "Vazhinjam",
    "INVZM6": "DLL SEZ",
    "INVZR6": "M/S DR. REDDY SEZ",
    "INWAL6": "Waluj (Aurangabad)",
    "INWFD6": "ICD Bangalore",
    "INWFI6": "INFO/SEZ/BANGALORE",
    "INWFT6": "ITPL SEZ II BENGALUR",
    "INWGC4": "Warrangal",
    "INWRR6": "WARDHA POWER CO LTD",
    "INYMA6": "MODERN ASSET SEZ II",
    "INYNA6": "MOSERN ASSET SEZ I",
    "INYNK6": "KIP/SEZ/N BANGALORE",
    "INYNL6": "L&T CEL SEZ II",
    "INYNM6": "MILESTONE/SEZ/BLR",
    "INYNT6": "L&T CEL SEZ I",
    "INZIP6": "ZIPL-SEZ AHMEDABAD",
}

CURRENCY_CODES = {
    "BDT": "Bangladeshi taka",
    "AED": "United Arab Emirates dirham",
    "AFN": "Afghan afghani",
    "ALL": "Albanian lek",
    "AMD": "Armenian dram",
    "ANG": "Netherlands Antillean guilder",
    "AOA": "Angolan kwanza",
    "ARS": "Argentine peso",
    "AUD": "Australian dollar",
    "AWG": "Aruban florin",
    "AZN": "Azerbaijani manat",
    "BAM": "Bosnia and Herzegovina convertible mark",
    "BBD": "Barbados dollar",
    "BGN": "Bulgarian lev",
    "BHD": "Bahraini dinar",
    "BIF": "Burundian franc",
    "BMD": "Bermudian dollar",
    "BND": "Brunei dollar",
    "BOB": "Boliviano",
    "BOV": "Bolivian Mvdol (funds code)",
    "BRL": "Brazilian real",
    "BSD": "Bahamian dollar",
    "BTN": "Bhutanese ngultrum",
    "BWP": "Botswana pula",
    "BYN": "Belarusian ruble",
    "BZD": "Belize dollar",
    "CAD": "Canadian dollar",
    "CDF": "Congolese franc",
    "CHE": "WIR Euro (complementary currency)",
    "CHF": "Swiss franc",
    "CHW": "WIR Franc (complementary currency)",
    "CLF": "Unidad de Fomento (funds code)",
    "CLP": "Chilean peso",
    "CNY": "Renminbi (Chinese) yuan",
    "COP": "Colombian peso",
    "COU": "Unidad de Valor Real (UVR) (funds code)",
    "CRC": "Costa Rican colon",
    "CUC": "Cuban convertible peso",
    "CUP": "Cuban peso",
    "CVE": "Cape Verdean escudo",
    "CZK": "Czech koruna",
    "DJF": "Djiboutian franc",
    "DKK": "Danish krone",
    "DOP": "Dominican peso",
    "DZD": "Algerian dinar",
    "EGP": "Egyptian pound",
    "ERN": "Eritrean nakfa",
    "ETB": "Ethiopian birr",
    "EUR": "Euro",
    "FJD": "Fiji dollar",
    "FKP": "Falkland Islands pound",
    "GBP": "Pound sterling",
    "GEL": "Georgian lari",
    "GHS": "Ghanaian cedi",
    "GIP": "Gibraltar pound",
    "GMD": "Gambian dalasi",
    "GNF": "Guinean franc",
    "GTQ": "Guatemalan quetzal",
    "GYD": "Guyanese dollar",
    "HKD": "Hong Kong dollar",
    "HNL": "Honduran lempira",
    "HRK": "Croatian kuna",
    "HTG": "Haitian gourde",
    "HUF": "Hungarian forint",
    "IDR": "Indonesian rupiah",
    "ILS": "Israeli new shekel",
    "INR": "Indian rupee",
    "IQD": "Iraqi dinar",
    "IRR": "Iranian rial",
    "ISK": "Icelandic króna",
    "JMD": "Jamaican dollar",
    "JOD": "Jordanian dinar",
    "JPY": "Japanese yen",
    "KES": "Kenyan shilling",
    "KGS": "Kyrgyzstani som",
    "KHR": "Cambodian riel",
    "KMF": "Comoro franc",
    "KPW": "North Korean won",
    "KRW": "South Korean won",
    "KWD": "Kuwaiti dinar",
    "KYD": "Cayman Islands dollar",
    "KZT": "Kazakhstani tenge",
    "LAK": "Lao kip",
    "LBP": "Lebanese pound",
    "LKR": "Sri Lankan rupee",
    "LRD": "Liberian dollar",
    "LSL": "Lesotho loti",
    "LYD": "Libyan dinar",
    "MAD": "Moroccan dirham",
    "MDL": "Moldovan leu",
    "MGA": "Malagasy ariary",
    "MKD": "Macedonian denar",
    "MMK": "Myanmar kyat",
    "MNT": "Mongolian tögrög",
    "MOP": "Macanese pataca",
    "MRU": "Mauritanian ouguiya",
    "MUR": "Mauritian rupee",
    "MVR": "Maldivian rufiyaa",
    "MWK": "Malawian kwacha",
    "MXN": "Mexican peso",
    "MXV": "Mexican Unidad de Inversion (UDI) (funds code)",
    "MYR": "Malaysian ringgit",
    "MZN": "Mozambican metical",
    "NAD": "Namibian dollar",
    "NGN": "Nigerian naira",
    "NIO": "Nicaraguan córdoba",
    "NOK": "Norwegian krone",
    "NPR": "Nepalese rupee",
    "NZD": "New Zealand dollar",
    "OMR": "Omani rial",
    "PAB": "Panamanian balboa",
    "PEN": "Peruvian sol",
    "PGK": "Papua New Guinean kina",
    "PHP": "Philippine peso",
    "PKR": "Pakistani rupee",
    "PLN": "Polish zloty",
    "PYG": "Paraguayan guaraní",
    "QAR": "Qatari riyal",
    "RON": "Romanian leu",
    "RSD": "Serbian dinar",
    "RUB": "Russian ruble",
    "RWF": "Rwandan franc",
    "SAR": "Saudi riyal",
    "SBD": "Solomon Islands dollar",
    "SCR": "Seychelles rupee",
    "SDG": "Sudanese pound",
    "SEK": "Swedish krona/kronor",
    "SGD": "Singapore dollar",
    "SHP": "Saint Helena pound",
    "SLL": "Sierra Leonean leone",
    "SOS": "Somali shilling",
    "SRD": "Surinamese dollar",
    "SSP": "South Sudanese pound",
    "STN": "São Tomé and Príncipe dobra",
    "SVC": "Salvadoran colón",
    "SYP": "Syrian pound",
    "SZL": "Swazi lilangeni",
    "THB": "Thai baht",
    "TJS": "Tajikistani somoni",
    "TMT": "Turkmenistan manat",
    "TND": "Tunisian dinar",
    "TOP": "Tongan pa?anga",
    "TRY": "Turkish lira",
    "TTD": "Trinidad and Tobago dollar",
    "TWD": "New Taiwan dollar",
    "TZS": "Tanzanian shilling",
    "UAH": "Ukrainian hryvnia",
    "UGX": "Ugandan shilling",
    "USD": "United States dollar",
    "USN": "United States dollar (next day) (funds code)",
    "UYI": "Uruguay Peso en Unidades Indexadas (URUIURUI) (funds code)",
    "UYU": "Uruguayan peso",
    "UYW": "Unidad previsional",
    "UZS": "Uzbekistan som",
    "VES": "Venezuelan bolívar soberano",
    "VND": "Vietnamese d?ng",
    "VUV": "Vanuatu vatu",
    "WST": "Samoan tala",
    "XAF": "CFA franc BEAC",
    "XAG": "Silver (one troy ounce)",
    "XAU": "Gold (one troy ounce)",
    "XBA": "European Composite Unit (EURCO) (bond market unit)",
    "XBB": "European Monetary Unit (E.M.U.-6) (bond market unit)",
    "XBC": "European Unit of Account 9 (E.U.A.-9) (bond market unit)",
    "XBD": "European Unit of Account 17 (E.U.A.-17) (bond market unit)",
    "XCD": "East Caribbean dollar",
    "XDR": "Special drawing rights",
    "XOF": "CFA franc BCEAO",
    "XPD": "Palladium (one troy ounce)",
    "XPF": "CFP franc (franc Pacifique)",
    "XPT": "Platinum (one troy ounce)",
    "XSU": "SUCRE",
    "XTS": "Code reserved for testing",
    "XUA": "ADB Unit of Account",
    "XXX": "No currency",
    "YER": "Yemeni rial",
    "ZAR": "South African rand",
    "ZMW": "Zambian kwacha",
    "ZWL": "Zimbabwean dollar",
}

GST_TAX_RATES = {
    0.000,
    0.100,
    0.250,
    1.000,
    1.500,
    3.000,
    5.000,
    6.000,
    7.500,
    12.000,
    18.000,
    28.000,
}

# REGEX PATTERNS (https://developer.gst.gov.in/apiportal/taxpayer/returns)

NORMAL = (  # Normal but not TCS
    r"^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}[Z1-9ABD-J]{1}[0-9A-Z]{1}$"
)
GOVT_DEPTID = r"^[0-9]{2}[A-Z]{4}[0-9]{5}[A-Z]{1}[0-9]{1}[Z]{1}[0-9]{1}$"
REGISTERED = re.compile(rf"{NORMAL}|{GOVT_DEPTID}")

# Not allowed in GSTR1 B2B
NRI_ID = r"^[0-9]{4}[A-Z]{3}[0-9]{5}[N][R][0-9A-Z]{1}$"
OIDAR = r"^[9][9][0-9]{2}[A-Z]{3}[0-9]{5}[O][S][0-9A-Z]{1}$"
OVERSEAS = re.compile(rf"{NRI_ID}|{OIDAR}")

UNBODY = re.compile(r"^[0-9]{4}[A-Z]{3}[0-9]{5}[UO]{1}[N][A-Z0-9]{1}$")
TDS = re.compile(r"^[0-9]{2}[A-Z]{4}[A-Z0-9]{1}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}[D][0-9A-Z]$")
TCS = re.compile(r"^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}[C]{1}[0-9A-Z]{1}$")

GSTIN_FORMATS = {
    "Registered Regular": REGISTERED,
    "Registered Composition": REGISTERED,
    "SEZ": REGISTERED,
    "Overseas": OVERSEAS,
    "Deemed Export": REGISTERED,
    "UIN Holders": UNBODY,
    "Tax Deductor": TDS,
    "Tax Collector": TCS,
    "Input Service Distributor": REGISTERED,
}

PAN_NUMBER = re.compile(r"^[A-Z]{5}[0-9]{4}[A-Z]{1}$")
PINCODE_FORMAT = re.compile(r"^[1-9][0-9]{5}$")

# Maximum length must be 16 characters. First character must be alphanumeric.
# Subsequent characters can be alphanumeric, hyphens or slashes.
GST_INVOICE_NUMBER_FORMAT = re.compile(r"^[^\W_][A-Za-z0-9\-\/]{0,15}$")

# used to extract Distance (whole number) from string
DISTANCE_REGEX = re.compile(r"\d+")

INVOICE_DOCTYPES = {"Sales Invoice", "Purchase Invoice"}
SALES_DOCTYPES = set(sales_doctypes)
SUBCONTRACTING_DOCTYPES = (
    "Subcontracting Order",
    "Subcontracting Receipt",
    "Stock Entry",
)

BUG_REPORT_URL = "https://github.com/resilient-tech/india-compliance/issues/new"

ORIGINAL_VS_AMENDED = (
    {
        "original": "B2B",
        "amended": "B2BA",
    },
    {
        "original": "CDNR",
        "amended": "CDNRA",
    },
    {
        "original": "ISD",
        "amended": "ISDA",
    },
    {
        "original": "IMPG",
        "amended": "",
    },
    {
        "original": "IMPGSEZ",
        "amended": "",
    },
)

E_INVOICE_MASTER_CODES_URL = "https://einvoice1.gst.gov.in/Others/MasterCodes"
