From 805abea060cb2579aa7644397125525abb8c25f3 Mon Sep 17 00:00:00 2001 From: Armando Andini Date: Wed, 14 Dec 2016 15:41:32 -0300 Subject: [PATCH 1/6] Invoice default order. --- app/models/invoice.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/invoice.rb b/app/models/invoice.rb index e4ed72b..d66a3c2 100644 --- a/app/models/invoice.rb +++ b/app/models/invoice.rb @@ -12,6 +12,8 @@ class Invoice < ActiveRecord::Base monetize :exempt_cents monetize :perception_cents + default_scope { order(date: 'DESC') } + def operator_namespace operator.class.to_s.pluralize.downcase end From a6b38891597069e340001f105cbe4883a65b44fe Mon Sep 17 00:00:00 2001 From: Armando Andini Date: Wed, 14 Dec 2016 15:42:15 -0300 Subject: [PATCH 2/6] Changes in invoices template. --- app/views/invoices/_invoices.html.erb | 36 +++++++++------------------ 1 file changed, 12 insertions(+), 24 deletions(-) diff --git a/app/views/invoices/_invoices.html.erb b/app/views/invoices/_invoices.html.erb index 7f51cce..c271fd2 100644 --- a/app/views/invoices/_invoices.html.erb +++ b/app/views/invoices/_invoices.html.erb @@ -1,21 +1,17 @@ - +
- - - - + - @@ -23,24 +19,16 @@ <% @invoices.each do |invoice| %> - - - - - - - - - - - - - - - - + + + + + + + + + + <% end %> From e653fa9f6e1d8e5cf380960d69b7a5e1b30d295b Mon Sep 17 00:00:00 2001 From: Armando Andini Date: Wed, 14 Dec 2016 15:42:33 -0300 Subject: [PATCH 3/6] Color for links. --- app/assets/stylesheets/application.scss | 2 +- app/assets/stylesheets/colors.scss | 1 + app/assets/stylesheets/scaffolds.scss | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 app/assets/stylesheets/colors.scss diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 43a58ee..f3b86ee 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,5 +1,5 @@ @import "bootstrap-sprockets"; @import "bootstrap"; @import "bootstrap-datepicker3"; - +@import "colors"; @import "scaffolds"; diff --git a/app/assets/stylesheets/colors.scss b/app/assets/stylesheets/colors.scss new file mode 100644 index 0000000..acce2fb --- /dev/null +++ b/app/assets/stylesheets/colors.scss @@ -0,0 +1 @@ +$teal: #4ebdd7; diff --git a/app/assets/stylesheets/scaffolds.scss b/app/assets/stylesheets/scaffolds.scss index 32701c3..0f3a9dd 100644 --- a/app/assets/stylesheets/scaffolds.scss +++ b/app/assets/stylesheets/scaffolds.scss @@ -19,11 +19,10 @@ pre { } a { - color: #000; + color: $teal; &:hover { - color: #fff; - background-color: #000; + text-decoration: underline; } } From a7738333db08c06653a90ede0828a19fd811884c Mon Sep 17 00:00:00 2001 From: Armando Andini Date: Wed, 14 Dec 2016 15:54:02 -0300 Subject: [PATCH 4/6] Add fields and link to delete invoice from #show view. --- app/controllers/invoices_controller.rb | 2 +- app/views/invoices/show.html.erb | 31 +++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/app/controllers/invoices_controller.rb b/app/controllers/invoices_controller.rb index b4de421..02bc655 100644 --- a/app/controllers/invoices_controller.rb +++ b/app/controllers/invoices_controller.rb @@ -56,7 +56,7 @@ def update def destroy @invoice.destroy respond_to do |format| - format.html { redirect_to invoices_url, notice: 'Factura eliminada' } + format.html { redirect_to [@namespace, :invoices], notice: 'Factura eliminada' } format.json { head :no_content } end end diff --git a/app/views/invoices/show.html.erb b/app/views/invoices/show.html.erb index b3761c4..bdb7110 100644 --- a/app/views/invoices/show.html.erb +++ b/app/views/invoices/show.html.erb @@ -10,11 +10,14 @@ <%= @invoice.operator %>

+

+ CUIT: + <%= @invoice.operator.cuit %> +

+

