You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2009/08/14 09:43:31 UTC

svn commit: r804105 - in /ofbiz/trunk: applications/accounting/ applications/accounting/data/ applications/accounting/script/org/ofbiz/accounting/invoice/ applications/accounting/servicedef/ applications/accounting/src/org/ofbiz/accounting/tax/ applica...

Author: hansbak
Date: Fri Aug 14 07:43:30 2009
New Revision: 804105

URL: http://svn.apache.org/viewvc?rev=804105&view=rev
Log:
add the possibility of adding sales tax to an invoice using the same functions as is used for an order. moved most tax demo data from ecommerce to accounting. fixed product entry on an invoiceitem

Added:
    ofbiz/trunk/applications/accounting/data/DemoTaxAuthority.xml   (with props)
Modified:
    ofbiz/trunk/applications/accounting/ofbiz-component.xml
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceEvents.xml
    ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
    ofbiz/trunk/applications/accounting/widget/Menus.xml
    ofbiz/trunk/specialpurpose/ecommerce/data/DemoTaxAuthority.xml
    ofbiz/trunk/specialpurpose/myportal/ofbiz-component.xml

Added: ofbiz/trunk/applications/accounting/data/DemoTaxAuthority.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/DemoTaxAuthority.xml?rev=804105&view=auto
==============================================================================
--- ofbiz/trunk/applications/accounting/data/DemoTaxAuthority.xml (added)
+++ ofbiz/trunk/applications/accounting/data/DemoTaxAuthority.xml Fri Aug 14 07:43:30 2009
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+
+<entity-engine-xml>
+    <Party partyId="USA_IRS" partyTypeId="PARTY_GROUP"/>
+    <PartyGroup partyId="USA_IRS" groupName="United States of America - Internal Revenue Service"/>
+    <PartyRole partyId="USA_IRS" roleTypeId="TAX_AUTHORITY"/>
+    
+    <Party partyId="CA_BOE" partyTypeId="PARTY_GROUP"/>
+    <PartyGroup partyId="CA_BOE" groupName="State of Calilfornia Board of Equalization"/>
+    <ContactMech contactMechId="CA_BOE_0" contactMechTypeId="POSTAL_ADDRESS"/>
+    <PostalAddress contactMechId="CA_BOE_0" toName="Board of Equalization" address1="P O BOX 942879" city="Sacramento" stateProvinceGeoId="CA" postalCode="94279" countryGeoId="USA"/>
+    <PartyContactMech partyId="CA_BOE" contactMechId="CA_BOE_0" fromDate="2000-01-01 00:00:00.000" allowSolicitation="N"/>
+    <PartyContactMechPurpose partyId="CA_BOE" contactMechId="CA_BOE_0" contactMechPurposeTypeId="PAYMENT_LOCATION" fromDate="2000-01-01 00:00:00.000"/>
+    <PartyContactMechPurpose partyId="CA_BOE" contactMechId="CA_BOE_0" contactMechPurposeTypeId="BILLING_LOCATION" fromDate="2000-01-01 00:00:00.000"/>
+    <PartyRole partyId="CA_BOE" roleTypeId="TAX_AUTHORITY"/>
+    
+    <Party partyId="NY_DTF" partyTypeId="PARTY_GROUP"/>
+    <PartyGroup partyId="NY_DTF" groupName="New York Department of Taxation and Finance"/>
+    <ContactMech contactMechId="NY_DTF_0" contactMechTypeId="POSTAL_ADDRESS"/>
+    <PostalAddress contactMechId="NY_DTF_0" toName="NYS Sales Tax Processing" address1="JAF Building" address2="PO BOX 1205" city="New York" stateProvinceGeoId="NY" postalCode="11016" countryGeoId="USA"/>
+    <PartyContactMech partyId="NY_DTF" contactMechId="NY_DTF_0" fromDate="2000-01-01 00:00:00.000" allowSolicitation="N"/>
+    <PartyContactMechPurpose partyId="NY_DTF" contactMechId="NY_DTF_0" contactMechPurposeTypeId="PAYMENT_LOCATION" fromDate="2000-01-01 00:00:00.000"/>
+    <PartyContactMechPurpose partyId="NY_DTF" contactMechId="NY_DTF_0" contactMechPurposeTypeId="BILLING_LOCATION" fromDate="2000-01-01 00:00:00.000"/>
+    <PartyRole partyId="NY_DTF" roleTypeId="TAX_AUTHORITY"/>
+    
+    <Party partyId="TX_TAXMAN" partyTypeId="PARTY_GROUP"/>
+    <PartyGroup partyId="TX_TAXMAN" groupName="Texas Sales Tax Authority"/>
+    <PartyRole partyId="TX_TAXMAN" roleTypeId="TAX_AUTHORITY"/>
+    
+    <Party partyId="UT_TAXMAN" partyTypeId="PARTY_GROUP"/>
+    <PartyGroup partyId="UT_TAXMAN" groupName="Utah Sales Tax Authority"/>
+    <PartyRole partyId="UT_TAXMAN" roleTypeId="TAX_AUTHORITY"/>
+    <Party partyId="UT_UTAH_TAXMAN" partyTypeId="PARTY_GROUP"/>
+    <PartyGroup partyId="UT_UTAH_TAXMAN" groupName="Utah County, Utah Sales Tax Authority"/>
+    <PartyRole partyId="UT_UTAH_TAXMAN" roleTypeId="TAX_AUTHORITY"/>
+    
+    <Party partyId="CAN_TAXMAN" partyTypeId="PARTY_GROUP"/>
+    <PartyGroup partyId="CAN_TAXMAN" groupName="Canada Tax Authority"/>
+    <PartyRole partyId="CAN_TAXMAN" roleTypeId="TAX_AUTHORITY"/>
+    <Party partyId="ON_TAXMAN" partyTypeId="PARTY_GROUP"/>
+    <PartyGroup partyId="ON_TAXMAN" groupName="Ontario Sales Tax (VAT) Authority"/>
+    <PartyRole partyId="ON_TAXMAN" roleTypeId="TAX_AUTHORITY"/>
+    
+    <!-- _NA_ TaxAuthority defs -->
+    <TaxAuthority taxAuthGeoId="_NA_" taxAuthPartyId="_NA_" includeTaxInPrice="N"/>
+    <TaxAuthorityGlAccount taxAuthGeoId="_NA_" taxAuthPartyId="_NA_" organizationPartyId="Company" glAccountId="224000"/>
+    <TaxAuthorityCategory taxAuthGeoId="_NA_" taxAuthPartyId="_NA_" productCategoryId="20111"/> <!-- Micro Widgets, a category to be used to test categorized rates -->
+    <!-- taxAuthorityRateSeqId left blank to be auto-sequenced during the EE XML import -->
+    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9000" taxAuthGeoId="_NA_" taxAuthPartyId="_NA_" taxAuthorityRateTypeId="SALES_TAX"
+        productCategoryId="" titleTransferEnumId="" minItemPrice="25.00" minPurchase="0.00" taxShipping="N" taxPercentage="1" taxPromotions="N"
+        fromDate="2001-05-13 00:00:00.001" thruDate="" description="1% OFB _NA_ Tax"/>
+    
+    <!-- USA TaxAuthority defs -->
+    <TaxAuthority taxAuthGeoId="USA" taxAuthPartyId="USA_IRS" taxIdFormatPattern="\d{2}\-\d{7}|\d{3}\-\d{2}\-\d{4}" includeTaxInPrice="N"/>
+    <TaxAuthorityGlAccount taxAuthGeoId="USA" taxAuthPartyId="USA_IRS" organizationPartyId="Company" glAccountId="224106"/>
+    
+    <TaxAuthority taxAuthGeoId="CA" taxAuthPartyId="CA_BOE" includeTaxInPrice="N"/>
+    <TaxAuthorityGlAccount taxAuthGeoId="CA" taxAuthPartyId="CA_BOE" organizationPartyId="Company" glAccountId="224106"/>
+    <TaxAuthorityAssoc taxAuthGeoId="USA" taxAuthPartyId="USA_IRS" toTaxAuthGeoId="CA" toTaxAuthPartyId="CA_BOE" taxAuthorityAssocTypeId="EXEMPT_INHER" fromDate="2001-05-13 00:00:00.001" thruDate=""/>
+    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9001" taxAuthGeoId="CA" taxAuthPartyId="CA_BOE" taxAuthorityRateTypeId="SALES_TAX"
+        productCategoryId="" titleTransferEnumId="" minItemPrice="0.00" minPurchase="0.00" taxShipping="N" taxPercentage="6.25" taxPromotions="N"
+        fromDate="2001-05-13 00:00:00.001" thruDate="" description="California State Sales Tax"/>
+    
+    <TaxAuthority taxAuthGeoId="NY" taxAuthPartyId="NY_DTF" includeTaxInPrice="N"/>
+    <TaxAuthorityGlAccount taxAuthGeoId="NY" taxAuthPartyId="NY_DTF" organizationPartyId="Company" glAccountId="224140"/>
+    <TaxAuthorityAssoc taxAuthGeoId="USA" taxAuthPartyId="USA_IRS" toTaxAuthGeoId="NY" toTaxAuthPartyId="NY_DTF" taxAuthorityAssocTypeId="EXEMPT_INHER" fromDate="2001-05-13 00:00:00.001" thruDate=""/>
+    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9002" taxAuthGeoId="NY" taxAuthPartyId="NY_DTF" taxAuthorityRateTypeId="SALES_TAX"
+        productCategoryId="" titleTransferEnumId="" minItemPrice="0.00" minPurchase="0.00" taxShipping="N" taxPercentage="4.25" taxPromotions="N"
+        fromDate="2001-05-13 00:00:00.001" thruDate="" description="New York State Sales Tax"/>
+    
+    <TaxAuthority taxAuthGeoId="TX" taxAuthPartyId="TX_TAXMAN" includeTaxInPrice="N"/>
+    <TaxAuthorityGlAccount taxAuthGeoId="TX" taxAuthPartyId="TX_TAXMAN" organizationPartyId="Company" glAccountId="224151"/>
+    <TaxAuthorityAssoc taxAuthGeoId="USA" taxAuthPartyId="USA_IRS" toTaxAuthGeoId="TX" toTaxAuthPartyId="TX_TAXMAN" taxAuthorityAssocTypeId="EXEMPT_INHER" fromDate="2001-05-13 00:00:00.001" thruDate=""/>
+    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9003" taxAuthGeoId="TX" taxAuthPartyId="TX_TAXMAN" taxAuthorityRateTypeId="SALES_TAX"
+        productCategoryId="" titleTransferEnumId="" minItemPrice="0.00" minPurchase="0.00" taxShipping="N" taxPercentage="6.25" taxPromotions="N"
+        fromDate="2001-05-13 00:00:00.001" thruDate="" description="Texas State Sales Tax"/>
+    
+    <TaxAuthority taxAuthGeoId="UT" taxAuthPartyId="UT_TAXMAN" includeTaxInPrice="N"/>
+    <TaxAuthorityGlAccount taxAuthGeoId="UT" taxAuthPartyId="UT_TAXMAN" organizationPartyId="Company" glAccountId="224153"/>
+    <TaxAuthorityAssoc taxAuthGeoId="USA" taxAuthPartyId="USA_IRS" toTaxAuthGeoId="UT" toTaxAuthPartyId="UT_TAXMAN" taxAuthorityAssocTypeId="EXEMPT_INHER" fromDate="2001-05-13 00:00:00.001" thruDate=""/>
+    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9004" taxAuthGeoId="UT" taxAuthPartyId="UT_TAXMAN" taxAuthorityRateTypeId="SALES_TAX"
+        productCategoryId="" titleTransferEnumId="" minItemPrice="0.00" minPurchase="0.00" taxShipping="N" taxPercentage="4.75" taxPromotions="N"
+        fromDate="2001-05-13 00:00:00.001" thruDate="" description="Utah State Sales Tax"/>
+    <!-- An example county; there is some zip code data for testing this; note this is ONLY test data, there isn't really extra sales tax for this county -->
+    <TaxAuthority taxAuthGeoId="UT-UTAH" taxAuthPartyId="UT_UTAH_TAXMAN" includeTaxInPrice="N"/>
+    <!-- NOTE: using the state's sales tax GL Account -->
+    <TaxAuthorityGlAccount taxAuthGeoId="UT-UTAH" taxAuthPartyId="UT_UTAH_TAXMAN" organizationPartyId="Company" glAccountId="224153"/>
+    <TaxAuthorityAssoc taxAuthGeoId="UT" taxAuthPartyId="UT_TAXMAN" toTaxAuthGeoId="UT-UTAH" toTaxAuthPartyId="UT_UTAH_TAXMAN" taxAuthorityAssocTypeId="EXEMPT_INHER" fromDate="2001-05-13 00:00:00.001" thruDate=""/>
+    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9005" taxAuthGeoId="UT-UTAH" taxAuthPartyId="UT_UTAH_TAXMAN" taxAuthorityRateTypeId="SALES_TAX"
+        productCategoryId="" titleTransferEnumId="" minItemPrice="0.00" minPurchase="0.00" taxShipping="N" taxPercentage="0.1"
+        fromDate="2001-05-13 00:00:00.001" thruDate="" description="Utah County, Utah Sales Tax"/>
+    
+    <!-- Canada TaxAuthority defs -->
+    <TaxAuthority taxAuthGeoId="CAN" taxAuthPartyId="CAN_TAXMAN" includeTaxInPrice="N"/>
+    <TaxAuthorityGlAccount taxAuthGeoId="CAN" taxAuthPartyId="CAN_TAXMAN" organizationPartyId="Company" glAccountId="224209"/>
+    <TaxAuthority taxAuthGeoId="ON" taxAuthPartyId="ON_TAXMAN" includeTaxInPrice="Y"/>
+    <TaxAuthorityGlAccount taxAuthGeoId="ON" taxAuthPartyId="ON_TAXMAN" organizationPartyId="Company" glAccountId="224209"/>
+    
+    <!-- Party TaxAuthority info for Company -->
+    <!-- some interesting information at: http://www.taxadmin.org/fta/rate/tax_stru.html -->
+    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="_NA_" taxAuthPartyId="_NA_" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="" isExempt="" isNexus="Y"/>
+    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="USA" taxAuthPartyId="USA_IRS" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="12-3456789" isExempt="Y" isNexus="N"/>
+    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="CA" taxAuthPartyId="CA_BOE" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="" isExempt="" isNexus="Y"/>
+    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="NY" taxAuthPartyId="NY_DTF" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="" isExempt="" isNexus="Y"/>
+    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="TX" taxAuthPartyId="TX_TAXMAN" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="" isExempt="" isNexus="N"/> <!-- this one is not a nexus to test that feature -->
+    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="UT" taxAuthPartyId="UT_TAXMAN" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="" isExempt="" isNexus="Y"/>
+    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="UT-UTAH" taxAuthPartyId="UT_UTAH_TAXMAN" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="" isExempt="" isNexus="Y"/>
+    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="CAN" taxAuthPartyId="CAN_TAXMAN" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="87654321" isExempt="N" isNexus="Y"/>
+    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="ON" taxAuthPartyId="ON_TAXMAN" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="" isExempt="" isNexus="Y"/>
+    
+</entity-engine-xml>

