Skip to content

Commit

Permalink
- Added additional special translations keys for business documents.
Browse files Browse the repository at this point in the history
- Improved tablet support for business documents view.
  • Loading branch information
NeoRazorX committed Oct 8, 2019
1 parent 69c61bb commit 087732c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 24 deletions.
8 changes: 8 additions & 0 deletions Core/Base/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,14 @@ private function getTransKey(string $txt): string
'PedidoProveedor' => 'supplier-order',
'PresupuestoCliente' => 'customer-estimation',
'PresupuestoProveedor' => 'supplier-estimation',
'AlbaranCliente-min' => 'delivery-note',
'AlbaranProveedor-min' => 'delivery-note',
'FacturaCliente-min' => 'invoice',
'FacturaProveedor-min' => 'invoice',
'PedidoCliente-min' => 'order',
'PedidoProveedor-min' => 'order',
'PresupuestoCliente-min' => 'estimation',
'PresupuestoProveedor-min' => 'estimation',
];

return isset($specialKeys[$txt]) ? $specialKeys[$txt] : $txt;
Expand Down
19 changes: 1 addition & 18 deletions Core/Lib/PDF/PDFDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ protected function insertBusinessDocFooter($model)
protected function insertBusinessDocHeader($model)
{
$headerData = [
'title' => $this->i18n->trans('delivery-note'),
'title' => $this->i18n->trans($model->modelClassName() . '-min'),
'subject' => $this->i18n->trans('customer'),
'fieldName' => 'nombrecliente'
];
Expand All @@ -215,23 +215,6 @@ protected function insertBusinessDocHeader($model)
$headerData['fieldName'] = 'nombre';
}

switch ($model->modelClassName()) {
case 'FacturaProveedor':
case 'FacturaCliente':
$headerData['title'] = $this->i18n->trans('invoice');
break;

case 'PedidoProveedor':
case 'PedidoCliente':
$headerData['title'] = $this->i18n->trans('order');
break;

case 'PresupuestoProveedor':
case 'PresupuestoCliente':
$headerData['title'] = $this->i18n->trans('estimation');
break;
}

if (!empty($this->format->titulo)) {
$headerData['title'] = Utils::fixHtml($this->format->titulo);
}
Expand Down
10 changes: 5 additions & 5 deletions Core/View/Master/BusinessDocumentView.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
{% endfor %}
{{ _self.customSelect('doc_codpago', 'codpago', currentView.model.codpago, currentView.getSelectValues('FormaPago')) }}
{{ _self.customSelect('doc_coddivisa', 'coddivisa', currentView.model.coddivisa, currentView.getSelectValues('Divisa')) }}
<div class="col">
<div class="col-sm-3 col-md-2 col-lg">
<div class="input-group">
<input type="text" id="doc_total" name="total" value="{{ currentView.model.total }}" class="form-control text-right" disabled="" />
<div class="input-group-append">
Expand Down Expand Up @@ -171,7 +171,7 @@
<input type="hidden" id="{{ id }}" name="{{ name }}" value="{{ key }}"/>
{% endfor %}
{% else %}
<div class="col mb-2">
<div class="col-sm-3 col-md-2 col-lg mb-2">
<select id="{{ id }}" name="{{ name }}" class="form-control">
{% for key, option in allValues %}
<option value="{{ key }}"{% if value == key %} selected=""{% endif %}>
Expand All @@ -184,7 +184,7 @@
{% endmacro %}

{% macro customInput(id, name, value, type = "text", icon = NULL, attributes = NULL) %}
<div class="col mb-2">
<div class="col-sm-3 col-md-2 col-lg mb-2">
{% if icon %}
<div class="input-group">
<span class="input-group-prepend">
Expand All @@ -210,7 +210,7 @@
{% endmacro %}

{% macro customerSelect(i18n, id, name, model, newUrl) %}
<div class="col mb-2">
<div class="col-sm-3 col-md-2 col-lg mb-2">
<div class="input-group">
<span class="input-group-prepend">
{% if model.codcliente %}
Expand All @@ -232,7 +232,7 @@
{% endmacro %}

{% macro supplierSelect(i18n, id, name, model, newUrl) %}
<div class="col mb-2">
<div class="col-sm-3 col-md-2 col-lg mb-2">
<div class="input-group">
<span class="input-group-prepend">
{% if model.codproveedor %}
Expand Down
2 changes: 2 additions & 0 deletions Core/View/Master/MenuTemplate.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@
{% block body %}
{% endblock %}
<br/>
<br/>
<br/>
{{ debugBarRender.render() | raw }}
</body>
{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion Core/View/Master/PanelController.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
<div class="btn-group">
<a href="{{ firstView.model.url() }}&action=export&option={{ fsc.exportManager.defaultOption() }}" target="_blank" class="btn btn-sm btn-light">
<i class="fas fa-print fa-fw" aria-hidden="true"></i>
<span class="d-none d-md-inline-block">{{ i18n.trans('print') }}</span>
<span class="d-none d-lg-inline-block">{{ i18n.trans('print') }}</span>
</a>
<button type="button" class="btn btn-sm btn-light dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">{{ i18n.trans('more') }}</span>
Expand Down

0 comments on commit 087732c

Please sign in to comment.