Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This would be a welcoming feature when the user sorts the Journal by payment type. An extra column would be added that shows the totals for that payment type.
Comment | File | Size | Author |
---|---|---|---|
#14 | add_a_cash_credit_column-2887519-14.patch | 7.7 KB | shabana.navas |
#4 | with_filter_selected.png | 193.58 KB | shabana.navas |
#4 | no_filter_selected.png | 221.19 KB | shabana.navas |
#3 | add_a_cash_credit_column-2887519-3.patch | 2.73 KB | shabana.navas |
image (1).png | 211.74 KB | shabana.navas |
Comments
Comment #2
shabana.navas CreditAttribution: shabana.navas at Acro Commerce commentedComment #3
shabana.navas CreditAttribution: shabana.navas at Acro Commerce commentedComment #4
shabana.navas CreditAttribution: shabana.navas at Acro Commerce commentedA more elaborate patch that displays a column for all the different payment methods by default. When a filter is selected, it display a column for only that payment type. See attached images.
Comment #5
shabana.navas CreditAttribution: shabana.navas at Acro Commerce commentedOops posted wrong patch in #4. Here's the correct one.
Comment #6
krystalcode CreditAttribution: krystalcode at Acro Commerce commented@shabana.navas I've made some improvements, patch attached. Changes:
1. Some optimizations to avoid looping over payment methods that are not going to be displayed.
2. Related, the sql query was getting the sum for all payments methods, now it does that only for the payment methods we need.
3. Since the module does not explicitly require at least php 5.4, changed one instance of using modern array syntax to the old one.
There is a potential bug introduced here that we should work before considering this done though. There may be different currencies per transaction (maybe even per payment?), and for the Order Total column (sum value) this is currently done by aggregating per currency and displaying all currencies separated with a line break i.e.
$12 USD
$24 CAD
We should be doing the same for the new columns.
There could be the option to convert between currencies, but that would be a separate issue.
Comment #7
krystalcode CreditAttribution: krystalcode at Acro Commerce commentedComment #8
shabana.navas CreditAttribution: shabana.navas at Acro Commerce commentedThanks @krystalcode, the improved patch looks really good. Regarding the potential bug, maybe @tbradbury or @smccabe might have some insights.
Comment #9
krystalcode CreditAttribution: krystalcode at Acro Commerce commented@shabana.navas, I haven't figured out yet how to make a POS payment in different currency so that I can test the patch in multi-currency situations. I've enabled more than one currency in the Currency Settings page, but I don't get a currency option when making a Cash payment. Any ideas?
Comment #10
krystalcode CreditAttribution: krystalcode at Acro Commerce commentedSo, there's not support at the moment for switching currency per POS payment or per POS transaction. If the site's default currency is changed however there can be multiple currencies displayed in the report. The updated patch displays the SUMs per currency in the new payment method columns in the same way done in the Order Total column.
Way to reproduce is to enable more than one currency in the site's configuration, make one or more POS transactions, switch the site's default currency, make one or more POS transactions, go to the report page. Payment method columns should be displaying the SUMs per currency.
Comment #11
shabana.navas CreditAttribution: shabana.navas at Acro Commerce commentedAwesome, code looks really good Dimitris. Btw, can you please post a screenshot of how it looks with the different currency transactions? That'll help everyone understand what we're trying to do without having to test it out.
Comment #12
krystalcode CreditAttribution: krystalcode at Acro Commerce commentedScreenshot attached.
Comment #13
shabana.navas CreditAttribution: shabana.navas at Acro Commerce commentedThere is an issue here where the cash totals need to be minus any change given back and overall, the payment type totals should be only showing 'success' payment transactions as well. Fix coming up on Monday.
Comment #14
shabana.navas CreditAttribution: shabana.navas at Acro Commerce commentedComment #16
smccabe CreditAttribution: smccabe at Acro Commerce commented