diff --git a/app/models/price_line.rb b/app/models/price_line.rb index f156d9b..d33c571 100644 --- a/app/models/price_line.rb +++ b/app/models/price_line.rb @@ -546,38 +546,36 @@ class PriceLine < ApplicationRecord - - def ca_tot_amount_ht - if ct_tot_amount_ht + if self.ct_tot_amount_ht self.ct_tot_amount_ht else - (self.ca_price_u_kg_net_ht * self.weight_qte.to_f).round(2) + (self.ca_price_u_ht * self.qte.to_f).round(3) end end def ca_tot_amount_tva - (self.tot_amount_ht * (self.tva_account_value/100)).round(2) + (self.tot_amount_ht * (self.tva_account_value/100)).round(3) end def ca_tot_amount_ttc - (self.tot_amount_ht + self.tot_amount_tva).round(2) + (self.tot_amount_ht + self.tot_amount_tva).round(3) end - - - + + + def ca_tot_discount_ht - (self.ca_price_u_ht * self.qte.to_f).round(2) - self.ca_tot_amount_ht + (self.ca_price_u_ht * self.qte.to_f).round(3) - self.ca_tot_amount_ht end - - - + + + def ca_tot_discount_tva - (self.tot_discount_ht * (self.tva_account_value/100)).round(2) + (self.tot_discount_ht * (self.tva_account_value/100)).round(3) end def ca_tot_discount_ttc - (self.tot_discount_ht+self.tot_discount_tva).round(2) + (self.tot_discount_ht+self.tot_discount_tva).round(3) end