ledgersmb / LedgerSMB

Double-entry accounting & ERP for the web
https://ledgersmb.org
Other
426 stars 152 forks source link

1.10 - Wa Sales Tax module does not record location code in Source field #6811

Closed freelock closed 1 year ago

freelock commented 2 years ago

Version

1.10-beta3

What browsers are you seeing the problem on?

Firefox

What happened?

The WA Sales tax module is supposed to record the location ID returned by the web service for a transaction in the "source" column of the sales tax account. After adding a taxable transaction, the tax is correctly calculated and added, but the source value is not stored.

What should have happened?

Store the location code in the source column, after looking it up in the tax webservice.

ehuelsmann commented 1 year ago

Testing the plugin, it works for me. These are the steps I ran through installing and using it. Please let me know which ones are different for you.

cp utils/wa-tax-service/WA.pm lib/LedgerSMB/Taxes/WA.pm
psql -U postgres -h 172.20.0.3 -d test -c "INSERT INTO \"xyz\".\"taxmodule\" (\"taxmodule_id\", \"taxmodulename\") VALUES (999, 'WA')"
  1. Log into your LedgerSMB after this
  2. Go to System > Taxes and edit your Tax settings; mine look like this: image
  3. Set the billing address for your customer entity or credit entity to a location which has an applicable tax rate; mine look like this for the entity: image and like this for the entity: image
  4. Create your invoice; during the "Save" phase, you can see this pop up in the logs, if logging is set to debugging:
    Request URI: https://webgis.dor.wa.gov/webapi/addressrates.aspx?output=xml&addr=600%201st%20Ave%20&city=Seattle&zip=98104
    <?xml version="1.0" encoding="utf-8"?><response loccode="1726" localrate=".0375" rate=".1025" code="2" xmlns=""><addressline code="1726" street="1ST AVE" househigh="600" houselow="600" evenodd="E" state="WA" zip="98104" plus4="2210" period="Q42022" rta="Y" ptba="King PTBA" cez="" /><rate name="SEATTLE" code="1726" staterate=".0650" localrate=".0375" /></response>
    Extracted rate and location code: (.1025, 1726)
  5. Post the invoice and check General Journal > Search output; mine looks like: image (attempts 1 and 2 happened while my EU server wasn't able to connect to the WA government API)
ehuelsmann commented 1 year ago

Just verified: the same works with transactions (as opposed to invoices).

ehuelsmann commented 1 year ago

Solved: configuration issue.