public function getTotalPriceAsCurrency()
 {
     $base = $this->getBasePriceAsCurrency();
     $price = PhortuneCurrency::newEmptyCurrency();
     for ($ii = 0; $ii < $this->getQuantity(); $ii++) {
         $price = $price->add($base);
     }
     return $price;
 }
 public function getPriceAsCurrency(PhortuneProduct $product)
 {
     return PhortuneCurrency::newEmptyCurrency();
 }
 public static function initializeNewInitiative(PhabricatorUser $actor)
 {
     $app = id(new PhabricatorApplicationQuery())->setViewer($actor)->withClasses(array('PhabricatorFundApplication'))->executeOne();
     $view_policy = $app->getPolicy(FundDefaultViewCapability::CAPABILITY);
     return id(new FundInitiative())->setOwnerPHID($actor->getPHID())->setViewPolicy($view_policy)->setEditPolicy($actor->getPHID())->setStatus(self::STATUS_OPEN)->setTotalAsCurrency(PhortuneCurrency::newEmptyCurrency());
 }
Beispiel #4
0
 public function getAmountRefundableAsCurrency()
 {
     $amount = $this->getAmountAsCurrency();
     $refunded = $this->getAmountRefundedAsCurrency();
     // We can't refund negative amounts of money, since it does not make
     // sense and is not possible in the various payment APIs.
     $refundable = $amount->subtract($refunded);
     if ($refundable->isPositive()) {
         return $refundable;
     } else {
         return PhortuneCurrency::newEmptyCurrency();
     }
 }
 public function getPriceAsCurrency(PhortuneProduct $product)
 {
     // Prices are calculated by the SubscriptionImplementation.
     return PhortuneCurrency::newEmptyCurrency();
 }