needs to be called AFTER taxId of product was updated
196099
public function getNetPriceAfterTaxUpdate($productId, $oldNetPrice, $oldTaxRate)
    {

        // if old tax was 0, $oldTaxRate === null (tax 0 has no record in table tax) and would reset the price to 0
        if (is_null($oldTaxRate)) {
            $oldTaxRate = 0;
        }

        $sql = 'SELECT ROUND(:oldNetPrice / ((100 + t.rate) / 100) * (1 + :oldTaxRate / 100), 6) as new_net_price ';
        $sql .= $this->getTaxJoins();
        $params = [
            'oldNetPrice' => $oldNetPrice,
            'oldTaxRate' => $oldTaxRate,
            'productId' => $productId
        ];
        $statement = $this->getConnection()->prepare($sql);
        $statement->execute($params);
        $rate = $statement->fetchAll('assoc');

        // if tax == 0 %, tax is empty
        if (empty($rate)) {
            $newNetPrice = $oldNetPrice * (1 + $oldTaxRate / 100);
        } else {
            $newNetPrice = $rate[0]['new_net_price'];
        }

        return $newNetPrice;
    }
1061414
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CommerceTaxMethod addCommerceTaxMethod(
		CommerceTaxMethod commerceTaxMethod) {
		commerceTaxMethod.setNew(true);

		return commerceTaxMethodPersistence.update(commerceTaxMethod);
	}
238280
function addUpdated(results) {
  results.forEach(function(result) {
    result = normalizeResult(result);
    if (!lastQuery.results.hits) {
      lastQuery = { results: { hits: { total : 0, hits: [] } } };
    } else {
      var i = 0, l = lastQuery.results.hits.hits.length;
      for (i; i < l; i++) {
        if (lastQuery.results.hits.hits[i]._source.uri === result._source.uri) {
          lastQuery.results.hits.hits.splice(i, 1);
          break;
        }
      }
    }
    lastQuery.results.hits.hits.unshift(result);
  });
  updateResults(lastQuery);
}
262094
function removeThis()
    {
        $vatID = $this->ID;
        $db = eZDB::instance();
        $db->begin();

        // remove dependent VAT rules
        $dependentRules = eZVatRule::fetchByVatType( $vatID );
        foreach ( $dependentRules as $rule )
        {
            eZVatRule::removeVatRule( $rule->attribute( 'id' ) );
        }

        // replace VAT type in dependent products.
        eZVatType::resetToDefaultInProducts( $vatID );

        // Remove the VAT type itself.
        eZPersistentObject::removeObject( eZVatType::definition(),
                                          array( "id" => $vatID ) );

        $db->commit();
    }
547891
private void updateDetail(TrackMetadataUpdate update, WaveformDetail detail) {
        detailHotCache.put(DeckReference.getDeckReference(update.player, 0), detail);  // Main deck
        if (update.metadata.getCueList() != null) {  // Update the cache with any hot cues in this track as well
            for (CueList.Entry entry : update.metadata.getCueList().entries) {
                if (entry.hotCueNumber != 0) {
                    detailHotCache.put(DeckReference.getDeckReference(update.player, entry.hotCueNumber), detail);
                }
            }
        }
        deliverWaveformDetailUpdate(update.player, detail);
    }
903750
def update(self, *args, **kwargs):
        """"""
        self._call_helper("Updating", self.real.update, *args, **kwargs)
806716
def updateproduct(self, category_id, product, position=None):
        
        return bool(self.call(
            'catalog_category.updateProduct', [category_id, product, position])
        )
