Skip to content

Commit

Permalink
App: merger remote printer permission
Browse files Browse the repository at this point in the history
* kitchen and remote printer
  • Loading branch information
poolborges committed May 5, 2023
1 parent fc4f3d7 commit 3c19b79
Showing 1 changed file with 24 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -414,47 +414,43 @@ public void setActiveTicket(TicketInfo ticketInfo, String oTicketExt) {
m_oTicket.setUser(m_App.getAppUserView().getUser().getUserInfo());
m_oTicket.setActiveCash(m_App.getActiveCashIndex());
m_oTicket.setDate(new Date());
}

if (isRestaurantMode()) {
if (isAutoLogoutRestaurant()) {
if (listener != null) {
listener.restart();
if (isRestaurantMode()) {
if (isAutoLogoutRestaurant()) {
if (listener != null) {
listener.restart();
}
}
}

j_btnRemotePrt.setVisible(m_App.hasPermission("sales.PrintKitchen"));
if (m_App.hasPermission("sales.PrintRemote")) {
j_btnRemotePrt.setEnabled(true);
} else {
j_btnRemotePrt.setEnabled(false);
}
j_btnRemotePrt.setVisible(m_App.hasPermission("sales.PrintRemote"));
j_btnRemotePrt.setEnabled(m_App.hasPermission("sales.PrintRemote"));

if (!m_oTicket.getOldTicket()) {
restDB.setTicketIdInTable(m_oTicket.getId(), m_oTicketExt);
}
if (!m_oTicket.getOldTicket()) {
restDB.setTicketIdInTable(m_oTicket.getId(), m_oTicketExt);
}

if (Boolean.parseBoolean(m_App.getProperties().getProperty("table.showcustomerdetails"))) {
if (restDB.getCustomerNameInTable(m_oTicketExt) == null && m_oTicket.getCustomer() != null) {
restDB.setCustomerNameInTable(m_oTicket.getCustomer().toString(), m_oTicketExt);
if (Boolean.parseBoolean(m_App.getProperties().getProperty("table.showcustomerdetails"))) {
String custname = restDB.getCustomerNameInTable(m_oTicketExt);
if (m_oTicket.getCustomer() != null && (custname == null || custname.isBlank())) {
restDB.setCustomerNameInTable(m_oTicket.getCustomer().getName(), m_oTicketExt);
}
}
}

if (Boolean.parseBoolean(m_App.getProperties().getProperty("table.showwaiterdetails"))) {
String waiter = restDB.getWaiterNameInTable(m_oTicketExt);
if (waiter == null || waiter.isBlank()) {
restDB.setWaiterNameInTable(m_App.getAppUserView().getUser().getName(), m_oTicketExt);
if (Boolean.parseBoolean(m_App.getProperties().getProperty("table.showwaiterdetails"))) {
String waiter = restDB.getWaiterNameInTable(m_oTicketExt);
if (waiter == null || waiter.isBlank()) {
restDB.setWaiterNameInTable(m_App.getAppUserView().getUser().getName(), m_oTicketExt);
}
}
}

if (restDB.getTableMovedFlag(m_oTicket.getId())) {
restDB.moveCustomer(m_oTicketExt, m_oTicket.getId());
if (restDB.getTableMovedFlag(m_oTicket.getId())) {
restDB.moveCustomer(m_oTicketExt, m_oTicket.getId());
}
}
}

if (m_oTicket != null) {
executeEvent(m_oTicket, m_oTicketExt, "ticket.show");
}

refreshTicket();
}

Expand Down

0 comments on commit 3c19b79

Please sign in to comment.