Propchange: ofbiz/trunk/applications/accounting/data/DemoTaxAuthority.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/accounting/data/DemoTaxAuthority.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/accounting/data/DemoTaxAuthority.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: ofbiz/trunk/applications/accounting/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/ofbiz-component.xml?rev=804105&r1=804104&r2=804105&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/ofbiz-component.xml (original)
+++ ofbiz/trunk/applications/accounting/ofbiz-component.xml Fri Aug 14 07:43:30 2009
@@ -46,7 +46,8 @@
     <entity-resource type="data" reader-name="demo" loader="main" location="data/PaymentsInvoices.xml"/>
     <entity-resource type="data" reader-name="demo" loader="main" location="data/DemoAcctgTransactionData.xml"/>
     <entity-resource type="data" reader-name="demo" loader="main" location="data/DemoFinAccountData.xml"/>
-
+    <entity-resource type="data" reader-name="demo" loader="main" location="data/DemoTaxAuthority.xml"/>
+    
     <!-- General Payment Service Definitions -->
     <service-resource type="model" loader="main" location="servicedef/services_agreement.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_admin.xml"/>

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceEvents.xml?rev=804105&r1=804104&r2=804105&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceEvents.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceEvents.xml Fri Aug 14 07:43:30 2009
@@ -315,6 +315,7 @@
         </if-empty>
         <create-value value-field="newEntity"/>
     </simple-method>
