Skip to content

Commit

Permalink
[-] Fixed error with error 0x80 processing
Browse files Browse the repository at this point in the history
  • Loading branch information
VitalyKravtsov2016 committed Jun 6, 2023
1 parent 2385e2e commit 4f585e3
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 12 deletions.
7 changes: 7 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
Company : SHTRIH-M www.shtrih-m.ru (495) 787-6090
Url : https://github.com/shtrih-m/javapos_shtrih

********************************************************************************

06.06.2023
deviceServiceVersion = 1013698

[-] Fixed error with error 0x80 processing

********************************************************************************

05.06.2023
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ public void deviceExecute(PrinterCommand command) throws Exception {
}
device.send(command);
resultCode = command.getResultCode();

} catch (ClosedConnectionException e) {
if (!command.getIsRepeatable()) {
throw new DeviceException(PrinterConst.SMFPTR_E_NOCONNECTION, e.getMessage());
Expand All @@ -262,7 +261,6 @@ public void deviceExecute(PrinterCommand command) throws Exception {
Thread.sleep(3000);
}
commandSucceeded(command);
afterCommand(command);
} else {
if (command.getCode() != 0x6B) {
if (capLastErrorText) {
Expand All @@ -279,6 +277,7 @@ public void deviceExecute(PrinterCommand command) throws Exception {
logger.error(text + ", " + command.getParametersText(commands));
}
}
afterCommand(command);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.shtrih.barcode.PrinterBarcode;
import com.shtrih.fiscalprinter.FontNumber;
import com.shtrih.fiscalprinter.SMFiscalPrinter;
import com.shtrih.fiscalprinter.command.PrinterConst;
import static com.shtrih.fiscalprinter.command.TextDocumentFilter.quantityToStr;
import com.shtrih.fiscalprinter.skl.FileSKLStorage;
import com.shtrih.fiscalprinter.skl.SKLStorage;
Expand Down Expand Up @@ -68,15 +69,17 @@ public void visitSalesReceipt(Object element)
for (int i = 0; i < receipt.items.size(); i++) {
process((Object) receipt.items.get(i));
}

/*
if (receipt.discounts.getTotal() > 0)
{
add(STotalText, summToStr(receipt.getSubtotal()));
// ОКРУГЛЕНИЕ
//add(SRoundingText, summToStr(command.getDiscount()));
add(PrinterConst.STotalText, summToStr(receipt.getSubtotal()));
/*
if (receipt.isRounded()){
add(PrinterConst.SRoundingText, summToStr(receipt.getRounding()));
}
*/
}
add(SReceiptTotal, summToStr(receipt.getTotal()));
//add(PrinterConst.SReceiptTotal, summToStr(receipt.getTotal()));
/*
receipt.getPaymentAmount()
long[] payments = params.getPayments();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class FSSalesReceipt extends CustomReceipt implements FiscalReceipt {
private String voidDescription = "";
public Vector<Object> items = new Vector<Object>();
private final Vector endingItems = new Vector();
//private final List<ReceiptPayment> payments = new ArrayList<>(ReceiptPayment); // payment amounts
private final long[] payments = new long[16]; // payment amounts
public final FSDiscounts discounts = new FSDiscounts();
private Vector<String> messages = new Vector<String>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package com.shtrih.util;

public class ServiceVersion {
public static final String VERSION = "696-2-gc646619";
public static final String VERSION = "697";
}
6 changes: 3 additions & 3 deletions Source/FiscalPrinterTest/Res/jpos.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<!-- ProtocolType, 0 - protocol 1, 1 - protocol 2 -->
<prop name="protocolType" type="String" value="1"/>
<!-- Port type: 0 - serial, 1 - bluetooth, 2 - socket, 3 - from parameter protClass, 5 - PPP over serial -->
<prop name="portType" type="String" value="2"/>
<prop name="portType" type="String" value="0"/>
<!--Port name-->
<!--For serial ports - COM1, for TCP ports: host:port - "10.11.7.210:12345" -->
<!--<prop name="portName" type="String" value="10.11.7.210:12345"/> -->
Expand All @@ -31,8 +31,8 @@
<!--<prop name="portName" type="String" value="192.168.137.111:7778"/>-->
<!--<prop name="portName" type="String" value="192.168.1.134:12345"/>-->

<prop name="portName" type="String" value="192.168.4.1:7778"/>
<!--<prop name="portName" type="String" value="COM4"/> -->
<!--<prop name="portName" type="String" value="192.168.4.1:7778"/>-->
<prop name="portName" type="String" value="COM4"/>

<prop name="baudRate" type="String" value="115200"/>
<!--Default department-->
Expand Down

0 comments on commit 4f585e3

Please sign in to comment.