order admin

This commit is contained in:
Etienne Roudeix
2013-09-24 12:10:22 +02:00
parent 93e7a4dc90
commit 4600727163
7 changed files with 456 additions and 435 deletions

View File

@@ -63,7 +63,6 @@ class Customer extends BaseLoop
)
),
Argument::createBooleanTypeArgument('reseller'),
Argument::createBooleanTypeArgument('last_order'),
Argument::createIntTypeArgument('sponsor')
);
}
@@ -130,20 +129,6 @@ class Customer extends BaseLoop
$loopResultRow->set("SPONSOR", $customer->getSponsor());
$loopResultRow->set("DISCOUNT", $customer->getDiscount());
$lastOrderDate = "";
$lastOrderAmount = "";
if ($this->getLastOrder()) {
$order = $customer->getOrders()->getFirst();
if ($order) {
$lastOrderDate = $order->getCreatedAt();
$lastOrderAmount = $order->getTotalAmount();
}
}
$loopResultRow->set("LASTORDER_DATE", $lastOrderDate);
$loopResultRow->set("LASTORDER_AMOUNT", $lastOrderAmount);
$loopResult->addRow($loopResultRow);
}

View File

@@ -32,6 +32,7 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\AddressQuery;
use Thelia\Model\OrderAddressQuery;
use Thelia\Type\TypeCollection;
use Thelia\Type;
@@ -54,29 +55,7 @@ class OrderAddress extends BaseLoop
protected function getArgDefinitions()
{
return new ArgumentCollection(
new Argument(
'id',
new TypeCollection(
new Type\IntListType(),
new Type\EnumType(array('*', 'any'))
)
),
new Argument(
'customer',
new TypeCollection(
new Type\IntType(),
new Type\EnumType(array('current'))
),
'current'
),
Argument::createBooleanOrBothTypeArgument('default'),
new Argument(
'exclude',
new TypeCollection(
new Type\IntListType(),
new Type\EnumType(array('none'))
)
)
Argument::createIntTypeArgument('id', null, true)
);
}
@@ -91,60 +70,27 @@ class OrderAddress extends BaseLoop
$id = $this->getId();
if (null !== $id && !in_array($id, array('*', 'any'))) {
$search->filterById($id, Criteria::IN);
}
$search->filterById($id, Criteria::IN);
$customer = $this->getCustomer();
$orderAddresses = $this->search($search, $pagination);
if ($customer === 'current') {
$currentCustomer = $this->securityContext->getCustomerUser();
if ($currentCustomer === null) {
return new LoopResult();
} else {
$search->filterByCustomerId($currentCustomer->getId(), Criteria::EQUAL);
}
} else {
$search->filterByCustomerId($customer, Criteria::EQUAL);
}
$loopResult = new LoopResult($orderAddresses);
$default = $this->getDefault();
if ($default === true) {
$search->filterByIsDefault(1, Criteria::EQUAL);
} else if($default === false) {
$search->filterByIsDefault(0, Criteria::EQUAL);
}
$exclude = $this->getExclude();
if (null !== $exclude && 'none' !== $exclude) {
$search->filterById($exclude, Criteria::NOT_IN);
}
$addresses = $this->search($search, $pagination);
$loopResult = new LoopResult($addresses);
foreach ($addresses as $address) {
$loopResultRow = new LoopResultRow($loopResult, $address, $this->versionable, $this->timestampable, $this->countable);
foreach ($orderAddresses as $orderAddress) {
$loopResultRow = new LoopResultRow($loopResult, $orderAddress, $this->versionable, $this->timestampable, $this->countable);
$loopResultRow
->set("ID", $address->getId())
->set("LABEL", $address->getLabel())
->set("CUSTOMER", $address->getCustomerId())
->set("TITLE", $address->getTitleId())
->set("COMPANY", $address->getCompany())
->set("FIRSTNAME", $address->getFirstname())
->set("LASTNAME", $address->getLastname())
->set("ADDRESS1", $address->getAddress1())
->set("ADDRESS2", $address->getAddress2())
->set("ADDRESS3", $address->getAddress3())
->set("ZIPCODE", $address->getZipcode())
->set("CITY", $address->getCity())
->set("COUNTRY", $address->getCountryId())
->set("PHONE", $address->getPhone())
->set("CELLPHONE", $address->getCellphone())
->set("DEFAULT", $address->getIsDefault())
->set("ID", $orderAddress->getId())
->set("TITLE", $orderAddress->getCustomerTitleId())
->set("COMPANY", $orderAddress->getCompany())
->set("FIRSTNAME", $orderAddress->getFirstname())
->set("LASTNAME", $orderAddress->getLastname())
->set("ADDRESS1", $orderAddress->getAddress1())
->set("ADDRESS2", $orderAddress->getAddress2())
->set("ADDRESS3", $orderAddress->getAddress3())
->set("ZIPCODE", $orderAddress->getZipcode())
->set("CITY", $orderAddress->getCity())
->set("COUNTRY", $orderAddress->getCountryId())
->set("PHONE", $orderAddress->getPhone())
;
$loopResult->addRow($loopResultRow);

View File

@@ -4,7 +4,7 @@
/* Thelia */
/* */
/* Copyright (c) OpenStudio */
/* email : info@thelia.net */
/* email : info@thelia.net */
/* web : http://www.thelia.net */
/* */
/* This program is free software; you can redistribute it and/or modify */
@@ -23,33 +23,77 @@
namespace Thelia\Core\Template\Loop;
use Thelia\Core\Template\Element\BaseLoop;
use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Core\Template\Element\BaseI18nLoop;
use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Core\Template\Loop\Argument\ArgumentCollection;
use Thelia\Core\Template\Loop\Argument\Argument;
use Thelia\Model\OrderStatusQuery;
/**
*
* @package Thelia\Core\Template\Loop
* OrderStatus loop
*
* @author Franck Allimant <franck@cqfdev.fr>
*
* Class OrderStatus
* @package Thelia\Core\Template\Loop
* @author Etienne Roudeix <eroudeix@openstudio.fr>
*/
class OrderStatus extends BaseLoop
class OrderStatus extends BaseI18nLoop
{
public function getArgDefinitions()
public $timestampable = true;
/**
* @return ArgumentCollection
*/
protected function getArgDefinitions()
{
return new ArgumentCollection();
return new ArgumentCollection(
Argument::createIntListTypeArgument('id')
);
}
/**
*
* @param $pagination
*
* @return \Thelia\Core\Template\Element\LoopResult
*/
public function exec(&$pagination)
{
// TODO : a coder !
return new LoopResult();
$search = OrderStatusQuery::create();
/* manage translations */
$locale = $this->configureI18nProcessing($search);
$id = $this->getId();
if (null !== $id) {
$search->filterById($id, Criteria::IN);
}
/* perform search */
$orderStatusList = $this->search($search, $pagination);
$loopResult = new LoopResult($orderStatusList);
foreach ($orderStatusList as $orderStatus) {
$loopResultRow = new LoopResultRow($loopResult, $orderStatus, $this->versionable, $this->timestampable, $this->countable);
$loopResultRow->set("ID", $orderStatus->getId())
->set("IS_TRANSLATED",$orderStatus->getVirtualColumn('IS_TRANSLATED'))
->set("LOCALE",$locale)
->set("CODE", $orderStatus->getCode())
->set("TITLE", $orderStatus->getVirtualColumn('i18n_TITLE'))
->set("CHAPO", $orderStatus->getVirtualColumn('i18n_CHAPO'))
->set("DESCRIPTION", $orderStatus->getVirtualColumn('i18n_DESCRIPTION'))
->set("POSTSCRIPTUM", $orderStatus->getVirtualColumn('i18n_POSTSCRIPTUM'))
;
$loopResult->addRow($loopResultRow);
}
return $loopResult;
}
}

View File

@@ -111,26 +111,26 @@
{/loop}
{loop name="menu-auth-order" type="auth" roles="ADMIN" permissions="admin.orders.view"}
<li class="dropdown {if $admin_current_location == 'customer'}active{/if}" id="orders_menu" data-toggle="dropdown">
<li class="dropdown {if $admin_current_location == 'customer'}active{/if}" id="orders_menu">
<a href="#">{intl l="Orders"} <span class="caret"></span></a>
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{intl l="Orders"} <span class="caret"></span></a>
<ul class="dropdown-menu config_menu" role="menu">
<ul class="dropdown-menu config_menu" role="menu">
<li role="menuitem"><a data-target="{url path='admin/orders'}" href="{url path='admin/orders'}">
{intl l="All orders"}
<span class="badge badge-important">{count type="order"}</span></a>
</li>
<li role="menuitem"><a data-target="{url path='admin/orders'}" href="{url path='admin/orders'}">
{intl l="All orders"}
<span class="badge">{count type="order"}</span></a>
</li>
{loop name="order-status-list" type="order-status"}
<li role="menuitem">
<a data-target="{url path='admin/orders/$LABEL'}" href="{url path='admin/orders/$LABEL'}">
{$LABEL} <span class="badge badge-important">{count type="order" status="{$ID}"}</span>
</a>
</li>
{/loop}
</ul>
</li>
{loop name="order-status-list" type="order-status"}
<li role="menuitem">
<a data-target="{url path='admin/orders/$LABEL'}" href="{url path='admin/orders/$LABEL'}">
{$LABEL} <span class="badge">{count type="order" status="{$ID}"}</span>
</a>
</li>
{/loop}
</ul>
</li>
{/loop}
{loop name="menu-auth-catalog" type="auth" roles="ADMIN" permissions="admin.catalog.view"}

View File

@@ -64,9 +64,21 @@
</thead>
<tbody>
{loop name="customer_list" type="customer" current="false" visible="*" last_order="1" backend_context="1" page={$customer_page} limit={$display_customer}}
{loop name="customer_list" type="customer" current="false" visible="*" backend_context="1" page={$customer_page} limit={$display_customer}}
{assign "lastOrderDate" ''}
{assign "lastOrderAmount" ''}
{assign "lastOrderCurrency" ''}
{loop type="order" name="last-order" customer=$ID order="create-date-reverse" limit="1"}
{assign "lastOrderDate" "{format_date date=$CREATE_DATE}"}
{assign "lastOrderAmount" "{format_number number=$TOTAL_TAXED_AMOUNT}"}
{loop type="currency" name="order-currency" id=$CURRENCY}
{assign "lastOrderCurrency" $SYMBOL}
{/loop}
{/loop}
<tr>
<td><a href="{url path="/admin/customer/update/{$ID}" }">{$REF}</a></td>
<td><a href="{url path="/admin/customer/update/{$ID}"}">{$REF}</a></td>
<td>
{$COMPANY}
@@ -79,11 +91,11 @@
{module_include location='customer_list_row'}
<td>
{format_date date=$LASTORDER_DATE}
{$lastOrderDate}
</td>
<td>
{format_number number=$LASTORDER_AMOUNT}
{$lastOrderCurrency} {$lastOrderAmount}
</td>
<td>
<div class="btn-group">

View File

@@ -11,331 +11,340 @@
<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>
<li><a href="{url path='/admin/order'}">{intl l="Orders"}</a></li>
</ul>
<div class="row">
<div class="col-md-12">
<div class="general-block-decorator">
<ul class="nav nav-tabs">
<li class="active"><a href="#cart" data-toggle="tab"><span class="glyphicon glyphicon-shopping-cart"></span> {intl l="Cart"}</a></li>
<li><a href="#bill" data-toggle="tab"><span class="glyphicon glyphicon-list-alt"></span> {intl l="Bill"}</a></li>
<li><a href="#carriage" data-toggle="tab"><span class="glyphicon glyphicon-send"></span> {intl l="Carriage"}</a></li>
<li><a href="#settlement" data-toggle="tab"><span class="glyphicon glyphicon-credit-card"></span> {intl l="Settlement"}</a></li>
<li><a href="#address" data-toggle="tab"><span class="glyphicon glyphicon-home"></span> {intl l="Address"}</a></li>
<li><a href="#supplements" data-toggle="tab"><span class="glyphicon glyphicon-info-sign"></span> {intl l="Further information"}</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='Information about order 01201303540354'}
</caption>
<thead>
<tr>
<th>{intl l="Designation"}</th>
<th>{intl l="Price"}</th>
<th>{intl l="Quantity"}</th>
<th>{intl l="Total"}</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#">T-Shirt F T1</a></td>
<td>20.00 &euro;</td>
<td>3</td>
<td>60.00 &euro;</td>
</tr>
<tr>
<td><a href="#">T-Shirt F T1</a></td>
<td>20.00 &euro;</td>
<td>3</td>
<td>60.00 &euro;</td>
</tr>
<tr>
<td><a href="#">T-Shirt F T1</a></td>
<td>20.00 &euro;</td>
<td>3</td>
<td>60.00 &euro;</td>
</tr>
</tbody>
<tfoot>
<tr class="active">
<td colspan="3"><strong>Total</strong></td>
<td><strong>180.00 &euro;</strong></td>
</tr>
</tfoot>
</table>
</div>
</div> <!-- #cart -->
{ifloop rel='the-order'}
<div class="tab-pane fade" id="bill">
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<caption>
{intl l='Information about the bill'}
</caption>
<thead>
<tr>
<th>{intl l="Bill n°"}</th>
<th>{intl l="Compagny"}</th>
<th>{intl l="Firstname & Lastname"}</th>
<th>{intl l="Date & Hour"}</th>
</tr>
</thead>
{loop type="order" name="the-order" id=$order_id customer="*"}
<tbody>
<tr>
<td><a href="#">0001</a></td>
<td>Thelia</td>
<td>Dupont Jean</td>
<td>11/01/2013 14:11:00</td>
</tr>
</tbody>
</table>
</div>
</div> <!-- #bill -->
{loop type="currency" name="order-currency" id=$CURRENCY}
{assign "orderCurrency" $SYMBOL}
{/loop}
<div class="tab-pane fade" id="carriage">
<p class="title title-without-tabs clearfix">
{intl l='Information about the carriage'}
<a class="btn btn-default btn-primary pull-right" title="{intl l='Download pdf bill'}" href="#">
<span class="glyphicon glyphicon-cloud-download"></span> {intl l='Download pdf bill'}
</a>
</p>
<ul class="nav nav-tabs">
<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>
<li><a href="#supplements" data-toggle="tab"><span class="glyphicon glyphicon-info-sign"></span> {intl l="Further information"}</a></li>
</ul>
<dl class="dl-horizontal">
<dt>{intl l="Mode of transportation"}</dt>
<dd>Colissimo</dd>
</dl>
<dl class="dl-horizontal">
<dt>{intl l="Description"}</dt>
<dd>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, error, necessitatibus ipsam dolores ad quisquam provident sed repudiandae ullam quasi quae perferendis numquam voluptates doloribus laborum possimus dicta similique in?</dd>
</dl>
</div> <!-- #carriage -->
<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>{intl l="Product"}</th>
<th>{intl l="Price"}</th>
<th>{intl l="Quantity"}</th>
<th>{intl l="Total"}</th>
</tr>
</thead>
<div class="tab-pane fade" id="settlement">
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
{intl l='Information about the settlement'}
</caption>
<tbody>
<tr>
<th>{intl l="Type of payment"}</th>
<td>Unknown</td>
</tr>
<tr>
<th>{intl l="Transaction reference"}</th>
<td>141100</td>
</tr>
<tr>
<th>{intl l="Total order before discount"}</th>
<td>60 &euro;</td>
</tr>
<tr>
<th>{intl l="Discount"}</th>
<td>10%</td>
</tr>
<tr>
<th>{intl l="Coupon code"}</th>
<td></td>
</tr>
<tr>
<th>{intl l="Total with discount"}</th>
<td>50 &euro;</td>
</tr>
<tr>
<th>{intl l="Freight"}</th>
<td>6 &euro;</td>
</tr>
<tr>
<th>{intl l="Total"}</th>
<td>56 &euro;</td>
</tr>
</tbody>
</table>
</div>
</div> <!-- #settlement -->
<tbody>
<tr>
<td><a href="#">T-Shirt F T1</a></td>
<td>20.00 &euro;</td>
<td>3</td>
<td>60.00 &euro;</td>
</tr>
<tr>
<td><a href="#">T-Shirt F T1</a></td>
<td>20.00 &euro;</td>
<td>3</td>
<td>60.00 &euro;</td>
</tr>
<tr>
<td><a href="#">T-Shirt F T1</a></td>
<td>20.00 &euro;</td>
<td>3</td>
<td>60.00 &euro;</td>
</tr>
</tbody>
<tfoot>
<tr class="active">
<td colspan="3"><strong>Total</strong></td>
<td><strong>180.00 &euro;</strong></td>
</tr>
</tfoot>
</table>
</div>
<div class="tab-pane fade clearfix" id="address">
<div class="col-md-6">
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
{intl l='Billing address'}
<a class="btn btn-default btn-primary pull-right" title="{intl l='Edit this billing address'}" href="#edit_address_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-edit"></span>
</a>
</caption>
<tbody>
<tr>
<th>{intl l="Title"}</th>
<td>Mr</td>
</tr>
<tr>
<th>{intl l="Compagny"}</th>
<td>Thelia</td>
</tr>
<tr>
<th>{intl l="Firstname"}</th>
<td>Espeche</td>
</tr>
<tr>
<th>{intl l="Lastname"}</th>
<td>Michaël</td>
</tr>
<tr>
<th>{intl l="Street address"}</th>
<td>5, rue Rochon</td>
</tr>
<tr>
<th>{intl l="Additional address"}</th>
<td>Lorem ipsum dolor sit amet</td>
</tr>
<tr>
<th>{intl l="Additional address"}</th>
<td>Lorem ipsum dolor sit</td>
</tr>
<tr>
<th>{intl l="Zip code"}</th>
<td>63000</td>
</tr>
<tr>
<th>{intl l="City"}</th>
<td>Clermont-Fd</td>
</tr>
<tr>
<th>{intl l="Country"}</th>
<td>France</td>
</tr>
<tr>
<th>{intl l="Phone"}</th>
<td>01 02 03 04 05</td>
</tr>
</tbody>
</table>
</div>
</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>
<tr>
<th>{intl l="Total without discount"}</th>
<td>@TODO</td>
</tr>
<tr>
<th>{intl l="Discount"}</th>
<td>@TODO</td>
</tr>
<tr>
<th>{intl l="Coupon code"}</th>
<td>@TODO</td>
</tr>
<tr>
<th>{intl l="Total including discount"}</th>
<td>{$orderCurrency} {$TOTAL_TAXED_AMOUNT-$POSTAGE}</td>
</tr>
<tr>
<th>{intl l="Postage"}</th>
<td>{$orderCurrency} {$POSTAGE}</td>
</tr>
<tr>
<th>{intl l="Total"}</th>
<td>{$orderCurrency} {$TOTAL_TAXED_AMOUNT}</td>
</tr>
</tbody>
</table>
</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'}
<a class="btn btn-default btn-primary pull-right" title="{intl l='Edit this delivery address'}" href="#edit_address_dialog" data-toggle="modal">
<span class="glyphicon glyphicon-edit"></span>
</a>
</caption>
<tbody>
<tr>
<th>{intl l="Title"}</th>
<td>Mr</td>
</tr>
<tr>
<th>{intl l="Compagny"}</th>
<td>Thelia</td>
</tr>
<tr>
<th>{intl l="Firstname"}</th>
<td>Espeche</td>
</tr>
<tr>
<th>{intl l="Lastname"}</th>
<td>Michaël</td>
</tr>
<tr>
<th>{intl l="Street address"}</th>
<td>5, rue Rochon</td>
</tr>
<tr>
<th>{intl l="Additional address"}</th>
<td>Lorem ipsum dolor sit amet</td>
</tr>
<tr>
<th>{intl l="Additional address"}</th>
<td>Lorem ipsum dolor sit</td>
</tr>
<tr>
<th>{intl l="Zip code"}</th>
<td>63000</td>
</tr>
<tr>
<th>{intl l="City"}</th>
<td>Clermont-Fd</td>
</tr>
<tr>
<th>{intl l="Country"}</th>
<td>France</td>
</tr>
<tr>
<th>{intl l="Phone"}</th>
<td>01 02 03 04 05</td>
</tr>
</tbody>
</table>
</div>
</div>
</div> <!-- #address -->
<div class="tab-pane fade clearfix" id="supplements">
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<caption>
{intl l='Further information'}
</caption>
<tbody>
<tr>
<th><label for="">{intl l='Status'}</label></th>
<td>
<form action="" method="">
<div class="row">
<div class="col-lg-4">
<select name="" id="" class="form-control">
<option value="">Status 1</option>
<option value="">Status 2</option>
<option value="">Status 3</option>
</select>
</div>
</div>
</form>
</td>
</tr>
<tr>
<th><label for="">{intl l='Order Tracking'}</label></th>
<td>
<form action="" method="">
<div class="row">
<div class="col-lg-4">
<input type="text" id="" name="" class="form-control" value="" title="" placeholder="">
</div>
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-ok"></span></button>
</div>
</form>
</td>
</tr>
<tr>
<th>{intl l='Bill'}</th>
<td><a href="#" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-cloud-download"></span> {intl l='Download bill to pdf'}</a></td>
</tr>
<tr>
<th>{intl l='Delivery'}</th>
<td><a href="#" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-cloud-download"></span> {intl l='Download delivery to pdf'}</a></td>
</tr>
</tbody>
</table>
</div>
</div> <!-- #supplements -->
</div> <!-- #cart -->
</div>
<div class="tab-pane fade clearfix" id="bill">
<p class="title title-without-tabs">
{intl l='Delivery module'}
</p>
{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 class="tab-pane fade clearfix" id="supplements">
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<caption>
{intl l='Further information'}
</caption>
<tbody>
<tr>
<th><label for="">{intl l='Status'}</label></th>
<td>
<form action="" method="">
<div class="row">
<div class="col-lg-4">
<select name="" id="" class="form-control">
<option value="">Status 1</option>
<option value="">Status 2</option>
<option value="">Status 3</option>
</select>
</div>
</div>
</form>
</td>
</tr>
<tr>
<th><label for="">{intl l='Order Tracking'}</label></th>
<td>
<form action="" method="">
<div class="row">
<div class="col-lg-4">
<input type="text" id="" name="" class="form-control" value="" title="" placeholder="">
</div>
<button type="submit" class="btn btn-primary"><span class="glyphicon glyphicon-ok"></span></button>
</div>
</form>
</td>
</tr>
<tr>
<th>{intl l='Bill'}</th>
<td><a href="#" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-cloud-download"></span> {intl l='Download bill to pdf'}</a></td>
</tr>
<tr>
<th>{intl l='Delivery'}</th>
<td><a href="#" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-cloud-download"></span> {intl l='Download delivery to pdf'}</a></td>
</tr>
</tbody>
</table>
</div>
</div> <!-- #supplements -->
</div>
{/loop}
{/ifloop}
{elseloop rel="the-order"}
DOES NOT EXISTS
{/elseloop}
</div>

View File

@@ -45,22 +45,47 @@
</thead>
<tbody>
{loop type="order" name="order-list" customer="*"}
{loop type="customer" name="order-customer"}
{loop type="order_address" name="order-invoice-address" id=$INVOICE_ADDRESS}
{assign "orderInvoiceFirstName" $FIRSTNAME}
{assign "orderInvoiceLastName" $LASTNAME}
{assign "orderInvoiceCompany" $COMPANY}
{/loop}
{loop type="order_address" name="order-invoice-address"}
{loop type="order-status" name="order-status" id=$STATUS}
{assign "orderStatus" $TITLE}
{if $CODE == 'not_paid'}
{assign "orderStatusLabel" "warning"}
{else}
{if $CODE == 'paid'}
{assign "orderStatusLabel" "success"}
{else}
{if $CODE == 'processing'}
{assign "orderStatusLabel" "Primary"}
{else}
{if $CODE == 'sent'}
{assign "orderStatusLabel" "info"}
{else}
{if $CODE == 'canceled'}
{assign "orderStatusLabel" "danger"}
{else}
{/if}
{/if}
{/if}
{/if}
{/if}
{/loop}
<tr>
<td><a href="">{$REF}</a></td>
<td><a href="{url path="/admin/order/update/$ID"}">01230450123045</a></td>
<td>{format_date date=$CREATE_DATE}</td>
<td>Thelia</td>
<td><a href="">Dupont</a></td>
<td>251 &euro;</td>
<td><span class="label label-success">Paid</span></td>
<td>{$orderInvoiceCompany}</td>
<td><a href="{url path="/admin/customer/update/$CUSTOMER"}">{$orderInvoiceFirstName|ucwords} {$orderInvoiceLastName|upper}</a></td>
<td>{$TOTAL_TAXED_AMOUNT}</td>
<td><span class="label label-{$orderStatusLabel}">{$orderStatus}</span></td>
{module_include location='orders_table_row'}