Beispiel #1
0
 protected function _prepareIncrease(RM_Points_Action $obAction = NULL)
 {
     $params = $obAction->getParams();
     $obPurchase = M('Purchase')->loadPurchaseById($params['purchase_id']);
     if (isNull($obUser = $obPurchase->getUser())) {
         return DELETE_ACTION;
     }
     $this->_obAccount = $this->getAccount($obUser->id());
     $this->_bdate = M('Date')->dbDate(M('Date')->add($obPurchase->getVirtualReceipt()->cdate_virt, '-2h'));
     $this->_obPurchase = $obPurchase;
 }
Beispiel #2
0
 public function process(RM_Points_Action $obAction = NULL)
 {
     $params = $obAction->getParams();
     $obAccount = $this->getAccount($params['user_id']);
     $obPayment = iterFirst($obAccount->getPaymentList()->filter('event=? and amount_date=? and vocation_end=?', 'leave-add', $params['prevFrom'], $params['prevTo']));
     if (isNull($obPayment)) {
         return TRUE;
     }
     $obPayment->amount_date = $params['from'];
     $obPayment->vocation_end = $params['to'];
     return $obPayment->save();
 }
Beispiel #3
0
 public function process(RM_Points_Action $obAction = NULL)
 {
     $params = $obAction->getParams();
     $obAccount = $this->getAccount($params['user_id']);
     if ($this->_isNotUnique($obAccount, $params)) {
         return TRUE;
     }
     $this->_descriptionParams['number'] = $params['number'];
     $this->_descriptionParams['date'] = M('Date')->format('date-format', M('Date')->time($params['date']));
     $this->increaseAccount($obAccount, 'full', array('some_key' => $params['number'], 'amount_date' => $params['date']));
     return TRUE;
 }
Beispiel #4
0
 public function process(RM_Points_Action $obAction = NULL)
 {
     $params = $obAction->getParams();
     $obAccount = $this->getAccount($params['user_id']);
     if (count($obAccount->getPaymentList()->filter('event=? and amount_date<=? and vocation_end>=?', 'leave-add', $params['to'], $params['from'])) > 0) {
         return TRUE;
     }
     $subType = 'full';
     if ($params['byAdmin']) {
         $subType = 'by-admin';
     }
     if (M('Date')->time($params['from']) < M('Date')->time() - 86400) {
         $subType = 'backdate';
     }
     $this->increaseAccount($obAccount, $subType, array('vocation_end' => $params['to'], 'amount_date' => $params['from']));
     return TRUE;
 }
Beispiel #5
0
 public function process(RM_Points_Action $obAction = NULL)
 {
     $params = $obAction->getParams();
     $obAccount = $this->getAccount($params['user_id']);
     if ($this->_isNotUnique($obAccount, $params)) {
         return TRUE;
     }
     if (M('Date')->time($params['end_time']) < M('Date')->time(C('point.anketa-dead-line'))) {
         $bonus = '-bonus';
     } else {
         $bonus = '';
     }
     if (isset($params['person_id']) && $params['person_id'] > 0) {
         $personId = $params['person_id'];
         $this->_descriptionParams['person_name'] = $params['person_name'];
     }
     $this->_prepareIncrease($params);
     $this->increaseAccount($obAccount, $this->_subType . $bonus, $this->_additionalData);
     return TRUE;
 }