def unavailable_reason(self, invoice): if invoice.canceltime: if diff_workdays( datetime.now(), invoice.canceltime) < self.unavailable_less_than_days: return "Since this invoice will be automatically canceled in less than {0} working days, it requires the use of a faster payment method.".format( self.unavailable_less_than_days)
def available(self, invoice): if invoice.canceltime: if diff_workdays( datetime.now(), invoice.canceltime) < self.unavailable_less_than_days: return False return True
def unavailable_reason(self, invoice): if invoice.canceltime: if diff_workdays(timezone.now(), invoice.canceltime) < 5: return "Since this invoice will be automatically canceled in less than 5 working days, it requires the use of a faster payment method."
def available(self, invoice): if invoice.canceltime: if diff_workdays(timezone.now(), invoice.canceltime) < 5: return False return True