Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions pos_next/pos_next/utils/pos_closing_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ def _fetch_items_for_targets(parent_targets: set[tuple[str, str]]) -> list[dict]
def get_items_sold(doc) -> list[dict]:
closing_doc = _as_closing_doc(doc)
parent_targets = _collect_parent_targets(closing_doc.get("pos_transactions"))
if not parent_targets:
return []

items = _fetch_items_for_targets(parent_targets)

return [
Expand Down
8 changes: 8 additions & 0 deletions pos_next/pos_next/utils/tests/test_pos_closing_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,11 @@ def test_get_items_sold_returns_empty_when_no_transactions(self, mock_fetch):

self.assertEqual(result, [])
mock_fetch.assert_not_called()

@patch("pos_next.pos_next.utils.pos_closing_print._fetch_items_for_targets")
def test_get_items_sold_returns_empty_when_no_parent_targets(self, mock_fetch):
doc = {"pos_transactions": [{"customer": "CUST-001"}]}
result = get_items_sold(doc)

self.assertEqual(result, [])
mock_fetch.assert_not_called()
1 change: 1 addition & 0 deletions pos_next/translations/ar.csv
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"Item removed from cart","تم الحذف من السلة",""
"Open Shift","فتح وردية",""
"Close Shift","إغلاق الوردية",""
"Print EOD Report","طباعة تقرير نهاية اليوم",""
"Shift Opening","بداية الوردية",""
"Shift Closing","نهاية الوردية",""
"Opening Amount","عهدة الفتح",""
Expand Down
1 change: 1 addition & 0 deletions pos_next/translations/id.csv
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"Item removed from cart","Dihapus dari keranjang",""
"Open Shift","Buka Shift",""
"Close Shift","Tutup Shift",""
"Print EOD Report","Cetak Laporan Akhir Hari",""
"Shift Opening","Pembukaan Shift",""
"Shift Closing","Penutupan Shift",""
"Opening Amount","Jumlah Pembukaan Shift",""
Expand Down
1 change: 1 addition & 0 deletions pos_next/translations/pt-br.csv
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"Item removed from cart","Item removido do carrinho",""
"Open Shift","Abrir Turno",""
"Close Shift","Fechar Turno",""
"Print EOD Report","Imprimir Relatório de Fim de Dia",""
"Shift Opening","Abertura do Turno",""
"Shift Closing","Fechamento do Turno",""
"Opening Amount","Valor de Abertura",""
Expand Down
Loading