@frappe.whitelist()
def get_due_date(posting_date, party_type, party, company):
 due_date = None
 if (posting_date and party):
  due_date = posting_date
  (credit_days_based_on, credit_days) = get_credit_days(party_type, party, company)
  if ((credit_days_based_on == u'Fixed Days') and credit_days):
   due_date = add_days(posting_date, credit_days)
  elif (credit_days_based_on == u'Last Day of the Next Month'):
   due_date = (get_first_day(posting_date, 0, 2) + datetime.timedelta((-1))).strftime(u'%Y-%m-%d')
 return due_date

@ frappe . whitelist ( ) def get_due_date ( posting_date , party_type , party , company ) : due_date = None if ( posting_date and party ) : due_date = posting_date ( credit_days_based_on , credit_days ) = get_credit_days ( party_type , party , company ) if ( ( credit_days_based_on == u'Fixed Days' ) and credit_days ) : due_date = add_days ( posting_date , credit_days ) elif ( credit_days_based_on == u'Last Day of the Next Month' ) : due_date = ( get_first_day ( posting_date , 0 , 2 ) + datetime . timedelta ( ( - 1 ) ) ) . strftime ( u'%Y-%m-%d' ) return due_date
set due date = posting date + credit days .