public function afterFind() { | public function afterFind() { | ||||
if ($this->taxRate == null) { | if ($this->taxRate == null) { | ||||
$this->populateRelation('taxRate', GlobalParam::getCurrentProducer()->taxRate); | |||||
$producer = Producer::searchOne(['id' => GlobalParam::getCurrentProducerId()]) ; | |||||
$this->populateRelation('taxRate', $producer->taxRate); | |||||
//$this->populateRelation('taxRate', GlobalParam::getCurrentProducer()->taxRate); | |||||
} | } | ||||
$this->wording_unit = Product::strUnit($this->unit) ; | $this->wording_unit = Product::strUnit($this->unit) ; |
if($pointSaleDistributions && count($pointSaleDistributions) > 0) { | if($pointSaleDistributions && count($pointSaleDistributions) > 0) { | ||||
echo '<div class="point-sales">' ; | echo '<div class="point-sales">' ; | ||||
foreach($pointSaleDistributions as $pointSaleDistribution) { | foreach($pointSaleDistributions as $pointSaleDistribution) { | ||||
echo $pointSaleDistribution->pointSale->name.'<br />' ; | |||||
echo $pointSaleDistribution->pointSale->name.'' ; | |||||
if(strlen($pointSaleDistribution->pointSale->locality)) { | |||||
echo ' ('.$pointSaleDistribution->pointSale->locality.')' ; | |||||
} | |||||
echo '<br />' ; | |||||
} | } | ||||
echo '</div>' ; | echo '</div>' ; | ||||
} | } |
'format' => 'raw', | 'format' => 'raw', | ||||
'value' => function($model) { | 'value' => function($model) { | ||||
$producer = GlobalParam::getCurrentProducer() ; | |||||
$producer = \Yii::$app->controller->getProducer() ; | |||||
if($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_WEEK) { | if($producer->behavior_home_point_sale_day_list == Producer::BEHAVIOR_HOME_POINT_SALE_DAY_LIST_WEEK) { | ||||
return $model->getStrDeliveryDays() ; | return $model->getStrDeliveryDays() ; |