UOCL-315: variable name refactor
This commit is contained in:
@@ -55,27 +55,27 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
|
||||
private static final DateFormat m_dateformat = new SimpleDateFormat("hh:mm");
|
||||
|
||||
private String m_sHost;
|
||||
private String m_sId;
|
||||
private int tickettype;
|
||||
private int m_iTicketId;
|
||||
private int m_iPickupId;
|
||||
private java.util.Date m_dDate;
|
||||
private String host;
|
||||
private String id;
|
||||
private int ticketType;
|
||||
private int ticketId;
|
||||
private int pickupId;
|
||||
private java.util.Date date;
|
||||
private Properties attributes;
|
||||
private UserInfo m_User;
|
||||
private UserInfo userInfo;
|
||||
private Double multiply;
|
||||
private CustomerInfoExt m_Customer;
|
||||
private String m_sActiveCash;
|
||||
private List<TicketLineInfo> m_aLines;
|
||||
private CustomerInfoExt cutomerInfoExt;
|
||||
private String activeCash;
|
||||
private List<TicketLineInfo> ticketLines;
|
||||
private List<PaymentInfo> payments;
|
||||
private List<TicketTaxInfo> taxes;
|
||||
private final String m_sResponse;
|
||||
private String loyaltyCardNumber;
|
||||
private Boolean oldTicket;
|
||||
private boolean tip;
|
||||
private PaymentInfoTicket m_paymentInfo;
|
||||
private boolean m_isProcessed;
|
||||
private final String m_locked;
|
||||
private PaymentInfoTicket ticketPaymentInfo;
|
||||
private boolean isProcessed;
|
||||
private final String locked;
|
||||
private Double nsum;
|
||||
private int ticketstatus;
|
||||
|
||||
@@ -91,15 +91,15 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
|
||||
/** Creates new TicketModel */
|
||||
public TicketInfo() {
|
||||
m_sId = UUID.randomUUID().toString();
|
||||
tickettype = RECEIPT_NORMAL;
|
||||
m_iTicketId = 0; // incrementamos
|
||||
m_dDate = new Date();
|
||||
id = UUID.randomUUID().toString();
|
||||
ticketType = RECEIPT_NORMAL;
|
||||
ticketId = 0; // incrementamos
|
||||
date = new Date();
|
||||
attributes = new Properties();
|
||||
m_User = null;
|
||||
m_Customer = null;
|
||||
m_sActiveCash = null;
|
||||
m_aLines = new ArrayList<>();
|
||||
userInfo = null;
|
||||
cutomerInfoExt = null;
|
||||
activeCash = null;
|
||||
ticketLines = new ArrayList<>();
|
||||
payments = new ArrayList<>();
|
||||
taxes = null;
|
||||
m_sResponse = null;
|
||||
@@ -109,35 +109,35 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
System.getProperty("user.home")), AppLocal.APP_ID + ".properties"));
|
||||
config.load();
|
||||
tip = Boolean.valueOf(config.getProperty("machine.showTip"));
|
||||
m_isProcessed = false;
|
||||
m_locked = null;
|
||||
isProcessed = false;
|
||||
locked = null;
|
||||
ticketstatus = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeExternal(ObjectOutput out) throws IOException {
|
||||
out.writeObject(m_sId);
|
||||
out.writeInt(tickettype);
|
||||
out.writeInt(m_iTicketId);
|
||||
out.writeObject(m_Customer);
|
||||
out.writeObject(m_dDate);
|
||||
out.writeObject(id);
|
||||
out.writeInt(ticketType);
|
||||
out.writeInt(ticketId);
|
||||
out.writeObject(cutomerInfoExt);
|
||||
out.writeObject(date);
|
||||
out.writeObject(attributes);
|
||||
out.writeObject(m_aLines);
|
||||
out.writeObject(ticketLines);
|
||||
|
||||
out.writeInt(ticketstatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
|
||||
m_sId = (String) in.readObject();
|
||||
tickettype = in.readInt();
|
||||
m_iTicketId = in.readInt();
|
||||
m_Customer = (CustomerInfoExt) in.readObject();
|
||||
m_dDate = (Date) in.readObject();
|
||||
id = (String) in.readObject();
|
||||
ticketType = in.readInt();
|
||||
ticketId = in.readInt();
|
||||
cutomerInfoExt = (CustomerInfoExt) in.readObject();
|
||||
date = (Date) in.readObject();
|
||||
attributes = (Properties) in.readObject();
|
||||
m_aLines = (List<TicketLineInfo>) in.readObject();
|
||||
m_User = null;
|
||||
m_sActiveCash = null;
|
||||
ticketLines = (List<TicketLineInfo>) in.readObject();
|
||||
userInfo = null;
|
||||
activeCash = null;
|
||||
payments = new ArrayList<>(); // JG June 2102 diamond inference
|
||||
taxes = null;
|
||||
|
||||
@@ -151,11 +151,11 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
*/
|
||||
@Override
|
||||
public void readValues(DataRead dr) throws BasicException {
|
||||
m_sId = dr.getString(1);
|
||||
tickettype = dr.getInt(2);
|
||||
m_iTicketId = dr.getInt(3);
|
||||
m_dDate = dr.getTimestamp(4);
|
||||
m_sActiveCash = dr.getString(5);
|
||||
id = dr.getString(1);
|
||||
ticketType = dr.getInt(2);
|
||||
ticketId = dr.getInt(3);
|
||||
date = dr.getTimestamp(4);
|
||||
activeCash = dr.getString(5);
|
||||
try {
|
||||
byte[] img = dr.getBytes(6);
|
||||
if (img != null) {
|
||||
@@ -163,9 +163,9 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
}
|
||||
} catch (IOException e) {
|
||||
}
|
||||
m_User = new UserInfo(dr.getString(7), dr.getString(8));
|
||||
m_Customer = new CustomerInfoExt(dr.getString(9));
|
||||
m_aLines = new ArrayList<>();
|
||||
userInfo = new UserInfo(dr.getString(7), dr.getString(8));
|
||||
cutomerInfoExt = new CustomerInfoExt(dr.getString(9));
|
||||
ticketLines = new ArrayList<>();
|
||||
payments = new ArrayList<>();
|
||||
taxes = null;
|
||||
|
||||
@@ -177,52 +177,52 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
* @return
|
||||
*/
|
||||
public TicketInfo copyTicket() {
|
||||
TicketInfo t = new TicketInfo();
|
||||
TicketInfo ticketInfo = new TicketInfo();
|
||||
|
||||
t.tickettype = tickettype;
|
||||
t.m_iTicketId = m_iTicketId;
|
||||
t.m_dDate = m_dDate;
|
||||
t.m_sActiveCash = m_sActiveCash;
|
||||
t.attributes = (Properties) attributes.clone();
|
||||
t.m_User = m_User;
|
||||
t.m_Customer = m_Customer;
|
||||
ticketInfo.ticketType = ticketType;
|
||||
ticketInfo.ticketId = ticketId;
|
||||
ticketInfo.date = date;
|
||||
ticketInfo.activeCash = activeCash;
|
||||
ticketInfo.attributes = (Properties) attributes.clone();
|
||||
ticketInfo.userInfo = userInfo;
|
||||
ticketInfo.cutomerInfoExt = cutomerInfoExt;
|
||||
|
||||
t.m_aLines = new ArrayList<>(); // JG June 2102 diamond inference
|
||||
m_aLines.forEach((l) -> {
|
||||
t.m_aLines.add(l.copyTicketLine());
|
||||
ticketInfo.ticketLines = new ArrayList<>(); // JG June 2102 diamond inference
|
||||
ticketLines.forEach((line) -> {
|
||||
ticketInfo.ticketLines.add(line.copyTicketLine());
|
||||
});
|
||||
t.refreshLines();
|
||||
ticketInfo.refreshLines();
|
||||
|
||||
t.payments = new LinkedList<>(); // JG June 2102 diamond inference
|
||||
ticketInfo.payments = new LinkedList<>(); // JG June 2102 diamond inference
|
||||
payments.forEach((p) -> {
|
||||
t.payments.add(p.copyPayment());
|
||||
ticketInfo.payments.add(p.copyPayment());
|
||||
});
|
||||
t.oldTicket = oldTicket;
|
||||
ticketInfo.oldTicket = oldTicket;
|
||||
// taxes are not copied, must be calculated again.
|
||||
|
||||
t.ticketstatus = ticketstatus;
|
||||
ticketInfo.ticketstatus = ticketstatus;
|
||||
|
||||
return t;
|
||||
return ticketInfo;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return m_sId;
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getTicketType() {
|
||||
return tickettype;
|
||||
return ticketType;
|
||||
}
|
||||
|
||||
public void setTicketType(int tickettype) {
|
||||
this.tickettype = tickettype;
|
||||
this.ticketType = tickettype;
|
||||
}
|
||||
|
||||
public int getTicketId() {
|
||||
return m_iTicketId;
|
||||
return ticketId;
|
||||
}
|
||||
|
||||
public void setTicketId(int iTicketId) {
|
||||
m_iTicketId = iTicketId;
|
||||
ticketId = iTicketId;
|
||||
}
|
||||
|
||||
public int getTicketStatus() {
|
||||
@@ -230,19 +230,19 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
}
|
||||
|
||||
public void setTicketStatus(int ticketstatus) {
|
||||
if (m_iTicketId > 0) {
|
||||
this.ticketstatus = m_iTicketId;
|
||||
if (ticketId > 0) {
|
||||
this.ticketstatus = ticketId;
|
||||
} else {
|
||||
this.ticketstatus = ticketstatus;
|
||||
}
|
||||
}
|
||||
|
||||
public void setPickupId(int iTicketId) {
|
||||
m_iPickupId = iTicketId;
|
||||
pickupId = iTicketId;
|
||||
}
|
||||
|
||||
public int getPickupId() {
|
||||
return m_iPickupId;
|
||||
return pickupId;
|
||||
}
|
||||
|
||||
public String getName(Object info) {
|
||||
@@ -254,23 +254,23 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
name.add(nameprop);
|
||||
}
|
||||
|
||||
if (m_User != null) {
|
||||
name.add(m_User.getName());
|
||||
if (userInfo != null) {
|
||||
name.add(userInfo.getName());
|
||||
}
|
||||
|
||||
if (info == null) {
|
||||
if (m_iTicketId == 0) {
|
||||
name.add("(" + m_dateformat.format(m_dDate) + " "
|
||||
+ Long.toString(m_dDate.getTime() % 1000) + ")");
|
||||
if (ticketId == 0) {
|
||||
name.add("(" + m_dateformat.format(date) + " "
|
||||
+ Long.toString(date.getTime() % 1000) + ")");
|
||||
} else {
|
||||
name.add(Integer.toString(m_iTicketId));
|
||||
name.add(Integer.toString(ticketId));
|
||||
}
|
||||
} else {
|
||||
name.add(info.toString());
|
||||
}
|
||||
|
||||
if (m_Customer != null) {
|
||||
name.add(m_Customer.getName());
|
||||
if (cutomerInfoExt != null) {
|
||||
name.add(cutomerInfoExt.getName());
|
||||
}
|
||||
|
||||
return org.apache.commons.lang.StringUtils.join(name, " - ");
|
||||
@@ -281,11 +281,11 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
}
|
||||
|
||||
public java.util.Date getDate() {
|
||||
return m_dDate;
|
||||
return date;
|
||||
}
|
||||
|
||||
public void setDate(java.util.Date dDate) {
|
||||
m_dDate = dDate;
|
||||
date = dDate;
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
@@ -297,27 +297,27 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
return machineHostname;
|
||||
}
|
||||
|
||||
public UserInfo getUser() {
|
||||
return m_User;
|
||||
public UserInfo getUserInfo() {
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
public void setUser(UserInfo value) {
|
||||
m_User = value;
|
||||
public void setUserInfo(UserInfo value) {
|
||||
userInfo = value;
|
||||
}
|
||||
|
||||
public CustomerInfoExt getCustomer() {
|
||||
return m_Customer;
|
||||
return cutomerInfoExt;
|
||||
}
|
||||
|
||||
public void setCustomer(CustomerInfoExt value) {
|
||||
m_Customer = value;
|
||||
cutomerInfoExt = value;
|
||||
}
|
||||
|
||||
public String getCustomerId() {
|
||||
if (m_Customer == null) {
|
||||
if (cutomerInfoExt == null) {
|
||||
return null;
|
||||
} else {
|
||||
return m_Customer.getId();
|
||||
return cutomerInfoExt.getId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,11 +334,11 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
}
|
||||
|
||||
public void setActiveCash(String value) {
|
||||
m_sActiveCash = value;
|
||||
activeCash = value;
|
||||
}
|
||||
|
||||
public String getActiveCash() {
|
||||
return m_sActiveCash;
|
||||
return activeCash;
|
||||
}
|
||||
|
||||
public String getProperty(String key) {
|
||||
@@ -358,45 +358,45 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
}
|
||||
|
||||
public TicketLineInfo getLine(int index) {
|
||||
return m_aLines.get(index);
|
||||
return ticketLines.get(index);
|
||||
}
|
||||
|
||||
public void addLine(TicketLineInfo oLine) {
|
||||
oLine.setTicket(m_sId, m_aLines.size());
|
||||
m_aLines.add(oLine);
|
||||
oLine.setTicket(id, ticketLines.size());
|
||||
ticketLines.add(oLine);
|
||||
}
|
||||
|
||||
public void insertLine(int index, TicketLineInfo oLine) {
|
||||
m_aLines.add(index, oLine);
|
||||
ticketLines.add(index, oLine);
|
||||
refreshLines();
|
||||
}
|
||||
|
||||
public void setLine(int index, TicketLineInfo oLine) {
|
||||
oLine.setTicket(m_sId, index);
|
||||
m_aLines.set(index, oLine);
|
||||
oLine.setTicket(id, index);
|
||||
ticketLines.set(index, oLine);
|
||||
}
|
||||
|
||||
public void removeLine(int index) {
|
||||
m_aLines.remove(index);
|
||||
ticketLines.remove(index);
|
||||
refreshLines();
|
||||
|
||||
}
|
||||
|
||||
public void refreshLines() {
|
||||
for (int i = 0; i < m_aLines.size(); i++) {
|
||||
getLine(i).setTicket(m_sId, i);
|
||||
for (int i = 0; i < ticketLines.size(); i++) {
|
||||
getLine(i).setTicket(id, i);
|
||||
}
|
||||
}
|
||||
|
||||
public int getLinesCount() {
|
||||
return m_aLines.size();
|
||||
return ticketLines.size();
|
||||
}
|
||||
|
||||
public double getArticlesCount() {
|
||||
double dArticles = 0.0;
|
||||
TicketLineInfo oLine;
|
||||
|
||||
for (Iterator<TicketLineInfo> i = m_aLines.iterator(); i.hasNext();) {
|
||||
for (Iterator<TicketLineInfo> i = ticketLines.iterator(); i.hasNext();) {
|
||||
oLine = i.next();
|
||||
dArticles += oLine.getMultiply();
|
||||
}
|
||||
@@ -406,7 +406,8 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
|
||||
public double getSubTotal() {
|
||||
double sum = 0.0;
|
||||
sum = m_aLines.stream().map((line) -> line.getSubValue()).reduce(sum, (accumulator, _item) -> accumulator + _item);
|
||||
sum = ticketLines.stream().map((line) -> line.getSubValue()).reduce(sum,
|
||||
(accumulator, _item) -> accumulator + _item);
|
||||
return sum;
|
||||
}
|
||||
|
||||
@@ -419,7 +420,7 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
nsum = sum;
|
||||
}
|
||||
} else {
|
||||
sum = m_aLines.stream().map((line) -> line.getTax()).reduce(sum, (accumulator, _item) -> accumulator + _item);
|
||||
sum = ticketLines.stream().map((line) -> line.getTax()).reduce(sum, (accumulator, _item) -> accumulator + _item);
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
@@ -446,11 +447,11 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
}
|
||||
|
||||
public List<TicketLineInfo> getLines() {
|
||||
return m_aLines;
|
||||
return ticketLines;
|
||||
}
|
||||
|
||||
public void setLines(List<TicketLineInfo> l) {
|
||||
m_aLines = l;
|
||||
ticketLines = l;
|
||||
}
|
||||
|
||||
public List<PaymentInfo> getPayments() {
|
||||
@@ -490,7 +491,7 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
}
|
||||
|
||||
public void setIsProcessed(boolean isP) {
|
||||
m_isProcessed = isP;
|
||||
isProcessed = isP;
|
||||
}
|
||||
|
||||
public TicketTaxInfo getTaxLine(TaxInfo tax) {
|
||||
@@ -509,7 +510,7 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
Map<String, TicketTaxInfo> m = new HashMap<>();
|
||||
|
||||
TicketLineInfo oLine;
|
||||
for (Iterator<TicketLineInfo> i = m_aLines.iterator(); i.hasNext();) {
|
||||
for (Iterator<TicketLineInfo> i = ticketLines.iterator(); i.hasNext();) {
|
||||
oLine = i.next();
|
||||
|
||||
TicketTaxInfo t = m.get(oLine.getTaxInfo().getId());
|
||||
@@ -535,8 +536,8 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
|
||||
m_config = null;
|
||||
|
||||
if (m_iTicketId > 0) {
|
||||
String tmpTicketId = Integer.toString(m_iTicketId);
|
||||
if (ticketId > 0) {
|
||||
String tmpTicketId = Integer.toString(ticketId);
|
||||
if (receiptSize == null || (Integer.parseInt(receiptSize) <= tmpTicketId.length())) {
|
||||
if (receiptPrefix != null) {
|
||||
tmpTicketId = receiptPrefix + tmpTicketId;
|
||||
@@ -556,16 +557,16 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
}
|
||||
|
||||
public String printDate() {
|
||||
return Formats.TIMESTAMP.formatValue(m_dDate);
|
||||
return Formats.TIMESTAMP.formatValue(date);
|
||||
}
|
||||
|
||||
public String printUser() {
|
||||
return m_User == null ? "" : m_User.getName();
|
||||
return userInfo == null ? "" : userInfo.getName();
|
||||
|
||||
}
|
||||
|
||||
public String printHost() {
|
||||
return m_sHost;
|
||||
return host;
|
||||
}
|
||||
|
||||
// Added JDL 28.05.13 for loyalty card functions
|
||||
@@ -594,11 +595,11 @@ public final class TicketInfo implements SerializableRead, Externalizable {
|
||||
}
|
||||
|
||||
public String printCustomer() {
|
||||
return m_Customer == null ? "" : m_Customer.getName();
|
||||
return cutomerInfoExt == null ? "" : cutomerInfoExt.getName();
|
||||
}
|
||||
|
||||
public String printPhone1() {
|
||||
return m_Customer == null ? "" : m_Customer.getPhone1();
|
||||
return cutomerInfoExt == null ? "" : cutomerInfoExt.getPhone1();
|
||||
}
|
||||
|
||||
public String printArticlesCount() {
|
||||
|
||||
Reference in New Issue
Block a user