Payment subtotal amount fixed

Function edd_get_payment_subtotal() should return the amount without any
discounts applied, that means it can not take total amount and just
subtract the taxes, like it was doing.
Fix for issue with wrong price, tax and discount when quantity greater than 1 and tax is applied after discount.
Remove urlencode_deep()
Make country code for Maldives uppercase
Merge pull request #2484 from elliott-stocks/patch-3

Make country code for Maldives uppercase
Change span class for edd_cart_subtotal

The other spans are appended with "_amount" to make it easier to target the values.
Merge pull request #2488 from elliott-stocks/patch-4

Change span class for edd_cart_subtotal
Remove unused  var from textarea callback
Merge
your commit message
Merge pull request #2508 from NikV/master

Consistency with "Download Categories" in Metaboxes
New Screenshot
Merge pull request #2509 from NikV/master

New Screenshot for edit-dwonload.png
Revert "New Screenshot for edit-dwonload.png"
Merge pull request #2510 from easydigitaldownloads/revert-2509-master

Revert "New Screenshot for edit-dwonload.png"
Revised-Screenshot
Merge pull request #2512 from NikV/master

Resubmitting Screenshot for edit-download.png
Allow empty fields to take into account custom template

If for some reason a custom shortcode template doesn't use display name, first/last name or email address it results in a undefined index. Ideally these should be optional and if they aren't provided they should fall back to the original values.
Merge pull request #2447 from AlexMyr/master

#2446 Fix for issue with wrong price, tax and discount when quantity > 1 and tax is applied after discount.
Bug in EDD reports if columns are deleted

I'm using the edd_export_csv_cols_payments filter to remove (and add - but I don't think that's important) some columns from a report with "unset( $columns['address1'] )" etc.

The bug showed itself in the omission of a comma between two fields in the CSV file (in my case I was looking at the products report, but I think it probably affects other reports too). As a result, when you import the CSV file into a spreadsheet, you get two fields joined in the same cell. Delete one field & it's the last comma missing in each row (between fields n & 'n-1'). Each additional field you delete moves the missing comma one field to the left.

Looking at the code here, if you delete any columns from the report then the number of 'columns' in the data array ($data) is greater than the number in the column headers array ($cols).

The loop on line 147 goes through each element in the data, then line 149 discards any items which aren't in the required output columns.

The code manages a counter $i which tracks when you get to the final column (judged by the number of column headers) and decides whether or not to add a comma after the value.

The OLD code incremented the counter regardless of whether the data value was output into the report. This has to be wrong - you only want to advance the counter if you've actually outputted the value as discarded fields don't affect the layout.

Also the "+1" in the comparison is at odds with the code on line 100 - I don't think the offset is needed.