app/models/billing/charge.rb in billing-0.1.8 vs app/models/billing/charge.rb in billing-0.1.9
- old
+ new
@@ -23,9 +23,13 @@
after_initialize do
self.value = price if self.new_record? #unless modifier.present? #bill validation will update modified value
end
+ def qtyprice
+ (qty || 1) * price
+ end
+
def find_tax_group_mapping_for(fiscal_driver) # optimize and remove me!
if tax_groups.present? && fiscal_driver.fiscal? #if billable provides tax groups (delegate)
tax_group = tax_groups.find_by(percent_ratio: tax_ratio)
tax_group.tax_group_fiscal_driver_mappings.find_by(extface_driver_id: fiscal_driver.id).try(:mapping) if tax_group
end