def __str__(self): return "{n} x {part} from {supplier} (for {po})".format( n=decimal2string(self.quantity), part=self.part.SKU if self.part else 'unknown part', supplier=self.order.supplier.name if self.order.supplier else _('deleted'), po=self.order)
def price_range(self): """ Return the price-range for this BOM item. """ prange = self.sub_part.get_price_range(self.quantity) if prange is None: return prange pmin, pmax = prange if pmin == pmax: return decimal2string(pmin) # Convert to better string representation pmin = decimal2string(pmin) pmax = decimal2string(pmax) return "{pmin} to {pmax}".format(pmin=pmin, pmax=pmax)
def __str__(self): if self.part.trackable and self.serial: s = '{part} #{sn}'.format(part=self.part.full_name, sn=self.serial) else: s = '{n} x {part}'.format(n=helpers.decimal2string(self.quantity), part=self.part.full_name) if self.location: s += ' @ {loc}'.format(loc=self.location.name) return s
def __str__(self): return "{q} x {part}".format(q=decimal2string(self.quantity), part=str(self.part.full_name))
def __str__(self): return "Build {q} x {part}".format(q=decimal2string(self.quantity), part=str(self.part))
def decimal(x, *args, **kwargs): """ Simplified rendering of a decimal number """ return decimal2string(x)
def __str__(self): return "{n} x {child} to make {parent}".format( parent=self.part.full_name, child=self.sub_part.full_name, n=helpers.decimal2string(self.quantity))
def part_allocation_count(build, part, *args, **kwargs): """ Return the total number of <part> allocated to <build> """ return decimal2string(build.getAllocatedQuantity(part))
def multiply(x, y, *args, **kwargs): """ Multiply two numbers together """ return decimal2string(x * y)