Module: Invoicexpress::Client::Charts

Included in:
Invoicexpress::Client
Defined in:
lib/invoicexpress/client/charts.rb

Instance Method Summary collapse

Instance Method Details

#invoicing_chart(options = {}) ⇒ Array<Invoicexpress::Models::Chart>

Returns the invoicing chart data.

Returns:

Raises:

  • Invoicexpress::Unauthorized When the client is unauthorized



9
10
11
12
# File 'lib/invoicexpress/client/charts.rb', line 9

def invoicing_chart(options = {})
  params = { :klass => Invoicexpress::Models::Chart }
  get("api/charts/invoicing.xml", params.merge(options))
end

#quarterly_results(year = Date.today.year, options = {}) ⇒ Array<Invoicexpress::Models::TopClient>

This method allows you to obtain the quarterly results. Each quarter has: The amount invoiced before taxes Taxes amount Year to date (YTD) which consists on the difference between the invoiced on the current quarter less the invoiced on the same quarter one year ago

Parameters:

  • year (Integer) (defaults to: Date.today.year)

    By default year is the current year. It should obey the format YYYY (ex.: 2010)

Returns:

Raises:

  • Invoicexpress::Unauthorized When the client is unauthorized



50
51
52
53
54
# File 'lib/invoicexpress/client/charts.rb', line 50

def quarterly_results(year=Date.today.year , options = {})
  #params = { :klass => Invoicexpress::Models::QuaterlyResult }
  params = {  :klass => Invoicexpress::Models::QuarterlyResult, :year => year }
  get("api/charts/quarterly-results.xml", params.merge(options))
end

#top_clients(options = {}) ⇒ Array<Invoicexpress::Models::TopClient>

Returns your 5 top clients for which you have invoiced more.

Returns:

Raises:

  • Invoicexpress::Unauthorized When the client is unauthorized



27
28
29
30
# File 'lib/invoicexpress/client/charts.rb', line 27

def top_clients(options = {})
  params = { :klass => Invoicexpress::Models::TopClient }
  get("api/charts/top-clients.xml", params.merge(options))
end

#top_debtors(options = {}) ⇒ Array<Invoicexpress::Models::TopClient>

Returns your 5 top debtors. Values are calculated based on the due amount.

Returns:

Raises:

  • Invoicexpress::Unauthorized When the client is unauthorized



36
37
38
39
# File 'lib/invoicexpress/client/charts.rb', line 36

def top_debtors(options = {})
  params = { :klass => Invoicexpress::Models::TopDebtor }
  get("api/charts/top-debtors.xml", params.merge(options))
end

#treasury_chart(options = {}) ⇒ Array<Invoicexpress::Models::Chart>

Returns the treasury chart data.

Returns:

Raises:

  • Invoicexpress::Unauthorized When the client is unauthorized



18
19
20
21
# File 'lib/invoicexpress/client/charts.rb', line 18

def treasury_chart(options = {})
  params = { :klass => Invoicexpress::Models::Chart }
  get("api/charts/treasury.xml", params.merge(options))
end