Search in sources :

Example 51 with FixedAsset

use of com.axelor.apps.account.db.FixedAsset in project axelor-open-suite by axelor.

the class TestFixedAssetService method testGenerateAndComputeLinesProrataDegressiveFixedAssetFifthLine.

@Test
public void testGenerateAndComputeLinesProrataDegressiveFixedAssetFifthLine() {
    FixedAsset fixedAsset = generateAndComputeLinesProrataDegressiveFixedAsset();
    assertFixedAssetLineEquals(createFixedAssetLine(LocalDate.of(2025, 12, 31), new BigDecimal("8971.91"), new BigDecimal("84694.53"), new BigDecimal("17943.82")), fixedAsset.getFixedAssetLineList().get(4));
}
Also used : FixedAsset(com.axelor.apps.account.db.FixedAsset) FixedAssetTestTool.createFixedAsset(com.axelor.apps.account.service.fixedasset.FixedAssetTestTool.createFixedAsset) BigDecimal(java.math.BigDecimal) Test(org.junit.Test)

Example 52 with FixedAsset

use of com.axelor.apps.account.db.FixedAsset in project axelor-open-suite by axelor.

the class TestFixedAssetService method testGenerateAndComputeLinesProrataDegressiveFixedAssetFourthLine.

@Test
public void testGenerateAndComputeLinesProrataDegressiveFixedAssetFourthLine() {
    FixedAsset fixedAsset = generateAndComputeLinesProrataDegressiveFixedAsset();
    assertFixedAssetLineEquals(createFixedAssetLine(LocalDate.of(2024, 12, 31), new BigDecimal("12749.56"), new BigDecimal("75722.62"), new BigDecimal("26915.73")), fixedAsset.getFixedAssetLineList().get(3));
}
Also used : FixedAsset(com.axelor.apps.account.db.FixedAsset) FixedAssetTestTool.createFixedAsset(com.axelor.apps.account.service.fixedasset.FixedAssetTestTool.createFixedAsset) BigDecimal(java.math.BigDecimal) Test(org.junit.Test)

Example 53 with FixedAsset

use of com.axelor.apps.account.db.FixedAsset in project axelor-open-suite by axelor.

the class TestFixedAssetService method testGenerateAndComputeLinesUsProrataLinearFixedAssetFirstLine.

@Test
public void testGenerateAndComputeLinesUsProrataLinearFixedAssetFirstLine() {
    FixedAsset fixedAsset = generateAndComputeLineUsProrataLinearFixedAsset();
    assertFixedAssetLineEquals(createFixedAssetLine(LocalDate.of(2020, 12, 31), new BigDecimal("7331.31"), new BigDecimal("7331.31"), new BigDecimal("95307.04")), fixedAsset.getFixedAssetLineList().get(0));
}
Also used : FixedAsset(com.axelor.apps.account.db.FixedAsset) FixedAssetTestTool.createFixedAsset(com.axelor.apps.account.service.fixedasset.FixedAssetTestTool.createFixedAsset) BigDecimal(java.math.BigDecimal) Test(org.junit.Test)

Example 54 with FixedAsset

use of com.axelor.apps.account.db.FixedAsset in project axelor-open-suite by axelor.

the class TestFixedAssetService method testGenerateAndComputeLinesProrataLinearFixedAssetSixthLine.

@Test
public void testGenerateAndComputeLinesProrataLinearFixedAssetSixthLine() {
    FixedAsset fixedAsset = generateAndComputeLineProrataLinearFixedAsset();
    assertFixedAssetLineEquals(createFixedAssetLine(LocalDate.of(2025, 10, 4), new BigDecimal("76.11"), new BigDecimal("500.00"), new BigDecimal("0.00")), fixedAsset.getFixedAssetLineList().get(5));
}
Also used : FixedAsset(com.axelor.apps.account.db.FixedAsset) FixedAssetTestTool.createFixedAsset(com.axelor.apps.account.service.fixedasset.FixedAssetTestTool.createFixedAsset) BigDecimal(java.math.BigDecimal) Test(org.junit.Test)

Example 55 with FixedAsset

use of com.axelor.apps.account.db.FixedAsset in project axelor-open-suite by axelor.

the class TestFixedAssetService method testGenerateAndComputeLinesSimpleLinearFixedAssetSecondLine.

@Test
public void testGenerateAndComputeLinesSimpleLinearFixedAssetSecondLine() {
    FixedAsset fixedAsset = generateAndComputeLineSimpleLinearFixedAsset();
    assertFixedAssetLineEquals(createFixedAssetLine(LocalDate.of(2021, 12, 31), new BigDecimal("100.00"), new BigDecimal("200.00"), new BigDecimal("300.00")), fixedAsset.getFixedAssetLineList().get(1));
}
Also used : FixedAsset(com.axelor.apps.account.db.FixedAsset) FixedAssetTestTool.createFixedAsset(com.axelor.apps.account.service.fixedasset.FixedAssetTestTool.createFixedAsset) BigDecimal(java.math.BigDecimal) Test(org.junit.Test)

Aggregations

FixedAsset (com.axelor.apps.account.db.FixedAsset)65 FixedAssetTestTool.createFixedAsset (com.axelor.apps.account.service.fixedasset.FixedAssetTestTool.createFixedAsset)52 BigDecimal (java.math.BigDecimal)52 Test (org.junit.Test)47 FixedAssetLine (com.axelor.apps.account.db.FixedAssetLine)12 FixedAssetTestTool.createFixedAssetLine (com.axelor.apps.account.service.fixedasset.FixedAssetTestTool.createFixedAssetLine)10 Transactional (com.google.inject.persist.Transactional)6 AxelorException (com.axelor.exception.AxelorException)5 ArrayList (java.util.ArrayList)5 LocalDate (java.time.LocalDate)4 MoveLine (com.axelor.apps.account.db.MoveLine)3 FixedAssetRepository (com.axelor.apps.account.db.repo.FixedAssetRepository)3 FixedAssetService (com.axelor.apps.account.service.fixedasset.FixedAssetService)3 Account (com.axelor.apps.account.db.Account)2 AccountConfig (com.axelor.apps.account.db.AccountConfig)2 InvoiceLine (com.axelor.apps.account.db.InvoiceLine)2 Journal (com.axelor.apps.account.db.Journal)2 Move (com.axelor.apps.account.db.Move)2 Company (com.axelor.apps.base.db.Company)2 Partner (com.axelor.apps.base.db.Partner)2