Monday, July 5, 2010

Another stab at "invoice"

I now dislike my earlier text-based notion of macros. The macro system should be native, and more importantly, needs to be at a semantic level. That is, we are describing to Class::Declarative what sort of node it should be building.

With this in mind, here's my current notion:
unit invoice
has customer => customer
has data items (description, price, unit, subtotal)
assert usually count(items) > 0
calc total = sum(price) from items
has currency => currency default USD
has comments

I need to find a more specifically macro-oriented structural definition and express it like this.

No comments:

Post a Comment