当前位置: 首页>>代码示例>>Java>>正文


Java Period.setInclusiveEnd方法代码示例

本文整理汇总了Java中nl.strohalm.cyclos.utils.Period.setInclusiveEnd方法的典型用法代码示例。如果您正苦于以下问题:Java Period.setInclusiveEnd方法的具体用法?Java Period.setInclusiveEnd怎么用?Java Period.setInclusiveEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nl.strohalm.cyclos.utils.Period的用法示例。


在下文中一共展示了Period.setInclusiveEnd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getBalanceAtTransfer

import nl.strohalm.cyclos.utils.Period; //导入方法依赖的package包/类
@Override
public BigDecimal getBalanceAtTransfer(final Account account, final Transfer transfer, final boolean compensateChargebacks, final boolean inclusive) {
    if (transfer.getProcessDate() == null) {
        throw new IllegalArgumentException("transfer must be processed.");
    }
    // Get the last closed balance before the given date
    ClosedAccountBalance closedBalance = closedAccountBalanceDao.get(account, transfer.getProcessDate());
    BigDecimal balance = closedBalance == null ? BigDecimal.ZERO : closedBalance.getBalance();

    Period diffPeriod = Period.begginingAt((closedBalance == null) ? null : closedBalance.getDate());
    diffPeriod.setInclusiveEnd(inclusive);
    BigDecimal diff = transferDao.balanceDiff(account, diffPeriod, transfer);
    balance = balance.add(diff);
    if (compensateChargebacks) {
        BigDecimal chargebackBalance = transferDao.getChargebackBalance(account, transfer, inclusive);
        balance = balance.add(chargebackBalance);
    }
    return balance;
}
 
开发者ID:crypto-coder,项目名称:open-cyclos,代码行数:20,代码来源:AccountServiceImpl.java

示例2: getExclusiveBalance

import nl.strohalm.cyclos.utils.Period; //导入方法依赖的package包/类
@Override
public BigDecimal getExclusiveBalance(final AccountDateDTO params) {
    Account account = getAccount(params);
    Calendar date = params.getDate();

    // Get the last closed balance before the given date
    ClosedAccountBalance closedBalance = closedAccountBalanceDao.get(account, date);
    BigDecimal balance = closedBalance == null ? BigDecimal.ZERO : closedBalance.getBalance();

    if (date == null || closedBalance == null || !date.equals(closedBalance.getDate())) {
        Calendar beginDate = (closedBalance == null) ? null : closedBalance.getDate();
        Period balanceDiffPeriod = Period.between(beginDate, date).useTime();
        balanceDiffPeriod.setInclusiveEnd(false);
        BigDecimal diff = transferDao.balanceDiff(account, balanceDiffPeriod);
        balance = balance.add(diff);
    }
    return balance;
}
 
开发者ID:crypto-coder,项目名称:open-cyclos,代码行数:19,代码来源:AccountServiceImpl.java

示例3: getBalanceAtTimePoint

import nl.strohalm.cyclos.utils.Period; //导入方法依赖的package包/类
@Override
public BigDecimal getBalanceAtTimePoint(final Account account, final Calendar date, final boolean inclusive, final boolean compensateChargebacks) {
    AccountDateDTO param = new AccountDateDTO(account, date);
    BigDecimal balance = (inclusive) ? getBalance(param) : getExclusiveBalance(param);
    if (compensateChargebacks) {
        Period period = Period.endingAt(date).useTime();
        period.setInclusiveEnd(inclusive);
        BigDecimal chargebackBalance = transferDao.getChargebackBalance(account, period);
        balance = balance.add(chargebackBalance);
    }
    return balance;
}
 
开发者ID:crypto-coder,项目名称:open-cyclos,代码行数:13,代码来源:AccountServiceImpl.java


注:本文中的nl.strohalm.cyclos.utils.Period.setInclusiveEnd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。