Explorar el Código

[Backend] Affichage du crédit dans l'historique client et affichage de l'utilisateur responsable de chaque mouvement

prodstable
keun hace 7 años
padre
commit
cbd9c5c54d
Se han modificado 5 ficheros con 40 adiciones y 8 borrados
  1. +2
    -1
      backend/controllers/UserController.php
  2. +3
    -1
      backend/views/user/credit.php
  3. BIN
      backend/web/.sass-cache/c8fef7d48da4dc7f024edc2b0fada9d8d6de5dac/screen.scssc
  4. +21
    -6
      backend/web/css/screen.css
  5. +14
    -0
      backend/web/sass/screen.scss

+ 2
- 1
backend/controllers/UserController.php Ver fichero

@@ -207,6 +207,7 @@ class UserController extends BackendController
if ($credit_historique->load(Yii::$app->request->post()) && $credit_historique->validate())
{
$credit_historique->id_user = $user->id ;
$credit_historique->id_user_action = Yii::$app->user->identity->id ;
$credit_historique->id_etablissement = Yii::$app->user->identity->id_etablissement ;
if($credit_historique->type == CreditHistorique::TYPE_DEBIT && $credit_historique->montant > 0)
$credit_historique->montant = - $credit_historique->montant ;
@@ -217,7 +218,7 @@ class UserController extends BackendController
}
$historique = CreditHistorique::find()
->with('commande')
->with(['commande','userAction'])
->where([
'id_user' => $user->id,
'id_etablissement' => Yii::$app->user->identity->id_etablissement,

+ 3
- 1
backend/views/user/credit.php Ver fichero

@@ -47,11 +47,12 @@ $this->params['breadcrumbs'][] = 'Créditer';
</div>
<div class="col-md-12">
<h2>Historique</h2>
<h2>Historique <span class="the-credit"><?= number_format($user->getCredit($etablissement->id), 2); ?> €</span></h2>
<table class="table table-bordered">
<thead>
<tr>
<th>Date</th>
<th>Utilisateur</th>
<th>Type</th>
<th>Montant</th>
<th>Paiement</th>
@@ -63,6 +64,7 @@ $this->params['breadcrumbs'][] = 'Créditer';
<?php foreach($historique as $ch): ?>
<tr>
<td><?= date('d/m/Y à H:i:s',strtotime($ch->date)) ?></td>
<td><?php if(isset($ch->userAction)): echo Html::encode($ch->userAction->nom. ' '.$ch->userAction->prenom) ; else: echo 'Administrateur' ;endif; ?></td>
<td>
<?php if($ch->type == CreditHistorique::TYPE_CREDIT_INITIAL): ?>Crédit initial<?php endif; ?>
<?php if($ch->type == CreditHistorique::TYPE_CREDIT): ?>Crédit<?php endif; ?>

BIN
backend/web/.sass-cache/c8fef7d48da4dc7f024edc2b0fada9d8d6de5dac/screen.scssc Ver fichero


+ 21
- 6
backend/web/css/screen.css Ver fichero

@@ -1157,17 +1157,32 @@ a:hover, a:focus, a:active {
text-align: center;
}

/* line 1175, ../sass/screen.scss */
.user-credit .the-credit {
float: right;
font-weight: bold;
background-color: #BB8757;
color: white;
-moz-border-radius: 8px;
-webkit-border-radius: 8px;
border-radius: 8px;
padding: 3px 10px;
padding-top: 7px;
position: relative;
top: -12px;
}

/* facturation */
/* line 1176, ../sass/screen.scss */
/* line 1190, ../sass/screen.scss */
#estimation-facture {
padding: 20px;
background-color: #F9F9F9;
}
/* line 1180, ../sass/screen.scss */
/* line 1194, ../sass/screen.scss */
#estimation-facture h2 {
font-family: "myriadpro-it";
}
/* line 1184, ../sass/screen.scss */
/* line 1198, ../sass/screen.scss */
#estimation-facture .montant span {
font-size: 25px;
color: white;
@@ -1179,17 +1194,17 @@ a:hover, a:focus, a:active {
padding-top: 7px;
font-family: "myriadpro-regular";
}
/* line 1195, ../sass/screen.scss */
/* line 1209, ../sass/screen.scss */
#estimation-facture label {
text-transform: uppercase;
font-family: "myriadpro-light";
font-size: 20px;
}
/* line 1200, ../sass/screen.scss */
/* line 1214, ../sass/screen.scss */
#estimation-facture label span {
font-size: 16px;
}
/* line 1205, ../sass/screen.scss */
/* line 1219, ../sass/screen.scss */
#estimation-facture #etablissement-prix_libre {
width: 100px;
height: 60px;

+ 14
- 0
backend/web/sass/screen.scss Ver fichero

@@ -1171,6 +1171,20 @@ a {
}
}

.user-credit {
.the-credit {
float: right ;
font-weight: bold ;
background-color: $color1 ;
color: white ;
@include border-radius(8px) ;
padding: 3px 10px ;
padding-top: 7px ;
position: relative ;
top: -12px ;
}
}

/* facturation */

#estimation-facture {

Cargando…
Cancelar
Guardar