Permalink
Browse files

Merge pull request #2629 from gillesbourgeat/feature/improve-invoice-…

…and-delivery-interface

Improve invoice and delivery interface
  • Loading branch information...
gillesbourgeat committed Feb 7, 2019
2 parents b2940ba + 785765e commit 89989fb40c7833fa1bd64e8c5c288157d66a1a38
@@ -1336,5 +1336,9 @@
'tracking reference' => 'Numéro du colis',
'version' => 'Version',
'warning' => 'Attention',
'Download' => 'Télécharger',
'Print' => 'Imprimer',
'Print invoice' => 'Imprimer la facture',
'Print purchase order' => 'Imprimer le bon de commande',
'you can combine taxes in tax rules and chose if they are applied one after the other or at the same time : it allows to apply taxes on an already taxed price or not.' => 'vous pouvez combiner des taxes en règles de taxe et choisir si elle sont appliquées l\'une après l\'autre ou en même temps: cela permet d\'appliquer des taxes sur un produit déjà taxé ou non.',
);
@@ -454,17 +454,42 @@ <h3 class="panel-title">{intl l='tracking reference'}</h3>
<h3 class="panel-title">{intl l='Invoice informations'}</h3>
</div>
<div class="panel-body">
<a class="btn btn-info" title="{intl l='View invoice PDF'}" href="{url path="/admin/order/pdf/invoice/%id/%browser" browser=1 id=$ID}" target="_blank">
<span class="glyphicon glyphicon glyphicon-eye-open"></span> {intl l='PDF | Invoice'}
</a>
<a class="btn btn-info" title="{intl l='Download invoice as PDF'}" href="{url path="/admin/order/pdf/invoice/%id/%browser" browser=0 id=$ID}">
<span class="glyphicon glyphicon-cloud-download"></span> {intl l='PDF | Invoice'}
</a>
{include file='renderer/buttons.html' with_text=false buttons=[
[
'type' => 'view',
'title' => {intl l='View invoice PDF'},
'href' => {url path="/admin/order/pdf/invoice/%id/%browser" browser=1 id=$ID},
'attr' => ['target' => '_blank']
],
[
'type' => 'download',
'title' => {intl l='Download invoice as PDF'},
'href' => {url path="/admin/order/pdf/invoice/%id/%browser" browser=0 id=$ID}
],
[
'type' => 'print',
'class' => 'js-action-print',
'title' => {intl l='Print invoice'},
'href' => {url path="/admin/order/pdf/invoice/%id/%browser" browser=1 id=$ID},
'data' => [
'type' => "invoice"
]
]
]}

<div class="pull-right">
<a class="btn btn-primary js-update-order-address" data-address-id="{$INVOICE_ADDRESS}" title="{intl l='Edit invoice address'}" href="#edit_order_address_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-edit"></span>
</a>
{include file='renderer/buttons.html' with_text=false buttons=[
[
'type' => 'edit',
'class' => 'js-update-order-address',
'title' => {intl l='Edit invoice address'},
'href' => "#edit_order_address_dialog",
'data' => [
'address-id' => $INVOICE_ADDRESS,
'toggle' => 'modal'
]
]
]}
</div>
</div>

@@ -543,6 +568,10 @@ <h3 class="panel-title">{intl l='Invoice informations'}</h3>
<th>{intl l="Cellphone"}</th>
<td>{$CELLPHONE}</td>
</tr>
<tr>
<th>{intl l="Email"}</th>
<td>{loop type="customer" name="customer" id=$CUSTOMER backend_context="on" current="false"}<a href="mailto:{$EMAIL}?Subject={intl l='Order %ref' ref={$REF}}">{$EMAIL}</a>{/loop}</td>
</tr>
{/loop}
</tbody>
</table>
@@ -556,16 +585,42 @@ <h3 class="panel-title">{intl l='Delivery address'}</h3>
</div>

