lnbits / tpos

Secure, mobile-ready, instant and shareable point of sale
MIT License
14 stars 13 forks source link

[Feature Request] Print receipt #20

Open arbadacarbaYK opened 11 months ago

arbadacarbaYK commented 11 months ago

Each payment should be able to be printed from the "paid"-screen and also from the tx-overview within the tpos (in case smb decides too late to want a receipt which happens often).

The receipt should best-case include

Note: A valid tax receipt would also contain a tax %, which can differ depending on the product. Maybe another reason to revalidate fixed products (with a taxrate x) in the tpos https://github.com/lnbits/tpos/issues/8

massmux commented 11 months ago

This feature would be nice. Infact many people use a device with printer onboard and are willing to issue a receipt for the payment just done by the customer.

in my opinion what is necessary is:

talvasconcelos commented 9 months ago

I'd like to integrate this. Would using the Invoices extension be a viable option?

Just like for onchain capabilities, users must enable the extension, they've to enable the Invoices extension, and the TPoS would issue an invoice.

Maybe we need to evaluate this feature. As TPoS can be used in those devices with a printer built-in, it should probably be something simpler.

As per tax %, the experience I have is that it differs from jurisdiction to jurisdiction and each merchant must handle it a different way.

arbadacarbaYK commented 9 months ago

I'd like to integrate this. Would using the Invoices extension be a viable option?

Just like for onchain capabilities, users must enable the extension, they've to enable the Invoices extension, and the TPoS would issue an invoice.

Maybe we need to evaluate this feature. As TPoS can be used in those devices with a printer built-in, it should probably be something simpler.

As per tax %, the experience I have is that it differs from jurisdiction to jurisdiction and each merchant must handle it a different way."

The request was to be able to print from TPOS tx-list or when tx happens to the printer - not from the invoice extnesion. Invoices in the invoice-extension also are static and cannot list dynamically or 2 or 3 products, right ? TPOS was just changed to sum up more than one product but the bill needs to show the different products for tax reasons in regions, where that differes.

Tax is handled everywhere the same - wordpress uses a fixed tax% for all, per producttype or per product - since that is too complex per product would be easier for LNbits imo. But the tax is not the point here, it can be done afterwards as long as the products are listed separately.

arbadacarbaYK commented 5 months ago

Solution should include to enable printing on the LNbits POS Terminal / Sunmi/bitcoinize internal printer.

If predefined products are used (which are realised meanwhile without a tax/product) they should be listed separately to the print and also the csv export to handle taxes based on that.

Also voucher of the ATM feature should be printable.

DoktorShift commented 2 months ago

Enhance the LNbits TPOS extension by adding functionality to handle payment JSONs and generate printable receipts. After a payment is received and processed, a "Print Receipt" button should appear on the TPOS screen, allowing users to print the receipt. Ensure compatibility with devices that do not have a printer by providing alternative options.

Action after setteled payment 1) Successfully handle ´payment´ object JSON, extracting necessary details. 2) Generate a structured receipt based on the extracted payment information. 3) Display a "Print Receipt" button or pop up on the TPOS screen after a payment is processed. (+ add print button in "last sales" as well) 4) Print the receipt when the "Print Receipt" button is clicked.

print_3

Steps

  1. Payment JSON Handling:

    • Extract the 'payment' object from the received JSON
  2. Printable Receipt Generation:

    • Create a visually appealing receipt format that includes relevant payment details. Could be a source
  3. Implement functionality to detect if the device has an available printer. (Could be tricky since its a spa and not a "solid app")

    • Provide alternative options if no printer is detected.
  4. UI Enhancement:

    • Modify the TPOS screen to display a "Print Receipt" button after the payment is successfully processed. (see above screenshot left)
    • Modify TPoS receipt "last payments" to print receipt even after the payment process is finished. (see above Screenshot right)
arbadacarbaYK commented 2 months ago

Enhance the LNbits TPOS extension by adding functionality to handle payment JSONs and generate printable receipts. After a payment is received and processed, a "Print Receipt" button should appear on the TPOS screen, allowing users to print the receipt. Ensure compatibility with devices that do not have a printer by providing alternative options.

The bounty will be paid by me once the changes are merged into lnbits main.

Action after setteled payment

1. Successfully handle ´payment´ object JSON, extracting necessary details.

2. Generate a structured receipt based on the extracted payment information.

3. Display a "Print Receipt" button or pop up on the TPOS screen after a payment is processed. (+ add print button in "last sales" as well)

4. Print the receipt when the "Print Receipt" button is clicked.

print_3

Steps to achieve Bounty

1. Payment JSON Handling:

   * Extract the 'payment' object from the received JSON

2. Printable Receipt Generation:

   * Create a visually appealing receipt format that includes relevant payment details. [Could be a source](https://github.com/lnbits/tpos-receipt-printer/blob/main/firmware/src/print.h#L214)

3. Implement functionality to detect if the device has an available printer. (Could be tricky since its a spa and not a "solid app")

   * Provide alternative options if no printer is detected.

4. UI Enhancement:

   * Modify the TPOS screen to display a "Print Receipt" button after the payment is successfully processed. (see above screenshot left)
   * Modify TPoS receipt "last payments" to print receipt even after the payment process is finished. (see above Screenshot right)

That doesnt reflect all of the above which makes it a bit hard to follow up here

arbadacarbaYK commented 2 months ago

all three points the logo tpos-name (to simulate shop-name) the (preferred currency) fiat value at tx time are not in. So i wonder if you just read the headline.