Files
sterivein/templates/admin/default/order-edit.html
Etienne Roudeix 1ffcaa7dd4 order admin
2013-09-25 15:55:48 +02:00

478 lines
30 KiB
HTML

{extends file="admin-layout.tpl"}
{block name="page-title"}{intl l='Edit an order'}{/block}
{block name="check-permissions"}admin.order.edit{/block}
{block name="main-content"}
<div class="orders edit-order">
<div id="wrapper" class="container">
<ul class="breadcrumb">
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
<li><a href="{url path='/admin/orders'}">{intl l="Orders"}</a></li>
</ul>
<div class="row">
<div class="col-md-12">
<div class="general-block-decorator">
{ifloop rel='the-order'}
{loop type="order" name="the-order" id=$order_id customer="*"}
{loop type="currency" name="order-currency" id=$CURRENCY}
{assign "orderCurrency" $SYMBOL}
{/loop}
{assign "orderStatusId" $STATUS}
<div class="lead clearfix">
<span class='label label-default pull-left'>{$REF}</span>
<div class="pull-right select-fixed-width">
<form id="order-update-status-form" action="{url path="/admin/order/update/$ID/status"}" method="post">
<select class="js-update-order-status" name="status_id" data-toggle="selectpicker">
{loop type="order-status" name="all-status"}
{assign "orderStatusLabel" "order_$CODE"}
<option {if $ID == $orderStatusId}selected="selected" {/if} value="{$ID}" data-content="<span class='label label-{#$orderStatusLabel#}'>{$TITLE}</span>">{$TITLE}</option>
{/loop}
</select>
</form>
</div>
</div>
<ul class="nav nav-tabs clearfix">
<li class="active"><a href="#cart" data-toggle="tab"><span class="glyphicon glyphicon-shopping-cart"></span> {intl l="Ordered products"}</a></li>
<li><a href="#bill" data-toggle="tab"><span class="glyphicon glyphicon-list-alt"></span> {intl l="Invoice and Delivery"}</a></li>
</ul>
<div class="tab-content">
<div class="tab-pane fade active in" id="cart">
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
{intl l='Cart'}
</caption>
<thead>
<tr>
<th class="col-md-7">{intl l="Product"}</th>
<th class="col-md-1">{intl l="Unit. price"}</th>
<th class="col-md-1">{intl l="Tax"}</th>
<th class="col-md-1">{intl l="Unit taxed price"}</th>
<th class="col-md-1">{intl l="Quantity"}</th>
<th class="col-md-1">{intl l="Taxed total"}</th>
</tr>
</thead>
<tbody>
{loop type="order_product" name="order-products" order=$ID}
{if $WAS_IN_PROMO == 1}
{assign "realPrice" $PROMO_PRICE}
{assign "realTax" $PROMO_PRICE_TAX}
{assign "realTaxedPrice" $TAXED_PROMO_PRICE}
{else}
{assign "realPrice" $PRICE}
{assign "realTax" $PRICE_TAX}
{assign "realTaxedPrice" $TAXED_PRICE}
{/if}
<tr>
<td>
<a href="#">{$TITLE}</a>
{ifloop rel="combinations"}
<dl class="dl-horizontal">
{loop type="order_product_attribute_combination" name="combinations" order_product=$ID}
<dt>{$ATTRIBUTE_TITLE}</dt>
<dd>{$ATTRIBUTE_AVAILABILITY_TITLE}</dd>
{/loop}
</dl>
{/ifloop}
</td>
<td>{$orderCurrency} {$realPrice}</td>
<td>{$orderCurrency} {$realTax}</td>
<td>{$orderCurrency} {$realTaxedPrice}</td>
<td>{$QUANTITY}</td>
<td>{$orderCurrency} {$realTaxedPrice * $QUANTITY}</td>
</tr>
{/loop}
</tbody>
<tbody class="table-condensed">
<tr class="active">
<td colspan="2" class="td-unstyled"></td>
<td colspan="3"><strong>{intl l="Total without discount"}</strong></td>
<td><strong>{$orderCurrency} {$TOTAL_TAXED_AMOUNT-$POSTAGE}</strong></td>
</tr>
<tr>
<td colspan="2" class="td-unstyled"></td>
<td colspan="3"><strong>{intl l="Discount"}</strong></td>
<td><strong>{$orderCurrency} 0</strong></td>
</tr>
<tr class="active">
<td colspan="2" class="td-unstyled"></td>
<td colspan="3"><strong>{intl l="Coupon code"}</strong></td>
<td><strong>{$orderCurrency} 0</strong></td>
</tr>
<tr>
<td colspan="2" class="td-unstyled"></td>
<td colspan="3"><strong>{intl l="Total including discount"}</strong></td>
<td><strong>{$orderCurrency} {$TOTAL_TAXED_AMOUNT-$POSTAGE}</strong></td>
</tr>
<tr class="active">
<td colspan="2" class="td-unstyled"></td>
<td colspan="3"><strong>{intl l="Postage"}</strong></td>
<td><strong>{$orderCurrency} {$POSTAGE}</strong></td>
</tr>
<tr>
<td colspan="2" class="td-unstyled"></td>
<td colspan="3" class="last"><strong>{intl l="Total"}</strong></td>
<td class="last"><strong>{$orderCurrency} {$TOTAL_TAXED_AMOUNT}</strong></td>
</tr>
</tbody>
</table>
</div>
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
{intl l='Payment information'}
</caption>
<tbody>
<tr>
<th>{intl l="Payment module"}</th>
<td>{loop name="payment-module" type="module" id=$PAYMENT_MODULE}{$TITLE}{/loop}</td>
</tr>
<tr>
<th>{intl l="Transaction reference"}</th>
<td>{$TRANSACTION_REF}</td>
</tr>
</tbody>
</table>
</div>
</div> <!-- #cart -->
<div class="tab-pane fade clearfix" id="bill">
<div class="title title-without-tabs clearfix">
{intl l='Delivery module'}
<div class="pull-right col-md-3">
<form action="{url path="/admin/order/update/$ID/delivery-ref"}" method="post">
<div class="input-group">
<input class="form-control" type="text" name="delivery_ref" value="{$DELIVERY_REF}" placeholder="{intl l="tracking reference"}"/>
<span class="input-group-btn">
<button class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span></button>
</span>
</div>
</form>
</div>
</div>
{loop name="payment-module" type="module" id=$DELIVERY_MODULE}
<dl class="dl-horizontal">
<dt>{intl l="Name"}</dt>
<dd>{$TITLE}</dd>
</dl>
<dl class="dl-horizontal">
<dt>{intl l="Description"}</dt>
<dd>{$DESCRIPTION}</dd>
</dl>
{/loop}
<div class="col-md-6">
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
{intl l='Invoice informations'}
<div class="pull-right">
<a class="btn btn-default btn-primary" title="{intl l='Download invoice as PDF'}" href="#">
<span class="glyphicon glyphicon-cloud-download"></span> {intl l='PDF | Invoice'}
</a>
<a class="btn btn-default btn-primary" title="{intl l='Edit invoice address'}" href="#edit_address_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-edit"></span>
</a>
</div>
</caption>
<tbody>
<tr>
<th>{intl l="Invoice reference"}</th>
<td>{$INVOICE_REF}</td>
</tr>
<tr>
<th>{intl l="Invoice date"}</th>
<td>{format_date date=$INVOICE_DATE output="date"}</td>
</tr>
{loop type="order_address" name="order-invoice-address" id=$INVOICE_ADDRESS}
<tr>
<th>{intl l="Title"}</th>
<td>{loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}</td>
</tr>
<tr>
<th>{intl l="Compagny"}</th>
<td>{$COMPANY}</td>
</tr>
<tr>
<th>{intl l="Firstname"}</th>
<td>{$FIRSTNAME}</td>
</tr>
<tr>
<th>{intl l="Lastname"}</th>
<td>{$LASTNAME}</td>
</tr>
<tr>
<th>{intl l="Street address"}</th>
<td>{$ADDRESS1}</td>
</tr>
<tr>
<th>{intl l="Additional address"}</th>
<td>{$ADDRESS2}</td>
</tr>
<tr>
<th>{intl l="Additional address"}</th>
<td>{$ADDRESS3}</td>
</tr>
<tr>
<th>{intl l="Zip code"}</th>
<td>{$ZIPCODE}</td>
</tr>
<tr>
<th>{intl l="City"}</th>
<td>{$CITY}</td>
</tr>
<tr>
<th>{intl l="Country"}</th>
<td>{loop type="country" name="order-invoice-address-country" id=$COUNTRY}{$TITLE}{/loop}</td>
</tr>
<tr>
<th>{intl l="Phone"}</th>
<td>{$PHONE}</td>
</tr>
{/loop}
</tbody>
</table>
</div>
</div>
<div class="col-md-6">
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
{intl l='Delivery address'}
<div class="pull-right">
<a class="btn btn-default btn-primary" title="{intl l='Download purchase order as PDF'}" href="#">
<span class="glyphicon glyphicon-cloud-download"></span> {intl l='PDF | Purchase order'}
</a>
<a class="btn btn-default btn-primary" title="{intl l='Edit delivery address'}" href="#edit_address_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-edit"></span>
</a>
</div>
</caption>
<tbody>
{loop type="order_address" name="order-delivery-address" id=$DELIVERY_ADDRESS}
<tr>
<th>{intl l="Title"}</th>
<td>{loop type="title" name="order-delivery-address-title" id=$TITLE}{$LONG}{/loop}</td>
</tr>
<tr>
<th>{intl l="Compagny"}</th>
<td>{$COMPANY}</td>
</tr>
<tr>
<th>{intl l="Firstname"}</th>
<td>{$FIRSTNAME}</td>
</tr>
<tr>
<th>{intl l="Lastname"}</th>
<td>{$LASTNAME}</td>
</tr>
<tr>
<th>{intl l="Street address"}</th>
<td>{$ADDRESS1}</td>
</tr>
<tr>
<th>{intl l="Additional address"}</th>
<td>{$ADDRESS2}</td>
</tr>
<tr>
<th>{intl l="Additional address"}</th>
<td>{$ADDRESS3}</td>
</tr>
<tr>
<th>{intl l="Zip code"}</th>
<td>{$ZIPCODE}</td>
</tr>
<tr>
<th>{intl l="City"}</th>
<td>{$CITY}</td>
</tr>
<tr>
<th>{intl l="Country"}</th>
<td>{loop type="country" name="order-delivery-address-country" id=$COUNTRY}{$TITLE}{/loop}</td>
</tr>
<tr>
<th>{intl l="Phone"}</th>
<td>{$PHONE}</td>
</tr>
{/loop}
</tbody>
</table>
</div>
</div>
</div> <!-- #bill -->
</div>
{/loop}
{/ifloop}
{elseloop rel="the-order"}
DOES NOT EXISTS
{/elseloop}
</div>
</div>
</div>
</div>
</div>
{* Update an Address *}
{form name="thelia.address.update"}
{* Capture the dialog body, to pass it to the generic dialog *}
{capture "edit_address_dialog"}
{form_hidden_fields form=$form}
{form_field form=$form field='label'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Label'}">
</div>
{/form_field}
{form_field form=$form field='company'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Company'}">
</div>
{/form_field}
{form_field form=$form field='title'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
{loop type="title" name="title1"}
<option value="{$ID}">{$LONG}</option>
{/loop}
</select>
</div>
{/form_field}
{form_field form=$form field='firstname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Firstname'}">
</div>
{/form_field}
{form_field form=$form field='lastname'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Lastname'}">
</div>
{/form_field}
{form_field form=$form field='address1'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Address'}">
</div>
<div class="form-group">
{form_field form=$form field='address2'}
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Additional address'}">
{/form_field}
</div>
<div class="form-group">
{form_field form=$form field='address3'}
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Additional address'}">
{/form_field}
</div>
{/form_field}
{form_field form=$form field='zipcode'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Zip code'}">
</div>
{/form_field}
{form_field form=$form field='city'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='City'}">
</div>
{/form_field}
{form_field form=$form field='country'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
<select name="{$name}" id="{$label_attr.for}" class="form-control">
{loop type="country" name="country1"}
<option value="{$ID}">{$TITLE}</option>
{/loop}
</select>
</div>
{/form_field}
{/capture}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "edit_address_dialog"
dialog_title = {intl l="Edit an address"}
dialog_body = {$smarty.capture.edit_address_dialog nofilter}
dialog_ok_label = {intl l="Edit this address"}
dialog_cancel_label = {intl l="Cancel"}
form_action = {url path='/admin/address/update'}
form_enctype = {form_enctype form=$form}
form_error_message = $form_error_message
}
{/form}
{/block}
{block name="javascript-initialization"}
{javascripts file='assets/js/bootstrap-select/bootstrap-select.js'}
<script src="{$asset_url}"></script>
{/javascripts}
{javascripts file='assets/js/main.js'}
<script src="{$asset_url}"></script>
{/javascripts}
<script type="text/javascript">
$(".js-update-order-status").change(function(e){
e.preventDefault();
$('#order-update-status-form').submit();
});
</script>
{/block}