Factura: - <%= @invoice.invoice_type %> - <%= @invoice.sales_point %> - <%= @invoice.number %> + <%= @invoice.full_number %>

@@ -22,8 +25,18 @@ <%= @invoice.taxed_21 %>

+

+ IVA 21% + <%= @invoice.tax_21 %> +

+

Gravado IVA 10,5: + <%= @invoice.tax_105 %> +

+ +

+ IVA 10,5: <%= @invoice.taxed_105 %>

@@ -37,5 +50,17 @@ <%= @invoice.exempt %>

+

+ Percepcion AFIP: + <%= @invoice.perception %> +

+ +

+ Total: + <%= @invoice.total %> +

+ <%= link_to 'Editar', [:edit, @invoice.operator_namespace, @invoice] %> | +<%= link_to 'Borrar', [@invoice.operator_namespace, @invoice], method: :delete, + data: { confirm: 'Desea eliminar la factura?' } %> | <%= link_to 'Volver', [@invoice.operator_namespace, :invoices] %> From d95805ea92164741395aeda31cb7a5f398e5ee93 Mon Sep 17 00:00:00 2001 From: Armando Andini Date: Mon, 2 Jan 2017 11:25:38 -0300 Subject: [PATCH 5/6] Tablas cambiadas por estilo con bordes. --- app/views/invoices/_invoices.html.erb | 2 +- app/views/movements/_movements.html.erb | 2 +- app/views/operators/_operators.html.erb | 2 +- app/views/passengers/_passengers.html.erb | 2 +- app/views/reservas/index.html.erb | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/invoices/_invoices.html.erb b/app/views/invoices/_invoices.html.erb index c271fd2..4beb801 100644 --- a/app/views/invoices/_invoices.html.erb +++ b/app/views/invoices/_invoices.html.erb @@ -1,4 +1,4 @@ -
Fecha OperadorCUIT FacturaPto_d_VtaNro Gravado 21% IVA 21% Gravado 10,5% IVA 10,5% No gravado ExentoPercepcion AFIP5% AFIP Total
<%= localize invoice.date, :format => '%d/%m/%Y' %><%= invoice.operator.name %><%= invoice.operator.cuit %><%= invoice.invoice_type %><%= invoice.sales_point %><%= invoice.number %><%= invoice.taxed_21 %><%= number_to_currency invoice.tax_21, unit: '' %><%= invoice.taxed_105 %><%= number_to_currency invoice.tax_105, unit: '' %><%= invoice.not_taxed %><%= invoice.exempt %><%= invoice.perception %><%= number_to_currency invoice.total, unit: '' %><%= link_to 'Detalles', [invoice.operator_namespace, invoice] %><%= link_to 'Editar', - [:edit, invoice.operator_namespace, invoice] %><%= link_to 'Borrar', [invoice.operator_namespace, invoice], - method: :delete, data: { confirm: '¿Seguro de borrar?' } %><%= invoice.operator.name.truncate 30 %><%= link_to invoice.full_number, invoice_path(invoice)%><%= invoice.taxed_21 %><%= number_to_currency invoice.tax_21, unit: '' %><%= invoice.taxed_105 %><%= number_to_currency invoice.tax_105, unit: '' %><%= invoice.not_taxed %><%= invoice.exempt %><%= invoice.perception %><%= number_to_currency invoice.total %>
+
diff --git a/app/views/movements/_movements.html.erb b/app/views/movements/_movements.html.erb index 7a6afa7..8f0a329 100644 --- a/app/views/movements/_movements.html.erb +++ b/app/views/movements/_movements.html.erb @@ -1,4 +1,4 @@ -
Fecha
+
diff --git a/app/views/operators/_operators.html.erb b/app/views/operators/_operators.html.erb index 52dc48f..0de217f 100644 --- a/app/views/operators/_operators.html.erb +++ b/app/views/operators/_operators.html.erb @@ -1,4 +1,4 @@ -
Monto
+
diff --git a/app/views/passengers/_passengers.html.erb b/app/views/passengers/_passengers.html.erb index 5b8a822..000bb40 100644 --- a/app/views/passengers/_passengers.html.erb +++ b/app/views/passengers/_passengers.html.erb @@ -1,4 +1,4 @@ -
Nombre
+
diff --git a/app/views/reservas/index.html.erb b/app/views/reservas/index.html.erb index c37efb7..5794968 100644 --- a/app/views/reservas/index.html.erb +++ b/app/views/reservas/index.html.erb @@ -17,7 +17,7 @@ -
Name
+
From 8d402af3dab0e3f27bf9a535d3b2cffad531c863 Mon Sep 17 00:00:00 2001 From: Armando Andini Date: Mon, 2 Jan 2017 12:14:09 -0300 Subject: [PATCH 6/6] Cambiados estilos de botones. Eliminados botones innecesarios. Cambiado formato del invoices#show. --- app/views/invoices/_form.html.erb | 2 +- app/views/invoices/edit.html.erb | 3 +- app/views/invoices/show.html.erb | 92 ++++++++++--------------------- 3 files changed, 31 insertions(+), 66 deletions(-) diff --git a/app/views/invoices/_form.html.erb b/app/views/invoices/_form.html.erb index 3b9410d..4b566d8 100644 --- a/app/views/invoices/_form.html.erb +++ b/app/views/invoices/_form.html.erb @@ -19,6 +19,6 @@
- <%= f.button :submit %> + <%= f.button :submit, 'Aceptar', class: 'btn btn-primary' %>
<% end %> diff --git a/app/views/invoices/edit.html.erb b/app/views/invoices/edit.html.erb index 8c04b3e..47c8574 100644 --- a/app/views/invoices/edit.html.erb +++ b/app/views/invoices/edit.html.erb @@ -2,5 +2,4 @@ <%= render partial: 'form', locals: { operators: @operators } %> -<%= link_to 'Detalles', [@invoice.operator_namespace, @invoice] %> | -<%= link_to 'Volver', [@invoice.operator_namespace, :invoices] %> +<%= link_to 'Cancelar', [@invoice.operator_namespace, :invoices], class: 'btn btn-default' %> diff --git a/app/views/invoices/show.html.erb b/app/views/invoices/show.html.erb index bdb7110..f55a57d 100644 --- a/app/views/invoices/show.html.erb +++ b/app/views/invoices/show.html.erb @@ -1,66 +1,32 @@

