Browse Source

Merge branch 'dev'

master
Guillaume Bourgeois 5 years ago
parent
commit
0da696fb22
5 changed files with 7 additions and 16 deletions
  1. +2
    -0
      backend/controllers/DistributionController.php
  2. +1
    -1
      backend/views/distribution/index.php
  3. +2
    -14
      backend/views/producer/update.php
  4. +1
    -1
      backend/web/js/vuejs/producer-update.js
  5. +1
    -0
      producer/controllers/OrderController.php

+ 2
- 0
backend/controllers/DistributionController.php View File

// commandes // commandes
$ordersArray = Order::searchAll([ $ordersArray = Order::searchAll([
'distribution.date' => $date, 'distribution.date' => $date,
],[
'orderby' => 'user.lastname ASC, user.name ASC'
]); ]);
// montant et poids des commandes // montant et poids des commandes

+ 1
- 1
backend/views/distribution/index.php View File

<label class="label label-warning" v-else>admin</label> <label class="label label-warning" v-else>admin</label>
</td> </td>
<td> <td>
<span v-if="order.user">{{ order.user.name +' '+order.user.lastname }}</span>
<span v-if="order.user">{{ order.user.lastname+' '+order.user.name }}</span>
<span v-else>{{ order.username }}</span> <span v-else>{{ order.username }}</span>
</td> </td>
<td v-if="idActivePointSale == 0"> <td v-if="idActivePointSale == 0">

+ 2
- 14
backend/views/producer/update.php View File

<?= $form->field($model, 'photo')->fileInput() ?> <?= $form->field($model, 'photo')->fileInput() ?>
<?php <?php
if (strlen($model->photo)) { if (strlen($model->photo)) {
$base_url = Yii::$app->urlManagerProducer->getHostInfo().'/'.Yii::$app->urlManagerProducer->baseUrl ;
echo '<img src="'.$base_url.'uploads/' . $model->photo . '" width="400px" /><br />';
echo '<img src="'.Yii::$app->urlManagerProducer->getBaseUrl().'/uploads/' . $model->photo . '" width="400px" /><br />';
echo '<input type="checkbox" name="delete_photo" id="delete_photo" /> <label for="delete_photo">Supprimer la photo</label><br /><br />'; echo '<input type="checkbox" name="delete_photo" id="delete_photo" /> <label for="delete_photo">Supprimer la photo</label><br /><br />';
} }
?> ?>
<div v-show="currentSection == 'credit-payment'" class="panel panel-default"> <div v-show="currentSection == 'credit-payment'" class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">Crédit / paiement en ligne</h3>
<h3 class="panel-title">Crédit</h3>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<?= $form->field($model, 'credit') <?= $form->field($model, 'credit')
Producer::CREDIT_FUNCTIONING_OPTIONAL => 'Optionnelle', Producer::CREDIT_FUNCTIONING_OPTIONAL => 'Optionnelle',
Producer::CREDIT_FUNCTIONING_MANDATORY => 'Obligatoire', Producer::CREDIT_FUNCTIONING_MANDATORY => 'Obligatoire',
], []) ; ?> ], []) ; ?>

<?= $form->field($model, 'online_payment')
->dropDownList([
0 => 'Non',
1 => 'Oui',
], [])
->label('Activer le paiement en ligne')
->hint('Le paiement en ligne permet à vos utilisateurs de recharger leur Crédit'
. ' via leur carte bancaire.') ; ?>
<?= $form->field($model, 'secret_key_payplug') ?>
</div> </div>
</div> </div>

+ 1
- 1
backend/web/js/vuejs/producer-update.js View File

}, },
{ {
name: 'credit-payment', name: 'credit-payment',
nameDisplay: 'Crédit / paiement en ligne'
nameDisplay: 'Crédit'
}, },
{ {
name: 'infos', name: 'infos',

+ 1
- 0
producer/controllers/OrderController.php View File

$product['photo'] = '' ; $product['photo'] = '' ;
} }
$product['quantity_max'] = $product['productDistribution'][0]['quantity_max'] ;
$quantityOrder = Order::getProductQuantity($product['id'], $ordersArray) ; $quantityOrder = Order::getProductQuantity($product['id'], $ordersArray) ;
$product['quantity_ordered'] = $quantityOrder ; $product['quantity_ordered'] = $quantityOrder ;
$product['quantity_remaining'] = $product['quantity_max'] - $quantityOrder ; $product['quantity_remaining'] = $product['quantity_max'] - $quantityOrder ;

Loading…
Cancel
Save