We've run into several problems trying to use UberPOS in cases where the order has to have a $0 balance. The main problem has to be the print pop up that is triggered when an order is created by any means other than adding a product with a price greater than $0. This causes problems because I need to assign new orders to a user ID before any products are added to the order, so UberPOS tries to print a receipt for a blank order... Also, when adding a product to an order where the price of that item is $0, UberPOS wants to print a receipt. That wouldn't be a huge issue if I only wanted to add one item to the order. This leads to the second problem, we need to occasionally ring up $0 orders for donations of products that are leaving the store (for inventory purposes). The usual workflow is to hit Cash, Check or Credit after the items are scanned and you'll get the print prompt and then clear the order to start your next transaction. When the order is $0 balance you won't get a print prompt because you have to cancel it after the first item is added to the order, the print isn't triggered after hitting cash, check or credit because "The order has been paid in full" since there is $0 due. Clearing the message doesn't get you back to a new order screen either, you have to clear multiple times or hit cancel, both are bad considering the order status needs to still be completed to be tracked properly.

If anyone has any advice here I'd appreciate it if you could shared that with me.

Thanks

Comments

coreywood’s picture

After some research on why these receipts were being printed, it looks like UberPOS was built to trigger the receipt whenever the balance of an order hits $0 or less. I don't know why this is, since it seems logical that instances would occur where a zero balance would need to be carrier and/or an order with a zero balance would need to be marked as completed (donations or freebies still need to be removed from inventory). I made two changes, one to uberpos.module and one to uberpos.commands.inc to get the desired behavior. Basically, I set the receipt to only be triggered by an order status of complete and instead of saying an order is already paid when you hit a payment method, I set the order status to completed and display a thank you message.

Here's the code I used in uberpos.module

  // if order status is completed UberPOS will display the print dialog.
  if ($order->order_status == 'pos_completed') {
    $times_printed = uberpos_receipt_times_printed($order->order_id);
    if ($times_printed == 0 || $_SESSION['uberpos_reprint'] == TRUE) {
      module_invoke_all('uberpos_paid', $order);
      $js['receipt'] = uberpos_get_receipt($order);
    }
  }

Here's the code I used in uberpos.commands.inc (around line 224)

    else {
	  //set order status as completed
	  uc_order_update_status($order->order_id, 'pos_completed');
	  $order = uc_order_load($order->order_id);
	  
	  // set clear message with order status
	  uberpos_clear_message(t('Thank you for shopping!'), array('clear_order' => TRUE));

    }
    return $type;
last call media’s picture

Thanks for working on this. If possible, could you provide a patch file for these changes?