public class CashEvents extends Object
CashContract
.CashDrawers
Modifier and Type | Field and Description |
---|---|
static String |
ARG_ACCOUNT
Extra type:
Account . |
static String |
ARG_CASH_EVENT
Extra type:
CashEvent . |
static String |
ARG_SUCCESS
For internal use only.
|
static String |
EXTRA_CASH_DRAWER_IDENTIFIER
Extra type: String.
|
static String |
EXTRA_CASH_DRAWER_NUMBER
Extra type: Integer.
|
static String |
METHOD_ADD_ENTRY
For internal use only.
|
Constructor and Description |
---|
CashEvents(Context context,
Account account)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addCash(long amount,
String note)
Record a miscellaneous "add cash" event and pops one cash drawer.
|
boolean |
addCash(long amount,
String note,
CashDrawer cashDrawer)
Record a miscellaneous "add cash" event and pops the given cash drawer.
|
boolean |
removeCash(long amount,
String note)
Record a miscellaneous "remove cash" event and pops one cash drawer.
|
boolean |
removeCash(long amount,
String note,
CashDrawer cashDrawer)
Record a miscellaneous "remove cash" event and pops the given cash drawer.
|
public static final String METHOD_ADD_ENTRY
public static final String ARG_ACCOUNT
Account
. This is not an arg, actually an extra.
For internal use only.public static final String ARG_CASH_EVENT
CashEvent
. This is not an arg, actually an extra.
For internal use only.public static final String EXTRA_CASH_DRAWER_IDENTIFIER
CashDrawer.getIdentifier()
,
Constant Field Valuespublic static final String EXTRA_CASH_DRAWER_NUMBER
public static final String ARG_SUCCESS
public CashEvents(Context context, Account account)
context
- account
- Obtain account with CloverAccount.getAccount(Context)
public boolean addCash(long amount, String note)
amount
- amount being added, must be positivenote
- human readable string explaining why cash was addedpublic boolean removeCash(long amount, String note)
amount
- amount being removed, must be negativenote
- human readable string explaining why cash was addedpublic boolean addCash(long amount, String note, CashDrawer cashDrawer)
amount
- amount being added, must be positivenote
- human readable string explaining why cash was addedcashDrawer
- the drawer to pop and have the event recorded againstCashDrawers
public boolean removeCash(long amount, String note, CashDrawer cashDrawer)
amount
- amount being removed, must be negativenote
- human readable string explaining why cash was addedcashDrawer
- the drawer to pop and have the event recorded againstCashDrawers