In e-commerce, when you clicked on an invoice it would change the workflow to 'Invoiced' -- this is a critical function for multiple employees working on orders.
I've changed the uc_orders module to add an 'Invoice Printed' workflow when you press 'Print invoice' -- I didn't like how ecommerce would not have a difference between view and print invoices.
Used the tips from this page:
http://www.ubercart.org/forum/ideas_and_suggestions/1589/update_order_st...
Around Line 2055 change:
if ($op == 'print') {
print $output;
exit();
}To:
if ($op == 'print') {
if ($op == 'print') {
$invoiced = FALSE;
$comments = uc_order_comments_load($order_id);
foreach($comments AS $comment ) {
if($comment->order_status == 'invoiced') {
$invoiced = TRUE;
}
}
if(!$invoiced) {
uc_order_comment_save($order_id, $uid, 'Invoice has been printed out','order','invoiced',false);
uc_order_update_status($order_id, 'invoiced');
}
print $output;
exit();
}
}Since you may print out the invoice multiple times, even after the workflow has been changed, this code is set so after you print the invoice once, can be printed over and over without constant notification.
You also need to add an 'invoiced' order status under store administration. I liked to label it 'Invoiced Printed'