<%= notice %>

-

- Fecha: - <%= @invoice.date.strftime('%d/%m/%Y')%> -

- -

- Operador: - <%= @invoice.operator %> -

- -

- CUIT: - <%= @invoice.operator.cuit %> -

- -

- Factura: - <%= @invoice.full_number %> -

- -

- Gravado IVA 21% - <%= @invoice.taxed_21 %> -

- -

- IVA 21% - <%= @invoice.tax_21 %> -

- -

- Gravado IVA 10,5: - <%= @invoice.tax_105 %> -

- -

- IVA 10,5: - <%= @invoice.taxed_105 %> -

- -

- No Gravado: - <%= @invoice.not_taxed %> -

- -

- Exento: - <%= @invoice.exempt %> -

- -

- Percepcion AFIP: - <%= @invoice.perception %> -

- -

- Total: - <%= @invoice.total %> -

- -<%= link_to 'Editar', [:edit, @invoice.operator_namespace, @invoice] %> | +
+
Factura:
+
<%= @invoice.full_number %>
+
Fecha:
+
<%= @invoice.date.strftime('%d/%m/%Y')%>
+
Operador:
+
<%= @invoice.operator %>
+
CUIT:
+
<%= @invoice.operator.cuit %>
+
Gravado IVA 21%
+
<%= @invoice.taxed_21 %>
+
IVA 21%
+
<%= @invoice.tax_21 %>
+
Gravado IVA 10,5:
+
<%= @invoice.tax_105 %>
+
IVA 10,5:
+
<%= @invoice.taxed_105 %>
+
No Gravado:
+
<%= @invoice.not_taxed %>
+
Exento:
+
<%= @invoice.exempt %>
+
Percepcion AFIP:
+
<%= @invoice.perception %>
+
Total:
+
<%= @invoice.total %>
+
+ +<%= link_to 'Editar', [:edit, @invoice.operator_namespace, @invoice], class: 'btn btn-default' %> <%= link_to 'Borrar', [@invoice.operator_namespace, @invoice], method: :delete, - data: { confirm: 'Desea eliminar la factura?' } %> | -<%= link_to 'Volver', [@invoice.operator_namespace, :invoices] %> + data: { confirm: 'Desea eliminar la factura?' }, class: 'btn btn-danger' %>
Salida