/* * [PrepMissouri.java] * * Summary: One shot program to process tax data for Missouri. Generates code for AmericanTax.java table. * * Copyright: (c) 1999-2017 Roedy Green, Canadian Mind Products, http://mindprod.com * * Licence: This software may be copied and used freely for any purpose but military. * http://mindprod.com/contact/nonmil.html * * Requires: JDK 1.8+ * * Created with: JetBrains IntelliJ IDEA IDE http://www.jetbrains.com/idea/ * * Version History: * 1.0 2008-05-22 * 1.1 2010-12-10 update to produce CSV file without state tax included. */ package com.mindprod.americantax; import com.mindprod.common18.ST; import com.mindprod.csv.CSVReader; import java.io.IOException; /** * One shot program to process tax data for Missouri. Generates code for AmericanTax.java table. *

* Generates code for AmericanTax.java table. * * @author Roedy Green, Canadian Mind Products * @version 1.1 2010-12-10 update to produce CSV file without state tax included. * @since 2008-05-22 */ public final class PrepMissouri extends PrepStateBase { /** * Constructor */ private PrepMissouri() { super( "MO", "missouri", 4.225, false /* counties */, true /* cities */, true /* files include state rate */, true /* convert to book case */, 2000 ); } /** * Default method to read and prepare one city record. * You must read, and add SalesTaxItem to salesTaxItems, and skipToNewLine * * @param c open CSV reader. * * @throws IOException if cannot read file */ void prepareCity( final CSVReader c ) throws IOException { String city = ST.toBookTitleCase( c.get() ); // TDD TCED CID should be all caps. city = city.replace( " Tdd", " TDD" ); city = city.replace( " Tced", " TCED" ); city = city.replace( " Cid", " CID" ); city = city.replace( " Fpd", " FTD" ); String county = ST.toBookTitleCase( c.get() ); county = county.replace( " Tdd", " TDD" ); county = county.replace( " Tced", " TCED" ); county = county.replace( " Cid", " CID" ); county = county.replace( " Fpd", " FTD" ); final double percent = c.getDouble() - stateTax; // remove state tax salesTaxItems.add( new SalesTaxItem( county, city, percent ) ); c.skipToNextLine(); } /* * home: http://dor.mo.gov/business/sales/ * download http://dor.mo.gov/pdf/rates/2011/jan2011.txt missouriraw.txt *

* sort by last column, and peel off district lines. * Strip out columns except for city, country, rate. * Copy paste the PDF file then tidy it to this format: * This will take a long time since you need to join lines to form long city names. * Remove (X2) dups. * code abbreviates phrases * ambulance district * Community Improvement District CID * Fire Protection District FPD * xxxx country and * GIBBS,ADAIR,.05350 * NOVINGER,ADAIR,.05350 * BRASHEAR,ADAIR,.06350 *

* and save as E:\com\mindprod\americantax\missouritax.csv * We are interested in the sales tax, not the use tax. */ public static void main( String[] args ) throws IOException { new PrepMissouri().prepare(); } }