Skip to content

Commit

Permalink
Add development mode option to avoid FacturaPlus integration
Browse files Browse the repository at this point in the history
  • Loading branch information
jresinas committed Sep 4, 2018
1 parent 25d76e6 commit 444d4a6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
9 changes: 7 additions & 2 deletions app/views/settings/_facturaplus_settings.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,16 @@
</p>
</fieldset>

<fielset>
<legend><%=l(:"facturaplus.label_emails")%></legend>
<fieldset>
<legend><%=l(:"facturaplus.label_others")%></legend>
<p>
<label><%=l(:"facturaplus.label_email_list")%></label>
<%= text_field_tag 'settings[emails]', @settings['emails'] %>
</p>
</fieldset>
<p>
<label><%=l(:"facturaplus.label_devel_mode")%></label>
<%= check_box_tag 'settings[devel_mode]', 1, @settings['devel_mode'] %>
</p>
</div>
</fieldset>
7 changes: 5 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ en:
label_default_content: Default content
label_default_clients: Default clients
label_endpoints: Endpoints
label_get_clients: Get clientes
label_protocol: Protocol
label_domain: Domain
label_get_clients: Get clients
label_set_order: Set order
delete_order: Delete order
label_set_delivery_note: Set delivery note
delete_delivery_note: Delete delivery note
label_emails: Emails
label_others: Others
label_email_list: Email list
label_devel_mode: Development mode
email_subject: Error while synchronize with FacturaPlus
email_subject: Bill changes

Expand Down
5 changes: 4 additions & 1 deletion config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ es:
label_default_content: Contenido por defecto
label_default_clients: Clientes por defecto
label_endpoints: Endpoints
label_protocol: Protocolo
label_domain: Dominio
label_get_clients: Obtener clientes
label_set_order: Crear pedido cliente
delete_order: Eliminar pedido de cliente
label_set_delivery_note: Crear albarán de cliente
delete_delivery_note: Eliminar albarán de cliente
label_emails: Emails
label_others: Otros
label_email_list: Lista de emails
label_devel_mode: Modo de desarrollo
email_subject: Error durante la sincronización con FacturaPlus
email_subject: Cambios en facturas

Expand Down
6 changes: 5 additions & 1 deletion lib/facturaplus/fp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,11 @@ def self.get_endpoint(action)

def self.facturaplus_request(url, parameters, method)
begin
if url.present?
if Setting.plugin_redmine_facturaplus['devel_mode'].present?
code = 200
result = true
body = {}
elsif url.present?
uri = URI.parse(url)

case method
Expand Down

0 comments on commit 444d4a6

Please sign in to comment.