Discount rule based on amount

in our company discount will be applicable in 4 conditions
1, based on quantity for customer X if he buy > some amount quantity he will get this much discount based on percentage ex, if he buy > 10 quantity he will get 2% discount(it works fine on erpnext)
2, based on number of quantity he purchased he will get some amount free,
ex, if he buy 10 he will get 1 free
if he buys 15 he will get 2 free
how could this work on ERPnext,i couldnt find it
3, based on total sales based on amount not quantity
if he buys more than 100000 USD he will get 2% discount
if he buys more than 1000000 USD he will get 4% discount and so on
how could this work on ERPnext i couldnt find it
4, based on period
if some customer buys this much amount total in the period of one month but in different days he will get some percent discount,
so how can i make this kind of rules on ERPNext?
thanks in advance

Check the following links,

  1. Applying discounts

  2. Pricing Rule

@Pawan
thanks for your replay
but i have seen the above links they are working only for no1 rule,hey dont work based on amount.thanks