Skip to content

Conversation

@diego-ramos
Copy link
Contributor

New Receipt format that works on POS thermal printers (58/80 mm)

@jekkos jekkos added this to the 3.4.2 milestone Jun 30, 2025
Copy link
Member

@objecttothis objecttothis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curly braces formatting needs to be fixed for PSR-12 compliance. Take a look at the rest of the code base to see the formatting for if statements.

@diego-ramos
Copy link
Contributor Author

Curly braces formatting needs to be fixed for PSR-12 compliance. Take a look at the rest of the code base to see the formatting for if statements.

Done!

@diego-ramos diego-ramos requested a review from objecttothis July 9, 2025 12:40
@diego-ramos
Copy link
Contributor Author

@objecttothis @BudsieBuds , Hi any news on this review?

Copy link
Member

@objecttothis objecttothis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I thought I submitted these comments but I just had it in progress. Just fix these and I think we are good to merge.

@objecttothis objecttothis requested a review from Copilot October 15, 2025 05:58
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for 58mm receipt format specifically designed for POS thermal printers. The implementation provides a new compact receipt template optimized for narrow thermal printer widths.

  • New 58mm receipt template with optimized layout for thermal printers
  • Added configuration option to select the 58mm receipt format
  • Compact CSS styling designed for 58mm width constraints

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
public/css/receipt.css Added CSS styles for 58mm receipt format with monospace font and compact layout
app/Views/sales/receipt_58mm.php New receipt template with condensed layout optimized for 58mm thermal printers
app/Views/configs/receipt_config.php Added 58mm option to receipt template dropdown configuration
app/Language/en/Config.php Added language key for 58mm receipt option

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

width: 100%;
}

.items_58 th, .items td {
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CSS selector mismatch: should be .items_58 th, .items_58 td to properly target both th and td elements within the items_58 class.

Suggested change
.items_58 th, .items td {
.items_58 th, .items_58 td {

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@diego-ramos can you take a look at these comments made by copilot and fix any that need to be fixed?

<div><?= lang('Sales.giftcard_balance') ?>: <?= to_currency($cur_giftcard_value) ?></div>
<?php } ?>

<div><?= lang('Sales.amount_due') ?>:: <?= to_currency($amount_change); ?></div>
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double colon after 'amount_due' - should be single colon for consistency with other labels.

Suggested change
<div><?= lang('Sales.amount_due') ?>:: <?= to_currency($amount_change); ?></div>
<div><?= lang('Sales.amount_due') ?>: <?= to_currency($amount_change); ?></div>

Copilot uses AI. Check for mistakes.
<div id="sale_id"><?= lang('Sales.id') . esc(": $sale_id") ?></div>

<?php if(!empty($invoice_number)) { ?>
<div id="invoice_number"><?= lang('Sales.invoice_number') . ": $invoice_number" ?></div>
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing output escaping for $invoice_number variable. Should use esc() function to prevent XSS vulnerabilities.

Suggested change
<div id="invoice_number"><?= lang('Sales.invoice_number') . ": $invoice_number" ?></div>
<div id="invoice_number"><?= lang('Sales.invoice_number') . ": " . esc($invoice_number) ?></div>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants