Skip to content

Shift Activity

You can query all pay in/out activity for:

  • a specific shift and
  • a specific cash register

And then use that information to report on shift activity. Once again, the cash register's unique identifier is required, so it must first be obtained using Cash Registers.

The Code

ObjC

// End of Shift operations process
CashRegisterActivityCompletion completion = ^(NSArray <WDCashActivity *> * _Nullable cashActivities, NSError * _Nullable cashActivitiesError){
// cashActivities List of Cash In/Out activities for the specified Shift and Cash Register
};
// Additional Query details such as page ,page size
WDQuery *query = [[WDQuery alloc ] initWithPage:0 pageSize:20];
[sdk.cashManager getOperationsForShift:@"ShiftID" // Shift for which to query the activities
query:query // additional query details
belongingToCashRegister:@"CashRegisterInteralID" // The selected Cash Register internal ID
completion:completion]; // End of Shift activities process

Swift

// End of Shift types process
let completion:CashRegisterActivityCompletion = { ( cashActivities:[WDCashActivity]?, error: Error?) in
// cashActivities List of Cash In/Out activities for the specified Shift and Cash Register
}
// Additional Query details such as page ,page size
let query = WDQuery(page: 0, pageSize: 20)
sdk.cashManager.getOperationsForShift("ShiftID" ,// Shift for which to query the activities
query: query, // additional query details
belongingToCashRegister: "CashRegisterInteralID", // The selected Cash Register internal ID
completion: completion) // End of Shift activities process

import de.wirecard.epos.model.with.With;
import de.wirecard.epos.model.with.WithPagination;
import io.reactivex.android.schedulers.AndroidSchedulers;
// Obtain list of Cash In/Out operations
epos.cash()
.getCashOperations(
cashRegister.getId(), // cash register id
lastShift.getId()) // shift id
.observeOn(AndroidSchedulers.mainThread()) // in case you want result in main thread
.subscribe(cashOperations -> {
// cashActivities List of Cash In/Out activities for the specified Shift and Cash Register
}, throwable -> {
// handle error
});
//******************** USING WITH PARAMETER ********************//
WithPagination withPagination = With.pagination()
.includeResponseFields("shiftId", "amount", "timestamp") // backend response object will contain only specified fields
.param("shiftId", "5s5s5s5s5s5") // add optional parameter shiftId to backend request
.param("operationType", "CASH_IN") // add optional parameter operationType to backend request
.sort("timestamp", WithPagination.Order.ASC) // sort response object CashOperations by timestamp backend response object field
.page(0) // return first 10 results
.size(10); // number (10) of items in one page
epos.cash()
.getCashOperations(
cashRegister.getId(),
lastShift.getId(),
withPagination)
.observeOn(AndroidSchedulers.mainThread()) // in case you want result in main thread
.subscribe(cashOperations -> {
// cashActivities List of Cash In/Out activities for the specified Shift and Cash Register
}, throwable -> {
// handle error
});

Universal Windows Platform SDK coming soon