Skip to content

Commit 8aad86b

Browse files
dev
1 parent 6ba5697 commit 8aad86b

18 files changed

+61
-55
lines changed

src/controllers/AdminBasketController.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,12 @@ public function actions()
105105
'format' => 'raw',
106106
'value' => function (\skeeks\cms\shop\models\ShopBasket $shopBasket) {
107107
if ($shopBasket->discount_value) {
108-
return "<span style='text-decoration: line-through;'>" . \Yii::$app->money->intlFormatter()->format($shopBasket->moneyOriginal) . "</span><br />" . Html::tag('small',
109-
$shopBasket->notes) . "<br />" . \Yii::$app->money->intlFormatter()->format($shopBasket->money) . "<br />" . Html::tag('small',
108+
return "<span style='text-decoration: line-through;'>" . (string) $shopBasket->moneyOriginal . "</span><br />" . Html::tag('small',
109+
$shopBasket->notes) . "<br />" . (string) $shopBasket->money . "<br />" . Html::tag('small',
110110
\Yii::t('skeeks/shop/app',
111111
'Discount') . ": " . $shopBasket->discount_value);
112112
} else {
113-
return \Yii::$app->money->intlFormatter()->format($shopBasket->money) . "<br />" . Html::tag('small',
113+
return (string) $shopBasket->money . "<br />" . Html::tag('small',
114114
$shopBasket->notes);
115115
}
116116

@@ -122,7 +122,8 @@ public function actions()
122122
'attribute' => 'price',
123123
'format' => 'raw',
124124
'value' => function (\skeeks\cms\shop\models\ShopBasket $shopBasket) {
125-
return \Yii::$app->money->intlFormatter()->format($shopBasket->money->multiply($shopBasket->quantity));
125+
$shopBasket->money->multiply($shopBasket->quantity);
126+
return (string) $shopBasket->money;
126127
}
127128
],
128129
],

src/controllers/AdminCmsContentElementController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ static public function getDefaultColumns($cmsContent = null)
216216
if ($shopProductPrice = $shopProduct->getShopProductPrices()
217217
->andWhere(['type_price_id' => $shopTypePrice->id])->one()
218218
) {
219-
return \Yii::$app->money->intlFormatter()->format($shopProductPrice->money);
219+
return (string) $shopProductPrice->money;
220220
}
221221
}
222222

src/controllers/AdminUserAccountController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function actions()
6464
'attribute' => 'current_budget',
6565
'class' => DataColumn::className(),
6666
'value' => function (ShopUserAccount $userAccount) {
67-
return \Yii::$app->money->intlFormatter()->format($userAccount->money);
67+
return (string) $userAccount->money;
6868
},
6969
],
7070

src/grid/BasketPriceGridColumn.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ protected function renderDataCellContent($model, $key, $index)
3232
{
3333
$shopBasket = $model;
3434
if ($shopBasket->discount_value) {
35-
return "<span style='text-decoration: line-through;'>" . \Yii::$app->money->intlFormatter()->format($shopBasket->moneyOriginal) . "</span><br />" . Html::tag('small',
36-
$shopBasket->notes) . "<br />" . \Yii::$app->money->intlFormatter()->format($shopBasket->money) . "<br />" . Html::tag('small',
35+
return "<span style='text-decoration: line-through;'>" . (string) $shopBasket->moneyOriginal . "</span><br />" . Html::tag('small',
36+
$shopBasket->notes) . "<br />" . (string) $shopBasket->money . "<br />" . Html::tag('small',
3737
$shopBasket->discount_name . ": " . $shopBasket->discount_value);
3838
} else {
39-
return \Yii::$app->money->intlFormatter()->format($shopBasket->money) . "<br />" . Html::tag('small',
39+
return (string) $shopBasket->money . "<br />" . Html::tag('small',
4040
$shopBasket->notes);
4141
}
4242
}

src/grid/BasketSumGridColumn.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ protected function renderDataCellContent($model, $key, $index)
3434
$this->label = \Yii::t('skeeks/shop/app', 'Sum');
3535
}
3636

37-
return \Yii::$app->money->intlFormatter()->format($model->money->multiply($model->quantity));
37+
$model->money->multiply($model->quantity);
38+
39+
return (string) $model->money;
3840
}
3941
}

src/mail/client-quantity-notice.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
'attribute' => 'price',
7777
'format' => 'raw',
7878
'value' => function (\skeeks\cms\shop\models\ShopProduct $shopProduct) {
79-
return \Yii::$app->money->intlFormatter()->format($shopProduct->baseProductPrice->money) . "<br />";
79+
return (string) $shopProduct->baseProductPrice->money . "<br />";
8080
}
8181
],
8282
]

src/mail/create-order.php

+8-7
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@
7979
'format' => 'raw',
8080
'value' => function (\skeeks\cms\shop\models\ShopBasket $shopBasket) {
8181
if ($shopBasket->discount_value) {
82-
return "<span style='text-decoration: line-through;'>" . \Yii::$app->money->intlFormatter()->format($shopBasket->moneyOriginal) . "</span><br />" . Html::tag('small',
83-
$shopBasket->notes) . "<br />" . \Yii::$app->money->intlFormatter()->format($shopBasket->money) . "<br />" . Html::tag('small',
82+
return "<span style='text-decoration: line-through;'>" . (string) $shopBasket->moneyOriginal . "</span><br />" . Html::tag('small',
83+
$shopBasket->notes) . "<br />" . (string) $shopBasket->money . "<br />" . Html::tag('small',
8484
\Yii::t('skeeks/shop/app', 'Discount') . ": " . $shopBasket->discount_value);
8585
} else {
86-
return \Yii::$app->money->intlFormatter()->format($shopBasket->money) . "<br />" . Html::tag('small',
86+
return (string) $shopBasket->money . "<br />" . Html::tag('small',
8787
$shopBasket->notes);
8888
}
8989

@@ -95,7 +95,8 @@
9595
'attribute' => 'price',
9696
'format' => 'raw',
9797
'value' => function (\skeeks\cms\shop\models\ShopBasket $shopBasket) {
98-
return \Yii::$app->money->intlFormatter()->format($shopBasket->money->multiply($shopBasket->quantity));
98+
$shopBasket->money->multiply($shopBasket->quantity);
99+
return (string) $shopBasket->money;
99100
}
100101
],
101102
]
@@ -176,9 +177,9 @@
176177
<?= Html::endTag('h2'); ?>
177178

178179
<?= Html::beginTag('p'); ?>
179-
Стоимость товаров: <?= Html::tag('b', \Yii::$app->money->intlFormatter()->format($order->basketsMoney)); ?><br/>
180-
Стоимость доставки: <?= Html::tag('b', \Yii::$app->money->intlFormatter()->format($order->moneyDelivery)); ?><br/>
181-
К оплате: <?= Html::tag('b', \Yii::$app->money->intlFormatter()->format($order->money)); ?>
180+
Стоимость товаров: <?= Html::tag('b', (string) $order->basketsMoney); ?><br/>
181+
Стоимость доставки: <?= Html::tag('b', (string) $order->moneyDelivery); ?><br/>
182+
К оплате: <?= Html::tag('b', (string) $order->money); ?>
182183
<?= Html::endTag('p'); ?>
183184

184185
<?= Html::beginTag('p'); ?>

src/mail/notice-added.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
'attribute' => 'price',
8282
'format' => 'raw',
8383
'value' => function (\skeeks\cms\shop\models\ShopProduct $shopProduct) {
84-
return \Yii::$app->money->intlFormatter()->format($shopProduct->baseProductPrice->money) . "<br />";
84+
return (string) $shopProduct->baseProductPrice->money . "<br />";
8585
}
8686
],
8787
]

src/mail/order-payed.php

