Minor fixes

This commit is contained in:
Oscar Alvarez 2020-12-09 14:44:39 -05:00
parent c988c92953
commit 4e0907024a
13 changed files with 100 additions and 36 deletions

BIN
0 Normal file

Binary file not shown.

View File

@ -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

View File

@ -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
----------------------------

View File

@ -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.

2
README
View File

@ -32,7 +32,7 @@ Update Translation
------------------
Modify your i18 file and execute in terminal:
$lrelease i18n_es.ts
$ lrelease i18n_es.ts
Copyright

BIN
app/__init__.pyc Normal file

Binary file not shown.

View File

@ -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

BIN
app/reporting.pyc Normal file

Binary file not shown.

View File

@ -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
#
##########################################

View File

@ -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"

BIN
lp0 Normal file

Binary file not shown.

View File

@ -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

74
test_printer.py Normal file
View File

@ -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...!')