presik_pos/app/states.py
2020-12-27 14:06:21 -05:00

43 lines
944 B
Python

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from re import compile
# States of mainwindow
STATES = {
'add': {
'button': 'button_accept',
're': compile(r'^(\*[0-9]*|[0-9]+)$|-|/|\*[0-9]*[.]*'),
},
'accept': {
'button': 'button_cash',
're': compile(r'^[0-9]+$'),
},
'payment': {
'button': 'button_payment',
're': compile(r'^[0-9]+$'),
},
'cash': {
'button': None,
're': compile(r'^[0-9]+(,[0-9]{,2})?$')
},
'paid': {
'button': None,
're': compile(r'^(\*[0-9]*|[0-9]+)$'),
},
'cancel': {
'button': None,
're': compile(r'^(\*[0-9]*|[0-9]+)$'),
},
'disabled': {
'button': None,
're': compile(r'^(\*[0-9]*|[0-9]+)$'),
},
'finished': {
'button': None,
're': compile(r'^(\*[0-9]*|[0-9]+)$'),
},
}
RE_SIGN = {
'quantity': compile(r'\d+|\.\d+|\d+\.'),
}