erpnext
erpnext copied to clipboard
fix: coupon code validation logic
Ensure errors are thrown if the coupon validity hasn't started, has expired, or if the maximum usage has been exceeded.
Previously, the condition was always satisfied with if coupon.valid_from:, which prevented the elif condition from being reached.