<div class="panel-body">
<a class="btn btn-info" title="{intl l='View purchase order as PDF'}" href="{url path="/admin/order/pdf/delivery/%id/%browser" browser=1 id=$ID}" target="_blank">
<span class="glyphicon glyphicon glyphicon-eye-open"></span> {intl l='PDF | Purchase order'}
</a>
<a class="btn btn-info" title="{intl l='Download purchase order as PDF'}" href="{url path="/admin/order/pdf/delivery/%id/%browser" browser=0 id=$ID}">
<span class="glyphicon glyphicon-cloud-download"></span> {intl l='PDF | Purchase order'}
</a>
{include file='renderer/buttons.html' with_text=false buttons=[
[
'type' => 'view',
'title' => {intl l='View purchase order as PDF'},
'href' => {url path="/admin/order/pdf/delivery/%id/%browser" browser=1 id=$ID},
'attr' => ['target' => '_blank']
],
[
'type' => 'download',
'title' => {intl l='Download purchase order as PDF'},
'href' => {url path="/admin/order/pdf/delivery/%id/%browser" browser=0 id=$ID}
],
[
'type' => 'print',
'class' => 'js-action-print',
'title' => {intl l='Print purchase order'},
'href' => {url path="/admin/order/pdf/delivery/%id/%browser" browser=1 id=$ID},
'data' => [
'type' => "purchase"
]
]
]}

<div class="pull-right">
<a class="btn btn-primary js-update-order-address" data-address-id="{$DELIVERY_ADDRESS}" title="{intl l='Edit delivery address'}" href="#edit_order_address_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-edit"></span>
</a>
{include file='renderer/buttons.html' with_text=false buttons=[
[
'type' => 'edit',
'class' => 'js-update-order-address',
'title' => {intl l='Edit delivery address'},
'href' => "#edit_order_address_dialog",
'data' => [
'address-id' => $DELIVERY_ADDRESS,
'toggle' => 'modal'
]
]
]}
</div>
</div>

@@ -577,6 +632,12 @@ <h3 class="panel-title">{intl l='Delivery address'}</h3>
{/ifhook}
{elsehook rel="order-edit.bill-delivery-address"}
{loop type="order_address" name="order-delivery-address" id=$DELIVERY_ADDRESS}
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr data-field-class="js-company">
<th>{intl l="Company"}</th>
<td>{$COMPANY}</td>
@@ -773,6 +834,22 @@ <h3 class="panel-title">{intl l='Delivery address'}</h3>
<script type="text/javascript">
$(function() {
function print(url, number) {
var iframeName = 'iframe-print-' + number;
var iframe = document.createElement('iframe');
iframe.src = url;
iframe.id = iframeName;
iframe.name = iframeName;
iframe.style.display = "none";
$('body').append(iframe);
window.frames[iframeName].focus();
window.frames[iframeName].print();
}
$('.js-action-print').on('click', function(e) {
e.preventDefault();
print($(this).attr('href'), this.dataset.type);
});
// Atomatic ajax tab load, if data-href is defined.
$('.nav-tabs a[data-href]').on('shown.bs.tab', function (ev) {
var $this = $(this);
@@ -798,7 +875,7 @@ <h3 class="panel-title">{intl l='Delivery address'}</h3>
$(this).data("address-id")
);
$(this).parents('table').find('tr').each(function (k, v) {
$(this).parents('.panel').find('table tr').each(function (k, v) {
var $field = $(v),
$formField,
fieldValue;
@@ -42,7 +42,7 @@
{$button['title'] = {intl l='View'}}
{/if}
{if !$button['icon']['class']}
{$button['icon']['class'] = 'glyphicon glyphicon-eye'}
{$button['icon']['class'] = 'glyphicon glyphicon-eye-open'}
{/if}
{if $button['auth'] && !$button['auth']['access']}
{$button['auth']['access'] = 'VIEW'}
@@ -201,6 +201,32 @@
{if $button['auth'] && !$button['auth']['access']}
{$button['auth']['access'] = 'VIEW'}
{/if}
{elseif $button['type'] == 'print'}
{if !$button['baseClass']}
{$button['baseClass'] = 'btn btn-default'}
{/if}
{if !$button['title']}
{$button['title'] = {intl l='Print'}}
{/if}
{if !$button['icon']['class']}
{$button['icon']['class'] = 'glyphicon glyphicon-print'}
{/if}
{if $button['auth'] && !$button['auth']['access']}
{$button['auth']['access'] = 'VIEW'}
{/if}
{elseif $button['type'] == 'download'}
{if !$button['baseClass']}
{$button['baseClass'] = 'btn btn-default'}
{/if}
{if !$button['title']}
{$button['title'] = {intl l='Download'}}
{/if}
{if !$button['icon']['class']}
{$button['icon']['class'] = 'glyphicon glyphicon-download-alt'}
{/if}
{if $button['auth'] && !$button['auth']['access']}
{$button['auth']['access'] = 'VIEW'}
{/if}
{/if}

{if $button['auth'] && $button['auth']['resource']}

0 comments on commit 89989fb

Please sign in to comment.