Przeglądaj źródła

Résolution bug : order.user provoque une erreur lorsqu'il n'est pas défini (cas de username définit à la place d'un compte utilisateur)

refactoring
Guillaume Bourgeois 5 lat temu
rodzic
commit
a6d960134e
2 zmienionych plików z 7 dodań i 7 usunięć
  1. +2
    -2
      backend/controllers/DistributionController.php
  2. +5
    -5
      backend/views/distribution/index.php

+ 2
- 2
backend/controllers/DistributionController.php Wyświetl plik

@@ -162,8 +162,8 @@ class DistributionController extends BackendController
'date' => date('d/m/Y H:i:s', strtotime($creditHistory->date)),
'user_action' => $creditHistory->strUserAction(),
'wording' => $creditHistory->getStrWording(),
'debit' => ($creditHistory->isTypeDebit() ? '- '.$creditHistory->getAmount(Order::AMOUNT_TOTAL,true) : ''),
'credit' => ($creditHistory->isTypeCredit() ? '+ '.$creditHistory->getAmount(Order::AMOUNT_TOTAL,true) : '')
'debit' => ($creditHistory->isTypeDebit() ? '- '.$creditHistory->getAmount(Order::AMOUNT_TOTAL,true) : ''),
'credit' => ($creditHistory->isTypeCredit() ? '+ '.$creditHistory->getAmount(Order::AMOUNT_TOTAL,true) : '')
] ;
}

+ 5
- 5
backend/views/distribution/index.php Wyświetl plik

@@ -256,7 +256,7 @@ $this->setPageTitle('Distributions') ;
<td class="column-actions">
<a class="btn btn-default" :href="baseUrl+'/subscription/update?id='+order.id_subscription" v-if="order.id_subscription > 0"><span class="glyphicon glyphicon-repeat"></span></a>
<button class="btn btn-default" :data-id-order="order.id" @click="orderViewClick"><span :class="'glyphicon ' + ((showViewProduct && idOrderView == order.id) ? 'glyphicon-eye-close' : 'glyphicon-eye-open')"></span></button>
<button class="btn btn-default" :data-id-order="order.id" @click="orderPaymentModalClick"><span class="glyphicon glyphicon-euro"></span></button>
<button class="btn btn-default" :data-id-order="order.id" @click="orderPaymentModalClick" v-show="order.user"><span class="glyphicon glyphicon-euro"></span></button>
<button class="btn btn-default" :data-id-order="order.id" @click="updateOrderClick"><span class="glyphicon glyphicon-pencil"></span></button>
<button class="btn btn-default" :data-id-order="order.id" @click="deleteOrderClick"><span class="glyphicon glyphicon-trash"></span></button>

@@ -275,8 +275,8 @@ $this->setPageTitle('Distributions') ;
<modal v-if="showModalPayment && idOrderPayment == order.id" class="modal-payment" @close="showModalPayment = false">
<h3 slot="header">
Commande du <strong>{{ dateFormat }}</strong> &gt;
<strong><span v-if="order.user">{{ order.user.name +' '+order.user.lastname }}</span>
<span v-else>{{ order.username }}</span></strong>
<strong><span v-if="order.user">{{ order.user.name +' '+order.user.lastname }}</span>
<span v-else>{{ order.username }}</span></strong>
</h3>
<div slot="body">
<div class="col-md-4">
@@ -357,8 +357,8 @@ $this->setPageTitle('Distributions') ;
<td>{{ creditHistory.date }}</td>
<td>{{ creditHistory.user_action }}</td>
<td v-html="creditHistory.wording"></td>
<td>{{ creditHistory.debit }}</td>
<td>{{ creditHistory.credit }}</td>
<td v-html="creditHistory.debit"></td>
<td v-html="creditHistory.credit"></td>
</tr>
</tbody>
</table>

Ładowanie…
Anuluj
Zapisz