Updates a price rule
423054
protected function updatePriceRule()
    {
        $this->controlAccess('price_rule_edit');

        if ($this->price_rule->update($this->data_rule['price_rule_id'], $this->getSubmitted())) {
            $this->redirect('admin/sale/price', $this->text('Price rule has been updated'), 'success');
        }

        $this->redirect('', $this->text('Price rule has not been updated'), 'warning');
    }
138466
protected function setBreadcrumbEditPriceRule()
    {
        $breadcrumbs = array();

        $breadcrumbs[] = array(
            'url' => $this->url('admin'),
            'text' => $this->text('Dashboard')
        );

        $breadcrumbs[] = array(
            'text' => $this->text('Price rules'),
            'url' => $this->url('admin/sale/price')
        );

        $this->setBreadcrumbs($breadcrumbs);
    }
265680
@Override
	public com.liferay.commerce.discount.model.CommerceDiscountRule updateCommerceDiscountRule(
		com.liferay.commerce.discount.model.CommerceDiscountRule commerceDiscountRule) {
		return _commerceDiscountRuleLocalService.updateCommerceDiscountRule(commerceDiscountRule);
	}
417160
def updateRules( self ):
        
        terms = sorted(self._rules.keys())
        for child in self.lineWidgets():
            child.setTerms(terms)
435421
public function listPriceRule()
    {
        $this->actionListPriceRule();
        $this->setTitleListPriceRule();
        $this->setBreadcrumbListPriceRule();
        $this->setFilterListPriceRule();
        $this->setPagerListPriceRule();

        $this->setData('stores', $this->store->getList());
        $this->setData('price_rules', $this->getListPriceRule());

        $this->outputListPriceRule();
    }
638335
public function cmdGetPriceRule()
    {
        $result = $this->getListPriceRule();
        $this->outputFormat($result);
        $this->outputFormatTablePriceRule($result);
        $this->output();
    }
110207
public function cmdUpdatePriceRule()
    {
        $params = $this->getParam();

        if (empty($params[0]) || count($params) < 2) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        if (!is_numeric($params[0])) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $this->setSubmitted(null, $params);
        $this->setSubmitted('update', $params[0]);
        $this->validateComponent('price_rule');

        $this->updatePriceRule($params[0]);
        $this->output();
    }
331750
function updateFormRules(cb) {

    //Filters out any conditional statements that are no longer valid.
    function filterConditionalStatements(rule) {
      return _.filter(rule.ruleConditionalStatements, function(ruleCondStatement) {
        var sourceField = ruleCondStatement.sourceField.toString();

        if (invalidFields[sourceField]) {
          /**
           * If the user flagged the field in this rule for deletion, flag the rule for deletion.
           */
          if (ruleDeletionFlags[sourceField]) {
            rulesFlaggedForDeletion[rule._id.toString()] = true;
          }
          return false;
        } else {
          return true;
        }
      });
    }

    var updatedFieldRules = _.map(form.fieldRules, function(fieldRule) {
      var filteredConditionalStatements = filterConditionalStatements(fieldRule);
      var filteredTargets = _.filter(fieldRule.targetField, function(targetField) {
        if (invalidFields[targetField]) {
          return false;
        } else {
          return true;
        }
      });

      fieldRule.ruleConditionalStatements = filteredConditionalStatements;
      fieldRule.targetField = filteredTargets;
      return fieldRule;
    });

    var updatedPageRules = _.map(form.pageRules, function(pageRule) {
      pageRule.ruleConditionalStatements = filterConditionalStatements(pageRule);
      return pageRule;
    });

    fieldRulesToDelete = _.filter(updatedFieldRules, function(fieldRule) {
      var targetFields = fieldRule.targetField;
      var conditionalStatements = fieldRule.ruleConditionalStatements;
      var fieldRuleId = fieldRule._id.toString();

      return targetFields.length === 0 || conditionalStatements.length === 0 || rulesFlaggedForDeletion[fieldRuleId];
    });

    pageRulesToDelete = _.filter(updatedPageRules, function(pageRule) {
      var conditionalStatements = pageRule.ruleConditionalStatements;
      var pageRuleId = pageRule._id.toString();

      return conditionalStatements.length === 0 || rulesFlaggedForDeletion[pageRuleId];
    });

    fieldRulesToDelete = _.map(fieldRulesToDelete, function(fieldRule) {
      return fieldRule._id.toString();
    });

    pageRulesToDelete = _.map(pageRulesToDelete, function(pageRule) {
      return pageRule._id.toString();
    });

    //Now have all the rules that need to be deleted, these rules need to be removed from the field and page rules
    updatedFieldRules = _.filter(updatedFieldRules, function(updatedFieldRule) {
      return fieldRulesToDelete.indexOf(updatedFieldRule._id.toString()) === -1;
    });


    updatedPageRules = _.filter(updatedPageRules, function(updatedPageRule) {
      return pageRulesToDelete.indexOf(updatedPageRule._id.toString()) === -1;
    });

    form.fieldRules = updatedFieldRules;
    form.pageRules = updatedPageRules;

    form.save(function(err) {
      return cb(err);
    });
  }
