本文整理汇总了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;
}
示例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;
}
示例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;
}