Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2012
    Location
    Naples, FL
    Posts
    30
    Plugin Contributions
    0

    Default Discount on Invoices Not Posting to Database Correctly

    Hi, I have hunted around and can't figure this out. My version is 1.50 and I am using TaxCloud to calculate taxes which might be part of the issue but they say it is not. My customer uses a discount coupon code and he is invoiced the correct discounted amount. Everything works fine, they get a copy of the invoice and the orders processed. But in the Zen Cart database, the discount is ADDED to the order total even though it shows a minus sign in front of it. I use CartSpan to import orders, and it works flawlessly until a discounted invoice is in the que and the transfer fails because the invoice does not balance. And Tax Cloud's admin panel only registers the net invoice ignoring the discount. So what I think is happening is that the discount is not posting to the SQL database correctly. Here is a screen shot of the invoice inside my Admin panel showing the discount getting Added to the total instead of deducted. If you could tell me where to look to fix this error I would appreciate it. My store is floridagofishing.com/shop Click image for larger version. 

Name:	invoice-with-discount.jpg 
Views:	118 
Size:	11.5 KB 
ID:	12820 Click image for larger version. 

Name:	invoice-with-discount2.jpg 
Views:	106 
Size:	16.6 KB 
ID:	12821
    Last edited by FloridaGoFishing; 30 Jul 2013 at 12:00 AM. Reason: add picture

  2. #2
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,671
    Plugin Contributions
    123

    Default Re: Discount on Invoices Not Posting to Database Correctly

    Turn off TaxCloud and see if you still have the issue.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  3. #3
    Join Date
    Oct 2012
    Location
    Naples, FL
    Posts
    30
    Plugin Contributions
    0

    Default Re: Discount on Invoices Not Posting to Database Correctly

    Quote Originally Posted by swguy View Post
    Turn off TaxCloud and see if you still have the issue.
    Makes sense, I'll create an order and see what happens.

  4. #4
    Join Date
    Oct 2012
    Location
    Naples, FL
    Posts
    30
    Plugin Contributions
    0

    Default Re: Discount on Invoices Not Posting to Database Correctly

    I turned off Tax Cloud and ran a live transaction. Yes, it worked perfectly! So Tax Cloud is the culprit causing the discount to ADD to the order total instead of deduct it. I have emailed Tax Cloud several times over the past 2 weeks about this problem and have received no response.

    To add to this problem my store has slowed to a crawl and I contacted Godaddy about this. They say my server is fine, running fast. Yet I am getting warnings from Google Webmaster Tools of high response times. My product pages are around 20.0 and my category listing pages are around 75.0! Godaddy tested again last night and said my site is speedy, on a server with a light load, and it might be my internet connection. I did a speed test on my machines and I’m at 27 which is fast. I don’t get it.

    So I am wondering if the issue with Tax Cloud posting my discounts as Additions instead of Deductions in the SQL database is causing my database to run slow? That is if Tax Cloud is doing the posting. The invoices are out of balance from this so it only makes sense it would slow down the database. What file posts the discount to the database so I can find what AddOn that installed it?

    If I need to fix the discounted records in the database, how can I fix them, maybe add a minus sign in front of the discounts? What table holds the discounts? Will this fix my database speed? Here is a page to try and I have activated the Parse/Query numbers at the bottom – can you tell me what you get for times? I get anywhere from 20 to 75 and tested in 3 browsers. http://www.floridagofishing.com/shop...index&cPath=50

  5. #5
    Join Date
    Oct 2012
    Location
    Naples, FL
    Posts
    30
    Plugin Contributions
    0

    Default Re: Discount on Invoices Not Posting to Database Correctly

    Figured out the slowness, it was the settings in Admin/Config/Images.

    Tax Cloud finally replied and they say the software does not support coupons and said I would have to change Zen's implementation to handle this. Why is it posting wrong when Tax Cloud is ON, but correct when OFF if they say they don't handle this? Not a clue where/how to fix this??

    If I keep using Tax Cloud (and anyone else who uses it with coupons) then all invoices with coupons are posted into the database wrong. Will this have any long term effects on the database?

    Does the Local Sales Tax Mod post discounts to SQL correctly? If so, I'll change and be done with this problem.

  6. #6
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Discount on Invoices Not Posting to Database Correctly

    Quote Originally Posted by FloridaGoFishing View Post
    ...
    Tax Cloud finally replied and they say the software does not support coupons and said I would have to change Zen's implementation to handle this. Why is it posting wrong when Tax Cloud is ON, but correct when OFF if they say they don't handle this? Not a clue where/how to fix this??
    ...
    This is probably due to the complexity the "coupon" order total module adds. A "coupon" is added as a discount line in the order (not a discount on specific products in the order). To fix the calculation of taxes (and the discount being added) at least two changes would need to be coded for the Tax Cloud plugin.

    1. Do not send the ot_coupon order total line to the Tax Cloud server when requesting a quote (if I remember correctly the Tax Cloud plugin treats all "unknown" order total lines as a positive number when submitting the order for a tax quote). When the updated order data is returned this will cause the order total line for ot_coupon to be added to the total instead of subtracted.
    2. Add a configuration option to "Generate Tax based upon discounted price". Alter each product price line before adding it to the quote request from the Tax Cloud server to reflect the price paid by the customer (after coupon is applied).


    Quote Originally Posted by FloridaGoFishing View Post
    ...
    Does the Local Sales Tax Mod post discounts to SQL correctly? If so, I'll change and be done with this problem.
    At this time no special integration for ot_coupon has been added to local_sales_taxes. This means two things: It ignores the ot_coupon order total line alone (so the total will be correct) and the customer will be charged local sales tax based upon the original (not discounted) price of the product.
    Last edited by lhungil; 31 Jul 2013 at 07:50 PM.
    The glass is not half full. The glass is not half empty. The glass is simply too big!
    Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
    Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker

  7. #7
    Join Date
    Oct 2012
    Location
    Naples, FL
    Posts
    30
    Plugin Contributions
    0

    Default Re: Discount on Invoices Not Posting to Database Correctly

    Thank you so much for the detailed explanation, this helps a lot! I forward your suggestion to Tax Cloud's support. Last question: Is there any ill effect having the discounts in the SQL db incorrect? Invoices out of balance? If so, what table do I edit inside the db?

  8. #8
    Join Date
    Feb 2012
    Location
    mostly harmless
    Posts
    1,809
    Plugin Contributions
    8

    Default Re: Discount on Invoices Not Posting to Database Correctly

    Quote Originally Posted by FloridaGoFishing View Post
    Is there any ill effect having the discounts in the SQL db incorrect? Invoices out of balance? If so, what table do I edit inside the db?
    The biggest concern I would have is the customer potentially being charged too much for their purchase (or being scared away by the shown order totals during checkout). You may want to double check and make sure this is not the case.

    The stored value orders_total for a coupon usually is positive (but the text will have a negative indicator). This may already be stored correctly based upon your screenshot.

    However, in your screenshot the "total" appears to be incorrect. If you want to correct the "total" after an order is placed you will need to modify the price (and text) in both the orders and orders_total tables. You may want to make a backup of the database first, just to be on the safe side.
    Last edited by lhungil; 31 Jul 2013 at 08:57 PM.

 

 

Similar Threads

  1. v151 One Field from Product Info Not Posting to Database
    By kamelion0927 in forum General Questions
    Replies: 5
    Last Post: 17 Aug 2013, 09:57 AM
  2. Reversal_Cancel not posting correctly
    By carlvt88 in forum PayPal Express Checkout support
    Replies: 1
    Last Post: 13 Oct 2010, 07:07 PM
  3. Discount not working correctly?
    By crisscross in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 24 Aug 2009, 03:56 PM
  4. Coupon discount not posting at check out.
    By sonquita in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 9
    Last Post: 18 Jun 2007, 02:57 PM
  5. Tax not Displaying Correctly on Order Slips/Invoices
    By gregoryjameswood in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 3
    Last Post: 28 Feb 2007, 10:37 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR