@@ -2,7 +2,7 @@ | |||
$displayPrices = Yii::$app->controller->getClass() != 'DeliveryNote' || (Yii::$app->controller->getClass() == 'DeliveryNote' && Producer::getConfig('document_display_prices_delivery_note')); | |||
$displayProductDescription = Producer::getConfig('document_display_product_description'); | |||
$documentPriceDecimals = (int) Producer::getConfig('document_price_decimals'); | |||
$documentPriceDecimals = (int) Producer::getConfig('option_document_price_decimals'); | |||
?> | |||
@@ -463,7 +463,7 @@ $this->addBreadcrumb($this->getTitle()); | |||
0 => 'Non', | |||
1 => 'Oui' | |||
]); ?> | |||
<?= $form->field($model, 'document_price_decimals')->dropDownList([ | |||
<?= $form->field($model, 'option_document_price_decimals')->dropDownList([ | |||
2 => '2', | |||
3 => '3' | |||
]); ?> |
@@ -76,7 +76,7 @@ class Price | |||
public static function numberTwoDecimals($number, $decimals = 2) | |||
{ | |||
return number_format(( ($number * 100)) / 100, 2) ; | |||
return number_format(( ($number * 100)) / 100, $decimals) ; | |||
} | |||
} |
@@ -164,7 +164,7 @@ class Producer extends ActiveRecordCommon | |||
'document_quotation_duration', | |||
'option_dashboard_number_distributions', | |||
'option_online_payment_minimum_amount', | |||
'document_price_decimals' | |||
'option_document_price_decimals' | |||
], | |||
'integer' | |||
], | |||
@@ -403,7 +403,7 @@ class Producer extends ActiveRecordCommon | |||
'option_csv_separator' => 'Séparateur de colonnes (CSV)', | |||
'option_display_message_new_opendistrib_version' => 'Afficher les messages de mise à jour du logiciel Opendistrib', | |||
'option_online_payment_minimum_amount' => 'Paiement en ligne : montant minimum', | |||
'document_price_decimals' => 'Prix : nombre de décimales affichées' | |||
'option_document_price_decimals' => 'Prix : nombre de décimales affichées' | |||
]; | |||
} | |||
@@ -0,0 +1,26 @@ | |||
<?php | |||
use yii\db\Migration; | |||
use yii\db\Schema; | |||
/** | |||
* Class m221212_143815_producer_add_option_document_price_decimals | |||
*/ | |||
class m221212_143815_producer_add_option_document_price_decimals extends Migration | |||
{ | |||
/** | |||
* {@inheritdoc} | |||
*/ | |||
public function safeUp() | |||
{ | |||
$this->addColumn('producer', 'option_document_price_decimals', Schema::TYPE_INTEGER . ' DEFAULT 2'); | |||
} | |||
/** | |||
* {@inheritdoc} | |||
*/ | |||
public function safeDown() | |||
{ | |||
$this->dropColumn('producer', 'option_document_price_decimals'); | |||
} | |||
} |