Hi there!
Is there a way to add a consecutive (and editable?) number for printed invoices?
Invoice number
|
|
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 
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.
Thank you, Ryan! Sometimes things turn out so easy...!
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
|
|



Joined: 01/17/2008