949 lines
43 KiB
Smarty
949 lines
43 KiB
Smarty
<!-- Warning messages -->
|
|
{block "messages"}
|
|
<div class="row">
|
|
<!-- Storno order -->
|
|
{if $order->isClosed()}
|
|
<div class="col-md-5">
|
|
<div class="alert alert-danger"><strong>{'errorOrderClosed'|translate}</strong></div>
|
|
</div>
|
|
{/if}
|
|
{if "1" == $body.data.status_storno}
|
|
<div class="col-md-5">
|
|
<div class="alert alert-danger"><strong>{'infoCanceled'|translate}</strong></div>
|
|
</div>
|
|
{/if}
|
|
{if findModule('replacement') or findModule('returns')}
|
|
{$returnId = $order->getData('replacement')}
|
|
{if $returnId}
|
|
<div class="col-xs-6">
|
|
<div class="alert alert-warning">
|
|
Objednávka je vratka z <a href="javascript:nw('order', '{$returnId}');"><strong>této objednávky</strong></a>.
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
{$returnIdNew = $order->getData('id_return')}
|
|
{if $returnIdNew}
|
|
<div class="col-xs-6">
|
|
<div class="alert alert-warning">
|
|
Objednávka patří k <a href="javascript:nw('Returns', '{$returnIdNew}');"><strong>této vratce</strong></a>.
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
{/if}
|
|
{if $module.B2B_PREORDERS and $order->getData('preorders')}
|
|
{$preorderData = $order->getData('preorders')}
|
|
<div class="col-xs-6">
|
|
<div class="alert alert-warning">
|
|
Objednávka patří k
|
|
<a href="javascript:nw('preordersUsers', '{$order->id_user}-{$preorderData.id_preorder_date}');">
|
|
<strong>této předobjednávce uživatele</strong></a>.
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
{/block}
|
|
|
|
<div class="row">
|
|
<div class="col-md-8">
|
|
<div class="panel panel-default panel-sm">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title">
|
|
{'sectionInvoiceData'|translate}
|
|
|
|
{block "customer-open-orders"}
|
|
{if $body.data.id && $body.multipleOrder}
|
|
<span class="no-margin badge badge-danger badge-light">
|
|
{'userOpenOrder1'|translate} <a href="javascript:nw('order', {$body.multipleOrder});">{'userOpenOrder2'|translate}</a>!
|
|
</span>
|
|
{/if}
|
|
{/block}
|
|
|
|
<a href="javascript:nw('userOrders', 0, {if $body.data.id_user}'userId='+$.dataField('id_user').val()+'&email={$body.data.invoice_email}'{else}'customer={$body.data.invoice_email}'{/if});">
|
|
<span class="badge badge-default pull-right" title="{'findUserOrders'|translate}">
|
|
<i class="glyphicon glyphicon-list-alt"></i>
|
|
</span>
|
|
</a>
|
|
<a href="javascript:nw('order', '', $('form #flapUser :input').not('#date-fields input').not($.dataField('order_no')).not('#inptHiddenFlap').serialize())">
|
|
<span class="badge badge-default pull-right" title="{'createNewUserOrder'|translate}">
|
|
<i class="glyphicon glyphicon-plus"></i>
|
|
</span>
|
|
</a>
|
|
{if $body.data.invoice_email}
|
|
{if $body.userInfo and !empty($body.userInfo.note)}
|
|
<a href="javascript:nw('user', {$body.userInfo.id})" class="pull-right" data-toggle="tooltip" data-html="true" title="{$body.userInfo.note}">
|
|
<span class="badge badge-danger badge-light">
|
|
<i class="glyphicon glyphicon glyphicon-flag"></i>
|
|
{$body.userInfo.note|truncate:30}
|
|
</span>
|
|
</a>
|
|
<script>
|
|
$('[data-toggle="tooltip"]').tooltip({
|
|
placement: 'bottom',
|
|
delay: {
|
|
show: 200, hide: 100,
|
|
},
|
|
container: 'body',
|
|
template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner tooltip-inner-help"></div></div>',
|
|
});
|
|
</script>
|
|
{else}
|
|
<a href="">
|
|
<span onclick="return addUserNote('{$body.data.id}')" class="badge badge-default pull-right" title="{'addNoteToUser'|translate}">
|
|
<i class="glyphicon glyphicon glyphicon-flag"></i>
|
|
</span>
|
|
<script>
|
|
function addUserNote(id) {
|
|
var note = window.prompt('Poznámka', '{$body.userInfo.note}');
|
|
if (note !== null) {
|
|
window.location = encodeURI('launch.php?s=orders.php&acn=addUserNote&ID=' + id + '¬e=' + note);
|
|
}
|
|
|
|
return false;
|
|
}
|
|
</script>
|
|
</a>
|
|
{/if}
|
|
{/if}
|
|
{if $body.data.id_user}
|
|
<span class="badge badge badge-success badge-light">
|
|
<a href="javascript:nw('user', {$body.data.id_user})" title="{'userEdit'|translate}">
|
|
{'userRegistered'|translate}
|
|
</a>
|
|
</span>
|
|
{/if}
|
|
{if findModule('price_levels')}
|
|
{if $body.price_level}
|
|
{$price_level = $body.price_level}
|
|
{else}
|
|
{$price_level = $order->getData('price_level')}
|
|
{/if}
|
|
{if is_string($price_level)}
|
|
{$price_level = ['id' => '', 'name' => $price_level]}
|
|
{/if}
|
|
{if $price_level}
|
|
<a href="javascript:nw('pricelevel', {$price_level.id})" title="Upravit cenovou hladinu">
|
|
<span class="badge badge badge-info" title="Cenová hladina">
|
|
{$price_level.name}
|
|
</span>
|
|
</a>
|
|
{/if}
|
|
{/if}
|
|
|
|
{foreach $body.data.used_order_discounts as $id => $name}
|
|
<a href="javascript:nw('OrderDiscounts', {$id})" title="{'showDiscount'|translate:'OrderDiscounts'}">
|
|
<span class="badge badge-primary badge-light">
|
|
{$name}
|
|
</span>
|
|
</a>
|
|
{/foreach}
|
|
</h3>
|
|
</div>
|
|
{get_contexts country=1 assign="contexts"}
|
|
{$allCountries = $contexts.country->getAll()}
|
|
<div class="panel-body text-indent">
|
|
<div class="row">
|
|
<div class="col-md-4">
|
|
<strong>{$body.data.invoice_name} {$body.data.invoice_surname}</strong><br/>
|
|
{$body.data.invoice_street}{if $body.data.invoice_street}<br/>{/if}
|
|
{$body.data.invoice_custom_address}{if $body.data.invoice_custom_address}<br/>{/if}
|
|
{$body.data.invoice_zip} {$body.data.invoice_city}<br/>
|
|
{$body.data.invoice_state}{if $body.data.invoice_state}<br/>{/if}
|
|
{$invoice_country = $allCountries[$body.data.invoice_country]}
|
|
{if $invoice_country}{$invoice_country->getName()}{/if}
|
|
</div>
|
|
<div class="col-md-4">
|
|
{if $body.data.invoice_phone}<strong>{'phone'|translate}:</strong> {$body.data.invoice_phone}<br/>{/if}
|
|
{if $body.data.invoice_email}<strong>{'email'|translate}: </strong> <a href="mailto:{$body.data.invoice_email}">{$body.data.invoice_email}</a>
|
|
<span{if $body.acn!="add"} class="copy-to-clipboard" data-copy-clipboard="{$body.data.invoice_email}" data-toggle="tooltip" title="{'clipboard-copy'|translate:'button'}" {/if}></span>
|
|
{/if}
|
|
|
|
</div>
|
|
<div class="col-md-4">
|
|
{block "invoice-firm-info"}
|
|
{$body.data.invoice_firm} {if $body.data.invoice_firm}<br/>{/if}
|
|
{if $body.data.invoice_ico}
|
|
<strong>{'ico'|translate}:</strong>
|
|
{$body.data.invoice_ico}
|
|
<a href="javascript:nw('userOrders', 0, 'ico={$body.data.invoice_ico}');">
|
|
<span class="badge badge-default" title="Objednávky se stejným IČO">
|
|
<i class="glyphicon glyphicon-list-alt"></i>
|
|
</span>
|
|
</a>
|
|
<br/>
|
|
{/if}
|
|
{if $body.data.invoice_dic}<strong>{'dic'|translate}:</strong> {$body.data.invoice_dic}{/if}
|
|
{/block}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="panel panel-default panel-sm">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title">
|
|
{'sectionDeliveryData'|translate}
|
|
<a href="#" onclick="switchTab('flapUser');return false;">
|
|
<span class="badge badge-default pull-right" title="{'userEdit'|translate}">
|
|
<i class="glyphicon glyphicon-cog"></i>
|
|
</span>
|
|
</a>
|
|
</h3>
|
|
</div>
|
|
<div class="panel-body text-indent">
|
|
{if $order->hasSameAddress()}
|
|
<p>{'sameAsInvoice'|translate}</p>
|
|
{else}
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<strong>{$body.data.delivery_name} {$body.data.delivery_surname}<br/></strong>
|
|
{$body.data.delivery_street}<br/>
|
|
{$body.data.delivery_custom_address}{if $body.data.delivery_custom_address}<br/>{/if}
|
|
{$body.data.delivery_zip} {$body.data.delivery_city}<br/>
|
|
{$body.data.delivery_state}{if $body.data.delivery_state}<br/>{/if}
|
|
{$delivery_country = $allCountries[$body.data.delivery_country]}
|
|
{if $delivery_country}{$delivery_country->getName()}{/if}
|
|
</div>
|
|
<div class="col-md-6">
|
|
{block "delivery-firm-info"}
|
|
{$body.data.delivery_firm}{if $body.data.delivery_firm}<br/>{/if}
|
|
{$body.data.delivery_phone}
|
|
{/block}
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{get_statuses name="active" assign="statuses"}
|
|
{if $body.data.status|in_array:$statuses != false}
|
|
<div id="orderMerge" style="display:none;">
|
|
<div class="row">
|
|
<div class="col-md-3 col-md-offset-9 bottom-space">
|
|
<div class="input-group">
|
|
<input type="text" data-merge-id name="data[IDmerge]" size="7" placeholder="{'orderMerge'|translate}" class="form-control input-sm" id="IDmerge">
|
|
<div class="input-group-btn">
|
|
<input type="button" data-merge-submit name="SubmitMerge" value="{'merge'|translate}" class="btn btn-sm btn-primary"
|
|
onclick="document.location.assign(document.location + '&acn=merge&id_merge=' + $.dataField('IDmerge').val())">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
|
|
<!-- polozky start -->
|
|
<a name=checkoutControlTop></a>
|
|
<script type="text/javascript">
|
|
function appendToMessage($span) {
|
|
var href = '{$body.data.domain}/product_z' + $span.data('id');
|
|
if (editor0.getData())
|
|
editor0.insertHtml('<br/>');
|
|
editor0.insertHtml('<a href=' + href + '>' + $span.text() + '</a>');
|
|
}
|
|
</script>
|
|
<div class="panel panel-default panel-sm no-margin">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title">
|
|
<div class="row">
|
|
<div class="col-md-2">
|
|
{'sectionCurrentItems'|translate}
|
|
</div>
|
|
<div class="col-md-5 text-right">
|
|
{block "products-header"}
|
|
{$heurekaId = $order->getData('heureka_id')}
|
|
{if $heurekaId}
|
|
<strong style="padding-right: 30px;">Heureka ID: {$heurekaId}</strong>
|
|
{/if}
|
|
{/block}
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<div {if $body.acn!="add"} class="copy-to-clipboard" data-copy-clipboard="{$body.data.order_no}" data-toggle="tooltip" title="{'clipboard-copy'|translate:'button'}" {/if}>
|
|
<strong>{'code'|translate}: {if $body.acn!="add"}{$body.data.order_no}{/if}</strong>
|
|
</div>
|
|
<input type="hidden" name="data[order_no]" value="{$body.data.order_no}">
|
|
</div>
|
|
<div class="col-md-2 text-right">
|
|
<a href="#" onclick="switchTab('flapItems');return false;" title="{'itemsEdit'|translate}">
|
|
<span class="badge badge-default pull-right">
|
|
<i class="glyphicon glyphicon-cog"></i>
|
|
</span>
|
|
</a>
|
|
{get_statuses name="active" assign="statuses"}
|
|
{if $body.data.status|in_array:$statuses != false}
|
|
<a href="#"
|
|
{if $body.paid && $body.paid->isZero() && intval($body.data.storno) == 0 }
|
|
onclick="javascript:nw('SplitOrder', '', 'ID={$body.data.id}');"
|
|
title="{'splitOrder'|translate}"
|
|
{else}
|
|
disabled="disabled" title="{'splitOrderDisabled'|translate}"
|
|
{/if}
|
|
>
|
|
<span class="badge badge-default pull-right">
|
|
<i class="glyphicon glyphicon-duplicate"></i>
|
|
</span>
|
|
</a>
|
|
|
|
<a href="#"
|
|
onclick="searchWnd('orders', 'mergeOrder', $.dataField('IDmerge').val(), 'function=1&customer={$body.data.invoice_email}&filters[onlyActive]=1&filters[except]={$body.data.id}');return false"
|
|
title="{'mergeOrders'|translate}">
|
|
<span class="badge badge-default pull-right">
|
|
<i class="glyphicon glyphicon-compressed"></i>
|
|
</span>
|
|
</a>
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
</h3>
|
|
</div>
|
|
{block "items-table"}
|
|
{block "items-vat-price-filter"}
|
|
{$pricePreferred = 'value_with_vat'}
|
|
{if ($dbcfg->prod_prefer_price_vat == 'N')}
|
|
{$pricePreferred = 'value_without_vat'}
|
|
{/if}
|
|
{/block}
|
|
<table xmlns="http://www.w3.org/1999/xhtml" class="table table-collapsed table-striped table-recapitulation">
|
|
<thead>
|
|
<tr>
|
|
<th scope="col" style="width:80px;">{'itemAction'|translate}</th>
|
|
<th scope="col">{'piecesUnit'|translate}</th>
|
|
<th scope="col" style="min-width:300px;">{'item'|translate}</th>
|
|
<th scope="col">{'productCode'|translate}</th>
|
|
<th scope="col">EAN</th>
|
|
<th scope="col">{'noteShort'|translate}</th>
|
|
<th scope="col">{'stock'|translate}</th>
|
|
{if ($pricePreferred == 'value_with_vat')}
|
|
<th scope="col">{'piecePrice'|translate} {'withTax'|translate:'choice'}</th>
|
|
<th scope="col">{'priceWithVat'|translate}</th>
|
|
{else}
|
|
<th scope="col">{'piecePrice'|translate} {'withoutTax'|translate:'choice'}</th>
|
|
<th scope="col">{'priceWithoutVat'|translate}</th>
|
|
{/if}
|
|
{block "items-header-additional-columns"}{/block}
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{ifmodule STORES}
|
|
{get_stores_inStore assign="storesInStore"}
|
|
{$stores = $storesInStore->getStores()}
|
|
{$delivery = $order->getDeliveryType()->getDelivery()}
|
|
{$cur_store = $storesInStore->getStoreByDeliveryId($delivery.id)}
|
|
{$cur_store_in_store = "store{$cur_store.id}_in_store"}
|
|
{/ifmodule}
|
|
{foreach from=$body.oop item=item key=key}
|
|
{if empty($item.id_product) || $item.in_store + $item.piecesOrdered >= 0}
|
|
{$class="row-green"}
|
|
{if $item.id_product && $cur_store_in_store && ($item[$cur_store_in_store] < 0)}
|
|
{$class="row-orange"}
|
|
{/if}
|
|
{else}
|
|
{if $item.in_store + $item.piecesOrdered + $item.piecesInSuppliers >= 0}
|
|
{$class="row-orange"}
|
|
{else}
|
|
{$class="row-red"}
|
|
{/if}
|
|
{/if}
|
|
<tr class="{$class} {$item.class}" data-item-id="{$item.ID}">
|
|
<td class="no-padding">
|
|
<a type="button" href="#" onclick="appendToMessage($(this).parentsUntil('tbody').find('.productname'));return false;" class=""
|
|
title="{'commentName'|translate}">
|
|
<span class="badge badge-default pull-left"><span class=" glyphicon glyphicon-comment"></span></span>
|
|
</a>
|
|
<a rel="product" href="{$item.img}"><span class="badge badge-default pull-left">
|
|
<span class="glyphicon glyphicon-picture" title="{'showProdImg'|translate}"></span></span>
|
|
</a>
|
|
</td>
|
|
<td>
|
|
{$item.pieces}
|
|
</td>
|
|
<td>
|
|
<div class="list_item">
|
|
<div class="productname" data-id='{$item.id_product}'>
|
|
{block productname}
|
|
{if $item.id_product > 0}
|
|
<a href="javascript:nw('product', '{$item.id_product}');"><strong>{$item.descr}</strong></a>
|
|
{else}
|
|
<strong>{$item.descr}</strong>
|
|
{/if}
|
|
{$item.variation_title}
|
|
{block "productname-note"}
|
|
{if $item.item_note}
|
|
<small>{$item.item_note}</small>
|
|
{/if}
|
|
{/block}
|
|
{/block}
|
|
</div>
|
|
</div>
|
|
</td>
|
|
<td>
|
|
{if findModule("products_suppliers")&& {find_right name="INSTORE_STOCKIN"}}
|
|
<a href="javascript:nw('productCodes', {$item.id_product}{if {$item.id_variation}}, {$item.id_variation}{else}{/if})" title="Kódy dodavatelů">
|
|
{$item.code}
|
|
</a>
|
|
{else}
|
|
{$item.code}
|
|
{/if}
|
|
</td>
|
|
<td>{block productEan}{$item.ean}{/block}</td>
|
|
<td>{$item.note_}</td>
|
|
<td>{strip}<b>{$item.in_store}</b>
|
|
{if $item.piecesOrdered>0 }/<abbr title="{'physicallyInstore'|translate}">{$item.in_store+$item.pieces+$item.piecesOrdered}</abbr>{/if}
|
|
{if $item.id_product && $cur_store_in_store}
|
|
{$short_text = ''}
|
|
{$long_text = ''}
|
|
{block 'storesTextForeach'}
|
|
{foreach $stores as $key => $store}
|
|
{$store_in_store = $item["store`$key`_in_store"]}
|
|
{if $store.type <= 1}
|
|
{if $key == 1 || $store_in_store != 0}
|
|
{$short_text = "`$short_text``$store_in_store|string_format:"%+d"`"}
|
|
{/if}
|
|
{$long_text = "`$long_text``$store_in_store` ks `$store.name`\n"}
|
|
{/if}
|
|
{/foreach}
|
|
{/block}
|
|
(
|
|
<abbr title="{$long_text}">
|
|
{if mb_strlen($short_text) > 100}
|
|
{'tooLongShortText'|translate}
|
|
{else}
|
|
{$short_text|ltrim:'+'}
|
|
{/if}
|
|
</abbr>
|
|
)
|
|
{/if}
|
|
{if {$item.id_product} && ({find_module name="products_suppliers"} || {find_module name="orders_of_suppliers"})
|
|
&& {find_right name="INSTORE_STOCKIN"}}
|
|
<a href="javascript:showProductCodes({$item.id_product}{if {$item.id_variation}}, {$item.id_variation}{else}{/if})">
|
|
{foreach from=$item.suppliers item=supplier key=key}
|
|
/
|
|
<span title="{$supplier.name} - {$supplier.code}">{$supplier.in_store}</span>
|
|
{/foreach}
|
|
</a>
|
|
{if $module.STOCK_IN}
|
|
{foreach $item.stock_in as $stock_in}
|
|
<span title="Předkpokládáné naskladnění za {$stock_in.stock_in_days} dnů; Budoucí naskladnění {$stock_in.date_issued} - {$stock_in.name}">
|
|
/(<span {if $stock_in.stock_in_days > 7}style="color:red"{/if}>{$stock_in.future_stock_in_pieces}</span>)
|
|
</span>
|
|
{/foreach}
|
|
{foreach $item.preorder_stock_in as $stock_in}
|
|
<span title="Předkpokládáné budoucí naskladnění za {$stock_in.stock_in_days} dnů; Budoucí naskladnění {$stock_in.date_issued} - {$stock_in.name}">
|
|
/(<span class="text-danger">{$stock_in.preorder_stock_in_pieces}</span>)
|
|
</span>
|
|
{/foreach}
|
|
{/if}
|
|
{/if}
|
|
{/strip}
|
|
</td>
|
|
<td>{$item.PiecePrice[$pricePreferred]|format_price:"ceil=no;decimal=dynamic"} {if !$item.discount->isZero()}{block "item-discount"}(-{$item.discount|format_editable_price:-2}%){/block}{/if}</td>
|
|
<td>{$item.Price[$pricePreferred]|format_price:"ceil=no;decimal=dynamic"}
|
|
{if $item.custom_data.priceWithoutDiscounts && $item.custom_data.totalDiscount}
|
|
{$priceWithoutDiscounts = $item.custom_data.priceWithoutDiscounts * $item.pieces}
|
|
{$totalDiscount = $item.custom_data.totalDiscount * $item.pieces}
|
|
<abbr style="white-space: nowrap;" title="Původní cena - celková sleva">({$priceWithoutDiscounts|format_price:"ceil=no;decimal=dynamic"} - {$totalDiscount|format_price:"ceil=no;decimal=dynamic"})</abbr>
|
|
{/if}
|
|
</td>
|
|
{block "items-table-additional-columns"}{/block}
|
|
</tr>
|
|
{/foreach}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
{/block}
|
|
</div>
|
|
|
|
{$userContent = $order->getData('user-content')}
|
|
{if !empty($userContent)}
|
|
<div class="panel panel-default panel-sm" style="margin-top: 20px; margin-bottom: 0;">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title">
|
|
Přílohy
|
|
</h3>
|
|
</div>
|
|
<table class="table">
|
|
{foreach $userContent as $file}
|
|
<tr>
|
|
<td style="text-align: center;width: 100px;">
|
|
{if $file.filename|strstr:".jpeg" or $file.filename|strstr:".jpeg" or $file.filename|strstr:".png" or $file.filename|strstr:".gif"}
|
|
<img src="{$file.src}" style="width: 70px;height: auto;">
|
|
{/if}
|
|
</td>
|
|
<td style="vertical-align: middle;">
|
|
{$file.originalFilename}
|
|
</td>
|
|
<td style="width: 120px; text-align: right; vertical-align: middle;">
|
|
<a href="{$file.src}" target="_blank">Zobrazit <i class="glyphicon glyphicon-new-window"></i></a>
|
|
</td>
|
|
<td style="width: 120px; text-align: right; vertical-align: middle;">
|
|
<a href="{$file.src}" download>Stáhnout <i class="glyphicon glyphicon-floppy-save"></i></a>
|
|
</td>
|
|
</tr>
|
|
{/foreach}
|
|
</table>
|
|
</div>
|
|
{/if}
|
|
|
|
|
|
<div class="panel-body row" id="deliveryTypes" style="">
|
|
{block "delivery"}
|
|
{if findModule('eshop_delivery') or findModule('deliveries')}
|
|
{$deliveryType = $order->getDeliveryType()}
|
|
<div class="col-md-6">
|
|
|
|
<div class="row d-flex">
|
|
<div class="control-label">
|
|
<label>{'delivery'|translate}</label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<select class="selecter" name="data[delivery]" data-delivery-select="id_delivery">
|
|
{$deliveries = [['name' => '---']] + $view->getDeliveryList()}
|
|
{foreach $deliveries as $id_delivery => $delivery}
|
|
<option value="{$id_delivery}" {$id_delivery|selected:$deliveryType.id_delivery}>{$delivery.name_admin|default:$delivery.name}</option>
|
|
{/foreach}
|
|
</select>
|
|
</div>
|
|
|
|
<div class="control-label">
|
|
<label>{'payment'|translate}</label>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<select class="selecter" name="data[payment]" data-delivery-select="id_payment">
|
|
{$payments = [['name' => '---']] + $view->getPaymentList()}
|
|
{foreach $payments as $id_payment => $payment}
|
|
<option value="{$id_payment}" {$id_payment|selected:$deliveryType.id_payment}>{$payment.name_admin|default:$payment.name}</option>
|
|
{/foreach}
|
|
</select>
|
|
</div>
|
|
|
|
<div class="">
|
|
<button name="acn" value="refreshDeliveryType" class="btn btn-sm btn-primary{if $body.duplicate} disabled{/if}" title="{'infoRefreshDelivery'|translate}"
|
|
{if $body.duplicate}disabled{/if}>
|
|
{'recalculate'|translate}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row d-flex">
|
|
{if $deliveryType}
|
|
<div style="margin-top: 10px;">
|
|
{$deliveryType->getDelivery()->printDeliverySettings($order) nofilter}
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
|
|
<div class="row d-flex">
|
|
{if $body.payment_method}
|
|
<div style="padding-right: 20px;">
|
|
<label>{'paymentMethod'|translate}:</label> {$body.payment_method.name}
|
|
</div>
|
|
{/if}
|
|
{if $module.PRODUCTS__WEIGHT}
|
|
<div style="padding-right: 20px;">
|
|
<label>{'weight'|translate}:</label> {$order->getTotalWeight()|format_editable_number:-6} kg
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
|
|
{if $body.data.packages}
|
|
<div class="row d-flex">
|
|
<div style="padding-right: 20px;">
|
|
<label>{'trackingNumber'|translate}:</label>
|
|
{foreach $body.data.packages as $package}
|
|
{if $package.track_url}
|
|
<a href="{$package.track_url}">{$package.package_id}</a>{if !$package@last}, {/if}
|
|
{else}
|
|
{$package.package_id}{if !$package@last}, {/if}
|
|
{/if}
|
|
{/foreach}
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
{else}
|
|
<div class="col-md-6">
|
|
{if $module.PRODUCTS__WEIGHT}
|
|
<div style="margin-top: 10px; flex-grow: 1;">{'weight'|translate}: {$order->getTotalWeight()|format_editable_number:-6} kg</div>
|
|
{/if}
|
|
</div>
|
|
{/if}
|
|
{/block}
|
|
|
|
{block "payment"}
|
|
{if $module.ORDER_PAYMENT && $body.acn != 'add'}
|
|
{$total_price = $body.data.total_price}
|
|
{if isset($body.paid)}
|
|
{$paid_remaining = $total_price->sub($body.paid)}
|
|
{else}
|
|
{$paid_remaining = $total_price}
|
|
{/if}
|
|
{$paid_remaining_CZK = $order->getRemainingPaymentInCZK()}
|
|
<div class="col-md-2 text-right">
|
|
{if !$paid_remaining_CZK->lowerThan(toDecimal(1))}
|
|
<a href="{$ctrl.currUrl.Rel}&acn=payOrder&flap=1" class="btn btn-sm btn-success {if !{find_right name="POS_ADD"}}disabled{/if}">{'actionPay'|translate}
|
|
{if $module.EET && $deliveryType && $deliveryType->payment_class}
|
|
{if $deliveryType->payment_class->requiresEET()}
|
|
+ EET
|
|
{/if}
|
|
{/if}
|
|
</a>
|
|
{elseif $paid_remaining_CZK->lowerThan(toDecimal(-1))}
|
|
<a href="{$ctrl.currUrl.Rel}&acn=payOrder&flap=1" class="btn btn-sm btn-danger {if !{find_right name="POS_ADD"}}disabled{/if} confirm" title="Vrátit přeplatek">{'actionReturnOverpayment'|translate}
|
|
{if $module.EET && $deliveryType && $deliveryType->payment_class}
|
|
{if $deliveryType->payment_class->requiresEET()}
|
|
+ EET
|
|
{/if}
|
|
{/if}
|
|
</a>
|
|
{else}
|
|
<a type="submit" class="btn btn-sm btn-success disabled" disabled>{'statusPaid'|translate}</a>
|
|
{/if}
|
|
</div>
|
|
<div class="col-md-4" style="padding-right: 0;">
|
|
<h5 class="no-margin text-right">{'totalPricePay'|translate}: {$body.data.total_price|format_price:"ceil=no;decimal=dynamic"} {'withTax'|translate:'choice'}</h5>
|
|
|
|
<h6 class="text-right" style="margin: 4px 0 0; font-weight: 700;">{$body.data.total_price_without_vat->value(2)|format_price:"ceil=no;decimal=dynamic"} {'withoutTax'|translate:'choice'}</h6>
|
|
|
|
<div class="d-flex justify-content-end align-items-center" style="margin-top: 7px">
|
|
<h6 class="no-margin pull-right" style="margin-right:5px;"><strong>Platby:</strong></h6>
|
|
|
|
|
|
{if ($body.paid && !$body.paid->isZero()) || $paid_remaining_CZK->lowerThan(toDecimal(-1))}
|
|
<a href="javascript:nw('orderPayments', {$body.data.id});" title="Platby">
|
|
<p class="no-margin badge badge-success badge-light pull-right" style="margin-right: 5px;">
|
|
{'amountPaid'|translate}: {$body.paid|format_price:"ceil=no;decimal=dynamic"}
|
|
</p>
|
|
</a>
|
|
{/if}
|
|
|
|
{if !$paid_remaining_CZK->lowerThan(toDecimal(1)) || $paid_remaining_CZK->lowerThan(toDecimal(-1))}
|
|
<a href="javascript:nw('orderPayments', {$body.data.id});" title="Platby">
|
|
<p class="no-margin badge badge-warning badge-light pull-right" style="margin-right: 5px;">
|
|
{if $paid_remaining_CZK->lowerThan(toDecimal(1))}
|
|
{'preplatek'|translate}: {$paid_remaining->abs()|format_price:"ceil=no;decimal=dynamic"}
|
|
{else}
|
|
{'amountRemaining'|translate}: {$paid_remaining|format_price:"ceil=no;decimal=dynamic"}
|
|
{/if}
|
|
</p>
|
|
</a>
|
|
{if $returnId}
|
|
<a href="javascript:nw('orderPayment', 0, 'data[id_order]={$body.data.id}&data[note]=Vratka&autoclose=1&replacement=1&data[price]={$paid_remaining}');"
|
|
title="{'actionReturn'|translate}">
|
|
<p class="no-margin badge badge-primary badge-light pull-right" style="margin-right: 5px;">
|
|
{'actionReturn'|translate}
|
|
</p>
|
|
</a>
|
|
{else}
|
|
<a href="javascript:nw('orderPayment', 0, 'data[id_order]={$body.data.id}&autoclose=1&data[price]={$paid_remaining}');" title="{'actionPay'|translate}">
|
|
<p class="no-margin badge badge-primary badge-light pull-right" style="margin-right: 5px;">
|
|
{'actionPay'|translate}
|
|
</p>
|
|
</a>
|
|
{/if}
|
|
{/if}
|
|
|
|
<a href="javascript:nw('orderPayments', {$body.data.id});">
|
|
<span class="badge badge-default pull-right" title="Platby">
|
|
<i class="glyphicon glyphicon-list-alt"></i>
|
|
</span>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
{else}
|
|
<div class="col-md-2 control-label">
|
|
<label>{'statusPaid'|translate}</label>
|
|
</div>
|
|
<div class="col-md-1">
|
|
{print_toggle name="status_payed"}
|
|
</div>
|
|
<div class="col-md-3 control-label">
|
|
<h5 class="no-margin">{'total'|translate}: {$body.data.total_price|format_price} ({'withTax'|translate:'choice'})</h5>
|
|
<h6 class="no-margin pull-right"><strong>{$body.data.total_price_without_vat|format_price} ({'withoutTax'|translate:'choice'}) </strong></h6>
|
|
</div>
|
|
{/if}
|
|
{/block}
|
|
</div>
|
|
|
|
<div class="panel panel-default panel-sm">
|
|
{block historyHeader}
|
|
<div class="panel-heading"><h3 class="panel-title">{'sectionComm'|translate}</h3></div>
|
|
{/block}
|
|
|
|
<table class="table order-history">
|
|
<thead>
|
|
<tr>
|
|
<th width="13%">{'date'|translate:'base'}</th>
|
|
<th width="15%">{'orderStatus'|translate}</th>
|
|
<th width="55%">{'note'|translate}</th>
|
|
<th width="10%">{'sent'|translate}</th>
|
|
<th scope="col">admin</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{$email_types = translate('email_types', 'emails')}
|
|
|
|
{function renderHistoryStatus}
|
|
{$long_text = ""}
|
|
{if $row.custom_data.email_type}
|
|
{$long_text = "E-mail: "|cat:$row.custom_data.email_type}
|
|
{if $email_types[$row.custom_data.email_type]}
|
|
{$long_text = "E-mail: "|cat:{$email_types[$row.custom_data.email_type]}}
|
|
{/if}
|
|
{/if}
|
|
{if $row.custom_data.subject}
|
|
{$long_text = $long_text|cat: "\nPředmět: "|cat:{$row.custom_data.subject}}
|
|
{/if}
|
|
{if $row.custom_data.email_id}
|
|
{$long_text = $long_text|cat: "\nID: "|cat:$row.custom_data.email_id}
|
|
{/if}
|
|
{if $long_text}<abbr title="{$long_text}">{$status}</abbr>{else}{$status}{/if}
|
|
{if !empty($row.attachments)}
|
|
<span class="badge badge-default m-l-1" title="Přílohy: {$row.attachments}"><i class="glyphicon glyphicon-paperclip"></i></span>
|
|
{/if}
|
|
{/function}
|
|
|
|
{foreach from=$body.orders_history item=row}
|
|
<tr style="{if $row.notified == 3||$row.custom_data.user_note}background-color: #bfec55;{/if}">
|
|
<td>{$row.datef}</td>
|
|
<td>{block ordersHistoryStatus}{$cfg.Order.Status.global[$row.id_status]}{/block}</td>
|
|
<td>
|
|
<div class="order-comment {if $row.comment|strlen > 350}overlay{/if}">{$row.comment nofilter}</div>
|
|
{if $row.comment|strlen > 350}<a href="" data-toggle="description-overlay" class="read-more"><span class="badge badge-light">Číst více</span></a>{/if}</td>
|
|
<td>
|
|
{switch $row.notified}
|
|
{case 0}NE{/case}
|
|
{case 1}
|
|
{renderHistoryStatus row=$row status='ANO'}
|
|
{/case}
|
|
{case 2}SMS Odeslaná{/case}
|
|
{case 3}SMS Přijatá{/case}
|
|
{case 4}
|
|
{renderHistoryStatus row=$row status='Odesílá se'}
|
|
{/case}
|
|
{case 5}
|
|
{renderHistoryStatus row=$row status='Selhalo'}
|
|
{/case}
|
|
{/switch}
|
|
</td>
|
|
<td>{$row.login}{if $row.custom_data.initiator}<br><small>{$row.custom_data.initiator->name}</small>{/if}</td>
|
|
</tr>
|
|
{/foreach}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
</div>
|
|
<div class="row">
|
|
{block orderBottomArea}
|
|
<div class="col-md-5">
|
|
<h1 class="h4 main-panel-title">{'orderStatus'|translate}</h1>
|
|
|
|
{include "block.UserMessages.tpl" emailsInStatuses="ORDER_MESSAGE" attachmentTypes=$body.attachments_types|json_decode:true attachmentUrls=$body.attachments_urls|json_decode:true formSelector="#editform"}
|
|
{renderStatusButtons statuses=getOrderStatuses() userMessageKey="status_comment"}
|
|
|
|
{block order_flags}
|
|
{if (!empty($cfg.Order.Flags))}
|
|
<div class="row form-group">
|
|
<div class="col-md-12">
|
|
{foreach $cfg.Order.Flags as $key=>$flag}
|
|
<div class="checkbox pull-left">
|
|
<input type="checkbox" name="data[flags][]" value="{$key}"
|
|
{if $body.data.flags_array[$key]}checked="checked"{/if} id="f{$key}" class="check"/>
|
|
<label for="f{$key}">{$flag.name}</label>
|
|
</div>
|
|
{/foreach}
|
|
</div>
|
|
</div>
|
|
{/if}
|
|
{/block}
|
|
</div>
|
|
<div class="col-md-7">
|
|
<h1 class="h4 main-panel-title d-flex justify-content-between">
|
|
<span>{'comments'|translate} <span data-attachment="" class="badge badge-default pull-right"></span></span>
|
|
{insert_llm_button type='order_comment' target="comments"}
|
|
</h1>
|
|
<div class="row form-group">
|
|
<div class="col-md-12">
|
|
<textarea id="comments" name="data[comments]" wrap="soft"></textarea>
|
|
{insert_wysiwyg target="comments" type="BasicTable"
|
|
config="toolbarStartupExpanded : false,startupFocus : false,removePlugins : 'elementspath', height:'150px', resize_minHeight:'100px', resize_enabled:false, ignoreEmptyParagraph:true, startupOutlineBlocks:false"}
|
|
</div>
|
|
</div>
|
|
<div class="form-group">
|
|
<div class="col-md-6">
|
|
{block 'doNotNotifyCheckbox'}
|
|
<div class="checkbox">
|
|
<input type="checkbox" class="check" value="1" name="data[doNotNotify]" id="donotnotify" {if $returnId || $dbcfg.doNotNotify == 'Y'}checked{/if}>
|
|
<label for="donotnotify"><strong>{'negation'|translate}</strong>{'sendEmail'|translate}</label>
|
|
</div>
|
|
{/block}
|
|
</div>
|
|
<div class="col-md-6">
|
|
{block 'sendSMS'}
|
|
{if $body.SMSSenderBackend}
|
|
<div class="checkbox">
|
|
<input type="checkbox" class="check" value="1" name="data[send_telfa_sms]" id="send_telfa_sms">
|
|
<label for="send_telfa_sms" id="send_label_telfa_sms">Odeslat jako sms</label>
|
|
</div>
|
|
{/if}
|
|
{/block}
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
|
|
|
|
|
|
{renderMessageButtons}
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{/block}
|
|
|
|
<script type="text/javascript">
|
|
window.searchWndCallbacks = {
|
|
mergeOrder: function(val, data) {
|
|
let order_id = val;
|
|
let order_no = data['order_no'];
|
|
|
|
setTimeout(function() {
|
|
if (confirm('Jste si jisti, že chcete sloučit objednávku s objednávkou číslo ' + order_no + '?')) {
|
|
$('[data-merge-id]').val(order_id);
|
|
$('[data-merge-submit]').click();
|
|
}
|
|
}, 100); // TODO: HACK kvuli osklivemu chromu, ktery suppressne popup dialogy (od v69) pokud je focusnute jine okno,
|
|
// proto se musi chvili pockat nez se zavre focusnute okno a focusne se to pod tim
|
|
},
|
|
};
|
|
|
|
var balik_id = "{$body.data.package_id}";
|
|
var textUser = [];
|
|
{foreach $view->getEmail()->getOrderMessages($body.data.id_language) as $message}
|
|
textUser['{$message.name}'] = "{$message.body|escape:'javascript'}";
|
|
{/foreach}
|
|
|
|
{if $body.acn!="add"}
|
|
var messages = EmailMessages;
|
|
messages.attachmentTypes = JSON.parse('{$body.attachments_types nofilter}');
|
|
messages.attachmentUrls = JSON.parse('{$body.attachments_urls nofilter}');
|
|
{/if}
|
|
|
|
{if findModule('telfa')}
|
|
function checkSendSMS() {
|
|
var check = $('#send_label_telfa_sms');
|
|
|
|
if (!check.is(':checked'))
|
|
check.trigger('click');
|
|
}
|
|
{/if}
|
|
|
|
function insertUserMessage(message, fromStatus, attachments) {
|
|
var msg = $('<div/>').html(textUser[message]).text();
|
|
|
|
msg = messages.replacePlaceholders(msg, balik_id);
|
|
|
|
if (!fromStatus)
|
|
editor0.insertHtml(msg);
|
|
else
|
|
editor0.setData(msg);
|
|
|
|
$('#status_comment').val(message);
|
|
{if $dbcfg.doNotNotify == 'Y'}
|
|
$('#donotnotify').prop("checked", false);
|
|
{/if}
|
|
messages.renderAttachments(attachments);
|
|
}
|
|
</script>
|
|
</div>
|
|
|
|
{block orderStatusButtons}
|
|
|
|
{/block}
|
|
|
|
<script type="text/javascript">
|
|
{if findModule('eshop_delivery') or findModule('deliveries')}
|
|
$('form[name="editform"]').on('submit', function() {
|
|
const types = {$view->getValidDeliveryTypes()|json_encode nofilter};
|
|
const id_delivery = $('[data-delivery-select="id_delivery"]').val();
|
|
const id_payment = $('[data-delivery-select="id_payment"]').val();
|
|
|
|
console.log(id_delivery, id_payment);
|
|
|
|
if (!types.hasOwnProperty(id_delivery + '-' + id_payment)) {
|
|
alert('Vybraná kombinace dopravy a platby neexistuje!');
|
|
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
});
|
|
{/if}
|
|
|
|
$('#statusButtons').on('click', '[data-status]', function(e) {
|
|
$(this).closest('#statusButtons').find('.btn-active').removeClass('btn-active');
|
|
$(this).closest('div').find('button').addClass('btn-active');
|
|
$('#status_combo').val($(this).data('status'));
|
|
return true;
|
|
});
|
|
|
|
$('#deliveryTypes').on('click', '[data-delivery]', function(e) {
|
|
var id_delivery = $(this).data('delivery');
|
|
|
|
document.location = 'launch.php?s=orders.php&acn=changeDelivery&ID={$body.data.id}&id_delivery=' + id_delivery;
|
|
|
|
return false;
|
|
});
|
|
|
|
$('a[rel=product]').fancybox({
|
|
openEffect: 'none',
|
|
closeEffect: 'none',
|
|
type: 'image',
|
|
helpers: {
|
|
overlay: {
|
|
locked: false
|
|
}
|
|
}
|
|
});
|
|
|
|
$('.table-recapitulation').on('dblclick', 'tbody tr', function() {
|
|
var $ID = $(this).data('item-id');
|
|
|
|
$('a[href*=flapItems]').click();
|
|
|
|
$('#flapItems iframe').on('load', function() {
|
|
openRow($ID);
|
|
});
|
|
openRow($ID);
|
|
});
|
|
|
|
function openRow($ID) {
|
|
var panel = $('#flapItems iframe').contents().find('.panel[data-form-item=' + $ID + '] .panel-heading').parent();
|
|
panel.find('.collapsed').click();
|
|
panel.find('[data-calculate=pieces]').focus();
|
|
}
|
|
|
|
$('[data-toggle="description-overlay"]').on('click', function(){
|
|
$(this).siblings('.overlay').removeClass('overlay');
|
|
$(this).hide();
|
|
return false;
|
|
});
|
|
|
|
window.onload = function(event) {
|
|
let params = new URLSearchParams(location.search.substring(1));
|
|
if (params.get('reload_parent') && window.opener != null) {
|
|
window.opener.location.reload();
|
|
params.delete('reload_parent');
|
|
location.replace(location.origin + location.pathname + "?" + params.toString());
|
|
}
|
|
};
|
|
|
|
</script>
|
|
|
|
|