+    
     <simple-method method-name="updateInvoiceItem"
         short-description="Update an existing Invoice Item">
         <call-simple-method method-name="InvoiceStatusInProgress"/>
@@ -348,6 +349,7 @@
             <store-value value-field="lookedUpValue"/>
         </if-compare-field>
     </simple-method>
+    
     <simple-method method-name="removeInvoiceItem" short-description="Remove an existing Invoice Item">
         <call-simple-method method-name="InvoiceStatusInProgress"/>
         <set field="invoiceId" from-field="parameters.invoiceId"/>
@@ -612,4 +614,155 @@
            <call-service service-name="updateInvoice" in-map-name="updateInvoiceCtx"/>
        </iterate>
    </simple-method>
+    
+    <simple-method method-name="addtax" short-description="Set Parameter And Call Tax Calculate Service">
+        <entity-one entity-name="Invoice" value-field="invoice">
+            <field-map field-name="invoiceId" from-field="parameters.invoiceId"/>
+        </entity-one>
+        <entity-and entity-name="InvoiceItem" list="invoiceItems">
+            <field-map field-name="invoiceId" from-field="invoice.invoiceId"/>
+        </entity-and>
+        <entity-and entity-name="PartyContactMechPurpose" list="contacts">
+            <field-map field-name="partyId" from-field="invoice.partyId"/>
+            <field-map field-name="contactMechPurposeTypeId" value="SHIPPING_LOCATION"/>
+        </entity-and>
+        <if-empty field="contacts">
+            <entity-and entity-name="PartyContactMechPurpose" list="contacts">
+                <field-map field-name="partyId" from-field="invoice.partyId"/>
+                <field-map field-name="contactMechPurposeTypeId" value="GENERAL_LOCATION"/>
+            </entity-and>
+        </if-empty>
+        <if-empty field="contacts">
+            <add-error><fail-message message="cannot calculate tax, no shipping or......."/></add-error>
+        </if-empty>
+        <first-from-list entry="contactMech" list="contacts"/>
+        <entity-one entity-name="PostalAddress" value-field="postalAddress">
+            <field-map field-name="contactMechId" from-field="contactMech.contactMechId"/>
+        </entity-one>      
+        <if-compare field="invoice.invoiceTypeId" value="SALES_INVOICE" operator="equals">
+            <set field="addtaxMap.billToPartyId" from-field="invoice.partyId"/>
+        </if-compare>
+        <if-compare field="invoice.invoiceTypeId" value="PURCHASE_INVOICE" operator="equals">
+            <set field="addtaxMap.billToPartyId" from-field="invoice.partyIdFrom"/>
+        </if-compare>
+        <set field="addtaxMap.payToPartyId" from-field="invoice.partyIdFrom"/>
+        <iterate list="invoiceItems" entry="invoiceItem">
+            <entity-and entity-name="Product" list="product">
+                <field-map field-name="productId" from-field="invoiceItem.productId"/>
+            </entity-and>
+            <first-from-list entry="itemProduct" list="product"/>
+            <if-not-empty field="invoiceItem.productId">
+                <entity-and entity-name="InvoiceItem" list="findinvoiceItems">
+                    <field-map field-name="invoiceId" from-field="invoice.invoiceId"/>
+                    <field-map field-name="productId" from-field="invoiceItem.productId"/>
+                    <field-map field-name="invoiceItemTypeId" value="ITM_PROMOTION_ADJ"/>
+                </entity-and>
+                <if-not-empty field="findinvoiceItems">
+                    <calculate field="total" decimal-scale="${roundingDecimals}" rounding-mode="${roundingMode}" type="BigDecimal">
+                        <calcop operator="multiply">
+                            <calcop operator="get" field="invoiceItem.quantity"/>
+                            <calcop operator="get" field="invoiceItem.amount"/>
+                        </calcop>
+                    </calculate>
+                    <set field="totalAmount" from-field="total" type="BigDecimal"/>
+                    <calculate field="totalAmount" decimal-scale="${roundingDecimals}" rounding-mode="${roundingMode}" type="BigDecimal">
+                        <calcop operator="subtract">
+                            <calcop operator="get" field="totalAmount"/>
+                            <calcop operator="get" field="invoiceItem.amount"/>
+                        </calcop>
+                    </calculate>
+                <else>
+                    <calculate field="total" decimal-scale="${roundingDecimals}" rounding-mode="${roundingMode}" type="BigDecimal">
+                        <calcop operator="multiply">
+                            <calcop operator="get" field="invoiceItem.quantity"/>
+                            <calcop operator="get" field="invoiceItem.amount"/>
+                        </calcop>
+                    </calculate>
+                    <set field="totalAmount" from-field="total" type="BigDecimal"/>
+                </else>
+                </if-not-empty>
+            <else>
+                <set field="totalAmount" value="0" type="BigDecimal"/>
+            </else>
+            </if-not-empty>
+            <set field="itemAmount" from-field="totalAmount" type="BigDecimal"/>
+            <set field="itemPrice" from-field="invoiceItem.amount"/>
+            <set field="addtaxMap.itemProductList[]" from-field="itemProduct"/>
+            <set field="addtaxMap.itemAmountList[]" from-field="itemAmount" type="BigDecimal"/>
+            <set field="addtaxMap.itemPriceList[]" from-field="itemPrice"/>
+            <set field="addtaxMap.itemShippingList[]" type="BigDecimal" value="0"/>
+        </iterate>
+        <set field="addtaxMap.orderShippingAmount" type="BigDecimal" value="0"/>
+        <set field="addtaxMap.orderPromotionsAmount" type="BigDecimal" value="0"/>
+        <set field="addtaxMap.shippingAddress" from-field="postalAddress"/> 
+        <if>
+            <condition>
+                <not><if-empty field="addtaxMap.itemProductList"></if-empty></not>
+            </condition>
+            <then>
+                <call-service service-name="calcTax" in-map-name="addtaxMap">
+                    <result-to-field result-name="itemAdjustments" field="itemAdjustments"/>
+                    <result-to-field result-name="orderAdjustments" field="orderAdjustments"/>
+                </call-service>      
+                <iterate list="invoiceItems" entry="findItem">  
+                    <if>
+                        <condition>
+                            <not><if-empty field="findItem.productId"></if-empty></not>
+                        </condition>
+                        <then>
+                            <set field="invoiceItemSeqId" from-field="findItem.invoiceItemSeqId"/>
+                            <set field="productId" from-field="findItem.productId"/>
+                            <set field="itemMap.itemSeqIdList[]" from-field="invoiceItemSeqId"/>
+                            <set field="itemMap.productList[]" from-field="productId"/>
+                        </then>
+                    </if>        
+                </iterate>
+                <set field="countItemId" value="-1" type="Long"/>
+                <iterate list="itemAdjustments" entry="itemAdjustment">
+                    <calculate field="countItemId">
+                        <calcop operator="add" field="countItemId">
+                            <number value="1"/>
+                        </calcop>
+                    </calculate>
+                    <if-not-empty field="itemAdjustment">
+                        <iterate list="itemAdjustment" entry="orderAdjustment">
+                            <set field="createInvoiceItemContext.invoiceId" from-field="invoice.invoiceId"/>
+                            <set field="createInvoiceItemContext.invoiceItemTypeId" value="ITM_SALES_TAX"/>
+                            <set field="createInvoiceItemContext.overrideGlAccountId" from-field="orderAdjustment.overrideGlAccountId"/>
+                            <set field="createInvoiceItemContext.productId" from-field="itemMap.productList[countItemId]"/>
+                            <set field="createInvoiceItemContext.taxAuthPartyId" from-field="orderAdjustment.taxAuthPartyId"/>
+                            <set field="createInvoiceItemContext.taxAuthGeoId" from-field="orderAdjustment.taxAuthGeoId"/>
+                            <set field="createInvoiceItemContext.amount" from-field="orderAdjustment.amount" type="BigDecimal"/>
+                            <set field="createInvoiceItemContext.quantity" value="1"/>
+                            <set field="createInvoiceItemContext.parentInvoiceItemSeqId" from-field="itemMap.itemSeqIdList[countItemId]"/>
+                            <set field="createInvoiceItemContext.taxAuthorityRateSeqId" from-field="orderAdjustment.taxAuthorityRateSeqId"/>
+                            <set field="createInvoiceItemContext.description" from-field="orderAdjustment.comments"/>
+                            <!--call createInvoiceItem service for every ItemAdjustment--> 
+                            <call-service service-name="createInvoiceItem" in-map-name="createInvoiceItemContext"></call-service>
+                        </iterate>
+                    </if-not-empty>
+                </iterate>
+                <iterate list="orderAdjustments" entry="Adjustment">
+                    <if-not-empty field="Adjustment">
+                        <set field="InvoiceItemContext.invoiceId" from-field="invoice.invoiceId"/>
+                        <set field="InvoiceItemContext.invoiceItemTypeId" value="ITM_SALES_TAX"/>
+                        <set field="InvoiceItemContext.overrideGlAccountId" from-field="Adjustment.overrideGlAccountId"/>
+                        <set field="InvoiceItemContext.taxAuthPartyId" from-field="Adjustment.taxAuthPartyId"/>
+                        <set field="InvoiceItemContext.taxAuthGeoId" from-field="Adjustment.taxAuthGeoId"/>
+                        <set field="InvoiceItemContext.amount" from-field="Adjustment.amount" type="BigDecimal"/>
+                        <set field="InvoiceItemContext.quantity" value="1"/>
+                        <set field="InvoiceItemContext.taxAuthorityRateSeqId" from-field="Adjustment.taxAuthorityRateSeqId"/>
+                        <!-- call createInvoiceItem service for every orderAdjustment -->
+                        <call-service service-name="createInvoiceItem" in-map-name="InvoiceItemContext"></call-service>
+                    </if-not-empty>
+                </iterate>
+            </then>
+            <else>
+                <add-error>
+                    <fail-message message="productId don't have value, cannot call calcTax service."/>
+                </add-error>
+                <log level="error" message="Cannot call calcTax service, when don't have productId"/>
+            </else>
+        </if> 
+    </simple-method>  
 </simple-methods>

