Sfoglia il codice sorgente

[Administration] Distributions : ajout info crédit point de vente

feature/souke
Guillaume Bourgeois 1 anno fa
parent
commit
6b4122ac6b
3 ha cambiato i file con 64 aggiunte e 45 eliminazioni
  1. +13
    -4
      backend/views/distribution/index.php
  2. +43
    -41
      backend/views/document/_form.php
  3. +8
    -0
      backend/web/js/vuejs/distribution-index.js

+ 13
- 4
backend/views/distribution/index.php Vedi File

@@ -307,8 +307,19 @@ $this->setPageTitle('Distributions') ;
</div>

<div v-if="idActivePointSale > 0 && (totalActivePointSale() > 0 || weightActivePointSale() > 0)" class="point-sale-totals">
<span class="title">Totaux</span>
CA TTC : <strong>{{ totalActivePointSale() }} €</strong> / Poids : <strong>{{ weightActivePointSale() }} kg</strong>
<div>
<span class="title">Totaux</span>
CA TTC : <strong>{{ totalActivePointSale() }} €</strong> / Poids : <strong>{{ weightActivePointSale() }} kg</strong>
</div>
<div v-if="producer.credit && pointSaleActive">
<span class="title">Crédit</span>
<template v-if="pointSaleActive.credit">
<template v-if="pointSaleActive.credit_functioning == 'mandatory'">Obligatoire</template>
<template v-else-if="pointSaleActive.credit_functioning == 'user'">Basé sur l'utilisateur</template>
<template v-else-if="pointSaleActive.credit_functioning == 'optionnal'">Optionnel</template>
</template>
<template v-else>Désactivé</template>
</div>
</div>

<table class="table table-condensed table-bordered table-hover" v-if="countOrdersByPointSale[idActivePointSale] > 0 || (idActivePointSale == 0 && orders.length > 0)">
@@ -382,8 +393,6 @@ $this->setPageTitle('Distributions') ;
({{ order.user.credit.toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }})
<span class="glyphicon glyphicon-time" title="Paiement automatique la veille de la distribution" v-if="order.auto_payment && (order.amount_paid == 0 || order.amount_paid < order.amount)"></span>
</template>


</td>
<td class="column-payment" v-if="producer && producer.credit">


+ 43
- 41
backend/views/document/_form.php Vedi File

@@ -242,52 +242,54 @@ $documentClass = $documentManager->getClass($model);

<?php if ($action == 'update' && $documentClass == 'Invoice'): ?>

<div v-if="document.status == 'valid'">
<div class="panel panel-default">
<div class="panel-heading">
Règlement
</div>
<div class="panel-body">
<?php if($model->payments && count($model->payments) > 0): ?>
<table class="table table-bordered">
<thead>
<tr>
<th>Moyen de paiement</th>
<th>Montant</th>
</tr>
</thead>
<tbody>
<?php foreach($model->payments as $payment): ?>
<tr>
<td><?= $paymentManager->getStrMeanPayment($payment); ?></td>
<td><?= Price::format($payment->amount); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<?php if($documentManager->isStatusValid($model)): ?>
<div>
<div class="panel panel-default">
<div class="panel-heading">
Règlement
</div>
<div class="panel-body">
<?php if($model->payments && count($model->payments) > 0): ?>
<table class="table table-bordered">
<thead>
<tr>
<th>Moyen de paiement</th>
<th>Montant</th>
</tr>
</thead>
<tbody>
<?php foreach($model->payments as $payment): ?>
<tr>
<td><?= $paymentManager->getStrMeanPayment($payment); ?></td>
<td><?= Price::format($payment->amount); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>

<?php if(!$invoiceManager->isInvoicePaid($model)): ?>
<div class="row">
<?php $form = ActiveForm::begin(); ?>
<div class="col-md-4">
<?= $form->field($payment, 'mean_payment')->dropDownList(MeanPayment::getAll()); ?>
</div>
<div class="col-md-4">
<?= $form->field($payment, 'amount')->textInput(); ?>
</div>
<div class="col-md-4">
<div class="form-group">
<br>
<?= Html::submitButton('Ajouter', ['class' => 'btn btn-primary']) ?>
<?php if(!$invoiceManager->isInvoicePaid($model)): ?>
<div class="row">
<?php $form = ActiveForm::begin(); ?>
<div class="col-md-4">
<?= $form->field($payment, 'mean_payment')->dropDownList(MeanPayment::getAll()); ?>
</div>
<div class="col-md-4">
<?= $form->field($payment, 'amount')->textInput(); ?>
</div>
<div class="col-md-4">
<div class="form-group">
<br>
<?= Html::submitButton('Ajouter', ['class' => 'btn btn-primary']) ?>
</div>
</div>
<?php ActiveForm::end(); ?>
</div>
<?php ActiveForm::end(); ?>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php endif; ?>

<div v-if="(deliveryNoteUpdateArray && deliveryNoteUpdateArray.length > 0) || (deliveryNoteCreateArray && deliveryNoteCreateArray.length > 0)">
<div class="panel panel-default">

+ 8
- 0
backend/web/js/vuejs/distribution-index.js Vedi File

@@ -55,6 +55,7 @@ var app = new Vue({
pointsSale: [],
meansPayment: [],
idActivePointSale: 0,
pointSaleActive: null,
idDefaultPointSale: 0,
countActivePointsSale: 0,
countOrdersByPointSale: [],
@@ -418,6 +419,13 @@ var app = new Vue({
},
setIdActivePointSale: function (id) {
this.idActivePointSale = id;

for(key in this.pointsSale) {
if(this.pointsSale[key].id == id) {
this.pointSaleActive = this.pointsSale[key];
}
}

if (!id) {
this.orderCreate.id_point_sale = this.idDefaultPointSale;
} else {

Loading…
Annulla
Salva