</div> | </div> | ||||
<div v-if="idActivePointSale > 0 && (totalActivePointSale() > 0 || weightActivePointSale() > 0)" class="point-sale-totals"> | <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> | </div> | ||||
<table class="table table-condensed table-bordered table-hover" v-if="countOrdersByPointSale[idActivePointSale] > 0 || (idActivePointSale == 0 && orders.length > 0)"> | <table class="table table-condensed table-bordered table-hover" v-if="countOrdersByPointSale[idActivePointSale] > 0 || (idActivePointSale == 0 && orders.length > 0)"> | ||||
({{ order.user.credit.toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }}) | ({{ 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> | <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> | </template> | ||||
</td> | </td> | ||||
<td class="column-payment" v-if="producer && producer.credit"> | <td class="column-payment" v-if="producer && producer.credit"> | ||||
<?php if ($action == 'update' && $documentClass == 'Invoice'): ?> | <?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> | ||||
<div class="col-md-4"> | |||||
<div class="form-group"> | |||||
<br> | |||||
<?= Html::submitButton('Ajouter', ['class' => 'btn btn-primary']) ?> | |||||
</div> | |||||
</div> | |||||
<?php ActiveForm::end(); ?> | |||||
</div> | </div> | ||||
<?php ActiveForm::end(); ?> | |||||
</div> | |||||
<?php endif; ?> | |||||
<?php endif; ?> | |||||
</div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | |||||
<?php endif; ?> | |||||
<div v-if="(deliveryNoteUpdateArray && deliveryNoteUpdateArray.length > 0) || (deliveryNoteCreateArray && deliveryNoteCreateArray.length > 0)"> | <div v-if="(deliveryNoteUpdateArray && deliveryNoteUpdateArray.length > 0) || (deliveryNoteCreateArray && deliveryNoteCreateArray.length > 0)"> | ||||
<div class="panel panel-default"> | <div class="panel panel-default"> |
pointsSale: [], | pointsSale: [], | ||||
meansPayment: [], | meansPayment: [], | ||||
idActivePointSale: 0, | idActivePointSale: 0, | ||||
pointSaleActive: null, | |||||
idDefaultPointSale: 0, | idDefaultPointSale: 0, | ||||
countActivePointsSale: 0, | countActivePointsSale: 0, | ||||
countOrdersByPointSale: [], | countOrdersByPointSale: [], | ||||
}, | }, | ||||
setIdActivePointSale: function (id) { | setIdActivePointSale: function (id) { | ||||
this.idActivePointSale = id; | this.idActivePointSale = id; | ||||
for(key in this.pointsSale) { | |||||
if(this.pointsSale[key].id == id) { | |||||
this.pointSaleActive = this.pointsSale[key]; | |||||
} | |||||
} | |||||
if (!id) { | if (!id) { | ||||
this.orderCreate.id_point_sale = this.idDefaultPointSale; | this.orderCreate.id_point_sale = this.idDefaultPointSale; | ||||
} else { | } else { |