Files
PhpSpreadsheet/tests/data/Calculation/Financial/DB.php
Mark Baker 5ad5f787ab Financial functions next stage of refactoring (#1943)
* First steps splitting out the Amortization and Deprecation Excel functions from Financials
* Verify which methods allow negative values for arguments
* Additional unit tests for SLN() and SYD()
* Additional unit tests for DDB()
* Additional unit tests for DB()
* Verify Amortization cases where salvage is greater than cost
* More unit tests for Amortization
* Resolve broken test in AMORLINC() and extract amortizationCoefficient calculation
* verify amortizationCoefficient calculation
* Extract YIELDDISC() and YIELDMAT() to Financial\Securities
* Additional validation for Securities Yield functions
2021-03-21 21:40:49 +01:00

248 lines
3.1 KiB
PHP

<?php
// cost, salvage, life, period, month, result
return [
[
186083.33333333,
1000000,
100000,
6,
1,
7,
],
[
259639.41666667,
1000000,
100000,
6,
2,
7,
],
[
176814.44274999999,
1000000,
100000,
6,
3,
7,
],
[
120410.63551275,
1000000,
100000,
6,
4,
7,
],
[
81999.642784183001,
1000000,
100000,
6,
5,
7,
],
[
55841.756736028001,
1000000,
100000,
6,
6,
7,
],
[
15845.098473848,
1000000,
100000,
6,
7,
7,
],
[
1845.0,
10000,
1000,
5,
1,
6,
],
[
3009.1950000000002,
10000,
1000,
5,
2,
6,
],
[
1898.8020449999999,
10000,
1000,
5,
3,
6,
],
[
1198.1440903949999,
10000,
1000,
5,
4,
6,
],
[
756.02892103925001,
10000,
1000,
5,
5,
6,
],
[
238.52712458788,
10000,
1000,
5,
6,
6,
],
[
0.0,
0,
0,
5,
6,
6,
],
[
4651.199,
12000,
2000,
3.5,
2,
1,
],
[
3521.399,
12000,
2000,
5,
2.5,
1,
],
[
3521.399,
12000,
2000,
5,
2.5,
1.2,
],
// Period value between 0 and 1 not yet handled in code
// [
// 301.0,
// 12000,
// 2000,
// 5,
// 0.5,
// 1,
// ],
[
-554.116,
12000,
15000,
5,
2,
1,
],
[
'#NUM!',
-1000,
100,
5,
6,
6,
],
[
'#VALUE!',
'Invalid',
1000,
5,
2,
1,
],
[
'#VALUE!',
12000,
'Invalid',
5,
2,
1,
],
[
'#VALUE!',
12000,
1000,
'Invalid',
2,
1,
],
[
'#VALUE!',
12000,
1000,
5,
'Invalid',
1,
],
[
'#VALUE!',
12000,
1000,
5,
2,
'Invalid',
],
[
'#NUM!',
-12000,
1000,
5,
2,
1,
],
[
'#NUM!',
12000,
-1000,
5,
2,
1,
],
[
'#NUM!',
12000,
1000,
5,
0,
1,
],
[
'#NUM!',
12000,
1000,
5,
-2,
1,
],
[
'#NUM!',
12000,
1000,
5,
2,
0,
],
];