diff --git a/lib/afip_bill/assets/images/factura_a.jpg b/lib/afip_bill/assets/images/factura_a.jpg index 5b20011..69c029f 100644 Binary files a/lib/afip_bill/assets/images/factura_a.jpg and b/lib/afip_bill/assets/images/factura_a.jpg differ diff --git a/lib/afip_bill/assets/images/factura_b.jpg b/lib/afip_bill/assets/images/factura_b.jpg index bba1b1d..6eca9cf 100644 Binary files a/lib/afip_bill/assets/images/factura_b.jpg and b/lib/afip_bill/assets/images/factura_b.jpg differ diff --git a/lib/afip_bill/assets/images/factura_c.jpg b/lib/afip_bill/assets/images/factura_c.jpg index bba1b1d..6eca9cf 100644 Binary files a/lib/afip_bill/assets/images/factura_c.jpg and b/lib/afip_bill/assets/images/factura_c.jpg differ diff --git a/lib/afip_bill/generator.rb b/lib/afip_bill/generator.rb index f7fc4cf..1cf272b 100644 --- a/lib/afip_bill/generator.rb +++ b/lib/afip_bill/generator.rb @@ -13,14 +13,14 @@ class Generator FOOTER_PATH = File.dirname(__FILE__) + '/views/shared/_factura_footer.html.erb'.freeze BRAVO_CBTE_TIPO = { '01' => { directory: 'bills', template: 'factura_a', doc_name: 'factura', doc_type: 'a' }, - '02' => { directory: 'notes', template: 'nota_a', doc_name: 'Nota de débito', doc_type: 'a' }, - '03' => { directory: 'notes', template: 'nota_a', doc_name: 'Nota de crédito', doc_type: 'a' }, + '02' => { directory: 'bills', template: 'factura_a', doc_name: 'Nota de débito', doc_type: 'a' }, + '03' => { directory: 'bills', template: 'factura_a', doc_name: 'Nota de crédito', doc_type: 'a' }, '06' => { directory: 'bills', template: 'factura_b', doc_name: 'factura', doc_type: 'b' }, - '07' => { directory: 'notes', template: 'nota_b', doc_name: 'Nota de débito', doc_type: 'b' }, - '08' => { directory: 'notes', template: 'nota_b', doc_name: 'Nota de crédito', doc_type: 'b' }, + '07' => { directory: 'bills', template: 'factura_b', doc_name: 'Nota de débito', doc_type: 'b' }, + '08' => { directory: 'bills', template: 'factura_b', doc_name: 'Nota de crédito', doc_type: 'b' }, '11' => { directory: 'bills', template: 'factura_b', doc_name: 'factura', doc_type: 'c' }, - '12' => { directory: 'notes', template: 'nota_b', doc_name: 'Nota de débito', doc_type: 'c' }, - '13' => { directory: 'notes', template: 'nota_b', doc_name: 'Nota de crédito', doc_type: 'c' } + '12' => { directory: 'bills', template: 'factura_b', doc_name: 'Nota de débito', doc_type: 'c' }, + '13' => { directory: 'bills', template: 'factura_b', doc_name: 'Nota de crédito', doc_type: 'c' } }.freeze IVA = 21.freeze DEFAULTS = { diff --git a/lib/afip_bill/views/bills/factura_a.html.erb b/lib/afip_bill/views/bills/factura_a.html.erb index c16849d..a9feff8 100644 --- a/lib/afip_bill/views/bills/factura_a.html.erb +++ b/lib/afip_bill/views/bills/factura_a.html.erb @@ -1,33 +1,33 @@ <%= @template_header %> -
Alicuota
Código
-
Producto / Servicio
-
Cant.
+
Producto / Servicio
+
Cant.
-
Precio Unit.
+
Precio Unit.
-
Subtotal
-
Subtotal c/IVA
-
IVA
+
Subtotal
+
Alicuota
IVA
+
Subtotal
c/IVA
<% top = 283 %> <% @line_items.each_with_index do |line_item, index| item_code = line_item.code || (index + 1).to_s.rjust(3, "0") + small_code = item_code.length > 8 precio_unitario = ('%.2f' % line_item.imp_unitario).to_s.tr(".", ",") subtotal = ('%.2f' % line_item.imp_total_unitario).to_s.tr(".", ",") alic_iva = ('%.2f' % line_item.iva).to_s.tr(".", ",") subtotal_con_iva = ('%.2f' % line_item.imp_total_unitario_con_iva).to_s.tr(".", ",") %> -
<%= item_code %>
-
<%= line_item.name %>
-
<%= line_item.quantity.to_s.tr(".", ",") %>
+
"><%= item_code %>
+
<%= line_item.name %>
+
<%= line_item.quantity.to_s.tr(".", ",") %>
-
<%= precio_unitario %>
+
<%= precio_unitario %>
-
<%= subtotal %>
-
<%= alic_iva %>%
-
<%= subtotal_con_iva %>
+
<%= subtotal %>
+
<%= alic_iva %>%
+
<%= subtotal_con_iva %>
<% top += 15 %> <% end %> diff --git a/lib/afip_bill/views/bills/factura_b.html.erb b/lib/afip_bill/views/bills/factura_b.html.erb index 7eadfe4..410ab30 100644 --- a/lib/afip_bill/views/bills/factura_b.html.erb +++ b/lib/afip_bill/views/bills/factura_b.html.erb @@ -1,28 +1,31 @@ <%= @template_header %>
Código
-
Producto / Servicio
-
Cantidad
+
Producto / Servicio
+
Cant.
-
Precio Unit.
+
Precio Unit.
-
Subtotal
+
Subtotal
-<% top = 293 %> +<% top = 288 %> <% @line_items.each_with_index do |line_item, index| item_code = line_item.code || (index + 1).to_s.rjust(3, "0") + small_code = item_code.length > 8 precio_unitario = ('%.2f' % line_item.imp_unitario).to_s.tr(".", ",") subtotal = ('%.2f' % line_item.imp_total_unitario).to_s.tr(".", ",") %> -
<%= item_code %>
-
<%= line_item.name %>
-
<%= line_item.quantity.round(2).to_s.tr(".", ",") %>
+
+ "><%= item_code %> +
+
<%= line_item.name %>
+
<%= line_item.quantity.round(2).to_s.tr(".", ",") %>
-
<%= precio_unitario %>
+
<%= precio_unitario %>
-
<%= subtotal %>
+
<%= subtotal %>
<% top += 15 %> <% end %>