dysath / seat-billing

A billing system for mining/PvE costs for corps/alliances
GNU General Public License v2.0
6 stars 6 forks source link

DataTables Wonky: Some columns don't sort, others don't sort properly. #11

Open Eingang opened 5 years ago

Eingang commented 5 years ago

Summary

The AJAX DataTables configuration used provide individual column sorting on the various calculation display pages doesn't work consistently/correctly, some tables don't have column sorting at all, and the text alignment of data is inconsistent.

Discussion

All tables have been enabled for AJAX DataTables column sorting except for Past Billing Invoices (Corporation Mining) and Past Billing Invoices (Corporation PvE). Where column sorting is available, columns holding ISK values, where ISK is present as a cell value, do not sort numerically correctly in ascending or descending order. This is likely because DataTables perceives the column values as being string values when you tack on ISK instead of as doubles or floats.

This theory is supported by Past Billing Invoices (Individual Mining) -> Mining Amount sorting numerically correctly and it's missing the ISK bit unlike the equivalent in other tables. The same issue also likely applies to the Registered Users, Adjusted Value, and Tax Owed (or Tax Due) columns in tables.

Some tables have columns that don't work at all. This seemed to only obviously be the Character Name column on any kind of Individual Mining summary table. No idea why it doesn't seem to work there but it does work in other tables.

A number of column headers (and/or values) are inconsistent. Most tables use Mined Amount, but some use Mining Amount. Some of those columns include ISK in the value and others don't. Some tables have Tax Due but most have Tax Owed. Market Modifier is referred to as Percentage of Market Value and Mining Tax Modifier in places. Most tables use Tax Rate but some use Mining Tax.

All columns with ISK or percentage values should have two decimal places and the values should be right-aligned in the table. Sometimes that seems to be the case, but not consistently. For example, Current Billing Summary (Corporation PvE) -> Total Bounties looks to be right-aligned, but Current Billing Summary (Individual Mining) -> Tax Due isn't. Obviously Corporation and Character Name don't need to be right-aligned. The rest of the columns probably should be.

Problem Summary

Handy summary of problems on a page-by-page, column-by-column basis:

Current Billing Summary (Corporation Mining)

Current Billing Summary (Corporation PvE)

Current Billing Summary (Individual Mining)

Past Billing Invoices (Corporation Mining)

Past Billing Invoices (Corporation PvE)

Past Billing Invoices (Individual Mining)

Other Comments

OK, technically the right-alignment isn't a sorting issue, but rather a formatting issue. But it's related. That's my story and I'm sticking to it.

As for fixing things… For the ISK-related issues, you might be able to use the Any Number DataTables plug-in. Or… simpler: Put the currency unit in the column header instead of in each of the values, and then the default sort will likely work for ISK columns. No clue on the Registered Users one. Sorry!