Exemple #1
0
 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)
Exemple #3
0
 def lot_minValue(self):
     return Value(
         dict(
             amount=self.minValue.amount,
             currency=self.__parent__.minValue.currency,
             valueAddedTaxIncluded=self.__parent__.minValue.valueAddedTaxIncluded,
         )
     )
Exemple #4
0
 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,
             ))
Exemple #5
0
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))
Exemple #7
0
 def contract_amountPaid(self):
     if self.amountPaid:
         return Value(
             dict(amount=self.amountPaid.amount,
                  currency=self.value.currency,
                  valueAddedTaxIncluded=self.value.valueAddedTaxIncluded))
Exemple #8
0
 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