[interchange-cvs] interchange - danb modified 8 files

interchange-core at icdevgroup.org interchange-core@icdevgroup.org
Wed Jul 2 23:25:00 EDT 2003


User:      danb
Date:      2003-07-03 02:24:07 GMT
Modified:  .        WHATSNEW
Modified:  code/Filter qb_safe.filter
Modified:  extensions/quickbooks README.html README.txt
Modified:  extensions/quickbooks/pages/admin/quickbooks
Modified:           generate_new_iif.html index.html
Modified:  extensions/quickbooks/products mv_metadata.asc.append
Modified:  extensions/quickbooks/vars TRANS_QUICKBOOKS
Log:
* Quickbooks updates:

  - Updated documentation.

  - Installation fixes.

  - Rewrite of the IIF generation query page:
    - Can query by order number range, date range, or "since last generation"
    - Allow specification of QuickBooks invoice number to be used
      and incremented during IIF generation.
    - Filters out deleted orders.

  - IIF Generation changes:
    - Use the country name instead of the country code.
    - Some filter updates (the period is not as dangerous as it looks).

Revision  Changes    Path
2.139     +21 -1     interchange/WHATSNEW


rev 2.139, prev_rev 2.138
Index: WHATSNEW
===================================================================
RCS file: /var/cvs/interchange/WHATSNEW,v
retrieving revision 2.138
retrieving revision 2.139
diff -u -r2.138 -r2.139
--- WHATSNEW	1 Jul 2003 10:46:32 -0000	2.138
+++ WHATSNEW	3 Jul 2003 02:24:07 -0000	2.139
@@ -120,7 +120,7 @@
 ------
 
 * Drop Build-Depends on libdb2-dev to allow builds on woody and sid,
-  apache-dev already has the proper dependency (Closes: #198136)
+  apache-dev already has the proper dependency (Closes:#198136)
 
 Miscellaneous
 -------------
@@ -130,6 +130,26 @@
 * Various minor cleanup, prevents warnings on startup.
 
 * Call tracking functions only if Vend::Track object exists.
+
+Extensions
+----------
+
+* Quickbooks updates:
+
+  - Updated documentation.
+  
+  - Installation fixes.
+  
+  - Rewrite of the IIF generation query page:
+    - Can query by order number range, date range, or "since last generation"
+    - Allow specification of QuickBooks invoice number to be used 
+      and incremented during IIF generation.
+    - Filters out deleted orders.
+  
+  - IIF Generation changes:
+    - Use the country name instead of the country code.
+    - Some filter updates (the period is not as dangerous as it looks).
+
 
 ------------------------------------------------------------------------------
 



1.2       +1 -1      interchange/code/Filter/qb_safe.filter


rev 1.2, prev_rev 1.1
Index: qb_safe.filter
===================================================================
RCS file: /var/cvs/interchange/code/Filter/qb_safe.filter,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- qb_safe.filter	4 Jun 2003 09:23:28 -0000	1.1
+++ qb_safe.filter	3 Jul 2003 02:24:07 -0000	1.2
@@ -5,7 +5,7 @@
 CodeDef qb_safe Routine <<EOR
 sub {
 	my $val = shift;
-	$val =~ s/[\"\.\/\\]//g;
+	$val =~ s/[\"\/\\]//g;
 	return $val;
 }
 EOR



1.2       +45 -14    interchange/extensions/quickbooks/README.html


rev 1.2, prev_rev 1.1
Index: README.html
===================================================================
RCS file: /var/cvs/interchange/extensions/quickbooks/README.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- README.html	4 Jun 2003 09:23:28 -0000	1.1
+++ README.html	3 Jul 2003 02:24:07 -0000	1.2
@@ -64,14 +64,19 @@
 <BR>
 <A HREF="#Test">4.12. Test</A></UL>
 <BR>
-<A HREF="#Discussion">5. Discussion</A><UL>
-<A HREF="#Sales Tax">5.1. Sales Tax</A>
+<A HREF="#Usage">5. Usage</A><UL>
+<A HREF="#Accessing Admin UI Features">5.1. Accessing Admin UI Features</A>
 <BR>
-<A HREF="#Shipping">5.2. Shipping</A>
+<A HREF="#Generating IIF Files">5.2. Generating IIF Files</A></UL>
 <BR>
-<A HREF="#Customer Imports">5.3. Customer Imports</A>
+<A HREF="#Discussion">6. Discussion</A><UL>
+<A HREF="#Sales Tax">6.1. Sales Tax</A>
 <BR>
-<A HREF="#IIF generation at time of order">5.4. IIF generation at time of order</A></UL>
+<A HREF="#Shipping">6.2. Shipping</A>
+<BR>
+<A HREF="#Customer Imports">6.3. Customer Imports</A>
+<BR>
+<A HREF="#IIF generation at time of order">6.4. IIF generation at time of order</A></UL>
 <BR>
 <A HREF="#Credits">A. Credits</A>
 <BR>
@@ -152,6 +157,7 @@
 <P>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.</P>
 <H2><A NAME="Quick Installation Script">4.3. Quick Installation Script</A></H2>
 <P>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.</P>
+<P>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.</P>
 <PRE>
 
 # Modify these three variables to match your environment.
@@ -167,11 +173,19 @@
 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/variable.txt-additions &gt;&gt; \
+cat   $QB/products/variable.txt.append &gt;&gt; \
       $CATROOT/products/variable.txt
-cat   $QB/mv_metadata.asc-additions &gt;&gt; \
+cat   $QB/products/mv_metadata.asc.append &gt;&gt; \
       $CATROOT/products/mv_metadata.asc
 
 # Menu entries: start with the existing menu, then add ours.
@@ -260,16 +274,33 @@
 <H2><A NAME="Test">4.12. Test</A></H2>
 <P>Place a test order on your Interchange catalog once you have finished installing. You should find a file in the <TT>orders</TT> directory with the name <TT>qbYYYYMMDD.iif</TT>. (YYYY=year, MM=month, DD=day.) Transfer this file to your QuickBooks machine and run File/Import and select that file as the source. This should import the customer and order into the system. If it doesn't work, it may be due to lack of sales tax or shipping definitions, discussed below.</P>
 <HR>
-<H1><A NAME="Discussion">5. Discussion</A></H1>
+<H1><A NAME="Usage">5. Usage</A></H1>
+<H2><A NAME="Accessing Admin UI Features">5.1. Accessing Admin UI Features</A></H2>
+<P>A typical installation will cause the Administrative User Interface Features to become available via the top level menu:</P>
+<UL>
+<LI>Login to the Admin UI
+<LI>Administration
+<LI>Quickbooks</UL>
+<P>You should then be presented with a menu of the Admin UI features.</P>
+<H2><A NAME="Generating IIF Files">5.2. Generating IIF Files</A></H2>
+<P>To generate the IIF files, access the corresponding page from the Admin UI Quickbooks Menu (Administration -&gt; Quickbooks -&gt; Generate IIF Files).</P>
+<P>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.</P>
+<P>You will be notified of its success or failure.  The resulting page will:</P>
+<UL>
+<LI>Inform you of the success or failure of the query.
+<LI>Provide a link to the &quot;results&quot; IIF file (which includes all of the orders found by the query).  Note that this &quot;results&quot; IIf file is overwritten every time a query is run.
+<LI>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.</UL>
+<HR>
+<H1><A NAME="Discussion">6. Discussion</A></H1>
 <P>The interface provided works for the sample company data distributed with QuickBooks. There are certain requirements to make sure it works in your environment.</P>
 <P>Also, you can change the configuration by editing the file etc/trans_quickbooks to suit your IIF file needs.</P>
-<H2><A NAME="Sales Tax">5.1. Sales Tax</A></H2>
+<H2><A NAME="Sales Tax">6.1. Sales Tax</A></H2>
 <P>QuickBooks has a taxing system whereby tax rates are defined by customer location. There is usually also a generic <TT>Sales Tax Item</TT>, 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 <TT>QB_SALES_TAX_ITEM</TT> variable.</P>
-<H2><A NAME="Shipping">5.2. Shipping</A></H2>
+<H2><A NAME="Shipping">6.2. Shipping</A></H2>
 <P>Interchange will add a generic item <TT>Shipping</TT> 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 <TT>QB_SHIPPING_ITEM</TT> variable.</P>
-<H2><A NAME="Customer Imports">5.3. Customer Imports</A></H2>
+<H2><A NAME="Customer Imports">6.3. Customer Imports</A></H2>
 <P>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.</P>
-<H2><A NAME="IIF generation at time of order">5.4. IIF generation at time of order</A></H2>
+<H2><A NAME="IIF generation at time of order">6.4. IIF generation at time of order</A></H2>
 <P>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 <TT>extensions/quickbooks/legacy</TT>.</P>
 <HR>
 <H1><A NAME="Credits">A. Credits</A></H1>
@@ -293,8 +324,8 @@
 <P ALIGN="Center"><A HREF="index.html" TARGET="_top">Catalog</A></P>
 </DIV>
 <HR>
-<ADDRESS><SPAN CLASS="doc-id">ic_howto_qb-1.3</SPAN> <SPAN CLASS="doc-status">(Draft)</SPAN></ADDRESS>
-<ADDRESS CLASS="doc-modified">4 June 2003</ADDRESS>
+<ADDRESS><SPAN CLASS="doc-id">ic_howto_qb-1.4</SPAN> <SPAN CLASS="doc-status">(Draft)</SPAN></ADDRESS>
+<ADDRESS CLASS="doc-modified">2 July 2003</ADDRESS>
 <ADDRESS CLASS="copyright">Copyright &copy;  2001,2002 Mike Heins &lt;<A HREF="mailto:mike@perusion.com">mike@perusion.com</A>&gt;, Dan Browning &lt;<A HREF="mailto:db@kavod.com">db@kavod.com</A>&gt;</ADDRESS>
 </DIV>
 



1.2       +63 -8     interchange/extensions/quickbooks/README.txt


rev 1.2, prev_rev 1.1
Index: README.txt
===================================================================
RCS file: /var/cvs/interchange/extensions/quickbooks/README.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- README.txt	4 Jun 2003 09:23:28 -0000	1.1
+++ README.txt	3 Jul 2003 02:24:07 -0000	1.2
@@ -1,7 +1,7 @@
 Interchange + QuickBooks HOWTO
 ==============================
 
-ic_howto_qb.1.3 (Draft)
+ic_howto_qb.1.4 (Draft)
 
 1. Introduction
 ===============
@@ -151,6 +151,10 @@
 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
@@ -165,11 +169,19 @@
 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/variable.txt-additions >> \
+cat   $QB/products/variable.txt.append >> \
       $CATROOT/products/variable.txt
-cat   $QB/mv_metadata.asc-additions >> \
+cat   $QB/products/mv_metadata.asc.append >> \
       $CATROOT/products/mv_metadata.asc
 
 # Menu entries: start with the existing menu, then add ours.
@@ -364,7 +376,50 @@
 If it doesn't work, it may be due to lack of sales tax or shipping
 definitions, discussed below.
 
-5. Discussion
+5. Usage
+========
+
+5.1. Accessing Admin UI Features
+--------------------------------
+
+A typical installation will cause the Administrative User Interface
+Features to become available via the top level menu:
+
+o    Login to the Admin UI
+
+o    Administration
+
+o    Quickbooks
+
+You should then be presented with a menu of the Admin UI features.
+
+5.2. Generating IIF Files
+-------------------------
+
+To generate the IIF files, access the corresponding page from the
+Admin UI Quickbooks Menu (Administration -> 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
@@ -374,7 +429,7 @@
 Also, you can change the configuration by editing the file
 etc/trans_quickbooks to suit your IIF file needs.
 
-5.1. Sales Tax
+6.1. Sales Tax
 --------------
 
 QuickBooks has a taxing system whereby tax rates are defined by
@@ -384,7 +439,7 @@
 need to create it, or specify your tax item using the
 QB_SALES_TAX_ITEM variable.
 
-5.2. Shipping
+6.2. Shipping
 -------------
 
 Interchange will add a generic item Shipping to each order that has a
@@ -393,7 +448,7 @@
 you must create it, or specify your shipping item using the
 QB_SHIPPING_ITEM variable.
 
-5.3. Customer Imports
+6.3. Customer Imports
 ---------------------
 
 To generate a QuickBooks transtype of INVOICE, a CUSTOMER is required.
@@ -402,7 +457,7 @@
 generate the unique listing, we place the Interchange username in
 parentheses after the company or name.
 
-5.4. IIF generation at time of order
+6.4. IIF generation at time of order
 ------------------------------------
 
 As of 4.9, the IIF generation was moved from an order route into the



2.2       +179 -35   interchange/extensions/quickbooks/pages/admin/quickbooks/generate_new_iif.html


rev 2.2, prev_rev 2.1
Index: generate_new_iif.html
===================================================================
RCS file: /var/cvs/interchange/extensions/quickbooks/pages/admin/quickbooks/generate_new_iif.html,v
retrieving revision 2.1
retrieving revision 2.2
diff -u -r2.1 -r2.2
--- generate_new_iif.html	4 Jun 2003 09:23:29 -0000	2.1
+++ generate_new_iif.html	3 Jul 2003 02:24:07 -0000	2.2
@@ -1,29 +1,148 @@
 [set page_title]Quickbooks -- Generate new IIF files[/set]
-[set help_name]quickbooks[/set]
+[set help_name]quickbooks.main[/set]
 [set icon_name]icon_config.gif[/set]
+
 @_UI_STD_HEAD_@
 
 <!-- BEGIN CONTENT -->
 
+
+<h2 align=center> Quickbooks IIF Generation </h2>
+
+<p>
+	<strong>Please note: we do not recommend generating more than 100 IIF files at a time, 
+	due to the load on the system.</strong>
+</p>
+
+<hr>
+
+<p><ol><li>Please select your query options:</li></p>
+
+
+<form name=form2 action="[area __UI_BASE__/quickbooks/generate_new_iif]" method="POST">
+	<input type=hidden name="mv_session_id" value="[data session id]">
+	
+	[tmp any_new_limit]50[/tmp]
+	
+	[update values]
+	<table>
+		<tr>
+			<td>
+				<input type=radio name=query_type value="order_between" [checked name=query_type value="order_between" default=1]>
+				Order Number between:</li>
+				</ul>
+			</td>
+			<td align=left>
+				<input type=text name="order_from" value="[cgi order_from]"> and
+				<input type=text name="order_to" value="[cgi order_to]">
+			</td>
+		
+		<tr>
+			<td colspan=2>&nbsp;</td>
+		</tr>
+		<tr>
+			<td>
+				<input type=radio name=query_type value="date_between" [checked name=query_type value="date_between" default=0]>
+				Date between:
+			</td>
+			<td>
+				<input type=text name="date_from" value="[cgi date_from]"> and
+				<input type=text name="date_to" value="[cgi date_to]"> (YYYYMMDD)
+			</td>
+		<tr>
+			<td colspan=2>&nbsp;</td>
+		</tr>
+		<tr>
+			<td>
+				<input type=radio name=query_type value="one_order" [checked name=query_type value="one_order" default=0]>
+				Only One Order Number:
+			</td>
+			<td>
+				<input type=text name="order_number" value="[cgi order_number]">
+			</td>
+		</tr>
+		<tr>
+			<td colspan=2>&nbsp;</td>
+		</tr>
+		<tr>
+			<td>
+				<input type=radio name=query_type value="any_new" [checked name=query_type value="any_new" default=0]>
+				Generate any new IIF files
+			</td>
+			<td>
+				(since the last generation, up to [scratch any_new_limit] at a time)
+			</td>
+		</tr>
+		<tr>
+			<td colspan=2>&nbsp;</td>
+		</tr>
+	</table>
+	
+	<li>Start with this quickbooks invoice number: <input type=text name="qb_invoice_num" value="[cgi qb_invoice_num]"></li>
+			
+	<p>
+		<input type=hidden name="go" value="1">
+		<li><input type=submit value="Generate new IIF file(s)"></li>
+	</p>
+	
+	</ol>
+</form>
+
+
 [if type=explicit compare=|
 	[calc]
-		return '' unless $CGI->{ 'go' };
+		return 1 if $CGI->{ 'query_type' } eq 'any_new';
+		
 		# User must have chosen at least one limiting factor before selecting orders.
 		for ( 'date_from', 'order_number', 'order_from' ) {
 			return 1 if $CGI->{ $_ };
 		}
+		
 		return '';
 	[/calc]
 |]
-	<font color=red>Generating...</font><BR><BR><BR>
 	
+	
+	<hr>
+	
+	<p><font color=red>Starting generation...</font></p>
+	<blockquote>
 	<!-- zero out the file so that it starts fresh for all the coming orders.-->
 	[log create=1 umask=022 file=">orders/0_qb_results.iif" type=text interpolate=0 hide=1][/log]
 	
+	[comment]
+	[if cgi query_type eq 'any_new']
+		<!-- Find any orders that haven't been generated yet -->
+		
+		[tmp addsql]
+			AND comments NOT LIKE '%(syncronized)%'
+		[tmp last_order_generated][file etc/last_order_generated.number][/tmp]
+		[if !scratch last_order_generated]
+			<!-- generate new file -->
+			[log create=1 umask=022 file=">etc/last_order_generated.number" type=text hide=1][/log]
+			
+			<!-- use the transactions table to find the first and last order numbers -->
+			
+		[/if]
+		[calc]
+			$CGI->{ 'order_from' } = 1020;
+			$CGI->{ 'order_to' } = 1030;
+		[/calc]
+		
+		<!-- Find the last order number that was placed -->
+		
+		
+		<!-- If the numbers are the same, or there is any other error, exit safely -->
+		[goto done]
+		
+	[/if]
+	[/comment]
+	
 	[tmp sql]
 		SELECT		*
 		FROM		transactions
-		WHERE		1=1		
+		WHERE		1=1
+		AND			deleted != 1
 		[if cgi date_from]
 			AND order_ymd >= '[cgi date_from]'
 			AND order_ymd <= '[cgi date_to]'
@@ -35,50 +154,75 @@
 			AND order_number >= '[cgi order_from]'
 			AND order_number <= '[cgi order_to]'
 		[/if]
+		[if cgi query_type eq 'any_new']
+			AND comments NOT LIKE '%(syncronized)'
+			LIMIT [scratch any_new_limit]
+		[/if]
 	[/tmp]		
 
+	[comment] This is done so that the IIF files can be downloaded [/comment]
+	[tmp mv_add_dot_html]0[/tmp] 
+	
+	
 	[query prefix=tx list=1 type=list sql='[scratch sql]']
 		[no-match] No Match.  Query was <pre>[scratch sql]</pre> [/no-match]
 		[list]
-			Processing [tx-param order_number]<BR>
+			
+			[calc]
+				if ( $CGI->{ 'qb_invoice_num' } )
+				{
+					if ( ! $Scratch->{ 'qb_invoice_num' } ) {
+						
+						# If this is our first time around, initialize tmp var, and subtract one.
+						$Tag->tmp( 'qb_invoice_num', 0 );
+						
+						$Scratch->{ 'qb_invoice_num' } = $CGI->{ 'qb_invoice_num' } + q{ [tx-increment] } - 1;
+					}
+					else {
+						$Scratch->{ 'qb_invoice_num' } = $Scratch->{ 'qb_invoice_num' } + 1;
+					}
+				}
+				return;
+			[/calc]
+			
+			
+			[if cgi query_type eq 'any_new']
+				<!-- Update the record so that it is syncronized -->
+				[tmp hideme] [data table=transactions field=comments value='[tx-param comments] (syncronized)' key='[tx-param code]'] [/tmp]
+			[/if]
+		
+			
+			[tx-increment]: Generating [tx-param order_number][if cgi qb_invoice_num] using QB invoice number [scratch qb_invoice_num].[/if] <font color=red size=2>(Download
+			
+				[page href="ui_download/orders/[tx-param order_number].iif"][tx-param order_number]</a>)
+				
+				</font><BR>
+			
 			[tmp hideme]@_TRANS_QUICKBOOKS_@[/tmp]
 			<!-- [scratch hideme] -->
+			
 		[/list]
 	[/query]
+		
+	</blockquote>
+		
+	<p><font color=red>...done.</font></p>
+	
+	<ul>
+		<li>[page href=ui_download/orders/0_qb_results.iif]Download all orders in one combined IIF file</a>
+		<li>
+		[page
+			href="__UI_BASE__/file_transfer"
+			form="
+				action=chdir
+				dir=orders/
+		"]Browse the orders directory</a>
+		</li>
+	</ul>
 	
-	<font color=red>...done</font><BR><BR><BR>
 [/if]
 
-We do not recommend generating more than 100 IIF files at a time, due to the load on the system.<BR>
-
-<form action="[area __UI_BASE__/quickbooks/generate_new_iif]" method="POST">
-	<input type=hidden name="mv_session_id" value="[data session id]">
-	Date FROM:<input type=text name="date_from" value="[cgi date_from]"> (YYYYMMDD, e.g. 20021101)<BR>
-	Date TO:<input type=text name="date_to" value="[cgi date_to]"> (YYYYMMDD e.g. 20021131)<BR>
-	
-	<BR>
-	<BR>  - AND - <BR>
-	<BR>
-	
-	Order Number:<input type=text name="order_number" value="[cgi order_number]"> (For just one order, e.g. 20025003)<BR>
-	
-	<input type=hidden name="go" value="1">
-	<input type=submit value="Generate new IIF file for these dates">
-</form>
 
-We do not recommend generating more than 100 IIF files at a time, due to the load on the system.<BR>
-<BR>
-Please note that this process may continue even after the page is loaded, and may take quite some time.  <BR>
-<BR>
-<BR>
-<h2>
-	[page
-		href="__UI_BASE__/file_transfer"
-		form="
-			action=chdir
-			dir=orders/new
-	"]IIF download directory</a>
-</h2>
 
 <!-- END CONTENT -->
 



2.2       +3 -3      interchange/extensions/quickbooks/pages/admin/quickbooks/index.html


rev 2.2, prev_rev 2.1
Index: index.html
===================================================================
RCS file: /var/cvs/interchange/extensions/quickbooks/pages/admin/quickbooks/index.html,v
retrieving revision 2.1
retrieving revision 2.2
diff -u -r2.1 -r2.2
--- index.html	4 Jun 2003 09:23:29 -0000	2.1
+++ index.html	3 Jul 2003 02:24:07 -0000	2.2
@@ -40,7 +40,7 @@
 
 <tr><td align=left bgcolor=__UI_C_INTBLOCK__>
 	<font size="+1" face="arial,helvetica,sans-serif">
-		<a href="[area __UI_BASE__/quickbooks/generate_new_iif]">Generate new orders</a>
+		<a href="[area __UI_BASE__/quickbooks/generate_new_iif]">Generate Quickbooks IIF Files</a>
 	</font>
 </td></tr>
 
@@ -50,9 +50,9 @@
 			href="__UI_BASE__/file_transfer"
 			form="
 				action=chdir
-				dir=orders/new
+				dir=orders
 			"
-		]Download generated orders</a>
+		]Download Quickbooks IIF files</a>
 	</font>
 </td></tr>
 



1.2       +1 -1      interchange/extensions/quickbooks/products/mv_metadata.asc.append


rev 1.2, prev_rev 1.1
Index: mv_metadata.asc.append
===================================================================
RCS file: /var/cvs/interchange/extensions/quickbooks/products/mv_metadata.asc.append,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- mv_metadata.asc.append	4 Jun 2003 09:23:29 -0000	1.1
+++ mv_metadata.asc.append	3 Jul 2003 02:24:07 -0000	1.2
@@ -7,4 +7,4 @@
 variable::Variable::QB_DEFAULT_ACCOUNT	text										The income account associated with each product line item.  "Other Income" by default; however, the highest precence is 'account' field in the 'inventory' table. 
 variable::Variable::QB_SALES_TAX_ACCOUNT	text										The liability account associated with sales tax.  "Sales Tax Payable" by default.
 variable::Variable::QB_SALES_TAX_AGENCY	text										The name of the sales tax agency for your locality.  "State Board of Equalization" by default (the name given in the Quickbooks 2000 sample products based business).
-variable::Variable::QB_SALES_TAX_ITEM	text										The item name (Quickbooks unique identifier) for the sales tax.  "Sales Tax Item" by default (from Quickbooks 2000 sample products based business).
+variable::Variable::QB_SALES_TAX_ITEM	text										The item name (Quickbooks unique identifier) for the sales tax.  "Sales Tax Item" by default (from Quickbooks 2000 sample products based business).  Quickbooks 2003 has several tax items setup by default, one of this is "San Tomas".  Older versions of QuickBooks used "Sales Tax Item" for the default.



1.2       +25 -26    interchange/extensions/quickbooks/vars/TRANS_QUICKBOOKS


rev 1.2, prev_rev 1.1
Index: TRANS_QUICKBOOKS
===================================================================
RCS file: /var/cvs/interchange/extensions/quickbooks/vars/TRANS_QUICKBOOKS,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TRANS_QUICKBOOKS	4 Jun 2003 09:23:29 -0000	1.1
+++ TRANS_QUICKBOOKS	3 Jul 2003 02:24:07 -0000	1.2
@@ -1,6 +1,7 @@
 #### begin quickbooks for [tx-param order_number] #####
 [tmp quickbooks_record]
-[if-tx-param salestax]
+[tmp order_number][either][scratch qb_invoice_num][or][tx-param order_number][/either][/tmp]
+[if-tx-param salestax > 0]
 	[set NAMEISTAXABLE]Y[/set]
 	[set ISTAXABLE]1[/set]
 	[set NAME]Invoice[/set]
@@ -18,28 +19,28 @@
 [/else]
 [/if-tx-param]
 Checking shipping: HASSHIPPING=[scratch HASSHIPPING]
-[if-tx-param b_address1] [comment]User put in billing info, use that[/comment]
+[if-tx-param b_address1]
 	[seti ADDR1][if-tx-param b_fname][tx-param b_fname] [tx-param b_lname][else][tx-param fname] [tx-param lname][/else][/if-tx-param][/seti]
 	[seti ADDR2][if-tx-param company][tx-param company][/if-tx-param][/seti]
 	[seti ADDR3][tx-param b_address1][if-tx-param b_address2], [tx-param b_address2][/if-tx-param][/seti]
 	[seti ADDR4][tx-param b_city], [tx-param b_state] [tx-param b_zip][/seti]
-	[seti ADDR5][tx-param b_country][/seti]
+	[seti ADDR5][data table=country field=name key="[tx-param b_country]"][/seti]
 	[seti SADDR1][tx-param fname] [tx-param lname][/seti]
 	[seti SADDR2][if-tx-param company][tx-param company][/if-tx-param][/seti]
 	[seti SADDR3][tx-param address1][if-tx-param address2], [tx-param address2][/if-tx-param][/seti]
 	[seti SADDR4][tx-param city], [tx-param state] [tx-param zip][/seti]
-	[seti SADDR5][tx-param country][/seti]
+	[seti SADDR5][data table=country field=name key="[tx-param country]"][/seti]
 [else]
 	[seti ADDR1][tx-param fname] [tx-param lname][/seti]
 	[seti ADDR2][if-tx-param company][tx-param company][/if-tx-param][/seti]
 	[seti ADDR3][tx-param address1][if-tx-param address2], [tx-param address2][/if-tx-param][/seti]
 	[seti ADDR4][tx-param city], [tx-param state] [tx-param zip][/seti]
-	[seti ADDR5][tx-param country][/seti]
+	[seti ADDR5][data table=country field=name key="[tx-param country]"][/seti]
 	[seti SADDR1][tx-param fname] [tx-param lname][/seti]
 	[seti SADDR2][if-tx-param company][tx-param company][/if-tx-param][/seti]
 	[seti SADDR3][tx-param address1][if-tx-param address2], [tx-param address2][/if-tx-param][/seti]
 	[seti SADDR4][tx-param city], [tx-param state] [tx-param zip][/seti]
-	[seti SADDR5][tx-param country][/seti]
+	[seti SADDR5][data table=country field=name key="[tx-param country]"][/seti]
 [/else]
 [/if-tx-param]
 [if variable FILE_BY_COMPANY]
@@ -54,7 +55,7 @@
 [seti qb_trans]!CUST	NAME	REFNUM	TIMESTAMP	EMAIL	BADDR1	BADDR2	BADDR3	BADDR4	BADDR5	SADDR1	SADDR2	SADDR3	SADDR4	SADDR5	PHONE1	PHONE2	FAXNUM	NOTE	CONT1	CONT2	CTYPE	TERMS	TAXABLE	LIMIT	RESALENUM	REP	TAXITEM	NOTEPAD	SALUTATION	COMPANYNAME	FIRSTNAME	MIDINIT	LASTNAME	CUSTFLD1	CUSTFLD2	CUSTFLD3	CUSTFLD4	CUSTFLD5	CUSTFLD6	CUSTFLD7	CUSTFLD8	CUSTFLD9	CUSTFLD10	CUSTFLD11	CUSTFLD12	CUSTFLD13	CUSTFLD14	CUSTFLD15	JOBDESC	JOBTYPE	JOBSTATUS	JOBSTART	JOBPROJEND	JOBEND	HIDDEN	DELCOUNT
 [filter tabbed]CUST
 [scratch CUSTNAME]
-[tx-param order_number][comment][data table=userdb field=customer_number key="[tx-param username]"][/comment][comment]Customer number... just use order number?[/comment]
+[scratch order_number][comment][data table=userdb field=customer_number key="[tx-param username]"][/comment][comment]Customer number... just use order number?[/comment]
 [tag time]%s[/tag]
 [tx-param email]
 [scratch ADDR1]
@@ -70,7 +71,7 @@
 [filter op=mac interpoloate=1][tx-param phone_day][/filter]
 [filter op=mac interpoloate=1][tx-param phone_night][/filter]
 [filter op=mac interpoloate=1][tx-param fax][/filter]
-[filter op=mac interpoloate=1][tx-param gift_note][/filter] 
+[filter op=mac interpoloate=1][tx-param comments][/filter] 
 [tx-param fname] [tx-param lname]
 [tx-param b_fname] [tx-param b_lname]
 Retail
@@ -109,18 +110,20 @@
 [comment]JOBDESC[/comment]
 N
 __STORE_ID__[/filter]
-!TRNS	TRNSID	TRNSTYPE	DATE	ACCNT	NAME	CLASS	AMOUNT	[if !variable QB_DISABLE_DOCNUM]DOCNUM	[/if]MEMO	CLEAR	TOPRINT	NAMEISTAXABLE	ADDR1	ADDR2	ADDR3	ADDR4	ADDR5	PAYMETH	SHIPVIA	SADDR1	SADDR2	SADDR3	SADDR4	SADDR5
+!TRNS	TRNSID	TRNSTYPE	DATE	ACCNT	NAME	CLASS	AMOUNT	DOCNUM	MEMO	PONUM	CLEAR	TOPRINT	NAMEISTAXABLE	ADDR1	ADDR2	ADDR3	ADDR4	ADDR5	PAYMETH	SHIPVIA	SADDR1	SADDR2	SADDR3	SADDR4	SADDR5
 !SPL	SPLID	TRNSTYPE	DATE	ACCNT	NAME	CLASS	AMOUNT	DOCNUM	MEMO	CLEAR	QNTY	PRICE	INVITEM	PAYMETH	TAXABLE	VALADJ	SERVICEDATE	OTHER2	EXTRA
 !ENDTRNS
 [filter tabbed]TRNS
-[tx-param order_number]
+[scratch order_number]
 [scratch TRNSTYPE]
 [scratch DATE]
 [either]__QB_TRANSACTION_ACCOUNT__[or]Checking[/either]
 [scratch CUSTNAME]
 __QB_TRANSACTION_CLASS__
-[tx-param total_cost][calc] return "\t" . q{[tx-param order_number]} unless $Variable->{QB_DISABLE_DOCNUM}; [/calc]
-Order Number: [tx-param order_number].  [filter op=mac interpoloate=1][tx-param gift_note][/filter]
+[tx-param total_cost]
+[scratch order_number]
+IC Order Number: [tx-param order_number].  [filter op=mac interpoloate=1][tx-param comments][/filter]
+[tx-param order_number]
 N
 N
 [scratch NAMEISTAXABLE]
@@ -149,20 +152,16 @@
 [scratch CUSTNAME]
 __QB_TRANSACTION_CLASS__
 -[ol-param subtotal]
-[ol-param order_number]
-[seti DESC][filter
-                interpolate=1
-                op="strip mac __QB_ITEM_LENGTH__ 45"
-            ]
-				[tmp qb_item_prefix]__QB_ITEM_PREFIX__[/tmp]
-				[filter op=qb_safe interpolate=1][scratch qb_item_prefix][either][ol-param title][or][ol-param description][/either][/filter]
-[/filter][/seti][scratch DESC]
+[scratch order_number]
+[filter interpolate=1 op="strip mac qb_safe"][ol-param description][/filter]
 N
 -[ol-param quantity]
 [ol-param price]
-[filter op="qb_safe 25" interpolate=1][ol-param sku][/filter]
+[tmp filter_length][either]@_QB_ITEM_LENGTH_@[or]45[/either][/tmp][filter 
+	op="qb_safe [scratch filter_length]" 
+	interpolate=1]@_QB_ITEM_PREFIX_@[either]@_QB_SKU_@[or][ol-param sku][/either][/filter]
 
-[if-ol-param nontaxable]N[else][scratch NAMEISTAXABLE][/else][/if-ol-param]
+[if-ol-param taxable][scratch NAMEISTAXABLE][else]N[/else][/if-ol-param]
 N
 
 
@@ -175,12 +174,12 @@
 [scratch CUSTNAME]
 
 -[tx-param shipping]
-[tx-param order_number]
+[scratch order_number]
 [tx-param shipmode]
 N
 -1
 [tx-param shipping]
-[either]__QB_SHIPPING_ITEM__[or]Shipping[/either]
+[either]@_QB_SHIPPING_ITEM_@[or]Shipping[/either]
 
 N
 N
@@ -195,7 +194,7 @@
 [either][query list=1 sql=|SELECT qb_tax_agency FROM state WHERE country = '[tx-param country]' AND state = '[tx-param state]'|][sql-param qb_tax_agency][/query][or]__QB_SALES_TAX_AGENCY__[or]State Board of Equalization[/either]
 
 -[tx-param salestax]
-[tx-param order_number]
+[scratch order_number]
 [tx-param state]
 N
 -1
@@ -214,7 +213,7 @@
 	$Scratch->{qb_trans} =~ s/\s*$/\r\n/;
 	return;
 [/calc]
-Logging transaction to orders/qb[either]__QB_FILE_SUFFIX__[or][scratch FILEDATE][/either].iif: [log umask=022 file=">orders/qb[tx-param order_number].iif" type=text interpolate=1][scratch qb_trans][/log]
+Logging transaction to orders/[tx-param order_number].iif: [log umask=022 file=">orders/[tx-param order_number].iif" type=text interpolate=1][scratch qb_trans][/log]
 Also appending transaction to orders/0_qb_results.iif: [log umask=022 file="orders/0_qb_results.iif" type=text interpolate=1][scratch qb_trans][/log]
 
 








More information about the interchange-cvs mailing list