| 
									
										
										
										
											2018-02-11 08:08:08 +01:00
										 |  |  | <?php | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * AccountTransformer.php | 
					
						
							| 
									
										
										
										
											2020-02-16 13:57:18 +01:00
										 |  |  |  * Copyright (c) 2019 james@firefly-iii.org | 
					
						
							| 
									
										
										
										
											2018-02-11 08:08:08 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2019-10-02 06:37:26 +02:00
										 |  |  |  * This file is part of Firefly III (https://github.com/firefly-iii). | 
					
						
							| 
									
										
										
										
											2018-02-11 08:08:08 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2019-10-02 06:37:26 +02:00
										 |  |  |  * This program is free software: you can redistribute it and/or modify | 
					
						
							|  |  |  |  * it under the terms of the GNU Affero General Public License as | 
					
						
							|  |  |  |  * published by the Free Software Foundation, either version 3 of the | 
					
						
							|  |  |  |  * License, or (at your option) any later version. | 
					
						
							| 
									
										
										
										
											2018-02-11 08:08:08 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2019-10-02 06:37:26 +02:00
										 |  |  |  * This program is distributed in the hope that it will be useful, | 
					
						
							| 
									
										
										
										
											2018-02-11 08:08:08 +01:00
										 |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					
						
							| 
									
										
										
										
											2019-10-02 06:37:26 +02:00
										 |  |  |  * GNU Affero General Public License for more details. | 
					
						
							| 
									
										
										
										
											2018-02-11 08:08:08 +01:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2019-10-02 06:37:26 +02:00
										 |  |  |  * You should have received a copy of the GNU Affero General Public License | 
					
						
							|  |  |  |  * along with this program.  If not, see <https://www.gnu.org/licenses/>. | 
					
						
							| 
									
										
										
										
											2018-02-11 08:08:08 +01:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | declare(strict_types=1); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace FireflyIII\Transformers; | 
					
						
							| 
									
										
										
										
											2018-02-13 18:24:06 +01:00
										 |  |  | use Carbon\Carbon; | 
					
						
							| 
									
										
										
										
											2018-02-11 08:08:08 +01:00
										 |  |  | use FireflyIII\Models\Account; | 
					
						
							| 
									
										
										
										
											2018-02-16 22:14:34 +01:00
										 |  |  | use FireflyIII\Repositories\Account\AccountRepositoryInterface; | 
					
						
							| 
									
										
										
										
											2018-02-11 08:08:08 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | /** | 
					
						
							|  |  |  |  * Class AccountTransformer | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2018-12-15 07:59:49 +01:00
										 |  |  | class AccountTransformer extends AbstractTransformer | 
					
						
							| 
									
										
										
										
											2018-02-11 08:08:08 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2021-03-14 06:20:23 +01:00
										 |  |  |     protected AccountRepositoryInterface $repository; | 
					
						
							| 
									
										
										
										
											2018-03-19 19:39:02 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-11 20:45:33 +01:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2018-02-16 22:14:34 +01:00
										 |  |  |      * | 
					
						
							|  |  |  |      * AccountTransformer constructor. | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @codeCoverageIgnore | 
					
						
							| 
									
										
										
										
											2018-02-11 20:45:33 +01:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2018-12-15 07:59:49 +01:00
										 |  |  |     public function __construct() | 
					
						
							| 
									
										
										
										
											2018-02-11 20:45:33 +01:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2018-03-19 19:39:02 +01:00
										 |  |  |         $this->repository = app(AccountRepositoryInterface::class); | 
					
						
							| 
									
										
										
										
											2018-02-11 20:45:33 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-11 08:08:08 +01:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2018-02-17 10:47:06 +01:00
										 |  |  |      * Transform the account. | 
					
						
							|  |  |  |      * | 
					
						
							| 
									
										
										
										
											2018-02-11 08:08:08 +01:00
										 |  |  |      * @param Account $account | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return array | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     public function transform(Account $account): array | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2018-03-19 19:39:02 +01:00
										 |  |  |         $this->repository->setUser($account->user); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-15 07:59:49 +01:00
										 |  |  |         // get account type:
 | 
					
						
							| 
									
										
										
										
											2020-08-09 08:56:15 +02:00
										 |  |  |         $fullType      = $account->accountType->type; | 
					
						
							| 
									
										
										
										
											2021-03-14 06:20:23 +01:00
										 |  |  |         $accountType   = (string)config(sprintf('firefly.shortNamesByFullName.%s', $fullType)); | 
					
						
							|  |  |  |         $liabilityType = (string)config(sprintf('firefly.shortLiabilityNameByFullName.%s', $fullType)); | 
					
						
							| 
									
										
										
										
											2021-03-06 07:20:49 +01:00
										 |  |  |         $liabilityType = '' === $liabilityType ? null : strtolower($liabilityType); | 
					
						
							| 
									
										
										
										
											2018-12-15 07:59:49 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-18 19:57:23 +01:00
										 |  |  |         // get account role (will only work if the type is asset.
 | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |         $accountRole = $this->getAccountRole($account, $accountType); | 
					
						
							|  |  |  |         $date        = $this->getDate(); | 
					
						
							| 
									
										
										
										
											2021-02-26 18:09:48 +01:00
										 |  |  |         $date->endOfDay(); | 
					
						
							| 
									
										
										
										
											2018-12-15 07:59:49 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |         [$currencyId, $currencyCode, $currencySymbol, $decimalPlaces] = $this->getCurrency($account); | 
					
						
							|  |  |  |         [$creditCardType, $monthlyPaymentDate] = $this->getCCInfo($account, $accountRole, $accountType); | 
					
						
							| 
									
										
										
										
											2020-10-24 17:27:36 +02:00
										 |  |  |         [$openingBalance, $openingBalanceDate] = $this->getOpeningBalance($account, $accountType); | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |         [$interest, $interestPeriod] = $this->getInterest($account, $accountType); | 
					
						
							| 
									
										
										
										
											2018-02-13 18:24:06 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-14 06:20:23 +01:00
										 |  |  |         $openingBalance  = number_format((float)$openingBalance, $decimalPlaces, '.', ''); | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |         $includeNetWorth = '0' !== $this->repository->getMetaValue($account, 'include_net_worth'); | 
					
						
							| 
									
										
										
										
											2019-12-30 17:49:29 +01:00
										 |  |  |         $longitude       = null; | 
					
						
							|  |  |  |         $latitude        = null; | 
					
						
							|  |  |  |         $zoomLevel       = null; | 
					
						
							|  |  |  |         $location        = $this->repository->getLocation($account); | 
					
						
							|  |  |  |         if (null !== $location) { | 
					
						
							|  |  |  |             $longitude = $location->longitude; | 
					
						
							|  |  |  |             $latitude  = $location->latitude; | 
					
						
							| 
									
										
										
										
											2021-03-14 06:20:23 +01:00
										 |  |  |             $zoomLevel = (int)$location->zoom_level; | 
					
						
							| 
									
										
										
										
											2019-12-30 17:49:29 +01:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2021-03-14 06:20:23 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // no order for some accounts:
 | 
					
						
							|  |  |  |         $order = (int)$account->order; | 
					
						
							|  |  |  |         if (!in_array(strtolower($accountType), ['liability', 'liabilities', 'asset'])) { | 
					
						
							|  |  |  |             $order = null; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-30 17:49:29 +01:00
										 |  |  |         return [ | 
					
						
							| 
									
										
										
										
											2021-03-14 06:20:23 +01:00
										 |  |  |             'id'                      => (string)$account->id, | 
					
						
							| 
									
										
										
										
											2018-12-18 19:57:23 +01:00
										 |  |  |             'created_at'              => $account->created_at->toAtomString(), | 
					
						
							|  |  |  |             'updated_at'              => $account->updated_at->toAtomString(), | 
					
						
							|  |  |  |             'active'                  => $account->active, | 
					
						
							| 
									
										
										
										
											2021-03-14 06:20:23 +01:00
										 |  |  |             'order'                   => $order, | 
					
						
							| 
									
										
										
										
											2018-12-18 19:57:23 +01:00
										 |  |  |             'name'                    => $account->name, | 
					
						
							| 
									
										
										
										
											2021-02-24 06:01:43 +01:00
										 |  |  |             'type'                    => strtolower($accountType), | 
					
						
							| 
									
										
										
										
											2018-12-18 19:57:23 +01:00
										 |  |  |             'account_role'            => $accountRole, | 
					
						
							|  |  |  |             'currency_id'             => $currencyId, | 
					
						
							|  |  |  |             'currency_code'           => $currencyCode, | 
					
						
							|  |  |  |             'currency_symbol'         => $currencySymbol, | 
					
						
							|  |  |  |             'currency_decimal_places' => $decimalPlaces, | 
					
						
							| 
									
										
										
										
											2021-03-14 06:20:23 +01:00
										 |  |  |             'current_balance'         => number_format((float)app('steam')->balance($account, $date), $decimalPlaces, '.', ''), | 
					
						
							| 
									
										
										
										
											2021-04-01 20:56:11 +02:00
										 |  |  |             'current_balance_date'    => $date->toAtomString(), | 
					
						
							| 
									
										
										
										
											2018-12-18 19:57:23 +01:00
										 |  |  |             'notes'                   => $this->repository->getNoteText($account), | 
					
						
							|  |  |  |             'monthly_payment_date'    => $monthlyPaymentDate, | 
					
						
							|  |  |  |             'credit_card_type'        => $creditCardType, | 
					
						
							| 
									
										
										
										
											2019-07-31 16:53:09 +02:00
										 |  |  |             'account_number'          => $this->repository->getMetaValue($account, 'account_number'), | 
					
						
							| 
									
										
										
										
											2018-12-18 19:57:23 +01:00
										 |  |  |             'iban'                    => '' === $account->iban ? null : $account->iban, | 
					
						
							|  |  |  |             'bic'                     => $this->repository->getMetaValue($account, 'BIC'), | 
					
						
							| 
									
										
										
										
											2021-03-14 06:20:23 +01:00
										 |  |  |             'virtual_balance'         => number_format((float)$account->virtual_balance, $decimalPlaces, '.', ''), | 
					
						
							| 
									
										
										
										
											2018-12-18 19:57:23 +01:00
										 |  |  |             'opening_balance'         => $openingBalance, | 
					
						
							|  |  |  |             'opening_balance_date'    => $openingBalanceDate, | 
					
						
							|  |  |  |             'liability_type'          => $liabilityType, | 
					
						
							| 
									
										
										
										
											2021-03-14 06:20:23 +01:00
										 |  |  |             'interest'                => (float)$interest, | 
					
						
							| 
									
										
										
										
											2018-12-18 19:57:23 +01:00
										 |  |  |             'interest_period'         => $interestPeriod, | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |             'include_net_worth'       => $includeNetWorth, | 
					
						
							| 
									
										
										
										
											2019-12-30 17:49:29 +01:00
										 |  |  |             'longitude'               => $longitude, | 
					
						
							|  |  |  |             'latitude'                => $latitude, | 
					
						
							|  |  |  |             'zoom_level'              => $zoomLevel, | 
					
						
							| 
									
										
										
										
											2018-12-18 19:57:23 +01:00
										 |  |  |             'links'                   => [ | 
					
						
							| 
									
										
										
										
											2018-02-11 08:08:08 +01:00
										 |  |  |                 [ | 
					
						
							|  |  |  |                     'rel' => 'self', | 
					
						
							|  |  |  |                     'uri' => '/accounts/' . $account->id, | 
					
						
							|  |  |  |                 ], | 
					
						
							|  |  |  |             ], | 
					
						
							|  |  |  |         ]; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @param Account $account | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @param string  $accountType | 
					
						
							|  |  |  |      * | 
					
						
							| 
									
										
										
										
											2019-01-27 12:30:52 +01:00
										 |  |  |      * @return string|null | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2019-01-27 12:30:52 +01:00
										 |  |  |     private function getAccountRole(Account $account, string $accountType): ?string | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2019-07-05 19:43:16 +02:00
										 |  |  |         $accountRole = $this->repository->getMetaValue($account, 'account_role'); | 
					
						
							| 
									
										
										
										
											2021-03-14 06:20:23 +01:00
										 |  |  |         if ('asset' !== $accountType || '' === (string)$accountRole) { | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |             $accountRole = null; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return $accountRole; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							| 
									
										
										
										
											2021-03-21 09:15:40 +01:00
										 |  |  |      * @return Carbon | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2021-03-21 09:15:40 +01:00
										 |  |  |     private function getDate(): Carbon | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2021-03-21 09:15:40 +01:00
										 |  |  |         $date = today(config('app.timezone')); | 
					
						
							|  |  |  |         if (null !== $this->parameters->get('date')) { | 
					
						
							|  |  |  |             $date = $this->parameters->get('date'); | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-21 09:15:40 +01:00
										 |  |  |         return $date; | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @param Account $account | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return array | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     private function getCurrency(Account $account): array | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2020-08-09 08:56:15 +02:00
										 |  |  |         $currency = $this->repository->getAccountCurrency($account); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // only grab default when result is null:
 | 
					
						
							|  |  |  |         if (null === $currency) { | 
					
						
							|  |  |  |             $currency = app('amount')->getDefaultCurrencyByUser($account->user); | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2021-03-14 06:20:23 +01:00
										 |  |  |         $currencyId     = (string)$currency->id; | 
					
						
							| 
									
										
										
										
											2020-08-09 08:56:15 +02:00
										 |  |  |         $currencyCode   = $currency->code; | 
					
						
							|  |  |  |         $decimalPlaces  = $currency->decimal_places; | 
					
						
							|  |  |  |         $currencySymbol = $currency->symbol; | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         return [$currencyId, $currencyCode, $currencySymbol, $decimalPlaces]; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							| 
									
										
										
										
											2021-03-21 09:15:40 +01:00
										 |  |  |      * @param Account     $account | 
					
						
							|  |  |  |      * @param string|null $accountRole | 
					
						
							|  |  |  |      * @param string      $accountType | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |      * | 
					
						
							|  |  |  |      * @return array | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2021-03-21 09:15:40 +01:00
										 |  |  |     private function getCCInfo(Account $account, ?string $accountRole, string $accountType): array | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2021-03-21 09:15:40 +01:00
										 |  |  |         $monthlyPaymentDate = null; | 
					
						
							|  |  |  |         $creditCardType     = null; | 
					
						
							|  |  |  |         if ('ccAsset' === $accountRole && 'asset' === $accountType) { | 
					
						
							|  |  |  |             $creditCardType     = $this->repository->getMetaValue($account, 'cc_type'); | 
					
						
							|  |  |  |             $monthlyPaymentDate = $this->repository->getMetaValue($account, 'cc_monthly_payment_date'); | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |         } | 
					
						
							| 
									
										
										
										
											2021-04-01 20:56:11 +02:00
										 |  |  |         if(null !== $monthlyPaymentDate) { | 
					
						
							|  |  |  |             $monthlyPaymentDate = Carbon::createFromFormat('!Y-m-d', $monthlyPaymentDate, config('app.timezone'))->toAtomString(); | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-21 09:15:40 +01:00
										 |  |  |         return [$creditCardType, $monthlyPaymentDate]; | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @param Account $account | 
					
						
							|  |  |  |      * @param string  $accountType | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @param int     $decimalPlaces | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return array | 
					
						
							| 
									
										
										
										
											2020-08-09 08:56:15 +02:00
										 |  |  |      * | 
					
						
							|  |  |  |      * TODO refactor call to getOpeningBalanceAmount / Date because its extra queries. | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2020-10-24 17:27:36 +02:00
										 |  |  |     private function getOpeningBalance(Account $account, string $accountType): array | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |     { | 
					
						
							|  |  |  |         $openingBalance     = null; | 
					
						
							|  |  |  |         $openingBalanceDate = null; | 
					
						
							| 
									
										
										
										
											2019-06-21 19:10:02 +02:00
										 |  |  |         if (in_array($accountType, ['asset', 'liabilities'], true)) { | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |             $amount             = $this->repository->getOpeningBalanceAmount($account); | 
					
						
							| 
									
										
										
										
											2020-07-12 17:32:48 +02:00
										 |  |  |             $openingBalance     = $amount; | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  |             $openingBalanceDate = $this->repository->getOpeningBalanceDate($account); | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2021-04-01 20:56:11 +02:00
										 |  |  |         if(null !== $openingBalanceDate) { | 
					
						
							|  |  |  |             $openingBalanceDate = Carbon::createFromFormat('!Y-m-d', $openingBalanceDate, config('app.timezone'))->toAtomString(); | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2019-01-27 07:48:49 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |         return [$openingBalance, $openingBalanceDate]; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2021-03-21 09:15:40 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * @param Account $account | 
					
						
							|  |  |  |      * @param string  $accountType | 
					
						
							|  |  |  |      * | 
					
						
							|  |  |  |      * @return array | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     private function getInterest(Account $account, string $accountType): array | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         $interest       = null; | 
					
						
							|  |  |  |         $interestPeriod = null; | 
					
						
							|  |  |  |         if ('liabilities' === $accountType) { | 
					
						
							|  |  |  |             $interest       = $this->repository->getMetaValue($account, 'interest'); | 
					
						
							|  |  |  |             $interestPeriod = $this->repository->getMetaValue($account, 'interest_period'); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         return [$interest, $interestPeriod]; | 
					
						
							|  |  |  |     } | 
					
						
							| 
									
										
										
										
											2018-03-05 19:35:58 +01:00
										 |  |  | } |