feat(terminal): quick sale at the counter: cash/card/split, change, cash drawer, fiscal (platform-v2 3.3b)

- POST /api/pos/sales: all checks first (shift, lines, payment split, cash given,
  discount → ordering.prices.modify or manager approval, fiscal VAT groups), then the
  existing open_order / add_items / pay_items functions, so tickets, KDS, price events,
  shift totals and the fiscal receipt work as for any order.
- Cash drawer: printer_service.open_cash_drawer (ESC @ + ESC p 0 25 250) to the screen's
  receipt printer on cash, logged and audited (DRAWER_OPENED / DRAWER_FAILED).
- orders._can_access_order: the people assigned to an order may act on it (a cashier's
  own takeaway order); pos_cart prices a batch with the lines before it, as add_items does.
- Terminal: Charge → payment dialog (exact cash pre-selected, quick amounts, change,
  card, split by line), per-line discounts, sale summary and "Same again".
- Tests: backend +6 (socket printer receives the drawer kick, fiscal file in the bridge
  folder), terminal unit +1, terminal.mjs +9.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-15 00:28:33 +02:00
co-authored by Claude Opus 5.5
parent 17bee66df1
commit bff82a332a
15 changed files with 632 additions and 14 deletions
+4 -1
View File
@@ -79,6 +79,9 @@
"claim_needs_staff": "Μόνο μέλος του προσωπικού μπορεί να αναλάβει ένα είδος."
},
"pos": {
"line_invalid": "Η γραμμή {{line}} του καλαθιού δεν μπορεί να πουληθεί όπως επιλέχθηκε ({{reason}})."
"line_invalid": "Η γραμμή {{line}} του καλαθιού δεν μπορεί να πουληθεί όπως επιλέχθηκε ({{reason}}).",
"shift_required": "Ξεκινήστε τη βάρδιά σας πριν πουλήσετε.",
"payment_invalid": "Αυτή η πληρωμή δεν βγαίνει ({{reason}}).",
"fiscal_vat_missing": "Οι φορολογικές αποδείξεις είναι ενεργές, αλλά αυτά τα προϊόντα δεν έχουν ομάδα ΦΠΑ: {{names}}."
}
}
+33
View File
@@ -204,6 +204,39 @@
"startingCash": "Μετρητά στο συρτάρι τώρα",
"badAmount": "Γράψτε ένα ποσό, π.χ. 50 ή 50,00",
"start": "Έναρξη βάρδιας"
},
"charge": "Χρέωση {{total}}",
"discount": "Έκπτωση",
"noDiscount": "Χωρίς έκπτωση",
"discountNeedsApproval": "Μια έκπτωση χρειάζεται έγκριση διαχειριστή κατά τη χρέωση.",
"discountLine": "−{{pct}}%: {{amount}} το ένα",
"pay": {
"title": "Πληρωμή: {{total}}",
"method": "Τρόπος πληρωμής",
"cash": "Μετρητά",
"card": "Κάρτα",
"split": "Μοιρασμένα",
"confirmCash": "Είσπραξη {{amount}} μετρητά",
"confirmCard": "Πληρώθηκαν {{amount}} με κάρτα",
"confirmSplit": "Είσπραξη",
"cashPart": "Μετρητά: {{amount}}",
"cardPart": "Κάρτα: {{amount}}",
"cardHint": "Πληκτρολογήστε {{amount}} στο τερματικό καρτών και επιβεβαιώστε εδώ μόλις εγκριθεί.",
"given": "Μετρητά που δόθηκαν",
"exact": "Ακριβώς: {{amount}}",
"change": "Ρέστα: {{amount}}",
"short": "Είναι λιγότερα από το ποσό που οφείλεται"
},
"done": {
"paid": "Πληρώθηκαν {{total}}",
"cash": "Μετρητά {{amount}}",
"card": "Κάρτα {{amount}}",
"drawerOpened": "Το συρτάρι άνοιξε",
"drawerFailed": "Το συρτάρι δεν άνοιξε",
"fiscal": "Η απόδειξη στάλθηκε στον φορολογικό μηχανισμό",
"again": "Τα ίδια ξανά",
"toast": "Πληρώθηκε",
"toastChange": "Πληρώθηκε. Ρέστα: {{change}}"
}
}
}
+4 -1
View File
@@ -79,6 +79,9 @@
"claim_needs_staff": "Only a staff member can claim an item."
},
"pos": {
"line_invalid": "Cart line {{line}} can't be sold as chosen ({{reason}})."
"line_invalid": "Cart line {{line}} can't be sold as chosen ({{reason}}).",
"shift_required": "Start your shift before selling.",
"payment_invalid": "This payment doesn't add up ({{reason}}).",
"fiscal_vat_missing": "Fiscal receipts are on, but these products have no VAT group: {{names}}."
}
}
+33
View File
@@ -204,6 +204,39 @@
"startingCash": "Cash in the drawer now",
"badAmount": "Enter an amount, e.g. 50 or 50,00",
"start": "Start shift"
},
"charge": "Charge {{total}}",
"discount": "Discount",
"noDiscount": "No discount",
"discountNeedsApproval": "A discount needs a manager's approval when you charge.",
"discountLine": "−{{pct}}%: {{amount}} each",
"pay": {
"title": "Payment: {{total}}",
"method": "Payment method",
"cash": "Cash",
"card": "Card",
"split": "Split",
"confirmCash": "Take {{amount}} in cash",
"confirmCard": "Paid {{amount}} by card",
"confirmSplit": "Take the payment",
"cashPart": "Cash: {{amount}}",
"cardPart": "Card: {{amount}}",
"cardHint": "Enter {{amount}} on the card terminal, then confirm here once it's approved.",
"given": "Cash given",
"exact": "Exact: {{amount}}",
"change": "Change: {{amount}}",
"short": "That's less than the amount due"
},
"done": {
"paid": "Paid {{total}}",
"cash": "Cash {{amount}}",
"card": "Card {{amount}}",
"drawerOpened": "Drawer opened",
"drawerFailed": "The drawer didn't open",
"fiscal": "Receipt sent to the fiscal device",
"again": "Same again",
"toast": "Paid",
"toastChange": "Paid. Change: {{change}}"
}
}
}