def __init__(self): self._ui = None self.default_store = get_default_store() self._printer_verified = False # Delay printer creation until we are accessing pos or till app. Other # applications should still be accessible without a printer self._printer = None SaleStatusChangedEvent.connect(self._on_SaleStatusChanged) ECFIsLastSaleEvent.connect(self._on_ECFIsLastSale) TillOpenEvent.connect(self._on_TillOpen) TillCloseEvent.connect(self._on_TillClose) TillAddCashEvent.connect(self._on_TillAddCash) TillAddTillEntryEvent.connect(self._on_AddTillEntry) TillRemoveCashEvent.connect(self._on_TillRemoveCash) StartApplicationEvent.connect(self._on_StartApplicationEvent) StopApplicationEvent.connect(self._on_StopApplicationEvent) CouponCreatedEvent.connect(self._on_CouponCreatedEvent) GerencialReportPrintEvent.connect(self._on_GerencialReportPrintEvent) GerencialReportCancelEvent.connect(self._on_GerencialReportCancelEvent) CheckECFStateEvent.connect(self._on_CheckECFStateEvent) HasPendingReduceZ.connect(self._on_HasPendingReduceZ) HasOpenCouponEvent.connect(self._on_HasOpenCouponEvent) self._till_summarize_action = gtk.Action( 'Summary', _('Summary'), None, None) self._till_summarize_action.connect( 'activate', self._on_TillSummary__activate) add_bindings([ ('plugin.ecf.read_memory', '<Primary>F9'), ('plugin.ecf.summarize', '<Primary>F11'), ])
def __init__(self): self._ui = None self.default_store = get_default_store() self._printer_verified = False # Delay printer creation until we are accessing pos or till app. Other # applications should still be accessible without a printer self._printer = None SaleStatusChangedEvent.connect(self._on_SaleStatusChanged) ECFIsLastSaleEvent.connect(self._on_ECFIsLastSale) TillOpenEvent.connect(self._on_TillOpen) TillCloseEvent.connect(self._on_TillClose) TillAddCashEvent.connect(self._on_TillAddCash) TillAddTillEntryEvent.connect(self._on_AddTillEntry) TillRemoveCashEvent.connect(self._on_TillRemoveCash) StartApplicationEvent.connect(self._on_StartApplicationEvent) StopApplicationEvent.connect(self._on_StopApplicationEvent) CouponCreatedEvent.connect(self._on_CouponCreatedEvent) GerencialReportPrintEvent.connect(self._on_GerencialReportPrintEvent) GerencialReportCancelEvent.connect(self._on_GerencialReportCancelEvent) CheckECFStateEvent.connect(self._on_CheckECFStateEvent) HasPendingReduceZ.connect(self._on_HasPendingReduceZ) HasOpenCouponEvent.connect(self._on_HasOpenCouponEvent) self._till_summarize_action = gtk.Action('Summary', _('Summary'), None, None) self._till_summarize_action.connect('activate', self._on_TillSummary__activate) add_bindings([ ('plugin.ecf.read_memory', '<Primary>F9'), ('plugin.ecf.summarize', '<Primary>F11'), ])
def create_coupon(self, sale=None): """ Creates a new fiscal coupon :param sale: The |sale| to which we are creating a coupon :returns: a new coupon """ if sysparam.get_bool('DEMO_MODE'): branch = api.get_current_branch(self.store) company = branch.person.company if company and company.cnpj not in [ '24.198.774/7322-35', '66.873.574/0001-82' ]: # FIXME: Find a better description for the warning bellow. warning( _("You are not allowed to sell in branches not " "created by the demonstration mode")) coupon = FiscalCoupon(self._parent) try: CouponCreatedEvent.emit(coupon, sale) except Exception as e: warning(_("It wasn't possible to open the coupon"), str(e)) coupon = None return coupon
def _setup_events(self): SaleStatusChangedEvent.connect(self._on_SaleStatusChanged) SaleAvoidCancelEvent.connect(self._on_SaleAvoidCancel) TillOpenEvent.connect(self._on_TillOpen) TillCloseEvent.connect(self._on_TillClose) TillAddCashEvent.connect(self._on_TillAddCash) TillAddTillEntryEvent.connect(self._on_AddTillEntry) TillRemoveCashEvent.connect(self._on_TillRemoveCash) StartApplicationEvent.connect(self._on_StartApplicationEvent) CouponCreatedEvent.connect(self._on_CouponCreatedEvent) GerencialReportPrintEvent.connect(self._on_GerencialReportPrintEvent) GerencialReportCancelEvent.connect(self._on_GerencialReportCancelEvent) CheckECFStateEvent.connect(self._on_CheckECFStateEvent) HasPendingReduceZ.connect(self._on_HasPendingReduceZ) HasOpenCouponEvent.connect(self._on_HasOpenCouponEvent) EditorCreateEvent.connect(self._on_EditorCreateEvent) ECFGetPrinterUserNumberEvent.connect(self._on_ECFGetPrinterUserNumberEvent)
def _setup_events(self): SaleStatusChangedEvent.connect(self._on_SaleStatusChanged) SaleAvoidCancelEvent.connect(self._on_SaleAvoidCancel) TillOpenEvent.connect(self._on_TillOpen) TillCloseEvent.connect(self._on_TillClose) TillAddCashEvent.connect(self._on_TillAddCash) TillAddTillEntryEvent.connect(self._on_AddTillEntry) TillRemoveCashEvent.connect(self._on_TillRemoveCash) StartApplicationEvent.connect(self._on_StartApplicationEvent) StopApplicationEvent.connect(self._on_StopApplicationEvent) CouponCreatedEvent.connect(self._on_CouponCreatedEvent) GerencialReportPrintEvent.connect(self._on_GerencialReportPrintEvent) GerencialReportCancelEvent.connect(self._on_GerencialReportCancelEvent) CheckECFStateEvent.connect(self._on_CheckECFStateEvent) HasPendingReduceZ.connect(self._on_HasPendingReduceZ) HasOpenCouponEvent.connect(self._on_HasOpenCouponEvent) EditorCreateEvent.connect(self._on_EditorCreateEvent)
def create_coupon(self): """ Creates a new fiscal coupon :returns: a new coupon """ if sysparam.get_bool("DEMO_MODE"): branch = api.get_current_branch(self.store) company = branch.person.company if company and company.cnpj not in ["24.198.774/7322-35", "66.873.574/0001-82"]: # FIXME: Find a better description for the warning bellow. warning(_("You are not allowed to sell in branches not " "created by the demonstration mode")) coupon = FiscalCoupon(self._parent) try: CouponCreatedEvent.emit(coupon) except (DriverError, DeviceError): warning(_("It wasn't possible to open the coupon")) coupon = None return coupon
def create_coupon(self): """ Creates a new fiscal coupon :returns: a new coupon """ if sysparam(self.store).DEMO_MODE: branch = api.get_current_branch(self.store) company = branch.person.company if company and company.cnpj not in ['24.198.774/7322-35', '66.873.574/0001-82']: # FIXME: Find a better description for the warning bellow. warning(_("You are not allowed to sell in branches not " "created by the demonstration mode")) coupon = FiscalCoupon(self._parent) try: CouponCreatedEvent.emit(coupon) except (DriverError, DeviceError): warning(_("It wasn't possible to open the coupon")) coupon = None return coupon
def create_coupon(self): """ Creates a new fiscal coupon :returns: a new coupon """ if sysparam(self.store).DEMO_MODE: branch = api.get_current_branch(self.store) company = branch.person.company if company and company.cnpj not in ['24.198.774/7322-35', '66.873.574/0001-82']: # FIXME: Find a better description for the warning bellow. warning(_("You are not allowed to sell in branches not " "created by the demonstration mode")) coupon = FiscalCoupon(self._parent) try: CouponCreatedEvent.emit(coupon) except (DriverError, DeviceError): warning('Não foi possível abrir o cupom') coupon = None return coupon
def create_coupon(self, sale=None): """ Creates a new fiscal coupon :param sale: The |sale| to which we are creating a coupon :returns: a new coupon """ if sysparam.get_bool('DEMO_MODE'): branch = api.get_current_branch(self.store) company = branch.person.company if company and company.cnpj not in ['24.198.774/7322-35', '66.873.574/0001-82']: # FIXME: Find a better description for the warning bellow. warning(_("You are not allowed to sell in branches not " "created by the demonstration mode")) coupon = FiscalCoupon(self._parent) try: CouponCreatedEvent.emit(coupon, sale) except Exception as e: warning(_("It wasn't possible to open the coupon"), str(e)) coupon = None return coupon