Ejemplo n.º 1
0
 def tender_guarantee(self):
     if self.lots:
         lots_amount = [i.guarantee.amount for i in self.lots if i.guarantee]
         if not lots_amount:
             return self.guarantee
         guarantee = {'amount': sum(lots_amount)}
         lots_currency = [i.guarantee.currency for i in self.lots if i.guarantee]
         guarantee['currency'] = lots_currency[0] if lots_currency else None
         if self.guarantee:
             guarantee['currency'] = self.guarantee.currency
         return Guarantee(guarantee)
     else:
         return self.guarantee
Ejemplo n.º 2
0
 def lot_guarantee(self):
     if self.guarantee:
         currency = self.__parent__.guarantee.currency if self.__parent__.guarantee else self.guarantee.currency
         return Guarantee(dict(amount=self.guarantee.amount, currency=currency))