Skip to content

Instantly share code, notes, and snippets.

@robertpfeiffer
Created November 19, 2009 13:50
Show Gist options
  • Save robertpfeiffer/238774 to your computer and use it in GitHub Desktop.
Save robertpfeiffer/238774 to your computer and use it in GitHub Desktop.
d = Accounting::Account.find(:first, :conditions => {:name => "Kasse"})
c = Accounting::Account.find(:first, :conditions => {:name => "Budget 1"})
record = Accounting::Record.new(:credit => c,
:debit => d,
:amount => 100)
record.description= "BüroPapier"
record.commit!()
package AutobahnERP::Accounting;
import UMLPrimitiveTypes;
primitive DateTime;
class Account
attribute name : String;
attribute number : Integer;
attribute initial_balance : Integer;
operation assets\? () : Boolean;
operation liabilities\? () : Boolean;
operation expense\? () : Boolean;
operation income\? () : Boolean;
operation credit_sum () : Integer;
operation debit_sum () : Integer;
end;
class Record
reference credit : Account;
reference debit : Account;
attribute description : String;
attribute number : Integer;
attribute amount : Integer;
attribute time : DateTime;
operation commit\! () ;
operation committed\? () : Boolean;
operation reversed () : Record;
end;
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment