Browse Source

Merge branch 'dev'

prodstable
Fabien Normand 2 years ago
parent
commit
1aa0f073a5
9 changed files with 33 additions and 39 deletions
  1. +5
    -5
      backend/controllers/DistributionController.php
  2. +9
    -7
      backend/views/distribution/index.php
  3. +0
    -1
      backend/views/layouts/main.php
  4. +11
    -7
      backend/web/css/document/download.css
  5. +6
    -2
      backend/web/sass/document/download.scss
  6. +2
    -3
      common/models/Order.php
  7. +0
    -10
      common/views/_analytics.php
  8. +0
    -3
      frontend/views/layouts/main.php
  9. +0
    -1
      producer/views/layouts/main.php

+ 5
- 5
backend/controllers/DistributionController.php View File

@@ -282,15 +282,15 @@ class DistributionController extends BackendController

$order = array_merge($order->getAttributes(), [
'selected' => false,
'amount' => $order->getAmountWithTax(Order::AMOUNT_TOTAL),
'amount_paid' => $order->getAmount(Order::AMOUNT_PAID),
'amount_remaining' => $order->getAmount(Order::AMOUNT_REMAINING),
'amount_surplus' => $order->getAmount(Order::AMOUNT_SURPLUS),
'amount' => Price::numberTwoDecimals($order->getAmountWithTax(Order::AMOUNT_TOTAL)),
'amount_paid' => Price::numberTwoDecimals($order->getAmount(Order::AMOUNT_PAID)),
'amount_remaining' => Price::numberTwoDecimals($order->getAmount(Order::AMOUNT_REMAINING)),
'amount_surplus' => Price::numberTwoDecimals($order->getAmount(Order::AMOUNT_SURPLUS)),
'user' => (isset($order->user)) ? array_merge(
$order->user->getAttributes(),
$arrayCreditUser
) : null,
'pointSale' => ['id' => $order->pointSale->id, 'name' => $order->pointSale->name],
'pointSale' => $order->pointSale ? ['id' => $order->pointSale->id, 'name' => $order->pointSale->name] : null,
'productOrder' => $productOrderArray,
'creditHistory' => $creditHistoryArray,
'oneProductUnactivated' => $oneProductUnactivated

+ 9
- 7
backend/views/distribution/index.php View File

@@ -336,9 +336,11 @@ $this->setPageTitle('Distributions') ;
<span v-if="order.delivery_home && order.delivery_address && order.delivery_address.length > 0" class="glyphicon glyphicon-home"></span>
</td>
<td class="column-point-sale" v-if="idActivePointSale == 0">
{{ order.pointSale.name }}
<template v-if="order.pointSale">
{{ order.pointSale.name }}
</template>
</td>
<td class="column-amount">{{ order.amount.toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+'&nbsp;€' }}</td>
<td class="column-amount">{{ order.amount.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+'&nbsp;€' }}</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>
@@ -420,7 +422,7 @@ $this->setPageTitle('Distributions') ;
<span :class="'info-box-icon ' +((order.amount_paid == order.amount) ? 'bg-green' : 'bg-red')"><i class="fa fa-check"></i></span>
<div class="info-box-content">
<span class="info-box-text">Montant</span>
<span class="info-box-number">{{ order.amount.toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }}</span>
<span class="info-box-number">{{ order.amount.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }}</span>
<span class="info-box-text">
Statut<br />
<span class="label label-success" v-if="order.amount_paid == order.amount">payé</span>
@@ -445,7 +447,7 @@ $this->setPageTitle('Distributions') ;
data-type="refund"
@click="orderPaymentClick" >
<span class="glyphicon glyphicon-chevron-right"></span>
Rembourser {{ order.amount.toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }}
Rembourser {{ order.amount.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }}
</button>

<button v-else-if="order.amount_paid == 0"
@@ -454,7 +456,7 @@ $this->setPageTitle('Distributions') ;
data-type="payment"
@click="orderPaymentClick">
<span class="glyphicon glyphicon-chevron-right"></span>
Payer {{ order.amount.toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }}
Payer {{ order.amount.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }}
</button>

<button v-else-if="order.amount_paid > order.amount"
@@ -463,7 +465,7 @@ $this->setPageTitle('Distributions') ;
data-type="refund"
@click="orderPaymentClick">
<span class="glyphicon glyphicon-chevron-right"></span>
Rembourser {{ order.amount_surplus.toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }}
Rembourser {{ order.amount_surplus.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }}
</button>

<button v-else-if="order.amount_paid < order.amount"
@@ -472,7 +474,7 @@ $this->setPageTitle('Distributions') ;
data-type="payment"
@click="orderPaymentClick">
<span class="glyphicon glyphicon-chevron-right"></span>
Payer le restant {{ order.amount_remaining.toFixed(2).replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }}
Payer le restant {{ order.amount_remaining.replace(/(\d)(?=(\d{3})+(?:\.\d+)?$)/g, "$1,")+' €' }}
</button>
</div>


+ 0
- 1
backend/views/layouts/main.php View File

@@ -97,7 +97,6 @@ if (Yii::$app->controller->action->id === 'login') {

<script type="text/javascript" src="https://cdn.polyfill.io/v3/polyfill.min.js?features=Intl.~locale.fr"></script>
<?php $this->endBody() ?>
<?= $this->render('@common/views/_analytics.php'); ?>

</body>
</html>

+ 11
- 7
backend/web/css/document/download.css View File

@@ -62,11 +62,11 @@ body {
}
/* line 71, ../../sass/document/download.scss */
.document-download #block-products table td, .document-download #block-products table th {
padding: 5px;
padding: 2px 5px;
border-top: solid 1px #c0c0c0;
border-left: solid 1px #c0c0c0;
font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 13px;
font-size: 12px;
}
/* line 78, ../../sass/document/download.scss */
.document-download #block-products table td.align-left, .document-download #block-products table th.align-left {
@@ -80,32 +80,36 @@ body {
.document-download #block-products table td.align-right, .document-download #block-products table th.align-right {
text-align: right;
}
/* line 91, ../../sass/document/download.scss */
/* line 89, ../../sass/document/download.scss */
.document-download #block-products table td {
font-size: 11px;
}
/* line 95, ../../sass/document/download.scss */
.document-download .block-infos {
margin-top: 20px;
padding: 10px;
border: solid 1px #c0c0c0;
}
/* line 96, ../../sass/document/download.scss */
/* line 100, ../../sass/document/download.scss */
.document-download .block-infos strong {
font-size: 12px;
}

/* line 102, ../../sass/document/download.scss */
/* line 106, ../../sass/document/download.scss */
#footer {
font-family: "Source Sans Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
text-align: center;
padding-top: 10px;
border-top: solid 1px gray;
}
/* line 108, ../../sass/document/download.scss */
/* line 112, ../../sass/document/download.scss */
#footer .infos-bottom {
padding-bottom: 20px;
margin-bottom: 40px;
font-size: 12px;
line-height: 18px;
}
/* line 114, ../../sass/document/download.scss */
/* line 118, ../../sass/document/download.scss */
#footer .reference-document {
font-weight: bold;
}

+ 6
- 2
backend/web/sass/document/download.scss View File

@@ -69,11 +69,11 @@ body {
border-collapse: collapse ;

td, th {
padding: 5px ;
padding: 2px 5px;
border-top: solid 1px $border-color ;
border-left: solid 1px $border-color ;
font-family: $font-family ;
font-size: 13px;
font-size: 12px;

&.align-left {
text-align: left ;
@@ -85,6 +85,10 @@ body {
text-align: right ;
}
}

td {
font-size: 11px;
}
}
}


+ 2
- 3
common/models/Order.php View File

@@ -452,8 +452,6 @@ class Order extends ActiveRecordCommon
$amount = $this->getAmountWithTax(self::AMOUNT_PAID)
- $this->getAmountWithTax(self::AMOUNT_TOTAL);
break;
/*default:
throw new NotFoundHttpException('Type de montant inconnu : '.$type) ;*/
}

if ($format) {
@@ -981,7 +979,8 @@ class Order extends ActiveRecordCommon
$productOrder->invoice_price = $productOrder->product->getPrice([
'user' => isset($params['user']) ? $params['user'] : null,
'user_producer' => isset($params['user_producer']) ? $params['user_producer'] : null,
'point_sale' => isset($params['point_sale']) ? $params['point_sale'] : null
'point_sale' => isset($params['point_sale']) ? $params['point_sale'] : null,
'quantity' => $productOrder->quantity
]);
$productOrder->save();
}

+ 0
- 10
common/views/_analytics.php View File

@@ -1,10 +0,0 @@
<!-- analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-86917043-1', 'auto');
ga('send', 'pageview');
</script>

+ 0
- 3
frontend/views/layouts/main.php View File

@@ -233,9 +233,6 @@ if(!Yii::$app->user->isGuest && Yii::$app->user->identity->id_producer > 0) {
</footer>
<?php $this->endBody() ?>
<?= $this->render('@common/views/_analytics.php'); ?>
</body>
</html>
<?php $this->endPage() ?>

+ 0
- 1
producer/views/layouts/main.php View File

@@ -334,7 +334,6 @@ if (!Yii::$app->user->isGuest) {
</footer>
<script type="text/javascript" src="https://cdn.polyfill.io/v3/polyfill.min.js?features=Intl.~locale.fr"></script>
<?php $this->endBody() ?>
<?= $this->render('@common/views/_analytics.php'); ?>
</body>
</html>
<?php $this->endPage() ?>

Loading…
Cancel
Save