69 $this->storeDocumentElement
72 $writeOffResult = $distributor->writeOff($this->amount);
74 if (!$writeOffResult->isSuccess())
76 return $writeOffResult;
81 '=DOCUMENT_ELEMENT_ID' => $this->storeDocumentElement->getId(),
86 while ($writeOffBinding = $writeOffBindings->fetchObject())
89 $moveAmount = abs($writeOffBinding->getAmount());
90 if (CostPriceCalculator::getMethod() === CostPriceCalculator::METHOD_AVERAGE)
92 $batch = $this->
loadBatch($this->storeToId);
99 $writeOffBinding->getBatchPrice(),
100 $writeOffBinding->getBatchCurrency(),
102 $resultUpdate = $batch->save();
103 if (!$resultUpdate->isSuccess())
116 $batch = $this->createBatch(
119 $writeOffBinding->getBatchPrice(),
120 $writeOffBinding->getBatchCurrency(),
136 $writeOffBinding->getBatchPrice(),
137 $writeOffBinding->getBatchCurrency(),