Add ledger and journal tables #130

This commit is contained in:
Nabeel Shahzad
2018-02-28 18:01:32 -06:00
parent 7ffef849d2
commit f557e9f965
7 changed files with 683 additions and 1 deletions

View File

@@ -39,7 +39,7 @@ class Money
public static function convertToSubunit($amount)
{
$currency = config('phpvms.currency');
return $amount * config('money.'.$currency.'.subunit');
return (int) $amount * config('money.'.$currency.'.subunit');
}
/**
@@ -64,9 +64,20 @@ class Money
}
/**
* Return the amount of currency in smallest denomination
* @return string
*/
public function getAmount()
{
return $this->money->getAmount();
}
/**
* Returns the value in whole amounts, e.g: 100.00
* vs returning in all cents
* @return float
*/
public function getValue()
{
return $this->money->getValue();
}