show amount

This commit is contained in:
Barnabé 2021-09-13 18:36:38 +02:00
parent 6751e34f29
commit bb8c841404

View File

@ -546,38 +546,36 @@ class PriceLine < ApplicationRecord
def ca_tot_amount_ht def ca_tot_amount_ht
if ct_tot_amount_ht if self.ct_tot_amount_ht
self.ct_tot_amount_ht self.ct_tot_amount_ht
else 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
end end
def ca_tot_amount_tva 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 end
def ca_tot_amount_ttc 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 end
def ca_tot_discount_ht 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 end
def ca_tot_discount_tva 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 end
def ca_tot_discount_ttc 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 end