def create_model(self, store): tax_constant = SellableTaxConstant.get_by_type(TaxType.SERVICE, self.store) sellable = Sellable(description=u"", price=currency(0), store=store) sellable.tax_constant = tax_constant sellable.unit_id = sysparam.get_object_id("SUGGESTED_UNIT") model = Service(sellable=sellable, store=store) return model
def _set_product_tax_constant_default(self, store): if self.has_object("DEFAULT_PRODUCT_TAX_CONSTANT"): return from stoqlib.domain.sellable import SellableTaxConstant tax_constant = SellableTaxConstant.get_by_type(TaxType.NONE, store) self.set_object(store, "DEFAULT_PRODUCT_TAX_CONSTANT", tax_constant)
def _set_product_tax_constant_default(self, store): if self.has_object("DEFAULT_PRODUCT_TAX_CONSTANT"): return from stoqlib.domain.sellable import SellableTaxConstant tax_constant = SellableTaxConstant.get_by_type(TaxType.NONE, store) self.set_object(store, "DEFAULT_PRODUCT_TAX_CONSTANT", tax_constant)
def __init__(self): super(ServiceImporter, self).__init__() default_store = get_default_store() self.tax_constant = SellableTaxConstant.get_by_type( TaxType.SERVICE, default_store) self._code = 11 assert self.tax_constant
def create_model(self, store): tax_constant = SellableTaxConstant.get_by_type(TaxType.SERVICE, self.store) sellable = Sellable(description=u'', price=currency(0), store=store) sellable.tax_constant = tax_constant sellable.unit_id = sysparam.get_object_id('SUGGESTED_UNIT') model = Service(sellable=sellable, store=store) return model
def __init__(self): super(ServiceImporter, self).__init__() default_store = get_default_store() self.tax_constant = SellableTaxConstant.get_by_type( TaxType.SERVICE, default_store) self._code = 11 assert self.tax_constant
def _create_product_tax_constant(self): from stoqlib.domain.sellable import SellableTaxConstant key = u"DEFAULT_PRODUCT_TAX_CONSTANT" if self.get_parameter_by_field(key, SellableTaxConstant): return tax_constant = SellableTaxConstant.get_by_type( TaxType.NONE, self.store) self._set_schema(key, tax_constant.id)
def create_service(self, description=u"Description", price=10): from stoqlib.domain.sellable import Sellable, SellableTaxConstant from stoqlib.domain.service import Service tax_constant = SellableTaxConstant.get_by_type(TaxType.SERVICE, self.store) sellable = Sellable(price=price, description=description, store=self.store) sellable.tax_constant = tax_constant service = Service(sellable=sellable, store=self.store) return service
def _set_delivery_default(self, store): if self.has_object("DELIVERY_SERVICE"): return from stoqlib.domain.sellable import (Sellable, SellableTaxConstant) from stoqlib.domain.service import Service tax_constant = SellableTaxConstant.get_by_type(TaxType.SERVICE, store) sellable = Sellable(store=store, description=_(u'Delivery')) sellable.tax_constant = tax_constant service = Service(sellable=sellable, store=store) self.set_object(store, "DELIVERY_SERVICE", service)
def create_model(self, store): tax_constant = SellableTaxConstant.get_by_type(TaxType.SERVICE, self.store) sellable = Sellable(description=u'', price=currency(0), store=store) sellable.status = Sellable.STATUS_AVAILABLE sellable.tax_constant = tax_constant sellable.unit = sysparam(self.store).SUGGESTED_UNIT model = Service(sellable=sellable, store=store) return model
def _set_delivery_default(self, store): if self.has_object("DELIVERY_SERVICE"): return from stoqlib.domain.sellable import Sellable, SellableTaxConstant from stoqlib.domain.service import Service tax_constant = SellableTaxConstant.get_by_type(TaxType.SERVICE, store) sellable = Sellable(store=store, description=_(u"Delivery")) sellable.tax_constant = tax_constant service = Service(sellable=sellable, store=store) self.set_object(store, "DELIVERY_SERVICE", service)
def create_service(self, description=u'Description', price=10): from stoqlib.domain.sellable import Sellable, SellableTaxConstant from stoqlib.domain.service import Service tax_constant = SellableTaxConstant.get_by_type(TaxType.SERVICE, self.store) sellable = Sellable(price=price, description=description, store=self.store) sellable.tax_constant = tax_constant service = Service(sellable=sellable, store=self.store) return service
def create_delivery_service(self): from stoqlib.domain.sellable import (Sellable, SellableTaxConstant) from stoqlib.domain.service import Service key = u"DELIVERY_SERVICE" store = new_store() tax_constant = SellableTaxConstant.get_by_type(TaxType.SERVICE, store) sellable = Sellable(description=_(u'Delivery'), store=store) sellable.tax_constant = tax_constant service = Service(sellable=sellable, store=store) self._set_schema(key, service.id) store.commit(close=True)
def get_taxes(self): service_tax = SellableTaxConstant.get_by_type(TaxType.SERVICE, self.store) return [(_(u'No tax'), None), (service_tax.description, service_tax)]
def get_taxes(self): service_tax = SellableTaxConstant.get_by_type(TaxType.SERVICE, self.store) return [(_(u'No tax'), None), (service_tax.description, service_tax)]