def tender_minValue(self): return (Value( dict( amount=sum([i.minValue.amount for i in self.lots]), currency=self.minValue.currency, valueAddedTaxIncluded=self.minValue.valueAddedTaxIncluded, )) if self.lots else self.minValue)
def tender_minimalStep(self): return (Value( dict( amount=min([i.minimalStep.amount for i in self.lots]), currency=self.minimalStep.currency, valueAddedTaxIncluded=self.minimalStep.valueAddedTaxIncluded, )) if self.lots else self.minimalStep)
def lot_minValue(self): return Value( dict( amount=self.minValue.amount, currency=self.__parent__.minValue.currency, valueAddedTaxIncluded=self.__parent__.minValue.valueAddedTaxIncluded, ) )
def serialize_weightedValue(self): if self.weightedValue: value = self.value or self.weightedValue return Value( dict( amount=self.weightedValue.amount, currency=value.currency, valueAddedTaxIncluded=value.valueAddedTaxIncluded, ))
def calculate_agreement_contracts_value_amount(request, tender): agreement = tender.agreements[0] tender_items = dict((i.id, i.quantity) for i in tender.items) for contract in agreement.contracts: value = Value() value.amount = 0 value.currency = contract.unitPrices[0].value.currency value.valueAddedTaxIncluded = contract.unitPrices[0].value.valueAddedTaxIncluded for unitPrice in contract.unitPrices: if unitPrice.relatedItem in tender_items: value.amount += unitPrice.value.amount * tender_items[unitPrice.relatedItem] value.amount = round(value.amount, 2) contract.value = value tender.lots[0].value = max([contract.value for contract in agreement.contracts], key=lambda value: value.amount) tender.value = tender.lots[0].value
def lot_minimalStep(self): return Value( dict(amount=self.minimalStep.amount, currency=self.__parent__.minimalStep.currency, valueAddedTaxIncluded=self.__parent__.minimalStep. valueAddedTaxIncluded))
def contract_amountPaid(self): if self.amountPaid: return Value( dict(amount=self.amountPaid.amount, currency=self.value.currency, valueAddedTaxIncluded=self.value.valueAddedTaxIncluded))
def auction_minimalStep(self): return Value(dict(amount=0))
def auction_value(self): return Value( dict(amount=sum([i.value.amount for i in self.lots]), currency=self.value.currency, valueAddedTaxIncluded=self.value.valueAddedTaxIncluded) ) if self.lots else self.value