loan/investment/fleetmgmt fixes

This commit is contained in:
Dennis Eichhorn 2023-06-23 14:27:14 +00:00
parent 213f7de83a
commit db366dc7ce
4 changed files with 106 additions and 9 deletions

View File

@ -4,7 +4,7 @@
"pid": "/",
"type": 2,
"subtype": 1,
"name": "Loan",
"name": "Loans",
"uri": "{/base}finance/loan/list?{?}",
"target": "self",
"icon": null,

99
Models/Loan.php Normal file
View File

@ -0,0 +1,99 @@
<?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package Modules\LoanManagement\Models
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
namespace Modules\LoanManagement\Models;
use Modules\Admin\Models\Account;
use Modules\Admin\Models\NullAccount;
use phpOMS\Business\Finance\DepreciationType;
use phpOMS\Localization\BaseStringL11nType;
/**
* Loan model.
*
* @package Modules\LoanManagement\Models
* @license OMS License 2.0
* @link https://orange-management.org
* @since 1.0.0
*/
class Loan
{
public int $id = 0;
public string $name = '';
public string $description = '';
public int $status = LoanStatus::DRAFT;
public int $amount = 0;
public int $acquisitionFee = 0;
public int $disagio = 0;
public int $nominalBorrowingRate = 0;
public int $startingRepaymentRate = 0;
public int $startingRepayment = 0;
// 0 = end of month
public int $dayOfRepayment = 0;
// monthly, quarterly, annually, end of duration
public int $interestInterval = 0;
public int $interestTaxRate = 0;
// monthly, quarterly, annually, end of duration
public int $repaymentInterval = 0;
// months
public int $duration = 0;
public int $repaymentFreeTime = 0;
// Either separate (during the repayment free time) or during the repayment time
public int $repaymentFreeInterest = 1;
public int $residualAmountAfterDuration = 0;
public int $annualSpecialPayment = 0;
public bool $isSpecialPaymentAllowed = false;
public \DateTime $start;
public \DateTime $end;
public \DateTime $payout;
// 0 = not possible
public int $interestRateAfterDuration = 0;
// used to indicate if the interests/payments/taxes are manually adjusted
public bool $hasManualInterestAmounts = false;
public array $interests = [];
// in and out
public array $payments = [];
public bool $hasManualPaymentAmounts = false;
public array $taxes = [];
public bool $hasManualTaxAmounts = false;
}

View File

@ -4,7 +4,7 @@
*
* PHP Version 8.1
*
* @package Modules\LoanmentManagement\Models
* @package Modules\LoanManagement\Models
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
@ -12,14 +12,14 @@
*/
declare(strict_types=1);
namespace Modules\LoanmentManagement\Models;
namespace Modules\LoanManagement\Models;
use phpOMS\Stdlib\Base\Enum;
/**
* Loanment status enum.
*
* @package Modules\LoanmentManagement\Models
* @package Modules\LoanManagement\Models
* @license OMS License 2.0
* @link https://jingga.app
* @since 1.0.0
@ -28,9 +28,7 @@ abstract class LoanStatus extends Enum
{
public const DRAFT = 1;
public const OPEN = 2;
public const ACTIVE = 2;
public const APPROVED = 3;
public const DENIED = 4;
public const INACTIVE = 3;
}

View File

@ -14,5 +14,5 @@ declare(strict_types=1);
return ['Navigation' => [
'List' => 'List',
'Loan' => 'Loan',
'Loans' => 'Loans',
]];