question

tombialy avatar image
tombialy asked tombialy commented

setQuantitySold() when printing receipt with StaticReceiptPrintJob

We are using StaticReceiptPrintJob to generate receipts. However, we are having hard time to print proper quantity. For some reason, quantity always prints as 1.


Below is printout from our experiment where we hardcoded quantity sold to 379.23

for (Gnjitmapi itm : wzCmd.getGnjitms()) {
            LineItem item = new LineItem();
            item.setPrinted(false);
            item.setName(itm.getIn() + "[v.13]");

            // item.setQuantitySold(itm.getQ());
            // TMP: Hardcoded to test printout
            item.setQuantitySold(379.23);

            if (itm.getR() != null && itm.getR().getA() != null)
                item.setPrice((long) (itm.getR().getA() * 100L));
            item.setPrinted(false);
            lineItemList.add(item);
        }


yet, receipt has printed with 1.



StaticReceiptPrintJob works very nice except for this one issue.

REST API
img-5586.jpg (372.3 KiB)
10 |2000

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

1 Answer

Jeffrey Blattman avatar image
Jeffrey Blattman answered tombialy commented

That field is not used. To add multiple line items, just add additional line items singularly. Even if they are identical.

I'll work on getting the field removed so it doesn't cause such confusion.

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.

tombialy avatar image tombialy commented ·

Thanks for clarifying.

0 Likes 0 ·

Welcome to the
Clover Developer Community