459927
def update(self):
        
        con = self.subpars.pars.control
        self(con.eqd1*con.tind)
813838
public function updateRuleData(Rule $rule): void
    {
        $query = $this->connection->createQueryBuilder();
        $query
            ->update('ngbm_rule_data')
            ->set('enabled', ':enabled')
            ->set('priority', ':priority')
            ->where(
                $query->expr()->eq('rule_id', ':rule_id')
            )
            ->setParameter('rule_id', $rule->id, Type::INTEGER)
            ->setParameter('enabled', $rule->enabled, Type::BOOLEAN)
            ->setParameter('priority', $rule->priority, Type::INTEGER);

        $query->execute();
    }
3393
def update(self, value):
        ""
        if value <= 0.1:
            value = 0
        assert 0 <= value <= self.maxval
        self.currval = value
        if not self._need_update() or self.finished:
            return
        if not self.start_time:
            self.start_time = time.time()
        self.seconds_elapsed = time.time() - self.start_time
        self.prev_percentage = self.percentage()
        if value != self.maxval:
            self.fd.write(self._format_line() + '\r')
        else:
            self.finished = True
            self.fd.write(self._format_line() + '\n')
657546
def updateMktDepth(self, id, position, operation, side, price, size):
        """"""
        return _swigibpy.EWrapper_updateMktDepth(self, id, position, operation, side, price, size)
711949
def update(self, adgroup_id, catmatch_id, max_price, is_default_price, online_status, nick=None):
        ''''''
        request = TOPRequest('xxxxx.xxxxx.adgroup.catmatch.update')
        request['adgroup_id'] = adgroup_id
        request['catmatch_id'] = catmatch_id
        request['max_price'] = max_price
        request['is_default_price'] = is_default_price
        request['online_status'] = online_status
        if nick!=None: request['nick'] = nick
        self.create(self.execute(request), fields=['success','result','success','result_code','result_message'], models={'result':ADGroupCatmatch})
        return self.result
632076
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CommercePriceList updateCommercePriceList(
		CommercePriceList commercePriceList) {
		return commercePriceListPersistence.update(commercePriceList);
	}
221562
public function UpdatePriceToLowestVariant()
    {
        /** @var TdbShopArticle $product */
        $product = $this->oTable;
        $oLowestPriceVariant = $product->GetLowestPricedVariant();
        if ($oLowestPriceVariant) {
            $aData = array('price' => $oLowestPriceVariant->fieldPriceFormated, 'price_reference' => $oLowestPriceVariant->fieldPriceReferenceFormated);
            $this->SaveFields($aData, false);
        }
    }
