capacitor-hugin-gmp3 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,6 +13,9 @@ import com.getcapacitor.JSObject;
13
13
  import org.json.JSONArray;
14
14
  import org.json.JSONObject;
15
15
 
16
+ import java.util.ArrayList;
17
+ import java.util.List;
18
+
16
19
  import gmp3.droid.printer.DeviceInfo;
17
20
  import gmp3.droid.printer.HuginPrinter;
18
21
  import gmp3.droid.printer.Utility;
@@ -98,7 +101,7 @@ public class PrinterCoverService extends Service {
98
101
  saleItems.put("Adjustments", (jsObjectSale.getJSONArray("Adjustments")));
99
102
  saleItems.put("Payments", new JSArray());
100
103
  saleItems.put("EndOfReceiptInfo", jsObjectSale.getJSONObject("EndOfReceiptInfo"));
101
- saleItems.put("FooterNotes", (jsObjectSale.getJSONArray("FooterNotes")));
104
+ saleItems.put("FooterNotes", (new JSArray()));
102
105
  JSONArray payments = jsObjectSale.getJSONArray("Payments");
103
106
 
104
107
  String res = printer.CheckPrinterStatus();
@@ -129,8 +132,18 @@ public class PrinterCoverService extends Service {
129
132
  printer.PrintPayment(payment.getInt("Type"), i, payment.getDouble("PaidTotal"));
130
133
  }
131
134
  Log.i(TAG, creditPayment);
135
+ JSONArray footerNotes = jsObjectSale.getJSONArray("FooterNotes");
136
+ List<String> list = new ArrayList<>();
137
+
138
+ for (int i = 0; i < footerNotes.length(); i++) {
139
+ list.add(footerNotes.getString(i));
140
+ }
141
+
142
+ String[] arr = list.toArray(new String[0]);
143
+
144
+ printer.PrintRemarkLine(arr);
132
145
 
133
- String closeReceipt = printer.CloseReceipt(true);
146
+ String closeReceipt = printer.CloseReceipt(true);
134
147
 
135
148
  Log.i(TAG, str);
136
149
  String[] response = printResponse(closeReceipt);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-hugin-gmp3",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Hugin plugin for TCP/IP",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",