diff --git a/0 b/0 new file mode 100644 index 0000000..7f8ae31 Binary files /dev/null and b/0 differ diff --git a/COPYRIGHT b/COPYRIGHT index 4db27ec..c665520 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -1,4 +1,4 @@ -Copyright (C) 2012-2020 Oscar Alvarez. +Copyright (C) 2016-2020 Oscar Alvarez. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/INSTALL b/INSTALL index a873dcc..fd382d2 100644 --- a/INSTALL +++ b/INSTALL @@ -4,7 +4,7 @@ Installing Tryton POS Client Prerequisites Client -------------------- - * Python 3.6 or later (http://www.python.org/) + * Python 3.7 or later (http://www.python.org/) * python-setuptools * python3-pyqt5 * python3-pyqt5.qtsvg @@ -15,12 +15,17 @@ Prerequisites Client * python3-dev * python3-pil - * Optional, Pip packages: + * Required, Pip packages: pip3 install pyusb pip3 install pillow pip3 install qrcode pip3 install paramiko pip3 install pycups + pip3 install requests + pip3 install simplejson + pip3 install win32printing + pip3 install escpos + Prerequisites Server Modules ---------------------------- diff --git a/INSTALL_es b/INSTALL_es index 95a2055..9e1e328 100644 --- a/INSTALL_es +++ b/INSTALL_es @@ -11,7 +11,7 @@ paquetes instalados en el sistema: En Debian, Ubuntu y Derivados, se recomienda usar: $ apt install paquete - * Python 3.6 or later (http://www.python.org/) + * Python 3.7 or later (http://www.python.org/) * python-setuptools * python3-pyqt5 * python3-pyqt5.qtsvg @@ -29,12 +29,15 @@ En Debian, Ubuntu y Derivados, se recomienda usar: $ apt install paquete Los siguientes paquetes se deben instalar usando PIP - pip3 install pyserial - pip3 install pyusb - pip3 install pillow - pip3 install qrcode - pip3 install paramiko - pip3 install pycups +pip3 install pyusb +pip3 install pillow +pip3 install qrcode +pip3 install paramiko +pip3 install pycups +pip3 install requests +pip3 install simplejson +pip3 install win32printing +pip3 install escpos Tener en cuenta que algunos paquetes se deben instalar con pip para python3. diff --git a/README b/README index 59b1fd3..2d83e3b 100644 --- a/README +++ b/README @@ -32,7 +32,7 @@ Update Translation ------------------ Modify your i18 file and execute in terminal: -$lrelease i18n_es.ts +$ lrelease i18n_es.ts Copyright diff --git a/app/__init__.pyc b/app/__init__.pyc new file mode 100644 index 0000000..ad51088 Binary files /dev/null and b/app/__init__.pyc differ diff --git a/app/reporting.py b/app/reporting.py index 98c2ae7..a43cfc6 100755 --- a/app/reporting.py +++ b/app/reporting.py @@ -137,7 +137,7 @@ class Receipt(object): if not self._printer: return self.print_enter() - self._printer.image('image_test.jpeg', center=True) + self._printer.image('app/image_test.jpeg', center=True) self.print_enter() self.print_header() self.print_enter() @@ -675,7 +675,7 @@ if __name__ == '__main__': # Unix-like Usb example device = 'usb','/dev/usb/lp1' - # Windows Usb example for printer nameb SATPOS + # Windows Usb example for printer name SATPOS # device = 'usb', 'SATPOS' # SSH example diff --git a/app/reporting.pyc b/app/reporting.pyc new file mode 100644 index 0000000..abd5e46 Binary files /dev/null and b/app/reporting.pyc differ diff --git a/config_pos.ini b/config_pos.ini index 89511b8..64d7f5c 100644 --- a/config_pos.ini +++ b/config_pos.ini @@ -14,7 +14,7 @@ user=admin # network,192.168.0.36 # cups,EPSON-TM-T20 # -# For Windows use just namep printer eg: +# For Windows use just name printer eg: # usb,SATPOS # ########################################## diff --git a/doc/index.rst b/doc/index.rst index f0eb28b..f2ae61c 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -3,31 +3,13 @@ Tryton POS Client (Using Qt5 and Python3) # FOR WINDOWS -Download and install python-3.5.2-amd64 +Download and install python-3.7.9-amd64 -Download and install Visual C++ Build Tools 2013 - -Download and install swigwin-3.0.12 - -Add swig.exe to Windows PATH - - -> python -m pip install -U pip - -> pip install -U setuptools - -> pip install -U virtualenv - -> pip install PyQt5 - -> downlod TortoiseHG instalador mercurial +> pip install PyQt5==5.8.1.1 Copy config_pos.ini on user AppData/Local/tryton Modify config_pos.ini -Put launcher on desktop and set icon change +Put launcher on desktop and set icon change name "pospro.pyw" - - - diff --git a/lp0 b/lp0 new file mode 100644 index 0000000..7f8ae31 Binary files /dev/null and b/lp0 differ diff --git a/project.pro b/project.pro index 250bd0d..c42bef6 100644 --- a/project.pro +++ b/project.pro @@ -1,3 +1,3 @@ -# Execute in terminal $pylupdate5 project.pro +# Execute in terminal $ pylupdate5 project.pro SOURCES = app/mainwindow.py app/dialogs.py app/reporting.py app/buttonpad.py app/commons/custom_button.py app/commons/buttons.py app/commons/dblogin.py app/commons/dialogs.py app/commons/forms.py app/commons/frontwindow.py app/commons/menu_list.py app/commons/search_window.py TRANSLATIONS = app/locale/i18n_es.ts diff --git a/test_printer.py b/test_printer.py new file mode 100644 index 0000000..3640b85 --- /dev/null +++ b/test_printer.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python3 + +from app.reporting import Receipt + + +if __name__ == '__main__': + + # Test for Escpos interface printer Linux and Windows + + # Network example + # device = 'network', '192.168.0.32' + + # Unix-like Usb example + # device = 'usb', '/dev/usb/lp1' + + # Windows Usb example for printer name SATPOS + # device = 'usb', 'SATPOS' + + # SSH example + # device = 'ssh', 'psk@xxxxx@192.168.0.5@23@/dev/usb/lp1' + + protocols = { + '1': 'usb', + '2': 'network', + '3': 'ssh', + } + protocols_msg = """ + 1 - usb + 2 - network + 3 - ssh + """ + print('Please select interface...') + print(protocols_msg) + interface = input('Interface : ') + + print(""" + Please insert device path, examples... + + # Network example: + 192.168.0.32 + + # Unix-like USB example + /dev/usb/lp1 + + # Windows USB example for printer name SATPOS + EPSON-POS + """) + + device = input('Device : ') + protocol = protocols[str(interface)] + printer_test = { + 'interface': protocol, + 'device': str(device), + 'profile': 'TM-P80', + } + + ctx_printing = {} + ctx_printing['company'] = 'OSCORP INC' + ctx_printing['sale_device'] = 'CAJA-10' + ctx_printing['shop'] = 'Shop Wall Boulevard' + ctx_printing['street'] = 'Cll 21 # 172-81. Central Park' + ctx_printing['user'] = 'Charles Chapplin' + ctx_printing['city'] = 'Dallas' + ctx_printing['zip'] = '0876' + ctx_printing['phone'] = '591 5513 455' + ctx_printing['id_number'] = '123456789-0' + ctx_printing['tax_regime'] = 'none' + + receipt = Receipt(ctx_printing) + try: + receipt.set_printer(printer_test) + receipt.test_printer() + except: + print('Printing failed...!')