Closed DimiDR closed 4 months ago
TIJobPrintBluetooth method has
printedOrders.add(orderId);
IdManager.clearIds(context);
IdManager.saveIds(context, printedOrders);
This will save order IDs so they will not be reprinted. This should not happen. As this is only for automatic printing while service is running. The service will only print invoices, which were not yet printed and have the initial status.
In MainActivity there is this code:
public void onSuccess(String[] results) { ...
JSONObject jsonObjectOrders = new JSONObject(results[0]);
JSONObject jsonObjectMenus = new JSONObject(results[1]);
JSONObject jsonObjectCategories = new JSONObject(results[2]);
JSONArray dataArrayOrders = DocketStringModeler.filterPrintableOrders(jsonObjectOrders.getJSONArray("data"), printedOrders);
for (int i = 0; i < dataArrayOrders.length(); i++) {
dataObjectOrders = dataArrayOrders.getJSONObject(i);
orderID = dataObjectOrders.getString("id");
TIJobPrintBluetooth(docketStringModeler.startPrinting(dataObjectOrders, jsonObjectMenus, jsonObjectCategories, mediaPlayer, shop_name), orderID);
}
The filterPrintableOrders will remove data from array, for the orders which were already printed. This method should not be used in forces printing. TIJobPrintBluetooth should execute the print, if the correct data is given. As only one print in the list view is selectable, it will be always one element.
I hope executing TIJobPrintBluetooth with correct data is enough.
Popup UI is in xml file orders_list.xml RePrintTask in Main activity
To show different data you can see OrdersAdapter.class This adapter is used in popup to display data
Logic in OrderAdapter.java
Implement reprenting UI.
It should contain: Order Nr, Time, Name, Status of Order