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; } } 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/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 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/_invoices.html.erb b/app/views/invoices/_invoices.html.erb index 7f51cce..4beb801 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 %> 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 b3761c4..f55a57d 100644 --- a/app/views/invoices/show.html.erb +++ b/app/views/invoices/show.html.erb @@ -1,41 +1,32 @@

<%= notice %>

-

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -

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

- -<%= link_to 'Editar', [:edit, @invoice.operator_namespace, @invoice] %> | -<%= link_to 'Volver', [@invoice.operator_namespace, :invoices] %> +
+
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?' }, class: 'btn btn-danger' %> 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 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/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
+
Salida