Move journal transaction code to repository #130

This commit is contained in:
Nabeel Shahzad
2018-02-28 19:04:56 -06:00
parent d1fcecf873
commit 1794549a20
5 changed files with 151 additions and 4 deletions

View File

@@ -43,12 +43,18 @@ class Money
}
/**
* Create a new currency object using the currency setting
* Fall back to USD if it's not valid
* @return Currency
* @throws \OutOfBoundsException
*/
public static function currency()
{
return new Currency(config('phpvms.currency'));
try {
return new Currency(config('phpvms.currency', 'USD'));
} catch (\OutOfBoundsException $e) {
return new Currency('USD');
}
}
/**