Skip to content

Commit

Permalink
Extract duplicated order information to a separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
sauliusstasiukaitis committed Mar 24, 2017
1 parent b00c3b6 commit 26458c8
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 171 deletions.
86 changes: 86 additions & 0 deletions source/Application/views/admin/tpl/include/order_info.tpl
@@ -0,0 +1,86 @@
<table border="0" cellspacing="0" cellpadding="0" id="order.info">
[{if $edit->isNettoMode()}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_INETTO"}]</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedTotalNetSum()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_DISCOUNT"}]&nbsp;&nbsp;</td>
<td class="edittext" align="right"><b>- [{$edit->getFormattedDiscount()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{foreach key=iVat from=$aProductVats item=dVatPrice}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_IVAT"}] ([{$iVat}]%)</td>
<td class="edittext" align="right"><b>[{$dVatPrice}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{/foreach}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_IBRUTTO"}]</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedTotalBrutSum()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{else}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_IBRUTTO"}]</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedTotalBrutSum()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>

<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_DISCOUNT"}]&nbsp;&nbsp;</td>
<td class="edittext" align="right"><b>- [{$edit->getFormattedDiscount()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_INETTO"}]</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedTotalNetSum()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{foreach key=iVat from=$aProductVats item=dVatPrice}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_IVAT"}] ([{$iVat}]%)</td>
<td class="edittext" align="right"><b>[{$dVatPrice}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{/foreach}]
[{/if}]
[{if $edit->oxorder__oxvoucherdiscount->value}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_VOUCHERS"}]</td>
<td class="edittext" align="right"><b>- [{$edit->getFormattedTotalVouchers()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{/if}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_DELIVERYCOST"}]&nbsp;&nbsp;</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedeliveryCost()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_PAYCOST"}]&nbsp;&nbsp;</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedPayCost()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{if $edit->oxorder__oxwrapcost->value}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_WRAPPING"}]&nbsp;[{if $wrapping}]([{$wrapping->oxwrapping__oxname->value}])[{/if}]&nbsp;</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedWrapCost()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{/if}]
[{if $edit->oxorder__oxgiftcardcost->value}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_CARD"}]&nbsp;[{if $giftCard}]([{$giftCard->oxwrapping__oxname->value}])[{/if}]&nbsp;</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedGiftCardCost()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{/if}]
<tr>
<td class="edittext" height="25">[{oxmultilang ident="GENERAL_SUMTOTAL"}]&nbsp;&nbsp;</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedTotalOrderSum()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
</table>
86 changes: 1 addition & 85 deletions source/Application/views/admin/tpl/order_article.tpl
Expand Up @@ -160,91 +160,7 @@ function StornoThisArticle( sID)
[{/if}]
<b>[{oxmultilang ident="GENERAL_ATALL"}] : </b><br>
[{block name="admin_order_article_total"}]
<table border="0" cellspacing="0" cellpadding="0" id="order.info">
[{if $edit->isNettoMode()}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_INETTO"}]</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedTotalNetSum()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] &euro; [{/if}]</b></td>
</tr>
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_DISCOUNT"}]&nbsp;&nbsp;</td>
<td class="edittext" align="right"><b>- [{$edit->getFormattedDiscount()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] &euro; [{/if}]</b></td>
</tr>
[{foreach key=iVat from=$aProductVats item=dVatPrice}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_IVAT"}] ([{$iVat}]%)</td>
<td class="edittext" align="right"><b>[{$dVatPrice}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{/foreach}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_IBRUTTO"}]</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedTotalBrutSum()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] &euro; [{/if}]</b></td>
</tr>
[{else}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_IBRUTTO"}]</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedTotalBrutSum()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] &euro; [{/if}]</b></td>
</tr>
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_DISCOUNT"}]&nbsp;&nbsp;</td>
<td class="edittext" align="right"><b>- [{$edit->getFormattedDiscount()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] &euro; [{/if}]</b></td>
</tr>
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_INETTO"}]</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedTotalNetSum()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] &euro; [{/if}]</b></td>
</tr>
[{foreach key=iVat from=$aProductVats item=dVatPrice}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_IVAT"}] ([{$iVat}]%)</td>
<td class="edittext" align="right"><b>[{$dVatPrice}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{/foreach}]
[{/if}]
[{if $edit->oxorder__oxvoucherdiscount->value}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_VOUCHERS"}]</td>
<td class="edittext" align="right"><b>- [{$edit->getFormattedTotalVouchers()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] &euro; [{/if}]</b></td>
</tr>
[{/if}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_DELIVERYCOST"}]&nbsp;&nbsp;</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedeliveryCost()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] &euro; [{/if}]</b></td>
</tr>
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_PAYCOST"}]&nbsp;&nbsp;</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedPayCost()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] &euro; [{/if}]</b></td>
</tr>
[{if $edit->oxorder__oxwrapcost->value}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_WRAPPING"}]&nbsp;&nbsp;</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedWrapCost()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] &euro; [{/if}]</b></td>
</tr>
[{/if}]
[{if $edit->oxorder__oxgiftcardcost->value}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_CARD"}]&nbsp;&nbsp;</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedGiftCardCost()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] &euro; [{/if}]</b></td>
</tr>
[{/if}]
<tr>
<td class="edittext" height="25">[{oxmultilang ident="GENERAL_SUMTOTAL"}]&nbsp;&nbsp;</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedTotalOrderSum()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] &euro; [{/if}]</b></td>
</tr>
</table>
[{include file="include/order_info.tpl"}]
[{/block}]
</td>
<td valign="top" align="left" width="60%">
Expand Down
87 changes: 1 addition & 86 deletions source/Application/views/admin/tpl/order_overview.tpl
Expand Up @@ -87,94 +87,9 @@
<span class="orderstorno">[{oxmultilang ident="ORDER_OVERVIEW_STORNO"}]</span><br><br>
[{/if}]
<b>[{oxmultilang ident="GENERAL_ATALL"}]: </b><br><br>
<table border="0" cellspacing="0" cellpadding="0" id="order.info">
[{block name="admin_order_overview_total"}]
[{if $edit->isNettoMode()}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_INETTO"}]</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedTotalNetSum()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_DISCOUNT"}]&nbsp;&nbsp;</td>
<td class="edittext" align="right"><b>- [{$edit->getFormattedDiscount()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{foreach key=iVat from=$aProductVats item=dVatPrice}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_IVAT"}] ([{$iVat}]%)</td>
<td class="edittext" align="right"><b>[{$dVatPrice}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{/foreach}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_IBRUTTO"}]</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedTotalBrutSum()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{else}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_IBRUTTO"}]</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedTotalBrutSum()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>

<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_DISCOUNT"}]&nbsp;&nbsp;</td>
<td class="edittext" align="right"><b>- [{$edit->getFormattedDiscount()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_INETTO"}]</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedTotalNetSum()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{foreach key=iVat from=$aProductVats item=dVatPrice}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_IVAT"}] ([{$iVat}]%)</td>
<td class="edittext" align="right"><b>[{$dVatPrice}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{/foreach}]
[{/if}]
[{if $edit->oxorder__oxvoucherdiscount->value}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_VOUCHERS"}]</td>
<td class="edittext" align="right"><b>- [{$edit->getFormattedTotalVouchers()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{/if}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_DELIVERYCOST"}]&nbsp;&nbsp;</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedeliveryCost()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_PAYCOST"}]&nbsp;&nbsp;</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedPayCost()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{if $edit->oxorder__oxwrapcost->value}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_WRAPPING"}]&nbsp;[{if $wrapping}]([{$wrapping->oxwrapping__oxname->value}])[{/if}]&nbsp;</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedWrapCost()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{/if}]
[{if $edit->oxorder__oxgiftcardcost->value}]
<tr>
<td class="edittext" height="15">[{oxmultilang ident="GENERAL_CARD"}]&nbsp;[{if $giftCard}]([{$giftCard->oxwrapping__oxname->value}])[{/if}]&nbsp;</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedGiftCardCost()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{/if}]
<tr>
<td class="edittext" height="25">[{oxmultilang ident="GENERAL_SUMTOTAL"}]&nbsp;&nbsp;</td>
<td class="edittext" align="right"><b>[{$edit->getFormattedTotalOrderSum()}]</b></td>
<td class="edittext">&nbsp;<b>[{if $edit->oxorder__oxcurrency->value}] [{$edit->oxorder__oxcurrency->value}] [{else}] [{$currency->name}] [{/if}]</b></td>
</tr>
[{include file="include/order_info.tpl"}]
[{/block}]
</table>

<br>
<table>
Expand Down

0 comments on commit 26458c8

Please sign in to comment.