def test_filechooser(self): detail = ParameterDetails(u'FOO', 'section', 'short_desc', 'long_desc', str, editor='directory-chooser') sysparam.register_param(detail) editor = SystemParameterEditor(self.store, detail) self.check_editor(editor, 'editor-systemparameter-file-chooser') sysparam._details.pop('FOO')
def test_unwrapped_text_view_entry(self): detail = ParameterDetails(u'FOO', 'section', 'short_desc', 'long_desc', str, multiline=True, initial=u'bar', wrap=False) sysparam.register_param(detail) editor = SystemParameterEditor(self.store, detail) self.check_editor(editor, 'editor-systemparameter-unwrapped-text-view-entry') sysparam._details.pop('FOO')
def test_get_parameter_data_path_parameter(self): parameter = ParameterDetails(u'FOO', 'section', 'short_desc', 'long_desc', unicode, initial=u'~/.stoq/cat52', editor='directory-chooser') sysparam.register_param(parameter) search = ParameterSearch(self.store) value = search._get_parameter_value(parameter) self.assertEquals(value, u'~/.stoq/cat52') sysparam._details.pop('FOO')
from stoqlib.lib.osutils import get_application_dir from stoqlib.lib.parameters import sysparam, ParameterDetails from stoqlib.lib.permissions import PermissionManager from stoqlib.lib.translation import stoqlib_gettext from nfe.nfegenerator import NFeGenerator _ = stoqlib_gettext log = logging.getLogger(__name__) params = [ ParameterDetails( u'NFE_SERIAL_NUMBER', _(u'NF-e'), _(u'Fiscal document serial number'), _(u'Fiscal document serial number. Fill with 0 if the NF-e have no ' u'series. This parameter only has effect if the nfe plugin is enabled.' ), int, initial=1), ParameterDetails( u'NFE_DANFE_ORIENTATION', _(u'NF-e'), _(u'Danfe printing orientation'), _(u'Orientation to use for printing danfe. Portrait or Landscape'), int, initial=0, options={ 0: _(u'Portrait'), 1: _(u'Landscape') }),
from ecf.ecfprinterdialog import ECFListDialog from ecf.ecfmemorydialog import FiscalMemoryDialog from ecf.paulistainvoicedialog import PaulistaInvoiceDialog _ = stoqlib_gettext log = logging.getLogger(__name__) params = [ # Some fiscal printers can print up to 8 rows and 70 characters each row. # But we want to write an documentation to make sure it will work # on every fiscal printer ParameterDetails( u'ADDITIONAL_INFORMATION_ON_COUPON', _(u'ECF'), _(u'Additional information on fiscal coupon'), _(u'This will be printed in the promotional message area of the fiscal coupon\n' u'IMPORTANT NOTE:\n' u'This template cannot have more than 2 line, and each line more ' u'than 50 characters, and you have to break it manually using the characters ' u'"\\n" or (enter key) or the fiscal printer may not print it correctly.'), unicode, multiline=True, initial=u'', wrap=False), ParameterDetails( u'ENABLE_DOCUMENT_ON_INVOICE', _(u'ECF'), _(u'Enable document on invoice'), _(u'Once this parameter is set, we will confirm the client document ' u'when registering a fiscal coupon.'), bool, initial=False), ParameterDetails( u'ALLOW_CANCEL_LAST_COUPON',
with api.new_store() as store: order = store.fetch(work_order) rv = run_dialog(OpticalSupplierEditor, None, store, order) if not rv: return False order.supplier_order = rv.supplier_order optical_wo = OpticalWorkOrder.find_by_work_order(store, order) optical_wo.create_purchase(rv.supplier, rv.item, rv.is_freebie) params = [ ParameterDetails( u'CUSTOM_WORK_ORDER_DESCRIPTION', _(u'Work order'), _(u'Allow to customize the work order description'), _(u'If true, it will be allowed to set a description for the work order ' u'manually. Otherwise, the identifier will be used.'), bool, initial=True) ] class OpticalUI(object): def __init__(self): self._setup_params() self.default_store = get_default_store() StartApplicationEvent.connect(self._on_StartApplicationEvent) EditorCreateEvent.connect(self._on_EditorCreateEvent) RunDialogEvent.connect(self._on_RunDialogEvent) PrintReportEvent.connect(self._on_PrintReportEvent) SearchDialogSetupSearchEvent.connect(self._on_SearchDialogSetupSearchEvent)