How to stop Amember from creating invoices for free products and save money

Discussion in 'Customization & add-ons' started by alexve, Jan 22, 2011.

  1. alexve

    alexve aMember Pro Customer

    Joined:
    Nov 19, 2010
    Messages:
    14
    Hi,

    By default, Amember creates invoices for all products that are sold, including 0 EUR products. I would really like my Amember site to stop creating invoices for products that are free (0 EUR) and stop registering the 'payments' (as there are none) when someone orders a free/0 EUR product.

    Some background why this is important:
    All invoices that are generated for customers by my sites, need to be included in the financial administration of my business. This includes 0 EUR invoices. However, my accountant charges 0.98 EUR for every invoice that I submit to my financial administration (it's hosted in the cloud). So effectively, I am losing money when someone 'buys' a free product and I submit the corresponding 0 EUR invoice to my online accountant.

    Leaving the 0 EUR invoices out of the financial administration is no option either because Dutch tax law dictates that invoices that you store in your financial administation are all numbered in a consecutive way. (e.g. invoice-2011-001, invoice-2011-002, invoice-2011-003, etc). If you would leave the 0 EUR invoices out of the financial administration, you would effectively be skipping invoicenumbers. Unfortunately, this is against the law here in the Netherlands / Holland.

    Right now, Amember does not treat invoices for free products any different as regular (> 0 EUR) invoices and the invoicenumber is always 'upped' with each free product being 'sold'. (e.g. to 'invoice-2011-004, etc). Hence my request above for Amember not to create an invoice for 0 EUR products and stop registering the 'payment(s)' for these free products too.

    Can anyone please help fix this in Amember's code? Thanks!
  2. thehpmc

    thehpmc Member

    Joined:
    Aug 24, 2006
    Messages:
    901
    If you also have 'paid for' content and somebody registers and then goes to payment processor but then changes mind a '0' invoice is also produced.
  3. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Well, sorry that it is not fixed in helpdesk yet I will take your ticket and will fix this in 24 hours.
    There is no way to not create payments for free signups. But here is what can be done:
    Additional field can be created in payment record for invoice_id and this field will be set only when user purchase payment with amount >0; Then aMember will use that field in templates when will display number of invoice.
    So user will see that invoice_id instead of payment_id. Also, this is possible to change templates in amember CP, so invoice_if will be used here as well.
  4. alexve

    alexve aMember Pro Customer

    Joined:
    Nov 19, 2010
    Messages:
    14
    Spoke to Anton from support over Skype this morning

    Hi Alexander,

    Thanks very much for your reply. I was able to chat with Anton from support over Skype this morning and he provided a solution that seems to work after doing some initial testing today.

    He added the following to mail_receipt.pdf

    {php}
    $p = $this->_tpl_vars['payment'];
    global $db;
    $num=$db->query_one("SELECT count(*) from {$db->config['prefix']}payments
    where completed=1 and amount>0 and time<'$p[time]' and DATE_FORMAT(time,'%Y')=DATE_FORMAT('$p[time]','%Y')")+1;
    $this->assign('num', $num);
    {/php}
    <b>#_TPL_THX_YOUR_INVOICE# {$payment.time|date_format:'%Y'}-{$num|string_format:'%03d'} #_TPL_THX_FROM# {$payment.tm_completed|amember_date_format}</b>


    Just to be sure, will this be sufficient to solve the issue properly?

    Thank you guys for your suport.

    Alex
  5. andres

    andres New Member

    Joined:
    Feb 23, 2011
    Messages:
    7
    Dear Sirs,

    I have ran into the same issue as described in this thread. We have several products that are free (price=0) and a few "products" that act as packages and include the free ones. When invoices or reports are generated, we get something like:

    "Package" Product $100
    Free product 1 $0
    [...]
    Free product 1$0

    And we end up with a really cluttered report/invoice. Should we apply the code that is shown in this thread to change this?

    Thank you in advance
  6. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    No this will not help.
    I'm not sure that understood what you need in result?
  7. andres

    andres New Member

    Joined:
    Feb 23, 2011
    Messages:
    7
    Hello,

    Let's say I have the following products:

    Independent suscriptions/products:
    Product #1, set price $0
    Product #2, set price $0
    Product #3, set price $0
    Product #4, set price $50
    Product #5, set price $50

    Product #6, set price $80: includes all the previous products

    If the user acquires product #6:

    1) the invoice lists all products (1-6) with individual prices, not just product 6
    2) if I generate a report, all the products for this user show up, not just the one that he paid for; I end up with a list of products of price 0 + the product that the user actually paid for, that includes the others. This really clutters the report.

    I hope this is clearer.

    Best regards
  8. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    1. This is possible to modify receipt so it will not include free products. Contact as in helpdesk we will help.
    2. Not sure I understood. What report you mean?
  9. sarah_rendle

    sarah_rendle Member

    Joined:
    Apr 3, 2014
    Messages:
    69
    Hi there, I too would liketo use this code - question --- Where do I find the mail_receipt.pdf to add this code?

    thanks

  10. thehpmc

    thehpmc Member

    Joined:
    Aug 24, 2006
    Messages:
    901
    Sarah this thread is around 3 years old so might relate to V3.

Share This Page