From e87a411e239461ee5bdbfb4b40f1e467f1e722bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Augusto=20Samam=C3=A9?= Date: Mon, 4 Oct 2021 11:39:45 -0500 Subject: [PATCH] remove igv from discount total sent to einvoice company --- app/controllers/ecommerce/addresses_controller.rb | 2 +- app/controllers/ecommerce/checkout_controller.rb | 2 +- app/models/ecommerce/order.rb | 2 +- .../ecommerce/organici/store/terms_and_conditions.html.erb | 2 +- lib/ecommerce/version.rb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/ecommerce/addresses_controller.rb b/app/controllers/ecommerce/addresses_controller.rb index 31de8363..c0bad0b9 100644 --- a/app/controllers/ecommerce/addresses_controller.rb +++ b/app/controllers/ecommerce/addresses_controller.rb @@ -29,7 +29,7 @@ def new @address = Address.new(user: current_user) @address.latitude = "-12.1051699" @address.longitude = "-76.9849161" - @districts = ['San Isidro', 'Miraflores', 'Barranco', 'Santiago de Surco', 'La Molina','Chorrillos','San Borja','San Luis','Surquillo','San Miguel','Pueblo Libre','La Victoria','Magdalena','Jesus María','Lince', 'Bellavista de Callao', 'La Perla', 'Breña', 'San Martín de Porras', 'Los Olivos', 'San Juan de Miraflores'] + @districts = ['San Isidro', 'Miraflores', 'Barranco', 'Santiago de Surco', 'La Molina','Chorrillos','San Borja','San Luis','Surquillo','San Miguel','Pueblo Libre','La Victoria','Magdalena','Jesus María','Lince', 'Bellavista de Callao', 'La Perla', 'Breña', 'San Martin de Porras', 'Los Olivos', 'San Juan de Miraflores'] respond_with @address end diff --git a/app/controllers/ecommerce/checkout_controller.rb b/app/controllers/ecommerce/checkout_controller.rb index 383e7f49..cfdb8ad9 100644 --- a/app/controllers/ecommerce/checkout_controller.rb +++ b/app/controllers/ecommerce/checkout_controller.rb @@ -101,7 +101,7 @@ def show @address = Address.new(user_id: current_user.id) @picked_address = Address.new(user_id: current_user.id) @checkout_addresses = Address.where(user_id: current_user.id) - @districts = ['San Isidro', 'Miraflores', 'Barranco', 'Santiago de Surco', 'La Molina','Chorrillos','San Borja','San Luis','Surquillo','San Miguel','Pueblo Libre','La Victoria','Magdalena','Jesus María','Lince', 'Bellavista de Callao', 'La Perla', 'Breña', 'San Martín de Porras', 'Los Olivos', 'San Juan de Miraflores'].sort + @districts = ['San Isidro', 'Miraflores', 'Barranco', 'Santiago de Surco', 'La Molina','Chorrillos','San Borja','San Luis','Surquillo','San Miguel','Pueblo Libre','La Victoria','Magdalena','Jesus María','Lince', 'Bellavista de Callao', 'La Perla', 'Breña', 'San Martin de Porras', 'Los Olivos', 'San Juan de Miraflores'].sort @cart_subtotal = 0 @cart.cart_items.includes(:product).each do |cart_item| @cart_subtotal += cart_item.line_total(current_user) diff --git a/app/models/ecommerce/order.rb b/app/models/ecommerce/order.rb index 5dd00b67..ec2f5a7b 100644 --- a/app/models/ecommerce/order.rb +++ b/app/models/ecommerce/order.rb @@ -90,7 +90,7 @@ def generate_einvoice line = 0 weight = 0.0 total_order_amount = (self.amount).to_f - (self.points_redeemed_amount.to_f / 100) - discount_total = (self.discount_amount).to_f.abs + (self.points_redeemed_amount.to_f / 100) + discount_total = ((self.discount_amount).to_f.abs + (self.points_redeemed_amount.to_f / 100)) / 1.18 #since igv amount is taken by certifact as the sum of igv lines, the igv in tax lines need to be reduced based on the discount OrderItem.where(order_id: self.id).includes(:product).each do |item| invoice_lines_array << {name: item.product.name, quantity: item.quantity, product_id: item.product.id, price_total: (item.price * item.quantity).to_f, price_subtotal: item.price.to_f, weight: (item.quantity * item.product.weight).to_f } diff --git a/app/views/ecommerce/organici/store/terms_and_conditions.html.erb b/app/views/ecommerce/organici/store/terms_and_conditions.html.erb index 9255cc01..8677739e 100644 --- a/app/views/ecommerce/organici/store/terms_and_conditions.html.erb +++ b/app/views/ecommerce/organici/store/terms_and_conditions.html.erb @@ -53,7 +53,7 @@
  1. . Cobertura de despacho a domicilio:
-

Los productos adquiridos a través de expatshop.pe podrán entregarse con despacho a domicilio en los siguientes Distritos: Barranco, Chorrillos, Jesús María, La Victoria (Santa Catalina), Magdalena, Miraflores, Pueblo Libre, San Borja, San Isidro, San Luis, San Miguel, Santiago de Surco, Surquillo, La Molina, Bellavista de Callao, La Perla, Breña, San Martín de Porras, Los Olivos y San Juan de Miraflores.

+

Los productos adquiridos a través de expatshop.pe podrán entregarse con despacho a domicilio en los siguientes Distritos: Barranco, Chorrillos, Jesús María, La Victoria (Santa Catalina), Magdalena, Miraflores, Pueblo Libre, San Borja, San Isidro, San Luis, San Miguel, Santiago de Surco, Surquillo, La Molina, Bellavista de Callao, La Perla, Breña, San Martin de Porras, Los Olivos y San Juan de Miraflores.

  1. Despacho de los productos.
  2. diff --git a/lib/ecommerce/version.rb b/lib/ecommerce/version.rb index 96976f30..d8317340 100644 --- a/lib/ecommerce/version.rb +++ b/lib/ecommerce/version.rb @@ -1,3 +1,3 @@ module Ecommerce - VERSION = '0.7.2.2' + VERSION = '0.7.2.3' end