@@ -286,6 +286,9 @@ class DocumentController extends BackendController | |||
$ordersArray[$order->id] = array_merge( | |||
$order->getAttributes(), | |||
[ | |||
'username' => $order->getUsername(), | |||
'distribution_date' => isset($order->distribution) ? date('d/m/Y', strtotime($order->distribution->date)) : null, | |||
'point_sale_name' => isset($order->pointSale) ? $order->pointSale->name : null, | |||
'productOrder' => $productsOrderArray, | |||
] | |||
); |
@@ -204,7 +204,12 @@ use common\models\Producer; | |||
<template v-for="order in ordersArray"> | |||
<tr v-for="productOrder in order.productOrder"> | |||
<td class="col-md-4"> | |||
{{ productsArray[productOrder.id_product].name }} | |||
<div class="product-name">{{ productsArray[productOrder.id_product].name }}</div> | |||
<ul class="product-order-meta"> | |||
<li>{{ order.username }}</li> | |||
<li v-if="order.distribution_date">{{ order.distribution_date }}</li> | |||
<li v-if="order.point_sale_name">{{ order.point_sale_name }}</li> | |||
</ul> | |||
</td> | |||
<td class="col-md-2">{{ formatPrice(productOrder.price) }}</td> | |||
<td class="col-md-2">{{ productOrder.quantity }}</td> |
@@ -2340,3 +2340,14 @@ termes. | |||
.document-form #block-add-product .total .btn { | |||
float: right; | |||
} | |||
/* line 32, ../sass/document/_form.scss */ | |||
.document-form #block-list-products ul.product-order-meta { | |||
padding: 0px; | |||
margin: 0px; | |||
padding-left: 20px; | |||
} | |||
/* line 37, ../sass/document/_form.scss */ | |||
.document-form #block-list-products ul.product-order-meta li { | |||
color: gray; | |||
font-size: 11px; | |||
} |
@@ -27,4 +27,17 @@ | |||
} | |||
} | |||
} | |||
#block-list-products { | |||
ul.product-order-meta { | |||
padding: 0px ; | |||
margin: 0px ; | |||
padding-left: 20px ; | |||
li { | |||
color: gray ; | |||
font-size: 11px ; | |||
} | |||
} | |||
} | |||
} |
@@ -842,4 +842,16 @@ class Order extends ActiveRecordCommon | |||
</div>'; | |||
} | |||
public function getUsername() | |||
{ | |||
$username = '' ; | |||
if($this->user) { | |||
$username = $this->user->getUsername() ; | |||
} | |||
if(strlen($this->username)) { | |||
$username = $this->username ; | |||
} | |||
return $username ; | |||
} | |||
} |
@@ -687,6 +687,11 @@ class User extends ActiveRecordCommon implements IdentityInterface | |||
return $address; | |||
} | |||
public function getUsername() | |||
{ | |||
return $this->lastname.' '.$this->name ; | |||
} | |||
/** | |||
* Retourne l'ID de l'utilisateur courant connecté. | |||
* |