Class: LedgerSync::NetSuite::DashboardURLHelper

Inherits:
Ledgers::DashboardURLHelper
  • Object
show all
Defined in:
lib/ledger_sync/netsuite/dashboard_url_helper.rb

Instance Method Summary collapse

Instance Method Details

#resource_pathObject

rubocop:disable Metrics/CyclomaticComplexity



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ledger_sync/netsuite/dashboard_url_helper.rb', line 6

def resource_path # rubocop:disable Metrics/CyclomaticComplexity
  @resource_path = case resource
                   when NetSuite::Account
                     "/app/accounting/account/account.nl?id=#{resource.ledger_id}"
                   when NetSuite::Currency
                     "/app/common/multicurrency/currency.nl?id=#{resource.ledger_id}"
                   when NetSuite::Customer, NetSuite::Vendor
                     "/app/common/entity/entity.nl?id=#{resource.ledger_id}"
                   when NetSuite::Department
                     "/app/common/otherlists/departmenttype.nl?id=#{resource.ledger_id}"
                   when NetSuite::Deposit, NetSuite::Invoice
                     "/app/accounting/transactions/transaction.nl?id=#{resource.ledger_id}"
                   when NetSuite::LedgerClass
                     "/app/common/otherlists/classtype.nl?id=#{resource.ledger_id}"
                   when NetSuite::Subsidiary
                     "/app/common/otherlists/subsidiarytype.nl?id=#{resource.ledger_id}"
                   end
end