Skip to content

Commit

Permalink
[-] Added result check for operation tags
Browse files Browse the repository at this point in the history
[-] Changed defaut value of parameter tagsBeforeItem to false
  • Loading branch information
Vitaly Kravtsov committed Feb 11, 2022
1 parent 15b5870 commit a200166
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 190 deletions.
8 changes: 8 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
Company : SHTRIH-M www.shtrih-m.ru (495) 787-6090
Url : https://github.com/shtrih-m/javapos_shtrih

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

11.02.2022
deviceServiceVersion = 1013642

[-] Added result check for operation tags
[-] Changed defaut value of parameter tagsBeforeItem to false

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

03.02.2022
Expand Down
177 changes: 0 additions & 177 deletions Source/Core/src/com/shtrih/fiscalprinter/port/PPPPort.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public class FptrParameters {
public int markingType = SmFptrConst.MARKING_TYPE_PRINTER;
public int validTimeDiffInSecs = 0;
public String quantityFormat = "0.000";
public boolean tagsBeforeItem = true;
public boolean tagsBeforeItem = false;
public HashMap<Integer, Integer> commandTimeouts = new HashMap<Integer, Integer>();
public String pppConfigFile = "";
public boolean pppStartService = true;
Expand Down Expand Up @@ -444,7 +444,7 @@ public void load(JposEntry entry) throws Exception {
markingType = reader.readInteger("markingType", SmFptrConst.MARKING_TYPE_PRINTER);
validTimeDiffInSecs = reader.readInteger("validTimeDiffInSecs", 0);
quantityFormat = reader.readString("QuantityFormat", "0.000");
tagsBeforeItem = reader.readBoolean("tagsBeforeItem", true);
tagsBeforeItem = reader.readBoolean("tagsBeforeItem", false);
pppConfigFile = reader.readString("pppConfigFile", "");
pppStartService = reader.readBoolean("pppStartService", true);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,7 @@ public void printFSSaleNoTemplate(FSSaleReceiptItem item) throws Exception {
public void writeOperationTLV(FSSaleReceiptItem item) throws Exception {
for (int i = 0; i < item.getTags().size(); i++) {
FSTLVItem tag = (FSTLVItem) item.getTags().get(i);
//getDevice().check(getDevice().fsWriteOperationTLV(tag.getData()));
getDevice().fsWriteOperationTLV(tag.getData());
getDevice().check(getDevice().fsWriteOperationTLV(tag.getData()));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ public static PrinterPort createInstance(FptrParameters params)
result = SocketPort.getInstance(params.portName, params.getByteTimeout());
break;

/*
case SmFptrConst.PORT_TYPE_PPP:
result = new PPPPort(params);
break;
*/

case SmFptrConst.PORT_TYPE_FROMCLASS:
Class portClass = Class.forName(params.portClass);
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 = "641-3-g959c0e5";
public static final String VERSION = "641-4-g15b5870";
}
12 changes: 6 additions & 6 deletions Source/FiscalPrinterTest/Res/jpos.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@
<!--<prop name="portClass" type="String" value="com.shtrih.bluetooth.BTPrinterPort"/>-->
<!--Other non JavaPOS required property (mostly vendor properties and bus specific properties i.e. RS232 )-->
<!-- ProtocolType, 0 - protocol 1, 1 - protocol 2 -->
<prop name="protocolType" type="String" value="0"/>
<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="5"/>
<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"/> -->
<!--<prop name="portName" type="String" value="COM2"/> -->
<!-- <prop name="portName" type="String" value="COM8"/> -->
<!--Baudrate 2400;4800;9600;19200;38400;57600;115200;230400;460800 -->
<!--<prop name="portName" type="String" value="192.168.137.111:7778"/>-->
<prop name="portName" type="String" value="COM7"/>
<prop name="portName" type="String" value="COM3"/>
<prop name="baudRate" type="String" value="115200"/>
<!--Default department-->
<prop name="department" type="String" value="0"/>
Expand Down Expand Up @@ -101,15 +101,15 @@
<!-- Cut mode, 0 - auto, 1 - disabled -->
<prop name="cutMode" type="String" value="0"/>
<!-- maxEnqNumber -->
<prop name="maxEnqNumber" type="String" value="100"/>
<prop name="maxEnqNumber" type="String" value="3"/>
<!-- maxNakCommandNumber -->
<prop name="maxNakCommandNumber" type="String" value="100"/>
<prop name="maxNakCommandNumber" type="String" value="3"/>
<!-- maxNakAnswerNumber -->
<prop name="maxNakAnswerNumber" type="String" value="3"/>
<!-- maxAckNumber -->
<prop name="maxAckNumber" type="String" value="3"/>
<!-- maxRepeatCount -->
<prop name="maxRepeatCount" type="String" value="100"/>
<prop name="maxRepeatCount" type="String" value="3"/>
<!-- Payment types -->
<!-- Payment types -->
<prop name="payType0" type="String" value="0"/>
Expand Down
4 changes: 2 additions & 2 deletions Source/FiscalPrinterTest/src/PrinterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -4583,12 +4583,12 @@ public void printFiscalReceiptWithSupplier() {
printer.fsWriteOperationTag(1224, writer.getBytes());
printer.fsWriteOperationTag(1226, "5448100656");
printer.setParameter(SmFptrConst.SMFPTR_DIO_PARAM_ITEM_SUBJECT_TYPE, 4);
printer.printRecItem("Товар 1", 100, 1000000, 1, 100, "0");
printer.printRecItem("Товар 1", 1, 1000000, 1, 1, "0");

printer.fsWriteOperationTag(1224, writer.getBytes());
printer.fsWriteOperationTag(1226, "5448100656");
printer.setParameter(SmFptrConst.SMFPTR_DIO_PARAM_ITEM_SUBJECT_TYPE, 4);
printer.printRecItem("Товар 2", 100, 1000000, 1, 100, "0");
printer.printRecItem("Товар 2", 1, 1000000, 1, 1, "0");

printer.printRecTotal(1000, 1000, "1");
printer.endFiscalReceipt(false);
Expand Down

0 comments on commit a200166

Please sign in to comment.