This should be defined by payment module but is actually used in order views.
As the balance field doesn't exist in DB, we should figure out an alternative, maybe a separate table for order totals.

Comments

rszrama’s picture

Title: Add a views filter for balance in order » Provide a way to track totals of things (like payments) and filter Views by them
Component: Views integration » Contributed modules
Status: Active » Postponed
Issue tags: +dcsprint6

So, I was thinking about this issue last night. I think I'll go ahead and add a Views field to display the balance of the order right now, but I'm not sure how to get around requiring a separate table to allow for filtering. As such, I don't think we should approach that in core just yet. I'm going to flag this for review at the contrib sprint (dcsprint6), because I think we can perhaps create a "totals" module that tracks other types of totals (payment totals, price component totals, etc.). If we do it well, we can maybe move it to core in 2.x to handle even the Order Total.

So... right now I'll commit the Views field and maybe a condition to check the balance of an order and an event that gets triggered the first time the balance of an order reaches 0. For the actual original post, I'm postponing this issue.

(EDIT: Silly me, we already have the Views field.. so I'll just add the Rule stuff.)

rszrama’s picture

I've just committed the Rules condition for checking the balance of an order and an event for reacting "When an order is first paid in full" (with a related hook_commerce_payment_order_paid_in_full()). This will only be invoked the first time an order's balance drops to 0 or below. The redefined issue per my thoughts in #1 are a separate issue and will keep this open.

rickmanelius’s picture

Hi Ryan,

I've read this thread and #1031058: Payment views missing handlers. Do you know if any contrib maintainer/module picked this up?

bojanz’s picture

Issue summary: View changes
Status: Postponed » Closed (outdated)