code: def __set_date(self, value):
          '''
          Sets the invoice date.
          @param value:datetime
          '''
          value = date_to_datetime(value)
          if value > datetime.now() + timedelta(hours=14, minutes=1): #More or less 14 hours from now in case the submitted date was local
              raise ValueError("Date cannot be in the future.")
  
          if self.__due_date and value.date() > self.__due_date:
              raise ValueError("Date cannot be posterior to the due date.")
  
          self.__date = valuf __set_date(self, value):
          '''
          Sets the invoice date.
          @param value:datetime
          '''
          value = date_to_datetime(value)
          if value > datetime.now() + timedelta(hours=14, minutes=1): #More or less 14 hours from now in case the submitted date was local
              raise ValueError("Date cannot be in the future.")
  
          if self.__due_date and value.date() > self.__due_date:
              raise ValueError("Date cannot be posterior to the due date.")
  
          self.__date = value
docs: Sets the invoice date.
          @param value:datetime