AR Payment term due 15th or 30th of the following month

I need some help wrapping my head around creating this AR Terms Code.  

This is what I need:

Invoice dated 1st - 15th payable 15th following month

Invoices 16th-31st payable 30th following month

Thanks for any suggestion!