Coder Social home page Coder Social logo

Can't order result about xeroizer HOT 6 CLOSED

waynerobinson avatar waynerobinson commented on August 17, 2024
Can't order result

from xeroizer.

Comments (6)

waynerobinson avatar waynerobinson commented on August 17, 2024

The values for order should be the same as the attribute names in the actual API at the moment unfortunately.

So what you're probably looking for is:

xero_connection.Account.all(order: "Name")

from xeroizer.

bpinto avatar bpinto commented on August 17, 2024

I had tried that but it doesn't work:

account.xero_connection.Account.all(order: "Name").map(&:name)
=> ["Business Bank Account",
 "Business Savings Account",
 "Sales",
 "Other Revenue",
 "Interest Income",
 "Purchases",
 "Advertising",
 "Bank Fees",
 "Cleaning",
 "Consulting & Accounting",
 "Depreciation",

I could only make it work when I changed the gem to use order instead of orderBy.

from xeroizer.

waynerobinson avatar waynerobinson commented on August 17, 2024

I'm not sure what the issue is at your end. The Gem doesn't make use of orderBy. The code for the ordering is in lib/xeroizer/record/base_model_http_proxy.rb

My version of the test code returns accounts in the correct order:

Xero = Xeroizer::PrivateApplication.new(ACCESS_KEY, ACCESS_SECRET, XERO_PRIVATE_KEY)
accounts = Xero.Account.all(order: "Name")
ap accounts.map(&:name)

Returns:

[
    [ 0] "Accounts Payable",
    [ 1] "Accounts Receivable",
    [ 2] "Accrued Liabilities",
    [ 3] "Advertising",
    [ 4] "Bank Fees",
    [ 5] "Bank Revaluations",
    [ 6] "Business Bank Account",
    [ 7] "Business Savings Account",
    [ 8] "Cleaning",
    [ 9] "Clearing Account",
    [10] "Commission",
    [11] "Computer Equipment",
    [12] "Consulting & Accounting",
    [13] "Depreciation",
    [14] "Entertainment",
    [15] "Freight & Courier",
    [16] "General Expenses",
    [17] "GST",
    [18] "Historical Adjustment",
    [19] "Income Tax Expense",
    [20] "Income Tax Payable",
    [21] "Insurance",
    [22] "Interest Expense",
    [23] "Interest Income",
    [24] "Legal expenses",
    [25] "Less Accumulated Depreciation on Computer Equipment",
    [26] "Less Accumulated Depreciation on Office Equipment",
    [27] "Light, Power, Heating",
    [28] "Loan",
    [29] "Motor Vehicle Expenses",
    [30] "Office Equipment",
    [31] "Office Expenses",
    [32] "Other Revenue",
    [33] "Owner A Drawings",
    [34] "Owner A Funds Introduced",
    [35] "Owner A Share Capital",
    [36] "PAYG Withholdings Payable",
    [37] "Prepayments",
    [38] "Printing & Stationery",
    [39] "Purchases",
    [40] "Realised Currency Gains",
    [41] "Rent",
    [42] "Repairs and Maintenance",
    [43] "Retained Earnings",
    [44] "Revenue Received in Advance",
    [45] "Rounding",
    [46] "Sales",
    [47] "Subscriptions",
    [48] "Superannuation",
    [49] "Superannuation Payable",
    [50] "Suspense",
    [51] "Telephone & Internet",
    [52] "Tracking Transfers",
    [53] "Travel - International",
    [54] "Travel - National",
    [55] "Unpaid Expense Claims",
    [56] "Unrealised Currency Gains",
    [57] "Wage Payables",
    [58] "Wages and Salaries"
]

from xeroizer.

waynerobinson avatar waynerobinson commented on August 17, 2024

Ahh, but my code is currently using the HEAD version of Xeroizer.

from xeroizer.

waynerobinson avatar waynerobinson commented on August 17, 2024

I have bumped the Gem version with all the latest patches in it. If you update Xeroizer to 2.5.15 then this issue should be fixed.

from xeroizer.

bpinto avatar bpinto commented on August 17, 2024

Oh thanks!

from xeroizer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.