namespace backend\controllers; | namespace backend\controllers; | ||||
use common\helpers\CSV; | |||||
use common\helpers\Price; | |||||
use common\models\DeliveryNote; | use common\models\DeliveryNote; | ||||
use common\models\Invoice; | use common\models\Invoice; | ||||
use common\models\PointSale; | use common\models\PointSale; | ||||
'TVA', | 'TVA', | ||||
'Total TVA', | 'Total TVA', | ||||
'Total HT', | 'Total HT', | ||||
'Créateur', | |||||
'Classification vente', | |||||
'Code Classification vente', | |||||
]; | ]; | ||||
foreach($document->getProductsOrders() as $productOrderArray) { | foreach($document->getProductsOrders() as $productOrderArray) { | ||||
$price = $productOrder->getInvoicePrice() ; | $price = $productOrder->getInvoicePrice() ; | ||||
} | } | ||||
$typeTotal = $document->isInvoicePrice() ? Order::INVOICE_AMOUNT_TOTAL : Order::AMOUNT_TOTAL; | |||||
$priceTotal = $productOrder->getPriceByTypeTotal($typeTotal) * $productOrder->quantity; | |||||
$tva = Price::getVat( | |||||
$priceTotal, | |||||
$productOrder->taxRate->value, | |||||
$document->tax_calculation_method | |||||
); | |||||
$datas[] = [ | $datas[] = [ | ||||
$document->reference, // N° facture externe * | $document->reference, // N° facture externe * | ||||
date('d/m/Y', strtotime($document->date)), // Date facture * | date('d/m/Y', strtotime($document->date)), // Date facture * | ||||
$price, // PU HT * | $price, // PU HT * | ||||
'', // Remise | '', // Remise | ||||
$productOrder->taxRate->value * 100, // TVA | $productOrder->taxRate->value * 100, // TVA | ||||
'', // Total TVA | |||||
'', // Total HT | |||||
'', // Créateur | |||||
$tva, // Total TVA | |||||
$priceTotal, // Total HT | |||||
'', // Classification vente | |||||
'01', // Code Classification vente | |||||
]; | ]; | ||||
} | } | ||||
} | } |
* @param string $processCredit | * @param string $processCredit | ||||
*/ | */ | ||||
public function actionAjaxCreate( | public function actionAjaxCreate( | ||||
$date, $idPointSale, $idUser, $username, $meanPayment = '', $products, $comment, $processCredit = 0) | |||||
$date, $idPointSale, $idUser, $username, $meanPayment = '', $products, $comment) | |||||
{ | { | ||||
\Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; | \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON; | ||||
} | } | ||||
$order = Order::searchOne(['id' => $order->id]); | $order = Order::searchOne(['id' => $order->id]); | ||||
if ($order && $processCredit) { | |||||
if ($order && $order->isCreditAutoPayment()) { | |||||
$order->processCredit(); | $order->processCredit(); | ||||
} | } | ||||
$order->save(); | $order->save(); | ||||
$order = Order::searchOne(['id' => $order->id]); | $order = Order::searchOne(['id' => $order->id]); | ||||
if ($order && $processCredit) { | |||||
if($order && $order->isCreditAutoPayment()) { | |||||
// Si changement d'user : on rembourse l'ancien user | // Si changement d'user : on rembourse l'ancien user | ||||
$amountPaid = $order->getAmount(Order::AMOUNT_PAID); | $amountPaid = $order->getAmount(Order::AMOUNT_PAID); | ||||
if($oldIdUser != $idUser && $amountPaid > 0) { | if($oldIdUser != $idUser && $amountPaid > 0) { |
</td> | </td> | ||||
<td class="column-amount"> | <td class="column-amount"> | ||||
{{ order.amount.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }} | {{ order.amount.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }} | ||||
</td> | |||||
<td class="column-state-payment"> | |||||
<div class="input-group"> | |||||
<span class="label label-success input-group-addon" v-if="order.amount_paid == order.amount">payé</span> | |||||
<span class="label label-default input-group-addon" v-else-if="order.amount_paid == 0">non réglé</span> | |||||
<span class="label label-default input-group-addon" v-else-if="order.amount_paid > order.amount">surplus</span> | |||||
<span class="label label-warning input-group-addon" v-else-if="order.amount_paid < order.amount">reste à payer</span> | |||||
<span class="glyphicon glyphicon-time" title="Paiement automatique" v-if="order.auto_payment && producer && producer.credit && (order.amount_paid == 0 || order.amount_paid < order.amount)"></span> | |||||
<div class="state-payment-mobile"> | |||||
<order-state-payment :order="order" :producer="producer"></order-state-payment> | |||||
</div> | </div> | ||||
</td> | </td> | ||||
<td class="column-state-payment"> | |||||
<order-state-payment :order="order" :producer="producer"></order-state-payment> | |||||
</td> | |||||
<td class="column-payment" v-if="producer && producer.credit"> | <td class="column-payment" v-if="producer && producer.credit"> | ||||
<div class="btn-group" v-if="order.user && !order.date_delete"> | <div class="btn-group" v-if="order.user && !order.date_delete"> | ||||
<button class="btn btn-xs btn-default" v-if="order.amount_paid == order.amount" @click="orderPaymentClick" :data-id-order="order.id" data-type="refund" :data-amount="order.amount"> | <button class="btn btn-xs btn-default" v-if="order.amount_paid == order.amount" @click="orderPaymentClick" :data-id-order="order.id" data-type="refund" :data-amount="order.amount"> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<script type="text/x-template" id="order-state-payment"> | |||||
<div class="input-group"> | |||||
<span class="label label-success input-group-addon" v-if="order.amount_paid == order.amount">payé</span> | |||||
<span class="label label-default input-group-addon" v-else-if="order.amount_paid == 0">non réglé</span> | |||||
<span class="label label-default input-group-addon" v-else-if="order.amount_paid > order.amount">surplus</span> | |||||
<span class="label label-warning input-group-addon" v-else-if="order.amount_paid < order.amount">reste à payer</span> | |||||
<span class="glyphicon glyphicon-time" title="Paiement automatique" v-if="order.auto_payment && producer && producer.credit && (order.amount_paid == 0 || order.amount_paid < order.amount)"></span> | |||||
</div> | |||||
</script> | |||||
<!-- template for the order-form component --> | <!-- template for the order-form component --> | ||||
<script type="text/x-template" id="order-form-template"> | <script type="text/x-template" id="order-form-template"> | ||||
<modal class="modal-form-order" @close="$emit('close')"> | <modal class="modal-form-order" @close="$emit('close')"> | ||||
</div> | </div> | ||||
<div slot="footer"> | <div slot="footer"> | ||||
<div class="actions-form"> | <div class="actions-form"> | ||||
<button class="modal-default-button btn btn-primary" @click="submitFormCreate" v-if="!order.id && order.id_user > 0" data-process-credit="1">Créer et payer</button> | |||||
<button class="modal-default-button btn btn-primary" @click="submitFormUpdate" v-if="order.id && order.id_user > 0" data-process-credit="1">Modifier et payer</button> | |||||
<!--<button class="modal-default-button btn btn-primary" @click="submitFormCreate" v-if="!order.id && order.id_user > 0" data-process-credit="1">Créer et payer</button> | |||||
<button class="modal-default-button btn btn-primary" @click="submitFormUpdate" v-if="order.id && order.id_user > 0" data-process-credit="1">Modifier et payer</button>--> | |||||
<button class="modal-default-button btn btn-primary" @click="submitFormUpdate" v-if="order.id">Modifier</button> | <button class="modal-default-button btn btn-primary" @click="submitFormUpdate" v-if="order.id">Modifier</button> | ||||
<button class="modal-default-button btn btn-primary" @click="submitFormCreate" v-if="!order.id">Créer</button> | <button class="modal-default-button btn btn-primary" @click="submitFormCreate" v-if="!order.id">Créer</button> |
Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_WEEK => 'Jours de la semaine', | Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_WEEK => 'Jours de la semaine', | ||||
Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_INCOMING_DISTRIBUTIONS => 'Distributions à venir', | Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_INCOMING_DISTRIBUTIONS => 'Distributions à venir', | ||||
]); ?> | ]); ?> | ||||
<?= $form->field($model, 'option_point_sale_wording') ?> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
.distribution-index #orders table td.column-state-payment { | .distribution-index #orders table td.column-state-payment { | ||||
width: 120px; | width: 120px; | ||||
} | } | ||||
/* line 300, ../sass/distribution/_index.scss */ | |||||
/* line 299, ../sass/distribution/_index.scss */ | |||||
.distribution-index #orders table .state-payment-mobile { | |||||
display: none; | |||||
} | |||||
/* line 304, ../sass/distribution/_index.scss */ | |||||
.distribution-index #orders table td.column-payment div.btn-group { | .distribution-index #orders table td.column-payment div.btn-group { | ||||
width: 125px; | width: 125px; | ||||
} | } | ||||
/* line 306, ../sass/distribution/_index.scss */ | |||||
/* line 310, ../sass/distribution/_index.scss */ | |||||
.distribution-index #orders table tr.view ul { | .distribution-index #orders table tr.view ul { | ||||
list-style-type: none; | list-style-type: none; | ||||
margin-left: 0px; | margin-left: 0px; | ||||
padding-left: 15px; | padding-left: 15px; | ||||
} | } | ||||
/* line 316, ../sass/distribution/_index.scss */ | |||||
/* line 320, ../sass/distribution/_index.scss */ | |||||
.distribution-index #orders table tr.view .comment { | .distribution-index #orders table tr.view .comment { | ||||
margin-top: 20px; | margin-top: 20px; | ||||
} | } | ||||
/* line 320, ../sass/distribution/_index.scss */ | |||||
/* line 324, ../sass/distribution/_index.scss */ | |||||
.distribution-index #orders table tr.view .delivery { | .distribution-index #orders table tr.view .delivery { | ||||
margin-top: 20px; | margin-top: 20px; | ||||
} | } | ||||
/* line 329, ../sass/distribution/_index.scss */ | |||||
/* line 333, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order .modal-container { | .distribution-index .modal-form-order .modal-container { | ||||
width: 100%; | width: 100%; | ||||
padding: 0px; | padding: 0px; | ||||
} | } | ||||
/* line 333, ../sass/distribution/_index.scss */ | |||||
/* line 337, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order .modal-container .modal-body { | .distribution-index .modal-form-order .modal-container .modal-body { | ||||
padding-right: 15px; | padding-right: 15px; | ||||
} | } | ||||
/* line 336, ../sass/distribution/_index.scss */ | |||||
/* line 340, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order .modal-container .modal-body table { | .distribution-index .modal-form-order .modal-container .modal-body table { | ||||
margin-bottom: 150px; | margin-bottom: 150px; | ||||
} | } | ||||
/* line 341, ../sass/distribution/_index.scss */ | |||||
/* line 345, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order .modal-container .modal-footer { | .distribution-index .modal-form-order .modal-container .modal-footer { | ||||
border-top-color: #f4f4f4; | border-top-color: #f4f4f4; | ||||
position: fixed; | position: fixed; | ||||
text-align: center; | text-align: center; | ||||
border-top: solid 1px #e0e0e0; | border-top: solid 1px #e0e0e0; | ||||
} | } | ||||
/* line 353, ../sass/distribution/_index.scss */ | |||||
/* line 357, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order .modal-container .modal-footer .actions-form button { | .distribution-index .modal-form-order .modal-container .modal-footer .actions-form button { | ||||
float: none; | float: none; | ||||
} | } | ||||
/* line 357, ../sass/distribution/_index.scss */ | |||||
/* line 361, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order .modal-container .modal-footer .actions-form div.right { | .distribution-index .modal-form-order .modal-container .modal-footer .actions-form div.right { | ||||
float: right; | float: right; | ||||
} | } | ||||
/* line 364, ../sass/distribution/_index.scss */ | |||||
/* line 368, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order .btn-credit { | .distribution-index .modal-form-order .btn-credit { | ||||
float: right; | float: right; | ||||
} | } | ||||
/* line 370, ../sass/distribution/_index.scss */ | |||||
/* line 374, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products .product-ordered td { | .distribution-index .modal-form-order table.table-products .product-ordered td { | ||||
background-color: #e9e9e9; | background-color: #e9e9e9; | ||||
} | } | ||||
/* line 374, ../sass/distribution/_index.scss */ | |||||
/* line 378, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products .product-ordered input.input-quantity { | .distribution-index .modal-form-order table.table-products .product-ordered input.input-quantity { | ||||
font-size: 16px; | font-size: 16px; | ||||
font-weight: bold; | font-weight: bold; | ||||
} | } | ||||
/* line 380, ../sass/distribution/_index.scss */ | |||||
/* line 384, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.price { | .distribution-index .modal-form-order table.table-products td.price { | ||||
width: 150px; | width: 150px; | ||||
} | } | ||||
/* line 383, ../sass/distribution/_index.scss */ | |||||
/* line 387, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.price input { | .distribution-index .modal-form-order table.table-products td.price input { | ||||
text-align: center; | text-align: center; | ||||
} | } | ||||
/* line 387, ../sass/distribution/_index.scss */ | |||||
/* line 391, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.price .input-group-addon { | .distribution-index .modal-form-order table.table-products td.price .input-group-addon { | ||||
background-color: #eee; | background-color: #eee; | ||||
} | } | ||||
/* line 392, ../sass/distribution/_index.scss */ | |||||
/* line 396, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.quantity { | .distribution-index .modal-form-order table.table-products td.quantity { | ||||
width: 165px; | width: 165px; | ||||
} | } | ||||
/* line 395, ../sass/distribution/_index.scss */ | |||||
/* line 399, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.quantity input { | .distribution-index .modal-form-order table.table-products td.quantity input { | ||||
text-align: center; | text-align: center; | ||||
color: black; | color: black; | ||||
} | } | ||||
/* line 400, ../sass/distribution/_index.scss */ | |||||
/* line 404, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.quantity .form-control { | .distribution-index .modal-form-order table.table-products td.quantity .form-control { | ||||
border-right: 0px none; | border-right: 0px none; | ||||
padding-right: 4px; | padding-right: 4px; | ||||
} | } | ||||
/* line 405, ../sass/distribution/_index.scss */ | |||||
/* line 409, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.quantity .input-group-addon { | .distribution-index .modal-form-order table.table-products td.quantity .input-group-addon { | ||||
padding: 5px; | padding: 5px; | ||||
padding-left: 0px; | padding-left: 0px; | ||||
border-left: 0px none; | border-left: 0px none; | ||||
border-right: 0px none; | border-right: 0px none; | ||||
} | } | ||||
/* line 414, ../sass/distribution/_index.scss */ | |||||
/* line 418, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.quantity-remaining { | .distribution-index .modal-form-order table.table-products td.quantity-remaining { | ||||
text-align: right; | text-align: right; | ||||
} | } | ||||
/* line 417, ../sass/distribution/_index.scss */ | |||||
/* line 421, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.quantity-remaining.quantity-remaining, .distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite { | .distribution-index .modal-form-order table.table-products td.quantity-remaining.quantity-remaining, .distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite { | ||||
color: #00A65A; | color: #00A65A; | ||||
} | } | ||||
/* line 421, ../sass/distribution/_index.scss */ | |||||
/* line 425, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.quantity-remaining.negative { | .distribution-index .modal-form-order table.table-products td.quantity-remaining.negative { | ||||
color: #DD4B39; | color: #DD4B39; | ||||
} | } | ||||
/* line 425, ../sass/distribution/_index.scss */ | |||||
/* line 429, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite, .distribution-index .modal-form-order table.table-products td.quantity-remaining.empty { | .distribution-index .modal-form-order table.table-products td.quantity-remaining.infinite, .distribution-index .modal-form-order table.table-products td.quantity-remaining.empty { | ||||
font-size: 18px; | font-size: 18px; | ||||
} | } | ||||
/* line 432, ../sass/distribution/_index.scss */ | |||||
/* line 436, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-form-order .actions-form button { | .distribution-index .modal-form-order .actions-form button { | ||||
margin-left: 15px; | margin-left: 15px; | ||||
} | } | ||||
/* line 440, ../sass/distribution/_index.scss */ | |||||
/* line 444, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-payment .info-box .info-box-icon { | .distribution-index .modal-payment .info-box .info-box-icon { | ||||
width: 50px; | width: 50px; | ||||
} | } | ||||
/* line 443, ../sass/distribution/_index.scss */ | |||||
/* line 447, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-payment .info-box .info-box-icon i { | .distribution-index .modal-payment .info-box .info-box-icon i { | ||||
font-size: 30px; | font-size: 30px; | ||||
} | } | ||||
/* line 448, ../sass/distribution/_index.scss */ | |||||
/* line 452, ../sass/distribution/_index.scss */ | |||||
.distribution-index .modal-payment .info-box .info-box-content { | .distribution-index .modal-payment .info-box .info-box-content { | ||||
margin-left: 50px; | margin-left: 50px; | ||||
} | } | ||||
display: block; | display: block; | ||||
} | } | ||||
/* line 120, ../sass/_responsive.scss */ | /* line 120, ../sass/_responsive.scss */ | ||||
.distribution-index #orders table .state-payment-mobile { | |||||
display: block; | |||||
} | |||||
/* line 123, ../sass/_responsive.scss */ | |||||
.distribution-index #orders table .state-payment-mobile .glyphicon-time { | |||||
display: none; | |||||
} | |||||
/* line 129, ../sass/_responsive.scss */ | |||||
.distribution-index #orders table ul.dropdown-menu a { | .distribution-index #orders table ul.dropdown-menu a { | ||||
padding: 15px; | padding: 15px; | ||||
} | } | ||||
/* line 125, ../sass/_responsive.scss */ | |||||
/* line 134, ../sass/_responsive.scss */ | |||||
.distribution-index #orders table button.dropdown-toggle, | .distribution-index #orders table button.dropdown-toggle, | ||||
.distribution-index #orders table button.btn-moins, | .distribution-index #orders table button.btn-moins, | ||||
.distribution-index #orders table button.btn-plus { | .distribution-index #orders table button.btn-plus { | ||||
padding: 15px; | padding: 15px; | ||||
} | } | ||||
/* line 132, ../sass/_responsive.scss */ | |||||
/* line 141, ../sass/_responsive.scss */ | |||||
.distribution-index #orders table .column-origin, | .distribution-index #orders table .column-origin, | ||||
.distribution-index #orders table .column-point-sale, | .distribution-index #orders table .column-point-sale, | ||||
.distribution-index #orders table .column-state-payment, | .distribution-index #orders table .column-state-payment, |
}, | }, | ||||
}); | }); | ||||
Vue.component('order-state-payment', { | |||||
props: ['order', 'producer'], | |||||
template: '#order-state-payment', | |||||
}); | |||||
Vue.component('modal', { | Vue.component('modal', { | ||||
template: '#modal-template' | template: '#modal-template' | ||||
}) | |||||
}); | |||||
Vue.component('order-form',{ | Vue.component('order-form',{ | ||||
props: ['date', 'dateFormat', 'pointsSale', 'idActivePointSale', 'meansPayment', 'users', 'products', 'order', 'producer', 'loadingUpdateProductOrder'], | props: ['date', 'dateFormat', 'pointsSale', 'idActivePointSale', 'meansPayment', 'users', 'products', 'order', 'producer', 'loadingUpdateProductOrder'], | ||||
username: this.order.username, | username: this.order.username, | ||||
meanPayment: this.order.mean_payment, | meanPayment: this.order.mean_payment, | ||||
products: app.getProductOrderArrayRequest(), | products: app.getProductOrderArrayRequest(), | ||||
comment: this.order.comment, | |||||
processCredit: processCredit | |||||
comment: this.order.comment | |||||
}}) | }}) | ||||
.then(function(response) { | .then(function(response) { | ||||
app.order.id_point_sale = 0 ; | app.order.id_point_sale = 0 ; |
} | } | ||||
table { | table { | ||||
.state-payment-mobile { | |||||
display: block; | |||||
.glyphicon-time { | |||||
display: none; | |||||
} | |||||
} | |||||
ul.dropdown-menu { | ul.dropdown-menu { | ||||
a { | a { | ||||
padding: 15px; | padding: 15px; |
width: 120px; | width: 120px; | ||||
} | } | ||||
.state-payment-mobile { | |||||
display: none; | |||||
} | |||||
td.column-payment { | td.column-payment { | ||||
div.btn-group { | div.btn-group { | ||||
width: 125px; | width: 125px; |
*/ | */ | ||||
return [ | return [ | ||||
'version' => '23.1.A', | |||||
'version' => '23.3.A', | |||||
'adminEmail' => 'contact@opendistrib.net', | 'adminEmail' => 'contact@opendistrib.net', | ||||
'supportEmail' => 'contact@opendistrib.net', | 'supportEmail' => 'contact@opendistrib.net', | ||||
'user.passwordResetTokenExpire' => 3600, | 'user.passwordResetTokenExpire' => 3600, |
<?php | |||||
return [ | |||||
'components' => [ | |||||
'db' => [ | |||||
'class' => 'yii\db\Connection', | |||||
'dsn' => 'mysql:host=localhost;dbname=opendistrib_test', | |||||
'username' => 'root', | |||||
'password' => 'root', | |||||
'charset' => 'utf8', | |||||
], | |||||
'mailer' => [ | |||||
'class' => 'yii\swiftmailer\Mailer', | |||||
'viewPath' => '@common/mail', | |||||
// send all mails to a file by default. You have to set | |||||
// 'useFileTransport' to false and configure a transport | |||||
// for the mailer to send real emails. | |||||
'useFileTransport' => true, | |||||
'transport' => [ | |||||
'class' => 'Swift_SmtpTransport', | |||||
'host' => 'smtp-laclic.alwaysdata.net', | |||||
'username' => 'nepasrepondre@laclic.fr', | |||||
'password' => 'UPdz4ain73u3T3S74z2MHG9gUKnu6Qq6', | |||||
'port' => '25', | |||||
//'encryption' => 'tls', | |||||
], | |||||
], | |||||
], | |||||
]; |
} | } | ||||
} | } | ||||
krsort($versionsArray); | |||||
rsort($versionsArray); | |||||
return $versionsArray; | return $versionsArray; | ||||
} | } |
$amountTotalOrderOpendistrib = (int)round( | $amountTotalOrderOpendistrib = (int)round( | ||||
$orderOpendistrib->getAmountWithTax(Order::AMOUNT_TOTAL) * 100 | $orderOpendistrib->getAmountWithTax(Order::AMOUNT_TOTAL) * 100 | ||||
); | ); | ||||
if ($amountTotalOrderOpendistrib == (int)$orderTiller->currentPayedAmount | |||||
|| $amountTotalOrderOpendistrib == (int)$orderTiller->currentBill) { | |||||
if ($amountTotalOrderOpendistrib >= (int)$orderTiller->currentPayedAmount | |||||
|| $amountTotalOrderOpendistrib >= (int)$orderTiller->currentBill) { | |||||
$ordersOpendistribSynchro[$orderOpendistrib->id] = true; | $ordersOpendistribSynchro[$orderOpendistrib->id] = true; | ||||
} | } | ||||
} | } |
|| ($this->quotation && $this->quotation->isStatusValid()) | || ($this->quotation && $this->quotation->isStatusValid()) | ||||
|| ($this->invoice && $this->invoice->isStatusValid()); | || ($this->invoice && $this->invoice->isStatusValid()); | ||||
} | } | ||||
public function isCreditAutoPayment() | |||||
{ | |||||
$pointSale = PointSale::findOne($this->id_point_sale); | |||||
$distribution = Distribution::findOne($this->id_distribution); | |||||
$creditFunctioning = $pointSale->getCreditFunctioning(); | |||||
if ($this->id_user && Producer::getConfig('credit') && $pointSale->credit) { | |||||
if ($creditFunctioning == Producer::CREDIT_FUNCTIONING_OPTIONAL) { | |||||
return 0; | |||||
} elseif ($creditFunctioning == Producer::CREDIT_FUNCTIONING_MANDATORY) { | |||||
return 1; | |||||
} elseif ($creditFunctioning == Producer::CREDIT_FUNCTIONING_USER) { | |||||
$userProducer = UserProducer::searchOne([ | |||||
'id_user' => $this->id_user, | |||||
'id_producer' => $distribution->id_producer | |||||
]); | |||||
if ($userProducer) { | |||||
return $userProducer->credit_active; | |||||
} | |||||
} | |||||
} | |||||
return 0; | |||||
} | |||||
} | } |
'option_online_payment_type', | 'option_online_payment_type', | ||||
'option_tax_calculation_method', | 'option_tax_calculation_method', | ||||
'latest_version_opendistrib', | 'latest_version_opendistrib', | ||||
'option_csv_separator' | |||||
'option_csv_separator', | |||||
'option_point_sale_wording' | |||||
], | ], | ||||
'string' | 'string' | ||||
], | ], | ||||
'document_delivery_note_first_reference', | 'document_delivery_note_first_reference', | ||||
'option_billing_type', | 'option_billing_type', | ||||
'option_billing_frequency', | 'option_billing_frequency', | ||||
'option_point_sale_wording' | |||||
], | ], | ||||
'string', | 'string', | ||||
'max' => 255 | 'max' => 255 | ||||
'option_billing_reduction_percentage' => 'Réduction : pourcentage', | 'option_billing_reduction_percentage' => 'Réduction : pourcentage', | ||||
'option_billing_permanent_transfer' => 'Virement permanent', | 'option_billing_permanent_transfer' => 'Virement permanent', | ||||
'option_billing_permanent_transfer_amount' => 'Virement permanent : montant', | 'option_billing_permanent_transfer_amount' => 'Virement permanent : montant', | ||||
'option_point_sale_wording' => 'Libellé points de vente' | |||||
]; | ]; | ||||
} | } | ||||
return $onlinePaymentMinimumAmount; | return $onlinePaymentMinimumAmount; | ||||
} | } | ||||
public function getPointSaleWording() | |||||
{ | |||||
if($this->option_point_sale_wording && strlen($this->option_point_sale_wording)) { | |||||
return Html::encode($this->option_point_sale_wording); | |||||
} | |||||
return 'Points de vente'; | |||||
} | |||||
} | } | ||||
$pointSale = PointSale::findOne($this->id_point_sale); | $pointSale = PointSale::findOne($this->id_point_sale); | ||||
if ($pointSale) { | if ($pointSale) { | ||||
$creditFunctioning = $pointSale->getCreditFunctioning(); | |||||
$order->auto_payment = 0; | $order->auto_payment = 0; | ||||
if($this->auto_payment == self::AUTO_PAYMENT_DEDUCTED) { | if($this->auto_payment == self::AUTO_PAYMENT_DEDUCTED) { | ||||
if ($order->id_user && Producer::getConfig('credit') && $pointSale->credit) { | |||||
if ($creditFunctioning == Producer::CREDIT_FUNCTIONING_OPTIONAL) { | |||||
$order->auto_payment = 0; | |||||
} elseif ($creditFunctioning == Producer::CREDIT_FUNCTIONING_MANDATORY) { | |||||
$order->auto_payment = 1; | |||||
} elseif ($creditFunctioning == Producer::CREDIT_FUNCTIONING_USER) { | |||||
$user = User::findOne($order->id_user); | |||||
$userProducer = UserProducer::searchOne([ | |||||
'id_user' => $order->id_user, | |||||
'id_producer' => $distribution->id_producer | |||||
]); | |||||
if ($userProducer) { | |||||
$order->auto_payment = $userProducer->credit_active; | |||||
} | |||||
} | |||||
} | |||||
$order->auto_payment = $order->isCreditAutoPayment(); | |||||
} | } | ||||
elseif($this->auto_payment == self::AUTO_PAYMENT_YES) { | elseif($this->auto_payment == self::AUTO_PAYMENT_YES) { | ||||
$order->auto_payment = 1; | $order->auto_payment = 1; | ||||
$order->auto_payment = 0; | $order->auto_payment = 0; | ||||
} | } | ||||
$order->tiller_synchronization = $order->auto_payment; | $order->tiller_synchronization = $order->auto_payment; | ||||
$userPointSale = UserPointSale::searchOne([ | $userPointSale = UserPointSale::searchOne([ |
<h4>Date de sortie</h4> | |||||
<ul> | |||||
<li>27/03/2023</li> | |||||
</ul> | |||||
<h4>Évolutions</h4> | |||||
<ul> | |||||
<li> | |||||
[Administration] Distributions > édition/création commande : bouton unique "Créer" ou "Modifier". | |||||
La gestion du crédit est désormais automatiquement déduite du contexte (utilisateur, point de vente). | |||||
</li> | |||||
<li> | |||||
[Administration] Paramètres : ajout d'une option pour configurer le libellé "Points de vente" affiché sur l'accueil | |||||
et le tunnel de commande de l'espace producteur. | |||||
</li> | |||||
<li> | |||||
[Administration] Export vers le logiciel Evoliz : ajout de la TVA + code classification vente | |||||
</li> | |||||
</ul> |
<?php | |||||
use yii\db\Migration; | |||||
use yii\db\Schema; | |||||
/** | |||||
* Class m230320_080836_producer_add_option_point_sale_wording | |||||
*/ | |||||
class m230320_080836_producer_add_option_point_sale_wording extends Migration | |||||
{ | |||||
/** | |||||
* {@inheritdoc} | |||||
*/ | |||||
public function safeUp() | |||||
{ | |||||
$this->addColumn('producer', 'option_point_sale_wording', Schema::TYPE_STRING .' DEFAULT NULL'); | |||||
} | |||||
/** | |||||
* {@inheritdoc} | |||||
*/ | |||||
public function safeDown() | |||||
{ | |||||
$this->dropColumn('producer', 'option_point_sale_wording'); | |||||
} | |||||
} |
<script type="text/x-template" id="template-step-point-sale"> | <script type="text/x-template" id="template-step-point-sale"> | ||||
<li id="step-point-sale" :class="'col-md-3'+((step == 'point-sale') ? ' active ' : '')+(first ? ' first' : '')"> | <li id="step-point-sale" :class="'col-md-3'+((step == 'point-sale') ? ' active ' : '')+(first ? ' first' : '')"> | ||||
<button @click="changeStep('point-sale')" :class="'btn '+ (step == 'point-sale' ? 'btn-primary' : 'btn-default')" :disabled="producer && (producer.option_order_entry_point == 'date' && step == 'date')"> | <button @click="changeStep('point-sale')" :class="'btn '+ (step == 'point-sale' ? 'btn-primary' : 'btn-default')" :disabled="producer && (producer.option_order_entry_point == 'date' && step == 'date')"> | ||||
<span class="button-content"><span class="glyphicon glyphicon-map-marker"></span> Points de vente</span> | |||||
<span class="button-content"><span class="glyphicon glyphicon-map-marker"></span> <?= $producer->getPointSaleWording(); ?></span> | |||||
</button> | </button> | ||||
<div class="info-step" v-if="pointSaleActive"> | <div class="info-step" v-if="pointSaleActive"> | ||||
{{ pointSaleActive.name }} | {{ pointSaleActive.name }} |
<section id="points-sale"> | <section id="points-sale"> | ||||
<h3><span>Points de vente</span></h3> | |||||
<h3><span><?= $producer->getPointSaleWording(); ?></span></h3> | |||||
<?= GridView::widget([ | <?= GridView::widget([ | ||||
'dataProvider' => $dataProviderPointsSale, | 'dataProvider' => $dataProviderPointsSale, | ||||
'summary' => '', | 'summary' => '', |
<!DOCTYPE html> | |||||
<html lang="fr-FR"> | |||||
<head> | |||||
<title>Démo | Contact</title> | |||||
<meta charset="utf-8"> | |||||
<meta name="viewport" content="width=device-width, initial-scale=1"> | |||||
<meta name="base-url" content="/Opendistrib/producer/web"> | |||||
<meta name="slug-producer" content="demo"> | |||||
<link rel="icon" type="image/png" | |||||
href="/Opendistrib/producer/web/img/favicon-distrib.png"/> | |||||
<link href="/producer/web/assets/d52c06b/css/bootstrap.css" rel="stylesheet"> | |||||
<link href="/producer/web/assets/86336c25/bootstrap/css/bootstrap.min.css?v=1660289677" rel="stylesheet"> | |||||
<link href="/producer/web/assets/86336c25/js/jquery-ui-1.11.4.custom/jquery-ui.min.css?v=1660289677" rel="stylesheet"> | |||||
<link href="/producer/web/assets/86336c25/js/jquery-ui-1.11.4.custom/jquery-ui.theme.css?v=1660289677" rel="stylesheet"> | |||||
<link href="/producer/web/assets/86336c25/js/vuejs/vcalendar/vcalendar.min.css?v=1660289677" rel="stylesheet"> | |||||
<link href="/producer/web/assets/86336c25/css/screen.css?v=1660289677" rel="stylesheet"> | |||||
<link href="/producer/web/css/screen.css?v=1680250670" rel="stylesheet"></head> | |||||
<body class="site-contact"> | |||||
<div id="header-bap"> | |||||
<ul id="nav-bap" class="nav"><li id="label1" class="dropdown"><a class="dropdown-toggle" href="#" data-toggle="dropdown"><span class="glyphicon glyphicon-menu-hamburger"></span> <span class="caret"></span></a><ul id="w2" class="dropdown-menu"><li><a href="http://localhost/Opendistrib/frontend/web/site/index" tabindex="-1"><span class="glyphicon glyphicon-chevron-left"></span> Retour à l'accueil</a></li> | |||||
<li><a href="http://localhost/Opendistrib/frontend/web/site/signup" tabindex="-1"><span class="glyphicon glyphicon-user"></span> Inscription</a></li> | |||||
<li><a href="http://localhost/Opendistrib/frontend/web/site/login?return_url=http%3A%2F%2Flocalhost%2Findex-test.php%2Fdemo" tabindex="-1"><span class="glyphicon glyphicon-log-in"></span> Connexion</a></li></ul></li></ul></div> | |||||
<div class="container"> | |||||
<div id="left" class="col-md-3"> | |||||
<div class="fixed"> | |||||
<h1>Démo</h1> | |||||
<h2>Boulangerie à Besançon (25000)</h2> | |||||
<nav id="main-nav"> | |||||
<ul id="w3" class="nav"><li><a href="/Opendistrib/producer/web/demo"><span class="glyphicon glyphicon-th-large"></span> Accueil</a></li> | |||||
<li><a href="http://localhost/Opendistrib/frontend/web/site/producer?id=32&return_url=http%3A%2F%2Flocalhost%2FOpendistrib%2Fproducer%2Fweb%2Fdemo%2Forder%2Forder"><span class="glyphicon glyphicon-plus"></span> Commander</a></li> | |||||
<li class="active"><a href="/Opendistrib/producer/web/demo/site/contact"><span class="glyphicon glyphicon-envelope"></span> Contact</a></li></ul> </nav> | |||||
</div> | |||||
</div> | |||||
<div id="main" class="col-md-9"> | |||||
<div id="img-big"> | |||||
<img class="img-photo" src="/Opendistrib/producer/web/uploads/bread-2595658_1920-5ced4b138049a.jpg" | |||||
alt="Photo Démo"/> | |||||
</div> | |||||
<div id="infos-producer"> | |||||
<span data-toggle="tooltip" data-placement="bottom" title="Heure limite de commande"> | |||||
<span class="glyphicon glyphicon-time"></span> Commande avant | |||||
<strong>16 h</strong></span>, | |||||
<span data-toggle="tooltip" data-placement="bottom" | |||||
title="Exemple : commande le lundi pour le | |||||
mardi"><strong>1 jour</strong> à l'avance</span> | |||||
<div class="clr"></div> | |||||
</div> | |||||
<h2 id="page-title"> | |||||
Contact </h2> | |||||
<section id="content"> | |||||
<div class="alert alert-danger" role="alert"> | |||||
Il y a eu une erreur lors de l'envoi de votre message. </div> | |||||
<div class="site-contact"> | |||||
<div class="row"> | |||||
<div class="col-lg-5"> | |||||
<form id="contact-form" action="/demo/site/contact" method="post"> <div class="form-group field-contactform-name required"> | |||||
<label class="control-label" for="contactform-name">Nom</label> | |||||
<input type="text" id="contactform-name" class="form-control" name="ContactForm[name]" aria-required="true"> | |||||
<p class="help-block help-block-error"></p> | |||||
</div> <div class="form-group field-contactform-email required"> | |||||
<label class="control-label" for="contactform-email">Email</label> | |||||
<input type="text" id="contactform-email" class="form-control" name="ContactForm[email]" aria-required="true"> | |||||
<p class="help-block help-block-error"></p> | |||||
</div> <div class="form-group field-contactform-subject required"> | |||||
<label class="control-label" for="contactform-subject">Sujet</label> | |||||
<input type="text" id="contactform-subject" class="form-control" name="ContactForm[subject]" aria-required="true"> | |||||
<p class="help-block help-block-error"></p> | |||||
</div> <div class="form-group field-contactform-body required"> | |||||
<label class="control-label" for="contactform-body">Message</label> | |||||
<textarea id="contactform-body" class="form-control" name="ContactForm[body]" rows="6" aria-required="true"></textarea> | |||||
<p class="help-block help-block-error"></p> | |||||
</div> | |||||
<div class="form-group field-contactform-verifycode"> | |||||
<label class="control-label" for="contactform-verifycode">Code de vérification</label> | |||||
<div class="row"><div class="col-md-12"><img id="contactform-verifycode-image" src="/index-test.php/demo/site/captcha?v=64269cf450f772.41015171" alt=""></div><div class="col-md-12"><input type="text" id="contactform-verifycode" class="form-control" name="ContactForm[verifyCode]"></div></div> | |||||
<p class="help-block help-block-error"></p> | |||||
</div> <div class="form-group field-contactform-istest"> | |||||
<label class="control-label" for="contactform-istest">Is Test</label> | |||||
<input type="hidden" id="contactform-istest" class="form-control" name="ContactForm[isTest]"> | |||||
<p class="help-block help-block-error"></p> | |||||
</div> <div class="form-group"> | |||||
<button type="submit" class="btn btn-primary" name="contact-button">Envoyer</button> </div> | |||||
</form> </div> | |||||
</div> | |||||
</div> | |||||
</section> | |||||
</div> | |||||
</div> | |||||
<footer id="footer" class="container"> | |||||
<div class="content"> | |||||
<a href="http://localhost/Opendistrib/frontend/web/site/index">distrib</a> • | |||||
<a href="http://localhost/Opendistrib/frontend/web/site/mentions">Mentions | |||||
légales</a> • | |||||
<a href="http://localhost/Opendistrib/frontend/web/site/cgv">CGS</a> • | |||||
<a id="code-source" href="https://forge.laclic.fr/Laclic/Opendistrib">Code source</a> | |||||
</div> | |||||
</footer> | |||||
<script type="text/javascript" src="https://cdn.polyfill.io/v3/polyfill.min.js?features=Intl.~locale.fr"></script> | |||||
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script> | |||||
<script src="/producer/web/assets/8f677d6c/yii.js"></script> | |||||
<script src="/producer/web/assets/8f677d6c/yii.captcha.js"></script> | |||||
<script src="/producer/web/assets/8f677d6c/yii.activeForm.js"></script> | |||||
<script src="/producer/web/assets/86336c25/js/jquery-ui-1.11.4.custom/jquery-ui.min.js?v=1660289677"></script> | |||||
<script src="/producer/web/assets/86336c25/js/promise-polyfill/promise.min.js?v=1660289677"></script> | |||||
<script src="/producer/web/assets/86336c25/js/axios/axios.min.js?v=1660289677"></script> | |||||
<script src="/producer/web/assets/86336c25/js/vuejs/vue.js?v=1660289677"></script> | |||||
<script src="/producer/web/assets/86336c25/js/vuejs/vcalendar/vcalendar.min.js?v=1660289677"></script> | |||||
<script src="/producer/web/assets/86336c25/js/utils.js?v=1660289677"></script> | |||||
<script src="/producer/web/js/producer.js?v=1660289677"></script> | |||||
<script src="/producer/web/assets/d52c06b/js/bootstrap.js"></script> | |||||
<script>jQuery(function ($) { | |||||
jQuery('#contactform-verifycode-image').yiiCaptcha({"refreshUrl":"\/index-test.php\/demo\/site\/captcha?refresh=1","hashKey":"yiiCaptcha\/site\/captcha"}); | |||||
jQuery('#contact-form').yiiActiveForm([], []); | |||||
});</script></body> | |||||
</html> |