Skip to content

Commit

Permalink
remove igv from discount total sent to einvoice company
Browse files Browse the repository at this point in the history
  • Loading branch information
augustosamame committed Oct 4, 2021
1 parent 5c44eac commit e87a411
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/ecommerce/addresses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/ecommerce/checkout_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion app/models/ecommerce/order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<ol start="6">
<li><strong>. Cobertura de despacho a domicilio</strong><strong>:</strong></li>
</ol>
<p>Los productos adquiridos a trav&eacute;s de expatshop.pe podr&aacute;n entregarse con despacho a domicilio en los siguientes Distritos: Barranco, Chorrillos, Jes&uacute;s Mar&iacute;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.</p>
<p>Los productos adquiridos a trav&eacute;s de expatshop.pe podr&aacute;n entregarse con despacho a domicilio en los siguientes Distritos: Barranco, Chorrillos, Jes&uacute;s Mar&iacute;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.</p>

<ol start="7">
<li><strong> Despacho de los productos.</strong></li>
Expand Down
2 changes: 1 addition & 1 deletion lib/ecommerce/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Ecommerce
VERSION = '0.7.2.2'
VERSION = '0.7.2.3'
end

0 comments on commit e87a411

Please sign in to comment.