224107
async function refund(ctx) {
  let order = ctx.state.order;
  let body = ctx.state.body || ctx.request.body;
  let orderId = body.order || ctx.request.body.order;
  let reason = body.reason || ctx.request.body.reason;
  let amount = body.amount || ctx.request.body.amount;
  if (!orderId && !order || ctx.method !== 'POST') _2.default.error(400);
  if (!ctx.user) _2.default.error(403);
  if (!reason) _2.default.error('Invalid refund reason');
  if (!order) {
    // $Flow
    let orderTmp = await _Order2.default.findById(orderId).where('user', ctx.user._id);
    order = orderTmp;
    if (!order) _2.default.error('Order not found');
    if (order.state !== 400 && order.state !== 500) _2.default.error('Order state error');
  }
  if (!amount) {
    amount = order.payed;
  }
  if (amount > order.payed) _2.default.error('Invalid refund amount');
  await _2.default.run('Refund', {
    ctx, order, reason, amount
  });
  ctx.body = order.data();
}
523808
function() {
							this.calculateItemCounts();
							this.getParent().updateItems(sap.ui.model.ChangeReason.Change);
							template.removeDelegate(oDelegate);
						}
233582
function onupgradeneeded() {
            self.db = request.result;
            self.transaction = request.transaction;

            // NB! in case of a version conflict, we don't try to migrate,
            // instead just throw away the old store and create a new one.
            // this happens if somebody changed the 
            try {
                self.db.deleteObjectStore(self.record);
            } catch (e) { /* ignore */ }

            // create object store.
            var objectStoreOptions = {
                autoIncrement: useAutoIncrement()
            }
            if( typeof( self.keyPath )) {
                objectStoreOptions.keyPath = self.keyPath;
            }
            self.db.createObjectStore(self.record, objectStoreOptions);
        }
1006117
def tax_for_order(self, order_deets):
        """"""
        request = self._post('taxes', order_deets)
        return self.responder(request)
350518
def update(self, item, dry_run=None):
        """"""
        logger.debug('Updating item. Item: {item} Table: {namespace}'.format(
            item=item,
            namespace=self.namespace
        ))

        if not dry_run:
            self.table.put_item(Item=item)

        return item
842696
def clean_total_refund_amount(self):
        '''
        
        '''
        initial = self.cleaned_data.get('initial_refund_amount', 0)
        total = self.cleaned_data['total_refund_amount']
        summed_refunds = sum([v for k,v in self.cleaned_data.items() if k.startswith('item_refundamount_')])

        if not self.cleaned_data.get('id'):
            raise ValidationError('ID not in cleaned data')

        if summed_refunds != total:
            raise ValidationError(_('Passed value does not match sum of allocated refunds.'))
        elif summed_refunds > self.cleaned_data['id'].amountPaid + self.cleaned_data['id'].refunds:
            raise ValidationError(_('Total refunds allocated exceed revenue received.'))
        elif total < initial:
            raise ValidationError(_('Cannot reduce the total amount of the refund.'))
        return total
831951
protected function updateTotalPrice(): void
    {
        if (is_int($this->price) && is_int($this->quantity)) {
            $this->totalPrice = BigInteger::of($this->price)->multipliedBy(abs($this->quantity))->toInt();

            $this->updateDiscount();
        }
    }
717938
def admin_update
      return if !user_is_allowed('orders', 'edit')
      
      resp = Caboose::StdClass.new({'attributes' => {}})
      order = Order.find(params[:id])    
      
      save = true    
      params.each do |name,value|
        case name
          when 'tax'
            order.tax = value          
          when 'shipping'
            order.shipping = value
          when 'handling'
            order.handling = value
          when 'discount'
            order.discount = value        
          when 'status'
            order.status = value
            resp.attributes['status'] = {'text' => value}
        end
      end
      order.calculate_total    
      resp.success = save && order.save
      render :json => resp
    end
912589
def update_refund(self, refund_id, refund_deets):
        """"""
        request = self._put('transactions/refunds/' + str(refund_id), refund_deets)
        return self.responder(request)
276543
def doSendRefundForms(self, item_id, buyer_id, reason, quantity_sold):
        """"""
        # TODO: deprecated
        return self.__ask__('doSendRefundForms',
                            sendRefundFormsDataArr={
                                'item': {
                                    'itemId': item_id, 'buyerId': buyer_id,
                                    'refundReason': reason, 'itemQuantitySold': quantity_sold
                                }
                            })['sendRefundFormsResultsArr']