Fix pending 'day sales'

Fix previous code (previous merge from @w0www )