152000
def update(self, date, data=None, inow=None):
        
        # resolve stale state
        self.root.stale = False

        # update helpers on date change
        # also set newpt flag
        newpt = False
        if self.now == 0:
            newpt = True
        elif date != self.now:
            self._net_flows = 0
            self._last_price = self._price
            self._last_value = self._value
            self._last_fee = 0.0
            newpt = True

        # update now
        self.now = date
        if inow is None:
            if self.now == 0:
                inow = 0
            else:
                inow = self.data.index.get_loc(date)

        # update children if any and calculate value
        val = self._capital  # default if no children

        if self.children is not None:
            for c in self._childrenv:
                # avoid useless update call
                if c._issec and not c._needupdate:
                    continue
                c.update(date, data, inow)
                val += c.value

        if self.root == self:
            if (val < 0) and not self.bankrupt:
                # Declare a bankruptcy
                self.bankrupt = True
                self.flatten()

        # update data if this value is different or
        # if now has changed - avoid all this if not since it
        # won't change
        if newpt or self._value != val:
            self._value = val
            self._values.values[inow] = val

            bottom = self._last_value + self._net_flows
            if bottom != 0:
                ret = self._value / (self._last_value + self._net_flows) - 1
            else:
                if self._value == 0:
                    ret = 0
                else:
                    raise ZeroDivisionError(
                        'Could not update %s. Last value '
                        'was %s and net flows were %s. Current'
                        'value is %s. Therefore, '
                        'we are dividing by zero to obtain the return '
                        'for the period.' % (self.name,
                                             self._last_value,
                                             self._net_flows,
                                             self._value))

            self._price = self._last_price * (1 + ret)
            self._prices.values[inow] = self._price

        # update children weights
        if self.children is not None:
            for c in self._childrenv:
                # avoid useless update call
                if c._issec and not c._needupdate:
                    continue

                if val != 0:
                    c._weight = c.value / val
                else:
                    c._weight = 0.0

        # if we have strategy children, we will need to update them in universe
        if self._has_strat_children:
            for c in self._strat_children:
                # TODO: optimize ".loc" here as well
                self._universe.loc[date, c] = self.children[c].price

        # Cash should track the unallocated capital at the end of the day, so
        # we should update it every time we call "update".
        # Same for fees
        self._cash.values[inow] = self._capital
        self._fees.values[inow] = self._last_fee

        # update paper trade if necessary
        if newpt and self._paper_trade:
            self._paper.update(date)
            self._paper.run()
            self._paper.update(date)
            # update price
            self._price = self._paper.price
            self._prices.values[inow] = self._price
54758
def updateorders(self):
        
        log.info("Replacing orders")

        # Canceling orders
        self.cancelall()

        # Target
        target = self.bot.get("target", {})
        price = self.getprice()

        # prices
        buy_price = price * (1 - target["offsets"]["buy"] / 100)
        sell_price = price * (1 + target["offsets"]["sell"] / 100)

        # Store price in storage for later use
        self["feed_price"] = float(price)

        # Buy Side
        if float(self.balance(self.market["base"])) < buy_price * target["amount"]["buy"]:
            InsufficientFundsError(Amount(target["amount"]["buy"] * float(buy_price), self.market["base"]))
            self["insufficient_buy"] = True
        else:
            self["insufficient_buy"] = False
            self.market.buy(
                buy_price,
                Amount(target["amount"]["buy"], self.market["quote"]),
                account=self.account
            )

        # Sell Side
        if float(self.balance(self.market["quote"])) < target["amount"]["sell"]:
            InsufficientFundsError(Amount(target["amount"]["sell"], self.market["quote"]))
            self["insufficient_sell"] = True
        else:
            self["insufficient_sell"] = False
            self.market.sell(
                sell_price,
                Amount(target["amount"]["sell"], self.market["quote"]),
                account=self.account
            )

        pprint(self.execute())