question

cdcilley avatar image
cdcilley asked Raymond Lee Deactivated commented

Printed receipt line numbering

Using Secure Pay, when the customer is done and chooses to "Print Receipt", all of the line items on the receipt are numbered "1" on the left hand side, see image. How can I get either no numbering or have it number the lines sequentially, 1 - 2 - 3 - etc...?


I'm building a custom Android application. I build the Order with a call to
mOrder = orderConnector.createOrder();
I create the LineItems and set the values, then add them to the order using
tmpItem = new LineItem();
tmpItem.setName("Avocados");
tmpItem.setPrice(250);
orderConnector.addCustomLineItem(mOrder.getId(), tmpItem, false);
Everything works fine - the order is created, has the correct line items, total, etc.

I call Secure Pay using
Intent intent = new Intent(Intents.ACTION_SECURE_PAY);
intent.putExtra(Intents.EXTRA_AMOUNT, 1030);
intent.putExtra(Intents.EXTRA_ORDER_ID, mOrder.getId());
startActivityForResult(intent, CSPConstants.SECURE_PAY_REQUEST_CODE);

As a bonus question... You may notice I've added text in the "item name" that includes the unit name and quantity. I've tried tmpItem.setUnitName but that does not show up on the receipt and tmpItem.setUnitQty only accepts integers which doesn't work for stuff sold by the pound.
PrintDevKitsecure network pay display
receipt.jpg (284.1 KiB)
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Dan avatar image Dan ♦ commented ·

The list of 1's is the quantity of each item. The order has 1 item of "Grain Quinoa Organic" with the units lb, with 3.15 lb at $3.15 per lb and so on.

I don't know if this is configurable.

0 Likes 0 ·

1 Answer

cdcilley avatar image
cdcilley answered Raymond Lee Deactivated commented
I set the Unit Qty as you suggested...
LineItem tmpItem = new LineItem();
tmpItem.setName("Avocado");
tmpItem.setUnitQty((int) (2.2 * 1000));
Log.d("CloverTAG", "unitQty = " + tmpItem.getUnitQty()); // Returns 2200 in Logcat
tmpItem.setPrice(195); // $1.95/lb
orderConnector.addCustomLineItem(mOrder.getId(), tmpItem, false);
Still prints a "1" for each and every line item on the receipt.
I feel this may have something to do with not being able to set the payType for a custom LineItem...

I'll give the REST option a try, but it seems overkill for something that should be set-able in the SDK.

As an aside... I'm stuck creating these as custom LineItems. My client has a robust and in-house built order/inventory system (over 7000 items that are in flux). They currently use Clover to process card transactions, but just hand enter a single line item with an invoice number and total cost. They are keen (especially after I showed them these test printed receipts) to have the detail show up on the invoice.
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community