Skip to content

Commit

Permalink
[-] Fixed error with printing before receipt ending
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaly Kravtsov committed Sep 6, 2023
1 parent c25648f commit eb08740
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 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.09.2023
deviceServiceVersion = 1013702

[-] Fixed error with printing before receipt ending

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

29.08.2023
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

public abstract class CustomReceipt implements FiscalReceipt {

protected boolean ending = false;
protected boolean cancelled = false;
private final SMFiscalPrinter printer;
private static CompositeLogger logger = CompositeLogger.getLogger(CustomReceipt.class);
Expand Down Expand Up @@ -120,7 +121,7 @@ public boolean isCancelled() {
}

public boolean isEnding() throws Exception{
return isPayed() || isCancelled();
return ending;
}

public void notSupported() throws Exception {
Expand All @@ -129,6 +130,7 @@ public void notSupported() throws Exception {
}

public void beginFiscalReceipt(boolean printHeader) throws Exception {
ending = false;
cancelled = false;
}

Expand Down Expand Up @@ -171,6 +173,7 @@ public void printRecTotal(long total, long payment, long payType,

public void printRecVoid(String description) throws Exception {
cancelled = true;
ending = true;
}

public void printRecVoidItem(String description, long amount, double quantity,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,10 @@ public void printRecTotal(long total, long payment, long payType,
checkTotal(getSubtotal(), total);
addPayment(payment, payType);
clearPrePostLine();

if (isPayed()){
ending = true;
}
}

public void printRecItemVoid(String description, long price, double quantity,
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 = "700";
public static final String VERSION = "701";
}
1 change: 1 addition & 0 deletions Source/FiscalPrinterTest/src/PrinterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -3981,6 +3981,7 @@ public void printFiscalReceipt145_7()
printer.resetPrinter();
printer.setFiscalReceiptType(SmFptrConst.SMFPTR_RT_SALE);
printer.beginFiscalReceipt(false);
printer.printRecMessage("printRecMessage 1");
printer.fsWriteTag(1008, "foo@example.com");

TLVWriter tlvWriter = new TLVWriter();
Expand Down

0 comments on commit eb08740

Please sign in to comment.