Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError in Debit_invoices#new #8

Closed
enyachoke opened this issue Jun 16, 2013 · 6 comments
Closed

RuntimeError in Debit_invoices#new #8

enyachoke opened this issue Jun 16, 2013 · 6 comments

Comments

@enyachoke
Copy link

RuntimeError in Debit_invoices#new

Showing /home/achachiez/Code/Ruby/Rails/bookyt/app/views/line_items/_list_form.html.haml where line #2 raised:

Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id

Extracted source (around line #2):

1: %h3= t('title.line_items')
2: %table#line_items.table.table-striped{'data-direct-account-id' => resource.direct_account.id, 'data-direct-account-factor' => resource.direct_account_factor}
3: %thead
4: = render 'line_items/list_header', :invoice => invoice
5: %tbody.sortable

Trace of template inclusion: app/views/debit_invoices/_form.html.haml, app/views/application/new.html.haml

Rails.root: /home/achachiez/Code/Ruby/Rails/bookyt
Application Trace | Framework Trace | Full Trace

app/views/line_items/_list_form.html.haml:2:in _app_views_line_items__list_form_html_haml___421911651060381592_66039120' app/views/debit_invoices/_form.html.haml:19:inblock in _app_views_debit_invoices__form_html_haml__3178882032653932038_55522860'
app/views/debit_invoices/_form.html.haml:1:in _app_views_debit_invoices__form_html_haml__3178882032653932038_55522860' app/views/application/new.html.haml:5:in_app_views_application_new_html_haml__2359191747295712144_55500660'
app/controllers/debit_invoices_controller.rb:41:in new' config/initializers/quiet_assets.rb:7:incall_with_quiet_assets'

Request

Parameters:

{"locale"=>"en"}

@huerlisi
Copy link
Owner

This is because of some hardcoded accounts for debit/credit invoices. There actually need to be some accounts with numbers '1100', '3200', ''2000", and '4000' to get invoices working correctly.

These values are hardcoded in the DebitInvoice an CreditInvoice models. But it should actually be a configuration in the Tenant.

To get it working fast, you might try to load the seed data for Switzerland. Start the console and run
load "db/seeds/locales/de-CH.rb"

Cheers
Simon

@enyachoke
Copy link
Author

Thank I was doubting that but I was not sure. Thanks a million. I also signed-up for an account on the issue tracker.

@enyachoke
Copy link
Author

So any plans to fix this. Or I should just clone the project and try to fix it myself

@huerlisi
Copy link
Owner

Working on a fix. But contributions are very welcome:-)

Probably best to file further issues on github, it's a hazzle to sign up on our redmine... Thanx for doing so, anyway:-)

@enyachoke
Copy link
Author

Thanks.

On Mon, Jun 17, 2013 at 11:28 PM, Simon Hürlimann
notifications@github.comwrote:

Working on a fix. But contributions are very welcome:-)

Probably best to file further issues on github, it's a hazzle to sign up
on our redmine... Thanx for doing so, anyway:-)


Reply to this email directly or view it on GitHubhttps://github.com//issues/8#issuecomment-19572370
.

Computer Science Student At Kabarak University.
Systems developer at Bespoke Systems.
Android and Appengine applications developer.
Founder Of Pyxis Kenya Limited.
GDG Kabarak lead.

@huerlisi
Copy link
Owner

Sorry for the long delay.

I took the time to implemented a more generic solution to select the relevant accounts used for invoices. You can now configure tags in the Account view/form. Those will be used as debit/credit accounts for new credit and debit invoices. It should now also not raise an error if you didn't specify them, but you would have to manually set the accounts for each line item in this case.

You should now be able to create invoices. There's an open issue regarding printing/PDF download for debit invoices. It gives an error if you don't have a bank account with the relevant bank information configured.

I'll fix that issue soonish, but it should be quite simple to add a check if such a BankAccount/Bank is configured and otherwise leave out this information. So feel free to fork and hack;-)

mur-wtag pushed a commit to wtag/bookyt that referenced this issue Jan 19, 2017
…d-method-fiscal-years

AG-735 NoMethodError: undefined method `fiscal_years' for nil:NilClass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants