I'd like to create a view that shows all orders with an order balance above 0, however I cant seem to access the Commerce: Odrder Balance field in the filters section

Is there an easy way to do this, ordoes itinvolve custom code?

Comments

rszrama’s picture

Status: Active » Closed (won't fix)

It isn't actually possible, because there is no filter based on order balance (since it's calculated, not present in the data in the database, and therefore not queryable).

jeremymcminn’s picture

Ok no worries thanks for that - any ideas on how to create a view of orders with a balance of over 0, or is it just completely impossible? This is quite crucial for a project I am working on, to show orders with an outstanding balance.

ANy help would be appreciated. Thanks!

rszrama’s picture

You can probably rough it out with relationships from the order table to the payment transaction table, but I haven't tried to be able to advise on the implementation.

jeremymcminn’s picture

Ahh that would make sense. Ill give that a go.

Thanks!

jasonrichardsmith@gmail.com’s picture

rszrama:

I wrote this module based on the above request, because my organization wanted the filter/sort ability as well. I have not completed all the code cleanup, but it is a perfectly functioning module.

I wanted to be sure the query calc I am performing is taking care of all the commerce contingencies.

https://www.drupal.org/sandbox/jasonrichardsmith/2446085