search for: total_cost

Displaying 3 results from an estimated 3 matches for "total_cost".

2006 Jul 27
5
Calculate methods on attr_accessor objects
Is it possible to use the calculate methods (sum, etc.) on attr_accessor attributes? Ie: Class Item < ActiveRecord::Base attr_accessor :total_cost def total_cost @total_cost = self.cost_unit * self.amount end calling Item.sum(:total_cost) or Item.sum(''total_cost'') both return a unknown column ''total_cost'' mysql error. I thought that active record considers attr_accessor objects the same as column...
2006 May 19
2
How to run direct DML (insert or update)
I want when the user clicks on a button on the browser "Perform monthly billing run" the controller to lanch a sql DML statment to be called (in the model?) than runs something like "insert into billing (item, qnt, total_cost, billing_run_timestamp select item, qnt, item*cost as total_cost, timestamp from services where service_end_date is null" How can I run a DML (insert, update, delete) direct sql statement ? -- Posted via http://www.ruby-forum.com/.
2009 Jan 21
2
CDR 0.00 duration
Hi I am using Trixbox 2.4 and PRI lines..on the CDR i see many calls that have duration of 0 seconds, but they are still shown as ANSWERED . how come its possible when duration is 0.00 ? Are the callers billed for such calls ? Rgds Sriram -------------- next part -------------- An HTML attachment was scrubbed... URL: