In purchase order while we are doing first tranasction the discount is not taking

In purchase order while we are doing first transaction the discount is not taking ,but while we are doing second transaction then the discount is taking (is this is an error or any thing)