(self, at_date=None, immo_period_list=None, **kw)
return None
Returns the calculated remaining amortisation duration for the item.
      It is based on the latest immobilisation period at given date, or now.
Returns the calculated remaining amortisation duration for the item.
      It is based on the latest immobilisation period at given date, or now.
Returns the calculated remaining amortisation duration for the item . It is based on the latest immobilisation period at given date or now .
def getRemainingAmortisationDuration(self, at_date=None, immo_period_list=None, **kw):
    """
      Returns the calculated remaining amortisation duration for the item.
      It is based on the latest immobilisation period at given date, or now.
    """
    if at_date is None:
      at_date = DateTime()
    new_kw = dict(kw)
    if new_kw.has_key('to_date'):
      del new_kw['to_date']
    if new_kw.has_key('at_date'):
      del new_kw['at_date']
    if immo_period_list is None:
      immo_period_list = self.getImmobilisationPeriodList(to_date=at_date, **new_kw)
    if len(immo_period_list) > 0:
      immo_period = immo_period_list[-1]
      initial_date = immo_period['initial_date']
      initial_duration = immo_period.get('initial_duration',0)
      stop_date = immo_period.get('stop_date', at_date)
      consumpted_duration = getRoundedMonthBetween(initial_date, stop_date, True)
      remaining_duration = initial_duration - consumpted_duration
      if remaining_duration < 0:
        remaining_duration = 0
      return int(remaining_duration)
    return None
def getRemainingAmortisationDuration ( self , at_date = None , immo_period_list = None , * * kw ) : if at_date is None : at_date = DateTime ( ) new_kw = dict ( kw ) if new_kw . has_key ( 'to_date' ) : del new_kw [ 'to_date' ] if new_kw . has_key ( 'at_date' ) : del new_kw [ 'at_date' ] if immo_period_list is None : immo_period_list = self . getImmobilisationPeriodList ( to_date = at_date , * * new_kw ) if len ( immo_period_list ) > 0 : immo_period = immo_period_list [ - 1 ] initial_date = immo_period [ 'initial_date' ] initial_duration = immo_period . get ( 'initial_duration' , 0 ) stop_date = immo_period . get ( 'stop_date' , at_date ) consumpted_duration = getRoundedMonthBetween ( initial_date , stop_date , True ) remaining_duration = initial_duration - consumpted_duration if remaining_duration < 0 : remaining_duration = 0 return int ( remaining_duration ) return None