Invoice number

Posts: 11
Joined: 01/17/2008

Hi there!
Is there a way to add a consecutive (and editable?) number for printed invoices?

Posts: 11
Joined: 01/17/2008

Another beginner's question: What would be the "clean" way to get an additional tab item into the invoice-menu from an external module "uc_invoicenumber.module"? I have tried the following:

/**
* Implementation of hook_menu().
*/
function uc_invoicenumber_menu($may_cache) {
  global $user, $items;

  if (!$may_cache) {
 
if (arg(0) == 'admin' && arg(1) == 'store' && arg(2) == 'orders' && is_numeric(arg(3))) {
 
      $items[] = array(
        'path' => 'admin/store/orders/'. arg(3) .'/invoice/invoicenumber',
        'title' => t('Invoice Number'),
        'callback arguments' => array(arg(3), 'invoicenumber'),
        'access' => user_access('view all orders'),
        'weight' => -1,
        'type' => MENU_LOCAL_TASK,
      );

}
}
}

... but the menu-item will only show up if I enter the code directly into the function uc_order_menu($may_cache), which is not the appreciated way, as I have learned Eye-wink

Posts: 4379
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Regarding the menu item, the hook requires a return value. So take out $items from your global declarations and add return $items; to the bottom of the function.

Posts: 11
Joined: 01/17/2008

Thank you, Ryan! Sometimes things turn out so easy...!

Posts: 1
Joined: 07/31/2008

I'm at the moment struggling with the same requirement to generate consecutive and editable numbers for printed invoices.

Before I start the development I would like to ask if there is perhaps already a module or patch out there.

Thank's very much in advance

Nils