Custom invoice numer error

Discussion in 'Customization & add-ons' started by gogoseo, Dec 30, 2012.

  1. gogoseo

    gogoseo Member

    Joined:
    Nov 17, 2012
    Messages:
    36
    Hello,

    i customized the customized invice number code at:
    http://www.amember.com/docs/How_to_set_up_custom_invoice_numbering
    and changed this line:

    $invoice->public_id = ++$last_invoice_num ."/". date('Y');

    ..so that the invoice number now includes a "/" and i also tried with "-" (i need those in invoice number)
    This produces an error with Offline payment(i have not tried others)...basically
    the "payment instructions" page that should open is not found (i think that becouse
    of those special characters in URL).

    Any ideas how to solve this?

    Full code:
    Am_Di::getInstance()->hook->add(Am_Event::INVOICE_BEFORE_INSERT, 'invoicePublicId');
    function invoicePublicId(Am_Event $event){
    $last_invoice_num = Am_Di::getInstance()->store->get('last_invoice_num');
    $invoice = $event->getInvoice();
    $invoice->public_id = ++$last_invoice_num ."-". date('Y');
    Am_Di::getInstance()->store->set('last_invoice_num', $last_invoice_num);
    }
    williambangwill likes this.

Share This Page