This repository has been archived on 2021-11-24. You can view files and clone it, but cannot push or open issues or pull requests.
phone_app/app/models/p_ship_bill.rb
2021-08-23 10:26:02 +02:00

18 lines
312 B
Ruby

class PShipBill < ApplicationRecord
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