Class: MOCO::ExpenseTemplate
- Inherits:
-
BaseEntity
- Object
- BaseEntity
- MOCO::ExpenseTemplate
- Defined in:
- lib/moco/entities/expense_template.rb
Overview
Represents a MOCO expense template (Zusatzleistungs-Katalog) Pre-defined templates for project additional services
Required attributes for create:
title - String, template name (e.g., "Hosting L")
unit - String, unit type (e.g., "month", "hours", "pieces")
unit_price - Float, price per unit
currency - String, currency code (e.g., "EUR")
Optional attributes:
description - String, detailed description
unit_cost - Float, internal cost per unit
Read-only attributes:
id, revenue_category (Hash), created_at, updated_at
Example:
moco.expense_templates.create(
title: "Monthly Hosting",
description: "Web hosting with monitoring and backup",
unit: "month",
unit_price: 50.0,
unit_cost: 30.0,
currency: "EUR"
)
Instance Attribute Summary
Attributes inherited from BaseEntity
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from BaseEntity
#==, #association, #destroy, #eql?, #has_many, #hash, #id, #initialize, #inspect, #reload, #save, #to_h, #to_json, #update
Constructor Details
This class inherits a constructor from MOCO::BaseEntity
Class Method Details
.entity_path ⇒ Object
31 32 33 |
# File 'lib/moco/entities/expense_template.rb', line 31 def self.entity_path "account/expense_templates" end |
Instance Method Details
#to_s ⇒ Object
35 36 37 |
# File 'lib/moco/entities/expense_template.rb', line 35 def to_s name.to_s end |