Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Revisions: Issue #41270 Back to Issue ]
Summary 0041270: Copy Store Process are copying the same POS Terminal Type Name as the Original Store copied.
Revision 2019-07-12 13:51 by samuel_nicuesa
Steps To Reproduce [BO]

 - > Execute Copy Store process Using the following information.
See attached images

     Original Store -> Vall Blanca Store
     Original Pos Terminal Type -> VBS POS Terminal Type
 
     New store -> 31400
     New Pos Terminal Type -> VBS POS Terminal Type (The same as the original)

It is happening because more than one terminal is using the same pos terminal type.
When pos terminal types are copied these code is being executed :


public void copyTerminalTypes(TerminalType originalType, BaseOBObject newObject) {
    MutableBoolean isNew = new MutableBoolean(false);
    TerminalType selectedType = (TerminalType) getObjectInTree(originalType, isNew);
    String terminalTypeName = originalType.getName();
    if (isNew.booleanValue()) {
      if (terminalTypeName.contains(originalTerminal.getName())) {
        terminalTypeName = terminalTypeName.replace(originalTerminal.getName(),
            newObject.get("name").toString());
      } else {
        terminalTypeName += "-" + newObject.get("name");
      }
    }
    selectedType.setName(terminalTypeName);
    newObject.set("obposTerminaltype", selectedType);
    if (isNew.booleanValue()) {
      copyPaymentMethods(originalType, selectedType);
    }
  }

In the first execution if (isNew.booleanValue()) { is TRUE and the pos terminal type is copied fine using :

1) Replace
or
2)terminalTypeName += "-" + newObject.get("name");

In the second execution, this terminal type is not new because it is used by more than 1 terminal and
if (isNew.booleanValue()) is FALSE.
The new terminal types created are overwritten by the original Pos Terminal Type :

 -> String terminalTypeName = originalType.getName();

 -> selectedType.setName(terminalTypeName);
Revision 2019-07-12 10:54 by samuel_nicuesa
Description Copy Store Process are copying the same POS Terminal Type Name as the Original Store copied.
It is happening because more than 1 Terminal is associated to the same Terminal Type.
Revision 2019-07-12 10:46 by samuel_nicuesa
Steps To Reproduce [BO]

 - > Execute Copy Store process Using the following information.
See attached images

     Original Store -> Vall Blanca Store
     Original Pos Terminal Type -> VBS POS Terminal Type
 
     New store -> 31400
     New Pos Terminal Type -> VBS POS Terminal Type (The same as the original)

It is happening because more than one terminal is using the same pos terminal type.
When pos terminal types are copied these code is being executed :


public void copyTerminalTypes(TerminalType originalType, BaseOBObject newObject) {
    MutableBoolean isNew = new MutableBoolean(false);
    TerminalType selectedType = (TerminalType) getObjectInTree(originalType, isNew);
    String terminalTypeName = originalType.getName();
    if (isNew.booleanValue()) {
      if (terminalTypeName.contains(originalTerminal.getName())) {
        terminalTypeName = terminalTypeName.replace(originalTerminal.getName(),
            newObject.get("name").toString());
      } else {
        terminalTypeName += "-" + newObject.get("name");
      }
    }
    selectedType.setName(terminalTypeName);
    newObject.set("obposTerminaltype", selectedType);
    System.out.println("CopyTerminalTypes: "+"Original Terminal Type: "+terminalTypeName+" NewObject: "+newObject);
    if (isNew.booleanValue()) {
      copyPaymentMethods(originalType, selectedType);
    }
  }

In the first execution if (isNew.booleanValue()) { is TRUE and the pos terminal type is copied fine using :

1) Replace
or
2)terminalTypeName += "-" + newObject.get("name");

In the second execution, this terminal type is not new because it is used by more than 1 terminal and
if (isNew.booleanValue()) is FALSE.
The new terminal types created are overwritten by the original Pos Terminal Type :

 -> String terminalTypeName = originalType.getName();

 -> selectedType.setName(terminalTypeName);
Revision 2019-07-12 10:46 by samuel_nicuesa
Description Copy Store Process are copying the same POS Terminal Type as the Original Store copied.
It is happening because more than 1 Terminal is associated to the same Terminal Type.
Revision 2019-07-04 09:59 by samuel_nicuesa
Steps To Reproduce [BO]

 - > Execute Copy Store process

 - > Original Store > POS Terminal Type = 715161516

 - > POS Terminal Type of all new Terminals created have the same Terminal Type as the original store > 715161516

I think the problem is happening when isNew = false because the Terminal Type will be originalType.getName().

I cannot reproduce the problem in PI environment but if isNew = false this problem happens.



public void copyTerminalTypes(TerminalType originalType, BaseOBObject newObject) {
    MutableBoolean isNew = new MutableBoolean(false);
    TerminalType selectedType = (TerminalType) getObjectInTree(originalType, isNew);
    String terminalTypeName = originalType.getName();
    if (isNew.booleanValue()) {
      if (terminalTypeName.contains(originalTerminal.getName())) {
        terminalTypeName = terminalTypeName.replace(originalTerminal.getName(),
            newObject.get("name").toString());
      } else {
        terminalTypeName += "-" + newObject.get("name");
      }
    }
    selectedType.setName(terminalTypeName);
    newObject.set("obposTerminaltype", selectedType);
    System.out.println("CopyTerminalTypes: "+"Original Terminal Type: "+terminalTypeName+" NewObject: "+newObject);
    if (isNew.booleanValue()) {
      copyPaymentMethods(originalType, selectedType);
    }
  }

Could you check if the code is not correct in this part of the code?
Revision 2019-07-04 09:59 by samuel_nicuesa
Description In some cincumstances, the Copy Store Process are copying the same POS Terminal Type as the Original Store copied so several stores can have the same POS Terminal Type for different pos terminals


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker