In the UI they make it really easy to send a state...
# suitescript
m
In the UI they make it really easy to send a statement for previous month (first day of previous month..), but in code you have to calculate the dates yourself