+8-7
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@
7676
'format' => 'raw',
7777
'value' => function (\skeeks\cms\shop\models\ShopBasket $shopBasket) {
7878
if ($shopBasket->discount_value) {
79-
return "<span style='text-decoration: line-through;'>" . \Yii::$app->money->intlFormatter()->format($shopBasket->moneyOriginal) . "</span><br />" . Html::tag('small',
80-
$shopBasket->notes) . "<br />" . \Yii::$app->money->intlFormatter()->format($shopBasket->money) . "<br />" . Html::tag('small',
79+
return "<span style='text-decoration: line-through;'>" . (string) $shopBasket->moneyOriginal . "</span><br />" . Html::tag('small',
80+
$shopBasket->notes) . "<br />" . (string) $shopBasket->money . "<br />" . Html::tag('small',
8181
\Yii::t('skeeks/shop/app', 'Discount') . ": " . $shopBasket->discount_value);
8282
} else {
83-
return \Yii::$app->money->intlFormatter()->format($shopBasket->money) . "<br />" . Html::tag('small',
83+
return (string) $shopBasket->money . "<br />" . Html::tag('small',
8484
$shopBasket->notes);
8585
}
8686

@@ -92,7 +92,8 @@
9292
'attribute' => 'price',
9393
'format' => 'raw',
9494
'value' => function (\skeeks\cms\shop\models\ShopBasket $shopBasket) {
95-
return \Yii::$app->money->intlFormatter()->format($shopBasket->money->multiply($shopBasket->quantity));
95+
$shopBasket->money->multiply($shopBasket->quantity);
96+
return (string) $shopBasket->money;
9697
}
9798
],
9899
]
@@ -105,9 +106,9 @@
105106
<?= Html::endTag('h2'); ?>
106107

107108
<?= Html::beginTag('p'); ?>
108-
Стоимость товаров: <?= Html::tag('b', \Yii::$app->money->intlFormatter()->format($order->basketsMoney)); ?><br/>
109-
Стоимость доставки: <?= Html::tag('b', \Yii::$app->money->intlFormatter()->format($order->moneyDelivery)); ?><br/>
110-
Оплачено: <?= Html::tag('b', \Yii::$app->money->intlFormatter()->format($order->money)); ?>
109+
Стоимость товаров: <?= Html::tag('b', (string) $order->basketsMoney); ?><br/>
110+
Стоимость доставки: <?= Html::tag('b', (string) $order->moneyDelivery); ?><br/>
111+
Оплачено: <?= Html::tag('b', (string) $order->money); ?>
111112
<?= Html::endTag('p'); ?>
112113

113114
<?= Html::beginTag('h2'); ?>

src/views/admin-buyer-user/_form.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@
9797

9898
$average = "-";
9999
if (\yii\helpers\ArrayHelper::getValue($userStatistics, 'totalPayed')) {
100-
$average = \Yii::$app->money->intlFormatter()->format($money->multiply(
100+
$money->multiply(
101101
(1 / \yii\helpers\ArrayHelper::getValue($userStatistics, 'totalPayed'))
102-
));
102+
);
103+
104+
$average = (string) $money;
103105
}
104106

105107
?>
@@ -118,7 +120,7 @@
118120
[ // the owner name of the model
119121
'label' => \Yii::t('skeeks/shop/app', 'Paid orders worth'),
120122
'format' => 'raw',
121-
'value' => \Yii::$app->money->intlFormatter()->format($money),
123+
'value' => (string) $money,
122124
],
123125

124126
[ // the owner name of the model
@@ -294,7 +296,7 @@
294296
if ($model->shopBaskets) {
295297
$result = [];
296298
foreach ($model->shopBaskets as $shopBasket) {
297-
$money = \Yii::$app->money->intlFormatter()->format($shopBasket->money);
299+
$money = (string) $shopBasket->money;
298300
$result[] = Html::a($shopBasket->name, $shopBasket->url, [
299301
'target' => '_blank',
300302
'data-pjax' => '0'
@@ -314,7 +316,7 @@
314316
'attribute' => 'price',
315317
'label' => \Yii::t('skeeks/shop/app', 'Sum'),
316318
'value' => function (\skeeks\cms\shop\models\ShopOrder $model) {
317-
return \Yii::$app->money->intlFormatter()->format($model->money);
319+
return (string) $model->money;
318320
},
319321
],
320322

src/views/admin-delivery/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
'format' => 'raw',
5050
'filter' => false,
5151
'value' => function (\skeeks\cms\shop\models\ShopDelivery $model) {
52-
return \Yii::$app->money->intlFormatter()->format($model->money);
52+
return (string) $model->money;
5353
}
5454
],
5555
[

src/views/admin-discount/index.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@
4444
if ($shopDiscount->value_type == \skeeks\cms\shop\models\ShopDiscount::VALUE_TYPE_P) {
4545
return \Yii::$app->formatter->asPercent($shopDiscount->value / 100);
4646
} else {
47-
$money = \skeeks\cms\money\new Money((string)$shopDiscount->value,
47+
$money = new \skeeks\cms\money\Money((string)$shopDiscount->value,
4848
$shopDiscount->currency_code);
49-
return \Yii::$app->money->intlFormatter()->format($money);
49+
return (string) $money;
5050
}
5151
},
5252
],

src/views/admin-fuser/index.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
'filter' => false,
9898
'label' => \Yii::t('skeeks/shop/app', 'Price of basket'),
9999
'value' => function (\skeeks\cms\shop\models\ShopFuser $model) {
100-
return \Yii::$app->money->intlFormatter()->format($model->money);
100+
return (string) $model->money;
101101
},
102102
],
103103

@@ -119,7 +119,7 @@
119119
if ($model->shopBaskets) {
120120
$result = [];
121121
foreach ($model->shopBaskets as $shopBasket) {
122-
$money = \Yii::$app->money->intlFormatter()->format($shopBasket->money);
122+
$money = (string) $shopBasket->money;
123123
$result[] = \yii\helpers\Html::a($shopBasket->name,
124124
$shopBasket->product ? $shopBasket->product->cmsContentElement->url : '#',
125125
['target' => '_blank']) . <<<HTML

src/views/admin-order/_form.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -385,22 +385,22 @@
385385
'attributes' => [
386386
[
387387
'label' => \Yii::t('skeeks/shop/app', 'The total value of the goods'),
388-
'value' => \Yii::$app->money->intlFormatter()->format($model->basketsMoney),
388+
'value' => (string) $model->basketsMoney,
389389
],
390390

391391
[
392392
'label' => \Yii::t('skeeks/shop/app', 'Discount, margin'),
393-
'value' => \Yii::$app->money->intlFormatter()->format($model->moneyDiscount),
393+
'value' => (string) $model->moneyDiscount,
394394
],
395395

396396
[
397397
'label' => \Yii::t('skeeks/shop/app', 'Delivery service'),
398-
'value' => \Yii::$app->money->intlFormatter()->format($model->moneyDelivery),
398+
'value' => (string) $model->moneyDelivery,
399399
],
400400

401401
[
402402
'label' => \Yii::t('skeeks/shop/app', 'Taxe'),
403-
'value' => \Yii::$app->money->intlFormatter()->format($model->moneyVat),
403+
'value' => (string) $model->moneyVat,
404404
],
405405

406406
[
@@ -410,13 +410,13 @@
410410

411411
[
412412
'label' => \Yii::t('skeeks/shop/app', 'Already paid'),
413-
'value' => \Yii::$app->money->intlFormatter()->format($model->moneySummPaid),
413+
'value' => (string) $model->moneySummPaid,
414414
],
415415

416416
[
417417
'label' => \Yii::t('skeeks/shop/app', 'In total'),
418418
'format' => 'raw',
419-
'value' => Html::tag('b', \Yii::$app->money->intlFormatter()->format($model->money)),
419+
'value' => Html::tag('b', (string) $model->money),
420420
]
421421
]
422422
])
@@ -511,7 +511,7 @@
511511
'label' => \Yii::t('skeeks/shop/app', 'Sum'),
512512
'format' => 'raw',
513513
'value' => function (\skeeks\cms\shop\models\ShopUserTransact $shopUserTransact) {
514-
return ($shopUserTransact->debit == "Y" ? "+" : "-") . \Yii::$app->money->intlFormatter()->format($shopUserTransact->money);
514+
return ($shopUserTransact->debit == "Y" ? "+" : "-") . (string) $shopUserTransact->money;
515515
}
516516
],
517517

src/views/admin-order/create-order.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -280,22 +280,22 @@ class="sx-change-user"><?= $shopFuser->user->displayName; ?></a>
280280
'attributes' => [
281281
[
282282
'label' => \skeeks\cms\shop\Module::t('app', 'The total value of the goods'),
283-
'value' => \Yii::$app->money->intlFormatter()->format($model->money),
283+
'value' => (string) $model->money,
284284
],
285285

286286
[
287287
'label' => \skeeks\cms\shop\Module::t('app', 'Discount, margin'),
288-
'value' => \Yii::$app->money->intlFormatter()->format($model->moneyDiscount),
288+
'value' => (string) $model->moneyDiscount,
289289
],
290290

291291
[
292292
'label' => \skeeks\cms\shop\Module::t('app', 'Delivery service'),
293-
'value' => \Yii::$app->money->intlFormatter()->format($model->moneyDelivery),
293+
'value' => (string) $model->moneyDelivery,
294294
],
295295

296296
[
297297
'label' => \skeeks\cms\shop\Module::t('app', 'Taxe'),
298-
'value' => \Yii::$app->money->intlFormatter()->format($model->moneyVat),
298+
'value' => (string) $model->moneyVat,
299299
],
300300

301301
[
@@ -306,7 +306,7 @@ class="sx-change-user"><?= $shopFuser->user->displayName; ?></a>
306306
[
307307
'label' => \skeeks\cms\shop\Module::t('app', 'In total'),
308308
'format' => 'raw',
309-
'value' => Html::tag('b', \Yii::$app->money->intlFormatter()->format($model->money)),
309+
'value' => Html::tag('b', (string) $model->money),
310310
]
311311
]
312312
])

0 commit comments

Comments
 (0)