示例#1
0
 public function TypeName()
 {
     $account = Acctype::findOne(['id' => $this->type_id]);
     if ($account == null) {
         return \Yii::t('app', 'NA');
     }
     return $account->name;
 }
示例#2
0
 public function getName($id)
 {
     $model = Acctype::findOne(['id' => $id]);
     if ($model == NULL) {
         return 'ERROR';
     } else {
         return Yii::t('app', $model->desc);
     }
 }
示例#3
0
 public function calcPay()
 {
     $this->step = 1;
     $this->dates();
     $this->income_sum = Acctype::findOne(3)->getTotal($this->from_date, $this->to_date);
     $this->tax_rate = \app\helpers\Linet3Helper::getSetting('company.tax.rate');
     //$tax
     $this->tax_sum = $this->income_sum * ($this->tax_rate / 100);
     $this->custtax_acc = \app\helpers\Linet3Helper::getSetting('company.acc.custtax');
     $this->custtax_sum = Accounts::findOne($this->custtax_acc)->getTotal($this->from_date, $this->to_date);
     //*-1
     $this->custtax_total = Accounts::findOne($this->custtax_acc)->getTotal(0, $this->to_date);
     if ($this->custtax_total > $this->tax_sum) {
         $this->custtax_total = $this->tax_sum;
     }
     $this->tax_total = $this->tax_sum + $this->custtax_total;
     return $this->tax_total;
 }