Example #1
0
 /**
  * Add to credit amount for this account
  * Will update parent account if required
  *
  * @param Currency $amount
  * @return $this
  */
 public function credit(Currency $amount)
 {
     $this->acCr->set($this->acCr->get() + $amount());
     Match::on($this->optGetParentId())->Monad_Option_Some(function ($parentId) use($amount) {
         $this->chart->getAccount($parentId->value())->credit($amount);
     });
     return $this;
 }
Example #2
0
 public function testYouCanSetCurrencyValueUsingAnIntegerValue()
 {
     $this->assertEquals('£10.20', $this->sut->set(1020.15)->display());
 }