capacitor-hugin-gmp3 0.2.6 → 0.2.8

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.
@@ -83,7 +83,13 @@ public class CapacitorHuginGMP3Plugin extends Plugin {
83
83
  call.reject("Parametre eksik: terminalNo, ip veya port");
84
84
  return;
85
85
  }
86
-
86
+ if(printerService == null) {
87
+ JSObject result = new JSObject();
88
+ result.put("connected", false);
89
+ result.put("message", "must_reconnect");
90
+ call.resolve(result);
91
+ return;
92
+ }
87
93
  boolean connected = printerService.connect(ip, port, terminalNo);
88
94
  JSObject result = new JSObject();
89
95
  result.put("connected", connected);
@@ -92,7 +98,7 @@ public class CapacitorHuginGMP3Plugin extends Plugin {
92
98
  JSObject result = new JSObject();
93
99
  result.put("connected", false);
94
100
  call.resolve(result);
95
- Log.i(TAG,"Hata Bizde" + e.toString());
101
+ Log.i(TAG,"Hata Bizde " + e.getMessage());
96
102
  }
97
103
  }
98
104
 
@@ -53,10 +53,12 @@ public class PrinterCoverService extends Service {
53
53
  @Override
54
54
  public boolean connect(String ip, int port, String terminalNo) throws RemoteException {
55
55
  try {
56
- tcpConnected = tcpConnect(ip,port);
57
56
  if(!tcpConnected) {
57
+ tcpConnected = tcpConnect(ip,port);
58
+ if(!tcpConnected) {
58
59
  Log.w(TAG,"TCP Bağlantısı sağlanamadı.");
59
60
  return false;
61
+ }
60
62
  }
61
63
  DeviceInfo serverInfo = new DeviceInfo();
62
64
  serverInfo.Brand = "HUGIN";
@@ -107,7 +109,7 @@ public class PrinterCoverService extends Service {
107
109
  String res = printer.CheckPrinterStatus();
108
110
  Log.i(TAG, res);
109
111
  String result = printer.PrintDocumentHeader();
110
- Log.i(TAG, saleItems.toString());
112
+ Log.i(TAG, result + saleItems);
111
113
 
112
114
  String str = printer.PrintJSONDocumentDeptOnly(saleItems.toString());
113
115
 
@@ -123,7 +125,7 @@ public class PrinterCoverService extends Service {
123
125
  }
124
126
  String creditPayment = "0";
125
127
  if(totalCreditPayment > 0.0) {
126
- creditPayment = printer.GetEFTAuthorisation(totalCreditPayment, 0, "");
128
+ creditPayment = printer.GetEFTAuthorisation(totalCreditPayment, 1, "");
127
129
  }
128
130
 
129
131
  if(creditPayment.startsWith("0")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-hugin-gmp3",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "Hugin plugin for TCP/IP",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",