Interchange + QuickBooks HOWTO ============================== ic_howto_qb.1.6 (Draft) 1. Introduction =============== 1.1. Summary Description ------------------------ Interchange QuickBooks -- QuickBooks support for transactions and items 1.2. Audience ------------- Users who already have Quickbooks setup and are familiar with it, in addition to having the foundation (or other) catalog correctly working. 1.3. Contact the author ----------------------- If you find any spelling errors, technical slip-ups, mistakes, subliminal messages, or if you wish to send feedback, critique, remarks, comments, or if you wish to contribute examples, instructions for alternative platforms, chapters, or other material, please do so. The preferred method of submitting changes is in the form of a context diff against the SDF source file (ic_howto_qb.sdf). Please address your correspondence to: Volunteer Maintainer, Dan Browning db@kavod.com or Original Author, Mike Heins mike@perusion.com 1.4. Version ------------ This document describes software based on Interchange 4.5 and later. 2. Description ============== Interchange is a business-to-business and business-to-consumer internet ordering and cataloguing product. It has the ability to take orders via the World Wide Web, and store transaction data. This document describes how to interface Interchange with QuickBooks, the popular small-business accounting program from Intuit. QuickBooks has an import/export format called IIF, a mnemonic for Intuit Interchange Format. Fitting, eh? The standard capabilities of Interchange allow production of IIF files for transaction passing. With some support from Interchange UserTags, it can even import and export item listings. 3. Contents =========== The extension files can be found in the Interchange tarball under the 'extensions/quickbooks' directory. The following files are used with this extension: usertag/import_quicken_items UserTag for importing items usertag/export_quicken_items UserTag for exporting items pages/admin/quickbooks/* Menu support for Interchange UI qb.catalog.cfg Quickbooks configuration. 4. Installation =============== To set up this extension, the basic steps are: o Create and copy directories and files. o Add additional database fields. o Modify catalog.cfg with additions. o Add "quickbooks" order route to checkout pages. o Restart Interchange. o Export your items from Interchange catalog (or import your existing QuickBooks items to Interchange). o Test. 4.1. Terms and locations ------------------------ Several terms are used in the examples. Catalog Directory This is the main directory for the catalog, where catalog.cfg resides. It will have a NAME, the name for the catalog. (Some common Interchange demo names are foundation, construct, barry, and simple.) Common locations: /var/lib/interchange/NAME /usr/local/interchange/catalogs/NAME $HOME/catalogs/NAME We will use the path /var/lib/interchange/foundation in these examples. Interchange software directory This is the main directory for your Interchange server, where the file interchange.cfg resides. Common locations: /usr/lib/interchange /usr/local/interchange $HOME/ic We will use the path /usr/lib/interchange in these examples. Interchange tarball directory The quickbooks files are located in the untarred distribution file, before installation of Interchange is performed. Interchange User The Interchange daemon runs as a user ID that cannot be root. It will require write permission on directories it must modify to do its work. We will use the user ID interch in these examples. 4.2. Create and copy directories and files ------------------------------------------ This extension requires you to add some files to your catalog. It is assumed you have tools and knowledge to create directories with the proper permissions. Any directories that will contain varying files like order transaction logs will require write permission for the Interchange daemon user; pages and configuration only need have read permission. 4.3. Quick Installation Script ------------------------------ This script will install the necessary files for you, provided that you modify the variables to your environment. Alternately, you can follow the more detailed installation instructions that follow it. Note that if you are not using a 4.9.8+ version of Interchange, you will need to manually install the qb_safe.filter by copying it from the 4.9.8 code/Filter/qb_safe.filter into your Interchange version. # Modify these three variables to match your environment. export QB=/path/to/interchange/extensions/quickbooks export VENDROOT=/usr/local/interchange export CATROOT=/home/interch/catalogs/foundation mkdir -p $CATROOT/include/menus $CATROOT/vars cp -r $QB/TRANS_QUICKBOOKS \ $CATROOT/vars cp -r $QB/pages/admin/quickbooks \ $CATROOT/pages/admin cp -i $QB/usertag/* \ $VENDROOT/code/UI_Tag # Alternate usertag installation style: # #mkdir -p $CATROOT/usertags/global #cp -i $QB/usertag/* \ # $CATROOT/usertags/global # # Then include the global/*.tag in your interchange.cfg # Variables that optionally modify the export process, along with # their help entries. cat $QB/products/variable.txt.append >> \ $CATROOT/products/variable.txt cat $QB/products/mv_metadata.asc.append >> \ $CATROOT/products/mv_metadata.asc # Menu entries: start with the existing menu, then add ours. cp -i $VENDROOT/lib/UI/pages/include/menus/Admin.txt \ $CATROOT/include/menus cat $QB/menus/Admin.txt.append >> \ $CATROOT/include/menus/Admin.txt # Some configuration changes. cat >> $CATROOT/catalog.cfg < Quickbooks -> Generate IIF Files). You will be presented with a query tool. Select the query options that you would like and submit your query. Among the query options, you have the option to input a QB transaction number. This will be the first number that is used when generating the IIF files, and it will be incremented for each sequential order in the query. You will be notified of its success or failure. The resulting page will: o Inform you of the success or failure of the query. o Provide a link to the "results" IIF file (which includes all of the orders found by the query). Note that this "results" IIf file is overwritten every time a query is run. o Provide a link for each IIF file (one per order). This can be used as a backup, or for importing one-by-one instead of all at once. 6. Discussion ============= The interface provided works for the sample company data distributed with QuickBooks. There are certain requirements to make sure it works in your environment. Also, you can change the configuration by editing the file etc/trans_quickbooks to suit your IIF file needs. 6.1. Sales Tax -------------- QuickBooks has a taxing system whereby tax rates are defined by customer location. There is usually also a generic Sales Tax Item, such as contained in the sample company data. This allows Interchange to calculate the sales tax. If that item is not present then you will need to create it, or specify your tax item using the QB_SALES_TAX_ITEM variable. 6.2. Shipping ------------- Interchange will add a generic item Shipping to each order that has a shipping cost. Its MEMO field will contain the text description of the mode. If that item is not in your QuickBooks item definitions, then you must create it, or specify your shipping item using the QB_SHIPPING_ITEM variable. 6.3. Customer Imports --------------------- To generate a QuickBooks transtype of INVOICE, a CUSTOMER is required. Interchange outputs a CUST IIF record for each sale with the customer information. Since QuickBooks uses the customer name or company to generate the unique listing, we place the Interchange username in parentheses after the company or name. 6.4. IIF generation at time of order ------------------------------------ As of 4.9, the IIF generation was moved from an order route into the Admin UI. This was done so that the IIF generation process could be fine tuned without restarting Interchange and placing an order. If you need the IIF file generated at the time of order, you can still access the pre-4.9.6 files in extensions/quickbooks/legacy. A. Credits ========== o Mike Heins: This document was copied from the original POD documentation (extensions/quickbooks/ic_qb.pod) written by Mike Heins mike@perusion.com. o Dan Browning: Updated by Dan Browning db@kavod.com. B. Document history =================== o July 20, 2002. Initial revision. C. Resources ============ C.1. Documentation ------------------ o What are the IIF File Headers? http://www.quickbooks.com/support/faqs/qbw2000/121756.html o Also see the Quickbooks Help item, "Reference guide to import files" Copyright 2002-2004 Interchange Development Group. Freely redistributable under terms of the GNU General Public License.