Created
November 19, 2009 13:50
-
-
Save robertpfeiffer/238774 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!() | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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