Modified: ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml?rev=804105&r1=804104&r2=804105&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml Fri Aug 14 07:43:30 2009
@@ -302,6 +302,12 @@
         <attribute name="organizationPartyId" type="String" mode="IN" optional="true"/>
         <attribute name="invoiceRunningTotal" type="String" mode="OUT" optional="false"/>
     </service>
+    
+    <service name="addtax" engine="simple" 
+        location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceEvents.xml" invoke="addtax">
+        <description>Call Tax Calculate Service</description>
+        <attribute name="invoiceId" type="String" mode="IN" optional="false"/>
+    </service>
 
     <service name="getInvoicesFilterByAssocType" engine="simple"
             location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml" invoke="getInvoicesFilterByAssocType" auth="true">

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java?rev=804105&r1=804104&r2=804105&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/tax/TaxAuthorityServices.java Fri Aug 14 07:43:30 2009
@@ -45,6 +45,8 @@
 import org.ofbiz.entity.util.EntityUtil;
 import org.ofbiz.party.contact.ContactMechWorker;
 import org.ofbiz.service.DispatchContext;
+import org.ofbiz.service.GenericServiceException;
+import org.ofbiz.service.LocalDispatcher;
 import org.ofbiz.service.ServiceUtil;
 
 /**
@@ -149,24 +151,39 @@
         if (shippingAddress == null || (shippingAddress.get("countryGeoId") == null && shippingAddress.get("stateProvinceGeoId") == null && shippingAddress.get("postalCodeGeoId") == null)) {
             return ServiceUtil.returnError("The address(es) used for tax calculation did not have State/Province or Country or other tax jurisdiction values set, so we cannot determine the taxes to charge.");
         }
+
         // without knowing the TaxAuthority parties, just find all TaxAuthories for the set of IDs...
         Set taxAuthoritySet = FastSet.newInstance();
         GenericValue productStore = null;
-        try {
-            getTaxAuthorities(delegator, shippingAddress, taxAuthoritySet);
-            if (productStoreId != null) {
-                productStore = delegator.findByPrimaryKey("ProductStore", UtilMisc.toMap("productStoreId", productStoreId));
-            }
-        } catch (GenericEntityException e) {
-            String errMsg = "Data error getting tax settings: " + e.toString();
-            Debug.logError(e, errMsg, module);
-            return ServiceUtil.returnError(errMsg);
+        // Check value productStore *** New
+        if (productStoreId!=null){
+	        try {
+	            getTaxAuthorities(delegator, shippingAddress, taxAuthoritySet);
+	            if (productStoreId != null) {
+	                productStore = delegator.findByPrimaryKey("ProductStore", UtilMisc.toMap("productStoreId", productStoreId));
+	            }
+	         
+	        } catch (GenericEntityException e) {
+	            String errMsg = "Data error getting tax settings: " + e.toString();
+	            Debug.logError(e, errMsg, module);
+	            return ServiceUtil.returnError(errMsg);
+	        }
+
+	        if (productStore == null && payToPartyId == null) {
+	            throw new IllegalArgumentException("Could not find payToPartyId [" + payToPartyId + "] or ProductStore [" + productStoreId + "] for tax calculation");
+	        }
+        }
+        else
+        {
+        	try{
+        		getTaxAuthorities(delegator, shippingAddress, taxAuthoritySet);    
+        	}catch (GenericEntityException e){
+        	    String errMsg = "Data error getting tax settings: " + e.toString();
+	            Debug.logError(e, errMsg, module);
+	            return ServiceUtil.returnError(errMsg);
+        	}
         }
-
-        if (productStore == null && payToPartyId == null) {
-            throw new IllegalArgumentException("Could not find payToPartyId [" + payToPartyId + "] or ProductStore [" + productStoreId + "] for tax calculation");
-        }
-
+     
         // Setup the return lists.
         List orderAdjustments = FastList.newInstance();
         List itemAdjustments = FastList.newInstance();
@@ -269,7 +286,7 @@
             taxAuthCondOrList.add(taxAuthCond);
         }
         EntityCondition taxAuthoritiesCond = EntityCondition.makeCondition(taxAuthCondOrList, EntityOperator.OR);
-
+  
         try {
             EntityCondition productCategoryCond = null;
             if (product != null) {
@@ -301,14 +318,14 @@
             mainExprs.add(EntityCondition.makeCondition(EntityCondition.makeCondition("minItemPrice", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("minItemPrice", EntityOperator.LESS_THAN_EQUAL_TO, itemPrice)));
             mainExprs.add(EntityCondition.makeCondition(EntityCondition.makeCondition("minPurchase", EntityOperator.EQUALS, null), EntityOperator.OR, EntityCondition.makeCondition("minPurchase", EntityOperator.LESS_THAN_EQUAL_TO, itemAmount)));
             EntityCondition mainCondition = EntityCondition.makeCondition(mainExprs, EntityOperator.AND);
-
+    
             // create the orderby clause
             List orderList = UtilMisc.toList("minItemPrice", "minPurchase", "fromDate");
 
             // finally ready... do the rate query
             List lookupList = delegator.findList("TaxAuthorityRateProduct", mainCondition, null, orderList, null, false);
             List filteredList = EntityUtil.filterByDate(lookupList, true);
-
+           
             if (filteredList.size() == 0) {
                 Debug.logWarning("In TaxAuthority Product Rate no records were found for condition:" + mainCondition.toString(), module);
                 return adjustments;
@@ -318,7 +335,6 @@
             Iterator flIt = filteredList.iterator();
             while (flIt.hasNext()) {
                 GenericValue taxAuthorityRateProduct = (GenericValue) flIt.next();
-
                 BigDecimal taxRate = taxAuthorityRateProduct.get("taxPercentage") != null ? taxAuthorityRateProduct.getBigDecimal("taxPercentage") : ZERO_BASE;
                 BigDecimal taxable = ZERO_BASE;
 
@@ -376,7 +392,6 @@
                         GenericValue partyRelationship = (GenericValue) partyRelationshipIter.next();
                         billToPartyIdSet.add(partyRelationship.get("partyIdFrom"));
                     }
-
                     handlePartyTaxExempt(adjValue, billToPartyIdSet, taxAuthGeoId, taxAuthPartyId, taxAmount, nowTimestamp, delegator);
                 } else {
                     Debug.logInfo("NOTE: A tax calculation was done without a billToPartyId or taxAuthGeoId, so no tax exemptions or tax IDs considered; billToPartyId=[" + billToPartyId + "] taxAuthGeoId=[" + taxAuthGeoId + "]", module);

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml?rev=804105&r1=804104&r2=804105&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Fri Aug 14 07:43:30 2009
@@ -2343,6 +2343,14 @@
         <security auth="true" https="true"/>
         <response name="success" type="view" value="MonthlyTrialBalancePdf"/>
     </request-map>
+    
+    <!--Add Tax Settings -->
+    <request-map uri="addtax">
+        <security auth="true" https="true"/>
+        <event type="service" invoke="addtax"/>
+        <response name="success" type="view" value="invoiceOverview"/>
+        <response name="error" type="view" value="invoiceOverview"/>
+    </request-map>
 
     <request-map uri="FindGlAccountCategory">
         <security https="true" auth="true"/>

Modified: ofbiz/trunk/applications/accounting/widget/Menus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/Menus.xml?rev=804105&r1=804104&r2=804105&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/Menus.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/Menus.xml Fri Aug 14 07:43:30 2009
@@ -145,6 +145,7 @@
             </link>
         </menu-item>
     </menu>
+    
     <menu name="InvoiceSubTabBar" menu-container-style="button-bar button-style-2" default-selected-style="selected">
         <menu-item name="createNew" title="${uiLabelMap.CommonCreateNew}" >
             <link target="newInvoice"/>
@@ -320,6 +321,17 @@
                 <parameter param-name="invoiceTypeId" from-field="invoice.invoiceTypeId"/>
             </link>
         </menu-item>
+        <menu-item name="addtax" title="Add Tax">
+            <condition>
+                <and>
+                    <not><if-empty field="invoice.invoiceId"/></not>
+                    <if-compare field="invoice.statusId" operator="equals" value="INVOICE_IN_PROCESS"/>
+                </and>
+            </condition>
+            <link target="addtax">
+                <parameter param-name="invoiceId" from-field="invoice.invoiceId"/>
+            </link>
+        </menu-item>
     </menu>
 
     <menu name="PaymentTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">

Modified: ofbiz/trunk/specialpurpose/ecommerce/data/DemoTaxAuthority.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/ecommerce/data/DemoTaxAuthority.xml?rev=804105&r1=804104&r2=804105&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/ecommerce/data/DemoTaxAuthority.xml (original)
+++ ofbiz/trunk/specialpurpose/ecommerce/data/DemoTaxAuthority.xml Fri Aug 14 07:43:30 2009
@@ -19,111 +19,26 @@
 -->
 
 <entity-engine-xml>
-    <Party partyId="USA_IRS" partyTypeId="PARTY_GROUP"/>
-    <PartyGroup partyId="USA_IRS" groupName="United States of America - Internal Revenue Service"/>
-    <PartyRole partyId="USA_IRS" roleTypeId="TAX_AUTHORITY"/>
-
-    <Party partyId="CA_BOE" partyTypeId="PARTY_GROUP"/>
-    <PartyGroup partyId="CA_BOE" groupName="State of Calilfornia Board of Equalization"/>
-    <ContactMech contactMechId="CA_BOE_0" contactMechTypeId="POSTAL_ADDRESS"/>
-    <PostalAddress contactMechId="CA_BOE_0" toName="Board of Equalization" address1="P O BOX 942879" city="Sacramento" stateProvinceGeoId="CA" postalCode="94279" countryGeoId="USA"/>
-    <PartyContactMech partyId="CA_BOE" contactMechId="CA_BOE_0" fromDate="2000-01-01 00:00:00.000" allowSolicitation="N"/>
-    <PartyContactMechPurpose partyId="CA_BOE" contactMechId="CA_BOE_0" contactMechPurposeTypeId="PAYMENT_LOCATION" fromDate="2000-01-01 00:00:00.000"/>
-    <PartyContactMechPurpose partyId="CA_BOE" contactMechId="CA_BOE_0" contactMechPurposeTypeId="BILLING_LOCATION" fromDate="2000-01-01 00:00:00.000"/>
-    <PartyRole partyId="CA_BOE" roleTypeId="TAX_AUTHORITY"/>
-
-    <Party partyId="NY_DTF" partyTypeId="PARTY_GROUP"/>
-    <PartyGroup partyId="NY_DTF" groupName="New York Department of Taxation and Finance"/>
-    <ContactMech contactMechId="NY_DTF_0" contactMechTypeId="POSTAL_ADDRESS"/>
-    <PostalAddress contactMechId="NY_DTF_0" toName="NYS Sales Tax Processing" address1="JAF Building" address2="PO BOX 1205" city="New York" stateProvinceGeoId="NY" postalCode="11016" countryGeoId="USA"/>
-    <PartyContactMech partyId="NY_DTF" contactMechId="NY_DTF_0" fromDate="2000-01-01 00:00:00.000" allowSolicitation="N"/>
-    <PartyContactMechPurpose partyId="NY_DTF" contactMechId="NY_DTF_0" contactMechPurposeTypeId="PAYMENT_LOCATION" fromDate="2000-01-01 00:00:00.000"/>
-    <PartyContactMechPurpose partyId="NY_DTF" contactMechId="NY_DTF_0" contactMechPurposeTypeId="BILLING_LOCATION" fromDate="2000-01-01 00:00:00.000"/>
-    <PartyRole partyId="NY_DTF" roleTypeId="TAX_AUTHORITY"/>
-
-    <Party partyId="TX_TAXMAN" partyTypeId="PARTY_GROUP"/>
-    <PartyGroup partyId="TX_TAXMAN" groupName="Texas Sales Tax Authority"/>
-    <PartyRole partyId="TX_TAXMAN" roleTypeId="TAX_AUTHORITY"/>
-
-    <Party partyId="UT_TAXMAN" partyTypeId="PARTY_GROUP"/>
-    <PartyGroup partyId="UT_TAXMAN" groupName="Utah Sales Tax Authority"/>
-    <PartyRole partyId="UT_TAXMAN" roleTypeId="TAX_AUTHORITY"/>
-    <Party partyId="UT_UTAH_TAXMAN" partyTypeId="PARTY_GROUP"/>
-    <PartyGroup partyId="UT_UTAH_TAXMAN" groupName="Utah County, Utah Sales Tax Authority"/>
-    <PartyRole partyId="UT_UTAH_TAXMAN" roleTypeId="TAX_AUTHORITY"/>
-
-    <Party partyId="CAN_TAXMAN" partyTypeId="PARTY_GROUP"/>
-    <PartyGroup partyId="CAN_TAXMAN" groupName="Canada Tax Authority"/>
-    <PartyRole partyId="CAN_TAXMAN" roleTypeId="TAX_AUTHORITY"/>
-    <Party partyId="ON_TAXMAN" partyTypeId="PARTY_GROUP"/>
-    <PartyGroup partyId="ON_TAXMAN" groupName="Ontario Sales Tax (VAT) Authority"/>
-    <PartyRole partyId="ON_TAXMAN" roleTypeId="TAX_AUTHORITY"/>
-
-    <!-- _NA_ TaxAuthority defs -->
-    <TaxAuthority taxAuthGeoId="_NA_" taxAuthPartyId="_NA_" includeTaxInPrice="N"/>
-    <TaxAuthorityGlAccount taxAuthGeoId="_NA_" taxAuthPartyId="_NA_" organizationPartyId="Company" glAccountId="224000"/>
-    <TaxAuthorityCategory taxAuthGeoId="_NA_" taxAuthPartyId="_NA_" productCategoryId="20111"/> <!-- Micro Widgets, a category to be used to test categorized rates -->
-    <!-- taxAuthorityRateSeqId left blank to be auto-sequenced during the EE XML import -->
-    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9000" taxAuthGeoId="_NA_" taxAuthPartyId="_NA_" taxAuthorityRateTypeId="SALES_TAX" productStoreId="9000"
+    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9000" taxAuthGeoId="_NA_" taxAuthPartyId="_NA_" taxAuthorityRateTypeId="SALES_TAX" productStoreId=""
         productCategoryId="" titleTransferEnumId="" minItemPrice="25.00" minPurchase="0.00" taxShipping="N" taxPercentage="1" taxPromotions="N"
         fromDate="2001-05-13 00:00:00.001" thruDate="" description="1% OFB _NA_ Tax"/>
-
-    <!-- USA TaxAuthority defs -->
-    <TaxAuthority taxAuthGeoId="USA" taxAuthPartyId="USA_IRS" taxIdFormatPattern="\d{2}\-\d{7}|\d{3}\-\d{2}\-\d{4}" includeTaxInPrice="N"/>
-    <TaxAuthorityGlAccount taxAuthGeoId="USA" taxAuthPartyId="USA_IRS" organizationPartyId="Company" glAccountId="224106"/>
-
-    <TaxAuthority taxAuthGeoId="CA" taxAuthPartyId="CA_BOE" includeTaxInPrice="N"/>
-    <TaxAuthorityGlAccount taxAuthGeoId="CA" taxAuthPartyId="CA_BOE" organizationPartyId="Company" glAccountId="224106"/>
-    <TaxAuthorityAssoc taxAuthGeoId="USA" taxAuthPartyId="USA_IRS" toTaxAuthGeoId="CA" toTaxAuthPartyId="CA_BOE" taxAuthorityAssocTypeId="EXEMPT_INHER" fromDate="2001-05-13 00:00:00.001" thruDate=""/>
-    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9001" taxAuthGeoId="CA" taxAuthPartyId="CA_BOE" taxAuthorityRateTypeId="SALES_TAX" productStoreId="9000"
+    
+    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9001" taxAuthGeoId="CA" taxAuthPartyId="CA_BOE" taxAuthorityRateTypeId="SALES_TAX" productStoreId=""
         productCategoryId="" titleTransferEnumId="" minItemPrice="0.00" minPurchase="0.00" taxShipping="N" taxPercentage="6.25" taxPromotions="N"
         fromDate="2001-05-13 00:00:00.001" thruDate="" description="California State Sales Tax"/>
 
-    <TaxAuthority taxAuthGeoId="NY" taxAuthPartyId="NY_DTF" includeTaxInPrice="N"/>
-    <TaxAuthorityGlAccount taxAuthGeoId="NY" taxAuthPartyId="NY_DTF" organizationPartyId="Company" glAccountId="224140"/>
-    <TaxAuthorityAssoc taxAuthGeoId="USA" taxAuthPartyId="USA_IRS" toTaxAuthGeoId="NY" toTaxAuthPartyId="NY_DTF" taxAuthorityAssocTypeId="EXEMPT_INHER" fromDate="2001-05-13 00:00:00.001" thruDate=""/>
-    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9002" taxAuthGeoId="NY" taxAuthPartyId="NY_DTF" taxAuthorityRateTypeId="SALES_TAX" productStoreId="9000"
+    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9002" taxAuthGeoId="NY" taxAuthPartyId="NY_DTF" taxAuthorityRateTypeId="SALES_TAX" productStoreId=""
         productCategoryId="" titleTransferEnumId="" minItemPrice="0.00" minPurchase="0.00" taxShipping="N" taxPercentage="4.25" taxPromotions="N"
         fromDate="2001-05-13 00:00:00.001" thruDate="" description="New York State Sales Tax"/>
 
-    <TaxAuthority taxAuthGeoId="TX" taxAuthPartyId="TX_TAXMAN" includeTaxInPrice="N"/>
-    <TaxAuthorityGlAccount taxAuthGeoId="TX" taxAuthPartyId="TX_TAXMAN" organizationPartyId="Company" glAccountId="224151"/>
-    <TaxAuthorityAssoc taxAuthGeoId="USA" taxAuthPartyId="USA_IRS" toTaxAuthGeoId="TX" toTaxAuthPartyId="TX_TAXMAN" taxAuthorityAssocTypeId="EXEMPT_INHER" fromDate="2001-05-13 00:00:00.001" thruDate=""/>
-    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9003" taxAuthGeoId="TX" taxAuthPartyId="TX_TAXMAN" taxAuthorityRateTypeId="SALES_TAX" productStoreId="9000"
+    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9003" taxAuthGeoId="TX" taxAuthPartyId="TX_TAXMAN" taxAuthorityRateTypeId="SALES_TAX" productStoreId=""
         productCategoryId="" titleTransferEnumId="" minItemPrice="0.00" minPurchase="0.00" taxShipping="N" taxPercentage="6.25" taxPromotions="N"
         fromDate="2001-05-13 00:00:00.001" thruDate="" description="Texas State Sales Tax"/>
 
-    <TaxAuthority taxAuthGeoId="UT" taxAuthPartyId="UT_TAXMAN" includeTaxInPrice="N"/>
-    <TaxAuthorityGlAccount taxAuthGeoId="UT" taxAuthPartyId="UT_TAXMAN" organizationPartyId="Company" glAccountId="224153"/>
-    <TaxAuthorityAssoc taxAuthGeoId="USA" taxAuthPartyId="USA_IRS" toTaxAuthGeoId="UT" toTaxAuthPartyId="UT_TAXMAN" taxAuthorityAssocTypeId="EXEMPT_INHER" fromDate="2001-05-13 00:00:00.001" thruDate=""/>
-    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9004" taxAuthGeoId="UT" taxAuthPartyId="UT_TAXMAN" taxAuthorityRateTypeId="SALES_TAX" productStoreId="9000"
+    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9004" taxAuthGeoId="UT" taxAuthPartyId="UT_TAXMAN" taxAuthorityRateTypeId="SALES_TAX" productStoreId=""
         productCategoryId="" titleTransferEnumId="" minItemPrice="0.00" minPurchase="0.00" taxShipping="N" taxPercentage="4.75" taxPromotions="N"
         fromDate="2001-05-13 00:00:00.001" thruDate="" description="Utah State Sales Tax"/>
-    <!-- An example county; there is some zip code data for testing this; note this is ONLY test data, there isn't really extra sales tax for this county -->
-    <TaxAuthority taxAuthGeoId="UT-UTAH" taxAuthPartyId="UT_UTAH_TAXMAN" includeTaxInPrice="N"/>
-    <!-- NOTE: using the state's sales tax GL Account -->
-    <TaxAuthorityGlAccount taxAuthGeoId="UT-UTAH" taxAuthPartyId="UT_UTAH_TAXMAN" organizationPartyId="Company" glAccountId="224153"/>
-    <TaxAuthorityAssoc taxAuthGeoId="UT" taxAuthPartyId="UT_TAXMAN" toTaxAuthGeoId="UT-UTAH" toTaxAuthPartyId="UT_UTAH_TAXMAN" taxAuthorityAssocTypeId="EXEMPT_INHER" fromDate="2001-05-13 00:00:00.001" thruDate=""/>
-    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9005" taxAuthGeoId="UT-UTAH" taxAuthPartyId="UT_UTAH_TAXMAN" taxAuthorityRateTypeId="SALES_TAX" productStoreId="9000"
+    <TaxAuthorityRateProduct taxAuthorityRateSeqId="9005" taxAuthGeoId="UT-UTAH" taxAuthPartyId="UT_UTAH_TAXMAN" taxAuthorityRateTypeId="SALES_TAX" productStoreId=""
         productCategoryId="" titleTransferEnumId="" minItemPrice="0.00" minPurchase="0.00" taxShipping="N" taxPercentage="0.1"
         fromDate="2001-05-13 00:00:00.001" thruDate="" description="Utah County, Utah Sales Tax"/>
-
-    <!-- Canada TaxAuthority defs -->
-    <TaxAuthority taxAuthGeoId="CAN" taxAuthPartyId="CAN_TAXMAN" includeTaxInPrice="N"/>
-    <TaxAuthorityGlAccount taxAuthGeoId="CAN" taxAuthPartyId="CAN_TAXMAN" organizationPartyId="Company" glAccountId="224209"/>
-    <TaxAuthority taxAuthGeoId="ON" taxAuthPartyId="ON_TAXMAN" includeTaxInPrice="Y"/>
-    <TaxAuthorityGlAccount taxAuthGeoId="ON" taxAuthPartyId="ON_TAXMAN" organizationPartyId="Company" glAccountId="224209"/>
-
-    <!-- Party TaxAuthority info for Company -->
-    <!-- some interesting information at: http://www.taxadmin.org/fta/rate/tax_stru.html -->
-    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="_NA_" taxAuthPartyId="_NA_" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="" isExempt="" isNexus="Y"/>
-    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="USA" taxAuthPartyId="USA_IRS" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="12-3456789" isExempt="Y" isNexus="N"/>
-    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="CA" taxAuthPartyId="CA_BOE" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="" isExempt="" isNexus="Y"/>
-    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="NY" taxAuthPartyId="NY_DTF" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="" isExempt="" isNexus="Y"/>
-    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="TX" taxAuthPartyId="TX_TAXMAN" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="" isExempt="" isNexus="N"/> <!-- this one is not a nexus to test that feature -->
-    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="UT" taxAuthPartyId="UT_TAXMAN" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="" isExempt="" isNexus="Y"/>
-    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="UT-UTAH" taxAuthPartyId="UT_UTAH_TAXMAN" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="" isExempt="" isNexus="Y"/>
-    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="CAN" taxAuthPartyId="CAN_TAXMAN" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="87654321" isExempt="N" isNexus="Y"/>
-    <PartyTaxAuthInfo partyId="Company" taxAuthGeoId="ON" taxAuthPartyId="ON_TAXMAN" fromDate="2001-05-13 00:00:00.001" thruDate="" partyTaxId="" isExempt="" isNexus="Y"/>
-
 </entity-engine-xml>

Modified: ofbiz/trunk/specialpurpose/myportal/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/ofbiz-component.xml?rev=804105&r1=804104&r2=804105&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/myportal/ofbiz-component.xml (original)
+++ ofbiz/trunk/specialpurpose/myportal/ofbiz-component.xml Fri Aug 14 07:43:30 2009
@@ -26,7 +26,6 @@
 
     <entity-resource type="data" reader-name="seed" loader="main" location="data/MyPortalSecurityData.xml"/>
     <entity-resource type="data" reader-name="seed" loader="main" location="data/MyPortalTypeData.xml"/>
-    <entity-resource type="data" reader-name="seed" loader="main" location="data/MyPortalHelpData.xml"/>
     <entity-resource type="data" reader-name="demo" loader="main" location="data/MyPortalDemoData.xml"/>
 
     <service-resource type="model" loader="main" location="servicedef/services.xml"/>