Scenario: An admin goes in and adjusts a payment amount manually:

Problem: The income stats for the individual forms remain unchanged:

The total income does update here: https://github.com/easydigitaldownloads/Easy-Digital-Downloads/blob/master/includes/admin/payments/actions.php#L301
... But the individual downloads are not also updated.
@DevinWalker That's intentional. The total purchase price is the accumulated amounts from all items.
To reduce the amount on the item, you would need to remove and re-add the item. That would trigger the stats change.
That's a rather crappy user experience though. Perhaps we should support changing the amounts on individual items?
Gotcha. For Give it makes sense that we have the ability to adjust the total based on this field because there's only ever one donation form per transaction. For EDD, there can be one or many downloads per transaction. Perhaps something like this would be better:

Clicking the "Edit Amount" would make the total editable within an input field. The user then could click "Update Payment" and see the new totals.
I'd prefer the amount just be shown as an input field. Seems more intuitive to me.
Yeah I'm overthinking it...
No worries :)
@DevinWalker @pippinsplugins Retitled this one. I think we'll work towards a 're-price' column that allows the individual product price to be updated, therefore allowing us to alter the download stats.
Changed this to high priority as it's a blocker to getting us accurate reports. Right now if a partial refund is processed, there is no way to update the earnings on the product, giving us inaccurate stats.
So this starts bringing in a few other issues we'll probably have to resolve at the same time.
1) We'll need to account for quantities, and allow per unit price changes
2) We'll also probably need to add the tax on the payment into an editable field
3) Since we would then have an item price, and a tax field, maybe we'd be best to have a 'total' column that's not editable but is calculated based off the item price * quantities + tax?
Just laying out some ideas, adding an editable field here opens a few other things we'll have to improve, as long as we're aware of that change.
I vote three fields:
Total can be ineditable.
Ok i'll work that up.
This reworks the display of the purchased items of the view-order-details.php for admin view of payments. I've reworked the CSS and markup as well as updated EDD_Payment to allow modifying specific aspects of cart items.
EDD_Payment::modify_cart_item which allows editing the item_price, quantity, discount, and tax of an item. Total is calculated based off this information.quantity and item_pricetax and discounttotal column when related inputs are modifiedincludes/admin/payments/actions.php to determine if an item was modified, so it can use EDD_Payment::modify_cart_itemNew UI:

UI looks really slick @cklosowski 👍
Ok, this is ready for some testing @easydigitaldownloads/core-devs. Both from a UI/UX perspective, and from a functional standpoint. Be sure to clear any local cache of the .js files as there have been some hefty modifications to the selectors used.
@cklosowski this is looking really good!
Just found an issue: download earning stats are not incremented / decremented properly.
When I decrement the quantity, say from 4 to 3, on an item and click save, the earnings stats _increase_ instead of decrease.
Another item: adjusting the item quantities does not trigger the Recalculate button to show up. Adjusting the item price does show it properly.
Looks like amounts changed by item quantities do not get taken into account during Recalculate as well.
Once this is all working (don't worry about it yet), we'll have to work on some small screen styling:

yeah, minimal screens just need some updates to it. I tested this up to a 11" Macbook Air.
Looks like stats changes are backwards for taxes too. I added tax to a product that previously had no taxes and my earnings went _down_ instead of up.
@pippinsplugins @sunnyratilal ready for more.
Just tested and it all seems to be working fine on my end
Just FYI I'm working on the final style cleanup here. I've made slight changes to tidy up the full view before the moving to the responsive view, though. Doesn't look like much but if you have beef with any of it, please let me know. For the most part, I just got everything lined up with even spacing everywhere. Biggest change (the only thing you may not like) is what I did with the price options:

Text wrap with the product title and price option is pretty common. In my opinion, it's ugly. I think this helps pretty up the wrap since it's almost inevitable. Also makes for much easier scanning of the products and their price options.
Moving on to responsiveness so just drop a line if you think I need to reverse that.
Looks great from the screenshots. Will check it tonight when back at the
desk.
On Jan 23, 2017 7:41 PM, "Sean Davis" notifications@github.com wrote:
Just FYI I'm working on the final style cleanup here. I've made slight
changes to tidy up the full view before the moving to the responsive view,
though. Doesn't look like much but if you have beef with any of it, please
let me know. Biggest change (the only thing you may not like) is what I did
with the price options:[image: screenshot 2017-01-23 16 39 16]
https://cloud.githubusercontent.com/assets/2359131/22229115/815037f2-e18a-11e6-8dd6-474b5e9d6565.pngText wrap with the product title and price option is pretty common. In my
opinion, it's ugly. I think this helps pretty up the wrap since it's almost
inevitable. Also makes for much easier scanning of the products and their
price options.Moving on to responsiveness so just drop a line if you think I need to
reverse that.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/easydigitaldownloads/easy-digital-downloads/issues/3802#issuecomment-274665455,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABU2LMSd_qF6fBtt3GUi_mmw2R1kwU0Cks5rVUjOgaJpZM4F-sOa
.
Alright, this is up and ready for @cklosowski's JS to make it all work again because I broke it. Looks pretty good, though.

@SDavisMedia @pippinsplugins @sunnyratilal this is ready for some testing.
The box title along with the column title seems a bit redundant:

What if we remove the box title entirely?
My personal preference would be rename Download Purchased to simply Download
I think Purchased Downloads can definitely go.
I've tested and there's some great work that's happened here.
Kudos @cklosowski and @SDavisMedia! 💯
@SDavisMedia @pippinsplugins @sunnyratilal Yes?

I like it but as soon as responsiveness kicks in, we're gonna lose those headings as I move them down to just above the fields for clarity on mobile. So what we need to do is keep everything we have and hide things when necessary. So for full screen, it should look like what you have there but the main heading can stay hidden. Then when responsive, the headings you see there are already set to go away and the main heading should come back.
I can whip that up on your green light.
Go for it @SDavisMedia. I'll leave it up to you. I won't commit what I have since it sounds like deleting the markup for the h3 is not what's needed (which is what I did :P )
@cklosowski that'll do it
Looks amazing @SDavisMedia:
Larger screens:

Responsive:

I'm good with this @easydigitaldownloads/core-devs if you guys are.
Yep! Happy here!
I'm _thrilled_ here. This is as perfect as it's going to get! Merging.
Most helpful comment
I'm good with this @easydigitaldownloads/core-devs if you guys are.