fix reporting and filter sales

This commit is contained in:
Wilson Gomez 2023-10-02 12:35:42 -05:00
parent fe32199a9b
commit be0bc91d61
3 changed files with 14 additions and 8 deletions

View File

@ -2035,7 +2035,11 @@ class AppWindow(FrontWindow):
if _type == 'cash':
dom.extend([
('payment_term', '=', self.default_payment_term['id']),
[
'OR',
('payment_term', '=', self.default_payment_term['id']),
('payment_term', '=', None),
],
('reservation', '!=', True)
])
elif _type == 'credit':

View File

@ -170,6 +170,7 @@ class Receipt(object):
self._printer.ln(3)
self._printer.cut()
self._printer.cashdraw(2)
self._printer.close()
# self._printer.beep()
def config_printer(self, printer):
@ -202,7 +203,7 @@ class Receipt(object):
def close_printer(self):
# only close printer in interfaces correct
if self._interface == 'usb' and '/dev/usb/' not in self._device:
if self._interface == 'usb' and OS_NAME == 'nt':
self._printer.close()
def set_printer(self):
@ -478,7 +479,7 @@ class Receipt(object):
self._printer.textln('NOTA:' + ln.get('note'))
self._printer.ln(2)
self._printer.cut()
self.close_printer()
self._printer.close()
except Exception as e:
print(e)
traceback.print_exc()
@ -932,8 +933,8 @@ class Receipt(object):
if turn:
self._printer.text('TURNO: %s' % str(turn))
self._printer.ln(2)
if self._environment != 'retail':
kind = order.get('kind', 'delivery')
kind = order.get('kind', None)
if self._environment != 'retail' and kind:
if kind == 'take_away':
_kind = 'PARA LLEVAR'
elif kind == 'to_table':

View File

@ -9,8 +9,8 @@ from app.reporting import Receipt
fake_data = {
"12": {
"printer": {
"device": "/dev/usb/lp1",
"interface": "usb",
"device": "192.168.1.33",
"interface": "network",
"profile": "",
"row_characters": None
},
@ -53,4 +53,5 @@ fake_data = {
}
receipt = Receipt(context={}, environment='restaurant')
receipt.print_tasks(fake_data)
for i in range(12):
receipt.print_tasks(fake_data)