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