Class BalanceDebitorActionDisplayServiceImpl
java.lang.Object
ch.tocco.nice2.optional.debitor.impl.action.BalanceDebitorActionDisplayServiceImpl
- All Implemented Interfaces:
BalanceDebitorActionDisplayService
public class BalanceDebitorActionDisplayServiceImpl
extends Object
implements BalanceDebitorActionDisplayService
-
Constructor Summary
ConstructorDescriptionBalanceDebitorActionDisplayServiceImpl
(EntityExplorerActionSelectionService selectionService, Context context, DefaultDisplayService defaultDisplayService) -
Method Summary
Modifier and TypeMethodDescriptionReturns the default loss and gain accounts based on the Voucher_types win and loss.getNumberOfDebitorsUnbalanced
(EntityExplorerActionSelection selectedDebitors) Get count of negatively and postively unbalanced debitors, ignoring balanced debitors.boolean
isAnyBalanceGreaterThan
(EntityExplorerActionSelection selectedDebitors, BigDecimal maxDiscrepancy) Check if any Debitor balance deviates more than given value from zero.
-
Constructor Details
-
BalanceDebitorActionDisplayServiceImpl
public BalanceDebitorActionDisplayServiceImpl(EntityExplorerActionSelectionService selectionService, Context context, DefaultDisplayService defaultDisplayService)
-
-
Method Details
-
isAnyBalanceGreaterThan
public boolean isAnyBalanceGreaterThan(EntityExplorerActionSelection selectedDebitors, BigDecimal maxDiscrepancy) Description copied from interface:BalanceDebitorActionDisplayService
Check if any Debitor balance deviates more than given value from zero.- Specified by:
isAnyBalanceGreaterThan
in interfaceBalanceDebitorActionDisplayService
- Parameters:
selectedDebitors
- debitors selectedmaxDiscrepancy
- max. amount balance may deviate from zero- Returns:
- true if any debitor's balance is off by more than value. Otherwise, false.
-
getNumberOfDebitorsUnbalanced
public Map<String,Object> getNumberOfDebitorsUnbalanced(EntityExplorerActionSelection selectedDebitors) Description copied from interface:BalanceDebitorActionDisplayService
Get count of negatively and postively unbalanced debitors, ignoring balanced debitors.- Specified by:
getNumberOfDebitorsUnbalanced
in interfaceBalanceDebitorActionDisplayService
- Parameters:
selectedDebitors
- Debitors selected- Returns:
- Map with keys "postive" to hold count of positively unbalanced debitors, and "negative" for negatively unbalanced.
-
getDefaultAccounts
Description copied from interface:BalanceDebitorActionDisplayService
Returns the default loss and gain accounts based on the Voucher_types win and loss.- Specified by:
getDefaultAccounts
in interfaceBalanceDebitorActionDisplayService
-