From bb8c841404f00b1aa98a10de5fc12434823ae05d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A9?= Date: Mon, 13 Sep 2021 18:36:38 +0200 Subject: [PATCH] show amount --- app/models/price_line.rb | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) 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