File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
core/src/main/java/io/snabble/sdk/codes Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,18 @@ public class EAN13 extends ScannableCode implements Serializable {
5757 } else if (isEmbeddedDataOk ()) {
5858 lookupCode = code .substring (0 , 6 ) + "0000000" ;
5959 embeddedData = Integer .parseInt (code .substring (7 , 12 ));
60+
61+ if (hasUnitData && embeddedData == 0 ) {
62+ embeddedData = 1 ;
63+
64+ StringBuilder stringBuilder = new StringBuilder ();
65+ stringBuilder .append (code .substring (0 , code .length () - 2 ));
66+ stringBuilder .append ("1" );
67+ stringBuilder .replace (6 , 7 , String .valueOf (internalChecksum (stringBuilder .toString ())));
68+ stringBuilder .append (String .valueOf (checksum (stringBuilder .toString ())));
69+
70+ this .code = stringBuilder .toString ();
71+ }
6072 } else {
6173 lookupCode = code ;
6274 hasWeighData = false ;
You can’t perform that action at this time.
0 commit comments