Permalink
Browse files

Add Helper to Access Summary Data in Credit Notes

  • Loading branch information...
1 parent f583fe6 commit e69c7925e7289e31fd32e0d049d23f87858f14eb @waynerobinson committed Apr 15, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 lib/xeroizer/models/credit_note.rb
@@ -70,6 +70,18 @@ class CreditNote < Base
public
+ # Access the contact name without forcing a download of
+ # an incomplete, summary credit note.
+ def contact_name
+ attributes[:contact] && attributes[:contact][:name]
+ end
+
+ # Access the contact ID without forcing a download of an
+ # incomplete, summary credit note.
+ def contact_id
+ attributes[:contact] && attributes[:contact][:contact_id]
+ end
+
# Swallow assignment of attributes that should only be calculated automatically.
def sub_total=(value); raise SettingTotalDirectlyNotSupported.new(:sub_total); end
def total_tax=(value); raise SettingTotalDirectlyNotSupported.new(:total_tax); end

0 comments on commit e69c792

Please sign in to comment.