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/stock_movement_line.rb
Philippe b32ddd37f5 Add front validations for p_article form, add p_article to stock_movement, add AJAX on price_line update method
TODO:
- AJAX for add_p_article and add_stock_movement_p_article in stock_movement views
- Fix select p_article with in stock_movement partial view
- Fix query to display available p_article in stock_movement partial
2021-11-23 20:20:41 +01:00

23 lines
624 B
Ruby

class StockMovementLine < ApplicationRecord
belongs_to :stock_movement
belongs_to :p_product_ref
has_many :stock_movement_line_p_articles
has_many :p_articles, through: :stock_movement_line_p_articles
accepts_nested_attributes_for :stock_movement_line_p_articles
accepts_nested_attributes_for :p_articles, allow_destroy: true
acts_as_caching :fields => [:tot_amount_ht, :price_u_ht]
acts_as_sorting :fields => {
:qte => {:name => "Qté", :reorder => true},
:actions => {:name => "Actions"}
}
def ca_tot_amount_ht
if self.ct_tot_amount_ht
self.ct_tot_amount_ht
end
end
end