intra_app/app/models/p_ship_bill.rb
Nicolas Bally 761e075bb6 initial
2018-11-08 21:47:30 +01:00

18 lines
313 B
Ruby

class PShipBill < ActiveRecord::Base
belongs_to :p_fournisseur
has_many :p_ship_bill_lines
accepts_nested_attributes_for :p_ship_bill_lines
before_save do
self.a_ok_total = 0.0
self.p_ship_bill_lines.each do |psbl|
self.a_ok_total += psbl.a_ok_total
end
end
end